diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ec85fd..5c0151c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,15 +252,8 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' permissions: contents: write - pull-requests: write id-token: write steps: - - uses: googleapis/release-please-action@v4 - id: release - with: - token: ${{ secrets.GITHUB_TOKEN }} - skip-github-pull-request: true - - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -287,15 +280,26 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish to npm (stable) - if: steps.release.outputs.release_created == 'true' + - name: Check if version exists on npm + id: check run: | CURRENT_VERSION=$(node -p "require('./package.json').version") - echo "Publishing stable version: $CURRENT_VERSION" + echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + if npm view @mrmeaow/tsinject@$CURRENT_VERSION version &>/dev/null; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi + + - name: Publish to npm (stable) + if: steps.check.outputs.exists == 'false' + run: | + echo "Publishing @mrmeaow/tsinject@${{ steps.check.outputs.version }} to npm" npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish to JSR (stable) - if: steps.release.outputs.release_created == 'true' - run: npx jsr publish --allow-dirty + run: | + echo "Publishing @mrmeaow/tsinject@${{ steps.check.outputs.version }} to JSR" + npx jsr publish --allow-dirty diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c2b929b..484cfe6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1 @@ -{ - ".": "0.2.0-dev.0" -} +{ ".": "1.0.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e58b5b..66e50bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,24 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.2.0-dev.0] - 2026-04-10 +## [1.0.0] - 2026-04-10 ### Added -- Initial implementation of tsinject DI container (renamed from tsneedle) -- Token system with branded types -- Container with registration methods (registerClass, registerFactory, registerValue, registerSingleton) +- Token system with branded types for compile-time safety +- Container with registration methods (registerClass, registerFactory, registerValue, registerAlias) - Lifecycle management (Transient, Singleton, Scoped) -- Sync and async resolution +- Sync and async resolution with full context injection - Circular dependency detection - Decorators: @injectable, @singleton, @scoped, @inject, @optional, @lazy, @postConstruct, @preDestroy -- Metadata registry for decorator storage -- Hierarchical container scoping -- Module loading (defineModule, container.load) +- Metadata registry for decorator storage via Symbol.metadata +- Hierarchical container scoping with parent-child relationships +- Module loading (defineModule, container.load) with imports - Container disposal with lifecycle hooks - Optional reflect-metadata integration - commitlint with conventional commits - husky for git hooks -- GitHub Actions CI pipeline +- GitHub Actions CI pipeline with multi-node testing - Multi-channel releases (dev, next, stable) ### Features @@ -30,7 +29,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ESM + CJS dual module format - TypeScript 5.2+ Stage 3 decorators - Strong type safety with branded tokens -- Scoped package name: @mrmeaow/tsinject +- Scoped package: @mrmeaow/tsinject -[0.2.0-dev.0]: https://github.com/mrmeaow/tsinject/releases/tag/v0.2.0-dev.0 -[Unreleased]: https://github.com/mrmeaow/tsinject/compare/v0.2.0-dev.0...HEAD +[1.0.0]: https://github.com/mrmeaow/tsinject/releases/tag/v1.0.0 diff --git a/README.md b/README.md index 69b1fd1..c5ea299 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ npm version JSR version CI status - Coverage + Coverage

