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,76 @@
|
|
|
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 addEmptyExports_exports = {};
|
|
30
|
+
__export(addEmptyExports_exports, {
|
|
31
|
+
JEST_SETUP_FILES: () => JEST_SETUP_FILES,
|
|
32
|
+
tryAddEmptyExports: () => tryAddEmptyExports
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(addEmptyExports_exports);
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_util = require("util");
|
|
37
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
38
|
+
var import_logging = require("../../utils/logging");
|
|
39
|
+
var import_package = require("./analysis/package");
|
|
40
|
+
var import_project = require("./analysis/project");
|
|
41
|
+
var import_prettier = require("./processing/prettier");
|
|
42
|
+
const JEST_SETUP_FILES = ["jest.setup.ts", "jest.setup.int.ts"];
|
|
43
|
+
const addEmptyExports = async () => {
|
|
44
|
+
const manifest = await (0, import_package.getDestinationManifest)();
|
|
45
|
+
const destinationRoot = import_path.default.dirname(manifest.path);
|
|
46
|
+
const readDestinationFile = (0, import_project.createDestinationFileReader)(destinationRoot);
|
|
47
|
+
const addEmptyExport = async (filename) => {
|
|
48
|
+
const inputFile = await readDestinationFile(filename);
|
|
49
|
+
if (!inputFile || // The file appears to have an import or export so it should be compatible
|
|
50
|
+
// with isolated modules. This is a very naive check that we don't want to
|
|
51
|
+
// overcomplicate because it is invoked before many skuba commands.
|
|
52
|
+
inputFile.includes("import ") || inputFile.includes("export ")) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const data = (0, import_prettier.formatPrettier)([inputFile, "export {}"].join("\n\n"), {
|
|
56
|
+
parser: "typescript"
|
|
57
|
+
});
|
|
58
|
+
const filepath = import_path.default.join(destinationRoot, filename);
|
|
59
|
+
await import_fs_extra.default.promises.writeFile(filepath, data);
|
|
60
|
+
};
|
|
61
|
+
await Promise.all(JEST_SETUP_FILES.map(addEmptyExport));
|
|
62
|
+
};
|
|
63
|
+
const tryAddEmptyExports = async () => {
|
|
64
|
+
try {
|
|
65
|
+
await addEmptyExports();
|
|
66
|
+
} catch (err) {
|
|
67
|
+
import_logging.log.warn("Failed to convert Jest setup files to isolated modules.");
|
|
68
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
JEST_SETUP_FILES,
|
|
74
|
+
tryAddEmptyExports
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=addEmptyExports.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/cli/configure/addEmptyExports.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../utils/logging';\n\nimport { getDestinationManifest } from './analysis/package';\nimport { createDestinationFileReader } from './analysis/project';\nimport { formatPrettier } from './processing/prettier';\n\n// TODO: glob `**/jest.*setup*.ts`?\nexport const JEST_SETUP_FILES = ['jest.setup.ts', 'jest.setup.int.ts'];\n\nconst addEmptyExports = async () => {\n const manifest = await getDestinationManifest();\n\n const destinationRoot = path.dirname(manifest.path);\n\n const readDestinationFile = createDestinationFileReader(destinationRoot);\n\n const addEmptyExport = async (filename: string) => {\n const inputFile = await readDestinationFile(filename);\n\n if (\n !inputFile ||\n // The file appears to have an import or export so it should be compatible\n // with isolated modules. This is a very naive check that we don't want to\n // overcomplicate because it is invoked before many skuba commands.\n inputFile.includes('import ') ||\n inputFile.includes('export ')\n ) {\n return;\n }\n\n const data = formatPrettier([inputFile, 'export {}'].join('\\n\\n'), {\n parser: 'typescript',\n });\n\n const filepath = path.join(destinationRoot, filename);\n\n await fs.promises.writeFile(filepath, data);\n };\n\n await Promise.all(JEST_SETUP_FILES.map(addEmptyExport));\n};\n\n/**\n * Tries to add an empty `export {}` statement to the bottom of Jest setup files\n * for compliance with TypeScript isolated modules.\n */\nexport const tryAddEmptyExports = async () => {\n try {\n await addEmptyExports();\n } catch (err) {\n log.warn('Failed to convert Jest setup files to isolated modules.');\n log.subtle(inspect(err));\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,sBAAe;AAEf,qBAAoB;AAEpB,qBAAuC;AACvC,qBAA4C;AAC5C,sBAA+B;AAGxB,MAAM,mBAAmB,CAAC,iBAAiB,mBAAmB;AAErE,MAAM,kBAAkB,YAAY;AAClC,QAAM,WAAW,UAAM,uCAAuB;AAE9C,QAAM,kBAAkB,YAAAA,QAAK,QAAQ,SAAS,IAAI;AAElD,QAAM,0BAAsB,4CAA4B,eAAe;AAEvE,QAAM,iBAAiB,OAAO,aAAqB;AACjD,UAAM,YAAY,MAAM,oBAAoB,QAAQ;AAEpD,QACE,CAAC;AAAA;AAAA;AAAA,IAID,UAAU,SAAS,SAAS,KAC5B,UAAU,SAAS,SAAS,GAC5B;AACA;AAAA,IACF;AAEA,UAAM,WAAO,gCAAe,CAAC,WAAW,WAAW,EAAE,KAAK,MAAM,GAAG;AAAA,MACjE,QAAQ;AAAA,IACV,CAAC;AAED,UAAM,WAAW,YAAAA,QAAK,KAAK,iBAAiB,QAAQ;AAEpD,UAAM,gBAAAC,QAAG,SAAS,UAAU,UAAU,IAAI;AAAA,EAC5C;AAEA,QAAM,QAAQ,IAAI,iBAAiB,IAAI,cAAc,CAAC;AACxD;AAMO,MAAM,qBAAqB,YAAY;AAC5C,MAAI;AACF,UAAM,gBAAgB;AAAA,EACxB,SAAS,KAAP;AACA,uBAAI,KAAK,yDAAyD;AAClE,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AAAA,EACzB;AACF;",
|
|
6
|
+
"names": ["path", "fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ProjectType } from '../../utils/manifest';
|
|
2
|
+
interface Props {
|
|
3
|
+
destinationRoot: string;
|
|
4
|
+
entryPoint: string;
|
|
5
|
+
firstRun: boolean;
|
|
6
|
+
type: ProjectType;
|
|
7
|
+
}
|
|
8
|
+
export declare const analyseConfiguration: (props: Props) => Promise<undefined | (() => Promise<void>)>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
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 analyseConfiguration_exports = {};
|
|
30
|
+
__export(analyseConfiguration_exports, {
|
|
31
|
+
analyseConfiguration: () => analyseConfiguration
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(analyseConfiguration_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
+
var import_logging = require("../../utils/logging");
|
|
37
|
+
var import_project = require("./analysis/project");
|
|
38
|
+
const analyseConfiguration = async (props) => {
|
|
39
|
+
import_logging.log.newline();
|
|
40
|
+
import_logging.log.plain(import_logging.log.bold("Config:"));
|
|
41
|
+
const files = await (0, import_project.diffFiles)(props);
|
|
42
|
+
if (Object.keys(files).length === 0) {
|
|
43
|
+
import_logging.log.newline();
|
|
44
|
+
import_logging.log.ok("\u2714 No changes");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
import_logging.log.newline();
|
|
48
|
+
Object.entries(files).sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB)).forEach(([filename, { operation }]) => import_logging.log.plain(operation, filename));
|
|
49
|
+
return async () => {
|
|
50
|
+
const dirnames = [
|
|
51
|
+
...new Set(Object.keys(files).map((filename) => import_path.default.dirname(filename)))
|
|
52
|
+
];
|
|
53
|
+
await Promise.all(
|
|
54
|
+
dirnames.map(
|
|
55
|
+
(dirname) => import_fs_extra.default.promises.mkdir(dirname, { recursive: true })
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
await Promise.all(
|
|
59
|
+
Object.entries(files).map(
|
|
60
|
+
([filename, { data }]) => data === void 0 ? import_fs_extra.default.promises.rm(filename) : import_fs_extra.default.promises.writeFile(filename, data)
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
analyseConfiguration
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=analyseConfiguration.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/cli/configure/analyseConfiguration.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../utils/logging';\nimport type { ProjectType } from '../../utils/manifest';\n\nimport { diffFiles } from './analysis/project';\n\ninterface Props {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n type: ProjectType;\n}\n\nexport const analyseConfiguration = async (\n props: Props,\n): Promise<undefined | (() => Promise<void>)> => {\n log.newline();\n log.plain(log.bold('Config:'));\n\n const files = await diffFiles(props);\n\n if (Object.keys(files).length === 0) {\n log.newline();\n log.ok('\u2714 No changes');\n return;\n }\n\n log.newline();\n Object.entries(files)\n .sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB))\n .forEach(([filename, { operation }]) => log.plain(operation, filename));\n\n return async () => {\n const dirnames = [\n ...new Set(Object.keys(files).map((filename) => path.dirname(filename))),\n ];\n\n await Promise.all(\n dirnames.map((dirname) =>\n fs.promises.mkdir(dirname, { recursive: true }),\n ),\n );\n\n await Promise.all(\n Object.entries(files).map(([filename, { data }]) =>\n data === undefined\n ? fs.promises.rm(filename)\n : fs.promises.writeFile(filename, data),\n ),\n );\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,qBAAoB;AAGpB,qBAA0B;AASnB,MAAM,uBAAuB,OAClC,UAC+C;AAC/C,qBAAI,QAAQ;AACZ,qBAAI,MAAM,mBAAI,KAAK,SAAS,CAAC;AAE7B,QAAM,QAAQ,UAAM,0BAAU,KAAK;AAEnC,MAAI,OAAO,KAAK,KAAK,EAAE,WAAW,GAAG;AACnC,uBAAI,QAAQ;AACZ,uBAAI,GAAG,mBAAc;AACrB;AAAA,EACF;AAEA,qBAAI,QAAQ;AACZ,SAAO,QAAQ,KAAK,EACjB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,MAAM,UAAU,cAAc,SAAS,CAAC,EACrE,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,mBAAI,MAAM,WAAW,QAAQ,CAAC;AAExE,SAAO,YAAY;AACjB,UAAM,WAAW;AAAA,MACf,GAAG,IAAI,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,CAAC,aAAa,YAAAA,QAAK,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzE;AAEA,UAAM,QAAQ;AAAA,MACZ,SAAS;AAAA,QAAI,CAAC,YACZ,gBAAAC,QAAG,SAAS,MAAM,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,MAChD;AAAA,IACF;AAEA,UAAM,QAAQ;AAAA,MACZ,OAAO,QAAQ,KAAK,EAAE;AAAA,QAAI,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,MAC5C,SAAS,SACL,gBAAAA,QAAG,SAAS,GAAG,QAAQ,IACvB,gBAAAA,QAAG,SAAS,UAAU,UAAU,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["path", "fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NormalizedReadResult } from 'read-pkg-up';
|
|
2
|
+
import type { ProjectType } from '../../utils/manifest';
|
|
3
|
+
interface Props {
|
|
4
|
+
destinationRoot: string;
|
|
5
|
+
include: (pathname: string) => boolean;
|
|
6
|
+
manifest: NormalizedReadResult;
|
|
7
|
+
type: ProjectType;
|
|
8
|
+
}
|
|
9
|
+
export declare const analyseDependencies: ({ destinationRoot, include, manifest: { packageJson }, type, }: Props) => Promise<undefined | (() => Promise<void>)>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
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 analyseDependencies_exports = {};
|
|
30
|
+
__export(analyseDependencies_exports, {
|
|
31
|
+
analyseDependencies: () => analyseDependencies
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(analyseDependencies_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
+
var import_copy = require("../../utils/copy");
|
|
37
|
+
var import_logging = require("../../utils/logging");
|
|
38
|
+
var import_version = require("../../utils/version");
|
|
39
|
+
var import_package = require("./analysis/package");
|
|
40
|
+
var dependencyMutators = __toESM(require("./dependencies"));
|
|
41
|
+
var import_package2 = require("./processing/package");
|
|
42
|
+
const logDiff = (diff) => {
|
|
43
|
+
const entries = Object.entries(diff);
|
|
44
|
+
if (entries.length === 0) {
|
|
45
|
+
import_logging.log.ok("\u2714 No changes");
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
Object.entries(diff).sort(([nameA], [nameB]) => nameA.localeCompare(nameB)).forEach(
|
|
49
|
+
([name, { operation, version }]) => import_logging.log.plain(operation, name, import_logging.log.formatSubtle(version))
|
|
50
|
+
);
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
const pinUnspecifiedVersions = async (dependencies) => {
|
|
54
|
+
const updates = await Promise.all(
|
|
55
|
+
Object.entries(dependencies).filter(([, version]) => version === "*").map(async ([name]) => {
|
|
56
|
+
const version = await (name === "skuba" ? (0, import_version.getSkubaVersion)() : (0, import_version.latestNpmVersion)(name));
|
|
57
|
+
return [name, version];
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
updates.forEach(([name, version]) => {
|
|
61
|
+
dependencies[name] = version;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const analyseDependencies = async ({
|
|
65
|
+
destinationRoot,
|
|
66
|
+
include,
|
|
67
|
+
manifest: { packageJson },
|
|
68
|
+
type
|
|
69
|
+
}) => {
|
|
70
|
+
const input = {
|
|
71
|
+
dependencies: packageJson.dependencies ?? {},
|
|
72
|
+
devDependencies: packageJson.devDependencies ?? {},
|
|
73
|
+
type
|
|
74
|
+
};
|
|
75
|
+
const output = {
|
|
76
|
+
dependencies: { ...input.dependencies },
|
|
77
|
+
devDependencies: { ...input.devDependencies },
|
|
78
|
+
type
|
|
79
|
+
};
|
|
80
|
+
const printNotices = (0, import_package.generateNotices)(input);
|
|
81
|
+
const processors = Object.values(dependencyMutators).reduce(
|
|
82
|
+
(acc, mutate) => {
|
|
83
|
+
const newProcessors = mutate(output);
|
|
84
|
+
acc.push(...newProcessors);
|
|
85
|
+
return acc;
|
|
86
|
+
},
|
|
87
|
+
[]
|
|
88
|
+
);
|
|
89
|
+
await Promise.all([
|
|
90
|
+
pinUnspecifiedVersions(output.dependencies),
|
|
91
|
+
pinUnspecifiedVersions(output.devDependencies)
|
|
92
|
+
]);
|
|
93
|
+
const dependencyDiff = (0, import_package.diffDependencies)({
|
|
94
|
+
old: input.dependencies,
|
|
95
|
+
new: output.dependencies
|
|
96
|
+
});
|
|
97
|
+
import_logging.log.newline();
|
|
98
|
+
import_logging.log.plain(import_logging.log.bold("Dependencies:"));
|
|
99
|
+
import_logging.log.newline();
|
|
100
|
+
const hasDependencyDiff = logDiff(dependencyDiff);
|
|
101
|
+
const devDependencyDiff = (0, import_package.diffDependencies)({
|
|
102
|
+
old: input.devDependencies,
|
|
103
|
+
new: output.devDependencies
|
|
104
|
+
});
|
|
105
|
+
import_logging.log.newline();
|
|
106
|
+
import_logging.log.plain(import_logging.log.bold("Dev dependencies:"));
|
|
107
|
+
import_logging.log.newline();
|
|
108
|
+
const hasDevDependencyDiff = logDiff(devDependencyDiff);
|
|
109
|
+
printNotices();
|
|
110
|
+
const packageJsonFilepath = import_path.default.join(destinationRoot, "package.json");
|
|
111
|
+
if (!hasDependencyDiff && !hasDevDependencyDiff) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
return async () => {
|
|
115
|
+
const updatedPackageJson = (0, import_package2.formatPackage)({
|
|
116
|
+
...packageJson,
|
|
117
|
+
dependencies: output.dependencies,
|
|
118
|
+
devDependencies: output.devDependencies
|
|
119
|
+
});
|
|
120
|
+
await import_fs_extra.default.promises.writeFile(packageJsonFilepath, updatedPackageJson);
|
|
121
|
+
if (processors.length === 0) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
await (0, import_copy.copyFiles)({
|
|
125
|
+
sourceRoot: destinationRoot,
|
|
126
|
+
destinationRoot,
|
|
127
|
+
include,
|
|
128
|
+
processors
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
133
|
+
0 && (module.exports = {
|
|
134
|
+
analyseDependencies
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=analyseDependencies.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/cli/configure/analyseDependencies.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { NormalizedReadResult } from 'read-pkg-up';\n\nimport type { TextProcessor } from '../../utils/copy';\nimport { copyFiles } from '../../utils/copy';\nimport { log } from '../../utils/logging';\nimport type { ProjectType } from '../../utils/manifest';\nimport { getSkubaVersion, latestNpmVersion } from '../../utils/version';\n\nimport { diffDependencies, generateNotices } from './analysis/package';\nimport * as dependencyMutators from './dependencies';\nimport { formatPackage } from './processing/package';\nimport type { DependencyDiff } from './types';\n\nconst logDiff = (diff: DependencyDiff): boolean => {\n const entries = Object.entries(diff);\n\n if (entries.length === 0) {\n log.ok('\u2714 No changes');\n\n return false;\n }\n\n Object.entries(diff)\n .sort(([nameA], [nameB]) => nameA.localeCompare(nameB))\n .forEach(([name, { operation, version }]) =>\n log.plain(operation, name, log.formatSubtle(version)),\n );\n\n return true;\n};\n\nconst pinUnspecifiedVersions = async (\n dependencies: Record<string, string>,\n): Promise<void> => {\n const updates = await Promise.all(\n Object.entries(dependencies)\n .filter(([, version]) => version === '*')\n .map(async ([name]) => {\n const version = await (name === 'skuba'\n ? getSkubaVersion()\n : latestNpmVersion(name));\n\n return [name, version] as const;\n }),\n );\n\n updates.forEach(([name, version]) => {\n dependencies[name] = version;\n });\n};\n\ninterface Props {\n destinationRoot: string;\n include: (pathname: string) => boolean;\n manifest: NormalizedReadResult;\n type: ProjectType;\n}\n\nexport const analyseDependencies = async ({\n destinationRoot,\n include,\n manifest: { packageJson },\n type,\n}: Props): Promise<undefined | (() => Promise<void>)> => {\n const input = {\n dependencies: packageJson.dependencies ?? {},\n devDependencies: packageJson.devDependencies ?? {},\n type,\n };\n\n const output = {\n dependencies: { ...input.dependencies },\n devDependencies: { ...input.devDependencies },\n type,\n };\n\n const printNotices = generateNotices(input);\n\n const processors = Object.values(dependencyMutators).reduce<TextProcessor[]>(\n (acc, mutate) => {\n const newProcessors = mutate(output);\n acc.push(...newProcessors);\n return acc;\n },\n [],\n );\n\n await Promise.all([\n pinUnspecifiedVersions(output.dependencies),\n pinUnspecifiedVersions(output.devDependencies),\n ]);\n\n const dependencyDiff = diffDependencies({\n old: input.dependencies,\n new: output.dependencies,\n });\n\n log.newline();\n log.plain(log.bold('Dependencies:'));\n\n log.newline();\n const hasDependencyDiff = logDiff(dependencyDiff);\n\n const devDependencyDiff = diffDependencies({\n old: input.devDependencies,\n new: output.devDependencies,\n });\n\n log.newline();\n log.plain(log.bold('Dev dependencies:'));\n\n log.newline();\n const hasDevDependencyDiff = logDiff(devDependencyDiff);\n\n printNotices();\n\n const packageJsonFilepath = path.join(destinationRoot, 'package.json');\n\n if (!hasDependencyDiff && !hasDevDependencyDiff) {\n return;\n }\n\n return async () => {\n const updatedPackageJson = formatPackage({\n ...packageJson,\n dependencies: output.dependencies,\n devDependencies: output.devDependencies,\n });\n\n await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);\n\n if (processors.length === 0) {\n return;\n }\n\n await copyFiles({\n sourceRoot: destinationRoot,\n destinationRoot,\n include,\n processors,\n });\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAIf,kBAA0B;AAC1B,qBAAoB;AAEpB,qBAAkD;AAElD,qBAAkD;AAClD,yBAAoC;AACpC,IAAAA,kBAA8B;AAG9B,MAAM,UAAU,CAAC,SAAkC;AACjD,QAAM,UAAU,OAAO,QAAQ,IAAI;AAEnC,MAAI,QAAQ,WAAW,GAAG;AACxB,uBAAI,GAAG,mBAAc;AAErB,WAAO;AAAA,EACT;AAEA,SAAO,QAAQ,IAAI,EAChB,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,MAAM,MAAM,cAAc,KAAK,CAAC,EACrD;AAAA,IAAQ,CAAC,CAAC,MAAM,EAAE,WAAW,QAAQ,CAAC,MACrC,mBAAI,MAAM,WAAW,MAAM,mBAAI,aAAa,OAAO,CAAC;AAAA,EACtD;AAEF,SAAO;AACT;AAEA,MAAM,yBAAyB,OAC7B,iBACkB;AAClB,QAAM,UAAU,MAAM,QAAQ;AAAA,IAC5B,OAAO,QAAQ,YAAY,EACxB,OAAO,CAAC,CAAC,EAAE,OAAO,MAAM,YAAY,GAAG,EACvC,IAAI,OAAO,CAAC,IAAI,MAAM;AACrB,YAAM,UAAU,OAAO,SAAS,cAC5B,gCAAgB,QAChB,iCAAiB,IAAI;AAEzB,aAAO,CAAC,MAAM,OAAO;AAAA,IACvB,CAAC;AAAA,EACL;AAEA,UAAQ,QAAQ,CAAC,CAAC,MAAM,OAAO,MAAM;AACnC,iBAAa,IAAI,IAAI;AAAA,EACvB,CAAC;AACH;AASO,MAAM,sBAAsB,OAAO;AAAA,EACxC;AAAA,EACA;AAAA,EACA,UAAU,EAAE,YAAY;AAAA,EACxB;AACF,MAAyD;AACvD,QAAM,QAAQ;AAAA,IACZ,cAAc,YAAY,gBAAgB,CAAC;AAAA,IAC3C,iBAAiB,YAAY,mBAAmB,CAAC;AAAA,IACjD;AAAA,EACF;AAEA,QAAM,SAAS;AAAA,IACb,cAAc,EAAE,GAAG,MAAM,aAAa;AAAA,IACtC,iBAAiB,EAAE,GAAG,MAAM,gBAAgB;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,mBAAe,gCAAgB,KAAK;AAE1C,QAAM,aAAa,OAAO,OAAO,kBAAkB,EAAE;AAAA,IACnD,CAAC,KAAK,WAAW;AACf,YAAM,gBAAgB,OAAO,MAAM;AACnC,UAAI,KAAK,GAAG,aAAa;AACzB,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AAEA,QAAM,QAAQ,IAAI;AAAA,IAChB,uBAAuB,OAAO,YAAY;AAAA,IAC1C,uBAAuB,OAAO,eAAe;AAAA,EAC/C,CAAC;AAED,QAAM,qBAAiB,iCAAiB;AAAA,IACtC,KAAK,MAAM;AAAA,IACX,KAAK,OAAO;AAAA,EACd,CAAC;AAED,qBAAI,QAAQ;AACZ,qBAAI,MAAM,mBAAI,KAAK,eAAe,CAAC;AAEnC,qBAAI,QAAQ;AACZ,QAAM,oBAAoB,QAAQ,cAAc;AAEhD,QAAM,wBAAoB,iCAAiB;AAAA,IACzC,KAAK,MAAM;AAAA,IACX,KAAK,OAAO;AAAA,EACd,CAAC;AAED,qBAAI,QAAQ;AACZ,qBAAI,MAAM,mBAAI,KAAK,mBAAmB,CAAC;AAEvC,qBAAI,QAAQ;AACZ,QAAM,uBAAuB,QAAQ,iBAAiB;AAEtD,eAAa;AAEb,QAAM,sBAAsB,YAAAC,QAAK,KAAK,iBAAiB,cAAc;AAErE,MAAI,CAAC,qBAAqB,CAAC,sBAAsB;AAC/C;AAAA,EACF;AAEA,SAAO,YAAY;AACjB,UAAM,yBAAqB,+BAAc;AAAA,MACvC,GAAG;AAAA,MACH,cAAc,OAAO;AAAA,MACrB,iBAAiB,OAAO;AAAA,IAC1B,CAAC;AAED,UAAM,gBAAAC,QAAG,SAAS,UAAU,qBAAqB,kBAAkB;AAEnE,QAAI,WAAW,WAAW,GAAG;AAC3B;AAAA,IACF;AAEA,cAAM,uBAAU;AAAA,MACd,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": ["import_package", "path", "fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const determineOperation: (oldData?: string, newData?: string) => string;
|
|
@@ -0,0 +1,45 @@
|
|
|
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 diff_exports = {};
|
|
30
|
+
__export(diff_exports, {
|
|
31
|
+
determineOperation: () => determineOperation
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(diff_exports);
|
|
34
|
+
var import_chalk = __toESM(require("chalk"));
|
|
35
|
+
const determineOperation = (oldData, newData) => {
|
|
36
|
+
if (oldData === void 0) {
|
|
37
|
+
return import_chalk.default.green("A");
|
|
38
|
+
}
|
|
39
|
+
return newData === void 0 ? import_chalk.default.red("D") : import_chalk.default.yellow("M");
|
|
40
|
+
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
determineOperation
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/analysis/diff.ts"],
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk';\n\nexport const determineOperation = (\n oldData?: string,\n newData?: string,\n): string => {\n if (oldData === undefined) {\n return chalk.green('A');\n }\n\n return newData === undefined ? chalk.red('D') : chalk.yellow('M');\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAEX,MAAM,qBAAqB,CAChC,SACA,YACW;AACX,MAAI,YAAY,QAAW;AACzB,WAAO,aAAAA,QAAM,MAAM,GAAG;AAAA,EACxB;AAEA,SAAO,YAAY,SAAY,aAAAA,QAAM,IAAI,GAAG,IAAI,aAAAA,QAAM,OAAO,GAAG;AAClE;",
|
|
6
|
+
"names": ["chalk"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tsFileExists: (filePath: string) => Promise<boolean>;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 files_exports = {};
|
|
30
|
+
__export(files_exports, {
|
|
31
|
+
tsFileExists: () => tsFileExists
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(files_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
+
var import_error = require("../../../utils/error");
|
|
37
|
+
const tsFileExists = async (filePath) => {
|
|
38
|
+
const ext = import_path.default.extname(filePath);
|
|
39
|
+
if (ext !== "" && ext !== ".ts") {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const stats = await import_fs_extra.default.promises.lstat(
|
|
44
|
+
ext === "" ? `${filePath}.ts` : filePath
|
|
45
|
+
);
|
|
46
|
+
return stats.isFile();
|
|
47
|
+
} catch (err) {
|
|
48
|
+
if ((0, import_error.isErrorWithCode)(err, "ENOENT")) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
tsFileExists
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/analysis/files.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { isErrorWithCode } from '../../../utils/error';\n\nexport const tsFileExists = async (filePath: string) => {\n const ext = path.extname(filePath);\n\n if (ext !== '' && ext !== '.ts') {\n return false;\n }\n\n try {\n const stats = await fs.promises.lstat(\n ext === '' ? `${filePath}.ts` : filePath,\n );\n\n return stats.isFile();\n } catch (err) {\n if (isErrorWithCode(err, 'ENOENT')) {\n return false;\n }\n\n throw err;\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,mBAAgC;AAEzB,MAAM,eAAe,OAAO,aAAqB;AACtD,QAAM,MAAM,YAAAA,QAAK,QAAQ,QAAQ;AAEjC,MAAI,QAAQ,MAAM,QAAQ,OAAO;AAC/B,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,QAAQ,MAAM,gBAAAC,QAAG,SAAS;AAAA,MAC9B,QAAQ,KAAK,GAAG,gBAAgB;AAAA,IAClC;AAEA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,KAAP;AACA,YAAI,8BAAgB,KAAK,QAAQ,GAAG;AAClC,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": ["path", "fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const auditWorkingTree: (dir: string) => Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 git_exports = {};
|
|
30
|
+
__export(git_exports, {
|
|
31
|
+
auditWorkingTree: () => auditWorkingTree
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(git_exports);
|
|
34
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
+
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
36
|
+
var import_dir = require("../../../utils/dir");
|
|
37
|
+
var import_logging = require("../../../utils/logging");
|
|
38
|
+
const auditWorkingTree = async (dir) => {
|
|
39
|
+
const filepaths = await (0, import_dir.crawlDirectory)(dir);
|
|
40
|
+
const statuses = await Promise.all(
|
|
41
|
+
filepaths.map((filepath) => import_isomorphic_git.default.status({ dir, fs: import_fs_extra.default, filepath }))
|
|
42
|
+
);
|
|
43
|
+
if (statuses.some(
|
|
44
|
+
(status) => status !== "absent" && status !== "ignored" && status !== "unmodified"
|
|
45
|
+
)) {
|
|
46
|
+
import_logging.log.newline();
|
|
47
|
+
import_logging.log.warn("You have dirty/untracked files that may be overwritten.");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
auditWorkingTree
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/configure/analysis/git.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { crawlDirectory } from '../../../utils/dir';\nimport { log } from '../../../utils/logging';\n\nexport const auditWorkingTree = async (dir: string) => {\n const filepaths = await crawlDirectory(dir);\n\n const statuses = await Promise.all(\n filepaths.map((filepath) => git.status({ dir, fs, filepath })),\n );\n\n if (\n statuses.some(\n (status) =>\n status !== 'absent' && status !== 'ignored' && status !== 'unmodified',\n )\n ) {\n log.newline();\n log.warn('You have dirty/untracked files that may be overwritten.');\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAEhB,iBAA+B;AAC/B,qBAAoB;AAEb,MAAM,mBAAmB,OAAO,QAAgB;AACrD,QAAM,YAAY,UAAM,2BAAe,GAAG;AAE1C,QAAM,WAAW,MAAM,QAAQ;AAAA,IAC7B,UAAU,IAAI,CAAC,aAAa,sBAAAA,QAAI,OAAO,EAAE,KAAK,oBAAAC,SAAI,SAAS,CAAC,CAAC;AAAA,EAC/D;AAEA,MACE,SAAS;AAAA,IACP,CAAC,WACC,WAAW,YAAY,WAAW,aAAa,WAAW;AAAA,EAC9D,GACA;AACA,uBAAI,QAAQ;AACZ,uBAAI,KAAK,yDAAyD;AAAA,EACpE;AACF;",
|
|
6
|
+
"names": ["git", "fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import readPkgUp from 'read-pkg-up';
|
|
2
|
+
import type { DependencyDiff, DependencySet } from '../types';
|
|
3
|
+
interface GetDestinationManifestProps {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const getDestinationManifest: (props?: GetDestinationManifestProps) => Promise<readPkgUp.NormalizedReadResult>;
|
|
7
|
+
interface DiffDependenciesProps {
|
|
8
|
+
old: Record<string, string | undefined>;
|
|
9
|
+
new: Record<string, string | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export declare const diffDependencies: (props: DiffDependenciesProps) => DependencyDiff;
|
|
12
|
+
export declare const generateNotices: ({ dependencies, devDependencies, }: DependencySet) => () => void;
|
|
13
|
+
export {};
|