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
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/tslint.ts"],
|
|
4
4
|
"sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles.js';\nimport type { Module } from '../types.js';\n\nexport const tslintModule = (): Module =>\n deleteFiles('tslint.json', 'tslint.yaml');\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,SAAS,mBAAmB;AAGrB,MAAM,eAAe,MAC1B,YAAY,eAAe,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
|
|
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 configFile_exports = {};
|
|
30
|
-
__export(configFile_exports, {
|
|
31
|
-
generateIgnoreFileSimpleVariants: () => generateIgnoreFileSimpleVariants,
|
|
32
|
-
mergeWithConfigFile: () => mergeWithConfigFile,
|
|
33
|
-
replaceManagedSection: () => replaceManagedSection
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(configFile_exports);
|
|
36
|
-
var z = __toESM(require("zod"));
|
|
1
|
+
import * as z from "zod";
|
|
37
2
|
const OUTDATED_PATTERNS = ["node_modules_bak/", "tmp-*/"];
|
|
38
3
|
const ASTERISKS = /\*/g;
|
|
39
4
|
const LEADING_SLASH = /^\//;
|
|
@@ -122,10 +87,9 @@ const mergeWithConfigFile = (rawTemplateFile, fileType = "ignore", packageJson)
|
|
|
122
87
|
`;
|
|
123
88
|
};
|
|
124
89
|
};
|
|
125
|
-
|
|
126
|
-
0 && (module.exports = {
|
|
90
|
+
export {
|
|
127
91
|
generateIgnoreFileSimpleVariants,
|
|
128
92
|
mergeWithConfigFile,
|
|
129
93
|
replaceManagedSection
|
|
130
|
-
}
|
|
94
|
+
};
|
|
131
95
|
//# sourceMappingURL=configFile.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/configFile.ts"],
|
|
4
4
|
"sourcesContent": ["import * as z from 'zod';\n\n/**\n * Patterns that are superseded by skuba's bundled ignore file patterns and are\n * non-trivial to derive using e.g. `generateSimpleVariants`.\n */\nconst OUTDATED_PATTERNS = ['node_modules_bak/', 'tmp-*/'];\n\nconst ASTERISKS = /\\*/g;\nconst LEADING_SLASH = /^\\//;\nconst TRAILING_SLASH = /\\/$/;\n\n/**\n * Generate simple variants of an ignore pattern for exact matching purposes.\n *\n * Note that these patterns are not actually equivalent (e.g. `lib` matches more\n * than `lib/`) but they generally represent the same _intent_.\n */\nexport const generateIgnoreFileSimpleVariants = (patterns: string[]) => {\n const set = new Set<string>();\n\n for (const pattern of patterns) {\n const deAsterisked = pattern.replace(ASTERISKS, '');\n const stripped = deAsterisked\n .replace(LEADING_SLASH, '')\n .replace(TRAILING_SLASH, '');\n\n set.add(pattern);\n set.add(deAsterisked);\n set.add(deAsterisked.replace(LEADING_SLASH, ''));\n set.add(deAsterisked.replace(TRAILING_SLASH, ''));\n set.add(stripped);\n\n if (stripped !== '') {\n set.add(`/${stripped}`);\n set.add(`${stripped}/`);\n set.add(`/${stripped}/`);\n }\n }\n\n set.delete('');\n\n return set;\n};\n\nconst amendPnpmWorkspaceTemplate = (\n templateFile: string,\n packageJson?: string,\n) => {\n if (!packageJson) {\n return templateFile;\n }\n let rawJSON;\n try {\n rawJSON = JSON.parse(packageJson) as unknown;\n } catch {\n throw new Error('package.json is not valid JSON');\n }\n const parsed = z\n .object({\n minimumReleaseAgeExcludeOverload: z.array(z.string()).optional(),\n })\n .safeParse(rawJSON);\n\n const excludes = parsed.data?.minimumReleaseAgeExcludeOverload;\n if (\n !excludes ||\n Array.isArray(excludes) === false ||\n excludes.some((e) => typeof e !== 'string')\n ) {\n return templateFile;\n }\n\n const targetKey = 'minimumReleaseAgeExclude:';\n const index = templateFile.indexOf(targetKey);\n\n if (index === -1) {\n return templateFile;\n }\n\n const beforeKey = templateFile.substring(0, index);\n const afterKey = templateFile.substring(index + targetKey.length);\n const excludeLines = excludes.map((exclude) => ` - '${exclude}'`).join('\\n');\n\n return `${beforeKey + targetKey}\\n${excludeLines}${afterKey}`;\n};\n\nexport const replaceManagedSection = (input: string, template: string) =>\n input.replace(/# managed by skuba[\\s\\S]*# end managed by skuba/, template);\n\nexport const mergeWithConfigFile = (\n rawTemplateFile: string,\n fileType: 'ignore' | 'pnpm-workspace' = 'ignore',\n packageJson?: string,\n) => {\n const templateFile =\n fileType === 'pnpm-workspace'\n ? amendPnpmWorkspaceTemplate(rawTemplateFile.trim(), packageJson)\n : rawTemplateFile.trim();\n\n let generator: (s: string[], packageJson?: string) => Set<string>;\n\n switch (fileType) {\n case 'ignore':\n generator = generateIgnoreFileSimpleVariants;\n break;\n case 'pnpm-workspace':\n generator = () => new Set<string>();\n break;\n }\n\n const templatePatterns = generator(\n [\n ...OUTDATED_PATTERNS,\n ...templateFile.split('\\n').map((line) => line.trim()),\n ],\n packageJson,\n );\n\n return (rawInputFile?: string) => {\n if (rawInputFile === undefined) {\n return `${templateFile}\\n`;\n }\n\n const replacedFile = replaceManagedSection(\n rawInputFile.replace(/\\r?\\n/g, '\\n'),\n templateFile,\n );\n\n if (replacedFile.includes(templateFile)) {\n return replacedFile;\n }\n\n // Crunch the existing lines of a non-skuba config.\n const migratedFile = replacedFile\n .split('\\n')\n .filter((line) => !templatePatterns.has(line))\n .join('\\n')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n\n const outputFile = [templateFile, migratedFile].join('\\n\\n').trim();\n\n return `${outputFile}\\n`;\n };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,YAAY,OAAO;AAMnB,MAAM,oBAAoB,CAAC,qBAAqB,QAAQ;AAExD,MAAM,YAAY;AAClB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAQhB,MAAM,mCAAmC,CAAC,aAAuB;AACtE,QAAM,MAAM,oBAAI,IAAY;AAE5B,aAAW,WAAW,UAAU;AAC9B,UAAM,eAAe,QAAQ,QAAQ,WAAW,EAAE;AAClD,UAAM,WAAW,aACd,QAAQ,eAAe,EAAE,EACzB,QAAQ,gBAAgB,EAAE;AAE7B,QAAI,IAAI,OAAO;AACf,QAAI,IAAI,YAAY;AACpB,QAAI,IAAI,aAAa,QAAQ,eAAe,EAAE,CAAC;AAC/C,QAAI,IAAI,aAAa,QAAQ,gBAAgB,EAAE,CAAC;AAChD,QAAI,IAAI,QAAQ;AAEhB,QAAI,aAAa,IAAI;AACnB,UAAI,IAAI,IAAI,QAAQ,EAAE;AACtB,UAAI,IAAI,GAAG,QAAQ,GAAG;AACtB,UAAI,IAAI,IAAI,QAAQ,GAAG;AAAA,IACzB;AAAA,EACF;AAEA,MAAI,OAAO,EAAE;AAEb,SAAO;AACT;AAEA,MAAM,6BAA6B,CACjC,cACA,gBACG;AACH,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AACA,MAAI;AACJ,MAAI;AACF,cAAU,KAAK,MAAM,WAAW;AAAA,EAClC,QAAQ;AACN,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AACA,QAAM,SAAS,EACZ,OAAO;AAAA,IACN,kCAAkC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACjE,CAAC,EACA,UAAU,OAAO;AAEpB,QAAM,WAAW,OAAO,MAAM;AAC9B,MACE,CAAC,YACD,MAAM,QAAQ,QAAQ,MAAM,SAC5B,SAAS,KAAK,CAAC,MAAM,OAAO,MAAM,QAAQ,GAC1C;AACA,WAAO;AAAA,EACT;AAEA,QAAM,YAAY;AAClB,QAAM,QAAQ,aAAa,QAAQ,SAAS;AAE5C,MAAI,UAAU,IAAI;AAChB,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,aAAa,UAAU,GAAG,KAAK;AACjD,QAAM,WAAW,aAAa,UAAU,QAAQ,UAAU,MAAM;AAChE,QAAM,eAAe,SAAS,IAAI,CAAC,YAAY,QAAQ,OAAO,GAAG,EAAE,KAAK,IAAI;AAE5E,SAAO,GAAG,YAAY,SAAS;AAAA,EAAK,YAAY,GAAG,QAAQ;AAC7D;AAEO,MAAM,wBAAwB,CAAC,OAAe,aACnD,MAAM,QAAQ,mDAAmD,QAAQ;AAEpE,MAAM,sBAAsB,CACjC,iBACA,WAAwC,UACxC,gBACG;AACH,QAAM,eACJ,aAAa,mBACT,2BAA2B,gBAAgB,KAAK,GAAG,WAAW,IAC9D,gBAAgB,KAAK;AAE3B,MAAI;AAEJ,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,kBAAY;AACZ;AAAA,IACF,KAAK;AACH,kBAAY,MAAM,oBAAI,IAAY;AAClC;AAAA,EACJ;AAEA,QAAM,mBAAmB;AAAA,IACvB;AAAA,MACE,GAAG;AAAA,MACH,GAAG,aAAa,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC;AAAA,IACvD;AAAA,IACA;AAAA,EACF;AAEA,SAAO,CAAC,iBAA0B;AAChC,QAAI,iBAAiB,QAAW;AAC9B,aAAO,GAAG,YAAY;AAAA;AAAA,IACxB;AAEA,UAAM,eAAe;AAAA,MACnB,aAAa,QAAQ,UAAU,IAAI;AAAA,MACnC;AAAA,IACF;AAEA,QAAI,aAAa,SAAS,YAAY,GAAG;AACvC,aAAO;AAAA,IACT;AAGA,UAAM,eAAe,aAClB,MAAM,IAAI,EACV,OAAO,CAAC,SAAS,CAAC,iBAAiB,IAAI,IAAI,CAAC,EAC5C,KAAK,IAAI,EACT,QAAQ,WAAW,MAAM,EACzB,KAAK;AAER,UAAM,aAAa,CAAC,cAAc,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK;AAElE,WAAO,GAAG,UAAU;AAAA;AAAA,EACtB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,31 +1,7 @@
|
|
|
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 deleteFiles_exports = {};
|
|
20
|
-
__export(deleteFiles_exports, {
|
|
21
|
-
deleteFiles: () => deleteFiles
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(deleteFiles_exports);
|
|
24
1
|
const deleteFiles = (...filenames) => Object.fromEntries(
|
|
25
2
|
filenames.map((filename) => [filename, () => void 0])
|
|
26
3
|
);
|
|
27
|
-
|
|
28
|
-
0 && (module.exports = {
|
|
4
|
+
export {
|
|
29
5
|
deleteFiles
|
|
30
|
-
}
|
|
6
|
+
};
|
|
31
7
|
//# sourceMappingURL=deleteFiles.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/deleteFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Module } from '../types.js';\n\n/**\n * Load files into cache and schedule them for deletion.\n */\nexport const deleteFiles = (...filenames: string[]): Module =>\n Object.fromEntries(\n filenames.map((filename) => [filename, () => undefined] as const),\n );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAKO,MAAM,cAAc,IAAI,cAC7B,OAAO;AAAA,EACL,UAAU,IAAI,CAAC,aAAa,CAAC,UAAU,MAAM,MAAS,CAAU;AAClE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,3 @@
|
|
|
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 javascript_exports = {};
|
|
20
|
-
__export(javascript_exports, {
|
|
21
|
-
prependImport: () => prependImport,
|
|
22
|
-
stripImports: () => stripImports
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(javascript_exports);
|
|
25
1
|
const prependImport = (name, file) => [`import '${name}';
|
|
26
2
|
`, file].filter((value) => value !== void 0).join("\n");
|
|
27
3
|
const stripImports = (names, inputFile) => {
|
|
@@ -30,9 +6,8 @@ const stripImports = (names, inputFile) => {
|
|
|
30
6
|
return `${outputFile}
|
|
31
7
|
`;
|
|
32
8
|
};
|
|
33
|
-
|
|
34
|
-
0 && (module.exports = {
|
|
9
|
+
export {
|
|
35
10
|
prependImport,
|
|
36
11
|
stripImports
|
|
37
|
-
}
|
|
12
|
+
};
|
|
38
13
|
//# sourceMappingURL=javascript.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/javascript.ts"],
|
|
4
4
|
"sourcesContent": ["export const prependImport = (name: string, file?: string) =>\n [`import '${name}';\\n`, file]\n .filter((value) => value !== undefined)\n .join('\\n');\n\nexport const stripImports = (names: readonly string[], inputFile: string) => {\n const searchStrings = names.flatMap((name) => [`'${name}'`, `\"${name}\"`]);\n\n const outputFile = inputFile\n .split(/\\r?\\n/)\n .filter((line) => !searchStrings.some((str) => line.includes(str)))\n .join('\\n')\n .trim();\n\n return `${outputFile}\\n`;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAO,MAAM,gBAAgB,CAAC,MAAc,SAC1C,CAAC,WAAW,IAAI;AAAA,GAAQ,IAAI,EACzB,OAAO,CAAC,UAAU,UAAU,MAAS,EACrC,KAAK,IAAI;AAEP,MAAM,eAAe,CAAC,OAA0B,cAAsB;AAC3E,QAAM,gBAAgB,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC;AAExE,QAAM,aAAa,UAChB,MAAM,OAAO,EACb,OAAO,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,QAAQ,KAAK,SAAS,GAAG,CAAC,CAAC,EACjE,KAAK,IAAI,EACT,KAAK;AAER,SAAO,GAAG,UAAU;AAAA;AACtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 json_exports = {};
|
|
20
|
-
__export(json_exports, {
|
|
21
|
-
formatObject: () => formatObject,
|
|
22
|
-
parseObject: () => parseObject
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(json_exports);
|
|
25
|
-
var import_validation = require("../../../utils/validation.js");
|
|
26
|
-
var import_prettier = require("./prettier.js");
|
|
1
|
+
import { isObject } from "../../../utils/validation.js";
|
|
2
|
+
import { formatPrettier } from "./prettier.js";
|
|
27
3
|
const formatObject = (data, filepath) => {
|
|
28
4
|
const sortedData = Object.fromEntries(
|
|
29
5
|
Object.entries(data).sort(
|
|
@@ -31,7 +7,7 @@ const formatObject = (data, filepath) => {
|
|
|
31
7
|
)
|
|
32
8
|
);
|
|
33
9
|
const output = JSON.stringify(sortedData, null, 2);
|
|
34
|
-
return
|
|
10
|
+
return formatPrettier(
|
|
35
11
|
output,
|
|
36
12
|
filepath === void 0 ? { parser: "json" } : { filepath }
|
|
37
13
|
);
|
|
@@ -42,16 +18,15 @@ const parseObject = (input) => {
|
|
|
42
18
|
}
|
|
43
19
|
try {
|
|
44
20
|
const data = JSON.parse(input);
|
|
45
|
-
if (
|
|
21
|
+
if (isObject(data)) {
|
|
46
22
|
return data;
|
|
47
23
|
}
|
|
48
24
|
} catch {
|
|
49
25
|
}
|
|
50
26
|
return;
|
|
51
27
|
};
|
|
52
|
-
|
|
53
|
-
0 && (module.exports = {
|
|
28
|
+
export {
|
|
54
29
|
formatObject,
|
|
55
30
|
parseObject
|
|
56
|
-
}
|
|
31
|
+
};
|
|
57
32
|
//# sourceMappingURL=json.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/json.ts"],
|
|
4
4
|
"sourcesContent": ["import { isObject } from '../../../utils/validation.js';\n\nimport { formatPrettier } from './prettier.js';\n\nexport const formatObject = (\n data: Record<Exclude<PropertyKey, symbol>, unknown>,\n filepath?: string,\n) => {\n const sortedData = Object.fromEntries(\n Object.entries(data).sort(([keyA], [keyB]) =>\n String(keyA).localeCompare(String(keyB)),\n ),\n );\n\n const output = JSON.stringify(sortedData, null, 2);\n\n return formatPrettier(\n output,\n filepath === undefined ? { parser: 'json' } : { filepath },\n );\n};\n\nexport const parseObject = (\n input: string | undefined,\n): Record<Exclude<PropertyKey, symbol>, unknown> | undefined => {\n if (input === undefined) {\n return;\n }\n\n try {\n const data = JSON.parse(input) as unknown;\n\n if (isObject(data)) {\n return data;\n }\n } catch {}\n\n return;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAEzB,SAAS,sBAAsB;AAExB,MAAM,eAAe,CAC1B,MACA,aACG;AACH,QAAM,aAAa,OAAO;AAAA,IACxB,OAAO,QAAQ,IAAI,EAAE;AAAA,MAAK,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,MACtC,OAAO,IAAI,EAAE,cAAc,OAAO,IAAI,CAAC;AAAA,IACzC;AAAA,EACF;AAEA,QAAM,SAAS,KAAK,UAAU,YAAY,MAAM,CAAC;AAEjD,SAAO;AAAA,IACL;AAAA,IACA,aAAa,SAAY,EAAE,QAAQ,OAAO,IAAI,EAAE,SAAS;AAAA,EAC3D;AACF;AAEO,MAAM,cAAc,CACzB,UAC8D;AAC9D,MAAI,UAAU,QAAW;AACvB;AAAA,EACF;AAEA,MAAI;AACF,UAAM,OAAO,KAAK,MAAM,KAAK;AAE7B,QAAI,SAAS,IAAI,GAAG;AAClB,aAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAAC;AAET;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,31 +1,7 @@
|
|
|
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 loadFiles_exports = {};
|
|
20
|
-
__export(loadFiles_exports, {
|
|
21
|
-
loadFiles: () => loadFiles
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(loadFiles_exports);
|
|
24
1
|
const loadFiles = (...filenames) => Object.fromEntries(
|
|
25
2
|
filenames.map((filename) => [filename, (file) => file])
|
|
26
3
|
);
|
|
27
|
-
|
|
28
|
-
0 && (module.exports = {
|
|
4
|
+
export {
|
|
29
5
|
loadFiles
|
|
30
|
-
}
|
|
6
|
+
};
|
|
31
7
|
//# sourceMappingURL=loadFiles.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/loadFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Module } from '../types.js';\n\n/**\n * Load files into cache to perform side effects in another module.\n */\nexport const loadFiles = (...filenames: string[]): Module =>\n Object.fromEntries(\n filenames.map((filename) => [filename, (file?: string) => file] as const),\n );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAKO,MAAM,YAAY,IAAI,cAC3B,OAAO;AAAA,EACL,UAAU,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAkB,IAAI,CAAU;AAC1E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 module_exports = {};
|
|
20
|
-
__export(module_exports, {
|
|
21
|
-
replacePackageReferences: () => replacePackageReferences
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(module_exports);
|
|
24
|
-
var import_copy = require("../../../utils/copy.js");
|
|
25
|
-
const replacePackageReferences = (props) => (0, import_copy.createStringReplacer)([
|
|
1
|
+
import { createStringReplacer } from "../../../utils/copy.js";
|
|
2
|
+
const replacePackageReferences = (props) => createStringReplacer([
|
|
26
3
|
{
|
|
27
4
|
input: new RegExp(`(['"])${props.old.packageName}(['"/])`, "g"),
|
|
28
5
|
output: `$1${props.new.packageName}$2`
|
|
@@ -32,8 +9,7 @@ const replacePackageReferences = (props) => (0, import_copy.createStringReplacer
|
|
|
32
9
|
output: props.new.repoSlug
|
|
33
10
|
}
|
|
34
11
|
]);
|
|
35
|
-
|
|
36
|
-
0 && (module.exports = {
|
|
12
|
+
export {
|
|
37
13
|
replacePackageReferences
|
|
38
|
-
}
|
|
14
|
+
};
|
|
39
15
|
//# sourceMappingURL=module.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/module.ts"],
|
|
4
4
|
"sourcesContent": ["import { createStringReplacer } from '../../../utils/copy.js';\n\nexport const replacePackageReferences = (props: {\n old: {\n packageName: string;\n repoSlug: string;\n };\n new: {\n packageName: string;\n repoSlug: string;\n };\n}) =>\n createStringReplacer([\n {\n input: new RegExp(`(['\"])${props.old.packageName}(['\"/])`, 'g'),\n output: `$1${props.new.packageName}$2`,\n },\n {\n input: new RegExp(props.old.repoSlug, 'ig'),\n output: props.new.repoSlug,\n },\n ]);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,SAAS,4BAA4B;AAE9B,MAAM,2BAA2B,CAAC,UAUvC,qBAAqB;AAAA,EACnB;AAAA,IACE,OAAO,IAAI,OAAO,SAAS,MAAM,IAAI,WAAW,WAAW,GAAG;AAAA,IAC9D,QAAQ,KAAK,MAAM,IAAI,WAAW;AAAA,EACpC;AAAA,EACA;AAAA,IACE,OAAO,IAAI,OAAO,MAAM,IAAI,UAAU,IAAI;AAAA,IAC1C,QAAQ,MAAM,IAAI;AAAA,EACpB;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,71 +1,5 @@
|
|
|
1
1
|
import type { PackageJson } from '../types.js';
|
|
2
2
|
export declare const formatPackage: (rawData: PackageJson) => Promise<string>;
|
|
3
3
|
export declare const parsePackage: (input: string | undefined) => PackageJson | undefined;
|
|
4
|
-
export declare const createDependencyFilter: (names: readonly string[], type: "dependencies" | "devDependencies") => (data: PackageJson) =>
|
|
5
|
-
[x: string]: unknown;
|
|
6
|
-
name?: string;
|
|
7
|
-
version?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
keywords?: string[];
|
|
10
|
-
homepage?: import("type-fest").LiteralUnion<".", string>;
|
|
11
|
-
bugs?: import("type-fest").PackageJson.BugsLocation;
|
|
12
|
-
license?: string;
|
|
13
|
-
licenses?: Array<{
|
|
14
|
-
type?: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
}>;
|
|
17
|
-
author?: import("type-fest").PackageJson.Person;
|
|
18
|
-
contributors?: import("type-fest").PackageJson.Person[];
|
|
19
|
-
maintainers?: import("type-fest").PackageJson.Person[];
|
|
20
|
-
files?: string[];
|
|
21
|
-
type?: "module" | "commonjs";
|
|
22
|
-
main?: string;
|
|
23
|
-
exports?: import("type-fest").PackageJson.Exports;
|
|
24
|
-
imports?: import("type-fest").PackageJson.Imports;
|
|
25
|
-
bin?: string | Partial<Record<string, string>>;
|
|
26
|
-
man?: string | string[];
|
|
27
|
-
directories?: import("type-fest").PackageJson.DirectoryLocations;
|
|
28
|
-
repository?: string | {
|
|
29
|
-
type: string;
|
|
30
|
-
url: string;
|
|
31
|
-
directory?: string;
|
|
32
|
-
};
|
|
33
|
-
scripts?: import("type-fest").PackageJson.Scripts;
|
|
34
|
-
config?: Record<string, unknown>;
|
|
35
|
-
dependencies?: import("type-fest").PackageJson.Dependency;
|
|
36
|
-
devDependencies?: import("type-fest").PackageJson.Dependency;
|
|
37
|
-
optionalDependencies?: import("type-fest").PackageJson.Dependency;
|
|
38
|
-
peerDependencies?: import("type-fest").PackageJson.Dependency;
|
|
39
|
-
peerDependenciesMeta?: Partial<Record<string, {
|
|
40
|
-
optional: true;
|
|
41
|
-
}>>;
|
|
42
|
-
bundledDependencies?: string[];
|
|
43
|
-
bundleDependencies?: string[];
|
|
44
|
-
engines?: { [EngineName in "npm" | "node" | string]?: string; };
|
|
45
|
-
engineStrict?: boolean;
|
|
46
|
-
os?: Array<import("type-fest").LiteralUnion<"aix" | "darwin" | "freebsd" | "linux" | "openbsd" | "sunos" | "win32" | "!aix" | "!darwin" | "!freebsd" | "!linux" | "!openbsd" | "!sunos" | "!win32", string>>;
|
|
47
|
-
cpu?: Array<import("type-fest").LiteralUnion<"arm" | "arm64" | "ia32" | "mips" | "mipsel" | "ppc" | "ppc64" | "s390" | "s390x" | "x32" | "x64" | "!arm" | "!arm64" | "!ia32" | "!mips" | "!mipsel" | "!ppc" | "!ppc64" | "!s390" | "!s390x" | "!x32" | "!x64", string>>;
|
|
48
|
-
preferGlobal?: boolean;
|
|
49
|
-
private?: boolean;
|
|
50
|
-
publishConfig?: import("type-fest").PackageJson.PublishConfig;
|
|
51
|
-
funding?: string | {
|
|
52
|
-
type?: import("type-fest").LiteralUnion<"github" | "opencollective" | "patreon" | "individual" | "foundation" | "corporation", string>;
|
|
53
|
-
url: string;
|
|
54
|
-
};
|
|
55
|
-
module?: string;
|
|
56
|
-
esnext?: string | {
|
|
57
|
-
[moduleName: string]: string | undefined;
|
|
58
|
-
main?: string;
|
|
59
|
-
browser?: string;
|
|
60
|
-
};
|
|
61
|
-
browser?: string | Partial<Record<string, string | false>>;
|
|
62
|
-
sideEffects?: boolean | string[];
|
|
63
|
-
types?: string;
|
|
64
|
-
typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
|
|
65
|
-
typings?: string;
|
|
66
|
-
workspaces?: import("type-fest").PackageJson.WorkspacePattern[] | import("type-fest").PackageJson.WorkspaceConfig;
|
|
67
|
-
flat?: boolean;
|
|
68
|
-
resolutions?: import("type-fest").PackageJson.Dependency;
|
|
69
|
-
jspm?: import("type-fest").PackageJson;
|
|
70
|
-
};
|
|
4
|
+
export declare const createDependencyFilter: (names: readonly string[], type: "dependencies" | "devDependencies") => (data: PackageJson) => PackageJson;
|
|
71
5
|
export declare const withPackage: (fn: (data: PackageJson) => PackageJson) => (input: string | undefined) => Promise<string>;
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 package_exports = {};
|
|
30
|
-
__export(package_exports, {
|
|
31
|
-
createDependencyFilter: () => createDependencyFilter,
|
|
32
|
-
formatPackage: () => formatPackage,
|
|
33
|
-
parsePackage: () => parsePackage,
|
|
34
|
-
withPackage: () => withPackage
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(package_exports);
|
|
37
|
-
var import_normalize_package_data = __toESM(require("normalize-package-data"));
|
|
38
|
-
var import_json = require("./json.js");
|
|
39
|
-
var import_prettier = require("./prettier.js");
|
|
1
|
+
import normalizeData from "normalize-package-data";
|
|
2
|
+
import { parseObject } from "./json.js";
|
|
3
|
+
import { formatPrettier } from "./prettier.js";
|
|
40
4
|
const normalizeDataWithoutThrowing = (rawData) => {
|
|
41
5
|
try {
|
|
42
|
-
(
|
|
6
|
+
normalizeData(rawData);
|
|
43
7
|
} catch {
|
|
44
8
|
}
|
|
45
9
|
};
|
|
@@ -55,12 +19,12 @@ const formatPackage = async (rawData) => {
|
|
|
55
19
|
if (rawData.version === "") {
|
|
56
20
|
delete rawData.version;
|
|
57
21
|
}
|
|
58
|
-
return
|
|
22
|
+
return formatPrettier(JSON.stringify(rawData), {
|
|
59
23
|
filepath: "package.json"
|
|
60
24
|
});
|
|
61
25
|
};
|
|
62
26
|
const parsePackage = (input) => {
|
|
63
|
-
const data =
|
|
27
|
+
const data = parseObject(input);
|
|
64
28
|
if (data === void 0) {
|
|
65
29
|
return;
|
|
66
30
|
}
|
|
@@ -81,11 +45,10 @@ const withPackage = (fn) => (input) => {
|
|
|
81
45
|
const outputObject = fn(inputObject ?? {});
|
|
82
46
|
return formatPackage(outputObject);
|
|
83
47
|
};
|
|
84
|
-
|
|
85
|
-
0 && (module.exports = {
|
|
48
|
+
export {
|
|
86
49
|
createDependencyFilter,
|
|
87
50
|
formatPackage,
|
|
88
51
|
parsePackage,
|
|
89
52
|
withPackage
|
|
90
|
-
}
|
|
53
|
+
};
|
|
91
54
|
//# sourceMappingURL=package.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/package.ts"],
|
|
4
|
-
"sourcesContent": ["import normalizeData from 'normalize-package-data';\n\nimport type { PackageJson } from '../types.js';\n\nimport { parseObject } from './json.js';\nimport { formatPrettier } from './prettier.js';\n\nconst normalizeDataWithoutThrowing = (rawData: PackageJson) => {\n try {\n normalizeData(rawData);\n } catch {\n // `normalize-package-data` can be picky about e.g. the `name` being valid.\n // This creates issues for partially-init-ed projects.\n }\n};\n\nexport const formatPackage = async (rawData: PackageJson) => {\n normalizeDataWithoutThrowing(rawData);\n\n // normalize-package-data fields that aren't useful for applications\n\n delete rawData._id;\n\n if (rawData.name === '') {\n delete rawData.name;\n }\n\n if (rawData.readme === 'ERROR: No README data found!') {\n delete rawData.readme;\n }\n\n if (rawData.version === '') {\n delete rawData.version;\n }\n\n return formatPrettier(JSON.stringify(rawData), {\n filepath: 'package.json',\n });\n};\n\nexport const parsePackage = (\n input: string | undefined,\n): PackageJson | undefined => {\n const data = parseObject(input);\n\n if (data === undefined) {\n return;\n }\n\n normalizeDataWithoutThrowing(data);\n\n return data;\n};\n\nexport const createDependencyFilter = (\n names: readonly string[],\n type: 'dependencies' | 'devDependencies',\n) => {\n const set = new Set(names);\n\n return (data: PackageJson)
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import normalizeData from 'normalize-package-data';\n\nimport type { PackageJson } from '../types.js';\n\nimport { parseObject } from './json.js';\nimport { formatPrettier } from './prettier.js';\n\nconst normalizeDataWithoutThrowing = (rawData: PackageJson) => {\n try {\n normalizeData(rawData);\n } catch {\n // `normalize-package-data` can be picky about e.g. the `name` being valid.\n // This creates issues for partially-init-ed projects.\n }\n};\n\nexport const formatPackage = async (rawData: PackageJson) => {\n normalizeDataWithoutThrowing(rawData);\n\n // normalize-package-data fields that aren't useful for applications\n\n delete rawData._id;\n\n if (rawData.name === '') {\n delete rawData.name;\n }\n\n if (rawData.readme === 'ERROR: No README data found!') {\n delete rawData.readme;\n }\n\n if (rawData.version === '') {\n delete rawData.version;\n }\n\n return formatPrettier(JSON.stringify(rawData), {\n filepath: 'package.json',\n });\n};\n\nexport const parsePackage = (\n input: string | undefined,\n): PackageJson | undefined => {\n const data = parseObject(input) as PackageJson | undefined;\n\n if (data === undefined) {\n return;\n }\n\n normalizeDataWithoutThrowing(data);\n\n return data;\n};\n\nexport const createDependencyFilter = (\n names: readonly string[],\n type: 'dependencies' | 'devDependencies',\n) => {\n const set = new Set(names);\n\n return (data: PackageJson) =>\n ({\n ...data,\n [type]: Object.fromEntries(\n Object.entries(data[type] ?? {}).filter(([name]) => !set.has(name)),\n ),\n }) as PackageJson;\n};\n\nexport const withPackage =\n (fn: (data: PackageJson) => PackageJson) => (input: string | undefined) => {\n const inputObject = parsePackage(input);\n\n const outputObject = fn(inputObject ?? {});\n\n return formatPackage(outputObject);\n };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,mBAAmB;AAI1B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,MAAM,+BAA+B,CAAC,YAAyB;AAC7D,MAAI;AACF,kBAAc,OAAO;AAAA,EACvB,QAAQ;AAAA,EAGR;AACF;AAEO,MAAM,gBAAgB,OAAO,YAAyB;AAC3D,+BAA6B,OAAO;AAIpC,SAAO,QAAQ;AAEf,MAAI,QAAQ,SAAS,IAAI;AACvB,WAAO,QAAQ;AAAA,EACjB;AAEA,MAAI,QAAQ,WAAW,gCAAgC;AACrD,WAAO,QAAQ;AAAA,EACjB;AAEA,MAAI,QAAQ,YAAY,IAAI;AAC1B,WAAO,QAAQ;AAAA,EACjB;AAEA,SAAO,eAAe,KAAK,UAAU,OAAO,GAAG;AAAA,IAC7C,UAAU;AAAA,EACZ,CAAC;AACH;AAEO,MAAM,eAAe,CAC1B,UAC4B;AAC5B,QAAM,OAAO,YAAY,KAAK;AAE9B,MAAI,SAAS,QAAW;AACtB;AAAA,EACF;AAEA,+BAA6B,IAAI;AAEjC,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,OACA,SACG;AACH,QAAM,MAAM,IAAI,IAAI,KAAK;AAEzB,SAAO,CAAC,UACL;AAAA,IACC,GAAG;AAAA,IACH,CAAC,IAAI,GAAG,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;AAAA,IACpE;AAAA,EACF;AACJ;AAEO,MAAM,cACX,CAAC,OAA2C,CAAC,UAA8B;AACzE,QAAM,cAAc,aAAa,KAAK;AAEtC,QAAM,eAAe,GAAG,eAAe,CAAC,CAAC;AAEzC,SAAO,cAAc,YAAY;AACnC;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,46 +1,12 @@
|
|
|
1
|
-
|
|
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 prettier_exports = {};
|
|
30
|
-
__export(prettier_exports, {
|
|
31
|
-
formatPrettier: () => formatPrettier
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(prettier_exports);
|
|
34
|
-
var import_prettier = __toESM(require("../../../../config/prettier.js"));
|
|
1
|
+
import prettierConfig from "../../../../config/prettier.js";
|
|
35
2
|
const formatPrettier = async (source, options) => {
|
|
36
3
|
const prettier = await import("prettier");
|
|
37
4
|
return prettier.format(source, {
|
|
38
5
|
...options,
|
|
39
|
-
...
|
|
6
|
+
...prettierConfig
|
|
40
7
|
});
|
|
41
8
|
};
|
|
42
|
-
|
|
43
|
-
0 && (module.exports = {
|
|
9
|
+
export {
|
|
44
10
|
formatPrettier
|
|
45
|
-
}
|
|
11
|
+
};
|
|
46
12
|
//# sourceMappingURL=prettier.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/processing/prettier.ts"],
|
|
4
4
|
"sourcesContent": ["import type prettier from 'prettier';\n\nimport prettierConfig from '../../../../config/prettier.js';\n\ntype Options = Pick<prettier.Options, 'filepath' | 'parser'>;\n\nexport const formatPrettier = async (source: string, options: Options) => {\n const prettier = await import('prettier');\n return prettier.format(source, {\n ...options,\n ...prettierConfig,\n });\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAEA,OAAO,oBAAoB;AAIpB,MAAM,iBAAiB,OAAO,QAAgB,YAAqB;AACxE,QAAM,WAAW,MAAM,OAAO,UAAU;AACxC,SAAO,SAAS,OAAO,QAAQ;AAAA,IAC7B,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|