skuba 14.0.0-migrate-to-inquirer-20251031055743 → 14.0.0-replace-global-vars-20251117052457
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/config/eslint.js +1 -1
- package/config/prettier.d.ts +8 -4
- package/config/prettier.js +10 -2
- package/lib/cli/adapter/eslint.js +11 -45
- package/lib/cli/adapter/eslint.js.map +3 -3
- package/lib/cli/adapter/prettier.js +39 -67
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +8 -42
- package/lib/cli/build/args.js.map +2 -2
- package/lib/cli/build/assets.d.ts +3 -2
- package/lib/cli/build/assets.js +28 -60
- package/lib/cli/build/assets.js.map +3 -3
- package/lib/cli/build/esbuild.js +21 -45
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +21 -55
- package/lib/cli/build/index.js.map +3 -3
- package/lib/cli/build/tsc.js +23 -61
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/buildPackage/index.js +8 -32
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +16 -50
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/analyseDependencies.d.ts +1 -1
- package/lib/cli/configure/analyseDependencies.js +25 -59
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +5 -39
- package/lib/cli/configure/analysis/diff.js.map +3 -3
- package/lib/cli/configure/analysis/files.js +8 -42
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +12 -46
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/configure/analysis/package.d.ts +2 -3
- package/lib/cli/configure/analysis/package.js +10 -45
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +18 -50
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +7 -35
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +4 -28
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +4 -28
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +4 -28
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +2 -26
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +4 -29
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +35 -60
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.d.ts +1 -1
- package/lib/cli/configure/getEntryPoint.js +14 -48
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/getProjectType.d.ts +1 -1
- package/lib/cli/configure/getProjectType.js +14 -35
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +50 -84
- package/lib/cli/configure/index.js.map +3 -3
- package/lib/cli/configure/modules/eslint.js +10 -34
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +8 -32
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +18 -44
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/nodemon.js +4 -28
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +10 -34
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +11 -35
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +17 -40
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +2 -26
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +4 -28
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +3 -39
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +2 -26
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +2 -27
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +6 -31
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +2 -26
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +4 -28
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.d.ts +1 -67
- package/lib/cli/configure/processing/package.js +8 -45
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +4 -38
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +5 -41
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +26 -63
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/types.d.ts +15 -4
- package/lib/cli/configure/types.js +0 -16
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +20 -54
- package/lib/cli/format/index.js.map +3 -3
- package/lib/cli/help/index.js +6 -30
- package/lib/cli/help/index.js.map +1 -1
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/init/getConfig.js +89 -118
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.js +16 -51
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +67 -98
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.js +21 -42
- package/lib/cli/init/prompts.js.map +1 -1
- package/lib/cli/init/types.js +7 -41
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +2 -30
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +8 -42
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +3 -37
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +11 -45
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +3 -37
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +3 -37
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +3 -37
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +2 -26
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +11 -45
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +2 -26
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +2 -26
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +4 -28
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +6 -30
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +37 -73
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/eslint.js +16 -51
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +19 -51
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +26 -52
- package/lib/cli/lint/index.js.map +2 -2
- package/lib/cli/lint/internal.js +20 -52
- package/lib/cli/lint/internal.js.map +3 -3
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +8 -33
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +12 -48
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +21 -55
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +33 -66
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
- package/lib/cli/lint/internalLints/upgrade/index.js +23 -56
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +6 -30
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +37 -65
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +23 -59
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +6 -30
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +29 -67
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +10 -34
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +4 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +18 -63
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +15 -50
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +11 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +5 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +72 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +17 -51
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +10 -34
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +10 -44
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +12 -46
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +15 -49
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +10 -39
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +13 -47
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +8 -32
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +1 -1
- package/lib/cli/lint/prettier.js +15 -50
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +4 -28
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +0 -16
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.js +10 -34
- package/lib/cli/migrate/index.js.map +1 -1
- package/lib/cli/migrate/nodeVersion/checks.js +24 -61
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.js +25 -55
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/node/index.js +20 -57
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +4 -28
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +16 -50
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +4 -44
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/version/index.js +6 -30
- package/lib/cli/version/index.js.map +1 -1
- package/lib/eslint.d.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +6 -46
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +26 -45
- package/lib/skuba.js.map +3 -3
- package/lib/utils/args.js +6 -43
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +4 -42
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +20 -57
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +32 -72
- package/lib/utils/dir.js.map +2 -2
- package/lib/utils/env.js +2 -26
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +10 -47
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.d.ts +3 -2
- package/lib/utils/exec.js +24 -62
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +6 -40
- package/lib/utils/fs.js.map +3 -3
- package/lib/utils/help.js +6 -30
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/logging.d.ts +9 -10
- package/lib/utils/logging.js +11 -48
- package/lib/utils/logging.js.map +3 -3
- package/lib/utils/logo.js +28 -59
- package/lib/utils/logo.js.map +3 -3
- package/lib/utils/manifest.d.ts +3 -2
- package/lib/utils/manifest.js +8 -48
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +2 -26
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +12 -49
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +4 -39
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +2 -26
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/template.js +18 -55
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +2 -31
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +9 -46
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +7 -32
- package/lib/utils/wait.js.map +1 -1
- package/lib/utils/worker.d.ts +3 -3
- package/lib/utils/worker.js +10 -35
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/function-arguments.d.js +0 -1
- package/lib/wrapper/functionHandler.js +18 -49
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.d.ts +0 -6
- package/lib/wrapper/http.js +8 -51
- package/lib/wrapper/http.js.map +3 -3
- package/lib/wrapper/index.js +6 -7
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +8 -42
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +13 -46
- package/lib/wrapper/requestListener.js.map +3 -3
- package/lib/wrapper/server.d.ts +7 -0
- package/lib/wrapper/server.js +11 -0
- package/lib/wrapper/server.js.map +7 -0
- package/package.json +17 -24
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +3 -2
- package/template/base/vitest.config.ts +25 -0
- package/template/express-rest-api/package.json +2 -1
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +1 -0
- package/template/greeter/package.json +4 -3
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +3 -1
- package/template/koa-rest-api/package.json +2 -1
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -0
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +2 -0
- package/template/koa-rest-api/src/app.test.ts +2 -0
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +2 -0
- package/template/koa-rest-api/src/testing/metrics.ts +2 -0
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +15 -3
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +11 -9
- package/template/lambda-sqs-worker-cdk/package.json +6 -5
- package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +22 -13
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +1 -0
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +33 -31
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +8 -2
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -2
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +4 -3
- package/template/oss-npm-package/_package.json +1 -0
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +2 -0
- package/template/private-npm-package/_package.json +1 -0
- package/template/private-npm-package/skuba.template.js +1 -1
- package/template/private-npm-package/src/index.test.ts +2 -0
- package/config/jest.js +0 -1
- package/jest/moduleNameMapper.js +0 -64
- package/jest/transform.js +0 -62
- package/jest/tsConfig.js +0 -26
- package/jest-preset.js +0 -37
- package/lib/api/jest/index.d.ts +0 -15
- package/lib/api/jest/index.js +0 -59
- package/lib/api/jest/index.js.map +0 -7
- package/lib/cli/configure/modules/jest.d.ts +0 -2
- package/lib/cli/configure/modules/jest.js +0 -86
- package/lib/cli/configure/modules/jest.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
- package/lib/cli/test/reporters/github/annotations.d.ts +0 -9
- package/lib/cli/test/reporters/github/annotations.js +0 -102
- package/lib/cli/test/reporters/github/annotations.js.map +0 -7
- package/lib/cli/test/reporters/github/index.d.ts +0 -5
- package/lib/cli/test/reporters/github/index.js +0 -74
- package/lib/cli/test/reporters/github/index.js.map +0 -7
- package/template/base/jest.config.ts +0 -19
- package/template/base/jest.setup.ts +0 -3
package/lib/utils/error.js
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var error_exports = {};
|
|
30
|
-
__export(error_exports, {
|
|
31
|
-
concurrentlyErrorsSchema: () => concurrentlyErrorsSchema,
|
|
32
|
-
createTerseError: () => createTerseError,
|
|
33
|
-
handleCliError: () => handleCliError,
|
|
34
|
-
isErrorWithCode: () => isErrorWithCode
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(error_exports);
|
|
37
|
-
var import_util = require("util");
|
|
38
|
-
var z = __toESM(require("zod/v4"));
|
|
39
|
-
var import_logging = require("./logging.js");
|
|
40
|
-
var import_validation = require("./validation.js");
|
|
1
|
+
import { inspect } from "util";
|
|
2
|
+
import * as z from "zod/v4";
|
|
3
|
+
import { log } from "./logging.js";
|
|
4
|
+
import { hasNumberProp, hasProp } from "./validation.js";
|
|
41
5
|
const concurrentlyErrorsSchema = z.array(
|
|
42
6
|
z.object({
|
|
43
7
|
command: z.object({
|
|
@@ -49,24 +13,23 @@ const concurrentlyErrorsSchema = z.array(
|
|
|
49
13
|
})
|
|
50
14
|
);
|
|
51
15
|
const createTerseError = (message) => Object.assign(new Error(message), {
|
|
52
|
-
[
|
|
16
|
+
[inspect.custom]: () => message
|
|
53
17
|
});
|
|
54
|
-
const isExecaError = (err) =>
|
|
18
|
+
const isExecaError = (err) => hasNumberProp(err, "exitCode");
|
|
55
19
|
const handleCliError = (err) => {
|
|
56
20
|
if (isExecaError(err)) {
|
|
57
21
|
process.exitCode = err.exitCode;
|
|
58
22
|
return;
|
|
59
23
|
}
|
|
60
|
-
|
|
24
|
+
log.err(inspect(err));
|
|
61
25
|
process.exitCode = 1;
|
|
62
26
|
return;
|
|
63
27
|
};
|
|
64
|
-
const isErrorWithCode = (err, code) =>
|
|
65
|
-
|
|
66
|
-
0 && (module.exports = {
|
|
28
|
+
const isErrorWithCode = (err, code) => hasProp(err, "code") && err.code === code;
|
|
29
|
+
export {
|
|
67
30
|
concurrentlyErrorsSchema,
|
|
68
31
|
createTerseError,
|
|
69
32
|
handleCliError,
|
|
70
33
|
isErrorWithCode
|
|
71
|
-
}
|
|
34
|
+
};
|
|
72
35
|
//# sourceMappingURL=error.js.map
|
package/lib/utils/error.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/error.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport type { ExecaError } from 'execa';\nimport * as z from 'zod/v4';\n\nimport { log } from './logging.js';\nimport { hasNumberProp, hasProp } from './validation.js';\n\nexport type ConcurrentlyErrors = z.infer<typeof concurrentlyErrorsSchema>;\n\nexport const concurrentlyErrorsSchema = z.array(\n z.object({\n command: z.object({\n command: z.string(),\n name: z.string(),\n }),\n index: z.number(),\n exitCode: z.number(),\n }),\n);\n\n/**\n * Creates an error that returns its plain `message` rather than a full stack\n * trace when `util.inspect`ed.\n *\n * This can be useful for terser handling and logging of known error scenarios\n * that have descriptive messages.\n *\n * https://nodejs.org/api/util.html#custom-inspection-functions-on-objects\n */\nexport const createTerseError = (message?: string) =>\n Object.assign(new Error(message), {\n [inspect.custom]: () => message,\n });\n\nconst isExecaError = (err: unknown): err is ExecaError =>\n hasNumberProp(err, 'exitCode');\n\nexport const handleCliError = (err: unknown) => {\n if (isExecaError(err)) {\n process.exitCode = err.exitCode;\n return;\n }\n\n log.err(inspect(err));\n process.exitCode = 1;\n return;\n};\n\nexport const isErrorWithCode = <T>(\n err: unknown,\n code: T,\n): err is Record<PropertyKey, unknown> & { code: T } =>\n hasProp(err, 'code') && err.code === code;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAGxB,YAAY,OAAO;AAEnB,SAAS,WAAW;AACpB,SAAS,eAAe,eAAe;AAIhC,MAAM,2BAA2B,EAAE;AAAA,EACxC,EAAE,OAAO;AAAA,IACP,SAAS,EAAE,OAAO;AAAA,MAChB,SAAS,EAAE,OAAO;AAAA,MAClB,MAAM,EAAE,OAAO;AAAA,IACjB,CAAC;AAAA,IACD,OAAO,EAAE,OAAO;AAAA,IAChB,UAAU,EAAE,OAAO;AAAA,EACrB,CAAC;AACH;AAWO,MAAM,mBAAmB,CAAC,YAC/B,OAAO,OAAO,IAAI,MAAM,OAAO,GAAG;AAAA,EAChC,CAAC,QAAQ,MAAM,GAAG,MAAM;AAC1B,CAAC;AAEH,MAAM,eAAe,CAAC,QACpB,cAAc,KAAK,UAAU;AAExB,MAAM,iBAAiB,CAAC,QAAiB;AAC9C,MAAI,aAAa,GAAG,GAAG;AACrB,YAAQ,WAAW,IAAI;AACvB;AAAA,EACF;AAEA,MAAI,IAAI,QAAQ,GAAG,CAAC;AACpB,UAAQ,WAAW;AACnB;AACF;AAEO,MAAM,kBAAkB,CAC7B,KACA,SAEA,QAAQ,KAAK,MAAM,KAAK,IAAI,SAAS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/utils/exec.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { styleText } from 'node:util';
|
|
1
2
|
import stream from 'stream';
|
|
2
|
-
import type { Color } from 'chalk';
|
|
3
3
|
import execa, { type ExecaChildProcess } from 'execa';
|
|
4
4
|
import type { PackageManager } from './packageManager.js';
|
|
5
|
+
type StyleColor = Parameters<typeof styleText>[0];
|
|
5
6
|
export type Exec = (command: string, ...args: string[]) => ExecaChildProcess<string>;
|
|
6
7
|
interface ExecConcurrentlyCommand {
|
|
7
8
|
command: string;
|
|
8
9
|
name: string;
|
|
9
|
-
prefixColor?:
|
|
10
|
+
prefixColor?: StyleColor;
|
|
10
11
|
}
|
|
11
12
|
interface ExecConcurrentlyOptions {
|
|
12
13
|
/**
|
package/lib/utils/exec.js
CHANGED
|
@@ -1,50 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var exec_exports = {};
|
|
30
|
-
__export(exec_exports, {
|
|
31
|
-
createExec: () => createExec,
|
|
32
|
-
ensureCommands: () => ensureCommands,
|
|
33
|
-
exec: () => exec,
|
|
34
|
-
execConcurrently: () => execConcurrently,
|
|
35
|
-
hasCommand: () => hasCommand
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(exec_exports);
|
|
38
|
-
var import_os = require("os");
|
|
39
|
-
var import_stream = __toESM(require("stream"));
|
|
40
|
-
var import_util = __toESM(require("util"));
|
|
41
|
-
var import_concurrently = __toESM(require("concurrently"));
|
|
42
|
-
var import_execa = __toESM(require("execa"));
|
|
43
|
-
var import_npm_run_path = __toESM(require("npm-run-path"));
|
|
44
|
-
var import_npm_which = __toESM(require("npm-which"));
|
|
45
|
-
var import_error = require("./error.js");
|
|
46
|
-
var import_logging = require("./logging.js");
|
|
47
|
-
class YarnSpamFilter extends import_stream.default.Transform {
|
|
1
|
+
import { cpus } from "os";
|
|
2
|
+
import stream from "stream";
|
|
3
|
+
import util from "util";
|
|
4
|
+
import concurrently from "concurrently";
|
|
5
|
+
import execa from "execa";
|
|
6
|
+
import npmRunPath from "npm-run-path";
|
|
7
|
+
import npmWhich from "npm-which";
|
|
8
|
+
import { concurrentlyErrorsSchema, isErrorWithCode } from "./error.js";
|
|
9
|
+
import { log } from "./logging.js";
|
|
10
|
+
class YarnSpamFilter extends stream.Transform {
|
|
48
11
|
silenced = false;
|
|
49
12
|
_transform(chunk, _encoding, callback) {
|
|
50
13
|
const str = Buffer.from(chunk).toString();
|
|
@@ -58,7 +21,7 @@ class YarnSpamFilter extends import_stream.default.Transform {
|
|
|
58
21
|
callback();
|
|
59
22
|
}
|
|
60
23
|
}
|
|
61
|
-
class YarnWarningFilter extends
|
|
24
|
+
class YarnWarningFilter extends stream.Transform {
|
|
62
25
|
_transform(chunk, _encoding, callback) {
|
|
63
26
|
const str = Buffer.from(chunk).toString();
|
|
64
27
|
if (!str.startsWith("warning skuba >")) {
|
|
@@ -68,11 +31,11 @@ class YarnWarningFilter extends import_stream.default.Transform {
|
|
|
68
31
|
}
|
|
69
32
|
}
|
|
70
33
|
const envWithPath = {
|
|
71
|
-
PATH: (
|
|
34
|
+
PATH: npmRunPath({ cwd: import.meta.dirname })
|
|
72
35
|
};
|
|
73
36
|
const runCommand = (command, args, opts) => {
|
|
74
|
-
const subprocess = (
|
|
75
|
-
localDir:
|
|
37
|
+
const subprocess = execa(command, args, {
|
|
38
|
+
localDir: import.meta.dirname,
|
|
76
39
|
preferLocal: true,
|
|
77
40
|
stdio: "inherit",
|
|
78
41
|
...opts
|
|
@@ -92,8 +55,8 @@ const runCommand = (command, args, opts) => {
|
|
|
92
55
|
}
|
|
93
56
|
return subprocess;
|
|
94
57
|
};
|
|
95
|
-
const whichCallback = (
|
|
96
|
-
const which =
|
|
58
|
+
const whichCallback = npmWhich(import.meta.dirname);
|
|
59
|
+
const which = util.promisify(whichCallback);
|
|
97
60
|
const createExec = (opts) => (command, ...args) => runCommand(command, args, opts);
|
|
98
61
|
const exec = (command, ...args) => runCommand(command, args);
|
|
99
62
|
const execConcurrently = async (commands, { maxProcesses, nameLength, outputStream } = {}) => {
|
|
@@ -102,22 +65,22 @@ const execConcurrently = async (commands, { maxProcesses, nameLength, outputStre
|
|
|
102
65
|
0
|
|
103
66
|
);
|
|
104
67
|
try {
|
|
105
|
-
await (
|
|
68
|
+
await concurrently(
|
|
106
69
|
commands.map(({ command, name, prefixColor }) => ({
|
|
107
70
|
command,
|
|
108
71
|
env: envWithPath,
|
|
109
72
|
name: name.padEnd(maxNameLength),
|
|
110
|
-
prefixColor
|
|
73
|
+
prefixColor: Array.isArray(prefixColor) ? prefixColor[0] : prefixColor
|
|
111
74
|
})),
|
|
112
75
|
{
|
|
113
|
-
maxProcesses: maxProcesses ??
|
|
76
|
+
maxProcesses: maxProcesses ?? cpus().length,
|
|
114
77
|
outputStream,
|
|
115
78
|
// Use a minimalist logging prefix.
|
|
116
79
|
prefix: "{name} \u2502"
|
|
117
80
|
}
|
|
118
81
|
).result;
|
|
119
82
|
} catch (err) {
|
|
120
|
-
const result =
|
|
83
|
+
const result = concurrentlyErrorsSchema.safeParse(err);
|
|
121
84
|
if (!result.success) {
|
|
122
85
|
throw err;
|
|
123
86
|
}
|
|
@@ -134,7 +97,7 @@ const ensureCommands = async (...names) => {
|
|
|
134
97
|
const result = await hasCommand(name);
|
|
135
98
|
if (!result) {
|
|
136
99
|
success = false;
|
|
137
|
-
|
|
100
|
+
log.err(log.bold(name), "needs to be installed.");
|
|
138
101
|
}
|
|
139
102
|
})
|
|
140
103
|
);
|
|
@@ -147,18 +110,17 @@ const hasCommand = async (name) => {
|
|
|
147
110
|
await which(name);
|
|
148
111
|
return true;
|
|
149
112
|
} catch (err) {
|
|
150
|
-
if (
|
|
113
|
+
if (isErrorWithCode(err, "ENOENT")) {
|
|
151
114
|
return false;
|
|
152
115
|
}
|
|
153
116
|
throw err;
|
|
154
117
|
}
|
|
155
118
|
};
|
|
156
|
-
|
|
157
|
-
0 && (module.exports = {
|
|
119
|
+
export {
|
|
158
120
|
createExec,
|
|
159
121
|
ensureCommands,
|
|
160
122
|
exec,
|
|
161
123
|
execConcurrently,
|
|
162
124
|
hasCommand
|
|
163
|
-
}
|
|
125
|
+
};
|
|
164
126
|
//# sourceMappingURL=exec.js.map
|
package/lib/utils/exec.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/exec.ts"],
|
|
4
|
-
"sourcesContent": ["import { cpus } from 'os';\nimport stream from 'stream';\nimport util from 'util';\n\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import type { styleText } from 'node:util';\nimport { cpus } from 'os';\nimport stream from 'stream';\nimport util from 'util';\n\nimport concurrently from 'concurrently';\nimport execa, { type ExecaChildProcess } from 'execa';\nimport npmRunPath from 'npm-run-path';\nimport npmWhich from 'npm-which';\n\nimport { concurrentlyErrorsSchema, isErrorWithCode } from './error.js';\nimport { log } from './logging.js';\nimport type { PackageManager } from './packageManager.js';\n\ntype StyleColor = Parameters<typeof styleText>[0];\n\nclass YarnSpamFilter extends stream.Transform {\n silenced = false;\n\n _transform(\n chunk: Uint8Array,\n _encoding: BufferEncoding,\n callback: stream.TransformCallback,\n ) {\n const str = Buffer.from(chunk).toString();\n\n // Yarn spews the entire installed dependency tree after this message\n if (str.startsWith('info Direct dependencies')) {\n this.silenced = true;\n }\n\n if (\n !this.silenced &&\n // This isn't very useful given the command generates a lockfile\n !str.startsWith('info No lockfile found')\n ) {\n this.push(chunk);\n }\n\n callback();\n }\n}\n\nclass YarnWarningFilter extends stream.Transform {\n _transform(\n chunk: Uint8Array,\n _encoding: BufferEncoding,\n callback: stream.TransformCallback,\n ) {\n const str = Buffer.from(chunk).toString();\n\n // Filter out annoying deprecation warnings that users can do little about\n if (!str.startsWith('warning skuba >')) {\n this.push(chunk);\n }\n\n callback();\n }\n}\n\nexport type Exec = (\n command: string,\n ...args: string[]\n) => ExecaChildProcess<string>;\n\ninterface ExecConcurrentlyCommand {\n command: string;\n name: string;\n prefixColor?: StyleColor;\n}\n\ninterface ExecConcurrentlyOptions {\n /**\n * The maximum number of processes that can execute concurrently.\n *\n * Defaults to the CPU core count.\n */\n maxProcesses?: number;\n\n /**\n * A set length to pad names to.\n *\n * Defaults to the length of the longest command name.\n */\n nameLength?: number;\n\n /**\n * The stream that logging output will be written to.\n *\n * Defaults to `process.stdout`.\n */\n outputStream?: stream.Writable;\n}\n\ntype ExecOptions = execa.Options & { streamStdio?: true | PackageManager };\n\nconst envWithPath = {\n PATH: npmRunPath({ cwd: import.meta.dirname }),\n};\n\nconst runCommand = (command: string, args: string[], opts?: ExecOptions) => {\n const subprocess = execa(command, args, {\n localDir: import.meta.dirname,\n preferLocal: true,\n stdio: 'inherit',\n ...opts,\n });\n\n switch (opts?.streamStdio) {\n case 'yarn':\n const stderrFilter = new YarnWarningFilter();\n const stdoutFilter = new YarnSpamFilter();\n\n subprocess.stderr?.pipe(stderrFilter).pipe(process.stderr);\n subprocess.stdout?.pipe(stdoutFilter).pipe(process.stdout);\n\n break;\n\n case 'pnpm':\n case true:\n subprocess.stderr?.pipe(process.stderr);\n subprocess.stdout?.pipe(process.stdout);\n\n break;\n }\n\n return subprocess;\n};\n\nconst whichCallback = npmWhich(import.meta.dirname);\n\nconst which = util.promisify<string, string>(whichCallback);\n\nexport const createExec =\n (opts: ExecOptions): Exec =>\n (command, ...args) =>\n runCommand(command, args, opts);\n\nexport const exec: Exec = (command, ...args) => runCommand(command, args);\n\nexport const execConcurrently = async (\n commands: ExecConcurrentlyCommand[],\n { maxProcesses, nameLength, outputStream }: ExecConcurrentlyOptions = {},\n) => {\n const maxNameLength =\n nameLength ??\n commands.reduce(\n (length, command) => Math.max(length, command.name.length),\n 0,\n );\n\n try {\n await concurrently(\n commands.map(({ command, name, prefixColor }) => ({\n command,\n env: envWithPath,\n name: name.padEnd(maxNameLength),\n prefixColor: Array.isArray(prefixColor) ? prefixColor[0] : prefixColor,\n })),\n {\n maxProcesses: maxProcesses ?? cpus().length,\n\n outputStream,\n\n // Use a minimalist logging prefix.\n prefix: '{name} \u2502',\n },\n ).result;\n } catch (err) {\n const result = concurrentlyErrorsSchema.safeParse(err);\n\n if (!result.success) {\n throw err;\n }\n\n const failed = result.data\n .filter(({ exitCode }) => exitCode !== 0)\n .sort(({ index: indexA }, { index: indexB }) => indexA - indexB)\n .map((subprocess) => subprocess.command.name);\n\n throw Error(\n `${failed.join(', ')} subprocess${\n failed.length === 1 ? '' : 'es'\n } failed.`,\n );\n }\n};\n\nexport const ensureCommands = async (...names: string[]) => {\n let success = true;\n\n await Promise.all(\n names.map(async (name) => {\n const result = await hasCommand(name);\n\n if (!result) {\n success = false;\n\n log.err(log.bold(name), 'needs to be installed.');\n }\n }),\n );\n\n if (!success) {\n process.exit(1);\n }\n};\n\nexport const hasCommand = async (name: string) => {\n try {\n await which(name);\n\n return true;\n } catch (err) {\n if (isErrorWithCode(err, 'ENOENT')) {\n return false;\n }\n\n throw err;\n }\n};\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,OAAO,UAAU;AAEjB,OAAO,kBAAkB;AACzB,OAAO,WAAuC;AAC9C,OAAO,gBAAgB;AACvB,OAAO,cAAc;AAErB,SAAS,0BAA0B,uBAAuB;AAC1D,SAAS,WAAW;AAKpB,MAAM,uBAAuB,OAAO,UAAU;AAAA,EAC5C,WAAW;AAAA,EAEX,WACE,OACA,WACA,UACA;AACA,UAAM,MAAM,OAAO,KAAK,KAAK,EAAE,SAAS;AAGxC,QAAI,IAAI,WAAW,0BAA0B,GAAG;AAC9C,WAAK,WAAW;AAAA,IAClB;AAEA,QACE,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AC;AAAA,EAChB;AACF;AAEO,MAAM,aAAa,OAAO,SAAiB;AAChD,MAAI;AACF,UAAM,MAAM,IAAI;AAEhB,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,QAAI,gBAAgB,KAAK,QAAQ,GAAG;AAClC,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/lib/utils/fs.js
CHANGED
|
@@ -1,51 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var fs_exports = {};
|
|
30
|
-
__export(fs_exports, {
|
|
31
|
-
pathExists: () => pathExists
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(fs_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_error = require("./error.js");
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import { isErrorWithCode } from "./error.js";
|
|
36
3
|
const pathExists = async (filePath) => {
|
|
37
4
|
try {
|
|
38
|
-
await
|
|
5
|
+
await fs.promises.access(filePath);
|
|
39
6
|
return true;
|
|
40
7
|
} catch (error) {
|
|
41
|
-
if (
|
|
8
|
+
if (isErrorWithCode(error, "ENOENT")) {
|
|
42
9
|
return false;
|
|
43
10
|
}
|
|
44
11
|
throw error;
|
|
45
12
|
}
|
|
46
13
|
};
|
|
47
|
-
|
|
48
|
-
0 && (module.exports = {
|
|
14
|
+
export {
|
|
49
15
|
pathExists
|
|
50
|
-
}
|
|
16
|
+
};
|
|
51
17
|
//# sourceMappingURL=fs.js.map
|
package/lib/utils/fs.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/fs.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\n\nimport { isErrorWithCode } from './error.js';\n\nexport const pathExists = async (filePath: string): Promise<boolean> => {\n try {\n await fs.access(filePath);\n\n return true; // Path exists and is accessible\n } catch (error: unknown) {\n if (isErrorWithCode(error, 'ENOENT')) {\n return false; // Path does not exist\n }\n\n throw error; // Other errors (include permission issues)\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\n\nimport { isErrorWithCode } from './error.js';\n\nexport const pathExists = async (filePath: string): Promise<boolean> => {\n try {\n await fs.promises.access(filePath);\n\n return true; // Path exists and is accessible\n } catch (error: unknown) {\n if (isErrorWithCode(error, 'ENOENT')) {\n return false; // Path does not exist\n }\n\n throw error; // Other errors (include permission issues)\n }\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AAEf,SAAS,uBAAuB;AAEzB,MAAM,aAAa,OAAO,aAAuC;AACtE,MAAI;AACF,UAAM,GAAG,SAAS,OAAO,QAAQ;AAEjC,WAAO;AAAA,EACT,SAAS,OAAgB;AACvB,QAAI,gBAAgB,OAAO,QAAQ,GAAG;AACpC,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/lib/utils/help.js
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var help_exports = {};
|
|
20
|
-
__export(help_exports, {
|
|
21
|
-
showHelp: () => showHelp
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(help_exports);
|
|
24
|
-
var import_command = require("./command.js");
|
|
25
|
-
var import_logging = require("./logging.js");
|
|
1
|
+
import { COMMAND_LIST } from "./command.js";
|
|
2
|
+
import { log } from "./logging.js";
|
|
26
3
|
const showHelp = () => {
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
log.plain(log.bold("Available commands:"));
|
|
5
|
+
COMMAND_LIST.forEach((item) => log.plain(item));
|
|
29
6
|
};
|
|
30
|
-
|
|
31
|
-
0 && (module.exports = {
|
|
7
|
+
export {
|
|
32
8
|
showHelp
|
|
33
|
-
}
|
|
9
|
+
};
|
|
34
10
|
//# sourceMappingURL=help.js.map
|
package/lib/utils/help.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/help.ts"],
|
|
4
4
|
"sourcesContent": ["import { COMMAND_LIST } from './command.js';\nimport { log } from './logging.js';\n\nexport const showHelp = () => {\n log.plain(log.bold('Available commands:'));\n\n COMMAND_LIST.forEach((item) => log.plain(item));\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAW;AAEb,MAAM,WAAW,MAAM;AAC5B,MAAI,MAAM,IAAI,KAAK,qBAAqB,CAAC;AAEzC,eAAa,QAAQ,CAAC,SAAS,IAAI,MAAM,IAAI,CAAC;AAChD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/utils/logging.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
export type Logger = typeof log;
|
|
3
2
|
export declare const createLogger: ({ debug, prefixes, suffixes, }: {
|
|
4
3
|
debug: boolean;
|
|
@@ -10,9 +9,9 @@ export declare const createLogger: ({ debug, prefixes, suffixes, }: {
|
|
|
10
9
|
prefixes: unknown[];
|
|
11
10
|
suffixes: unknown[];
|
|
12
11
|
};
|
|
13
|
-
bold:
|
|
14
|
-
dim:
|
|
15
|
-
formatSubtle:
|
|
12
|
+
bold: (text: string) => string;
|
|
13
|
+
dim: (text: string) => string;
|
|
14
|
+
formatSubtle: (text: string) => string;
|
|
16
15
|
timing: (start: bigint, end: bigint) => string;
|
|
17
16
|
debug: (...message: unknown[]) => void;
|
|
18
17
|
subtle: (...message: unknown[]) => void;
|
|
@@ -28,9 +27,9 @@ export declare const log: {
|
|
|
28
27
|
prefixes: unknown[];
|
|
29
28
|
suffixes: unknown[];
|
|
30
29
|
};
|
|
31
|
-
bold:
|
|
32
|
-
dim:
|
|
33
|
-
formatSubtle:
|
|
30
|
+
bold: (text: string) => string;
|
|
31
|
+
dim: (text: string) => string;
|
|
32
|
+
formatSubtle: (text: string) => string;
|
|
34
33
|
timing: (start: bigint, end: bigint) => string;
|
|
35
34
|
debug: (...message: unknown[]) => void;
|
|
36
35
|
subtle: (...message: unknown[]) => void;
|
|
@@ -46,9 +45,9 @@ export declare const childLogger: (logger: Logger, settings: Partial<Logger["set
|
|
|
46
45
|
prefixes: unknown[];
|
|
47
46
|
suffixes: unknown[];
|
|
48
47
|
};
|
|
49
|
-
bold:
|
|
50
|
-
dim:
|
|
51
|
-
formatSubtle:
|
|
48
|
+
bold: (text: string) => string;
|
|
49
|
+
dim: (text: string) => string;
|
|
50
|
+
formatSubtle: (text: string) => string;
|
|
52
51
|
timing: (start: bigint, end: bigint) => string;
|
|
53
52
|
debug: (...message: unknown[]) => void;
|
|
54
53
|
subtle: (...message: unknown[]) => void;
|
package/lib/utils/logging.js
CHANGED
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var logging_exports = {};
|
|
30
|
-
__export(logging_exports, {
|
|
31
|
-
childLogger: () => childLogger,
|
|
32
|
-
createLogger: () => createLogger,
|
|
33
|
-
log: () => log,
|
|
34
|
-
pluralise: () => pluralise
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(logging_exports);
|
|
37
|
-
var import_chalk = __toESM(require("chalk"));
|
|
1
|
+
import { styleText } from "node:util";
|
|
38
2
|
const createLogger = ({
|
|
39
3
|
debug,
|
|
40
4
|
prefixes = [],
|
|
@@ -44,17 +8,17 @@ const createLogger = ({
|
|
|
44
8
|
const log2 = (...message) => logWithoutSuffixes(...message, ...suffixes);
|
|
45
9
|
return {
|
|
46
10
|
settings: { debug, prefixes, suffixes },
|
|
47
|
-
bold:
|
|
48
|
-
dim:
|
|
49
|
-
formatSubtle:
|
|
11
|
+
bold: (text) => styleText("bold", text),
|
|
12
|
+
dim: (text) => styleText("dim", text),
|
|
13
|
+
formatSubtle: (text) => styleText("gray", text),
|
|
50
14
|
timing: (start, end) => `${Number((end - start) / BigInt(1e7)) / 100}s`,
|
|
51
|
-
debug: (...message) => debug ? log2(
|
|
52
|
-
subtle: (...message) => log2(
|
|
53
|
-
err: (...message) => log2(
|
|
15
|
+
debug: (...message) => debug ? log2(...message.map((m) => styleText("gray", String(m)))) : void 0,
|
|
16
|
+
subtle: (...message) => log2(...message.map((m) => styleText("gray", String(m)))),
|
|
17
|
+
err: (...message) => log2(...message.map((m) => styleText("red", String(m)))),
|
|
54
18
|
newline: () => logWithoutSuffixes(),
|
|
55
|
-
ok: (...message) => log2(
|
|
19
|
+
ok: (...message) => log2(...message.map((m) => styleText("green", String(m)))),
|
|
56
20
|
plain: (...message) => log2(...message),
|
|
57
|
-
warn: (...message) => log2(
|
|
21
|
+
warn: (...message) => log2(...message.map((m) => styleText("yellow", String(m))))
|
|
58
22
|
};
|
|
59
23
|
};
|
|
60
24
|
const log = createLogger({ debug: false });
|
|
@@ -64,11 +28,10 @@ const childLogger = (logger, settings) => createLogger({
|
|
|
64
28
|
suffixes: [...logger.settings.suffixes, ...settings.suffixes ?? []]
|
|
65
29
|
});
|
|
66
30
|
const pluralise = (count, subject) => `${count} ${subject}${count === 1 ? "" : "s"}`;
|
|
67
|
-
|
|
68
|
-
0 && (module.exports = {
|
|
31
|
+
export {
|
|
69
32
|
childLogger,
|
|
70
33
|
createLogger,
|
|
71
34
|
log,
|
|
72
35
|
pluralise
|
|
73
|
-
}
|
|
36
|
+
};
|
|
74
37
|
//# sourceMappingURL=logging.js.map
|
package/lib/utils/logging.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/logging.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-console */\n\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["log"
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\n\nimport { styleText } from 'node:util';\n\nexport type Logger = typeof log;\n\nexport const createLogger = ({\n debug,\n prefixes = [],\n suffixes = [],\n}: {\n debug: boolean;\n prefixes?: unknown[];\n suffixes?: unknown[];\n}) => {\n const logWithoutSuffixes = (...message: unknown[]) =>\n console.log(...prefixes, ...message);\n\n const log = (...message: unknown[]) =>\n logWithoutSuffixes(...message, ...suffixes);\n\n return {\n settings: { debug, prefixes, suffixes },\n\n bold: (text: string) => styleText('bold', text),\n dim: (text: string) => styleText('dim', text),\n formatSubtle: (text: string) => styleText('gray', text),\n\n timing: (start: bigint, end: bigint) =>\n `${Number((end - start) / BigInt(10_000_000)) / 100}s`,\n\n debug: (...message: unknown[]) =>\n debug\n ? log(...message.map((m) => styleText('gray', String(m))))\n : undefined,\n subtle: (...message: unknown[]) =>\n log(...message.map((m) => styleText('gray', String(m)))),\n err: (...message: unknown[]) =>\n log(...message.map((m) => styleText('red', String(m)))),\n newline: () => logWithoutSuffixes(),\n ok: (...message: unknown[]) =>\n log(...message.map((m) => styleText('green', String(m)))),\n plain: (...message: unknown[]) => log(...message),\n warn: (...message: unknown[]) =>\n log(...message.map((m) => styleText('yellow', String(m)))),\n };\n};\n\nexport const log = createLogger({ debug: false });\n\nexport const childLogger = (\n logger: Logger,\n settings: Partial<Logger['settings']>,\n) =>\n createLogger({\n debug: settings.debug ?? logger.settings.debug,\n prefixes: [...(settings.prefixes ?? []), ...logger.settings.prefixes],\n suffixes: [...logger.settings.suffixes, ...(settings.suffixes ?? [])],\n });\n\nexport const pluralise = (count: number, subject: string) =>\n `${count} ${subject}${count === 1 ? '' : 's'}`;\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAInB,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW,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