skuba 13.0.3 → 14.0.0-esmify-skuba-20251031135439
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/eslint.js +1 -1
- package/config/prettier.js +10 -2
- package/lib/cli/adapter/eslint.js +10 -46
- package/lib/cli/adapter/eslint.js.map +2 -2
- package/lib/cli/adapter/prettier.js +40 -72
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +7 -43
- package/lib/cli/build/args.js.map +2 -2
- package/lib/cli/build/assets.js +27 -62
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.js +20 -55
- package/lib/cli/build/esbuild.js.map +3 -3
- package/lib/cli/build/index.js +20 -56
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/build/tsc.js +24 -66
- package/lib/cli/build/tsc.js.map +2 -2
- package/lib/cli/buildPackage/index.js +7 -33
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +15 -51
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/analyseDependencies.js +24 -60
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +4 -40
- package/lib/cli/configure/analysis/diff.js.map +2 -2
- package/lib/cli/configure/analysis/files.js +7 -43
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +11 -47
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/configure/analysis/package.js +10 -48
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +18 -53
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +5 -39
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +3 -29
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +3 -29
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +3 -29
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +1 -27
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +4 -32
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +31 -61
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.js +13 -49
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/getProjectType.js +13 -36
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +49 -85
- package/lib/cli/configure/index.js.map +3 -3
- package/lib/cli/configure/modules/eslint.js +9 -35
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +7 -33
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +17 -45
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/nodemon.js +2 -28
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +9 -35
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +10 -36
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +17 -43
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +1 -27
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +2 -28
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +4 -44
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +1 -27
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +2 -30
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +6 -34
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +1 -27
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +2 -28
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.js +10 -52
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +3 -39
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +4 -44
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +28 -70
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/types.js +0 -15
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +19 -55
- package/lib/cli/format/index.js.map +2 -2
- package/lib/cli/help/index.js +5 -31
- package/lib/cli/help/index.js.map +1 -1
- package/lib/cli/init/getConfig.js +75 -107
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.js +16 -54
- package/lib/cli/init/git.js.map +3 -3
- package/lib/cli/init/index.js +66 -99
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.js +20 -56
- package/lib/cli/init/prompts.js.map +3 -3
- package/lib/cli/init/types.js +6 -42
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +5 -39
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +7 -43
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +2 -38
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +10 -46
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +2 -38
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +2 -38
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +2 -38
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +1 -27
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +10 -46
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +1 -27
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +1 -27
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +3 -29
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +5 -31
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +38 -78
- package/lib/cli/lint/autofix.js.map +3 -3
- package/lib/cli/lint/eslint.js +14 -52
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +18 -53
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +24 -50
- package/lib/cli/lint/index.js.map +1 -1
- package/lib/cli/lint/internal.js +17 -53
- package/lib/cli/lint/internal.js.map +2 -2
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +8 -36
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +10 -46
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +20 -56
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +33 -68
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +21 -54
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +5 -31
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +36 -73
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +11 -49
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +24 -64
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +11 -49
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +5 -31
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +11 -49
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +11 -49
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +11 -49
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +32 -76
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +9 -35
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +28 -88
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +15 -53
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +16 -52
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +9 -35
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +9 -45
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +11 -47
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +14 -50
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +9 -40
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +12 -48
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +10 -46
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +3 -29
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +7 -33
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +1 -1
- package/lib/cli/lint/prettier.js +13 -51
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +3 -29
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +0 -15
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.js +9 -35
- package/lib/cli/migrate/index.js.map +1 -1
- package/lib/cli/migrate/nodeVersion/checks.js +26 -68
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.js +24 -56
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/node/index.js +20 -60
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +3 -29
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +15 -51
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +3 -45
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/version/index.js +5 -31
- package/lib/cli/version/index.js.map +1 -1
- package/lib/config/prettier.d.ts +7 -0
- package/lib/index.js +4 -49
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +26 -44
- package/lib/skuba.js.map +3 -3
- package/lib/{cli → src/cli}/configure/analyseDependencies.d.ts +1 -1
- package/lib/{cli → src/cli}/configure/analysis/package.d.ts +2 -3
- package/lib/{cli → src/cli}/configure/ensureTemplateCompletion.d.ts +1 -1
- package/lib/{cli → src/cli}/configure/getEntryPoint.d.ts +1 -1
- package/lib/{cli → src/cli}/configure/getProjectType.d.ts +1 -1
- package/lib/src/cli/configure/processing/package.d.ts +5 -0
- package/lib/{cli → src/cli}/configure/types.d.ts +15 -4
- package/lib/{cli → src/cli}/init/getConfig.d.ts +1 -1
- package/lib/{cli → src/cli}/init/prompts.d.ts +4 -4
- package/lib/{cli → src/cli}/lint/internalLints/upgrade/index.d.ts +1 -1
- package/lib/{index.d.ts → src/index.d.ts} +0 -1
- package/lib/src/utils/fs.d.ts +1 -0
- package/lib/{utils → src/utils}/manifest.d.ts +3 -2
- package/lib/src/utils/sleep.d.ts +5 -0
- package/lib/{utils → src/utils}/wait.d.ts +0 -4
- package/lib/{wrapper → src/wrapper}/http.d.ts +0 -6
- package/lib/src/wrapper/server.d.ts +7 -0
- package/lib/utils/args.js +8 -50
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +6 -50
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +22 -64
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +37 -84
- package/lib/utils/dir.js.map +3 -3
- package/lib/utils/env.js +1 -27
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +11 -53
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.js +26 -70
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +15 -0
- package/lib/utils/fs.js.map +7 -0
- package/lib/utils/help.js +5 -31
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/logging.js +13 -55
- package/lib/utils/logging.js.map +2 -2
- package/lib/utils/logo.js +23 -59
- package/lib/utils/logo.js.map +2 -2
- package/lib/utils/manifest.js +12 -60
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +1 -27
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +14 -56
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +4 -42
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +9 -0
- package/lib/utils/sleep.js.map +7 -0
- package/lib/utils/template.js +21 -68
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +6 -42
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +11 -53
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +6 -42
- package/lib/utils/wait.js.map +2 -2
- package/lib/utils/worker.js +9 -37
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/functionHandler.js +17 -50
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.js +7 -53
- package/lib/wrapper/http.js.map +3 -3
- package/lib/wrapper/index.js +6 -6
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +7 -43
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +12 -47
- package/lib/wrapper/requestListener.js.map +3 -3
- package/lib/wrapper/server.js +9 -0
- package/lib/wrapper/server.js.map +7 -0
- package/package.json +19 -24
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +3 -2
- package/template/base/vitest.config.ts +25 -0
- package/template/express-rest-api/.gantry/dev.yml +2 -2
- package/template/express-rest-api/.gantry/prod.yml +2 -2
- package/template/express-rest-api/package.json +6 -5
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +1 -0
- package/template/greeter/package.json +4 -3
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +3 -1
- package/template/koa-rest-api/.gantry/dev.yml +2 -2
- package/template/koa-rest-api/.gantry/prod.yml +2 -2
- package/template/koa-rest-api/package.json +6 -5
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -0
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +2 -0
- package/template/koa-rest-api/src/app.test.ts +2 -0
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +2 -0
- package/template/koa-rest-api/src/testing/metrics.ts +2 -0
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +15 -3
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +11 -9
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +6 -5
- package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +22 -13
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +1 -0
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +33 -31
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +8 -2
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -2
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +4 -3
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/_package.json +1 -0
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +2 -0
- package/template/private-npm-package/_package.json +1 -0
- package/template/private-npm-package/skuba.template.js +1 -1
- package/template/private-npm-package/src/index.test.ts +2 -0
- package/config/jest.js +0 -1
- package/config/prettier.d.ts +0 -4
- package/jest/moduleNameMapper.js +0 -64
- package/jest/transform.js +0 -62
- package/jest/tsConfig.js +0 -26
- package/jest-preset.js +0 -37
- package/lib/api/jest/index.d.ts +0 -15
- package/lib/api/jest/index.js +0 -59
- package/lib/api/jest/index.js.map +0 -7
- package/lib/cli/configure/modules/jest.d.ts +0 -2
- package/lib/cli/configure/modules/jest.js +0 -86
- package/lib/cli/configure/modules/jest.js.map +0 -7
- package/lib/cli/configure/processing/package.d.ts +0 -71
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
- package/lib/cli/test/reporters/github/annotations.d.ts +0 -9
- package/lib/cli/test/reporters/github/annotations.js +0 -102
- package/lib/cli/test/reporters/github/annotations.js.map +0 -7
- package/lib/cli/test/reporters/github/index.d.ts +0 -5
- package/lib/cli/test/reporters/github/index.js +0 -74
- package/lib/cli/test/reporters/github/index.js.map +0 -7
- package/template/base/jest.config.ts +0 -19
- package/template/base/jest.setup.ts +0 -3
- /package/lib/{cli → src/cli}/adapter/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/adapter/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/args.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/assets.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/esbuild.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/build/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/buildPackage/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analyseConfiguration.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/diff.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/files.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/git.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/analysis/project.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/seekDatadogCustomMetrics.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/seekKoala.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/skuba.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/skubaDeps.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/dependencies/skubaDive.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/ignore.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/nodemon.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/package.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/renovate.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/serverless.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/modules/tslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/configFile.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/deleteFiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/javascript.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/json.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/loadFiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/module.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/record.d.ts +0 -0
- /package/lib/{cli → src/cli}/configure/processing/typescript.d.ts +0 -0
- /package/lib/{cli → src/cli}/format/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/help/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/git.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/types.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/validation.d.ts +0 -0
- /package/lib/{cli → src/cli}/init/writePackageJson.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/internal.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/buildkite/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/internal.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/github/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/annotate/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/autofix.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/eslint.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/external.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internal.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/detectBadCodeowners.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/noSkubaTemplateJs.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/patchRenovateConfig.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/refreshConfigFiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.0.2/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.1.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.3.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.0.1/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/prettier.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/tsc.d.ts +0 -0
- /package/lib/{cli → src/cli}/lint/types.d.ts +0 -0
- /package/lib/{cli → src/cli}/migrate/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/migrate/nodeVersion/checks.d.ts +0 -0
- /package/lib/{cli → src/cli}/migrate/nodeVersion/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/node/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/release/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/start/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/test/index.d.ts +0 -0
- /package/lib/{cli → src/cli}/version/index.d.ts +0 -0
- /package/lib/{skuba.d.ts → src/skuba.d.ts} +0 -0
- /package/lib/{utils → src/utils}/args.d.ts +0 -0
- /package/lib/{utils → src/utils}/command.d.ts +0 -0
- /package/lib/{utils → src/utils}/copy.d.ts +0 -0
- /package/lib/{utils → src/utils}/dir.d.ts +0 -0
- /package/lib/{utils → src/utils}/env.d.ts +0 -0
- /package/lib/{utils → src/utils}/error.d.ts +0 -0
- /package/lib/{utils → src/utils}/exec.d.ts +0 -0
- /package/lib/{utils → src/utils}/help.d.ts +0 -0
- /package/lib/{utils → src/utils}/logging.d.ts +0 -0
- /package/lib/{utils → src/utils}/logo.d.ts +0 -0
- /package/lib/{utils → src/utils}/npmrc.d.ts +0 -0
- /package/lib/{utils → src/utils}/packageManager.d.ts +0 -0
- /package/lib/{utils → src/utils}/port.d.ts +0 -0
- /package/lib/{utils → src/utils}/template.d.ts +0 -0
- /package/lib/{utils → src/utils}/validation.d.ts +0 -0
- /package/lib/{utils → src/utils}/version.d.ts +0 -0
- /package/lib/{utils → src/utils}/worker.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/functionHandler.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/index.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/main.d.ts +0 -0
- /package/lib/{wrapper → src/wrapper}/requestListener.d.ts +0 -0
package/lib/cli/build/esbuild.js
CHANGED
|
@@ -1,47 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 esbuild_exports = {};
|
|
30
|
-
__export(esbuild_exports, {
|
|
31
|
-
esbuild: () => esbuild
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(esbuild_exports);
|
|
34
|
-
var import_util = require("util");
|
|
35
|
-
var import_tsconfig_paths = __toESM(require("@esbuild-plugins/tsconfig-paths"));
|
|
36
|
-
var import_esbuild = require("esbuild");
|
|
37
|
-
var import_typescript = require("typescript");
|
|
38
|
-
var import_logging = require("../../utils/logging.js");
|
|
39
|
-
var import_args = require("./args.js");
|
|
40
|
-
var import_tsc = require("./tsc.js");
|
|
41
|
-
const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
42
|
-
const log = (0, import_logging.createLogger)({ debug });
|
|
43
|
-
const tscArgs = (0, import_args.parseTscArgs)(args);
|
|
44
|
-
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
2
|
+
import { inspect } from "util";
|
|
3
|
+
import { TsconfigPathsPlugin } from "@esbuild-plugins/tsconfig-paths";
|
|
4
|
+
import { build } from "esbuild";
|
|
5
|
+
import { ModuleKind, ModuleResolutionKind, ScriptTarget } from "typescript";
|
|
6
|
+
import { createLogger } from "../../utils/logging.js";
|
|
7
|
+
import { parseTscArgs } from "./args.js";
|
|
8
|
+
import { getCustomConditions, readTsBuildConfig, tsc } from "./tsc.js";
|
|
9
|
+
export const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
10
|
+
const log = createLogger({ debug });
|
|
11
|
+
const tscArgs = parseTscArgs(args);
|
|
12
|
+
const customConditions = getCustomConditions();
|
|
45
13
|
if (tscArgs.build) {
|
|
46
14
|
log.err(
|
|
47
15
|
"skuba does not currently support the tsc --build flag with esbuild"
|
|
@@ -49,7 +17,7 @@ const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
|
49
17
|
process.exitCode = 1;
|
|
50
18
|
return;
|
|
51
19
|
}
|
|
52
|
-
const parsedCommandLine =
|
|
20
|
+
const parsedCommandLine = readTsBuildConfig(args, log);
|
|
53
21
|
if (!parsedCommandLine || process.exitCode) {
|
|
54
22
|
return;
|
|
55
23
|
}
|
|
@@ -57,21 +25,22 @@ const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
|
57
25
|
log.debug(log.bold("Files"));
|
|
58
26
|
entryPoints.forEach((filepath) => log.debug(filepath));
|
|
59
27
|
log.debug(log.bold("Compiler options"));
|
|
60
|
-
log.debug(
|
|
28
|
+
log.debug(inspect(compilerOptions));
|
|
61
29
|
const start = process.hrtime.bigint();
|
|
62
30
|
const bundle = false;
|
|
63
|
-
const isEsm = compilerOptions.module !==
|
|
64
|
-
await
|
|
31
|
+
const isEsm = compilerOptions.module !== ModuleKind.CommonJS && type === "module";
|
|
32
|
+
await build({
|
|
65
33
|
bundle,
|
|
66
34
|
entryPoints,
|
|
67
35
|
format: !isEsm ? "cjs" : void 0,
|
|
68
36
|
outdir: compilerOptions.outDir,
|
|
69
37
|
logLevel: debug ? "debug" : "info",
|
|
70
38
|
logLimit: 0,
|
|
71
|
-
platform: compilerOptions.moduleResolution ===
|
|
39
|
+
platform: compilerOptions.moduleResolution === ModuleResolutionKind.NodeJs || compilerOptions.moduleResolution === ModuleResolutionKind.Node16 ? "node" : void 0,
|
|
72
40
|
plugins: bundle ? [] : [
|
|
73
41
|
// evanw/esbuild#394
|
|
74
|
-
|
|
42
|
+
// eslint-disable-next-line new-cap
|
|
43
|
+
TsconfigPathsPlugin({
|
|
75
44
|
tsconfig: { baseUrl: compilerOptions.baseUrl, compilerOptions }
|
|
76
45
|
})
|
|
77
46
|
],
|
|
@@ -80,22 +49,18 @@ const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
|
80
49
|
// avoid ambiguity where multiple `tsconfig.json`s are involved in a build.
|
|
81
50
|
// This would be unusual for a typical SEEK project but we can still explore
|
|
82
51
|
// an explicit setting once we implement `skuba.config.ts` (#1167).
|
|
83
|
-
target: compilerOptions.target ?
|
|
52
|
+
target: compilerOptions.target ? ScriptTarget[compilerOptions.target].toLocaleLowerCase() : void 0,
|
|
84
53
|
tsconfig: tscArgs.pathname,
|
|
85
54
|
conditions: customConditions?.length ? customConditions : void 0
|
|
86
55
|
});
|
|
87
56
|
const end = process.hrtime.bigint();
|
|
88
57
|
log.plain(`Built in ${log.timing(start, end)}.`);
|
|
89
58
|
if (compilerOptions.declaration) {
|
|
90
|
-
await
|
|
59
|
+
await tsc([
|
|
91
60
|
"--declaration",
|
|
92
61
|
"--emitDeclarationOnly",
|
|
93
62
|
...tscArgs.project ? ["--project", tscArgs.project] : []
|
|
94
63
|
]);
|
|
95
64
|
}
|
|
96
65
|
};
|
|
97
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
-
0 && (module.exports = {
|
|
99
|
-
esbuild
|
|
100
|
-
});
|
|
101
66
|
//# sourceMappingURL=esbuild.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/esbuild.ts"],
|
|
4
|
-
"sourcesContent": ["import { inspect } from 'util';\n\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { TsconfigPathsPlugin } from '@esbuild-plugins/tsconfig-paths';\nimport { build } from 'esbuild';\nimport { ModuleKind, ModuleResolutionKind, ScriptTarget } from 'typescript';\n\nimport { createLogger } from '../../utils/logging.js';\n\nimport { parseTscArgs } from './args.js';\nimport { getCustomConditions, readTsBuildConfig, tsc } from './tsc.js';\n\ninterface EsbuildParameters {\n debug: boolean;\n type: string | undefined;\n}\n\nexport const esbuild = async (\n { debug, type }: EsbuildParameters,\n args = process.argv.slice(2),\n) => {\n const log = createLogger({ debug });\n\n const tscArgs = parseTscArgs(args);\n\n const customConditions = getCustomConditions();\n\n if (tscArgs.build) {\n log.err(\n 'skuba does not currently support the tsc --build flag with esbuild',\n );\n process.exitCode = 1;\n return;\n }\n\n const parsedCommandLine = readTsBuildConfig(args, log);\n\n if (!parsedCommandLine || process.exitCode) {\n return;\n }\n\n const { fileNames: entryPoints, options: compilerOptions } =\n parsedCommandLine;\n\n log.debug(log.bold('Files'));\n entryPoints.forEach((filepath) => log.debug(filepath));\n\n log.debug(log.bold('Compiler options'));\n log.debug(inspect(compilerOptions));\n\n const start = process.hrtime.bigint();\n\n // TODO: support `bundle`, `minify`, `splitting`, `treeShaking`\n const bundle = false;\n\n const isEsm =\n compilerOptions.module !== ModuleKind.CommonJS && type === 'module';\n\n await build({\n bundle,\n entryPoints,\n format: !isEsm ? 'cjs' : undefined,\n outdir: compilerOptions.outDir,\n logLevel: debug ? 'debug' : 'info',\n logLimit: 0,\n platform:\n compilerOptions.moduleResolution === ModuleResolutionKind.NodeJs ||\n compilerOptions.moduleResolution === ModuleResolutionKind.Node16\n ? 'node'\n : undefined,\n plugins: bundle\n ? []\n : [\n // evanw/esbuild#394\n // eslint-disable-next-line new-cap\n TsconfigPathsPlugin({\n tsconfig: { baseUrl: compilerOptions.baseUrl, compilerOptions },\n }),\n ],\n sourcemap: compilerOptions.sourceMap,\n // TODO: as of 0.18, the esbuild CLI no longer infers the target property to\n // avoid ambiguity where multiple `tsconfig.json`s are involved in a build.\n // This would be unusual for a typical SEEK project but we can still explore\n // an explicit setting once we implement `skuba.config.ts` (#1167).\n target: compilerOptions.target\n ? ScriptTarget[compilerOptions.target].toLocaleLowerCase()\n : undefined,\n tsconfig: tscArgs.pathname,\n conditions: customConditions?.length ? customConditions : undefined,\n });\n\n const end = process.hrtime.bigint();\n\n log.plain(`Built in ${log.timing(start, end)}.`);\n\n if (compilerOptions.declaration) {\n await tsc([\n '--declaration',\n '--emitDeclarationOnly',\n ...(tscArgs.project ? ['--project', tscArgs.project] : []),\n ]);\n }\n};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAExB,SAAS,2BAA2B;AACpC,SAAS,aAAa;AACtB,SAAS,YAAY,sBAAsB,oBAAoB;AAE/D,SAAS,oBAAoB;AAE7B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB,mBAAmB,WAAW;AAOrD,aAAM,UAAU,OACrB,EAAE,OAAO,KAAK,GACd,OAAO,QAAQ,KAAK,MAAM,CAAC,MACxB;AACH,QAAM,MAAM,aAAa,EAAE,MAAM,CAAC;AAElC,QAAM,UAAU,aAAa,IAAI;AAEjC,QAAM,mBAAmB,oBAAoB;AAE7C,MAAI,QAAQ,OAAO;AACjB,QAAI;AAAA,MACF;AAAA,IACF;AACA,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,QAAM,oBAAoB,kBAAkB,MAAM,GAAG;AAErD,MAAI,CAAC,qBAAqB,QAAQ,UAAU;AAC1C;AAAA,EACF;AAEA,QAAM,EAAE,WAAW,aAAa,SAAS,gBAAgB,IACvD;AAEF,MAAI,MAAM,IAAI,KAAK,OAAO,CAAC;AAC3B,cAAY,QAAQ,CAAC,aAAa,IAAI,MAAM,QAAQ,CAAC;AAErD,MAAI,MAAM,IAAI,KAAK,kBAAkB,CAAC;AACtC,MAAI,MAAM,QAAQ,eAAe,CAAC;AAElC,QAAM,QAAQ,QAAQ,OAAO,OAAO;AAGpC,QAAM,SAAS;AAEf,QAAM,QACJ,gBAAgB,WAAW,WAAW,YAAY,SAAS;AAE7D,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ,CAAC,QAAQ,QAAQ;AAAA,IACzB,QAAQ,gBAAgB;AAAA,IACxB,UAAU,QAAQ,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UACE,gBAAgB,qBAAqB,qBAAqB,UAC1D,gBAAgB,qBAAqB,qBAAqB,SACtD,SACA;AAAA,IACN,SAAS,SACL,CAAC,IACD;AAAA;AAAA;AAAA,MAGE,oBAAoB;AAAA,QAClB,UAAU,EAAE,SAAS,gBAAgB,SAAS,gBAAgB;AAAA,MAChE,CAAC;AAAA,IACH;AAAA,IACJ,WAAW,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,IAK3B,QAAQ,gBAAgB,SACpB,aAAa,gBAAgB,MAAM,EAAE,kBAAkB,IACvD;AAAA,IACJ,UAAU,QAAQ;AAAA,IAClB,YAAY,kBAAkB,SAAS,mBAAmB;AAAA,EAC5D,CAAC;AAED,QAAM,MAAM,QAAQ,OAAO,OAAO;AAElC,MAAI,MAAM,YAAY,IAAI,OAAO,OAAO,GAAG,CAAC,GAAG;AAE/C,MAAI,gBAAgB,aAAa;AAC/B,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA,GAAI,QAAQ,UAAU,CAAC,aAAa,QAAQ,OAAO,IAAI,CAAC;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/lib/cli/build/index.js
CHANGED
|
@@ -1,67 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 build_exports = {};
|
|
30
|
-
__export(build_exports, {
|
|
31
|
-
build: () => build
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(build_exports);
|
|
34
|
-
var import_chalk = __toESM(require("chalk"));
|
|
35
|
-
var import_args = require("../../utils/args.js");
|
|
36
|
-
var import_logging = require("../../utils/logging.js");
|
|
37
|
-
var import_manifest = require("../../utils/manifest.js");
|
|
38
|
-
var import_assets = require("./assets.js");
|
|
39
|
-
var import_esbuild = require("./esbuild.js");
|
|
40
|
-
var import_tsc = require("./tsc.js");
|
|
41
|
-
const build = async (args = process.argv.slice(2)) => {
|
|
42
|
-
const manifest = await (0, import_manifest.getManifestProperties)("build");
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { hasDebugFlag } from "../../utils/args.js";
|
|
4
|
+
import { log } from "../../utils/logging.js";
|
|
5
|
+
import { getManifestProperties } from "../../utils/manifest.js";
|
|
6
|
+
import { copyAssets } from "./assets.js";
|
|
7
|
+
import { esbuild } from "./esbuild.js";
|
|
8
|
+
import { readTsBuildConfig, tsc } from "./tsc.js";
|
|
9
|
+
export const build = async (args = process.argv.slice(2)) => {
|
|
10
|
+
const manifest = await getManifestProperties("build");
|
|
43
11
|
switch (manifest?.value) {
|
|
44
12
|
case "esbuild": {
|
|
45
|
-
const debug =
|
|
46
|
-
|
|
47
|
-
await
|
|
13
|
+
const debug = hasDebugFlag(args);
|
|
14
|
+
log.plain(chalk.yellow("esbuild"));
|
|
15
|
+
await esbuild({ debug, type: manifest.type }, args);
|
|
48
16
|
break;
|
|
49
17
|
}
|
|
50
18
|
// TODO: flip the default case over to `esbuild` in skuba vNext.
|
|
51
19
|
case void 0:
|
|
52
20
|
case "tsc": {
|
|
53
|
-
|
|
54
|
-
await
|
|
21
|
+
log.plain(chalk.blue("tsc"));
|
|
22
|
+
await tsc(args);
|
|
55
23
|
break;
|
|
56
24
|
}
|
|
57
25
|
default: {
|
|
58
|
-
|
|
26
|
+
log.err(
|
|
59
27
|
"We don\u2019t support the build tool specified in your",
|
|
60
|
-
|
|
28
|
+
log.bold("package.json"),
|
|
61
29
|
"yet:"
|
|
62
30
|
);
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
log.err(
|
|
32
|
+
log.subtle(
|
|
65
33
|
JSON.stringify({ skuba: { build: manifest?.value } }, null, 2)
|
|
66
34
|
)
|
|
67
35
|
);
|
|
@@ -69,7 +37,7 @@ const build = async (args = process.argv.slice(2)) => {
|
|
|
69
37
|
return;
|
|
70
38
|
}
|
|
71
39
|
}
|
|
72
|
-
const parsedCommandLine =
|
|
40
|
+
const parsedCommandLine = readTsBuildConfig(args, log);
|
|
73
41
|
if (!parsedCommandLine || process.exitCode) {
|
|
74
42
|
return;
|
|
75
43
|
}
|
|
@@ -77,10 +45,6 @@ const build = async (args = process.argv.slice(2)) => {
|
|
|
77
45
|
if (!compilerOptions.outDir) {
|
|
78
46
|
return;
|
|
79
47
|
}
|
|
80
|
-
await
|
|
48
|
+
await copyAssets(compilerOptions.outDir);
|
|
81
49
|
};
|
|
82
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
-
0 && (module.exports = {
|
|
84
|
-
build
|
|
85
|
-
});
|
|
86
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/index.ts"],
|
|
4
4
|
"sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { log } from '../../utils/logging.js';\nimport { getManifestProperties } from '../../utils/manifest.js';\n\nimport { copyAssets } from './assets.js';\nimport { esbuild } from './esbuild.js';\nimport { readTsBuildConfig, tsc } from './tsc.js';\n\nexport const build = async (args = process.argv.slice(2)) => {\n // TODO: define a unified `package.json#/skuba` schema and parser so we don't\n // need all these messy lookups.\n const manifest = await getManifestProperties('build');\n\n switch (manifest?.value) {\n case 'esbuild': {\n const debug = hasDebugFlag(args);\n\n log.plain(chalk.yellow('esbuild'));\n await esbuild({ debug, type: manifest.type }, args);\n break;\n }\n\n // TODO: flip the default case over to `esbuild` in skuba vNext.\n case undefined:\n case 'tsc': {\n log.plain(chalk.blue('tsc'));\n await tsc(args);\n break;\n }\n\n default: {\n log.err(\n 'We don\u2019t support the build tool specified in your',\n log.bold('package.json'),\n 'yet:',\n );\n log.err(\n log.subtle(\n JSON.stringify({ skuba: { build: manifest?.value } }, null, 2),\n ),\n );\n process.exitCode = 1;\n return;\n }\n }\n\n const parsedCommandLine = readTsBuildConfig(args, log);\n\n if (!parsedCommandLine || process.exitCode) {\n return;\n }\n\n const { options: compilerOptions } = parsedCommandLine;\n\n if (!compilerOptions.outDir) {\n return;\n }\n\n await copyAssets(compilerOptions.outDir);\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,OAAO,WAAW;AAElB,SAAS,oBAAoB;AAC7B,SAAS,WAAW;AACpB,SAAS,6BAA6B;AAEtC,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,mBAAmB,WAAW;AAEhC,aAAM,QAAQ,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAG3D,QAAM,WAAW,MAAM,sBAAsB,OAAO;AAEpD,UAAQ,UAAU,OAAO;AAAA,IACvB,KAAK,WAAW;AACd,YAAM,QAAQ,aAAa,IAAI;AAE/B,UAAI,MAAM,MAAM,OAAO,SAAS,CAAC;AACjC,YAAM,QAAQ,EAAE,OAAO,MAAM,SAAS,KAAK,GAAG,IAAI;AAClD;AAAA,IACF;AAAA;AAAA,IAGA,KAAK;AAAA,IACL,KAAK,OAAO;AACV,UAAI,MAAM,MAAM,KAAK,KAAK,CAAC;AAC3B,YAAM,IAAI,IAAI;AACd;AAAA,IACF;AAAA,IAEA,SAAS;AACP,UAAI;AAAA,QACF;AAAA,QACA,IAAI,KAAK,cAAc;AAAA,QACvB;AAAA,MACF;AACA,UAAI;AAAA,QACF,IAAI;AAAA,UACF,KAAK,UAAU,EAAE,OAAO,EAAE,OAAO,UAAU,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,QAC/D;AAAA,MACF;AACA,cAAQ,WAAW;AACnB;AAAA,IACF;AAAA,EACF;AAEA,QAAM,oBAAoB,kBAAkB,MAAM,GAAG;AAErD,MAAI,CAAC,qBAAqB,QAAQ,UAAU;AAC1C;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,gBAAgB,IAAI;AAErC,MAAI,CAAC,gBAAgB,QAAQ;AAC3B;AAAA,EACF;AAEA,QAAM,WAAW,gBAAgB,MAAM;AACzC;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/lib/cli/build/tsc.js
CHANGED
|
@@ -1,58 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var tsc_exports = {};
|
|
30
|
-
__export(tsc_exports, {
|
|
31
|
-
getCustomConditions: () => getCustomConditions,
|
|
32
|
-
readTsBuildConfig: () => readTsBuildConfig,
|
|
33
|
-
readTsConfig: () => readTsConfig,
|
|
34
|
-
tsc: () => tsc
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(tsc_exports);
|
|
37
|
-
var import_path = __toESM(require("path"));
|
|
38
|
-
var import_typescript = __toESM(require("typescript"));
|
|
39
|
-
var import_exec = require("../../utils/exec.js");
|
|
40
|
-
var import_logging = require("../../utils/logging.js");
|
|
41
|
-
var import_args = require("./args.js");
|
|
2
|
+
import path from "path";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
import { exec } from "../../utils/exec.js";
|
|
5
|
+
import { log as logger } from "../../utils/logging.js";
|
|
6
|
+
import { parseTscArgs } from "./args.js";
|
|
42
7
|
const DEFAULT_ARGS = ["--project", "tsconfig.build.json"];
|
|
43
8
|
const formatHost = {
|
|
44
9
|
getCanonicalFileName: (fileName) => fileName,
|
|
45
|
-
getCurrentDirectory:
|
|
46
|
-
getNewLine: () =>
|
|
10
|
+
getCurrentDirectory: ts.sys.getCurrentDirectory.bind(void 0),
|
|
11
|
+
getNewLine: () => ts.sys.newLine
|
|
47
12
|
};
|
|
48
13
|
const tsconfigCache = /* @__PURE__ */ new Map();
|
|
49
|
-
const tsc = async (args = process.argv.slice(2)) => {
|
|
50
|
-
const tscArgs =
|
|
14
|
+
export const tsc = async (args = process.argv.slice(2)) => {
|
|
15
|
+
const tscArgs = parseTscArgs(args);
|
|
51
16
|
const defaultArgs = tscArgs.build || tscArgs.project ? [] : DEFAULT_ARGS;
|
|
52
|
-
return
|
|
17
|
+
return exec("tsc", ...defaultArgs, ...args);
|
|
53
18
|
};
|
|
54
|
-
const readTsBuildConfig = (args = process.argv.slice(2), log) => {
|
|
55
|
-
const tscArgs =
|
|
19
|
+
export const readTsBuildConfig = (args = process.argv.slice(2), log) => {
|
|
20
|
+
const tscArgs = parseTscArgs(args);
|
|
56
21
|
log.debug(
|
|
57
22
|
log.bold(
|
|
58
23
|
"tsconfig",
|
|
@@ -67,26 +32,26 @@ const readTsBuildConfig = (args = process.argv.slice(2), log) => {
|
|
|
67
32
|
});
|
|
68
33
|
if (parsedConfig?.errors.length) {
|
|
69
34
|
log.err(`Could not parse ${tscArgs.basename}.`);
|
|
70
|
-
log.subtle(
|
|
35
|
+
log.subtle(ts.formatDiagnostics(parsedConfig.errors, formatHost));
|
|
71
36
|
process.exitCode = 1;
|
|
72
37
|
return;
|
|
73
38
|
}
|
|
74
39
|
return parsedConfig;
|
|
75
40
|
};
|
|
76
|
-
const readTsConfig = ({
|
|
41
|
+
export const readTsConfig = ({
|
|
77
42
|
dir,
|
|
78
43
|
fileName,
|
|
79
44
|
log,
|
|
80
45
|
silentlyFail = false
|
|
81
46
|
}) => {
|
|
82
|
-
const pathName =
|
|
47
|
+
const pathName = path.join(dir, fileName);
|
|
83
48
|
const cachedConfig = tsconfigCache.get(pathName);
|
|
84
49
|
if (cachedConfig) {
|
|
85
50
|
return cachedConfig;
|
|
86
51
|
}
|
|
87
|
-
const tsconfigFile =
|
|
52
|
+
const tsconfigFile = ts.findConfigFile(
|
|
88
53
|
dir,
|
|
89
|
-
|
|
54
|
+
ts.sys.fileExists.bind(void 0),
|
|
90
55
|
fileName
|
|
91
56
|
);
|
|
92
57
|
if (!tsconfigFile) {
|
|
@@ -96,31 +61,31 @@ const readTsConfig = ({
|
|
|
96
61
|
}
|
|
97
62
|
return;
|
|
98
63
|
}
|
|
99
|
-
const readConfigFile =
|
|
64
|
+
const readConfigFile = ts.readConfigFile(
|
|
100
65
|
tsconfigFile,
|
|
101
|
-
|
|
66
|
+
ts.sys.readFile.bind(void 0)
|
|
102
67
|
);
|
|
103
68
|
if (readConfigFile.error) {
|
|
104
69
|
if (!silentlyFail) {
|
|
105
70
|
log.err(`Could not read ${pathName}.`);
|
|
106
|
-
log.subtle(
|
|
71
|
+
log.subtle(ts.formatDiagnostic(readConfigFile.error, formatHost));
|
|
107
72
|
process.exitCode = 1;
|
|
108
73
|
}
|
|
109
74
|
return;
|
|
110
75
|
}
|
|
111
|
-
const parsedConfig =
|
|
76
|
+
const parsedConfig = ts.parseJsonConfigFileContent(
|
|
112
77
|
readConfigFile.config,
|
|
113
|
-
|
|
78
|
+
ts.sys,
|
|
114
79
|
dir
|
|
115
80
|
);
|
|
116
81
|
tsconfigCache.set(pathName, parsedConfig);
|
|
117
82
|
return parsedConfig;
|
|
118
83
|
};
|
|
119
|
-
const getCustomConditions = () => {
|
|
84
|
+
export const getCustomConditions = () => {
|
|
120
85
|
const parsedConfig = readTsConfig({
|
|
121
86
|
dir: process.cwd(),
|
|
122
87
|
fileName: "tsconfig.json",
|
|
123
|
-
log:
|
|
88
|
+
log: logger,
|
|
124
89
|
silentlyFail: true
|
|
125
90
|
});
|
|
126
91
|
if (!parsedConfig) {
|
|
@@ -128,11 +93,4 @@ const getCustomConditions = () => {
|
|
|
128
93
|
}
|
|
129
94
|
return parsedConfig.options.customConditions ?? [];
|
|
130
95
|
};
|
|
131
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
132
|
-
0 && (module.exports = {
|
|
133
|
-
getCustomConditions,
|
|
134
|
-
readTsBuildConfig,
|
|
135
|
-
readTsConfig,
|
|
136
|
-
tsc
|
|
137
|
-
});
|
|
138
96
|
//# sourceMappingURL=tsc.js.map
|
package/lib/cli/build/tsc.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/tsc.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\n\nimport ts from 'typescript';\n\nimport { exec } from '../../utils/exec.js';\nimport { type Logger, log as logger } from '../../utils/logging.js';\n\nimport { parseTscArgs } from './args.js';\n\nconst DEFAULT_ARGS = ['--project', 'tsconfig.build.json'] as const;\n\nconst formatHost: ts.FormatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: ts.sys.getCurrentDirectory.bind(undefined),\n getNewLine: () => ts.sys.newLine,\n};\n\nconst tsconfigCache = new Map<string, ts.ParsedCommandLine>();\n\nexport const tsc = async (args = process.argv.slice(2)) => {\n const tscArgs = parseTscArgs(args);\n\n // Build flag is incompatible with project flag.\n const defaultArgs = tscArgs.build || tscArgs.project ? [] : DEFAULT_ARGS;\n\n return exec('tsc', ...defaultArgs, ...args);\n};\n\nexport const readTsBuildConfig = (\n args = process.argv.slice(2),\n log: Logger,\n) => {\n const tscArgs = parseTscArgs(args);\n\n log.debug(\n log.bold(\n 'tsconfig',\n ...(tscArgs.project ? ['--project', tscArgs.project] : []),\n ),\n );\n log.debug(tscArgs.pathname);\n\n const parsedConfig = readTsConfig({\n dir: tscArgs.dirname,\n fileName: tscArgs.basename,\n log,\n });\n\n if (parsedConfig?.errors.length) {\n log.err(`Could not parse ${tscArgs.basename}.`);\n log.subtle(ts.formatDiagnostics(parsedConfig.errors, formatHost));\n process.exitCode = 1;\n return;\n }\n\n return parsedConfig;\n};\n\nexport const readTsConfig = ({\n dir,\n fileName,\n log,\n silentlyFail = false,\n}: {\n dir: string;\n fileName: string;\n log: Logger;\n silentlyFail?: boolean;\n}) => {\n const pathName = path.join(dir, fileName);\n\n const cachedConfig = tsconfigCache.get(pathName);\n\n if (cachedConfig) {\n return cachedConfig;\n }\n\n const tsconfigFile = ts.findConfigFile(\n dir,\n ts.sys.fileExists.bind(undefined),\n fileName,\n );\n if (!tsconfigFile) {\n if (!silentlyFail) {\n log.err(`Could not find ${pathName}.`);\n process.exitCode = 1;\n }\n return;\n }\n\n const readConfigFile = ts.readConfigFile(\n tsconfigFile,\n ts.sys.readFile.bind(undefined),\n );\n if (readConfigFile.error) {\n if (!silentlyFail) {\n log.err(`Could not read ${pathName}.`);\n log.subtle(ts.formatDiagnostic(readConfigFile.error, formatHost));\n process.exitCode = 1;\n }\n return;\n }\n\n const parsedConfig = ts.parseJsonConfigFileContent(\n readConfigFile.config,\n ts.sys,\n dir,\n );\n\n tsconfigCache.set(pathName, parsedConfig);\n\n return parsedConfig;\n};\n\nexport const getCustomConditions = () => {\n const parsedConfig = readTsConfig({\n dir: process.cwd(),\n fileName: 'tsconfig.json',\n log: logger,\n silentlyFail: true,\n });\n\n if (!parsedConfig) {\n return [];\n }\n\n return parsedConfig.options.customConditions ?? [];\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AAEjB,OAAO,QAAQ;AAEf,SAAS,YAAY;AACrB,SAAsB,OAAO,cAAc;AAE3C,SAAS,oBAAoB;AAE7B,MAAM,eAAe,CAAC,aAAa,qBAAqB;AAExD,MAAM,aAAuC;AAAA,EAC3C,sBAAsB,CAAC,aAAa;AAAA,EACpC,qBAAqB,GAAG,IAAI,oBAAoB,KAAK,MAAS;AAAA,EAC9D,YAAY,MAAM,GAAG,IAAI;AAC3B;AAEA,MAAM,gBAAgB,oBAAI,IAAkC;AAErD,aAAM,MAAM,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AACzD,QAAM,UAAU,aAAa,IAAI;AAGjC,QAAM,cAAc,QAAQ,SAAS,QAAQ,UAAU,CAAC,IAAI;AAE5D,SAAO,KAAK,OAAO,GAAG,aAAa,GAAG,IAAI;AAC5C;AAEO,aAAM,oBAAoB,CAC/B,OAAO,QAAQ,KAAK,MAAM,CAAC,GAC3B,QACG;AACH,QAAM,UAAU,aAAa,IAAI;AAEjC,MAAI;AAAA,IACF,IAAI;AAAA,MACF;AAAA,MACA,GAAI,QAAQ,UAAU,CAAC,aAAa,QAAQ,OAAO,IAAI,CAAC;AAAA,IAC1D;AAAA,EACF;AACA,MAAI,MAAM,QAAQ,QAAQ;AAE1B,QAAM,eAAe,aAAa;AAAA,IAChC,KAAK,QAAQ;AAAA,IACb,UAAU,QAAQ;AAAA,IAClB;AAAA,EACF,CAAC;AAED,MAAI,cAAc,OAAO,QAAQ;AAC/B,QAAI,IAAI,mBAAmB,QAAQ,QAAQ,GAAG;AAC9C,QAAI,OAAO,GAAG,kBAAkB,aAAa,QAAQ,UAAU,CAAC;AAChE,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,SAAO;AACT;AAEO,aAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAKM;AACJ,QAAM,WAAW,KAAK,KAAK,KAAK,QAAQ;AAExC,QAAM,eAAe,cAAc,IAAI,QAAQ;AAE/C,MAAI,cAAc;AAChB,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,GAAG;AAAA,IACtB;AAAA,IACA,GAAG,IAAI,WAAW,KAAK,MAAS;AAAA,IAChC;AAAA,EACF;AACA,MAAI,CAAC,cAAc;AACjB,QAAI,CAAC,cAAc;AACjB,UAAI,IAAI,kBAAkB,QAAQ,GAAG;AACrC,cAAQ,WAAW;AAAA,IACrB;AACA;AAAA,EACF;AAEA,QAAM,iBAAiB,GAAG;AAAA,IACxB;AAAA,IACA,GAAG,IAAI,SAAS,KAAK,MAAS;AAAA,EAChC;AACA,MAAI,eAAe,OAAO;AACxB,QAAI,CAAC,cAAc;AACjB,UAAI,IAAI,kBAAkB,QAAQ,GAAG;AACrC,UAAI,OAAO,GAAG,iBAAiB,eAAe,OAAO,UAAU,CAAC;AAChE,cAAQ,WAAW;AAAA,IACrB;AACA;AAAA,EACF;AAEA,QAAM,eAAe,GAAG;AAAA,IACtB,eAAe;AAAA,IACf,GAAG;AAAA,IACH;AAAA,EACF;AAEA,gBAAc,IAAI,UAAU,YAAY;AAExC,SAAO;AACT;AAEO,aAAM,sBAAsB,MAAM;AACvC,QAAM,eAAe,aAAa;AAAA,IAChC,KAAK,QAAQ,IAAI;AAAA,IACjB,UAAU;AAAA,IACV,KAAK;AAAA,IACL,cAAc;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,cAAc;AACjB,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,aAAa,QAAQ,oBAAoB,CAAC;AACnD;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,31 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var buildPackage_exports = {};
|
|
20
|
-
__export(buildPackage_exports, {
|
|
21
|
-
buildPackage: () => buildPackage
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(buildPackage_exports);
|
|
24
|
-
var import_args = require("../../utils/args.js");
|
|
25
|
-
var import_exec = require("../../utils/exec.js");
|
|
26
|
-
var import_assets = require("../build/assets.js");
|
|
27
|
-
const buildPackage = async (args = process.argv.slice(2)) => {
|
|
28
|
-
await (0, import_exec.execConcurrently)(
|
|
2
|
+
import { hasSerialFlag } from "../../utils/args.js";
|
|
3
|
+
import { execConcurrently } from "../../utils/exec.js";
|
|
4
|
+
import { copyAssetsConcurrently } from "../build/assets.js";
|
|
5
|
+
export const buildPackage = async (args = process.argv.slice(2)) => {
|
|
6
|
+
await execConcurrently(
|
|
29
7
|
[
|
|
30
8
|
{
|
|
31
9
|
command: "tsc --module CommonJS --outDir lib-commonjs --project tsconfig.build.json --moduleResolution node",
|
|
@@ -44,10 +22,10 @@ const buildPackage = async (args = process.argv.slice(2)) => {
|
|
|
44
22
|
}
|
|
45
23
|
],
|
|
46
24
|
{
|
|
47
|
-
maxProcesses:
|
|
25
|
+
maxProcesses: hasSerialFlag(args) ? 1 : void 0
|
|
48
26
|
}
|
|
49
27
|
);
|
|
50
|
-
await
|
|
28
|
+
await copyAssetsConcurrently([
|
|
51
29
|
{
|
|
52
30
|
outDir: "lib-commonjs",
|
|
53
31
|
name: "commonjs",
|
|
@@ -60,8 +38,4 @@ const buildPackage = async (args = process.argv.slice(2)) => {
|
|
|
60
38
|
}
|
|
61
39
|
]);
|
|
62
40
|
};
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
buildPackage
|
|
66
|
-
});
|
|
67
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/buildPackage/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { hasSerialFlag } from '../../utils/args.js';\nimport { execConcurrently } from '../../utils/exec.js';\nimport { copyAssetsConcurrently } from '../build/assets.js';\n\nexport const buildPackage = async (args = process.argv.slice(2)) => {\n await execConcurrently(\n [\n {\n command:\n 'tsc --module CommonJS --outDir lib-commonjs --project tsconfig.build.json --moduleResolution node',\n name: 'commonjs',\n prefixColor: 'green',\n },\n {\n command:\n 'tsc --module ES2015 --outDir lib-es2015 --project tsconfig.build.json --moduleResolution node',\n name: 'es2015',\n prefixColor: 'yellow',\n },\n {\n command:\n 'tsc --allowJS false --declaration --emitDeclarationOnly --outDir lib-types --project tsconfig.build.json',\n name: 'types',\n prefixColor: 'blue',\n },\n ],\n {\n maxProcesses: hasSerialFlag(args) ? 1 : undefined,\n },\n );\n\n await copyAssetsConcurrently([\n {\n outDir: 'lib-commonjs',\n name: 'commonjs',\n prefixColor: 'green',\n },\n {\n outDir: 'lib-es2015',\n name: 'es2015',\n prefixColor: 'yellow',\n },\n ]);\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AAEhC,aAAM,eAAe,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAClE,QAAM;AAAA,IACJ;AAAA,MACE;AAAA,QACE,SACE;AAAA,QACF,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,MACA;AAAA,QACE,SACE;AAAA,QACF,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,MACA;AAAA,QACE,SACE;AAAA,QACF,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,MACE,cAAc,cAAc,IAAI,IAAI,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,QAAM,uBAAuB;AAAA,IAC3B;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,69 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 analyseConfiguration_exports = {};
|
|
30
|
-
__export(analyseConfiguration_exports, {
|
|
31
|
-
analyseConfiguration: () => analyseConfiguration
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(analyseConfiguration_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
-
var import_logging = require("../../utils/logging.js");
|
|
37
|
-
var import_project = require("./analysis/project.js");
|
|
38
|
-
const analyseConfiguration = async (props) => {
|
|
39
|
-
import_logging.log.newline();
|
|
40
|
-
import_logging.log.plain(import_logging.log.bold("Config:"));
|
|
41
|
-
const files = await (0, import_project.diffFiles)(props);
|
|
2
|
+
import path from "path";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import { log } from "../../utils/logging.js";
|
|
5
|
+
import { diffFiles } from "./analysis/project.js";
|
|
6
|
+
export const analyseConfiguration = async (props) => {
|
|
7
|
+
log.newline();
|
|
8
|
+
log.plain(log.bold("Config:"));
|
|
9
|
+
const files = await diffFiles(props);
|
|
42
10
|
if (Object.keys(files).length === 0) {
|
|
43
|
-
|
|
44
|
-
|
|
11
|
+
log.newline();
|
|
12
|
+
log.ok("\u2714 No changes");
|
|
45
13
|
return;
|
|
46
14
|
}
|
|
47
|
-
|
|
48
|
-
Object.entries(files).sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB)).forEach(([filename, { operation }]) =>
|
|
15
|
+
log.newline();
|
|
16
|
+
Object.entries(files).sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB)).forEach(([filename, { operation }]) => log.plain(operation, filename));
|
|
49
17
|
return async () => {
|
|
50
18
|
const dirnames = [
|
|
51
|
-
...new Set(Object.keys(files).map((filename) =>
|
|
19
|
+
...new Set(Object.keys(files).map((filename) => path.dirname(filename)))
|
|
52
20
|
];
|
|
53
21
|
await Promise.all(
|
|
54
22
|
dirnames.map(
|
|
55
|
-
(dirname) =>
|
|
23
|
+
(dirname) => fs.promises.mkdir(dirname, { recursive: true })
|
|
56
24
|
)
|
|
57
25
|
);
|
|
58
26
|
await Promise.all(
|
|
59
27
|
Object.entries(files).map(
|
|
60
|
-
([filename, { data }]) => data === void 0 ?
|
|
28
|
+
([filename, { data }]) => data === void 0 ? fs.promises.rm(filename) : fs.promises.writeFile(filename, data)
|
|
61
29
|
)
|
|
62
30
|
);
|
|
63
31
|
};
|
|
64
32
|
};
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
analyseConfiguration
|
|
68
|
-
});
|
|
69
33
|
//# sourceMappingURL=analyseConfiguration.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/configure/analyseConfiguration.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../utils/logging.js';\nimport type { ProjectType } from '../../utils/manifest.js';\nimport type { PackageManagerConfig } from '../../utils/packageManager.js';\n\nimport { diffFiles } from './analysis/project.js';\n\ninterface Props {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n packageManager: PackageManagerConfig;\n type: ProjectType;\n}\n\nexport const analyseConfiguration = async (\n props: Props,\n): Promise<undefined | (() => Promise<void>)> => {\n log.newline();\n log.plain(log.bold('Config:'));\n\n const files = await diffFiles(props);\n\n if (Object.keys(files).length === 0) {\n log.newline();\n log.ok('\u2714 No changes');\n return;\n }\n\n log.newline();\n Object.entries(files)\n .sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB))\n .forEach(([filename, { operation }]) => log.plain(operation, filename));\n\n return async () => {\n const dirnames = [\n ...new Set(Object.keys(files).map((filename) => path.dirname(filename))),\n ];\n\n await Promise.all(\n dirnames.map((dirname) =>\n fs.promises.mkdir(dirname, { recursive: true }),\n ),\n );\n\n await Promise.all(\n Object.entries(files).map(([filename, { data }]) =>\n data === undefined\n ? fs.promises.rm(filename)\n : fs.promises.writeFile(filename, data),\n ),\n );\n };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AAEjB,OAAO,QAAQ;AAEf,SAAS,WAAW;AAIpB,SAAS,iBAAiB;AAUnB,aAAM,uBAAuB,OAClC,UAC+C;AAC/C,MAAI,QAAQ;AACZ,MAAI,MAAM,IAAI,KAAK,SAAS,CAAC;AAE7B,QAAM,QAAQ,MAAM,UAAU,KAAK;AAEnC,MAAI,OAAO,KAAK,KAAK,EAAE,WAAW,GAAG;AACnC,QAAI,QAAQ;AACZ,QAAI,GAAG,mBAAc;AACrB;AAAA,EACF;AAEA,MAAI,QAAQ;AACZ,SAAO,QAAQ,KAAK,EACjB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,MAAM,UAAU,cAAc,SAAS,CAAC,EACrE,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,IAAI,MAAM,WAAW,QAAQ,CAAC;AAExE,SAAO,YAAY;AACjB,UAAM,WAAW;AAAA,MACf,GAAG,IAAI,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,CAAC,aAAa,KAAK,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzE;AAEA,UAAM,QAAQ;AAAA,MACZ,SAAS;AAAA,QAAI,CAAC,YACZ,GAAG,SAAS,MAAM,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,MAChD;AAAA,IACF;AAEA,UAAM,QAAQ;AAAA,MACZ,OAAO,QAAQ,KAAK,EAAE;AAAA,QAAI,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,MAC5C,SAAS,SACL,GAAG,SAAS,GAAG,QAAQ,IACvB,GAAG,SAAS,UAAU,UAAU,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|