skuba 14.0.0-migrate-to-inquirer-20251031060542 → 14.0.0-replace-global-vars-20251121010036
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 +76 -104
- 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/addTypeModuleToPackageJson.d.ts +6 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js +86 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js.map +7 -0
- 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 +16 -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 +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +76 -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 -5
- 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/wrapper/main.js
CHANGED
|
@@ -1,47 +1,13 @@
|
|
|
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 main_exports = {};
|
|
30
|
-
__export(main_exports, {
|
|
31
|
-
main: () => main
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(main_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var import_functionHandler = require("./functionHandler.js");
|
|
36
|
-
var import_requestListener = require("./requestListener.js");
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { runFunctionHandler } from "./functionHandler.js";
|
|
3
|
+
import { runRequestListener } from "./requestListener.js";
|
|
37
4
|
const main = async (rawEntryPoint, rawPort) => {
|
|
38
5
|
const availablePort = Number(rawPort) || void 0;
|
|
39
|
-
const [modulePath, functionName] =
|
|
40
|
-
const entryPoint =
|
|
41
|
-
return functionName ?
|
|
6
|
+
const [modulePath, functionName] = path.join(process.cwd(), rawEntryPoint).split("#", 2);
|
|
7
|
+
const entryPoint = await import(modulePath);
|
|
8
|
+
return functionName ? runFunctionHandler({ availablePort, entryPoint, functionName }) : runRequestListener({ availablePort, entryPoint });
|
|
42
9
|
};
|
|
43
|
-
|
|
44
|
-
0 && (module.exports = {
|
|
10
|
+
export {
|
|
45
11
|
main
|
|
46
|
-
}
|
|
12
|
+
};
|
|
47
13
|
//# sourceMappingURL=main.js.map
|
package/lib/wrapper/main.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/wrapper/main.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport { runFunctionHandler } from './functionHandler.js';\nimport { runRequestListener } from './requestListener.js';\n\nexport const main = async (rawEntryPoint: string, rawPort: string) => {\n const availablePort = Number(rawPort) || undefined;\n\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath, functionName] = path\n .join(process.cwd(), rawEntryPoint)\n .split('#', 2);\n\n // Load entry point as module\n
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport { runFunctionHandler } from './functionHandler.js';\nimport { runRequestListener } from './requestListener.js';\n\nexport const main = async (rawEntryPoint: string, rawPort: string) => {\n const availablePort = Number(rawPort) || undefined;\n\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath, functionName] = path\n .join(process.cwd(), rawEntryPoint)\n .split('#', 2);\n\n // Load entry point as module\n\n const entryPoint = (await import(modulePath as string)) as unknown;\n\n return functionName\n ? runFunctionHandler({ availablePort, entryPoint, functionName })\n : runRequestListener({ availablePort, entryPoint });\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AAEjB,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAE5B,MAAM,OAAO,OAAO,eAAuB,YAAoB;AACpE,QAAM,gBAAgB,OAAO,OAAO,KAAK;AAGzC,QAAM,CAAC,YAAY,YAAY,IAAI,KAChC,KAAK,QAAQ,IAAI,GAAG,aAAa,EACjC,MAAM,KAAK,CAAC;AAIf,QAAM,aAAc,MAAM,OAAO;AAEjC,SAAO,eACH,mBAAmB,EAAE,eAAe,YAAY,aAAa,CAAC,IAC9D,mBAAmB,EAAE,eAAe,WAAW,CAAC;AACtD;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,40 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 requestListener_exports = {};
|
|
30
|
-
__export(requestListener_exports, {
|
|
31
|
-
runRequestListener: () => runRequestListener
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(requestListener_exports);
|
|
34
|
-
var import_http = __toESM(require("http"));
|
|
35
|
-
var import_validation = require("../utils/validation.js");
|
|
36
|
-
var import_http2 = require("./http.js");
|
|
37
|
-
const isConfig = (data) => (0, import_validation.isFunction)(data) || (0, import_validation.isObject)(data);
|
|
1
|
+
import http from "http";
|
|
2
|
+
import { isFunction, isIpPort, isObject } from "../utils/validation.js";
|
|
3
|
+
import { serveRequestListener } from "./http.js";
|
|
4
|
+
import { startServer } from "./server.js";
|
|
5
|
+
const isConfig = (data) => isFunction(data) || isObject(data);
|
|
38
6
|
const runRequestListener = async ({
|
|
39
7
|
availablePort,
|
|
40
8
|
entryPoint
|
|
@@ -49,21 +17,20 @@ const runRequestListener = async ({
|
|
|
49
17
|
if (Object.keys(config).length === 0) {
|
|
50
18
|
return;
|
|
51
19
|
}
|
|
52
|
-
const port =
|
|
53
|
-
if (typeof config !== "function" && config instanceof
|
|
54
|
-
return
|
|
20
|
+
const port = isIpPort(config.port) ? config.port : availablePort;
|
|
21
|
+
if (typeof config !== "function" && config instanceof http.Server) {
|
|
22
|
+
return startServer(config, port);
|
|
55
23
|
}
|
|
56
|
-
if (typeof config !== "function" && config.server && config.server instanceof
|
|
57
|
-
return
|
|
24
|
+
if (typeof config !== "function" && config.server && config.server instanceof http.Server) {
|
|
25
|
+
return startServer(config.server, port);
|
|
58
26
|
}
|
|
59
27
|
const requestListener = typeof config === "function" ? config : config.requestListener ?? config.callback?.();
|
|
60
28
|
if (typeof requestListener !== "function") {
|
|
61
29
|
return;
|
|
62
30
|
}
|
|
63
|
-
return
|
|
31
|
+
return serveRequestListener(requestListener, port);
|
|
64
32
|
};
|
|
65
|
-
|
|
66
|
-
0 && (module.exports = {
|
|
33
|
+
export {
|
|
67
34
|
runRequestListener
|
|
68
|
-
}
|
|
35
|
+
};
|
|
69
36
|
//# sourceMappingURL=requestListener.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/wrapper/requestListener.ts"],
|
|
4
|
-
"sourcesContent": ["import http from 'http';\n\nimport { isFunction, isIpPort, isObject } from '../utils/validation.js';\n\nimport { serveRequestListener
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import http from 'http';\n\nimport { isFunction, isIpPort, isObject } from '../utils/validation.js';\n\nimport { serveRequestListener } from './http.js';\nimport { startServer } from './server.js';\n\n// Express compatibility\ninterface FunctionConfig extends http.RequestListener {\n port?: number;\n}\n\ninterface ObjectConfig {\n // Koa compatibility\n callback?: () => http.RequestListener;\n\n requestListener?: http.RequestListener;\n\n // Fastify compatibility\n server?: http.Server;\n\n default?: Promise<unknown>;\n port?: unknown;\n}\n\nconst isConfig = (\n data: unknown,\n): data is Promise<FunctionConfig> | Promise<ObjectConfig> =>\n isFunction(data) || isObject(data);\n\ninterface Args {\n availablePort?: number;\n entryPoint: unknown;\n}\n\n/**\n * Create an HTTP server that calls into an exported `http.RequestListener`.\n *\n * This supports Express and Koa applications out of the box.\n */\nexport const runRequestListener = async ({\n availablePort,\n entryPoint,\n}: Args): Promise<void> => {\n if (!isConfig(entryPoint)) {\n // Assume an executable script with weird exports\n return;\n }\n\n let config: FunctionConfig | ObjectConfig = await entryPoint;\n\n if (typeof config === 'object' && isConfig(config.default)) {\n // Prefer `export default` over `export =`\n config = await config.default;\n }\n\n if (Object.keys(config).length === 0) {\n // Assume an executable script with no exports\n return;\n }\n\n const port = isIpPort(config.port) ? config.port : availablePort;\n\n // http.Server support\n if (typeof config !== 'function' && config instanceof http.Server) {\n return startServer(config, port);\n }\n\n // Fastify workaround\n if (\n typeof config !== 'function' &&\n config.server &&\n config.server instanceof http.Server\n ) {\n return startServer(config.server, port);\n }\n\n const requestListener =\n typeof config === 'function'\n ? config\n : (config.requestListener ?? config.callback?.());\n\n if (typeof requestListener !== 'function') {\n // Assume an executable script with non-request listener exports\n return;\n }\n\n return serveRequestListener(requestListener, port);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AAEjB,SAAS,YAAY,UAAU,gBAAgB;AAE/C,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAoB5B,MAAM,WAAW,CACf,SAEA,WAAW,IAAI,KAAK,SAAS,IAAI;AAY5B,MAAM,qBAAqB,OAAO;AAAA,EACvC;AAAA,EACA;AACF,MAA2B;AACzB,MAAI,CAAC,SAAS,UAAU,GAAG;AAEzB;AAAA,EACF;AAEA,MAAI,SAAwC,MAAM;AAElD,MAAI,OAAO,WAAW,YAAY,SAAS,OAAO,OAAO,GAAG;AAE1D,aAAS,MAAM,OAAO;AAAA,EACxB;AAEA,MAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AAEpC;AAAA,EACF;AAEA,QAAM,OAAO,SAAS,OAAO,IAAI,IAAI,OAAO,OAAO;AAGnD,MAAI,OAAO,WAAW,cAAc,kBAAkB,KAAK,QAAQ;AACjE,WAAO,YAAY,QAAQ,IAAI;AAAA,EACjC;AAGA,MACE,OAAO,WAAW,cAClB,OAAO,UACP,OAAO,kBAAkB,KAAK,QAC9B;AACA,WAAO,YAAY,OAAO,QAAQ,IAAI;AAAA,EACxC;AAEA,QAAM,kBACJ,OAAO,WAAW,aACd,SACC,OAAO,mBAAmB,OAAO,WAAW;AAEnD,MAAI,OAAO,oBAAoB,YAAY;AAEzC;AAAA,EACF;AAEA,SAAO,qBAAqB,iBAAiB,IAAI;AACnD;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { log } from "../utils/logging.js";
|
|
2
|
+
const startServer = (server, port) => new Promise(
|
|
3
|
+
(resolve, reject) => server.listen(port).on("close", resolve).on("error", reject).on("listening", () => {
|
|
4
|
+
const address = server.address();
|
|
5
|
+
log.ok("listening on port", log.bold(String(address.port)));
|
|
6
|
+
})
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
startServer
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/wrapper/server.ts"],
|
|
4
|
+
"sourcesContent": ["import type http from 'http';\nimport type { AddressInfo } from 'net';\n\nimport { log } from '../utils/logging.js';\n\n/**\n * Returns a HTTP server wrapped in a promise\n *\n * This function resolves when the server is closed.\n */\nexport const startServer = (server: http.Server, port?: number) =>\n new Promise<void>((resolve, reject) =>\n server\n .listen(port)\n .on('close', resolve)\n .on('error', reject)\n .on('listening', () => {\n const address = server.address() as AddressInfo;\n\n log.ok('listening on port', log.bold(String(address.port)));\n }),\n );\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,WAAW;AAOb,MAAM,cAAc,CAAC,QAAqB,SAC/C,IAAI;AAAA,EAAc,CAAC,SAAS,WAC1B,OACG,OAAO,IAAI,EACX,GAAG,SAAS,OAAO,EACnB,GAAG,SAAS,MAAM,EAClB,GAAG,aAAa,MAAM;AACrB,UAAM,UAAU,OAAO,QAAQ;AAE/B,QAAI,GAAG,qBAAqB,IAAI,KAAK,OAAO,QAAQ,IAAI,CAAC,CAAC;AAAA,EAC5D,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "14.0.0-
|
|
3
|
+
"version": "14.0.0-replace-global-vars-20251121010036",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
+
"type": "module",
|
|
16
17
|
"main": "lib/index.js",
|
|
17
18
|
"types": "./lib/index.d.ts",
|
|
18
19
|
"bin": {
|
|
@@ -20,12 +21,10 @@
|
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"config/**/*",
|
|
23
|
-
"jest/**/*.js",
|
|
24
24
|
"lib*/**/*.d.ts",
|
|
25
25
|
"lib*/**/*.js",
|
|
26
26
|
"lib*/**/*.js.map",
|
|
27
|
-
"template/**/*"
|
|
28
|
-
"jest-preset.js"
|
|
27
|
+
"template/**/*"
|
|
29
28
|
],
|
|
30
29
|
"remarkConfig": {
|
|
31
30
|
"plugins": [
|
|
@@ -58,14 +57,14 @@
|
|
|
58
57
|
"@esbuild-plugins/tsconfig-paths": "^0.1.0",
|
|
59
58
|
"@eslint/migrate-config": "~1.3.8",
|
|
60
59
|
"@inquirer/prompts": "^7.9.0",
|
|
61
|
-
"@jest/types": "^30.0.0",
|
|
62
60
|
"@octokit/graphql": "^9.0.0",
|
|
63
61
|
"@octokit/graphql-schema": "^15.3.0",
|
|
64
62
|
"@octokit/rest": "^22.0.0",
|
|
65
63
|
"@octokit/types": "^15.0.0",
|
|
66
|
-
"@types/jest": "^30.0.0",
|
|
67
64
|
"@types/node": "^22.0.0",
|
|
68
|
-
"
|
|
65
|
+
"@vitest/coverage-v8": "^4.0.5",
|
|
66
|
+
"@vitest/ui": "^4.0.5",
|
|
67
|
+
"@vitest/utils": "^4.0.5",
|
|
69
68
|
"concurrently": "^9.0.0",
|
|
70
69
|
"ejs": "^3.1.6",
|
|
71
70
|
"esbuild": "~0.25.0",
|
|
@@ -80,8 +79,6 @@
|
|
|
80
79
|
"ignore": "^7.0.0",
|
|
81
80
|
"is-installed-globally": "^0.4.0",
|
|
82
81
|
"isomorphic-git": "^1.11.1",
|
|
83
|
-
"jest": "^30.0.0",
|
|
84
|
-
"jest-watch-typeahead": "^3.0.1",
|
|
85
82
|
"lodash.mergewith": "^4.6.2",
|
|
86
83
|
"minimist": "^1.2.6",
|
|
87
84
|
"normalize-package-data": "^7.0.0",
|
|
@@ -91,25 +88,21 @@
|
|
|
91
88
|
"picomatch": "^4.0.0",
|
|
92
89
|
"prettier": "~3.6.0",
|
|
93
90
|
"prettier-plugin-packagejson": "^2.4.10",
|
|
94
|
-
"read-
|
|
91
|
+
"read-package-up": "^11.0.0",
|
|
95
92
|
"semantic-release": "^24.2.3",
|
|
96
93
|
"simple-git": "^3.5.0",
|
|
97
|
-
"ts-dedent": "^2.2.0",
|
|
98
|
-
"ts-jest": "^29.4.0",
|
|
99
|
-
"ts-node": "^10.9.2",
|
|
100
94
|
"tsconfig-paths": "^4.0.0",
|
|
101
95
|
"tsconfig-seek": "2.0.0",
|
|
102
96
|
"tsx": "^4.16.2",
|
|
103
97
|
"typescript": "~5.9.0",
|
|
98
|
+
"vitest": "^4.0.5",
|
|
104
99
|
"zod": "^4.0.0",
|
|
105
|
-
"@skuba-lib/api": "^1.0
|
|
106
|
-
"eslint-config-skuba": "7.
|
|
100
|
+
"@skuba-lib/api": "^1.1.0-replace-global-vars-20251121010036",
|
|
101
|
+
"eslint-config-skuba": "7.3.0-replace-global-vars-20251121010036"
|
|
107
102
|
},
|
|
108
103
|
"devDependencies": {
|
|
109
104
|
"@changesets/cli": "2.29.7",
|
|
110
105
|
"@changesets/get-github-info": "0.6.0",
|
|
111
|
-
"@jest/reporters": "30.2.0",
|
|
112
|
-
"@jest/test-result": "30.2.0",
|
|
113
106
|
"@types/ejs": "3.1.5",
|
|
114
107
|
"@types/express": "5.0.3",
|
|
115
108
|
"@types/fs-extra": "11.0.4",
|
|
@@ -125,7 +118,6 @@
|
|
|
125
118
|
"enhanced-resolve": "5.18.3",
|
|
126
119
|
"express": "5.1.0",
|
|
127
120
|
"fastify": "5.6.1",
|
|
128
|
-
"jest-diff": "30.2.0",
|
|
129
121
|
"jsonfile": "6.2.0",
|
|
130
122
|
"koa": "3.0.3",
|
|
131
123
|
"memfs": "4.49.0",
|
|
@@ -133,10 +125,11 @@
|
|
|
133
125
|
"remark-preset-lint-recommended": "7.0.1",
|
|
134
126
|
"semver": "7.7.3",
|
|
135
127
|
"supertest": "7.1.4",
|
|
128
|
+
"ts-dedent": "^2.2.0",
|
|
136
129
|
"type-fest": "2.19.0"
|
|
137
130
|
},
|
|
138
131
|
"peerDependencies": {
|
|
139
|
-
"skuba-dive": "3.0.0-
|
|
132
|
+
"skuba-dive": "3.0.0-replace-global-vars-20251121010036"
|
|
140
133
|
},
|
|
141
134
|
"peerDependenciesMeta": {
|
|
142
135
|
"skuba-dive": {
|
|
@@ -166,12 +159,12 @@
|
|
|
166
159
|
"release": "pnpm --silent build && changeset publish",
|
|
167
160
|
"skuba": "pnpm --silent build && pnpm --silent skuba:exec",
|
|
168
161
|
"skuba:exec": "node lib/skuba",
|
|
169
|
-
"stage": "changeset version && node ./.changeset/inject.
|
|
170
|
-
"test": "pnpm --silent skuba test
|
|
171
|
-
"test:ci": "pnpm --silent skuba test
|
|
172
|
-
"test:int": "pnpm --silent skuba test
|
|
162
|
+
"stage": "changeset version && node ./.changeset/inject.cjs && pnpm format",
|
|
163
|
+
"test": "pnpm --silent skuba test run",
|
|
164
|
+
"test:ci": "pnpm --silent skuba test run",
|
|
165
|
+
"test:int": "pnpm --silent skuba test run",
|
|
173
166
|
"test:template": "scripts/test-template.sh",
|
|
174
167
|
"test:template:updateSnapshot": "scripts/test-template.sh -u",
|
|
175
|
-
"test:watch": "pnpm --silent skuba test
|
|
168
|
+
"test:watch": "pnpm --silent skuba test"
|
|
176
169
|
}
|
|
177
170
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from 'skuba/config/prettier.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from 'eslint-config-skuba';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# managed by skuba
|
|
2
2
|
ignorePatchFailures: false
|
|
3
|
-
minimumReleaseAge: 4320 # 3 days
|
|
3
|
+
# minimumReleaseAge: 4320 # 3 days
|
|
4
4
|
minimumReleaseAgeExclude:
|
|
5
5
|
- '@seek/*'
|
|
6
6
|
- '@skuba-lib/*'
|
|
@@ -12,11 +12,12 @@ minimumReleaseAgeExclude:
|
|
|
12
12
|
packageManagerStrictVersion: true
|
|
13
13
|
publicHoistPattern:
|
|
14
14
|
- '@types*'
|
|
15
|
+
- '@vitest/*'
|
|
15
16
|
- eslint
|
|
16
17
|
- eslint-config-skuba
|
|
17
18
|
- prettier
|
|
18
19
|
- esbuild
|
|
19
|
-
- jest
|
|
20
20
|
- tsconfig-seek
|
|
21
21
|
- typescript
|
|
22
|
+
- vitest
|
|
22
23
|
# end managed by skuba
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
ssr: {
|
|
5
|
+
resolve: {
|
|
6
|
+
conditions: ['@seek/<%- serviceName %>/source'],
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
test: {
|
|
10
|
+
env: {
|
|
11
|
+
DEPLOYMENT: 'test',
|
|
12
|
+
},
|
|
13
|
+
coverage: {
|
|
14
|
+
thresholds: {
|
|
15
|
+
branches: 0,
|
|
16
|
+
functions: 0,
|
|
17
|
+
lines: 0,
|
|
18
|
+
statements: 0,
|
|
19
|
+
},
|
|
20
|
+
include: ['src'],
|
|
21
|
+
exclude: ['src/testing'],
|
|
22
|
+
},
|
|
23
|
+
include: ['**/*.test*.ts'],
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"name": "@seek/<%- serviceName %>",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"imports": {
|
|
6
7
|
"#src/*": {
|
|
7
8
|
"@seek/<%- serviceName %>/source": "./src/*",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"skuba": "*",
|
|
41
42
|
"supertest": "^7.0.0"
|
|
42
43
|
},
|
|
43
|
-
"packageManager": "pnpm@10.
|
|
44
|
+
"packageManager": "pnpm@10.20.0",
|
|
44
45
|
"engines": {
|
|
45
46
|
"node": ">=22"
|
|
46
47
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"name": "@seek/greeter",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"imports": {
|
|
6
7
|
"#src/*": {
|
|
7
8
|
"@seek/<%- serviceName %>/source": "./src/*",
|
|
@@ -19,13 +20,13 @@
|
|
|
19
20
|
"test:watch": "skuba test --watch"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"skuba-dive": "3.0.0-
|
|
23
|
+
"skuba-dive": "3.0.0-replace-global-vars-20251121010036"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/node": "^22.13.10",
|
|
26
|
-
"skuba": "14.0.0-
|
|
27
|
+
"skuba": "14.0.0-replace-global-vars-20251121010036"
|
|
27
28
|
},
|
|
28
|
-
"packageManager": "pnpm@10.
|
|
29
|
+
"packageManager": "pnpm@10.20.0",
|
|
29
30
|
"engines": {
|
|
30
31
|
"node": ">=22"
|
|
31
32
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"name": "@seek/<%- serviceName %>",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"imports": {
|
|
6
7
|
"#src/*": {
|
|
7
8
|
"@seek/<%- serviceName %>/source": "./src/*",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"skuba": "*",
|
|
50
51
|
"supertest": "^7.0.0"
|
|
51
52
|
},
|
|
52
|
-
"packageManager": "pnpm@10.
|
|
53
|
+
"packageManager": "pnpm@10.20.0",
|
|
53
54
|
"engines": {
|
|
54
55
|
"node": ">=22"
|
|
55
56
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Router from '@koa/router';
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
3
|
|
|
3
4
|
import { stdoutMock } from './logging.js';
|
|
4
5
|
|
|
@@ -7,8 +8,7 @@ import { agentFromRouter } from '#src/testing/server.js';
|
|
|
7
8
|
import { chance } from '#src/testing/types.js';
|
|
8
9
|
import type { Middleware } from '#src/types/koa.js';
|
|
9
10
|
|
|
10
|
-
const middleware =
|
|
11
|
-
|
|
11
|
+
const middleware = vi.fn<Middleware>();
|
|
12
12
|
const router = new Router()
|
|
13
13
|
.use('/nested', new Router().put('/:param', middleware).routes())
|
|
14
14
|
.get('/', middleware);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
4
4
|
{
|
|
@@ -184,7 +184,6 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
184
184
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
185
185
|
"DD_LOGS_INJECTION": "false",
|
|
186
186
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
187
|
-
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
188
187
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
189
188
|
"DD_SERVICE": "serviceName",
|
|
190
189
|
"DD_SITE": "datadoghq.com",
|
|
@@ -763,6 +762,14 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
763
762
|
},
|
|
764
763
|
},
|
|
765
764
|
"Resources": {
|
|
765
|
+
"datadogapikeysecret046FEF06": {
|
|
766
|
+
"DeletionPolicy": "Delete",
|
|
767
|
+
"Properties": {
|
|
768
|
+
"GenerateSecretString": {},
|
|
769
|
+
},
|
|
770
|
+
"Type": "AWS::SecretsManager::Secret",
|
|
771
|
+
"UpdateReplacePolicy": "Delete",
|
|
772
|
+
},
|
|
766
773
|
"destinationtopicDCE2E0B8": {
|
|
767
774
|
"Properties": {
|
|
768
775
|
"KmsMasterKeyId": {
|
|
@@ -920,14 +927,15 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
920
927
|
},
|
|
921
928
|
"Environment": {
|
|
922
929
|
"Variables": {
|
|
923
|
-
"DD_API_KEY_SECRET_ARN":
|
|
930
|
+
"DD_API_KEY_SECRET_ARN": {
|
|
931
|
+
"Ref": "datadogapikeysecret046FEF06",
|
|
932
|
+
},
|
|
924
933
|
"DD_CAPTURE_LAMBDA_PAYLOAD": "false",
|
|
925
934
|
"DD_ENV": "production",
|
|
926
935
|
"DD_FLUSH_TO_LOG": "false",
|
|
927
936
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
928
937
|
"DD_LOGS_INJECTION": "false",
|
|
929
938
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
930
|
-
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
931
939
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
932
940
|
"DD_SERVICE": "serviceName",
|
|
933
941
|
"DD_SITE": "datadoghq.com",
|
|
@@ -1384,7 +1392,9 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1384
1392
|
"secretsmanager:DescribeSecret",
|
|
1385
1393
|
],
|
|
1386
1394
|
"Effect": "Allow",
|
|
1387
|
-
"Resource":
|
|
1395
|
+
"Resource": {
|
|
1396
|
+
"Ref": "datadogapikeysecret046FEF06",
|
|
1397
|
+
},
|
|
1388
1398
|
},
|
|
1389
1399
|
{
|
|
1390
1400
|
"Action": [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { App, aws_secretsmanager, aws_sns } from 'aws-cdk-lib';
|
|
2
2
|
import { Template } from 'aws-cdk-lib/assertions';
|
|
3
|
+
import { afterAll, afterEach, expect, it, vi } from 'vitest';
|
|
3
4
|
|
|
4
5
|
const originalDeployment = process.env.DEPLOYMENT;
|
|
5
6
|
const originalVersion = process.env.VERSION;
|
|
@@ -10,7 +11,7 @@ afterAll(() => {
|
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
afterEach(() => {
|
|
13
|
-
|
|
14
|
+
vi.resetModules();
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
it.each(['dev', 'prod'])(
|
|
@@ -21,15 +22,16 @@ it.each(['dev', 'prod'])(
|
|
|
21
22
|
|
|
22
23
|
const { AppStack } = await import('./appStack.js');
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
vi.spyOn(aws_sns.Topic, 'fromTopicArn').mockImplementation(
|
|
26
|
+
(scope, id) => new aws_sns.Topic(scope, id),
|
|
27
|
+
);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
29
|
+
vi.spyOn(
|
|
30
|
+
aws_secretsmanager.Secret,
|
|
31
|
+
'fromSecretPartialArn',
|
|
32
|
+
).mockImplementation(
|
|
33
|
+
(scope, id) => new aws_secretsmanager.Secret(scope, id),
|
|
34
|
+
);
|
|
33
35
|
|
|
34
36
|
const app = new App({ context: { 'aws:cdk:bundling-stacks': [] } });
|
|
35
37
|
|