skuba 0.0.0-master-20230318044948
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/LICENSE +21 -0
- package/README.md +67 -0
- package/config/eslint.js +3 -0
- package/config/jest.js +1 -0
- package/config/prettier.d.ts +3 -0
- package/config/prettier.js +5 -0
- package/config/tsconfig.json +9 -0
- package/jest/moduleNameMapper.js +58 -0
- package/jest/moduleNameMapper.test.ts +64 -0
- package/jest/transform.js +50 -0
- package/jest/transform.test.ts +11 -0
- package/jest/tsConfig.js +26 -0
- package/jest-preset.js +34 -0
- package/lib/api/buildkite/annotate.d.ts +26 -0
- package/lib/api/buildkite/annotate.js +49 -0
- package/lib/api/buildkite/annotate.js.map +7 -0
- package/lib/api/buildkite/index.d.ts +3 -0
- package/lib/api/buildkite/index.js +32 -0
- package/lib/api/buildkite/index.js.map +7 -0
- package/lib/api/buildkite/md.d.ts +6 -0
- package/lib/api/buildkite/md.js +33 -0
- package/lib/api/buildkite/md.js.map +7 -0
- package/lib/api/git/commit.d.ts +15 -0
- package/lib/api/git/commit.js +52 -0
- package/lib/api/git/commit.js.map +7 -0
- package/lib/api/git/commitAllChanges.d.ts +19 -0
- package/lib/api/git/commitAllChanges.js +65 -0
- package/lib/api/git/commitAllChanges.js.map +7 -0
- package/lib/api/git/currentBranch.d.ts +10 -0
- package/lib/api/git/currentBranch.js +58 -0
- package/lib/api/git/currentBranch.js.map +7 -0
- package/lib/api/git/getChangedFiles.d.ts +20 -0
- package/lib/api/git/getChangedFiles.js +63 -0
- package/lib/api/git/getChangedFiles.js.map +7 -0
- package/lib/api/git/index.d.ts +10 -0
- package/lib/api/git/index.js +55 -0
- package/lib/api/git/index.js.map +7 -0
- package/lib/api/git/log.d.ts +19 -0
- package/lib/api/git/log.js +71 -0
- package/lib/api/git/log.js.map +7 -0
- package/lib/api/git/pull.d.ts +35 -0
- package/lib/api/git/pull.js +69 -0
- package/lib/api/git/pull.js.map +7 -0
- package/lib/api/git/push.d.ts +43 -0
- package/lib/api/git/push.js +70 -0
- package/lib/api/git/push.js.map +7 -0
- package/lib/api/git/remote.d.ts +20 -0
- package/lib/api/git/remote.js +72 -0
- package/lib/api/git/remote.js.map +7 -0
- package/lib/api/git/reset.d.ts +12 -0
- package/lib/api/git/reset.js +62 -0
- package/lib/api/git/reset.js.map +7 -0
- package/lib/api/git/statusMatrix.d.ts +7 -0
- package/lib/api/git/statusMatrix.js +47 -0
- package/lib/api/git/statusMatrix.js.map +7 -0
- package/lib/api/github/checkRun.d.ts +44 -0
- package/lib/api/github/checkRun.js +81 -0
- package/lib/api/github/checkRun.js.map +7 -0
- package/lib/api/github/environment.d.ts +18 -0
- package/lib/api/github/environment.js +48 -0
- package/lib/api/github/environment.js.map +7 -0
- package/lib/api/github/index.d.ts +7 -0
- package/lib/api/github/index.js +48 -0
- package/lib/api/github/index.js.map +7 -0
- package/lib/api/github/issueComment.d.ts +59 -0
- package/lib/api/github/issueComment.js +83 -0
- package/lib/api/github/issueComment.js.map +7 -0
- package/lib/api/github/pullRequest.d.ts +21 -0
- package/lib/api/github/pullRequest.js +68 -0
- package/lib/api/github/pullRequest.js.map +7 -0
- package/lib/api/github/push.d.ts +79 -0
- package/lib/api/github/push.js +158 -0
- package/lib/api/github/push.js.map +7 -0
- package/lib/api/jest/index.d.ts +144 -0
- package/lib/api/jest/index.js +41 -0
- package/lib/api/jest/index.js.map +7 -0
- package/lib/api/net/compose.d.ts +4 -0
- package/lib/api/net/compose.js +50 -0
- package/lib/api/net/compose.js.map +7 -0
- package/lib/api/net/index.d.ts +1 -0
- package/lib/api/net/index.js +29 -0
- package/lib/api/net/index.js.map +7 -0
- package/lib/api/net/socket.d.ts +5 -0
- package/lib/api/net/socket.js +68 -0
- package/lib/api/net/socket.js.map +7 -0
- package/lib/api/net/waitFor.d.ts +22 -0
- package/lib/api/net/waitFor.js +40 -0
- package/lib/api/net/waitFor.js.map +7 -0
- package/lib/cli/adapter/eslint.d.ts +14 -0
- package/lib/cli/adapter/eslint.js +112 -0
- package/lib/cli/adapter/eslint.js.map +7 -0
- package/lib/cli/adapter/prettier.d.ts +45 -0
- package/lib/cli/adapter/prettier.js +171 -0
- package/lib/cli/adapter/prettier.js.map +7 -0
- package/lib/cli/build/args.d.ts +7 -0
- package/lib/cli/build/args.js +73 -0
- package/lib/cli/build/args.js.map +7 -0
- package/lib/cli/build/esbuild.d.ts +5 -0
- package/lib/cli/build/esbuild.js +133 -0
- package/lib/cli/build/esbuild.js.map +7 -0
- package/lib/cli/build/index.d.ts +1 -0
- package/lib/cli/build/index.js +73 -0
- package/lib/cli/build/index.js.map +7 -0
- package/lib/cli/build/tsc.d.ts +1 -0
- package/lib/cli/build/tsc.js +36 -0
- package/lib/cli/build/tsc.js.map +7 -0
- package/lib/cli/buildPackage.d.ts +1 -0
- package/lib/cli/buildPackage.js +56 -0
- package/lib/cli/buildPackage.js.map +7 -0
- package/lib/cli/configure/addEmptyExports.d.ts +6 -0
- package/lib/cli/configure/addEmptyExports.js +76 -0
- package/lib/cli/configure/addEmptyExports.js.map +7 -0
- package/lib/cli/configure/analyseConfiguration.d.ts +9 -0
- package/lib/cli/configure/analyseConfiguration.js +69 -0
- package/lib/cli/configure/analyseConfiguration.js.map +7 -0
- package/lib/cli/configure/analyseDependencies.d.ts +10 -0
- package/lib/cli/configure/analyseDependencies.js +136 -0
- package/lib/cli/configure/analyseDependencies.js.map +7 -0
- package/lib/cli/configure/analysis/diff.d.ts +1 -0
- package/lib/cli/configure/analysis/diff.js +45 -0
- package/lib/cli/configure/analysis/diff.js.map +7 -0
- package/lib/cli/configure/analysis/files.d.ts +1 -0
- package/lib/cli/configure/analysis/files.js +58 -0
- package/lib/cli/configure/analysis/files.js.map +7 -0
- package/lib/cli/configure/analysis/git.d.ts +1 -0
- package/lib/cli/configure/analysis/git.js +54 -0
- package/lib/cli/configure/analysis/git.js.map +7 -0
- package/lib/cli/configure/analysis/package.d.ts +13 -0
- package/lib/cli/configure/analysis/package.js +110 -0
- package/lib/cli/configure/analysis/package.js.map +7 -0
- package/lib/cli/configure/analysis/project.d.ts +3 -0
- package/lib/cli/configure/analysis/project.js +105 -0
- package/lib/cli/configure/analysis/project.js.map +7 -0
- package/lib/cli/configure/dependencies/index.d.ts +5 -0
- package/lib/cli/configure/dependencies/index.js +41 -0
- package/lib/cli/configure/dependencies/index.js.map +7 -0
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -0
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +59 -0
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +7 -0
- package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -0
- package/lib/cli/configure/dependencies/seekKoala.js +56 -0
- package/lib/cli/configure/dependencies/seekKoala.js.map +7 -0
- package/lib/cli/configure/dependencies/skuba.d.ts +2 -0
- package/lib/cli/configure/dependencies/skuba.js +52 -0
- package/lib/cli/configure/dependencies/skuba.js.map +7 -0
- package/lib/cli/configure/dependencies/skubaDeps.d.ts +2 -0
- package/lib/cli/configure/dependencies/skubaDeps.js +56 -0
- package/lib/cli/configure/dependencies/skubaDeps.js.map +7 -0
- package/lib/cli/configure/dependencies/skubaDive.d.ts +3 -0
- package/lib/cli/configure/dependencies/skubaDive.js +70 -0
- package/lib/cli/configure/dependencies/skubaDive.js.map +7 -0
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +9 -0
- package/lib/cli/configure/ensureTemplateCompletion.js +77 -0
- package/lib/cli/configure/ensureTemplateCompletion.js.map +7 -0
- package/lib/cli/configure/getEntryPoint.d.ts +11 -0
- package/lib/cli/configure/getEntryPoint.js +70 -0
- package/lib/cli/configure/getEntryPoint.js.map +7 -0
- package/lib/cli/configure/getProjectType.d.ts +9 -0
- package/lib/cli/configure/getProjectType.js +52 -0
- package/lib/cli/configure/getProjectType.js.map +7 -0
- package/lib/cli/configure/index.d.ts +1 -0
- package/lib/cli/configure/index.js +148 -0
- package/lib/cli/configure/index.js.map +7 -0
- package/lib/cli/configure/modules/eslint.d.ts +2 -0
- package/lib/cli/configure/modules/eslint.js +61 -0
- package/lib/cli/configure/modules/eslint.js.map +7 -0
- package/lib/cli/configure/modules/ignore.d.ts +2 -0
- package/lib/cli/configure/modules/ignore.js +40 -0
- package/lib/cli/configure/modules/ignore.js.map +7 -0
- package/lib/cli/configure/modules/index.d.ts +2 -0
- package/lib/cli/configure/modules/index.js +54 -0
- package/lib/cli/configure/modules/index.js.map +7 -0
- 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.d.ts +2 -0
- package/lib/cli/configure/modules/nodemon.js +30 -0
- package/lib/cli/configure/modules/nodemon.js.map +7 -0
- package/lib/cli/configure/modules/package.d.ts +2 -0
- package/lib/cli/configure/modules/package.js +117 -0
- package/lib/cli/configure/modules/package.js.map +7 -0
- package/lib/cli/configure/modules/prettier.d.ts +2 -0
- package/lib/cli/configure/modules/prettier.js +52 -0
- package/lib/cli/configure/modules/prettier.js.map +7 -0
- package/lib/cli/configure/modules/renovate.d.ts +3 -0
- package/lib/cli/configure/modules/renovate.js +69 -0
- package/lib/cli/configure/modules/renovate.js.map +7 -0
- package/lib/cli/configure/modules/serverless.d.ts +2 -0
- package/lib/cli/configure/modules/serverless.js +36 -0
- package/lib/cli/configure/modules/serverless.js.map +7 -0
- package/lib/cli/configure/modules/skubaDive.d.ts +2 -0
- package/lib/cli/configure/modules/skubaDive.js +72 -0
- package/lib/cli/configure/modules/skubaDive.js.map +7 -0
- package/lib/cli/configure/modules/tsconfig.d.ts +2 -0
- package/lib/cli/configure/modules/tsconfig.js +87 -0
- package/lib/cli/configure/modules/tsconfig.js.map +7 -0
- package/lib/cli/configure/modules/tslint.d.ts +2 -0
- package/lib/cli/configure/modules/tslint.js +30 -0
- package/lib/cli/configure/modules/tslint.js.map +7 -0
- package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
- package/lib/cli/configure/patchRenovateConfig.js +132 -0
- package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
- package/lib/cli/configure/processing/deleteFiles.d.ts +5 -0
- package/lib/cli/configure/processing/deleteFiles.js +31 -0
- package/lib/cli/configure/processing/deleteFiles.js.map +7 -0
- package/lib/cli/configure/processing/ignoreFile.d.ts +8 -0
- package/lib/cli/configure/processing/ignoreFile.js +74 -0
- package/lib/cli/configure/processing/ignoreFile.js.map +7 -0
- package/lib/cli/configure/processing/javascript.d.ts +2 -0
- package/lib/cli/configure/processing/javascript.js +38 -0
- package/lib/cli/configure/processing/javascript.js.map +7 -0
- package/lib/cli/configure/processing/json.d.ts +2 -0
- package/lib/cli/configure/processing/json.js +57 -0
- package/lib/cli/configure/processing/json.js.map +7 -0
- package/lib/cli/configure/processing/loadFiles.d.ts +5 -0
- package/lib/cli/configure/processing/loadFiles.js +31 -0
- package/lib/cli/configure/processing/loadFiles.js.map +7 -0
- package/lib/cli/configure/processing/module.d.ts +10 -0
- package/lib/cli/configure/processing/module.js +39 -0
- package/lib/cli/configure/processing/module.js.map +7 -0
- package/lib/cli/configure/processing/package.d.ts +73 -0
- package/lib/cli/configure/processing/package.js +87 -0
- package/lib/cli/configure/processing/package.js.map +7 -0
- package/lib/cli/configure/processing/prettier.d.ts +4 -0
- package/lib/cli/configure/processing/prettier.js +44 -0
- package/lib/cli/configure/processing/prettier.js.map +7 -0
- package/lib/cli/configure/processing/record.d.ts +11 -0
- package/lib/cli/configure/processing/record.js +65 -0
- package/lib/cli/configure/processing/record.js.map +7 -0
- package/lib/cli/configure/processing/typescript.d.ts +23 -0
- package/lib/cli/configure/processing/typescript.js +197 -0
- package/lib/cli/configure/processing/typescript.js.map +7 -0
- package/lib/cli/configure/refreshIgnoreFiles.d.ts +3 -0
- package/lib/cli/configure/refreshIgnoreFiles.js +78 -0
- package/lib/cli/configure/refreshIgnoreFiles.js.map +7 -0
- package/lib/cli/configure/types.d.ts +26 -0
- package/lib/cli/configure/types.js +17 -0
- package/lib/cli/configure/types.js.map +7 -0
- package/lib/cli/format.d.ts +1 -0
- package/lib/cli/format.js +70 -0
- package/lib/cli/format.js.map +7 -0
- package/lib/cli/help.d.ts +1 -0
- package/lib/cli/help.js +34 -0
- package/lib/cli/help.js.map +7 -0
- package/lib/cli/init/getConfig.d.ts +26 -0
- package/lib/cli/init/getConfig.js +285 -0
- package/lib/cli/init/getConfig.js.map +7 -0
- package/lib/cli/init/git.d.ts +7 -0
- package/lib/cli/init/git.js +82 -0
- package/lib/cli/init/git.js.map +7 -0
- package/lib/cli/init/index.d.ts +1 -0
- package/lib/cli/init/index.js +146 -0
- package/lib/cli/init/index.js.map +7 -0
- package/lib/cli/init/prompts.d.ts +45 -0
- package/lib/cli/init/prompts.js +97 -0
- package/lib/cli/init/prompts.js.map +7 -0
- package/lib/cli/init/types.d.ts +28 -0
- package/lib/cli/init/types.js +65 -0
- package/lib/cli/init/types.js.map +7 -0
- package/lib/cli/init/validation.d.ts +8 -0
- package/lib/cli/init/validation.js +43 -0
- package/lib/cli/init/validation.js.map +7 -0
- package/lib/cli/init/writePackageJson.d.ts +13 -0
- package/lib/cli/init/writePackageJson.js +58 -0
- package/lib/cli/init/writePackageJson.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/eslint.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js +40 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -0
- package/lib/cli/lint/annotate/buildkite/index.js +58 -0
- package/lib/cli/lint/annotate/buildkite/index.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/prettier.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js +47 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/tsc.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js +45 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +7 -0
- package/lib/cli/lint/annotate/github/eslint.d.ts +3 -0
- package/lib/cli/lint/annotate/github/eslint.js +45 -0
- package/lib/cli/lint/annotate/github/eslint.js.map +7 -0
- package/lib/cli/lint/annotate/github/index.d.ts +4 -0
- package/lib/cli/lint/annotate/github/index.js +63 -0
- package/lib/cli/lint/annotate/github/index.js.map +7 -0
- package/lib/cli/lint/annotate/github/prettier.d.ts +3 -0
- package/lib/cli/lint/annotate/github/prettier.js +39 -0
- package/lib/cli/lint/annotate/github/prettier.js.map +7 -0
- package/lib/cli/lint/annotate/github/tsc.d.ts +3 -0
- package/lib/cli/lint/annotate/github/tsc.js +63 -0
- package/lib/cli/lint/annotate/github/tsc.js.map +7 -0
- package/lib/cli/lint/annotate/index.d.ts +4 -0
- package/lib/cli/lint/annotate/index.js +36 -0
- package/lib/cli/lint/annotate/index.js.map +7 -0
- package/lib/cli/lint/autofix.d.ts +10 -0
- package/lib/cli/lint/autofix.js +189 -0
- package/lib/cli/lint/autofix.js.map +7 -0
- package/lib/cli/lint/eslint.d.ts +4 -0
- package/lib/cli/lint/eslint.js +55 -0
- package/lib/cli/lint/eslint.js.map +7 -0
- package/lib/cli/lint/external.d.ts +10 -0
- package/lib/cli/lint/external.js +120 -0
- package/lib/cli/lint/external.js.map +7 -0
- package/lib/cli/lint/index.d.ts +2 -0
- package/lib/cli/lint/index.js +49 -0
- package/lib/cli/lint/index.js.map +7 -0
- package/lib/cli/lint/internal.d.ts +1 -0
- package/lib/cli/lint/internal.js +64 -0
- package/lib/cli/lint/internal.js.map +7 -0
- package/lib/cli/lint/prettier.d.ts +4 -0
- package/lib/cli/lint/prettier.js +55 -0
- package/lib/cli/lint/prettier.js.map +7 -0
- package/lib/cli/lint/tsc.d.ts +2 -0
- package/lib/cli/lint/tsc.js +58 -0
- package/lib/cli/lint/tsc.js.map +7 -0
- package/lib/cli/lint/types.d.ts +34 -0
- package/lib/cli/lint/types.js +17 -0
- package/lib/cli/lint/types.js.map +7 -0
- package/lib/cli/node.d.ts +1 -0
- package/lib/cli/node.js +77 -0
- package/lib/cli/node.js.map +7 -0
- package/lib/cli/release.d.ts +1 -0
- package/lib/cli/release.js +32 -0
- package/lib/cli/release.js.map +7 -0
- package/lib/cli/start.d.ts +1 -0
- package/lib/cli/start.js +69 -0
- package/lib/cli/start.js.map +7 -0
- package/lib/cli/test/index.d.ts +1 -0
- package/lib/cli/test/index.js +37 -0
- package/lib/cli/test/index.js.map +7 -0
- 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 +77 -0
- package/lib/cli/test/reporters/github/index.js.map +7 -0
- package/lib/cli/version.d.ts +1 -0
- package/lib/cli/version.js +34 -0
- package/lib/cli/version.js.map +7 -0
- package/lib/enquirer.d.js +2 -0
- package/lib/enquirer.d.js.map +7 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +51 -0
- package/lib/index.js.map +7 -0
- package/lib/skuba.d.ts +11 -0
- package/lib/skuba.js +55 -0
- package/lib/skuba.js.map +7 -0
- package/lib/utils/args.d.ts +43 -0
- package/lib/utils/args.js +114 -0
- package/lib/utils/args.js.map +7 -0
- package/lib/utils/command.d.ts +6 -0
- package/lib/utils/command.js +72 -0
- package/lib/utils/command.js.map +7 -0
- package/lib/utils/copy.d.ts +16 -0
- package/lib/utils/copy.js +100 -0
- package/lib/utils/copy.js.map +7 -0
- package/lib/utils/dir.d.ts +21 -0
- package/lib/utils/dir.js +91 -0
- package/lib/utils/dir.js.map +7 -0
- package/lib/utils/env.d.ts +5 -0
- package/lib/utils/env.js +29 -0
- package/lib/utils/env.js.map +7 -0
- package/lib/utils/error.d.ts +28 -0
- package/lib/utils/error.js +72 -0
- package/lib/utils/error.js.map +7 -0
- package/lib/utils/exec.d.ts +40 -0
- package/lib/utils/exec.js +166 -0
- package/lib/utils/exec.js.map +7 -0
- package/lib/utils/help.d.ts +1 -0
- package/lib/utils/help.js +34 -0
- package/lib/utils/help.js.map +7 -0
- package/lib/utils/logging.d.ts +27 -0
- package/lib/utils/logging.js +60 -0
- package/lib/utils/logging.js.map +7 -0
- package/lib/utils/logo.d.ts +9 -0
- package/lib/utils/logo.js +74 -0
- package/lib/utils/logo.js.map +7 -0
- package/lib/utils/manifest.d.ts +10 -0
- package/lib/utils/manifest.js +77 -0
- package/lib/utils/manifest.js.map +7 -0
- package/lib/utils/port.d.ts +2 -0
- package/lib/utils/port.js +48 -0
- package/lib/utils/port.js.map +7 -0
- package/lib/utils/template.d.ts +37 -0
- package/lib/utils/template.js +116 -0
- package/lib/utils/template.js.map +7 -0
- package/lib/utils/validation.d.ts +6 -0
- package/lib/utils/validation.js +44 -0
- package/lib/utils/validation.js.map +7 -0
- package/lib/utils/version.d.ts +13 -0
- package/lib/utils/version.js +89 -0
- package/lib/utils/version.js.map +7 -0
- package/lib/utils/wait.d.ts +17 -0
- package/lib/utils/wait.js +59 -0
- package/lib/utils/wait.js.map +7 -0
- package/lib/utils/worker.d.ts +20 -0
- package/lib/utils/worker.js +63 -0
- package/lib/utils/worker.js.map +7 -0
- package/lib/wrapper/function-arguments.d.js +2 -0
- package/lib/wrapper/function-arguments.d.js.map +7 -0
- package/lib/wrapper/functionHandler.d.ts +10 -0
- package/lib/wrapper/functionHandler.js +63 -0
- package/lib/wrapper/functionHandler.js.map +7 -0
- package/lib/wrapper/http.d.ts +20 -0
- package/lib/wrapper/http.js +79 -0
- package/lib/wrapper/http.js.map +7 -0
- package/lib/wrapper/index.d.ts +12 -0
- package/lib/wrapper/index.js +16 -0
- package/lib/wrapper/index.js.map +7 -0
- package/lib/wrapper/main.d.ts +1 -0
- package/lib/wrapper/main.js +47 -0
- package/lib/wrapper/main.js.map +7 -0
- package/lib/wrapper/requestListener.d.ts +11 -0
- package/lib/wrapper/requestListener.js +66 -0
- package/lib/wrapper/requestListener.js.map +7 -0
- package/package.json +167 -0
- package/template/base/.github/CODEOWNERS +5 -0
- package/template/base/.github/renovate.json5 +3 -0
- package/template/base/_.dockerignore +18 -0
- package/template/base/_.eslintignore +14 -0
- package/template/base/_.eslintrc.js +3 -0
- package/template/base/_.gitignore +23 -0
- package/template/base/_.prettierignore +20 -0
- package/template/base/_.prettierrc.js +1 -0
- package/template/base/jest.config.ts +15 -0
- package/template/base/jest.setup.ts +3 -0
- package/template/base/tsconfig.build.json +5 -0
- package/template/base/tsconfig.json +13 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +103 -0
- package/template/express-rest-api/.env +1 -0
- package/template/express-rest-api/.gantry/common.yml +20 -0
- package/template/express-rest-api/.gantry/dev.yml +8 -0
- package/template/express-rest-api/.gantry/prod.yml +8 -0
- package/template/express-rest-api/.nvmrc +1 -0
- package/template/express-rest-api/Dockerfile +37 -0
- package/template/express-rest-api/Dockerfile.dev-deps +11 -0
- package/template/express-rest-api/README.md +106 -0
- package/template/express-rest-api/docker-compose.yml +22 -0
- package/template/express-rest-api/gantry.apply.yml +122 -0
- package/template/express-rest-api/gantry.build.yml +15 -0
- package/template/express-rest-api/package.json +30 -0
- package/template/express-rest-api/skuba.template.js +49 -0
- package/template/express-rest-api/src/api/healthCheck.ts +11 -0
- package/template/express-rest-api/src/api/smokeTest.ts +8 -0
- package/template/express-rest-api/src/app.test.ts +9 -0
- package/template/express-rest-api/src/app.ts +14 -0
- package/template/express-rest-api/src/config.ts +57 -0
- package/template/express-rest-api/src/framework/logging.ts +17 -0
- package/template/express-rest-api/src/listen.ts +23 -0
- package/template/express-rest-api/src/register.ts +1 -0
- package/template/greeter/.buildkite/pipeline.yml +37 -0
- package/template/greeter/.nvmrc +1 -0
- package/template/greeter/Dockerfile +11 -0
- package/template/greeter/README.md +96 -0
- package/template/greeter/docker-compose.yml +22 -0
- package/template/greeter/package.json +24 -0
- package/template/greeter/skuba.template.js +16 -0
- package/template/greeter/src/app.test.ts +5 -0
- package/template/greeter/src/app.ts +4 -0
- package/template/koa-rest-api/.buildkite/pipeline.yml +103 -0
- package/template/koa-rest-api/.env +1 -0
- package/template/koa-rest-api/.gantry/common.yml +20 -0
- package/template/koa-rest-api/.gantry/dev.yml +11 -0
- package/template/koa-rest-api/.gantry/prod.yml +11 -0
- package/template/koa-rest-api/.nvmrc +1 -0
- package/template/koa-rest-api/Dockerfile +37 -0
- package/template/koa-rest-api/Dockerfile.dev-deps +11 -0
- package/template/koa-rest-api/README.md +111 -0
- package/template/koa-rest-api/docker-compose.yml +22 -0
- package/template/koa-rest-api/gantry.apply.yml +129 -0
- package/template/koa-rest-api/gantry.build.yml +15 -0
- package/template/koa-rest-api/package.json +47 -0
- package/template/koa-rest-api/skuba.template.js +49 -0
- package/template/koa-rest-api/src/api/healthCheck.ts +13 -0
- package/template/koa-rest-api/src/api/index.ts +10 -0
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +9 -0
- package/template/koa-rest-api/src/api/jobs/getJobs.ts +15 -0
- package/template/koa-rest-api/src/api/jobs/index.ts +10 -0
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +34 -0
- package/template/koa-rest-api/src/api/jobs/postJob.ts +19 -0
- package/template/koa-rest-api/src/api/smokeTest.ts +11 -0
- package/template/koa-rest-api/src/app.test.ts +21 -0
- package/template/koa-rest-api/src/app.ts +8 -0
- package/template/koa-rest-api/src/config.ts +57 -0
- package/template/koa-rest-api/src/framework/logging.ts +25 -0
- package/template/koa-rest-api/src/framework/metrics.ts +11 -0
- package/template/koa-rest-api/src/framework/middleware.ts +3 -0
- package/template/koa-rest-api/src/framework/server.test.ts +260 -0
- package/template/koa-rest-api/src/framework/server.ts +51 -0
- package/template/koa-rest-api/src/framework/validation.test.ts +72 -0
- package/template/koa-rest-api/src/framework/validation.ts +77 -0
- package/template/koa-rest-api/src/listen.ts +24 -0
- package/template/koa-rest-api/src/register.ts +1 -0
- package/template/koa-rest-api/src/storage/jobs.ts +28 -0
- package/template/koa-rest-api/src/testing/logging.ts +16 -0
- package/template/koa-rest-api/src/testing/metrics.ts +29 -0
- package/template/koa-rest-api/src/testing/server.ts +31 -0
- package/template/koa-rest-api/src/testing/types.ts +24 -0
- package/template/koa-rest-api/src/tracing.ts +61 -0
- package/template/koa-rest-api/src/types/jobs.ts +17 -0
- package/template/koa-rest-api/src/types/koa.ts +8 -0
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +96 -0
- package/template/lambda-sqs-worker/.env +1 -0
- package/template/lambda-sqs-worker/.nvmrc +1 -0
- package/template/lambda-sqs-worker/Dockerfile +12 -0
- package/template/lambda-sqs-worker/README.md +132 -0
- package/template/lambda-sqs-worker/docker-compose.yml +27 -0
- package/template/lambda-sqs-worker/package.json +44 -0
- package/template/lambda-sqs-worker/serverless.yml +202 -0
- package/template/lambda-sqs-worker/skuba.template.js +32 -0
- package/template/lambda-sqs-worker/src/app.test.ts +116 -0
- package/template/lambda-sqs-worker/src/app.ts +52 -0
- package/template/lambda-sqs-worker/src/config.ts +57 -0
- package/template/lambda-sqs-worker/src/framework/handler.test.ts +61 -0
- package/template/lambda-sqs-worker/src/framework/handler.ts +43 -0
- package/template/lambda-sqs-worker/src/framework/logging.ts +27 -0
- package/template/lambda-sqs-worker/src/framework/metrics.ts +14 -0
- package/template/lambda-sqs-worker/src/framework/validation.test.ts +84 -0
- package/template/lambda-sqs-worker/src/framework/validation.ts +10 -0
- package/template/lambda-sqs-worker/src/hooks.ts +96 -0
- package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +19 -0
- package/template/lambda-sqs-worker/src/services/aws.ts +5 -0
- package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +44 -0
- package/template/lambda-sqs-worker/src/services/jobScorer.ts +56 -0
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +40 -0
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.ts +33 -0
- package/template/lambda-sqs-worker/src/testing/handler.ts +13 -0
- package/template/lambda-sqs-worker/src/testing/logging.ts +16 -0
- package/template/lambda-sqs-worker/src/testing/services.ts +28 -0
- package/template/lambda-sqs-worker/src/testing/types.ts +33 -0
- package/template/lambda-sqs-worker/src/types/jobScorer.ts +15 -0
- package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +21 -0
- package/template/lambda-sqs-worker/tsconfig.json +13 -0
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +93 -0
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -0
- package/template/lambda-sqs-worker-cdk/Dockerfile +13 -0
- package/template/lambda-sqs-worker-cdk/cdk.json +25 -0
- package/template/lambda-sqs-worker-cdk/docker-compose.yml +28 -0
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +723 -0
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +34 -0
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +74 -0
- package/template/lambda-sqs-worker-cdk/infra/index.ts +14 -0
- package/template/lambda-sqs-worker-cdk/package.json +30 -0
- package/template/lambda-sqs-worker-cdk/shared/context-types.ts +21 -0
- package/template/lambda-sqs-worker-cdk/skuba.template.js +27 -0
- package/template/lambda-sqs-worker-cdk/src/app.ts +10 -0
- package/template/lambda-sqs-worker-cdk/tsconfig.json +13 -0
- package/template/oss-npm-package/.github/workflows/release.yml +35 -0
- package/template/oss-npm-package/.github/workflows/validate.yml +31 -0
- package/template/oss-npm-package/.nvmrc +1 -0
- package/template/oss-npm-package/LICENSE +21 -0
- package/template/oss-npm-package/README.md +128 -0
- package/template/oss-npm-package/_package.json +41 -0
- package/template/oss-npm-package/skuba.template.js +22 -0
- package/template/oss-npm-package/src/index.test.ts +5 -0
- package/template/oss-npm-package/src/index.ts +7 -0
- package/template/oss-npm-package/tsconfig.json +10 -0
- package/template/private-npm-package/.buildkite/pipeline.yml +5 -0
- package/template/private-npm-package/.nvmrc +1 -0
- package/template/private-npm-package/README.md +109 -0
- package/template/private-npm-package/_package.json +41 -0
- package/template/private-npm-package/skuba.template.js +24 -0
- package/template/private-npm-package/src/index.test.ts +5 -0
- package/template/private-npm-package/src/index.ts +7 -0
- package/template/private-npm-package/tsconfig.json +10 -0
|
@@ -0,0 +1,72 @@
|
|
|
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 skubaDive_exports = {};
|
|
30
|
+
__export(skubaDive_exports, {
|
|
31
|
+
skubaDiveModule: () => skubaDiveModule
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(skubaDive_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_skubaDive = require("../dependencies/skubaDive");
|
|
36
|
+
var import_javascript = require("../processing/javascript");
|
|
37
|
+
var import_loadFiles = require("../processing/loadFiles");
|
|
38
|
+
var import_package = require("../processing/package");
|
|
39
|
+
const DEFAULT_FILENAME = "src/register.ts";
|
|
40
|
+
const skubaDiveModule = ({ entryPoint, type }) => {
|
|
41
|
+
if (type === "package") {
|
|
42
|
+
return {};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
...(0, import_loadFiles.loadFiles)(DEFAULT_FILENAME, "package.json"),
|
|
46
|
+
[entryPoint]: (inputFile, files) => {
|
|
47
|
+
const packageJson = (0, import_package.parsePackage)(files["package.json"]);
|
|
48
|
+
const registerFile = files[DEFAULT_FILENAME];
|
|
49
|
+
if (!packageJson?.dependencies?.["skuba-dive"] || inputFile === void 0 || inputFile.includes("skuba-dive/register") || registerFile?.includes("skuba-dive/register")) {
|
|
50
|
+
return inputFile;
|
|
51
|
+
}
|
|
52
|
+
const outputFile = (0, import_javascript.stripImports)(import_skubaDive.SKUBA_DIVE_HOOKS, inputFile);
|
|
53
|
+
const relativeToSrc = import_path.default.posix.relative(
|
|
54
|
+
import_path.default.join(entryPoint, ".."),
|
|
55
|
+
"src"
|
|
56
|
+
);
|
|
57
|
+
if (relativeToSrc === "") {
|
|
58
|
+
return (0, import_javascript.prependImport)("skuba-dive/register", outputFile);
|
|
59
|
+
}
|
|
60
|
+
files[DEFAULT_FILENAME] = (0, import_javascript.prependImport)(
|
|
61
|
+
"skuba-dive/register",
|
|
62
|
+
registerFile
|
|
63
|
+
);
|
|
64
|
+
return (0, import_javascript.prependImport)(`${relativeToSrc}/register`, outputFile);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
skubaDiveModule
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=skubaDive.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/modules/skubaDive.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport { SKUBA_DIVE_HOOKS } from '../dependencies/skubaDive';\nimport { prependImport, stripImports } from '../processing/javascript';\nimport { loadFiles } from '../processing/loadFiles';\nimport { parsePackage } from '../processing/package';\nimport type { Module, Options } from '../types';\n\nconst DEFAULT_FILENAME = 'src/register.ts';\n\nexport const skubaDiveModule = ({ entryPoint, type }: Options): Module => {\n // skuba-dive is a runtime component; it's not appropriate for packages\n if (type === 'package') {\n return {};\n }\n\n return {\n ...loadFiles(DEFAULT_FILENAME, 'package.json'),\n\n [entryPoint]: (inputFile, files) => {\n const packageJson = parsePackage(files['package.json']);\n\n const registerFile = files[DEFAULT_FILENAME];\n\n if (\n !packageJson?.dependencies?.['skuba-dive'] ||\n inputFile === undefined ||\n inputFile.includes('skuba-dive/register') ||\n registerFile?.includes('skuba-dive/register')\n ) {\n return inputFile;\n }\n\n const outputFile = stripImports(SKUBA_DIVE_HOOKS, inputFile);\n\n const relativeToSrc = path.posix.relative(\n path.join(entryPoint, '..'),\n 'src',\n );\n\n // import skuba-dive directly from the entry point\n if (relativeToSrc === '') {\n return prependImport('skuba-dive/register', outputFile);\n }\n\n // import skuba-dive via src/register.ts\n files[DEFAULT_FILENAME] = prependImport(\n 'skuba-dive/register',\n registerFile,\n );\n\n return prependImport(`${relativeToSrc}/register`, outputFile);\n },\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,uBAAiC;AACjC,wBAA4C;AAC5C,uBAA0B;AAC1B,qBAA6B;AAG7B,MAAM,mBAAmB;AAElB,MAAM,kBAAkB,CAAC,EAAE,YAAY,KAAK,MAAuB;AAExE,MAAI,SAAS,WAAW;AACtB,WAAO,CAAC;AAAA,EACV;AAEA,SAAO;AAAA,IACL,OAAG,4BAAU,kBAAkB,cAAc;AAAA,IAE7C,CAAC,UAAU,GAAG,CAAC,WAAW,UAAU;AAClC,YAAM,kBAAc,6BAAa,MAAM,cAAc,CAAC;AAEtD,YAAM,eAAe,MAAM,gBAAgB;AAE3C,UACE,CAAC,aAAa,eAAe,YAAY,KACzC,cAAc,UACd,UAAU,SAAS,qBAAqB,KACxC,cAAc,SAAS,qBAAqB,GAC5C;AACA,eAAO;AAAA,MACT;AAEA,YAAM,iBAAa,gCAAa,mCAAkB,SAAS;AAE3D,YAAM,gBAAgB,YAAAA,QAAK,MAAM;AAAA,QAC/B,YAAAA,QAAK,KAAK,YAAY,IAAI;AAAA,QAC1B;AAAA,MACF;AAGA,UAAI,kBAAkB,IAAI;AACxB,mBAAO,iCAAc,uBAAuB,UAAU;AAAA,MACxD;AAGA,YAAM,gBAAgB,QAAI;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAEA,iBAAO,iCAAc,GAAG,0BAA0B,UAAU;AAAA,IAC9D;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["path"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 tsconfig_exports = {};
|
|
20
|
+
__export(tsconfig_exports, {
|
|
21
|
+
tsconfigModule: () => tsconfigModule
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(tsconfig_exports);
|
|
24
|
+
var import_template = require("../../../utils/template");
|
|
25
|
+
var import_validation = require("../../../utils/validation");
|
|
26
|
+
var import_json = require("../processing/json");
|
|
27
|
+
var import_loadFiles = require("../processing/loadFiles");
|
|
28
|
+
var import_record = require("../processing/record");
|
|
29
|
+
const tsconfigModule = async ({
|
|
30
|
+
firstRun,
|
|
31
|
+
type
|
|
32
|
+
}) => {
|
|
33
|
+
const [buildFile, baseFile] = await Promise.all([
|
|
34
|
+
(0, import_template.readBaseTemplateFile)("tsconfig.build.json"),
|
|
35
|
+
(0, import_template.readBaseTemplateFile)("tsconfig.json")
|
|
36
|
+
]);
|
|
37
|
+
const baseData = (0, import_json.parseObject)(baseFile);
|
|
38
|
+
if (type === "package" && (0, import_validation.hasProp)(baseData, "compilerOptions") && (0, import_validation.isObject)(baseData.compilerOptions)) {
|
|
39
|
+
delete baseData.compilerOptions.baseUrl;
|
|
40
|
+
delete baseData.compilerOptions.paths;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
...(0, import_loadFiles.loadFiles)("Dockerfile"),
|
|
44
|
+
"tsconfig.build.json": (inputFile) => inputFile ?? buildFile,
|
|
45
|
+
"tsconfig.json": (inputFile, files, initialFiles) => {
|
|
46
|
+
const inputData = (0, import_json.parseObject)(inputFile);
|
|
47
|
+
let outDir;
|
|
48
|
+
if ((0, import_validation.hasProp)(inputData, "compilerOptions") && (0, import_validation.hasStringProp)(inputData.compilerOptions, "outDir")) {
|
|
49
|
+
outDir = inputData.compilerOptions.outDir.replace(/\/$/, "");
|
|
50
|
+
}
|
|
51
|
+
if (outDir !== void 0 && outDir !== "lib") {
|
|
52
|
+
files.Dockerfile = files.Dockerfile?.replace(
|
|
53
|
+
new RegExp(`([^\\w])${outDir}([^\\w])`, "g"),
|
|
54
|
+
"$1lib$2"
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if ((0, import_validation.hasProp)(baseData, "compilerOptions")) {
|
|
58
|
+
if ((0, import_validation.hasProp)(baseData.compilerOptions, "lib") && (0, import_validation.hasProp)(inputData?.compilerOptions, "lib")) {
|
|
59
|
+
delete baseData.compilerOptions.lib;
|
|
60
|
+
}
|
|
61
|
+
if ((0, import_validation.hasProp)(baseData.compilerOptions, "target") && (0, import_validation.hasProp)(inputData?.compilerOptions, "target")) {
|
|
62
|
+
delete baseData.compilerOptions.target;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const outputData = (0, import_record.merge)(inputData ?? {}, baseData);
|
|
66
|
+
if ((0, import_validation.hasProp)(outputData, "exclude") && Array.isArray(outputData.exclude)) {
|
|
67
|
+
const { exclude } = outputData;
|
|
68
|
+
const hasLibStar = exclude.includes("lib*/**/*");
|
|
69
|
+
outputData.exclude = exclude.filter(
|
|
70
|
+
(pattern) => !(hasLibStar && (/* @__PURE__ */ new Set(["lib", "lib/**/*"])).has(pattern))
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
if ((0, import_validation.hasProp)(outputData, "include") && !initialFiles["tsconfig.json"]?.includes("skuba/config/tsconfig.json")) {
|
|
74
|
+
delete outputData.include;
|
|
75
|
+
}
|
|
76
|
+
if (firstRun && type === "package" && (0, import_validation.isObject)(outputData.compilerOptions) && !outputData.compilerOptions.removeComments) {
|
|
77
|
+
outputData.compilerOptions.removeComments = false;
|
|
78
|
+
}
|
|
79
|
+
return (0, import_json.formatObject)(outputData);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
+
0 && (module.exports = {
|
|
85
|
+
tsconfigModule
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=tsconfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/modules/tsconfig.ts"],
|
|
4
|
+
"sourcesContent": ["import { readBaseTemplateFile } from '../../../utils/template';\nimport { hasProp, hasStringProp, isObject } from '../../../utils/validation';\nimport { formatObject, parseObject } from '../processing/json';\nimport { loadFiles } from '../processing/loadFiles';\nimport { merge } from '../processing/record';\nimport type { Module, Options } from '../types';\n\nexport const tsconfigModule = async ({\n firstRun,\n type,\n}: Options): Promise<Module> => {\n const [buildFile, baseFile] = await Promise.all([\n readBaseTemplateFile('tsconfig.build.json'),\n readBaseTemplateFile('tsconfig.json'),\n ]);\n\n const baseData = parseObject(baseFile);\n\n // packages should not use module aliases\n if (\n type === 'package' &&\n hasProp(baseData, 'compilerOptions') &&\n isObject(baseData.compilerOptions)\n ) {\n delete baseData.compilerOptions.baseUrl;\n delete baseData.compilerOptions.paths;\n }\n\n return {\n ...loadFiles('Dockerfile'),\n\n 'tsconfig.build.json': (inputFile) => inputFile ?? buildFile,\n\n 'tsconfig.json': (inputFile, files, initialFiles) => {\n const inputData = parseObject(inputFile);\n\n let outDir: string | undefined;\n\n if (\n hasProp(inputData, 'compilerOptions') &&\n hasStringProp(inputData.compilerOptions, 'outDir')\n ) {\n outDir = inputData.compilerOptions.outDir.replace(/\\/$/, '');\n }\n\n // optimistically rewire Dockerfile for new output directory\n if (outDir !== undefined && outDir !== 'lib') {\n files.Dockerfile = files.Dockerfile?.replace(\n new RegExp(`([^\\\\w])${outDir}([^\\\\w])`, 'g'),\n '$1lib$2',\n );\n }\n\n // existing project may target earlier Node.js versions than skuba\n if (hasProp(baseData, 'compilerOptions')) {\n if (\n hasProp(baseData.compilerOptions, 'lib') &&\n hasProp(inputData?.compilerOptions, 'lib')\n ) {\n delete baseData.compilerOptions.lib;\n }\n\n if (\n hasProp(baseData.compilerOptions, 'target') &&\n hasProp(inputData?.compilerOptions, 'target')\n ) {\n delete baseData.compilerOptions.target;\n }\n }\n\n const outputData = merge(inputData ?? {}, baseData);\n\n // Remove `lib/**/*` and `lib`, which duplicate `lib*/**/*`\n if (hasProp(outputData, 'exclude') && Array.isArray(outputData.exclude)) {\n const { exclude } = outputData;\n\n const hasLibStar = exclude.includes('lib*/**/*');\n\n outputData.exclude = exclude.filter(\n (pattern: unknown) =>\n !(hasLibStar && new Set<unknown>(['lib', 'lib/**/*']).has(pattern)),\n );\n }\n\n // for optimal ESLinting, base config should compile all files and leave\n // exclusions to .eslintignore and tsconfig.build.json\n if (\n hasProp(outputData, 'include') &&\n !initialFiles['tsconfig.json']?.includes('skuba/config/tsconfig.json')\n ) {\n delete outputData.include;\n }\n\n // Retain comments for package documentation\n if (\n firstRun &&\n type === 'package' &&\n isObject(outputData.compilerOptions) &&\n !outputData.compilerOptions.removeComments\n ) {\n outputData.compilerOptions.removeComments = false;\n }\n\n return formatObject(outputData);\n },\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,wBAAiD;AACjD,kBAA0C;AAC1C,uBAA0B;AAC1B,oBAAsB;AAGf,MAAM,iBAAiB,OAAO;AAAA,EACnC;AAAA,EACA;AACF,MAAgC;AAC9B,QAAM,CAAC,WAAW,QAAQ,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC9C,sCAAqB,qBAAqB;AAAA,QAC1C,sCAAqB,eAAe;AAAA,EACtC,CAAC;AAED,QAAM,eAAW,yBAAY,QAAQ;AAGrC,MACE,SAAS,iBACT,2BAAQ,UAAU,iBAAiB,SACnC,4BAAS,SAAS,eAAe,GACjC;AACA,WAAO,SAAS,gBAAgB;AAChC,WAAO,SAAS,gBAAgB;AAAA,EAClC;AAEA,SAAO;AAAA,IACL,OAAG,4BAAU,YAAY;AAAA,IAEzB,uBAAuB,CAAC,cAAc,aAAa;AAAA,IAEnD,iBAAiB,CAAC,WAAW,OAAO,iBAAiB;AACnD,YAAM,gBAAY,yBAAY,SAAS;AAEvC,UAAI;AAEJ,cACE,2BAAQ,WAAW,iBAAiB,SACpC,iCAAc,UAAU,iBAAiB,QAAQ,GACjD;AACA,iBAAS,UAAU,gBAAgB,OAAO,QAAQ,OAAO,EAAE;AAAA,MAC7D;AAGA,UAAI,WAAW,UAAa,WAAW,OAAO;AAC5C,cAAM,aAAa,MAAM,YAAY;AAAA,UACnC,IAAI,OAAO,WAAW,kBAAkB,GAAG;AAAA,UAC3C;AAAA,QACF;AAAA,MACF;AAGA,cAAI,2BAAQ,UAAU,iBAAiB,GAAG;AACxC,gBACE,2BAAQ,SAAS,iBAAiB,KAAK,SACvC,2BAAQ,WAAW,iBAAiB,KAAK,GACzC;AACA,iBAAO,SAAS,gBAAgB;AAAA,QAClC;AAEA,gBACE,2BAAQ,SAAS,iBAAiB,QAAQ,SAC1C,2BAAQ,WAAW,iBAAiB,QAAQ,GAC5C;AACA,iBAAO,SAAS,gBAAgB;AAAA,QAClC;AAAA,MACF;AAEA,YAAM,iBAAa,qBAAM,aAAa,CAAC,GAAG,QAAQ;AAGlD,cAAI,2BAAQ,YAAY,SAAS,KAAK,MAAM,QAAQ,WAAW,OAAO,GAAG;AACvE,cAAM,EAAE,QAAQ,IAAI;AAEpB,cAAM,aAAa,QAAQ,SAAS,WAAW;AAE/C,mBAAW,UAAU,QAAQ;AAAA,UAC3B,CAAC,YACC,EAAE,eAAc,oBAAI,IAAa,CAAC,OAAO,UAAU,CAAC,GAAE,IAAI,OAAO;AAAA,QACrE;AAAA,MACF;AAIA,cACE,2BAAQ,YAAY,SAAS,KAC7B,CAAC,aAAa,eAAe,GAAG,SAAS,4BAA4B,GACrE;AACA,eAAO,WAAW;AAAA,MACpB;AAGA,UACE,YACA,SAAS,iBACT,4BAAS,WAAW,eAAe,KACnC,CAAC,WAAW,gBAAgB,gBAC5B;AACA,mBAAW,gBAAgB,iBAAiB;AAAA,MAC9C;AAEA,iBAAO,0BAAa,UAAU;AAAA,IAChC;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 tslint_exports = {};
|
|
20
|
+
__export(tslint_exports, {
|
|
21
|
+
tslintModule: () => tslintModule
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(tslint_exports);
|
|
24
|
+
var import_deleteFiles = require("../processing/deleteFiles");
|
|
25
|
+
const tslintModule = () => (0, import_deleteFiles.deleteFiles)("tslint.json", "tslint.yaml");
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
tslintModule
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=tslint.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/modules/tslint.ts"],
|
|
4
|
+
"sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles';\nimport type { Module } from '../types';\n\nexport const tslintModule = (): Module =>\n deleteFiles('tslint.json', 'tslint.yaml');\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAGrB,MAAM,eAAe,UAC1B,gCAAY,eAAe,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tryPatchRenovateConfig: (dir?: string) => Promise<void>;
|
|
@@ -0,0 +1,132 @@
|
|
|
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 patchRenovateConfig_exports = {};
|
|
30
|
+
__export(patchRenovateConfig_exports, {
|
|
31
|
+
tryPatchRenovateConfig: () => tryPatchRenovateConfig
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(patchRenovateConfig_exports);
|
|
34
|
+
var import_util = require("util");
|
|
35
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
+
var fleece = __toESM(require("golden-fleece"));
|
|
37
|
+
var t = __toESM(require("runtypes"));
|
|
38
|
+
var Git = __toESM(require("../../api/git"));
|
|
39
|
+
var import_logging = require("../../utils/logging");
|
|
40
|
+
var import_project = require("./analysis/project");
|
|
41
|
+
var import_renovate = require("./modules/renovate");
|
|
42
|
+
var import_prettier = require("./processing/prettier");
|
|
43
|
+
const RENOVATE_PRESETS = [
|
|
44
|
+
"local>seekasia/renovate-config",
|
|
45
|
+
"local>seek-jobs/renovate-config"
|
|
46
|
+
];
|
|
47
|
+
const RenovateConfig = t.Record({
|
|
48
|
+
extends: t.Array(t.String)
|
|
49
|
+
});
|
|
50
|
+
const ownerToRenovatePreset = (owner) => {
|
|
51
|
+
const lowercaseOwner = owner.toLowerCase();
|
|
52
|
+
switch (lowercaseOwner) {
|
|
53
|
+
case "seekasia":
|
|
54
|
+
return "local>seekasia/renovate-config";
|
|
55
|
+
case "seek-jobs":
|
|
56
|
+
return "local>seek-jobs/renovate-config";
|
|
57
|
+
default:
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const patchJson = async ({ filepath, input, presetToAdd }) => {
|
|
62
|
+
const config = JSON.parse(input);
|
|
63
|
+
if (!RenovateConfig.guard(config)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
config.extends.unshift(presetToAdd);
|
|
67
|
+
await import_fs_extra.default.promises.writeFile(
|
|
68
|
+
filepath,
|
|
69
|
+
(0, import_prettier.formatPrettier)(JSON.stringify(config), { parser: "json" })
|
|
70
|
+
);
|
|
71
|
+
return;
|
|
72
|
+
};
|
|
73
|
+
const patchJson5 = async ({ filepath, input, presetToAdd }) => {
|
|
74
|
+
const config = fleece.evaluate(input);
|
|
75
|
+
if (!RenovateConfig.guard(config)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
config.extends.unshift(presetToAdd);
|
|
79
|
+
await import_fs_extra.default.promises.writeFile(
|
|
80
|
+
filepath,
|
|
81
|
+
(0, import_prettier.formatPrettier)(fleece.patch(input, config), { parser: "json5" })
|
|
82
|
+
);
|
|
83
|
+
return;
|
|
84
|
+
};
|
|
85
|
+
const patchByFiletype = {
|
|
86
|
+
json: patchJson,
|
|
87
|
+
json5: patchJson5
|
|
88
|
+
};
|
|
89
|
+
const patchRenovateConfig = async (dir) => {
|
|
90
|
+
const readFile = (0, import_project.createDestinationFileReader)(dir);
|
|
91
|
+
const { owner } = await Git.getOwnerAndRepo({ dir });
|
|
92
|
+
const presetToAdd = ownerToRenovatePreset(owner);
|
|
93
|
+
if (!presetToAdd) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const maybeConfigs = await Promise.all(
|
|
97
|
+
import_renovate.RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({
|
|
98
|
+
input: await readFile(filepath),
|
|
99
|
+
filepath
|
|
100
|
+
}))
|
|
101
|
+
);
|
|
102
|
+
const config = maybeConfigs.find((maybeConfig) => Boolean(maybeConfig.input));
|
|
103
|
+
if (
|
|
104
|
+
// No file was found.
|
|
105
|
+
!config?.input || // The file appears to mention the baseline preset for the configured Git
|
|
106
|
+
// owner. This is a very naive check that we don't want to overcomplicate
|
|
107
|
+
// because it is invoked before each skuba format and lint.
|
|
108
|
+
config.input.includes(presetToAdd)
|
|
109
|
+
) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const filetype = config.filepath.toLowerCase().endsWith(".json5") ? "json5" : "json";
|
|
113
|
+
const patchFile = patchByFiletype[filetype];
|
|
114
|
+
await patchFile({
|
|
115
|
+
filepath: config.filepath,
|
|
116
|
+
input: config.input,
|
|
117
|
+
presetToAdd
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const tryPatchRenovateConfig = async (dir = process.cwd()) => {
|
|
121
|
+
try {
|
|
122
|
+
await patchRenovateConfig(dir);
|
|
123
|
+
} catch (err) {
|
|
124
|
+
import_logging.log.warn("Failed to patch Renovate config.");
|
|
125
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
129
|
+
0 && (module.exports = {
|
|
130
|
+
tryPatchRenovateConfig
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=patchRenovateConfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/cli/configure/patchRenovateConfig.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable new-cap */\n\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\nimport * as fleece from 'golden-fleece';\nimport * as t from 'runtypes';\n\nimport * as Git from '../../api/git';\nimport { log } from '../../utils/logging';\n\nimport { createDestinationFileReader } from './analysis/project';\nimport { RENOVATE_CONFIG_FILENAMES } from './modules/renovate';\nimport { formatPrettier } from './processing/prettier';\n\nconst RENOVATE_PRESETS = [\n 'local>seekasia/renovate-config',\n 'local>seek-jobs/renovate-config',\n] as const;\n\ntype RenovateFiletype = 'json' | 'json5';\n\ntype RenovatePreset = (typeof RENOVATE_PRESETS)[number];\n\nconst RenovateConfig = t.Record({\n extends: t.Array(t.String),\n});\n\nconst ownerToRenovatePreset = (owner: string): RenovatePreset | undefined => {\n const lowercaseOwner = owner.toLowerCase();\n\n switch (lowercaseOwner) {\n case 'seekasia':\n return 'local>seekasia/renovate-config';\n\n case 'seek-jobs':\n return 'local>seek-jobs/renovate-config';\n\n default:\n return;\n }\n};\n\ntype PatchFile = (props: {\n filepath: string;\n input: string;\n presetToAdd: RenovatePreset;\n}) => Promise<void>;\n\nconst patchJson: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const config: unknown = JSON.parse(input);\n\n if (!RenovateConfig.guard(config)) {\n return;\n }\n\n config.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n formatPrettier(JSON.stringify(config), { parser: 'json' }),\n );\n\n return;\n};\n\nconst patchJson5: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const config: unknown = fleece.evaluate(input);\n\n if (!RenovateConfig.guard(config)) {\n return;\n }\n\n config.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n formatPrettier(fleece.patch(input, config), { parser: 'json5' }),\n );\n\n return;\n};\n\nconst patchByFiletype: Record<RenovateFiletype, PatchFile> = {\n json: patchJson,\n json5: patchJson5,\n};\n\nconst patchRenovateConfig = async (dir: string) => {\n const readFile = createDestinationFileReader(dir);\n\n const { owner } = await Git.getOwnerAndRepo({ dir });\n\n const presetToAdd = ownerToRenovatePreset(owner);\n\n if (!presetToAdd) {\n // No baseline preset needs to be added for the configured Git owner.\n return;\n }\n\n const maybeConfigs = await Promise.all(\n RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({\n input: await readFile(filepath),\n filepath,\n })),\n );\n\n const config = maybeConfigs.find((maybeConfig) => Boolean(maybeConfig.input));\n\n if (\n // No file was found.\n !config?.input ||\n // The file appears to mention the baseline preset for the configured Git\n // owner. This is a very naive check that we don't want to overcomplicate\n // because it is invoked before each skuba format and lint.\n config.input.includes(presetToAdd)\n ) {\n return;\n }\n\n const filetype: RenovateFiletype = config.filepath\n .toLowerCase()\n .endsWith('.json5')\n ? 'json5'\n : 'json';\n\n const patchFile = patchByFiletype[filetype];\n\n await patchFile({\n filepath: config.filepath,\n input: config.input,\n presetToAdd,\n });\n};\n\nexport const tryPatchRenovateConfig = async (dir = process.cwd()) => {\n try {\n await patchRenovateConfig(dir);\n } catch (err) {\n log.warn('Failed to patch Renovate config.');\n log.subtle(inspect(err));\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAwB;AAExB,sBAAe;AACf,aAAwB;AACxB,QAAmB;AAEnB,UAAqB;AACrB,qBAAoB;AAEpB,qBAA4C;AAC5C,sBAA0C;AAC1C,sBAA+B;AAE/B,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AACF;AAMA,MAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,SAAS,EAAE,MAAM,EAAE,MAAM;AAC3B,CAAC;AAED,MAAM,wBAAwB,CAAC,UAA8C;AAC3E,QAAM,iBAAiB,MAAM,YAAY;AAEzC,UAAQ,gBAAgB;AAAA,IACtB,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AACH,aAAO;AAAA,IAET;AACE;AAAA,EACJ;AACF;AAQA,MAAM,YAAuB,OAAO,EAAE,UAAU,OAAO,YAAY,MAAM;AACvE,QAAM,SAAkB,KAAK,MAAM,KAAK;AAExC,MAAI,CAAC,eAAe,MAAM,MAAM,GAAG;AACjC;AAAA,EACF;AAEA,SAAO,QAAQ,QAAQ,WAAW;AAElC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB;AAAA,QACA,gCAAe,KAAK,UAAU,MAAM,GAAG,EAAE,QAAQ,OAAO,CAAC;AAAA,EAC3D;AAEA;AACF;AAEA,MAAM,aAAwB,OAAO,EAAE,UAAU,OAAO,YAAY,MAAM;AACxE,QAAM,SAAkB,OAAO,SAAS,KAAK;AAE7C,MAAI,CAAC,eAAe,MAAM,MAAM,GAAG;AACjC;AAAA,EACF;AAEA,SAAO,QAAQ,QAAQ,WAAW;AAElC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB;AAAA,QACA,gCAAe,OAAO,MAAM,OAAO,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACjE;AAEA;AACF;AAEA,MAAM,kBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,sBAAsB,OAAO,QAAgB;AACjD,QAAM,eAAW,4CAA4B,GAAG;AAEhD,QAAM,EAAE,MAAM,IAAI,MAAM,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAEnD,QAAM,cAAc,sBAAsB,KAAK;AAE/C,MAAI,CAAC,aAAa;AAEhB;AAAA,EACF;AAEA,QAAM,eAAe,MAAM,QAAQ;AAAA,IACjC,0CAA0B,IAAI,OAAO,cAAc;AAAA,MACjD,OAAO,MAAM,SAAS,QAAQ;AAAA,MAC9B;AAAA,IACF,EAAE;AAAA,EACJ;AAEA,QAAM,SAAS,aAAa,KAAK,CAAC,gBAAgB,QAAQ,YAAY,KAAK,CAAC;AAE5E;AAAA;AAAA,IAEE,CAAC,QAAQ;AAAA;AAAA;AAAA,IAIT,OAAO,MAAM,SAAS,WAAW;AAAA,IACjC;AACA;AAAA,EACF;AAEA,QAAM,WAA6B,OAAO,SACvC,YAAY,EACZ,SAAS,QAAQ,IAChB,UACA;AAEJ,QAAM,YAAY,gBAAgB,QAAQ;AAE1C,QAAM,UAAU;AAAA,IACd,UAAU,OAAO;AAAA,IACjB,OAAO,OAAO;AAAA,IACd;AAAA,EACF,CAAC;AACH;AAEO,MAAM,yBAAyB,OAAO,MAAM,QAAQ,IAAI,MAAM;AACnE,MAAI;AACF,UAAM,oBAAoB,GAAG;AAAA,EAC/B,SAAS,KAAP;AACA,uBAAI,KAAK,kCAAkC;AAC3C,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AAAA,EACzB;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var deleteFiles_exports = {};
|
|
20
|
+
__export(deleteFiles_exports, {
|
|
21
|
+
deleteFiles: () => deleteFiles
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(deleteFiles_exports);
|
|
24
|
+
const deleteFiles = (...filenames) => Object.fromEntries(
|
|
25
|
+
filenames.map((filename) => [filename, () => void 0])
|
|
26
|
+
);
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
deleteFiles
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=deleteFiles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/processing/deleteFiles.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Module } from '../types';\n\n/**\n * Load files into cache and schedule them for deletion.\n */\nexport const deleteFiles = (...filenames: string[]): Module =>\n Object.fromEntries(\n filenames.map((filename) => [filename, () => undefined] as const),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,cAAc,IAAI,cAC7B,OAAO;AAAA,EACL,UAAU,IAAI,CAAC,aAAa,CAAC,UAAU,MAAM,MAAS,CAAU;AAClE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate simple variants of an ignore pattern for exact matching purposes.
|
|
3
|
+
*
|
|
4
|
+
* Note that these patterns are not actually equivalent (e.g. `lib` matches more
|
|
5
|
+
* than `lib/`) but they generally represent the same _intent_.
|
|
6
|
+
*/
|
|
7
|
+
export declare const generateSimpleVariants: (patterns: string[]) => Set<string>;
|
|
8
|
+
export declare const mergeWithIgnoreFile: (rawTemplateFile: string) => (rawInputFile?: string) => string;
|
|
@@ -0,0 +1,74 @@
|
|
|
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 ignoreFile_exports = {};
|
|
20
|
+
__export(ignoreFile_exports, {
|
|
21
|
+
generateSimpleVariants: () => generateSimpleVariants,
|
|
22
|
+
mergeWithIgnoreFile: () => mergeWithIgnoreFile
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ignoreFile_exports);
|
|
25
|
+
const OUTDATED_PATTERNS = ["node_modules_bak/", "tmp-*/"];
|
|
26
|
+
const ASTERISKS = /\*/g;
|
|
27
|
+
const LEADING_SLASH = /^\//;
|
|
28
|
+
const TRAILING_SLASH = /\/$/;
|
|
29
|
+
const generateSimpleVariants = (patterns) => {
|
|
30
|
+
const set = /* @__PURE__ */ new Set();
|
|
31
|
+
for (const pattern of patterns) {
|
|
32
|
+
const deAsterisked = pattern.replace(ASTERISKS, "");
|
|
33
|
+
const stripped = deAsterisked.replace(LEADING_SLASH, "").replace(TRAILING_SLASH, "");
|
|
34
|
+
set.add(pattern);
|
|
35
|
+
set.add(deAsterisked);
|
|
36
|
+
set.add(deAsterisked.replace(LEADING_SLASH, ""));
|
|
37
|
+
set.add(deAsterisked.replace(TRAILING_SLASH, ""));
|
|
38
|
+
set.add(stripped);
|
|
39
|
+
if (stripped !== "") {
|
|
40
|
+
set.add(`/${stripped}`);
|
|
41
|
+
set.add(`${stripped}/`);
|
|
42
|
+
set.add(`/${stripped}/`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
set.delete("");
|
|
46
|
+
return set;
|
|
47
|
+
};
|
|
48
|
+
const mergeWithIgnoreFile = (rawTemplateFile) => {
|
|
49
|
+
const templateFile = rawTemplateFile.trim();
|
|
50
|
+
const templatePatterns = generateSimpleVariants([
|
|
51
|
+
...OUTDATED_PATTERNS,
|
|
52
|
+
...templateFile.split("\n").map((line) => line.trim())
|
|
53
|
+
]);
|
|
54
|
+
return (rawInputFile) => {
|
|
55
|
+
if (rawInputFile === void 0) {
|
|
56
|
+
return `${templateFile}
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
const replacedFile = rawInputFile.replace(/\r?\n/g, "\n").replace(/# managed by skuba[\s\S]*# end managed by skuba/, templateFile);
|
|
60
|
+
if (replacedFile.includes(templateFile)) {
|
|
61
|
+
return replacedFile;
|
|
62
|
+
}
|
|
63
|
+
const migratedFile = replacedFile.split("\n").filter((line) => !templatePatterns.has(line)).join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
64
|
+
const outputFile = [templateFile, migratedFile].join("\n\n").trim();
|
|
65
|
+
return `${outputFile}
|
|
66
|
+
`;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
generateSimpleVariants,
|
|
72
|
+
mergeWithIgnoreFile
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=ignoreFile.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/processing/ignoreFile.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Patterns that are superseded by skuba's bundled ignore file patterns and are\n * non-trivial to derive using e.g. `generateSimpleVariants`.\n */\nconst OUTDATED_PATTERNS = ['node_modules_bak/', 'tmp-*/'];\n\nconst ASTERISKS = /\\*/g;\nconst LEADING_SLASH = /^\\//;\nconst TRAILING_SLASH = /\\/$/;\n\n/**\n * Generate simple variants of an ignore pattern for exact matching purposes.\n *\n * Note that these patterns are not actually equivalent (e.g. `lib` matches more\n * than `lib/`) but they generally represent the same _intent_.\n */\nexport const generateSimpleVariants = (patterns: string[]) => {\n const set = new Set<string>();\n\n for (const pattern of patterns) {\n const deAsterisked = pattern.replace(ASTERISKS, '');\n const stripped = deAsterisked\n .replace(LEADING_SLASH, '')\n .replace(TRAILING_SLASH, '');\n\n set.add(pattern);\n set.add(deAsterisked);\n set.add(deAsterisked.replace(LEADING_SLASH, ''));\n set.add(deAsterisked.replace(TRAILING_SLASH, ''));\n set.add(stripped);\n\n if (stripped !== '') {\n set.add(`/${stripped}`);\n set.add(`${stripped}/`);\n set.add(`/${stripped}/`);\n }\n }\n\n set.delete('');\n\n return set;\n};\n\nexport const mergeWithIgnoreFile = (rawTemplateFile: string) => {\n const templateFile = rawTemplateFile.trim();\n\n const templatePatterns = generateSimpleVariants([\n ...OUTDATED_PATTERNS,\n ...templateFile.split('\\n').map((line) => line.trim()),\n ]);\n\n return (rawInputFile?: string) => {\n if (rawInputFile === undefined) {\n return `${templateFile}\\n`;\n }\n\n const replacedFile = rawInputFile\n .replace(/\\r?\\n/g, '\\n')\n .replace(/# managed by skuba[\\s\\S]*# end managed by skuba/, templateFile);\n\n if (replacedFile.includes(templateFile)) {\n return replacedFile;\n }\n\n // Crunch the existing lines of a non-skuba config.\n const migratedFile = replacedFile\n .split('\\n')\n .filter((line) => !templatePatterns.has(line))\n .join('\\n')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n\n const outputFile = [templateFile, migratedFile].join('\\n\\n').trim();\n\n return `${outputFile}\\n`;\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,MAAM,oBAAoB,CAAC,qBAAqB,QAAQ;AAExD,MAAM,YAAY;AAClB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAQhB,MAAM,yBAAyB,CAAC,aAAuB;AAC5D,QAAM,MAAM,oBAAI,IAAY;AAE5B,aAAW,WAAW,UAAU;AAC9B,UAAM,eAAe,QAAQ,QAAQ,WAAW,EAAE;AAClD,UAAM,WAAW,aACd,QAAQ,eAAe,EAAE,EACzB,QAAQ,gBAAgB,EAAE;AAE7B,QAAI,IAAI,OAAO;AACf,QAAI,IAAI,YAAY;AACpB,QAAI,IAAI,aAAa,QAAQ,eAAe,EAAE,CAAC;AAC/C,QAAI,IAAI,aAAa,QAAQ,gBAAgB,EAAE,CAAC;AAChD,QAAI,IAAI,QAAQ;AAEhB,QAAI,aAAa,IAAI;AACnB,UAAI,IAAI,IAAI,UAAU;AACtB,UAAI,IAAI,GAAG,WAAW;AACtB,UAAI,IAAI,IAAI,WAAW;AAAA,IACzB;AAAA,EACF;AAEA,MAAI,OAAO,EAAE;AAEb,SAAO;AACT;AAEO,MAAM,sBAAsB,CAAC,oBAA4B;AAC9D,QAAM,eAAe,gBAAgB,KAAK;AAE1C,QAAM,mBAAmB,uBAAuB;AAAA,IAC9C,GAAG;AAAA,IACH,GAAG,aAAa,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC;AAAA,EACvD,CAAC;AAED,SAAO,CAAC,iBAA0B;AAChC,QAAI,iBAAiB,QAAW;AAC9B,aAAO,GAAG;AAAA;AAAA,IACZ;AAEA,UAAM,eAAe,aAClB,QAAQ,UAAU,IAAI,EACtB,QAAQ,mDAAmD,YAAY;AAE1E,QAAI,aAAa,SAAS,YAAY,GAAG;AACvC,aAAO;AAAA,IACT;AAGA,UAAM,eAAe,aAClB,MAAM,IAAI,EACV,OAAO,CAAC,SAAS,CAAC,iBAAiB,IAAI,IAAI,CAAC,EAC5C,KAAK,IAAI,EACT,QAAQ,WAAW,MAAM,EACzB,KAAK;AAER,UAAM,aAAa,CAAC,cAAc,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK;AAElE,WAAO,GAAG;AAAA;AAAA,EACZ;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var javascript_exports = {};
|
|
20
|
+
__export(javascript_exports, {
|
|
21
|
+
prependImport: () => prependImport,
|
|
22
|
+
stripImports: () => stripImports
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(javascript_exports);
|
|
25
|
+
const prependImport = (name, file) => [`import '${name}';
|
|
26
|
+
`, file].filter((value) => value !== void 0).join("\n");
|
|
27
|
+
const stripImports = (names, inputFile) => {
|
|
28
|
+
const searchStrings = names.flatMap((name) => [`'${name}'`, `"${name}"`]);
|
|
29
|
+
const outputFile = inputFile.split(/\r?\n/).filter((line) => !searchStrings.some((str) => line.includes(str))).join("\n").trim();
|
|
30
|
+
return `${outputFile}
|
|
31
|
+
`;
|
|
32
|
+
};
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
prependImport,
|
|
36
|
+
stripImports
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=javascript.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/processing/javascript.ts"],
|
|
4
|
+
"sourcesContent": ["export const prependImport = (name: string, file?: string) =>\n [`import '${name}';\\n`, file]\n .filter((value) => value !== undefined)\n .join('\\n');\n\nexport const stripImports = (names: readonly string[], inputFile: string) => {\n const searchStrings = names.flatMap((name) => [`'${name}'`, `\"${name}\"`]);\n\n const outputFile = inputFile\n .split(/\\r?\\n/)\n .filter((line) => !searchStrings.some((str) => line.includes(str)))\n .join('\\n')\n .trim();\n\n return `${outputFile}\\n`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,gBAAgB,CAAC,MAAc,SAC1C,CAAC,WAAW;AAAA,GAAY,IAAI,EACzB,OAAO,CAAC,UAAU,UAAU,MAAS,EACrC,KAAK,IAAI;AAEP,MAAM,eAAe,CAAC,OAA0B,cAAsB;AAC3E,QAAM,gBAAgB,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,OAAO,CAAC;AAExE,QAAM,aAAa,UAChB,MAAM,OAAO,EACb,OAAO,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,QAAQ,KAAK,SAAS,GAAG,CAAC,CAAC,EACjE,KAAK,IAAI,EACT,KAAK;AAER,SAAO,GAAG;AAAA;AACZ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|