skuba 14.0.0-migrate-to-inquirer-20251031060542 → 14.0.0-replace-global-vars-20251117052457
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/eslint.js +1 -1
- package/config/prettier.d.ts +8 -4
- package/config/prettier.js +10 -2
- package/lib/cli/adapter/eslint.js +11 -45
- package/lib/cli/adapter/eslint.js.map +3 -3
- package/lib/cli/adapter/prettier.js +39 -67
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +8 -42
- package/lib/cli/build/args.js.map +2 -2
- package/lib/cli/build/assets.d.ts +3 -2
- package/lib/cli/build/assets.js +28 -60
- package/lib/cli/build/assets.js.map +3 -3
- package/lib/cli/build/esbuild.js +21 -45
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +21 -55
- package/lib/cli/build/index.js.map +3 -3
- package/lib/cli/build/tsc.js +23 -61
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/buildPackage/index.js +8 -32
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +16 -50
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/analyseDependencies.d.ts +1 -1
- package/lib/cli/configure/analyseDependencies.js +25 -59
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +5 -39
- package/lib/cli/configure/analysis/diff.js.map +3 -3
- package/lib/cli/configure/analysis/files.js +8 -42
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +12 -46
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/configure/analysis/package.d.ts +2 -3
- package/lib/cli/configure/analysis/package.js +10 -45
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +18 -50
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +7 -35
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +4 -28
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +4 -28
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +4 -28
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +2 -26
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +4 -29
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +35 -60
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.d.ts +1 -1
- package/lib/cli/configure/getEntryPoint.js +14 -48
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/getProjectType.d.ts +1 -1
- package/lib/cli/configure/getProjectType.js +14 -35
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +50 -84
- package/lib/cli/configure/index.js.map +3 -3
- package/lib/cli/configure/modules/eslint.js +10 -34
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +8 -32
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +18 -44
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/nodemon.js +4 -28
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +10 -34
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +11 -35
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +17 -40
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +2 -26
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +4 -28
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +3 -39
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +2 -26
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +2 -27
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +6 -31
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +2 -26
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +4 -28
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.d.ts +1 -67
- package/lib/cli/configure/processing/package.js +8 -45
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +4 -38
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +5 -41
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +26 -63
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/types.d.ts +15 -4
- package/lib/cli/configure/types.js +0 -16
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +20 -54
- package/lib/cli/format/index.js.map +3 -3
- package/lib/cli/help/index.js +6 -30
- package/lib/cli/help/index.js.map +1 -1
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/init/getConfig.js +76 -104
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.js +16 -51
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +67 -98
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.js +21 -42
- package/lib/cli/init/prompts.js.map +1 -1
- package/lib/cli/init/types.js +7 -41
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +2 -30
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +8 -42
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +3 -37
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +11 -45
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +3 -37
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +3 -37
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +3 -37
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +2 -26
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +11 -45
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +2 -26
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +2 -26
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +4 -28
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +6 -30
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +37 -73
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/eslint.js +16 -51
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +19 -51
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +26 -52
- package/lib/cli/lint/index.js.map +2 -2
- package/lib/cli/lint/internal.js +20 -52
- package/lib/cli/lint/internal.js.map +3 -3
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +8 -33
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +12 -48
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +21 -55
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +33 -66
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
- package/lib/cli/lint/internalLints/upgrade/index.js +23 -56
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +6 -30
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +37 -65
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +23 -59
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +6 -30
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +11 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +29 -67
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +10 -34
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +4 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +18 -63
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +15 -50
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +11 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +5 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +72 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +17 -51
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +10 -34
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +10 -44
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +12 -46
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +15 -49
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +10 -39
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +13 -47
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +11 -45
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +4 -28
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +8 -32
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +1 -1
- package/lib/cli/lint/prettier.js +15 -50
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +4 -28
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +0 -16
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.js +10 -34
- package/lib/cli/migrate/index.js.map +1 -1
- package/lib/cli/migrate/nodeVersion/checks.js +24 -61
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.js +25 -55
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/node/index.js +20 -57
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +4 -28
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +16 -50
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +4 -44
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/version/index.js +6 -30
- package/lib/cli/version/index.js.map +1 -1
- package/lib/eslint.d.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +6 -46
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +26 -45
- package/lib/skuba.js.map +3 -3
- package/lib/utils/args.js +6 -43
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +4 -42
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +20 -57
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +32 -72
- package/lib/utils/dir.js.map +2 -2
- package/lib/utils/env.js +2 -26
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +10 -47
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.d.ts +3 -2
- package/lib/utils/exec.js +24 -62
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +6 -40
- package/lib/utils/fs.js.map +3 -3
- package/lib/utils/help.js +6 -30
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/logging.d.ts +9 -10
- package/lib/utils/logging.js +11 -48
- package/lib/utils/logging.js.map +3 -3
- package/lib/utils/logo.js +28 -59
- package/lib/utils/logo.js.map +3 -3
- package/lib/utils/manifest.d.ts +3 -2
- package/lib/utils/manifest.js +8 -48
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +2 -26
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +12 -49
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +4 -39
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +2 -26
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/template.js +18 -55
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +2 -31
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +9 -46
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +7 -32
- package/lib/utils/wait.js.map +1 -1
- package/lib/utils/worker.d.ts +3 -3
- package/lib/utils/worker.js +10 -35
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/function-arguments.d.js +0 -1
- package/lib/wrapper/functionHandler.js +18 -49
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.d.ts +0 -6
- package/lib/wrapper/http.js +8 -51
- package/lib/wrapper/http.js.map +3 -3
- package/lib/wrapper/index.js +6 -7
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +8 -42
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +13 -46
- package/lib/wrapper/requestListener.js.map +3 -3
- package/lib/wrapper/server.d.ts +7 -0
- package/lib/wrapper/server.js +11 -0
- package/lib/wrapper/server.js.map +7 -0
- package/package.json +17 -24
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +3 -2
- package/template/base/vitest.config.ts +25 -0
- package/template/express-rest-api/package.json +2 -1
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +1 -0
- package/template/greeter/package.json +4 -3
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +3 -1
- package/template/koa-rest-api/package.json +2 -1
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -0
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +2 -0
- package/template/koa-rest-api/src/app.test.ts +2 -0
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +2 -0
- package/template/koa-rest-api/src/testing/metrics.ts +2 -0
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +15 -3
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +11 -9
- package/template/lambda-sqs-worker-cdk/package.json +6 -5
- package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +22 -13
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +1 -0
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +33 -31
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +8 -2
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -2
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +4 -3
- package/template/oss-npm-package/_package.json +1 -0
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +2 -0
- package/template/private-npm-package/_package.json +1 -0
- package/template/private-npm-package/skuba.template.js +1 -1
- package/template/private-npm-package/src/index.test.ts +2 -0
- package/config/jest.js +0 -1
- package/jest/moduleNameMapper.js +0 -64
- package/jest/transform.js +0 -62
- package/jest/tsConfig.js +0 -26
- package/jest-preset.js +0 -37
- package/lib/api/jest/index.d.ts +0 -15
- package/lib/api/jest/index.js +0 -59
- package/lib/api/jest/index.js.map +0 -7
- package/lib/cli/configure/modules/jest.d.ts +0 -2
- package/lib/cli/configure/modules/jest.js +0 -86
- package/lib/cli/configure/modules/jest.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
- package/lib/cli/test/reporters/github/annotations.d.ts +0 -9
- package/lib/cli/test/reporters/github/annotations.js +0 -102
- package/lib/cli/test/reporters/github/annotations.js.map +0 -7
- package/lib/cli/test/reporters/github/index.d.ts +0 -5
- package/lib/cli/test/reporters/github/index.js +0 -74
- package/lib/cli/test/reporters/github/index.js.map +0 -7
- package/template/base/jest.config.ts +0 -19
- package/template/base/jest.setup.ts +0 -3
|
@@ -1,46 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var 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");
|
|
1
|
+
import { inspect } from "util";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
4
|
+
import { createDestinationFileReader } from "../../../../../configure/analysis/project.js";
|
|
38
5
|
const DOCKERFILE_FILENAME = "Dockerfile";
|
|
39
6
|
const NON_DEBIAN_REGEX = /gcr.io\/distroless\/nodejs:(18|20)/g;
|
|
40
7
|
const DEBIAN_REGEX = /gcr.io\/distroless\/nodejs(18|20)-debian11/g;
|
|
41
8
|
const VERSION_DEBIAN_REPLACE = "gcr.io/distroless/nodejs$1-debian12";
|
|
42
9
|
const patchDockerfile = async (mode, dir) => {
|
|
43
|
-
const readFile =
|
|
10
|
+
const readFile = createDestinationFileReader(dir);
|
|
44
11
|
const maybeDockerfile = await readFile(DOCKERFILE_FILENAME);
|
|
45
12
|
if (!maybeDockerfile) {
|
|
46
13
|
return { result: "skip", reason: "no Dockerfile found" };
|
|
@@ -52,7 +19,7 @@ const patchDockerfile = async (mode, dir) => {
|
|
|
52
19
|
if (mode === "lint") {
|
|
53
20
|
return { result: "apply" };
|
|
54
21
|
}
|
|
55
|
-
await
|
|
22
|
+
await fs.promises.writeFile(DOCKERFILE_FILENAME, patched);
|
|
56
23
|
return { result: "apply" };
|
|
57
24
|
};
|
|
58
25
|
const tryPatchDockerfile = async ({
|
|
@@ -62,13 +29,12 @@ const tryPatchDockerfile = async ({
|
|
|
62
29
|
try {
|
|
63
30
|
return await patchDockerfile(mode, dir);
|
|
64
31
|
} catch (err) {
|
|
65
|
-
|
|
66
|
-
|
|
32
|
+
log.warn("Failed to patch Dockerfile.");
|
|
33
|
+
log.subtle(inspect(err));
|
|
67
34
|
return { result: "skip", reason: "due to an error" };
|
|
68
35
|
}
|
|
69
36
|
};
|
|
70
|
-
|
|
71
|
-
0 && (module.exports = {
|
|
37
|
+
export {
|
|
72
38
|
tryPatchDockerfile
|
|
73
|
-
}
|
|
39
|
+
};
|
|
74
40
|
//# 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,MAAM,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,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var 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");
|
|
1
|
+
import { inspect } from "util";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
4
|
+
import { createDestinationFileReader } from "../../../../../configure/analysis/project.js";
|
|
5
|
+
import { formatPrettier } from "../../../../../configure/processing/prettier.js";
|
|
39
6
|
const SERVER_LISTENER_FILENAME = "src/listen.ts";
|
|
40
7
|
const KEEP_ALIVE_CODE = `
|
|
41
8
|
// Gantry ALB default idle timeout is 30 seconds
|
|
@@ -46,7 +13,7 @@ const KEEP_ALIVE_CODE = `
|
|
|
46
13
|
listener.keepAliveTimeout = 31000;
|
|
47
14
|
`;
|
|
48
15
|
const patchServerListener = async (mode, dir) => {
|
|
49
|
-
const readFile =
|
|
16
|
+
const readFile = createDestinationFileReader(dir);
|
|
50
17
|
let listener = await readFile(SERVER_LISTENER_FILENAME);
|
|
51
18
|
if (!listener) {
|
|
52
19
|
return { result: "skip", reason: "no listener file found" };
|
|
@@ -67,9 +34,9 @@ const patchServerListener = async (mode, dir) => {
|
|
|
67
34
|
return { result: "apply" };
|
|
68
35
|
}
|
|
69
36
|
listener = `${listener}${KEEP_ALIVE_CODE}`;
|
|
70
|
-
await
|
|
37
|
+
await fs.promises.writeFile(
|
|
71
38
|
SERVER_LISTENER_FILENAME,
|
|
72
|
-
await
|
|
39
|
+
await formatPrettier(listener, {
|
|
73
40
|
parser: "typescript"
|
|
74
41
|
})
|
|
75
42
|
);
|
|
@@ -82,13 +49,12 @@ const tryPatchServerListener = async ({
|
|
|
82
49
|
try {
|
|
83
50
|
return await patchServerListener(mode, dir);
|
|
84
51
|
} catch (err) {
|
|
85
|
-
|
|
86
|
-
|
|
52
|
+
log.warn("Failed to patch server listener.");
|
|
53
|
+
log.subtle(inspect(err));
|
|
87
54
|
return { result: "skip", reason: "due to an error" };
|
|
88
55
|
}
|
|
89
56
|
};
|
|
90
|
-
|
|
91
|
-
0 && (module.exports = {
|
|
57
|
+
export {
|
|
92
58
|
tryPatchServerListener
|
|
93
|
-
}
|
|
59
|
+
};
|
|
94
60
|
//# 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,MAAM,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,11 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
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");
|
|
1
|
+
import { tryPatchPnpmPackageManager } from "./patchPnpmPackageManager.js";
|
|
25
2
|
const patches = [
|
|
26
3
|
{
|
|
27
|
-
apply:
|
|
4
|
+
apply: tryPatchPnpmPackageManager,
|
|
28
5
|
description: "Ensure the pnpm package manager version specified in package.json is used in Dockerfiles"
|
|
29
6
|
}
|
|
30
7
|
];
|
|
31
|
-
|
|
32
|
-
0 && (module.exports = {
|
|
8
|
+
export {
|
|
33
9
|
patches
|
|
34
|
-
}
|
|
10
|
+
};
|
|
35
11
|
//# 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,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,41 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var 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");
|
|
1
|
+
import { inspect } from "util";
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import { lt } from "semver";
|
|
5
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
39
6
|
const DOCKERFILE_COREPACK_COMMAND = "RUN corepack enable pnpm";
|
|
40
7
|
const PACKAGE_JSON_MOUNT = `RUN --mount=type=bind,source=package.json,target=package.json \\
|
|
41
8
|
corepack enable pnpm && corepack install`;
|
|
@@ -44,7 +11,7 @@ const BEFORE_PIPELINE_REGEX = /(\s*cache-on:\s*\n\s*-\s*\.npmrc\s*\n)((\s*)-\s*p
|
|
|
44
11
|
const ECR_REGEX = /seek-oss\/docker-ecr-cache#v([\d\.]+)/gm;
|
|
45
12
|
const fetchFiles = async (files) => Promise.all(
|
|
46
13
|
files.map(async (file) => {
|
|
47
|
-
const contents = await
|
|
14
|
+
const contents = await fs.readFile(file, "utf8");
|
|
48
15
|
return {
|
|
49
16
|
file,
|
|
50
17
|
contents
|
|
@@ -69,8 +36,8 @@ const patchPnpmPackageManager = async ({
|
|
|
69
36
|
};
|
|
70
37
|
}
|
|
71
38
|
const [maybeDockerfiles, maybePipelines] = await Promise.all([
|
|
72
|
-
(
|
|
73
|
-
(
|
|
39
|
+
fg(["Dockerfile*"]),
|
|
40
|
+
fg([".buildkite/*.yml"])
|
|
74
41
|
]);
|
|
75
42
|
if (!maybeDockerfiles.length || !maybePipelines.length) {
|
|
76
43
|
return {
|
|
@@ -104,7 +71,7 @@ const patchPnpmPackageManager = async ({
|
|
|
104
71
|
DOCKERFILE_COREPACK_COMMAND,
|
|
105
72
|
PACKAGE_JSON_MOUNT
|
|
106
73
|
);
|
|
107
|
-
await
|
|
74
|
+
await fs.writeFile(file, patchedContent);
|
|
108
75
|
})
|
|
109
76
|
);
|
|
110
77
|
}
|
|
@@ -119,13 +86,13 @@ $2`
|
|
|
119
86
|
const patchedEcrContent = patchedContent.replace(
|
|
120
87
|
ECR_REGEX,
|
|
121
88
|
(match, version) => {
|
|
122
|
-
if (typeof version === "string" &&
|
|
89
|
+
if (typeof version === "string" && lt(version, "2.2.0")) {
|
|
123
90
|
return "seek-oss/docker-ecr-cache#v2.2.0";
|
|
124
91
|
}
|
|
125
92
|
return match;
|
|
126
93
|
}
|
|
127
94
|
);
|
|
128
|
-
await
|
|
95
|
+
await fs.writeFile(file, patchedEcrContent);
|
|
129
96
|
})
|
|
130
97
|
);
|
|
131
98
|
}
|
|
@@ -135,13 +102,12 @@ const tryPatchPnpmPackageManager = async (config) => {
|
|
|
135
102
|
try {
|
|
136
103
|
return await patchPnpmPackageManager(config);
|
|
137
104
|
} catch (err) {
|
|
138
|
-
|
|
139
|
-
|
|
105
|
+
log.warn("Failed to patch pnpm packageManager CI configuration.");
|
|
106
|
+
log.subtle(inspect(err));
|
|
140
107
|
return { result: "skip", reason: "due to an error" };
|
|
141
108
|
}
|
|
142
109
|
};
|
|
143
|
-
|
|
144
|
-
0 && (module.exports = {
|
|
110
|
+
export {
|
|
145
111
|
tryPatchPnpmPackageManager
|
|
146
|
-
}
|
|
112
|
+
};
|
|
147
113
|
//# 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,MAAM,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,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var 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");
|
|
1
|
+
import { inspect } from "util";
|
|
2
|
+
import { glob } from "fast-glob";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import { log } from "../../../../../../utils/logging.js";
|
|
38
5
|
const collapseDuplicateMergeKeys = async ({
|
|
39
6
|
mode
|
|
40
7
|
}) => {
|
|
41
|
-
const buildkiteFiles = await
|
|
8
|
+
const buildkiteFiles = await glob(
|
|
42
9
|
["{apps/*/,packages/*/,./}.buildkite/**/*.y*ml"],
|
|
43
10
|
{ onlyFiles: true }
|
|
44
11
|
);
|
|
@@ -46,7 +13,7 @@ const collapseDuplicateMergeKeys = async ({
|
|
|
46
13
|
return { result: "skip", reason: "no Buildkite files found" };
|
|
47
14
|
}
|
|
48
15
|
const input = await Promise.all(
|
|
49
|
-
buildkiteFiles.map((name) =>
|
|
16
|
+
buildkiteFiles.map((name) => fs.promises.readFile(name, "utf-8"))
|
|
50
17
|
);
|
|
51
18
|
const replaced = input.map(collapseDuplicateMergeKeysInFile);
|
|
52
19
|
if (replaced.every((r, i) => r === input[i])) {
|
|
@@ -59,7 +26,7 @@ const collapseDuplicateMergeKeys = async ({
|
|
|
59
26
|
buildkiteFiles.flatMap(
|
|
60
27
|
(name, i) => replaced[i] !== input[i] ? (
|
|
61
28
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
62
|
-
[
|
|
29
|
+
[fs.promises.writeFile(name, replaced[i])]
|
|
63
30
|
) : []
|
|
64
31
|
)
|
|
65
32
|
);
|
|
@@ -92,13 +59,12 @@ const tryCollapseDuplicateMergeKeys = async (config) => {
|
|
|
92
59
|
try {
|
|
93
60
|
return await collapseDuplicateMergeKeys(config);
|
|
94
61
|
} catch (err) {
|
|
95
|
-
|
|
96
|
-
|
|
62
|
+
log.warn("Failed to collapse duplicate merge keys.");
|
|
63
|
+
log.subtle(inspect(err));
|
|
97
64
|
return { result: "skip", reason: "due to an error" };
|
|
98
65
|
}
|
|
99
66
|
};
|
|
100
|
-
|
|
101
|
-
0 && (module.exports = {
|
|
67
|
+
export {
|
|
102
68
|
tryCollapseDuplicateMergeKeys
|
|
103
|
-
}
|
|
69
|
+
};
|
|
104
70
|
//# 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,MAAM,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
|
}
|
|
@@ -1,55 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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_collapseDuplicateMergeKeys = require("./collapseDuplicateMergeKeys.js");
|
|
25
|
-
var import_moveNpmrcMounts = require("./moveNpmrcMounts.js");
|
|
26
|
-
var import_patchDockerCompose = require("./patchDockerCompose.js");
|
|
27
|
-
var import_patchDockerImages = require("./patchDockerImages.js");
|
|
28
|
-
var import_upgradeESLint = require("./upgradeESLint.js");
|
|
1
|
+
import { tryCollapseDuplicateMergeKeys } from "./collapseDuplicateMergeKeys.js";
|
|
2
|
+
import { tryMoveNpmrcMounts } from "./moveNpmrcMounts.js";
|
|
3
|
+
import { tryPatchDockerComposeFiles } from "./patchDockerCompose.js";
|
|
4
|
+
import { tryPatchDockerImages } from "./patchDockerImages.js";
|
|
29
5
|
const patches = [
|
|
30
6
|
{
|
|
31
|
-
apply:
|
|
7
|
+
apply: tryCollapseDuplicateMergeKeys,
|
|
32
8
|
description: "Collapse duplicate merge keys in .buildkite files"
|
|
33
9
|
},
|
|
34
10
|
{
|
|
35
|
-
apply:
|
|
36
|
-
description: "Upgrade to ESLint flat config"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
apply: import_patchDockerCompose.tryPatchDockerComposeFiles,
|
|
11
|
+
apply: tryPatchDockerComposeFiles,
|
|
40
12
|
description: "Remove version field from docker-compose files"
|
|
41
13
|
},
|
|
42
14
|
{
|
|
43
|
-
apply:
|
|
15
|
+
apply: tryPatchDockerImages,
|
|
44
16
|
description: "Update docker image references to use public.ecr.aws and remove --platform flag"
|
|
45
17
|
},
|
|
46
18
|
{
|
|
47
|
-
apply:
|
|
19
|
+
apply: tryMoveNpmrcMounts,
|
|
48
20
|
description: "Move .npmrc mounts from tmp/.npmrc to /tmp/.npmrc"
|
|
49
21
|
}
|
|
50
22
|
];
|
|
51
|
-
|
|
52
|
-
0 && (module.exports = {
|
|
23
|
+
export {
|
|
53
24
|
patches
|
|
54
|
-
}
|
|
25
|
+
};
|
|
55
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryCollapseDuplicateMergeKeys } from './collapseDuplicateMergeKeys.js';\nimport { tryMoveNpmrcMounts } from './moveNpmrcMounts.js';\nimport { tryPatchDockerComposeFiles } from './patchDockerCompose.js';\nimport { tryPatchDockerImages } from './patchDockerImages.js';\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryCollapseDuplicateMergeKeys } from './collapseDuplicateMergeKeys.js';\nimport { tryMoveNpmrcMounts } from './moveNpmrcMounts.js';\nimport { tryPatchDockerComposeFiles } from './patchDockerCompose.js';\nimport { tryPatchDockerImages } from './patchDockerImages.js';\n\nexport const patches: Patches = [\n {\n apply: tryCollapseDuplicateMergeKeys,\n description: 'Collapse duplicate merge keys in .buildkite files',\n },\n {\n apply: tryPatchDockerComposeFiles,\n description: 'Remove version field from docker-compose files',\n },\n {\n apply: tryPatchDockerImages,\n description:\n 'Update docker image references to use public.ecr.aws and remove --platform flag',\n },\n {\n apply: tryMoveNpmrcMounts,\n description: 'Move .npmrc mounts from tmp/.npmrc to /tmp/.npmrc',\n },\n];\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,qCAAqC;AAC9C,SAAS,0BAA0B;AACnC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAE9B,MAAM,UAAmB;AAAA,EAC9B;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,aACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|