skuba 14.0.0-replace-global-vars-20251121010036 → 14.0.0-test-private-templates-20260103062459
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 +111 -76
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.d.ts +1 -0
- package/lib/cli/init/git.js +88 -16
- package/lib/cli/init/git.js.map +3 -3
- package/lib/cli/init/index.js +98 -67
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.d.ts +6 -5
- package/lib/cli/init/prompts.js +54 -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 +1 -1
- package/lib/cli/lint/internalLints/upgrade/index.js +53 -22
- 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 +44 -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.d.ts +1 -1
- package/lib/utils/template.js +60 -19
- 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 +8 -9
- 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 +9 -11
- 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 -19
- 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/addTypeModuleToPackageJson.d.ts +0 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js +0 -86
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +0 -16
- 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 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +0 -76
- 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
|
@@ -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 = 91;
|
|
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-test-private-templates-20260103062459",
|
|
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-test-private-templates-20260103062459"
|
|
46
46
|
},
|
|
47
|
-
"packageManager": "pnpm@10.
|
|
47
|
+
"packageManager": "pnpm@10.26.2",
|
|
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,6 +0,0 @@
|
|
|
1
|
-
import type { PatchFunction } from '../../index.js';
|
|
2
|
-
export declare const hasDirNameRegex: RegExp;
|
|
3
|
-
export declare const hasFileNameRegex: RegExp;
|
|
4
|
-
export declare const addTypeModule: (cwd: string, originalContent: string) => Promise<string>;
|
|
5
|
-
export declare const tryAddTypeModuleToPackageJson: PatchFunction;
|
|
6
|
-
export declare const addTypeModuleToPackageJson: PatchFunction;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { inspect } from "util";
|
|
2
|
-
import { glob } from "fast-glob";
|
|
3
|
-
import fs from "fs-extra";
|
|
4
|
-
import { readPackageUp } from "read-package-up";
|
|
5
|
-
import { log } from "../../../../../../utils/logging.js";
|
|
6
|
-
import { formatPackage } from "../../../../../configure/processing/package.js";
|
|
7
|
-
const hasDirNameRegex = /__dirname\b/;
|
|
8
|
-
const hasFileNameRegex = /__filename\b/;
|
|
9
|
-
const addTypeModule = async (cwd, originalContent) => {
|
|
10
|
-
const manifest = await readPackageUp({ cwd, normalize: false });
|
|
11
|
-
if (manifest === void 0) {
|
|
12
|
-
return originalContent;
|
|
13
|
-
}
|
|
14
|
-
if (manifest.packageJson.type !== "module") {
|
|
15
|
-
manifest.packageJson.type = "module";
|
|
16
|
-
return await formatPackage(manifest.packageJson);
|
|
17
|
-
}
|
|
18
|
-
return originalContent;
|
|
19
|
-
};
|
|
20
|
-
const fetchFiles = async (files) => Promise.all(
|
|
21
|
-
files.map(async (file) => {
|
|
22
|
-
const contents = await fs.promises.readFile(file, "utf8");
|
|
23
|
-
return {
|
|
24
|
-
file,
|
|
25
|
-
contents
|
|
26
|
-
};
|
|
27
|
-
})
|
|
28
|
-
);
|
|
29
|
-
const tryAddTypeModuleToPackageJson = async ({
|
|
30
|
-
mode
|
|
31
|
-
}) => {
|
|
32
|
-
const fileNames = await glob(["**/*package.json"]);
|
|
33
|
-
if (!fileNames.length) {
|
|
34
|
-
return {
|
|
35
|
-
result: "skip",
|
|
36
|
-
reason: "no package.json file found"
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const packageJsonFiles = await fetchFiles(fileNames);
|
|
40
|
-
const filesWithTypeModuleAdded = await Promise.all(
|
|
41
|
-
packageJsonFiles.map(async ({ file, contents }) => ({
|
|
42
|
-
file,
|
|
43
|
-
before: contents,
|
|
44
|
-
after: await addTypeModule(file, contents)
|
|
45
|
-
}))
|
|
46
|
-
);
|
|
47
|
-
const hasChanges = filesWithTypeModuleAdded.some(
|
|
48
|
-
({ before, after }) => before !== after
|
|
49
|
-
);
|
|
50
|
-
if (!hasChanges) {
|
|
51
|
-
return {
|
|
52
|
-
result: "skip",
|
|
53
|
-
reason: "type module already present in package.json"
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (mode === "lint") {
|
|
57
|
-
return {
|
|
58
|
-
result: "apply"
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
await Promise.all(
|
|
62
|
-
filesWithTypeModuleAdded.map(async ({ file, before, after }) => {
|
|
63
|
-
if (before !== after) {
|
|
64
|
-
await fs.promises.writeFile(file, after);
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
return { result: "apply" };
|
|
69
|
-
};
|
|
70
|
-
const addTypeModuleToPackageJson = async (config) => {
|
|
71
|
-
try {
|
|
72
|
-
return await tryAddTypeModuleToPackageJson(config);
|
|
73
|
-
} catch (err) {
|
|
74
|
-
log.warn("Failed to add module type to package.json");
|
|
75
|
-
log.subtle(inspect(err));
|
|
76
|
-
return { result: "skip", reason: "due to an error" };
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
export {
|
|
80
|
-
addTypeModule,
|
|
81
|
-
addTypeModuleToPackageJson,
|
|
82
|
-
hasDirNameRegex,
|
|
83
|
-
hasFileNameRegex,
|
|
84
|
-
tryAddTypeModuleToPackageJson
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=addTypeModuleToPackageJson.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.ts"],
|
|
4
|
-
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\nimport { readPackageUp } from 'read-package-up';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport { formatPackage } from '../../../../../configure/processing/package.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nexport const hasDirNameRegex = /__dirname\\b/;\nexport const hasFileNameRegex = /__filename\\b/;\n\nexport const addTypeModule = async (cwd: string, originalContent: string) => {\n const manifest = await readPackageUp({ cwd, normalize: false });\n\n if (manifest === undefined) {\n return originalContent;\n }\n\n if (manifest.packageJson.type !== 'module') {\n manifest.packageJson.type = 'module';\n return await formatPackage(manifest.packageJson);\n }\n\n return originalContent;\n};\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nexport const tryAddTypeModuleToPackageJson: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const fileNames = await glob(['**/*package.json']);\n\n if (!fileNames.length) {\n return {\n result: 'skip',\n reason: 'no package.json file found',\n };\n }\n\n const packageJsonFiles = await fetchFiles(fileNames);\n\n const filesWithTypeModuleAdded = await Promise.all(\n packageJsonFiles.map(async ({ file, contents }) => ({\n file,\n before: contents,\n after: await addTypeModule(file, contents),\n })),\n );\n\n const hasChanges = filesWithTypeModuleAdded.some(\n ({ before, after }) => before !== after,\n );\n\n if (!hasChanges) {\n return {\n result: 'skip',\n reason: 'type module already present in package.json',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n filesWithTypeModuleAdded.map(async ({ file, before, after }) => {\n if (before !== after) {\n await fs.promises.writeFile(file, after);\n }\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const addTypeModuleToPackageJson: PatchFunction = async (config) => {\n try {\n return await tryAddTypeModuleToPackageJson(config);\n } catch (err) {\n log.warn('Failed to add module type to package.json');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAe;AAExB,SAAS,YAAY;AACrB,OAAO,QAAQ;AACf,SAAS,qBAAqB;AAE9B,SAAS,WAAW;AACpB,SAAS,qBAAqB;AAGvB,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAEzB,MAAM,gBAAgB,OAAO,KAAa,oBAA4B;AAC3E,QAAM,WAAW,MAAM,cAAc,EAAE,KAAK,WAAW,MAAM,CAAC;AAE9D,MAAI,aAAa,QAAW;AAC1B,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,YAAY,SAAS,UAAU;AAC1C,aAAS,YAAY,OAAO;AAC5B,WAAO,MAAM,cAAc,SAAS,WAAW;AAAA,EACjD;AAEA,SAAO;AACT;AAEA,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,GAAG,SAAS,SAAS,MAAM,MAAM;AAExD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEK,MAAM,gCAA+C,OAAO;AAAA,EACjE;AACF,MAAgC;AAC9B,QAAM,YAAY,MAAM,KAAK,CAAC,kBAAkB,CAAC;AAEjD,MAAI,CAAC,UAAU,QAAQ;AACrB,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,mBAAmB,MAAM,WAAW,SAAS;AAEnD,QAAM,2BAA2B,MAAM,QAAQ;AAAA,IAC7C,iBAAiB,IAAI,OAAO,EAAE,MAAM,SAAS,OAAO;AAAA,MAClD;AAAA,MACA,QAAQ;AAAA,MACR,OAAO,MAAM,cAAc,MAAM,QAAQ;AAAA,IAC3C,EAAE;AAAA,EACJ;AAEA,QAAM,aAAa,yBAAyB;AAAA,IAC1C,CAAC,EAAE,QAAQ,MAAM,MAAM,WAAW;AAAA,EACpC;AAEA,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,yBAAyB,IAAI,OAAO,EAAE,MAAM,QAAQ,MAAM,MAAM;AAC9D,UAAI,WAAW,OAAO;AACpB,cAAM,GAAG,SAAS,UAAU,MAAM,KAAK;AAAA,MACzC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,6BAA4C,OAAO,WAAW;AACzE,MAAI;AACF,WAAO,MAAM,8BAA8B,MAAM;AAAA,EACnD,SAAS,KAAK;AACZ,QAAI,KAAK,2CAA2C;AACpD,QAAI,OAAO,QAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { addTypeModuleToPackageJson } from "./addTypeModuleToPackageJson.js";
|
|
2
|
-
import { rewriteGlobalVars } from "./rewriteGlobalVars.js";
|
|
3
|
-
const patches = [
|
|
4
|
-
{
|
|
5
|
-
apply: addTypeModuleToPackageJson,
|
|
6
|
-
description: "Add module type to package.json to support ESM"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
apply: rewriteGlobalVars,
|
|
10
|
-
description: "Replace __dirname and __filename with import.meta equivalents"
|
|
11
|
-
}
|
|
12
|
-
];
|
|
13
|
-
export {
|
|
14
|
-
patches
|
|
15
|
-
};
|
|
16
|
-
//# 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 { addTypeModuleToPackageJson } from './addTypeModuleToPackageJson.js';\nimport { rewriteGlobalVars } from './rewriteGlobalVars.js';\n\nexport const patches: Patches = [\n {\n apply: addTypeModuleToPackageJson,\n description: 'Add module type to package.json to support ESM',\n },\n {\n apply: rewriteGlobalVars,\n description:\n 'Replace __dirname and __filename with import.meta equivalents',\n },\n];\n"],
|
|
5
|
-
"mappings": "AAEA,SAAS,kCAAkC;AAC3C,SAAS,yBAAyB;AAE3B,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PatchFunction } from '../../index.js';
|
|
2
|
-
export declare const hasDirNameRegex: RegExp;
|
|
3
|
-
export declare const hasDirNameVariableRegex: RegExp;
|
|
4
|
-
export declare const hasFileNameRegex: RegExp;
|
|
5
|
-
export declare const hasFileNameVariableRegex: RegExp;
|
|
6
|
-
export declare const tryRewriteGlobalVars: PatchFunction;
|
|
7
|
-
export declare const rewriteGlobalVars: PatchFunction;
|