A sharp, modern, lightweight dependency injection container for TypeScript. Zero runtime dependencies, ESM + CJS support, and strong type safety. diff --git a/V1_RELEASE_PLAN.md b/V1_RELEASE_PLAN.md deleted file mode 100644 index fdf14b6..0000000 --- a/V1_RELEASE_PLAN.md +++ /dev/null @@ -1,115 +0,0 @@ -# v1.0.0 Stable Release Plan - -## Current Status (as of 2026-04-10) - -### Package Info -- **Name**: `@mrmeaow/tsinject` -- **Current Version**: `0.2.0-dev.0` (dev branch) -- **GitHub**: https://github.com/mrmeaow/tsinject -- **npm**: https://www.npmjs.com/package/@mrmeaow/tsinject -- **JSR**: https://jsr.io/@mrmeaow/tsinject - -### Test Coverage -- **Current**: 43.4% -- **Target**: 90%+ -- **Threshold Configured**: 90% (statements, branches, functions, lines) - -### Coverage Breakdown -| Module | Coverage | Status | -|--------|----------|--------| -| binding | 100% | ✅ | -| token | 100% | ✅ | -| modules | 100% | ✅ | -| errors | 98.03% | ✅ | -| container | 39.17% | ⚠️ Needs work | -| metadata | 47.05% | ⚠️ Needs work | -| decorators | 21.1% | ❌ Critical gap | -| context | 6.25% | ❌ Critical gap | -| **Overall** | **43.4%** | ❌ Below target | - -## CI/CD Status - -### Working -- ✅ Multi-node testing (18, 20, 22) -- ✅ TypeScript type checking -- ✅ Biome linting -- ✅ Test coverage reporting -- ✅ ESM/CJS runtime compatibility -- ✅ npm publish (dev tag) with version check -- ✅ JSR publish (dev) with OIDC -- ✅ Semantic versioning (prerelease dev.N) - -### Branch Strategy -``` -main → v1.0.0, v1.1.0, etc. (stable LTS) -dev → v0.2.0-dev.1, v0.2.0-dev.2, etc. (prerelease) -next → v0.3.0-next.1, v0.3.0-next.2, etc. (experimental) -``` - -## Requirements for v1.0.0 - -### 1. Test Coverage ≥ 90% -**Priority: HIGH** - -Uncovered areas needing tests: -- [ ] Container async resolution paths (lines 504-617) -- [ ] All decorators (@injectable, @inject, @singleton, @scoped, @optional, @lazy, @postConstruct, @preDestroy) -- [ ] Metadata registry full coverage -- [ ] Resolution context creation and usage -- [ ] Edge cases and error paths - -### 2. Battle-Testing Checklist -- [ ] Zero critical bugs reported -- [ ] All public APIs have comprehensive tests -- [ ] Edge cases covered (circular deps, missing tokens, async failures) -- [ ] Performance benchmarks acceptable -- [ ] TypeScript strict mode compatibility verified -- [ ] ESM + CJS both fully functional -- [ ] reflect-metadata integration tested - -### 3. Documentation -- [x] README with installation and basic usage -- [x] Comparison table (verified) -- [ ] API documentation (JSDoc complete) -- [ ] Migration guides (if applicable) -- [ ] Advanced usage examples - -### 4. Code Quality -- [x] TypeScript strict mode -- [x] Biome linting passes -- [x] No console warnings -- [x] Zero runtime dependencies -- [x] Tree-shakeable exports - -## Release Process (Once Ready) - -```bash -# 1. Ensure dev branch is stable -git checkout dev -git push origin dev - -# 2. Merge to main via PR -git checkout main -git merge dev -git push origin main - -# 3. release-please will: -# - Bump version to 1.0.0 -# - Update CHANGELOG.md -# - Create GitHub release -# - Trigger CI to publish to npm (latest tag) -# - Trigger CI to publish to JSR (latest) -``` - -## Timeline Estimate -- **Coverage to 90%**: ~2-3 days of focused test writing -- **Battle-testing**: ~1-2 weeks of real-world usage -- **Documentation**: ~1 day -- **Total**: ~2-4 weeks from current state - -## Next Steps -1. **Write comprehensive tests** for uncovered modules -2. **Run coverage** after each test batch -3. **Fix any bugs** discovered during testing -4. **Update docs** with real-world examples -5. **Merge to main** when all criteria met diff --git a/jsr.json b/jsr.json index 3f1a506..04f8acb 100644 --- a/jsr.json +++ b/jsr.json @@ -1,8 +1,6 @@ { "name": "@mrmeaow/tsinject", - "version": "0.2.1-dev.0", + "version": "1.0.1", "exports": "./dist/index.js", - "publish": { - "include": ["dist", "LICENSE", "README.md"] - } + "publish": { "include": ["dist", "LICENSE", "README.md"] } } diff --git a/package.json b/package.json index ff2951c..b3206e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mrmeaow/tsinject", - "version": "0.2.0-dev.0", + "version": "1.0.0", "description": "A sharp, modern, lightweight dependency injection container for TypeScript — ESM + CJS, zero dependencies, runtime-agnostic", "type": "module", "main": "./dist/index.cjs",