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/cli/init/index.js
CHANGED
|
@@ -1,58 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
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 init_exports = {};
|
|
30
|
-
__export(init_exports, {
|
|
31
|
-
init: () => init
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(init_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var import_util = require("util");
|
|
36
|
-
var import_args = require("../../utils/args.js");
|
|
37
|
-
var import_copy = require("../../utils/copy.js");
|
|
38
|
-
var import_dir = require("../../utils/dir.js");
|
|
39
|
-
var import_exec = require("../../utils/exec.js");
|
|
40
|
-
var import_logging = require("../../utils/logging.js");
|
|
41
|
-
var import_logo = require("../../utils/logo.js");
|
|
42
|
-
var import_manifest = require("../../utils/manifest.js");
|
|
43
|
-
var import_packageManager = require("../../utils/packageManager.js");
|
|
44
|
-
var import_template = require("../../utils/template.js");
|
|
45
|
-
var import_prettier = require("../adapter/prettier.js");
|
|
46
|
-
var import_patchRenovateConfig = require("../lint/internalLints/patchRenovateConfig.js");
|
|
47
|
-
var import_getConfig = require("./getConfig.js");
|
|
48
|
-
var import_git = require("./git.js");
|
|
49
|
-
var import_writePackageJson = require("./writePackageJson.js");
|
|
50
|
-
var Git = __toESM(require("@skuba-lib/api/git"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { inspect } from "util";
|
|
3
|
+
import { hasDebugFlag } from "../../utils/args.js";
|
|
4
|
+
import { copyFiles, createEjsRenderer } from "../../utils/copy.js";
|
|
5
|
+
import { createInclusionFilter } from "../../utils/dir.js";
|
|
6
|
+
import { createExec, ensureCommands } from "../../utils/exec.js";
|
|
7
|
+
import { createLogger, log } from "../../utils/logging.js";
|
|
8
|
+
import { showLogoAndVersionInfo } from "../../utils/logo.js";
|
|
9
|
+
import { getConsumerManifest } from "../../utils/manifest.js";
|
|
10
|
+
import { detectPackageManager } from "../../utils/packageManager.js";
|
|
11
|
+
import {
|
|
12
|
+
BASE_TEMPLATE_DIR,
|
|
13
|
+
ensureTemplateConfigDeletion
|
|
14
|
+
} from "../../utils/template.js";
|
|
15
|
+
import { runPrettier } from "../adapter/prettier.js";
|
|
16
|
+
import { tryPatchRenovateConfig } from "../lint/internalLints/patchRenovateConfig.js";
|
|
17
|
+
import { getConfig } from "./getConfig.js";
|
|
18
|
+
import { initialiseRepo } from "./git.js";
|
|
19
|
+
import { writePackageJson } from "./writePackageJson.js";
|
|
20
|
+
import * as Git from "@skuba-lib/api/git";
|
|
51
21
|
const init = async (args = process.argv.slice(2)) => {
|
|
52
22
|
const opts = {
|
|
53
|
-
debug:
|
|
23
|
+
debug: hasDebugFlag(args)
|
|
54
24
|
};
|
|
55
|
-
const skubaVersionInfo = await
|
|
25
|
+
const skubaVersionInfo = await showLogoAndVersionInfo();
|
|
56
26
|
const {
|
|
57
27
|
destinationDir,
|
|
58
28
|
entryPoint,
|
|
@@ -61,15 +31,15 @@ const init = async (args = process.argv.slice(2)) => {
|
|
|
61
31
|
templateData,
|
|
62
32
|
templateName,
|
|
63
33
|
type
|
|
64
|
-
} = await
|
|
65
|
-
await
|
|
66
|
-
const include = await
|
|
67
|
-
|
|
68
|
-
|
|
34
|
+
} = await getConfig();
|
|
35
|
+
await ensureCommands(packageManager);
|
|
36
|
+
const include = await createInclusionFilter([
|
|
37
|
+
path.join(destinationDir, ".gitignore"),
|
|
38
|
+
path.join(BASE_TEMPLATE_DIR, "_.gitignore")
|
|
69
39
|
]);
|
|
70
|
-
const processors = [
|
|
71
|
-
await
|
|
72
|
-
sourceRoot:
|
|
40
|
+
const processors = [createEjsRenderer(templateData)];
|
|
41
|
+
await copyFiles({
|
|
42
|
+
sourceRoot: BASE_TEMPLATE_DIR,
|
|
73
43
|
destinationRoot: destinationDir,
|
|
74
44
|
include,
|
|
75
45
|
// prefer template-specific files
|
|
@@ -78,15 +48,15 @@ const init = async (args = process.argv.slice(2)) => {
|
|
|
78
48
|
// base template has files like _eslint.config.js
|
|
79
49
|
stripUnderscorePrefix: true
|
|
80
50
|
});
|
|
81
|
-
await
|
|
51
|
+
await copyFiles({
|
|
82
52
|
sourceRoot: destinationDir,
|
|
83
53
|
destinationRoot: destinationDir,
|
|
84
54
|
include,
|
|
85
55
|
processors
|
|
86
56
|
});
|
|
87
57
|
await Promise.all([
|
|
88
|
-
templateComplete ?
|
|
89
|
-
|
|
58
|
+
templateComplete ? ensureTemplateConfigDeletion(destinationDir) : Promise.resolve(),
|
|
59
|
+
writePackageJson({
|
|
90
60
|
cwd: destinationDir,
|
|
91
61
|
entryPoint,
|
|
92
62
|
template: templateName,
|
|
@@ -94,21 +64,21 @@ const init = async (args = process.argv.slice(2)) => {
|
|
|
94
64
|
version: skubaVersionInfo.local
|
|
95
65
|
})
|
|
96
66
|
]);
|
|
97
|
-
const exec =
|
|
67
|
+
const exec = createExec({
|
|
98
68
|
cwd: destinationDir,
|
|
99
69
|
stdio: "pipe",
|
|
100
70
|
streamStdio: packageManager
|
|
101
71
|
});
|
|
102
|
-
|
|
103
|
-
await
|
|
72
|
+
log.newline();
|
|
73
|
+
await initialiseRepo(destinationDir, templateData);
|
|
104
74
|
const [manifest, packageManagerConfig] = await Promise.all([
|
|
105
|
-
|
|
106
|
-
|
|
75
|
+
getConsumerManifest(destinationDir),
|
|
76
|
+
detectPackageManager(destinationDir)
|
|
107
77
|
]);
|
|
108
78
|
if (!manifest) {
|
|
109
79
|
throw new Error("Repository doesn't contain a package.json file.");
|
|
110
80
|
}
|
|
111
|
-
await
|
|
81
|
+
await tryPatchRenovateConfig({
|
|
112
82
|
mode: "format",
|
|
113
83
|
dir: destinationDir,
|
|
114
84
|
manifest,
|
|
@@ -118,56 +88,55 @@ const init = async (args = process.argv.slice(2)) => {
|
|
|
118
88
|
let depsInstalled = false;
|
|
119
89
|
try {
|
|
120
90
|
await exec(packageManager, "add", "-D", skubaSlug);
|
|
121
|
-
await
|
|
91
|
+
await runPrettier(
|
|
122
92
|
"format",
|
|
123
|
-
|
|
93
|
+
createLogger({ debug: opts.debug }),
|
|
124
94
|
destinationDir
|
|
125
95
|
);
|
|
126
96
|
depsInstalled = true;
|
|
127
97
|
} catch (err) {
|
|
128
|
-
|
|
98
|
+
log.warn(inspect(err));
|
|
129
99
|
}
|
|
130
100
|
await Git.commitAllChanges({
|
|
131
101
|
dir: destinationDir,
|
|
132
102
|
message: `Clone ${templateName}`
|
|
133
103
|
});
|
|
134
104
|
const logGitHubRepoCreation = () => {
|
|
135
|
-
|
|
105
|
+
log.plain(
|
|
136
106
|
"Next, create an empty",
|
|
137
|
-
|
|
107
|
+
log.bold(`${templateData.orgName}/${templateData.repoName}`),
|
|
138
108
|
"repository:"
|
|
139
109
|
);
|
|
140
|
-
|
|
110
|
+
log.ok("https://github.com/new");
|
|
141
111
|
};
|
|
142
112
|
if (!depsInstalled) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
113
|
+
log.newline();
|
|
114
|
+
log.warn(log.bold("\u2717 Failed to install dependencies."));
|
|
115
|
+
log.newline();
|
|
146
116
|
logGitHubRepoCreation();
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
117
|
+
log.newline();
|
|
118
|
+
log.plain("Then, resume initialisation:");
|
|
119
|
+
log.ok("cd", destinationDir);
|
|
120
|
+
log.ok(packageManager, "add", "-D", skubaSlug);
|
|
121
|
+
log.ok(packageManager, "run", "format");
|
|
122
|
+
log.ok("git add --all");
|
|
123
|
+
log.ok("git commit --message", `'Pin ${skubaSlug}'`);
|
|
124
|
+
log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);
|
|
125
|
+
log.newline();
|
|
156
126
|
process.exitCode = 1;
|
|
157
127
|
return;
|
|
158
128
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
129
|
+
log.newline();
|
|
130
|
+
log.ok(log.bold("\u2714 Project initialised!"));
|
|
131
|
+
log.newline();
|
|
162
132
|
logGitHubRepoCreation();
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
133
|
+
log.newline();
|
|
134
|
+
log.plain("Then, push your local changes:");
|
|
135
|
+
log.ok("cd", destinationDir);
|
|
136
|
+
log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);
|
|
137
|
+
log.newline();
|
|
168
138
|
};
|
|
169
|
-
|
|
170
|
-
0 && (module.exports = {
|
|
139
|
+
export {
|
|
171
140
|
init
|
|
172
|
-
}
|
|
141
|
+
};
|
|
173
142
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/index.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy.js';\nimport { createInclusionFilter } from '../../utils/dir.js';\nimport { createExec, ensureCommands } from '../../utils/exec.js';\nimport { createLogger, log } from '../../utils/logging.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\nimport { getConsumerManifest } from '../../utils/manifest.js';\nimport { detectPackageManager } from '../../utils/packageManager.js';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template.js';\nimport { runPrettier } from '../adapter/prettier.js';\nimport { tryPatchRenovateConfig } from '../lint/internalLints/patchRenovateConfig.js';\n\nimport { getConfig } from './getConfig.js';\nimport { initialiseRepo } from './git.js';\nimport type { Input } from './types.js';\nimport { writePackageJson } from './writePackageJson.js';\n\nimport * as Git from '@skuba-lib/api/git';\n\nexport const init = async (args = process.argv.slice(2)) => {\n const opts: Input = {\n debug: hasDebugFlag(args),\n };\n\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n const {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n await ensureCommands(packageManager);\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _eslint.config.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: packageManager,\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n const [manifest, packageManagerConfig] = await Promise.all([\n getConsumerManifest(destinationDir),\n detectPackageManager(destinationDir),\n ]);\n\n if (!manifest) {\n throw new Error(\"Repository doesn't contain a package.json file.\");\n }\n\n // Patch in a baseline Renovate preset based on the configured Git owner.\n await tryPatchRenovateConfig({\n mode: 'format',\n dir: destinationDir,\n manifest,\n packageManager: packageManagerConfig,\n });\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n // The `-D` shorthand is portable across our package managers.\n await exec(packageManager, 'add', '-D', skubaSlug);\n\n // Templating can initially leave certain files in an unformatted state;\n // consider a Markdown table with columns sized based on content length.\n await runPrettier(\n 'format',\n createLogger({ debug: opts.debug }),\n destinationDir,\n );\n\n depsInstalled = true;\n } catch (err) {\n log.warn(inspect(err));\n }\n\n await Git.commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n // The `-D` shorthand is portable across our package managers.\n log.ok(packageManager, 'add', '-D', skubaSlug);\n log.ok(packageManager, 'run', 'format');\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AACjB,SAAS,eAAe;AAExB,SAAS,oBAAoB;AAC7B,SAAS,WAAW,yBAAyB;AAC7C,SAAS,6BAA6B;AACtC,SAAS,YAAY,sBAAsB;AAC3C,SAAS,cAAc,WAAW;AAClC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AAEvC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAE/B,SAAS,wBAAwB;AAEjC,YAAY,SAAS;AAEd,MAAM,OAAO,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAC1D,QAAM,OAAc;AAAA,IAClB,OAAO,aAAa,IAAI;AAAA,EAC1B;AAEA,QAAM,mBAAmB,MAAM,uBAAuB;AAEtD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,MAAM,UAAU;AAEpB,QAAM,eAAe,cAAc;AAEnC,QAAM,UAAU,MAAM,sBAAsB;AAAA,IAC1C,KAAK,KAAK,gBAAgB,YAAY;AAAA,IACtC,KAAK,KAAK,mBAAmB,aAAa;AAAA,EAC5C,CAAC;AAED,QAAM,aAAa,CAAC,kBAAkB,YAAY,CAAC;AAEnD,QAAM,UAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA;AAAA,IAEA,WAAW;AAAA,IACX;AAAA;AAAA,IAEA,uBAAuB;AAAA,EACzB,CAAC;AAED,QAAM,UAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,IAAI;AAAA,IAChB,mBACI,6BAA6B,cAAc,IAC3C,QAAQ,QAAQ;AAAA,IAEpB,iBAAiB;AAAA,MACf,KAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,SAAS,iBAAiB;AAAA,IAC5B,CAAC;AAAA,EACH,CAAC;AAED,QAAM,OAAO,WAAW;AAAA,IACtB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aAAa;AAAA,EACf,CAAC;AAED,MAAI,QAAQ;AACZ,QAAM,eAAe,gBAAgB,YAAY;AAEjD,QAAM,CAAC,UAAU,oBAAoB,IAAI,MAAM,QAAQ,IAAI;AAAA,IACzD,oBAAoB,cAAc;AAAA,IAClC,qBAAqB,cAAc;AAAA,EACrC,CAAC;AAED,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AAGA,QAAM,uBAAuB;AAAA,IAC3B,MAAM;AAAA,IACN,KAAK;AAAA,IACL;AAAA,IACA,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,YAAY,SAAS,iBAAiB,KAAK;AAEjD,MAAI,gBAAgB;AACpB,MAAI;AAEF,UAAM,KAAK,gBAAgB,OAAO,MAAM,SAAS;AAIjD,UAAM;AAAA,MACJ;AAAA,MACA,aAAa,EAAE,OAAO,KAAK,MAAM,CAAC;AAAA,MAClC;AAAA,IACF;AAEA,oBAAgB;AAAA,EAClB,SAAS,KAAK;AACZ,QAAI,KAAK,QAAQ,GAAG,CAAC;AAAA,EACvB;AAEA,QAAM,IAAI,iBAAiB;AAAA,IACzB,KAAK;AAAA,IACL,SAAS,SAAS,YAAY;AAAA,EAChC,CAAC;AAED,QAAM,wBAAwB,MAAM;AAClC,QAAI;AAAA,MACF;AAAA,MACA,IAAI,KAAK,GAAG,aAAa,OAAO,IAAI,aAAa,QAAQ,EAAE;AAAA,MAC3D;AAAA,IACF;AACA,QAAI,GAAG,wBAAwB;AAAA,EACjC;AAEA,MAAI,CAAC,eAAe;AAClB,QAAI,QAAQ;AACZ,QAAI,KAAK,IAAI,KAAK,wCAAmC,CAAC;AAEtD,QAAI,QAAQ;AACZ,0BAAsB;AAEtB,QAAI,QAAQ;AACZ,QAAI,MAAM,8BAA8B;AACxC,QAAI,GAAG,MAAM,cAAc;AAE3B,QAAI,GAAG,gBAAgB,OAAO,MAAM,SAAS;AAC7C,QAAI,GAAG,gBAAgB,OAAO,QAAQ;AACtC,QAAI,GAAG,eAAe;AACtB,QAAI,GAAG,wBAAwB,QAAQ,SAAS,GAAG;AACnD,QAAI,GAAG,kCAAkC,aAAa,aAAa,EAAE;AAErE,QAAI,QAAQ;AACZ,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,MAAI,QAAQ;AACZ,MAAI,GAAG,IAAI,KAAK,6BAAwB,CAAC;AAEzC,MAAI,QAAQ;AACZ,wBAAsB;AAEtB,MAAI,QAAQ;AACZ,MAAI,MAAM,gCAAgC;AAC1C,MAAI,GAAG,MAAM,cAAc;AAC3B,MAAI,GAAG,kCAAkC,aAAa,aAAa,EAAE;AAErE,MAAI,QAAQ;AACd;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/lib/cli/init/prompts.js
CHANGED
|
@@ -1,33 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 prompts_exports = {};
|
|
20
|
-
__export(prompts_exports, {
|
|
21
|
-
BASE_PROMPT_PROPS: () => BASE_PROMPT_PROPS,
|
|
22
|
-
getGitPath: () => getGitPath,
|
|
23
|
-
getTemplateName: () => getTemplateName,
|
|
24
|
-
shouldContinue: () => shouldContinue
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(prompts_exports);
|
|
27
|
-
var import_prompts = require("@inquirer/prompts");
|
|
28
|
-
var import_fs = require("../../utils/fs.js");
|
|
29
|
-
var import_template = require("../../utils/template.js");
|
|
30
|
-
var import_validation = require("./validation.js");
|
|
1
|
+
import { input, select } from "@inquirer/prompts";
|
|
2
|
+
import { pathExists } from "../../utils/fs.js";
|
|
3
|
+
import { TEMPLATE_NAMES_WITH_BYO } from "../../utils/template.js";
|
|
4
|
+
import {
|
|
5
|
+
PLATFORM_OPTIONS,
|
|
6
|
+
isGitHubOrg,
|
|
7
|
+
isGitHubRepo,
|
|
8
|
+
isGitHubTeam,
|
|
9
|
+
isPlatform
|
|
10
|
+
} from "./validation.js";
|
|
31
11
|
const BASE_CHOICES = [
|
|
32
12
|
{
|
|
33
13
|
name: "ownerName",
|
|
@@ -38,10 +18,10 @@ const BASE_CHOICES = [
|
|
|
38
18
|
return "required";
|
|
39
19
|
}
|
|
40
20
|
const [org, team] = value.split("/");
|
|
41
|
-
if (!org || !
|
|
21
|
+
if (!org || !isGitHubOrg(org)) {
|
|
42
22
|
return "fails GitHub validation";
|
|
43
23
|
}
|
|
44
|
-
return team === void 0 ||
|
|
24
|
+
return team === void 0 || isGitHubTeam(team) || "fails GitHub validation";
|
|
45
25
|
}
|
|
46
26
|
},
|
|
47
27
|
{
|
|
@@ -52,10 +32,10 @@ const BASE_CHOICES = [
|
|
|
52
32
|
if (typeof value !== "string") {
|
|
53
33
|
return "required";
|
|
54
34
|
}
|
|
55
|
-
if (!
|
|
35
|
+
if (!isGitHubRepo(value)) {
|
|
56
36
|
return "fails GitHub validation";
|
|
57
37
|
}
|
|
58
|
-
const exists = await
|
|
38
|
+
const exists = await pathExists(value);
|
|
59
39
|
return !exists || `'${value}' is an existing directory`;
|
|
60
40
|
}
|
|
61
41
|
},
|
|
@@ -64,7 +44,7 @@ const BASE_CHOICES = [
|
|
|
64
44
|
message: "Platform",
|
|
65
45
|
initial: "arm64",
|
|
66
46
|
allowInitial: true,
|
|
67
|
-
validate: (value) =>
|
|
47
|
+
validate: (value) => isPlatform(value) || `must be ${PLATFORM_OPTIONS}`
|
|
68
48
|
},
|
|
69
49
|
{
|
|
70
50
|
name: "defaultBranch",
|
|
@@ -79,27 +59,26 @@ const BASE_PROMPT_PROPS = {
|
|
|
79
59
|
message: "For starters, some project details:",
|
|
80
60
|
name: "baseAnswers"
|
|
81
61
|
};
|
|
82
|
-
const shouldContinue = async () =>
|
|
62
|
+
const shouldContinue = async () => select({
|
|
83
63
|
message: "Fill this in now?",
|
|
84
64
|
choices: [
|
|
85
65
|
{ name: "Yes", value: "yes" },
|
|
86
66
|
{ name: "No", value: "no" }
|
|
87
67
|
]
|
|
88
68
|
});
|
|
89
|
-
const getGitPath = async () =>
|
|
69
|
+
const getGitPath = async () => input({
|
|
90
70
|
message: "Git path",
|
|
91
71
|
default: "seek-oss/skuba",
|
|
92
72
|
validate: (value) => /[^/]+\/[^/]+/.test(value) || "Path is not valid"
|
|
93
73
|
});
|
|
94
|
-
const getTemplateName = async () =>
|
|
74
|
+
const getTemplateName = async () => select({
|
|
95
75
|
message: "Select a template:",
|
|
96
|
-
choices:
|
|
76
|
+
choices: TEMPLATE_NAMES_WITH_BYO.map((name) => ({ name, value: name }))
|
|
97
77
|
});
|
|
98
|
-
|
|
99
|
-
0 && (module.exports = {
|
|
78
|
+
export {
|
|
100
79
|
BASE_PROMPT_PROPS,
|
|
101
80
|
getGitPath,
|
|
102
81
|
getTemplateName,
|
|
103
82
|
shouldContinue
|
|
104
|
-
}
|
|
83
|
+
};
|
|
105
84
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/prompts.ts"],
|
|
4
4
|
"sourcesContent": ["import { input, select } from '@inquirer/prompts';\n\nimport { pathExists } from '../../utils/fs.js';\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template.js';\n\nimport {\n PLATFORM_OPTIONS,\n type Platform,\n isGitHubOrg,\n isGitHubRepo,\n isGitHubTeam,\n isPlatform,\n} from './validation.js';\n\nexport interface Choice {\n name: string;\n message: string;\n initial?: string;\n validate?: (value: string) => boolean | string | Promise<boolean | string>;\n /**\n * Whether the user is allowed to skip field entry and use the initial value.\n *\n * Defaults to `false`.\n */\n allowInitial?: boolean;\n}\n\nexport type BaseFields = Record<\n (typeof BASE_CHOICES)[number]['name'],\n string\n> & {\n platformName: Platform;\n};\n\nconst BASE_CHOICES = [\n {\n name: 'ownerName',\n message: 'Owner',\n initial: 'SEEK-Jobs/my-team',\n validate: (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n const [org, team] = value.split('/');\n\n if (!org || !isGitHubOrg(org)) {\n return 'fails GitHub validation';\n }\n\n return (\n team === undefined || isGitHubTeam(team) || 'fails GitHub validation'\n );\n },\n },\n {\n name: 'repoName',\n message: 'Repo',\n initial: 'my-repo',\n validate: async (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n if (!isGitHubRepo(value)) {\n return 'fails GitHub validation';\n }\n\n const exists = await pathExists(value);\n\n return !exists || `'${value}' is an existing directory`;\n },\n },\n {\n name: 'platformName',\n message: 'Platform',\n initial: 'arm64',\n allowInitial: true,\n validate: (value: unknown) =>\n isPlatform(value) || `must be ${PLATFORM_OPTIONS}`,\n },\n {\n name: 'defaultBranch',\n message: 'Default Branch',\n initial: 'main',\n allowInitial: true,\n validate: (value: unknown) =>\n typeof value === 'string' && value.length > 0 ? true : 'required',\n },\n] as const;\n\nexport const BASE_PROMPT_PROPS = {\n choices: BASE_CHOICES,\n message: 'For starters, some project details:',\n name: 'baseAnswers',\n};\n\nexport const shouldContinue = async () =>\n select({\n message: 'Fill this in now?',\n choices: [\n { name: 'Yes', value: 'yes' },\n { name: 'No', value: 'no' },\n ],\n });\n\nexport const getGitPath = async () =>\n input({\n message: 'Git path',\n default: 'seek-oss/skuba',\n validate: (value: string) =>\n /[^/]+\\/[^/]+/.test(value) || 'Path is not valid',\n });\n\nexport const getTemplateName = async () =>\n select({\n message: 'Select a template:',\n choices: TEMPLATE_NAMES_WITH_BYO.map((name) => ({ name, value: name })),\n });\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,SAAS,OAAO,cAAc;AAE9B,SAAS,kBAAkB;AAC3B,SAAS,+BAA+B;AAExC;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAsBP,MAAM,eAAe;AAAA,EACnB;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,CAAC,UAAmB;AAC5B,UAAI,OAAO,UAAU,UAAU;AAC7B,eAAO;AAAA,MACT;AAEA,YAAM,CAAC,KAAK,IAAI,IAAI,MAAM,MAAM,GAAG;AAEnC,UAAI,CAAC,OAAO,CAAC,YAAY,GAAG,GAAG;AAC7B,eAAO;AAAA,MACT;AAEA,aACE,SAAS,UAAa,aAAa,IAAI,KAAK;AAAA,IAEhD;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,OAAO,UAAmB;AAClC,UAAI,OAAO,UAAU,UAAU;AAC7B,eAAO;AAAA,MACT;AAEA,UAAI,CAAC,aAAa,KAAK,GAAG;AACxB,eAAO;AAAA,MACT;AAEA,YAAM,SAAS,MAAM,WAAW,KAAK;AAErC,aAAO,CAAC,UAAU,IAAI,KAAK;AAAA,IAC7B;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,cAAc;AAAA,IACd,UAAU,CAAC,UACT,WAAW,KAAK,KAAK,WAAW,gBAAgB;AAAA,EACpD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,cAAc;AAAA,IACd,UAAU,CAAC,UACT,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,OAAO;AAAA,EAC3D;AACF;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,iBAAiB,YAC5B,OAAO;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,EAAE,MAAM,OAAO,OAAO,MAAM;AAAA,IAC5B,EAAE,MAAM,MAAM,OAAO,KAAK;AAAA,EAC5B;AACF,CAAC;AAEI,MAAM,aAAa,YACxB,MAAM;AAAA,EACJ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU,CAAC,UACT,eAAe,KAAK,KAAK,KAAK;AAClC,CAAC;AAEI,MAAM,kBAAkB,YAC7B,OAAO;AAAA,EACL,SAAS;AAAA,EACT,SAAS,wBAAwB,IAAI,CAAC,UAAU,EAAE,MAAM,OAAO,KAAK,EAAE;AACxE,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/cli/init/types.js
CHANGED
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 types_exports = {};
|
|
30
|
-
__export(types_exports, {
|
|
31
|
-
initConfigInputSchema: () => initConfigInputSchema
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(types_exports);
|
|
34
|
-
var z = __toESM(require("zod/v4"));
|
|
35
|
-
var import_manifest = require("../../utils/manifest.js");
|
|
36
|
-
var import_packageManager = require("../../utils/packageManager.js");
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { projectTypeSchema } from "../../utils/manifest.js";
|
|
3
|
+
import { packageManagerSchema } from "../../utils/packageManager.js";
|
|
37
4
|
const initConfigInputSchema = z.object({
|
|
38
5
|
destinationDir: z.string(),
|
|
39
6
|
templateComplete: z.boolean(),
|
|
@@ -60,11 +27,10 @@ const initConfigSchema = initConfigInputSchema.omit({
|
|
|
60
27
|
port: z.string()
|
|
61
28
|
}).catchall(z.string()),
|
|
62
29
|
entryPoint: z.string().optional(),
|
|
63
|
-
packageManager:
|
|
64
|
-
type:
|
|
30
|
+
packageManager: packageManagerSchema,
|
|
31
|
+
type: projectTypeSchema.optional()
|
|
65
32
|
});
|
|
66
|
-
|
|
67
|
-
0 && (module.exports = {
|
|
33
|
+
export {
|
|
68
34
|
initConfigInputSchema
|
|
69
|
-
}
|
|
35
|
+
};
|
|
70
36
|
//# sourceMappingURL=types.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/types.ts"],
|
|
4
4
|
"sourcesContent": ["import * as z from 'zod/v4';\n\nimport { projectTypeSchema } from '../../utils/manifest.js';\nimport { packageManagerSchema } from '../../utils/packageManager.js';\n\nexport interface Input {\n /**\n * Whether to enable verbose debug logging.\n *\n * Defaults to `false`.\n */\n debug: boolean;\n}\n\nexport type InitConfigInput = z.infer<typeof initConfigInputSchema>;\n\nexport const initConfigInputSchema = z.object({\n destinationDir: z.string(),\n templateComplete: z.boolean(),\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n platformName: z.union([z.literal('amd64'), z.literal('arm64')]),\n defaultBranch: z.string(),\n })\n .catchall(z.string()),\n templateName: z.string(),\n});\n\nexport type InitConfig = z.infer<typeof initConfigSchema>;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst initConfigSchema = initConfigInputSchema\n .omit({\n templateData: true,\n })\n .extend({\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n defaultBranch: z.string(),\n\n // Derived from ownerName\n // TODO: use zod to transform `InitConfigInput` -> `InitConfig`?\n orgName: z.string(),\n teamName: z.string(),\n\n // Generated by init command\n port: z.string(),\n })\n .catchall(z.string()),\n\n entryPoint: z.string().optional(),\n packageManager: packageManagerSchema,\n type: projectTypeSchema.optional(),\n });\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,YAAY,OAAO;AAEnB,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AAa9B,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,gBAAgB,EAAE,OAAO;AAAA,EACzB,kBAAkB,EAAE,QAAQ;AAAA,EAC5B,cAAc,EACX,OAAO;AAAA,IACN,WAAW,EAAE,OAAO;AAAA,IACpB,UAAU,EAAE,OAAO;AAAA,IACnB,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,CAAC,CAAC;AAAA,IAC9D,eAAe,EAAE,OAAO;AAAA,EAC1B,CAAC,EACA,SAAS,EAAE,OAAO,CAAC;AAAA,EACtB,cAAc,EAAE,OAAO;AACzB,CAAC;AAKD,MAAM,mBAAmB,sBACtB,KAAK;AAAA,EACJ,cAAc;AAChB,CAAC,EACA,OAAO;AAAA,EACN,cAAc,EACX,OAAO;AAAA,IACN,WAAW,EAAE,OAAO;AAAA,IACpB,UAAU,EAAE,OAAO;AAAA,IACnB,eAAe,EAAE,OAAO;AAAA;AAAA;AAAA,IAIxB,SAAS,EAAE,OAAO;AAAA,IAClB,UAAU,EAAE,OAAO;AAAA;AAAA,IAGnB,MAAM,EAAE,OAAO;AAAA,EACjB,CAAC,EACA,SAAS,EAAE,OAAO,CAAC;AAAA,EAEtB,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,gBAAgB;AAAA,EAChB,MAAM,kBAAkB,SAAS;AACnC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
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 validation_exports = {};
|
|
20
|
-
__export(validation_exports, {
|
|
21
|
-
PLATFORM_OPTIONS: () => PLATFORM_OPTIONS,
|
|
22
|
-
isGitHubOrg: () => isGitHubOrg,
|
|
23
|
-
isGitHubRepo: () => isGitHubRepo,
|
|
24
|
-
isGitHubTeam: () => isGitHubTeam,
|
|
25
|
-
isPlatform: () => isPlatform
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(validation_exports);
|
|
28
1
|
const isGitHubOrg = (value) => /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(value) && !value.includes("--");
|
|
29
2
|
const isGitHubRepo = (value) => /^[A-Za-z0-9_.-]+$/.test(value) && value !== "." && value !== "..";
|
|
30
3
|
const isGitHubTeam = (value) => /^[A-Za-z0-9_](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/.test(value) && !value.endsWith("-") && !value.includes("--");
|
|
@@ -32,12 +5,11 @@ const PLATFORMS = ["amd64", "arm64"];
|
|
|
32
5
|
const PLATFORM_OPTIONS = PLATFORMS.join(" | ");
|
|
33
6
|
const platformSet = new Set(PLATFORMS);
|
|
34
7
|
const isPlatform = (value) => platformSet.has(value);
|
|
35
|
-
|
|
36
|
-
0 && (module.exports = {
|
|
8
|
+
export {
|
|
37
9
|
PLATFORM_OPTIONS,
|
|
38
10
|
isGitHubOrg,
|
|
39
11
|
isGitHubRepo,
|
|
40
12
|
isGitHubTeam,
|
|
41
13
|
isPlatform
|
|
42
|
-
}
|
|
14
|
+
};
|
|
43
15
|
//# sourceMappingURL=validation.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/validation.ts"],
|
|
4
4
|
"sourcesContent": ["export const isGitHubOrg = (value: string) =>\n /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(value) &&\n !value.includes('--');\n\nexport const isGitHubRepo = (value: string) =>\n /^[A-Za-z0-9_.-]+$/.test(value) && value !== '.' && value !== '..';\n\nexport const isGitHubTeam = (value: string) =>\n /^[A-Za-z0-9_](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/.test(value) &&\n !value.endsWith('-') &&\n !value.includes('--');\n\nconst PLATFORMS = ['amd64', 'arm64'] as const;\n\nexport type Platform = (typeof PLATFORMS)[number];\n\nexport const PLATFORM_OPTIONS = PLATFORMS.join(' | ');\n\nconst platformSet = new Set<unknown>(PLATFORMS);\n\nexport const isPlatform = (value: unknown) => platformSet.has(value);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAO,MAAM,cAAc,CAAC,UAC1B,6CAA6C,KAAK,KAAK,KACvD,CAAC,MAAM,SAAS,IAAI;AAEf,MAAM,eAAe,CAAC,UAC3B,oBAAoB,KAAK,KAAK,KAAK,UAAU,OAAO,UAAU;AAEzD,MAAM,eAAe,CAAC,UAC3B,gDAAgD,KAAK,KAAK,KAC1D,CAAC,MAAM,SAAS,GAAG,KACnB,CAAC,MAAM,SAAS,IAAI;AAEtB,MAAM,YAAY,CAAC,SAAS,OAAO;AAI5B,MAAM,mBAAmB,UAAU,KAAK,KAAK;AAEpD,MAAM,cAAc,IAAI,IAAa,SAAS;AAEvC,MAAM,aAAa,CAAC,UAAmB,YAAY,IAAI,KAAK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 writePackageJson_exports = {};
|
|
30
|
-
__export(writePackageJson_exports, {
|
|
31
|
-
writePackageJson: () => writePackageJson
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(writePackageJson_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_package = require("../configure/analysis/package.js");
|
|
36
|
-
var import_package2 = require("../configure/processing/package.js");
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import { getDestinationManifest } from "../configure/analysis/package.js";
|
|
3
|
+
import { formatPackage } from "../configure/processing/package.js";
|
|
37
4
|
const writePackageJson = async ({
|
|
38
5
|
cwd,
|
|
39
6
|
entryPoint,
|
|
@@ -41,18 +8,17 @@ const writePackageJson = async ({
|
|
|
41
8
|
type,
|
|
42
9
|
version
|
|
43
10
|
}) => {
|
|
44
|
-
const manifest = await
|
|
11
|
+
const manifest = await getDestinationManifest({ cwd });
|
|
45
12
|
manifest.packageJson.skuba = {
|
|
46
13
|
entryPoint: entryPoint ?? null,
|
|
47
14
|
template,
|
|
48
15
|
type,
|
|
49
16
|
version
|
|
50
17
|
};
|
|
51
|
-
const updatedPackageJson = await
|
|
52
|
-
await
|
|
18
|
+
const updatedPackageJson = await formatPackage(manifest.packageJson);
|
|
19
|
+
await fs.promises.writeFile(manifest.path, updatedPackageJson);
|
|
53
20
|
};
|
|
54
|
-
|
|
55
|
-
0 && (module.exports = {
|
|
21
|
+
export {
|
|
56
22
|
writePackageJson
|
|
57
|
-
}
|
|
23
|
+
};
|
|
58
24
|
//# sourceMappingURL=writePackageJson.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/writePackageJson.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\n\nimport type { ProjectType } from '../../utils/manifest.js';\nimport { getDestinationManifest } from '../configure/analysis/package.js';\nimport { formatPackage } from '../configure/processing/package.js';\n\ninterface WritePackageJsonProps {\n cwd: string;\n entryPoint?: string;\n template: string;\n type?: ProjectType;\n version: string;\n}\n\nexport interface SkubaPackageJson {\n entryPoint: string | null;\n template: string;\n type?: string;\n version: string;\n}\n\n/**\n * Write a `skuba` section into the destination `package.json`.\n */\nexport const writePackageJson = async ({\n cwd,\n entryPoint,\n template,\n type,\n version,\n}: WritePackageJsonProps) => {\n const manifest = await getDestinationManifest({ cwd });\n\n manifest.packageJson.skuba = {\n entryPoint: entryPoint ?? null,\n template,\n type,\n version,\n } satisfies SkubaPackageJson;\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n\n await fs.promises.writeFile(manifest.path, updatedPackageJson);\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AAGf,SAAS,8BAA8B;AACvC,SAAS,qBAAqB;AAoBvB,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA6B;AAC3B,QAAM,WAAW,MAAM,uBAAuB,EAAE,IAAI,CAAC;AAErD,WAAS,YAAY,QAAQ;AAAA,IAC3B,YAAY,cAAc;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAAqB,MAAM,cAAc,SAAS,WAAW;AAEnE,QAAM,GAAG,SAAS,UAAU,SAAS,MAAM,kBAAkB;AAC/D;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|