skuba 14.0.0-esmify-skuba-20251105032119 → 14.0.0-hacky-hack-lang-json-20260108235938
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/eslint.js +1 -1
- package/config/jest.js +1 -0
- package/config/prettier.d.ts +4 -0
- package/config/prettier.js +2 -10
- package/jest/moduleNameMapper.js +64 -0
- package/jest/transform.js +62 -0
- package/jest/tsConfig.js +26 -0
- package/jest-preset.js +37 -0
- package/lib/api/jest/index.d.ts +15 -0
- package/lib/api/jest/index.js +59 -0
- package/lib/api/jest/index.js.map +7 -0
- package/lib/cli/adapter/eslint.js +45 -11
- package/lib/cli/adapter/eslint.js.map +3 -3
- package/lib/cli/adapter/prettier.js +67 -39
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/args.js +42 -8
- package/lib/cli/build/args.js.map +2 -2
- package/lib/{src/cli → cli}/build/assets.d.ts +3 -2
- package/lib/cli/build/assets.js +60 -28
- package/lib/cli/build/assets.js.map +3 -3
- package/lib/cli/build/esbuild.d.ts +8 -0
- package/lib/cli/build/esbuild.js +64 -23
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +53 -21
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/build/tsc.js +60 -24
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/buildPackage/index.js +32 -8
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +50 -16
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/{src/cli → cli}/configure/analyseDependencies.d.ts +1 -1
- package/lib/cli/configure/analyseDependencies.js +59 -25
- package/lib/cli/configure/analyseDependencies.js.map +3 -3
- package/lib/cli/configure/analysis/diff.js +29 -5
- package/lib/cli/configure/analysis/diff.js.map +2 -2
- package/lib/cli/configure/analysis/files.js +42 -8
- package/lib/cli/configure/analysis/files.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +46 -12
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/{src/cli → cli}/configure/analysis/package.d.ts +3 -2
- package/lib/cli/configure/analysis/package.js +45 -10
- package/lib/cli/configure/analysis/package.js.map +3 -3
- package/lib/cli/configure/analysis/project.js +50 -18
- package/lib/cli/configure/analysis/project.js.map +2 -2
- package/lib/cli/configure/dependencies/index.js +35 -7
- package/lib/cli/configure/dependencies/index.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js +28 -4
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js +28 -4
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js +29 -4
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/{src/cli → cli}/configure/ensureTemplateCompletion.d.ts +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +63 -32
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/{src/cli → cli}/configure/getEntryPoint.d.ts +2 -2
- package/lib/cli/configure/getEntryPoint.js +51 -19
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/{src/cli → cli}/configure/getProjectType.d.ts +1 -1
- package/lib/cli/configure/getProjectType.js +36 -17
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +91 -56
- package/lib/cli/configure/index.js.map +3 -3
- package/lib/cli/configure/modules/eslint.js +34 -10
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +32 -8
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/index.js +44 -18
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/jest.d.ts +2 -0
- package/lib/cli/configure/modules/jest.js +86 -0
- package/lib/cli/configure/modules/jest.js.map +7 -0
- package/lib/cli/configure/modules/nodemon.js +28 -4
- package/lib/cli/configure/modules/nodemon.js.map +1 -1
- package/lib/cli/configure/modules/package.js +34 -10
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +35 -11
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +40 -17
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/serverless.js +26 -2
- package/lib/cli/configure/modules/serverless.js.map +1 -1
- package/lib/cli/configure/modules/tslint.js +28 -4
- package/lib/cli/configure/modules/tslint.js.map +1 -1
- package/lib/cli/configure/processing/configFile.js +39 -3
- package/lib/cli/configure/processing/configFile.js.map +1 -1
- package/lib/cli/configure/processing/deleteFiles.js +26 -2
- package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
- package/lib/cli/configure/processing/javascript.js +27 -2
- package/lib/cli/configure/processing/javascript.js.map +1 -1
- package/lib/cli/configure/processing/json.js +31 -6
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/loadFiles.js +26 -2
- package/lib/cli/configure/processing/loadFiles.js.map +1 -1
- package/lib/cli/configure/processing/module.js +28 -4
- package/lib/cli/configure/processing/module.js.map +1 -1
- package/lib/cli/configure/processing/package.d.ts +71 -0
- package/lib/cli/configure/processing/package.js +45 -8
- package/lib/cli/configure/processing/package.js.map +3 -3
- package/lib/cli/configure/processing/prettier.js +38 -4
- package/lib/cli/configure/processing/prettier.js.map +2 -2
- package/lib/cli/configure/processing/record.js +41 -5
- package/lib/cli/configure/processing/record.js.map +2 -2
- package/lib/cli/configure/processing/typescript.js +63 -26
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/{src/cli → cli}/configure/types.d.ts +4 -15
- package/lib/cli/configure/types.js +16 -0
- package/lib/cli/configure/types.js.map +3 -3
- package/lib/cli/format/index.js +44 -20
- package/lib/cli/format/index.js.map +2 -2
- package/lib/cli/help/index.js +30 -6
- package/lib/cli/help/index.js.map +1 -1
- package/lib/{src/cli → cli}/init/getConfig.d.ts +2 -2
- package/lib/cli/init/getConfig.js +121 -102
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/git.js +51 -16
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +98 -67
- package/lib/cli/init/index.js.map +2 -2
- package/lib/{src/cli → cli}/init/prompts.d.ts +13 -10
- package/lib/cli/init/prompts.js +56 -35
- package/lib/cli/init/prompts.js.map +2 -2
- package/lib/cli/init/types.js +41 -7
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.js +30 -2
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +42 -8
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +45 -11
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
- package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +26 -2
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +45 -11
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/internal.js +26 -2
- package/lib/cli/lint/annotate/github/internal.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.js +26 -2
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +28 -4
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/index.js +30 -6
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/{src/cli → cli}/lint/autofix.d.ts +5 -0
- package/lib/cli/lint/autofix.js +80 -40
- package/lib/cli/lint/autofix.js.map +2 -2
- package/lib/cli/lint/eslint.js +51 -16
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/external.js +51 -19
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.js +50 -28
- package/lib/cli/lint/index.js.map +2 -2
- package/lib/cli/lint/internal.js +44 -18
- package/lib/cli/lint/internal.js.map +2 -2
- package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
- package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +46 -14
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +64 -35
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
- package/lib/{src/cli → cli}/lint/internalLints/upgrade/index.d.ts +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +105 -41
- package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -17
- 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 +50 -15
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +149 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
- package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
- package/lib/cli/lint/prettier.js +50 -15
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/lint/tsc.js +28 -4
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/lint/types.js +16 -0
- package/lib/cli/lint/types.js.map +3 -3
- package/lib/cli/migrate/index.d.ts +6 -0
- package/lib/cli/migrate/index.js +79 -15
- package/lib/cli/migrate/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -0
- package/lib/cli/migrate/nodeVersion/checks.js +51 -120
- package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.d.ts +10 -0
- package/lib/cli/migrate/nodeVersion/index.js +239 -65
- package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
- package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
- package/lib/cli/node/index.js +57 -20
- package/lib/cli/node/index.js.map +3 -3
- package/lib/cli/release/index.js +28 -4
- package/lib/cli/release/index.js.map +1 -1
- package/lib/cli/start/index.js +50 -16
- package/lib/cli/start/index.js.map +3 -3
- package/lib/cli/test/index.js +44 -4
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
- package/lib/cli/test/reporters/github/annotations.js +102 -0
- package/lib/cli/test/reporters/github/annotations.js.map +7 -0
- package/lib/cli/test/reporters/github/index.d.ts +5 -0
- package/lib/cli/test/reporters/github/index.js +74 -0
- package/lib/cli/test/reporters/github/index.js.map +7 -0
- package/lib/cli/version/index.js +30 -6
- package/lib/cli/version/index.js.map +1 -1
- package/lib/{src/index.d.ts → index.d.ts} +1 -0
- package/lib/index.js +46 -6
- package/lib/index.js.map +2 -2
- package/lib/skuba.js +45 -26
- package/lib/skuba.js.map +3 -3
- package/lib/utils/args.js +43 -6
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/command.js +42 -4
- package/lib/utils/command.js.map +3 -3
- package/lib/utils/copy.js +57 -20
- package/lib/utils/copy.js.map +2 -2
- package/lib/utils/dir.js +72 -32
- package/lib/utils/dir.js.map +2 -2
- package/lib/utils/env.js +26 -2
- package/lib/utils/env.js.map +1 -1
- package/lib/utils/error.js +47 -10
- package/lib/utils/error.js.map +1 -1
- package/lib/{src/utils → utils}/exec.d.ts +3 -2
- package/lib/utils/exec.js +62 -24
- package/lib/utils/exec.js.map +3 -3
- package/lib/utils/fs.js +40 -6
- package/lib/utils/fs.js.map +2 -2
- package/lib/utils/help.js +30 -6
- package/lib/utils/help.js.map +1 -1
- package/lib/{src/utils → utils}/logging.d.ts +9 -10
- package/lib/utils/logging.js +38 -11
- package/lib/utils/logging.js.map +2 -2
- package/lib/utils/logo.js +52 -25
- package/lib/utils/logo.js.map +2 -2
- package/lib/{src/utils → utils}/manifest.d.ts +2 -3
- package/lib/utils/manifest.js +48 -8
- package/lib/utils/manifest.js.map +3 -3
- package/lib/utils/npmrc.js +26 -2
- package/lib/utils/npmrc.js.map +1 -1
- package/lib/utils/packageManager.js +49 -12
- package/lib/utils/packageManager.js.map +2 -2
- package/lib/utils/port.js +39 -4
- package/lib/utils/port.js.map +2 -2
- package/lib/utils/sleep.js +26 -2
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/template.js +55 -18
- package/lib/utils/template.js.map +3 -3
- package/lib/utils/validation.js +31 -2
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +46 -9
- package/lib/utils/version.js.map +2 -2
- package/lib/utils/wait.js +32 -7
- package/lib/utils/wait.js.map +1 -1
- package/lib/{src/utils → utils}/worker.d.ts +3 -3
- package/lib/utils/worker.js +35 -10
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/function-arguments.d.js +1 -0
- package/lib/wrapper/functionHandler.js +49 -18
- package/lib/wrapper/functionHandler.js.map +2 -2
- package/lib/wrapper/http.js +43 -8
- package/lib/wrapper/http.js.map +2 -2
- package/lib/wrapper/index.js +7 -6
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +42 -8
- package/lib/wrapper/main.js.map +3 -3
- package/lib/wrapper/requestListener.js +47 -13
- package/lib/wrapper/requestListener.js.map +2 -2
- package/lib/wrapper/server.js +28 -4
- package/lib/wrapper/server.js.map +2 -2
- package/package.json +43 -45
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +4 -3
- package/template/base/jest.config.ts +19 -0
- package/template/base/jest.setup.ts +3 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/package.json +8 -9
- package/template/express-rest-api/skuba.template.js +1 -1
- package/template/express-rest-api/src/app.test.ts +0 -1
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/package.json +4 -5
- package/template/greeter/skuba.template.js +1 -1
- package/template/greeter/src/app.test.ts +1 -3
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/package.json +9 -11
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
- package/template/koa-rest-api/src/app.test.ts +0 -2
- package/template/koa-rest-api/src/framework/server.test.ts +2 -2
- package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
- package/template/koa-rest-api/src/testing/metrics.ts +0 -2
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -21
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
- package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
- package/template/lambda-sqs-worker-cdk/package.json +9 -9
- package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/oss-npm-package/_package.json +0 -1
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/src/index.test.ts +0 -2
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +1 -2
- package/template/private-npm-package/skuba.template.js +2 -2
- package/template/private-npm-package/src/index.test.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
- package/lib/config/prettier.d.ts +0 -7
- package/lib/enquirer.d.js +0 -1
- package/lib/enquirer.d.js.map +0 -7
- package/lib/eslint.d.js +0 -1
- package/lib/eslint.d.js.map +0 -7
- package/lib/src/cli/build/esbuild.d.ts +0 -6
- package/lib/src/cli/configure/processing/package.d.ts +0 -5
- package/lib/src/cli/migrate/index.d.ts +0 -1
- package/lib/src/cli/migrate/nodeVersion/checks.d.ts +0 -14
- package/lib/src/cli/migrate/nodeVersion/index.d.ts +0 -4
- package/template/base/vitest.config.ts +0 -25
- package/lib/{src/cli → cli}/adapter/eslint.d.ts +0 -0
- package/lib/{src/cli → cli}/adapter/prettier.d.ts +0 -0
- package/lib/{src/cli → cli}/build/args.d.ts +0 -0
- package/lib/{src/cli → cli}/build/index.d.ts +0 -0
- package/lib/{src/cli → cli}/build/tsc.d.ts +0 -0
- package/lib/{src/cli → cli}/buildPackage/index.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/analyseConfiguration.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/analysis/diff.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/analysis/files.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/analysis/git.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/analysis/project.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/dependencies/index.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/dependencies/seekDatadogCustomMetrics.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/dependencies/seekKoala.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/dependencies/skuba.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/dependencies/skubaDeps.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/dependencies/skubaDive.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/index.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/eslint.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/ignore.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/index.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/nodemon.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/package.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/prettier.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/renovate.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/serverless.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/modules/tslint.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/configFile.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/deleteFiles.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/javascript.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/json.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/loadFiles.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/module.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/prettier.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/record.d.ts +0 -0
- package/lib/{src/cli → cli}/configure/processing/typescript.d.ts +0 -0
- package/lib/{src/cli → cli}/format/index.d.ts +0 -0
- package/lib/{src/cli → cli}/help/index.d.ts +0 -0
- package/lib/{src/cli → cli}/init/git.d.ts +0 -0
- package/lib/{src/cli → cli}/init/index.d.ts +0 -0
- package/lib/{src/cli → cli}/init/types.d.ts +1 -1
- /package/lib/{src/cli → cli}/init/validation.d.ts +0 -0
- /package/lib/{src/cli → cli}/init/writePackageJson.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/buildkite/eslint.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/buildkite/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/buildkite/internal.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/buildkite/prettier.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/buildkite/tsc.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/github/eslint.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/github/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/github/internal.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/github/prettier.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/github/tsc.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/annotate/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/eslint.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/external.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internal.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/detectBadCodeowners.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/noSkubaTemplateJs.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/patchRenovateConfig.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/refreshConfigFiles.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.0.2/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.1.1/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.3.0/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.1/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.d.ts +0 -0
- /package/lib/{src/cli/lint/internalLints/upgrade/patches/7.3.1 → cli/lint/internalLints/upgrade/patches/13.1.1}/index.d.ts +0 -0
- /package/lib/{src/cli/lint/internalLints/upgrade/patches/9.1.0 → cli/lint/internalLints/upgrade/patches/13.1.1}/upgradeNode.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +0 -0
- /package/lib/{src/cli/lint/internalLints/upgrade/patches/8.0.0 → cli/lint/internalLints/upgrade/patches/7.3.1}/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +0 -0
- /package/lib/{src/cli/lint/internalLints/upgrade/patches/8.2.1 → cli/lint/internalLints/upgrade/patches/8.0.0}/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +0 -0
- /package/lib/{src/cli/lint/internalLints/upgrade/patches/9.0.1 → cli/lint/internalLints/upgrade/patches/8.2.1}/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +0 -0
- /package/lib/{src/cli/lint/internalLints/upgrade/patches/9.1.0 → cli/lint/internalLints/upgrade/patches/9.0.1}/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/prettier.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/tsc.d.ts +0 -0
- /package/lib/{src/cli → cli}/lint/types.d.ts +0 -0
- /package/lib/{src/cli → cli}/node/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/release/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/start/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/test/index.d.ts +0 -0
- /package/lib/{src/cli → cli}/version/index.d.ts +0 -0
- /package/lib/{src/skuba.d.ts → skuba.d.ts} +0 -0
- /package/lib/{src/utils → utils}/args.d.ts +0 -0
- /package/lib/{src/utils → utils}/command.d.ts +0 -0
- /package/lib/{src/utils → utils}/copy.d.ts +0 -0
- /package/lib/{src/utils → utils}/dir.d.ts +0 -0
- /package/lib/{src/utils → utils}/env.d.ts +0 -0
- /package/lib/{src/utils → utils}/error.d.ts +0 -0
- /package/lib/{src/utils → utils}/fs.d.ts +0 -0
- /package/lib/{src/utils → utils}/help.d.ts +0 -0
- /package/lib/{src/utils → utils}/logo.d.ts +0 -0
- /package/lib/{src/utils → utils}/npmrc.d.ts +0 -0
- /package/lib/{src/utils → utils}/packageManager.d.ts +0 -0
- /package/lib/{src/utils → utils}/port.d.ts +0 -0
- /package/lib/{src/utils → utils}/sleep.d.ts +0 -0
- /package/lib/{src/utils → utils}/template.d.ts +0 -0
- /package/lib/{src/utils → utils}/validation.d.ts +0 -0
- /package/lib/{src/utils → utils}/version.d.ts +0 -0
- /package/lib/{src/utils → utils}/wait.d.ts +0 -0
- /package/lib/{src/wrapper → wrapper}/functionHandler.d.ts +0 -0
- /package/lib/{src/wrapper → wrapper}/http.d.ts +0 -0
- /package/lib/{src/wrapper → wrapper}/index.d.ts +0 -0
- /package/lib/{src/wrapper → wrapper}/main.d.ts +0 -0
- /package/lib/{src/wrapper → wrapper}/requestListener.d.ts +0 -0
- /package/lib/{src/wrapper → wrapper}/server.d.ts +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/migrate/nodeVersion/upgrade.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'node:util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\nimport { coerce, lt } from 'semver';\n\nimport { exec } from '../../../utils/exec.js';\nimport { log } from '../../../utils/logging.js';\nimport { detectPackageManager } from '../../../utils/packageManager.js';\nimport type { PatchReturnType } from '../../lint/internalLints/upgrade/index.js';\n\nconst packageVersionRegex = (packageName: string) =>\n new RegExp(`\"\\\\b${packageName}\\\\b\"\\\\s*:\\\\s*\"([^\"]+)\"`, 'g');\n\nconst yamlPackageVersionRegex = (packageName: string) =>\n new RegExp(`\\\\b${packageName}\\\\b:\\\\s*([^\\\\s]+)`, 'g');\n\nconst normalizeVersionRange = (\n currentVersion: string,\n newVersion: string,\n): string => {\n if (currentVersion.startsWith('^')) {\n return `^${newVersion}`;\n }\n\n if (currentVersion.startsWith('~')) {\n return `~${newVersion}`;\n }\n\n // >=1.2.3, >1.2.3, <=1.2.3, <1.2.3\n if (\n currentVersion.startsWith('>=') ||\n currentVersion.startsWith('>') ||\n currentVersion.startsWith('<=') ||\n currentVersion.startsWith('<')\n ) {\n return `^${newVersion}`;\n }\n\n // 1.x, 1.2.x, 1.x.x\n if (currentVersion.includes('x') || currentVersion.includes('X')) {\n return `^${newVersion}`;\n }\n\n // 1.0.0 - 2.0.0\n if (currentVersion.includes(' - ')) {\n return `^${newVersion}`;\n }\n\n const coercedCurrent = coerce(currentVersion);\n if (coercedCurrent && lt(coercedCurrent, newVersion)) {\n return newVersion;\n }\n\n return currentVersion;\n};\n\ntype PackageInfo = {\n name: string;\n version: string;\n};\n\nexport const upgradeInfraPackages = async (\n mode: 'lint' | 'format',\n packages: PackageInfo[],\n): Promise<PatchReturnType> => {\n const [packageJsonPaths, pnpmWorkspacePaths] = await Promise.all([\n glob(['**/package.json'], {\n ignore: ['**/.git', '**/node_modules'],\n }),\n glob('**/pnpm-workspace.yaml', {\n ignore: ['**/.git', '**/node_modules'],\n }),\n ]);\n\n if (packageJsonPaths.length === 0 && pnpmWorkspacePaths.length === 0) {\n return {\n result: 'skip',\n reason: 'no package.json or pnpm-workspace.yaml files found',\n };\n }\n\n const [packageJsons, pnpmWorkspaces] = await Promise.all([\n Promise.all(\n packageJsonPaths.map(async (file) => {\n const contents = await fs.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n ),\n Promise.all(\n pnpmWorkspacePaths.map(async (file) => {\n const contents = await fs.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n ),\n ]);\n\n const patchedPackageJsons = packageJsons\n .map((file) => {\n const updated = packages.reduce((contents, packageName) => {\n const regex = packageVersionRegex(packageName.name);\n return contents.replaceAll(regex, (match, currentVersion: string) => {\n if (\n currentVersion.startsWith('*') ||\n currentVersion.startsWith('workspace:') ||\n currentVersion.startsWith('link:') ||\n currentVersion.startsWith('file:') ||\n currentVersion.startsWith('catalog:')\n ) {\n return match;\n }\n\n const newVersion = normalizeVersionRange(\n currentVersion,\n packageName.version,\n );\n\n return newVersion === currentVersion\n ? match\n : `\"${packageName.name}\":\"${newVersion}\"`;\n });\n }, file.contents);\n\n return {\n ...file,\n updated,\n };\n })\n .filter(({ contents, updated }) => contents !== updated);\n\n const patchedPnpmWorkspaces = pnpmWorkspaces\n .map((file) => {\n const updated = packages.reduce((contents, packageName) => {\n const regex = yamlPackageVersionRegex(packageName.name);\n return contents.replace(regex, (match, currentVersion: string) => {\n const newVersion = normalizeVersionRange(\n currentVersion,\n packageName.version,\n );\n\n return newVersion === currentVersion\n ? match\n : `${packageName.name}: ${newVersion}`;\n });\n }, file.contents);\n\n return {\n ...file,\n updated,\n };\n })\n .filter(({ contents, updated }) => contents !== updated);\n\n if (patchedPackageJsons.length === 0 && patchedPnpmWorkspaces.length === 0) {\n return {\n result: 'skip',\n reason: 'no package.json or pnpm-workspace.yaml files to patch',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n [...patchedPackageJsons, ...patchedPnpmWorkspaces].map(\n async ({ file, updated }) => {\n await fs.writeFile(file, updated, 'utf8');\n },\n ),\n );\n\n const packageManager = await detectPackageManager();\n\n await exec(\n packageManager.command,\n 'install',\n '--frozen-lockfile=false',\n '--prefer-offline',\n );\n\n return {\n result: 'apply',\n };\n};\n\nexport const tryUpgradeInfraPackages = async (\n mode: 'lint' | 'format',\n packages: PackageInfo[],\n): Promise<PatchReturnType> => {\n try {\n return await upgradeInfraPackages(mode, packages);\n } catch (err) {\n log.err('Failed to upgrade infrastructure packages');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AACf,oBAA2B;AAE3B,kBAAqB;AACrB,qBAAoB;AACpB,4BAAqC;AAGrC,MAAM,sBAAsB,CAAC,gBAC3B,IAAI,OAAO,OAAO,WAAW,0BAA0B,GAAG;AAE5D,MAAM,0BAA0B,CAAC,gBAC/B,IAAI,OAAO,MAAM,WAAW,qBAAqB,GAAG;AAEtD,MAAM,wBAAwB,CAC5B,gBACA,eACW;AACX,MAAI,eAAe,WAAW,GAAG,GAAG;AAClC,WAAO,IAAI,UAAU;AAAA,EACvB;AAEA,MAAI,eAAe,WAAW,GAAG,GAAG;AAClC,WAAO,IAAI,UAAU;AAAA,EACvB;AAGA,MACE,eAAe,WAAW,IAAI,KAC9B,eAAe,WAAW,GAAG,KAC7B,eAAe,WAAW,IAAI,KAC9B,eAAe,WAAW,GAAG,GAC7B;AACA,WAAO,IAAI,UAAU;AAAA,EACvB;AAGA,MAAI,eAAe,SAAS,GAAG,KAAK,eAAe,SAAS,GAAG,GAAG;AAChE,WAAO,IAAI,UAAU;AAAA,EACvB;AAGA,MAAI,eAAe,SAAS,KAAK,GAAG;AAClC,WAAO,IAAI,UAAU;AAAA,EACvB;AAEA,QAAM,qBAAiB,sBAAO,cAAc;AAC5C,MAAI,sBAAkB,kBAAG,gBAAgB,UAAU,GAAG;AACpD,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAOO,MAAM,uBAAuB,OAClC,MACA,aAC6B;AAC7B,QAAM,CAAC,kBAAkB,kBAAkB,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC/D,uBAAK,CAAC,iBAAiB,GAAG;AAAA,MACxB,QAAQ,CAAC,WAAW,iBAAiB;AAAA,IACvC,CAAC;AAAA,QACD,uBAAK,0BAA0B;AAAA,MAC7B,QAAQ,CAAC,WAAW,iBAAiB;AAAA,IACvC,CAAC;AAAA,EACH,CAAC;AAED,MAAI,iBAAiB,WAAW,KAAK,mBAAmB,WAAW,GAAG;AACpE,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,CAAC,cAAc,cAAc,IAAI,MAAM,QAAQ,IAAI;AAAA,IACvD,QAAQ;AAAA,MACN,iBAAiB,IAAI,OAAO,SAAS;AACnC,cAAM,WAAW,MAAM,gBAAAA,QAAG,SAAS,MAAM,MAAM;AAE/C,eAAO;AAAA,UACL;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,QAAQ;AAAA,MACN,mBAAmB,IAAI,OAAO,SAAS;AACrC,cAAM,WAAW,MAAM,gBAAAA,QAAG,SAAS,MAAM,MAAM;AAE/C,eAAO;AAAA,UACL;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AAED,QAAM,sBAAsB,aACzB,IAAI,CAAC,SAAS;AACb,UAAM,UAAU,SAAS,OAAO,CAAC,UAAU,gBAAgB;AACzD,YAAM,QAAQ,oBAAoB,YAAY,IAAI;AAClD,aAAO,SAAS,WAAW,OAAO,CAAC,OAAO,mBAA2B;AACnE,YACE,eAAe,WAAW,GAAG,KAC7B,eAAe,WAAW,YAAY,KACtC,eAAe,WAAW,OAAO,KACjC,eAAe,WAAW,OAAO,KACjC,eAAe,WAAW,UAAU,GACpC;AACA,iBAAO;AAAA,QACT;AAEA,cAAM,aAAa;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,QACd;AAEA,eAAO,eAAe,iBAClB,QACA,IAAI,YAAY,IAAI,MAAM,UAAU;AAAA,MAC1C,CAAC;AAAA,IACH,GAAG,KAAK,QAAQ;AAEhB,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC,EACA,OAAO,CAAC,EAAE,UAAU,QAAQ,MAAM,aAAa,OAAO;AAEzD,QAAM,wBAAwB,eAC3B,IAAI,CAAC,SAAS;AACb,UAAM,UAAU,SAAS,OAAO,CAAC,UAAU,gBAAgB;AACzD,YAAM,QAAQ,wBAAwB,YAAY,IAAI;AACtD,aAAO,SAAS,QAAQ,OAAO,CAAC,OAAO,mBAA2B;AAChE,cAAM,aAAa;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,QACd;AAEA,eAAO,eAAe,iBAClB,QACA,GAAG,YAAY,IAAI,KAAK,UAAU;AAAA,MACxC,CAAC;AAAA,IACH,GAAG,KAAK,QAAQ;AAEhB,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC,EACA,OAAO,CAAC,EAAE,UAAU,QAAQ,MAAM,aAAa,OAAO;AAEzD,MAAI,oBAAoB,WAAW,KAAK,sBAAsB,WAAW,GAAG;AAC1E,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,CAAC,GAAG,qBAAqB,GAAG,qBAAqB,EAAE;AAAA,MACjD,OAAO,EAAE,MAAM,QAAQ,MAAM;AAC3B,cAAM,gBAAAA,QAAG,UAAU,MAAM,SAAS,MAAM;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,UAAM,4CAAqB;AAElD,YAAM;AAAA,IACJ,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AAAA,IACL,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,0BAA0B,OACrC,MACA,aAC6B;AAC7B,MAAI;AACF,WAAO,MAAM,qBAAqB,MAAM,QAAQ;AAAA,EAClD,SAAS,KAAK;AACZ,uBAAI,IAAI,2CAA2C;AACnD,uBAAI,WAAO,0BAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
|
+
}
|
package/lib/cli/node/index.js
CHANGED
|
@@ -1,54 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var node_exports = {};
|
|
30
|
+
__export(node_exports, {
|
|
31
|
+
longRunning: () => longRunning,
|
|
32
|
+
node: () => node
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(node_exports);
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_execa = __toESM(require("execa"));
|
|
37
|
+
var import_get_port = __toESM(require("get-port"));
|
|
38
|
+
var import_args = require("../../utils/args.js");
|
|
39
|
+
var import_exec = require("../../utils/exec.js");
|
|
40
|
+
var import_validation = require("../../utils/validation.js");
|
|
41
|
+
var import_tsc = require("../build/tsc.js");
|
|
8
42
|
const longRunning = true;
|
|
9
43
|
const node = async () => {
|
|
10
|
-
const args = parseRunArgs(process.argv.slice(2));
|
|
11
|
-
const customConditions = getCustomConditions();
|
|
44
|
+
const args = (0, import_args.parseRunArgs)(process.argv.slice(2));
|
|
45
|
+
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
12
46
|
const uniqueConditions = [
|
|
13
47
|
.../* @__PURE__ */ new Set([...args.conditions ?? [], ...customConditions])
|
|
14
48
|
];
|
|
15
|
-
const availablePort = await
|
|
49
|
+
const availablePort = await (0, import_get_port.default)();
|
|
16
50
|
const commonArgs = [
|
|
17
51
|
...args.node,
|
|
18
52
|
...uniqueConditions.map((condition) => `--conditions=${condition}`),
|
|
19
53
|
"--env-file-if-exists",
|
|
20
|
-
".env"
|
|
54
|
+
".env",
|
|
55
|
+
"--require",
|
|
56
|
+
require.resolve("tsconfig-paths/register")
|
|
21
57
|
];
|
|
22
58
|
if (args.entryPoint) {
|
|
23
|
-
const exec = createExec({
|
|
59
|
+
const exec = (0, import_exec.createExec)({
|
|
24
60
|
env: {
|
|
25
61
|
__SKUBA_ENTRY_POINT: args.entryPoint,
|
|
26
|
-
__SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort)
|
|
62
|
+
__SKUBA_PORT: String((0, import_validation.isIpPort)(args.port) ? args.port : availablePort)
|
|
27
63
|
}
|
|
28
64
|
});
|
|
29
65
|
return exec(
|
|
30
66
|
"tsx",
|
|
31
67
|
...commonArgs,
|
|
32
|
-
|
|
68
|
+
import_path.default.join(__dirname, "..", "..", "wrapper", "index.js"),
|
|
33
69
|
...args.script
|
|
34
70
|
);
|
|
35
71
|
}
|
|
36
|
-
return
|
|
37
|
-
|
|
72
|
+
return (0, import_execa.default)(
|
|
73
|
+
require.resolve("tsx/cli"),
|
|
38
74
|
[
|
|
39
75
|
...commonArgs,
|
|
40
|
-
"--
|
|
76
|
+
"--require",
|
|
41
77
|
// Unsure if bug or feature that this is needed, but tsx appears to not do anything typescript in the REPL without this!
|
|
42
78
|
// Doesn't occur when just running the tsx binary directly 🧐
|
|
43
|
-
|
|
79
|
+
require.resolve("tsx/patch-repl")
|
|
44
80
|
],
|
|
45
81
|
{
|
|
46
82
|
stdio: "inherit"
|
|
47
83
|
}
|
|
48
84
|
);
|
|
49
85
|
};
|
|
50
|
-
export
|
|
86
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
+
0 && (module.exports = {
|
|
51
88
|
longRunning,
|
|
52
89
|
node
|
|
53
|
-
};
|
|
90
|
+
});
|
|
54
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/node/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport execa from 'execa';\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const longRunning = true;\n\nexport const node = async () => {\n const args = parseRunArgs(process.argv.slice(2));\n const customConditions = getCustomConditions();\n\n const uniqueConditions = [\n ...new Set([...(args.conditions ?? []), ...customConditions]),\n ];\n\n const availablePort = await getPort();\n\n const commonArgs = [\n ...args.node,\n ...uniqueConditions.map((condition) => `--conditions=${condition}`),\n '--env-file-if-exists',\n '.env',\n ];\n\n if (args.entryPoint) {\n const exec = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return exec(\n 'tsx',\n ...commonArgs,\n path.join(
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport execa from 'execa';\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const longRunning = true;\n\nexport const node = async () => {\n const args = parseRunArgs(process.argv.slice(2));\n const customConditions = getCustomConditions();\n\n const uniqueConditions = [\n ...new Set([...(args.conditions ?? []), ...customConditions]),\n ];\n\n const availablePort = await getPort();\n\n const commonArgs = [\n ...args.node,\n ...uniqueConditions.map((condition) => `--conditions=${condition}`),\n '--env-file-if-exists',\n '.env',\n '--require',\n require.resolve('tsconfig-paths/register'),\n ];\n\n if (args.entryPoint) {\n const exec = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return exec(\n 'tsx',\n ...commonArgs,\n path.join(__dirname, '..', '..', 'wrapper', 'index.js'),\n ...args.script,\n );\n }\n\n return execa(\n require.resolve('tsx/cli'),\n [\n ...commonArgs,\n '--require',\n // Unsure if bug or feature that this is needed, but tsx appears to not do anything typescript in the REPL without this!\n // Doesn't occur when just running the tsx binary directly \uD83E\uDDD0\n require.resolve('tsx/patch-repl'),\n ],\n {\n stdio: 'inherit',\n },\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,wBAAyB;AACzB,iBAAoC;AAE7B,MAAM,cAAc;AAEpB,MAAM,OAAO,YAAY;AAC9B,QAAM,WAAO,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAC/C,QAAM,uBAAmB,gCAAoB;AAE7C,QAAM,mBAAmB;AAAA,IACvB,GAAG,oBAAI,IAAI,CAAC,GAAI,KAAK,cAAc,CAAC,GAAI,GAAG,gBAAgB,CAAC;AAAA,EAC9D;AAEA,QAAM,gBAAgB,UAAM,gBAAAA,SAAQ;AAEpC,QAAM,aAAa;AAAA,IACjB,GAAG,KAAK;AAAA,IACR,GAAG,iBAAiB,IAAI,CAAC,cAAc,gBAAgB,SAAS,EAAE;AAAA,IAClE;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,yBAAyB;AAAA,EAC3C;AAEA,MAAI,KAAK,YAAY;AACnB,UAAM,WAAO,wBAAW;AAAA,MACtB,KAAK;AAAA,QACH,qBAAqB,KAAK;AAAA,QAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,MACtE;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA,GAAG;AAAA,MACH,YAAAC,QAAK,KAAK,WAAW,MAAM,MAAM,WAAW,UAAU;AAAA,MACtD,GAAG,KAAK;AAAA,IACV;AAAA,EACF;AAEA,aAAO,aAAAC;AAAA,IACL,gBAAgB,SAAS;AAAA,IACzB;AAAA,MACE,GAAG;AAAA,MACH;AAAA;AAAA;AAAA,MAGA,gBAAgB,gBAAgB;AAAA,IAClC;AAAA,IACA;AAAA,MACE,OAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["getPort", "path", "execa"]
|
|
7
7
|
}
|
package/lib/cli/release/index.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var release_exports = {};
|
|
20
|
+
__export(release_exports, {
|
|
21
|
+
release: () => release
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(release_exports);
|
|
24
|
+
var import_exec = require("../../utils/exec.js");
|
|
2
25
|
const release = async () => {
|
|
3
|
-
await exec("semantic-release", "--success", "false");
|
|
26
|
+
await (0, import_exec.exec)("semantic-release", "--success", "false");
|
|
4
27
|
};
|
|
5
|
-
export
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
6
30
|
release
|
|
7
|
-
};
|
|
31
|
+
});
|
|
8
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/release/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { exec } from '../../utils/exec.js';\n\nexport const release = async () => {\n await exec('semantic-release', '--success', 'false');\n};\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAEd,MAAM,UAAU,YAAY;AACjC,YAAM,kBAAK,oBAAoB,aAAa,OAAO;AACrD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/cli/start/index.js
CHANGED
|
@@ -1,22 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var start_exports = {};
|
|
30
|
+
__export(start_exports, {
|
|
31
|
+
start: () => start
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(start_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_get_port = __toESM(require("get-port"));
|
|
36
|
+
var import_args = require("../../utils/args.js");
|
|
37
|
+
var import_exec = require("../../utils/exec.js");
|
|
38
|
+
var import_manifest = require("../../utils/manifest.js");
|
|
39
|
+
var import_validation = require("../../utils/validation.js");
|
|
40
|
+
var import_tsc = require("../build/tsc.js");
|
|
8
41
|
const start = async () => {
|
|
9
|
-
const customConditions = getCustomConditions();
|
|
10
|
-
const args = parseRunArgs(process.argv.slice(2));
|
|
11
|
-
const availablePort = await
|
|
42
|
+
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
43
|
+
const args = (0, import_args.parseRunArgs)(process.argv.slice(2));
|
|
44
|
+
const availablePort = await (0, import_get_port.default)();
|
|
12
45
|
const uniqueConditions = [
|
|
13
46
|
.../* @__PURE__ */ new Set([...args.conditions ?? [], ...customConditions])
|
|
14
47
|
];
|
|
15
|
-
args.entryPoint ??= await getEntryPointFromManifest();
|
|
16
|
-
const execProcess = createExec({
|
|
48
|
+
args.entryPoint ??= await (0, import_manifest.getEntryPointFromManifest)();
|
|
49
|
+
const execProcess = (0, import_exec.createExec)({
|
|
17
50
|
env: {
|
|
18
51
|
__SKUBA_ENTRY_POINT: args.entryPoint,
|
|
19
|
-
__SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort)
|
|
52
|
+
__SKUBA_PORT: String((0, import_validation.isIpPort)(args.port) ? args.port : availablePort)
|
|
20
53
|
}
|
|
21
54
|
});
|
|
22
55
|
return execProcess(
|
|
@@ -29,11 +62,12 @@ const start = async () => {
|
|
|
29
62
|
".env",
|
|
30
63
|
"--require",
|
|
31
64
|
"tsconfig-paths/register",
|
|
32
|
-
|
|
65
|
+
import_path.default.join(__dirname, "..", "..", "wrapper", "index.js"),
|
|
33
66
|
...args.script
|
|
34
67
|
);
|
|
35
68
|
};
|
|
36
|
-
export
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
37
71
|
start
|
|
38
|
-
};
|
|
72
|
+
});
|
|
39
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/start/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { getEntryPointFromManifest } from '../../utils/manifest.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const start = async () => {\n const customConditions = getCustomConditions();\n const args = parseRunArgs(process.argv.slice(2));\n const availablePort = await getPort();\n\n const uniqueConditions = [\n ...new Set([...(args.conditions ?? []), ...customConditions]),\n ];\n\n args.entryPoint ??= await getEntryPointFromManifest();\n\n const execProcess = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return execProcess(\n 'tsx',\n 'watch',\n '--clear-screen=false',\n ...args.node,\n ...uniqueConditions.map((condition) => `--conditions=${condition}`),\n '--env-file-if-exists',\n '.env',\n '--require',\n 'tsconfig-paths/register',\n path.join(
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { getEntryPointFromManifest } from '../../utils/manifest.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const start = async () => {\n const customConditions = getCustomConditions();\n const args = parseRunArgs(process.argv.slice(2));\n const availablePort = await getPort();\n\n const uniqueConditions = [\n ...new Set([...(args.conditions ?? []), ...customConditions]),\n ];\n\n args.entryPoint ??= await getEntryPointFromManifest();\n\n const execProcess = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return execProcess(\n 'tsx',\n 'watch',\n '--clear-screen=false',\n ...args.node,\n ...uniqueConditions.map((condition) => `--conditions=${condition}`),\n '--env-file-if-exists',\n '.env',\n '--require',\n 'tsconfig-paths/register',\n path.join(__dirname, '..', '..', 'wrapper', 'index.js'),\n ...args.script,\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,sBAA0C;AAC1C,wBAAyB;AACzB,iBAAoC;AAE7B,MAAM,QAAQ,YAAY;AAC/B,QAAM,uBAAmB,gCAAoB;AAC7C,QAAM,WAAO,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAC/C,QAAM,gBAAgB,UAAM,gBAAAA,SAAQ;AAEpC,QAAM,mBAAmB;AAAA,IACvB,GAAG,oBAAI,IAAI,CAAC,GAAI,KAAK,cAAc,CAAC,GAAI,GAAG,gBAAgB,CAAC;AAAA,EAC9D;AAEA,OAAK,eAAe,UAAM,2CAA0B;AAEpD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,qBAAqB,KAAK;AAAA,MAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,IACtE;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,KAAK;AAAA,IACR,GAAG,iBAAiB,IAAI,CAAC,cAAc,gBAAgB,SAAS,EAAE;AAAA,IAClE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAAC,QAAK,KAAK,WAAW,MAAM,MAAM,WAAW,UAAU;AAAA,IACtD,GAAG,KAAK;AAAA,EACV;AACF;",
|
|
6
|
+
"names": ["getPort", "path"]
|
|
7
7
|
}
|
package/lib/cli/test/index.js
CHANGED
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var test_exports = {};
|
|
30
|
+
__export(test_exports, {
|
|
31
|
+
test: () => test
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(test_exports);
|
|
34
|
+
var import_exec = require("../../utils/exec.js");
|
|
2
35
|
const test = async () => {
|
|
3
36
|
const argv = process.argv.slice(2);
|
|
4
|
-
|
|
37
|
+
const nodeOptions = process.env.NODE_OPTIONS ?? "";
|
|
38
|
+
const execWithEnv = (0, import_exec.createExec)({
|
|
39
|
+
env: {
|
|
40
|
+
NODE_OPTIONS: !nodeOptions.includes("--experimental-vm-modules") ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning` : nodeOptions
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return execWithEnv(require.resolve("jest/bin/jest"), ...argv);
|
|
5
44
|
};
|
|
6
|
-
export
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
7
47
|
test
|
|
8
|
-
};
|
|
48
|
+
});
|
|
9
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/test/index.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "AAAA,
|
|
4
|
+
"sourcesContent": ["import { createExec } from '../../utils/exec.js';\n\nexport const test = async () => {\n const argv = process.argv.slice(2);\n\n const nodeOptions = process.env.NODE_OPTIONS ?? '';\n\n const execWithEnv = createExec({\n env: {\n NODE_OPTIONS: !nodeOptions.includes('--experimental-vm-modules')\n ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning`\n : nodeOptions,\n },\n });\n\n // Run Jest in a child process with proper environment\n return execWithEnv(require.resolve('jest/bin/jest'), ...argv);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAEpB,MAAM,OAAO,YAAY;AAC9B,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,QAAM,cAAc,QAAQ,IAAI,gBAAgB;AAEhD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,cAAc,CAAC,YAAY,SAAS,2BAA2B,IAC3D,GAAG,WAAW,iEACd;AAAA,IACN;AAAA,EACF,CAAC;AAGD,SAAO,YAAY,gBAAgB,eAAe,GAAG,GAAG,IAAI;AAC9D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TestResult } from '@jest/test-result';
|
|
2
|
+
import type * as GitHub from '@skuba-lib/api/github';
|
|
3
|
+
export declare const createAnnotations: (testResults: TestResult[]) => GitHub.Annotation[];
|
|
4
|
+
interface AnnotationEntry {
|
|
5
|
+
annotations: GitHub.Annotation[];
|
|
6
|
+
displayName: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const generateAnnotationEntries: (testResults: TestResult[]) => AnnotationEntry[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var annotations_exports = {};
|
|
30
|
+
__export(annotations_exports, {
|
|
31
|
+
createAnnotations: () => createAnnotations,
|
|
32
|
+
generateAnnotationEntries: () => generateAnnotationEntries
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(annotations_exports);
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_util = require("util");
|
|
37
|
+
var import_ts_dedent = __toESM(require("ts-dedent"));
|
|
38
|
+
const JEST_LOCATION_REGEX = /\n +at (.+\()?(.+?):(\d+):(\d+)/;
|
|
39
|
+
const createAnnotations = (testResults) => {
|
|
40
|
+
const cwd = process.cwd();
|
|
41
|
+
return testResults.flatMap((testResult) => {
|
|
42
|
+
if (testResult.testExecError) {
|
|
43
|
+
return {
|
|
44
|
+
annotation_level: "failure",
|
|
45
|
+
path: import_path.default.relative(cwd, testResult.testFilePath),
|
|
46
|
+
start_line: 1,
|
|
47
|
+
end_line: 1,
|
|
48
|
+
message: (0, import_util.stripVTControlCharacters)(
|
|
49
|
+
testResult.failureMessage ? (0, import_ts_dedent.default)(testResult.failureMessage) : testResult.testExecError.message
|
|
50
|
+
),
|
|
51
|
+
title: "Jest"
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (testResult.numFailingTests > 0) {
|
|
55
|
+
return testResult.testResults.flatMap(
|
|
56
|
+
(assertionResult) => assertionResult.failureMessages.flatMap((failureMessage) => {
|
|
57
|
+
const match = JEST_LOCATION_REGEX.exec(failureMessage);
|
|
58
|
+
if (match?.length === 5 && match[2]) {
|
|
59
|
+
return {
|
|
60
|
+
annotation_level: "failure",
|
|
61
|
+
path: import_path.default.relative(cwd, match[2]),
|
|
62
|
+
start_line: Number(match[3]),
|
|
63
|
+
end_line: Number(match[3]),
|
|
64
|
+
start_column: Number(match[4]),
|
|
65
|
+
end_column: Number(match[4]),
|
|
66
|
+
message: (0, import_util.stripVTControlCharacters)(failureMessage),
|
|
67
|
+
title: "Jest"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return [];
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
const DEFAULT_DISPLAY_NAME = Symbol("DEFAULT_DISPLAY_NAME");
|
|
78
|
+
const generateAnnotationEntries = (testResults) => {
|
|
79
|
+
const resultsByDisplayName = testResults.reduce(
|
|
80
|
+
(acc, result) => {
|
|
81
|
+
const displayName = result.displayName?.name ?? DEFAULT_DISPLAY_NAME;
|
|
82
|
+
(acc[displayName] ??= []).push(result);
|
|
83
|
+
return acc;
|
|
84
|
+
},
|
|
85
|
+
{}
|
|
86
|
+
);
|
|
87
|
+
const defaultResults = resultsByDisplayName[DEFAULT_DISPLAY_NAME];
|
|
88
|
+
const entries = [
|
|
89
|
+
...defaultResults?.length ? [[void 0, defaultResults]] : [],
|
|
90
|
+
...Object.entries(resultsByDisplayName)
|
|
91
|
+
];
|
|
92
|
+
return entries.map(([displayName, results]) => ({
|
|
93
|
+
annotations: createAnnotations(results),
|
|
94
|
+
displayName
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
createAnnotations,
|
|
100
|
+
generateAnnotationEntries
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/cli/test/reporters/github/annotations.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\nimport { stripVTControlCharacters as stripAnsi } from 'util';\n\nimport type { TestResult } from '@jest/test-result';\nimport dedent from 'ts-dedent';\n\nimport type * as GitHub from '@skuba-lib/api/github';\n\n/**\n * Matches the first stack trace location in a Jest failure message.\n *\n * For example, given the following input message:\n *\n * ```console\n * Error: expect(received).toBe(expected) // Object.is equality\n *\n * Expected: \"a\"\n * Received: \"b\"\n * at Object.<anonymous> (/workdir/skuba/src/test.test.ts:2:15)\n * at Promise.then.completed (/workdir/skuba/node_modules/jest-circus/build/utils.js:390:28)\n * ...\n * ```\n *\n * or:\n *\n * ```console\n * Error: expect(received).toBe(expected) // Object.is equality\n *\n * Expected: \"a\"\n * Received: \"b\"\n * at /workdir/skuba/src/test.test.ts:2:15\n * at Promise.then.completed (/workdir/skuba/node_modules/jest-circus/build/utils.js:390:28)\n * ...\n * ```\n *\n * This pattern will produce the following matches:\n *\n * 1. /workdir/skuba/src/test.test.ts\n * 2. 2\n * 2. 15\n */\nconst JEST_LOCATION_REGEX = /\\n +at (.+\\()?(.+?):(\\d+):(\\d+)/;\n\nexport const createAnnotations = (\n testResults: TestResult[],\n): GitHub.Annotation[] => {\n const cwd = process.cwd();\n\n return testResults.flatMap((testResult) => {\n if (testResult.testExecError) {\n return {\n annotation_level: 'failure',\n path: path.relative(cwd, testResult.testFilePath),\n start_line: 1,\n end_line: 1,\n message: stripAnsi(\n testResult.failureMessage\n ? dedent(testResult.failureMessage)\n : testResult.testExecError.message,\n ),\n title: 'Jest',\n };\n }\n\n if (testResult.numFailingTests > 0) {\n return testResult.testResults.flatMap((assertionResult) =>\n assertionResult.failureMessages.flatMap((failureMessage) => {\n const match = JEST_LOCATION_REGEX.exec(failureMessage);\n if (match?.length === 5 && match[2]) {\n return {\n annotation_level: 'failure',\n path: path.relative(cwd, match[2]),\n start_line: Number(match[3]),\n end_line: Number(match[3]),\n start_column: Number(match[4]),\n end_column: Number(match[4]),\n message: stripAnsi(failureMessage),\n title: 'Jest',\n };\n }\n\n return [];\n }),\n );\n }\n\n return [];\n });\n};\n\nconst DEFAULT_DISPLAY_NAME = Symbol('DEFAULT_DISPLAY_NAME');\n\ninterface AnnotationEntry {\n annotations: GitHub.Annotation[];\n displayName: string | undefined;\n}\n\nexport const generateAnnotationEntries = (\n testResults: TestResult[],\n): AnnotationEntry[] => {\n type ResultsByDisplayName = Record<string | symbol, TestResult[]>;\n\n // Group test results by display name.\n const resultsByDisplayName = testResults.reduce<ResultsByDisplayName>(\n (acc, result) => {\n const displayName = result.displayName?.name ?? DEFAULT_DISPLAY_NAME;\n\n (acc[displayName] ??= []).push(result);\n\n return acc;\n },\n {},\n );\n\n const defaultResults = resultsByDisplayName[DEFAULT_DISPLAY_NAME];\n\n const entries = [\n ...(defaultResults?.length ? ([[undefined, defaultResults]] as const) : []),\n ...Object.entries(resultsByDisplayName),\n ];\n\n // Create annotations for each display name.\n return entries.map<AnnotationEntry>(([displayName, results]) => ({\n annotations: createAnnotations(results),\n displayName,\n }));\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAsD;AAGtD,uBAAmB;AAqCnB,MAAM,sBAAsB;AAErB,MAAM,oBAAoB,CAC/B,gBACwB;AACxB,QAAM,MAAM,QAAQ,IAAI;AAExB,SAAO,YAAY,QAAQ,CAAC,eAAe;AACzC,QAAI,WAAW,eAAe;AAC5B,aAAO;AAAA,QACL,kBAAkB;AAAA,QAClB,MAAM,YAAAA,QAAK,SAAS,KAAK,WAAW,YAAY;AAAA,QAChD,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,aAAS,YAAAC;AAAA,UACP,WAAW,qBACP,iBAAAC,SAAO,WAAW,cAAc,IAChC,WAAW,cAAc;AAAA,QAC/B;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAEA,QAAI,WAAW,kBAAkB,GAAG;AAClC,aAAO,WAAW,YAAY;AAAA,QAAQ,CAAC,oBACrC,gBAAgB,gBAAgB,QAAQ,CAAC,mBAAmB;AAC1D,gBAAM,QAAQ,oBAAoB,KAAK,cAAc;AACrD,cAAI,OAAO,WAAW,KAAK,MAAM,CAAC,GAAG;AACnC,mBAAO;AAAA,cACL,kBAAkB;AAAA,cAClB,MAAM,YAAAF,QAAK,SAAS,KAAK,MAAM,CAAC,CAAC;AAAA,cACjC,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,cAC3B,UAAU,OAAO,MAAM,CAAC,CAAC;AAAA,cACzB,cAAc,OAAO,MAAM,CAAC,CAAC;AAAA,cAC7B,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,cAC3B,aAAS,YAAAC,0BAAU,cAAc;AAAA,cACjC,OAAO;AAAA,YACT;AAAA,UACF;AAEA,iBAAO,CAAC;AAAA,QACV,CAAC;AAAA,MACH;AAAA,IACF;AAEA,WAAO,CAAC;AAAA,EACV,CAAC;AACH;AAEA,MAAM,uBAAuB,OAAO,sBAAsB;AAOnD,MAAM,4BAA4B,CACvC,gBACsB;AAItB,QAAM,uBAAuB,YAAY;AAAA,IACvC,CAAC,KAAK,WAAW;AACf,YAAM,cAAc,OAAO,aAAa,QAAQ;AAEhD,OAAC,IAAI,WAAW,MAAM,CAAC,GAAG,KAAK,MAAM;AAErC,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AAEA,QAAM,iBAAiB,qBAAqB,oBAAoB;AAEhE,QAAM,UAAU;AAAA,IACd,GAAI,gBAAgB,SAAU,CAAC,CAAC,QAAW,cAAc,CAAC,IAAc,CAAC;AAAA,IACzE,GAAG,OAAO,QAAQ,oBAAoB;AAAA,EACxC;AAGA,SAAO,QAAQ,IAAqB,CAAC,CAAC,aAAa,OAAO,OAAO;AAAA,IAC/D,aAAa,kBAAkB,OAAO;AAAA,IACtC;AAAA,EACF,EAAE;AACJ;",
|
|
6
|
+
"names": ["path", "stripAnsi", "dedent"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Reporter, TestContext } from '@jest/reporters';
|
|
2
|
+
import type { AggregatedResult } from '@jest/test-result';
|
|
3
|
+
export default class GitHubReporter implements Pick<Reporter, 'onRunComplete'> {
|
|
4
|
+
onRunComplete(_contexts: Set<TestContext>, { testResults }: AggregatedResult): Promise<void>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var github_exports = {};
|
|
30
|
+
__export(github_exports, {
|
|
31
|
+
default: () => GitHubReporter
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(github_exports);
|
|
34
|
+
var import_util = require("util");
|
|
35
|
+
var import_logging = require("../../../../utils/logging.js");
|
|
36
|
+
var import_wait = require("../../../../utils/wait.js");
|
|
37
|
+
var import_annotations = require("./annotations.js");
|
|
38
|
+
var GitHub = __toESM(require("@skuba-lib/api/github"));
|
|
39
|
+
class GitHubReporter {
|
|
40
|
+
async onRunComplete(_contexts, { testResults }) {
|
|
41
|
+
if (!GitHub.enabledFromEnvironment()) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let lastCheckRun;
|
|
45
|
+
try {
|
|
46
|
+
const entries = (0, import_annotations.generateAnnotationEntries)(testResults);
|
|
47
|
+
const build = GitHub.buildNameFromEnvironment();
|
|
48
|
+
for (const { displayName, annotations } of entries) {
|
|
49
|
+
const name = `skuba/test${displayName ? ` (${displayName})` : ""}`;
|
|
50
|
+
const isOk = !annotations.length;
|
|
51
|
+
const summary = isOk ? "`skuba test` passed." : "`skuba test` found issues that require triage.";
|
|
52
|
+
const checkRun = {
|
|
53
|
+
name,
|
|
54
|
+
annotations,
|
|
55
|
+
conclusion: isOk ? "success" : "failure",
|
|
56
|
+
summary,
|
|
57
|
+
title: `${build} ${isOk ? "passed" : "failed"}`
|
|
58
|
+
};
|
|
59
|
+
lastCheckRun = checkRun;
|
|
60
|
+
await (0, import_wait.throwOnTimeout)(GitHub.createCheckRun(checkRun), {
|
|
61
|
+
s: 30
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
} catch (err) {
|
|
65
|
+
import_logging.log.warn("Failed to report test results to GitHub.");
|
|
66
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
67
|
+
if (lastCheckRun) {
|
|
68
|
+
import_logging.log.subtle("Last request:");
|
|
69
|
+
import_logging.log.subtle(JSON.stringify(lastCheckRun));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/cli/test/reporters/github/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport type { Reporter, TestContext } from '@jest/reporters';\nimport type { AggregatedResult } from '@jest/test-result';\n\nimport { log } from '../../../../utils/logging.js';\nimport { throwOnTimeout } from '../../../../utils/wait.js';\n\nimport { generateAnnotationEntries } from './annotations.js';\n\nimport * as GitHub from '@skuba-lib/api/github';\n\nexport default class GitHubReporter implements Pick<Reporter, 'onRunComplete'> {\n async onRunComplete(\n _contexts: Set<TestContext>,\n { testResults }: AggregatedResult,\n ): Promise<void> {\n if (!GitHub.enabledFromEnvironment()) {\n return;\n }\n\n type CheckRun = Parameters<typeof GitHub.createCheckRun>[0];\n\n let lastCheckRun: CheckRun | undefined;\n\n try {\n const entries = generateAnnotationEntries(testResults);\n\n const build = GitHub.buildNameFromEnvironment();\n\n // Create a check run per display name.\n // Run in series to reduce the likelihood of exceeding GitHub rate limits.\n for (const { displayName, annotations } of entries) {\n const name = `skuba/test${displayName ? ` (${displayName})` : ''}`;\n\n const isOk = !annotations.length;\n\n const summary = isOk\n ? '`skuba test` passed.'\n : '`skuba test` found issues that require triage.';\n\n const checkRun: CheckRun = {\n name,\n annotations,\n conclusion: isOk ? 'success' : 'failure',\n summary,\n title: `${build} ${isOk ? 'passed' : 'failed'}`,\n };\n\n lastCheckRun = checkRun;\n\n await throwOnTimeout(GitHub.createCheckRun(checkRun), {\n s: 30,\n });\n }\n } catch (err) {\n log.warn('Failed to report test results to GitHub.');\n log.subtle(inspect(err));\n\n if (lastCheckRun) {\n log.subtle('Last request:');\n log.subtle(JSON.stringify(lastCheckRun));\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAKxB,qBAAoB;AACpB,kBAA+B;AAE/B,yBAA0C;AAE1C,aAAwB;AAExB,MAAO,eAAwE;AAAA,EAC7E,MAAM,cACJ,WACA,EAAE,YAAY,GACC;AACf,QAAI,CAAC,OAAO,uBAAuB,GAAG;AACpC;AAAA,IACF;AAIA,QAAI;AAEJ,QAAI;AACF,YAAM,cAAU,8CAA0B,WAAW;AAErD,YAAM,QAAQ,OAAO,yBAAyB;AAI9C,iBAAW,EAAE,aAAa,YAAY,KAAK,SAAS;AAClD,cAAM,OAAO,aAAa,cAAc,KAAK,WAAW,MAAM,EAAE;AAEhE,cAAM,OAAO,CAAC,YAAY;AAE1B,cAAM,UAAU,OACZ,yBACA;AAEJ,cAAM,WAAqB;AAAA,UACzB;AAAA,UACA;AAAA,UACA,YAAY,OAAO,YAAY;AAAA,UAC/B;AAAA,UACA,OAAO,GAAG,KAAK,IAAI,OAAO,WAAW,QAAQ;AAAA,QAC/C;AAEA,uBAAe;AAEf,kBAAM,4BAAe,OAAO,eAAe,QAAQ,GAAG;AAAA,UACpD,GAAG;AAAA,QACL,CAAC;AAAA,MACH;AAAA,IACF,SAAS,KAAK;AACZ,yBAAI,KAAK,0CAA0C;AACnD,yBAAI,WAAO,qBAAQ,GAAG,CAAC;AAEvB,UAAI,cAAc;AAChB,2BAAI,OAAO,eAAe;AAC1B,2BAAI,OAAO,KAAK,UAAU,YAAY,CAAC;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|