skuba 14.0.0-replace-global-vars-20251121010036 → 14.0.0-test-private-templates-20260103062459
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/eslint.js +1 -1
- package/config/jest.js +1 -0
- package/config/prettier.d.ts +4 -8
- package/config/prettier.js +2 -10
- package/jest/moduleNameMapper.js +64 -0
- package/jest/transform.js +62 -0
- package/jest/tsConfig.js +26 -0
- package/jest-preset.js +37 -0
- package/lib/api/jest/index.d.ts +15 -0
- package/lib/api/jest/index.js +59 -0
- package/lib/api/jest/index.js.map +7 -0
- package/lib/cli/adapter/eslint.js +45 -11
- package/lib/cli/adapter/eslint.js.map +2 -2
- package/lib/cli/adapter/prettier.js +67 -39
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +42 -8
- package/lib/cli/build/args.js.map +2 -2
- package/lib/cli/build/assets.js +60 -28
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.js +45 -21
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +45 -21
- package/lib/cli/build/index.js.map +1 -1
- package/lib/cli/build/tsc.js +59 -22
- package/lib/cli/build/tsc.js.map +2 -2
- package/lib/cli/buildPackage/index.js +32 -8
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +50 -16
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/analyseDependencies.d.ts +1 -1
- package/lib/cli/configure/analyseDependencies.js +59 -25
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +29 -5
- package/lib/cli/configure/analysis/diff.js.map +1 -1
- package/lib/cli/configure/analysis/files.js +42 -8
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +46 -12
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/configure/analysis/package.d.ts +3 -2
- package/lib/cli/configure/analysis/package.js +45 -10
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +50 -18
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +35 -7
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +28 -4
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +28 -4
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +29 -4
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +61 -33
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.d.ts +1 -1
- package/lib/cli/configure/getEntryPoint.js +48 -14
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/getProjectType.d.ts +1 -1
- package/lib/cli/configure/getProjectType.js +35 -14
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +84 -50
- package/lib/cli/configure/index.js.map +2 -2
- package/lib/cli/configure/modules/eslint.js +34 -10
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +32 -8
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +44 -18
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/jest.d.ts +2 -0
- package/lib/cli/configure/modules/jest.js +86 -0
- package/lib/cli/configure/modules/jest.js.map +7 -0
- package/lib/cli/configure/modules/nodemon.js +28 -4
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +34 -10
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +35 -11
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +40 -17
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +26 -2
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +28 -4
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +39 -3
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +26 -2
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +27 -2
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +31 -6
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +26 -2
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +28 -4
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.d.ts +67 -1
- package/lib/cli/configure/processing/package.js +45 -8
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +38 -4
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +41 -5
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +63 -26
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/types.d.ts +4 -15
- package/lib/cli/configure/types.js +16 -0
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +44 -20
- package/lib/cli/format/index.js.map +1 -1
- package/lib/cli/help/index.js +30 -6
- package/lib/cli/help/index.js.map +1 -1
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/init/getConfig.js +111 -76
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.d.ts +1 -0
- package/lib/cli/init/git.js +88 -16
- package/lib/cli/init/git.js.map +3 -3
- package/lib/cli/init/index.js +98 -67
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.d.ts +6 -5
- package/lib/cli/init/prompts.js +54 -27
- package/lib/cli/init/prompts.js.map +2 -2
- package/lib/cli/init/types.js +41 -7
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +30 -2
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +42 -8
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +45 -11
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +26 -2
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +45 -11
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +26 -2
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +26 -2
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +28 -4
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +30 -6
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +73 -37
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/eslint.js +51 -16
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +51 -19
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +49 -25
- package/lib/cli/lint/index.js.map +1 -1
- package/lib/cli/lint/internal.js +42 -18
- package/lib/cli/lint/internal.js.map +1 -1
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +45 -11
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +63 -32
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
- package/lib/cli/lint/internalLints/upgrade/index.js +53 -22
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -18
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +50 -15
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/prettier.js +50 -15
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +28 -4
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +16 -0
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.d.ts +5 -0
- package/lib/cli/migrate/index.js +79 -15
- package/lib/cli/migrate/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
- package/lib/cli/migrate/nodeVersion/checks.js +51 -120
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
- package/lib/cli/migrate/nodeVersion/index.js +239 -65
- package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
- package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
- package/lib/cli/node/index.js +57 -20
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +28 -4
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +50 -16
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +44 -4
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
- package/lib/cli/test/reporters/github/annotations.js +102 -0
- package/lib/cli/test/reporters/github/annotations.js.map +7 -0
- package/lib/cli/test/reporters/github/index.d.ts +5 -0
- package/lib/cli/test/reporters/github/index.js +74 -0
- package/lib/cli/test/reporters/github/index.js.map +7 -0
- package/lib/cli/version/index.js +30 -6
- package/lib/cli/version/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +46 -6
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +45 -26
- package/lib/skuba.js.map +3 -3
- package/lib/utils/args.js +43 -6
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +42 -4
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +57 -20
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +72 -32
- package/lib/utils/dir.js.map +2 -2
- package/lib/utils/env.js +26 -2
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +47 -10
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.js +61 -23
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +40 -6
- package/lib/utils/fs.js.map +2 -2
- package/lib/utils/help.js +30 -6
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/logging.js +38 -11
- package/lib/utils/logging.js.map +1 -1
- package/lib/utils/logo.js +48 -24
- package/lib/utils/logo.js.map +1 -1
- package/lib/utils/manifest.d.ts +2 -3
- package/lib/utils/manifest.js +48 -8
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +26 -2
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +49 -12
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +39 -4
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +26 -2
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/template.d.ts +1 -1
- package/lib/utils/template.js +60 -19
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +31 -2
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +46 -9
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +32 -7
- package/lib/utils/wait.js.map +1 -1
- package/lib/utils/worker.js +35 -10
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/function-arguments.d.js +1 -0
- package/lib/wrapper/functionHandler.js +49 -18
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.js +43 -8
- package/lib/wrapper/http.js.map +2 -2
- package/lib/wrapper/index.js +7 -6
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +42 -8
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +47 -13
- package/lib/wrapper/requestListener.js.map +2 -2
- package/lib/wrapper/server.js +28 -4
- package/lib/wrapper/server.js.map +1 -1
- package/package.json +42 -43
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +4 -3
- package/template/base/jest.config.ts +19 -0
- package/template/base/jest.setup.ts +3 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/package.json +8 -9
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +0 -1
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/package.json +4 -5
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +1 -3
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/package.json +9 -11
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
- package/template/koa-rest-api/src/app.test.ts +0 -2
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
- package/template/koa-rest-api/src/testing/metrics.ts +0 -2
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -19
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
- package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
- package/template/lambda-sqs-worker-cdk/package.json +9 -9
- package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/oss-npm-package/_package.json +0 -1
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +0 -2
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +1 -2
- package/template/private-npm-package/skuba.template.js +2 -2
- package/template/private-npm-package/src/index.test.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.d.ts +0 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js +0 -86
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +0 -16
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +0 -76
- package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
- package/lib/eslint.d.js +0 -1
- package/lib/eslint.d.js.map +0 -7
- package/template/base/vitest.config.ts +0 -25
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.5.0 → 13.1.1}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
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_removeYarnIgnoreOptionalFlags = require("./removeYarnIgnoreOptionalFlags.js");
|
|
2
25
|
const patches = [
|
|
3
26
|
{
|
|
4
|
-
apply: tryRemoveYarnIgnoreOptionalFlags,
|
|
27
|
+
apply: import_removeYarnIgnoreOptionalFlags.tryRemoveYarnIgnoreOptionalFlags,
|
|
5
28
|
description: "Remove yarn --ignore-optional flags in Dockerfiles"
|
|
6
29
|
}
|
|
7
30
|
];
|
|
8
|
-
export
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
9
33
|
patches
|
|
10
|
-
};
|
|
34
|
+
});
|
|
11
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/10.0.4/index.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryRemoveYarnIgnoreOptionalFlags } from './removeYarnIgnoreOptionalFlags.js';\n\nexport const patches: Patches = [\n {\n apply: tryRemoveYarnIgnoreOptionalFlags,\n description: 'Remove yarn --ignore-optional flags in Dockerfiles',\n },\n];\n"],
|
|
5
|
-
"mappings": "AAEA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2CAAiD;AAE1C,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var removeYarnIgnoreOptionalFlags_exports = {};
|
|
30
|
+
__export(removeYarnIgnoreOptionalFlags_exports, {
|
|
31
|
+
tryRemoveYarnIgnoreOptionalFlags: () => tryRemoveYarnIgnoreOptionalFlags
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(removeYarnIgnoreOptionalFlags_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");
|
|
5
38
|
const fetchFiles = async (files) => Promise.all(
|
|
6
39
|
files.map(async (file) => {
|
|
7
|
-
const contents = await
|
|
40
|
+
const contents = await import_fs_extra.default.promises.readFile(file, "utf8");
|
|
8
41
|
return {
|
|
9
42
|
file,
|
|
10
43
|
contents
|
|
@@ -43,7 +76,7 @@ const removeYarnIgnoreFlag = (contents) => {
|
|
|
43
76
|
const removeYarnIgnoreOptionalFlags = async ({
|
|
44
77
|
mode
|
|
45
78
|
}) => {
|
|
46
|
-
const maybeDockerFilesPaths = await glob(["Dockerfile*"]);
|
|
79
|
+
const maybeDockerFilesPaths = await (0, import_fast_glob.glob)(["Dockerfile*"]);
|
|
47
80
|
if (!maybeDockerFilesPaths.length) {
|
|
48
81
|
return {
|
|
49
82
|
result: "skip",
|
|
@@ -69,7 +102,7 @@ const removeYarnIgnoreOptionalFlags = async ({
|
|
|
69
102
|
}
|
|
70
103
|
await Promise.all(
|
|
71
104
|
mapped.map(async ({ file, after }) => {
|
|
72
|
-
await
|
|
105
|
+
await import_fs_extra.default.promises.writeFile(file, after);
|
|
73
106
|
})
|
|
74
107
|
);
|
|
75
108
|
return { result: "apply" };
|
|
@@ -78,12 +111,13 @@ const tryRemoveYarnIgnoreOptionalFlags = async (config) => {
|
|
|
78
111
|
try {
|
|
79
112
|
return await removeYarnIgnoreOptionalFlags(config);
|
|
80
113
|
} catch (err) {
|
|
81
|
-
log.warn("Failed to remove yarn --ignore-optional flags");
|
|
82
|
-
log.subtle(inspect(err));
|
|
114
|
+
import_logging.log.warn("Failed to remove yarn --ignore-optional flags");
|
|
115
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
83
116
|
return { result: "skip", reason: "due to an error" };
|
|
84
117
|
}
|
|
85
118
|
};
|
|
86
|
-
export
|
|
119
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
+
0 && (module.exports = {
|
|
87
121
|
tryRemoveYarnIgnoreOptionalFlags
|
|
88
|
-
};
|
|
122
|
+
});
|
|
89
123
|
//# sourceMappingURL=removeYarnIgnoreOptionalFlags.js.map
|
package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { 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 fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nconst regex = /\\s*--ignore-optional/;\n\nconst removeYarnIgnoreFlag = (contents: string) => {\n let isInYarn = false;\n\n const lines = contents.split('\\n');\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!;\n\n if (line.includes('yarn')) {\n isInYarn = true;\n }\n\n if (isInYarn && regex.test(line)) {\n lines[i] = line.replace(regex, '');\n\n // If we're now an empty line, remove it and get rid of the \\ at the end of the previous line\n if (!lines[i]!.trim()) {\n lines.splice(i, 1);\n if (i > 0) {\n lines[i - 1] = lines[i - 1]!.replace(/\\s*\\\\$/, '');\n }\n i--;\n } else if (lines[i] === '\\\\') {\n lines.splice(i, 1);\n i--;\n }\n\n isInYarn = false;\n }\n\n if (!line.endsWith('\\\\')) {\n isInYarn = false;\n }\n }\n\n return lines.join('\\n');\n};\n\nconst removeYarnIgnoreOptionalFlags: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const maybeDockerFilesPaths = await glob(['Dockerfile*']);\n\n if (!maybeDockerFilesPaths.length) {\n return {\n result: 'skip',\n reason: 'no Dockerfiles found',\n };\n }\n\n const dockerFiles = await fetchFiles(maybeDockerFilesPaths);\n\n const mapped = dockerFiles.map(({ file, contents }) => ({\n file,\n before: contents,\n after: removeYarnIgnoreFlag(contents),\n }));\n\n if (!mapped.some(({ before, after }) => before !== after)) {\n return {\n result: 'skip',\n reason: 'no Dockerfiles to patch',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n mapped.map(async ({ file, after }) => {\n await fs.promises.writeFile(file, after);\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const tryRemoveYarnIgnoreOptionalFlags: PatchFunction = async (\n config,\n) => {\n try {\n return await removeYarnIgnoreOptionalFlags(config);\n } catch (err) {\n log.warn('Failed to remove yarn --ignore-optional flags');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "AACA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AAEf,qBAAoB;AAGpB,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,gBAAAA,QAAG,SAAS,SAAS,MAAM,MAAM;AAExD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEF,MAAM,QAAQ;AAEd,MAAM,uBAAuB,CAAC,aAAqB;AACjD,MAAI,WAAW;AAEf,QAAM,QAAQ,SAAS,MAAM,IAAI;AAEjC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC;AAEpB,QAAI,KAAK,SAAS,MAAM,GAAG;AACzB,iBAAW;AAAA,IACb;AAEA,QAAI,YAAY,MAAM,KAAK,IAAI,GAAG;AAChC,YAAM,CAAC,IAAI,KAAK,QAAQ,OAAO,EAAE;AAGjC,UAAI,CAAC,MAAM,CAAC,EAAG,KAAK,GAAG;AACrB,cAAM,OAAO,GAAG,CAAC;AACjB,YAAI,IAAI,GAAG;AACT,gBAAM,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,EAAG,QAAQ,UAAU,EAAE;AAAA,QACnD;AACA;AAAA,MACF,WAAW,MAAM,CAAC,MAAM,MAAM;AAC5B,cAAM,OAAO,GAAG,CAAC;AACjB;AAAA,MACF;AAEA,iBAAW;AAAA,IACb;AAEA,QAAI,CAAC,KAAK,SAAS,IAAI,GAAG;AACxB,iBAAW;AAAA,IACb;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;AAEA,MAAM,gCAA+C,OAAO;AAAA,EAC1D;AACF,MAAgC;AAC9B,QAAM,wBAAwB,UAAM,uBAAK,CAAC,aAAa,CAAC;AAExD,MAAI,CAAC,sBAAsB,QAAQ;AACjC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,cAAc,MAAM,WAAW,qBAAqB;AAE1D,QAAM,SAAS,YAAY,IAAI,CAAC,EAAE,MAAM,SAAS,OAAO;AAAA,IACtD;AAAA,IACA,QAAQ;AAAA,IACR,OAAO,qBAAqB,QAAQ;AAAA,EACtC,EAAE;AAEF,MAAI,CAAC,OAAO,KAAK,CAAC,EAAE,QAAQ,MAAM,MAAM,WAAW,KAAK,GAAG;AACzD,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,OAAO,IAAI,OAAO,EAAE,MAAM,MAAM,MAAM;AACpC,YAAM,gBAAAA,QAAG,SAAS,UAAU,MAAM,KAAK;AAAA,IACzC,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,mCAAkD,OAC7D,WACG;AACH,MAAI;AACF,WAAO,MAAM,8BAA8B,MAAM;AAAA,EACnD,SAAS,KAAK;AACZ,uBAAI,KAAK,+CAA+C;AACxD,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
7
|
}
|
|
@@ -1,16 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
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_migrateNpmrcToPnpmWorkspace = require("./migrateNpmrcToPnpmWorkspace.js");
|
|
25
|
+
var import_stopBundlingInCDKTests = require("./stopBundlingInCDKTests.js");
|
|
3
26
|
const patches = [
|
|
4
27
|
{
|
|
5
|
-
apply: tryStopBundlingInCDKTests,
|
|
28
|
+
apply: import_stopBundlingInCDKTests.tryStopBundlingInCDKTests,
|
|
6
29
|
description: "Stop bundling inside CDK unit tests"
|
|
7
30
|
},
|
|
8
31
|
{
|
|
9
|
-
apply: tryMigrateNpmrcToPnpmWorkspace,
|
|
32
|
+
apply: import_migrateNpmrcToPnpmWorkspace.tryMigrateNpmrcToPnpmWorkspace,
|
|
10
33
|
description: "Move .npmrc config to pnpm-workspace.yaml"
|
|
11
34
|
}
|
|
12
35
|
];
|
|
13
|
-
export
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
14
38
|
patches
|
|
15
|
-
};
|
|
39
|
+
});
|
|
16
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/10.1.0/index.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryMigrateNpmrcToPnpmWorkspace } from './migrateNpmrcToPnpmWorkspace.js';\nimport { tryStopBundlingInCDKTests } from './stopBundlingInCDKTests.js';\n\nexport const patches: Patches = [\n {\n apply: tryStopBundlingInCDKTests,\n description: 'Stop bundling inside CDK unit tests',\n },\n {\n apply: tryMigrateNpmrcToPnpmWorkspace,\n description: 'Move .npmrc config to pnpm-workspace.yaml',\n },\n];\n"],
|
|
5
|
-
"mappings": "AAEA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yCAA+C;AAC/C,oCAA0C;AAEnC,MAAM,UAAmB;AAAA,EAC9B;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,27 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var migrateNpmrcToPnpmWorkspace_exports = {};
|
|
30
|
+
__export(migrateNpmrcToPnpmWorkspace_exports, {
|
|
31
|
+
tryMigrateNpmrcToPnpmWorkspace: () => tryMigrateNpmrcToPnpmWorkspace
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(migrateNpmrcToPnpmWorkspace_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_dir = require("../../../../../../utils/dir.js");
|
|
38
|
+
var import_fs = require("../../../../../../utils/fs.js");
|
|
39
|
+
var import_logging = require("../../../../../../utils/logging.js");
|
|
40
|
+
var import_npmrc = require("../../../../../../utils/npmrc.js");
|
|
41
|
+
var import_configFile = require("../../../../../configure/processing/configFile.js");
|
|
12
42
|
const NPMRC = ".npmrc";
|
|
13
43
|
const migrateCustomNpmrcSettings = async () => {
|
|
14
|
-
const contents = await
|
|
15
|
-
const remainderLines = replaceManagedSection(contents, "").split("\n").map((line) => line.trim()).filter((line) => line.length > 0).filter((line) => !line.startsWith("#")).filter((line) => !hasNpmrcSecret(line));
|
|
44
|
+
const contents = await import_fs_extra.default.promises.readFile(NPMRC, "utf-8");
|
|
45
|
+
const remainderLines = (0, import_configFile.replaceManagedSection)(contents, "").split("\n").map((line) => line.trim()).filter((line) => line.length > 0).filter((line) => !line.startsWith("#")).filter((line) => !(0, import_npmrc.hasNpmrcSecret)(line));
|
|
16
46
|
if (remainderLines.length === 0) {
|
|
17
47
|
return;
|
|
18
48
|
}
|
|
19
49
|
const pnpmWorkspaceFile = "pnpm-workspace.yaml";
|
|
20
|
-
const pnpmWorkspaceExists = await pathExists(pnpmWorkspaceFile);
|
|
50
|
+
const pnpmWorkspaceExists = await (0, import_fs.pathExists)(pnpmWorkspaceFile);
|
|
21
51
|
if (!pnpmWorkspaceExists) {
|
|
22
|
-
await
|
|
52
|
+
await import_fs_extra.default.promises.writeFile(pnpmWorkspaceFile, "");
|
|
23
53
|
}
|
|
24
|
-
const pnpmWorkspaceContents = await
|
|
54
|
+
const pnpmWorkspaceContents = await import_fs_extra.default.promises.readFile(
|
|
25
55
|
pnpmWorkspaceFile,
|
|
26
56
|
"utf-8"
|
|
27
57
|
);
|
|
@@ -33,43 +63,43 @@ const migrateCustomNpmrcSettings = async () => {
|
|
|
33
63
|
${commentedLines}
|
|
34
64
|
|
|
35
65
|
${pnpmWorkspaceContents}`;
|
|
36
|
-
await
|
|
66
|
+
await import_fs_extra.default.promises.writeFile(pnpmWorkspaceFile, newContents);
|
|
37
67
|
};
|
|
38
68
|
const fixDockerfiles = async () => {
|
|
39
|
-
const fileNames = await glob(["**/Dockerfile*"]);
|
|
69
|
+
const fileNames = await (0, import_fast_glob.glob)(["**/Dockerfile*"]);
|
|
40
70
|
await Promise.all(
|
|
41
71
|
fileNames.map(async (fileName) => {
|
|
42
|
-
const contents = await
|
|
72
|
+
const contents = await import_fs_extra.default.promises.readFile(fileName, "utf8");
|
|
43
73
|
const patched = contents.replaceAll(
|
|
44
74
|
"--mount=type=bind,source=.npmrc,target=.npmrc",
|
|
45
75
|
"--mount=type=bind,source=pnpm-workspace.yaml,target=pnpm-workspace.yaml"
|
|
46
76
|
);
|
|
47
77
|
if (patched !== contents) {
|
|
48
|
-
await
|
|
78
|
+
await import_fs_extra.default.promises.writeFile(fileName, patched);
|
|
49
79
|
}
|
|
50
80
|
})
|
|
51
81
|
);
|
|
52
82
|
};
|
|
53
83
|
const fixBuildkitePipelines = async () => {
|
|
54
|
-
const fileNames = await glob(["**/.buildkite/**.{yml,yaml}"]);
|
|
84
|
+
const fileNames = await (0, import_fast_glob.glob)(["**/.buildkite/**.{yml,yaml}"]);
|
|
55
85
|
await Promise.all(
|
|
56
86
|
fileNames.map(async (fileName) => {
|
|
57
|
-
const contents = await
|
|
87
|
+
const contents = await import_fs_extra.default.promises.readFile(fileName, "utf8");
|
|
58
88
|
const patched = contents.replace(
|
|
59
89
|
/(cache-on:[\s\S]*?)([ \t]+-[ \t]+\.npmrc)([\s\S]*?)(?=\n[ \t]*\S|$)/g,
|
|
60
90
|
(_, before, npmrcLine, after) => before + npmrcLine.replace(".npmrc", "pnpm-workspace.yaml") + after
|
|
61
91
|
);
|
|
62
92
|
if (patched !== contents) {
|
|
63
|
-
await
|
|
93
|
+
await import_fs_extra.default.promises.writeFile(fileName, patched);
|
|
64
94
|
}
|
|
65
95
|
})
|
|
66
96
|
);
|
|
67
97
|
};
|
|
68
98
|
const forceUpgradeToPnpm10 = async () => {
|
|
69
|
-
const fileNames = await glob(["**/package.json"]);
|
|
99
|
+
const fileNames = await (0, import_fast_glob.glob)(["**/package.json"]);
|
|
70
100
|
await Promise.all(
|
|
71
101
|
fileNames.map(async (fileName) => {
|
|
72
|
-
const contents = await
|
|
102
|
+
const contents = await import_fs_extra.default.promises.readFile(fileName, "utf8");
|
|
73
103
|
const packageManagerMatch = /"packageManager"\s*:\s*"pnpm@([^"]+)"/.exec(
|
|
74
104
|
contents
|
|
75
105
|
);
|
|
@@ -83,7 +113,7 @@ const forceUpgradeToPnpm10 = async () => {
|
|
|
83
113
|
/"packageManager"(\s*):(\s*)"pnpm@[^"]+"/,
|
|
84
114
|
'"packageManager"$1:$2"pnpm@10.8.1"'
|
|
85
115
|
);
|
|
86
|
-
await
|
|
116
|
+
await import_fs_extra.default.promises.writeFile(fileName, patched);
|
|
87
117
|
}
|
|
88
118
|
})
|
|
89
119
|
);
|
|
@@ -99,8 +129,8 @@ const migrateNpmrcToPnpmWorkspace = async ({
|
|
|
99
129
|
};
|
|
100
130
|
}
|
|
101
131
|
const [workspaceRoot, currentWorkspaceProjectRoot] = await Promise.all([
|
|
102
|
-
findWorkspaceRoot(),
|
|
103
|
-
findCurrentWorkspaceProjectRoot()
|
|
132
|
+
(0, import_dir.findWorkspaceRoot)(),
|
|
133
|
+
(0, import_dir.findCurrentWorkspaceProjectRoot)()
|
|
104
134
|
]);
|
|
105
135
|
if (workspaceRoot !== currentWorkspaceProjectRoot) {
|
|
106
136
|
return {
|
|
@@ -108,7 +138,7 @@ const migrateNpmrcToPnpmWorkspace = async ({
|
|
|
108
138
|
reason: "not running in the workspace root"
|
|
109
139
|
};
|
|
110
140
|
}
|
|
111
|
-
const npmrcExists = await pathExists(NPMRC);
|
|
141
|
+
const npmrcExists = await (0, import_fs.pathExists)(NPMRC);
|
|
112
142
|
if (!npmrcExists) {
|
|
113
143
|
return {
|
|
114
144
|
result: "skip",
|
|
@@ -126,19 +156,20 @@ const migrateNpmrcToPnpmWorkspace = async ({
|
|
|
126
156
|
fixBuildkitePipelines(),
|
|
127
157
|
forceUpgradeToPnpm10()
|
|
128
158
|
]);
|
|
129
|
-
await
|
|
159
|
+
await import_fs_extra.default.promises.rm(NPMRC);
|
|
130
160
|
return { result: "apply" };
|
|
131
161
|
};
|
|
132
162
|
const tryMigrateNpmrcToPnpmWorkspace = async (config) => {
|
|
133
163
|
try {
|
|
134
164
|
return await migrateNpmrcToPnpmWorkspace(config);
|
|
135
165
|
} catch (err) {
|
|
136
|
-
log.warn("Failed to migrate .npmrc to pnpm-workspace.yaml");
|
|
137
|
-
log.subtle(inspect(err));
|
|
166
|
+
import_logging.log.warn("Failed to migrate .npmrc to pnpm-workspace.yaml");
|
|
167
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
138
168
|
return { result: "skip", reason: "due to an error" };
|
|
139
169
|
}
|
|
140
170
|
};
|
|
141
|
-
export
|
|
171
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
172
|
+
0 && (module.exports = {
|
|
142
173
|
tryMigrateNpmrcToPnpmWorkspace
|
|
143
|
-
};
|
|
174
|
+
});
|
|
144
175
|
//# sourceMappingURL=migrateNpmrcToPnpmWorkspace.js.map
|
package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport {\n findCurrentWorkspaceProjectRoot,\n findWorkspaceRoot,\n} from '../../../../../../utils/dir.js';\nimport { pathExists } from '../../../../../../utils/fs.js';\nimport { log } from '../../../../../../utils/logging.js';\nimport { hasNpmrcSecret } from '../../../../../../utils/npmrc.js';\nimport { replaceManagedSection } from '../../../../../configure/processing/configFile.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst NPMRC = '.npmrc';\n\nconst migrateCustomNpmrcSettings = async () => {\n const contents = await fs.promises.readFile(NPMRC, 'utf-8');\n\n const remainderLines = replaceManagedSection(contents, '')\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .filter((line) => !line.startsWith('#'))\n .filter((line) => !hasNpmrcSecret(line));\n\n if (remainderLines.length === 0) {\n return;\n }\n\n const pnpmWorkspaceFile = 'pnpm-workspace.yaml';\n const pnpmWorkspaceExists = await pathExists(pnpmWorkspaceFile);\n if (!pnpmWorkspaceExists) {\n await fs.promises.writeFile(pnpmWorkspaceFile, '');\n }\n\n // prepend the lines to the pnpm-workspace.yaml file, but commented out\n const pnpmWorkspaceContents = await fs.promises.readFile(\n pnpmWorkspaceFile,\n 'utf-8',\n );\n const commentedLines = remainderLines.map((line) => `# ${line}`).join('\\n');\n const newContents = `# TODO: Translate these settings to the required format for pnpm-workspace.yaml.\n# skuba moved these from .npmrc, but doesn't know what they mean.\n# See: https://pnpm.io/settings\n#\n${commentedLines}\n\n${pnpmWorkspaceContents}`;\n\n await fs.promises.writeFile(pnpmWorkspaceFile, newContents);\n};\n\nconst fixDockerfiles = async () => {\n const fileNames = await glob(['**/Dockerfile*']);\n\n await Promise.all(\n fileNames.map(async (fileName) => {\n const contents = await fs.promises.readFile(fileName, 'utf8');\n const patched = contents.replaceAll(\n '--mount=type=bind,source=.npmrc,target=.npmrc',\n '--mount=type=bind,source=pnpm-workspace.yaml,target=pnpm-workspace.yaml',\n );\n\n if (patched !== contents) {\n await fs.promises.writeFile(fileName, patched);\n }\n }),\n );\n};\n\nconst fixBuildkitePipelines = async () => {\n const fileNames = await glob(['**/.buildkite/**.{yml,yaml}']);\n\n await Promise.all(\n fileNames.map(async (fileName) => {\n const contents = await fs.promises.readFile(fileName, 'utf8');\n const patched = contents.replace(\n /(cache-on:[\\s\\S]*?)([ \\t]+-[ \\t]+\\.npmrc)([\\s\\S]*?)(?=\\n[ \\t]*\\S|$)/g,\n (_, before: string, npmrcLine: string, after: string) =>\n before + npmrcLine.replace('.npmrc', 'pnpm-workspace.yaml') + after,\n );\n\n if (patched !== contents) {\n await fs.promises.writeFile(fileName, patched);\n }\n }),\n );\n};\n\nconst forceUpgradeToPnpm10 = async () => {\n const fileNames = await glob(['**/package.json']);\n\n await Promise.all(\n fileNames.map(async (fileName) => {\n const contents = await fs.promises.readFile(fileName, 'utf8');\n\n const packageManagerMatch = /\"packageManager\"\\s*:\\s*\"pnpm@([^\"]+)\"/.exec(\n contents,\n );\n\n if (!packageManagerMatch) {\n return;\n }\n\n const currentVersion = packageManagerMatch[1] ?? '';\n const majorVersion = parseInt(currentVersion.split('.')?.[0] ?? '0', 10);\n\n if (!isNaN(majorVersion) && majorVersion < 10) {\n const patched = contents.replace(\n /\"packageManager\"(\\s*):(\\s*)\"pnpm@[^\"]+\"/,\n '\"packageManager\"$1:$2\"pnpm@10.8.1\"',\n );\n\n await fs.promises.writeFile(fileName, patched);\n }\n }),\n );\n};\n\nconst migrateNpmrcToPnpmWorkspace: PatchFunction = async ({\n mode,\n packageManager,\n}): Promise<PatchReturnType> => {\n if (packageManager.command !== 'pnpm') {\n return {\n result: 'skip',\n reason: 'not using pnpm',\n };\n }\n\n const [workspaceRoot, currentWorkspaceProjectRoot] = await Promise.all([\n findWorkspaceRoot(),\n findCurrentWorkspaceProjectRoot(),\n ]);\n\n if (workspaceRoot !== currentWorkspaceProjectRoot) {\n return {\n result: 'skip',\n reason: 'not running in the workspace root',\n };\n }\n\n const npmrcExists = await pathExists(NPMRC);\n if (!npmrcExists) {\n return {\n result: 'skip',\n reason: 'no .npmrc found',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all([\n migrateCustomNpmrcSettings(),\n fixDockerfiles(),\n fixBuildkitePipelines(),\n forceUpgradeToPnpm10(),\n ]);\n\n await fs.promises.rm(NPMRC);\n\n return { result: 'apply' };\n};\n\nexport const tryMigrateNpmrcToPnpmWorkspace: PatchFunction = async (config) => {\n try {\n return await migrateNpmrcToPnpmWorkspace(config);\n } catch (err) {\n log.warn('Failed to migrate .npmrc to pnpm-workspace.yaml');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAA
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["fs"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var stopBundlingInCDKTests_exports = {};
|
|
30
|
+
__export(stopBundlingInCDKTests_exports, {
|
|
31
|
+
hasAppImportRegex: () => hasAppImportRegex,
|
|
32
|
+
tryStopBundlingInCDKTests: () => tryStopBundlingInCDKTests
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(stopBundlingInCDKTests_exports);
|
|
35
|
+
var import_util = require("util");
|
|
36
|
+
var import_fast_glob = require("fast-glob");
|
|
37
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
38
|
+
var import_logging = require("../../../../../../utils/logging.js");
|
|
5
39
|
const fetchFiles = async (files) => Promise.all(
|
|
6
40
|
files.map(async (file) => {
|
|
7
|
-
const contents = await
|
|
41
|
+
const contents = await import_fs_extra.default.promises.readFile(file, "utf8");
|
|
8
42
|
return {
|
|
9
43
|
file,
|
|
10
44
|
contents
|
|
@@ -24,7 +58,7 @@ const addBundlingContext = (contents) => {
|
|
|
24
58
|
const stopBundlingInCDKTests = async ({
|
|
25
59
|
mode
|
|
26
60
|
}) => {
|
|
27
|
-
const infraTestFileNames = await glob(["**/infra/**/*.test.ts"]);
|
|
61
|
+
const infraTestFileNames = await (0, import_fast_glob.glob)(["**/infra/**/*.test.ts"]);
|
|
28
62
|
if (!infraTestFileNames.length) {
|
|
29
63
|
return {
|
|
30
64
|
result: "skip",
|
|
@@ -50,7 +84,7 @@ const stopBundlingInCDKTests = async ({
|
|
|
50
84
|
}
|
|
51
85
|
await Promise.all(
|
|
52
86
|
mapped.map(async ({ file, after }) => {
|
|
53
|
-
await
|
|
87
|
+
await import_fs_extra.default.promises.writeFile(file, after);
|
|
54
88
|
})
|
|
55
89
|
);
|
|
56
90
|
return { result: "apply" };
|
|
@@ -59,13 +93,14 @@ const tryStopBundlingInCDKTests = async (config) => {
|
|
|
59
93
|
try {
|
|
60
94
|
return await stopBundlingInCDKTests(config);
|
|
61
95
|
} catch (err) {
|
|
62
|
-
log.warn("Failed to remove bundling in CDK tests");
|
|
63
|
-
log.subtle(inspect(err));
|
|
96
|
+
import_logging.log.warn("Failed to remove bundling in CDK tests");
|
|
97
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
64
98
|
return { result: "skip", reason: "due to an error" };
|
|
65
99
|
}
|
|
66
100
|
};
|
|
67
|
-
export
|
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
+
0 && (module.exports = {
|
|
68
103
|
hasAppImportRegex,
|
|
69
104
|
tryStopBundlingInCDKTests
|
|
70
|
-
};
|
|
105
|
+
});
|
|
71
106
|
//# sourceMappingURL=stopBundlingInCDKTests.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.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 fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nexport const hasAppImportRegex =\n /import\\s*\\{\\s*(?:[^}]*,\\s*)?App\\s*(?:,\\s*[^}]*)?\\s*\\}\\s*from\\s*['\"]aws-cdk-lib['\"]/gm;\n\nconst addBundlingContext = (contents: string) => {\n if (contents.includes('new App()') && hasAppImportRegex.test(contents)) {\n return contents.replaceAll(\n 'new App()',\n \"new App({ context: { 'aws:cdk:bundling-stacks': [] } })\",\n );\n }\n\n return contents;\n};\n\nconst stopBundlingInCDKTests: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const infraTestFileNames = await glob(['**/infra/**/*.test.ts']);\n\n if (!infraTestFileNames.length) {\n return {\n result: 'skip',\n reason: 'no CDK test files found',\n };\n }\n\n const infraTestFiles = await fetchFiles(infraTestFileNames);\n\n const mapped = infraTestFiles.map(({ file, contents }) => ({\n file,\n before: contents,\n after: addBundlingContext(contents),\n }));\n\n if (!mapped.some(({ before, after }) => before !== after)) {\n return {\n result: 'skip',\n reason: 'no CDK test files need patching',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n mapped.map(async ({ file, after }) => {\n await fs.promises.writeFile(file, after);\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const tryStopBundlingInCDKTests: PatchFunction = async (config) => {\n try {\n return await stopBundlingInCDKTests(config);\n } catch (err) {\n log.warn('Failed to remove bundling in CDK tests');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AAEf,qBAAoB;AAGpB,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,gBAAAA,QAAG,SAAS,SAAS,MAAM,MAAM;AAExD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEK,MAAM,oBACX;AAEF,MAAM,qBAAqB,CAAC,aAAqB;AAC/C,MAAI,SAAS,SAAS,WAAW,KAAK,kBAAkB,KAAK,QAAQ,GAAG;AACtE,WAAO,SAAS;AAAA,MACd;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,yBAAwC,OAAO;AAAA,EACnD;AACF,MAAgC;AAC9B,QAAM,qBAAqB,UAAM,uBAAK,CAAC,uBAAuB,CAAC;AAE/D,MAAI,CAAC,mBAAmB,QAAQ;AAC9B,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,iBAAiB,MAAM,WAAW,kBAAkB;AAE1D,QAAM,SAAS,eAAe,IAAI,CAAC,EAAE,MAAM,SAAS,OAAO;AAAA,IACzD;AAAA,IACA,QAAQ;AAAA,IACR,OAAO,mBAAmB,QAAQ;AAAA,EACpC,EAAE;AAEF,MAAI,CAAC,OAAO,KAAK,CAAC,EAAE,QAAQ,MAAM,MAAM,WAAW,KAAK,GAAG;AACzD,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,OAAO,IAAI,OAAO,EAAE,MAAM,MAAM,MAAM;AACpC,YAAM,gBAAAA,QAAG,SAAS,UAAU,MAAM,KAAK;AAAA,IACzC,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,4BAA2C,OAAO,WAAW;AACxE,MAAI;AACF,WAAO,MAAM,uBAAuB,MAAM;AAAA,EAC5C,SAAS,KAAK;AACZ,uBAAI,KAAK,wCAAwC;AACjD,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
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_unhandledRejections = require("./unhandledRejections.js");
|
|
2
25
|
const patches = [
|
|
3
26
|
{
|
|
4
|
-
apply: tryPatchUnhandledRejections,
|
|
27
|
+
apply: import_unhandledRejections.tryPatchUnhandledRejections,
|
|
5
28
|
description: "Add event handler to log unhandled promise rejections instead of crashing the process"
|
|
6
29
|
}
|
|
7
30
|
];
|
|
8
|
-
export
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
9
33
|
patches
|
|
10
|
-
};
|
|
34
|
+
});
|
|
11
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.0.2/index.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryPatchUnhandledRejections } from './unhandledRejections.js';\n\nexport const patches: Patches = [\n {\n apply: tryPatchUnhandledRejections,\n description:\n 'Add event handler to log unhandled promise rejections instead of crashing the process',\n },\n];\n"],
|
|
5
|
-
"mappings": "AAEA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iCAA4C;AAErC,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|