skuba 14.0.0-replace-global-vars-20251117052457 → 14.0.0-rfc-upgrade-on-test-20251217012156
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/jest.js +1 -0
- package/config/prettier.d.ts +4 -8
- package/config/prettier.js +2 -10
- package/jest/moduleNameMapper.js +64 -0
- package/jest/transform.js +62 -0
- package/jest/tsConfig.js +26 -0
- package/jest-preset.js +37 -0
- package/lib/api/jest/index.d.ts +15 -0
- package/lib/api/jest/index.js +59 -0
- package/lib/api/jest/index.js.map +7 -0
- package/lib/cli/adapter/eslint.js +45 -11
- package/lib/cli/adapter/eslint.js.map +2 -2
- package/lib/cli/adapter/prettier.js +67 -39
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +42 -8
- package/lib/cli/build/args.js.map +2 -2
- package/lib/cli/build/assets.js +60 -28
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.js +45 -21
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +45 -21
- package/lib/cli/build/index.js.map +1 -1
- package/lib/cli/build/tsc.js +59 -22
- package/lib/cli/build/tsc.js.map +2 -2
- package/lib/cli/buildPackage/index.js +32 -8
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +50 -16
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/analyseDependencies.d.ts +1 -1
- package/lib/cli/configure/analyseDependencies.js +59 -25
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +29 -5
- package/lib/cli/configure/analysis/diff.js.map +1 -1
- package/lib/cli/configure/analysis/files.js +42 -8
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +46 -12
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/configure/analysis/package.d.ts +3 -2
- package/lib/cli/configure/analysis/package.js +45 -10
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +50 -18
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +35 -7
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +28 -4
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +28 -4
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +29 -4
- 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 +61 -33
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.d.ts +1 -1
- package/lib/cli/configure/getEntryPoint.js +48 -14
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/getProjectType.d.ts +1 -1
- package/lib/cli/configure/getProjectType.js +35 -14
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +84 -50
- package/lib/cli/configure/index.js.map +2 -2
- package/lib/cli/configure/modules/eslint.js +34 -10
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +32 -8
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +44 -18
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/jest.d.ts +2 -0
- package/lib/cli/configure/modules/jest.js +86 -0
- package/lib/cli/configure/modules/jest.js.map +7 -0
- package/lib/cli/configure/modules/nodemon.js +28 -4
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +34 -10
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +35 -11
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +40 -17
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +26 -2
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +28 -4
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +39 -3
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +26 -2
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +27 -2
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +31 -6
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +26 -2
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +28 -4
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.d.ts +67 -1
- package/lib/cli/configure/processing/package.js +45 -8
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +38 -4
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +41 -5
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +63 -26
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/types.d.ts +4 -15
- package/lib/cli/configure/types.js +16 -0
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +44 -20
- package/lib/cli/format/index.js.map +1 -1
- package/lib/cli/help/index.js +30 -6
- package/lib/cli/help/index.js.map +1 -1
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/init/getConfig.js +100 -74
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.js +51 -16
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +98 -67
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.d.ts +4 -4
- package/lib/cli/init/prompts.js +48 -27
- package/lib/cli/init/prompts.js.map +2 -2
- package/lib/cli/init/types.js +41 -7
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +30 -2
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +42 -8
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +45 -11
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +26 -2
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +45 -11
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +26 -2
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +26 -2
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +28 -4
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +30 -6
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +73 -37
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/eslint.js +51 -16
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +51 -19
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +49 -25
- package/lib/cli/lint/index.js.map +1 -1
- package/lib/cli/lint/internal.js +42 -18
- package/lib/cli/lint/internal.js.map +1 -1
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +45 -11
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +63 -32
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +6 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +55 -23
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
- 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 +45 -11
- 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 +30 -6
- 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 +65 -34
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
- 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 +28 -4
- 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 +59 -23
- 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 +28 -4
- 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 +46 -11
- 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 +30 -6
- 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 +46 -11
- 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 +46 -11
- 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 +28 -4
- 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 +46 -11
- 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 +67 -29
- 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 +34 -10
- 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 +45 -11
- 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 +0 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -18
- 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 +50 -15
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
- 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 +34 -10
- 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 +44 -10
- 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 +46 -12
- 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 +28 -4
- 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 +49 -15
- 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 +45 -11
- 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 +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
- 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 +45 -11
- 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 +47 -13
- 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 +28 -4
- 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 +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/prettier.js +50 -15
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +28 -4
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +16 -0
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.d.ts +5 -0
- package/lib/cli/migrate/index.js +79 -15
- package/lib/cli/migrate/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
- package/lib/cli/migrate/nodeVersion/checks.js +51 -120
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
- package/lib/cli/migrate/nodeVersion/index.js +239 -65
- package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
- package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
- package/lib/cli/node/index.js +57 -20
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +28 -4
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +50 -16
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +65 -4
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
- package/lib/cli/test/reporters/github/annotations.js +102 -0
- package/lib/cli/test/reporters/github/annotations.js.map +7 -0
- package/lib/cli/test/reporters/github/index.d.ts +5 -0
- package/lib/cli/test/reporters/github/index.js +74 -0
- package/lib/cli/test/reporters/github/index.js.map +7 -0
- package/lib/cli/version/index.js +30 -6
- package/lib/cli/version/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +46 -6
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +45 -26
- package/lib/skuba.js.map +3 -3
- package/lib/utils/args.js +43 -6
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +42 -4
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +57 -20
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +72 -32
- package/lib/utils/dir.js.map +2 -2
- package/lib/utils/env.js +26 -2
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +47 -10
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.js +61 -23
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +40 -6
- package/lib/utils/fs.js.map +2 -2
- package/lib/utils/help.js +30 -6
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/logging.js +38 -11
- package/lib/utils/logging.js.map +1 -1
- package/lib/utils/logo.js +48 -24
- package/lib/utils/logo.js.map +1 -1
- package/lib/utils/manifest.d.ts +2 -3
- package/lib/utils/manifest.js +48 -8
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +26 -2
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +49 -12
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +39 -4
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +26 -2
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/template.js +55 -18
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +31 -2
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +46 -9
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +32 -7
- package/lib/utils/wait.js.map +1 -1
- package/lib/utils/worker.js +35 -10
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/function-arguments.d.js +1 -0
- package/lib/wrapper/functionHandler.js +49 -18
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.js +43 -8
- package/lib/wrapper/http.js.map +2 -2
- package/lib/wrapper/index.js +7 -6
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +42 -8
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +47 -13
- package/lib/wrapper/requestListener.js.map +2 -2
- package/lib/wrapper/server.js +28 -4
- package/lib/wrapper/server.js.map +1 -1
- package/package.json +42 -43
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +4 -3
- package/template/base/jest.config.ts +19 -0
- package/template/base/jest.setup.ts +3 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/package.json +7 -8
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +0 -1
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/package.json +4 -5
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +1 -3
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/package.json +8 -10
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
- package/template/koa-rest-api/src/app.test.ts +0 -2
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
- package/template/koa-rest-api/src/testing/metrics.ts +0 -2
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -21
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
- package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
- package/template/lambda-sqs-worker-cdk/package.json +9 -9
- package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/oss-npm-package/_package.json +0 -1
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +0 -2
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +1 -2
- package/template/private-npm-package/skuba.template.js +2 -2
- package/template/private-npm-package/src/index.test.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +0 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +0 -5
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +0 -72
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
- package/lib/eslint.d.js +0 -1
- package/lib/eslint.d.js.map +0 -7
- package/template/base/vitest.config.ts +0 -25
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.5.0 → 13.1.1}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
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",
|
|
@@ -217,7 +216,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
217
216
|
{
|
|
218
217
|
"Ref": "AWS::Region",
|
|
219
218
|
},
|
|
220
|
-
":464622532012:layer:Datadog-
|
|
219
|
+
":464622532012:layer:Datadog-Node24-x:x",
|
|
221
220
|
],
|
|
222
221
|
],
|
|
223
222
|
},
|
|
@@ -242,7 +241,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
242
241
|
"Arn",
|
|
243
242
|
],
|
|
244
243
|
},
|
|
245
|
-
"Runtime": "
|
|
244
|
+
"Runtime": "nodejs24.x",
|
|
246
245
|
"Tags": [
|
|
247
246
|
{
|
|
248
247
|
"Key": "aws-codedeploy-hooks",
|
|
@@ -763,14 +762,6 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
763
762
|
},
|
|
764
763
|
},
|
|
765
764
|
"Resources": {
|
|
766
|
-
"datadogapikeysecret046FEF06": {
|
|
767
|
-
"DeletionPolicy": "Delete",
|
|
768
|
-
"Properties": {
|
|
769
|
-
"GenerateSecretString": {},
|
|
770
|
-
},
|
|
771
|
-
"Type": "AWS::SecretsManager::Secret",
|
|
772
|
-
"UpdateReplacePolicy": "Delete",
|
|
773
|
-
},
|
|
774
765
|
"destinationtopicDCE2E0B8": {
|
|
775
766
|
"Properties": {
|
|
776
767
|
"KmsMasterKeyId": {
|
|
@@ -928,16 +919,13 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
928
919
|
},
|
|
929
920
|
"Environment": {
|
|
930
921
|
"Variables": {
|
|
931
|
-
"DD_API_KEY_SECRET_ARN":
|
|
932
|
-
"Ref": "datadogapikeysecret046FEF06",
|
|
933
|
-
},
|
|
922
|
+
"DD_API_KEY_SECRET_ARN": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key",
|
|
934
923
|
"DD_CAPTURE_LAMBDA_PAYLOAD": "false",
|
|
935
924
|
"DD_ENV": "production",
|
|
936
925
|
"DD_FLUSH_TO_LOG": "false",
|
|
937
926
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
938
927
|
"DD_LOGS_INJECTION": "false",
|
|
939
928
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
940
|
-
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
941
929
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
942
930
|
"DD_SERVICE": "serviceName",
|
|
943
931
|
"DD_SITE": "datadoghq.com",
|
|
@@ -970,7 +958,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
970
958
|
{
|
|
971
959
|
"Ref": "AWS::Region",
|
|
972
960
|
},
|
|
973
|
-
":464622532012:layer:Datadog-
|
|
961
|
+
":464622532012:layer:Datadog-Node24-x:x",
|
|
974
962
|
],
|
|
975
963
|
],
|
|
976
964
|
},
|
|
@@ -995,7 +983,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
995
983
|
"Arn",
|
|
996
984
|
],
|
|
997
985
|
},
|
|
998
|
-
"Runtime": "
|
|
986
|
+
"Runtime": "nodejs24.x",
|
|
999
987
|
"Tags": [
|
|
1000
988
|
{
|
|
1001
989
|
"Key": "aws-codedeploy-hooks",
|
|
@@ -1394,9 +1382,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1394
1382
|
"secretsmanager:DescribeSecret",
|
|
1395
1383
|
],
|
|
1396
1384
|
"Effect": "Allow",
|
|
1397
|
-
"Resource":
|
|
1398
|
-
"Ref": "datadogapikeysecret046FEF06",
|
|
1399
|
-
},
|
|
1385
|
+
"Resource": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key-??????",
|
|
1400
1386
|
},
|
|
1401
1387
|
{
|
|
1402
1388
|
"Action": [
|
|
@@ -1,6 +1,5 @@
|
|
|
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';
|
|
4
3
|
|
|
5
4
|
const originalDeployment = process.env.DEPLOYMENT;
|
|
6
5
|
const originalVersion = process.env.VERSION;
|
|
@@ -11,7 +10,7 @@ afterAll(() => {
|
|
|
11
10
|
});
|
|
12
11
|
|
|
13
12
|
afterEach(() => {
|
|
14
|
-
|
|
13
|
+
jest.resetModules();
|
|
15
14
|
});
|
|
16
15
|
|
|
17
16
|
it.each(['dev', 'prod'])(
|
|
@@ -22,16 +21,15 @@ it.each(['dev', 'prod'])(
|
|
|
22
21
|
|
|
23
22
|
const { AppStack } = await import('./appStack.js');
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
(
|
|
27
|
-
|
|
24
|
+
jest
|
|
25
|
+
.spyOn(aws_sns.Topic, 'fromTopicArn')
|
|
26
|
+
.mockImplementation((scope, id) => new aws_sns.Topic(scope, id));
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
aws_secretsmanager.Secret,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
28
|
+
jest
|
|
29
|
+
.spyOn(aws_secretsmanager.Secret, 'fromSecretPartialArn')
|
|
30
|
+
.mockImplementation(
|
|
31
|
+
(scope, id) => new aws_secretsmanager.Secret(scope, id),
|
|
32
|
+
);
|
|
35
33
|
|
|
36
34
|
const app = new App({ context: { 'aws:cdk:bundling-stacks': [] } });
|
|
37
35
|
|
|
@@ -19,7 +19,7 @@ import { DatadogLambda } from 'datadog-cdk-constructs-v2';
|
|
|
19
19
|
import { config } from './config.js';
|
|
20
20
|
|
|
21
21
|
// Updated by https://github.com/seek-oss/rynovate
|
|
22
|
-
const DATADOG_EXTENSION_LAYER_VERSION =
|
|
22
|
+
const DATADOG_EXTENSION_LAYER_VERSION = 90;
|
|
23
23
|
|
|
24
24
|
// Updated by https://github.com/seek-oss/rynovate
|
|
25
25
|
const DATADOG_NODE_LAYER_VERSION = 126;
|
|
@@ -86,7 +86,7 @@ export class AppStack extends Stack {
|
|
|
86
86
|
|
|
87
87
|
const worker = new aws_lambda_nodejs.NodejsFunction(this, 'worker', {
|
|
88
88
|
architecture: aws_lambda.Architecture[architecture],
|
|
89
|
-
runtime: aws_lambda.Runtime.
|
|
89
|
+
runtime: aws_lambda.Runtime.NODEJS_24_X,
|
|
90
90
|
memorySize: 512,
|
|
91
91
|
environmentEncryption: kmsKey,
|
|
92
92
|
// aws-sdk-v3 sets this to true by default, so it is not necessary to set the environment variable
|
|
@@ -96,7 +96,7 @@ export class AppStack extends Stack {
|
|
|
96
96
|
timeout: Duration.seconds(30),
|
|
97
97
|
bundling: {
|
|
98
98
|
sourceMap: true,
|
|
99
|
-
target: '
|
|
99
|
+
target: 'node24',
|
|
100
100
|
// aws-sdk-v3 is set as an external module by default, but we want it to be bundled with the function
|
|
101
101
|
externalModules: [],
|
|
102
102
|
esbuildArgs: {
|
|
@@ -40,8 +40,7 @@ const configs: Record<Deployment, Config> = {
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
-
datadogApiKeySecretArn:
|
|
44
|
-
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
|
|
43
|
+
datadogApiKeySecretArn: '<%- devDataDogApiKeySecretArn %>',
|
|
45
44
|
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
|
|
46
45
|
},
|
|
47
46
|
prod: {
|
|
@@ -57,8 +56,7 @@ const configs: Record<Deployment, Config> = {
|
|
|
57
56
|
},
|
|
58
57
|
},
|
|
59
58
|
|
|
60
|
-
datadogApiKeySecretArn:
|
|
61
|
-
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
|
|
59
|
+
datadogApiKeySecretArn: '<%- prodDataDogApiKeySecretArn %>',
|
|
62
60
|
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
|
|
63
61
|
},
|
|
64
62
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"name": "@seek/<%- serviceName %>",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"imports": {
|
|
7
6
|
"#src/*": {
|
|
8
7
|
"@seek/<%- serviceName %>/source": "./src/*",
|
|
@@ -21,10 +20,11 @@
|
|
|
21
20
|
"dependencies": {
|
|
22
21
|
"@aws-sdk/client-codedeploy": "^3.363.0",
|
|
23
22
|
"@aws-sdk/client-lambda": "^3.363.0",
|
|
23
|
+
"@aws-sdk/client-secrets-manager": "^3.363.0",
|
|
24
24
|
"@aws-sdk/client-sns": "^3.363.0",
|
|
25
25
|
"@seek/aws-codedeploy-hooks": "^2.0.0",
|
|
26
26
|
"@seek/logger": "^11.1.0",
|
|
27
|
-
"skuba-dive": "
|
|
27
|
+
"skuba-dive": "4.0.0-rfc-upgrade-on-test-20251217012156",
|
|
28
28
|
"zod": "^4.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"@types/chance": "^1.1.3",
|
|
34
34
|
"@types/node": "^22.13.10",
|
|
35
35
|
"aws-cdk": "^2.1010.0",
|
|
36
|
-
"aws-cdk-lib": "^2.
|
|
37
|
-
"aws-sdk-client-mock": "^4.
|
|
38
|
-
"aws-sdk-client-mock-
|
|
36
|
+
"aws-cdk-lib": "^2.232.1",
|
|
37
|
+
"aws-sdk-client-mock": "^4.0.0",
|
|
38
|
+
"aws-sdk-client-mock-jest": "^4.0.0",
|
|
39
39
|
"chance": "^1.1.8",
|
|
40
40
|
"constructs": "^10.0.17",
|
|
41
|
-
"datadog-cdk-constructs-v2": "^3.
|
|
41
|
+
"datadog-cdk-constructs-v2": "^3.4.0",
|
|
42
42
|
"datadog-lambda-js": "^12.0.0",
|
|
43
43
|
"dd-trace": "^5.0.0",
|
|
44
44
|
"pino-pretty": "^13.0.0",
|
|
45
|
-
"skuba": "14.0.0-
|
|
45
|
+
"skuba": "14.0.0-rfc-upgrade-on-test-20251217012156"
|
|
46
46
|
},
|
|
47
|
-
"packageManager": "pnpm@10.
|
|
47
|
+
"packageManager": "pnpm@10.25.0",
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">=24"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Run `skuba configure` to finish templating and remove this file.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
module.exports = {
|
|
6
6
|
entryPoint: 'src/app.ts#handler',
|
|
7
7
|
fields: [
|
|
8
8
|
{
|
|
@@ -22,6 +22,18 @@ export default {
|
|
|
22
22
|
initial: 'my-team-aws-account-prod:cicd',
|
|
23
23
|
validate: (value) => /^.+:.+$/.test(value),
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
name: 'devDataDogApiKeySecretArn',
|
|
27
|
+
message: 'Dev DataDog API Key Secret ARN',
|
|
28
|
+
initial:
|
|
29
|
+
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'prodDataDogApiKeySecretArn',
|
|
33
|
+
message: 'Prod DataDog API Key Secret ARN',
|
|
34
|
+
initial:
|
|
35
|
+
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key',
|
|
36
|
+
},
|
|
25
37
|
],
|
|
26
38
|
packageManager: 'pnpm',
|
|
27
39
|
type: 'application',
|
|
@@ -1,14 +1,5 @@
|
|
|
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';
|
|
12
3
|
|
|
13
4
|
import * as app from './app.js';
|
|
14
5
|
import { stdoutMock } from './framework/logging.js';
|
|
@@ -29,7 +20,7 @@ describe('handler', () => {
|
|
|
29
20
|
|
|
30
21
|
const score = chance.floating({ max: 1, min: 0 });
|
|
31
22
|
|
|
32
|
-
const distribution =
|
|
23
|
+
const distribution = jest
|
|
33
24
|
.spyOn(metricsClient, 'distribution')
|
|
34
25
|
.mockReturnValue();
|
|
35
26
|
|
|
@@ -50,9 +41,9 @@ describe('handler', () => {
|
|
|
50
41
|
it('handles one record', async () => {
|
|
51
42
|
const event = createSqsEvent([JSON.stringify(jobPublished)]);
|
|
52
43
|
|
|
53
|
-
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
44
|
+
await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
|
|
54
45
|
batchItemFailures: [],
|
|
55
|
-
}
|
|
46
|
+
});
|
|
56
47
|
|
|
57
48
|
expect(scoringService.request).toHaveBeenCalledTimes(1);
|
|
58
49
|
|
|
@@ -81,9 +72,9 @@ describe('handler', () => {
|
|
|
81
72
|
JSON.stringify(jobPublished),
|
|
82
73
|
]);
|
|
83
74
|
|
|
84
|
-
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
75
|
+
await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
|
|
85
76
|
batchItemFailures: [],
|
|
86
|
-
}
|
|
77
|
+
});
|
|
87
78
|
|
|
88
79
|
expect(stdoutMock.calls).toMatchObject([
|
|
89
80
|
{ count: 2, level: 20, msg: 'Received jobs' },
|
|
@@ -109,9 +100,9 @@ describe('handler', () => {
|
|
|
109
100
|
JSON.stringify(jobPublished),
|
|
110
101
|
]);
|
|
111
102
|
|
|
112
|
-
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
103
|
+
await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
|
|
113
104
|
batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
|
|
114
|
-
}
|
|
105
|
+
});
|
|
115
106
|
|
|
116
107
|
expect(stdoutMock.calls).toMatchObject([
|
|
117
108
|
{ count: 2, level: 20, msg: 'Received jobs' },
|
|
@@ -137,13 +128,13 @@ describe('handler', () => {
|
|
|
137
128
|
it('returns a batchItemFailure on invalid input', () => {
|
|
138
129
|
const event = createSqsEvent(['}']);
|
|
139
130
|
|
|
140
|
-
return expect(app.handler(event, ctx)).resolves.toEqual({
|
|
131
|
+
return expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
|
|
141
132
|
batchItemFailures: [
|
|
142
133
|
{
|
|
143
134
|
itemIdentifier: event.Records[0]!.messageId,
|
|
144
135
|
},
|
|
145
136
|
],
|
|
146
|
-
}
|
|
137
|
+
});
|
|
147
138
|
});
|
|
148
139
|
|
|
149
140
|
it('bubbles up scoring service error', async () => {
|
|
@@ -153,9 +144,9 @@ describe('handler', () => {
|
|
|
153
144
|
|
|
154
145
|
const event = createSqsEvent([JSON.stringify(jobPublished)]);
|
|
155
146
|
|
|
156
|
-
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
147
|
+
await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
|
|
157
148
|
batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
|
|
158
|
-
}
|
|
149
|
+
});
|
|
159
150
|
|
|
160
151
|
expect(stdoutMock.calls).toMatchObject([
|
|
161
152
|
{ count: 1, level: 20, msg: 'Received jobs' },
|
|
@@ -179,9 +170,9 @@ describe('handler', () => {
|
|
|
179
170
|
|
|
180
171
|
const event = createSqsEvent([JSON.stringify(jobPublished)]);
|
|
181
172
|
|
|
182
|
-
await expect(app.handler(event, ctx)).resolves.toEqual({
|
|
173
|
+
await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
|
|
183
174
|
batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
|
|
184
|
-
}
|
|
175
|
+
});
|
|
185
176
|
|
|
186
177
|
expect(stdoutMock.calls).toMatchObject([
|
|
187
178
|
{
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
|
|
3
1
|
import { validateJson } from './validation.js';
|
|
4
2
|
|
|
5
3
|
import {
|
|
@@ -32,17 +30,17 @@ describe('validateJson', () => {
|
|
|
32
30
|
|
|
33
31
|
expect(() => validateJson(input, IdDescriptionSchema))
|
|
34
32
|
.toThrowErrorMatchingInlineSnapshot(`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
"[
|
|
34
|
+
{
|
|
35
|
+
"expected": "string",
|
|
36
|
+
"code": "invalid_type",
|
|
37
|
+
"path": [
|
|
38
|
+
"id"
|
|
39
|
+
],
|
|
40
|
+
"message": "Invalid input: expected string, received null"
|
|
41
|
+
}
|
|
42
|
+
]"
|
|
43
|
+
`);
|
|
46
44
|
});
|
|
47
45
|
|
|
48
46
|
it('blocks missing prop', () => {
|
|
@@ -50,25 +48,25 @@ describe('validateJson', () => {
|
|
|
50
48
|
|
|
51
49
|
expect(() => validateJson(input, IdDescriptionSchema))
|
|
52
50
|
.toThrowErrorMatchingInlineSnapshot(`
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
"[
|
|
52
|
+
{
|
|
53
|
+
"expected": "string",
|
|
54
|
+
"code": "invalid_type",
|
|
55
|
+
"path": [
|
|
56
|
+
"id"
|
|
57
|
+
],
|
|
58
|
+
"message": "Invalid input: expected string, received undefined"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"expected": "string",
|
|
62
|
+
"code": "invalid_type",
|
|
63
|
+
"path": [
|
|
64
|
+
"description"
|
|
65
|
+
],
|
|
66
|
+
"message": "Invalid input: expected string, received undefined"
|
|
67
|
+
}
|
|
68
|
+
]"
|
|
69
|
+
`);
|
|
72
70
|
});
|
|
73
71
|
|
|
74
72
|
it('blocks invalid JSON', () => {
|
|
@@ -77,7 +75,7 @@ describe('validateJson', () => {
|
|
|
77
75
|
expect(() =>
|
|
78
76
|
validateJson(input, IdDescriptionSchema),
|
|
79
77
|
).toThrowErrorMatchingInlineSnapshot(
|
|
80
|
-
`
|
|
78
|
+
`"Unexpected token '}', "}" is not valid JSON"`,
|
|
81
79
|
);
|
|
82
80
|
});
|
|
83
81
|
});
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { afterEach, beforeAll, describe, expect, it } from 'vitest';
|
|
2
|
-
|
|
3
1
|
import * as jobScorer from './jobScorer.js';
|
|
4
2
|
|
|
5
3
|
import { scoringService } from '#src/testing/services.js';
|
|
6
4
|
import { chance, mockJobPublishedEvent } from '#src/testing/types.js';
|
|
7
5
|
|
|
8
6
|
describe('scoreJobPublishedEvent', () => {
|
|
9
|
-
beforeAll(
|
|
10
|
-
scoringService.spy();
|
|
11
|
-
});
|
|
7
|
+
beforeAll(scoringService.spy);
|
|
12
8
|
|
|
13
|
-
afterEach(
|
|
14
|
-
scoringService.clear();
|
|
15
|
-
});
|
|
9
|
+
afterEach(scoringService.clear);
|
|
16
10
|
|
|
17
11
|
it('scores an event', async () => {
|
|
18
12
|
const score = chance.floating({ max: 1, min: 0 });
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PublishCommand } from '@aws-sdk/client-sns';
|
|
2
|
-
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
3
2
|
|
|
4
3
|
import { sendPipelineEvent } from './pipelineEventSender.js';
|
|
5
4
|
|
|
@@ -8,7 +7,7 @@ import { chance } from '#src/testing/types.js';
|
|
|
8
7
|
|
|
9
8
|
describe('sendPipelineEvent', () => {
|
|
10
9
|
afterEach(() => {
|
|
11
|
-
|
|
10
|
+
jest.clearAllMocks();
|
|
12
11
|
});
|
|
13
12
|
|
|
14
13
|
it('handles happy path', async () => {
|
|
@@ -35,7 +34,7 @@ describe('sendPipelineEvent', () => {
|
|
|
35
34
|
return expect(
|
|
36
35
|
sendPipelineEvent({}),
|
|
37
36
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
|
38
|
-
`
|
|
37
|
+
`"SNS did not return a message ID"`,
|
|
39
38
|
);
|
|
40
39
|
});
|
|
41
40
|
});
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import 'aws-sdk-client-mock-
|
|
1
|
+
import 'aws-sdk-client-mock-jest';
|
|
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';
|
|
6
5
|
|
|
7
6
|
import { sns as snsClient } from '#src/services/aws.js';
|
|
8
7
|
import * as jobScorer from '#src/services/jobScorer.js';
|
|
9
8
|
|
|
10
9
|
export const scoringService = {
|
|
11
|
-
request:
|
|
10
|
+
request: jest.fn(),
|
|
12
11
|
|
|
13
12
|
clear: () => scoringService.request.mockClear(),
|
|
14
13
|
|
|
15
14
|
spy: () =>
|
|
16
|
-
|
|
15
|
+
jest
|
|
17
16
|
.spyOn(jobScorer.scoringService, 'request')
|
|
18
17
|
.mockImplementation(scoringService.request),
|
|
19
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
16
|
"sideEffects": false,
|
|
17
|
-
"type": "module",
|
|
18
17
|
"main": "./lib-commonjs/index.js",
|
|
19
18
|
"module": "./lib-es2015/index.js",
|
|
20
19
|
"types": "./lib-types/index.d.ts",
|
|
@@ -47,6 +46,6 @@
|
|
|
47
46
|
},
|
|
48
47
|
"packageManager": "pnpm@10.7.0",
|
|
49
48
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
49
|
+
"node": ">=20"
|
|
51
50
|
}
|
|
52
51
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Run `skuba configure` to finish templating and remove this file.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
module.exports = {
|
|
6
6
|
entryPoint: 'src/index.ts',
|
|
7
7
|
fields: [
|
|
8
8
|
{
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
message: 'Module name',
|
|
11
11
|
initial: '@seek/my-first-module',
|
|
12
12
|
validate: (value) =>
|
|
13
|
-
/^@seek\/.+$/.test(value) || '
|
|
13
|
+
/^@seek\/.+$/.test(value) || 'Must start with @seek/ scope',
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
name: 'description',
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { rewriteGlobalVars } from "./rewriteGlobalVars.js";
|
|
2
|
-
const patches = [
|
|
3
|
-
{
|
|
4
|
-
apply: rewriteGlobalVars,
|
|
5
|
-
description: "Replace __dirname and __filename with import.meta equivalents"
|
|
6
|
-
}
|
|
7
|
-
];
|
|
8
|
-
export {
|
|
9
|
-
patches
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.5.0/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { rewriteGlobalVars } from './rewriteGlobalVars.js';\n\nexport const patches: Patches = [\n {\n apply: rewriteGlobalVars,\n description:\n 'Replace __dirname and __filename with import.meta equivalents',\n },\n];\n"],
|
|
5
|
-
"mappings": "AAEA,SAAS,yBAAyB;AAE3B,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|