skuba 0.0.0-master-20231121000709 → 0.0.0-master-20240206001217
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/README.md +3 -3
- package/jest/transform.test.ts +3 -1
- package/lib/api/jest/index.d.ts +1 -1
- package/lib/api/jest/index.js.map +2 -2
- package/lib/cli/adapter/prettier.d.ts +1 -1
- package/lib/cli/adapter/prettier.js +11 -10
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/build/index.js +0 -2
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/buildPackage.js +0 -2
- package/lib/cli/buildPackage.js.map +2 -2
- package/lib/cli/configure/analyseConfiguration.d.ts +2 -0
- package/lib/cli/configure/analyseConfiguration.js.map +2 -2
- package/lib/cli/configure/getEntryPoint.js +1 -1
- package/lib/cli/configure/getEntryPoint.js.map +2 -2
- package/lib/cli/configure/getProjectType.js +1 -1
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +11 -8
- package/lib/cli/configure/index.js.map +2 -2
- package/lib/cli/configure/modules/index.js +0 -2
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/package.d.ts +1 -1
- package/lib/cli/configure/modules/package.js +2 -1
- package/lib/cli/configure/modules/package.js.map +2 -2
- package/lib/cli/configure/patchRenovateConfig.d.ts +2 -1
- package/lib/cli/configure/patchRenovateConfig.js +23 -10
- package/lib/cli/configure/patchRenovateConfig.js.map +2 -2
- package/lib/cli/configure/types.d.ts +2 -0
- package/lib/cli/configure/types.js.map +1 -1
- package/lib/cli/configure/upgrade/index.d.ts +15 -0
- package/lib/cli/configure/upgrade/index.js +130 -0
- package/lib/cli/configure/upgrade/index.js.map +7 -0
- package/lib/cli/configure/{addEmptyExports.d.ts → upgrade/patches/7.3.1/addEmptyExports.d.ts} +2 -2
- package/lib/cli/configure/{addEmptyExports.js → upgrade/patches/7.3.1/addEmptyExports.js} +15 -11
- package/lib/cli/configure/upgrade/patches/7.3.1/addEmptyExports.js.map +7 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/index.d.ts +2 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/index.js +55 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/index.js.map +7 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/moveNpmrcOutOfGitignoreManagedSection.d.ts +2 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/moveNpmrcOutOfGitignoreManagedSection.js +94 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/moveNpmrcOutOfGitignoreManagedSection.js.map +7 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/patchDockerfile.d.ts +2 -0
- package/lib/cli/configure/{patchDockerfile.js → upgrade/patches/7.3.1/patchDockerfile.js} +18 -12
- package/lib/cli/configure/upgrade/patches/7.3.1/patchDockerfile.js.map +7 -0
- package/lib/cli/configure/upgrade/patches/7.3.1/patchServerListener.d.ts +2 -0
- package/lib/cli/configure/{patchServerListener.js → upgrade/patches/7.3.1/patchServerListener.js} +18 -14
- package/lib/cli/configure/upgrade/patches/7.3.1/patchServerListener.js.map +7 -0
- package/lib/cli/format.js +7 -14
- package/lib/cli/format.js.map +2 -2
- package/lib/cli/init/getConfig.d.ts +4 -2
- package/lib/cli/init/getConfig.js +53 -26
- package/lib/cli/init/getConfig.js.map +2 -2
- package/lib/cli/init/git.d.ts +2 -1
- package/lib/cli/init/git.js +2 -9
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.d.ts +1 -1
- package/lib/cli/init/index.js +19 -9
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.d.ts +26 -3
- package/lib/cli/init/prompts.js +10 -2
- package/lib/cli/init/prompts.js.map +2 -2
- package/lib/cli/init/types.d.ts +21 -0
- package/lib/cli/init/types.js +5 -1
- package/lib/cli/init/types.js.map +2 -2
- package/lib/cli/init/writePackageJson.d.ts +6 -0
- package/lib/cli/init/writePackageJson.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/index.d.ts +2 -1
- package/lib/cli/lint/annotate/buildkite/index.js +5 -3
- package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/internal.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/internal.js +45 -0
- package/lib/cli/lint/annotate/buildkite/internal.js.map +7 -0
- package/lib/cli/lint/annotate/github/index.d.ts +2 -1
- package/lib/cli/lint/annotate/github/index.js +4 -2
- package/lib/cli/lint/annotate/github/index.js.map +2 -2
- package/lib/cli/lint/annotate/github/internal.d.ts +3 -0
- package/lib/cli/lint/annotate/github/internal.js +36 -0
- package/lib/cli/lint/annotate/github/internal.js.map +7 -0
- package/lib/cli/lint/annotate/index.d.ts +4 -3
- package/lib/cli/lint/annotate/index.js +9 -3
- package/lib/cli/lint/annotate/index.js.map +2 -2
- package/lib/cli/lint/autofix.d.ts +3 -1
- package/lib/cli/lint/autofix.js +36 -59
- package/lib/cli/lint/autofix.js.map +3 -3
- package/lib/cli/lint/external.d.ts +6 -1
- package/lib/cli/lint/external.js +6 -29
- package/lib/cli/lint/external.js.map +2 -2
- package/lib/cli/lint/index.d.ts +2 -1
- package/lib/cli/lint/index.js +46 -14
- package/lib/cli/lint/index.js.map +2 -2
- package/lib/cli/lint/internal.d.ts +12 -1
- package/lib/cli/lint/internal.js +55 -19
- package/lib/cli/lint/internal.js.map +3 -3
- package/lib/cli/lint/internalLints/deleteFiles.d.ts +3 -0
- package/lib/cli/lint/internalLints/deleteFiles.js +102 -0
- package/lib/cli/lint/internalLints/deleteFiles.js.map +7 -0
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +3 -0
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +75 -0
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +7 -0
- package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +11 -0
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +147 -0
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +7 -0
- package/lib/cli/test/index.js +0 -2
- package/lib/cli/test/index.js.map +2 -2
- package/lib/skuba.d.ts +1 -1
- package/lib/skuba.js.map +1 -1
- package/lib/utils/exec.d.ts +2 -1
- package/lib/utils/exec.js +1 -0
- package/lib/utils/exec.js.map +2 -2
- package/lib/utils/logging.d.ts +2 -0
- package/lib/utils/logging.js +1 -0
- package/lib/utils/logging.js.map +2 -2
- package/lib/utils/logo.js +6 -10
- package/lib/utils/logo.js.map +3 -3
- package/lib/utils/manifest.d.ts +1 -1
- package/lib/utils/manifest.js +1 -1
- package/lib/utils/manifest.js.map +2 -2
- package/lib/utils/npmrc.d.ts +1 -0
- package/lib/utils/npmrc.js +29 -0
- package/lib/utils/npmrc.js.map +7 -0
- package/lib/utils/packageManager.d.ts +24 -0
- package/lib/utils/packageManager.js +97 -0
- package/lib/utils/packageManager.js.map +7 -0
- package/lib/utils/template.d.ts +3 -0
- package/lib/utils/template.js +2 -0
- package/lib/utils/template.js.map +2 -2
- package/lib/utils/worker.d.ts +1 -0
- package/lib/wrapper/http.d.ts +1 -0
- package/package.json +39 -36
- package/template/base/_.dockerignore +0 -1
- package/template/base/_.eslintignore +1 -0
- package/template/base/_.gitignore +1 -1
- package/template/base/_.npmrc +8 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +13 -10
- package/template/express-rest-api/.gantry/dev.yml +3 -0
- package/template/express-rest-api/Dockerfile +6 -12
- package/template/express-rest-api/Dockerfile.dev-deps +6 -5
- package/template/express-rest-api/README.md +6 -6
- package/template/express-rest-api/docker-compose.yml +0 -10
- package/template/express-rest-api/gantry.apply.yml +5 -0
- package/template/express-rest-api/gantry.build.yml +1 -2
- package/template/express-rest-api/package.json +2 -2
- package/template/express-rest-api/skuba.template.js +1 -0
- package/template/greeter/.buildkite/pipeline.yml +12 -9
- package/template/greeter/Dockerfile +6 -5
- package/template/greeter/README.md +6 -6
- package/template/greeter/docker-compose.yml +0 -10
- package/template/greeter/package.json +1 -1
- package/template/greeter/skuba.template.js +1 -0
- package/template/koa-rest-api/.buildkite/pipeline.yml +13 -10
- package/template/koa-rest-api/.gantry/dev.yml +3 -0
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/Dockerfile +6 -12
- package/template/koa-rest-api/Dockerfile.dev-deps +6 -5
- package/template/koa-rest-api/README.md +6 -6
- package/template/koa-rest-api/docker-compose.yml +0 -10
- package/template/koa-rest-api/gantry.apply.yml +5 -0
- package/template/koa-rest-api/gantry.build.yml +1 -2
- package/template/koa-rest-api/package.json +8 -6
- package/template/koa-rest-api/skuba.template.js +1 -0
- package/template/koa-rest-api/src/framework/validation.test.ts +48 -15
- package/template/koa-rest-api/src/framework/validation.ts +31 -8
- package/template/koa-rest-api/src/testing/types.ts +16 -4
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +21 -15
- package/template/lambda-sqs-worker/Dockerfile +6 -6
- package/template/lambda-sqs-worker/README.md +8 -8
- package/template/lambda-sqs-worker/_.npmrc +12 -0
- package/template/lambda-sqs-worker/docker-compose.yml +0 -15
- package/template/lambda-sqs-worker/package.json +3 -4
- package/template/lambda-sqs-worker/serverless.yml +4 -1
- package/template/lambda-sqs-worker/skuba.template.js +1 -0
- package/template/lambda-sqs-worker/src/hooks.ts +1 -2
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +42 -18
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +9 -7
- package/template/lambda-sqs-worker-cdk/cdk.json +12 -6
- package/template/lambda-sqs-worker-cdk/docker-compose.yml +0 -15
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +1587 -225
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +23 -3
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +127 -14
- package/template/lambda-sqs-worker-cdk/package.json +5 -3
- package/template/lambda-sqs-worker-cdk/shared/context-types.ts +1 -0
- package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -0
- package/template/lambda-sqs-worker-cdk/src/app.ts +14 -1
- package/template/lambda-sqs-worker-cdk/src/postHook.ts +154 -0
- package/template/lambda-sqs-worker-cdk/src/preHook.ts +95 -0
- package/template/oss-npm-package/.github/workflows/release.yml +10 -7
- package/template/oss-npm-package/.github/workflows/validate.yml +10 -7
- package/template/oss-npm-package/.releaserc +16 -0
- package/template/oss-npm-package/README.md +17 -17
- package/template/oss-npm-package/_package.json +3 -2
- package/template/oss-npm-package/skuba.template.js +1 -0
- package/template/private-npm-package/.releaserc +16 -0
- package/template/private-npm-package/README.md +16 -16
- package/template/private-npm-package/_package.json +3 -3
- package/template/private-npm-package/skuba.template.js +1 -0
- package/lib/cli/configure/addEmptyExports.js.map +0 -7
- package/lib/cli/configure/modules/tsconfig.d.ts +0 -2
- package/lib/cli/configure/modules/tsconfig.js +0 -87
- package/lib/cli/configure/modules/tsconfig.js.map +0 -7
- package/lib/cli/configure/patchDockerfile.d.ts +0 -1
- package/lib/cli/configure/patchDockerfile.js.map +0 -7
- package/lib/cli/configure/patchServerListener.d.ts +0 -3
- package/lib/cli/configure/patchServerListener.js.map +0 -7
- package/lib/cli/configure/refreshIgnoreFiles.d.ts +0 -3
- package/lib/cli/configure/refreshIgnoreFiles.js +0 -78
- package/lib/cli/configure/refreshIgnoreFiles.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport { commitAllChanges } from '../../api/git';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { createInclusionFilter } from '../../utils/dir';\nimport { createExec, ensureCommands } from '../../utils/exec';\nimport { log } from '../../utils/logging';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\nimport { tryPatchRenovateConfig } from '../configure/patchRenovateConfig';\n\nimport { getConfig } from './getConfig';\nimport { initialiseRepo } from './git';\nimport { writePackageJson } from './writePackageJson';\n\nexport const init = async () => {\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;
|
|
4
|
+
"sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport { commitAllChanges } from '../../api/git';\nimport { hasDebugFlag } from '../../utils/args';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { createInclusionFilter } from '../../utils/dir';\nimport { createExec, ensureCommands } from '../../utils/exec';\nimport { createLogger, log } from '../../utils/logging';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\nimport { runPrettier } from '../adapter/prettier';\nimport { tryPatchRenovateConfig } from '../configure/patchRenovateConfig';\n\nimport { getConfig } from './getConfig';\nimport { initialiseRepo } from './git';\nimport type { Input } from './types';\nimport { writePackageJson } from './writePackageJson';\n\nexport const init = async (args = process.argv.slice(2)) => {\n const opts: Input = {\n debug: hasDebugFlag(args),\n };\n\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n const {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n await ensureCommands(packageManager);\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _.eslintrc.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: packageManager,\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n // Patch in a baseline Renovate preset based on the configured Git owner.\n await tryPatchRenovateConfig('format', destinationDir);\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n // The `-D` shorthand is portable across our package managers.\n await exec(packageManager, 'add', '-D', skubaSlug);\n\n // Templating can initially leave certain files in an unformatted state;\n // consider a Markdown table with columns sized based on content length.\n await runPrettier('format', createLogger(opts.debug), destinationDir);\n\n depsInstalled = true;\n } catch (err) {\n log.warn(inspect(err));\n }\n\n await commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n // The `-D` shorthand is portable across our package managers.\n log.ok(packageManager, 'add', '-D', skubaSlug);\n log.ok(packageManager, 'run', 'format');\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,iBAAiC;AACjC,kBAA6B;AAC7B,kBAA6C;AAC7C,iBAAsC;AACtC,kBAA2C;AAC3C,qBAAkC;AAClC,kBAAuC;AACvC,sBAGO;AACP,sBAA4B;AAC5B,iCAAuC;AAEvC,uBAA0B;AAC1B,IAAAA,cAA+B;AAE/B,8BAAiC;AAE1B,MAAM,OAAO,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAC1D,QAAM,OAAc;AAAA,IAClB,WAAO,0BAAa,IAAI;AAAA,EAC1B;AAEA,QAAM,mBAAmB,UAAM,oCAAuB;AAEtD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,UAAM,4BAAU;AAEpB,YAAM,4BAAe,cAAc;AAEnC,QAAM,UAAU,UAAM,kCAAsB;AAAA,IAC1C,YAAAC,QAAK,KAAK,gBAAgB,YAAY;AAAA,IACtC,YAAAA,QAAK,KAAK,mCAAmB,aAAa;AAAA,EAC5C,CAAC;AAED,QAAM,aAAa,KAAC,+BAAkB,YAAY,CAAC;AAEnD,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA;AAAA,IAEA,WAAW;AAAA,IACX;AAAA;AAAA,IAEA,uBAAuB;AAAA,EACzB,CAAC;AAED,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,IAAI;AAAA,IAChB,uBACI,8CAA6B,cAAc,IAC3C,QAAQ,QAAQ;AAAA,QAEpB,0CAAiB;AAAA,MACf,KAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,SAAS,iBAAiB;AAAA,IAC5B,CAAC;AAAA,EACH,CAAC;AAED,QAAM,WAAO,wBAAW;AAAA,IACtB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aAAa;AAAA,EACf,CAAC;AAED,qBAAI,QAAQ;AACZ,YAAM,4BAAe,gBAAgB,YAAY;AAGjD,YAAM,mDAAuB,UAAU,cAAc;AAErD,QAAM,YAAY,SAAS,iBAAiB,KAAK;AAEjD,MAAI,gBAAgB;AACpB,MAAI;AAEF,UAAM,KAAK,gBAAgB,OAAO,MAAM,SAAS;AAIjD,cAAM,6BAAY,cAAU,6BAAa,KAAK,KAAK,GAAG,cAAc;AAEpE,oBAAgB;AAAA,EAClB,SAAS,KAAK;AACZ,uBAAI,SAAK,qBAAQ,GAAG,CAAC;AAAA,EACvB;AAEA,YAAM,6BAAiB;AAAA,IACrB,KAAK;AAAA,IACL,SAAS,SAAS,YAAY;AAAA,EAChC,CAAC;AAED,QAAM,wBAAwB,MAAM;AAClC,uBAAI;AAAA,MACF;AAAA,MACA,mBAAI,KAAK,GAAG,aAAa,OAAO,IAAI,aAAa,QAAQ,EAAE;AAAA,MAC3D;AAAA,IACF;AACA,uBAAI,GAAG,wBAAwB;AAAA,EACjC;AAEA,MAAI,CAAC,eAAe;AAClB,uBAAI,QAAQ;AACZ,uBAAI,KAAK,mBAAI,KAAK,wCAAmC,CAAC;AAEtD,uBAAI,QAAQ;AACZ,0BAAsB;AAEtB,uBAAI,QAAQ;AACZ,uBAAI,MAAM,8BAA8B;AACxC,uBAAI,GAAG,MAAM,cAAc;AAE3B,uBAAI,GAAG,gBAAgB,OAAO,MAAM,SAAS;AAC7C,uBAAI,GAAG,gBAAgB,OAAO,QAAQ;AACtC,uBAAI,GAAG,eAAe;AACtB,uBAAI,GAAG,wBAAwB,QAAQ,SAAS,GAAG;AACnD,uBAAI,GAAG,kCAAkC,aAAa,aAAa,EAAE;AAErE,uBAAI,QAAQ;AACZ,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,qBAAI,QAAQ;AACZ,qBAAI,GAAG,mBAAI,KAAK,6BAAwB,CAAC;AAEzC,qBAAI,QAAQ;AACZ,wBAAsB;AAEtB,qBAAI,QAAQ;AACZ,qBAAI,MAAM,gCAAgC;AAC1C,qBAAI,GAAG,MAAM,cAAc;AAC3B,qBAAI,GAAG,kCAAkC,aAAa,aAAa,EAAE;AAErE,qBAAI,QAAQ;AACd;",
|
|
6
6
|
"names": ["import_git", "path"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/// <reference path="../../../src/enquirer.d.ts" />
|
|
2
|
+
import { type FormChoice, Input, Select } from 'enquirer';
|
|
1
3
|
import { type Platform } from './validation';
|
|
2
|
-
|
|
4
|
+
export type Choice = FormChoice & {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the user is allowed to skip field entry and use the initial value.
|
|
7
|
+
*
|
|
8
|
+
* Defaults to `false`.
|
|
9
|
+
*/
|
|
10
|
+
allowInitial?: boolean;
|
|
11
|
+
};
|
|
3
12
|
export type BaseFields = Record<(typeof BASE_CHOICES)[number]['name'], string> & {
|
|
4
13
|
platformName: Platform;
|
|
5
14
|
};
|
|
@@ -16,8 +25,15 @@ declare const BASE_CHOICES: readonly [{
|
|
|
16
25
|
}, {
|
|
17
26
|
readonly name: "platformName";
|
|
18
27
|
readonly message: "Platform";
|
|
19
|
-
readonly initial:
|
|
28
|
+
readonly initial: "arm64";
|
|
29
|
+
readonly allowInitial: true;
|
|
20
30
|
readonly validate: (value: unknown) => string | true;
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "defaultBranch";
|
|
33
|
+
readonly message: "Default Branch";
|
|
34
|
+
readonly initial: "main";
|
|
35
|
+
readonly allowInitial: true;
|
|
36
|
+
readonly validate: (value: unknown) => true | "required";
|
|
21
37
|
}];
|
|
22
38
|
export declare const BASE_PROMPT_PROPS: {
|
|
23
39
|
choices: readonly [{
|
|
@@ -33,8 +49,15 @@ export declare const BASE_PROMPT_PROPS: {
|
|
|
33
49
|
}, {
|
|
34
50
|
readonly name: "platformName";
|
|
35
51
|
readonly message: "Platform";
|
|
36
|
-
readonly initial:
|
|
52
|
+
readonly initial: "arm64";
|
|
53
|
+
readonly allowInitial: true;
|
|
37
54
|
readonly validate: (value: unknown) => string | true;
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "defaultBranch";
|
|
57
|
+
readonly message: "Default Branch";
|
|
58
|
+
readonly initial: "main";
|
|
59
|
+
readonly allowInitial: true;
|
|
60
|
+
readonly validate: (value: unknown) => true | "required";
|
|
38
61
|
}];
|
|
39
62
|
message: string;
|
|
40
63
|
name: string;
|
package/lib/cli/init/prompts.js
CHANGED
|
@@ -24,10 +24,10 @@ __export(prompts_exports, {
|
|
|
24
24
|
TEMPLATE_PROMPT: () => TEMPLATE_PROMPT
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(prompts_exports);
|
|
27
|
+
var import_enquirer = require("enquirer");
|
|
27
28
|
var import_fs_extra = require("fs-extra");
|
|
28
29
|
var import_template = require("../../utils/template");
|
|
29
30
|
var import_validation = require("./validation");
|
|
30
|
-
var import_enquirer = require("enquirer");
|
|
31
31
|
const BASE_CHOICES = [
|
|
32
32
|
{
|
|
33
33
|
name: "ownerName",
|
|
@@ -62,8 +62,16 @@ const BASE_CHOICES = [
|
|
|
62
62
|
{
|
|
63
63
|
name: "platformName",
|
|
64
64
|
message: "Platform",
|
|
65
|
-
initial:
|
|
65
|
+
initial: "arm64",
|
|
66
|
+
allowInitial: true,
|
|
66
67
|
validate: (value) => (0, import_validation.isPlatform)(value) || `must be ${import_validation.PLATFORM_OPTIONS}`
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "defaultBranch",
|
|
71
|
+
message: "Default Branch",
|
|
72
|
+
initial: "main",
|
|
73
|
+
allowInitial: true,
|
|
74
|
+
validate: (value) => typeof value === "string" && value.length > 0 ? true : "required"
|
|
67
75
|
}
|
|
68
76
|
];
|
|
69
77
|
const BASE_PROMPT_PROPS = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/prompts.ts"],
|
|
4
|
-
"sourcesContent": ["import { pathExists } from 'fs-extra';\n\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template';\n\nimport {\n PLATFORM_OPTIONS,\n type Platform,\n isGitHubOrg,\n isGitHubRepo,\n isGitHubTeam,\n isPlatform,\n} from './validation';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2B;AAE3B,sBAAwC;AAExC,wBAOO;
|
|
4
|
+
"sourcesContent": ["import { type FormChoice, Input, Select } from 'enquirer';\nimport { pathExists } from 'fs-extra';\n\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template';\n\nimport {\n PLATFORM_OPTIONS,\n type Platform,\n isGitHubOrg,\n isGitHubRepo,\n isGitHubTeam,\n isPlatform,\n} from './validation';\n\nexport type Choice = FormChoice & {\n /**\n * Whether the user is allowed to skip field entry and use the initial value.\n *\n * Defaults to `false`.\n */\n allowInitial?: boolean;\n};\n\nexport type BaseFields = Record<\n (typeof BASE_CHOICES)[number]['name'],\n string\n> & {\n platformName: Platform;\n};\n\nconst BASE_CHOICES = [\n {\n name: 'ownerName',\n message: 'Owner',\n initial: 'SEEK-Jobs/my-team',\n validate: (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n const [org, team] = value.split('/');\n\n if (!org || !isGitHubOrg(org)) {\n return 'fails GitHub validation';\n }\n\n return (\n team === undefined || isGitHubTeam(team) || 'fails GitHub validation'\n );\n },\n },\n {\n name: 'repoName',\n message: 'Repo',\n initial: 'my-repo',\n validate: async (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n if (!isGitHubRepo(value)) {\n return 'fails GitHub validation';\n }\n\n const exists = await pathExists(value);\n\n return !exists || `'${value}' is an existing directory`;\n },\n },\n {\n name: 'platformName',\n message: 'Platform',\n initial: 'arm64',\n allowInitial: true,\n validate: (value: unknown) =>\n isPlatform(value) || `must be ${PLATFORM_OPTIONS}`,\n },\n {\n name: 'defaultBranch',\n message: 'Default Branch',\n initial: 'main',\n allowInitial: true,\n validate: (value: unknown) =>\n typeof value === 'string' && value.length > 0 ? true : 'required',\n },\n] as const;\n\nexport const BASE_PROMPT_PROPS = {\n choices: BASE_CHOICES,\n message: 'For starters, some project details:',\n name: 'baseAnswers',\n};\n\nexport const SHOULD_CONTINUE_PROMPT = new Select({\n choices: ['yes', 'no'] as const,\n message: 'Fill this in now?',\n name: 'shouldContinue',\n});\n\nexport const GIT_PATH_PROMPT = new Input({\n message: 'Git path',\n name: 'gitPath',\n initial: 'seek-oss/skuba',\n validate: (value) => /[^/]+\\/[^/]+/.test(value) || 'Path is not valid',\n});\n\nexport const TEMPLATE_PROMPT = new Select({\n choices: TEMPLATE_NAMES_WITH_BYO,\n message: 'Select a template:',\n name: 'templateName',\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA+C;AAC/C,sBAA2B;AAE3B,sBAAwC;AAExC,wBAOO;AAkBP,MAAM,eAAe;AAAA,EACnB;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,CAAC,UAAmB;AAC5B,UAAI,OAAO,UAAU,UAAU;AAC7B,eAAO;AAAA,MACT;AAEA,YAAM,CAAC,KAAK,IAAI,IAAI,MAAM,MAAM,GAAG;AAEnC,UAAI,CAAC,OAAO,KAAC,+BAAY,GAAG,GAAG;AAC7B,eAAO;AAAA,MACT;AAEA,aACE,SAAS,cAAa,gCAAa,IAAI,KAAK;AAAA,IAEhD;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,OAAO,UAAmB;AAClC,UAAI,OAAO,UAAU,UAAU;AAC7B,eAAO;AAAA,MACT;AAEA,UAAI,KAAC,gCAAa,KAAK,GAAG;AACxB,eAAO;AAAA,MACT;AAEA,YAAM,SAAS,UAAM,4BAAW,KAAK;AAErC,aAAO,CAAC,UAAU,IAAI,KAAK;AAAA,IAC7B;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,cAAc;AAAA,IACd,UAAU,CAAC,cACT,8BAAW,KAAK,KAAK,WAAW,kCAAgB;AAAA,EACpD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,cAAc;AAAA,IACd,UAAU,CAAC,UACT,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,OAAO;AAAA,EAC3D;AACF;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,yBAAyB,IAAI,uBAAO;AAAA,EAC/C,SAAS,CAAC,OAAO,IAAI;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAEM,MAAM,kBAAkB,IAAI,sBAAM;AAAA,EACvC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,UAAU,eAAe,KAAK,KAAK,KAAK;AACrD,CAAC;AAEM,MAAM,kBAAkB,IAAI,uBAAO;AAAA,EACxC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/cli/init/types.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export interface Input {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to enable verbose debug logging.
|
|
5
|
+
*
|
|
6
|
+
* Defaults to `false`.
|
|
7
|
+
*/
|
|
8
|
+
debug: boolean;
|
|
9
|
+
}
|
|
2
10
|
export type InitConfigInput = z.infer<typeof initConfigInputSchema>;
|
|
3
11
|
export declare const initConfigInputSchema: z.ZodObject<{
|
|
4
12
|
destinationDir: z.ZodString;
|
|
@@ -7,14 +15,17 @@ export declare const initConfigInputSchema: z.ZodObject<{
|
|
|
7
15
|
ownerName: z.ZodString;
|
|
8
16
|
repoName: z.ZodString;
|
|
9
17
|
platformName: z.ZodUnion<[z.ZodLiteral<"amd64">, z.ZodLiteral<"arm64">]>;
|
|
18
|
+
defaultBranch: z.ZodString;
|
|
10
19
|
}, "strip", z.ZodString, z.objectOutputType<{
|
|
11
20
|
ownerName: z.ZodString;
|
|
12
21
|
repoName: z.ZodString;
|
|
13
22
|
platformName: z.ZodUnion<[z.ZodLiteral<"amd64">, z.ZodLiteral<"arm64">]>;
|
|
23
|
+
defaultBranch: z.ZodString;
|
|
14
24
|
}, z.ZodString, "strip">, z.objectInputType<{
|
|
15
25
|
ownerName: z.ZodString;
|
|
16
26
|
repoName: z.ZodString;
|
|
17
27
|
platformName: z.ZodUnion<[z.ZodLiteral<"amd64">, z.ZodLiteral<"arm64">]>;
|
|
28
|
+
defaultBranch: z.ZodString;
|
|
18
29
|
}, z.ZodString, "strip">>;
|
|
19
30
|
templateName: z.ZodString;
|
|
20
31
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -22,6 +33,7 @@ export declare const initConfigInputSchema: z.ZodObject<{
|
|
|
22
33
|
destinationDir: string;
|
|
23
34
|
templateComplete: boolean;
|
|
24
35
|
templateData: {
|
|
36
|
+
defaultBranch: string;
|
|
25
37
|
repoName: string;
|
|
26
38
|
ownerName: string;
|
|
27
39
|
platformName: "arm64" | "amd64";
|
|
@@ -33,6 +45,7 @@ export declare const initConfigInputSchema: z.ZodObject<{
|
|
|
33
45
|
destinationDir: string;
|
|
34
46
|
templateComplete: boolean;
|
|
35
47
|
templateData: {
|
|
48
|
+
defaultBranch: string;
|
|
36
49
|
repoName: string;
|
|
37
50
|
ownerName: string;
|
|
38
51
|
platformName: "arm64" | "amd64";
|
|
@@ -48,30 +61,36 @@ declare const initConfigSchema: z.ZodObject<{
|
|
|
48
61
|
templateData: z.ZodObject<{
|
|
49
62
|
ownerName: z.ZodString;
|
|
50
63
|
repoName: z.ZodString;
|
|
64
|
+
defaultBranch: z.ZodString;
|
|
51
65
|
orgName: z.ZodString;
|
|
52
66
|
teamName: z.ZodString;
|
|
53
67
|
port: z.ZodString;
|
|
54
68
|
}, "strip", z.ZodString, z.objectOutputType<{
|
|
55
69
|
ownerName: z.ZodString;
|
|
56
70
|
repoName: z.ZodString;
|
|
71
|
+
defaultBranch: z.ZodString;
|
|
57
72
|
orgName: z.ZodString;
|
|
58
73
|
teamName: z.ZodString;
|
|
59
74
|
port: z.ZodString;
|
|
60
75
|
}, z.ZodString, "strip">, z.objectInputType<{
|
|
61
76
|
ownerName: z.ZodString;
|
|
62
77
|
repoName: z.ZodString;
|
|
78
|
+
defaultBranch: z.ZodString;
|
|
63
79
|
orgName: z.ZodString;
|
|
64
80
|
teamName: z.ZodString;
|
|
65
81
|
port: z.ZodString;
|
|
66
82
|
}, z.ZodString, "strip">>;
|
|
67
83
|
entryPoint: z.ZodOptional<z.ZodString>;
|
|
84
|
+
packageManager: z.ZodDefault<z.ZodEnum<["pnpm", "yarn"]>>;
|
|
68
85
|
type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"application">, z.ZodLiteral<"package">]>>;
|
|
69
86
|
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
packageManager: "yarn" | "pnpm";
|
|
70
88
|
templateName: string;
|
|
71
89
|
destinationDir: string;
|
|
72
90
|
templateComplete: boolean;
|
|
73
91
|
templateData: {
|
|
74
92
|
port: string;
|
|
93
|
+
defaultBranch: string;
|
|
75
94
|
orgName: string;
|
|
76
95
|
repoName: string;
|
|
77
96
|
ownerName: string;
|
|
@@ -87,6 +106,7 @@ declare const initConfigSchema: z.ZodObject<{
|
|
|
87
106
|
templateComplete: boolean;
|
|
88
107
|
templateData: {
|
|
89
108
|
port: string;
|
|
109
|
+
defaultBranch: string;
|
|
90
110
|
orgName: string;
|
|
91
111
|
repoName: string;
|
|
92
112
|
ownerName: string;
|
|
@@ -95,6 +115,7 @@ declare const initConfigSchema: z.ZodObject<{
|
|
|
95
115
|
[k: string]: string;
|
|
96
116
|
};
|
|
97
117
|
entryPoint?: string | undefined;
|
|
118
|
+
packageManager?: "yarn" | "pnpm" | undefined;
|
|
98
119
|
type?: "package" | "application" | undefined;
|
|
99
120
|
}>;
|
|
100
121
|
export {};
|
package/lib/cli/init/types.js
CHANGED
|
@@ -23,13 +23,15 @@ __export(types_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(types_exports);
|
|
24
24
|
var import_zod = require("zod");
|
|
25
25
|
var import_manifest = require("../../utils/manifest");
|
|
26
|
+
var import_packageManager = require("../../utils/packageManager");
|
|
26
27
|
const initConfigInputSchema = import_zod.z.object({
|
|
27
28
|
destinationDir: import_zod.z.string(),
|
|
28
29
|
templateComplete: import_zod.z.boolean(),
|
|
29
30
|
templateData: import_zod.z.object({
|
|
30
31
|
ownerName: import_zod.z.string(),
|
|
31
32
|
repoName: import_zod.z.string(),
|
|
32
|
-
platformName: import_zod.z.union([import_zod.z.literal("amd64"), import_zod.z.literal("arm64")])
|
|
33
|
+
platformName: import_zod.z.union([import_zod.z.literal("amd64"), import_zod.z.literal("arm64")]),
|
|
34
|
+
defaultBranch: import_zod.z.string()
|
|
33
35
|
}).catchall(import_zod.z.string()),
|
|
34
36
|
templateName: import_zod.z.string()
|
|
35
37
|
});
|
|
@@ -39,6 +41,7 @@ const initConfigSchema = initConfigInputSchema.omit({
|
|
|
39
41
|
templateData: import_zod.z.object({
|
|
40
42
|
ownerName: import_zod.z.string(),
|
|
41
43
|
repoName: import_zod.z.string(),
|
|
44
|
+
defaultBranch: import_zod.z.string(),
|
|
42
45
|
// Derived from ownerName
|
|
43
46
|
// TODO: use zod to transform `InitConfigInput` -> `InitConfig`?
|
|
44
47
|
orgName: import_zod.z.string(),
|
|
@@ -47,6 +50,7 @@ const initConfigSchema = initConfigInputSchema.omit({
|
|
|
47
50
|
port: import_zod.z.string()
|
|
48
51
|
}).catchall(import_zod.z.string()),
|
|
49
52
|
entryPoint: import_zod.z.string().optional(),
|
|
53
|
+
packageManager: import_packageManager.packageManagerSchema,
|
|
50
54
|
type: import_manifest.projectTypeSchema.optional()
|
|
51
55
|
});
|
|
52
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/types.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod';\n\nimport { projectTypeSchema } from '../../utils/manifest';\n\nexport type InitConfigInput = z.infer<typeof initConfigInputSchema>;\n\nexport const initConfigInputSchema = z.object({\n destinationDir: z.string(),\n templateComplete: z.boolean(),\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n platformName: z.union([z.literal('amd64'), z.literal('arm64')]),\n })\n .catchall(z.string()),\n templateName: z.string(),\n});\n\nexport type InitConfig = z.infer<typeof initConfigSchema>;\n\nconst initConfigSchema = initConfigInputSchema\n .omit({\n templateData: true,\n })\n .extend({\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n\n // Derived from ownerName\n // TODO: use zod to transform `InitConfigInput` -> `InitConfig`?\n orgName: z.string(),\n teamName: z.string(),\n\n // Generated by init command\n port: z.string(),\n })\n .catchall(z.string()),\n\n entryPoint: z.string().optional(),\n type: projectTypeSchema.optional(),\n });\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,sBAAkC;
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod';\n\nimport { projectTypeSchema } from '../../utils/manifest';\nimport { packageManagerSchema } from '../../utils/packageManager';\n\nexport interface Input {\n /**\n * Whether to enable verbose debug logging.\n *\n * Defaults to `false`.\n */\n debug: boolean;\n}\n\nexport type InitConfigInput = z.infer<typeof initConfigInputSchema>;\n\nexport const initConfigInputSchema = z.object({\n destinationDir: z.string(),\n templateComplete: z.boolean(),\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n platformName: z.union([z.literal('amd64'), z.literal('arm64')]),\n defaultBranch: z.string(),\n })\n .catchall(z.string()),\n templateName: z.string(),\n});\n\nexport type InitConfig = z.infer<typeof initConfigSchema>;\n\nconst initConfigSchema = initConfigInputSchema\n .omit({\n templateData: true,\n })\n .extend({\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n defaultBranch: z.string(),\n\n // Derived from ownerName\n // TODO: use zod to transform `InitConfigInput` -> `InitConfig`?\n orgName: z.string(),\n teamName: z.string(),\n\n // Generated by init command\n port: z.string(),\n })\n .catchall(z.string()),\n\n entryPoint: z.string().optional(),\n packageManager: packageManagerSchema,\n type: projectTypeSchema.optional(),\n });\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,sBAAkC;AAClC,4BAAqC;AAa9B,MAAM,wBAAwB,aAAE,OAAO;AAAA,EAC5C,gBAAgB,aAAE,OAAO;AAAA,EACzB,kBAAkB,aAAE,QAAQ;AAAA,EAC5B,cAAc,aACX,OAAO;AAAA,IACN,WAAW,aAAE,OAAO;AAAA,IACpB,UAAU,aAAE,OAAO;AAAA,IACnB,cAAc,aAAE,MAAM,CAAC,aAAE,QAAQ,OAAO,GAAG,aAAE,QAAQ,OAAO,CAAC,CAAC;AAAA,IAC9D,eAAe,aAAE,OAAO;AAAA,EAC1B,CAAC,EACA,SAAS,aAAE,OAAO,CAAC;AAAA,EACtB,cAAc,aAAE,OAAO;AACzB,CAAC;AAID,MAAM,mBAAmB,sBACtB,KAAK;AAAA,EACJ,cAAc;AAChB,CAAC,EACA,OAAO;AAAA,EACN,cAAc,aACX,OAAO;AAAA,IACN,WAAW,aAAE,OAAO;AAAA,IACpB,UAAU,aAAE,OAAO;AAAA,IACnB,eAAe,aAAE,OAAO;AAAA;AAAA;AAAA,IAIxB,SAAS,aAAE,OAAO;AAAA,IAClB,UAAU,aAAE,OAAO;AAAA;AAAA,IAGnB,MAAM,aAAE,OAAO;AAAA,EACjB,CAAC,EACA,SAAS,aAAE,OAAO,CAAC;AAAA,EAEtB,YAAY,aAAE,OAAO,EAAE,SAAS;AAAA,EAChC,gBAAgB;AAAA,EAChB,MAAM,kCAAkB,SAAS;AACnC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,6 +6,12 @@ interface WritePackageJsonProps {
|
|
|
6
6
|
type?: ProjectType;
|
|
7
7
|
version: string;
|
|
8
8
|
}
|
|
9
|
+
export interface SkubaPackageJson {
|
|
10
|
+
entryPoint: string | null;
|
|
11
|
+
template: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
9
15
|
/**
|
|
10
16
|
* Write a `skuba` section into the destination `package.json`.
|
|
11
17
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/writePackageJson.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\n\nimport type { ProjectType } from '../../utils/manifest';\nimport { getDestinationManifest } from '../configure/analysis/package';\nimport { formatPackage } from '../configure/processing/package';\n\ninterface WritePackageJsonProps {\n cwd: string;\n entryPoint?: string;\n template: string;\n type?: ProjectType;\n version: string;\n}\n\n/**\n * Write a `skuba` section into the destination `package.json`.\n */\nexport const writePackageJson = async ({\n cwd,\n entryPoint,\n template,\n type,\n version,\n}: WritePackageJsonProps) => {\n const manifest = await getDestinationManifest({ cwd });\n\n manifest.packageJson.skuba = {\n entryPoint: entryPoint ?? null,\n template,\n type,\n version,\n };\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n\n await fs.promises.writeFile(manifest.path, updatedPackageJson);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AAGf,qBAAuC;AACvC,IAAAA,kBAA8B;
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\n\nimport type { ProjectType } from '../../utils/manifest';\nimport { getDestinationManifest } from '../configure/analysis/package';\nimport { formatPackage } from '../configure/processing/package';\n\ninterface WritePackageJsonProps {\n cwd: string;\n entryPoint?: string;\n template: string;\n type?: ProjectType;\n version: string;\n}\n\nexport interface SkubaPackageJson {\n entryPoint: string | null;\n template: string;\n type?: string;\n version: string;\n}\n\n/**\n * Write a `skuba` section into the destination `package.json`.\n */\nexport const writePackageJson = async ({\n cwd,\n entryPoint,\n template,\n type,\n version,\n}: WritePackageJsonProps) => {\n const manifest = await getDestinationManifest({ cwd });\n\n manifest.packageJson.skuba = {\n entryPoint: entryPoint ?? null,\n template,\n type,\n version,\n } satisfies SkubaPackageJson;\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n\n await fs.promises.writeFile(manifest.path, updatedPackageJson);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AAGf,qBAAuC;AACvC,IAAAA,kBAA8B;AAoBvB,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA6B;AAC3B,QAAM,WAAW,UAAM,uCAAuB,EAAE,IAAI,CAAC;AAErD,WAAS,YAAY,QAAQ;AAAA,IAC3B,YAAY,cAAc;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAAqB,UAAM,+BAAc,SAAS,WAAW;AAEnE,QAAM,gBAAAC,QAAG,SAAS,UAAU,SAAS,MAAM,kBAAkB;AAC/D;",
|
|
6
6
|
"names": ["import_package", "fs"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ESLintOutput } from '../../../adapter/eslint';
|
|
2
2
|
import type { PrettierOutput } from '../../../adapter/prettier';
|
|
3
3
|
import type { StreamInterceptor } from '../../../lint/external';
|
|
4
|
-
|
|
4
|
+
import type { InternalLintResult } from '../../internal';
|
|
5
|
+
export declare const createBuildkiteAnnotations: (internal: InternalLintResult, eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
@@ -33,20 +33,22 @@ __export(buildkite_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(buildkite_exports);
|
|
34
34
|
var Buildkite = __toESM(require("../../../../api/buildkite"));
|
|
35
35
|
var import_eslint = require("./eslint");
|
|
36
|
+
var import_internal = require("./internal");
|
|
36
37
|
var import_prettier = require("./prettier");
|
|
37
38
|
var import_tsc = require("./tsc");
|
|
38
|
-
const createBuildkiteAnnotations = async (eslint, prettier, tscOk, tscOutputStream) => {
|
|
39
|
-
if (eslint.ok && prettier.ok && tscOk) {
|
|
39
|
+
const createBuildkiteAnnotations = async (internal, eslint, prettier, tscOk, tscOutputStream) => {
|
|
40
|
+
if (internal.ok && eslint.ok && prettier.ok && tscOk) {
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
const buildkiteOutput = [
|
|
43
44
|
"`skuba lint` found issues that require triage:",
|
|
45
|
+
...(0, import_internal.createInternalAnnotations)(internal),
|
|
44
46
|
...(0, import_eslint.createEslintAnnotations)(eslint),
|
|
45
47
|
...(0, import_prettier.createPrettierAnnotations)(prettier),
|
|
46
48
|
...(0, import_tsc.createTscAnnotations)(tscOk, tscOutputStream)
|
|
47
49
|
].join("\n\n");
|
|
48
50
|
await Buildkite.annotate(buildkiteOutput, {
|
|
49
|
-
context: "skuba-lint
|
|
51
|
+
context: "skuba-lint",
|
|
50
52
|
scopeContextToStep: true,
|
|
51
53
|
style: "error"
|
|
52
54
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/lint/annotate/buildkite/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { ESLintOutput } from '../../../adapter/eslint';\nimport type { PrettierOutput } from '../../../adapter/prettier';\nimport type { StreamInterceptor } from '../../../lint/external';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createBuildkiteAnnotations = async (\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n if (eslint.ok && prettier.ok && tscOk) {\n return;\n }\n\n const buildkiteOutput = [\n '`skuba lint` found issues that require triage:',\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ].join('\\n\\n');\n\n await Buildkite.annotate(buildkiteOutput, {\n context: 'skuba-lint
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;
|
|
4
|
+
"sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { ESLintOutput } from '../../../adapter/eslint';\nimport type { PrettierOutput } from '../../../adapter/prettier';\nimport type { StreamInterceptor } from '../../../lint/external';\nimport type { InternalLintResult } from '../../internal';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createInternalAnnotations } from './internal';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createBuildkiteAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n if (internal.ok && eslint.ok && prettier.ok && tscOk) {\n return;\n }\n\n const buildkiteOutput = [\n '`skuba lint` found issues that require triage:',\n ...createInternalAnnotations(internal),\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ].join('\\n\\n');\n\n await Buildkite.annotate(buildkiteOutput, {\n context: 'skuba-lint',\n scopeContextToStep: true,\n style: 'error',\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAM3B,oBAAwC;AACxC,sBAA0C;AAC1C,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,6BAA6B,OACxC,UACA,QACA,UACA,OACA,oBACkB;AAClB,MAAI,SAAS,MAAM,OAAO,MAAM,SAAS,MAAM,OAAO;AACpD;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD,EAAE,KAAK,MAAM;AAEb,QAAM,UAAU,SAAS,iBAAiB;AAAA,IACxC,SAAS;AAAA,IACT,oBAAoB;AAAA,IACpB,OAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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 internal_exports = {};
|
|
30
|
+
__export(internal_exports, {
|
|
31
|
+
createInternalAnnotations: () => createInternalAnnotations
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(internal_exports);
|
|
34
|
+
var Buildkite = __toESM(require("../../../../api/buildkite"));
|
|
35
|
+
const createInternalAnnotations = (internal) => !internal.ok && internal.annotations?.length ? [
|
|
36
|
+
"**skuba**",
|
|
37
|
+
Buildkite.md.terminal(
|
|
38
|
+
internal.annotations.map(({ message, path }) => `${path} ${message}`).join("\n")
|
|
39
|
+
)
|
|
40
|
+
] : [];
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
createInternalAnnotations
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/cli/lint/annotate/buildkite/internal.ts"],
|
|
4
|
+
"sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { InternalLintResult } from '../../internal';\n\nexport const createInternalAnnotations = (\n internal: InternalLintResult,\n): string[] =>\n !internal.ok && internal.annotations?.length\n ? [\n '**skuba**',\n Buildkite.md.terminal(\n internal.annotations\n .map(({ message, path }) => `${path} ${message}`)\n .join('\\n'),\n ),\n ]\n : [];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,4BAA4B,CACvC,aAEA,CAAC,SAAS,MAAM,SAAS,aAAa,SAClC;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,SAAS,YACN,IAAI,CAAC,EAAE,SAAS,KAAK,MAAM,GAAG,IAAI,IAAI,OAAO,EAAE,EAC/C,KAAK,IAAI;AAAA,EACd;AACF,IACA,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ESLintOutput } from '../../../adapter/eslint';
|
|
2
2
|
import type { PrettierOutput } from '../../../adapter/prettier';
|
|
3
3
|
import type { StreamInterceptor } from '../../../lint/external';
|
|
4
|
-
|
|
4
|
+
import type { InternalLintResult } from '../../internal';
|
|
5
|
+
export declare const createGitHubAnnotations: (internal: InternalLintResult, eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
@@ -34,18 +34,20 @@ module.exports = __toCommonJS(github_exports);
|
|
|
34
34
|
var GitHub = __toESM(require("../../../../api/github"));
|
|
35
35
|
var import_environment = require("../../../../api/github/environment");
|
|
36
36
|
var import_eslint = require("./eslint");
|
|
37
|
+
var import_internal = require("./internal");
|
|
37
38
|
var import_prettier = require("./prettier");
|
|
38
39
|
var import_tsc = require("./tsc");
|
|
39
|
-
const createGitHubAnnotations = async (eslint, prettier, tscOk, tscOutputStream) => {
|
|
40
|
+
const createGitHubAnnotations = async (internal, eslint, prettier, tscOk, tscOutputStream) => {
|
|
40
41
|
if (!(0, import_environment.enabledFromEnvironment)()) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
const annotations = [
|
|
45
|
+
...(0, import_internal.createInternalAnnotations)(internal),
|
|
44
46
|
...(0, import_eslint.createEslintAnnotations)(eslint),
|
|
45
47
|
...(0, import_prettier.createPrettierAnnotations)(prettier),
|
|
46
48
|
...(0, import_tsc.createTscAnnotations)(tscOk, tscOutputStream)
|
|
47
49
|
];
|
|
48
|
-
const isOk = eslint.ok && prettier.ok && tscOk;
|
|
50
|
+
const isOk = eslint.ok && prettier.ok && internal.ok && tscOk;
|
|
49
51
|
const summary = isOk ? "`skuba lint` passed." : "`skuba lint` found issues that require triage.";
|
|
50
52
|
const build = (0, import_environment.buildNameFromEnvironment)();
|
|
51
53
|
await GitHub.createCheckRun({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/lint/annotate/github/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as GitHub from '../../../../api/github';\nimport {\n buildNameFromEnvironment,\n enabledFromEnvironment,\n} from '../../../../api/github/environment';\nimport type { ESLintOutput } from '../../../adapter/eslint';\nimport type { PrettierOutput } from '../../../adapter/prettier';\nimport type { StreamInterceptor } from '../../../lint/external';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createGitHubAnnotations = async (\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n) => {\n if (!enabledFromEnvironment()) {\n return;\n }\n\n const annotations: GitHub.Annotation[] = [\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ];\n\n const isOk = eslint.ok && prettier.ok && tscOk;\n\n const summary = isOk\n ? '`skuba lint` passed.'\n : '`skuba lint` found issues that require triage.';\n\n const build = buildNameFromEnvironment();\n\n await GitHub.createCheckRun({\n name: 'skuba/lint',\n summary,\n annotations,\n conclusion: isOk ? 'success' : 'failure',\n title: `${build} ${isOk ? 'passed' : 'failed'}`,\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,yBAGO;
|
|
4
|
+
"sourcesContent": ["import * as GitHub from '../../../../api/github';\nimport {\n buildNameFromEnvironment,\n enabledFromEnvironment,\n} from '../../../../api/github/environment';\nimport type { ESLintOutput } from '../../../adapter/eslint';\nimport type { PrettierOutput } from '../../../adapter/prettier';\nimport type { StreamInterceptor } from '../../../lint/external';\nimport type { InternalLintResult } from '../../internal';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createInternalAnnotations } from './internal';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createGitHubAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n) => {\n if (!enabledFromEnvironment()) {\n return;\n }\n\n const annotations: GitHub.Annotation[] = [\n ...createInternalAnnotations(internal),\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ];\n\n const isOk = eslint.ok && prettier.ok && internal.ok && tscOk;\n\n const summary = isOk\n ? '`skuba lint` passed.'\n : '`skuba lint` found issues that require triage.';\n\n const build = buildNameFromEnvironment();\n\n await GitHub.createCheckRun({\n name: 'skuba/lint',\n summary,\n annotations,\n conclusion: isOk ? 'success' : 'failure',\n title: `${build} ${isOk ? 'passed' : 'failed'}`,\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,yBAGO;AAMP,oBAAwC;AACxC,sBAA0C;AAC1C,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,0BAA0B,OACrC,UACA,QACA,UACA,OACA,oBACG;AACH,MAAI,KAAC,2CAAuB,GAAG;AAC7B;AAAA,EACF;AAEA,QAAM,cAAmC;AAAA,IACvC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD;AAEA,QAAM,OAAO,OAAO,MAAM,SAAS,MAAM,SAAS,MAAM;AAExD,QAAM,UAAU,OACZ,yBACA;AAEJ,QAAM,YAAQ,6CAAyB;AAEvC,QAAM,OAAO,eAAe;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,YAAY,OAAO,YAAY;AAAA,IAC/B,OAAO,GAAG,KAAK,IAAI,OAAO,WAAW,QAAQ;AAAA,EAC/C,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var internal_exports = {};
|
|
20
|
+
__export(internal_exports, {
|
|
21
|
+
createInternalAnnotations: () => createInternalAnnotations
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(internal_exports);
|
|
24
|
+
const createInternalAnnotations = (internal) => (internal.annotations ?? []).map((annotation) => ({
|
|
25
|
+
annotation_level: "failure",
|
|
26
|
+
start_line: annotation.start_line ?? 1,
|
|
27
|
+
end_line: annotation.end_line ?? annotation.start_line ?? 1,
|
|
28
|
+
path: annotation.path,
|
|
29
|
+
message: annotation.message,
|
|
30
|
+
title: "skuba lint"
|
|
31
|
+
}));
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
createInternalAnnotations
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/cli/lint/annotate/github/internal.ts"],
|
|
4
|
+
"sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { InternalLintResult } from '../../internal';\n\nexport const createInternalAnnotations = (\n internal: InternalLintResult,\n): GitHub.Annotation[] =>\n (internal.annotations ?? []).map((annotation) => ({\n annotation_level: 'failure',\n start_line: annotation.start_line ?? 1,\n end_line: annotation.end_line ?? annotation.start_line ?? 1,\n path: annotation.path,\n message: annotation.message,\n title: 'skuba lint',\n }));\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,4BAA4B,CACvC,cAEC,SAAS,eAAe,CAAC,GAAG,IAAI,CAAC,gBAAgB;AAAA,EAChD,kBAAkB;AAAA,EAClB,YAAY,WAAW,cAAc;AAAA,EACrC,UAAU,WAAW,YAAY,WAAW,cAAc;AAAA,EAC1D,MAAM,WAAW;AAAA,EACjB,SAAS,WAAW;AAAA,EACpB,OAAO;AACT,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { ESLintOutput } from '../../../cli/adapter/eslint';
|
|
2
|
+
import type { PrettierOutput } from '../../../cli/adapter/prettier';
|
|
1
3
|
import type { StreamInterceptor } from '../external';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare const createAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
4
|
+
import type { InternalLintResult } from '../internal';
|
|
5
|
+
export declare const createAnnotations: (internal: InternalLintResult, eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
@@ -23,10 +23,16 @@ __export(annotate_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(annotate_exports);
|
|
24
24
|
var import_buildkite = require("./buildkite");
|
|
25
25
|
var import_github = require("./github");
|
|
26
|
-
const createAnnotations = async (eslint, prettier, tscOk, tscOutputStream) => {
|
|
26
|
+
const createAnnotations = async (internal, eslint, prettier, tscOk, tscOutputStream) => {
|
|
27
27
|
await Promise.all([
|
|
28
|
-
(0, import_github.createGitHubAnnotations)(eslint, prettier, tscOk, tscOutputStream),
|
|
29
|
-
(0, import_buildkite.createBuildkiteAnnotations)(
|
|
28
|
+
(0, import_github.createGitHubAnnotations)(internal, eslint, prettier, tscOk, tscOutputStream),
|
|
29
|
+
(0, import_buildkite.createBuildkiteAnnotations)(
|
|
30
|
+
internal,
|
|
31
|
+
eslint,
|
|
32
|
+
prettier,
|
|
33
|
+
tscOk,
|
|
34
|
+
tscOutputStream
|
|
35
|
+
)
|
|
30
36
|
]);
|
|
31
37
|
};
|
|
32
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/lint/annotate/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import type { ESLintOutput } from '../../../cli/adapter/eslint';\nimport type { PrettierOutput } from '../../../cli/adapter/prettier';\nimport type { StreamInterceptor } from '../external';\nimport type { InternalLintResult } from '../internal';\n\nimport { createBuildkiteAnnotations } from './buildkite';\nimport { createGitHubAnnotations } from './github';\n\nexport const createAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n await Promise.all([\n createGitHubAnnotations(internal, eslint, prettier, tscOk, tscOutputStream),\n createBuildkiteAnnotations(\n internal,\n eslint,\n prettier,\n tscOk,\n tscOutputStream,\n ),\n ]);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,uBAA2C;AAC3C,oBAAwC;AAEjC,MAAM,oBAAoB,OAC/B,UACA,QACA,UACA,OACA,oBACkB;AAClB,QAAM,QAAQ,IAAI;AAAA,QAChB,uCAAwB,UAAU,QAAQ,UAAU,OAAO,eAAe;AAAA,QAC1E;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as Git from '../../api/git';
|
|
2
2
|
import type { Input } from './types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const AUTOFIX_IGNORE_FILES_BASE: Git.ChangedFile[];
|
|
4
|
+
export declare const AUTOFIX_IGNORE_FILES_NPMRC: Git.ChangedFile[];
|
|
4
5
|
interface AutofixParameters {
|
|
5
6
|
debug: Input['debug'];
|
|
6
7
|
eslint: boolean;
|
|
7
8
|
prettier: boolean;
|
|
9
|
+
internal: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare const autofix: (params: AutofixParameters) => Promise<void>;
|
|
10
12
|
export {};
|