skuba 13.0.2 → 14.0.0-esmify-skuba-20251031135439
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/eslint.js +1 -1
- package/config/prettier.js +10 -2
- package/lib/cli/adapter/eslint.js +10 -46
- package/lib/cli/adapter/eslint.js.map +2 -2
- package/lib/cli/adapter/prettier.js +40 -72
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +7 -43
- package/lib/cli/build/args.js.map +2 -2
- package/lib/cli/build/assets.js +27 -62
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.js +20 -55
- package/lib/cli/build/esbuild.js.map +3 -3
- package/lib/cli/build/index.js +20 -56
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/build/tsc.js +24 -66
- package/lib/cli/build/tsc.js.map +2 -2
- package/lib/cli/buildPackage/index.js +7 -33
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +15 -51
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/analyseDependencies.js +24 -60
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +4 -40
- package/lib/cli/configure/analysis/diff.js.map +2 -2
- package/lib/cli/configure/analysis/files.js +7 -43
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +11 -47
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/configure/analysis/package.js +10 -48
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +18 -53
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +5 -39
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +3 -29
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +3 -29
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +3 -29
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +1 -27
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +4 -32
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +31 -61
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.js +13 -49
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/getProjectType.js +13 -36
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +49 -85
- package/lib/cli/configure/index.js.map +3 -3
- package/lib/cli/configure/modules/eslint.js +9 -35
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +7 -33
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +17 -45
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/nodemon.js +2 -28
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +9 -35
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +10 -36
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +17 -43
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +1 -27
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +2 -28
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +4 -44
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +1 -27
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +2 -30
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +6 -34
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +1 -27
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +2 -28
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.js +10 -52
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +3 -39
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +4 -44
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +28 -70
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/types.js +0 -15
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +19 -55
- package/lib/cli/format/index.js.map +2 -2
- package/lib/cli/help/index.js +5 -31
- package/lib/cli/help/index.js.map +1 -1
- package/lib/cli/init/getConfig.js +75 -107
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.js +16 -54
- package/lib/cli/init/git.js.map +3 -3
- package/lib/cli/init/index.js +66 -99
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.js +20 -56
- package/lib/cli/init/prompts.js.map +3 -3
- package/lib/cli/init/types.js +6 -42
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +5 -39
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +7 -43
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +2 -38
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +10 -46
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +2 -38
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +2 -38
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +2 -38
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +1 -27
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +10 -46
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +1 -27
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +1 -27
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +3 -29
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +5 -31
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +38 -78
- package/lib/cli/lint/autofix.js.map +3 -3
- package/lib/cli/lint/eslint.js +14 -52
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +18 -53
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +24 -50
- package/lib/cli/lint/index.js.map +1 -1
- package/lib/cli/lint/internal.js +17 -53
- package/lib/cli/lint/internal.js.map +2 -2
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +8 -36
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +10 -46
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +20 -56
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +33 -68
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +21 -54
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +3 -29
- 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 +10 -46
- 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 +5 -31
- 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 +36 -73
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +11 -49
- 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 +3 -29
- 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 +24 -64
- 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 +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +11 -49
- 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 +5 -31
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +11 -49
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +11 -49
- 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 +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +11 -49
- 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 +32 -76
- 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 +9 -35
- 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 +10 -46
- 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.js +28 -88
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +19 -58
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +16 -52
- 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 +9 -35
- 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 +9 -45
- 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 +11 -47
- 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 +3 -29
- 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 +14 -50
- 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 +10 -46
- 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 +9 -40
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +10 -46
- 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 +10 -46
- 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 +12 -48
- 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 +3 -29
- 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 +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +7 -33
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +1 -1
- package/lib/cli/lint/prettier.js +13 -51
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +3 -29
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +0 -15
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.js +9 -35
- package/lib/cli/migrate/index.js.map +1 -1
- package/lib/cli/migrate/nodeVersion/checks.js +26 -68
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.js +24 -56
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/node/index.js +20 -60
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +3 -29
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +15 -51
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +3 -45
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/version/index.js +5 -31
- package/lib/cli/version/index.js.map +1 -1
- package/lib/config/prettier.d.ts +7 -0
- package/lib/index.js +4 -49
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +26 -44
- package/lib/skuba.js.map +3 -3
- package/lib/{cli → src/cli}/configure/analyseDependencies.d.ts +1 -1
- package/lib/{cli → src/cli}/configure/analysis/package.d.ts +2 -3
- package/lib/{cli → src/cli}/configure/ensureTemplateCompletion.d.ts +1 -1
- package/lib/{cli → src/cli}/configure/getEntryPoint.d.ts +1 -1
- package/lib/{cli → src/cli}/configure/getProjectType.d.ts +1 -1
- package/lib/src/cli/configure/processing/package.d.ts +5 -0
- package/lib/{cli → src/cli}/configure/types.d.ts +15 -4
- package/lib/{cli → src/cli}/init/getConfig.d.ts +1 -1
- package/lib/{cli → src/cli}/init/prompts.d.ts +4 -4
- package/lib/{cli → src/cli}/lint/internalLints/upgrade/index.d.ts +1 -1
- package/lib/{index.d.ts → src/index.d.ts} +0 -1
- package/lib/src/utils/fs.d.ts +1 -0
- package/lib/{utils → src/utils}/manifest.d.ts +3 -2
- package/lib/src/utils/sleep.d.ts +5 -0
- package/lib/{utils → src/utils}/wait.d.ts +0 -4
- package/lib/{wrapper → src/wrapper}/http.d.ts +0 -6
- package/lib/src/wrapper/server.d.ts +7 -0
- package/lib/utils/args.js +8 -50
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +6 -50
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +22 -64
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +37 -84
- package/lib/utils/dir.js.map +3 -3
- package/lib/utils/env.js +1 -27
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +11 -53
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.js +26 -70
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +15 -0
- package/lib/utils/fs.js.map +7 -0
- package/lib/utils/help.js +5 -31
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/logging.js +13 -55
- package/lib/utils/logging.js.map +2 -2
- package/lib/utils/logo.js +23 -59
- package/lib/utils/logo.js.map +2 -2
- package/lib/utils/manifest.js +12 -60
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +1 -27
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +14 -56
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +4 -42
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +9 -0
- package/lib/utils/sleep.js.map +7 -0
- package/lib/utils/template.js +21 -68
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +6 -42
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +11 -53
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +6 -42
- package/lib/utils/wait.js.map +2 -2
- package/lib/utils/worker.js +9 -37
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/functionHandler.js +17 -50
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.js +7 -53
- package/lib/wrapper/http.js.map +3 -3
- package/lib/wrapper/index.js +6 -6
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +7 -43
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +12 -47
- package/lib/wrapper/requestListener.js.map +3 -3
- package/lib/wrapper/server.js +9 -0
- package/lib/wrapper/server.js.map +7 -0
- package/package.json +19 -24
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +3 -2
- package/template/base/vitest.config.ts +25 -0
- package/template/express-rest-api/.gantry/dev.yml +2 -2
- package/template/express-rest-api/.gantry/prod.yml +2 -2
- package/template/express-rest-api/package.json +6 -5
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +1 -0
- package/template/greeter/package.json +4 -3
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +3 -1
- package/template/koa-rest-api/.gantry/dev.yml +2 -2
- package/template/koa-rest-api/.gantry/prod.yml +2 -2
- package/template/koa-rest-api/package.json +6 -5
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -0
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +2 -0
- package/template/koa-rest-api/src/app.test.ts +2 -0
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +2 -0
- package/template/koa-rest-api/src/testing/metrics.ts +2 -0
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +15 -3
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +11 -9
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +6 -5
- package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +22 -13
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +1 -0
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +33 -31
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +8 -2
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -2
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +4 -3
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/_package.json +1 -0
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +2 -0
- package/template/private-npm-package/_package.json +1 -0
- package/template/private-npm-package/skuba.template.js +1 -1
- package/template/private-npm-package/src/index.test.ts +2 -0
- package/config/jest.js +0 -1
- package/config/prettier.d.ts +0 -4
- package/jest/moduleNameMapper.js +0 -64
- package/jest/transform.js +0 -62
- package/jest/tsConfig.js +0 -26
- package/jest-preset.js +0 -37
- package/lib/api/jest/index.d.ts +0 -15
- package/lib/api/jest/index.js +0 -59
- package/lib/api/jest/index.js.map +0 -7
- package/lib/cli/configure/modules/jest.d.ts +0 -2
- package/lib/cli/configure/modules/jest.js +0 -86
- package/lib/cli/configure/modules/jest.js.map +0 -7
- package/lib/cli/configure/processing/package.d.ts +0 -71
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
- package/lib/cli/test/reporters/github/annotations.d.ts +0 -9
- package/lib/cli/test/reporters/github/annotations.js +0 -102
- package/lib/cli/test/reporters/github/annotations.js.map +0 -7
- package/lib/cli/test/reporters/github/index.d.ts +0 -5
- package/lib/cli/test/reporters/github/index.js +0 -74
- package/lib/cli/test/reporters/github/index.js.map +0 -7
- package/template/base/jest.config.ts +0 -19
- package/template/base/jest.setup.ts +0 -3
- /package/lib/{cli → src/cli}/adapter/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/adapter/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/args.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/assets.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/esbuild.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/buildPackage/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analyseConfiguration.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/diff.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/files.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/git.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/project.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/seekDatadogCustomMetrics.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/seekKoala.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/skuba.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/skubaDeps.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/skubaDive.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/ignore.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/nodemon.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/package.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/renovate.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/serverless.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/tslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/configFile.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/deleteFiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/javascript.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/json.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/loadFiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/module.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/record.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/typescript.d.ts +0 -0
- /package/lib/{cli → src/cli}/format/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/help/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/git.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/types.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/validation.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/writePackageJson.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/internal.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/internal.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/autofix.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/external.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internal.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/detectBadCodeowners.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/noSkubaTemplateJs.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/patchRenovateConfig.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/refreshConfigFiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.0.2/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.1.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.3.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.0.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/types.d.ts +0 -0
- /package/lib/{cli → src/cli}/migrate/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/migrate/nodeVersion/checks.d.ts +0 -0
- /package/lib/{cli → src/cli}/migrate/nodeVersion/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/node/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/release/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/start/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/test/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/version/index.d.ts +0 -0
- /package/lib/{skuba.d.ts → src/skuba.d.ts} +0 -0
- /package/lib/{utils → src/utils}/args.d.ts +0 -0
- /package/lib/{utils → src/utils}/command.d.ts +0 -0
- /package/lib/{utils → src/utils}/copy.d.ts +0 -0
- /package/lib/{utils → src/utils}/dir.d.ts +0 -0
- /package/lib/{utils → src/utils}/env.d.ts +0 -0
- /package/lib/{utils → src/utils}/error.d.ts +0 -0
- /package/lib/{utils → src/utils}/exec.d.ts +0 -0
- /package/lib/{utils → src/utils}/help.d.ts +0 -0
- /package/lib/{utils → src/utils}/logging.d.ts +0 -0
- /package/lib/{utils → src/utils}/logo.d.ts +0 -0
- /package/lib/{utils → src/utils}/npmrc.d.ts +0 -0
- /package/lib/{utils → src/utils}/packageManager.d.ts +0 -0
- /package/lib/{utils → src/utils}/port.d.ts +0 -0
- /package/lib/{utils → src/utils}/template.d.ts +0 -0
- /package/lib/{utils → src/utils}/validation.d.ts +0 -0
- /package/lib/{utils → src/utils}/version.d.ts +0 -0
- /package/lib/{utils → src/utils}/worker.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/functionHandler.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/index.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/main.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/requestListener.d.ts +0 -0
|
@@ -1,50 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __exports = {};
|
|
20
|
-
__export(__exports, {
|
|
21
|
-
patches: () => patches
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(__exports);
|
|
24
|
-
var import_patchRenovateConfig = require("../../../patchRenovateConfig.js");
|
|
25
|
-
var import_addEmptyExports = require("./addEmptyExports.js");
|
|
26
|
-
var import_patchDockerfile = require("./patchDockerfile.js");
|
|
27
|
-
var import_patchServerListener = require("./patchServerListener.js");
|
|
28
|
-
const patches = [
|
|
2
|
+
import { tryPatchRenovateConfig } from "../../../patchRenovateConfig.js";
|
|
3
|
+
import { tryAddEmptyExports } from "./addEmptyExports.js";
|
|
4
|
+
import { tryPatchDockerfile } from "./patchDockerfile.js";
|
|
5
|
+
import { tryPatchServerListener } from "./patchServerListener.js";
|
|
6
|
+
export const patches = [
|
|
29
7
|
{
|
|
30
|
-
apply:
|
|
8
|
+
apply: tryAddEmptyExports,
|
|
31
9
|
description: "Add empty exports to Jest files for compliance with TypeScript isolated modules"
|
|
32
10
|
},
|
|
33
11
|
{
|
|
34
|
-
apply:
|
|
12
|
+
apply: tryPatchRenovateConfig,
|
|
35
13
|
description: "Update Renovate config to support private SEEK packages"
|
|
36
14
|
},
|
|
37
15
|
{
|
|
38
|
-
apply:
|
|
16
|
+
apply: tryPatchDockerfile,
|
|
39
17
|
description: "Upgrade Node.js Distroless Docker image to -debian12 variant"
|
|
40
18
|
},
|
|
41
19
|
{
|
|
42
|
-
apply:
|
|
20
|
+
apply: tryPatchServerListener,
|
|
43
21
|
description: "Add keepAliveTimeout to server listener"
|
|
44
22
|
}
|
|
45
23
|
];
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
patches
|
|
49
|
-
});
|
|
50
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/7.3.1/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { tryPatchRenovateConfig } from '../../../patchRenovateConfig.js';\nimport type { Patches } from '../../index.js';\n\nimport { tryAddEmptyExports } from './addEmptyExports.js';\nimport { tryPatchDockerfile } from './patchDockerfile.js';\nimport { tryPatchServerListener } from './patchServerListener.js';\n\nexport const patches: Patches = [\n {\n apply: tryAddEmptyExports,\n description:\n 'Add empty exports to Jest files for compliance with TypeScript isolated modules',\n },\n {\n apply: tryPatchRenovateConfig,\n description: 'Update Renovate config to support private SEEK packages',\n },\n {\n apply: tryPatchDockerfile,\n description: 'Upgrade Node.js Distroless Docker image to -debian12 variant',\n },\n {\n apply: tryPatchServerListener,\n description: 'Add keepAliveTimeout to server listener',\n },\n];\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA,SAAS,8BAA8B;AAGvC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEhC,aAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,46 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var patchDockerfile_exports = {};
|
|
30
|
-
__export(patchDockerfile_exports, {
|
|
31
|
-
tryPatchDockerfile: () => tryPatchDockerfile
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(patchDockerfile_exports);
|
|
34
|
-
var import_util = require("util");
|
|
35
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
-
var import_logging = require("../../../../../../utils/logging.js");
|
|
37
|
-
var import_project = require("../../../../../configure/analysis/project.js");
|
|
2
|
+
import { inspect } from "util";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
5
|
+
import { createDestinationFileReader } from "../../../../../configure/analysis/project.js";
|
|
38
6
|
const DOCKERFILE_FILENAME = "Dockerfile";
|
|
39
7
|
const NON_DEBIAN_REGEX = /gcr.io\/distroless\/nodejs:(18|20)/g;
|
|
40
8
|
const DEBIAN_REGEX = /gcr.io\/distroless\/nodejs(18|20)-debian11/g;
|
|
41
9
|
const VERSION_DEBIAN_REPLACE = "gcr.io/distroless/nodejs$1-debian12";
|
|
42
10
|
const patchDockerfile = async (mode, dir) => {
|
|
43
|
-
const readFile =
|
|
11
|
+
const readFile = createDestinationFileReader(dir);
|
|
44
12
|
const maybeDockerfile = await readFile(DOCKERFILE_FILENAME);
|
|
45
13
|
if (!maybeDockerfile) {
|
|
46
14
|
return { result: "skip", reason: "no Dockerfile found" };
|
|
@@ -52,23 +20,19 @@ const patchDockerfile = async (mode, dir) => {
|
|
|
52
20
|
if (mode === "lint") {
|
|
53
21
|
return { result: "apply" };
|
|
54
22
|
}
|
|
55
|
-
await
|
|
23
|
+
await fs.promises.writeFile(DOCKERFILE_FILENAME, patched);
|
|
56
24
|
return { result: "apply" };
|
|
57
25
|
};
|
|
58
|
-
const tryPatchDockerfile = async ({
|
|
26
|
+
export const tryPatchDockerfile = async ({
|
|
59
27
|
mode,
|
|
60
28
|
dir = process.cwd()
|
|
61
29
|
}) => {
|
|
62
30
|
try {
|
|
63
31
|
return await patchDockerfile(mode, dir);
|
|
64
32
|
} catch (err) {
|
|
65
|
-
|
|
66
|
-
|
|
33
|
+
log.warn("Failed to patch Dockerfile.");
|
|
34
|
+
log.subtle(inspect(err));
|
|
67
35
|
return { result: "skip", reason: "due to an error" };
|
|
68
36
|
}
|
|
69
37
|
};
|
|
70
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
-
0 && (module.exports = {
|
|
72
|
-
tryPatchDockerfile
|
|
73
|
-
});
|
|
74
38
|
//# sourceMappingURL=patchDockerfile.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../../../../configure/analysis/project.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst DOCKERFILE_FILENAME = 'Dockerfile';\n\nconst NON_DEBIAN_REGEX = /gcr.io\\/distroless\\/nodejs:(18|20)/g;\nconst DEBIAN_REGEX = /gcr.io\\/distroless\\/nodejs(18|20)-debian11/g;\nconst VERSION_DEBIAN_REPLACE = 'gcr.io/distroless/nodejs$1-debian12';\n\nconst patchDockerfile = async (\n mode: 'format' | 'lint',\n dir: string,\n): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(dir);\n\n const maybeDockerfile = await readFile(DOCKERFILE_FILENAME);\n\n if (!maybeDockerfile) {\n return { result: 'skip', reason: 'no Dockerfile found' };\n }\n\n const patched = maybeDockerfile\n .replaceAll(NON_DEBIAN_REGEX, VERSION_DEBIAN_REPLACE)\n .replaceAll(DEBIAN_REGEX, VERSION_DEBIAN_REPLACE);\n\n if (patched === maybeDockerfile) {\n return { result: 'skip' };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n await fs.promises.writeFile(DOCKERFILE_FILENAME, patched);\n\n return { result: 'apply' };\n};\n\nexport const tryPatchDockerfile: PatchFunction = async ({\n mode,\n dir = process.cwd(),\n}) => {\n try {\n return await patchDockerfile(mode, dir);\n } catch (err) {\n log.warn('Failed to patch Dockerfile.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAExB,OAAO,QAAQ;AAEf,SAAS,WAAW;AACpB,SAAS,mCAAmC;AAG5C,MAAM,sBAAsB;AAE5B,MAAM,mBAAmB;AACzB,MAAM,eAAe;AACrB,MAAM,yBAAyB;AAE/B,MAAM,kBAAkB,OACtB,MACA,QAC6B;AAC7B,QAAM,WAAW,4BAA4B,GAAG;AAEhD,QAAM,kBAAkB,MAAM,SAAS,mBAAmB;AAE1D,MAAI,CAAC,iBAAiB;AACpB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,sBAAsB;AAAA,EACzD;AAEA,QAAM,UAAU,gBACb,WAAW,kBAAkB,sBAAsB,EACnD,WAAW,cAAc,sBAAsB;AAElD,MAAI,YAAY,iBAAiB;AAC/B,WAAO,EAAE,QAAQ,OAAO;AAAA,EAC1B;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,GAAG,SAAS,UAAU,qBAAqB,OAAO;AAExD,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,aAAM,qBAAoC,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,IAAI;AACpB,MAAM;AACJ,MAAI;AACF,WAAO,MAAM,gBAAgB,MAAM,GAAG;AAAA,EACxC,SAAS,KAAK;AACZ,QAAI,KAAK,6BAA6B;AACtC,QAAI,OAAO,QAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,41 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var patchServerListener_exports = {};
|
|
30
|
-
__export(patchServerListener_exports, {
|
|
31
|
-
tryPatchServerListener: () => tryPatchServerListener
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(patchServerListener_exports);
|
|
34
|
-
var import_util = require("util");
|
|
35
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
-
var import_logging = require("../../../../../../utils/logging.js");
|
|
37
|
-
var import_project = require("../../../../../configure/analysis/project.js");
|
|
38
|
-
var import_prettier = require("../../../../../configure/processing/prettier.js");
|
|
2
|
+
import { inspect } from "util";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
5
|
+
import { createDestinationFileReader } from "../../../../../configure/analysis/project.js";
|
|
6
|
+
import { formatPrettier } from "../../../../../configure/processing/prettier.js";
|
|
39
7
|
const SERVER_LISTENER_FILENAME = "src/listen.ts";
|
|
40
8
|
const KEEP_ALIVE_CODE = `
|
|
41
9
|
// Gantry ALB default idle timeout is 30 seconds
|
|
@@ -46,7 +14,7 @@ const KEEP_ALIVE_CODE = `
|
|
|
46
14
|
listener.keepAliveTimeout = 31000;
|
|
47
15
|
`;
|
|
48
16
|
const patchServerListener = async (mode, dir) => {
|
|
49
|
-
const readFile =
|
|
17
|
+
const readFile = createDestinationFileReader(dir);
|
|
50
18
|
let listener = await readFile(SERVER_LISTENER_FILENAME);
|
|
51
19
|
if (!listener) {
|
|
52
20
|
return { result: "skip", reason: "no listener file found" };
|
|
@@ -67,28 +35,24 @@ const patchServerListener = async (mode, dir) => {
|
|
|
67
35
|
return { result: "apply" };
|
|
68
36
|
}
|
|
69
37
|
listener = `${listener}${KEEP_ALIVE_CODE}`;
|
|
70
|
-
await
|
|
38
|
+
await fs.promises.writeFile(
|
|
71
39
|
SERVER_LISTENER_FILENAME,
|
|
72
|
-
await
|
|
40
|
+
await formatPrettier(listener, {
|
|
73
41
|
parser: "typescript"
|
|
74
42
|
})
|
|
75
43
|
);
|
|
76
44
|
return { result: "apply" };
|
|
77
45
|
};
|
|
78
|
-
const tryPatchServerListener = async ({
|
|
46
|
+
export const tryPatchServerListener = async ({
|
|
79
47
|
mode,
|
|
80
48
|
dir = process.cwd()
|
|
81
49
|
}) => {
|
|
82
50
|
try {
|
|
83
51
|
return await patchServerListener(mode, dir);
|
|
84
52
|
} catch (err) {
|
|
85
|
-
|
|
86
|
-
|
|
53
|
+
log.warn("Failed to patch server listener.");
|
|
54
|
+
log.subtle(inspect(err));
|
|
87
55
|
return { result: "skip", reason: "due to an error" };
|
|
88
56
|
}
|
|
89
57
|
};
|
|
90
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
-
0 && (module.exports = {
|
|
92
|
-
tryPatchServerListener
|
|
93
|
-
});
|
|
94
58
|
//# sourceMappingURL=patchServerListener.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../../../../configure/analysis/project.js';\nimport { formatPrettier } from '../../../../../configure/processing/prettier.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst SERVER_LISTENER_FILENAME = 'src/listen.ts';\n\nconst KEEP_ALIVE_CODE = `\n// Gantry ALB default idle timeout is 30 seconds\n// https://nodejs.org/docs/latest-v20.x/api/http.html#serverkeepalivetimeout\n// Node default is 5 seconds\n// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout\n// AWS recommends setting an application timeout larger than the load balancer\nlistener.keepAliveTimeout = 31000;\n`;\n\nconst patchServerListener = async (\n mode: 'format' | 'lint',\n dir: string,\n): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(dir);\n\n let listener = await readFile(SERVER_LISTENER_FILENAME);\n if (!listener) {\n return { result: 'skip', reason: 'no listener file found' };\n }\n\n if (listener.includes('keepAliveTimeout')) {\n return { result: 'skip', reason: 'keepAliveTimeout already configured' };\n }\n\n if (listener.includes('\\napp.listen(')) {\n listener = listener.replace(\n '\\napp.listen(',\n '\\nconst listener = app.listen(',\n );\n }\n\n if (!listener.includes('\\nconst listener = app.listen(')) {\n return { result: 'skip', reason: 'no server listener found' };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n listener = `${listener}${KEEP_ALIVE_CODE}`;\n\n await fs.promises.writeFile(\n SERVER_LISTENER_FILENAME,\n await formatPrettier(listener, {\n parser: 'typescript',\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const tryPatchServerListener: PatchFunction = async ({\n mode,\n dir = process.cwd(),\n}) => {\n try {\n return await patchServerListener(mode, dir);\n } catch (err) {\n log.warn('Failed to patch server listener.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAExB,OAAO,QAAQ;AAEf,SAAS,WAAW;AACpB,SAAS,mCAAmC;AAC5C,SAAS,sBAAsB;AAG/B,MAAM,2BAA2B;AAEjC,MAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASxB,MAAM,sBAAsB,OAC1B,MACA,QAC6B;AAC7B,QAAM,WAAW,4BAA4B,GAAG;AAEhD,MAAI,WAAW,MAAM,SAAS,wBAAwB;AACtD,MAAI,CAAC,UAAU;AACb,WAAO,EAAE,QAAQ,QAAQ,QAAQ,yBAAyB;AAAA,EAC5D;AAEA,MAAI,SAAS,SAAS,kBAAkB,GAAG;AACzC,WAAO,EAAE,QAAQ,QAAQ,QAAQ,sCAAsC;AAAA,EACzE;AAEA,MAAI,SAAS,SAAS,eAAe,GAAG;AACtC,eAAW,SAAS;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,SAAS,SAAS,gCAAgC,GAAG;AACxD,WAAO,EAAE,QAAQ,QAAQ,QAAQ,2BAA2B;AAAA,EAC9D;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,aAAW,GAAG,QAAQ,GAAG,eAAe;AAExC,QAAM,GAAG,SAAS;AAAA,IAChB;AAAA,IACA,MAAM,eAAe,UAAU;AAAA,MAC7B,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,aAAM,yBAAwC,OAAO;AAAA,EAC1D;AAAA,EACA,MAAM,QAAQ,IAAI;AACpB,MAAM;AACJ,MAAI;AACF,WAAO,MAAM,oBAAoB,MAAM,GAAG;AAAA,EAC5C,SAAS,KAAK;AACZ,QAAI,KAAK,kCAAkC;AAC3C,QAAI,OAAO,QAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,35 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __exports = {};
|
|
20
|
-
__export(__exports, {
|
|
21
|
-
patches: () => patches
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(__exports);
|
|
24
|
-
var import_patchPnpmPackageManager = require("./patchPnpmPackageManager.js");
|
|
25
|
-
const patches = [
|
|
2
|
+
import { tryPatchPnpmPackageManager } from "./patchPnpmPackageManager.js";
|
|
3
|
+
export const patches = [
|
|
26
4
|
{
|
|
27
|
-
apply:
|
|
5
|
+
apply: tryPatchPnpmPackageManager,
|
|
28
6
|
description: "Ensure the pnpm package manager version specified in package.json is used in Dockerfiles"
|
|
29
7
|
}
|
|
30
8
|
];
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
patches
|
|
34
|
-
});
|
|
35
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.0.0/index.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryPatchPnpmPackageManager } from './patchPnpmPackageManager.js';\n\nexport const patches: Patches = [\n {\n apply: tryPatchPnpmPackageManager,\n description:\n 'Ensure the pnpm package manager version specified in package.json is used in Dockerfiles',\n },\n];\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAEA,SAAS,kCAAkC;AAEpC,aAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,41 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var patchPnpmPackageManager_exports = {};
|
|
30
|
-
__export(patchPnpmPackageManager_exports, {
|
|
31
|
-
tryPatchPnpmPackageManager: () => tryPatchPnpmPackageManager
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(patchPnpmPackageManager_exports);
|
|
34
|
-
var import_util = require("util");
|
|
35
|
-
var import_fast_glob = __toESM(require("fast-glob"));
|
|
36
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
37
|
-
var import_semver = require("semver");
|
|
38
|
-
var import_logging = require("../../../../../../utils/logging.js");
|
|
2
|
+
import { inspect } from "util";
|
|
3
|
+
import fg from "fast-glob";
|
|
4
|
+
import fs from "fs-extra";
|
|
5
|
+
import { lt } from "semver";
|
|
6
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
39
7
|
const DOCKERFILE_COREPACK_COMMAND = "RUN corepack enable pnpm";
|
|
40
8
|
const PACKAGE_JSON_MOUNT = `RUN --mount=type=bind,source=package.json,target=package.json \\
|
|
41
9
|
corepack enable pnpm && corepack install`;
|
|
@@ -44,7 +12,7 @@ const BEFORE_PIPELINE_REGEX = /(\s*cache-on:\s*\n\s*-\s*\.npmrc\s*\n)((\s*)-\s*p
|
|
|
44
12
|
const ECR_REGEX = /seek-oss\/docker-ecr-cache#v([\d\.]+)/gm;
|
|
45
13
|
const fetchFiles = async (files) => Promise.all(
|
|
46
14
|
files.map(async (file) => {
|
|
47
|
-
const contents = await
|
|
15
|
+
const contents = await fs.readFile(file, "utf8");
|
|
48
16
|
return {
|
|
49
17
|
file,
|
|
50
18
|
contents
|
|
@@ -69,8 +37,8 @@ const patchPnpmPackageManager = async ({
|
|
|
69
37
|
};
|
|
70
38
|
}
|
|
71
39
|
const [maybeDockerfiles, maybePipelines] = await Promise.all([
|
|
72
|
-
(
|
|
73
|
-
(
|
|
40
|
+
fg(["Dockerfile*"]),
|
|
41
|
+
fg([".buildkite/*.yml"])
|
|
74
42
|
]);
|
|
75
43
|
if (!maybeDockerfiles.length || !maybePipelines.length) {
|
|
76
44
|
return {
|
|
@@ -104,7 +72,7 @@ const patchPnpmPackageManager = async ({
|
|
|
104
72
|
DOCKERFILE_COREPACK_COMMAND,
|
|
105
73
|
PACKAGE_JSON_MOUNT
|
|
106
74
|
);
|
|
107
|
-
await
|
|
75
|
+
await fs.writeFile(file, patchedContent);
|
|
108
76
|
})
|
|
109
77
|
);
|
|
110
78
|
}
|
|
@@ -119,29 +87,25 @@ $2`
|
|
|
119
87
|
const patchedEcrContent = patchedContent.replace(
|
|
120
88
|
ECR_REGEX,
|
|
121
89
|
(match, version) => {
|
|
122
|
-
if (typeof version === "string" &&
|
|
90
|
+
if (typeof version === "string" && lt(version, "2.2.0")) {
|
|
123
91
|
return "seek-oss/docker-ecr-cache#v2.2.0";
|
|
124
92
|
}
|
|
125
93
|
return match;
|
|
126
94
|
}
|
|
127
95
|
);
|
|
128
|
-
await
|
|
96
|
+
await fs.writeFile(file, patchedEcrContent);
|
|
129
97
|
})
|
|
130
98
|
);
|
|
131
99
|
}
|
|
132
100
|
return { result: "apply" };
|
|
133
101
|
};
|
|
134
|
-
const tryPatchPnpmPackageManager = async (config) => {
|
|
102
|
+
export const tryPatchPnpmPackageManager = async (config) => {
|
|
135
103
|
try {
|
|
136
104
|
return await patchPnpmPackageManager(config);
|
|
137
105
|
} catch (err) {
|
|
138
|
-
|
|
139
|
-
|
|
106
|
+
log.warn("Failed to patch pnpm packageManager CI configuration.");
|
|
107
|
+
log.subtle(inspect(err));
|
|
140
108
|
return { result: "skip", reason: "due to an error" };
|
|
141
109
|
}
|
|
142
110
|
};
|
|
143
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
-
0 && (module.exports = {
|
|
145
|
-
tryPatchPnpmPackageManager
|
|
146
|
-
});
|
|
147
111
|
//# sourceMappingURL=patchPnpmPackageManager.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport fg from 'fast-glob';\nimport fs from 'fs-extra';\nimport { lt } from 'semver';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst DOCKERFILE_COREPACK_COMMAND = 'RUN corepack enable pnpm';\nconst PACKAGE_JSON_MOUNT = `RUN --mount=type=bind,source=package.json,target=package.json \\\\\n corepack enable pnpm && corepack install`;\nconst PACKAGE_JSON_CACHE = '- package.json#.packageManager';\n\nconst BEFORE_PIPELINE_REGEX =\n /(\\s*cache-on:\\s*\\n\\s*-\\s*\\.npmrc\\s*\\n)((\\s*)-\\s*pnpm-lock\\.yaml)/gm;\nconst ECR_REGEX = /seek-oss\\/docker-ecr-cache#v([\\d\\.]+)/gm;\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nconst patchPnpmPackageManager: PatchFunction = async ({\n mode,\n manifest,\n packageManager,\n}): Promise<PatchReturnType> => {\n if (packageManager.command !== 'pnpm') {\n return {\n result: 'skip',\n reason: 'not using pnpm',\n };\n }\n\n if (\n !(\n manifest.packageJson as { packageManager?: string }\n ).packageManager?.includes('pnpm')\n ) {\n return {\n result: 'skip',\n reason: 'no packageManager declaration in package.json found',\n };\n }\n\n const [maybeDockerfiles, maybePipelines] = await Promise.all([\n fg(['Dockerfile*']),\n fg(['.buildkite/*.yml']),\n ]);\n\n if (!maybeDockerfiles.length || !maybePipelines.length) {\n return {\n result: 'skip',\n reason: 'Either dockerfiles or pipelines were not found',\n };\n }\n\n const [dockerfiles, pipelines] = await Promise.all([\n fetchFiles(maybeDockerfiles),\n fetchFiles(maybePipelines),\n ]);\n\n const dockerFilesToPatch = dockerfiles.filter(\n ({ contents }) =>\n contents.includes(DOCKERFILE_COREPACK_COMMAND) &&\n !contents.includes('target=package.json'),\n );\n\n const pipelinesToPatch = pipelines.filter(({ contents }) =>\n Boolean(BEFORE_PIPELINE_REGEX.exec(contents)),\n );\n\n if (!dockerFilesToPatch.length && !pipelinesToPatch.length) {\n return {\n result: 'skip',\n reason: 'no pipeline or dockerfiles to patch',\n };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n if (dockerFilesToPatch.length) {\n await Promise.all(\n dockerFilesToPatch.map(async ({ file, contents }) => {\n const patchedContent = contents.replace(\n DOCKERFILE_COREPACK_COMMAND,\n PACKAGE_JSON_MOUNT,\n );\n await fs.writeFile(file, patchedContent);\n }),\n );\n }\n\n if (pipelinesToPatch.length) {\n await Promise.all(\n pipelinesToPatch.map(async ({ file, contents }) => {\n const patchedContent = contents.replace(\n BEFORE_PIPELINE_REGEX,\n `$1$3${PACKAGE_JSON_CACHE}\\n$2`,\n );\n\n const patchedEcrContent = patchedContent.replace(\n ECR_REGEX,\n (match, version) => {\n if (typeof version === 'string' && lt(version, '2.2.0')) {\n return 'seek-oss/docker-ecr-cache#v2.2.0';\n }\n return match;\n },\n );\n\n await fs.writeFile(file, patchedEcrContent);\n }),\n );\n }\n\n return { result: 'apply' };\n};\n\nexport const tryPatchPnpmPackageManager: PatchFunction = async (config) => {\n try {\n return await patchPnpmPackageManager(config);\n } catch (err) {\n log.warn('Failed to patch pnpm packageManager CI configuration.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAExB,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,SAAS,UAAU;AAEnB,SAAS,WAAW;AAGpB,MAAM,8BAA8B;AACpC,MAAM,qBAAqB;AAAA;AAE3B,MAAM,qBAAqB;AAE3B,MAAM,wBACJ;AACF,MAAM,YAAY;AAElB,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,GAAG,SAAS,MAAM,MAAM;AAE/C,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEF,MAAM,0BAAyC,OAAO;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAgC;AAC9B,MAAI,eAAe,YAAY,QAAQ;AACrC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MACE,CACE,SAAS,YACT,gBAAgB,SAAS,MAAM,GACjC;AACA,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,CAAC,kBAAkB,cAAc,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC3D,GAAG,CAAC,aAAa,CAAC;AAAA,IAClB,GAAG,CAAC,kBAAkB,CAAC;AAAA,EACzB,CAAC;AAED,MAAI,CAAC,iBAAiB,UAAU,CAAC,eAAe,QAAQ;AACtD,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,CAAC,aAAa,SAAS,IAAI,MAAM,QAAQ,IAAI;AAAA,IACjD,WAAW,gBAAgB;AAAA,IAC3B,WAAW,cAAc;AAAA,EAC3B,CAAC;AAED,QAAM,qBAAqB,YAAY;AAAA,IACrC,CAAC,EAAE,SAAS,MACV,SAAS,SAAS,2BAA2B,KAC7C,CAAC,SAAS,SAAS,qBAAqB;AAAA,EAC5C;AAEA,QAAM,mBAAmB,UAAU;AAAA,IAAO,CAAC,EAAE,SAAS,MACpD,QAAQ,sBAAsB,KAAK,QAAQ,CAAC;AAAA,EAC9C;AAEA,MAAI,CAAC,mBAAmB,UAAU,CAAC,iBAAiB,QAAQ;AAC1D,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,MAAI,mBAAmB,QAAQ;AAC7B,UAAM,QAAQ;AAAA,MACZ,mBAAmB,IAAI,OAAO,EAAE,MAAM,SAAS,MAAM;AACnD,cAAM,iBAAiB,SAAS;AAAA,UAC9B;AAAA,UACA;AAAA,QACF;AACA,cAAM,GAAG,UAAU,MAAM,cAAc;AAAA,MACzC,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,iBAAiB,QAAQ;AAC3B,UAAM,QAAQ;AAAA,MACZ,iBAAiB,IAAI,OAAO,EAAE,MAAM,SAAS,MAAM;AACjD,cAAM,iBAAiB,SAAS;AAAA,UAC9B;AAAA,UACA,OAAO,kBAAkB;AAAA;AAAA,QAC3B;AAEA,cAAM,oBAAoB,eAAe;AAAA,UACvC;AAAA,UACA,CAAC,OAAO,YAAY;AAClB,gBAAI,OAAO,YAAY,YAAY,GAAG,SAAS,OAAO,GAAG;AACvD,qBAAO;AAAA,YACT;AACA,mBAAO;AAAA,UACT;AAAA,QACF;AAEA,cAAM,GAAG,UAAU,MAAM,iBAAiB;AAAA,MAC5C,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,aAAM,6BAA4C,OAAO,WAAW;AACzE,MAAI;AACF,WAAO,MAAM,wBAAwB,MAAM;AAAA,EAC7C,SAAS,KAAK;AACZ,QAAI,KAAK,uDAAuD;AAChE,QAAI,OAAO,QAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,44 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var collapseDuplicateMergeKeys_exports = {};
|
|
30
|
-
__export(collapseDuplicateMergeKeys_exports, {
|
|
31
|
-
tryCollapseDuplicateMergeKeys: () => tryCollapseDuplicateMergeKeys
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(collapseDuplicateMergeKeys_exports);
|
|
34
|
-
var import_util = require("util");
|
|
35
|
-
var import_fast_glob = require("fast-glob");
|
|
36
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
37
|
-
var import_logging = require("../../../../../../utils/logging.js");
|
|
2
|
+
import { inspect } from "util";
|
|
3
|
+
import { glob } from "fast-glob";
|
|
4
|
+
import fs from "fs-extra";
|
|
5
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
38
6
|
const collapseDuplicateMergeKeys = async ({
|
|
39
7
|
mode
|
|
40
8
|
}) => {
|
|
41
|
-
const buildkiteFiles = await
|
|
9
|
+
const buildkiteFiles = await glob(
|
|
42
10
|
["{apps/*/,packages/*/,./}.buildkite/**/*.y*ml"],
|
|
43
11
|
{ onlyFiles: true }
|
|
44
12
|
);
|
|
@@ -46,7 +14,7 @@ const collapseDuplicateMergeKeys = async ({
|
|
|
46
14
|
return { result: "skip", reason: "no Buildkite files found" };
|
|
47
15
|
}
|
|
48
16
|
const input = await Promise.all(
|
|
49
|
-
buildkiteFiles.map((name) =>
|
|
17
|
+
buildkiteFiles.map((name) => fs.promises.readFile(name, "utf-8"))
|
|
50
18
|
);
|
|
51
19
|
const replaced = input.map(collapseDuplicateMergeKeysInFile);
|
|
52
20
|
if (replaced.every((r, i) => r === input[i])) {
|
|
@@ -59,7 +27,7 @@ const collapseDuplicateMergeKeys = async ({
|
|
|
59
27
|
buildkiteFiles.flatMap(
|
|
60
28
|
(name, i) => replaced[i] !== input[i] ? (
|
|
61
29
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
62
|
-
[
|
|
30
|
+
[fs.promises.writeFile(name, replaced[i])]
|
|
63
31
|
) : []
|
|
64
32
|
)
|
|
65
33
|
);
|
|
@@ -88,17 +56,13 @@ const replaceAllUntilStable = (input, searchValue, replacer) => {
|
|
|
88
56
|
} while (output !== previousOutput);
|
|
89
57
|
return output;
|
|
90
58
|
};
|
|
91
|
-
const tryCollapseDuplicateMergeKeys = async (config) => {
|
|
59
|
+
export const tryCollapseDuplicateMergeKeys = async (config) => {
|
|
92
60
|
try {
|
|
93
61
|
return await collapseDuplicateMergeKeys(config);
|
|
94
62
|
} catch (err) {
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
log.warn("Failed to collapse duplicate merge keys.");
|
|
64
|
+
log.subtle(inspect(err));
|
|
97
65
|
return { result: "skip", reason: "due to an error" };
|
|
98
66
|
}
|
|
99
67
|
};
|
|
100
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
-
0 && (module.exports = {
|
|
102
|
-
tryCollapseDuplicateMergeKeys
|
|
103
|
-
});
|
|
104
68
|
//# sourceMappingURL=collapseDuplicateMergeKeys.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst collapseDuplicateMergeKeys: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const buildkiteFiles = await glob(\n ['{apps/*/,packages/*/,./}.buildkite/**/*.y*ml'],\n { onlyFiles: true },\n );\n\n if (buildkiteFiles.length === 0) {\n return { result: 'skip', reason: 'no Buildkite files found' };\n }\n\n const input = await Promise.all(\n buildkiteFiles.map((name) => fs.promises.readFile(name, 'utf-8')),\n );\n\n const replaced = input.map(collapseDuplicateMergeKeysInFile);\n\n if (replaced.every((r, i) => r === input[i])) {\n return { result: 'skip', reason: 'no duplicate merge keys found' };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n await Promise.all(\n buildkiteFiles.flatMap((name, i) =>\n replaced[i] !== input[i]\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n [fs.promises.writeFile(name, replaced[i]!)]\n : [],\n ),\n );\n\n return { result: 'apply' };\n};\n\nconst collapseDuplicateMergeKeysInFile = (input: string) =>\n replaceAllUntilStable(\n input,\n /^([ \\-]*)<<: \\[?(\\*[^\\n#\\]]+)\\]?(\\s*#.*)?$\\n^( *)<<: \\[?(\\*[^\\n#\\]]+)\\]?(\\s*#.*)?$/gm,\n (match, prefixA, keyA, commentA, prefixB, keyB, commentB) => {\n if (prefixA.length === prefixB.length) {\n return [\n ...(commentA\n ? [`${' '.repeat(prefixA.length)}${commentA.trim()}`]\n : []),\n ...(commentB\n ? [`${' '.repeat(prefixA.length)}${commentB.trim()}`]\n : []),\n `${prefixA}<<: [${keyA.trim()}, ${keyB.trim()}]`,\n ].join('\\n');\n }\n return match;\n },\n );\n\nconst replaceAllUntilStable = (\n input: string,\n searchValue: RegExp,\n replacer: (substring: string, ...args: string[]) => string,\n): string => {\n let output = input;\n let previousOutput;\n\n do {\n previousOutput = output;\n output = output.replace(searchValue, replacer);\n } while (output !== previousOutput);\n\n return output;\n};\n\nexport const tryCollapseDuplicateMergeKeys: PatchFunction = async (config) => {\n try {\n return await collapseDuplicateMergeKeys(config);\n } catch (err) {\n log.warn('Failed to collapse duplicate merge keys.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAExB,SAAS,YAAY;AACrB,OAAO,QAAQ;AAEf,SAAS,WAAW;AAGpB,MAAM,6BAA4C,OAAO;AAAA,EACvD;AACF,MAAgC;AAC9B,QAAM,iBAAiB,MAAM;AAAA,IAC3B,CAAC,8CAA8C;AAAA,IAC/C,EAAE,WAAW,KAAK;AAAA,EACpB;AAEA,MAAI,eAAe,WAAW,GAAG;AAC/B,WAAO,EAAE,QAAQ,QAAQ,QAAQ,2BAA2B;AAAA,EAC9D;AAEA,QAAM,QAAQ,MAAM,QAAQ;AAAA,IAC1B,eAAe,IAAI,CAAC,SAAS,GAAG,SAAS,SAAS,MAAM,OAAO,CAAC;AAAA,EAClE;AAEA,QAAM,WAAW,MAAM,IAAI,gCAAgC;AAE3D,MAAI,SAAS,MAAM,CAAC,GAAG,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG;AAC5C,WAAO,EAAE,QAAQ,QAAQ,QAAQ,gCAAgC;AAAA,EACnE;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,QAAQ;AAAA,IACZ,eAAe;AAAA,MAAQ,CAAC,MAAM,MAC5B,SAAS,CAAC,MAAM,MAAM,CAAC;AAAA;AAAA,QAEnB,CAAC,GAAG,SAAS,UAAU,MAAM,SAAS,CAAC,CAAE,CAAC;AAAA,UAC1C,CAAC;AAAA,IACP;AAAA,EACF;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEA,MAAM,mCAAmC,CAAC,UACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA,CAAC,OAAO,SAAS,MAAM,UAAU,SAAS,MAAM,aAAa;AAC3D,QAAI,QAAQ,WAAW,QAAQ,QAAQ;AACrC,aAAO;AAAA,QACL,GAAI,WACA,CAAC,GAAG,IAAI,OAAO,QAAQ,MAAM,CAAC,GAAG,SAAS,KAAK,CAAC,EAAE,IAClD,CAAC;AAAA,QACL,GAAI,WACA,CAAC,GAAG,IAAI,OAAO,QAAQ,MAAM,CAAC,GAAG,SAAS,KAAK,CAAC,EAAE,IAClD,CAAC;AAAA,QACL,GAAG,OAAO,QAAQ,KAAK,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC;AAAA,MAC/C,EAAE,KAAK,IAAI;AAAA,IACb;AACA,WAAO;AAAA,EACT;AACF;AAEF,MAAM,wBAAwB,CAC5B,OACA,aACA,aACW;AACX,MAAI,SAAS;AACb,MAAI;AAEJ,KAAG;AACD,qBAAiB;AACjB,aAAS,OAAO,QAAQ,aAAa,QAAQ;AAAA,EAC/C,SAAS,WAAW;AAEpB,SAAO;AACT;AAEO,aAAM,gCAA+C,OAAO,WAAW;AAC5E,MAAI;AACF,WAAO,MAAM,2BAA2B,MAAM;AAAA,EAChD,SAAS,KAAK;AACZ,QAAI,KAAK,0CAA0C;AACnD,QAAI,OAAO,QAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|