skuba 0.0.0-beta-20231002015947
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 +4 -0
- package/config/prettier.js +6 -0
- package/config/tsconfig.json +11 -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 +40 -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 +79 -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 +59 -0
- package/lib/api/git/currentBranch.js.map +7 -0
- package/lib/api/git/findRoot.d.ts +9 -0
- package/lib/api/git/findRoot.js +52 -0
- package/lib/api/git/findRoot.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 +11 -0
- package/lib/api/git/index.js +58 -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 +73 -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 +69 -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 +167 -0
- package/lib/api/github/push.js.map +7 -0
- package/lib/api/jest/index.d.ts +147 -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 +99 -0
- package/lib/cli/adapter/eslint.js.map +7 -0
- package/lib/cli/adapter/prettier.d.ts +52 -0
- package/lib/cli/adapter/prettier.js +176 -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/assets.d.ts +10 -0
- package/lib/cli/build/assets.js +107 -0
- package/lib/cli/build/assets.js.map +7 -0
- package/lib/cli/build/esbuild.d.ts +5 -0
- package/lib/cli/build/esbuild.js +98 -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 +83 -0
- package/lib/cli/build/index.js.map +7 -0
- package/lib/cli/build/tsc.d.ts +4 -0
- package/lib/cli/build/tsc.js +102 -0
- package/lib/cli/build/tsc.js.map +7 -0
- package/lib/cli/buildPackage.d.ts +1 -0
- package/lib/cli/buildPackage.js +69 -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 +109 -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 +73 -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/patchDockerfile.d.ts +1 -0
- package/lib/cli/configure/patchDockerfile.js +65 -0
- package/lib/cli/configure/patchDockerfile.js.map +7 -0
- package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
- package/lib/cli/configure/patchRenovateConfig.js +138 -0
- package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
- package/lib/cli/configure/patchServerListener.d.ts +3 -0
- package/lib/cli/configure/patchServerListener.js +87 -0
- package/lib/cli/configure/patchServerListener.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 +85 -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 +205 -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 +74 -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 +286 -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 +214 -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 +117 -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 +51 -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 +36 -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 +75 -0
- package/lib/cli/test/reporters/github/index.js.map +7 -0
- package/lib/cli/test/reporters/prettier/index.d.ts +4 -0
- package/lib/cli/test/reporters/prettier/index.js +67 -0
- package/lib/cli/test/reporters/prettier/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 +53 -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 +17 -0
- package/lib/utils/copy.js +105 -0
- package/lib/utils/copy.js.map +7 -0
- package/lib/utils/dir.d.ts +22 -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 +39 -0
- package/lib/utils/exec.js +163 -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 +83 -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 +69 -0
- package/lib/wrapper/requestListener.js.map +7 -0
- package/package.json +170 -0
- package/template/base/.github/CODEOWNERS +1 -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 +8 -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 +105 -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 +120 -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 +105 -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 +127 -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 +56 -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/koa-rest-api/tsconfig.json +18 -0
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +98 -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 +57 -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 +22 -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 +59 -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 +19 -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 +95 -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 +36 -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 +47 -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 +44 -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,47 @@
|
|
|
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 main_exports = {};
|
|
30
|
+
__export(main_exports, {
|
|
31
|
+
main: () => main
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(main_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_functionHandler = require("./functionHandler");
|
|
36
|
+
var import_requestListener = require("./requestListener");
|
|
37
|
+
const main = async (rawEntryPoint, rawPort) => {
|
|
38
|
+
const availablePort = Number(rawPort) || void 0;
|
|
39
|
+
const [modulePath, functionName] = import_path.default.join(process.cwd(), rawEntryPoint).split("#", 2);
|
|
40
|
+
const entryPoint = require(modulePath);
|
|
41
|
+
return functionName ? (0, import_functionHandler.runFunctionHandler)({ availablePort, entryPoint, functionName }) : (0, import_requestListener.runRequestListener)({ availablePort, entryPoint });
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
main
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/wrapper/main.ts"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport { runFunctionHandler } from './functionHandler';\nimport { runRequestListener } from './requestListener';\n\nexport const main = async (rawEntryPoint: string, rawPort: string) => {\n const availablePort = Number(rawPort) || undefined;\n\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath, functionName] = path\n .join(process.cwd(), rawEntryPoint)\n .split('#', 2);\n\n // Load entry point as module\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const entryPoint = require(modulePath as string) as unknown;\n\n return functionName\n ? runFunctionHandler({ availablePort, entryPoint, functionName })\n : runRequestListener({ availablePort, entryPoint });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,6BAAmC;AACnC,6BAAmC;AAE5B,MAAM,OAAO,OAAO,eAAuB,YAAoB;AACpE,QAAM,gBAAgB,OAAO,OAAO,KAAK;AAGzC,QAAM,CAAC,YAAY,YAAY,IAAI,YAAAA,QAChC,KAAK,QAAQ,IAAI,GAAG,aAAa,EACjC,MAAM,KAAK,CAAC;AAIf,QAAM,aAAa,QAAQ,UAAoB;AAE/C,SAAO,mBACH,2CAAmB,EAAE,eAAe,YAAY,aAAa,CAAC,QAC9D,2CAAmB,EAAE,eAAe,WAAW,CAAC;AACtD;",
|
|
6
|
+
"names": ["path"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Args {
|
|
2
|
+
availablePort?: number;
|
|
3
|
+
entryPoint: unknown;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Create an HTTP server that calls into an exported `http.RequestListener`.
|
|
7
|
+
*
|
|
8
|
+
* This supports Express and Koa applications out of the box.
|
|
9
|
+
*/
|
|
10
|
+
export declare const runRequestListener: ({ availablePort, entryPoint, }: Args) => Promise<void>;
|
|
11
|
+
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 requestListener_exports = {};
|
|
30
|
+
__export(requestListener_exports, {
|
|
31
|
+
runRequestListener: () => runRequestListener
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(requestListener_exports);
|
|
34
|
+
var import_http = __toESM(require("http"));
|
|
35
|
+
var import_validation = require("../utils/validation");
|
|
36
|
+
var import_http2 = require("./http");
|
|
37
|
+
const isConfig = (data) => (0, import_validation.isFunction)(data) || (0, import_validation.isObject)(data);
|
|
38
|
+
const runRequestListener = async ({
|
|
39
|
+
availablePort,
|
|
40
|
+
entryPoint
|
|
41
|
+
}) => {
|
|
42
|
+
if (!isConfig(entryPoint)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let config = await entryPoint;
|
|
46
|
+
if (typeof config === "object" && isConfig(config.default)) {
|
|
47
|
+
config = await config.default;
|
|
48
|
+
}
|
|
49
|
+
if (Object.keys(config).length === 0) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const port = (0, import_validation.isIpPort)(config.port) ? config.port : availablePort;
|
|
53
|
+
if (typeof config !== "function" && config instanceof import_http.default.Server) {
|
|
54
|
+
return (0, import_http2.startServer)(config, port);
|
|
55
|
+
}
|
|
56
|
+
if (typeof config !== "function" && config.server && config.server instanceof import_http.default.Server) {
|
|
57
|
+
return (0, import_http2.startServer)(config.server, port);
|
|
58
|
+
}
|
|
59
|
+
const requestListener = typeof config === "function" ? config : config.requestListener ?? config.callback?.();
|
|
60
|
+
if (typeof requestListener !== "function") {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return (0, import_http2.serveRequestListener)(requestListener, port);
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
runRequestListener
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=requestListener.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/wrapper/requestListener.ts"],
|
|
4
|
+
"sourcesContent": ["import http from 'http';\n\nimport { isFunction, isIpPort, isObject } from '../utils/validation';\n\nimport { serveRequestListener, startServer } from './http';\n\n// Express compatibility\ninterface FunctionConfig extends http.RequestListener {\n port?: number;\n}\n\ninterface ObjectConfig {\n // Koa compatibility\n callback?: () => http.RequestListener;\n\n requestListener?: http.RequestListener;\n\n // Fastify compatibility\n server?: http.Server;\n\n default?: Promise<unknown>;\n port?: unknown;\n}\n\nconst isConfig = (\n data: unknown,\n): data is Promise<FunctionConfig> | Promise<ObjectConfig> =>\n isFunction(data) || isObject(data);\n\ninterface Args {\n availablePort?: number;\n entryPoint: unknown;\n}\n\n/**\n * Create an HTTP server that calls into an exported `http.RequestListener`.\n *\n * This supports Express and Koa applications out of the box.\n */\nexport const runRequestListener = async ({\n availablePort,\n entryPoint,\n}: Args): Promise<void> => {\n if (!isConfig(entryPoint)) {\n // Assume an executable script with weird exports\n return;\n }\n\n let config: FunctionConfig | ObjectConfig = await entryPoint;\n\n if (typeof config === 'object' && isConfig(config.default)) {\n // Prefer `export default` over `export =`\n config = await config.default;\n }\n\n if (Object.keys(config).length === 0) {\n // Assume an executable script with no exports\n return;\n }\n\n const port = isIpPort(config.port) ? config.port : availablePort;\n\n // http.Server support\n if (typeof config !== 'function' && config instanceof http.Server) {\n return startServer(config, port);\n }\n\n // Fastify workaround\n if (\n typeof config !== 'function' &&\n config.server &&\n config.server instanceof http.Server\n ) {\n return startServer(config.server, port);\n }\n\n const requestListener =\n typeof config === 'function'\n ? config\n : config.requestListener ?? config.callback?.();\n\n if (typeof requestListener !== 'function') {\n // Assume an executable script with non-request listener exports\n return;\n }\n\n return serveRequestListener(requestListener, port);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,wBAA+C;AAE/C,IAAAA,eAAkD;AAoBlD,MAAM,WAAW,CACf,aAEA,8BAAW,IAAI,SAAK,4BAAS,IAAI;AAY5B,MAAM,qBAAqB,OAAO;AAAA,EACvC;AAAA,EACA;AACF,MAA2B;AACzB,MAAI,CAAC,SAAS,UAAU,GAAG;AAEzB;AAAA,EACF;AAEA,MAAI,SAAwC,MAAM;AAElD,MAAI,OAAO,WAAW,YAAY,SAAS,OAAO,OAAO,GAAG;AAE1D,aAAS,MAAM,OAAO;AAAA,EACxB;AAEA,MAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AAEpC;AAAA,EACF;AAEA,QAAM,WAAO,4BAAS,OAAO,IAAI,IAAI,OAAO,OAAO;AAGnD,MAAI,OAAO,WAAW,cAAc,kBAAkB,YAAAC,QAAK,QAAQ;AACjE,eAAO,0BAAY,QAAQ,IAAI;AAAA,EACjC;AAGA,MACE,OAAO,WAAW,cAClB,OAAO,UACP,OAAO,kBAAkB,YAAAA,QAAK,QAC9B;AACA,eAAO,0BAAY,OAAO,QAAQ,IAAI;AAAA,EACxC;AAEA,QAAM,kBACJ,OAAO,WAAW,aACd,SACA,OAAO,mBAAmB,OAAO,WAAW;AAElD,MAAI,OAAO,oBAAoB,YAAY;AAEzC;AAAA,EACF;AAEA,aAAO,mCAAqB,iBAAiB,IAAI;AACnD;",
|
|
6
|
+
"names": ["import_http", "http"]
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skuba",
|
|
3
|
+
"version": "0.0.0-beta-20231002015947",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
|
+
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/seek-oss/skuba/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+ssh://git@github.com/seek-oss/skuba.git"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "lib/index.js",
|
|
17
|
+
"types": "./lib/index.d.ts",
|
|
18
|
+
"bin": {
|
|
19
|
+
"skuba": "lib/skuba.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"config/**/*",
|
|
23
|
+
"jest/**/*",
|
|
24
|
+
"lib*/**/*.d.ts",
|
|
25
|
+
"lib*/**/*.js",
|
|
26
|
+
"lib*/**/*.js.map",
|
|
27
|
+
"template/**/*",
|
|
28
|
+
"jest-preset.js"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "scripts/build.sh",
|
|
32
|
+
"deploy": "scripts/deploy.sh",
|
|
33
|
+
"format": "yarn skuba format",
|
|
34
|
+
"lint": "yarn skuba lint && yarn lint:md",
|
|
35
|
+
"lint:md": "remark --frail --quiet .",
|
|
36
|
+
"release": "yarn build && changeset publish",
|
|
37
|
+
"skuba": "yarn build && node lib/skuba",
|
|
38
|
+
"stage": "changeset version && yarn format",
|
|
39
|
+
"test": "yarn skuba test",
|
|
40
|
+
"test:ci": "yarn skuba test --config jest.config.int.ts --runInBand",
|
|
41
|
+
"test:int": "yarn skuba test --config jest.config.int.ts --runInBand",
|
|
42
|
+
"test:template": "scripts/test-template.sh",
|
|
43
|
+
"test:watch": "yarn skuba test --config jest.config.int.ts --runInBand --watch"
|
|
44
|
+
},
|
|
45
|
+
"remarkConfig": {
|
|
46
|
+
"plugins": [
|
|
47
|
+
"remark-preset-lint-recommended",
|
|
48
|
+
[
|
|
49
|
+
"remark-lint-list-item-indent",
|
|
50
|
+
false
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"remark-lint-no-shortcut-reference-link",
|
|
54
|
+
false
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"remark-lint-no-undefined-references",
|
|
58
|
+
{
|
|
59
|
+
"allow": [
|
|
60
|
+
" ",
|
|
61
|
+
"x"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"resolutions": {
|
|
68
|
+
"**/@types/node": ">=18.12"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@changesets/cli": "2.26.2",
|
|
72
|
+
"@esbuild-plugins/tsconfig-paths": "^0.1.0",
|
|
73
|
+
"@jest/types": "^29.0.0",
|
|
74
|
+
"@octokit/graphql": "^7.0.0",
|
|
75
|
+
"@octokit/graphql-schema": "^14.5.0",
|
|
76
|
+
"@octokit/rest": "^20.0.0",
|
|
77
|
+
"@octokit/types": "^12.0.0",
|
|
78
|
+
"@types/jest": "^29.0.0",
|
|
79
|
+
"@types/node": ">=18.12",
|
|
80
|
+
"chalk": "^4.1.0",
|
|
81
|
+
"concurrently": "^8.0.0",
|
|
82
|
+
"dotenv": "^16.0.0",
|
|
83
|
+
"ejs": "^3.1.6",
|
|
84
|
+
"enquirer": "^2.3.6",
|
|
85
|
+
"esbuild": "~0.19.0",
|
|
86
|
+
"eslint": "^8.11.0",
|
|
87
|
+
"eslint-config-skuba": "3.0.3",
|
|
88
|
+
"execa": "^5.0.0",
|
|
89
|
+
"fdir": "^6.0.0",
|
|
90
|
+
"fs-extra": "^11.0.0",
|
|
91
|
+
"function-arguments": "^1.0.9",
|
|
92
|
+
"get-port": "^5.1.1",
|
|
93
|
+
"golden-fleece": "^1.0.9",
|
|
94
|
+
"ignore": "^5.1.8",
|
|
95
|
+
"is-installed-globally": "^0.4.0",
|
|
96
|
+
"isomorphic-git": "^1.11.1",
|
|
97
|
+
"jest": "^29.0.1",
|
|
98
|
+
"jest-watch-typeahead": "^2.1.1",
|
|
99
|
+
"libnpmsearch": "^7.0.0",
|
|
100
|
+
"lodash.mergewith": "^4.6.2",
|
|
101
|
+
"minimist": "^1.2.6",
|
|
102
|
+
"normalize-package-data": "^6.0.0",
|
|
103
|
+
"npm-run-path": "^4.0.1",
|
|
104
|
+
"npm-which": "^3.0.1",
|
|
105
|
+
"picomatch": "^2.2.2",
|
|
106
|
+
"prettier": "~3.0.3",
|
|
107
|
+
"prettier-plugin-packagejson": "^2.4.6",
|
|
108
|
+
"read-pkg-up": "^7.0.1",
|
|
109
|
+
"runtypes": "^6.0.0",
|
|
110
|
+
"semantic-release": "^21.0.0",
|
|
111
|
+
"serialize-error": "^8.0.1",
|
|
112
|
+
"simple-git": "^3.5.0",
|
|
113
|
+
"strip-ansi": "^6.0.1",
|
|
114
|
+
"ts-dedent": "^2.2.0",
|
|
115
|
+
"ts-jest": "^29.1.0",
|
|
116
|
+
"ts-node": "^10.7.0",
|
|
117
|
+
"ts-node-dev": "^2.0.0",
|
|
118
|
+
"tsconfig-paths": "^4.0.0",
|
|
119
|
+
"tsconfig-seek": "2.0.0",
|
|
120
|
+
"typescript": "~5.2.0",
|
|
121
|
+
"validate-npm-package-name": "^5.0.0"
|
|
122
|
+
},
|
|
123
|
+
"devDependencies": {
|
|
124
|
+
"@changesets/get-github-info": "0.5.2",
|
|
125
|
+
"@jest/reporters": "29.7.0",
|
|
126
|
+
"@types/ejs": "3.1.3",
|
|
127
|
+
"@types/express": "4.17.18",
|
|
128
|
+
"@types/fs-extra": "11.0.2",
|
|
129
|
+
"@types/koa": "2.13.9",
|
|
130
|
+
"@types/libnpmsearch": "2.0.4",
|
|
131
|
+
"@types/lodash.mergewith": "4.6.7",
|
|
132
|
+
"@types/module-alias": "2.0.2",
|
|
133
|
+
"@types/npm-which": "3.0.1",
|
|
134
|
+
"@types/picomatch": "2.3.1",
|
|
135
|
+
"@types/supertest": "2.0.12",
|
|
136
|
+
"@types/validate-npm-package-name": "4.0.0",
|
|
137
|
+
"enhanced-resolve": "5.15.0",
|
|
138
|
+
"express": "4.18.2",
|
|
139
|
+
"fastify": "4.23.2",
|
|
140
|
+
"jsonfile": "6.1.0",
|
|
141
|
+
"koa": "2.14.2",
|
|
142
|
+
"memfs": "4.4.0",
|
|
143
|
+
"remark-cli": "12.0.0",
|
|
144
|
+
"remark-preset-lint-recommended": "6.1.3",
|
|
145
|
+
"semver": "7.5.4",
|
|
146
|
+
"supertest": "6.3.3",
|
|
147
|
+
"type-fest": "2.19.0"
|
|
148
|
+
},
|
|
149
|
+
"peerDependencies": {
|
|
150
|
+
"skuba-dive": "1 || 2"
|
|
151
|
+
},
|
|
152
|
+
"peerDependenciesMeta": {
|
|
153
|
+
"skuba-dive": {
|
|
154
|
+
"optional": true
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"engines": {
|
|
158
|
+
"node": ">=18.12"
|
|
159
|
+
},
|
|
160
|
+
"publishConfig": {
|
|
161
|
+
"provenance": true
|
|
162
|
+
},
|
|
163
|
+
"skuba": {
|
|
164
|
+
"build": "esbuild",
|
|
165
|
+
"entryPoint": "src/index.ts",
|
|
166
|
+
"template": null,
|
|
167
|
+
"type": "package",
|
|
168
|
+
"version": "4.0.0"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @<%- ownerName %>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# managed by skuba
|
|
2
|
+
.idea/*
|
|
3
|
+
.vscode/*
|
|
4
|
+
|
|
5
|
+
.cdk.staging/
|
|
6
|
+
.serverless/
|
|
7
|
+
cdk.out/
|
|
8
|
+
node_modules*/
|
|
9
|
+
|
|
10
|
+
/coverage*/
|
|
11
|
+
/dist*/
|
|
12
|
+
/lib*/
|
|
13
|
+
/tmp*/
|
|
14
|
+
|
|
15
|
+
.DS_Store
|
|
16
|
+
.eslintcache
|
|
17
|
+
.npmrc
|
|
18
|
+
*.tgz
|
|
19
|
+
*.tsbuildinfo
|
|
20
|
+
npm-debug.log
|
|
21
|
+
package-lock.json
|
|
22
|
+
yarn-error.log
|
|
23
|
+
# end managed by skuba
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('skuba/config/prettier');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Jest } from 'skuba';
|
|
2
|
+
|
|
3
|
+
export default Jest.mergePreset({
|
|
4
|
+
coveragePathIgnorePatterns: ['src/testing'],
|
|
5
|
+
coverageThreshold: {
|
|
6
|
+
global: {
|
|
7
|
+
branches: 0,
|
|
8
|
+
functions: 0,
|
|
9
|
+
lines: 0,
|
|
10
|
+
statements: 0,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
setupFiles: ['<rootDir>/jest.setup.ts'],
|
|
14
|
+
testPathIgnorePatterns: ['/test\\.ts'],
|
|
15
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
agents:
|
|
2
|
+
queue: <%- prodBuildkiteQueueName %>
|
|
3
|
+
|
|
4
|
+
configs:
|
|
5
|
+
plugins:
|
|
6
|
+
- &aws-sm
|
|
7
|
+
seek-oss/aws-sm#v2.3.1:
|
|
8
|
+
env:
|
|
9
|
+
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
|
+
|
|
11
|
+
- &docker-ecr-cache
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.1.0: &docker-ecr-cache-defaults
|
|
13
|
+
cache-on:
|
|
14
|
+
- package.json
|
|
15
|
+
- yarn.lock
|
|
16
|
+
dockerfile: Dockerfile.dev-deps
|
|
17
|
+
secrets: id=npm,src=.npmrc
|
|
18
|
+
|
|
19
|
+
- &private-npm
|
|
20
|
+
seek-oss/private-npm#v1.2.0:
|
|
21
|
+
env: NPM_READ_TOKEN
|
|
22
|
+
|
|
23
|
+
base-steps:
|
|
24
|
+
- &deploy
|
|
25
|
+
concurrency: 1
|
|
26
|
+
retry:
|
|
27
|
+
manual:
|
|
28
|
+
# Only use this if you need to roll back a deployment ASAP.
|
|
29
|
+
# Always follow up with a proper revert or fix in Git history.
|
|
30
|
+
permit_on_passed: true
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- label: 🧖♀️ Warm Prod
|
|
34
|
+
command: ':'
|
|
35
|
+
key: warm-prod
|
|
36
|
+
plugins:
|
|
37
|
+
- *aws-sm
|
|
38
|
+
- *private-npm
|
|
39
|
+
- seek-oss/docker-ecr-cache#v2.1.0:
|
|
40
|
+
<<: *docker-ecr-cache-defaults
|
|
41
|
+
skip-pull-from-cache: true
|
|
42
|
+
|
|
43
|
+
- label: 🧪 Test & Lint
|
|
44
|
+
commands:
|
|
45
|
+
- echo '+++ yarn test:ci'
|
|
46
|
+
- yarn test:ci
|
|
47
|
+
- echo '--- yarn lint'
|
|
48
|
+
- yarn lint
|
|
49
|
+
depends_on: warm-prod
|
|
50
|
+
env:
|
|
51
|
+
GET_GITHUB_TOKEN: please
|
|
52
|
+
plugins:
|
|
53
|
+
- *aws-sm
|
|
54
|
+
- *private-npm
|
|
55
|
+
- *docker-ecr-cache
|
|
56
|
+
- docker-compose#v4.14.0:
|
|
57
|
+
run: app
|
|
58
|
+
timeout_in_minutes: 10
|
|
59
|
+
|
|
60
|
+
- label: 📦 Build & Package
|
|
61
|
+
depends_on: warm-prod
|
|
62
|
+
plugins:
|
|
63
|
+
- *aws-sm
|
|
64
|
+
- *private-npm
|
|
65
|
+
- *docker-ecr-cache
|
|
66
|
+
- seek-jobs/gantry#v2.0.0:
|
|
67
|
+
command: build
|
|
68
|
+
file: gantry.build.yml
|
|
69
|
+
region: <%- region %>
|
|
70
|
+
values: .gantry/common.yml
|
|
71
|
+
|
|
72
|
+
- wait
|
|
73
|
+
- block: 🙋🏻♀️ Deploy Dev
|
|
74
|
+
branches: '!${BUILDKITE_PIPELINE_DEFAULT_BRANCH}'
|
|
75
|
+
|
|
76
|
+
- <<: *deploy
|
|
77
|
+
agents:
|
|
78
|
+
queue: <%- devBuildkiteQueueName %>
|
|
79
|
+
label: 🤞 Deploy Dev
|
|
80
|
+
concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
|
|
81
|
+
key: deploy-dev
|
|
82
|
+
plugins:
|
|
83
|
+
- seek-jobs/gantry#v2.0.0:
|
|
84
|
+
command: apply
|
|
85
|
+
environment: <%- devGantryEnvironmentName %>
|
|
86
|
+
file: gantry.apply.yml
|
|
87
|
+
region: <%- region %>
|
|
88
|
+
values:
|
|
89
|
+
- .gantry/common.yml
|
|
90
|
+
- .gantry/dev.yml
|
|
91
|
+
|
|
92
|
+
- <<: *deploy
|
|
93
|
+
label: 🚀 Deploy Prod
|
|
94
|
+
branches: ${BUILDKITE_PIPELINE_DEFAULT_BRANCH}
|
|
95
|
+
concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
|
|
96
|
+
depends_on: deploy-dev
|
|
97
|
+
plugins:
|
|
98
|
+
- seek-jobs/gantry#v2.0.0:
|
|
99
|
+
command: apply
|
|
100
|
+
environment: <%- prodGantryEnvironmentName %>
|
|
101
|
+
file: gantry.apply.yml
|
|
102
|
+
region: <%- region %>
|
|
103
|
+
values:
|
|
104
|
+
- .gantry/common.yml
|
|
105
|
+
- .gantry/prod.yml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ENVIRONMENT=local
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
prodAccountId: '<%- prodAwsAccountId %>'
|
|
2
|
+
|
|
3
|
+
image: '{{values "prodAccountId"}}.dkr.ecr.<%- region %>.amazonaws.com/{{values "service"}}:{{.BuildID}}'
|
|
4
|
+
service: '<%- serviceName %>'
|
|
5
|
+
|
|
6
|
+
# TODO: enable Datadog agent
|
|
7
|
+
# https://backstage.myseek.xyz/docs/default/component/gantry/v1/reference/resources/service/#datadogSecretId
|
|
8
|
+
# datadogSecretId: arn:aws:secretsmanager:<%- region %>:<aws-account-id>:secret:<secret-name>
|
|
9
|
+
|
|
10
|
+
tags:
|
|
11
|
+
# TODO: add data classification tags
|
|
12
|
+
# https://rfc.skinfra.xyz/RFC019-AWS-Tagging-Standard.html#seekdataconsumers
|
|
13
|
+
# seek:data:consumers: internal
|
|
14
|
+
# https://rfc.skinfra.xyz/RFC019-AWS-Tagging-Standard.html#seekdatatypes
|
|
15
|
+
# seek:data:types:restricted: job-ads
|
|
16
|
+
seek:env:label: '{{values "environment"}}'
|
|
17
|
+
seek:env:production: '{{values "isProduction"}}'
|
|
18
|
+
seek:owner:team: '<%- teamName %>'
|
|
19
|
+
seek:source:sha: '{{.CommitSHA}}'
|
|
20
|
+
seek:source:url: 'https://github.com/SEEK-Jobs/<%- repoName %>'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
ARG BASE_IMAGE
|
|
2
|
+
ARG BASE_TAG
|
|
3
|
+
|
|
4
|
+
###
|
|
5
|
+
|
|
6
|
+
FROM ${BASE_IMAGE}:${BASE_TAG} AS deps
|
|
7
|
+
|
|
8
|
+
RUN yarn install --ignore-optional --ignore-scripts --non-interactive --offline --production
|
|
9
|
+
|
|
10
|
+
###
|
|
11
|
+
|
|
12
|
+
FROM ${BASE_IMAGE}:${BASE_TAG} AS build
|
|
13
|
+
|
|
14
|
+
COPY . .
|
|
15
|
+
|
|
16
|
+
RUN yarn build
|
|
17
|
+
|
|
18
|
+
###
|
|
19
|
+
|
|
20
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} gcr.io/distroless/nodejs18-debian11 AS runtime
|
|
21
|
+
|
|
22
|
+
WORKDIR /workdir
|
|
23
|
+
|
|
24
|
+
COPY --from=build /workdir/lib lib
|
|
25
|
+
|
|
26
|
+
COPY --from=deps /workdir/node_modules node_modules
|
|
27
|
+
|
|
28
|
+
ENV NODE_ENV=production
|
|
29
|
+
|
|
30
|
+
# https://nodejs.org/api/cli.html#cli_node_options_options
|
|
31
|
+
ENV NODE_OPTIONS=--enable-source-maps
|
|
32
|
+
|
|
33
|
+
ARG PORT=8001
|
|
34
|
+
ENV PORT=${PORT}
|
|
35
|
+
EXPOSE ${PORT}
|
|
36
|
+
|
|
37
|
+
CMD ["lib/listen.js"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.2
|
|
2
|
+
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:18-alpine AS dev-deps
|
|
4
|
+
|
|
5
|
+
WORKDIR /workdir
|
|
6
|
+
|
|
7
|
+
COPY package.json yarn.lock ./
|
|
8
|
+
|
|
9
|
+
RUN \
|
|
10
|
+
--mount=type=secret,id=npm,dst=/workdir/.npmrc \
|
|
11
|
+
yarn install --frozen-lockfile --ignore-optional --non-interactive
|