intershell 0.3.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -202
- package/dist/affected/affected.d.ts.map +1 -0
- package/dist/affected/affected.js.map +1 -0
- package/dist/affected/affected.test.d.ts.map +1 -0
- package/dist/affected/affected.test.js.map +1 -0
- package/dist/affected/index.d.ts.map +1 -0
- package/dist/affected/index.js.map +1 -0
- package/dist/branch/branch.d.ts.map +1 -0
- package/dist/{entities/branch → branch}/branch.js +12 -5
- package/dist/branch/branch.js.map +1 -0
- package/dist/branch/branch.test.d.ts.map +1 -0
- package/dist/{entities/branch → branch}/branch.test.js +55 -0
- package/dist/branch/branch.test.js.map +1 -0
- package/dist/branch/branch.types.d.ts.map +1 -0
- package/dist/branch/branch.types.js.map +1 -0
- package/dist/branch/index.d.ts.map +1 -0
- package/dist/branch/index.js.map +1 -0
- package/dist/commit/commit.d.ts.map +1 -0
- package/dist/{entities/commit → commit}/commit.js +12 -6
- package/dist/commit/commit.js.map +1 -0
- package/dist/commit/commit.test.d.ts.map +1 -0
- package/dist/{entities/commit → commit}/commit.test.js +87 -0
- package/dist/commit/commit.test.js.map +1 -0
- package/dist/commit/commit.types.d.ts.map +1 -0
- package/dist/commit/commit.types.js.map +1 -0
- package/dist/commit/index.d.ts.map +1 -0
- package/dist/commit/index.js.map +1 -0
- package/dist/commit/pr.d.ts.map +1 -0
- package/dist/commit/pr.js.map +1 -0
- package/dist/commit/pr.test.d.ts.map +1 -0
- package/dist/commit/pr.test.js.map +1 -0
- package/dist/commit-check.d.ts +2 -0
- package/dist/commit-check.d.ts.map +1 -0
- package/dist/commit-check.js +119 -0
- package/dist/commit-check.js.map +1 -0
- package/dist/compose/compose.d.ts.map +1 -0
- package/dist/compose/compose.js.map +1 -0
- package/dist/compose/compose.test.d.ts.map +1 -0
- package/dist/compose/compose.test.js.map +1 -0
- package/dist/compose/compose.types.d.ts.map +1 -0
- package/dist/compose/compose.types.js.map +1 -0
- package/dist/compose/index.d.ts.map +1 -0
- package/dist/compose/index.js.map +1 -0
- package/dist/{entities/entities.shell.d.ts → entities.shell.d.ts} +1 -0
- package/dist/entities.shell.d.ts.map +1 -0
- package/dist/{entities/entities.shell.js → entities.shell.js} +1 -0
- package/dist/entities.shell.js.map +1 -0
- package/dist/entities.shell.test.d.ts.map +1 -0
- package/dist/entities.shell.test.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/intershell-config/intershell-config.d.ts.map +1 -0
- package/dist/{entities/intershell-config → intershell-config}/intershell-config.default.d.ts +1 -1
- package/dist/intershell-config/intershell-config.default.d.ts.map +1 -0
- package/dist/{entities/intershell-config → intershell-config}/intershell-config.default.js +1 -8
- package/dist/intershell-config/intershell-config.default.js.map +1 -0
- package/dist/{entities/intershell-config → intershell-config}/intershell-config.js +14 -3
- package/dist/intershell-config/intershell-config.js.map +1 -0
- package/dist/intershell-config/intershell-config.test.d.ts.map +1 -0
- package/dist/intershell-config/intershell-config.test.js.map +1 -0
- package/dist/{entities/intershell-config → intershell-config}/intershell-config.types.d.ts +3 -3
- package/dist/intershell-config/intershell-config.types.d.ts.map +1 -0
- package/dist/intershell-config/intershell-config.types.js.map +1 -0
- package/dist/package/index.d.ts.map +1 -0
- package/dist/package/index.js.map +1 -0
- package/dist/package/package.d.ts.map +1 -0
- package/dist/package/package.js.map +1 -0
- package/dist/package/package.shell.d.ts.map +1 -0
- package/dist/package/package.shell.js.map +1 -0
- package/dist/package/package.test.d.ts.map +1 -0
- package/dist/package/package.test.js.map +1 -0
- package/dist/package/package.types.d.ts.map +1 -0
- package/dist/package/package.types.js.map +1 -0
- package/dist/package-changelog/index.d.ts.map +1 -0
- package/dist/package-changelog/index.js.map +1 -0
- package/dist/package-changelog/package-changelog.d.ts.map +1 -0
- package/dist/package-changelog/package-changelog.js.map +1 -0
- package/dist/package-changelog/package-changelog.types.d.ts.map +1 -0
- package/dist/package-changelog/package-changelog.types.js.map +1 -0
- package/dist/package-changelog/template.d.ts.map +1 -0
- package/dist/package-changelog/template.default.d.ts.map +1 -0
- package/dist/package-changelog/template.default.js.map +1 -0
- package/dist/package-changelog/template.js.map +1 -0
- package/dist/package-commits/dependency-analyzer.d.ts.map +1 -0
- package/dist/package-commits/dependency-analyzer.js.map +1 -0
- package/dist/package-commits/dependency-analyzer.test.d.ts.map +1 -0
- package/dist/package-commits/dependency-analyzer.test.js.map +1 -0
- package/dist/package-commits/index.d.ts.map +1 -0
- package/dist/package-commits/index.js.map +1 -0
- package/dist/package-commits/package-commits.d.ts.map +1 -0
- package/dist/package-commits/package-commits.js.map +1 -0
- package/dist/package-commits/package-commits.test.d.ts.map +1 -0
- package/dist/package-commits/package-commits.test.js.map +1 -0
- package/dist/package-tags/index.d.ts.map +1 -0
- package/dist/package-tags/index.js.map +1 -0
- package/dist/{entities/package-tags → package-tags}/package-tags.d.ts +1 -1
- package/dist/package-tags/package-tags.d.ts.map +1 -0
- package/dist/{entities/package-tags → package-tags}/package-tags.js +2 -3
- package/dist/package-tags/package-tags.js.map +1 -0
- package/dist/package-tags/package-tags.test.d.ts.map +1 -0
- package/dist/package-tags/package-tags.test.js.map +1 -0
- package/dist/package-version/index.d.ts.map +1 -0
- package/dist/package-version/index.js.map +1 -0
- package/dist/package-version/package-version.d.ts.map +1 -0
- package/dist/package-version/package-version.js.map +1 -0
- package/dist/package-version/package-version.test.d.ts.map +1 -0
- package/dist/package-version/package-version.test.js.map +1 -0
- package/dist/package-version/package-version.types.d.ts.map +1 -0
- package/dist/package-version/package-version.types.js.map +1 -0
- package/dist/tag/index.d.ts.map +1 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/{entities/tag → tag}/tag.js +12 -3
- package/dist/tag/tag.js.map +1 -0
- package/dist/tag/tag.test.d.ts.map +1 -0
- package/dist/tag/tag.test.js.map +1 -0
- package/dist/tag/tag.types.d.ts.map +1 -0
- package/dist/tag/tag.types.js.map +1 -0
- package/docs/1_ENTITIES.md +62 -0
- package/package.json +31 -46
- package/src/{entities/branch → branch}/branch.test.ts +64 -3
- package/src/{entities/branch → branch}/branch.ts +13 -5
- package/src/{entities/commit → commit}/commit.test.ts +100 -0
- package/src/{entities/commit → commit}/commit.ts +15 -5
- package/src/commit-check.ts +138 -0
- package/src/{entities/entities.shell.ts → entities.shell.ts} +2 -0
- package/src/index.ts +11 -7
- package/src/{entities/intershell-config → intershell-config}/intershell-config.default.ts +1 -8
- package/src/{entities/intershell-config → intershell-config}/intershell-config.ts +17 -3
- package/src/{entities/intershell-config → intershell-config}/intershell-config.types.ts +3 -3
- package/src/{entities/package-tags → package-tags}/package-tags.ts +2 -3
- package/src/{entities/tag → tag}/tag.ts +13 -3
- package/dist/commands/ci/act.d.ts +0 -13
- package/dist/commands/ci/act.d.ts.map +0 -1
- package/dist/commands/ci/act.js +0 -89
- package/dist/commands/ci/act.js.map +0 -1
- package/dist/commands/ci/attach-affected.d.ts +0 -12
- package/dist/commands/ci/attach-affected.d.ts.map +0 -1
- package/dist/commands/ci/attach-affected.js +0 -83
- package/dist/commands/ci/attach-affected.js.map +0 -1
- package/dist/commands/ci/attach-service-ports.d.ts +0 -10
- package/dist/commands/ci/attach-service-ports.d.ts.map +0 -1
- package/dist/commands/ci/attach-service-ports.js +0 -25
- package/dist/commands/ci/attach-service-ports.js.map +0 -1
- package/dist/commands/commit-check.d.ts +0 -13
- package/dist/commands/commit-check.d.ts.map +0 -1
- package/dist/commands/commit-check.js +0 -110
- package/dist/commands/commit-check.js.map +0 -1
- package/dist/commands/commit.d.ts +0 -16
- package/dist/commands/commit.d.ts.map +0 -1
- package/dist/commands/commit.js +0 -91
- package/dist/commands/commit.js.map +0 -1
- package/dist/commands/dev/check.d.ts +0 -13
- package/dist/commands/dev/check.d.ts.map +0 -1
- package/dist/commands/dev/check.js +0 -91
- package/dist/commands/dev/check.js.map +0 -1
- package/dist/commands/dev/cleanup.d.ts +0 -10
- package/dist/commands/dev/cleanup.d.ts.map +0 -1
- package/dist/commands/dev/cleanup.js +0 -28
- package/dist/commands/dev/cleanup.js.map +0 -1
- package/dist/commands/dev/rm.d.ts +0 -12
- package/dist/commands/dev/rm.d.ts.map +0 -1
- package/dist/commands/dev/rm.js +0 -49
- package/dist/commands/dev/rm.js.map +0 -1
- package/dist/commands/dev/setup.d.ts +0 -10
- package/dist/commands/dev/setup.d.ts.map +0 -1
- package/dist/commands/dev/setup.js +0 -40
- package/dist/commands/dev/setup.js.map +0 -1
- package/dist/commands/local/cleanup.d.ts +0 -12
- package/dist/commands/local/cleanup.d.ts.map +0 -1
- package/dist/commands/local/cleanup.js +0 -62
- package/dist/commands/local/cleanup.js.map +0 -1
- package/dist/commands/local/setup.d.ts +0 -11
- package/dist/commands/local/setup.d.ts.map +0 -1
- package/dist/commands/local/setup.js +0 -55
- package/dist/commands/local/setup.js.map +0 -1
- package/dist/commands/local/vscode.d.ts +0 -17
- package/dist/commands/local/vscode.d.ts.map +0 -1
- package/dist/commands/local/vscode.js +0 -94
- package/dist/commands/local/vscode.js.map +0 -1
- package/dist/commands/update-package-json.d.ts +0 -12
- package/dist/commands/update-package-json.d.ts.map +0 -1
- package/dist/commands/update-package-json.js +0 -82
- package/dist/commands/update-package-json.js.map +0 -1
- package/dist/commands/version/apply.d.ts +0 -16
- package/dist/commands/version/apply.d.ts.map +0 -1
- package/dist/commands/version/apply.js +0 -120
- package/dist/commands/version/apply.js.map +0 -1
- package/dist/commands/version/ci.d.ts +0 -12
- package/dist/commands/version/ci.d.ts.map +0 -1
- package/dist/commands/version/ci.js +0 -67
- package/dist/commands/version/ci.js.map +0 -1
- package/dist/commands/version/prepare.d.ts +0 -19
- package/dist/commands/version/prepare.d.ts.map +0 -1
- package/dist/commands/version/prepare.js +0 -158
- package/dist/commands/version/prepare.js.map +0 -1
- package/dist/core/colorify.d.ts +0 -21
- package/dist/core/colorify.d.ts.map +0 -1
- package/dist/core/colorify.js +0 -56
- package/dist/core/colorify.js.map +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -3
- package/dist/core/index.js.map +0 -1
- package/dist/core/types.d.ts +0 -181
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -5
- package/dist/core/types.js.map +0 -1
- package/dist/core/wrapshell.d.ts +0 -19
- package/dist/core/wrapshell.d.ts.map +0 -1
- package/dist/core/wrapshell.js +0 -323
- package/dist/core/wrapshell.js.map +0 -1
- package/dist/entities/affected/affected.d.ts.map +0 -1
- package/dist/entities/affected/affected.js.map +0 -1
- package/dist/entities/affected/affected.test.d.ts.map +0 -1
- package/dist/entities/affected/affected.test.js.map +0 -1
- package/dist/entities/affected/index.d.ts.map +0 -1
- package/dist/entities/affected/index.js.map +0 -1
- package/dist/entities/branch/branch.d.ts.map +0 -1
- package/dist/entities/branch/branch.js.map +0 -1
- package/dist/entities/branch/branch.test.d.ts.map +0 -1
- package/dist/entities/branch/branch.test.js.map +0 -1
- package/dist/entities/branch/branch.types.d.ts.map +0 -1
- package/dist/entities/branch/branch.types.js.map +0 -1
- package/dist/entities/branch/index.d.ts.map +0 -1
- package/dist/entities/branch/index.js.map +0 -1
- package/dist/entities/commit/commit.d.ts.map +0 -1
- package/dist/entities/commit/commit.js.map +0 -1
- package/dist/entities/commit/commit.test.d.ts.map +0 -1
- package/dist/entities/commit/commit.test.js.map +0 -1
- package/dist/entities/commit/commit.types.d.ts.map +0 -1
- package/dist/entities/commit/commit.types.js.map +0 -1
- package/dist/entities/commit/index.d.ts.map +0 -1
- package/dist/entities/commit/index.js.map +0 -1
- package/dist/entities/commit/pr.d.ts.map +0 -1
- package/dist/entities/commit/pr.js.map +0 -1
- package/dist/entities/commit/pr.test.d.ts.map +0 -1
- package/dist/entities/commit/pr.test.js.map +0 -1
- package/dist/entities/compose/compose.d.ts.map +0 -1
- package/dist/entities/compose/compose.js.map +0 -1
- package/dist/entities/compose/compose.test.d.ts.map +0 -1
- package/dist/entities/compose/compose.test.js.map +0 -1
- package/dist/entities/compose/compose.types.d.ts.map +0 -1
- package/dist/entities/compose/compose.types.js.map +0 -1
- package/dist/entities/compose/index.d.ts.map +0 -1
- package/dist/entities/compose/index.js.map +0 -1
- package/dist/entities/entities.shell.d.ts.map +0 -1
- package/dist/entities/entities.shell.js.map +0 -1
- package/dist/entities/entities.shell.test.d.ts.map +0 -1
- package/dist/entities/entities.shell.test.js.map +0 -1
- package/dist/entities/index.d.ts +0 -12
- package/dist/entities/index.d.ts.map +0 -1
- package/dist/entities/index.js +0 -12
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/intershell-config/intershell-config.d.ts.map +0 -1
- package/dist/entities/intershell-config/intershell-config.default.d.ts.map +0 -1
- package/dist/entities/intershell-config/intershell-config.default.js.map +0 -1
- package/dist/entities/intershell-config/intershell-config.js.map +0 -1
- package/dist/entities/intershell-config/intershell-config.test.d.ts.map +0 -1
- package/dist/entities/intershell-config/intershell-config.test.js.map +0 -1
- package/dist/entities/intershell-config/intershell-config.types.d.ts.map +0 -1
- package/dist/entities/intershell-config/intershell-config.types.js.map +0 -1
- package/dist/entities/package/index.d.ts.map +0 -1
- package/dist/entities/package/index.js.map +0 -1
- package/dist/entities/package/package.d.ts.map +0 -1
- package/dist/entities/package/package.js.map +0 -1
- package/dist/entities/package/package.shell.d.ts.map +0 -1
- package/dist/entities/package/package.shell.js.map +0 -1
- package/dist/entities/package/package.test.d.ts.map +0 -1
- package/dist/entities/package/package.test.js.map +0 -1
- package/dist/entities/package/package.types.d.ts.map +0 -1
- package/dist/entities/package/package.types.js.map +0 -1
- package/dist/entities/package-changelog/index.d.ts.map +0 -1
- package/dist/entities/package-changelog/index.js.map +0 -1
- package/dist/entities/package-changelog/package-changelog.d.ts.map +0 -1
- package/dist/entities/package-changelog/package-changelog.js.map +0 -1
- package/dist/entities/package-changelog/package-changelog.types.d.ts.map +0 -1
- package/dist/entities/package-changelog/package-changelog.types.js.map +0 -1
- package/dist/entities/package-changelog/template.d.ts.map +0 -1
- package/dist/entities/package-changelog/template.default.d.ts.map +0 -1
- package/dist/entities/package-changelog/template.default.js.map +0 -1
- package/dist/entities/package-changelog/template.js.map +0 -1
- package/dist/entities/package-commits/dependency-analyzer.d.ts.map +0 -1
- package/dist/entities/package-commits/dependency-analyzer.js.map +0 -1
- package/dist/entities/package-commits/dependency-analyzer.test.d.ts.map +0 -1
- package/dist/entities/package-commits/dependency-analyzer.test.js.map +0 -1
- package/dist/entities/package-commits/index.d.ts.map +0 -1
- package/dist/entities/package-commits/index.js.map +0 -1
- package/dist/entities/package-commits/package-commits.d.ts.map +0 -1
- package/dist/entities/package-commits/package-commits.js.map +0 -1
- package/dist/entities/package-commits/package-commits.test.d.ts.map +0 -1
- package/dist/entities/package-commits/package-commits.test.js.map +0 -1
- package/dist/entities/package-tags/index.d.ts.map +0 -1
- package/dist/entities/package-tags/index.js.map +0 -1
- package/dist/entities/package-tags/package-tags.d.ts.map +0 -1
- package/dist/entities/package-tags/package-tags.js.map +0 -1
- package/dist/entities/package-tags/package-tags.test.d.ts.map +0 -1
- package/dist/entities/package-tags/package-tags.test.js.map +0 -1
- package/dist/entities/package-version/index.d.ts.map +0 -1
- package/dist/entities/package-version/index.js.map +0 -1
- package/dist/entities/package-version/package-version.d.ts.map +0 -1
- package/dist/entities/package-version/package-version.js.map +0 -1
- package/dist/entities/package-version/package-version.test.d.ts.map +0 -1
- package/dist/entities/package-version/package-version.test.js.map +0 -1
- package/dist/entities/package-version/package-version.types.d.ts.map +0 -1
- package/dist/entities/package-version/package-version.types.js.map +0 -1
- package/dist/entities/tag/index.d.ts.map +0 -1
- package/dist/entities/tag/index.js.map +0 -1
- package/dist/entities/tag/tag.d.ts.map +0 -1
- package/dist/entities/tag/tag.js.map +0 -1
- package/dist/entities/tag/tag.test.d.ts.map +0 -1
- package/dist/entities/tag/tag.test.js.map +0 -1
- package/dist/entities/tag/tag.types.d.ts.map +0 -1
- package/dist/entities/tag/tag.types.js.map +0 -1
- package/src/commands/ci/act.ts +0 -95
- package/src/commands/ci/attach-affected.ts +0 -93
- package/src/commands/ci/attach-service-ports.ts +0 -31
- package/src/commands/commit-check.ts +0 -124
- package/src/commands/commit.ts +0 -103
- package/src/commands/dev/check.ts +0 -117
- package/src/commands/dev/cleanup.ts +0 -34
- package/src/commands/dev/rm.ts +0 -66
- package/src/commands/dev/setup.ts +0 -48
- package/src/commands/local/cleanup.ts +0 -74
- package/src/commands/local/setup.ts +0 -68
- package/src/commands/local/vscode.ts +0 -118
- package/src/commands/update-package-json.ts +0 -104
- package/src/commands/version/apply.ts +0 -156
- package/src/commands/version/ci.ts +0 -85
- package/src/commands/version/prepare.ts +0 -223
- package/src/core/colorify.ts +0 -61
- package/src/core/index.ts +0 -3
- package/src/core/types.ts +0 -262
- package/src/core/wrapshell.ts +0 -388
- package/src/entities/index.ts +0 -11
- /package/dist/{entities/affected → affected}/affected.d.ts +0 -0
- /package/dist/{entities/affected → affected}/affected.js +0 -0
- /package/dist/{entities/affected → affected}/affected.test.d.ts +0 -0
- /package/dist/{entities/affected → affected}/affected.test.js +0 -0
- /package/dist/{entities/affected → affected}/index.d.ts +0 -0
- /package/dist/{entities/affected → affected}/index.js +0 -0
- /package/dist/{entities/branch → branch}/branch.d.ts +0 -0
- /package/dist/{entities/branch → branch}/branch.test.d.ts +0 -0
- /package/dist/{entities/branch → branch}/branch.types.d.ts +0 -0
- /package/dist/{entities/branch → branch}/branch.types.js +0 -0
- /package/dist/{entities/branch → branch}/index.d.ts +0 -0
- /package/dist/{entities/branch → branch}/index.js +0 -0
- /package/dist/{entities/commit → commit}/commit.d.ts +0 -0
- /package/dist/{entities/commit → commit}/commit.test.d.ts +0 -0
- /package/dist/{entities/commit → commit}/commit.types.d.ts +0 -0
- /package/dist/{entities/commit → commit}/commit.types.js +0 -0
- /package/dist/{entities/commit → commit}/index.d.ts +0 -0
- /package/dist/{entities/commit → commit}/index.js +0 -0
- /package/dist/{entities/commit → commit}/pr.d.ts +0 -0
- /package/dist/{entities/commit → commit}/pr.js +0 -0
- /package/dist/{entities/commit → commit}/pr.test.d.ts +0 -0
- /package/dist/{entities/commit → commit}/pr.test.js +0 -0
- /package/dist/{entities/compose → compose}/compose.d.ts +0 -0
- /package/dist/{entities/compose → compose}/compose.js +0 -0
- /package/dist/{entities/compose → compose}/compose.test.d.ts +0 -0
- /package/dist/{entities/compose → compose}/compose.test.js +0 -0
- /package/dist/{entities/compose → compose}/compose.types.d.ts +0 -0
- /package/dist/{entities/compose → compose}/compose.types.js +0 -0
- /package/dist/{entities/compose → compose}/index.d.ts +0 -0
- /package/dist/{entities/compose → compose}/index.js +0 -0
- /package/dist/{entities/entities.shell.test.d.ts → entities.shell.test.d.ts} +0 -0
- /package/dist/{entities/entities.shell.test.js → entities.shell.test.js} +0 -0
- /package/dist/{entities/intershell-config → intershell-config}/intershell-config.d.ts +0 -0
- /package/dist/{entities/intershell-config → intershell-config}/intershell-config.test.d.ts +0 -0
- /package/dist/{entities/intershell-config → intershell-config}/intershell-config.test.js +0 -0
- /package/dist/{entities/intershell-config → intershell-config}/intershell-config.types.js +0 -0
- /package/dist/{entities/package → package}/index.d.ts +0 -0
- /package/dist/{entities/package → package}/index.js +0 -0
- /package/dist/{entities/package → package}/package.d.ts +0 -0
- /package/dist/{entities/package → package}/package.js +0 -0
- /package/dist/{entities/package → package}/package.shell.d.ts +0 -0
- /package/dist/{entities/package → package}/package.shell.js +0 -0
- /package/dist/{entities/package → package}/package.test.d.ts +0 -0
- /package/dist/{entities/package → package}/package.test.js +0 -0
- /package/dist/{entities/package → package}/package.types.d.ts +0 -0
- /package/dist/{entities/package → package}/package.types.js +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/index.d.ts +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/index.js +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/package-changelog.d.ts +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/package-changelog.js +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/package-changelog.types.d.ts +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/package-changelog.types.js +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/template.d.ts +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/template.default.d.ts +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/template.default.js +0 -0
- /package/dist/{entities/package-changelog → package-changelog}/template.js +0 -0
- /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.d.ts +0 -0
- /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.js +0 -0
- /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.test.d.ts +0 -0
- /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.test.js +0 -0
- /package/dist/{entities/package-commits → package-commits}/index.d.ts +0 -0
- /package/dist/{entities/package-commits → package-commits}/index.js +0 -0
- /package/dist/{entities/package-commits → package-commits}/package-commits.d.ts +0 -0
- /package/dist/{entities/package-commits → package-commits}/package-commits.js +0 -0
- /package/dist/{entities/package-commits → package-commits}/package-commits.test.d.ts +0 -0
- /package/dist/{entities/package-commits → package-commits}/package-commits.test.js +0 -0
- /package/dist/{entities/package-tags → package-tags}/index.d.ts +0 -0
- /package/dist/{entities/package-tags → package-tags}/index.js +0 -0
- /package/dist/{entities/package-tags → package-tags}/package-tags.test.d.ts +0 -0
- /package/dist/{entities/package-tags → package-tags}/package-tags.test.js +0 -0
- /package/dist/{entities/package-version → package-version}/index.d.ts +0 -0
- /package/dist/{entities/package-version → package-version}/index.js +0 -0
- /package/dist/{entities/package-version → package-version}/package-version.d.ts +0 -0
- /package/dist/{entities/package-version → package-version}/package-version.js +0 -0
- /package/dist/{entities/package-version → package-version}/package-version.test.d.ts +0 -0
- /package/dist/{entities/package-version → package-version}/package-version.test.js +0 -0
- /package/dist/{entities/package-version → package-version}/package-version.types.d.ts +0 -0
- /package/dist/{entities/package-version → package-version}/package-version.types.js +0 -0
- /package/dist/{entities/tag → tag}/index.d.ts +0 -0
- /package/dist/{entities/tag → tag}/index.js +0 -0
- /package/dist/{entities/tag → tag}/tag.d.ts +0 -0
- /package/dist/{entities/tag → tag}/tag.test.d.ts +0 -0
- /package/dist/{entities/tag → tag}/tag.test.js +0 -0
- /package/dist/{entities/tag → tag}/tag.types.d.ts +0 -0
- /package/dist/{entities/tag → tag}/tag.types.js +0 -0
- /package/src/{entities/affected → affected}/affected.test.ts +0 -0
- /package/src/{entities/affected → affected}/affected.ts +0 -0
- /package/src/{entities/affected → affected}/index.ts +0 -0
- /package/src/{entities/branch → branch}/branch.types.ts +0 -0
- /package/src/{entities/branch → branch}/index.ts +0 -0
- /package/src/{entities/commit → commit}/commit.types.ts +0 -0
- /package/src/{entities/commit → commit}/index.ts +0 -0
- /package/src/{entities/commit → commit}/pr.test.ts +0 -0
- /package/src/{entities/commit → commit}/pr.ts +0 -0
- /package/src/{entities/compose → compose}/compose.test.ts +0 -0
- /package/src/{entities/compose → compose}/compose.ts +0 -0
- /package/src/{entities/compose → compose}/compose.types.ts +0 -0
- /package/src/{entities/compose → compose}/index.ts +0 -0
- /package/src/{entities/entities.shell.test.ts → entities.shell.test.ts} +0 -0
- /package/src/{entities/intershell-config → intershell-config}/intershell-config.test.ts +0 -0
- /package/src/{entities/package → package}/index.ts +0 -0
- /package/src/{entities/package → package}/package.shell.ts +0 -0
- /package/src/{entities/package → package}/package.test.ts +0 -0
- /package/src/{entities/package → package}/package.ts +0 -0
- /package/src/{entities/package → package}/package.types.ts +0 -0
- /package/src/{entities/package-changelog → package-changelog}/index.ts +0 -0
- /package/src/{entities/package-changelog → package-changelog}/package-changelog.ts +0 -0
- /package/src/{entities/package-changelog → package-changelog}/package-changelog.types.ts +0 -0
- /package/src/{entities/package-changelog → package-changelog}/template.default.ts +0 -0
- /package/src/{entities/package-changelog → package-changelog}/template.ts +0 -0
- /package/src/{entities/package-commits → package-commits}/dependency-analyzer.test.ts +0 -0
- /package/src/{entities/package-commits → package-commits}/dependency-analyzer.ts +0 -0
- /package/src/{entities/package-commits → package-commits}/index.ts +0 -0
- /package/src/{entities/package-commits → package-commits}/package-commits.test.ts +0 -0
- /package/src/{entities/package-commits → package-commits}/package-commits.ts +0 -0
- /package/src/{entities/package-tags → package-tags}/index.ts +0 -0
- /package/src/{entities/package-tags → package-tags}/package-tags.test.ts +0 -0
- /package/src/{entities/package-version → package-version}/index.ts +0 -0
- /package/src/{entities/package-version → package-version}/package-version.test.ts +0 -0
- /package/src/{entities/package-version → package-version}/package-version.ts +0 -0
- /package/src/{entities/package-version → package-version}/package-version.types.ts +0 -0
- /package/src/{entities/tag → tag}/index.ts +0 -0
- /package/src/{entities/tag → tag}/tag.test.ts +0 -0
- /package/src/{entities/tag → tag}/tag.types.ts +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Command, Flags } from "@oclif/core";
|
|
2
|
-
import { $ } from "bun";
|
|
3
|
-
import { colorify } from "../../core";
|
|
4
|
-
import { EntityTag } from "../../entities";
|
|
5
|
-
|
|
6
|
-
export default class VersionCi extends Command {
|
|
7
|
-
static description = "Complete CI versioning workflow: auth → prepare → apply";
|
|
8
|
-
|
|
9
|
-
static examples = [
|
|
10
|
-
"intershell version:ci",
|
|
11
|
-
"intershell version:ci --dry-run",
|
|
12
|
-
"intershell version:ci --no-push",
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
static flags = {
|
|
16
|
-
"no-push": Flags.boolean({
|
|
17
|
-
char: "n",
|
|
18
|
-
description: "Don't push tag to remote after creation",
|
|
19
|
-
default: false,
|
|
20
|
-
}),
|
|
21
|
-
"dry-run": Flags.boolean({
|
|
22
|
-
char: "d",
|
|
23
|
-
description: "Show planned changes without applying them",
|
|
24
|
-
default: false,
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
async run(): Promise<void> {
|
|
29
|
-
const { flags } = await this.parse(VersionCi);
|
|
30
|
-
this.log("🚀 Starting CI version workflow...");
|
|
31
|
-
|
|
32
|
-
await this.configureGitAuth(flags);
|
|
33
|
-
|
|
34
|
-
const fromTag = await EntityTag.getBaseCommitSha();
|
|
35
|
-
this.log(`📝 Using base commit: ${colorify.blue(fromTag)}`);
|
|
36
|
-
|
|
37
|
-
this.log("\n🔧 Preparing versions...");
|
|
38
|
-
// Note: In a real implementation, you would call the prepare command here
|
|
39
|
-
// For now, we'll just show what would happen
|
|
40
|
-
this.log(`📝 Would run: intershell version:prepare --from ${fromTag}`);
|
|
41
|
-
|
|
42
|
-
this.log("\n🚀 Applying version changes...");
|
|
43
|
-
// Note: In a real implementation, you would call the apply command here
|
|
44
|
-
// For now, we'll just show what would happen
|
|
45
|
-
this.log(`📝 Would run: intershell version:apply${flags["no-push"] ? " --no-push" : ""}`);
|
|
46
|
-
|
|
47
|
-
this.log(colorify.green("\n✅ CI version workflow completed successfully!"));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private async configureGitAuth(flags: {
|
|
51
|
-
"dry-run"?: boolean;
|
|
52
|
-
"no-push"?: boolean;
|
|
53
|
-
}): Promise<void> {
|
|
54
|
-
this.log("🔍 Configuring Git authentication...");
|
|
55
|
-
|
|
56
|
-
if (flags["dry-run"]) {
|
|
57
|
-
this.log("-> 🔍 Dry run, skipping git config");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (!process.env.GITHUB_ACTIONS) {
|
|
62
|
-
this.log("-> 🔍 Running locally, skip git config");
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!process.env.GITHUB_REPOSITORY) {
|
|
67
|
-
this.log("-> ⚠️ GITHUB_REPOSITORY not found");
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (!process.env.GITHUB_TOKEN) {
|
|
72
|
-
this.log("-> ⚠️ GITHUB_TOKEN not found");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this.log("-> 🔐 Configuring Git authentication...");
|
|
77
|
-
await $`git config user.name "github-actions[bot]"`;
|
|
78
|
-
await $`git config user.email "github-actions[bot]@users.noreply.github.com"`;
|
|
79
|
-
await $`git remote set-url origin https://x-access-token:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
|
|
80
|
-
|
|
81
|
-
const actualRemoteUrl = await $`git remote get-url origin`.text();
|
|
82
|
-
const maskedUrl = actualRemoteUrl.replace(/https:\/\/x-access-token:[^@]+@/, "***@");
|
|
83
|
-
this.log(`-> 🔗 Git authentication configured, remote URL: ${maskedUrl}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { Command, Flags } from "@oclif/core";
|
|
3
|
-
import { $ } from "bun";
|
|
4
|
-
import { colorify } from "../../core";
|
|
5
|
-
import {
|
|
6
|
-
DefaultChangelogTemplate,
|
|
7
|
-
EntityCompose,
|
|
8
|
-
EntityPackage,
|
|
9
|
-
EntityPackageChangelog,
|
|
10
|
-
EntityPackageCommits,
|
|
11
|
-
EntityPackageTags,
|
|
12
|
-
EntityPackageVersion,
|
|
13
|
-
type EntityPackageVersionBumpType,
|
|
14
|
-
EntityTag,
|
|
15
|
-
} from "../../entities";
|
|
16
|
-
|
|
17
|
-
const bumpTypeOptions = ["major", "minor", "patch", "none"] as EntityPackageVersionBumpType[];
|
|
18
|
-
|
|
19
|
-
export default class VersionPrepare extends Command {
|
|
20
|
-
static description = "Prepare version bumps and generate changelogs for packages";
|
|
21
|
-
|
|
22
|
-
static examples = [
|
|
23
|
-
"intershell version:prepare",
|
|
24
|
-
"intershell version:prepare --package root",
|
|
25
|
-
"intershell version:prepare --from v1.0.0 --to HEAD",
|
|
26
|
-
"intershell version:prepare --from-version 1.0.0 --to-version 1.2.0",
|
|
27
|
-
"intershell version:prepare --package package-name --from-version 1.0.0",
|
|
28
|
-
"intershell version:prepare --package root --bump-type major",
|
|
29
|
-
"intershell version:prepare --bump-type patch",
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
static flags = {
|
|
33
|
-
package: Flags.string({
|
|
34
|
-
char: "p",
|
|
35
|
-
description: "Package name to process (default: all packages)",
|
|
36
|
-
default: "root",
|
|
37
|
-
}),
|
|
38
|
-
from: Flags.string({
|
|
39
|
-
char: "f",
|
|
40
|
-
description: "Start commit/tag for changelog generation",
|
|
41
|
-
}),
|
|
42
|
-
to: Flags.string({
|
|
43
|
-
char: "t",
|
|
44
|
-
description: "End commit/tag for changelog generation (default: HEAD)",
|
|
45
|
-
}),
|
|
46
|
-
"from-version": Flags.string({
|
|
47
|
-
description:
|
|
48
|
-
"Start version for changelog generation (converts to appropriate tag based on package)",
|
|
49
|
-
}),
|
|
50
|
-
"to-version": Flags.string({
|
|
51
|
-
description:
|
|
52
|
-
"End version for changelog generation (converts to appropriate tag based on package)",
|
|
53
|
-
}),
|
|
54
|
-
"bump-type": Flags.string({
|
|
55
|
-
description: "Override version bump type (major, minor, patch, none)",
|
|
56
|
-
options: bumpTypeOptions,
|
|
57
|
-
}),
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
async run(): Promise<void> {
|
|
61
|
-
const { flags } = await this.parse(VersionPrepare);
|
|
62
|
-
const packageName = flags.package || "root";
|
|
63
|
-
|
|
64
|
-
this.log("🔍 Validating package configurations...");
|
|
65
|
-
const validationResult = await EntityPackage.validateAllPackages();
|
|
66
|
-
if (validationResult.length > 0) {
|
|
67
|
-
this.error(
|
|
68
|
-
`❌ Package validation failed!\nFound ${validationResult.length} validation errors:\n${validationResult.map((error) => ` 📦 ${error}`).join("\n")}`,
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
this.log(colorify.green("✅ All packages passed validation"));
|
|
72
|
-
|
|
73
|
-
const allVersionedPackages = await EntityPackage.getVersionedPackages();
|
|
74
|
-
const packageInstance = new EntityPackage(packageName);
|
|
75
|
-
const packageTags = new EntityPackageTags(packageInstance);
|
|
76
|
-
const packageCommits = new EntityPackageCommits(packageInstance);
|
|
77
|
-
const packageVersion = new EntityPackageVersion(packageInstance, packageCommits, packageTags);
|
|
78
|
-
const prefix = packageInstance.getTagSeriesName();
|
|
79
|
-
|
|
80
|
-
if (!allVersionedPackages.includes(packageName)) {
|
|
81
|
-
throw new Error(
|
|
82
|
-
`Package "${packageName}" should not be versioned (private package). Only versioned packages can be processed.`,
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
if (!prefix) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
`Tag series name not found for ${packageName}, this package should not be versioned (private package). Only versioned packages can be processed.`,
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
this.log(`🚀 Starting version preparation for package ${colorify.blue(packageName)}`);
|
|
92
|
-
const { fromCommit, toCommit } = await this.resolveCommitRange({
|
|
93
|
-
packageTags,
|
|
94
|
-
from: flags.from,
|
|
95
|
-
to: flags.to,
|
|
96
|
-
fromVersion: Array.isArray(flags["from-version"])
|
|
97
|
-
? flags["from-version"][0]
|
|
98
|
-
: flags["from-version"],
|
|
99
|
-
toVersion: Array.isArray(flags["to-version"]) ? flags["to-version"][0] : flags["to-version"],
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const from =
|
|
103
|
-
flags.from || flags["from-version"]
|
|
104
|
-
? fromCommit
|
|
105
|
-
: await packageTags.getBaseTagShaForPackage();
|
|
106
|
-
|
|
107
|
-
this.log(`📝 Generating changelog from ${colorify.blue(from)} to ${colorify.blue(toCommit)}`);
|
|
108
|
-
|
|
109
|
-
// Get commits and version data using EntityPackageVersion
|
|
110
|
-
const commits = await packageCommits.getCommitsInRange(from, toCommit);
|
|
111
|
-
const overrideBumpType = flags["bump-type"] as "major" | "minor" | "patch" | "none" | undefined;
|
|
112
|
-
const versionData = await packageVersion.calculateVersionData(commits, overrideBumpType);
|
|
113
|
-
|
|
114
|
-
// Create changelog with commits
|
|
115
|
-
const template = new DefaultChangelogTemplate(packageName, prefix);
|
|
116
|
-
const changelog = new EntityPackageChangelog(packageInstance, commits, {
|
|
117
|
-
template,
|
|
118
|
-
versionData,
|
|
119
|
-
versionMode: true,
|
|
120
|
-
});
|
|
121
|
-
const changelogContent = changelog.generateMergedChangelog();
|
|
122
|
-
|
|
123
|
-
if (commits.length === 0) {
|
|
124
|
-
this.log(colorify.yellow(`📦 ${packageName}: ${colorify.yellow("No commits found")}`));
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (!versionData.shouldBump) {
|
|
128
|
-
this.log(
|
|
129
|
-
colorify.yellow(
|
|
130
|
-
`📦 ${packageName}: ${colorify.yellow("No version bump needed")} (${versionData.bumpType})`,
|
|
131
|
-
),
|
|
132
|
-
);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
this.log(
|
|
137
|
-
`🔄 Updating package version from ${versionData.currentVersion} to ${versionData.targetVersion} in ${packageInstance.getJsonPath()}`,
|
|
138
|
-
);
|
|
139
|
-
await packageInstance.writeVersion(versionData.targetVersion);
|
|
140
|
-
await $`bun install`;
|
|
141
|
-
await packageInstance.writeChangelog(changelogContent);
|
|
142
|
-
|
|
143
|
-
const tagName = `${prefix}${versionData.targetVersion}`;
|
|
144
|
-
const versionCommitMessage = `release(${packageName}): ${tagName} [${versionData.bumpType}] (${versionData.currentVersion} => ${versionData.targetVersion})\n\n📝 Commits processed: ${commits.length}\n📝 Changelog updated: (${packageInstance.getChangelogPath()})`;
|
|
145
|
-
this.log(
|
|
146
|
-
`📦 (${colorify.yellow(versionData.currentVersion)} => ${colorify.green(versionData.targetVersion)}) ${colorify.blue(packageName)}: ${versionData.bumpType} (${colorify.green(packageInstance.getChangelogPath())})`,
|
|
147
|
-
);
|
|
148
|
-
await Bun.write(".git/COMMIT_EDITMSG", versionCommitMessage);
|
|
149
|
-
this.log(
|
|
150
|
-
`${colorify.green("📝 Commit message written in")} ${colorify.blue(".git/COMMIT_EDITMSG")}:`,
|
|
151
|
-
`\n\t${versionCommitMessage.replace(/\n/g, "\n\t")}`,
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
try {
|
|
155
|
-
const services = await new EntityCompose("docker-compose.yml").getServices();
|
|
156
|
-
const servicesToDeploy = services.filter((s) => s.name === packageName).map((s) => s.name);
|
|
157
|
-
if (servicesToDeploy) {
|
|
158
|
-
const servicesToDeployNames = servicesToDeploy.join(",");
|
|
159
|
-
if (process.env.GITHUB_OUTPUT) {
|
|
160
|
-
await fs.promises.appendFile(
|
|
161
|
-
process.env.GITHUB_OUTPUT,
|
|
162
|
-
`packages-to-deploy=${servicesToDeployNames}\n`,
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
this.log(`\n🚀 Packages to deploy: ${colorify.blue(servicesToDeployNames)}`);
|
|
166
|
-
}
|
|
167
|
-
} catch (error) {
|
|
168
|
-
this.log(
|
|
169
|
-
colorify.yellow(`📦 ${packageName}: ${colorify.yellow("No services found")}: ${error}`),
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
this.log(
|
|
174
|
-
"\n📝 Next steps:\n" +
|
|
175
|
-
"1. Review the generated changelogs\n" +
|
|
176
|
-
`2. Run ${colorify.blue("intershell version:apply")} to commit, tag and push the versions (you can turn it off using --no-push)`,
|
|
177
|
-
);
|
|
178
|
-
this.log(colorify.green("✅ Version preparation completed!"));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Resolves from/to commits, handling version-to-tag conversion when needed
|
|
183
|
-
*/
|
|
184
|
-
private async resolveCommitRange({
|
|
185
|
-
packageTags,
|
|
186
|
-
from,
|
|
187
|
-
to,
|
|
188
|
-
fromVersion,
|
|
189
|
-
toVersion,
|
|
190
|
-
}: {
|
|
191
|
-
packageTags: EntityPackageTags;
|
|
192
|
-
from?: string;
|
|
193
|
-
to?: string;
|
|
194
|
-
fromVersion?: string;
|
|
195
|
-
toVersion?: string;
|
|
196
|
-
}): Promise<{ fromCommit: string; toCommit: string }> {
|
|
197
|
-
let fromCommit: string;
|
|
198
|
-
let toCommit: string;
|
|
199
|
-
// Handle --from-version conversion
|
|
200
|
-
if (fromVersion) {
|
|
201
|
-
const fromTag = `${await packageTags.getTagPrefix()}${fromVersion}`;
|
|
202
|
-
this.log(`📝 Converting --from-version ${fromVersion} to tag: ${fromTag}`);
|
|
203
|
-
fromCommit = await EntityTag.getBaseCommitSha(fromTag);
|
|
204
|
-
} else if (from) {
|
|
205
|
-
fromCommit = await EntityTag.getBaseCommitSha(from);
|
|
206
|
-
} else {
|
|
207
|
-
// No --from specified, let EntityPackageTags auto-find the correct base SHA
|
|
208
|
-
// This will use the latest tag if it exists, or fall back to first commit for first-time versioning
|
|
209
|
-
fromCommit = await packageTags.getBaseTagShaForPackage();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Handle --to-version conversion
|
|
213
|
-
if (toVersion) {
|
|
214
|
-
const toTag = `${await packageTags.getTagPrefix()}${toVersion}`;
|
|
215
|
-
this.log(`📝 Converting --to-version ${toVersion} to tag: ${toTag}`);
|
|
216
|
-
toCommit = await EntityTag.getBaseCommitSha(toTag);
|
|
217
|
-
} else {
|
|
218
|
-
toCommit = to || "HEAD";
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return { fromCommit, toCommit };
|
|
222
|
-
}
|
|
223
|
-
}
|
package/src/core/colorify.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom console coloring utility to replace chalk
|
|
3
|
-
* Provides ANSI color codes for terminal output
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// ANSI color codes
|
|
7
|
-
const colors = {
|
|
8
|
-
red: "\x1b[31m",
|
|
9
|
-
green: "\x1b[32m",
|
|
10
|
-
yellow: "\x1b[33m",
|
|
11
|
-
blue: "\x1b[34m",
|
|
12
|
-
cyan: "\x1b[36m",
|
|
13
|
-
gray: "\x1b[90m",
|
|
14
|
-
bold: "\x1b[1m",
|
|
15
|
-
reset: "\x1b[0m",
|
|
16
|
-
} as const;
|
|
17
|
-
|
|
18
|
-
const createColorFunction = (colorCode: string) => {
|
|
19
|
-
return (text: string): string => {
|
|
20
|
-
return `${colorCode}${text}${colors.reset}`;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Console color utility that mimics chalk's API
|
|
26
|
-
*/
|
|
27
|
-
export const colorify = {
|
|
28
|
-
red: createColorFunction(colors.red),
|
|
29
|
-
green: createColorFunction(colors.green),
|
|
30
|
-
yellow: createColorFunction(colors.yellow),
|
|
31
|
-
blue: createColorFunction(colors.blue),
|
|
32
|
-
cyan: createColorFunction(colors.cyan),
|
|
33
|
-
gray: createColorFunction(colors.gray),
|
|
34
|
-
bold: createColorFunction(colors.bold),
|
|
35
|
-
reset: colors.reset,
|
|
36
|
-
|
|
37
|
-
supportsColor: (): boolean => {
|
|
38
|
-
// Check if we're in a terminal that supports colors
|
|
39
|
-
return process.stdout.isTTY && process.env.NO_COLOR !== "1";
|
|
40
|
-
},
|
|
41
|
-
disable: () => {
|
|
42
|
-
Object.keys(colorify).forEach((key) => {
|
|
43
|
-
if (typeof colorify[key as keyof typeof colorify] === "function") {
|
|
44
|
-
(colorify as unknown as Record<string, (text: string) => string>)[key] = (text: string) =>
|
|
45
|
-
text;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
enable: () => {
|
|
50
|
-
Object.keys(colors).forEach((key) => {
|
|
51
|
-
if (key !== "reset") {
|
|
52
|
-
(colorify as unknown as Record<string, (text: string) => string>)[key] =
|
|
53
|
-
createColorFunction(colors[key as keyof typeof colors]);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
} as const;
|
|
58
|
-
|
|
59
|
-
if (!colorify.supportsColor()) {
|
|
60
|
-
colorify.disable();
|
|
61
|
-
}
|
package/src/core/index.ts
DELETED
package/src/core/types.ts
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core type definitions for the InterShell CLI framework
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Basic CLI types
|
|
6
|
-
export interface KeyPress {
|
|
7
|
-
sequence: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
ctrl: boolean;
|
|
10
|
-
meta: boolean;
|
|
11
|
-
shift: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface ValidationResult<T = unknown> {
|
|
15
|
-
isValid: boolean;
|
|
16
|
-
value?: T;
|
|
17
|
-
error?: string;
|
|
18
|
-
warnings?: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ValidationError {
|
|
22
|
-
message: string;
|
|
23
|
-
field?: string;
|
|
24
|
-
code?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Event system types
|
|
28
|
-
export type EventHandler<T = unknown> = (data: T) => void | Promise<void>;
|
|
29
|
-
|
|
30
|
-
export interface EventEmitter<TEvents extends Record<string, unknown> = Record<string, unknown>> {
|
|
31
|
-
on<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): void;
|
|
32
|
-
off<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): void;
|
|
33
|
-
emit<K extends keyof TEvents>(event: K, data: TEvents[K]): void;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// State management types
|
|
37
|
-
export type StateListener<TState> = (state: TState, prevState: TState) => void;
|
|
38
|
-
|
|
39
|
-
export interface StateManager<TState> {
|
|
40
|
-
getState(): TState;
|
|
41
|
-
setState(newState: TState): void;
|
|
42
|
-
subscribe(listener: StateListener<TState>): () => void;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Script configuration types
|
|
46
|
-
export type ArgOption = {
|
|
47
|
-
short?: string; // pay attention, this turned optional! in affects the logic
|
|
48
|
-
long: string;
|
|
49
|
-
description: string;
|
|
50
|
-
examples?: string[];
|
|
51
|
-
} & (
|
|
52
|
-
| {
|
|
53
|
-
required: true;
|
|
54
|
-
type: "string" | "boolean" | "number";
|
|
55
|
-
validator: (value: string) => boolean | string | Promise<boolean | string>;
|
|
56
|
-
}
|
|
57
|
-
| {
|
|
58
|
-
required: false;
|
|
59
|
-
type: "string" | "boolean" | "number";
|
|
60
|
-
defaultValue?: string | boolean | number;
|
|
61
|
-
validator: (value: string) => boolean | string | Promise<boolean | string>;
|
|
62
|
-
}
|
|
63
|
-
| {
|
|
64
|
-
required: true;
|
|
65
|
-
type: "string[]" | "number[]"; // there is no multi boolean anymore, we must use type conditionals
|
|
66
|
-
validator: (value: string[]) => boolean | string | Promise<boolean | string>;
|
|
67
|
-
}
|
|
68
|
-
| {
|
|
69
|
-
required: false;
|
|
70
|
-
type: "string[]" | "number[]";
|
|
71
|
-
defaultValue?: string[] | number[];
|
|
72
|
-
validator: (value: string[]) => boolean | string | Promise<boolean | string>;
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
export interface ScriptConfig {
|
|
77
|
-
name: string;
|
|
78
|
-
description: string;
|
|
79
|
-
usage?: string;
|
|
80
|
-
examples?: string[];
|
|
81
|
-
options: ArgOption[];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type ScriptHandler<TConfig extends ScriptConfig> = (
|
|
85
|
-
args: InferArgs<TConfig>,
|
|
86
|
-
console: Console,
|
|
87
|
-
) => Promise<void> | void;
|
|
88
|
-
|
|
89
|
-
export interface ScriptInstance<TConfig extends ScriptConfig> {
|
|
90
|
-
config: TConfig;
|
|
91
|
-
handler: ScriptHandler<TConfig>;
|
|
92
|
-
run(args?: Partial<InferArgs<TConfig>>): Promise<void>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Utility type to infer argument types from config
|
|
96
|
-
export type InferArgs<TConfig extends ScriptConfig> = {
|
|
97
|
-
[K in TConfig["options"][number] as K["long"] extends `--${infer Name}`
|
|
98
|
-
? Name
|
|
99
|
-
: never]: K extends { required: true; type: infer T }
|
|
100
|
-
? T extends "string[]" | "number[]"
|
|
101
|
-
? string[] | number[]
|
|
102
|
-
: T extends "string"
|
|
103
|
-
? string
|
|
104
|
-
: T extends "boolean"
|
|
105
|
-
? boolean
|
|
106
|
-
: T extends "number"
|
|
107
|
-
? number
|
|
108
|
-
: never
|
|
109
|
-
: K extends { required: false; type: infer T; defaultValue: infer D }
|
|
110
|
-
? T extends "string[]" | "number[]"
|
|
111
|
-
? (string[] | number[]) | D
|
|
112
|
-
: T extends "string"
|
|
113
|
-
? string | D
|
|
114
|
-
: T extends "boolean"
|
|
115
|
-
? boolean | D
|
|
116
|
-
: T extends "number"
|
|
117
|
-
? number | D
|
|
118
|
-
: never
|
|
119
|
-
: K extends { required: false; type: infer T }
|
|
120
|
-
? T extends "string[]" | "number[]"
|
|
121
|
-
? (string[] | number[]) | undefined
|
|
122
|
-
: T extends "string"
|
|
123
|
-
? string | undefined
|
|
124
|
-
: T extends "boolean"
|
|
125
|
-
? boolean | undefined
|
|
126
|
-
: T extends "number"
|
|
127
|
-
? number | undefined
|
|
128
|
-
: never
|
|
129
|
-
: never;
|
|
130
|
-
} & {
|
|
131
|
-
verbose?: boolean;
|
|
132
|
-
quiet?: boolean;
|
|
133
|
-
"dry-run"?: boolean;
|
|
134
|
-
help?: boolean;
|
|
135
|
-
debug?: boolean;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
// Hook system types
|
|
139
|
-
export interface HookContext<TConfig extends ScriptConfig> {
|
|
140
|
-
script: ScriptInstance<TConfig>;
|
|
141
|
-
args: InferArgs<TConfig>;
|
|
142
|
-
startTime: number;
|
|
143
|
-
error?: Error;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export type Hook<TConfig extends ScriptConfig, TReturn = void> = (
|
|
147
|
-
context: HookContext<TConfig>,
|
|
148
|
-
) => Promise<TReturn> | TReturn;
|
|
149
|
-
|
|
150
|
-
export interface HookSystem<TConfig extends ScriptConfig> {
|
|
151
|
-
beforeRun: Hook<TConfig>[];
|
|
152
|
-
afterRun: Hook<TConfig, unknown>[];
|
|
153
|
-
onError: Hook<TConfig>[];
|
|
154
|
-
onValidation: Hook<TConfig, ValidationResult>[];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Color system types
|
|
158
|
-
export type ColorFunction = (text: string) => string;
|
|
159
|
-
|
|
160
|
-
export interface ColorSystem {
|
|
161
|
-
// Basic colors
|
|
162
|
-
red: ColorFunction;
|
|
163
|
-
green: ColorFunction;
|
|
164
|
-
blue: ColorFunction;
|
|
165
|
-
yellow: ColorFunction;
|
|
166
|
-
cyan: ColorFunction;
|
|
167
|
-
magenta: ColorFunction;
|
|
168
|
-
white: ColorFunction;
|
|
169
|
-
black: ColorFunction;
|
|
170
|
-
gray: ColorFunction;
|
|
171
|
-
grey: ColorFunction;
|
|
172
|
-
|
|
173
|
-
// Styles
|
|
174
|
-
bold: ColorFunction;
|
|
175
|
-
italic: ColorFunction;
|
|
176
|
-
underline: ColorFunction;
|
|
177
|
-
strikethrough: ColorFunction;
|
|
178
|
-
|
|
179
|
-
// Advanced colors
|
|
180
|
-
rgb(r: number, g: number, b: number): ColorFunction;
|
|
181
|
-
hsl(h: number, s: number, l: number): ColorFunction;
|
|
182
|
-
hex(color: string): ColorFunction;
|
|
183
|
-
|
|
184
|
-
// Effects
|
|
185
|
-
gradient(colors: string[]): ColorFunction;
|
|
186
|
-
rainbow: ColorFunction;
|
|
187
|
-
|
|
188
|
-
// Utilities
|
|
189
|
-
strip(text: string): string;
|
|
190
|
-
supportsColor(): boolean;
|
|
191
|
-
enable(): void;
|
|
192
|
-
disable(): void;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// CLI Tools types
|
|
196
|
-
export interface QuickAction {
|
|
197
|
-
key: string;
|
|
198
|
-
label: string;
|
|
199
|
-
description: string;
|
|
200
|
-
shortcut?: string;
|
|
201
|
-
action: () => void | Promise<void>;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface SelectConfig {
|
|
205
|
-
multiple?: boolean;
|
|
206
|
-
clearScreen?: boolean;
|
|
207
|
-
showCursor?: boolean;
|
|
208
|
-
exitOnCtrlC?: boolean;
|
|
209
|
-
quickActions?: QuickAction[];
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export interface PromptConfig {
|
|
213
|
-
clearScreen?: boolean;
|
|
214
|
-
allowEmpty?: boolean;
|
|
215
|
-
showCursor?: boolean;
|
|
216
|
-
exitOnCtrlC?: boolean;
|
|
217
|
-
quickActions?: QuickAction[];
|
|
218
|
-
onLeft?: () => void;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export interface ConfirmConfig {
|
|
222
|
-
clearScreen?: boolean;
|
|
223
|
-
defaultValue?: boolean;
|
|
224
|
-
exitOnCtrlC?: boolean;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Interactive CLI types
|
|
228
|
-
export interface InteractiveCLIOptions {
|
|
229
|
-
enableRawMode?: boolean;
|
|
230
|
-
exitOnCtrlC?: boolean;
|
|
231
|
-
clearOnExit?: boolean;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface InteractiveCLI {
|
|
235
|
-
// Core methods
|
|
236
|
-
select(question: string, options: string[], config?: SelectConfig): Promise<string[]>;
|
|
237
|
-
prompt(question: string, config?: PromptConfig): Promise<string>;
|
|
238
|
-
confirm(question: string, config?: ConfirmConfig): Promise<boolean>;
|
|
239
|
-
|
|
240
|
-
// Screen management
|
|
241
|
-
clearScreen(): void;
|
|
242
|
-
showCursor(): void;
|
|
243
|
-
hideCursor(): void;
|
|
244
|
-
|
|
245
|
-
// Event handling
|
|
246
|
-
onKeyPress(callback: (key: KeyPress) => void): void;
|
|
247
|
-
offKeyPress(callback: (key: KeyPress) => void): void;
|
|
248
|
-
|
|
249
|
-
// Lifecycle
|
|
250
|
-
cleanup(): void;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Framework-specific types (will be extended by interactive package)
|
|
254
|
-
export interface FrameworkOptions {
|
|
255
|
-
debug?: boolean;
|
|
256
|
-
logLevel?: "error" | "warn" | "info" | "debug";
|
|
257
|
-
enableHotkeys?: boolean;
|
|
258
|
-
enableHistory?: boolean;
|
|
259
|
-
maxHistorySize?: number;
|
|
260
|
-
renderMode?: "immediate" | "debounced" | "throttled";
|
|
261
|
-
renderDelay?: number;
|
|
262
|
-
}
|