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
|
@@ -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/*",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"@aws-sdk/client-sns": "^3.363.0",
|
|
24
25
|
"@seek/aws-codedeploy-hooks": "^2.0.0",
|
|
25
26
|
"@seek/logger": "^11.1.0",
|
|
26
|
-
"skuba-dive": "3.0.0-
|
|
27
|
+
"skuba-dive": "3.0.0-replace-global-vars-20251121010036",
|
|
27
28
|
"zod": "^4.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
@@ -33,17 +34,17 @@
|
|
|
33
34
|
"@types/node": "^22.13.10",
|
|
34
35
|
"aws-cdk": "^2.1010.0",
|
|
35
36
|
"aws-cdk-lib": "^2.190.0",
|
|
36
|
-
"aws-sdk-client-mock": "^4.
|
|
37
|
-
"aws-sdk-client-mock-
|
|
37
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
38
|
+
"aws-sdk-client-mock-vitest": "^6.2.1",
|
|
38
39
|
"chance": "^1.1.8",
|
|
39
40
|
"constructs": "^10.0.17",
|
|
40
41
|
"datadog-cdk-constructs-v2": "^3.0.0",
|
|
41
42
|
"datadog-lambda-js": "^12.0.0",
|
|
42
43
|
"dd-trace": "^5.0.0",
|
|
43
44
|
"pino-pretty": "^13.0.0",
|
|
44
|
-
"skuba": "14.0.0-
|
|
45
|
+
"skuba": "14.0.0-replace-global-vars-20251121010036"
|
|
45
46
|
},
|
|
46
|
-
"packageManager": "pnpm@10.
|
|
47
|
+
"packageManager": "pnpm@10.20.0",
|
|
47
48
|
"engines": {
|
|
48
49
|
"node": ">=22"
|
|
49
50
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { PublishCommand } from '@aws-sdk/client-sns';
|
|
2
2
|
import type { SQSBatchResponse } from 'aws-lambda';
|
|
3
|
+
import {
|
|
4
|
+
afterEach,
|
|
5
|
+
beforeAll,
|
|
6
|
+
beforeEach,
|
|
7
|
+
describe,
|
|
8
|
+
expect,
|
|
9
|
+
it,
|
|
10
|
+
vi,
|
|
11
|
+
} from 'vitest';
|
|
3
12
|
|
|
4
13
|
import * as app from './app.js';
|
|
5
14
|
import { stdoutMock } from './framework/logging.js';
|
|
@@ -20,7 +29,7 @@ describe('handler', () => {
|
|
|
20
29
|
|
|
21
30
|
const score = chance.floating({ max: 1, min: 0 });
|
|
22
31
|
|
|
23
|
-
const distribution =
|
|
32
|
+
const distribution = vi
|
|
24
33
|
.spyOn(metricsClient, 'distribution')
|
|
25
34
|
.mockReturnValue();
|
|
26
35
|
|
|
@@ -41,9 +50,9 @@ describe('handler', () => {
|
|
|
41
50
|
it('handles one record', async () => {
|
|
42
51
|
const event = createSqsEvent([JSON.stringify(jobPublished)]);
|
|
43
52
|
|
|
44
|
-
await expect(app.handler(event, ctx)).resolves.toEqual
|
|
53
|
+
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
45
54
|
batchItemFailures: [],
|
|
46
|
-
});
|
|
55
|
+
} satisfies SQSBatchResponse);
|
|
47
56
|
|
|
48
57
|
expect(scoringService.request).toHaveBeenCalledTimes(1);
|
|
49
58
|
|
|
@@ -72,9 +81,9 @@ describe('handler', () => {
|
|
|
72
81
|
JSON.stringify(jobPublished),
|
|
73
82
|
]);
|
|
74
83
|
|
|
75
|
-
await expect(app.handler(event, ctx)).resolves.toEqual
|
|
84
|
+
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
76
85
|
batchItemFailures: [],
|
|
77
|
-
});
|
|
86
|
+
} satisfies SQSBatchResponse);
|
|
78
87
|
|
|
79
88
|
expect(stdoutMock.calls).toMatchObject([
|
|
80
89
|
{ count: 2, level: 20, msg: 'Received jobs' },
|
|
@@ -100,9 +109,9 @@ describe('handler', () => {
|
|
|
100
109
|
JSON.stringify(jobPublished),
|
|
101
110
|
]);
|
|
102
111
|
|
|
103
|
-
await expect(app.handler(event, ctx)).resolves.toEqual
|
|
112
|
+
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
104
113
|
batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
|
|
105
|
-
});
|
|
114
|
+
} satisfies SQSBatchResponse);
|
|
106
115
|
|
|
107
116
|
expect(stdoutMock.calls).toMatchObject([
|
|
108
117
|
{ count: 2, level: 20, msg: 'Received jobs' },
|
|
@@ -128,13 +137,13 @@ describe('handler', () => {
|
|
|
128
137
|
it('returns a batchItemFailure on invalid input', () => {
|
|
129
138
|
const event = createSqsEvent(['}']);
|
|
130
139
|
|
|
131
|
-
return expect(app.handler(event, ctx)).resolves.toEqual
|
|
140
|
+
return expect(app.handler(event, ctx)).resolves.toEqual({
|
|
132
141
|
batchItemFailures: [
|
|
133
142
|
{
|
|
134
143
|
itemIdentifier: event.Records[0]!.messageId,
|
|
135
144
|
},
|
|
136
145
|
],
|
|
137
|
-
});
|
|
146
|
+
} satisfies SQSBatchResponse);
|
|
138
147
|
});
|
|
139
148
|
|
|
140
149
|
it('bubbles up scoring service error', async () => {
|
|
@@ -144,9 +153,9 @@ describe('handler', () => {
|
|
|
144
153
|
|
|
145
154
|
const event = createSqsEvent([JSON.stringify(jobPublished)]);
|
|
146
155
|
|
|
147
|
-
await expect(app.handler(event, ctx)).resolves.toEqual
|
|
156
|
+
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
148
157
|
batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
|
|
149
|
-
});
|
|
158
|
+
} satisfies SQSBatchResponse);
|
|
150
159
|
|
|
151
160
|
expect(stdoutMock.calls).toMatchObject([
|
|
152
161
|
{ count: 1, level: 20, msg: 'Received jobs' },
|
|
@@ -170,9 +179,9 @@ describe('handler', () => {
|
|
|
170
179
|
|
|
171
180
|
const event = createSqsEvent([JSON.stringify(jobPublished)]);
|
|
172
181
|
|
|
173
|
-
await expect(app.handler(event, ctx)).resolves.toEqual
|
|
182
|
+
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
174
183
|
batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
|
|
175
|
-
});
|
|
184
|
+
} satisfies SQSBatchResponse);
|
|
176
185
|
|
|
177
186
|
expect(stdoutMock.calls).toMatchObject([
|
|
178
187
|
{
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
1
3
|
import { validateJson } from './validation.js';
|
|
2
4
|
|
|
3
5
|
import {
|
|
@@ -30,17 +32,17 @@ describe('validateJson', () => {
|
|
|
30
32
|
|
|
31
33
|
expect(() => validateJson(input, IdDescriptionSchema))
|
|
32
34
|
.toThrowErrorMatchingInlineSnapshot(`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
[ZodError: [
|
|
36
|
+
{
|
|
37
|
+
"expected": "string",
|
|
38
|
+
"code": "invalid_type",
|
|
39
|
+
"path": [
|
|
40
|
+
"id"
|
|
41
|
+
],
|
|
42
|
+
"message": "Invalid input: expected string, received null"
|
|
43
|
+
}
|
|
44
|
+
]]
|
|
45
|
+
`);
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
it('blocks missing prop', () => {
|
|
@@ -48,25 +50,25 @@ describe('validateJson', () => {
|
|
|
48
50
|
|
|
49
51
|
expect(() => validateJson(input, IdDescriptionSchema))
|
|
50
52
|
.toThrowErrorMatchingInlineSnapshot(`
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
[ZodError: [
|
|
54
|
+
{
|
|
55
|
+
"expected": "string",
|
|
56
|
+
"code": "invalid_type",
|
|
57
|
+
"path": [
|
|
58
|
+
"id"
|
|
59
|
+
],
|
|
60
|
+
"message": "Invalid input: expected string, received undefined"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"expected": "string",
|
|
64
|
+
"code": "invalid_type",
|
|
65
|
+
"path": [
|
|
66
|
+
"description"
|
|
67
|
+
],
|
|
68
|
+
"message": "Invalid input: expected string, received undefined"
|
|
69
|
+
}
|
|
70
|
+
]]
|
|
71
|
+
`);
|
|
70
72
|
});
|
|
71
73
|
|
|
72
74
|
it('blocks invalid JSON', () => {
|
|
@@ -75,7 +77,7 @@ describe('validateJson', () => {
|
|
|
75
77
|
expect(() =>
|
|
76
78
|
validateJson(input, IdDescriptionSchema),
|
|
77
79
|
).toThrowErrorMatchingInlineSnapshot(
|
|
78
|
-
`
|
|
80
|
+
`[SyntaxError: Unexpected token '}', "}" is not valid JSON]`,
|
|
79
81
|
);
|
|
80
82
|
});
|
|
81
83
|
});
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import { afterEach, beforeAll, describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
1
3
|
import * as jobScorer from './jobScorer.js';
|
|
2
4
|
|
|
3
5
|
import { scoringService } from '#src/testing/services.js';
|
|
4
6
|
import { chance, mockJobPublishedEvent } from '#src/testing/types.js';
|
|
5
7
|
|
|
6
8
|
describe('scoreJobPublishedEvent', () => {
|
|
7
|
-
beforeAll(
|
|
9
|
+
beforeAll(() => {
|
|
10
|
+
scoringService.spy();
|
|
11
|
+
});
|
|
8
12
|
|
|
9
|
-
afterEach(
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
scoringService.clear();
|
|
15
|
+
});
|
|
10
16
|
|
|
11
17
|
it('scores an event', async () => {
|
|
12
18
|
const score = chance.floating({ max: 1, min: 0 });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PublishCommand } from '@aws-sdk/client-sns';
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
3
|
|
|
3
4
|
import { sendPipelineEvent } from './pipelineEventSender.js';
|
|
4
5
|
|
|
@@ -7,7 +8,7 @@ import { chance } from '#src/testing/types.js';
|
|
|
7
8
|
|
|
8
9
|
describe('sendPipelineEvent', () => {
|
|
9
10
|
afterEach(() => {
|
|
10
|
-
|
|
11
|
+
vi.clearAllMocks();
|
|
11
12
|
});
|
|
12
13
|
|
|
13
14
|
it('handles happy path', async () => {
|
|
@@ -34,7 +35,7 @@ describe('sendPipelineEvent', () => {
|
|
|
34
35
|
return expect(
|
|
35
36
|
sendPipelineEvent({}),
|
|
36
37
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
|
37
|
-
`
|
|
38
|
+
`[Error: SNS did not return a message ID]`,
|
|
38
39
|
);
|
|
39
40
|
});
|
|
40
41
|
});
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import 'aws-sdk-client-mock-
|
|
1
|
+
import 'aws-sdk-client-mock-vitest/extend';
|
|
2
2
|
|
|
3
3
|
import { PublishCommand } from '@aws-sdk/client-sns';
|
|
4
4
|
import { mockClient } from 'aws-sdk-client-mock';
|
|
5
|
+
import { vi } from 'vitest';
|
|
5
6
|
|
|
6
7
|
import { sns as snsClient } from '#src/services/aws.js';
|
|
7
8
|
import * as jobScorer from '#src/services/jobScorer.js';
|
|
8
9
|
|
|
9
10
|
export const scoringService = {
|
|
10
|
-
request:
|
|
11
|
+
request: vi.fn(),
|
|
11
12
|
|
|
12
13
|
clear: () => scoringService.request.mockClear(),
|
|
13
14
|
|
|
14
15
|
spy: () =>
|
|
15
|
-
|
|
16
|
+
vi
|
|
16
17
|
.spyOn(jobScorer.scoringService, 'request')
|
|
17
18
|
.mockImplementation(scoringService.request),
|
|
18
19
|
};
|
package/config/jest.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../jest-preset');
|
package/jest/moduleNameMapper.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
4
|
-
|
|
5
|
-
const { tryParseTsConfig } = require('./tsConfig');
|
|
6
|
-
|
|
7
|
-
module.exports.createModuleNameMapper = (getConfig) => {
|
|
8
|
-
const maybeTsConfig = tryParseTsConfig(getConfig);
|
|
9
|
-
|
|
10
|
-
const paths = Object.fromEntries(
|
|
11
|
-
Object.entries(maybeTsConfig?.options.paths ?? {}).flatMap(
|
|
12
|
-
([key, values]) => [
|
|
13
|
-
// Pass through the input path entry almost verbatim.
|
|
14
|
-
// We trim a trailing slash because TypeScript allows `import 'src'`
|
|
15
|
-
// to be resolved by the alias `src/`, but Jest's mapper does not.
|
|
16
|
-
[
|
|
17
|
-
key.replace(/\/$/, ''),
|
|
18
|
-
values.map((value) => value.replace(/\/$/, '')),
|
|
19
|
-
],
|
|
20
|
-
// Append a variant of the input path entry.
|
|
21
|
-
// As TypeScript allows both `import 'src'` and `import 'src/nested'`
|
|
22
|
-
// to be resolved by the alias `src/*` (and likewise for plain `src`),
|
|
23
|
-
// we need to seed two Jest mappings per path.
|
|
24
|
-
...(key.endsWith('/*')
|
|
25
|
-
? [
|
|
26
|
-
[
|
|
27
|
-
// Given a path `src/*`, seed an extra `src`.
|
|
28
|
-
key.replace(/\/\*$/, ''),
|
|
29
|
-
values.map((value) => value.replace(/\/\*$/, '')),
|
|
30
|
-
],
|
|
31
|
-
]
|
|
32
|
-
: [
|
|
33
|
-
[
|
|
34
|
-
// Given a path `src`, seed an extra `src/*`.
|
|
35
|
-
path.join(key, '*'),
|
|
36
|
-
values.map((value) => path.join(value, '*')),
|
|
37
|
-
],
|
|
38
|
-
]),
|
|
39
|
-
],
|
|
40
|
-
),
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const prefix = path.join('<rootDir>', maybeTsConfig?.options.baseUrl ?? '.');
|
|
44
|
-
|
|
45
|
-
const moduleNameMapper = pathsToModuleNameMapper(paths, {
|
|
46
|
-
prefix,
|
|
47
|
-
useESM: true,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Always try finding the file with extension before trying without
|
|
51
|
-
moduleNameMapper['^(\\.{1,2}/.*)\\.js$'] = ['$1.js', '$1'];
|
|
52
|
-
|
|
53
|
-
// Normalise away any `..`s that may crop up from `baseUrl` usage.
|
|
54
|
-
// For example, a `baseUrl` of `src` and a path of `../cli` will result in
|
|
55
|
-
// `<rootDir>/src/../cli`, which can be normalised to `<rootDir>/cli`.
|
|
56
|
-
return Object.fromEntries(
|
|
57
|
-
Object.entries(moduleNameMapper).map(([key, values]) => [
|
|
58
|
-
key,
|
|
59
|
-
Array.isArray(values)
|
|
60
|
-
? values.map((value) => path.normalize(value))
|
|
61
|
-
: path.normalize(values),
|
|
62
|
-
]),
|
|
63
|
-
);
|
|
64
|
-
};
|
package/jest/transform.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const { defaults } = require('ts-jest/presets');
|
|
2
|
-
const { ModuleResolutionKind } = require('typescript');
|
|
3
|
-
|
|
4
|
-
const { tryParseTsConfig } = require('./tsConfig');
|
|
5
|
-
|
|
6
|
-
const TS_JEST_NAME = 'ts-jest';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Resolved path of the `ts-jest` preset.
|
|
10
|
-
*
|
|
11
|
-
* This allows Jest to resolve the preset even if it is installed to a nested
|
|
12
|
-
* `./node_modules/skuba/node_modules/ts-jest` directory.
|
|
13
|
-
*/
|
|
14
|
-
const TS_JEST_PATH = require.resolve(TS_JEST_NAME);
|
|
15
|
-
|
|
16
|
-
const maybeTsConfig = tryParseTsConfig();
|
|
17
|
-
|
|
18
|
-
const BROKEN_MODULE_RESOLUTIONS = new Set([
|
|
19
|
-
ModuleResolutionKind.Bundler,
|
|
20
|
-
ModuleResolutionKind.NodeNext,
|
|
21
|
-
]);
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Passing through these module resolutions seems to break `ts-jest`.
|
|
25
|
-
*
|
|
26
|
-
* ```
|
|
27
|
-
* error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* https://github.com/kulshekhar/ts-jest/issues/4198
|
|
31
|
-
*/
|
|
32
|
-
const tsconfig = BROKEN_MODULE_RESOLUTIONS.has(
|
|
33
|
-
maybeTsConfig?.options.moduleResolution,
|
|
34
|
-
)
|
|
35
|
-
? { tsconfig: { moduleResolution: 'Node' } }
|
|
36
|
-
: undefined;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Rewrite `ts-jest` transformations using our resolved `TS_JEST_PATH`.
|
|
40
|
-
*
|
|
41
|
-
* @type {import ('@jest/types').Config.InitialOptions['transform']}
|
|
42
|
-
*/
|
|
43
|
-
module.exports.transform = Object.fromEntries(
|
|
44
|
-
Object.entries(defaults.transform).map(([key, value]) => {
|
|
45
|
-
if (typeof value === 'string') {
|
|
46
|
-
return [key, value === TS_JEST_NAME ? [TS_JEST_PATH, tsconfig] : value];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return [
|
|
50
|
-
key,
|
|
51
|
-
value[0] === TS_JEST_NAME
|
|
52
|
-
? [
|
|
53
|
-
TS_JEST_PATH,
|
|
54
|
-
{
|
|
55
|
-
...value[1],
|
|
56
|
-
...tsconfig,
|
|
57
|
-
},
|
|
58
|
-
]
|
|
59
|
-
: value,
|
|
60
|
-
];
|
|
61
|
-
}),
|
|
62
|
-
);
|
package/jest/tsConfig.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
sys,
|
|
3
|
-
findConfigFile,
|
|
4
|
-
readConfigFile,
|
|
5
|
-
parseJsonConfigFileContent,
|
|
6
|
-
} = require('typescript');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @returns {unknown}
|
|
10
|
-
*/
|
|
11
|
-
const getTsConfigFromDisk = () => {
|
|
12
|
-
const filename =
|
|
13
|
-
findConfigFile('.', sys.fileExists.bind(this)) ?? 'tsconfig.json';
|
|
14
|
-
|
|
15
|
-
return readConfigFile(filename, sys.readFile.bind(this)).config;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
module.exports.tryParseTsConfig = (getConfig = getTsConfigFromDisk) => {
|
|
19
|
-
try {
|
|
20
|
-
const json = getConfig();
|
|
21
|
-
|
|
22
|
-
return parseJsonConfigFileContent(json, sys, '.');
|
|
23
|
-
} catch {
|
|
24
|
-
// Bail out here to support zero-config mode.
|
|
25
|
-
}
|
|
26
|
-
};
|
package/jest-preset.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const { defaults } = require('ts-jest/presets');
|
|
2
|
-
|
|
3
|
-
const { createModuleNameMapper } = require('./jest/moduleNameMapper');
|
|
4
|
-
const { transform } = require('./jest/transform');
|
|
5
|
-
|
|
6
|
-
/** @type {import('@jest/types').Config.InitialOptions} */
|
|
7
|
-
module.exports = {
|
|
8
|
-
...defaults,
|
|
9
|
-
|
|
10
|
-
moduleNameMapper: createModuleNameMapper(),
|
|
11
|
-
transform,
|
|
12
|
-
|
|
13
|
-
collectCoverageFrom: [
|
|
14
|
-
'**/*.ts',
|
|
15
|
-
'**/*.tsx',
|
|
16
|
-
'!**/node_modules*/**',
|
|
17
|
-
'!<rootDir>/coverage*/**',
|
|
18
|
-
'!<rootDir>/dist*/**',
|
|
19
|
-
'!<rootDir>/lib*/**',
|
|
20
|
-
'!<rootDir>/tmp*/**',
|
|
21
|
-
'!<rootDir>/jest.*.ts',
|
|
22
|
-
],
|
|
23
|
-
coverageDirectory: 'coverage',
|
|
24
|
-
reporters: ['default', require.resolve('./lib/cli/test/reporters/github')],
|
|
25
|
-
testEnvironment: 'node',
|
|
26
|
-
testPathIgnorePatterns: [
|
|
27
|
-
'/node_modules.*/',
|
|
28
|
-
'<rootDir>/(coverage|dist|lib|tmp).*/',
|
|
29
|
-
],
|
|
30
|
-
watchPlugins: [
|
|
31
|
-
require.resolve('jest-watch-typeahead/filename'),
|
|
32
|
-
require.resolve('jest-watch-typeahead/testname'),
|
|
33
|
-
],
|
|
34
|
-
testEnvironmentOptions: {
|
|
35
|
-
globalsCleanup: 'on',
|
|
36
|
-
},
|
|
37
|
-
};
|
package/lib/api/jest/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Config } from '@jest/types';
|
|
2
|
-
export type { Config } from '@jest/types';
|
|
3
|
-
/**
|
|
4
|
-
* Set of Jest options that are recommended and supported for customisation.
|
|
5
|
-
*
|
|
6
|
-
* While we technically accept anything compatible with `Config.InitialOptions`,
|
|
7
|
-
* these are tacitly endorsed for our use cases and receive IntelliSense.
|
|
8
|
-
*/
|
|
9
|
-
type DefaultOptions = 'collectCoverage' | 'collectCoverageFrom' | 'coveragePathIgnorePatterns' | 'coverageThreshold' | 'displayName' | 'globals' | 'globalSetup' | 'globalTeardown' | 'projects' | 'setupFiles' | 'setupFilesAfterEnv' | 'snapshotSerializers' | 'testEnvironment' | 'testPathIgnorePatterns' | 'testTimeout' | 'watchPathIgnorePatterns';
|
|
10
|
-
/**
|
|
11
|
-
* Merge additional Jest options into the **skuba** preset.
|
|
12
|
-
*
|
|
13
|
-
* This concatenates array options like `testPathIgnorePatterns`.
|
|
14
|
-
*/
|
|
15
|
-
export declare const mergePreset: <AdditionalOptions extends keyof Config.InitialOptions>({ projects, ...options }: Pick<Config.InitialOptions, AdditionalOptions | DefaultOptions>) => Config.InitialOptions;
|
package/lib/api/jest/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var jest_exports = {};
|
|
30
|
-
__export(jest_exports, {
|
|
31
|
-
mergePreset: () => mergePreset
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(jest_exports);
|
|
34
|
-
var import_jest_preset = __toESM(require("../../../jest-preset.js"));
|
|
35
|
-
var import_record = require("../../cli/configure/processing/record.js");
|
|
36
|
-
const mergePreset = ({
|
|
37
|
-
projects,
|
|
38
|
-
...options
|
|
39
|
-
}) => {
|
|
40
|
-
const root = (0, import_record.mergeRaw)(import_jest_preset.default, options);
|
|
41
|
-
return {
|
|
42
|
-
...root,
|
|
43
|
-
projects: projects?.map((project) => {
|
|
44
|
-
if (typeof project === "string") {
|
|
45
|
-
return project;
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
moduleNameMapper: root.moduleNameMapper,
|
|
49
|
-
transform: root.transform,
|
|
50
|
-
...project
|
|
51
|
-
};
|
|
52
|
-
})
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
mergePreset
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/jest/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Config } from '@jest/types';\n\nimport jestPreset from '../../../jest-preset.js';\nimport { mergeRaw } from '../../cli/configure/processing/record.js';\n\n// Avoid TS4082 in Jest configuration files:\n// Default export of the module has or is using private name `ConfigGlobals`.\nexport type { Config } from '@jest/types';\n\n/**\n * Set of Jest options that are recommended and supported for customisation.\n *\n * While we technically accept anything compatible with `Config.InitialOptions`,\n * these are tacitly endorsed for our use cases and receive IntelliSense.\n */\ntype DefaultOptions =\n | 'collectCoverage'\n | 'collectCoverageFrom'\n | 'coveragePathIgnorePatterns'\n | 'coverageThreshold'\n | 'displayName'\n | 'globals'\n | 'globalSetup'\n | 'globalTeardown'\n | 'projects'\n | 'setupFiles'\n | 'setupFilesAfterEnv'\n | 'snapshotSerializers'\n | 'testEnvironment'\n | 'testPathIgnorePatterns'\n | 'testTimeout'\n | 'watchPathIgnorePatterns';\n\n/**\n * Merge additional Jest options into the **skuba** preset.\n *\n * This concatenates array options like `testPathIgnorePatterns`.\n */\nexport const mergePreset = <\n AdditionalOptions extends keyof Config.InitialOptions,\n>({\n projects,\n ...options\n}: Pick<\n Config.InitialOptions,\n AdditionalOptions | DefaultOptions\n>): Config.InitialOptions => {\n const root = mergeRaw(jestPreset, options);\n\n return {\n ...root,\n\n projects: projects?.map((project) => {\n if (typeof project === 'string') {\n return project;\n }\n\n return {\n moduleNameMapper: root.moduleNameMapper,\n transform: root.transform,\n ...project,\n };\n }),\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAuB;AACvB,oBAAyB;AAmClB,MAAM,cAAc,CAEzB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAG6B;AAC3B,QAAM,WAAO,wBAAS,mBAAAA,SAAY,OAAO;AAEzC,SAAO;AAAA,IACL,GAAG;AAAA,IAEH,UAAU,UAAU,IAAI,CAAC,YAAY;AACnC,UAAI,OAAO,YAAY,UAAU;AAC/B,eAAO;AAAA,MACT;AAEA,aAAO;AAAA,QACL,kBAAkB,KAAK;AAAA,QACvB,WAAW,KAAK;AAAA,QAChB,GAAG;AAAA,MACL;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
-
"names": ["jestPreset"]
|
|
7
|
-
}
|