This document outlines the standard development workflow for @oresoftware/linked-queue.
# Install dependencies
npm install
# Compile TypeScript
npx tsc
# Or if npm run build is configured:
npm run buildEdit files in src/ directory:
src/linked-queue.ts- Main queue implementationsrc/iterator.ts- Iterator utilitiessrc/example.ts- Example usage
After making changes to TypeScript files:
npx tscOr use watch mode for automatic recompilation:
npx tsc --watchOr if npm run build is configured:
npm run buildTest your changes:
npm testThis runs all tests in test/src/ using Suman.
Ensure all tests pass:
- 11 JavaScript test files should pass
- TypeScript test files may show execution warnings (expected)
# Stage all changes
git add -A
# Commit with descriptive message
git commit -m "Description of changes"git pushHere's the complete cycle in one flow:
# 1. Install/update dependencies
npm install
# 2. Compile TypeScript
npx tsc
# Or: npm run build
# 3. Run tests
npm test
# 4. If tests pass, commit
git add -A
git commit -m "Your commit message"
git push- Make code changes in
src/ - Run
npx tscornpm run buildto compile - Run
npm testto verify tests pass - Run
npm install --save-dev .to update local package (if needed) - Test both CommonJS and ESM imports work (if ESM is configured)
- Commit changes
- Push to remote
npm testnpx suman test/src/basic-queue.test.jsnode test/src/simple.js
node test/src/basic-queue.test.jsThe fuzz tests run 1,000,000 iterations to stress test the queue:
test/src/basic-queue-fuzz.jstest/src/linked-queue-fuzz.jstest/src/queue-fuzz.js
Expected results:
- ✅ 11 JavaScript tests passing
⚠️ 3 TypeScript files (source files, not executable)
This package supports:
- CommonJS:
require('@oresoftware/linked-queue') - ES Modules:
import {LinkedQueue} from '@oresoftware/linked-queue'(if ESM build is configured)
The exports field in package.json automatically selects the correct format (if configured).
TypeScript compiler performs type checking during compilation:
npx tsc --noEmitThis checks types without generating output files.
Check for linting errors (if configured):
# Check if linter is configured
npm run lint # if available-
Clean previous build:
rm -rf dist/
-
Compile:
npx tsc # Or: npm run build -
Verify output:
ls -la dist/
Use watch mode for continuous compilation:
npx tsc --watchEdit package.json:
{
"version": "2.1.130" // increment version
}After committing version bump:
git tag v2.1.130
git push --tags-
Check compilation errors:
npx tsc
-
Verify test files are in
test/src/ -
Check import paths in test files
-
Ensure
npm run buildcompleted successfully (if configured) -
Run
npm install --save-dev .to update local package -
Check that both
dist/anddist/esm/directories exist (if ESM is configured)
- Check
tsconfig.jsonconfiguration (andtsconfig.esm.jsonif ESM is configured) - Verify all dependencies are installed:
npm install - Check TypeScript version compatibility
- Run
npx tsc --noEmitto check for type errors
- Ensure
dist/directory exists and contains compiled files - Verify
package.jsonmain/types fields point to correct files - Check import paths in consuming code
- Verify
package.jsonhas correctexportsfield (if ESM is configured) - Check
main,module, andtypesfields are set correctly - Ensure
filesfield includesdistdirectory
- Verify
package.jsonhas correctexportsfield (if ESM is configured) - Check
main,module, andtypesfields are set correctly - Ensure
filesfield includesdistdirectory
- Always compile before committing: Run
npx tscto ensure no compilation errors - Run tests before pushing: Ensure
npm testpasses - Write descriptive commit messages: Explain what and why
- Keep tests updated: Update tests when adding new features
- Follow TypeScript best practices: Use proper types, avoid
anywhere possible
| Task | Command |
|---|---|
| Install dependencies | npm install |
| Compile TypeScript | npx tsc |
| Watch mode | npx tsc --watch |
| Run tests | npm test |
| Stage changes | git add -A |
| Commit | git commit -m "message" |
| Push | git push |
The project may use CI/CD. Common checks:
- TypeScript compilation
- Test execution
- Code quality checks
Ensure local development matches CI requirements.