A Chrome extension for converting prices to time worked (and the reverse).
✧ Gives you perspective on what things cost in terms of your time.
- Dynamically calculates how long you need to work to afford something
- Works with multiple currencies and pay frequencies
- Simple but powerful conversion tool
- Node.js (v14+)
- npm (v6+)
- TypeScript (Project uses strict TypeScript configuration)
- Clone the repository
git clone https://github.com/phaedrus/timeismoneycc.git
cd timeismoneycc- Install dependencies
npm install- Install pre-commit hooks
npm run pre-commit:install-hooks- Build project:
npm run build(Compiles TypeScript to JavaScript in thedistdirectory) - Watch for changes:
npm run watch(Automatically recompiles TypeScript on changes) - Run tests:
npm test - Run linting:
npm run lint - Format code:
npm run format - Run TypeScript check:
npm run typecheck - Clean build output:
npm run clean
This project uses pre-commit, post-commit, and pre-push hooks:
- Format code with Prettier
- Run ESLint and Stylelint with --fix options
- Run TypeScript type checking
- Run tests
- Prevent commit of sensitive data and large files
- Run
glance ./asynchronously to analyze the project - Check if documentation needs updating based on changed files
- Run complete test suite
- Validate branch naming convention (see CONTRIBUTING.md for naming guidelines)
This project uses GitHub Actions for CI to ensure code quality. The CI pipeline runs automatically on pull requests and pushes to the master branch.
The CI pipeline enforces the following quality gates:
- Lint: ESLint, CSS linting, Prettier formatting, and HTML validation
- TypeScript: Static type checking with TypeScript
- Tests: Jest tests with coverage requirements
- Security: npm audit for high and critical vulnerabilities
All quality gates must pass for a PR to be mergeable when branch protection rules are enabled.
The project follows a TypeScript-first approach:
scripts.ts: Main TypeScript source file for the extension's functionalitydist/scripts.js: Compiled JavaScript output (generated from TypeScript)tests/scripts.test.ts: TypeScript unit tests
Run these commands locally before pushing to avoid CI failures:
# First build the project
npm run build
# Then run all checks
npm run lint:all
npm run typecheck
npm test -- --coverage
npm audit --audit-level=high- Build failures: Make sure TypeScript compiles successfully with
npm run build. - Lint failures: Look for ESLint or Prettier errors in the logs. Fix with
npm run lint:fix:all. - TypeScript errors: Check the error message for file and line information. Fix type issues accordingly.
- Test failures: Run tests locally with
npm testto debug. Check for broken assertions or coverage issues. - Security issues: npm audit will show specific packages with vulnerabilities. Update or replace affected dependencies.
Detailed CI test procedures are documented in CI-TEST-PLAN.md.
This project is licensed under the MIT License - see the LICENSE file for details.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.