@xylabs/ts-scripts-yarn3 2.19.12 → 2.20.0-rc.1
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/dist/actions/build.d.ts +9 -0
- package/dist/actions/build.d.ts.map +1 -0
- package/dist/actions/build.js +21 -163
- package/dist/actions/build.js.map +1 -1
- package/dist/actions/clean-docs.d.ts +2 -0
- package/dist/actions/clean-docs.d.ts.map +1 -0
- package/dist/actions/clean-docs.js +13 -61
- package/dist/actions/clean-docs.js.map +1 -1
- package/dist/actions/clean-eslint.d.ts +2 -0
- package/dist/actions/clean-eslint.d.ts.map +1 -0
- package/dist/actions/clean-eslint.js +13 -47
- package/dist/actions/clean-eslint.js.map +1 -1
- package/dist/actions/clean-jest.d.ts +2 -0
- package/dist/actions/clean-jest.d.ts.map +1 -0
- package/dist/actions/clean-jest.js +6 -133
- package/dist/actions/clean-jest.js.map +1 -1
- package/dist/actions/clean.d.ts +12 -0
- package/dist/actions/clean.d.ts.map +1 -0
- package/dist/actions/clean.js +20 -247
- package/dist/actions/clean.js.map +1 -1
- package/dist/actions/compile.d.ts +16 -0
- package/dist/actions/compile.d.ts.map +1 -0
- package/dist/actions/compile.js +28 -156
- package/dist/actions/compile.js.map +1 -1
- package/dist/actions/copy-assets.d.ts +6 -0
- package/dist/actions/copy-assets.d.ts.map +1 -0
- package/dist/actions/copy-assets.js +48 -99
- package/dist/actions/copy-assets.js.map +1 -1
- package/dist/actions/cycle.d.ts +2 -0
- package/dist/actions/cycle.d.ts.map +1 -0
- package/dist/actions/cycle.js +8 -135
- package/dist/actions/cycle.js.map +1 -1
- package/dist/actions/dead.d.ts +2 -0
- package/dist/actions/dead.d.ts.map +1 -0
- package/dist/actions/dead.js +6 -133
- package/dist/actions/dead.js.map +1 -1
- package/dist/actions/deploy-major.d.ts +2 -0
- package/dist/actions/deploy-major.d.ts.map +1 -0
- package/dist/actions/deploy-major.js +14 -141
- package/dist/actions/deploy-major.js.map +1 -1
- package/dist/actions/deploy-minor.d.ts +2 -0
- package/dist/actions/deploy-minor.d.ts.map +1 -0
- package/dist/actions/deploy-minor.js +14 -141
- package/dist/actions/deploy-minor.js.map +1 -1
- package/dist/actions/deploy-next.d.ts +2 -0
- package/dist/actions/deploy-next.d.ts.map +1 -0
- package/dist/actions/deploy-next.js +14 -141
- package/dist/actions/deploy-next.js.map +1 -1
- package/dist/actions/deploy.d.ts +2 -0
- package/dist/actions/deploy.d.ts.map +1 -0
- package/dist/actions/deploy.js +15 -142
- package/dist/actions/deploy.js.map +1 -1
- package/dist/actions/deps.d.ts +12 -0
- package/dist/actions/deps.d.ts.map +1 -0
- package/dist/actions/deps.js +26 -153
- package/dist/actions/deps.js.map +1 -1
- package/dist/actions/dupdeps.d.ts +2 -0
- package/dist/actions/dupdeps.d.ts.map +1 -0
- package/dist/actions/dupdeps.js +12 -214
- package/dist/actions/dupdeps.js.map +1 -1
- package/dist/actions/fix.d.ts +2 -0
- package/dist/actions/fix.d.ts.map +1 -0
- package/dist/actions/fix.js +6 -133
- package/dist/actions/fix.js.map +1 -1
- package/dist/actions/gen-docs.d.ts +11 -0
- package/dist/actions/gen-docs.d.ts.map +1 -0
- package/dist/actions/gen-docs.js +18 -147
- package/dist/actions/gen-docs.js.map +1 -1
- package/dist/actions/gitignore-gen.d.ts +2 -0
- package/dist/actions/gitignore-gen.d.ts.map +1 -0
- package/dist/actions/gitignore-gen.js +6 -122
- package/dist/actions/gitignore-gen.js.map +1 -1
- package/dist/actions/gitlint-fix.d.ts +2 -0
- package/dist/actions/gitlint-fix.d.ts.map +1 -0
- package/dist/actions/gitlint-fix.js +23 -59
- package/dist/actions/gitlint-fix.js.map +1 -1
- package/dist/actions/gitlint.d.ts +2 -0
- package/dist/actions/gitlint.d.ts.map +1 -0
- package/dist/actions/gitlint.js +46 -80
- package/dist/actions/gitlint.js.map +1 -1
- package/dist/actions/index.d.ts +39 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +40 -1693
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/license.d.ts +2 -0
- package/dist/actions/license.d.ts.map +1 -0
- package/dist/actions/license.js +69 -116
- package/dist/actions/license.js.map +1 -1
- package/dist/actions/lint-clean.d.ts +2 -0
- package/dist/actions/lint-clean.d.ts.map +1 -0
- package/dist/actions/lint-clean.js +25 -180
- package/dist/actions/lint-clean.js.map +1 -1
- package/dist/actions/lint-profile.d.ts +2 -0
- package/dist/actions/lint-profile.d.ts.map +1 -0
- package/dist/actions/lint-profile.js +6 -133
- package/dist/actions/lint-profile.js.map +1 -1
- package/dist/actions/lint.d.ts +12 -0
- package/dist/actions/lint.d.ts.map +1 -0
- package/dist/actions/lint.js +30 -171
- package/dist/actions/lint.js.map +1 -1
- package/dist/actions/npmignore-gen.d.ts +2 -0
- package/dist/actions/npmignore-gen.d.ts.map +1 -0
- package/dist/actions/npmignore-gen.js +6 -122
- package/dist/actions/npmignore-gen.js.map +1 -1
- package/dist/actions/package/clean-outputs.d.ts +2 -0
- package/dist/actions/package/clean-outputs.d.ts.map +1 -0
- package/dist/actions/package/clean-outputs.js +16 -50
- package/dist/actions/package/clean-outputs.js.map +1 -1
- package/dist/actions/package/clean-typescript.d.ts +2 -0
- package/dist/actions/package/clean-typescript.d.ts.map +1 -0
- package/dist/actions/package/clean-typescript.js +16 -50
- package/dist/actions/package/clean-typescript.js.map +1 -1
- package/dist/actions/package/clean.d.ts +2 -0
- package/dist/actions/package/clean.d.ts.map +1 -0
- package/dist/actions/package/clean.js +8 -73
- package/dist/actions/package/clean.js.map +1 -1
- package/dist/actions/package/compile.d.ts +2 -0
- package/dist/actions/package/compile.d.ts.map +1 -0
- package/dist/actions/package/compile.js +60 -314
- package/dist/actions/package/compile.js.map +1 -1
- package/dist/actions/package/copy-assets.d.ts +5 -0
- package/dist/actions/package/copy-assets.d.ts.map +1 -0
- package/dist/actions/package/copy-assets.js +36 -73
- package/dist/actions/package/copy-assets.js.map +1 -1
- package/dist/actions/package/deps.d.ts +2 -0
- package/dist/actions/package/deps.d.ts.map +1 -0
- package/dist/actions/package/deps.js +89 -127
- package/dist/actions/package/deps.js.map +1 -1
- package/dist/actions/package/gen-docs.d.ts +2 -0
- package/dist/actions/package/gen-docs.d.ts.map +1 -0
- package/dist/actions/package/gen-docs.js +103 -135
- package/dist/actions/package/gen-docs.js.map +1 -1
- package/dist/actions/package/index.d.ts +11 -0
- package/dist/actions/package/index.d.ts.map +1 -0
- package/dist/actions/package/index.js +12 -590
- package/dist/actions/package/index.js.map +1 -1
- package/dist/actions/package/publint.d.ts +2 -0
- package/dist/actions/package/publint.d.ts.map +1 -0
- package/dist/actions/package/publint.js +41 -52
- package/dist/actions/package/publint.js.map +1 -1
- package/dist/actions/package/recompile.d.ts +2 -0
- package/dist/actions/package/recompile.d.ts.map +1 -0
- package/dist/actions/package/recompile.js +8 -361
- package/dist/actions/package/recompile.js.map +1 -1
- package/dist/actions/package/tsup.d.ts +2 -0
- package/dist/actions/package/tsup.d.ts.map +1 -0
- package/dist/actions/package/tsup.js +29 -0
- package/dist/actions/package/tsup.js.map +1 -0
- package/dist/actions/publint.d.ts +12 -0
- package/dist/actions/publint.d.ts.map +1 -0
- package/dist/actions/publint.js +17 -205
- package/dist/actions/publint.js.map +1 -1
- package/dist/actions/rebuild.d.ts +6 -0
- package/dist/actions/rebuild.d.ts.map +1 -0
- package/dist/actions/rebuild.js +10 -137
- package/dist/actions/rebuild.js.map +1 -1
- package/dist/actions/recompile.d.ts +16 -0
- package/dist/actions/recompile.d.ts.map +1 -0
- package/dist/actions/recompile.js +28 -172
- package/dist/actions/recompile.js.map +1 -1
- package/dist/actions/reinstall.d.ts +2 -0
- package/dist/actions/reinstall.d.ts.map +1 -0
- package/dist/actions/reinstall.js +26 -163
- package/dist/actions/reinstall.js.map +1 -1
- package/dist/actions/relint.d.ts +2 -0
- package/dist/actions/relint.d.ts.map +1 -0
- package/dist/actions/relint.js +24 -161
- package/dist/actions/relint.js.map +1 -1
- package/dist/actions/retest.d.ts +2 -0
- package/dist/actions/retest.d.ts.map +1 -0
- package/dist/actions/retest.js +10 -137
- package/dist/actions/retest.js.map +1 -1
- package/dist/actions/sonar.d.ts +2 -0
- package/dist/actions/sonar.d.ts.map +1 -0
- package/dist/actions/sonar.js +6 -133
- package/dist/actions/sonar.js.map +1 -1
- package/dist/actions/statics.d.ts +2 -0
- package/dist/actions/statics.d.ts.map +1 -0
- package/dist/actions/statics.js +12 -214
- package/dist/actions/statics.js.map +1 -1
- package/dist/actions/test.d.ts +2 -0
- package/dist/actions/test.d.ts.map +1 -0
- package/dist/actions/test.js +6 -133
- package/dist/actions/test.js.map +1 -1
- package/dist/actions/up.d.ts +2 -0
- package/dist/actions/up.d.ts.map +1 -0
- package/dist/actions/up.js +6 -133
- package/dist/actions/up.js.map +1 -1
- package/dist/actions/updo.d.ts +2 -0
- package/dist/actions/updo.d.ts.map +1 -0
- package/dist/actions/updo.js +11 -138
- package/dist/actions/updo.js.map +1 -1
- package/dist/actions/upplug.d.ts +2 -0
- package/dist/actions/upplug.d.ts.map +1 -0
- package/dist/actions/upplug.js +12 -139
- package/dist/actions/upplug.js.map +1 -1
- package/dist/actions/upyarn.d.ts +2 -0
- package/dist/actions/upyarn.d.ts.map +1 -0
- package/dist/actions/upyarn.js +6 -133
- package/dist/actions/upyarn.js.map +1 -1
- package/dist/actions/yarn3only.d.ts +2 -0
- package/dist/actions/yarn3only.d.ts.map +1 -0
- package/dist/actions/yarn3only.js +9 -93
- package/dist/actions/yarn3only.js.map +1 -1
- package/dist/bin/build.d.ts +3 -0
- package/dist/bin/build.d.ts.map +1 -0
- package/dist/bin/build.js +3 -33
- package/dist/bin/build.js.map +1 -1
- package/dist/bin/clean.d.ts +3 -0
- package/dist/bin/clean.d.ts.map +1 -0
- package/dist/bin/clean.js +3 -33
- package/dist/bin/clean.js.map +1 -1
- package/dist/bin/compile.d.ts +3 -0
- package/dist/bin/compile.d.ts.map +1 -0
- package/dist/bin/compile.js +3 -33
- package/dist/bin/compile.js.map +1 -1
- package/dist/bin/cycle.d.ts +3 -0
- package/dist/bin/cycle.d.ts.map +1 -0
- package/dist/bin/cycle.js +3 -33
- package/dist/bin/cycle.js.map +1 -1
- package/dist/bin/dead.d.ts +3 -0
- package/dist/bin/dead.d.ts.map +1 -0
- package/dist/bin/dead.js +3 -33
- package/dist/bin/dead.js.map +1 -1
- package/dist/bin/deploy-major.d.ts +3 -0
- package/dist/bin/deploy-major.d.ts.map +1 -0
- package/dist/bin/deploy-major.js +3 -33
- package/dist/bin/deploy-major.js.map +1 -1
- package/dist/bin/deploy-minor.d.ts +3 -0
- package/dist/bin/deploy-minor.d.ts.map +1 -0
- package/dist/bin/deploy-minor.js +3 -33
- package/dist/bin/deploy-minor.js.map +1 -1
- package/dist/bin/deploy-next.d.ts +3 -0
- package/dist/bin/deploy-next.d.ts.map +1 -0
- package/dist/bin/deploy-next.js +3 -33
- package/dist/bin/deploy-next.js.map +1 -1
- package/dist/bin/deploy.d.ts +3 -0
- package/dist/bin/deploy.d.ts.map +1 -0
- package/dist/bin/deploy.js +3 -33
- package/dist/bin/deploy.js.map +1 -1
- package/dist/bin/deps.d.ts +3 -0
- package/dist/bin/deps.d.ts.map +1 -0
- package/dist/bin/deps.js +3 -33
- package/dist/bin/deps.js.map +1 -1
- package/dist/bin/fix.d.ts +3 -0
- package/dist/bin/fix.d.ts.map +1 -0
- package/dist/bin/fix.js +3 -33
- package/dist/bin/fix.js.map +1 -1
- package/dist/bin/gen-docs.d.ts +3 -0
- package/dist/bin/gen-docs.d.ts.map +1 -0
- package/dist/bin/gen-docs.js +3 -33
- package/dist/bin/gen-docs.js.map +1 -1
- package/dist/bin/gitlint-fix.d.ts +3 -0
- package/dist/bin/gitlint-fix.d.ts.map +1 -0
- package/dist/bin/gitlint-fix.js +3 -33
- package/dist/bin/gitlint-fix.js.map +1 -1
- package/dist/bin/gitlint.d.ts +3 -0
- package/dist/bin/gitlint.d.ts.map +1 -0
- package/dist/bin/gitlint.js +3 -33
- package/dist/bin/gitlint.js.map +1 -1
- package/dist/bin/license.d.ts +3 -0
- package/dist/bin/license.d.ts.map +1 -0
- package/dist/bin/license.js +3 -33
- package/dist/bin/license.js.map +1 -1
- package/dist/bin/lint-clean.d.ts +3 -0
- package/dist/bin/lint-clean.d.ts.map +1 -0
- package/dist/bin/lint-clean.js +3 -33
- package/dist/bin/lint-clean.js.map +1 -1
- package/dist/bin/lint-fast.d.ts +3 -0
- package/dist/bin/lint-fast.d.ts.map +1 -0
- package/dist/bin/lint-fast.js +3 -33
- package/dist/bin/lint-fast.js.map +1 -1
- package/dist/bin/lint-profile.d.ts +3 -0
- package/dist/bin/lint-profile.d.ts.map +1 -0
- package/dist/bin/lint-profile.js +3 -33
- package/dist/bin/lint-profile.js.map +1 -1
- package/dist/bin/lint.d.ts +3 -0
- package/dist/bin/lint.d.ts.map +1 -0
- package/dist/bin/lint.js +3 -33
- package/dist/bin/lint.js.map +1 -1
- package/dist/bin/package/clean-outputs.d.ts +3 -0
- package/dist/bin/package/clean-outputs.d.ts.map +1 -0
- package/dist/bin/package/clean-outputs.js +3 -40
- package/dist/bin/package/clean-outputs.js.map +1 -1
- package/dist/bin/package/clean-typescript.d.ts +3 -0
- package/dist/bin/package/clean-typescript.d.ts.map +1 -0
- package/dist/bin/package/clean-typescript.js +3 -40
- package/dist/bin/package/clean-typescript.js.map +1 -1
- package/dist/bin/package/clean.d.ts +3 -0
- package/dist/bin/package/clean.d.ts.map +1 -0
- package/dist/bin/package/clean.js +3 -60
- package/dist/bin/package/clean.js.map +1 -1
- package/dist/bin/package/compile.d.ts +3 -0
- package/dist/bin/package/compile.d.ts.map +1 -0
- package/dist/bin/package/compile.js +7 -313
- package/dist/bin/package/compile.js.map +1 -1
- package/dist/bin/package/copy-assets-cjs.d.ts +3 -0
- package/dist/bin/package/copy-assets-cjs.d.ts.map +1 -0
- package/dist/bin/package/copy-assets-cjs.js +7 -70
- package/dist/bin/package/copy-assets-cjs.js.map +1 -1
- package/dist/bin/package/copy-assets-esm.d.ts +3 -0
- package/dist/bin/package/copy-assets-esm.d.ts.map +1 -0
- package/dist/bin/package/copy-assets-esm.js +7 -70
- package/dist/bin/package/copy-assets-esm.js.map +1 -1
- package/dist/bin/package/deps.d.ts +3 -0
- package/dist/bin/package/deps.d.ts.map +1 -0
- package/dist/bin/package/deps.js +7 -121
- package/dist/bin/package/deps.js.map +1 -1
- package/dist/bin/package/gen-docs.d.ts +3 -0
- package/dist/bin/package/gen-docs.d.ts.map +1 -0
- package/dist/bin/package/gen-docs.js +3 -134
- package/dist/bin/package/gen-docs.js.map +1 -1
- package/dist/bin/package/publint.d.ts +3 -0
- package/dist/bin/package/publint.d.ts.map +1 -0
- package/dist/bin/package/publint.js +7 -48
- package/dist/bin/package/publint.js.map +1 -1
- package/dist/bin/package/recompile.d.ts +3 -0
- package/dist/bin/package/recompile.d.ts.map +1 -0
- package/dist/bin/package/recompile.js +7 -353
- package/dist/bin/package/recompile.js.map +1 -1
- package/dist/bin/package/tsup.d.ts +3 -0
- package/dist/bin/package/tsup.d.ts.map +1 -0
- package/dist/bin/package/tsup.js +11 -0
- package/dist/bin/package/tsup.js.map +1 -0
- package/dist/bin/publint.d.ts +3 -0
- package/dist/bin/publint.d.ts.map +1 -0
- package/dist/bin/publint.js +3 -33
- package/dist/bin/publint.js.map +1 -1
- package/dist/bin/rebuild.d.ts +3 -0
- package/dist/bin/rebuild.d.ts.map +1 -0
- package/dist/bin/rebuild.js +3 -33
- package/dist/bin/rebuild.js.map +1 -1
- package/dist/bin/recompile.d.ts +3 -0
- package/dist/bin/recompile.d.ts.map +1 -0
- package/dist/bin/recompile.js +3 -33
- package/dist/bin/recompile.js.map +1 -1
- package/dist/bin/reinstall.d.ts +3 -0
- package/dist/bin/reinstall.d.ts.map +1 -0
- package/dist/bin/reinstall.js +3 -33
- package/dist/bin/reinstall.js.map +1 -1
- package/dist/bin/relint.d.ts +3 -0
- package/dist/bin/relint.d.ts.map +1 -0
- package/dist/bin/relint.js +3 -33
- package/dist/bin/relint.js.map +1 -1
- package/dist/bin/sonar.d.ts +3 -0
- package/dist/bin/sonar.d.ts.map +1 -0
- package/dist/bin/sonar.js +3 -33
- package/dist/bin/sonar.js.map +1 -1
- package/dist/bin/test.d.ts +3 -0
- package/dist/bin/test.d.ts.map +1 -0
- package/dist/bin/test.js +3 -33
- package/dist/bin/test.js.map +1 -1
- package/dist/bin/tsconfig-gen-clean.d.ts +3 -0
- package/dist/bin/tsconfig-gen-clean.d.ts.map +1 -0
- package/dist/bin/tsconfig-gen-clean.js +3 -33
- package/dist/bin/tsconfig-gen-clean.js.map +1 -1
- package/dist/bin/tsconfig-gen.d.ts +3 -0
- package/dist/bin/tsconfig-gen.d.ts.map +1 -0
- package/dist/bin/tsconfig-gen.js +3 -33
- package/dist/bin/tsconfig-gen.js.map +1 -1
- package/dist/bin/up.d.ts +3 -0
- package/dist/bin/up.d.ts.map +1 -0
- package/dist/bin/up.js +3 -33
- package/dist/bin/up.js.map +1 -1
- package/dist/bin/updo.d.ts +3 -0
- package/dist/bin/updo.d.ts.map +1 -0
- package/dist/bin/updo.js +3 -33
- package/dist/bin/updo.js.map +1 -1
- package/dist/bin/upplug.d.ts +3 -0
- package/dist/bin/upplug.d.ts.map +1 -0
- package/dist/bin/upplug.js +3 -33
- package/dist/bin/upplug.js.map +1 -1
- package/dist/bin/upyarn.d.ts +3 -0
- package/dist/bin/upyarn.d.ts.map +1 -0
- package/dist/bin/upyarn.js +3 -33
- package/dist/bin/upyarn.js.map +1 -1
- package/dist/bin/xy-ts.d.ts +3 -0
- package/dist/bin/xy-ts.d.ts.map +1 -0
- package/dist/bin/xy-ts.js +3 -1680
- package/dist/bin/xy-ts.js.map +1 -1
- package/dist/bin/xy.d.ts +3 -0
- package/dist/bin/xy.d.ts.map +1 -0
- package/dist/bin/xy.js +3 -1680
- package/dist/bin/xy.js.map +1 -1
- package/dist/bin/yarn3only.d.ts +3 -0
- package/dist/bin/yarn3only.d.ts.map +1 -0
- package/dist/bin/yarn3only.js +3 -33
- package/dist/bin/yarn3only.js.map +1 -1
- package/dist/index.d.ts +3 -319
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -2333
- package/dist/index.js.map +1 -1
- package/dist/lib/checkResult.d.ts +2 -0
- package/dist/lib/checkResult.d.ts.map +1 -0
- package/dist/lib/checkResult.js +13 -47
- package/dist/lib/checkResult.js.map +1 -1
- package/dist/lib/createBuildConfig.d.ts +2 -0
- package/dist/lib/createBuildConfig.d.ts.map +1 -0
- package/dist/lib/createBuildConfig.js +31 -66
- package/dist/lib/createBuildConfig.js.map +1 -1
- package/dist/lib/defaultBuildConfig.d.ts +9 -0
- package/dist/lib/defaultBuildConfig.d.ts.map +1 -0
- package/dist/lib/defaultBuildConfig.js +9 -35
- package/dist/lib/defaultBuildConfig.js.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.d.ts +9 -0
- package/dist/lib/dependencies/DuplicateDetector.d.ts.map +1 -0
- package/dist/lib/dependencies/DuplicateDetector.js +65 -104
- package/dist/lib/dependencies/DuplicateDetector.js.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.d.ts +2 -0
- package/dist/lib/dependencies/detectDuplicateDependencies.d.ts.map +1 -0
- package/dist/lib/dependencies/detectDuplicateDependencies.js +40 -192
- package/dist/lib/dependencies/detectDuplicateDependencies.js.map +1 -1
- package/dist/lib/dependencies/index.d.ts +3 -0
- package/dist/lib/dependencies/index.d.ts.map +1 -0
- package/dist/lib/dependencies/index.js +4 -199
- package/dist/lib/dependencies/index.js.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.d.ts +7 -0
- package/dist/lib/file/ReadFileSyncOptions.d.ts.map +1 -0
- package/dist/lib/file/ReadFileSyncOptions.js +3 -29
- package/dist/lib/file/ReadFileSyncOptions.js.map +1 -1
- package/dist/lib/file/constants.d.ts +3 -0
- package/dist/lib/file/constants.d.ts.map +1 -0
- package/dist/lib/file/constants.js +4 -32
- package/dist/lib/file/constants.js.map +1 -1
- package/dist/lib/file/fileLines.d.ts +6 -0
- package/dist/lib/file/fileLines.d.ts.map +1 -0
- package/dist/lib/file/fileLines.js +17 -53
- package/dist/lib/file/fileLines.js.map +1 -1
- package/dist/lib/file/index.d.ts +5 -0
- package/dist/lib/file/index.d.ts.map +1 -0
- package/dist/lib/file/index.js +6 -70
- package/dist/lib/file/index.js.map +1 -1
- package/dist/lib/file/tryReadFileSync.d.ts +4 -0
- package/dist/lib/file/tryReadFileSync.d.ts.map +1 -0
- package/dist/lib/file/tryReadFileSync.js +7 -36
- package/dist/lib/file/tryReadFileSync.js.map +1 -1
- package/dist/lib/generateIgnoreFiles.d.ts +2 -0
- package/dist/lib/generateIgnoreFiles.d.ts.map +1 -0
- package/dist/lib/generateIgnoreFiles.js +28 -115
- package/dist/lib/generateIgnoreFiles.js.map +1 -1
- package/dist/lib/index.d.ts +20 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +21 -1788
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/jsonFormatters.d.ts +2 -0
- package/dist/lib/jsonFormatters.d.ts.map +1 -0
- package/dist/lib/jsonFormatters.js +8 -33
- package/dist/lib/jsonFormatters.js.map +1 -1
- package/dist/lib/parsedPackageJSON.d.ts +2 -0
- package/dist/lib/parsedPackageJSON.d.ts.map +1 -0
- package/dist/lib/parsedPackageJSON.js +8 -33
- package/dist/lib/parsedPackageJSON.js.map +1 -1
- package/dist/lib/processEx.d.ts +2 -0
- package/dist/lib/processEx.d.ts.map +1 -0
- package/dist/lib/processEx.js +29 -68
- package/dist/lib/processEx.js.map +1 -1
- package/dist/lib/runSteps.d.ts +5 -0
- package/dist/lib/runSteps.d.ts.map +1 -0
- package/dist/lib/runSteps.js +36 -129
- package/dist/lib/runSteps.js.map +1 -1
- package/dist/lib/runStepsAsync.d.ts +4 -0
- package/dist/lib/runStepsAsync.d.ts.map +1 -0
- package/dist/lib/runStepsAsync.js +45 -144
- package/dist/lib/runStepsAsync.js.map +1 -1
- package/dist/lib/runXy.d.ts +2 -0
- package/dist/lib/runXy.d.ts.map +1 -0
- package/dist/lib/runXy.js +6 -135
- package/dist/lib/runXy.js.map +1 -1
- package/dist/lib/runXyWithWarning.d.ts +2 -0
- package/dist/lib/runXyWithWarning.d.ts.map +1 -0
- package/dist/lib/runXyWithWarning.js +9 -43
- package/dist/lib/runXyWithWarning.js.map +1 -1
- package/dist/lib/safeExit.d.ts +5 -0
- package/dist/lib/safeExit.d.ts.map +1 -0
- package/dist/lib/safeExit.js +25 -92
- package/dist/lib/safeExit.js.map +1 -1
- package/dist/lib/string/empty.d.ts +3 -0
- package/dist/lib/string/empty.d.ts.map +1 -0
- package/dist/lib/string/empty.js +6 -32
- package/dist/lib/string/empty.js.map +1 -1
- package/dist/lib/string/index.d.ts +3 -0
- package/dist/lib/string/index.d.ts.map +1 -0
- package/dist/lib/string/index.js +4 -39
- package/dist/lib/string/index.js.map +1 -1
- package/dist/lib/string/union.d.ts +2 -0
- package/dist/lib/string/union.d.ts.map +1 -0
- package/dist/lib/string/union.js +4 -29
- package/dist/lib/string/union.js.map +1 -1
- package/dist/lib/withErrnoException.d.ts +3 -0
- package/dist/lib/withErrnoException.d.ts.map +1 -0
- package/dist/lib/withErrnoException.js +8 -38
- package/dist/lib/withErrnoException.js.map +1 -1
- package/dist/lib/withError.d.ts +2 -0
- package/dist/lib/withError.d.ts.map +1 -0
- package/dist/lib/withError.js +7 -30
- package/dist/lib/withError.js.map +1 -1
- package/dist/lib/xy/index.d.ts +8 -0
- package/dist/lib/xy/index.d.ts.map +1 -0
- package/dist/lib/xy/index.js +9 -1707
- package/dist/lib/xy/index.js.map +1 -1
- package/dist/lib/xy/xy.d.ts +10 -0
- package/dist/lib/xy/xy.d.ts.map +1 -0
- package/dist/lib/xy/xy.js +20 -1691
- package/dist/lib/xy/xy.js.map +1 -1
- package/dist/lib/xy/xyBuildCommands.d.ts +3 -0
- package/dist/lib/xy/xyBuildCommands.d.ts.map +1 -0
- package/dist/lib/xy/xyBuildCommands.js +71 -426
- package/dist/lib/xy/xyBuildCommands.js.map +1 -1
- package/dist/lib/xy/xyCommonCommands.d.ts +3 -0
- package/dist/lib/xy/xyCommonCommands.d.ts.map +1 -0
- package/dist/lib/xy/xyCommonCommands.js +102 -807
- package/dist/lib/xy/xyCommonCommands.js.map +1 -1
- package/dist/lib/xy/xyDeployCommands.d.ts +3 -0
- package/dist/lib/xy/xyDeployCommands.d.ts.map +1 -0
- package/dist/lib/xy/xyDeployCommands.js +35 -227
- package/dist/lib/xy/xyDeployCommands.js.map +1 -1
- package/dist/lib/xy/xyInstallCommands.d.ts +3 -0
- package/dist/lib/xy/xyInstallCommands.d.ts.map +1 -0
- package/dist/lib/xy/xyInstallCommands.js +52 -491
- package/dist/lib/xy/xyInstallCommands.js.map +1 -1
- package/dist/lib/xy/xyLintCommands.d.ts +3 -0
- package/dist/lib/xy/xyLintCommands.d.ts.map +1 -0
- package/dist/lib/xy/xyLintCommands.js +71 -365
- package/dist/lib/xy/xyLintCommands.js.map +1 -1
- package/dist/lib/xy/xyParseOptions.d.ts +3 -0
- package/dist/lib/xy/xyParseOptions.d.ts.map +1 -0
- package/dist/lib/xy/xyParseOptions.js +52 -77
- package/dist/lib/xy/xyParseOptions.js.map +1 -1
- package/dist/lib/yarn/index.d.ts +4 -0
- package/dist/lib/yarn/index.d.ts.map +1 -0
- package/dist/lib/yarn/index.js +5 -77
- package/dist/lib/yarn/index.js.map +1 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.d.ts +2 -0
- package/dist/lib/yarn/isYarnVersionOrGreater.d.ts.map +1 -0
- package/dist/lib/yarn/isYarnVersionOrGreater.js +15 -40
- package/dist/lib/yarn/isYarnVersionOrGreater.js.map +1 -1
- package/dist/lib/yarn/workspace/Workspace.d.ts +5 -0
- package/dist/lib/yarn/workspace/Workspace.d.ts.map +1 -0
- package/dist/lib/yarn/workspace/Workspace.js +1 -17
- package/dist/lib/yarn/workspace/Workspace.js.map +1 -1
- package/dist/lib/yarn/workspace/index.d.ts +4 -0
- package/dist/lib/yarn/workspace/index.d.ts.map +1 -0
- package/dist/lib/yarn/workspace/index.js +5 -51
- package/dist/lib/yarn/workspace/index.js.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.d.ts +3 -0
- package/dist/lib/yarn/workspace/yarnWorkspace.d.ts.map +1 -0
- package/dist/lib/yarn/workspace/yarnWorkspace.js +10 -49
- package/dist/lib/yarn/workspace/yarnWorkspace.js.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.d.ts +3 -0
- package/dist/lib/yarn/workspace/yarnWorkspaces.d.ts.map +1 -0
- package/dist/lib/yarn/workspace/yarnWorkspaces.js +19 -38
- package/dist/lib/yarn/workspace/yarnWorkspaces.js.map +1 -1
- package/dist/lib/yarn/yarnInitCwd.d.ts +2 -0
- package/dist/lib/yarn/yarnInitCwd.d.ts.map +1 -0
- package/dist/lib/yarn/yarnInitCwd.js +7 -32
- package/dist/lib/yarn/yarnInitCwd.js.map +1 -1
- package/package.json +11 -5
- package/src/actions/index.ts +0 -5
- package/src/actions/package/compile.ts +64 -12
- package/src/actions/package/gen-docs.ts +1 -1
- package/src/actions/package/index.ts +1 -4
- package/src/actions/package/publint.ts +1 -2
- package/src/actions/package/tsup.ts +31 -0
- package/src/actions/package/types.d.ts +3 -0
- package/src/bin/package/publint.ts +1 -1
- package/src/bin/package/tsup.ts +9 -0
- package/src/lib/xy/xyCommonCommands.ts +0 -26
- package/tsconfig.build.json +8 -0
- package/tsconfig.json +4 -1
- package/dist/actions/build.mjs +0 -133
- package/dist/actions/build.mjs.map +0 -1
- package/dist/actions/clean-docs.mjs +0 -29
- package/dist/actions/clean-docs.mjs.map +0 -1
- package/dist/actions/clean-eslint.mjs +0 -15
- package/dist/actions/clean-eslint.mjs.map +0 -1
- package/dist/actions/clean-jest.mjs +0 -100
- package/dist/actions/clean-jest.mjs.map +0 -1
- package/dist/actions/clean.mjs +0 -210
- package/dist/actions/clean.mjs.map +0 -1
- package/dist/actions/compile.mjs +0 -124
- package/dist/actions/compile.mjs.map +0 -1
- package/dist/actions/copy-assets.mjs +0 -71
- package/dist/actions/copy-assets.mjs.map +0 -1
- package/dist/actions/cycle.mjs +0 -100
- package/dist/actions/cycle.mjs.map +0 -1
- package/dist/actions/dead.mjs +0 -99
- package/dist/actions/dead.mjs.map +0 -1
- package/dist/actions/deploy-major.mjs +0 -106
- package/dist/actions/deploy-major.mjs.map +0 -1
- package/dist/actions/deploy-minor.mjs +0 -106
- package/dist/actions/deploy-minor.mjs.map +0 -1
- package/dist/actions/deploy-next.mjs +0 -106
- package/dist/actions/deploy-next.mjs.map +0 -1
- package/dist/actions/deploy.mjs +0 -107
- package/dist/actions/deploy.mjs.map +0 -1
- package/dist/actions/deps.mjs +0 -121
- package/dist/actions/deps.mjs.map +0 -1
- package/dist/actions/dupdeps.mjs +0 -181
- package/dist/actions/dupdeps.mjs.map +0 -1
- package/dist/actions/fix.mjs +0 -99
- package/dist/actions/fix.mjs.map +0 -1
- package/dist/actions/gen-docs.mjs +0 -110
- package/dist/actions/gen-docs.mjs.map +0 -1
- package/dist/actions/gitignore-gen.mjs +0 -87
- package/dist/actions/gitignore-gen.mjs.map +0 -1
- package/dist/actions/gitlint-fix.mjs +0 -27
- package/dist/actions/gitlint-fix.mjs.map +0 -1
- package/dist/actions/gitlint.mjs +0 -48
- package/dist/actions/gitlint.mjs.map +0 -1
- package/dist/actions/index.mjs +0 -1590
- package/dist/actions/index.mjs.map +0 -1
- package/dist/actions/license.mjs +0 -87
- package/dist/actions/license.mjs.map +0 -1
- package/dist/actions/lint-clean.mjs +0 -147
- package/dist/actions/lint-clean.mjs.map +0 -1
- package/dist/actions/lint-profile.mjs +0 -99
- package/dist/actions/lint-profile.mjs.map +0 -1
- package/dist/actions/lint.mjs +0 -137
- package/dist/actions/lint.mjs.map +0 -1
- package/dist/actions/npmignore-gen.mjs +0 -87
- package/dist/actions/npmignore-gen.mjs.map +0 -1
- package/dist/actions/package/clean-outputs.mjs +0 -18
- package/dist/actions/package/clean-outputs.mjs.map +0 -1
- package/dist/actions/package/clean-typescript.mjs +0 -18
- package/dist/actions/package/clean-typescript.mjs.map +0 -1
- package/dist/actions/package/clean.mjs +0 -38
- package/dist/actions/package/clean.mjs.map +0 -1
- package/dist/actions/package/compile-cjs.js +0 -268
- package/dist/actions/package/compile-cjs.js.map +0 -1
- package/dist/actions/package/compile-cjs.mjs +0 -231
- package/dist/actions/package/compile-cjs.mjs.map +0 -1
- package/dist/actions/package/compile-esm.js +0 -270
- package/dist/actions/package/compile-esm.js.map +0 -1
- package/dist/actions/package/compile-esm.mjs +0 -233
- package/dist/actions/package/compile-esm.mjs.map +0 -1
- package/dist/actions/package/compile.mjs +0 -286
- package/dist/actions/package/compile.mjs.map +0 -1
- package/dist/actions/package/copy-assets.mjs +0 -43
- package/dist/actions/package/copy-assets.mjs.map +0 -1
- package/dist/actions/package/deps.mjs +0 -96
- package/dist/actions/package/deps.mjs.map +0 -1
- package/dist/actions/package/gen-docs.mjs +0 -112
- package/dist/actions/package/gen-docs.mjs.map +0 -1
- package/dist/actions/package/index.mjs +0 -543
- package/dist/actions/package/index.mjs.map +0 -1
- package/dist/actions/package/publint.mjs +0 -21
- package/dist/actions/package/publint.mjs.map +0 -1
- package/dist/actions/package/recompile.mjs +0 -326
- package/dist/actions/package/recompile.mjs.map +0 -1
- package/dist/actions/package/tsconfig-gen-cjs.js +0 -111
- package/dist/actions/package/tsconfig-gen-cjs.js.map +0 -1
- package/dist/actions/package/tsconfig-gen-cjs.mjs +0 -76
- package/dist/actions/package/tsconfig-gen-cjs.mjs.map +0 -1
- package/dist/actions/package/tsconfig-gen-esm.js +0 -113
- package/dist/actions/package/tsconfig-gen-esm.js.map +0 -1
- package/dist/actions/package/tsconfig-gen-esm.mjs +0 -78
- package/dist/actions/package/tsconfig-gen-esm.mjs.map +0 -1
- package/dist/actions/publint.mjs +0 -168
- package/dist/actions/publint.mjs.map +0 -1
- package/dist/actions/rebuild.mjs +0 -102
- package/dist/actions/rebuild.mjs.map +0 -1
- package/dist/actions/recompile.mjs +0 -140
- package/dist/actions/recompile.mjs.map +0 -1
- package/dist/actions/reinstall.mjs +0 -130
- package/dist/actions/reinstall.mjs.map +0 -1
- package/dist/actions/relint.mjs +0 -128
- package/dist/actions/relint.mjs.map +0 -1
- package/dist/actions/retest.mjs +0 -102
- package/dist/actions/retest.mjs.map +0 -1
- package/dist/actions/sonar.mjs +0 -99
- package/dist/actions/sonar.mjs.map +0 -1
- package/dist/actions/statics.mjs +0 -181
- package/dist/actions/statics.mjs.map +0 -1
- package/dist/actions/test.mjs +0 -99
- package/dist/actions/test.mjs.map +0 -1
- package/dist/actions/tsconfig-gen-cjs.js +0 -134
- package/dist/actions/tsconfig-gen-cjs.js.map +0 -1
- package/dist/actions/tsconfig-gen-cjs.mjs +0 -99
- package/dist/actions/tsconfig-gen-cjs.mjs.map +0 -1
- package/dist/actions/tsconfig-gen-clean.js +0 -80
- package/dist/actions/tsconfig-gen-clean.js.map +0 -1
- package/dist/actions/tsconfig-gen-clean.mjs +0 -45
- package/dist/actions/tsconfig-gen-clean.mjs.map +0 -1
- package/dist/actions/tsconfig-gen-esm.js +0 -134
- package/dist/actions/tsconfig-gen-esm.js.map +0 -1
- package/dist/actions/tsconfig-gen-esm.mjs +0 -99
- package/dist/actions/tsconfig-gen-esm.mjs.map +0 -1
- package/dist/actions/tsconfig-gen-test.js +0 -97
- package/dist/actions/tsconfig-gen-test.js.map +0 -1
- package/dist/actions/tsconfig-gen-test.mjs +0 -62
- package/dist/actions/tsconfig-gen-test.mjs.map +0 -1
- package/dist/actions/tsconfig-gen.js +0 -215
- package/dist/actions/tsconfig-gen.js.map +0 -1
- package/dist/actions/tsconfig-gen.mjs +0 -178
- package/dist/actions/tsconfig-gen.mjs.map +0 -1
- package/dist/actions/up.mjs +0 -99
- package/dist/actions/up.mjs.map +0 -1
- package/dist/actions/updo.mjs +0 -103
- package/dist/actions/updo.mjs.map +0 -1
- package/dist/actions/upplug.mjs +0 -104
- package/dist/actions/upplug.mjs.map +0 -1
- package/dist/actions/upyarn.mjs +0 -99
- package/dist/actions/upyarn.mjs.map +0 -1
- package/dist/actions/yarn3only.mjs +0 -60
- package/dist/actions/yarn3only.mjs.map +0 -1
- package/dist/bin/build.mjs +0 -13
- package/dist/bin/build.mjs.map +0 -1
- package/dist/bin/clean.mjs +0 -13
- package/dist/bin/clean.mjs.map +0 -1
- package/dist/bin/compile.mjs +0 -13
- package/dist/bin/compile.mjs.map +0 -1
- package/dist/bin/cycle.mjs +0 -13
- package/dist/bin/cycle.mjs.map +0 -1
- package/dist/bin/dead.mjs +0 -13
- package/dist/bin/dead.mjs.map +0 -1
- package/dist/bin/deploy-major.mjs +0 -13
- package/dist/bin/deploy-major.mjs.map +0 -1
- package/dist/bin/deploy-minor.mjs +0 -13
- package/dist/bin/deploy-minor.mjs.map +0 -1
- package/dist/bin/deploy-next.mjs +0 -13
- package/dist/bin/deploy-next.mjs.map +0 -1
- package/dist/bin/deploy.mjs +0 -13
- package/dist/bin/deploy.mjs.map +0 -1
- package/dist/bin/deps.mjs +0 -13
- package/dist/bin/deps.mjs.map +0 -1
- package/dist/bin/fix.mjs +0 -13
- package/dist/bin/fix.mjs.map +0 -1
- package/dist/bin/gen-docs.mjs +0 -13
- package/dist/bin/gen-docs.mjs.map +0 -1
- package/dist/bin/gitlint-fix.mjs +0 -13
- package/dist/bin/gitlint-fix.mjs.map +0 -1
- package/dist/bin/gitlint.mjs +0 -13
- package/dist/bin/gitlint.mjs.map +0 -1
- package/dist/bin/license.mjs +0 -13
- package/dist/bin/license.mjs.map +0 -1
- package/dist/bin/lint-clean.mjs +0 -13
- package/dist/bin/lint-clean.mjs.map +0 -1
- package/dist/bin/lint-fast.mjs +0 -13
- package/dist/bin/lint-fast.mjs.map +0 -1
- package/dist/bin/lint-profile.mjs +0 -13
- package/dist/bin/lint-profile.mjs.map +0 -1
- package/dist/bin/lint.mjs +0 -13
- package/dist/bin/lint.mjs.map +0 -1
- package/dist/bin/package/clean-outputs.mjs +0 -20
- package/dist/bin/package/clean-outputs.mjs.map +0 -1
- package/dist/bin/package/clean-typescript.mjs +0 -20
- package/dist/bin/package/clean-typescript.mjs.map +0 -1
- package/dist/bin/package/clean.mjs +0 -40
- package/dist/bin/package/clean.mjs.map +0 -1
- package/dist/bin/package/compile-cjs.js +0 -262
- package/dist/bin/package/compile-cjs.js.map +0 -1
- package/dist/bin/package/compile-cjs.mjs +0 -239
- package/dist/bin/package/compile-cjs.mjs.map +0 -1
- package/dist/bin/package/compile-esm.js +0 -264
- package/dist/bin/package/compile-esm.js.map +0 -1
- package/dist/bin/package/compile-esm.mjs +0 -241
- package/dist/bin/package/compile-esm.mjs.map +0 -1
- package/dist/bin/package/compile.mjs +0 -294
- package/dist/bin/package/compile.mjs.map +0 -1
- package/dist/bin/package/copy-assets-cjs.mjs +0 -51
- package/dist/bin/package/copy-assets-cjs.mjs.map +0 -1
- package/dist/bin/package/copy-assets-esm.mjs +0 -51
- package/dist/bin/package/copy-assets-esm.mjs.map +0 -1
- package/dist/bin/package/deps.mjs +0 -102
- package/dist/bin/package/deps.mjs.map +0 -1
- package/dist/bin/package/gen-docs.mjs +0 -114
- package/dist/bin/package/gen-docs.mjs.map +0 -1
- package/dist/bin/package/publint.mjs +0 -29
- package/dist/bin/package/publint.mjs.map +0 -1
- package/dist/bin/package/recompile.mjs +0 -334
- package/dist/bin/package/recompile.mjs.map +0 -1
- package/dist/bin/package/tsconfig-gen-cjs.js +0 -99
- package/dist/bin/package/tsconfig-gen-cjs.js.map +0 -1
- package/dist/bin/package/tsconfig-gen-cjs.mjs +0 -76
- package/dist/bin/package/tsconfig-gen-cjs.mjs.map +0 -1
- package/dist/bin/package/tsconfig-gen-esm.js +0 -101
- package/dist/bin/package/tsconfig-gen-esm.js.map +0 -1
- package/dist/bin/package/tsconfig-gen-esm.mjs +0 -78
- package/dist/bin/package/tsconfig-gen-esm.mjs.map +0 -1
- package/dist/bin/package/tsconfig-gen.js +0 -131
- package/dist/bin/package/tsconfig-gen.js.map +0 -1
- package/dist/bin/package/tsconfig-gen.mjs +0 -108
- package/dist/bin/package/tsconfig-gen.mjs.map +0 -1
- package/dist/bin/publint.mjs +0 -13
- package/dist/bin/publint.mjs.map +0 -1
- package/dist/bin/rebuild.mjs +0 -13
- package/dist/bin/rebuild.mjs.map +0 -1
- package/dist/bin/recompile.mjs +0 -13
- package/dist/bin/recompile.mjs.map +0 -1
- package/dist/bin/reinstall.mjs +0 -13
- package/dist/bin/reinstall.mjs.map +0 -1
- package/dist/bin/relint.mjs +0 -13
- package/dist/bin/relint.mjs.map +0 -1
- package/dist/bin/sonar.mjs +0 -13
- package/dist/bin/sonar.mjs.map +0 -1
- package/dist/bin/test.mjs +0 -13
- package/dist/bin/test.mjs.map +0 -1
- package/dist/bin/tsconfig-gen-clean.mjs +0 -13
- package/dist/bin/tsconfig-gen-clean.mjs.map +0 -1
- package/dist/bin/tsconfig-gen.mjs +0 -13
- package/dist/bin/tsconfig-gen.mjs.map +0 -1
- package/dist/bin/up.mjs +0 -13
- package/dist/bin/up.mjs.map +0 -1
- package/dist/bin/updo.mjs +0 -13
- package/dist/bin/updo.mjs.map +0 -1
- package/dist/bin/upplug.mjs +0 -13
- package/dist/bin/upplug.mjs.map +0 -1
- package/dist/bin/upyarn.mjs +0 -13
- package/dist/bin/upyarn.mjs.map +0 -1
- package/dist/bin/xy-ts.mjs +0 -1660
- package/dist/bin/xy-ts.mjs.map +0 -1
- package/dist/bin/xy.mjs +0 -1660
- package/dist/bin/xy.mjs.map +0 -1
- package/dist/bin/yarn3only.mjs +0 -13
- package/dist/bin/yarn3only.mjs.map +0 -1
- package/dist/index.d.mts +0 -319
- package/dist/index.mjs +0 -2191
- package/dist/index.mjs.map +0 -1
- package/dist/lib/checkResult.mjs +0 -16
- package/dist/lib/checkResult.mjs.map +0 -1
- package/dist/lib/createBuildConfig.mjs +0 -45
- package/dist/lib/createBuildConfig.mjs.map +0 -1
- package/dist/lib/defaultBuildConfig.mjs +0 -13
- package/dist/lib/defaultBuildConfig.mjs.map +0 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs +0 -77
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +0 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +0 -162
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +0 -1
- package/dist/lib/dependencies/index.mjs +0 -163
- package/dist/lib/dependencies/index.mjs.map +0 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs +0 -6
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +0 -1
- package/dist/lib/file/constants.mjs +0 -8
- package/dist/lib/file/constants.mjs.map +0 -1
- package/dist/lib/file/fileLines.mjs +0 -29
- package/dist/lib/file/fileLines.mjs.map +0 -1
- package/dist/lib/file/index.mjs +0 -39
- package/dist/lib/file/index.mjs.map +0 -1
- package/dist/lib/file/tryReadFileSync.mjs +0 -14
- package/dist/lib/file/tryReadFileSync.mjs.map +0 -1
- package/dist/lib/generateIgnoreFiles.mjs +0 -83
- package/dist/lib/generateIgnoreFiles.mjs.map +0 -1
- package/dist/lib/index.mjs +0 -1715
- package/dist/lib/index.mjs.map +0 -1
- package/dist/lib/jsonFormatters.mjs +0 -11
- package/dist/lib/jsonFormatters.mjs.map +0 -1
- package/dist/lib/parsedPackageJSON.mjs +0 -11
- package/dist/lib/parsedPackageJSON.mjs.map +0 -1
- package/dist/lib/processEx.mjs +0 -36
- package/dist/lib/processEx.mjs.map +0 -1
- package/dist/lib/runSteps.mjs +0 -96
- package/dist/lib/runSteps.mjs.map +0 -1
- package/dist/lib/runStepsAsync.mjs +0 -113
- package/dist/lib/runStepsAsync.mjs.map +0 -1
- package/dist/lib/runXy.mjs +0 -101
- package/dist/lib/runXy.mjs.map +0 -1
- package/dist/lib/runXyWithWarning.mjs +0 -11
- package/dist/lib/runXyWithWarning.mjs.map +0 -1
- package/dist/lib/safeExit.mjs +0 -61
- package/dist/lib/safeExit.mjs.map +0 -1
- package/dist/lib/string/empty.mjs +0 -8
- package/dist/lib/string/empty.mjs.map +0 -1
- package/dist/lib/string/index.mjs +0 -12
- package/dist/lib/string/index.mjs.map +0 -1
- package/dist/lib/string/union.mjs +0 -6
- package/dist/lib/string/union.mjs.map +0 -1
- package/dist/lib/withErrnoException.mjs +0 -13
- package/dist/lib/withErrnoException.mjs.map +0 -1
- package/dist/lib/withError.mjs +0 -8
- package/dist/lib/withError.mjs.map +0 -1
- package/dist/lib/xy/index.mjs +0 -1666
- package/dist/lib/xy/index.mjs.map +0 -1
- package/dist/lib/xy/xy.mjs +0 -1660
- package/dist/lib/xy/xy.mjs.map +0 -1
- package/dist/lib/xy/xyBuildCommands.mjs +0 -393
- package/dist/lib/xy/xyBuildCommands.mjs.map +0 -1
- package/dist/lib/xy/xyCommonCommands.mjs +0 -774
- package/dist/lib/xy/xyCommonCommands.mjs.map +0 -1
- package/dist/lib/xy/xyDeployCommands.mjs +0 -192
- package/dist/lib/xy/xyDeployCommands.mjs.map +0 -1
- package/dist/lib/xy/xyInstallCommands.mjs +0 -459
- package/dist/lib/xy/xyInstallCommands.mjs.map +0 -1
- package/dist/lib/xy/xyLintCommands.mjs +0 -334
- package/dist/lib/xy/xyLintCommands.mjs.map +0 -1
- package/dist/lib/xy/xyParseOptions.mjs +0 -45
- package/dist/lib/xy/xyParseOptions.mjs.map +0 -1
- package/dist/lib/yarn/index.mjs +0 -49
- package/dist/lib/yarn/index.mjs.map +0 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs +0 -18
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +0 -1
- package/dist/lib/yarn/workspace/Workspace.mjs +0 -1
- package/dist/lib/yarn/workspace/Workspace.mjs.map +0 -1
- package/dist/lib/yarn/workspace/index.mjs +0 -25
- package/dist/lib/yarn/workspace/index.mjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs +0 -24
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +0 -16
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +0 -1
- package/dist/lib/yarn/yarnInitCwd.mjs +0 -10
- package/dist/lib/yarn/yarnInitCwd.mjs.map +0 -1
- package/src/actions/package/compile-cjs.ts +0 -15
- package/src/actions/package/compile-esm.ts +0 -15
- package/src/actions/package/tsconfig-gen-cjs.ts +0 -32
- package/src/actions/package/tsconfig-gen-esm.ts +0 -34
- package/src/actions/tsconfig-gen-cjs.ts +0 -35
- package/src/actions/tsconfig-gen-clean.ts +0 -22
- package/src/actions/tsconfig-gen-esm.ts +0 -34
- package/src/actions/tsconfig-gen-test.ts +0 -39
- package/src/actions/tsconfig-gen.ts +0 -19
- package/src/bin/package/compile-cjs.ts +0 -9
- package/src/bin/package/compile-esm.ts +0 -9
- package/src/bin/package/tsconfig-gen-cjs.ts +0 -5
- package/src/bin/package/tsconfig-gen-esm.ts +0 -5
- package/src/bin/package/tsconfig-gen.ts +0 -6
- package/tsup.config.ts +0 -16
package/dist/actions/index.js
CHANGED
|
@@ -1,1695 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
cycle: () => cycle,
|
|
43
|
-
dead: () => dead,
|
|
44
|
-
deploy: () => deploy,
|
|
45
|
-
deployMajor: () => deployMajor,
|
|
46
|
-
deployMinor: () => deployMinor,
|
|
47
|
-
deployNext: () => deployNext,
|
|
48
|
-
deps: () => deps,
|
|
49
|
-
depsAll: () => depsAll,
|
|
50
|
-
depsPackage: () => depsPackage,
|
|
51
|
-
dupdeps: () => dupdeps,
|
|
52
|
-
fix: () => fix,
|
|
53
|
-
genDocs: () => genDocs,
|
|
54
|
-
genDocsAll: () => genDocsAll,
|
|
55
|
-
genDocsPackage: () => genDocsPackage,
|
|
56
|
-
gitignoreGen: () => gitignoreGen,
|
|
57
|
-
gitlint: () => gitlint,
|
|
58
|
-
gitlintFix: () => gitlintFix,
|
|
59
|
-
license: () => license,
|
|
60
|
-
lint: () => lint,
|
|
61
|
-
lintAll: () => lintAll,
|
|
62
|
-
lintClean: () => lintClean,
|
|
63
|
-
lintPackage: () => lintPackage,
|
|
64
|
-
lintProfile: () => lintProfile,
|
|
65
|
-
npmignoreGen: () => npmignoreGen,
|
|
66
|
-
packageClean: () => packageClean,
|
|
67
|
-
packageCleanOutputs: () => packageCleanOutputs,
|
|
68
|
-
packageCleanTypescript: () => packageCleanTypescript,
|
|
69
|
-
packageCompile: () => packageCompile,
|
|
70
|
-
packageCompileCjs: () => packageCompileCjs,
|
|
71
|
-
packageCompileEsm: () => packageCompileEsm,
|
|
72
|
-
packageCopyAssets: () => packageCopyAssets,
|
|
73
|
-
packageDeps: () => packageDeps,
|
|
74
|
-
packageGenDocs: () => packageGenDocs,
|
|
75
|
-
packagePublint: () => packagePublint,
|
|
76
|
-
packageRecompile: () => packageRecompile,
|
|
77
|
-
packageTsconfigGenCjs: () => packageTsconfigGenCjs,
|
|
78
|
-
packageTsconfigGenEsm: () => packageTsconfigGenEsm,
|
|
79
|
-
publint: () => publint,
|
|
80
|
-
publintAll: () => publintAll,
|
|
81
|
-
publintPackage: () => publintPackage,
|
|
82
|
-
rebuild: () => rebuild,
|
|
83
|
-
recompile: () => recompile,
|
|
84
|
-
recompileAll: () => recompileAll,
|
|
85
|
-
recompilePackage: () => recompilePackage,
|
|
86
|
-
reinstall: () => reinstall,
|
|
87
|
-
relint: () => relint,
|
|
88
|
-
retest: () => retest,
|
|
89
|
-
sonar: () => sonar,
|
|
90
|
-
statics: () => statics,
|
|
91
|
-
test: () => test,
|
|
92
|
-
tsconfigGen: () => tsconfigGen,
|
|
93
|
-
tsconfigGenCjs: () => tsconfigGenCjs,
|
|
94
|
-
tsconfigGenClean: () => tsconfigGenClean,
|
|
95
|
-
tsconfigGenEsm: () => tsconfigGenEsm,
|
|
96
|
-
tsconfigGenTest: () => tsconfigGenTest,
|
|
97
|
-
up: () => up,
|
|
98
|
-
updateYarnPlugins: () => updateYarnPlugins,
|
|
99
|
-
updateYarnVersion: () => updateYarnVersion,
|
|
100
|
-
updo: () => updo,
|
|
101
|
-
yarn3Only: () => yarn3Only
|
|
102
|
-
});
|
|
103
|
-
module.exports = __toCommonJS(actions_exports);
|
|
104
|
-
|
|
105
|
-
// src/actions/build.ts
|
|
106
|
-
var import_chalk7 = __toESM(require("chalk"));
|
|
107
|
-
|
|
108
|
-
// src/lib/checkResult.ts
|
|
109
|
-
var import_chalk = __toESM(require("chalk"));
|
|
110
|
-
var checkResult = (name, result, level = "error", exitOnFail = false) => {
|
|
111
|
-
if (result) {
|
|
112
|
-
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
113
|
-
const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
|
|
114
|
-
console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
|
|
115
|
-
if (exitOnFail) {
|
|
116
|
-
process.exit(result);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// src/lib/createBuildConfig.ts
|
|
122
|
-
var import_fs = require("fs");
|
|
123
|
-
|
|
124
|
-
// src/lib/defaultBuildConfig.ts
|
|
125
|
-
var defaultBuildConfig = {
|
|
126
|
-
compilerOptions: {
|
|
127
|
-
rootDir: "src",
|
|
128
|
-
rootDirs: ["package.json"]
|
|
129
|
-
},
|
|
130
|
-
exclude: ["**/build", "**/dist", "**/node_modules", "**/*.spec.*", "**/*.spec", "**/*.stories.*", "**/*.example.*", "**/spec/*", "**/stories/*"],
|
|
131
|
-
include: ["src"]
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
// src/lib/createBuildConfig.ts
|
|
135
|
-
var getGeneralTypescriptConfig = (location) => {
|
|
136
|
-
let generalConfig;
|
|
137
|
-
try {
|
|
138
|
-
generalConfig = (0, import_fs.readFileSync)(`${location}/tsconfig.json`, { encoding: "utf8" });
|
|
139
|
-
} catch (ex) {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
return JSON.parse(generalConfig);
|
|
143
|
-
};
|
|
144
|
-
var createBuildConfig = (location, module2, target, outDirSuffix) => {
|
|
145
|
-
const generalConfigObject = getGeneralTypescriptConfig(location);
|
|
146
|
-
if (generalConfigObject === false) {
|
|
147
|
-
return void 0;
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
...generalConfigObject,
|
|
151
|
-
compilerOptions: {
|
|
152
|
-
...defaultBuildConfig.compilerOptions,
|
|
153
|
-
...generalConfigObject.compilerOptions ?? {},
|
|
154
|
-
module: module2,
|
|
155
|
-
outDir: `./${generalConfigObject.compilerOptions?.outDir ?? "dist"}/${outDirSuffix}`,
|
|
156
|
-
target
|
|
157
|
-
},
|
|
158
|
-
exclude: [...generalConfigObject.exclude ?? [], ...defaultBuildConfig.exclude],
|
|
159
|
-
include: [...generalConfigObject.include ?? [], ...defaultBuildConfig.include]
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
164
|
-
var import_child_process = require("child_process");
|
|
165
|
-
|
|
166
|
-
// src/lib/processEx.ts
|
|
167
|
-
var import_chalk2 = __toESM(require("chalk"));
|
|
168
|
-
|
|
169
|
-
// src/lib/withError.ts
|
|
170
|
-
var withError = (ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
|
|
171
|
-
return predicate(ex) ? closure(ex) : void 0;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// src/lib/withErrnoException.ts
|
|
175
|
-
var withErrnoException = (ex, closure) => {
|
|
176
|
-
return withError(ex, closure, (ex2) => ex2.errno !== void 0);
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
// src/lib/processEx.ts
|
|
180
|
-
var processEx = (ex) => {
|
|
181
|
-
const error = typeof ex === "string" ? Error(ex) : ex;
|
|
182
|
-
const exitCode = withErrnoException(error, (error2) => {
|
|
183
|
-
if (error2.code === "ENOENT") {
|
|
184
|
-
console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
|
|
185
|
-
} else {
|
|
186
|
-
console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
|
|
187
|
-
}
|
|
188
|
-
return error2.errno ?? -1;
|
|
189
|
-
}) ?? withError(error, (error2) => {
|
|
190
|
-
console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
|
|
191
|
-
return -1;
|
|
192
|
-
}) ?? (() => {
|
|
193
|
-
console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
|
|
194
|
-
return -1;
|
|
195
|
-
})();
|
|
196
|
-
process.exit(process.exitCode ?? exitCode);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
// src/lib/safeExit.ts
|
|
200
|
-
var safeExit = (func, exitOnFail = true) => {
|
|
201
|
-
try {
|
|
202
|
-
const result = func();
|
|
203
|
-
if (result && exitOnFail) {
|
|
204
|
-
process.exit(result);
|
|
205
|
-
}
|
|
206
|
-
return result;
|
|
207
|
-
} catch (ex) {
|
|
208
|
-
return processEx(ex);
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
var safeExitAsync = async (func, exitOnFail = true) => {
|
|
212
|
-
try {
|
|
213
|
-
const result = await func();
|
|
214
|
-
if (result && exitOnFail) {
|
|
215
|
-
process.exit(result);
|
|
216
|
-
}
|
|
217
|
-
return result;
|
|
218
|
-
} catch (ex) {
|
|
219
|
-
return processEx(ex);
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
// src/lib/dependencies/DuplicateDetector.ts
|
|
224
|
-
var import_chalk3 = __toESM(require("chalk"));
|
|
225
|
-
var import_uniq = __toESM(require("lodash/uniq"));
|
|
226
|
-
var import_os = require("os");
|
|
227
|
-
|
|
228
|
-
// src/lib/jsonFormatters.ts
|
|
229
|
-
var multiLineToJSONArray = (output) => {
|
|
230
|
-
const withCommas = output.replace(/\r\n/g, "").replace(/\n/g, ",");
|
|
231
|
-
const cleanCollection = withCommas.substring(0, withCommas.length - 1);
|
|
232
|
-
const collection = `[${cleanCollection}]`;
|
|
233
|
-
return JSON.parse(collection);
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// src/lib/dependencies/DuplicateDetector.ts
|
|
237
|
-
var trimVirtualMeta = (value) => {
|
|
238
|
-
const virtualParts = value.split("virtual:");
|
|
239
|
-
if (virtualParts.length > 1) {
|
|
240
|
-
const hashParts = virtualParts[1].split("#");
|
|
241
|
-
return virtualParts[0] + hashParts[1];
|
|
242
|
-
} else {
|
|
243
|
-
return value;
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
var trimObjectDependencyVirtualMeta = (obj) => {
|
|
247
|
-
const resultObj = {};
|
|
248
|
-
Object.entries(obj).forEach(([key, value]) => {
|
|
249
|
-
resultObj[trimVirtualMeta(key)] = {
|
|
250
|
-
descriptor: trimVirtualMeta(value.descriptor),
|
|
251
|
-
locator: trimVirtualMeta(value.locator)
|
|
252
|
-
};
|
|
253
|
-
});
|
|
254
|
-
return resultObj;
|
|
255
|
-
};
|
|
256
|
-
var trimDependencyVirtualMeta = (dependencies) => {
|
|
257
|
-
return dependencies.map((dependency) => {
|
|
258
|
-
return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) };
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
var DuplicateDetector = class {
|
|
262
|
-
dependency;
|
|
263
|
-
dependencyEntries;
|
|
264
|
-
constructor(output, dependency) {
|
|
265
|
-
this.dependency = dependency;
|
|
266
|
-
this.dependencyEntries = trimDependencyVirtualMeta(multiLineToJSONArray(output));
|
|
267
|
-
}
|
|
268
|
-
detect() {
|
|
269
|
-
const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency));
|
|
270
|
-
if (result.duplicateVersions.length) {
|
|
271
|
-
console.log(import_chalk3.default.yellow(`${import_os.EOL}Duplicates found for: ${this.dependency}`));
|
|
272
|
-
console.log(import_chalk3.default.grey(` ${result.duplicateVersions.toString().replaceAll(",", `${import_os.EOL} `)}`, import_os.EOL));
|
|
273
|
-
return 1;
|
|
274
|
-
} else {
|
|
275
|
-
console.log(`${this.dependency} - OK`);
|
|
276
|
-
return 0;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
detectReducer(acc, entry) {
|
|
280
|
-
const version = Object.entries(entry.children).map(([k]) => k)[0];
|
|
281
|
-
if (!acc.currentVersion) {
|
|
282
|
-
acc.currentVersion = version;
|
|
283
|
-
return acc;
|
|
284
|
-
}
|
|
285
|
-
if (acc.currentVersion && acc.currentVersion !== version && !version.includes("@virtual:")) {
|
|
286
|
-
if (acc.duplicateVersions.length === 0) {
|
|
287
|
-
acc.duplicateVersions.push(acc.currentVersion);
|
|
288
|
-
}
|
|
289
|
-
acc.duplicateVersions.push(version);
|
|
290
|
-
acc.duplicateVersions = (0, import_uniq.default)(acc.duplicateVersions);
|
|
291
|
-
}
|
|
292
|
-
return acc;
|
|
293
|
-
}
|
|
294
|
-
resultsFactory = (dependency) => ({ currentVersion: void 0, dependency, duplicateVersions: [] });
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
298
|
-
var detectDuplicateDependencies = (depsFromPackageJSON, DefaultDependencies2) => {
|
|
299
|
-
let exitCode = 0;
|
|
300
|
-
const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
|
|
301
|
-
return safeExit(() => {
|
|
302
|
-
if (dependencies) {
|
|
303
|
-
dependencies.forEach((dependency) => {
|
|
304
|
-
let output;
|
|
305
|
-
try {
|
|
306
|
-
const cmd = `yarn why ${dependency} --json`;
|
|
307
|
-
output = (0, import_child_process.execSync)(cmd).toString();
|
|
308
|
-
} catch (e) {
|
|
309
|
-
console.error(`Error running yarn why: ${e}`);
|
|
310
|
-
exitCode = 1;
|
|
311
|
-
return exitCode;
|
|
312
|
-
}
|
|
313
|
-
if (output) {
|
|
314
|
-
exitCode = new DuplicateDetector(output, dependency).detect();
|
|
315
|
-
return exitCode;
|
|
316
|
-
} else {
|
|
317
|
-
console.log(`${dependency} - N/A`);
|
|
318
|
-
if (depsFromPackageJSON) {
|
|
319
|
-
exitCode = 1;
|
|
320
|
-
console.log(`\u{1F6A8} Library ${dependency} was requested in package.json but not found`);
|
|
321
|
-
}
|
|
322
|
-
return exitCode;
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
return exitCode;
|
|
326
|
-
} else {
|
|
327
|
-
console.log("\u{1F6A8} No dependencies where passed");
|
|
328
|
-
return exitCode;
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
// src/lib/file/constants.ts
|
|
334
|
-
var WINDOWS_NEWLINE_REGEX = /\r\n/g;
|
|
335
|
-
var CROSS_PLATFORM_NEWLINE = "\n";
|
|
336
|
-
|
|
337
|
-
// src/lib/file/fileLines.ts
|
|
338
|
-
var import_node_fs = require("fs");
|
|
339
|
-
|
|
340
|
-
// src/lib/string/empty.ts
|
|
341
|
-
var empty = (value) => value?.trim().length === 0;
|
|
342
|
-
var notEmpty = (value) => !empty(value);
|
|
343
|
-
|
|
344
|
-
// src/lib/string/union.ts
|
|
345
|
-
var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
|
|
346
|
-
|
|
347
|
-
// src/lib/file/ReadFileSyncOptions.ts
|
|
348
|
-
var defaultReadFileSyncOptions = { encoding: "utf-8" };
|
|
349
|
-
|
|
350
|
-
// src/lib/file/fileLines.ts
|
|
351
|
-
var readLines = (uri, options = defaultReadFileSyncOptions) => (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
|
|
352
|
-
var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
|
|
353
|
-
var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
|
|
354
|
-
const existing = (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options) : void 0;
|
|
355
|
-
const desired = lines.join(CROSS_PLATFORM_NEWLINE);
|
|
356
|
-
if (existing !== desired)
|
|
357
|
-
(0, import_node_fs.writeFileSync)(uri, desired, options);
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
// src/lib/generateIgnoreFiles.ts
|
|
361
|
-
var import_chalk4 = __toESM(require("chalk"));
|
|
362
|
-
|
|
363
|
-
// src/lib/yarn/isYarnVersionOrGreater.ts
|
|
364
|
-
var import_child_process2 = require("child_process");
|
|
365
|
-
var isYarnVersionOrGreater = (major, minor, patch) => {
|
|
366
|
-
const result = (0, import_child_process2.spawnSync)("yarn", ["-v"], { encoding: "utf8", shell: true });
|
|
367
|
-
const version = result.stdout.toString().replaceAll("\n", "");
|
|
368
|
-
const versionNumbers = version.split(".").map((ver) => parseInt(ver));
|
|
369
|
-
const majorDelta = versionNumbers[0] - major;
|
|
370
|
-
const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1]);
|
|
371
|
-
const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2]);
|
|
372
|
-
const majorOk = majorDelta >= 0;
|
|
373
|
-
const minorOk = majorDelta > 0 || minorDelta >= 0;
|
|
374
|
-
const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
|
|
375
|
-
return [majorOk && minorOk && patchOk, version];
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
// src/lib/yarn/workspace/yarnWorkspaces.ts
|
|
379
|
-
var import_child_process3 = require("child_process");
|
|
380
|
-
var yarnWorkspaces = () => {
|
|
381
|
-
const result = (0, import_child_process3.spawnSync)("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
|
|
382
|
-
if (result.error) {
|
|
383
|
-
throw result.error;
|
|
384
|
-
}
|
|
385
|
-
const list = result.stdout.toString().split("\n").slice(0, -1).map((item) => {
|
|
386
|
-
return JSON.parse(item);
|
|
387
|
-
});
|
|
388
|
-
return list;
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
// src/lib/yarn/workspace/yarnWorkspace.ts
|
|
392
|
-
var yarnWorkspace = (pkg) => {
|
|
393
|
-
const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
|
|
394
|
-
if (!workspace)
|
|
395
|
-
throw new Error(`Workspace ${pkg} not found`);
|
|
396
|
-
return workspace;
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
// src/lib/yarn/yarnInitCwd.ts
|
|
400
|
-
var INIT_CWD = () => {
|
|
401
|
-
if (!process.env.INIT_CWD)
|
|
402
|
-
console.error("Missing INIT_CWD");
|
|
403
|
-
return process.env.INIT_CWD;
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
// src/lib/generateIgnoreFiles.ts
|
|
407
|
-
var mergeEntries = (a, b) => [...union(a, b)].sort();
|
|
408
|
-
var generateIgnoreFiles = (filename3, pkg) => {
|
|
409
|
-
console.log(import_chalk4.default.green(`Generate ${filename3} Files`));
|
|
410
|
-
const cwd = INIT_CWD() ?? ".";
|
|
411
|
-
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
412
|
-
const readEntries = (location) => readNonEmptyLines(`${location}/${filename3}`);
|
|
413
|
-
const writeEntries = (location, entries) => writeLines(`${location}/${filename3}`, entries);
|
|
414
|
-
const results = workspaces.map(({ location, name }) => {
|
|
415
|
-
try {
|
|
416
|
-
writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)));
|
|
417
|
-
return 0;
|
|
418
|
-
} catch (ex) {
|
|
419
|
-
const error = ex;
|
|
420
|
-
console.error(`Generate ${filename3} Files [${name}] [${error.message}]`);
|
|
421
|
-
return 1;
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
const succeeded = results.every((result) => result === 0);
|
|
425
|
-
return succeeded ? 0 : 1;
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// src/lib/parsedPackageJSON.ts
|
|
429
|
-
var import_fs2 = require("fs");
|
|
430
|
-
var parsedPackageJSON = (path8) => {
|
|
431
|
-
const pathToPackageJSON = path8 ?? process.env.npm_package_json ?? "";
|
|
432
|
-
const packageJSON = (0, import_fs2.readFileSync)(pathToPackageJSON).toString();
|
|
433
|
-
return JSON.parse(packageJSON);
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
// src/lib/runSteps.ts
|
|
437
|
-
var import_chalk5 = __toESM(require("chalk"));
|
|
438
|
-
var import_child_process4 = require("child_process");
|
|
439
|
-
var import_fs3 = require("fs");
|
|
440
|
-
var runSteps = (name, steps, exitOnFail = true, messages) => {
|
|
441
|
-
return safeExit(() => {
|
|
442
|
-
const pkgName = process.env.npm_package_name;
|
|
443
|
-
console.log(import_chalk5.default.green(`${name} [${pkgName}]`));
|
|
444
|
-
let totalStatus = 0;
|
|
445
|
-
for (let i = 0; i < steps.length; i++) {
|
|
446
|
-
const [command, args, config] = steps[i];
|
|
447
|
-
if (messages?.[i]) {
|
|
448
|
-
console.log(import_chalk5.default.gray(messages?.[i]));
|
|
449
|
-
}
|
|
450
|
-
const argList = Array.isArray(args) ? args : args.split(" ");
|
|
451
|
-
if (command === "node" && !(0, import_fs3.existsSync)(argList[0])) {
|
|
452
|
-
throw Error(`File not found [${argList[0]}]`);
|
|
453
|
-
}
|
|
454
|
-
const status = (0, import_child_process4.spawnSync)(command, Array.isArray(args) ? args : args.split(" "), {
|
|
455
|
-
...config,
|
|
456
|
-
encoding: "utf8",
|
|
457
|
-
env: { FORCE_COLOR: "3", ...process.env },
|
|
458
|
-
shell: true,
|
|
459
|
-
stdio: "inherit"
|
|
460
|
-
}).status ?? 0;
|
|
461
|
-
checkResult(name, status, "error", exitOnFail);
|
|
462
|
-
totalStatus += status ?? 0;
|
|
463
|
-
}
|
|
464
|
-
return totalStatus;
|
|
465
|
-
}, !!exitOnFail);
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
// src/lib/runStepsAsync.ts
|
|
469
|
-
var import_chalk6 = __toESM(require("chalk"));
|
|
470
|
-
var import_child_process5 = require("child_process");
|
|
471
|
-
var import_fs4 = require("fs");
|
|
472
|
-
var runStepAsync = (name, step, exitOnFail = true, message) => {
|
|
473
|
-
return new Promise((resolve) => {
|
|
474
|
-
const [command, args, config] = step;
|
|
475
|
-
if (message) {
|
|
476
|
-
console.log(import_chalk6.default.gray(message));
|
|
477
|
-
}
|
|
478
|
-
const argList = Array.isArray(args) ? args : args.split(" ");
|
|
479
|
-
if (command === "node" && !(0, import_fs4.existsSync)(argList[0])) {
|
|
480
|
-
throw Error(`File not found [${argList[0]}]`);
|
|
481
|
-
}
|
|
482
|
-
(0, import_child_process5.spawn)(command, Array.isArray(args) ? args : args.split(" "), {
|
|
483
|
-
...config,
|
|
484
|
-
env: { FORCE_COLOR: "3", ...process.env },
|
|
485
|
-
shell: true,
|
|
486
|
-
stdio: "inherit"
|
|
487
|
-
}).on("close", (code) => {
|
|
488
|
-
if (code) {
|
|
489
|
-
console.error(
|
|
490
|
-
import_chalk6.default.red(
|
|
491
|
-
`Command Exited With Non-Zero Result [${import_chalk6.default.gray(code)}] | ${import_chalk6.default.yellow(command)} ${import_chalk6.default.white(
|
|
492
|
-
Array.isArray(args) ? args.join(" ") : args
|
|
493
|
-
)}`
|
|
494
|
-
)
|
|
495
|
-
);
|
|
496
|
-
checkResult(name, code, "error", exitOnFail);
|
|
497
|
-
resolve(code);
|
|
498
|
-
} else {
|
|
499
|
-
resolve(0);
|
|
500
|
-
}
|
|
501
|
-
});
|
|
502
|
-
});
|
|
503
|
-
};
|
|
504
|
-
var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
|
|
505
|
-
return await safeExitAsync(async () => {
|
|
506
|
-
const pkgName = process.env.npm_package_name;
|
|
507
|
-
console.log(import_chalk6.default.green(`${name} [${pkgName}]`));
|
|
508
|
-
let result = 0;
|
|
509
|
-
for (let i = 0; i < steps.length; i++) {
|
|
510
|
-
result += await runStepAsync(name, steps[i], exitOnFail, messages?.[i]);
|
|
511
|
-
}
|
|
512
|
-
return result;
|
|
513
|
-
});
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
// src/actions/build.ts
|
|
517
|
-
var build = async ({ incremental, jobs, target, verbose, pkg }) => {
|
|
518
|
-
const start = Date.now();
|
|
519
|
-
const pkgOptions = pkg ? [pkg] : [];
|
|
520
|
-
const incrementalOptions = incremental ? ["-i"] : [];
|
|
521
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
522
|
-
const targetOptions = target ? ["-t", target] : [];
|
|
523
|
-
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
524
|
-
if (jobs) {
|
|
525
|
-
console.log(import_chalk7.default.blue(`Jobs set to [${jobs}]`));
|
|
526
|
-
}
|
|
527
|
-
const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
|
|
528
|
-
["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
|
|
529
|
-
["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]],
|
|
530
|
-
["yarn", ["xy", "deps", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]]
|
|
531
|
-
]);
|
|
532
|
-
console.log(`${import_chalk7.default.gray("Built in")} [${import_chalk7.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk7.default.gray("seconds")}`);
|
|
533
|
-
return result;
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
// src/actions/clean-docs.ts
|
|
537
|
-
var import_chalk8 = __toESM(require("chalk"));
|
|
538
|
-
var import_path = __toESM(require("path"));
|
|
539
|
-
var import_rimraf = require("rimraf");
|
|
540
|
-
var cleanDocs = () => {
|
|
541
|
-
const pkgName = process.env.npm_package_name;
|
|
542
|
-
console.log(import_chalk8.default.green(`Cleaning Docs [${pkgName}]`));
|
|
543
|
-
yarnWorkspaces().map(({ location }) => (0, import_rimraf.rimrafSync)(import_path.default.join(location, "docs"), { glob: true }));
|
|
544
|
-
return 0;
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
// src/actions/clean-eslint.ts
|
|
548
|
-
var import_chalk9 = __toESM(require("chalk"));
|
|
549
|
-
var import_path2 = __toESM(require("path"));
|
|
550
|
-
var import_rimraf2 = require("rimraf");
|
|
551
|
-
var cleanESLint = () => {
|
|
552
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
553
|
-
const pkgName = process.env.npm_package_name;
|
|
554
|
-
console.log(import_chalk9.default.green(`Cleaning ESLint [${pkgName}]`));
|
|
555
|
-
(0, import_rimraf2.rimrafSync)(import_path2.default.join(pkg, ".eslintcache"), { glob: true });
|
|
556
|
-
return 0;
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
// src/actions/clean-jest.ts
|
|
560
|
-
var cleanJest = () => {
|
|
561
|
-
const pkgName = process.env.npm_package_name;
|
|
562
|
-
return runSteps(`Cleaning Jest [${pkgName}]`, [["jest", ["--clearCache"]]]);
|
|
563
|
-
};
|
|
564
|
-
|
|
565
|
-
// src/actions/clean.ts
|
|
566
|
-
var clean = async ({ verbose, pkg }) => {
|
|
567
|
-
return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
|
|
568
|
-
};
|
|
569
|
-
var cleanPackage = ({ verbose, pkg }) => {
|
|
570
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
571
|
-
return runStepsAsync(`Clean [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-clean", ...verboseOptions]]]);
|
|
572
|
-
};
|
|
573
|
-
var cleanAll = ({ verbose }) => {
|
|
574
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
575
|
-
return cleanJest() + cleanESLint() + cleanDocs() + runSteps("Clean", [["yarn", ["workspaces foreach -pA run package-clean", ...verboseOptions]]]);
|
|
576
|
-
};
|
|
577
|
-
|
|
578
|
-
// src/actions/compile.ts
|
|
579
|
-
var import_chalk10 = __toESM(require("chalk"));
|
|
580
|
-
var compile = ({ verbose, target, pkg, incremental }) => {
|
|
581
|
-
return pkg ? compilePackage({ pkg, target, verbose }) : compileAll({ incremental, target, verbose });
|
|
582
|
-
};
|
|
583
|
-
var compilePackage = ({ verbose, target, pkg }) => {
|
|
584
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
585
|
-
const targetOptions = target ? ["-t", target] : [];
|
|
586
|
-
return runSteps(`Compile [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-compile", ...verboseOptions, ...targetOptions]]]);
|
|
587
|
-
};
|
|
588
|
-
var compileAll = ({ jobs, verbose, target, incremental }) => {
|
|
589
|
-
const start = Date.now();
|
|
590
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
591
|
-
const targetOptions = target ? ["-t", target] : [];
|
|
592
|
-
const incrementalOptions = incremental ? ["--since", "-ptA"] : ["-ptA"];
|
|
593
|
-
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
594
|
-
if (jobs) {
|
|
595
|
-
console.log(import_chalk10.default.blue(`Jobs set to [${jobs}]`));
|
|
596
|
-
}
|
|
597
|
-
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
598
|
-
["yarn", ["workspaces", "foreach", ...incrementalOptions, ...jobsOptions, "run", "package-compile", ...verboseOptions, ...targetOptions]]
|
|
599
|
-
]);
|
|
600
|
-
console.log(`${import_chalk10.default.gray("Compiled in")} [${import_chalk10.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk10.default.gray("seconds")}`);
|
|
601
|
-
return result;
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
// src/actions/copy-assets.ts
|
|
605
|
-
var import_chalk11 = __toESM(require("chalk"));
|
|
606
|
-
var import_cpy = __toESM(require("cpy"));
|
|
607
|
-
var import_posix = __toESM(require("path/posix"));
|
|
608
|
-
var copyPackageTargetAssets = async (target, name, location) => {
|
|
609
|
-
try {
|
|
610
|
-
const values = await (0, import_cpy.default)(
|
|
611
|
-
["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
|
|
612
|
-
`../dist/${target}`,
|
|
613
|
-
{
|
|
614
|
-
cwd: import_posix.default.join(process.cwd(), location, "src"),
|
|
615
|
-
parents: true
|
|
616
|
-
}
|
|
617
|
-
);
|
|
618
|
-
values.forEach((value) => {
|
|
619
|
-
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
620
|
-
});
|
|
621
|
-
return 0;
|
|
622
|
-
} catch (reason) {
|
|
623
|
-
console.log(`Copy Failed: ${name}: ${reason}`);
|
|
624
|
-
return 1;
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
var copyTargetAssets = async (target, pkg) => {
|
|
628
|
-
const workspaces = yarnWorkspaces();
|
|
629
|
-
console.log(import_chalk11.default.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
630
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
631
|
-
return pkg === void 0 || name === pkg;
|
|
632
|
-
});
|
|
633
|
-
if (workspaceList.length === 0) {
|
|
634
|
-
console.error(`Package not found [${pkg}]`);
|
|
635
|
-
} else {
|
|
636
|
-
const results = await Promise.all(
|
|
637
|
-
workspaceList.map(async (workspace) => {
|
|
638
|
-
const { location, name } = workspace;
|
|
639
|
-
return await copyPackageTargetAssets(target, name, location);
|
|
640
|
-
})
|
|
641
|
-
);
|
|
642
|
-
return results.reduce((prev, result) => prev || result, 0);
|
|
643
|
-
}
|
|
644
|
-
return 0;
|
|
645
|
-
};
|
|
646
|
-
var copyAssets = async ({ target, pkg }) => {
|
|
647
|
-
switch (target) {
|
|
648
|
-
case "esm":
|
|
649
|
-
return await copyTargetAssets("esm", pkg);
|
|
650
|
-
case "cjs":
|
|
651
|
-
return await copyTargetAssets("cjs", pkg);
|
|
652
|
-
default:
|
|
653
|
-
return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
// src/actions/cycle.ts
|
|
658
|
-
var cycle = () => {
|
|
659
|
-
const rules = [`"'import/no-cycle': [1, { maxDepth: 6 }]"`, `"'import/no-internal-modules': ['off']"`];
|
|
660
|
-
return runSteps("Cycle", [["yarn", ["eslint", ...rules.map((rule) => ["--rule", rule]).flat(), "--cache", "."]]]);
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
// src/actions/dead.ts
|
|
664
|
-
var dead = () => {
|
|
665
|
-
return runSteps("Dead", [["yarn", ["ts-prune", "-p", "tsconfig.json"]]]);
|
|
666
|
-
};
|
|
667
|
-
|
|
668
|
-
// src/actions/deploy.ts
|
|
669
|
-
var deploy = () => {
|
|
670
|
-
return runSteps("Deploy [Patch]", [
|
|
671
|
-
["yarn", "workspaces foreach --all version patch --deferred"],
|
|
672
|
-
["yarn", "xy clean"],
|
|
673
|
-
["yarn", "xy build"],
|
|
674
|
-
["yarn", "xy cycle"],
|
|
675
|
-
["yarn", "xy gen-docs"],
|
|
676
|
-
["yarn", "version apply --all"],
|
|
677
|
-
["yarn", "workspaces foreach -pt npm publish"]
|
|
678
|
-
]);
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
// src/actions/deploy-major.ts
|
|
682
|
-
var deployMajor = () => {
|
|
683
|
-
return runSteps("Deploy [Major]", [
|
|
684
|
-
["yarn", "workspaces foreach --all version major --deferred"],
|
|
685
|
-
["yarn", "xy clean"],
|
|
686
|
-
["yarn", "xy build"],
|
|
687
|
-
["yarn", "xy cycle"],
|
|
688
|
-
["yarn", "version apply --all"],
|
|
689
|
-
["yarn", "workspaces foreach -pt npm publish"]
|
|
690
|
-
]);
|
|
691
|
-
};
|
|
692
|
-
|
|
693
|
-
// src/actions/deploy-minor.ts
|
|
694
|
-
var deployMinor = () => {
|
|
695
|
-
return runSteps("Deploy [Minor]", [
|
|
696
|
-
["yarn", "workspaces foreach --all version minor --deferred"],
|
|
697
|
-
["yarn", "xy clean"],
|
|
698
|
-
["yarn", "xy build"],
|
|
699
|
-
["yarn", "xy cycle"],
|
|
700
|
-
["yarn", "version apply --all"],
|
|
701
|
-
["yarn", "workspaces foreach -pt npm publish"]
|
|
702
|
-
]);
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
// src/actions/deploy-next.ts
|
|
706
|
-
var deployNext = () => {
|
|
707
|
-
return runSteps("Deploy [Next]", [
|
|
708
|
-
["yarn", "workspaces foreach --all version minor --deferred"],
|
|
709
|
-
["yarn", "xy clean"],
|
|
710
|
-
["yarn", "xy build"],
|
|
711
|
-
["yarn", "xy cycle"],
|
|
712
|
-
["yarn", "version apply --all --prerelease"],
|
|
713
|
-
["yarn", "workspaces foreach -pt npm publish --tag next"]
|
|
714
|
-
]);
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
// src/actions/deps.ts
|
|
718
|
-
var import_chalk12 = __toESM(require("chalk"));
|
|
719
|
-
var deps = ({ pkg, incremental }) => {
|
|
720
|
-
pkg ? depsPackage({ pkg }) : depsAll({ incremental });
|
|
721
|
-
return 0;
|
|
722
|
-
};
|
|
723
|
-
var depsPackage = ({ pkg }) => {
|
|
724
|
-
const steps = [["yarn", ["workspace", pkg, "run", "package-deps"]]];
|
|
725
|
-
return runSteps(`Deps [${pkg}]`, [...steps]);
|
|
726
|
-
};
|
|
727
|
-
var depsAll = ({ incremental, jobs }) => {
|
|
728
|
-
const start = Date.now();
|
|
729
|
-
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
730
|
-
if (jobs) {
|
|
731
|
-
console.log(import_chalk12.default.blue(`Jobs set to [${jobs}]`));
|
|
732
|
-
}
|
|
733
|
-
const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
|
|
734
|
-
const steps = [["yarn", ["workspaces", "foreach", ...jobsOptions, ...incrementalOptions, "run", "package-deps"]]];
|
|
735
|
-
const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [...steps]);
|
|
736
|
-
console.log(`${import_chalk12.default.gray("Dep checked in")} [${import_chalk12.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk12.default.gray("seconds")}`);
|
|
737
|
-
return result;
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
// src/actions/dupdeps.ts
|
|
741
|
-
var import_chalk13 = __toESM(require("chalk"));
|
|
742
|
-
var dupdeps = () => {
|
|
743
|
-
console.log(import_chalk13.default.green("Checking all Dependencies for Duplicates"));
|
|
744
|
-
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
745
|
-
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
746
|
-
return detectDuplicateDependencies(dependencies);
|
|
747
|
-
};
|
|
748
|
-
|
|
749
|
-
// src/actions/fix.ts
|
|
750
|
-
var fix = () => {
|
|
751
|
-
return runSteps("Fix", [["yarn", ["eslint", ".", "--fix", "--cache"]]]);
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
// src/actions/gen-docs.ts
|
|
755
|
-
var genDocs = ({ pkg, incremental }) => {
|
|
756
|
-
return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
|
|
757
|
-
};
|
|
758
|
-
var genDocsPackage = ({ pkg }) => {
|
|
759
|
-
const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
|
|
760
|
-
return runSteps(`GenDocs [${pkg}]`, [...steps]);
|
|
761
|
-
};
|
|
762
|
-
var genDocsAll = ({ incremental }) => {
|
|
763
|
-
const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
|
|
764
|
-
const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
|
|
765
|
-
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
// src/actions/gitignore-gen.ts
|
|
769
|
-
var filename = ".gitignore";
|
|
770
|
-
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
771
|
-
|
|
772
|
-
// src/actions/gitlint.ts
|
|
773
|
-
var import_chalk14 = __toESM(require("chalk"));
|
|
774
|
-
var import_parse_git_config = require("parse-git-config");
|
|
775
|
-
var gitlint = () => {
|
|
776
|
-
console.log(`
|
|
777
|
-
Gitlint Start [${process.cwd()}]
|
|
778
|
-
`);
|
|
779
|
-
let valid = 0;
|
|
780
|
-
let warnings = 0;
|
|
781
|
-
const errors = 0;
|
|
782
|
-
const gitConfig = (0, import_parse_git_config.sync)();
|
|
783
|
-
const warn = (message) => {
|
|
784
|
-
console.warn(import_chalk14.default.yellow(`Warning: ${message}`));
|
|
785
|
-
warnings++;
|
|
786
|
-
};
|
|
787
|
-
if (gitConfig.core.ignorecase) {
|
|
788
|
-
warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
789
|
-
} else {
|
|
790
|
-
valid++;
|
|
791
|
-
}
|
|
792
|
-
if (gitConfig.core.autocrlf !== false) {
|
|
793
|
-
warn("Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
794
|
-
} else {
|
|
795
|
-
valid++;
|
|
796
|
-
}
|
|
797
|
-
if (gitConfig.core.eol !== "lf") {
|
|
798
|
-
warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]');
|
|
799
|
-
} else {
|
|
800
|
-
valid++;
|
|
801
|
-
}
|
|
802
|
-
const resultMessages = [];
|
|
803
|
-
if (valid > 0) {
|
|
804
|
-
resultMessages.push(import_chalk14.default.green(`Passed: ${valid}`));
|
|
805
|
-
}
|
|
806
|
-
if (warnings > 0) {
|
|
807
|
-
resultMessages.push(import_chalk14.default.yellow(`Warnings: ${warnings}`));
|
|
808
|
-
}
|
|
809
|
-
if (errors > 0) {
|
|
810
|
-
resultMessages.push(import_chalk14.default.red(` Errors: ${errors}`));
|
|
811
|
-
}
|
|
812
|
-
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
813
|
-
`);
|
|
814
|
-
return warnings + errors === 0 ? 1 : 0;
|
|
815
|
-
};
|
|
816
|
-
|
|
817
|
-
// src/actions/gitlint-fix.ts
|
|
818
|
-
var import_chalk15 = __toESM(require("chalk"));
|
|
819
|
-
var import_child_process6 = require("child_process");
|
|
820
|
-
var import_parse_git_config2 = require("parse-git-config");
|
|
821
|
-
var gitlintFix = () => {
|
|
822
|
-
console.log(`
|
|
823
|
-
Gitlint Fix Start [${process.cwd()}]
|
|
824
|
-
`);
|
|
825
|
-
const gitConfig = (0, import_parse_git_config2.sync)();
|
|
826
|
-
if (gitConfig.core.ignorecase) {
|
|
827
|
-
(0, import_child_process6.execSync)("git config core.ignorecase false", { stdio: "inherit" });
|
|
828
|
-
console.warn(import_chalk15.default.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
829
|
-
}
|
|
830
|
-
if (gitConfig.core.autocrlf !== false) {
|
|
831
|
-
(0, import_child_process6.execSync)("git config core.autocrlf false", { stdio: "inherit" });
|
|
832
|
-
console.warn(import_chalk15.default.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
833
|
-
}
|
|
834
|
-
if (gitConfig.core.eol !== "lf") {
|
|
835
|
-
(0, import_child_process6.execSync)("git config core.eol lf", { stdio: "inherit" });
|
|
836
|
-
console.warn(import_chalk15.default.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
837
|
-
}
|
|
838
|
-
return 1;
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
// src/actions/license.ts
|
|
842
|
-
var import_chalk16 = __toESM(require("chalk"));
|
|
843
|
-
var import_license_checker = require("license-checker");
|
|
844
|
-
var license = async (pkg) => {
|
|
845
|
-
const workspaces = yarnWorkspaces();
|
|
846
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
847
|
-
return pkg === void 0 || name === pkg;
|
|
848
|
-
});
|
|
849
|
-
const exclude = [
|
|
850
|
-
"MIT",
|
|
851
|
-
"MIT*",
|
|
852
|
-
"ISC",
|
|
853
|
-
"Apache-2.0",
|
|
854
|
-
"BSD",
|
|
855
|
-
"BSD*",
|
|
856
|
-
"BSD-2-Clause",
|
|
857
|
-
"BSD-3-Clause",
|
|
858
|
-
"CC-BY-4.0",
|
|
859
|
-
"Unlicense",
|
|
860
|
-
"CC-BY-3.0",
|
|
861
|
-
"CC0-1.0",
|
|
862
|
-
"LGPL-3.0-only",
|
|
863
|
-
"LGPL-3.0",
|
|
864
|
-
"LGPL-3.0-or-later",
|
|
865
|
-
"Python-2.0"
|
|
866
|
-
];
|
|
867
|
-
console.log(import_chalk16.default.green("License Checker"));
|
|
868
|
-
return (await Promise.all(
|
|
869
|
-
workspaceList.map(({ location, name }) => {
|
|
870
|
-
return new Promise((resolve) => {
|
|
871
|
-
(0, import_license_checker.init)({ production: true, start: location }, (error, packages) => {
|
|
872
|
-
if (error) {
|
|
873
|
-
console.error(import_chalk16.default.red(`License Checker [${name}] Error`));
|
|
874
|
-
console.error(import_chalk16.default.gray(error));
|
|
875
|
-
console.log("\n");
|
|
876
|
-
resolve(1);
|
|
877
|
-
} else {
|
|
878
|
-
console.log(import_chalk16.default.green(`License Checker [${name}]`));
|
|
879
|
-
let count = 0;
|
|
880
|
-
Object.entries(packages).forEach(([name2, info]) => {
|
|
881
|
-
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
882
|
-
licenses.forEach((license2) => {
|
|
883
|
-
if (license2) {
|
|
884
|
-
if (license2[0] === "(" && license2[license2.length - 1] === ")") {
|
|
885
|
-
license2 = license2.substring(1, license2.length - 2);
|
|
886
|
-
}
|
|
887
|
-
const orLicenses = license2.split(" OR ");
|
|
888
|
-
let orLicenseFound = false;
|
|
889
|
-
orLicenses.forEach((orLicense) => {
|
|
890
|
-
if (exclude.includes(orLicense)) {
|
|
891
|
-
orLicenseFound = true;
|
|
892
|
-
}
|
|
893
|
-
});
|
|
894
|
-
if (!orLicenseFound) {
|
|
895
|
-
count++;
|
|
896
|
-
console.warn(import_chalk16.default.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
});
|
|
900
|
-
});
|
|
901
|
-
console.log("\n");
|
|
902
|
-
resolve(count);
|
|
903
|
-
}
|
|
904
|
-
});
|
|
905
|
-
});
|
|
906
|
-
})
|
|
907
|
-
)).reduce((prev, value) => prev || value, 0);
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
// src/actions/lint.ts
|
|
911
|
-
var import_chalk17 = __toESM(require("chalk"));
|
|
912
|
-
var import_eslint = require("eslint");
|
|
913
|
-
var lintPackage = async ({ pkg }) => {
|
|
914
|
-
const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
|
|
915
|
-
if (!workspace) {
|
|
916
|
-
console.error(import_chalk17.default.red(`Unable to locate package [${import_chalk17.default.magenta(pkg)}]`));
|
|
917
|
-
process.exit(1);
|
|
918
|
-
}
|
|
919
|
-
const engine = new import_eslint.ESLint({ cache: true });
|
|
920
|
-
const lintResults = await engine.lintFiles(workspace.location);
|
|
921
|
-
console.log(lintResults);
|
|
922
|
-
const errorCount = lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
923
|
-
return errorCount;
|
|
924
|
-
};
|
|
925
|
-
var lintAll = async () => {
|
|
926
|
-
const engine = new import_eslint.ESLint({ cache: true });
|
|
927
|
-
const lintResults = await engine.lintFiles("./**/*.*");
|
|
928
|
-
console.log(lintResults);
|
|
929
|
-
const errorCount = lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
930
|
-
return errorCount;
|
|
931
|
-
};
|
|
932
|
-
var lint = async ({ pkg } = {}) => {
|
|
933
|
-
return pkg ? await lintPackage({ pkg }) : runSteps("Lint-Caching [All]", [["yarn", ["eslint", ".", "--cache"]]]);
|
|
934
|
-
};
|
|
935
|
-
|
|
936
|
-
// src/actions/lint-clean.ts
|
|
937
|
-
var import_fs5 = require("fs");
|
|
938
|
-
var lintClean = () => {
|
|
939
|
-
console.log("Lint Clean [.eslintcache]");
|
|
940
|
-
const workspaces = yarnWorkspaces();
|
|
941
|
-
const result = workspaces.map(({ location, name }) => {
|
|
942
|
-
const dist = `${location}/.eslintcache`;
|
|
943
|
-
try {
|
|
944
|
-
(0, import_fs5.rmSync)(dist, { force: true, recursive: true });
|
|
945
|
-
return 0;
|
|
946
|
-
} catch (ex) {
|
|
947
|
-
const error = ex;
|
|
948
|
-
console.error(`Lint Clean [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
949
|
-
return 1;
|
|
950
|
-
}
|
|
951
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
952
|
-
return result || lint();
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
// src/actions/lint-profile.ts
|
|
956
|
-
var lintProfile = () => {
|
|
957
|
-
return runSteps("Lint Profile", [["yarn", ["xy", "lint"], { env: { ...process.env, TIMING: "1" } }]]);
|
|
958
|
-
};
|
|
959
|
-
|
|
960
|
-
// src/actions/npmignore-gen.ts
|
|
961
|
-
var filename2 = ".npmignore";
|
|
962
|
-
var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
|
|
963
|
-
|
|
964
|
-
// src/actions/package/clean-outputs.ts
|
|
965
|
-
var import_chalk18 = __toESM(require("chalk"));
|
|
966
|
-
var import_fs6 = require("fs");
|
|
967
|
-
var import_path3 = __toESM(require("path"));
|
|
968
|
-
var packageCleanOutputs = () => {
|
|
969
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
970
|
-
const pkgName = process.env.npm_package_name;
|
|
971
|
-
console.log(import_chalk18.default.green(`Cleaning Outputs [${pkgName}]`));
|
|
972
|
-
const dist = import_path3.default.join(pkg, "dist");
|
|
973
|
-
(0, import_fs6.rmSync)(dist, { force: true, recursive: true });
|
|
974
|
-
const build2 = import_path3.default.join(pkg, "build");
|
|
975
|
-
(0, import_fs6.rmSync)(build2, { force: true, recursive: true });
|
|
976
|
-
return 0;
|
|
977
|
-
};
|
|
978
|
-
|
|
979
|
-
// src/actions/package/clean-typescript.ts
|
|
980
|
-
var import_chalk19 = __toESM(require("chalk"));
|
|
981
|
-
var import_path4 = __toESM(require("path"));
|
|
982
|
-
var import_rimraf3 = require("rimraf");
|
|
983
|
-
var packageCleanTypescript = () => {
|
|
984
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
985
|
-
const pkgName = process.env.npm_package_name;
|
|
986
|
-
console.log(import_chalk19.default.green(`Cleaning Typescript [${pkgName}]`));
|
|
987
|
-
const buildInfo = import_path4.default.join(pkg, "*.tsbuildinfo");
|
|
988
|
-
(0, import_rimraf3.rimrafSync)(buildInfo, { glob: true });
|
|
989
|
-
const tsConfig = import_path4.default.join(pkg, ".tsconfig.*");
|
|
990
|
-
(0, import_rimraf3.rimrafSync)(tsConfig, { glob: true });
|
|
991
|
-
return 0;
|
|
992
|
-
};
|
|
993
|
-
|
|
994
|
-
// src/actions/package/clean.ts
|
|
995
|
-
var packageClean = () => {
|
|
996
|
-
return packageCleanOutputs() + packageCleanTypescript();
|
|
997
|
-
};
|
|
998
|
-
|
|
999
|
-
// src/actions/package/compile.ts
|
|
1000
|
-
var import_fs9 = require("fs");
|
|
1001
|
-
|
|
1002
|
-
// src/actions/package/copy-assets.ts
|
|
1003
|
-
var import_chalk20 = __toESM(require("chalk"));
|
|
1004
|
-
var import_cpy2 = __toESM(require("cpy"));
|
|
1005
|
-
var import_posix2 = __toESM(require("path/posix"));
|
|
1006
|
-
var copyTargetAssets2 = async (target, name, location) => {
|
|
1007
|
-
try {
|
|
1008
|
-
const values = await (0, import_cpy2.default)(
|
|
1009
|
-
["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
|
|
1010
|
-
`../dist/${target}`,
|
|
1011
|
-
{
|
|
1012
|
-
cwd: import_posix2.default.join(location, "src"),
|
|
1013
|
-
parents: true
|
|
1014
|
-
}
|
|
1015
|
-
);
|
|
1016
|
-
if (values.length > 0) {
|
|
1017
|
-
console.log(import_chalk20.default.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1018
|
-
}
|
|
1019
|
-
values.forEach((value) => {
|
|
1020
|
-
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
1021
|
-
});
|
|
1022
|
-
return 0;
|
|
1023
|
-
} catch (ex) {
|
|
1024
|
-
const error = ex;
|
|
1025
|
-
console.log(`Copy Assets Failed: ${name}: ${error.message}`);
|
|
1026
|
-
return 1;
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
var packageCopyAssets = async ({ target }) => {
|
|
1030
|
-
const pkg = process.env.INIT_CWD ?? "./";
|
|
1031
|
-
const pkgName = process.env.npm_package_name ?? "Unknown";
|
|
1032
|
-
switch (target) {
|
|
1033
|
-
case "esm":
|
|
1034
|
-
return await copyTargetAssets2("esm", pkgName, pkg);
|
|
1035
|
-
case "cjs":
|
|
1036
|
-
return await copyTargetAssets2("cjs", pkgName, pkg);
|
|
1037
|
-
default:
|
|
1038
|
-
return await copyTargetAssets2("esm", pkgName, pkg) || await copyTargetAssets2("cjs", pkgName, pkg);
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1041
|
-
|
|
1042
|
-
// src/actions/package/tsconfig-gen-cjs.ts
|
|
1043
|
-
var import_chalk21 = __toESM(require("chalk"));
|
|
1044
|
-
var import_fs7 = require("fs");
|
|
1045
|
-
var packageTsconfigGenCjs = () => {
|
|
1046
|
-
const pkg = process.env.INIT_CWD ?? "./";
|
|
1047
|
-
const pkgName = process.env.npm_package_name;
|
|
1048
|
-
try {
|
|
1049
|
-
const configObject = createBuildConfig(pkg, "CommonJS", "ES6", "cjs");
|
|
1050
|
-
if (configObject) {
|
|
1051
|
-
const config = JSON.stringify(configObject, null, 2);
|
|
1052
|
-
let currentConfig;
|
|
1053
|
-
try {
|
|
1054
|
-
currentConfig = (0, import_fs7.readFileSync)(`${pkg}/.tsconfig.build.cjs.json`, { encoding: "utf8" });
|
|
1055
|
-
} catch (ex) {
|
|
1056
|
-
currentConfig = void 0;
|
|
1057
|
-
}
|
|
1058
|
-
if (currentConfig !== config) {
|
|
1059
|
-
console.log(import_chalk21.default.gray(`Updating CJS tsconfig [${pkgName}]`));
|
|
1060
|
-
(0, import_fs7.writeFileSync)(`${pkg}/.tsconfig.build.cjs.json`, config, { encoding: "utf8" });
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
return 0;
|
|
1064
|
-
} catch (ex) {
|
|
1065
|
-
const error = ex;
|
|
1066
|
-
console.error(`tsconfig (CJS) generate failed [${pkgName}] [${error.message}]`);
|
|
1067
|
-
return 1;
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
|
|
1071
|
-
// src/actions/package/compile-cjs.ts
|
|
1072
|
-
var packageCompileCjs = async () => {
|
|
1073
|
-
const pkg = process.env.INIT_CWD;
|
|
1074
|
-
packageTsconfigGenCjs();
|
|
1075
|
-
return (await Promise.all([
|
|
1076
|
-
packageCopyAssets({ target: "cjs" }),
|
|
1077
|
-
runStepsAsync("Package Compile [CJS]", [["tsc", ["--build", `${pkg}/.tsconfig.build.cjs.json`]]])
|
|
1078
|
-
])).reduce((prev, value) => prev + value);
|
|
1079
|
-
};
|
|
1080
|
-
|
|
1081
|
-
// src/actions/package/tsconfig-gen-esm.ts
|
|
1082
|
-
var import_chalk22 = __toESM(require("chalk"));
|
|
1083
|
-
var import_fs8 = require("fs");
|
|
1084
|
-
var packageTsconfigGenEsm = (quiet = false) => {
|
|
1085
|
-
const pkg = process.env.INIT_CWD ?? "./";
|
|
1086
|
-
const pkgName = process.env.npm_package_name;
|
|
1087
|
-
try {
|
|
1088
|
-
const configObject = createBuildConfig(pkg, "ESNext", "ESNext", "esm");
|
|
1089
|
-
if (configObject) {
|
|
1090
|
-
const config = JSON.stringify(configObject, null, 2);
|
|
1091
|
-
let currentConfig;
|
|
1092
|
-
try {
|
|
1093
|
-
currentConfig = (0, import_fs8.readFileSync)(`${pkg}/.tsconfig.build.esm.json`, { encoding: "utf8" });
|
|
1094
|
-
} catch (ex) {
|
|
1095
|
-
currentConfig = void 0;
|
|
1096
|
-
}
|
|
1097
|
-
if (currentConfig !== config) {
|
|
1098
|
-
if (!quiet) {
|
|
1099
|
-
console.log(import_chalk22.default.gray(`Updating ESM tsconfig [${pkgName}]`));
|
|
1100
|
-
}
|
|
1101
|
-
(0, import_fs8.writeFileSync)(`${pkg}/.tsconfig.build.esm.json`, config, { encoding: "utf8" });
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
return 0;
|
|
1105
|
-
} catch (ex) {
|
|
1106
|
-
const error = ex;
|
|
1107
|
-
console.error(`tsconfig (ESM) generate failed [${pkgName}] [${error.message}]`);
|
|
1108
|
-
return 1;
|
|
1109
|
-
}
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
// src/actions/package/compile-esm.ts
|
|
1113
|
-
var packageCompileEsm = async () => {
|
|
1114
|
-
const pkg = process.env.INIT_CWD;
|
|
1115
|
-
packageTsconfigGenEsm();
|
|
1116
|
-
return (await Promise.all([
|
|
1117
|
-
packageCopyAssets({ target: "esm" }),
|
|
1118
|
-
runStepsAsync("Package Compile [ESM]", [["tsc", ["--build", `${pkg}/.tsconfig.build.esm.json`]]])
|
|
1119
|
-
])).reduce((prev, value) => prev + value);
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
// src/actions/package/compile.ts
|
|
1123
|
-
var packageCompile = async () => {
|
|
1124
|
-
const pkg = process.env.INIT_CWD;
|
|
1125
|
-
const pkgConfig = (0, import_fs9.readFileSync)(`${pkg}/package.json`, { encoding: "utf8" });
|
|
1126
|
-
const config = JSON.parse(pkgConfig);
|
|
1127
|
-
return (await Promise.all(config.type === "module" ? [packageCompileEsm()] : [packageCompileEsm(), packageCompileCjs()])).reduce(
|
|
1128
|
-
(prev, value) => prev + value,
|
|
1129
|
-
0
|
|
1130
|
-
);
|
|
1131
|
-
};
|
|
1132
|
-
|
|
1133
|
-
// src/actions/package/deps.ts
|
|
1134
|
-
var import_chalk23 = __toESM(require("chalk"));
|
|
1135
|
-
var import_depcheck = __toESM(require("depcheck"));
|
|
1136
|
-
var import_fs10 = require("fs");
|
|
1137
|
-
var packageDeps = async () => {
|
|
1138
|
-
const pkg = process.env.INIT_CWD;
|
|
1139
|
-
const pkgName = process.env.npm_package_name;
|
|
1140
|
-
const rawIgnore = (0, import_fs10.existsSync)(`${pkg}/.depcheckrc`) ? (0, import_fs10.readFileSync)(`${pkg}/.depcheckrc`, { encoding: "utf8" }).replace("ignores:", '"ignores":') : void 0;
|
|
1141
|
-
let ignoreMatches = [];
|
|
1142
|
-
try {
|
|
1143
|
-
ignoreMatches = rawIgnore ? JSON.parse(`{${rawIgnore}}`).ignores : [];
|
|
1144
|
-
} catch (ex) {
|
|
1145
|
-
const error = ex;
|
|
1146
|
-
console.log(`${pkgName} [${error.message}] Failed to parse .depcheckrc [${rawIgnore}]`);
|
|
1147
|
-
}
|
|
1148
|
-
ignoreMatches.push("@xylabs/ts-scripts-yarn3");
|
|
1149
|
-
ignoreMatches.push("@xylabs/tsconfig");
|
|
1150
|
-
ignoreMatches.push("@xylabs/tsconfig-dom");
|
|
1151
|
-
ignoreMatches.push("@xylabs/tsconfig-react");
|
|
1152
|
-
ignoreMatches.push("@xylabs/tsconfig-jest");
|
|
1153
|
-
ignoreMatches.push("typescript");
|
|
1154
|
-
const unusedList = await Promise.all([
|
|
1155
|
-
(0, import_depcheck.default)(`${pkg}/.`, { ignoreMatches, ignorePatterns: ["*.stories.*", "*.spec.*", "*.d.ts", "dist", ".*"] }),
|
|
1156
|
-
(0, import_depcheck.default)(`${pkg}/.`, {
|
|
1157
|
-
ignoreMatches,
|
|
1158
|
-
ignorePatterns: ["*.ts", "*.d.ts", "dist", ".*"],
|
|
1159
|
-
specials: [import_depcheck.special.eslint, import_depcheck.special.babel, import_depcheck.special.bin, import_depcheck.special.prettier, import_depcheck.special.jest, import_depcheck.special.mocha]
|
|
1160
|
-
})
|
|
1161
|
-
]);
|
|
1162
|
-
const unusedCode = unusedList[0];
|
|
1163
|
-
const unusedTests = unusedList[1];
|
|
1164
|
-
const unused = {
|
|
1165
|
-
...unusedCode,
|
|
1166
|
-
/* we only reports the unused devDeps if both are not using it */
|
|
1167
|
-
devDependencies: unusedTests.devDependencies.filter((value) => !!unusedCode.devDependencies.find((devValue) => devValue === value))
|
|
1168
|
-
};
|
|
1169
|
-
const errorCount = unused.dependencies.length + unused.devDependencies.length + Object.entries(unused.invalidDirs).length + Object.entries(unused.invalidFiles).length + Object.entries(unused.missing).length;
|
|
1170
|
-
if (errorCount > 0) {
|
|
1171
|
-
console.log(`Deps [${pkgName}]`);
|
|
1172
|
-
} else {
|
|
1173
|
-
console.log(`Deps [${pkgName}] - Ok`);
|
|
1174
|
-
}
|
|
1175
|
-
if (unused.dependencies.length) {
|
|
1176
|
-
const message = [import_chalk23.default.yellow(`${unused.dependencies.length} Unused dependencies`)];
|
|
1177
|
-
unused.dependencies.forEach((value) => message.push(import_chalk23.default.gray(` ${value}`)));
|
|
1178
|
-
console.log(message.join("\n"));
|
|
1179
|
-
}
|
|
1180
|
-
if (unused.devDependencies.length) {
|
|
1181
|
-
const message = [import_chalk23.default.yellow(`${unused.devDependencies.length} Unused devDependencies`)];
|
|
1182
|
-
unused.devDependencies.forEach((value) => message.push(import_chalk23.default.gray(` ${value}`)));
|
|
1183
|
-
console.log(message.join("\n"));
|
|
1184
|
-
}
|
|
1185
|
-
if (Object.entries(unused.invalidDirs).length) {
|
|
1186
|
-
Object.entries(unused.invalidDirs).forEach(([key, value]) => console.warn(import_chalk23.default.gray(`Invalid Dir: ${key}: ${value}`)));
|
|
1187
|
-
}
|
|
1188
|
-
if (Object.entries(unused.invalidFiles).length) {
|
|
1189
|
-
Object.entries(unused.invalidFiles).forEach(([key, value]) => console.warn(import_chalk23.default.gray(`Invalid File: ${key}: ${value}`)));
|
|
1190
|
-
}
|
|
1191
|
-
if (Object.entries(unusedCode.missing).length) {
|
|
1192
|
-
const message = [import_chalk23.default.yellow(`${Object.entries(unusedCode.missing).length} Missing dependencies`)];
|
|
1193
|
-
Object.entries(unusedCode.missing).forEach(([key, value]) => {
|
|
1194
|
-
message.push(`${key}`);
|
|
1195
|
-
message.push(import_chalk23.default.gray(` ${value.pop()}`));
|
|
1196
|
-
});
|
|
1197
|
-
console.log(import_chalk23.default.yellow(message.join("\n")));
|
|
1198
|
-
}
|
|
1199
|
-
if (Object.entries(unusedTests.missing).length) {
|
|
1200
|
-
const message = [import_chalk23.default.yellow(`${Object.entries(unusedTests.missing).length} Missing devDependencies`)];
|
|
1201
|
-
Object.entries(unusedTests.missing).forEach(([key, value]) => {
|
|
1202
|
-
message.push(`${key}`);
|
|
1203
|
-
message.push(import_chalk23.default.gray(` ${value.pop()}`));
|
|
1204
|
-
});
|
|
1205
|
-
console.log(import_chalk23.default.yellow(message.join("\n")));
|
|
1206
|
-
}
|
|
1207
|
-
checkResult(`Deps [${pkgName}]`, errorCount, "warn", false);
|
|
1208
|
-
return 0;
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
// src/actions/package/gen-docs.ts
|
|
1212
|
-
var import_node_fs2 = require("fs");
|
|
1213
|
-
var import_node_path = __toESM(require("path"));
|
|
1214
|
-
var import_chalk24 = __toESM(require("chalk"));
|
|
1215
|
-
var import_typedoc = require("typedoc");
|
|
1216
|
-
var ExitCodes = {
|
|
1217
|
-
CompileError: 3,
|
|
1218
|
-
ExceptionThrown: 6,
|
|
1219
|
-
NoEntryPoints: 2,
|
|
1220
|
-
Ok: 0,
|
|
1221
|
-
OptionError: 1,
|
|
1222
|
-
OutputError: 5,
|
|
1223
|
-
ValidationError: 4
|
|
1224
|
-
};
|
|
1225
|
-
var packageGenDocs = async () => {
|
|
1226
|
-
const pkg = process.env.INIT_CWD;
|
|
1227
|
-
if (pkg) {
|
|
1228
|
-
if (!(0, import_node_fs2.existsSync)(import_node_path.default.join(pkg, "typedoc.json"))) {
|
|
1229
|
-
return;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
const app = new import_typedoc.Application();
|
|
1233
|
-
app.options.addReader(new import_typedoc.ArgumentsReader(0));
|
|
1234
|
-
app.options.addReader(new import_typedoc.TypeDocReader());
|
|
1235
|
-
app.options.addReader(new import_typedoc.TSConfigReader());
|
|
1236
|
-
app.options.addReader(new import_typedoc.ArgumentsReader(300));
|
|
1237
|
-
app.bootstrap({
|
|
1238
|
-
entryPointStrategy: "resolve",
|
|
1239
|
-
entryPoints: [`${pkg}/src`],
|
|
1240
|
-
excludeExternals: true,
|
|
1241
|
-
json: `${pkg}/dist/docs.json`,
|
|
1242
|
-
logLevel: "Error",
|
|
1243
|
-
tsconfig: `${pkg}/.tsconfig.build.esm.json`
|
|
1244
|
-
});
|
|
1245
|
-
return await runTypeDoc(app);
|
|
1246
|
-
};
|
|
1247
|
-
var runTypeDoc = async (app) => {
|
|
1248
|
-
const pkgName = process.env.npm_package_name;
|
|
1249
|
-
if (app.options.getValue("version")) {
|
|
1250
|
-
console.log(app.toString());
|
|
1251
|
-
return ExitCodes.Ok;
|
|
1252
|
-
}
|
|
1253
|
-
if (app.options.getValue("showConfig")) {
|
|
1254
|
-
console.log(app.options.getRawValues());
|
|
1255
|
-
return ExitCodes.Ok;
|
|
1256
|
-
}
|
|
1257
|
-
if (app.logger.hasErrors()) {
|
|
1258
|
-
return ExitCodes.OptionError;
|
|
1259
|
-
}
|
|
1260
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
1261
|
-
return ExitCodes.OptionError;
|
|
1262
|
-
}
|
|
1263
|
-
if (app.options.getValue("entryPoints").length === 0) {
|
|
1264
|
-
app.logger.error("No entry points provided");
|
|
1265
|
-
return ExitCodes.NoEntryPoints;
|
|
1266
|
-
}
|
|
1267
|
-
if (app.options.getValue("watch")) {
|
|
1268
|
-
app.convertAndWatch(async (project2) => {
|
|
1269
|
-
const out = app.options.getValue("out");
|
|
1270
|
-
if (out) {
|
|
1271
|
-
await app.generateDocs(project2, out);
|
|
1272
|
-
}
|
|
1273
|
-
const json = app.options.getValue("json");
|
|
1274
|
-
if (json) {
|
|
1275
|
-
await app.generateJson(project2, json);
|
|
1276
|
-
}
|
|
1277
|
-
if (!out && !json) {
|
|
1278
|
-
await app.generateDocs(project2, "./docs");
|
|
1279
|
-
}
|
|
1280
|
-
});
|
|
1281
|
-
return ExitCodes.Ok;
|
|
1282
|
-
}
|
|
1283
|
-
const project = app.convert();
|
|
1284
|
-
if (!project) {
|
|
1285
|
-
return ExitCodes.CompileError;
|
|
1286
|
-
}
|
|
1287
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
1288
|
-
return ExitCodes.CompileError;
|
|
1289
|
-
}
|
|
1290
|
-
app.validate(project);
|
|
1291
|
-
if (app.logger.hasErrors()) {
|
|
1292
|
-
return ExitCodes.ValidationError;
|
|
1293
|
-
}
|
|
1294
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
1295
|
-
return ExitCodes.ValidationError;
|
|
1296
|
-
}
|
|
1297
|
-
if (app.options.getValue("emit") !== "none") {
|
|
1298
|
-
const out = app.options.getValue("out");
|
|
1299
|
-
if (out) {
|
|
1300
|
-
await app.generateDocs(project, out);
|
|
1301
|
-
}
|
|
1302
|
-
const json = app.options.getValue("json");
|
|
1303
|
-
if (json) {
|
|
1304
|
-
await app.generateJson(project, json);
|
|
1305
|
-
}
|
|
1306
|
-
if (!out && !json) {
|
|
1307
|
-
await app.generateDocs(project, "./docs");
|
|
1308
|
-
}
|
|
1309
|
-
if (app.logger.hasErrors()) {
|
|
1310
|
-
return ExitCodes.OutputError;
|
|
1311
|
-
}
|
|
1312
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
1313
|
-
return ExitCodes.OutputError;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
console.log(import_chalk24.default.green(`${pkgName} - Ok`));
|
|
1317
|
-
return ExitCodes.Ok;
|
|
1318
|
-
};
|
|
1319
|
-
|
|
1320
|
-
// src/actions/package/publint.ts
|
|
1321
|
-
var import_fs11 = require("fs");
|
|
1322
|
-
var packagePublint = async () => {
|
|
1323
|
-
const pkgDir = process.env.INIT_CWD;
|
|
1324
|
-
const pkg = JSON.parse(await import_fs11.promises.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1325
|
-
const { publint: publint2 } = await import("publint");
|
|
1326
|
-
const { messages } = await publint2({
|
|
1327
|
-
level: "warning",
|
|
1328
|
-
pkgDir,
|
|
1329
|
-
strict: true
|
|
1330
|
-
});
|
|
1331
|
-
const { formatMessage } = await import("publint/utils");
|
|
1332
|
-
messages.forEach((message) => {
|
|
1333
|
-
console.log(formatMessage(message, pkg));
|
|
1334
|
-
});
|
|
1335
|
-
return 0;
|
|
1336
|
-
};
|
|
1337
|
-
|
|
1338
|
-
// src/actions/package/recompile.ts
|
|
1339
|
-
var packageRecompile = async () => {
|
|
1340
|
-
return (await Promise.all([packageClean(), packageCompile()])).reduce((prev, value) => prev + value, 0);
|
|
1341
|
-
};
|
|
1342
|
-
|
|
1343
|
-
// src/actions/publint.ts
|
|
1344
|
-
var publint = async ({ verbose, pkg }) => {
|
|
1345
|
-
return pkg ? await publintPackage({ pkg, verbose }) : publintAll({ verbose });
|
|
1346
|
-
};
|
|
1347
|
-
var publintPackage = ({ verbose, pkg }) => {
|
|
1348
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
1349
|
-
return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint", ...verboseOptions]]]);
|
|
1350
|
-
};
|
|
1351
|
-
var publintAll = ({ verbose }) => {
|
|
1352
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
1353
|
-
return runSteps("Publint", [["yarn", ["workspaces foreach -pA run package-publint", ...verboseOptions]]]);
|
|
1354
|
-
};
|
|
1355
|
-
|
|
1356
|
-
// src/actions/rebuild.ts
|
|
1357
|
-
var rebuild = ({ target }) => {
|
|
1358
|
-
return runSteps("Rebuild", [
|
|
1359
|
-
["yarn", "xy clean"],
|
|
1360
|
-
["yarn", target ? `xy build -t ${target}` : "xy build"]
|
|
1361
|
-
]);
|
|
1362
|
-
};
|
|
1363
|
-
|
|
1364
|
-
// src/actions/recompile.ts
|
|
1365
|
-
var import_chalk25 = __toESM(require("chalk"));
|
|
1366
|
-
var recompile = async ({ verbose, target, pkg, incremental }) => {
|
|
1367
|
-
return pkg ? await recompilePackage({ pkg, target, verbose }) : await recompileAll({ incremental, target, verbose });
|
|
1368
|
-
};
|
|
1369
|
-
var recompilePackage = ({ verbose, target, pkg }) => {
|
|
1370
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
1371
|
-
const targetOptions = target ? ["-t", target] : [];
|
|
1372
|
-
return runStepsAsync(`Recompile [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-recompile", ...verboseOptions, ...targetOptions]]]);
|
|
1373
|
-
};
|
|
1374
|
-
var recompileAll = async ({ jobs, verbose, target, incremental }) => {
|
|
1375
|
-
const start = Date.now();
|
|
1376
|
-
const verboseOptions = verbose ? ["-v"] : [];
|
|
1377
|
-
const targetOptions = target ? ["-t", target] : [];
|
|
1378
|
-
const incrementalOptions = incremental ? ["--since", "-ptA"] : ["-ptA"];
|
|
1379
|
-
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
1380
|
-
if (jobs) {
|
|
1381
|
-
console.log(import_chalk25.default.blue(`Jobs set to [${jobs}]`));
|
|
1382
|
-
}
|
|
1383
|
-
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
1384
|
-
["yarn", ["workspaces", "foreach", ...incrementalOptions, ...jobsOptions, "run", "package-recompile", ...verboseOptions, ...targetOptions]]
|
|
1385
|
-
]);
|
|
1386
|
-
console.log(`${import_chalk25.default.gray("Recompiled in")} [${import_chalk25.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk25.default.gray("seconds")}`);
|
|
1387
|
-
return result;
|
|
1388
|
-
};
|
|
1389
|
-
|
|
1390
|
-
// src/actions/reinstall.ts
|
|
1391
|
-
var import_fs12 = require("fs");
|
|
1392
|
-
var reinstall = () => {
|
|
1393
|
-
console.log("Reinstall [Clear Lock File]");
|
|
1394
|
-
(0, import_fs12.closeSync)((0, import_fs12.openSync)("./yarn.lock", "w"));
|
|
1395
|
-
console.log("Reinstall [Clear Node Modules]");
|
|
1396
|
-
const workspaces = yarnWorkspaces();
|
|
1397
|
-
const result = workspaces.map(({ location, name }) => {
|
|
1398
|
-
const dist = `${location}/node_modules`;
|
|
1399
|
-
try {
|
|
1400
|
-
(0, import_fs12.rmSync)(dist, { force: true, recursive: true });
|
|
1401
|
-
return 0;
|
|
1402
|
-
} catch (ex) {
|
|
1403
|
-
const error = ex;
|
|
1404
|
-
console.error(`Reinstall [Clear Node Modules] Failed [${name}, ${error.message}]`);
|
|
1405
|
-
return 1;
|
|
1406
|
-
}
|
|
1407
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
1408
|
-
return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
|
|
1409
|
-
};
|
|
1410
|
-
|
|
1411
|
-
// src/actions/relint.ts
|
|
1412
|
-
var import_fs13 = require("fs");
|
|
1413
|
-
var relint = () => {
|
|
1414
|
-
console.log("Relint - Cleaning [.eslintcache]");
|
|
1415
|
-
const workspaces = yarnWorkspaces();
|
|
1416
|
-
const result = workspaces.map(({ location, name }) => {
|
|
1417
|
-
const dist = `${location}/.eslintcache`;
|
|
1418
|
-
try {
|
|
1419
|
-
(0, import_fs13.rmSync)(dist, { force: true, recursive: true });
|
|
1420
|
-
return 0;
|
|
1421
|
-
} catch (ex) {
|
|
1422
|
-
const error = ex;
|
|
1423
|
-
console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
1424
|
-
return 1;
|
|
1425
|
-
}
|
|
1426
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
1427
|
-
return result || runSteps("Relint", [["yarn", ["eslint", ".", "--cache"]]]);
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
// src/actions/retest.ts
|
|
1431
|
-
var retest = () => {
|
|
1432
|
-
return runSteps("Test", [
|
|
1433
|
-
["yarn", ["jest", "--clearCache"]],
|
|
1434
|
-
["yarn", ["jest", "."]]
|
|
1435
|
-
]);
|
|
1436
|
-
};
|
|
1437
|
-
|
|
1438
|
-
// src/actions/sonar.ts
|
|
1439
|
-
var sonar = () => {
|
|
1440
|
-
return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
// src/actions/statics.ts
|
|
1444
|
-
var import_chalk26 = __toESM(require("chalk"));
|
|
1445
|
-
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/styles", "@mui/system"];
|
|
1446
|
-
var statics = () => {
|
|
1447
|
-
console.log(import_chalk26.default.green("Check Required Static Dependencies"));
|
|
1448
|
-
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
1449
|
-
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
// src/actions/test.ts
|
|
1453
|
-
var test = () => {
|
|
1454
|
-
return runSteps("Test", [["yarn", ["jest", "."]]]);
|
|
1455
|
-
};
|
|
1456
|
-
|
|
1457
|
-
// src/actions/tsconfig-gen-cjs.ts
|
|
1458
|
-
var import_chalk27 = __toESM(require("chalk"));
|
|
1459
|
-
var import_fs14 = require("fs");
|
|
1460
|
-
var tsconfigGenCjs = (pkg) => {
|
|
1461
|
-
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
1462
|
-
console.log(import_chalk27.default.green("Generate Configs [CJS]"));
|
|
1463
|
-
return workspaces.map(({ location, name }) => {
|
|
1464
|
-
try {
|
|
1465
|
-
const configObject = createBuildConfig(location, "CommonJS", "ES6", "cjs");
|
|
1466
|
-
if (configObject) {
|
|
1467
|
-
const config = JSON.stringify(createBuildConfig(location, "CommonJS", "ES6", "cjs"), null, 2);
|
|
1468
|
-
let currentConfig;
|
|
1469
|
-
try {
|
|
1470
|
-
currentConfig = (0, import_fs14.readFileSync)(`${location}/.tsconfig.build.cjs.json`, { encoding: "utf8" });
|
|
1471
|
-
} catch (ex) {
|
|
1472
|
-
currentConfig = void 0;
|
|
1473
|
-
}
|
|
1474
|
-
if (currentConfig !== config) {
|
|
1475
|
-
console.log(import_chalk27.default.gray(`Updating CJS tsconfig [${name}]`));
|
|
1476
|
-
(0, import_fs14.writeFileSync)(`${location}/.tsconfig.build.cjs.json`, config, { encoding: "utf8" });
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
return 0;
|
|
1480
|
-
} catch (ex) {
|
|
1481
|
-
const error = ex;
|
|
1482
|
-
console.error(`tsconfig (CJS) generate failed [${name}] [${error.message}]`);
|
|
1483
|
-
return 1;
|
|
1484
|
-
}
|
|
1485
|
-
}).reduce((prev, value) => prev || value, 0);
|
|
1486
|
-
};
|
|
1487
|
-
|
|
1488
|
-
// src/actions/tsconfig-gen-esm.ts
|
|
1489
|
-
var import_chalk28 = __toESM(require("chalk"));
|
|
1490
|
-
var import_fs15 = require("fs");
|
|
1491
|
-
var tsconfigGenEsm = (pkg) => {
|
|
1492
|
-
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
1493
|
-
console.log(import_chalk28.default.green("Generate Configs [ESM]"));
|
|
1494
|
-
return workspaces.map(({ location, name }) => {
|
|
1495
|
-
try {
|
|
1496
|
-
const configObject = createBuildConfig(location, "ESNext", "ESNext", "esm");
|
|
1497
|
-
if (configObject) {
|
|
1498
|
-
const config = JSON.stringify(configObject, null, 2);
|
|
1499
|
-
let currentConfig;
|
|
1500
|
-
try {
|
|
1501
|
-
currentConfig = (0, import_fs15.readFileSync)(`${location}/.tsconfig.build.esm.json`, { encoding: "utf8" });
|
|
1502
|
-
} catch (ex) {
|
|
1503
|
-
currentConfig = void 0;
|
|
1504
|
-
}
|
|
1505
|
-
if (currentConfig !== config) {
|
|
1506
|
-
console.log(import_chalk28.default.gray(`Updating ESM tsconfig [${name}]`));
|
|
1507
|
-
(0, import_fs15.writeFileSync)(`${location}/.tsconfig.build.esm.json`, config, { encoding: "utf8" });
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
return 0;
|
|
1511
|
-
} catch (ex) {
|
|
1512
|
-
const error = ex;
|
|
1513
|
-
console.error(`tsconfig (ESM) generate failed [${name}] [${error.message}]`);
|
|
1514
|
-
return 1;
|
|
1515
|
-
}
|
|
1516
|
-
}).reduce((prev, value) => prev || value, 0);
|
|
1517
|
-
};
|
|
1518
|
-
|
|
1519
|
-
// src/actions/tsconfig-gen-test.ts
|
|
1520
|
-
var import_chalk29 = __toESM(require("chalk"));
|
|
1521
|
-
var import_fs16 = require("fs");
|
|
1522
|
-
var tsconfigName = ".tsconfig.build.test.json";
|
|
1523
|
-
var tsconfig = JSON.stringify(
|
|
1524
|
-
{
|
|
1525
|
-
extends: "./tsconfig.json",
|
|
1526
|
-
include: ["src/**/*.spec.ts"]
|
|
1527
|
-
},
|
|
1528
|
-
null,
|
|
1529
|
-
2
|
|
1530
|
-
);
|
|
1531
|
-
var tsconfigGenTest = (pkg) => {
|
|
1532
|
-
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
1533
|
-
console.log(import_chalk29.default.green("Generate Configs [Test]"));
|
|
1534
|
-
return workspaces.map(({ location, name }) => {
|
|
1535
|
-
try {
|
|
1536
|
-
let currentConfig;
|
|
1537
|
-
try {
|
|
1538
|
-
currentConfig = (0, import_fs16.readFileSync)(`${location}/${tsconfigName}`, { encoding: "utf8" });
|
|
1539
|
-
} catch (ex) {
|
|
1540
|
-
currentConfig = void 0;
|
|
1541
|
-
}
|
|
1542
|
-
if (currentConfig !== tsconfig) {
|
|
1543
|
-
console.log(import_chalk29.default.gray(`Updating TEST tsconfig [${name}]`));
|
|
1544
|
-
(0, import_fs16.writeFileSync)(`${location}/${tsconfigName}`, tsconfig, { encoding: "utf8" });
|
|
1545
|
-
}
|
|
1546
|
-
return 0;
|
|
1547
|
-
} catch (ex) {
|
|
1548
|
-
const error = ex;
|
|
1549
|
-
console.error(`tsconfig (TEST) generate failed [${name}] [${error.message}]`);
|
|
1550
|
-
return 1;
|
|
1551
|
-
}
|
|
1552
|
-
}).reduce((prev, value) => prev || value, 0);
|
|
1553
|
-
};
|
|
1554
|
-
|
|
1555
|
-
// src/actions/tsconfig-gen.ts
|
|
1556
|
-
var tsconfigGen = ({ target, pkg }) => {
|
|
1557
|
-
switch (target) {
|
|
1558
|
-
case "esm":
|
|
1559
|
-
return tsconfigGenEsm(pkg) || tsconfigGenTest(pkg);
|
|
1560
|
-
case "cjs":
|
|
1561
|
-
return tsconfigGenCjs(pkg) || tsconfigGenTest(pkg);
|
|
1562
|
-
default:
|
|
1563
|
-
return tsconfigGenEsm(pkg) || tsconfigGenCjs(pkg) || tsconfigGenTest(pkg);
|
|
1564
|
-
}
|
|
1565
|
-
};
|
|
1566
|
-
|
|
1567
|
-
// src/actions/tsconfig-gen-clean.ts
|
|
1568
|
-
var import_chalk30 = __toESM(require("chalk"));
|
|
1569
|
-
var import_fs17 = require("fs");
|
|
1570
|
-
var tsconfigGenClean = (pkg) => {
|
|
1571
|
-
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
1572
|
-
console.log(import_chalk30.default.green("Clean TSConfigs"));
|
|
1573
|
-
return workspaces.map(({ location, name }) => {
|
|
1574
|
-
const dist = `${location}/**/.tsconfig*`;
|
|
1575
|
-
try {
|
|
1576
|
-
(0, import_fs17.rmSync)(dist, { force: true, recursive: true });
|
|
1577
|
-
return 0;
|
|
1578
|
-
} catch (ex) {
|
|
1579
|
-
const error = ex;
|
|
1580
|
-
console.error(`Clean Failed [${name}, ${error.message}]`);
|
|
1581
|
-
return 1;
|
|
1582
|
-
}
|
|
1583
|
-
}).reduce((prev, result) => prev || result, 0);
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
// src/actions/up.ts
|
|
1587
|
-
var up = () => {
|
|
1588
|
-
return runSteps("Up", [["yarn", "outdated"]]);
|
|
1589
|
-
};
|
|
1590
|
-
|
|
1591
|
-
// src/actions/updo.ts
|
|
1592
|
-
var updo = () => {
|
|
1593
|
-
return runSteps("Updo", [
|
|
1594
|
-
["yarn", "install"],
|
|
1595
|
-
["yarn", "upgrade-interactive"],
|
|
1596
|
-
["yarn", "dedupe"]
|
|
1597
|
-
]);
|
|
1598
|
-
};
|
|
1599
|
-
|
|
1600
|
-
// src/actions/upplug.ts
|
|
1601
|
-
var updateYarnPlugins = () => {
|
|
1602
|
-
return runSteps("Update Yarn Plugins", [
|
|
1603
|
-
["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
|
|
1604
|
-
["yarn", ["plugin", "import", "version"]],
|
|
1605
|
-
["yarn", ["plugin", "import", "interactive-tools"]],
|
|
1606
|
-
["yarn", ["plugin", "import", "workspace-tools"]]
|
|
1607
|
-
]);
|
|
1608
|
-
};
|
|
1609
|
-
|
|
1610
|
-
// src/actions/upyarn.ts
|
|
1611
|
-
var updateYarnVersion = () => {
|
|
1612
|
-
return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
|
-
// src/actions/yarn3only.ts
|
|
1616
|
-
var yarn3Only = () => {
|
|
1617
|
-
const [valid, version] = isYarnVersionOrGreater(3);
|
|
1618
|
-
if (!valid) {
|
|
1619
|
-
processEx(`Invalid Yarn version [${version}]`);
|
|
1620
|
-
}
|
|
1621
|
-
return 0;
|
|
1622
|
-
};
|
|
1623
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
1624
|
-
0 && (module.exports = {
|
|
1625
|
-
build,
|
|
1626
|
-
clean,
|
|
1627
|
-
cleanAll,
|
|
1628
|
-
cleanDocs,
|
|
1629
|
-
cleanPackage,
|
|
1630
|
-
compile,
|
|
1631
|
-
compileAll,
|
|
1632
|
-
compilePackage,
|
|
1633
|
-
copyAssets,
|
|
1634
|
-
cycle,
|
|
1635
|
-
dead,
|
|
1636
|
-
deploy,
|
|
1637
|
-
deployMajor,
|
|
1638
|
-
deployMinor,
|
|
1639
|
-
deployNext,
|
|
1640
|
-
deps,
|
|
1641
|
-
depsAll,
|
|
1642
|
-
depsPackage,
|
|
1643
|
-
dupdeps,
|
|
1644
|
-
fix,
|
|
1645
|
-
genDocs,
|
|
1646
|
-
genDocsAll,
|
|
1647
|
-
genDocsPackage,
|
|
1648
|
-
gitignoreGen,
|
|
1649
|
-
gitlint,
|
|
1650
|
-
gitlintFix,
|
|
1651
|
-
license,
|
|
1652
|
-
lint,
|
|
1653
|
-
lintAll,
|
|
1654
|
-
lintClean,
|
|
1655
|
-
lintPackage,
|
|
1656
|
-
lintProfile,
|
|
1657
|
-
npmignoreGen,
|
|
1658
|
-
packageClean,
|
|
1659
|
-
packageCleanOutputs,
|
|
1660
|
-
packageCleanTypescript,
|
|
1661
|
-
packageCompile,
|
|
1662
|
-
packageCompileCjs,
|
|
1663
|
-
packageCompileEsm,
|
|
1664
|
-
packageCopyAssets,
|
|
1665
|
-
packageDeps,
|
|
1666
|
-
packageGenDocs,
|
|
1667
|
-
packagePublint,
|
|
1668
|
-
packageRecompile,
|
|
1669
|
-
packageTsconfigGenCjs,
|
|
1670
|
-
packageTsconfigGenEsm,
|
|
1671
|
-
publint,
|
|
1672
|
-
publintAll,
|
|
1673
|
-
publintPackage,
|
|
1674
|
-
rebuild,
|
|
1675
|
-
recompile,
|
|
1676
|
-
recompileAll,
|
|
1677
|
-
recompilePackage,
|
|
1678
|
-
reinstall,
|
|
1679
|
-
relint,
|
|
1680
|
-
retest,
|
|
1681
|
-
sonar,
|
|
1682
|
-
statics,
|
|
1683
|
-
test,
|
|
1684
|
-
tsconfigGen,
|
|
1685
|
-
tsconfigGenCjs,
|
|
1686
|
-
tsconfigGenClean,
|
|
1687
|
-
tsconfigGenEsm,
|
|
1688
|
-
tsconfigGenTest,
|
|
1689
|
-
up,
|
|
1690
|
-
updateYarnPlugins,
|
|
1691
|
-
updateYarnVersion,
|
|
1692
|
-
updo,
|
|
1693
|
-
yarn3Only
|
|
1694
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./build"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./clean"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./clean-docs"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./compile"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./copy-assets"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./cycle"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./dead"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./deploy"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./deploy-major"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./deploy-minor"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./deploy-next"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./deps"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./dupdeps"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./fix"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./gen-docs"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./gitignore-gen"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./gitlint"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./gitlint-fix"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./license"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./lint"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./lint-clean"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./lint-profile"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./npmignore-gen"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./package"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./publint"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./rebuild"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./recompile"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./reinstall"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./relint"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./retest"), exports);
|
|
34
|
+
tslib_1.__exportStar(require("./sonar"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./statics"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./test"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./up"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./updo"), exports);
|
|
39
|
+
tslib_1.__exportStar(require("./upplug"), exports);
|
|
40
|
+
tslib_1.__exportStar(require("./upyarn"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./yarn3only"), exports);
|
|
1695
42
|
//# sourceMappingURL=index.js.map
|