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
package/lib/utils/dir.js
CHANGED
|
@@ -1,27 +1,66 @@
|
|
|
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 dir_exports = {};
|
|
30
|
+
__export(dir_exports, {
|
|
31
|
+
buildPatternToFilepathMap: () => buildPatternToFilepathMap,
|
|
32
|
+
crawlDirectory: () => crawlDirectory,
|
|
33
|
+
createInclusionFilter: () => createInclusionFilter,
|
|
34
|
+
findCurrentWorkspaceProjectRoot: () => findCurrentWorkspaceProjectRoot,
|
|
35
|
+
findWorkspaceRoot: () => findWorkspaceRoot,
|
|
36
|
+
locateFurthestFile: () => locateFurthestFile,
|
|
37
|
+
locateNearestFile: () => locateNearestFile
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(dir_exports);
|
|
40
|
+
var import_path = __toESM(require("path"));
|
|
41
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
42
|
+
var import_ignore = __toESM(require("ignore"));
|
|
43
|
+
var import_picomatch = __toESM(require("picomatch"));
|
|
44
|
+
var import_error = require("./error.js");
|
|
45
|
+
var import_fs = require("./fs.js");
|
|
46
|
+
var Git = __toESM(require("@skuba-lib/api/git"));
|
|
8
47
|
const buildPatternToFilepathMap = (patterns, allFilepaths, options) => Object.fromEntries(
|
|
9
48
|
patterns.map((pattern) => {
|
|
10
|
-
const isMatch =
|
|
49
|
+
const isMatch = (0, import_picomatch.default)(pattern, options);
|
|
11
50
|
const filepaths = allFilepaths.filter((filepath) => isMatch(filepath));
|
|
12
51
|
return [pattern, filepaths];
|
|
13
52
|
})
|
|
14
53
|
);
|
|
15
54
|
const crawlDirectory = async (root, ignoreFilenames = [".gitignore"]) => {
|
|
16
55
|
const ignoreFileFilter = await createInclusionFilter(
|
|
17
|
-
ignoreFilenames.map((ignoreFilename) =>
|
|
56
|
+
ignoreFilenames.map((ignoreFilename) => import_path.default.join(root, ignoreFilename))
|
|
18
57
|
);
|
|
19
58
|
const absoluteFilenames = await crawl(root, {
|
|
20
59
|
includeDirName: (dirname) => ![".git", "node_modules"].includes(dirname),
|
|
21
|
-
includeFilePath: (pathname) => ignoreFileFilter(
|
|
60
|
+
includeFilePath: (pathname) => ignoreFileFilter(import_path.default.relative(root, pathname))
|
|
22
61
|
});
|
|
23
62
|
const relativeFilepaths = absoluteFilenames.map(
|
|
24
|
-
(filepath) =>
|
|
63
|
+
(filepath) => import_path.default.relative(root, filepath)
|
|
25
64
|
);
|
|
26
65
|
return relativeFilepaths;
|
|
27
66
|
};
|
|
@@ -29,26 +68,26 @@ const createInclusionFilter = async (ignoreFilepaths) => {
|
|
|
29
68
|
const ignoreFiles = await Promise.all(
|
|
30
69
|
ignoreFilepaths.map(async (ignoreFilepath) => {
|
|
31
70
|
try {
|
|
32
|
-
return await
|
|
71
|
+
return await import_fs_extra.default.promises.readFile(ignoreFilepath, "utf8");
|
|
33
72
|
} catch (err) {
|
|
34
|
-
if (isErrorWithCode(err, "ENOENT")) {
|
|
73
|
+
if ((0, import_error.isErrorWithCode)(err, "ENOENT")) {
|
|
35
74
|
return;
|
|
36
75
|
}
|
|
37
76
|
throw err;
|
|
38
77
|
}
|
|
39
78
|
})
|
|
40
79
|
);
|
|
41
|
-
const managers = ignoreFiles.filter((value) => typeof value === "string").map((value) =>
|
|
42
|
-
return
|
|
80
|
+
const managers = ignoreFiles.filter((value) => typeof value === "string").map((value) => (0, import_ignore.default)().add(value));
|
|
81
|
+
return (0, import_ignore.default)().add(".git").add(managers).createFilter();
|
|
43
82
|
};
|
|
44
83
|
async function crawl(directoryPath, filters, paths = []) {
|
|
45
84
|
try {
|
|
46
|
-
const entries = await
|
|
85
|
+
const entries = await import_fs_extra.default.promises.readdir(directoryPath, {
|
|
47
86
|
withFileTypes: true
|
|
48
87
|
});
|
|
49
88
|
await Promise.all(
|
|
50
89
|
entries.map(async (entry) => {
|
|
51
|
-
const fullPath =
|
|
90
|
+
const fullPath = import_path.default.join(directoryPath, entry.name);
|
|
52
91
|
if ((entry.isFile() || entry.isSymbolicLink()) && filters.includeFilePath(fullPath)) {
|
|
53
92
|
paths.push(fullPath);
|
|
54
93
|
}
|
|
@@ -66,12 +105,12 @@ const locateNearestFile = async ({
|
|
|
66
105
|
filename
|
|
67
106
|
}) => {
|
|
68
107
|
let currentDir = cwd;
|
|
69
|
-
while (currentDir !==
|
|
70
|
-
const filePath =
|
|
71
|
-
if (await pathExists(filePath)) {
|
|
108
|
+
while (currentDir !== import_path.default.dirname(currentDir)) {
|
|
109
|
+
const filePath = import_path.default.join(currentDir, filename);
|
|
110
|
+
if (await (0, import_fs.pathExists)(filePath)) {
|
|
72
111
|
return filePath;
|
|
73
112
|
}
|
|
74
|
-
currentDir =
|
|
113
|
+
currentDir = import_path.default.dirname(currentDir);
|
|
75
114
|
}
|
|
76
115
|
return null;
|
|
77
116
|
};
|
|
@@ -81,12 +120,12 @@ const locateFurthestFile = async ({
|
|
|
81
120
|
}) => {
|
|
82
121
|
let currentDir = cwd;
|
|
83
122
|
let furthestFilePath = null;
|
|
84
|
-
while (currentDir !==
|
|
85
|
-
const filePath =
|
|
86
|
-
if (await pathExists(filePath)) {
|
|
123
|
+
while (currentDir !== import_path.default.dirname(currentDir)) {
|
|
124
|
+
const filePath = import_path.default.join(currentDir, filename);
|
|
125
|
+
if (await (0, import_fs.pathExists)(filePath)) {
|
|
87
126
|
furthestFilePath = filePath;
|
|
88
127
|
}
|
|
89
|
-
currentDir =
|
|
128
|
+
currentDir = import_path.default.dirname(currentDir);
|
|
90
129
|
}
|
|
91
130
|
return furthestFilePath;
|
|
92
131
|
};
|
|
@@ -100,14 +139,14 @@ const findWorkspaceRoot = async (cwd = process.cwd()) => {
|
|
|
100
139
|
Git.findRoot({ dir: cwd })
|
|
101
140
|
]);
|
|
102
141
|
const candidates = [
|
|
103
|
-
pnpmLock ?
|
|
104
|
-
yarnLock ?
|
|
105
|
-
packageJson ?
|
|
142
|
+
pnpmLock ? import_path.default.dirname(pnpmLock) : null,
|
|
143
|
+
yarnLock ? import_path.default.dirname(yarnLock) : null,
|
|
144
|
+
packageJson ? import_path.default.dirname(packageJson) : null,
|
|
106
145
|
gitRoot
|
|
107
146
|
].filter((dir) => dir !== null);
|
|
108
147
|
if (candidates[0]) {
|
|
109
148
|
return candidates.reduce((longest, current) => {
|
|
110
|
-
if (current.split(
|
|
149
|
+
if (current.split(import_path.default.sep).length > longest.split(import_path.default.sep).length) {
|
|
111
150
|
return current;
|
|
112
151
|
}
|
|
113
152
|
return longest;
|
|
@@ -122,9 +161,10 @@ const findCurrentWorkspaceProjectRoot = async (cwd = process.cwd()) => {
|
|
|
122
161
|
cwd,
|
|
123
162
|
filename: "package.json"
|
|
124
163
|
});
|
|
125
|
-
return packageJson ?
|
|
164
|
+
return packageJson ? import_path.default.dirname(packageJson) : null;
|
|
126
165
|
};
|
|
127
|
-
export
|
|
166
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
167
|
+
0 && (module.exports = {
|
|
128
168
|
buildPatternToFilepathMap,
|
|
129
169
|
crawlDirectory,
|
|
130
170
|
createInclusionFilter,
|
|
@@ -132,5 +172,5 @@ export {
|
|
|
132
172
|
findWorkspaceRoot,
|
|
133
173
|
locateFurthestFile,
|
|
134
174
|
locateNearestFile
|
|
135
|
-
};
|
|
175
|
+
});
|
|
136
176
|
//# sourceMappingURL=dir.js.map
|
package/lib/utils/dir.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/dir.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport ignore from 'ignore';\nimport picomatch from 'picomatch';\n\nimport { isErrorWithCode } from './error.js';\nimport { pathExists } from './fs.js';\n\nimport * as Git from '@skuba-lib/api/git';\n\n/**\n * Build a map that associates each glob pattern with its matching filepaths.\n */\nexport const buildPatternToFilepathMap = (\n patterns: string[],\n allFilepaths: string[],\n options?: picomatch.PicomatchOptions,\n) =>\n Object.fromEntries(\n patterns.map((pattern) => {\n const isMatch = picomatch(pattern, options);\n\n const filepaths = allFilepaths.filter((filepath) => isMatch(filepath));\n\n return [pattern, filepaths] as const;\n }),\n );\n\n/**\n * List relative filepaths contained within a directory root.\n *\n * This excludes:\n *\n * - Patterns in the ignore files specified in `ignoreFilenames`\n * - `.git` subdirectories\n * - `node_modules` subdirectories\n */\nexport const crawlDirectory = async (\n root: string,\n ignoreFilenames = ['.gitignore'],\n) => {\n const ignoreFileFilter = await createInclusionFilter(\n ignoreFilenames.map((ignoreFilename) => path.join(root, ignoreFilename)),\n );\n\n const absoluteFilenames = await crawl(root, {\n includeDirName: (dirname) => !['.git', 'node_modules'].includes(dirname),\n includeFilePath: (pathname) =>\n ignoreFileFilter(path.relative(root, pathname)),\n });\n\n const relativeFilepaths = absoluteFilenames.map((filepath) =>\n path.relative(root, filepath),\n );\n\n return relativeFilepaths;\n};\n\n/**\n * Create a filter function that excludes filepaths based on ignore files like\n * `.gitignore` and `.prettierignore`.\n */\nexport const createInclusionFilter = async (ignoreFilepaths: string[]) => {\n const ignoreFiles = await Promise.all(\n ignoreFilepaths.map(async (ignoreFilepath) => {\n try {\n return await fs.promises.readFile(ignoreFilepath, 'utf8');\n } catch (err) {\n if (isErrorWithCode(err, 'ENOENT')) {\n return;\n }\n\n throw err;\n }\n }),\n );\n\n const managers = ignoreFiles\n .filter((value): value is string => typeof value === 'string')\n .map((value) => ignore().add(value));\n\n return ignore().add('.git').add(managers).createFilter();\n};\n\n/**\n * Recursively crawl a directory and return all file paths that match the\n * filters. `paths` is mutated and returned.\n */\nasync function crawl(\n directoryPath: string,\n filters: {\n includeDirName: (dirName: string) => boolean;\n includeFilePath: (path: string) => boolean;\n },\n paths: string[] = [],\n) {\n try {\n const entries = await fs.promises.readdir(directoryPath, {\n withFileTypes: true,\n });\n\n await Promise.all(\n entries.map(async (entry) => {\n const fullPath = path.join(directoryPath, entry.name);\n\n if (\n (entry.isFile() || entry.isSymbolicLink()) &&\n filters.includeFilePath(fullPath)\n ) {\n paths.push(fullPath);\n }\n\n if (entry.isDirectory() && filters.includeDirName(entry.name)) {\n await crawl(fullPath, filters, paths);\n }\n }),\n );\n } catch {\n // Ignore errors, because of e.g. permission issues reading directories\n }\n\n return paths;\n}\n\nexport const locateNearestFile = async ({\n cwd,\n filename,\n}: {\n cwd: string;\n filename: string;\n}) => {\n let currentDir = cwd;\n while (currentDir !== path.dirname(currentDir)) {\n const filePath = path.join(currentDir, filename);\n if (await pathExists(filePath)) {\n return filePath;\n }\n currentDir = path.dirname(currentDir);\n }\n\n return null;\n};\n\nexport const locateFurthestFile = async ({\n cwd,\n filename,\n}: {\n cwd: string;\n filename: string;\n}) => {\n let currentDir = cwd;\n let furthestFilePath: string | null = null;\n\n while (currentDir !== path.dirname(currentDir)) {\n const filePath = path.join(currentDir, filename);\n if (await pathExists(filePath)) {\n furthestFilePath = filePath;\n }\n currentDir = path.dirname(currentDir);\n }\n\n return furthestFilePath;\n};\n\nconst workspaceRootCache: Record<string, string | null> = {};\n\nexport const findWorkspaceRoot = async (\n cwd = process.cwd(),\n): Promise<string | null> => {\n const find = async (): Promise<string | null> => {\n const [pnpmLock, yarnLock, packageJson, gitRoot] = await Promise.all([\n locateNearestFile({ cwd, filename: 'pnpm-lock.yaml' }),\n locateNearestFile({ cwd, filename: 'yarn.lock' }),\n locateFurthestFile({ cwd, filename: 'package.json' }),\n Git.findRoot({ dir: cwd }),\n ]);\n\n const candidates = [\n pnpmLock ? path.dirname(pnpmLock) : null,\n yarnLock ? path.dirname(yarnLock) : null,\n packageJson ? path.dirname(packageJson) : null,\n gitRoot,\n ].filter((dir): dir is string => dir !== null);\n\n if (candidates[0]) {\n // Pick the longest path. This will be the most specific, which helps guard against someone\n // having an accidental lockfile in a parent directory by mistake.\n\n return candidates.reduce((longest, current) => {\n if (current.split(path.sep).length > longest.split(path.sep).length) {\n return current;\n }\n return longest;\n }, candidates[0]);\n }\n\n return null;\n };\n\n return (workspaceRootCache[cwd] ??= await find());\n};\n\nexport const findCurrentWorkspaceProjectRoot = async (\n cwd = process.cwd(),\n): Promise<string | null> => {\n const packageJson = await locateNearestFile({\n cwd,\n filename: 'package.json',\n });\n return packageJson ? path.dirname(packageJson) : null;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["picomatch", "path", "fs", "ignore"]
|
|
7
7
|
}
|
package/lib/utils/env.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
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 env_exports = {};
|
|
20
|
+
__export(env_exports, {
|
|
21
|
+
isCiEnv: () => isCiEnv
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(env_exports);
|
|
1
24
|
const isCiEnv = (env = process.env) => Boolean(env.BUILDKITE || env.CI || env.GITHUB_ACTIONS);
|
|
2
|
-
export
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
3
27
|
isCiEnv
|
|
4
|
-
};
|
|
28
|
+
});
|
|
5
29
|
//# sourceMappingURL=env.js.map
|
package/lib/utils/env.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/env.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * Whether the code is executing in a CI environment.\n */\nexport const isCiEnv = (env = process.env): boolean =>\n Boolean(env.BUILDKITE || env.CI || env.GITHUB_ACTIONS);\n"],
|
|
5
|
-
"mappings": "AAGO,MAAM,UAAU,CAAC,MAAM,QAAQ,QACpC,QAAQ,IAAI,aAAa,IAAI,MAAM,IAAI,cAAc;",
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU,CAAC,MAAM,QAAQ,QACpC,QAAQ,IAAI,aAAa,IAAI,MAAM,IAAI,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/utils/error.js
CHANGED
|
@@ -1,7 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var error_exports = {};
|
|
30
|
+
__export(error_exports, {
|
|
31
|
+
concurrentlyErrorsSchema: () => concurrentlyErrorsSchema,
|
|
32
|
+
createTerseError: () => createTerseError,
|
|
33
|
+
handleCliError: () => handleCliError,
|
|
34
|
+
isErrorWithCode: () => isErrorWithCode
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(error_exports);
|
|
37
|
+
var import_util = require("util");
|
|
38
|
+
var z = __toESM(require("zod/v4"));
|
|
39
|
+
var import_logging = require("./logging.js");
|
|
40
|
+
var import_validation = require("./validation.js");
|
|
5
41
|
const concurrentlyErrorsSchema = z.array(
|
|
6
42
|
z.object({
|
|
7
43
|
command: z.object({
|
|
@@ -13,23 +49,24 @@ const concurrentlyErrorsSchema = z.array(
|
|
|
13
49
|
})
|
|
14
50
|
);
|
|
15
51
|
const createTerseError = (message) => Object.assign(new Error(message), {
|
|
16
|
-
[inspect.custom]: () => message
|
|
52
|
+
[import_util.inspect.custom]: () => message
|
|
17
53
|
});
|
|
18
|
-
const isExecaError = (err) => hasNumberProp(err, "exitCode");
|
|
54
|
+
const isExecaError = (err) => (0, import_validation.hasNumberProp)(err, "exitCode");
|
|
19
55
|
const handleCliError = (err) => {
|
|
20
56
|
if (isExecaError(err)) {
|
|
21
57
|
process.exitCode = err.exitCode;
|
|
22
58
|
return;
|
|
23
59
|
}
|
|
24
|
-
log.err(inspect(err));
|
|
60
|
+
import_logging.log.err((0, import_util.inspect)(err));
|
|
25
61
|
process.exitCode = 1;
|
|
26
62
|
return;
|
|
27
63
|
};
|
|
28
|
-
const isErrorWithCode = (err, code) => hasProp(err, "code") && err.code === code;
|
|
29
|
-
export
|
|
64
|
+
const isErrorWithCode = (err, code) => (0, import_validation.hasProp)(err, "code") && err.code === code;
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
30
67
|
concurrentlyErrorsSchema,
|
|
31
68
|
createTerseError,
|
|
32
69
|
handleCliError,
|
|
33
70
|
isErrorWithCode
|
|
34
|
-
};
|
|
71
|
+
});
|
|
35
72
|
//# sourceMappingURL=error.js.map
|
package/lib/utils/error.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/error.ts"],
|
|
4
4
|
"sourcesContent": ["import { inspect } from 'util';\n\nimport type { ExecaError } from 'execa';\nimport * as z from 'zod/v4';\n\nimport { log } from './logging.js';\nimport { hasNumberProp, hasProp } from './validation.js';\n\nexport type ConcurrentlyErrors = z.infer<typeof concurrentlyErrorsSchema>;\n\nexport const concurrentlyErrorsSchema = z.array(\n z.object({\n command: z.object({\n command: z.string(),\n name: z.string(),\n }),\n index: z.number(),\n exitCode: z.number(),\n }),\n);\n\n/**\n * Creates an error that returns its plain `message` rather than a full stack\n * trace when `util.inspect`ed.\n *\n * This can be useful for terser handling and logging of known error scenarios\n * that have descriptive messages.\n *\n * https://nodejs.org/api/util.html#custom-inspection-functions-on-objects\n */\nexport const createTerseError = (message?: string) =>\n Object.assign(new Error(message), {\n [inspect.custom]: () => message,\n });\n\nconst isExecaError = (err: unknown): err is ExecaError =>\n hasNumberProp(err, 'exitCode');\n\nexport const handleCliError = (err: unknown) => {\n if (isExecaError(err)) {\n process.exitCode = err.exitCode;\n return;\n }\n\n log.err(inspect(err));\n process.exitCode = 1;\n return;\n};\n\nexport const isErrorWithCode = <T>(\n err: unknown,\n code: T,\n): err is Record<PropertyKey, unknown> & { code: T } =>\n hasProp(err, 'code') && err.code === code;\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAGxB,QAAmB;AAEnB,qBAAoB;AACpB,wBAAuC;AAIhC,MAAM,2BAA2B,EAAE;AAAA,EACxC,EAAE,OAAO;AAAA,IACP,SAAS,EAAE,OAAO;AAAA,MAChB,SAAS,EAAE,OAAO;AAAA,MAClB,MAAM,EAAE,OAAO;AAAA,IACjB,CAAC;AAAA,IACD,OAAO,EAAE,OAAO;AAAA,IAChB,UAAU,EAAE,OAAO;AAAA,EACrB,CAAC;AACH;AAWO,MAAM,mBAAmB,CAAC,YAC/B,OAAO,OAAO,IAAI,MAAM,OAAO,GAAG;AAAA,EAChC,CAAC,oBAAQ,MAAM,GAAG,MAAM;AAC1B,CAAC;AAEH,MAAM,eAAe,CAAC,YACpB,iCAAc,KAAK,UAAU;AAExB,MAAM,iBAAiB,CAAC,QAAiB;AAC9C,MAAI,aAAa,GAAG,GAAG;AACrB,YAAQ,WAAW,IAAI;AACvB;AAAA,EACF;AAEA,qBAAI,QAAI,qBAAQ,GAAG,CAAC;AACpB,UAAQ,WAAW;AACnB;AACF;AAEO,MAAM,kBAAkB,CAC7B,KACA,aAEA,2BAAQ,KAAK,MAAM,KAAK,IAAI,SAAS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { styleText } from 'node:util';
|
|
1
2
|
import stream from 'stream';
|
|
2
|
-
import type { Color } from 'chalk';
|
|
3
3
|
import execa, { type ExecaChildProcess } from 'execa';
|
|
4
4
|
import type { PackageManager } from './packageManager.js';
|
|
5
|
+
type StyleColor = Parameters<typeof styleText>[0];
|
|
5
6
|
export type Exec = (command: string, ...args: string[]) => ExecaChildProcess<string>;
|
|
6
7
|
interface ExecConcurrentlyCommand {
|
|
7
8
|
command: string;
|
|
8
9
|
name: string;
|
|
9
|
-
prefixColor?:
|
|
10
|
+
prefixColor?: StyleColor;
|
|
10
11
|
}
|
|
11
12
|
interface ExecConcurrentlyOptions {
|
|
12
13
|
/**
|
package/lib/utils/exec.js
CHANGED
|
@@ -1,13 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 exec_exports = {};
|
|
30
|
+
__export(exec_exports, {
|
|
31
|
+
createExec: () => createExec,
|
|
32
|
+
ensureCommands: () => ensureCommands,
|
|
33
|
+
exec: () => exec,
|
|
34
|
+
execConcurrently: () => execConcurrently,
|
|
35
|
+
hasCommand: () => hasCommand
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(exec_exports);
|
|
38
|
+
var import_os = require("os");
|
|
39
|
+
var import_stream = __toESM(require("stream"));
|
|
40
|
+
var import_util = __toESM(require("util"));
|
|
41
|
+
var import_concurrently = __toESM(require("concurrently"));
|
|
42
|
+
var import_execa = __toESM(require("execa"));
|
|
43
|
+
var import_npm_run_path = __toESM(require("npm-run-path"));
|
|
44
|
+
var import_npm_which = __toESM(require("npm-which"));
|
|
45
|
+
var import_error = require("./error.js");
|
|
46
|
+
var import_logging = require("./logging.js");
|
|
47
|
+
class YarnSpamFilter extends import_stream.default.Transform {
|
|
11
48
|
silenced = false;
|
|
12
49
|
_transform(chunk, _encoding, callback) {
|
|
13
50
|
const str = Buffer.from(chunk).toString();
|
|
@@ -21,7 +58,7 @@ class YarnSpamFilter extends stream.Transform {
|
|
|
21
58
|
callback();
|
|
22
59
|
}
|
|
23
60
|
}
|
|
24
|
-
class YarnWarningFilter extends
|
|
61
|
+
class YarnWarningFilter extends import_stream.default.Transform {
|
|
25
62
|
_transform(chunk, _encoding, callback) {
|
|
26
63
|
const str = Buffer.from(chunk).toString();
|
|
27
64
|
if (!str.startsWith("warning skuba >")) {
|
|
@@ -31,11 +68,11 @@ class YarnWarningFilter extends stream.Transform {
|
|
|
31
68
|
}
|
|
32
69
|
}
|
|
33
70
|
const envWithPath = {
|
|
34
|
-
PATH:
|
|
71
|
+
PATH: (0, import_npm_run_path.default)({ cwd: __dirname })
|
|
35
72
|
};
|
|
36
73
|
const runCommand = (command, args, opts) => {
|
|
37
|
-
const subprocess =
|
|
38
|
-
localDir:
|
|
74
|
+
const subprocess = (0, import_execa.default)(command, args, {
|
|
75
|
+
localDir: __dirname,
|
|
39
76
|
preferLocal: true,
|
|
40
77
|
stdio: "inherit",
|
|
41
78
|
...opts
|
|
@@ -55,8 +92,8 @@ const runCommand = (command, args, opts) => {
|
|
|
55
92
|
}
|
|
56
93
|
return subprocess;
|
|
57
94
|
};
|
|
58
|
-
const whichCallback =
|
|
59
|
-
const which =
|
|
95
|
+
const whichCallback = (0, import_npm_which.default)(__dirname);
|
|
96
|
+
const which = import_util.default.promisify(whichCallback);
|
|
60
97
|
const createExec = (opts) => (command, ...args) => runCommand(command, args, opts);
|
|
61
98
|
const exec = (command, ...args) => runCommand(command, args);
|
|
62
99
|
const execConcurrently = async (commands, { maxProcesses, nameLength, outputStream } = {}) => {
|
|
@@ -65,22 +102,22 @@ const execConcurrently = async (commands, { maxProcesses, nameLength, outputStre
|
|
|
65
102
|
0
|
|
66
103
|
);
|
|
67
104
|
try {
|
|
68
|
-
await
|
|
105
|
+
await (0, import_concurrently.default)(
|
|
69
106
|
commands.map(({ command, name, prefixColor }) => ({
|
|
70
107
|
command,
|
|
71
108
|
env: envWithPath,
|
|
72
109
|
name: name.padEnd(maxNameLength),
|
|
73
|
-
prefixColor
|
|
110
|
+
prefixColor: Array.isArray(prefixColor) ? prefixColor[0] : prefixColor
|
|
74
111
|
})),
|
|
75
112
|
{
|
|
76
|
-
maxProcesses: maxProcesses ?? cpus().length,
|
|
113
|
+
maxProcesses: maxProcesses ?? (0, import_os.cpus)().length,
|
|
77
114
|
outputStream,
|
|
78
115
|
// Use a minimalist logging prefix.
|
|
79
116
|
prefix: "{name} \u2502"
|
|
80
117
|
}
|
|
81
118
|
).result;
|
|
82
119
|
} catch (err) {
|
|
83
|
-
const result = concurrentlyErrorsSchema.safeParse(err);
|
|
120
|
+
const result = import_error.concurrentlyErrorsSchema.safeParse(err);
|
|
84
121
|
if (!result.success) {
|
|
85
122
|
throw err;
|
|
86
123
|
}
|
|
@@ -97,7 +134,7 @@ const ensureCommands = async (...names) => {
|
|
|
97
134
|
const result = await hasCommand(name);
|
|
98
135
|
if (!result) {
|
|
99
136
|
success = false;
|
|
100
|
-
log.err(log.bold(name), "needs to be installed.");
|
|
137
|
+
import_logging.log.err(import_logging.log.bold(name), "needs to be installed.");
|
|
101
138
|
}
|
|
102
139
|
})
|
|
103
140
|
);
|
|
@@ -110,17 +147,18 @@ const hasCommand = async (name) => {
|
|
|
110
147
|
await which(name);
|
|
111
148
|
return true;
|
|
112
149
|
} catch (err) {
|
|
113
|
-
if (isErrorWithCode(err, "ENOENT")) {
|
|
150
|
+
if ((0, import_error.isErrorWithCode)(err, "ENOENT")) {
|
|
114
151
|
return false;
|
|
115
152
|
}
|
|
116
153
|
throw err;
|
|
117
154
|
}
|
|
118
155
|
};
|
|
119
|
-
export
|
|
156
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
157
|
+
0 && (module.exports = {
|
|
120
158
|
createExec,
|
|
121
159
|
ensureCommands,
|
|
122
160
|
exec,
|
|
123
161
|
execConcurrently,
|
|
124
162
|
hasCommand
|
|
125
|
-
};
|
|
163
|
+
});
|
|
126
164
|
//# sourceMappingURL=exec.js.map
|
package/lib/utils/exec.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/exec.ts"],
|
|
4
|
-
"sourcesContent": ["import { cpus } from 'os';\nimport stream from 'stream';\nimport util from 'util';\n\nimport
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import type { styleText } from 'node:util';\nimport { cpus } from 'os';\nimport stream from 'stream';\nimport util from 'util';\n\nimport concurrently from 'concurrently';\nimport execa, { type ExecaChildProcess } from 'execa';\nimport npmRunPath from 'npm-run-path';\nimport npmWhich from 'npm-which';\n\nimport { concurrentlyErrorsSchema, isErrorWithCode } from './error.js';\nimport { log } from './logging.js';\nimport type { PackageManager } from './packageManager.js';\n\ntype StyleColor = Parameters<typeof styleText>[0];\n\nclass YarnSpamFilter extends stream.Transform {\n silenced = false;\n\n _transform(\n chunk: Uint8Array,\n _encoding: BufferEncoding,\n callback: stream.TransformCallback,\n ) {\n const str = Buffer.from(chunk).toString();\n\n // Yarn spews the entire installed dependency tree after this message\n if (str.startsWith('info Direct dependencies')) {\n this.silenced = true;\n }\n\n if (\n !this.silenced &&\n // This isn't very useful given the command generates a lockfile\n !str.startsWith('info No lockfile found')\n ) {\n this.push(chunk);\n }\n\n callback();\n }\n}\n\nclass YarnWarningFilter extends stream.Transform {\n _transform(\n chunk: Uint8Array,\n _encoding: BufferEncoding,\n callback: stream.TransformCallback,\n ) {\n const str = Buffer.from(chunk).toString();\n\n // Filter out annoying deprecation warnings that users can do little about\n if (!str.startsWith('warning skuba >')) {\n this.push(chunk);\n }\n\n callback();\n }\n}\n\nexport type Exec = (\n command: string,\n ...args: string[]\n) => ExecaChildProcess<string>;\n\ninterface ExecConcurrentlyCommand {\n command: string;\n name: string;\n prefixColor?: StyleColor;\n}\n\ninterface ExecConcurrentlyOptions {\n /**\n * The maximum number of processes that can execute concurrently.\n *\n * Defaults to the CPU core count.\n */\n maxProcesses?: number;\n\n /**\n * A set length to pad names to.\n *\n * Defaults to the length of the longest command name.\n */\n nameLength?: number;\n\n /**\n * The stream that logging output will be written to.\n *\n * Defaults to `process.stdout`.\n */\n outputStream?: stream.Writable;\n}\n\ntype ExecOptions = execa.Options & { streamStdio?: true | PackageManager };\n\nconst envWithPath = {\n PATH: npmRunPath({ cwd: __dirname }),\n};\n\nconst runCommand = (command: string, args: string[], opts?: ExecOptions) => {\n const subprocess = execa(command, args, {\n localDir: __dirname,\n preferLocal: true,\n stdio: 'inherit',\n ...opts,\n });\n\n switch (opts?.streamStdio) {\n case 'yarn':\n const stderrFilter = new YarnWarningFilter();\n const stdoutFilter = new YarnSpamFilter();\n\n subprocess.stderr?.pipe(stderrFilter).pipe(process.stderr);\n subprocess.stdout?.pipe(stdoutFilter).pipe(process.stdout);\n\n break;\n\n case 'pnpm':\n case true:\n subprocess.stderr?.pipe(process.stderr);\n subprocess.stdout?.pipe(process.stdout);\n\n break;\n }\n\n return subprocess;\n};\n\nconst whichCallback = npmWhich(__dirname);\n\nconst which = util.promisify<string, string>(whichCallback);\n\nexport const createExec =\n (opts: ExecOptions): Exec =>\n (command, ...args) =>\n runCommand(command, args, opts);\n\nexport const exec: Exec = (command, ...args) => runCommand(command, args);\n\nexport const execConcurrently = async (\n commands: ExecConcurrentlyCommand[],\n { maxProcesses, nameLength, outputStream }: ExecConcurrentlyOptions = {},\n) => {\n const maxNameLength =\n nameLength ??\n commands.reduce(\n (length, command) => Math.max(length, command.name.length),\n 0,\n );\n\n try {\n await concurrently(\n commands.map(({ command, name, prefixColor }) => ({\n command,\n env: envWithPath,\n name: name.padEnd(maxNameLength),\n prefixColor: Array.isArray(prefixColor) ? prefixColor[0] : prefixColor,\n })),\n {\n maxProcesses: maxProcesses ?? cpus().length,\n\n outputStream,\n\n // Use a minimalist logging prefix.\n prefix: '{name} \u2502',\n },\n ).result;\n } catch (err) {\n const result = concurrentlyErrorsSchema.safeParse(err);\n\n if (!result.success) {\n throw err;\n }\n\n const failed = result.data\n .filter(({ exitCode }) => exitCode !== 0)\n .sort(({ index: indexA }, { index: indexB }) => indexA - indexB)\n .map((subprocess) => subprocess.command.name);\n\n throw Error(\n `${failed.join(', ')} subprocess${\n failed.length === 1 ? '' : 'es'\n } failed.`,\n );\n }\n};\n\nexport const ensureCommands = async (...names: string[]) => {\n let success = true;\n\n await Promise.all(\n names.map(async (name) => {\n const result = await hasCommand(name);\n\n if (!result) {\n success = false;\n\n log.err(log.bold(name), 'needs to be installed.');\n }\n }),\n );\n\n if (!success) {\n process.exit(1);\n }\n};\n\nexport const hasCommand = async (name: string) => {\n try {\n await which(name);\n\n return true;\n } catch (err) {\n if (isErrorWithCode(err, 'ENOENT')) {\n return false;\n }\n\n throw err;\n }\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["stream", "npmRunPath", "execa", "npmWhich", "util", "concurrently"]
|
|
7
7
|
}
|
package/lib/utils/fs.js
CHANGED
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 fs_exports = {};
|
|
30
|
+
__export(fs_exports, {
|
|
31
|
+
pathExists: () => pathExists
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(fs_exports);
|
|
34
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
+
var import_error = require("./error.js");
|
|
3
36
|
const pathExists = async (filePath) => {
|
|
4
37
|
try {
|
|
5
|
-
await
|
|
38
|
+
await import_fs_extra.default.promises.access(filePath);
|
|
6
39
|
return true;
|
|
7
40
|
} catch (error) {
|
|
8
|
-
if (isErrorWithCode(error, "ENOENT")) {
|
|
41
|
+
if ((0, import_error.isErrorWithCode)(error, "ENOENT")) {
|
|
9
42
|
return false;
|
|
10
43
|
}
|
|
11
44
|
throw error;
|
|
12
45
|
}
|
|
13
46
|
};
|
|
14
|
-
export
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
15
49
|
pathExists
|
|
16
|
-
};
|
|
50
|
+
});
|
|
17
51
|
//# sourceMappingURL=fs.js.map
|
package/lib/utils/fs.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/fs.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\n\nimport { isErrorWithCode } from './error.js';\n\nexport const pathExists = async (filePath: string): Promise<boolean> => {\n try {\n await fs.promises.access(filePath);\n\n return true; // Path exists and is accessible\n } catch (error: unknown) {\n if (isErrorWithCode(error, 'ENOENT')) {\n return false; // Path does not exist\n }\n\n throw error; // Other errors (include permission issues)\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AAEf,mBAAgC;AAEzB,MAAM,aAAa,OAAO,aAAuC;AACtE,MAAI;AACF,UAAM,gBAAAA,QAAG,SAAS,OAAO,QAAQ;AAEjC,WAAO;AAAA,EACT,SAAS,OAAgB;AACvB,YAAI,8BAAgB,OAAO,QAAQ,GAAG;AACpC,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
7
|
}
|