@cbnventures/nova 0.14.0 → 0.15.0
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 +48 -0
- package/bin/nova.mjs +3 -0
- package/build/package.json +33 -23
- package/build/src/api/node-releases.d.ts +4 -4
- package/build/src/api/node-releases.d.ts.map +1 -1
- package/build/src/api/node-releases.js +31 -26
- package/build/src/api/node-releases.js.map +1 -1
- package/build/src/api/spdx-licenses.d.ts +4 -4
- package/build/src/api/spdx-licenses.d.ts.map +1 -1
- package/build/src/api/spdx-licenses.js +21 -18
- package/build/src/api/spdx-licenses.js.map +1 -1
- package/build/src/cli/generate/github/funding.d.ts +5 -0
- package/build/src/cli/generate/github/funding.d.ts.map +1 -0
- package/build/src/cli/generate/github/funding.js +68 -0
- package/build/src/cli/generate/github/funding.js.map +1 -0
- package/build/src/cli/generate/github/issue-template.d.ts +5 -0
- package/build/src/cli/generate/github/issue-template.d.ts.map +1 -0
- package/build/src/cli/generate/github/issue-template.js +267 -0
- package/build/src/cli/generate/github/issue-template.js.map +1 -0
- package/build/src/cli/generate/github/workflows.d.ts +10 -0
- package/build/src/cli/generate/github/workflows.d.ts.map +1 -0
- package/build/src/cli/generate/github/workflows.js +464 -0
- package/build/src/cli/generate/github/workflows.js.map +1 -0
- package/build/src/cli/generate/must-haves/agent-conventions.d.ts +5 -0
- package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -0
- package/build/src/cli/generate/must-haves/agent-conventions.js +114 -0
- package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -0
- package/build/src/cli/generate/must-haves/dotenv.d.ts +12 -0
- package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -0
- package/build/src/cli/generate/must-haves/dotenv.js +504 -0
- package/build/src/cli/generate/must-haves/dotenv.js.map +1 -0
- package/build/src/cli/generate/must-haves/editorconfig.d.ts +5 -0
- package/build/src/cli/generate/must-haves/editorconfig.d.ts.map +1 -0
- package/build/src/cli/generate/must-haves/editorconfig.js +37 -0
- package/build/src/cli/generate/must-haves/editorconfig.js.map +1 -0
- package/build/src/cli/generate/must-haves/gitignore.d.ts +13 -0
- package/build/src/cli/generate/must-haves/gitignore.d.ts.map +1 -0
- package/build/src/cli/generate/must-haves/gitignore.js +446 -0
- package/build/src/cli/generate/must-haves/gitignore.js.map +1 -0
- package/build/src/cli/generate/must-haves/license.d.ts +5 -0
- package/build/src/cli/generate/must-haves/license.d.ts.map +1 -0
- package/build/src/cli/generate/must-haves/license.js +131 -0
- package/build/src/cli/generate/must-haves/license.js.map +1 -0
- package/build/src/cli/generate/must-haves/read-me.d.ts +8 -0
- package/build/src/cli/generate/must-haves/read-me.d.ts.map +1 -0
- package/build/src/cli/generate/must-haves/read-me.js +255 -0
- package/build/src/cli/generate/must-haves/read-me.js.map +1 -0
- package/build/src/cli/index.js +298 -100
- package/build/src/cli/index.js.map +1 -1
- package/build/src/cli/recipe/index.d.ts +2 -2
- package/build/src/cli/recipe/index.d.ts.map +1 -1
- package/build/src/cli/recipe/index.js +19 -19
- package/build/src/cli/recipe/index.js.map +1 -1
- package/build/src/cli/recipe/package-json/cleanup.d.ts +3 -3
- package/build/src/cli/recipe/package-json/cleanup.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/cleanup.js +59 -50
- package/build/src/cli/recipe/package-json/cleanup.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-artifacts.d.ts +3 -3
- package/build/src/cli/recipe/package-json/normalize-artifacts.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-artifacts.js +120 -112
- package/build/src/cli/recipe/package-json/normalize-artifacts.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-bundler.d.ts +3 -3
- package/build/src/cli/recipe/package-json/normalize-bundler.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-bundler.js +36 -35
- package/build/src/cli/recipe/package-json/normalize-bundler.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-dependencies.d.ts +3 -3
- package/build/src/cli/recipe/package-json/normalize-dependencies.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-dependencies.js +70 -64
- package/build/src/cli/recipe/package-json/normalize-dependencies.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-modules.d.ts +3 -3
- package/build/src/cli/recipe/package-json/normalize-modules.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-modules.js +156 -142
- package/build/src/cli/recipe/package-json/normalize-modules.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-tooling.d.ts +3 -3
- package/build/src/cli/recipe/package-json/normalize-tooling.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-tooling.js +52 -57
- package/build/src/cli/recipe/package-json/normalize-tooling.js.map +1 -1
- package/build/src/cli/recipe/package-json/sync-environment.d.ts +3 -3
- package/build/src/cli/recipe/package-json/sync-environment.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/sync-environment.js +94 -97
- package/build/src/cli/recipe/package-json/sync-environment.js.map +1 -1
- package/build/src/cli/recipe/package-json/sync-identity.d.ts +3 -3
- package/build/src/cli/recipe/package-json/sync-identity.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/sync-identity.js +67 -62
- package/build/src/cli/recipe/package-json/sync-identity.js.map +1 -1
- package/build/src/cli/recipe/package-json/sync-ownership.d.ts +3 -3
- package/build/src/cli/recipe/package-json/sync-ownership.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/sync-ownership.js +106 -106
- package/build/src/cli/recipe/package-json/sync-ownership.js.map +1 -1
- package/build/src/cli/scaffold/app/expressjs.d.ts +5 -0
- package/build/src/cli/scaffold/app/expressjs.d.ts.map +1 -0
- package/build/src/cli/scaffold/app/expressjs.js +8 -0
- package/build/src/cli/scaffold/app/expressjs.js.map +1 -0
- package/build/src/cli/scaffold/app/nextjs.d.ts +5 -0
- package/build/src/cli/scaffold/app/nextjs.d.ts.map +1 -0
- package/build/src/cli/scaffold/app/nextjs.js +8 -0
- package/build/src/cli/scaffold/app/nextjs.js.map +1 -0
- package/build/src/cli/scaffold/app/vite.d.ts +5 -0
- package/build/src/cli/scaffold/app/vite.d.ts.map +1 -0
- package/build/src/cli/scaffold/app/vite.js +8 -0
- package/build/src/cli/scaffold/app/vite.js.map +1 -0
- package/build/src/cli/scaffold/app/workers.d.ts +5 -0
- package/build/src/cli/scaffold/app/workers.d.ts.map +1 -0
- package/build/src/cli/scaffold/app/workers.js +8 -0
- package/build/src/cli/scaffold/app/workers.js.map +1 -0
- package/build/src/cli/scaffold/docs/docusaurus.d.ts +5 -0
- package/build/src/cli/scaffold/docs/docusaurus.d.ts.map +1 -0
- package/build/src/cli/scaffold/docs/docusaurus.js +8 -0
- package/build/src/cli/scaffold/docs/docusaurus.js.map +1 -0
- package/build/src/cli/scaffold/starter/base.d.ts +5 -0
- package/build/src/cli/scaffold/starter/base.d.ts.map +1 -0
- package/build/src/cli/scaffold/starter/base.js +132 -0
- package/build/src/cli/scaffold/starter/base.js.map +1 -0
- package/build/src/cli/utility/changelog.d.ts +3 -3
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +206 -172
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/initialize.d.ts +6 -3
- package/build/src/cli/utility/initialize.d.ts.map +1 -1
- package/build/src/cli/utility/initialize.js +990 -265
- package/build/src/cli/utility/initialize.js.map +1 -1
- package/build/src/cli/utility/run-recipes.d.ts +3 -3
- package/build/src/cli/utility/run-recipes.d.ts.map +1 -1
- package/build/src/cli/utility/run-recipes.js +15 -14
- package/build/src/cli/utility/run-recipes.js.map +1 -1
- package/build/src/cli/utility/run-scripts.d.ts +4 -4
- package/build/src/cli/utility/run-scripts.d.ts.map +1 -1
- package/build/src/cli/utility/run-scripts.js +167 -70
- package/build/src/cli/utility/run-scripts.js.map +1 -1
- package/build/src/cli/utility/transpile.d.ts +3 -3
- package/build/src/cli/utility/transpile.d.ts.map +1 -1
- package/build/src/cli/utility/transpile.js +24 -19
- package/build/src/cli/utility/transpile.js.map +1 -1
- package/build/src/cli/utility/type-check.d.ts +3 -3
- package/build/src/cli/utility/type-check.d.ts.map +1 -1
- package/build/src/cli/utility/type-check.js +24 -19
- package/build/src/cli/utility/type-check.js.map +1 -1
- package/build/src/cli/utility/version.d.ts +3 -3
- package/build/src/cli/utility/version.d.ts.map +1 -1
- package/build/src/cli/utility/version.js +126 -68
- package/build/src/cli/utility/version.js.map +1 -1
- package/build/src/lib/item.d.ts +31 -29
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +106 -43
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/nova-config.d.ts +6 -5
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +217 -59
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/regex.d.ts +92 -26
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +92 -26
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/scaffold.d.ts +10 -0
- package/build/src/lib/scaffold.d.ts.map +1 -0
- package/build/src/lib/scaffold.js +535 -0
- package/build/src/lib/scaffold.js.map +1 -0
- package/build/src/lib/schema.d.ts +2 -9
- package/build/src/lib/schema.d.ts.map +1 -1
- package/build/src/lib/schema.js +6 -8
- package/build/src/lib/schema.js.map +1 -1
- package/build/src/lib/utility.d.ts +21 -18
- package/build/src/lib/utility.d.ts.map +1 -1
- package/build/src/lib/utility.js +173 -79
- package/build/src/lib/utility.js.map +1 -1
- package/build/src/lib/workflow-templates.d.ts +3 -0
- package/build/src/lib/workflow-templates.d.ts.map +1 -0
- package/build/src/lib/workflow-templates.js +187 -0
- package/build/src/lib/workflow-templates.js.map +1 -0
- package/build/src/presets/eslint/dx-code-style.d.ts +4 -0
- package/build/src/presets/eslint/dx-code-style.d.ts.map +1 -0
- package/build/src/presets/eslint/dx-code-style.js +523 -0
- package/build/src/presets/eslint/dx-code-style.js.map +1 -0
- package/build/src/presets/eslint/dx-ignore.d.ts +4 -0
- package/build/src/presets/eslint/dx-ignore.d.ts.map +1 -0
- package/build/src/presets/eslint/{dx-ignore.mjs → dx-ignore.js} +1 -1
- package/build/src/presets/eslint/dx-ignore.js.map +1 -0
- package/build/src/presets/eslint/fw-docusaurus.d.ts +4 -0
- package/build/src/presets/eslint/fw-docusaurus.d.ts.map +1 -0
- package/build/src/presets/eslint/fw-docusaurus.js +6 -0
- package/build/src/presets/eslint/fw-docusaurus.js.map +1 -0
- package/build/src/presets/eslint/fw-expressjs.d.ts +4 -0
- package/build/src/presets/eslint/fw-expressjs.d.ts.map +1 -0
- package/build/src/presets/eslint/{fw-expressjs.mjs → fw-expressjs.js} +3 -5
- package/build/src/presets/eslint/fw-expressjs.js.map +1 -0
- package/build/src/presets/eslint/fw-nextjs.d.ts +4 -0
- package/build/src/presets/eslint/fw-nextjs.d.ts.map +1 -0
- package/build/src/presets/eslint/{fw-nextjs.mjs → fw-nextjs.js} +3 -5
- package/build/src/presets/eslint/fw-nextjs.js.map +1 -0
- package/build/src/presets/eslint/index.d.ts +16 -0
- package/build/src/presets/eslint/index.d.ts.map +1 -0
- package/build/src/presets/eslint/index.js +16 -0
- package/build/src/presets/eslint/index.js.map +1 -0
- package/build/src/presets/eslint/lang-javascript.d.ts +4 -0
- package/build/src/presets/eslint/lang-javascript.d.ts.map +1 -0
- package/build/src/presets/eslint/lang-javascript.js +34 -0
- package/build/src/presets/eslint/lang-javascript.js.map +1 -0
- package/build/src/presets/eslint/lang-mdx.d.ts +4 -0
- package/build/src/presets/eslint/lang-mdx.d.ts.map +1 -0
- package/build/src/presets/eslint/{lang-mdx.mjs → lang-mdx.js} +4 -8
- package/build/src/presets/eslint/lang-mdx.js.map +1 -0
- package/build/src/presets/eslint/lang-typescript.d.ts +4 -0
- package/build/src/presets/eslint/lang-typescript.d.ts.map +1 -0
- package/build/src/presets/eslint/lang-typescript.js +148 -0
- package/build/src/presets/eslint/lang-typescript.js.map +1 -0
- package/build/src/presets/eslint/runtime-browser.d.ts +4 -0
- package/build/src/presets/eslint/runtime-browser.d.ts.map +1 -0
- package/build/src/presets/eslint/{env-web-worker.mjs → runtime-browser.js} +1 -1
- package/build/src/presets/eslint/runtime-browser.js.map +1 -0
- package/build/src/presets/eslint/runtime-cloudflare-workers.d.ts +4 -0
- package/build/src/presets/eslint/runtime-cloudflare-workers.d.ts.map +1 -0
- package/build/src/presets/eslint/runtime-cloudflare-workers.js +6 -0
- package/build/src/presets/eslint/runtime-cloudflare-workers.js.map +1 -0
- package/build/src/presets/eslint/runtime-edge.d.ts +4 -0
- package/build/src/presets/eslint/runtime-edge.d.ts.map +1 -0
- package/build/src/presets/eslint/{env-edge.mjs → runtime-edge.js} +1 -1
- package/build/src/presets/eslint/runtime-edge.js.map +1 -0
- package/build/src/presets/eslint/runtime-node.d.ts +4 -0
- package/build/src/presets/eslint/runtime-node.d.ts.map +1 -0
- package/build/src/presets/eslint/{env-node.mjs → runtime-node.js} +4 -4
- package/build/src/presets/eslint/runtime-node.js.map +1 -0
- package/build/src/presets/eslint/runtime-service-worker.d.ts +4 -0
- package/build/src/presets/eslint/runtime-service-worker.d.ts.map +1 -0
- package/build/src/presets/eslint/runtime-service-worker.js +3 -0
- package/build/src/presets/eslint/runtime-service-worker.js.map +1 -0
- package/build/src/presets/eslint/runtime-web-worker.d.ts +4 -0
- package/build/src/presets/eslint/runtime-web-worker.d.ts.map +1 -0
- package/build/src/presets/eslint/runtime-web-worker.js +3 -0
- package/build/src/presets/eslint/runtime-web-worker.js.map +1 -0
- package/build/src/presets/eslint/tool-vite.d.ts +4 -0
- package/build/src/presets/eslint/tool-vite.d.ts.map +1 -0
- package/build/src/presets/eslint/{tool-vite.mjs → tool-vite.js} +3 -5
- package/build/src/presets/eslint/tool-vite.js.map +1 -0
- package/build/src/presets/tsconfig/dx-strict.json +1 -0
- package/build/src/presets/tsconfig/runtime-cloudflare-workers.json +12 -0
- package/build/src/presets/tsconfig/{platform-cloudflare-workers.json → runtime-web-worker.json} +2 -2
- package/build/src/rules/eslint/conventions/no-default-export-declaration.d.ts +11 -0
- package/build/src/rules/eslint/conventions/no-default-export-declaration.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/no-default-export-declaration.js +73 -0
- package/build/src/rules/eslint/conventions/no-default-export-declaration.js.map +1 -0
- package/build/src/rules/eslint/conventions/no-implicit-boolean.d.ts +15 -0
- package/build/src/rules/eslint/conventions/no-implicit-boolean.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/no-implicit-boolean.js +140 -0
- package/build/src/rules/eslint/conventions/no-implicit-boolean.js.map +1 -0
- package/build/src/rules/eslint/conventions/require-explicit-return.d.ts +15 -0
- package/build/src/rules/eslint/conventions/require-explicit-return.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/require-explicit-return.js +184 -0
- package/build/src/rules/eslint/conventions/require-explicit-return.js.map +1 -0
- package/build/src/rules/eslint/conventions/require-hash-private.d.ts +12 -0
- package/build/src/rules/eslint/conventions/require-hash-private.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/require-hash-private.js +67 -0
- package/build/src/rules/eslint/conventions/require-hash-private.js.map +1 -0
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.d.ts +14 -0
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.js +95 -0
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.js.map +1 -0
- package/build/src/rules/eslint/conventions/require-naming-convention.d.ts +34 -0
- package/build/src/rules/eslint/conventions/require-naming-convention.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/require-naming-convention.js +382 -0
- package/build/src/rules/eslint/conventions/require-naming-convention.js.map +1 -0
- package/build/src/rules/eslint/conventions/require-undefined-init.d.ts +11 -0
- package/build/src/rules/eslint/conventions/require-undefined-init.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/require-undefined-init.js +71 -0
- package/build/src/rules/eslint/conventions/require-undefined-init.js.map +1 -0
- package/build/src/rules/eslint/conventions/switch-case-blocks.d.ts +13 -0
- package/build/src/rules/eslint/conventions/switch-case-blocks.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/switch-case-blocks.js +82 -0
- package/build/src/rules/eslint/conventions/switch-case-blocks.js.map +1 -0
- package/build/src/rules/eslint/formatting/no-complex-arrow-concise.d.ts +15 -0
- package/build/src/rules/eslint/formatting/no-complex-arrow-concise.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/no-complex-arrow-concise.js +166 -0
- package/build/src/rules/eslint/formatting/no-complex-arrow-concise.js.map +1 -0
- package/build/src/rules/eslint/formatting/no-multiline-strings.d.ts +15 -0
- package/build/src/rules/eslint/formatting/no-multiline-strings.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/no-multiline-strings.js +162 -0
- package/build/src/rules/eslint/formatting/no-multiline-strings.js.map +1 -0
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.d.ts +9 -4
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.d.ts.map +1 -1
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.js +53 -30
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.js.map +1 -1
- package/build/src/rules/eslint/formatting/no-ternary-in-template-literal.d.ts +11 -0
- package/build/src/rules/eslint/formatting/no-ternary-in-template-literal.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/no-ternary-in-template-literal.js +55 -0
- package/build/src/rules/eslint/formatting/no-ternary-in-template-literal.js.map +1 -0
- package/build/src/rules/eslint/formatting/require-import-order.d.ts +14 -0
- package/build/src/rules/eslint/formatting/require-import-order.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/require-import-order.js +187 -0
- package/build/src/rules/eslint/formatting/require-import-order.js.map +1 -0
- package/build/src/rules/eslint/formatting/require-multiline-condition-groups.d.ts +13 -0
- package/build/src/rules/eslint/formatting/require-multiline-condition-groups.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/require-multiline-condition-groups.js +138 -0
- package/build/src/rules/eslint/formatting/require-multiline-condition-groups.js.map +1 -0
- package/build/src/rules/eslint/formatting/require-multiline-conditions.d.ts +13 -0
- package/build/src/rules/eslint/formatting/require-multiline-conditions.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/require-multiline-conditions.js +94 -0
- package/build/src/rules/eslint/formatting/require-multiline-conditions.js.map +1 -0
- package/build/src/rules/eslint/formatting/require-padding-lines.d.ts +23 -11
- package/build/src/rules/eslint/formatting/require-padding-lines.d.ts.map +1 -1
- package/build/src/rules/eslint/formatting/require-padding-lines.js +291 -155
- package/build/src/rules/eslint/formatting/require-padding-lines.js.map +1 -1
- package/build/src/rules/eslint/formatting/require-ternary-parens.d.ts +11 -0
- package/build/src/rules/eslint/formatting/require-ternary-parens.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/require-ternary-parens.js +76 -0
- package/build/src/rules/eslint/formatting/require-ternary-parens.js.map +1 -0
- package/build/src/rules/eslint/index.d.ts +44 -14
- package/build/src/rules/eslint/index.d.ts.map +1 -1
- package/build/src/rules/eslint/index.js +44 -14
- package/build/src/rules/eslint/index.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.d.ts +15 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.js +176 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +26 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js +495 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.d.ts +12 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js +144 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts +12 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js +97 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-private.d.ts +11 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-private.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-private.js +90 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-private.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts +11 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js +88 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js.map +1 -0
- package/build/src/rules/eslint/nova/no-logger-dev.d.ts +11 -4
- package/build/src/rules/eslint/nova/no-logger-dev.d.ts.map +1 -1
- package/build/src/rules/eslint/nova/no-logger-dev.js +104 -82
- package/build/src/rules/eslint/nova/no-logger-dev.js.map +1 -1
- package/build/src/rules/eslint/patterns/no-assign-then-return.d.ts +9 -4
- package/build/src/rules/eslint/patterns/no-assign-then-return.d.ts.map +1 -1
- package/build/src/rules/eslint/patterns/no-assign-then-return.js +92 -51
- package/build/src/rules/eslint/patterns/no-assign-then-return.js.map +1 -1
- package/build/src/rules/eslint/patterns/no-await-in-loop.d.ts +17 -0
- package/build/src/rules/eslint/patterns/no-await-in-loop.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-await-in-loop.js +103 -0
- package/build/src/rules/eslint/patterns/no-await-in-loop.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-boolean-var-for-if.d.ts +11 -0
- package/build/src/rules/eslint/patterns/no-boolean-var-for-if.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-boolean-var-for-if.js +100 -0
- package/build/src/rules/eslint/patterns/no-boolean-var-for-if.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-bracket-assignment.d.ts +9 -4
- package/build/src/rules/eslint/patterns/no-bracket-assignment.d.ts.map +1 -1
- package/build/src/rules/eslint/patterns/no-bracket-assignment.js +60 -22
- package/build/src/rules/eslint/patterns/no-bracket-assignment.js.map +1 -1
- package/build/src/rules/eslint/patterns/no-bracket-method-call.d.ts +12 -0
- package/build/src/rules/eslint/patterns/no-bracket-method-call.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-bracket-method-call.js +86 -0
- package/build/src/rules/eslint/patterns/no-bracket-method-call.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-template-curly-in-string.d.ts +11 -0
- package/build/src/rules/eslint/patterns/no-template-curly-in-string.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-template-curly-in-string.js +77 -0
- package/build/src/rules/eslint/patterns/no-template-curly-in-string.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-use-before-define.d.ts +15 -0
- package/build/src/rules/eslint/patterns/no-use-before-define.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-use-before-define.js +148 -0
- package/build/src/rules/eslint/patterns/no-use-before-define.js.map +1 -0
- package/build/src/rules/eslint/regex/no-regex-literal-flags.d.ts +9 -4
- package/build/src/rules/eslint/regex/no-regex-literal-flags.d.ts.map +1 -1
- package/build/src/rules/eslint/regex/no-regex-literal-flags.js +51 -26
- package/build/src/rules/eslint/regex/no-regex-literal-flags.js.map +1 -1
- package/build/src/rules/eslint/regex/no-regex-literals.d.ts +10 -7
- package/build/src/rules/eslint/regex/no-regex-literals.d.ts.map +1 -1
- package/build/src/rules/eslint/regex/no-regex-literals.js +62 -45
- package/build/src/rules/eslint/regex/no-regex-literals.js.map +1 -1
- package/build/src/rules/eslint/safety/no-script-url.d.ts +12 -0
- package/build/src/rules/eslint/safety/no-script-url.d.ts.map +1 -0
- package/build/src/rules/eslint/safety/no-script-url.js +71 -0
- package/build/src/rules/eslint/safety/no-script-url.js.map +1 -0
- package/build/src/rules/eslint/syntax/no-destructuring.d.ts +21 -0
- package/build/src/rules/eslint/syntax/no-destructuring.d.ts.map +1 -0
- package/build/src/rules/eslint/syntax/no-destructuring.js +219 -0
- package/build/src/rules/eslint/syntax/no-destructuring.js.map +1 -0
- package/build/src/rules/eslint/syntax/no-numeric-literals.d.ts +14 -0
- package/build/src/rules/eslint/syntax/no-numeric-literals.d.ts.map +1 -0
- package/build/src/rules/eslint/syntax/no-numeric-literals.js +108 -0
- package/build/src/rules/eslint/syntax/no-numeric-literals.js.map +1 -0
- package/build/src/rules/eslint/syntax/no-optional-chaining.d.ts +11 -0
- package/build/src/rules/eslint/syntax/no-optional-chaining.d.ts.map +1 -0
- package/build/src/rules/eslint/syntax/no-optional-chaining.js +51 -0
- package/build/src/rules/eslint/syntax/no-optional-chaining.js.map +1 -0
- package/build/src/rules/eslint/syntax/no-rest-params.d.ts +15 -0
- package/build/src/rules/eslint/syntax/no-rest-params.d.ts.map +1 -0
- package/build/src/rules/eslint/syntax/no-rest-params.js +158 -0
- package/build/src/rules/eslint/syntax/no-rest-params.js.map +1 -0
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.d.ts +9 -4
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.d.ts.map +1 -1
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.js +61 -34
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.js.map +1 -1
- package/build/src/rules/eslint/typescript/no-explicit-any.d.ts +11 -0
- package/build/src/rules/eslint/typescript/no-explicit-any.d.ts.map +1 -0
- package/build/src/rules/eslint/typescript/no-explicit-any.js +51 -0
- package/build/src/rules/eslint/typescript/no-explicit-any.js.map +1 -0
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.d.ts +14 -4
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.d.ts.map +1 -1
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.js +180 -30
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.js.map +1 -1
- package/build/src/rules/eslint/typescript/no-shared-type-import.d.ts +10 -7
- package/build/src/rules/eslint/typescript/no-shared-type-import.d.ts.map +1 -1
- package/build/src/rules/eslint/typescript/no-shared-type-import.js +65 -51
- package/build/src/rules/eslint/typescript/no-shared-type-import.js.map +1 -1
- package/build/src/rules/eslint/typescript/require-bracket-property-access.d.ts +12 -0
- package/build/src/rules/eslint/typescript/require-bracket-property-access.d.ts.map +1 -0
- package/build/src/rules/eslint/typescript/require-bracket-property-access.js +115 -0
- package/build/src/rules/eslint/typescript/require-bracket-property-access.js.map +1 -0
- package/build/src/rules/eslint/typescript/require-type-naming.d.ts +12 -0
- package/build/src/rules/eslint/typescript/require-type-naming.d.ts.map +1 -0
- package/build/src/rules/eslint/typescript/require-type-naming.js +98 -0
- package/build/src/rules/eslint/typescript/require-type-naming.js.map +1 -0
- package/build/src/toolkit/bootstrap.d.ts +13 -0
- package/build/src/toolkit/bootstrap.d.ts.map +1 -0
- package/build/src/toolkit/bootstrap.js +175 -0
- package/build/src/toolkit/bootstrap.js.map +1 -0
- package/build/src/toolkit/cli-header.d.ts +5 -4
- package/build/src/toolkit/cli-header.d.ts.map +1 -1
- package/build/src/toolkit/cli-header.js +76 -62
- package/build/src/toolkit/cli-header.js.map +1 -1
- package/build/src/toolkit/index.d.ts +1 -0
- package/build/src/toolkit/index.d.ts.map +1 -1
- package/build/src/toolkit/index.js +1 -0
- package/build/src/toolkit/index.js.map +1 -1
- package/build/src/toolkit/logger.d.ts +9 -8
- package/build/src/toolkit/logger.d.ts.map +1 -1
- package/build/src/toolkit/logger.js +51 -32
- package/build/src/toolkit/logger.js.map +1 -1
- package/build/src/toolkit/markdown-table.d.ts +6 -5
- package/build/src/toolkit/markdown-table.d.ts.map +1 -1
- package/build/src/toolkit/markdown-table.js +36 -20
- package/build/src/toolkit/markdown-table.js.map +1 -1
- package/build/src/types/api/node-releases.d.ts +51 -0
- package/build/src/types/api/spdx-licenses.d.ts +41 -0
- package/build/src/types/cli/generate/github/funding.d.ts +59 -0
- package/build/src/types/cli/generate/github/issue-template.d.ts +142 -0
- package/build/src/types/cli/generate/github/workflows.d.ts +336 -0
- package/build/src/types/cli/generate/must-haves/agent-conventions.d.ts +43 -0
- package/build/src/types/cli/generate/must-haves/dotenv.d.ts +414 -0
- package/build/src/types/cli/generate/must-haves/editorconfig.d.ts +33 -0
- package/build/src/types/cli/generate/must-haves/gitignore.d.ts +344 -0
- package/build/src/types/cli/generate/must-haves/license.d.ts +72 -0
- package/build/src/types/cli/generate/must-haves/read-me.d.ts +175 -0
- package/build/src/types/cli/index.d.ts +182 -0
- package/build/src/types/cli/recipe/index.d.ts +36 -0
- package/build/src/types/cli/recipe/package-json/cleanup.d.ts +125 -0
- package/build/src/types/cli/recipe/package-json/normalize-artifacts.d.ts +104 -0
- package/build/src/types/cli/recipe/package-json/normalize-bundler.d.ts +78 -0
- package/build/src/types/cli/recipe/package-json/normalize-dependencies.d.ts +150 -0
- package/build/src/types/cli/recipe/package-json/normalize-modules.d.ts +76 -0
- package/build/src/types/cli/recipe/package-json/normalize-tooling.d.ts +89 -0
- package/build/src/types/cli/recipe/package-json/sync-environment.d.ts +140 -0
- package/build/src/types/cli/recipe/package-json/sync-identity.d.ts +107 -0
- package/build/src/types/cli/recipe/package-json/sync-ownership.d.ts +152 -0
- package/build/src/types/cli/scaffold/app/expressjs.d.ts +21 -0
- package/build/src/types/cli/scaffold/app/nextjs.d.ts +21 -0
- package/build/src/types/cli/scaffold/app/vite.d.ts +21 -0
- package/build/src/types/cli/scaffold/app/workers.d.ts +21 -0
- package/build/src/types/cli/scaffold/docs/docusaurus.d.ts +21 -0
- package/build/src/types/cli/scaffold/starter/base.d.ts +57 -0
- package/build/src/types/cli/utility/changelog.d.ts +381 -0
- package/build/src/types/cli/utility/initialize.d.ts +1185 -0
- package/build/src/types/cli/utility/run-recipes.d.ts +25 -0
- package/build/src/types/cli/utility/run-scripts.d.ts +133 -0
- package/build/src/types/cli/utility/transpile.d.ts +90 -0
- package/build/src/types/cli/utility/type-check.d.ts +88 -0
- package/build/src/types/cli/utility/version.d.ts +286 -0
- package/build/src/types/fetch-response.d.ts +12 -0
- package/build/src/types/lib/item.d.ts +536 -0
- package/build/src/types/lib/nova-config.d.ts +421 -0
- package/build/src/types/lib/scaffold.d.ts +342 -0
- package/build/src/types/lib/utility.d.ts +486 -0
- package/build/src/types/lib/workflow-templates.d.ts +48 -0
- package/build/src/types/presets/eslint/dx-code-style.d.ts +8 -0
- package/build/src/types/presets/eslint/dx-ignore.d.ts +8 -0
- package/build/src/types/presets/eslint/fw-docusaurus.d.ts +8 -0
- package/build/src/types/presets/eslint/fw-expressjs.d.ts +8 -0
- package/build/src/types/presets/eslint/fw-nextjs.d.ts +8 -0
- package/build/src/types/presets/eslint/lang-javascript.d.ts +8 -0
- package/build/src/types/presets/eslint/lang-mdx.d.ts +8 -0
- package/build/src/types/presets/eslint/lang-typescript.d.ts +8 -0
- package/build/src/types/presets/eslint/runtime-browser.d.ts +8 -0
- package/build/src/types/presets/eslint/runtime-cloudflare-workers.d.ts +8 -0
- package/build/src/types/presets/eslint/runtime-edge.d.ts +8 -0
- package/build/src/types/presets/eslint/runtime-node.d.ts +8 -0
- package/build/src/types/presets/eslint/runtime-service-worker.d.ts +8 -0
- package/build/src/types/presets/eslint/runtime-web-worker.d.ts +8 -0
- package/build/src/types/presets/eslint/tool-vite.d.ts +8 -0
- package/build/src/types/rules/eslint/conventions/no-default-export-declaration.d.ts +32 -0
- package/build/src/types/rules/eslint/conventions/no-implicit-boolean.d.ts +72 -0
- package/build/src/types/rules/eslint/conventions/require-explicit-return.d.ts +73 -0
- package/build/src/types/rules/eslint/conventions/require-hash-private.d.ts +31 -0
- package/build/src/types/rules/eslint/conventions/require-kebab-case-filename.d.ts +64 -0
- package/build/src/types/rules/eslint/conventions/require-naming-convention.d.ts +265 -0
- package/build/src/types/rules/eslint/conventions/require-undefined-init.d.ts +30 -0
- package/build/src/types/rules/eslint/conventions/switch-case-blocks.d.ts +48 -0
- package/build/src/types/rules/eslint/formatting/no-complex-arrow-concise.d.ts +74 -0
- package/build/src/types/rules/eslint/formatting/no-multiline-strings.d.ts +104 -0
- package/build/src/types/rules/eslint/formatting/no-raw-text-in-code.d.ts +28 -0
- package/build/src/types/rules/eslint/formatting/no-ternary-in-template-literal.d.ts +26 -0
- package/build/src/types/rules/eslint/formatting/require-import-order.d.ts +91 -0
- package/build/src/types/rules/eslint/formatting/require-multiline-condition-groups.d.ts +64 -0
- package/build/src/types/rules/eslint/formatting/require-multiline-conditions.d.ts +52 -0
- package/build/src/types/rules/eslint/formatting/require-padding-lines.d.ts +212 -0
- package/build/src/types/rules/eslint/formatting/require-ternary-parens.d.ts +32 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-body.d.ts +56 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +302 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-param-alignment.d.ts +108 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts +61 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-private.d.ts +40 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-since.d.ts +30 -0
- package/build/src/types/rules/eslint/nova/no-logger-dev.d.ts +60 -0
- package/build/src/types/rules/eslint/patterns/no-assign-then-return.d.ts +42 -0
- package/build/src/types/rules/eslint/patterns/no-await-in-loop.d.ts +87 -0
- package/build/src/types/rules/eslint/patterns/no-boolean-var-for-if.d.ts +48 -0
- package/build/src/types/rules/eslint/patterns/no-bracket-assignment.d.ts +34 -0
- package/build/src/types/rules/eslint/patterns/no-bracket-method-call.d.ts +46 -0
- package/build/src/types/rules/eslint/patterns/no-template-curly-in-string.d.ts +32 -0
- package/build/src/types/rules/eslint/patterns/no-use-before-define.d.ts +84 -0
- package/build/src/types/rules/eslint/regex/no-regex-literal-flags.d.ts +26 -0
- package/build/src/types/rules/eslint/regex/no-regex-literals.d.ts +40 -0
- package/build/src/types/rules/eslint/safety/no-script-url.d.ts +37 -0
- package/build/src/types/rules/eslint/syntax/no-destructuring.d.ts +131 -0
- package/build/src/types/rules/eslint/syntax/no-numeric-literals.d.ts +57 -0
- package/build/src/types/rules/eslint/syntax/no-optional-chaining.d.ts +26 -0
- package/build/src/types/rules/eslint/syntax/no-rest-params.d.ts +78 -0
- package/build/src/types/rules/eslint/typescript/no-catch-unknown-annotation.d.ts +30 -0
- package/build/src/types/rules/eslint/typescript/no-explicit-any.d.ts +26 -0
- package/build/src/types/rules/eslint/typescript/no-inline-type-annotation.d.ts +94 -0
- package/build/src/types/rules/eslint/typescript/no-shared-type-import.d.ts +43 -0
- package/build/src/types/rules/eslint/typescript/require-bracket-property-access.d.ts +53 -0
- package/build/src/types/rules/eslint/typescript/require-type-naming.d.ts +51 -0
- package/build/src/types/shared.d.ts +724 -0
- package/build/src/types/tests/api/node-releases.test.d.ts +14 -0
- package/build/src/types/tests/api/spdx-licenses.test.d.ts +18 -0
- package/build/src/types/tests/cli/generate/github/funding.test.d.ts +26 -0
- package/build/src/types/tests/cli/generate/github/issue-template.test.d.ts +14 -0
- package/build/src/types/tests/cli/generate/github/workflows.test.d.ts +38 -0
- package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +32 -0
- package/build/src/types/tests/cli/generate/must-haves/dotenv.test.d.ts +14 -0
- package/build/src/types/tests/cli/generate/must-haves/editorconfig.test.d.ts +22 -0
- package/build/src/types/tests/cli/generate/must-haves/gitignore.test.d.ts +14 -0
- package/build/src/types/tests/cli/generate/must-haves/license.test.d.ts +26 -0
- package/build/src/types/tests/cli/generate/must-haves/read-me.test.d.ts +26 -0
- package/build/src/types/tests/cli/recipe/package-json/cleanup.test.d.ts +42 -0
- package/build/src/types/tests/cli/recipe/package-json/normalize-artifacts.test.d.ts +32 -0
- package/build/src/types/tests/cli/recipe/package-json/normalize-bundler.test.d.ts +32 -0
- package/build/src/types/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts +40 -0
- package/build/src/types/tests/cli/recipe/package-json/normalize-modules.test.d.ts +32 -0
- package/build/src/types/tests/cli/recipe/package-json/normalize-tooling.test.d.ts +32 -0
- package/build/src/types/tests/cli/recipe/package-json/sync-environment.test.d.ts +32 -0
- package/build/src/types/tests/cli/recipe/package-json/sync-identity.test.d.ts +32 -0
- package/build/src/types/tests/cli/recipe/package-json/sync-ownership.test.d.ts +32 -0
- package/build/src/types/tests/cli/scaffold/app/expressjs.test.d.ts +40 -0
- package/build/src/types/tests/cli/scaffold/app/nextjs.test.d.ts +42 -0
- package/build/src/types/tests/cli/scaffold/app/vite.test.d.ts +42 -0
- package/build/src/types/tests/cli/scaffold/app/workers.test.d.ts +40 -0
- package/build/src/types/tests/cli/scaffold/docs/docusaurus.test.d.ts +40 -0
- package/build/src/types/tests/cli/scaffold/starter/base.test.d.ts +40 -0
- package/build/src/types/tests/cli/utility/changelog.test.d.ts +68 -0
- package/build/src/types/tests/cli/utility/initialize.test.d.ts +14 -0
- package/build/src/types/tests/cli/utility/run-recipes.test.d.ts +22 -0
- package/build/src/types/tests/cli/utility/run-scripts.test.d.ts +52 -0
- package/build/src/types/tests/cli/utility/transpile.test.d.ts +26 -0
- package/build/src/types/tests/cli/utility/type-check.test.d.ts +22 -0
- package/build/src/types/tests/cli/utility/version.test.d.ts +12 -0
- package/build/src/types/tests/lib/item.test.d.ts +88 -0
- package/build/src/types/tests/lib/nova-config.test.d.ts +138 -0
- package/build/src/types/tests/lib/regex.test.d.ts +122 -0
- package/build/src/types/tests/lib/scaffold.test.d.ts +26 -0
- package/build/src/types/tests/lib/schema.test.d.ts +36 -0
- package/build/src/types/tests/lib/utility.test.d.ts +324 -0
- package/build/src/types/tests/lib/workflow-templates.test.d.ts +77 -0
- package/build/src/types/tests/rules/eslint/conventions/no-default-export-declaration.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/no-implicit-boolean.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/require-explicit-return.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/require-hash-private.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/require-kebab-case-filename.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/require-naming-convention.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/require-undefined-init.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/conventions/switch-case-blocks.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/no-complex-arrow-concise.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/no-multiline-strings.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/no-raw-text-in-code.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/no-ternary-in-template-literal.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/require-import-order.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/require-multiline-condition-groups.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/require-multiline-conditions.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/require-padding-lines.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/formatting/require-ternary-parens.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-body.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-hierarchy.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-param-alignment.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-param-name.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-private.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-since.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/nova/no-logger-dev.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-assign-then-return.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-await-in-loop.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-boolean-var-for-if.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-bracket-assignment.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-bracket-method-call.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-template-curly-in-string.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/patterns/no-use-before-define.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/regex/no-regex-literal-flags.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/regex/no-regex-literals.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/safety/no-script-url.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/syntax/no-destructuring.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/syntax/no-numeric-literals.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/syntax/no-optional-chaining.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/syntax/no-rest-params.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/typescript/no-explicit-any.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/typescript/no-inline-type-annotation.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/typescript/no-shared-type-import.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/typescript/require-bracket-property-access.test.d.ts +12 -0
- package/build/src/types/tests/rules/eslint/typescript/require-type-naming.test.d.ts +8 -0
- package/build/src/types/tests/toolkit/bootstrap.test.d.ts +108 -0
- package/build/src/types/tests/toolkit/cli-header.test.d.ts +46 -0
- package/build/src/types/tests/toolkit/logger.test.d.ts +20 -0
- package/build/src/types/tests/toolkit/markdown-table.test.d.ts +65 -0
- package/build/src/types/tests/type-declarations.test.d.ts +564 -0
- package/build/src/types/toolkit/bootstrap.d.ts +133 -0
- package/build/src/types/toolkit/cli-header.d.ts +203 -0
- package/build/src/types/toolkit/logger.d.ts +160 -0
- package/build/src/types/toolkit/markdown-table.d.ts +159 -0
- package/build/templates/.novaignore +0 -0
- package/build/templates/generators/github/funding/FUNDING.yml +12 -0
- package/build/templates/generators/github/issue-template/BUG-REPORT.yml +86 -0
- package/build/templates/generators/github/issue-template/FEATURE-REQUEST.yml +61 -0
- package/build/templates/generators/github/issue-template/SUPPORT-REQUEST.yml +50 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/android.yml +16 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/apple.yml +23 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/csharp.yml +20 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/docker.yml +33 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/homebridge.yml +16 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/nodejs.yml +8 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/pfsense.yml +8 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/php.yml +8 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/python.yml +8 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/screenshots.yml +7 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/synology.yml +8 -0
- package/build/templates/generators/github/issue-template/bug-report-fields/web.yml +21 -0
- package/build/templates/generators/github/issue-template/config.yml +1 -0
- package/build/templates/generators/github/issue-template/legal-agreements/bug-report.yml +8 -0
- package/build/templates/generators/github/issue-template/legal-agreements/feature-request.yml +8 -0
- package/build/templates/generators/github/issue-template/legal-agreements/support-request.yml +8 -0
- package/build/templates/generators/github/workflows/check-sponsor-gated-issues/base.yml +57 -0
- package/build/templates/generators/github/workflows/lock-inactive-issues/base.yml +43 -0
- package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/schedule.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/base.yml +53 -0
- package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/push.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/release.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/base.yml +62 -0
- package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/triggers/push.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/triggers/release.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-docker-hub/base.yml +58 -0
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/release.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-any.yml +7 -0
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-failure.yml +8 -0
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-success.yml +8 -0
- package/build/templates/generators/github/workflows/publish-to-github-packages/base.yml +108 -0
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/release.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-any.yml +7 -0
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-failure.yml +8 -0
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-success.yml +8 -0
- package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/base.yml +79 -0
- package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/triggers/push.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/triggers/release.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-npm/base.yml +91 -0
- package/build/templates/generators/github/workflows/publish-to-npm/triggers/release.yml +5 -0
- package/build/templates/generators/github/workflows/publish-to-npm/triggers/workflow-run-any.yml +7 -0
- package/build/templates/generators/github/workflows/publish-to-npm/triggers/workflow-run-failure.yml +8 -0
- package/build/templates/generators/github/workflows/publish-to-npm/triggers/workflow-run-success.yml +8 -0
- package/build/templates/generators/must-haves/agent-conventions/.cursorrules +54 -0
- package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +54 -0
- package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +54 -0
- package/build/templates/generators/must-haves/agent-conventions/PROJECT_RULES.md +290 -0
- package/build/templates/generators/must-haves/agent-conventions/VISION.md +62 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/csharp.md +317 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/css.md +188 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/docker.md +131 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/documentation.md +615 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/java.md +285 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/kotlin.md +297 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/php.md +257 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/python.md +260 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/shell.md +205 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/swift.md +312 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/typescript.md +1530 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/universal.md +202 -0
- package/build/templates/generators/must-haves/dotenv/.env.sample +14 -0
- package/build/templates/generators/must-haves/editorconfig/.editorconfig +212 -0
- package/build/templates/generators/must-haves/license/AGPL-3.0 +662 -0
- package/build/templates/generators/must-haves/license/Apache-2.0 +202 -0
- package/build/templates/generators/must-haves/license/BSD-2-Clause +25 -0
- package/build/templates/generators/must-haves/license/BSD-3-Clause +29 -0
- package/build/templates/generators/must-haves/license/BSL-1.0 +24 -0
- package/build/templates/generators/must-haves/license/CC0-1.0 +122 -0
- package/build/templates/generators/must-haves/license/EPL-2.0 +278 -0
- package/build/templates/generators/must-haves/license/GPL-2.0 +340 -0
- package/build/templates/generators/must-haves/license/GPL-3.0 +675 -0
- package/build/templates/generators/must-haves/license/LGPL-2.1 +505 -0
- package/build/templates/generators/must-haves/license/MIT +22 -0
- package/build/templates/generators/must-haves/license/MPL-2.0 +374 -0
- package/build/templates/generators/must-haves/license/Proprietary +22 -0
- package/build/templates/generators/must-haves/license/Unlicense +25 -0
- package/build/templates/generators/must-haves/read-me/README.md +17 -0
- package/build/templates/scaffold/app/express/package.json +20 -0
- package/build/templates/scaffold/app/express/src/index.ts +12 -0
- package/build/templates/scaffold/app/express/tsconfig.json +15 -0
- package/build/templates/scaffold/app/nextjs/next.config.mjs +4 -0
- package/build/templates/scaffold/app/nextjs/package.json +22 -0
- package/build/templates/scaffold/app/nextjs/src/app/globals.css +11 -0
- package/build/templates/scaffold/app/nextjs/src/app/layout.tsx +18 -0
- package/build/templates/scaffold/app/nextjs/src/app/page.tsx +8 -0
- package/build/templates/scaffold/app/nextjs/tsconfig.json +26 -0
- package/build/templates/scaffold/app/vite/index.html +12 -0
- package/build/templates/scaffold/app/vite/package.json +17 -0
- package/build/templates/scaffold/app/vite/src/main.ts +5 -0
- package/build/templates/scaffold/app/vite/tsconfig.json +16 -0
- package/build/templates/scaffold/app/vite/vite.config.mts +3 -0
- package/build/templates/scaffold/app/workers/package.json +16 -0
- package/build/templates/scaffold/app/workers/src/index.ts +13 -0
- package/build/templates/scaffold/app/workers/tsconfig.json +17 -0
- package/build/templates/scaffold/app/workers/wrangler.toml +3 -0
- package/build/templates/scaffold/docs/docusaurus/docs/intro.md +9 -0
- package/build/templates/scaffold/docs/docusaurus/docusaurus.config.ts +33 -0
- package/build/templates/scaffold/docs/docusaurus/package.json +20 -0
- package/build/templates/scaffold/docs/docusaurus/sidebars.ts +9 -0
- package/build/templates/scaffold/docs/docusaurus/static/.gitkeep +0 -0
- package/build/templates/scaffold/docs/docusaurus/tsconfig.json +8 -0
- package/package.json +33 -23
- package/build/src/presets/eslint/dx-code-style.d.mts +0 -4
- package/build/src/presets/eslint/dx-code-style.d.mts.map +0 -1
- package/build/src/presets/eslint/dx-code-style.mjs +0 -211
- package/build/src/presets/eslint/dx-code-style.mjs.map +0 -1
- package/build/src/presets/eslint/dx-ignore.d.mts +0 -4
- package/build/src/presets/eslint/dx-ignore.d.mts.map +0 -1
- package/build/src/presets/eslint/dx-ignore.mjs.map +0 -1
- package/build/src/presets/eslint/env-browser.d.mts +0 -4
- package/build/src/presets/eslint/env-browser.d.mts.map +0 -1
- package/build/src/presets/eslint/env-browser.mjs +0 -3
- package/build/src/presets/eslint/env-browser.mjs.map +0 -1
- package/build/src/presets/eslint/env-edge.d.mts +0 -4
- package/build/src/presets/eslint/env-edge.d.mts.map +0 -1
- package/build/src/presets/eslint/env-edge.mjs.map +0 -1
- package/build/src/presets/eslint/env-node.d.mts +0 -4
- package/build/src/presets/eslint/env-node.d.mts.map +0 -1
- package/build/src/presets/eslint/env-node.mjs.map +0 -1
- package/build/src/presets/eslint/env-service-worker.d.mts +0 -4
- package/build/src/presets/eslint/env-service-worker.d.mts.map +0 -1
- package/build/src/presets/eslint/env-service-worker.mjs +0 -3
- package/build/src/presets/eslint/env-service-worker.mjs.map +0 -1
- package/build/src/presets/eslint/env-web-worker.d.mts +0 -4
- package/build/src/presets/eslint/env-web-worker.d.mts.map +0 -1
- package/build/src/presets/eslint/env-web-worker.mjs.map +0 -1
- package/build/src/presets/eslint/fw-docusaurus.d.mts +0 -4
- package/build/src/presets/eslint/fw-docusaurus.d.mts.map +0 -1
- package/build/src/presets/eslint/fw-docusaurus.mjs +0 -10
- package/build/src/presets/eslint/fw-docusaurus.mjs.map +0 -1
- package/build/src/presets/eslint/fw-expressjs.d.mts +0 -4
- package/build/src/presets/eslint/fw-expressjs.d.mts.map +0 -1
- package/build/src/presets/eslint/fw-expressjs.mjs.map +0 -1
- package/build/src/presets/eslint/fw-nextjs.d.mts +0 -4
- package/build/src/presets/eslint/fw-nextjs.d.mts.map +0 -1
- package/build/src/presets/eslint/fw-nextjs.mjs.map +0 -1
- package/build/src/presets/eslint/index.d.mts +0 -16
- package/build/src/presets/eslint/index.d.mts.map +0 -1
- package/build/src/presets/eslint/index.mjs +0 -16
- package/build/src/presets/eslint/index.mjs.map +0 -1
- package/build/src/presets/eslint/lang-javascript.d.mts +0 -4
- package/build/src/presets/eslint/lang-javascript.d.mts.map +0 -1
- package/build/src/presets/eslint/lang-javascript.mjs +0 -3
- package/build/src/presets/eslint/lang-javascript.mjs.map +0 -1
- package/build/src/presets/eslint/lang-mdx.d.mts +0 -4
- package/build/src/presets/eslint/lang-mdx.d.mts.map +0 -1
- package/build/src/presets/eslint/lang-mdx.mjs.map +0 -1
- package/build/src/presets/eslint/lang-typescript.d.mts +0 -4
- package/build/src/presets/eslint/lang-typescript.d.mts.map +0 -1
- package/build/src/presets/eslint/lang-typescript.mjs +0 -88
- package/build/src/presets/eslint/lang-typescript.mjs.map +0 -1
- package/build/src/presets/eslint/platform-cloudflare-workers.d.mts +0 -4
- package/build/src/presets/eslint/platform-cloudflare-workers.d.mts.map +0 -1
- package/build/src/presets/eslint/platform-cloudflare-workers.mjs +0 -8
- package/build/src/presets/eslint/platform-cloudflare-workers.mjs.map +0 -1
- package/build/src/presets/eslint/tool-vite.d.mts +0 -4
- package/build/src/presets/eslint/tool-vite.d.mts.map +0 -1
- package/build/src/presets/eslint/tool-vite.mjs.map +0 -1
- package/build/src/presets/tsconfig/env-web-worker.json +0 -12
- package/build/src/rules/eslint/patterns/no-destructuring.d.ts +0 -13
- package/build/src/rules/eslint/patterns/no-destructuring.d.ts.map +0 -1
- package/build/src/rules/eslint/patterns/no-destructuring.js +0 -177
- package/build/src/rules/eslint/patterns/no-destructuring.js.map +0 -1
- package/build/src/rules/eslint/patterns/no-implicit-boolean.d.ts +0 -6
- package/build/src/rules/eslint/patterns/no-implicit-boolean.d.ts.map +0 -1
- package/build/src/rules/eslint/patterns/no-implicit-boolean.js +0 -62
- package/build/src/rules/eslint/patterns/no-implicit-boolean.js.map +0 -1
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.d.ts +0 -6
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.d.ts.map +0 -1
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.js +0 -32
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.js.map +0 -1
- package/build/src/rules/eslint/patterns/switch-case-blocks.d.ts +0 -6
- package/build/src/rules/eslint/patterns/switch-case-blocks.d.ts.map +0 -1
- package/build/src/rules/eslint/patterns/switch-case-blocks.js +0 -36
- package/build/src/rules/eslint/patterns/switch-case-blocks.js.map +0 -1
- package/build/src/tests/api/node-releases.test.d.ts +0 -2
- package/build/src/tests/api/node-releases.test.d.ts.map +0 -1
- package/build/src/tests/api/node-releases.test.js +0 -193
- package/build/src/tests/api/node-releases.test.js.map +0 -1
- package/build/src/tests/api/spdx-licenses.test.d.ts +0 -2
- package/build/src/tests/api/spdx-licenses.test.d.ts.map +0 -1
- package/build/src/tests/api/spdx-licenses.test.js +0 -91
- package/build/src/tests/api/spdx-licenses.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/cleanup.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/cleanup.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/cleanup.test.js +0 -240
- package/build/src/tests/cli/recipe/package-json/cleanup.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.js +0 -161
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.js +0 -161
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.js +0 -175
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.js +0 -164
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.js +0 -193
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.js +0 -158
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.js +0 -156
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.js.map +0 -1
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.js +0 -164
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.js.map +0 -1
- package/build/src/tests/cli/utility/changelog.test.d.ts +0 -2
- package/build/src/tests/cli/utility/changelog.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/changelog.test.js +0 -274
- package/build/src/tests/cli/utility/changelog.test.js.map +0 -1
- package/build/src/tests/cli/utility/initialize.test.d.ts +0 -2
- package/build/src/tests/cli/utility/initialize.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/initialize.test.js +0 -27
- package/build/src/tests/cli/utility/initialize.test.js.map +0 -1
- package/build/src/tests/cli/utility/run-recipes.test.d.ts +0 -2
- package/build/src/tests/cli/utility/run-recipes.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/run-recipes.test.js +0 -41
- package/build/src/tests/cli/utility/run-recipes.test.js.map +0 -1
- package/build/src/tests/cli/utility/run-scripts.test.d.ts +0 -2
- package/build/src/tests/cli/utility/run-scripts.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/run-scripts.test.js +0 -153
- package/build/src/tests/cli/utility/run-scripts.test.js.map +0 -1
- package/build/src/tests/cli/utility/transpile.test.d.ts +0 -2
- package/build/src/tests/cli/utility/transpile.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/transpile.test.js +0 -65
- package/build/src/tests/cli/utility/transpile.test.js.map +0 -1
- package/build/src/tests/cli/utility/type-check.test.d.ts +0 -2
- package/build/src/tests/cli/utility/type-check.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/type-check.test.js +0 -63
- package/build/src/tests/cli/utility/type-check.test.js.map +0 -1
- package/build/src/tests/cli/utility/version.test.d.ts +0 -2
- package/build/src/tests/cli/utility/version.test.d.ts.map +0 -1
- package/build/src/tests/cli/utility/version.test.js +0 -38
- package/build/src/tests/cli/utility/version.test.js.map +0 -1
- package/build/src/tests/lib/item.test.d.ts +0 -2
- package/build/src/tests/lib/item.test.d.ts.map +0 -1
- package/build/src/tests/lib/item.test.js +0 -142
- package/build/src/tests/lib/item.test.js.map +0 -1
- package/build/src/tests/lib/nova-config.test.d.ts +0 -2
- package/build/src/tests/lib/nova-config.test.d.ts.map +0 -1
- package/build/src/tests/lib/nova-config.test.js +0 -516
- package/build/src/tests/lib/nova-config.test.js.map +0 -1
- package/build/src/tests/lib/regex.test.d.ts +0 -2
- package/build/src/tests/lib/regex.test.d.ts.map +0 -1
- package/build/src/tests/lib/regex.test.js +0 -342
- package/build/src/tests/lib/regex.test.js.map +0 -1
- package/build/src/tests/lib/schema.test.d.ts +0 -2
- package/build/src/tests/lib/schema.test.d.ts.map +0 -1
- package/build/src/tests/lib/schema.test.js +0 -260
- package/build/src/tests/lib/schema.test.js.map +0 -1
- package/build/src/tests/lib/utility.test.d.ts +0 -2
- package/build/src/tests/lib/utility.test.d.ts.map +0 -1
- package/build/src/tests/lib/utility.test.js +0 -744
- package/build/src/tests/lib/utility.test.js.map +0 -1
- package/build/src/tests/rules/eslint/formatting/no-raw-text-in-code.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/formatting/no-raw-text-in-code.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/formatting/no-raw-text-in-code.test.js +0 -47
- package/build/src/tests/rules/eslint/formatting/no-raw-text-in-code.test.js.map +0 -1
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.js +0 -131
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.js.map +0 -1
- package/build/src/tests/rules/eslint/nova/no-logger-dev.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/nova/no-logger-dev.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/nova/no-logger-dev.test.js +0 -55
- package/build/src/tests/rules/eslint/nova/no-logger-dev.test.js.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.js +0 -39
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.js.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.js +0 -40
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.js.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.js +0 -86
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.js.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.js +0 -76
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.js.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.js +0 -42
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.js.map +0 -1
- package/build/src/tests/rules/eslint/patterns/switch-case-blocks.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/patterns/switch-case-blocks.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/patterns/switch-case-blocks.test.js +0 -43
- package/build/src/tests/rules/eslint/patterns/switch-case-blocks.test.js.map +0 -1
- package/build/src/tests/rules/eslint/regex/no-regex-literal-flags.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/regex/no-regex-literal-flags.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/regex/no-regex-literal-flags.test.js +0 -47
- package/build/src/tests/rules/eslint/regex/no-regex-literal-flags.test.js.map +0 -1
- package/build/src/tests/rules/eslint/regex/no-regex-literals.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/regex/no-regex-literals.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/regex/no-regex-literals.test.js +0 -49
- package/build/src/tests/rules/eslint/regex/no-regex-literals.test.js.map +0 -1
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.js +0 -34
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.js.map +0 -1
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.js +0 -55
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.js.map +0 -1
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.d.ts +0 -2
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.js +0 -51
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.js.map +0 -1
- package/build/src/tests/toolkit/cli-header.test.d.ts +0 -2
- package/build/src/tests/toolkit/cli-header.test.d.ts.map +0 -1
- package/build/src/tests/toolkit/cli-header.test.js +0 -143
- package/build/src/tests/toolkit/cli-header.test.js.map +0 -1
- package/build/src/tests/toolkit/logger.test.d.ts +0 -2
- package/build/src/tests/toolkit/logger.test.d.ts.map +0 -1
- package/build/src/tests/toolkit/logger.test.js +0 -96
- package/build/src/tests/toolkit/logger.test.js.map +0 -1
- package/build/src/tests/toolkit/markdown-table.test.d.ts +0 -2
- package/build/src/tests/toolkit/markdown-table.test.d.ts.map +0 -1
- package/build/src/tests/toolkit/markdown-table.test.js +0 -138
- package/build/src/tests/toolkit/markdown-table.test.js.map +0 -1
- /package/build/src/presets/tsconfig/{env-browser.json → runtime-browser.json} +0 -0
- /package/build/src/presets/tsconfig/{env-edge.json → runtime-edge.json} +0 -0
- /package/build/src/presets/tsconfig/{env-node.json → runtime-node.json} +0 -0
- /package/build/src/presets/tsconfig/{env-service-worker.json → runtime-service-worker.json} +0 -0
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import { join, relative, sep } from 'path';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import prompts from 'prompts';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { discoverPathsWithFile } from '../../lib/utility.js';
|
|
5
|
+
import { libItemAllowedPoliciesByRole, libItemAllowedRecipes, libItemSyncRoles, libItemValidEntityRoles, } from '../../lib/item.js';
|
|
6
|
+
import { LibNovaConfig } from '../../lib/nova-config.js';
|
|
7
|
+
import { LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REGEX_PATTERN_SLUG_SCOPED, LIB_REGEX_PATTERN_SLUG_SIMPLE, LIB_REGEX_PATTERN_YML_EXTENSION, } from '../../lib/regex.js';
|
|
8
|
+
import { discoverPathsWithFile, pathExists, resolveTemplatePath } from '../../lib/utility.js';
|
|
9
|
+
import { libWorkflowTemplatesMetadata } from '../../lib/workflow-templates.js';
|
|
8
10
|
import { Logger } from '../../toolkit/index.js';
|
|
9
|
-
export class
|
|
11
|
+
export class CliUtilityInitialize {
|
|
10
12
|
static async run(options) {
|
|
11
13
|
const currentDirectory = process.cwd();
|
|
12
|
-
const isProjectRoot = await
|
|
14
|
+
const isProjectRoot = await CliUtilityInitialize.checkPath(currentDirectory);
|
|
13
15
|
if (isProjectRoot !== true) {
|
|
14
16
|
process.exitCode = 1;
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
17
|
-
const isDryRun = options
|
|
18
|
-
const isReplaceFile = options
|
|
19
|
+
const isDryRun = options['dryRun'] === true;
|
|
20
|
+
const isReplaceFile = options['replaceFile'] === true;
|
|
19
21
|
if (isDryRun === true) {
|
|
20
22
|
Logger.customize({
|
|
21
|
-
name: '
|
|
23
|
+
name: 'CliUtilityInitialize.run',
|
|
22
24
|
purpose: 'options',
|
|
23
25
|
}).warn('Dry run enabled. File changes will not be made in this session.');
|
|
24
26
|
}
|
|
25
27
|
if (isReplaceFile === true) {
|
|
26
|
-
const replaceFileNotice = (isDryRun) ? 'This option has no effect during a dry run session.' : 'Backup file will not be created.';
|
|
28
|
+
const replaceFileNotice = (isDryRun === true) ? 'This option has no effect during a dry run session.' : 'Backup file will not be created.';
|
|
27
29
|
Logger.customize({
|
|
28
|
-
name: '
|
|
30
|
+
name: 'CliUtilityInitialize.run',
|
|
29
31
|
purpose: 'options',
|
|
30
32
|
}).warn(`Replace file enabled. ${replaceFileNotice}`);
|
|
31
33
|
}
|
|
32
|
-
const novaConfig = new
|
|
34
|
+
const novaConfig = new LibNovaConfig();
|
|
33
35
|
const workingFile = await novaConfig.load();
|
|
34
|
-
const promptFlowResult = await
|
|
36
|
+
const promptFlowResult = await CliUtilityInitialize.promptFlow(workingFile);
|
|
35
37
|
if (promptFlowResult === 'cancel') {
|
|
36
38
|
Logger.customize({
|
|
37
|
-
name: '
|
|
39
|
+
name: 'CliUtilityInitialize.run',
|
|
38
40
|
purpose: 'promptFlow',
|
|
39
41
|
}).debug('Prompt flow exited without saving.');
|
|
40
42
|
return;
|
|
@@ -42,46 +44,52 @@ export class CLIUtilityInitialize {
|
|
|
42
44
|
novaConfig.set(workingFile);
|
|
43
45
|
if (isDryRun === true) {
|
|
44
46
|
Logger.customize({
|
|
45
|
-
name: '
|
|
47
|
+
name: 'CliUtilityInitialize.run',
|
|
46
48
|
purpose: 'promptFlow',
|
|
47
49
|
}).debug('Dry run enabled. Skipping save operation.');
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
52
|
await novaConfig.save(isReplaceFile);
|
|
53
|
+
return;
|
|
51
54
|
}
|
|
52
55
|
static async promptFlow(config) {
|
|
53
56
|
const category = {
|
|
54
57
|
project: {
|
|
55
58
|
label: 'Project',
|
|
56
59
|
description: 'Configure project metadata (name, description, keywords).',
|
|
57
|
-
handler:
|
|
60
|
+
handler: CliUtilityInitialize['promptProject'],
|
|
58
61
|
},
|
|
59
62
|
entities: {
|
|
60
63
|
label: 'Entities',
|
|
61
64
|
description: 'Manage entities, their roles, and contact information.',
|
|
62
|
-
handler:
|
|
65
|
+
handler: CliUtilityInitialize['promptEntities'],
|
|
63
66
|
},
|
|
64
67
|
emails: {
|
|
65
68
|
label: 'Emails',
|
|
66
69
|
description: 'Configure project emails (bugs, etc.).',
|
|
67
|
-
handler:
|
|
70
|
+
handler: CliUtilityInitialize['promptEmails'],
|
|
71
|
+
},
|
|
72
|
+
workflows: {
|
|
73
|
+
label: 'Workflows',
|
|
74
|
+
description: 'Configure workflow templates and settings.',
|
|
75
|
+
handler: CliUtilityInitialize['promptWorkflows'],
|
|
68
76
|
},
|
|
69
77
|
urls: {
|
|
70
78
|
label: 'URLs',
|
|
71
79
|
description: 'Configure project URLs (homepage, repository, fund sources, etc.).',
|
|
72
|
-
handler:
|
|
80
|
+
handler: CliUtilityInitialize['promptUrls'],
|
|
73
81
|
},
|
|
74
82
|
workspaces: {
|
|
75
83
|
label: 'Workspaces',
|
|
76
84
|
description: 'Review workspace packages, assigning roles and policies.',
|
|
77
|
-
handler:
|
|
85
|
+
handler: CliUtilityInitialize['promptWorkspaces'],
|
|
78
86
|
},
|
|
79
87
|
};
|
|
80
88
|
while (true) {
|
|
81
89
|
const categoryKeys = Object.keys(category);
|
|
82
90
|
const choices = categoryKeys.map((categoryKey) => ({
|
|
83
|
-
title: category[categoryKey]
|
|
84
|
-
description: category[categoryKey]
|
|
91
|
+
title: category[categoryKey]['label'],
|
|
92
|
+
description: category[categoryKey]['description'],
|
|
85
93
|
value: categoryKey,
|
|
86
94
|
}));
|
|
87
95
|
choices.push({
|
|
@@ -94,16 +102,16 @@ export class CLIUtilityInitialize {
|
|
|
94
102
|
description: 'Exit without persisting any changes.',
|
|
95
103
|
value: 'cancel',
|
|
96
104
|
});
|
|
97
|
-
const menuOutput = await
|
|
105
|
+
const menuOutput = await CliUtilityInitialize.promptWithCancel({
|
|
98
106
|
type: 'select',
|
|
99
107
|
name: 'action',
|
|
100
108
|
message: 'Select a Nova configuration category to edit.',
|
|
101
109
|
choices,
|
|
102
110
|
});
|
|
103
|
-
if (menuOutput
|
|
111
|
+
if (menuOutput['cancelled'] === true) {
|
|
104
112
|
return 'cancel';
|
|
105
113
|
}
|
|
106
|
-
const menuOutputResult = menuOutput
|
|
114
|
+
const menuOutputResult = menuOutput['result'];
|
|
107
115
|
if (menuOutputResult.action === undefined
|
|
108
116
|
|| menuOutputResult.action === 'cancel') {
|
|
109
117
|
return 'cancel';
|
|
@@ -112,65 +120,70 @@ export class CLIUtilityInitialize {
|
|
|
112
120
|
return 'save';
|
|
113
121
|
}
|
|
114
122
|
const categoryKey = menuOutputResult.action;
|
|
115
|
-
const categoryHandler = category[categoryKey]
|
|
123
|
+
const categoryHandler = category[categoryKey]['handler'];
|
|
116
124
|
await categoryHandler(config);
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
static async promptProject(config) {
|
|
120
|
-
const existingProject = config
|
|
121
|
-
const existingProjectName = (existingProject !== undefined) ? existingProject
|
|
122
|
-
const existingProjectDescription = (existingProject !== undefined) ? existingProject
|
|
123
|
-
const existingProjectKeywords = (existingProject !== undefined) ? existingProject
|
|
128
|
+
const existingProject = config['project'];
|
|
129
|
+
const existingProjectName = (existingProject !== undefined) ? existingProject['name'] : undefined;
|
|
130
|
+
const existingProjectDescription = (existingProject !== undefined) ? existingProject['description'] : undefined;
|
|
131
|
+
const existingProjectKeywords = (existingProject !== undefined) ? existingProject['keywords'] : undefined;
|
|
132
|
+
const existingProjectLegalName = (existingProject !== undefined) ? existingProject['legalName'] : undefined;
|
|
133
|
+
const existingProjectPronouns = (existingProject !== undefined) ? existingProject['pronouns'] : undefined;
|
|
134
|
+
const existingProjectPlatforms = (existingProject !== undefined) ? existingProject['platforms'] : undefined;
|
|
135
|
+
const existingProjectStartingYear = (existingProject !== undefined) ? existingProject['startingYear'] : undefined;
|
|
136
|
+
const existingProjectLicense = (existingProject !== undefined) ? existingProject['license'] : undefined;
|
|
124
137
|
const project = (existingProject !== undefined) ? { ...existingProject } : {};
|
|
125
138
|
const projectName = (existingProjectName !== undefined) ? { ...existingProjectName } : {};
|
|
126
139
|
const projectDescription = (existingProjectDescription !== undefined) ? { ...existingProjectDescription } : {};
|
|
127
140
|
const projectKeywords = (existingProjectKeywords !== undefined) ? [...existingProjectKeywords] : [];
|
|
128
|
-
const questionsOutput = await
|
|
141
|
+
const questionsOutput = await CliUtilityInitialize.promptWithCancel([
|
|
129
142
|
{
|
|
130
143
|
type: 'text',
|
|
131
144
|
name: 'projectNameTitle',
|
|
132
145
|
message: 'Project title (display name)',
|
|
133
|
-
initial: projectName
|
|
134
|
-
validate: (value) =>
|
|
146
|
+
initial: projectName['title'] ?? '',
|
|
147
|
+
validate: (value) => CliUtilityInitialize.normalizeText(value, Infinity)['result'],
|
|
135
148
|
},
|
|
136
149
|
{
|
|
137
150
|
type: 'text',
|
|
138
151
|
name: 'projectNameSlug',
|
|
139
152
|
message: 'Project slug (package name)',
|
|
140
|
-
initial: projectName
|
|
141
|
-
validate: (value) =>
|
|
153
|
+
initial: projectName['slug'] ?? '',
|
|
154
|
+
validate: (value) => CliUtilityInitialize.normalizeProjectSlug(value)['result'],
|
|
142
155
|
},
|
|
143
156
|
{
|
|
144
157
|
type: 'text',
|
|
145
158
|
name: 'projectDescriptionShort',
|
|
146
159
|
message: 'Short description',
|
|
147
|
-
initial: projectDescription
|
|
148
|
-
validate: (value) =>
|
|
160
|
+
initial: projectDescription['short'] ?? '',
|
|
161
|
+
validate: (value) => CliUtilityInitialize.normalizeText(value, Infinity)['result'],
|
|
149
162
|
},
|
|
150
163
|
{
|
|
151
164
|
type: 'text',
|
|
152
165
|
name: 'projectDescriptionLong',
|
|
153
166
|
message: 'Long description',
|
|
154
|
-
initial: projectDescription
|
|
155
|
-
validate: (value) =>
|
|
167
|
+
initial: projectDescription['long'] ?? '',
|
|
168
|
+
validate: (value) => CliUtilityInitialize.normalizeText(value, Infinity)['result'],
|
|
156
169
|
},
|
|
157
170
|
{
|
|
158
171
|
type: 'text',
|
|
159
172
|
name: 'projectKeywords',
|
|
160
173
|
message: 'Keywords (comma separated)',
|
|
161
174
|
initial: (projectKeywords.length > 0) ? projectKeywords.join(', ') : '',
|
|
162
|
-
validate: (value) =>
|
|
175
|
+
validate: (value) => CliUtilityInitialize.normalizeTextArray(value, 50)['result'],
|
|
163
176
|
},
|
|
164
177
|
]);
|
|
165
|
-
if (questionsOutput
|
|
178
|
+
if (questionsOutput['cancelled'] === true) {
|
|
166
179
|
return 'back';
|
|
167
180
|
}
|
|
168
|
-
const questionsOutputResult = questionsOutput
|
|
169
|
-
const projectNameTitleInput =
|
|
170
|
-
const projectNameSlugInput =
|
|
171
|
-
const projectDescriptionShortInput =
|
|
172
|
-
const projectDescriptionLongInput =
|
|
173
|
-
const projectKeywordsInput =
|
|
181
|
+
const questionsOutputResult = questionsOutput['result'];
|
|
182
|
+
const projectNameTitleInput = CliUtilityInitialize.normalizeText(questionsOutputResult.projectNameTitle, Infinity)['sanitized'];
|
|
183
|
+
const projectNameSlugInput = CliUtilityInitialize.normalizeProjectSlug(questionsOutputResult.projectNameSlug)['sanitized'];
|
|
184
|
+
const projectDescriptionShortInput = CliUtilityInitialize.normalizeText(questionsOutputResult.projectDescriptionShort, Infinity)['sanitized'];
|
|
185
|
+
const projectDescriptionLongInput = CliUtilityInitialize.normalizeText(questionsOutputResult.projectDescriptionLong, Infinity)['sanitized'];
|
|
186
|
+
const projectKeywordsInput = CliUtilityInitialize.normalizeTextArray(questionsOutputResult.projectKeywords, 50)['sanitized'];
|
|
174
187
|
if (projectNameTitleInput !== undefined) {
|
|
175
188
|
projectName.title = projectNameTitleInput;
|
|
176
189
|
}
|
|
@@ -213,28 +226,253 @@ export class CLIUtilityInitialize {
|
|
|
213
226
|
else {
|
|
214
227
|
Reflect.deleteProperty(project, 'keywords');
|
|
215
228
|
}
|
|
229
|
+
const legalNameOutput = await CliUtilityInitialize.promptWithCancel({
|
|
230
|
+
type: 'text',
|
|
231
|
+
name: 'projectLegalName',
|
|
232
|
+
message: 'Legal name (for licenses and copyright notices)',
|
|
233
|
+
initial: (typeof existingProjectLegalName === 'string') ? existingProjectLegalName : '',
|
|
234
|
+
});
|
|
235
|
+
if (legalNameOutput['cancelled'] === true) {
|
|
236
|
+
return 'back';
|
|
237
|
+
}
|
|
238
|
+
const projectLegalNameInput = CliUtilityInitialize.normalizeText(legalNameOutput['result'].projectLegalName, Infinity)['sanitized'];
|
|
239
|
+
if (projectLegalNameInput !== undefined) {
|
|
240
|
+
project.legalName = projectLegalNameInput;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
Reflect.deleteProperty(project, 'legalName');
|
|
244
|
+
}
|
|
245
|
+
const pronounsOutput = await CliUtilityInitialize.promptWithCancel({
|
|
246
|
+
type: 'select',
|
|
247
|
+
name: 'projectPronouns',
|
|
248
|
+
message: 'Pronouns',
|
|
249
|
+
choices: [
|
|
250
|
+
{
|
|
251
|
+
title: 'Business (we/us/our)',
|
|
252
|
+
value: 'business',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
title: 'Personal (I/me/my)',
|
|
256
|
+
value: 'personal',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
initial: (existingProjectPronouns === 'personal') ? 1 : 0,
|
|
260
|
+
});
|
|
261
|
+
if (pronounsOutput['cancelled'] === true) {
|
|
262
|
+
return 'back';
|
|
263
|
+
}
|
|
264
|
+
const projectPronounsInput = pronounsOutput['result'].projectPronouns;
|
|
265
|
+
if (projectPronounsInput !== undefined) {
|
|
266
|
+
project.pronouns = projectPronounsInput;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
Reflect.deleteProperty(project, 'pronouns');
|
|
270
|
+
}
|
|
271
|
+
const platformChoices = [
|
|
272
|
+
{
|
|
273
|
+
title: 'Node.js',
|
|
274
|
+
value: 'nodejs',
|
|
275
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('nodejs') === true,
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
title: 'Swift',
|
|
279
|
+
value: 'swift',
|
|
280
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('swift') === true,
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
title: 'Android',
|
|
284
|
+
value: 'android',
|
|
285
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('android') === true,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
title: 'Java',
|
|
289
|
+
value: 'java',
|
|
290
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('java') === true,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
title: 'Kotlin',
|
|
294
|
+
value: 'kotlin',
|
|
295
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('kotlin') === true,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
title: 'C#',
|
|
299
|
+
value: 'csharp',
|
|
300
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('csharp') === true,
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
title: 'PHP',
|
|
304
|
+
value: 'php',
|
|
305
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('php') === true,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
title: 'Python',
|
|
309
|
+
value: 'python',
|
|
310
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('python') === true,
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
title: 'macOS',
|
|
314
|
+
value: 'macos',
|
|
315
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('macos') === true,
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
title: 'Linux',
|
|
319
|
+
value: 'linux',
|
|
320
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('linux') === true,
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
title: 'Windows',
|
|
324
|
+
value: 'windows',
|
|
325
|
+
selected: existingProjectPlatforms !== undefined && existingProjectPlatforms.includes('windows') === true,
|
|
326
|
+
},
|
|
327
|
+
];
|
|
328
|
+
const platformsOutput = await CliUtilityInitialize.promptWithCancel({
|
|
329
|
+
type: 'multiselect',
|
|
330
|
+
name: 'projectPlatforms',
|
|
331
|
+
message: 'Supported platforms',
|
|
332
|
+
choices: platformChoices,
|
|
333
|
+
});
|
|
334
|
+
if (platformsOutput['cancelled'] === true) {
|
|
335
|
+
return 'back';
|
|
336
|
+
}
|
|
337
|
+
const projectPlatformsInput = platformsOutput['result'].projectPlatforms;
|
|
338
|
+
if (Array.isArray(projectPlatformsInput) === true && projectPlatformsInput.length > 0) {
|
|
339
|
+
project.platforms = projectPlatformsInput;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
Reflect.deleteProperty(project, 'platforms');
|
|
343
|
+
}
|
|
344
|
+
const startingYearOutput = await CliUtilityInitialize.promptWithCancel({
|
|
345
|
+
type: 'text',
|
|
346
|
+
name: 'projectStartingYear',
|
|
347
|
+
message: 'Starting year (e.g. 2025)',
|
|
348
|
+
initial: (existingProjectStartingYear !== undefined) ? String(existingProjectStartingYear) : '',
|
|
349
|
+
validate: (value) => {
|
|
350
|
+
const trimmed = String(value ?? '').trim();
|
|
351
|
+
if (trimmed === '') {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
const parsed = Number(trimmed);
|
|
355
|
+
if (Number.isNaN(parsed) === true
|
|
356
|
+
|| Number.isInteger(parsed) === false
|
|
357
|
+
|| parsed < 1970) {
|
|
358
|
+
return 'Must be an integer >= 1970';
|
|
359
|
+
}
|
|
360
|
+
return true;
|
|
361
|
+
},
|
|
362
|
+
});
|
|
363
|
+
if (startingYearOutput['cancelled'] === true) {
|
|
364
|
+
return 'back';
|
|
365
|
+
}
|
|
366
|
+
const startingYearRaw = String(startingYearOutput['result'].projectStartingYear ?? '').trim();
|
|
367
|
+
const startingYearParsed = (startingYearRaw !== '') ? Number(startingYearRaw) : undefined;
|
|
368
|
+
if (startingYearParsed !== undefined
|
|
369
|
+
&& Number.isInteger(startingYearParsed) === true
|
|
370
|
+
&& startingYearParsed >= 1970) {
|
|
371
|
+
project.startingYear = startingYearParsed;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
Reflect.deleteProperty(project, 'startingYear');
|
|
375
|
+
}
|
|
376
|
+
const licenseChoices = [
|
|
377
|
+
{
|
|
378
|
+
title: 'MIT License',
|
|
379
|
+
value: 'MIT',
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
title: 'Apache License 2.0',
|
|
383
|
+
value: 'Apache-2.0',
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
title: 'GNU General Public License v3.0',
|
|
387
|
+
value: 'GPL-3.0',
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
title: 'GNU General Public License v2.0',
|
|
391
|
+
value: 'GPL-2.0',
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
title: 'GNU Affero General Public License v3.0',
|
|
395
|
+
value: 'AGPL-3.0',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
title: 'GNU Lesser General Public License v2.1',
|
|
399
|
+
value: 'LGPL-2.1',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
title: 'BSD 2-Clause "Simplified" License',
|
|
403
|
+
value: 'BSD-2-Clause',
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
title: 'BSD 3-Clause "New" or "Revised" License',
|
|
407
|
+
value: 'BSD-3-Clause',
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
title: 'Boost Software License 1.0',
|
|
411
|
+
value: 'BSL-1.0',
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
title: 'Creative Commons Zero v1.0 Universal',
|
|
415
|
+
value: 'CC0-1.0',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
title: 'Eclipse Public License 2.0',
|
|
419
|
+
value: 'EPL-2.0',
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
title: 'Mozilla Public License 2.0',
|
|
423
|
+
value: 'MPL-2.0',
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
title: 'Proprietary (All Rights Reserved)',
|
|
427
|
+
value: 'Proprietary',
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
title: 'The Unlicense',
|
|
431
|
+
value: 'Unlicense',
|
|
432
|
+
},
|
|
433
|
+
];
|
|
434
|
+
const licenseInitialIndex = licenseChoices.findIndex((choice) => choice['value'] === existingProjectLicense);
|
|
435
|
+
const licenseOutput = await CliUtilityInitialize.promptWithCancel({
|
|
436
|
+
type: 'select',
|
|
437
|
+
name: 'projectLicense',
|
|
438
|
+
message: 'License',
|
|
439
|
+
choices: licenseChoices,
|
|
440
|
+
initial: (licenseInitialIndex !== -1) ? licenseInitialIndex : 0,
|
|
441
|
+
});
|
|
442
|
+
if (licenseOutput['cancelled'] === true) {
|
|
443
|
+
return 'back';
|
|
444
|
+
}
|
|
445
|
+
const projectLicenseInput = licenseOutput['result'].projectLicense;
|
|
446
|
+
if (projectLicenseInput !== undefined) {
|
|
447
|
+
project.license = projectLicenseInput;
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
Reflect.deleteProperty(project, 'license');
|
|
451
|
+
}
|
|
216
452
|
if (Object.keys(project).length > 0) {
|
|
217
453
|
Object.assign(config, { project });
|
|
218
454
|
}
|
|
219
455
|
else {
|
|
220
456
|
Reflect.deleteProperty(config, 'project');
|
|
221
457
|
}
|
|
222
|
-
const previousSlug = (existingProjectName !== undefined) ? existingProjectName
|
|
223
|
-
const currentSlug = (config
|
|
458
|
+
const previousSlug = (existingProjectName !== undefined) ? existingProjectName['slug'] ?? '' : '';
|
|
459
|
+
const currentSlug = (config['project'] !== undefined && config['project']['name'] !== undefined) ? config['project']['name']['slug'] ?? '' : '';
|
|
224
460
|
const slugChanged = previousSlug !== currentSlug;
|
|
225
|
-
if (slugChanged && config
|
|
226
|
-
const rolesToSync = [...
|
|
461
|
+
if (slugChanged === true && config['workspaces'] !== undefined) {
|
|
462
|
+
const rolesToSync = [...libItemSyncRoles];
|
|
227
463
|
const slugPrefix = new RegExp(`^${previousSlug}-`);
|
|
464
|
+
const previousLabel = (previousSlug !== '') ? previousSlug : '(unset)';
|
|
465
|
+
const currentLabel = (currentSlug !== '') ? currentSlug : '(unset)';
|
|
228
466
|
Logger.customize({
|
|
229
|
-
name: '
|
|
467
|
+
name: 'CliUtilityInitialize.promptProject',
|
|
230
468
|
purpose: 'updated',
|
|
231
469
|
padTop: 1,
|
|
232
|
-
}).info(`Project slug updated from "${
|
|
233
|
-
for (const workspace of Object.values(config
|
|
234
|
-
if (rolesToSync.includes(workspace
|
|
470
|
+
}).info(`Project slug updated from "${previousLabel}" to "${currentLabel}".`);
|
|
471
|
+
for (const workspace of Object.values(config['workspaces'])) {
|
|
472
|
+
if (rolesToSync.includes(workspace['role']) === false) {
|
|
235
473
|
continue;
|
|
236
474
|
}
|
|
237
|
-
const name = workspace
|
|
475
|
+
const name = workspace['name'];
|
|
238
476
|
if (previousSlug === '' && currentSlug !== '') {
|
|
239
477
|
workspace.name = `${currentSlug}-${name}`;
|
|
240
478
|
}
|
|
@@ -245,26 +483,26 @@ export class CLIUtilityInitialize {
|
|
|
245
483
|
workspace.name = name.replace(slugPrefix, `${currentSlug}-`);
|
|
246
484
|
}
|
|
247
485
|
Logger.customize({
|
|
248
|
-
name: '
|
|
486
|
+
name: 'CliUtilityInitialize.promptProject',
|
|
249
487
|
purpose: 'updated',
|
|
250
|
-
}).info(`Workspace name updated from "${name}" to "${workspace
|
|
488
|
+
}).info(`Workspace name updated from "${name}" to "${workspace['name']}".`);
|
|
251
489
|
}
|
|
252
490
|
}
|
|
253
491
|
Logger.customize({
|
|
254
|
-
name: '
|
|
492
|
+
name: 'CliUtilityInitialize.promptProject',
|
|
255
493
|
purpose: 'updated',
|
|
256
|
-
padTop: (slugChanged && config
|
|
494
|
+
padTop: (slugChanged === true && config['workspaces'] !== undefined) ? 0 : 1,
|
|
257
495
|
padBottom: 1,
|
|
258
496
|
}).info('Project details updated.');
|
|
259
497
|
return 'back';
|
|
260
498
|
}
|
|
261
499
|
static async promptEntities(config) {
|
|
262
500
|
const entities = [];
|
|
263
|
-
if (Array.isArray(config
|
|
264
|
-
for (const configEntity of config
|
|
501
|
+
if (Array.isArray(config['entities']) === true) {
|
|
502
|
+
for (const configEntity of config['entities']) {
|
|
265
503
|
const clonedEntity = { ...configEntity };
|
|
266
|
-
if (Array.isArray(configEntity
|
|
267
|
-
clonedEntity.roles = [...configEntity
|
|
504
|
+
if (Array.isArray(configEntity['roles']) === true) {
|
|
505
|
+
clonedEntity.roles = [...configEntity['roles']];
|
|
268
506
|
}
|
|
269
507
|
else {
|
|
270
508
|
Reflect.deleteProperty(clonedEntity, 'roles');
|
|
@@ -276,8 +514,8 @@ export class CLIUtilityInitialize {
|
|
|
276
514
|
if (entities.length > 0) {
|
|
277
515
|
const normalizedEntities = entities.map((entity) => {
|
|
278
516
|
const normalizedEntity = { ...entity };
|
|
279
|
-
if (Array.isArray(entity
|
|
280
|
-
normalizedEntity.roles = [...entity
|
|
517
|
+
if (Array.isArray(entity['roles']) === true && entity['roles'].length > 0) {
|
|
518
|
+
normalizedEntity.roles = [...entity['roles']];
|
|
281
519
|
}
|
|
282
520
|
else {
|
|
283
521
|
Reflect.deleteProperty(normalizedEntity, 'roles');
|
|
@@ -289,18 +527,30 @@ export class CLIUtilityInitialize {
|
|
|
289
527
|
else {
|
|
290
528
|
Reflect.deleteProperty(config, 'entities');
|
|
291
529
|
}
|
|
530
|
+
return;
|
|
292
531
|
};
|
|
293
532
|
while (true) {
|
|
533
|
+
entities.sort((a, b) => {
|
|
534
|
+
const nameA = (a !== undefined && a['name'] !== undefined) ? a['name'] : '';
|
|
535
|
+
const nameB = (b !== undefined && b['name'] !== undefined) ? b['name'] : '';
|
|
536
|
+
return nameA.localeCompare(nameB);
|
|
537
|
+
});
|
|
294
538
|
const choices = [];
|
|
295
539
|
for (let i = 0; i < entities.length; i += 1) {
|
|
296
540
|
const entity = entities[i];
|
|
297
541
|
if (entity === undefined) {
|
|
298
542
|
continue;
|
|
299
543
|
}
|
|
300
|
-
const entityName = (entity
|
|
301
|
-
const entityEmail = (entity
|
|
302
|
-
const entityRoles = (Array.isArray(entity
|
|
303
|
-
|
|
544
|
+
const entityName = (entity['name'] !== undefined) ? entity['name'].trim() : '';
|
|
545
|
+
const entityEmail = (entity['email'] !== undefined) ? entity['email'].trim() : '';
|
|
546
|
+
const entityRoles = (Array.isArray(entity['roles']) === true) ? entity['roles'].filter((role) => role.trim() !== '') : [];
|
|
547
|
+
let label = `Entity ${i + 1}`;
|
|
548
|
+
if (entityName !== '') {
|
|
549
|
+
label = entityName;
|
|
550
|
+
}
|
|
551
|
+
else if (entityEmail !== '') {
|
|
552
|
+
label = entityEmail;
|
|
553
|
+
}
|
|
304
554
|
const descriptionParts = [];
|
|
305
555
|
if (entityEmail !== '') {
|
|
306
556
|
descriptionParts.push(entityEmail);
|
|
@@ -316,7 +566,8 @@ export class CLIUtilityInitialize {
|
|
|
316
566
|
return unique;
|
|
317
567
|
}, []);
|
|
318
568
|
if (normalizedRoles.length > 0) {
|
|
319
|
-
|
|
569
|
+
const joinedRoles = normalizedRoles.join(', ');
|
|
570
|
+
descriptionParts.push(joinedRoles);
|
|
320
571
|
}
|
|
321
572
|
}
|
|
322
573
|
const description = descriptionParts.join(' · ');
|
|
@@ -351,58 +602,58 @@ export class CLIUtilityInitialize {
|
|
|
351
602
|
kind: 'back',
|
|
352
603
|
},
|
|
353
604
|
});
|
|
354
|
-
const menuOutput = await
|
|
605
|
+
const menuOutput = await CliUtilityInitialize.promptWithCancel({
|
|
355
606
|
type: 'select',
|
|
356
607
|
name: 'action',
|
|
357
608
|
message: (entities.length > 0) ? 'Select an entity to manage.' : 'No entities found. Choose an option.',
|
|
358
609
|
choices,
|
|
359
610
|
});
|
|
360
|
-
if (menuOutput
|
|
611
|
+
if (menuOutput['cancelled'] === true) {
|
|
361
612
|
return 'back';
|
|
362
613
|
}
|
|
363
|
-
const menuOutputResult = menuOutput
|
|
614
|
+
const menuOutputResult = menuOutput['result'];
|
|
364
615
|
if (menuOutputResult.action === undefined
|
|
365
|
-
|| menuOutputResult.action
|
|
616
|
+
|| menuOutputResult.action['kind'] === 'back') {
|
|
366
617
|
sync();
|
|
367
618
|
return 'back';
|
|
368
619
|
}
|
|
369
|
-
if (menuOutputResult.action
|
|
370
|
-
const result = await
|
|
371
|
-
if (result
|
|
620
|
+
if (menuOutputResult.action['kind'] === 'add') {
|
|
621
|
+
const result = await CliUtilityInitialize.promptEntitiesForm(undefined, 'create');
|
|
622
|
+
if (result['action'] === 'back') {
|
|
372
623
|
continue;
|
|
373
624
|
}
|
|
374
|
-
entities.push(result
|
|
625
|
+
entities.push(result['entity']);
|
|
375
626
|
sync();
|
|
376
627
|
Logger.customize({
|
|
377
|
-
name: '
|
|
628
|
+
name: 'CliUtilityInitialize.promptEntities',
|
|
378
629
|
purpose: 'add',
|
|
379
630
|
padTop: 1,
|
|
380
631
|
padBottom: 1,
|
|
381
632
|
}).info('Added new entity.');
|
|
382
633
|
continue;
|
|
383
634
|
}
|
|
384
|
-
if (menuOutputResult.action
|
|
385
|
-
const entityIndex = menuOutputResult.action
|
|
635
|
+
if (menuOutputResult.action['kind'] === 'edit') {
|
|
636
|
+
const entityIndex = menuOutputResult.action['index'];
|
|
386
637
|
if (entityIndex < 0 || entityIndex >= entities.length) {
|
|
387
638
|
continue;
|
|
388
639
|
}
|
|
389
640
|
const entityToEdit = entities[entityIndex];
|
|
390
|
-
const entityResult = await
|
|
391
|
-
if (entityResult
|
|
641
|
+
const entityResult = await CliUtilityInitialize.promptEntitiesForm(entityToEdit, 'update');
|
|
642
|
+
if (entityResult['action'] === 'back') {
|
|
392
643
|
continue;
|
|
393
644
|
}
|
|
394
|
-
Reflect.set(entities, entityIndex, entityResult
|
|
645
|
+
Reflect.set(entities, entityIndex, entityResult['entity']);
|
|
395
646
|
sync();
|
|
396
647
|
Logger.customize({
|
|
397
|
-
name: '
|
|
648
|
+
name: 'CliUtilityInitialize.promptEntities',
|
|
398
649
|
purpose: 'edit',
|
|
399
650
|
padTop: 1,
|
|
400
651
|
padBottom: 1,
|
|
401
652
|
}).info('Updated entity.');
|
|
402
653
|
continue;
|
|
403
654
|
}
|
|
404
|
-
if (menuOutputResult.action
|
|
405
|
-
const entityIndex = menuOutputResult.action
|
|
655
|
+
if (menuOutputResult.action['kind'] === 'remove') {
|
|
656
|
+
const entityIndex = menuOutputResult.action['index'];
|
|
406
657
|
if (entityIndex < 0 || entityIndex >= entities.length) {
|
|
407
658
|
continue;
|
|
408
659
|
}
|
|
@@ -410,17 +661,23 @@ export class CLIUtilityInitialize {
|
|
|
410
661
|
if (entityToRemove === undefined) {
|
|
411
662
|
continue;
|
|
412
663
|
}
|
|
413
|
-
const entityName = (typeof entityToRemove
|
|
414
|
-
const entityEmail = (typeof entityToRemove
|
|
415
|
-
|
|
416
|
-
|
|
664
|
+
const entityName = (typeof entityToRemove['name'] === 'string') ? entityToRemove['name'].trim() : '';
|
|
665
|
+
const entityEmail = (typeof entityToRemove['email'] === 'string') ? entityToRemove['email'].trim() : '';
|
|
666
|
+
let entityLabel = `Entity ${entityIndex + 1}`;
|
|
667
|
+
if (entityName !== '') {
|
|
668
|
+
entityLabel = entityName;
|
|
669
|
+
}
|
|
670
|
+
else if (entityEmail !== '') {
|
|
671
|
+
entityLabel = entityEmail;
|
|
672
|
+
}
|
|
673
|
+
const shouldRemove = await CliUtilityInitialize.promptEntitiesDeleteForm(entityLabel);
|
|
417
674
|
if (shouldRemove !== true) {
|
|
418
675
|
continue;
|
|
419
676
|
}
|
|
420
677
|
entities.splice(entityIndex, 1);
|
|
421
678
|
sync();
|
|
422
679
|
Logger.customize({
|
|
423
|
-
name: '
|
|
680
|
+
name: 'CliUtilityInitialize.promptEntities',
|
|
424
681
|
purpose: 'remove',
|
|
425
682
|
padTop: 1,
|
|
426
683
|
padBottom: 1,
|
|
@@ -429,35 +686,35 @@ export class CLIUtilityInitialize {
|
|
|
429
686
|
}
|
|
430
687
|
}
|
|
431
688
|
static async promptEntitiesForm(entity, mode) {
|
|
432
|
-
const validRoles = [...
|
|
433
|
-
const existingName = (entity !== undefined && typeof entity
|
|
434
|
-
const existingEmail = (entity !== undefined && typeof entity
|
|
435
|
-
const existingUrl = (entity !== undefined && typeof entity
|
|
689
|
+
const validRoles = [...libItemValidEntityRoles];
|
|
690
|
+
const existingName = (entity !== undefined && typeof entity['name'] === 'string') ? entity['name'] : '';
|
|
691
|
+
const existingEmail = (entity !== undefined && typeof entity['email'] === 'string') ? entity['email'] : '';
|
|
692
|
+
const existingUrl = (entity !== undefined && typeof entity['url'] === 'string') ? entity['url'] : '';
|
|
436
693
|
let existingRoles = [];
|
|
437
|
-
if (entity !== undefined && Array.isArray(entity
|
|
438
|
-
existingRoles = entity
|
|
694
|
+
if (entity !== undefined && Array.isArray(entity['roles']) === true) {
|
|
695
|
+
existingRoles = entity['roles'].filter((role) => validRoles.includes(role));
|
|
439
696
|
}
|
|
440
|
-
const questionsOutput = await
|
|
697
|
+
const questionsOutput = await CliUtilityInitialize.promptWithCancel([
|
|
441
698
|
{
|
|
442
699
|
type: 'text',
|
|
443
700
|
name: 'entityName',
|
|
444
701
|
message: 'Entity name',
|
|
445
702
|
initial: existingName,
|
|
446
|
-
validate: (value) =>
|
|
703
|
+
validate: (value) => CliUtilityInitialize.normalizeText(value, Infinity)['result'],
|
|
447
704
|
},
|
|
448
705
|
{
|
|
449
706
|
type: 'text',
|
|
450
707
|
name: 'entityEmail',
|
|
451
708
|
message: 'Entity email address',
|
|
452
709
|
initial: existingEmail,
|
|
453
|
-
validate: (value) =>
|
|
710
|
+
validate: (value) => CliUtilityInitialize.normalizeEmail(value)['result'],
|
|
454
711
|
},
|
|
455
712
|
{
|
|
456
713
|
type: 'text',
|
|
457
714
|
name: 'entityUrl',
|
|
458
715
|
message: 'Entity website',
|
|
459
716
|
initial: existingUrl,
|
|
460
|
-
validate: (value) =>
|
|
717
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
461
718
|
},
|
|
462
719
|
{
|
|
463
720
|
type: 'multiselect',
|
|
@@ -470,16 +727,16 @@ export class CLIUtilityInitialize {
|
|
|
470
727
|
})),
|
|
471
728
|
},
|
|
472
729
|
]);
|
|
473
|
-
if (questionsOutput
|
|
730
|
+
if (questionsOutput['cancelled'] === true) {
|
|
474
731
|
return {
|
|
475
732
|
action: 'back',
|
|
476
733
|
};
|
|
477
734
|
}
|
|
478
|
-
const questionsOutputResult = questionsOutput
|
|
479
|
-
const entityNameInput =
|
|
480
|
-
const entityEmailInput =
|
|
481
|
-
const entityUrlInput =
|
|
482
|
-
const entityRolesInput = Array.isArray(questionsOutputResult.entityRoles) ? [...questionsOutputResult.entityRoles] : [];
|
|
735
|
+
const questionsOutputResult = questionsOutput['result'];
|
|
736
|
+
const entityNameInput = CliUtilityInitialize.normalizeText(questionsOutputResult.entityName, Infinity)['sanitized'];
|
|
737
|
+
const entityEmailInput = CliUtilityInitialize.normalizeEmail(questionsOutputResult.entityEmail)['sanitized'];
|
|
738
|
+
const entityUrlInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.entityUrl, 'generic')['sanitized'];
|
|
739
|
+
const entityRolesInput = (Array.isArray(questionsOutputResult.entityRoles) === true) ? [...questionsOutputResult.entityRoles] : [];
|
|
483
740
|
const resolvedEntity = {};
|
|
484
741
|
if (entityNameInput !== undefined) {
|
|
485
742
|
resolvedEntity.name = entityNameInput;
|
|
@@ -504,35 +761,33 @@ export class CLIUtilityInitialize {
|
|
|
504
761
|
};
|
|
505
762
|
}
|
|
506
763
|
static async promptEntitiesDeleteForm(label) {
|
|
507
|
-
const confirmOutput = await
|
|
764
|
+
const confirmOutput = await CliUtilityInitialize.promptWithCancel({
|
|
508
765
|
type: 'confirm',
|
|
509
766
|
name: 'confirm',
|
|
510
767
|
message: `Remove entity "${label}"?`,
|
|
511
768
|
initial: false,
|
|
512
769
|
});
|
|
513
|
-
if (confirmOutput
|
|
770
|
+
if (confirmOutput['cancelled'] === true) {
|
|
514
771
|
return false;
|
|
515
772
|
}
|
|
516
|
-
const confirmOutputResult = confirmOutput
|
|
773
|
+
const confirmOutputResult = confirmOutput['result'];
|
|
517
774
|
return confirmOutputResult.confirm;
|
|
518
775
|
}
|
|
519
776
|
static async promptEmails(config) {
|
|
520
|
-
const existingEmails = config
|
|
777
|
+
const existingEmails = config['emails'];
|
|
521
778
|
const emails = (existingEmails !== undefined) ? { ...existingEmails } : {};
|
|
522
|
-
const questionsOutput = await
|
|
523
|
-
{
|
|
779
|
+
const questionsOutput = await CliUtilityInitialize.promptWithCancel([{
|
|
524
780
|
type: 'text',
|
|
525
781
|
name: 'emailsBugs',
|
|
526
782
|
message: 'Issue tracker email',
|
|
527
|
-
initial: emails
|
|
528
|
-
validate: (value) =>
|
|
529
|
-
}
|
|
530
|
-
])
|
|
531
|
-
if (questionsOutput.cancelled) {
|
|
783
|
+
initial: emails['bugs'] ?? '',
|
|
784
|
+
validate: (value) => CliUtilityInitialize.normalizeEmail(value)['result'],
|
|
785
|
+
}]);
|
|
786
|
+
if (questionsOutput['cancelled'] === true) {
|
|
532
787
|
return 'back';
|
|
533
788
|
}
|
|
534
|
-
const questionsOutputResult = questionsOutput
|
|
535
|
-
const emailsBugsInput =
|
|
789
|
+
const questionsOutputResult = questionsOutput['result'];
|
|
790
|
+
const emailsBugsInput = CliUtilityInitialize.normalizeEmail(questionsOutputResult.emailsBugs)['sanitized'];
|
|
536
791
|
if (emailsBugsInput !== undefined) {
|
|
537
792
|
emails.bugs = emailsBugsInput;
|
|
538
793
|
}
|
|
@@ -546,7 +801,7 @@ export class CLIUtilityInitialize {
|
|
|
546
801
|
Reflect.deleteProperty(config, 'emails');
|
|
547
802
|
}
|
|
548
803
|
Logger.customize({
|
|
549
|
-
name: '
|
|
804
|
+
name: 'CliUtilityInitialize.promptEmails',
|
|
550
805
|
purpose: 'updated',
|
|
551
806
|
padTop: 1,
|
|
552
807
|
padBottom: 1,
|
|
@@ -554,86 +809,110 @@ export class CLIUtilityInitialize {
|
|
|
554
809
|
return 'back';
|
|
555
810
|
}
|
|
556
811
|
static async promptUrls(config) {
|
|
557
|
-
const existingUrls = config
|
|
812
|
+
const existingUrls = config['urls'];
|
|
558
813
|
const urls = (existingUrls !== undefined) ? { ...existingUrls } : {};
|
|
559
|
-
const questionsOutput = await
|
|
814
|
+
const questionsOutput = await CliUtilityInitialize.promptWithCancel([
|
|
560
815
|
{
|
|
561
816
|
type: 'text',
|
|
562
817
|
name: 'urlsHomepage',
|
|
563
818
|
message: 'Homepage URL',
|
|
564
|
-
initial: urls
|
|
565
|
-
validate: (value) =>
|
|
819
|
+
initial: urls['homepage'] ?? '',
|
|
820
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
566
821
|
},
|
|
567
822
|
{
|
|
568
823
|
type: 'text',
|
|
569
824
|
name: 'urlsRepository',
|
|
570
825
|
message: 'Repository URL',
|
|
571
|
-
initial: urls
|
|
572
|
-
validate: (value) =>
|
|
826
|
+
initial: urls['repository'] ?? '',
|
|
827
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'repository')['result'],
|
|
573
828
|
},
|
|
574
829
|
{
|
|
575
830
|
type: 'text',
|
|
576
831
|
name: 'urlsBugs',
|
|
577
832
|
message: 'Issue tracker URL',
|
|
578
|
-
initial: urls
|
|
579
|
-
validate: (value) =>
|
|
833
|
+
initial: urls['bugs'] ?? '',
|
|
834
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
580
835
|
},
|
|
581
836
|
{
|
|
582
837
|
type: 'text',
|
|
583
838
|
name: 'urlsLicense',
|
|
584
839
|
message: 'License URL',
|
|
585
|
-
initial: urls
|
|
586
|
-
validate: (value) =>
|
|
840
|
+
initial: urls['license'] ?? '',
|
|
841
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
587
842
|
},
|
|
588
843
|
{
|
|
589
844
|
type: 'text',
|
|
590
845
|
name: 'urlsLogo',
|
|
591
846
|
message: 'Logo URL',
|
|
592
|
-
initial: urls
|
|
593
|
-
validate: (value) =>
|
|
847
|
+
initial: urls['logo'] ?? '',
|
|
848
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
594
849
|
},
|
|
595
850
|
{
|
|
596
851
|
type: 'text',
|
|
597
852
|
name: 'urlsDocumentation',
|
|
598
853
|
message: 'Documentation URL',
|
|
599
|
-
initial: urls
|
|
600
|
-
validate: (value) =>
|
|
854
|
+
initial: urls['documentation'] ?? '',
|
|
855
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
601
856
|
},
|
|
602
857
|
{
|
|
603
858
|
type: 'text',
|
|
604
859
|
name: 'urlsGithub',
|
|
605
860
|
message: 'GitHub URL',
|
|
606
|
-
initial: urls
|
|
607
|
-
validate: (value) =>
|
|
861
|
+
initial: urls['github'] ?? '',
|
|
862
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
608
863
|
},
|
|
609
864
|
{
|
|
610
865
|
type: 'text',
|
|
611
866
|
name: 'urlsNpm',
|
|
612
867
|
message: 'npm package URL',
|
|
613
|
-
initial: urls
|
|
614
|
-
validate: (value) =>
|
|
868
|
+
initial: urls['npm'] ?? '',
|
|
869
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
type: 'text',
|
|
873
|
+
name: 'urlsDocker',
|
|
874
|
+
message: 'Docker Hub URL',
|
|
875
|
+
initial: urls['docker'] ?? '',
|
|
876
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
615
877
|
},
|
|
616
878
|
{
|
|
617
879
|
type: 'text',
|
|
618
880
|
name: 'urlsFundSources',
|
|
619
881
|
message: 'Funding URLs (comma separated)',
|
|
620
|
-
initial: (Array.isArray(urls
|
|
621
|
-
validate: (value) =>
|
|
882
|
+
initial: (Array.isArray(urls['fundSources']) === true) ? urls['fundSources'].join(', ') : '',
|
|
883
|
+
validate: (value) => CliUtilityInitialize.normalizeUrlArray(value, 'generic')['result'],
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
type: 'text',
|
|
887
|
+
name: 'urlsPrivacyPolicy',
|
|
888
|
+
message: 'Privacy policy URL',
|
|
889
|
+
initial: urls['privacyPolicy'] ?? '',
|
|
890
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
type: 'text',
|
|
894
|
+
name: 'urlsTermsOfUse',
|
|
895
|
+
message: 'Terms of use URL',
|
|
896
|
+
initial: urls['termsOfUse'] ?? '',
|
|
897
|
+
validate: (value) => CliUtilityInitialize.normalizeUrl(value, 'generic')['result'],
|
|
622
898
|
},
|
|
623
899
|
]);
|
|
624
|
-
if (questionsOutput
|
|
900
|
+
if (questionsOutput['cancelled'] === true) {
|
|
625
901
|
return 'back';
|
|
626
902
|
}
|
|
627
|
-
const questionsOutputResult = questionsOutput
|
|
628
|
-
const urlsHomepageInput =
|
|
629
|
-
const urlsRepositoryInput =
|
|
630
|
-
const urlsBugsInput =
|
|
631
|
-
const urlsLicenseInput =
|
|
632
|
-
const urlsLogoInput =
|
|
633
|
-
const urlsDocumentationInput =
|
|
634
|
-
const urlsGithubInput =
|
|
635
|
-
const urlsNpmInput =
|
|
636
|
-
const
|
|
903
|
+
const questionsOutputResult = questionsOutput['result'];
|
|
904
|
+
const urlsHomepageInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsHomepage, 'generic')['sanitized'];
|
|
905
|
+
const urlsRepositoryInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsRepository, 'repository')['sanitized'];
|
|
906
|
+
const urlsBugsInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsBugs, 'generic')['sanitized'];
|
|
907
|
+
const urlsLicenseInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsLicense, 'generic')['sanitized'];
|
|
908
|
+
const urlsLogoInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsLogo, 'generic')['sanitized'];
|
|
909
|
+
const urlsDocumentationInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsDocumentation, 'generic')['sanitized'];
|
|
910
|
+
const urlsGithubInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsGithub, 'generic')['sanitized'];
|
|
911
|
+
const urlsNpmInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsNpm, 'generic')['sanitized'];
|
|
912
|
+
const urlsDockerInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsDocker, 'generic')['sanitized'];
|
|
913
|
+
const urlsFundSourcesInput = CliUtilityInitialize.normalizeUrlArray(questionsOutputResult.urlsFundSources, 'generic')['sanitized'];
|
|
914
|
+
const urlsPrivacyPolicyInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsPrivacyPolicy, 'generic')['sanitized'];
|
|
915
|
+
const urlsTermsOfUseInput = CliUtilityInitialize.normalizeUrl(questionsOutputResult.urlsTermsOfUse, 'generic')['sanitized'];
|
|
637
916
|
if (urlsHomepageInput !== undefined) {
|
|
638
917
|
urls.homepage = urlsHomepageInput;
|
|
639
918
|
}
|
|
@@ -682,12 +961,30 @@ export class CLIUtilityInitialize {
|
|
|
682
961
|
else {
|
|
683
962
|
Reflect.deleteProperty(urls, 'npm');
|
|
684
963
|
}
|
|
964
|
+
if (urlsDockerInput !== undefined) {
|
|
965
|
+
urls.docker = urlsDockerInput;
|
|
966
|
+
}
|
|
967
|
+
else {
|
|
968
|
+
Reflect.deleteProperty(urls, 'docker');
|
|
969
|
+
}
|
|
685
970
|
if (urlsFundSourcesInput !== undefined) {
|
|
686
971
|
urls.fundSources = urlsFundSourcesInput;
|
|
687
972
|
}
|
|
688
973
|
else {
|
|
689
974
|
Reflect.deleteProperty(urls, 'fundSources');
|
|
690
975
|
}
|
|
976
|
+
if (urlsPrivacyPolicyInput !== undefined) {
|
|
977
|
+
urls.privacyPolicy = urlsPrivacyPolicyInput;
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
Reflect.deleteProperty(urls, 'privacyPolicy');
|
|
981
|
+
}
|
|
982
|
+
if (urlsTermsOfUseInput !== undefined) {
|
|
983
|
+
urls.termsOfUse = urlsTermsOfUseInput;
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
Reflect.deleteProperty(urls, 'termsOfUse');
|
|
987
|
+
}
|
|
691
988
|
if (Object.keys(urls).length > 0) {
|
|
692
989
|
Object.assign(config, { urls });
|
|
693
990
|
}
|
|
@@ -695,39 +992,437 @@ export class CLIUtilityInitialize {
|
|
|
695
992
|
Reflect.deleteProperty(config, 'urls');
|
|
696
993
|
}
|
|
697
994
|
Logger.customize({
|
|
698
|
-
name: '
|
|
995
|
+
name: 'CliUtilityInitialize.promptUrls',
|
|
699
996
|
purpose: 'updated',
|
|
700
997
|
padTop: 1,
|
|
701
998
|
padBottom: 1,
|
|
702
999
|
}).info('URL references updated.');
|
|
703
1000
|
return 'back';
|
|
704
1001
|
}
|
|
1002
|
+
static async promptWorkflows(config) {
|
|
1003
|
+
const workflows = [];
|
|
1004
|
+
if (Array.isArray(config['workflows']) === true) {
|
|
1005
|
+
for (const configWorkflow of config['workflows']) {
|
|
1006
|
+
const clonedWorkflow = { ...configWorkflow };
|
|
1007
|
+
if (Array.isArray(configWorkflow['triggers']) === true) {
|
|
1008
|
+
clonedWorkflow.triggers = [...configWorkflow['triggers']];
|
|
1009
|
+
}
|
|
1010
|
+
if (configWorkflow['settings'] !== undefined) {
|
|
1011
|
+
clonedWorkflow.settings = { ...configWorkflow['settings'] };
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
Reflect.deleteProperty(clonedWorkflow, 'settings');
|
|
1015
|
+
}
|
|
1016
|
+
workflows.push(clonedWorkflow);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
const sync = () => {
|
|
1020
|
+
if (workflows.length > 0) {
|
|
1021
|
+
const normalizedWorkflows = workflows.map((workflow) => {
|
|
1022
|
+
const normalizedWorkflow = { ...workflow };
|
|
1023
|
+
if (Array.isArray(workflow['triggers']) === true && workflow['triggers'].length > 0) {
|
|
1024
|
+
normalizedWorkflow.triggers = [...workflow['triggers']];
|
|
1025
|
+
}
|
|
1026
|
+
if (Array.isArray(workflow['depends-on']) === true && workflow['depends-on'].length > 0) {
|
|
1027
|
+
Reflect.set(normalizedWorkflow, 'depends-on', [...workflow['depends-on']]);
|
|
1028
|
+
}
|
|
1029
|
+
else {
|
|
1030
|
+
Reflect.deleteProperty(normalizedWorkflow, 'depends-on');
|
|
1031
|
+
}
|
|
1032
|
+
if (workflow['settings'] !== undefined && Object.keys(workflow['settings']).length > 0) {
|
|
1033
|
+
normalizedWorkflow.settings = { ...workflow['settings'] };
|
|
1034
|
+
}
|
|
1035
|
+
else {
|
|
1036
|
+
Reflect.deleteProperty(normalizedWorkflow, 'settings');
|
|
1037
|
+
}
|
|
1038
|
+
return normalizedWorkflow;
|
|
1039
|
+
});
|
|
1040
|
+
Object.assign(config, { workflows: normalizedWorkflows });
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
Reflect.deleteProperty(config, 'workflows');
|
|
1044
|
+
}
|
|
1045
|
+
return;
|
|
1046
|
+
};
|
|
1047
|
+
while (true) {
|
|
1048
|
+
workflows.sort((a, b) => {
|
|
1049
|
+
const templateA = (a !== undefined && typeof a['template'] === 'string') ? a['template'] : '';
|
|
1050
|
+
const templateB = (b !== undefined && typeof b['template'] === 'string') ? b['template'] : '';
|
|
1051
|
+
const templateCompare = templateA.localeCompare(templateB);
|
|
1052
|
+
if (templateCompare !== 0) {
|
|
1053
|
+
return templateCompare;
|
|
1054
|
+
}
|
|
1055
|
+
const suffixA = (a !== undefined && typeof a['suffix'] === 'string') ? a['suffix'] : '';
|
|
1056
|
+
const suffixB = (b !== undefined && typeof b['suffix'] === 'string') ? b['suffix'] : '';
|
|
1057
|
+
return suffixA.localeCompare(suffixB);
|
|
1058
|
+
});
|
|
1059
|
+
const choices = [];
|
|
1060
|
+
for (let i = 0; i < workflows.length; i += 1) {
|
|
1061
|
+
const workflow = workflows[i];
|
|
1062
|
+
if (workflow === undefined) {
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
const template = (typeof workflow['template'] === 'string') ? workflow['template'].trim() : '';
|
|
1066
|
+
const suffix = (typeof workflow['suffix'] === 'string') ? workflow['suffix'].trim() : '';
|
|
1067
|
+
const triggers = (Array.isArray(workflow['triggers']) === true) ? workflow['triggers'] : [];
|
|
1068
|
+
let label = `Workflow ${i + 1}`;
|
|
1069
|
+
if (template !== '' && suffix !== '') {
|
|
1070
|
+
label = `${template}-${suffix}`;
|
|
1071
|
+
}
|
|
1072
|
+
else if (template !== '') {
|
|
1073
|
+
label = template;
|
|
1074
|
+
}
|
|
1075
|
+
const triggersLabel = (triggers.length > 0) ? ` [${triggers.join(', ')}]` : '';
|
|
1076
|
+
const outputFileName = (suffix !== '') ? `nova-${template}-${suffix}.yml` : `nova-${template}.yml`;
|
|
1077
|
+
const description = (template !== '') ? `${outputFileName}${triggersLabel}` : 'Update this workflow.';
|
|
1078
|
+
choices.push({
|
|
1079
|
+
title: `${chalk.yellow.bold('[EDIT]')} ${label}`,
|
|
1080
|
+
description,
|
|
1081
|
+
value: {
|
|
1082
|
+
kind: 'edit',
|
|
1083
|
+
index: i,
|
|
1084
|
+
},
|
|
1085
|
+
});
|
|
1086
|
+
choices.push({
|
|
1087
|
+
title: `${chalk.red.bold('[REMOVE]')} ${label}`,
|
|
1088
|
+
description: 'Delete this workflow.',
|
|
1089
|
+
value: {
|
|
1090
|
+
kind: 'remove',
|
|
1091
|
+
index: i,
|
|
1092
|
+
},
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
choices.push({
|
|
1096
|
+
title: 'Add new workflow',
|
|
1097
|
+
description: 'Create a new workflow.',
|
|
1098
|
+
value: {
|
|
1099
|
+
kind: 'add',
|
|
1100
|
+
},
|
|
1101
|
+
});
|
|
1102
|
+
choices.push({
|
|
1103
|
+
title: 'Back',
|
|
1104
|
+
description: 'Return to the category selection.',
|
|
1105
|
+
value: {
|
|
1106
|
+
kind: 'back',
|
|
1107
|
+
},
|
|
1108
|
+
});
|
|
1109
|
+
const menuOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1110
|
+
type: 'select',
|
|
1111
|
+
name: 'action',
|
|
1112
|
+
message: (workflows.length > 0) ? 'Select a workflow to manage.' : 'No workflows found. Choose an option.',
|
|
1113
|
+
choices,
|
|
1114
|
+
});
|
|
1115
|
+
if (menuOutput['cancelled'] === true) {
|
|
1116
|
+
return 'back';
|
|
1117
|
+
}
|
|
1118
|
+
const menuOutputResult = menuOutput['result'];
|
|
1119
|
+
if (menuOutputResult.action === undefined
|
|
1120
|
+
|| menuOutputResult.action['kind'] === 'back') {
|
|
1121
|
+
sync();
|
|
1122
|
+
return 'back';
|
|
1123
|
+
}
|
|
1124
|
+
if (menuOutputResult.action['kind'] === 'add') {
|
|
1125
|
+
const result = await CliUtilityInitialize.promptWorkflowsForm(undefined, 'create', workflows);
|
|
1126
|
+
if (result['action'] === 'back') {
|
|
1127
|
+
continue;
|
|
1128
|
+
}
|
|
1129
|
+
workflows.push(result['workflow']);
|
|
1130
|
+
sync();
|
|
1131
|
+
Logger.customize({
|
|
1132
|
+
name: 'CliUtilityInitialize.promptWorkflows',
|
|
1133
|
+
purpose: 'add',
|
|
1134
|
+
padTop: 1,
|
|
1135
|
+
padBottom: 1,
|
|
1136
|
+
}).info('Added new workflow.');
|
|
1137
|
+
continue;
|
|
1138
|
+
}
|
|
1139
|
+
if (menuOutputResult.action['kind'] === 'edit') {
|
|
1140
|
+
const workflowIndex = menuOutputResult.action['index'];
|
|
1141
|
+
if (workflowIndex < 0 || workflowIndex >= workflows.length) {
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
const workflowToEdit = workflows[workflowIndex];
|
|
1145
|
+
const workflowResult = await CliUtilityInitialize.promptWorkflowsForm(workflowToEdit, 'update', workflows);
|
|
1146
|
+
if (workflowResult['action'] === 'back') {
|
|
1147
|
+
continue;
|
|
1148
|
+
}
|
|
1149
|
+
Reflect.set(workflows, workflowIndex, workflowResult['workflow']);
|
|
1150
|
+
sync();
|
|
1151
|
+
Logger.customize({
|
|
1152
|
+
name: 'CliUtilityInitialize.promptWorkflows',
|
|
1153
|
+
purpose: 'edit',
|
|
1154
|
+
padTop: 1,
|
|
1155
|
+
padBottom: 1,
|
|
1156
|
+
}).info('Updated workflow.');
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
if (menuOutputResult.action['kind'] === 'remove') {
|
|
1160
|
+
const workflowIndex = menuOutputResult.action['index'];
|
|
1161
|
+
if (workflowIndex < 0 || workflowIndex >= workflows.length) {
|
|
1162
|
+
continue;
|
|
1163
|
+
}
|
|
1164
|
+
const workflowToRemove = workflows[workflowIndex];
|
|
1165
|
+
if (workflowToRemove === undefined) {
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
const template = (typeof workflowToRemove['template'] === 'string') ? workflowToRemove['template'].trim() : '';
|
|
1169
|
+
const suffix = (typeof workflowToRemove['suffix'] === 'string') ? workflowToRemove['suffix'].trim() : '';
|
|
1170
|
+
let workflowLabel = `Workflow ${workflowIndex + 1}`;
|
|
1171
|
+
if (template !== '' && suffix !== '') {
|
|
1172
|
+
workflowLabel = `${template}-${suffix}`;
|
|
1173
|
+
}
|
|
1174
|
+
else if (template !== '') {
|
|
1175
|
+
workflowLabel = template;
|
|
1176
|
+
}
|
|
1177
|
+
const shouldRemove = await CliUtilityInitialize.promptWorkflowsDeleteForm(workflowLabel);
|
|
1178
|
+
if (shouldRemove !== true) {
|
|
1179
|
+
continue;
|
|
1180
|
+
}
|
|
1181
|
+
workflows.splice(workflowIndex, 1);
|
|
1182
|
+
sync();
|
|
1183
|
+
Logger.customize({
|
|
1184
|
+
name: 'CliUtilityInitialize.promptWorkflows',
|
|
1185
|
+
purpose: 'remove',
|
|
1186
|
+
padTop: 1,
|
|
1187
|
+
padBottom: 1,
|
|
1188
|
+
}).info('Removed workflow.');
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
static async promptWorkflowsForm(workflow, mode, workflows) {
|
|
1193
|
+
const existingTemplate = (workflow !== undefined && typeof workflow['template'] === 'string') ? workflow['template'] : '';
|
|
1194
|
+
const existingSuffix = (workflow !== undefined && typeof workflow['suffix'] === 'string') ? workflow['suffix'] : '';
|
|
1195
|
+
const existingTriggers = (workflow !== undefined && Array.isArray(workflow['triggers']) === true) ? workflow['triggers'] : [];
|
|
1196
|
+
const existingDependsOn = (workflow !== undefined && Array.isArray(workflow['depends-on']) === true) ? workflow['depends-on'] : [];
|
|
1197
|
+
const templateChoices = libWorkflowTemplatesMetadata.map((entry) => ({
|
|
1198
|
+
title: entry['name'],
|
|
1199
|
+
description: entry['description'],
|
|
1200
|
+
value: entry['name'],
|
|
1201
|
+
}));
|
|
1202
|
+
let templateInitialIndex = 0;
|
|
1203
|
+
if (existingTemplate !== '') {
|
|
1204
|
+
const foundIndex = templateChoices.findIndex((choice) => choice['value'] === existingTemplate);
|
|
1205
|
+
if (foundIndex >= 0) {
|
|
1206
|
+
templateInitialIndex = foundIndex;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
const templateOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1210
|
+
type: 'select',
|
|
1211
|
+
name: 'template',
|
|
1212
|
+
message: 'Select a workflow template.',
|
|
1213
|
+
choices: templateChoices,
|
|
1214
|
+
initial: templateInitialIndex,
|
|
1215
|
+
});
|
|
1216
|
+
if (templateOutput['cancelled'] === true) {
|
|
1217
|
+
return {
|
|
1218
|
+
action: 'back',
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
const templateOutputResult = templateOutput['result'];
|
|
1222
|
+
const selectedTemplate = templateOutputResult.template;
|
|
1223
|
+
const suffixOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1224
|
+
type: 'text',
|
|
1225
|
+
name: 'suffix',
|
|
1226
|
+
message: 'Workflow suffix (used in filename and workflow name)',
|
|
1227
|
+
initial: existingSuffix,
|
|
1228
|
+
validate: (value) => {
|
|
1229
|
+
const trimmed = (typeof value === 'string') ? value.trim() : '';
|
|
1230
|
+
if (trimmed === '') {
|
|
1231
|
+
return 'Suffix is required.';
|
|
1232
|
+
}
|
|
1233
|
+
const compositeKey = `${selectedTemplate}-${trimmed}`;
|
|
1234
|
+
const editIndex = (workflow !== undefined) ? workflows.indexOf(workflow) : -1;
|
|
1235
|
+
const isDuplicate = workflows.some((w, i) => {
|
|
1236
|
+
if (i === editIndex) {
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
const existingKey = `${w['template']}-${w['suffix'] ?? ''}`;
|
|
1240
|
+
return existingKey === compositeKey;
|
|
1241
|
+
});
|
|
1242
|
+
if (isDuplicate === true) {
|
|
1243
|
+
return 'A workflow with this template and suffix already exists.';
|
|
1244
|
+
}
|
|
1245
|
+
return true;
|
|
1246
|
+
},
|
|
1247
|
+
});
|
|
1248
|
+
if (suffixOutput['cancelled'] === true) {
|
|
1249
|
+
return {
|
|
1250
|
+
action: 'back',
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
const suffixOutputResult = suffixOutput['result'];
|
|
1254
|
+
const selectedSuffix = (typeof suffixOutputResult.suffix === 'string') ? suffixOutputResult.suffix.trim() : '';
|
|
1255
|
+
const triggersDir = join(resolveTemplatePath(import.meta.url, 'generators/github/workflows'), selectedTemplate, 'triggers');
|
|
1256
|
+
const triggersDirExists = await pathExists(triggersDir);
|
|
1257
|
+
let selectedTriggers = [];
|
|
1258
|
+
if (triggersDirExists === true) {
|
|
1259
|
+
const triggersFiles = (await fs.readdir(triggersDir)).filter((file) => file.endsWith('.yml'));
|
|
1260
|
+
const triggerChoices = triggersFiles.map((file) => {
|
|
1261
|
+
const triggerName = file.replace(LIB_REGEX_PATTERN_YML_EXTENSION, '');
|
|
1262
|
+
return {
|
|
1263
|
+
title: triggerName,
|
|
1264
|
+
value: triggerName,
|
|
1265
|
+
selected: existingTriggers.includes(triggerName),
|
|
1266
|
+
};
|
|
1267
|
+
});
|
|
1268
|
+
const triggersOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1269
|
+
type: 'multiselect',
|
|
1270
|
+
name: 'triggers',
|
|
1271
|
+
message: 'Select triggers for this workflow.',
|
|
1272
|
+
choices: triggerChoices,
|
|
1273
|
+
});
|
|
1274
|
+
if (triggersOutput['cancelled'] === true) {
|
|
1275
|
+
return {
|
|
1276
|
+
action: 'back',
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
const triggersOutputResult = triggersOutput['result'];
|
|
1280
|
+
selectedTriggers = (Array.isArray(triggersOutputResult.triggers) === true) ? triggersOutputResult.triggers : [];
|
|
1281
|
+
}
|
|
1282
|
+
let selectedDependsOn = undefined;
|
|
1283
|
+
if (selectedTriggers.some((trigger) => trigger.startsWith('workflow-run')) === true) {
|
|
1284
|
+
const dependsOnChoices = workflows
|
|
1285
|
+
.filter((w) => w !== workflow
|
|
1286
|
+
&& typeof w['template'] === 'string'
|
|
1287
|
+
&& w['template'].trim() !== '')
|
|
1288
|
+
.map((w) => {
|
|
1289
|
+
const compositeKey = (typeof w['suffix'] === 'string' && w['suffix'].trim() !== '') ? `${w['template']}-${w['suffix']}` : w['template'];
|
|
1290
|
+
return {
|
|
1291
|
+
title: compositeKey,
|
|
1292
|
+
value: compositeKey,
|
|
1293
|
+
selected: existingDependsOn.includes(compositeKey),
|
|
1294
|
+
};
|
|
1295
|
+
});
|
|
1296
|
+
if (dependsOnChoices.length > 0) {
|
|
1297
|
+
const dependsOnOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1298
|
+
type: 'multiselect',
|
|
1299
|
+
name: 'dependsOn',
|
|
1300
|
+
message: 'Select the workflows this depends on.',
|
|
1301
|
+
choices: dependsOnChoices,
|
|
1302
|
+
});
|
|
1303
|
+
if (dependsOnOutput['cancelled'] === true) {
|
|
1304
|
+
return {
|
|
1305
|
+
action: 'back',
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
const dependsOnOutputResult = dependsOnOutput['result'];
|
|
1309
|
+
selectedDependsOn = (Array.isArray(dependsOnOutputResult.dependsOn) === true && dependsOnOutputResult.dependsOn.length > 0) ? dependsOnOutputResult.dependsOn : undefined;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
const matchedMetadata = libWorkflowTemplatesMetadata.find((entry) => entry['name'] === selectedTemplate);
|
|
1313
|
+
const settings = {};
|
|
1314
|
+
if (matchedMetadata !== undefined) {
|
|
1315
|
+
const variableEntries = Object.entries(matchedMetadata['variables']);
|
|
1316
|
+
for (const variableEntry of variableEntries) {
|
|
1317
|
+
const variableName = variableEntry[0];
|
|
1318
|
+
const variableConfig = variableEntry[1];
|
|
1319
|
+
if (variableConfig['auto'] === true) {
|
|
1320
|
+
continue;
|
|
1321
|
+
}
|
|
1322
|
+
let promptMessage = `Literal: ${variableName}`;
|
|
1323
|
+
let initialValue = '';
|
|
1324
|
+
if (variableConfig['format'] === 'secret') {
|
|
1325
|
+
promptMessage = `Secret: ${variableName}`;
|
|
1326
|
+
initialValue = (typeof variableConfig['default'] === 'string') ? variableConfig['default'] : '';
|
|
1327
|
+
}
|
|
1328
|
+
else if (variableConfig['format'] === 'var') {
|
|
1329
|
+
promptMessage = `Variable: ${variableName}`;
|
|
1330
|
+
initialValue = (typeof variableConfig['default'] === 'string') ? variableConfig['default'] : '';
|
|
1331
|
+
}
|
|
1332
|
+
const parts = [];
|
|
1333
|
+
if (typeof variableConfig['description'] === 'string') {
|
|
1334
|
+
parts.push(variableConfig['description']);
|
|
1335
|
+
}
|
|
1336
|
+
if (typeof variableConfig['example'] === 'string') {
|
|
1337
|
+
parts.push(`e.g. ${variableConfig['example']}`);
|
|
1338
|
+
}
|
|
1339
|
+
if (parts.length > 0) {
|
|
1340
|
+
promptMessage = `${promptMessage} (${parts.join(', ')})`;
|
|
1341
|
+
}
|
|
1342
|
+
if (workflow !== undefined
|
|
1343
|
+
&& workflow['settings'] !== undefined
|
|
1344
|
+
&& typeof workflow['settings'][variableName] === 'string') {
|
|
1345
|
+
initialValue = workflow['settings'][variableName];
|
|
1346
|
+
}
|
|
1347
|
+
const settingsOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1348
|
+
type: 'text',
|
|
1349
|
+
name: 'settingValue',
|
|
1350
|
+
message: promptMessage,
|
|
1351
|
+
initial: initialValue,
|
|
1352
|
+
});
|
|
1353
|
+
if (settingsOutput['cancelled'] === true) {
|
|
1354
|
+
return {
|
|
1355
|
+
action: 'back',
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
const settingsOutputResult = settingsOutput['result'];
|
|
1359
|
+
const settingValue = (typeof settingsOutputResult.settingValue === 'string') ? settingsOutputResult.settingValue.trim().replaceAll('\\n', '\n') : '';
|
|
1360
|
+
if (settingValue !== '') {
|
|
1361
|
+
Reflect.set(settings, variableName, settingValue);
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
const resolvedWorkflow = {
|
|
1366
|
+
template: selectedTemplate,
|
|
1367
|
+
suffix: selectedSuffix,
|
|
1368
|
+
triggers: selectedTriggers,
|
|
1369
|
+
};
|
|
1370
|
+
if (selectedDependsOn !== undefined) {
|
|
1371
|
+
Reflect.set(resolvedWorkflow, 'depends-on', selectedDependsOn);
|
|
1372
|
+
}
|
|
1373
|
+
if (Object.keys(settings).length > 0) {
|
|
1374
|
+
resolvedWorkflow.settings = settings;
|
|
1375
|
+
}
|
|
1376
|
+
if (mode === 'create' && selectedTemplate.trim() === '') {
|
|
1377
|
+
return {
|
|
1378
|
+
action: 'back',
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
return {
|
|
1382
|
+
action: 'apply',
|
|
1383
|
+
workflow: resolvedWorkflow,
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
static async promptWorkflowsDeleteForm(label) {
|
|
1387
|
+
const confirmOutput = await CliUtilityInitialize.promptWithCancel({
|
|
1388
|
+
type: 'confirm',
|
|
1389
|
+
name: 'confirm',
|
|
1390
|
+
message: `Remove workflow "${label}"?`,
|
|
1391
|
+
initial: false,
|
|
1392
|
+
});
|
|
1393
|
+
if (confirmOutput['cancelled'] === true) {
|
|
1394
|
+
return false;
|
|
1395
|
+
}
|
|
1396
|
+
const confirmOutputResult = confirmOutput['result'];
|
|
1397
|
+
return confirmOutputResult.confirm;
|
|
1398
|
+
}
|
|
705
1399
|
static async promptWorkspaces(config) {
|
|
706
|
-
const workspaces = (config
|
|
1400
|
+
const workspaces = (config['workspaces'] !== undefined) ? { ...(config['workspaces']) } : {};
|
|
707
1401
|
const rawWorkspacePaths = await discoverPathsWithFile('package.json', 'forward');
|
|
708
1402
|
const workspacePaths = rawWorkspacePaths.map((rawWorkspacePath) => {
|
|
709
|
-
const
|
|
1403
|
+
const currentWorkingDirectory = process.cwd();
|
|
1404
|
+
const relativePath = relative(currentWorkingDirectory, rawWorkspacePath);
|
|
710
1405
|
if (relativePath === '') {
|
|
711
1406
|
return './';
|
|
712
1407
|
}
|
|
713
1408
|
return `./${relativePath.split(sep).join('/')}`;
|
|
714
1409
|
});
|
|
715
1410
|
Logger.customize({
|
|
716
|
-
name: '
|
|
1411
|
+
name: 'CliUtilityInitialize.promptWorkspaces',
|
|
717
1412
|
purpose: 'paths',
|
|
718
1413
|
}).debug(workspacePaths);
|
|
719
1414
|
while (true) {
|
|
720
1415
|
const choices = workspacePaths.map((workspacePath) => {
|
|
721
1416
|
const workspace = workspaces[workspacePath];
|
|
722
1417
|
const summaryParts = [];
|
|
723
|
-
if (workspace !== undefined && workspace
|
|
724
|
-
summaryParts.push(workspace
|
|
1418
|
+
if (workspace !== undefined && workspace['name'] !== undefined) {
|
|
1419
|
+
summaryParts.push(workspace['name']);
|
|
725
1420
|
}
|
|
726
|
-
if (workspace !== undefined && workspace
|
|
727
|
-
summaryParts.push(workspace
|
|
1421
|
+
if (workspace !== undefined && workspace['role'] !== undefined) {
|
|
1422
|
+
summaryParts.push(workspace['role']);
|
|
728
1423
|
}
|
|
729
|
-
if (workspace !== undefined && workspace
|
|
730
|
-
summaryParts.push(workspace
|
|
1424
|
+
if (workspace !== undefined && workspace['policy'] !== undefined) {
|
|
1425
|
+
summaryParts.push(workspace['policy']);
|
|
731
1426
|
}
|
|
732
1427
|
return {
|
|
733
1428
|
title: workspacePath,
|
|
@@ -740,37 +1435,37 @@ export class CLIUtilityInitialize {
|
|
|
740
1435
|
description: 'Return to the category selection.',
|
|
741
1436
|
value: 'back',
|
|
742
1437
|
});
|
|
743
|
-
const menuOutput = await
|
|
1438
|
+
const menuOutput = await CliUtilityInitialize.promptWithCancel({
|
|
744
1439
|
type: 'select',
|
|
745
1440
|
name: 'workspacePath',
|
|
746
1441
|
message: 'Select a workspace to configure.',
|
|
747
1442
|
choices,
|
|
748
1443
|
});
|
|
749
|
-
if (menuOutput
|
|
1444
|
+
if (menuOutput['cancelled'] === true) {
|
|
750
1445
|
return 'back';
|
|
751
1446
|
}
|
|
752
|
-
const menuOutputResult = menuOutput
|
|
1447
|
+
const menuOutputResult = menuOutput['result'];
|
|
753
1448
|
if (menuOutputResult.workspacePath === undefined
|
|
754
1449
|
|| menuOutputResult.workspacePath === 'back') {
|
|
755
1450
|
return 'back';
|
|
756
1451
|
}
|
|
757
1452
|
const workspacePath = menuOutputResult.workspacePath;
|
|
758
|
-
const formResult = await
|
|
1453
|
+
const formResult = await CliUtilityInitialize.promptWorkspacesForm({
|
|
759
1454
|
workspacePath,
|
|
760
1455
|
existingWorkspace: workspaces[workspacePath],
|
|
761
|
-
projectSlug: (config
|
|
1456
|
+
projectSlug: (config['project'] !== undefined && config['project']['name'] !== undefined) ? config['project']['name']['slug'] : undefined,
|
|
762
1457
|
});
|
|
763
|
-
if (formResult
|
|
1458
|
+
if (formResult['action'] === 'back') {
|
|
764
1459
|
continue;
|
|
765
1460
|
}
|
|
766
|
-
Reflect.set(workspaces, workspacePath, formResult
|
|
1461
|
+
Reflect.set(workspaces, workspacePath, formResult['workspace']);
|
|
767
1462
|
Object.assign(config, { workspaces });
|
|
768
1463
|
Logger.customize({
|
|
769
|
-
name: '
|
|
1464
|
+
name: 'CliUtilityInitialize.promptWorkspaces',
|
|
770
1465
|
purpose: 'updated',
|
|
771
1466
|
padTop: 1,
|
|
772
1467
|
padBottom: 1,
|
|
773
|
-
}).info(`Updated workspace "${workspacePath}" → ${formResult
|
|
1468
|
+
}).info(`Updated workspace "${workspacePath}" → ${formResult['workspace']['name']} · ${formResult['workspace']['role']} · ${formResult['workspace']['policy']}`);
|
|
774
1469
|
}
|
|
775
1470
|
}
|
|
776
1471
|
static async promptWorkspacesForm(options) {
|
|
@@ -827,78 +1522,82 @@ export class CLIUtilityInitialize {
|
|
|
827
1522
|
};
|
|
828
1523
|
const resolveName = async (role) => {
|
|
829
1524
|
if (role === 'project' || role === 'docs') {
|
|
830
|
-
if (options
|
|
1525
|
+
if (options['projectSlug'] === undefined) {
|
|
831
1526
|
return (role === 'project') ? 'project' : 'docs';
|
|
832
1527
|
}
|
|
833
|
-
return `${options
|
|
1528
|
+
return `${options['projectSlug']}-${role}`;
|
|
834
1529
|
}
|
|
835
|
-
const base = (options
|
|
836
|
-
const namePrompt = await
|
|
1530
|
+
const base = (options['projectSlug'] !== undefined) ? `${options['projectSlug']}-${role}` : role;
|
|
1531
|
+
const namePrompt = await CliUtilityInitialize.promptWithCancel({
|
|
837
1532
|
type: 'text',
|
|
838
1533
|
name: 'workspaceName',
|
|
839
1534
|
message: 'Workspace package name',
|
|
840
|
-
initial: (options
|
|
841
|
-
validate: (value) =>
|
|
1535
|
+
initial: (options['existingWorkspace'] !== undefined) ? options['existingWorkspace']['name'] ?? '' : '',
|
|
1536
|
+
validate: (value) => CliUtilityInitialize.normalizeWorkspaceName(value, role, base)['result'],
|
|
842
1537
|
});
|
|
843
|
-
if (namePrompt
|
|
1538
|
+
if (namePrompt['cancelled'] === true) {
|
|
844
1539
|
return undefined;
|
|
845
1540
|
}
|
|
846
|
-
return
|
|
1541
|
+
return CliUtilityInitialize.normalizeWorkspaceName(namePrompt['result'].workspaceName, role, base)['sanitized'];
|
|
847
1542
|
};
|
|
848
|
-
const
|
|
1543
|
+
const existingRoleIndex = allowedRoles.findIndex((allowedRole) => options['existingWorkspace'] !== undefined && allowedRole['value'] === options['existingWorkspace']['role']);
|
|
1544
|
+
const rolePrompt = await CliUtilityInitialize.promptWithCancel({
|
|
849
1545
|
type: 'select',
|
|
850
1546
|
name: 'workspaceRole',
|
|
851
|
-
message: `Select a role for "${options
|
|
1547
|
+
message: `Select a role for "${options['workspacePath']}"`,
|
|
852
1548
|
choices: allowedRoles.map((allowedRole) => {
|
|
853
1549
|
return {
|
|
854
|
-
title: allowedRole
|
|
855
|
-
description: allowedRole
|
|
856
|
-
value: allowedRole
|
|
1550
|
+
title: allowedRole['title'],
|
|
1551
|
+
description: allowedRole['description'],
|
|
1552
|
+
value: allowedRole['value'],
|
|
857
1553
|
};
|
|
858
1554
|
}),
|
|
859
|
-
initial: Math.max(0,
|
|
1555
|
+
initial: Math.max(0, existingRoleIndex),
|
|
860
1556
|
});
|
|
861
|
-
if (rolePrompt
|
|
1557
|
+
if (rolePrompt['cancelled'] === true) {
|
|
862
1558
|
return {
|
|
863
1559
|
action: 'back',
|
|
864
1560
|
};
|
|
865
1561
|
}
|
|
866
|
-
const selectedRole = rolePrompt
|
|
867
|
-
const allowedPolicies =
|
|
868
|
-
const
|
|
1562
|
+
const selectedRole = rolePrompt['result'].workspaceRole;
|
|
1563
|
+
const allowedPolicies = libItemAllowedPoliciesByRole[selectedRole];
|
|
1564
|
+
const existingPolicyIndex = allowedPolicies.findIndex((allowedPolicy) => options['existingWorkspace'] !== undefined && allowedPolicy === options['existingWorkspace']['policy']);
|
|
1565
|
+
const policyPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
869
1566
|
type: 'select',
|
|
870
1567
|
name: 'workspacePolicy',
|
|
871
1568
|
message: 'Select a policy',
|
|
872
1569
|
choices: allowedPolicies.map((allowedPolicy) => {
|
|
873
1570
|
const policyEntry = Reflect.get(policy, allowedPolicy);
|
|
874
1571
|
return {
|
|
875
|
-
title: policyEntry
|
|
876
|
-
description: policyEntry
|
|
1572
|
+
title: policyEntry['label'],
|
|
1573
|
+
description: policyEntry['description'],
|
|
877
1574
|
value: allowedPolicy,
|
|
878
1575
|
};
|
|
879
1576
|
}),
|
|
880
|
-
initial: Math.max(0,
|
|
1577
|
+
initial: Math.max(0, existingPolicyIndex),
|
|
881
1578
|
});
|
|
882
|
-
if (policyPrompt
|
|
1579
|
+
if (policyPrompt['cancelled'] === true) {
|
|
883
1580
|
return {
|
|
884
1581
|
action: 'back',
|
|
885
1582
|
};
|
|
886
1583
|
}
|
|
887
|
-
const selectedPolicy = policyPrompt
|
|
1584
|
+
const selectedPolicy = policyPrompt['result'].workspacePolicy;
|
|
888
1585
|
const resolvedName = await resolveName(selectedRole);
|
|
889
1586
|
if (resolvedName === undefined) {
|
|
890
1587
|
return {
|
|
891
1588
|
action: 'back',
|
|
892
1589
|
};
|
|
893
1590
|
}
|
|
894
|
-
const existingRecipes = (options
|
|
895
|
-
const recipesPrompt = await
|
|
1591
|
+
const existingRecipes = (options['existingWorkspace'] !== undefined && options['existingWorkspace']['recipes'] !== undefined) ? options['existingWorkspace']['recipes'] : undefined;
|
|
1592
|
+
const recipesPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
896
1593
|
type: 'multiselect',
|
|
897
1594
|
name: 'workspaceRecipes',
|
|
898
1595
|
message: 'Select recipes to enable',
|
|
899
|
-
choices:
|
|
1596
|
+
choices: libItemAllowedRecipes.map((recipe) => {
|
|
900
1597
|
const recipeTuple = (existingRecipes !== undefined) ? Reflect.get(existingRecipes, recipe) : undefined;
|
|
901
|
-
const recipeSelected = (Array.isArray(recipeTuple)
|
|
1598
|
+
const recipeSelected = (Array.isArray(recipeTuple)
|
|
1599
|
+
&& recipeTuple.length > 0
|
|
1600
|
+
&& recipeTuple[0] === true);
|
|
902
1601
|
return {
|
|
903
1602
|
title: recipe,
|
|
904
1603
|
value: recipe,
|
|
@@ -906,19 +1605,19 @@ export class CLIUtilityInitialize {
|
|
|
906
1605
|
};
|
|
907
1606
|
}),
|
|
908
1607
|
});
|
|
909
|
-
if (recipesPrompt
|
|
1608
|
+
if (recipesPrompt['cancelled'] === true) {
|
|
910
1609
|
return {
|
|
911
1610
|
action: 'back',
|
|
912
1611
|
};
|
|
913
1612
|
}
|
|
914
|
-
const selectedRecipes = recipesPrompt
|
|
1613
|
+
const selectedRecipes = recipesPrompt['result'].workspaceRecipes;
|
|
915
1614
|
const recipes = {};
|
|
916
1615
|
for (const recipe of selectedRecipes) {
|
|
917
1616
|
const existingTupleRaw = (existingRecipes !== undefined) ? Reflect.get(existingRecipes, recipe) : undefined;
|
|
918
|
-
const existingTuple = (Array.isArray(existingTupleRaw)) ? existingTupleRaw : undefined;
|
|
1617
|
+
const existingTuple = (Array.isArray(existingTupleRaw) === true) ? existingTupleRaw : undefined;
|
|
919
1618
|
const existingSettings = (existingTuple !== undefined && existingTuple.length > 1) ? existingTuple[1] : undefined;
|
|
920
1619
|
if (recipe === 'sync-identity' && selectedPolicy === 'distributable') {
|
|
921
|
-
const settingsPrompt = await
|
|
1620
|
+
const settingsPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
922
1621
|
type: 'multiselect',
|
|
923
1622
|
name: 'workspaceRecipeSettings',
|
|
924
1623
|
message: 'sync-identity: Select properties to sync',
|
|
@@ -935,25 +1634,28 @@ export class CLIUtilityInitialize {
|
|
|
935
1634
|
},
|
|
936
1635
|
],
|
|
937
1636
|
});
|
|
938
|
-
if (settingsPrompt
|
|
1637
|
+
if (settingsPrompt['cancelled'] === true) {
|
|
939
1638
|
return {
|
|
940
1639
|
action: 'back',
|
|
941
1640
|
};
|
|
942
1641
|
}
|
|
943
|
-
const selectedSettings = settingsPrompt
|
|
1642
|
+
const selectedSettings = settingsPrompt['result'].workspaceRecipeSettings;
|
|
944
1643
|
if (selectedSettings.length > 0) {
|
|
945
1644
|
const settings = {};
|
|
946
1645
|
for (const setting of selectedSettings) {
|
|
947
1646
|
Reflect.set(settings, setting, true);
|
|
948
1647
|
}
|
|
949
|
-
Reflect.set(recipes, recipe, [
|
|
1648
|
+
Reflect.set(recipes, recipe, [
|
|
1649
|
+
true,
|
|
1650
|
+
settings,
|
|
1651
|
+
]);
|
|
950
1652
|
}
|
|
951
1653
|
else {
|
|
952
1654
|
Reflect.set(recipes, recipe, [true]);
|
|
953
1655
|
}
|
|
954
1656
|
}
|
|
955
1657
|
else if (recipe === 'sync-ownership' && selectedPolicy === 'distributable') {
|
|
956
|
-
const settingsPrompt = await
|
|
1658
|
+
const settingsPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
957
1659
|
type: 'multiselect',
|
|
958
1660
|
name: 'workspaceRecipeSettings',
|
|
959
1661
|
message: 'sync-ownership: Select properties to sync',
|
|
@@ -990,55 +1692,59 @@ export class CLIUtilityInitialize {
|
|
|
990
1692
|
},
|
|
991
1693
|
],
|
|
992
1694
|
});
|
|
993
|
-
if (settingsPrompt
|
|
1695
|
+
if (settingsPrompt['cancelled'] === true) {
|
|
994
1696
|
return {
|
|
995
1697
|
action: 'back',
|
|
996
1698
|
};
|
|
997
1699
|
}
|
|
998
|
-
const selectedSettings = settingsPrompt
|
|
1700
|
+
const selectedSettings = settingsPrompt['result'].workspaceRecipeSettings;
|
|
999
1701
|
if (selectedSettings.length > 0) {
|
|
1000
1702
|
const settings = {};
|
|
1001
1703
|
for (const setting of selectedSettings) {
|
|
1002
1704
|
Reflect.set(settings, setting, true);
|
|
1003
1705
|
}
|
|
1004
|
-
Reflect.set(recipes, recipe, [
|
|
1706
|
+
Reflect.set(recipes, recipe, [
|
|
1707
|
+
true,
|
|
1708
|
+
settings,
|
|
1709
|
+
]);
|
|
1005
1710
|
}
|
|
1006
1711
|
else {
|
|
1007
1712
|
Reflect.set(recipes, recipe, [true]);
|
|
1008
1713
|
}
|
|
1009
1714
|
}
|
|
1010
1715
|
else if (recipe === 'sync-environment') {
|
|
1011
|
-
const settingsPrompt = await
|
|
1716
|
+
const settingsPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
1012
1717
|
type: 'multiselect',
|
|
1013
1718
|
name: 'workspaceRecipeSettings',
|
|
1014
1719
|
message: 'sync-environment: Select settings',
|
|
1015
|
-
choices: [
|
|
1016
|
-
{
|
|
1720
|
+
choices: [{
|
|
1017
1721
|
title: 'trackNodeLtsVersions',
|
|
1018
1722
|
value: 'trackNodeLtsVersions',
|
|
1019
1723
|
selected: existingSettings !== undefined && existingSettings['trackNodeLtsVersions'] === true,
|
|
1020
|
-
},
|
|
1021
|
-
],
|
|
1724
|
+
}],
|
|
1022
1725
|
});
|
|
1023
|
-
if (settingsPrompt
|
|
1726
|
+
if (settingsPrompt['cancelled'] === true) {
|
|
1024
1727
|
return {
|
|
1025
1728
|
action: 'back',
|
|
1026
1729
|
};
|
|
1027
1730
|
}
|
|
1028
|
-
const selectedSettings = settingsPrompt
|
|
1731
|
+
const selectedSettings = settingsPrompt['result'].workspaceRecipeSettings;
|
|
1029
1732
|
if (selectedSettings.length > 0) {
|
|
1030
1733
|
const settings = {};
|
|
1031
1734
|
for (const setting of selectedSettings) {
|
|
1032
1735
|
Reflect.set(settings, setting, true);
|
|
1033
1736
|
}
|
|
1034
|
-
Reflect.set(recipes, recipe, [
|
|
1737
|
+
Reflect.set(recipes, recipe, [
|
|
1738
|
+
true,
|
|
1739
|
+
settings,
|
|
1740
|
+
]);
|
|
1035
1741
|
}
|
|
1036
1742
|
else {
|
|
1037
1743
|
Reflect.set(recipes, recipe, [true]);
|
|
1038
1744
|
}
|
|
1039
1745
|
}
|
|
1040
1746
|
else if (recipe === 'cleanup') {
|
|
1041
|
-
const settingsPrompt = await
|
|
1747
|
+
const settingsPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
1042
1748
|
type: 'multiselect',
|
|
1043
1749
|
name: 'workspaceRecipeSettings',
|
|
1044
1750
|
message: 'cleanup: Select settings',
|
|
@@ -1055,25 +1761,28 @@ export class CLIUtilityInitialize {
|
|
|
1055
1761
|
},
|
|
1056
1762
|
],
|
|
1057
1763
|
});
|
|
1058
|
-
if (settingsPrompt
|
|
1764
|
+
if (settingsPrompt['cancelled'] === true) {
|
|
1059
1765
|
return {
|
|
1060
1766
|
action: 'back',
|
|
1061
1767
|
};
|
|
1062
1768
|
}
|
|
1063
|
-
const selectedSettings = settingsPrompt
|
|
1769
|
+
const selectedSettings = settingsPrompt['result'].workspaceRecipeSettings;
|
|
1064
1770
|
if (selectedSettings.length > 0) {
|
|
1065
1771
|
const settings = {};
|
|
1066
1772
|
for (const setting of selectedSettings) {
|
|
1067
1773
|
Reflect.set(settings, setting, true);
|
|
1068
1774
|
}
|
|
1069
|
-
Reflect.set(recipes, recipe, [
|
|
1775
|
+
Reflect.set(recipes, recipe, [
|
|
1776
|
+
true,
|
|
1777
|
+
settings,
|
|
1778
|
+
]);
|
|
1070
1779
|
}
|
|
1071
1780
|
else {
|
|
1072
1781
|
Reflect.set(recipes, recipe, [true]);
|
|
1073
1782
|
}
|
|
1074
1783
|
}
|
|
1075
1784
|
else if (recipe === 'normalize-dependencies') {
|
|
1076
|
-
const settingsPrompt = await
|
|
1785
|
+
const settingsPrompt = await CliUtilityInitialize.promptWithCancel({
|
|
1077
1786
|
type: 'multiselect',
|
|
1078
1787
|
name: 'workspaceRecipeSettings',
|
|
1079
1788
|
message: 'normalize-dependencies: Select settings',
|
|
@@ -1090,18 +1799,21 @@ export class CLIUtilityInitialize {
|
|
|
1090
1799
|
},
|
|
1091
1800
|
],
|
|
1092
1801
|
});
|
|
1093
|
-
if (settingsPrompt
|
|
1802
|
+
if (settingsPrompt['cancelled'] === true) {
|
|
1094
1803
|
return {
|
|
1095
1804
|
action: 'back',
|
|
1096
1805
|
};
|
|
1097
1806
|
}
|
|
1098
|
-
const selectedSettings = settingsPrompt
|
|
1807
|
+
const selectedSettings = settingsPrompt['result'].workspaceRecipeSettings;
|
|
1099
1808
|
if (selectedSettings.length > 0) {
|
|
1100
1809
|
const settings = {};
|
|
1101
1810
|
for (const setting of selectedSettings) {
|
|
1102
1811
|
Reflect.set(settings, setting, true);
|
|
1103
1812
|
}
|
|
1104
|
-
Reflect.set(recipes, recipe, [
|
|
1813
|
+
Reflect.set(recipes, recipe, [
|
|
1814
|
+
true,
|
|
1815
|
+
settings,
|
|
1816
|
+
]);
|
|
1105
1817
|
}
|
|
1106
1818
|
else {
|
|
1107
1819
|
Reflect.set(recipes, recipe, [true]);
|
|
@@ -1124,12 +1836,12 @@ export class CLIUtilityInitialize {
|
|
|
1124
1836
|
static async promptWithCancel(questions) {
|
|
1125
1837
|
let cancelled = false;
|
|
1126
1838
|
const result = await prompts(questions, {
|
|
1127
|
-
onCancel: () =>
|
|
1128
|
-
cancelled = true;
|
|
1129
|
-
return false;
|
|
1130
|
-
},
|
|
1839
|
+
onCancel: () => false,
|
|
1131
1840
|
});
|
|
1132
|
-
if (
|
|
1841
|
+
if (Object.keys(result).length === 0) {
|
|
1842
|
+
cancelled = true;
|
|
1843
|
+
}
|
|
1844
|
+
if (cancelled === true) {
|
|
1133
1845
|
return {
|
|
1134
1846
|
cancelled: true,
|
|
1135
1847
|
};
|
|
@@ -1142,37 +1854,40 @@ export class CLIUtilityInitialize {
|
|
|
1142
1854
|
static async checkPath(currentDirectory) {
|
|
1143
1855
|
const locations = await discoverPathsWithFile('package.json', 'backward');
|
|
1144
1856
|
Logger.customize({
|
|
1145
|
-
name: '
|
|
1857
|
+
name: 'CliUtilityInitialize.checkPath',
|
|
1146
1858
|
purpose: 'detectedLocations',
|
|
1147
1859
|
}).debug(locations);
|
|
1148
1860
|
if (locations.length < 1) {
|
|
1149
|
-
|
|
1150
|
-
name: 'CLIUtilityInitialize.checkPath',
|
|
1151
|
-
purpose: 'lessThanOne',
|
|
1152
|
-
}).error([
|
|
1861
|
+
const lessThanOneMessage = [
|
|
1153
1862
|
'No "package.json" files were found. Re-run this command inside the project root directory.',
|
|
1154
1863
|
`Current directory is "${currentDirectory}"`,
|
|
1155
|
-
].join('\n')
|
|
1864
|
+
].join('\n');
|
|
1865
|
+
Logger.customize({
|
|
1866
|
+
name: 'CliUtilityInitialize.checkPath',
|
|
1867
|
+
purpose: 'lessThanOne',
|
|
1868
|
+
}).error(lessThanOneMessage);
|
|
1156
1869
|
return false;
|
|
1157
1870
|
}
|
|
1158
1871
|
if (locations.length > 1) {
|
|
1159
|
-
|
|
1160
|
-
name: 'CLIUtilityInitialize.checkPath',
|
|
1161
|
-
purpose: 'greaterThanOne',
|
|
1162
|
-
}).error([
|
|
1872
|
+
const greaterThanOneMessage = [
|
|
1163
1873
|
'Multiple "package.json" files were found. Re-run this command inside the project root directory.',
|
|
1164
1874
|
`Current directory is "${currentDirectory}"`,
|
|
1165
|
-
].join('\n')
|
|
1875
|
+
].join('\n');
|
|
1876
|
+
Logger.customize({
|
|
1877
|
+
name: 'CliUtilityInitialize.checkPath',
|
|
1878
|
+
purpose: 'greaterThanOne',
|
|
1879
|
+
}).error(greaterThanOneMessage);
|
|
1166
1880
|
return false;
|
|
1167
1881
|
}
|
|
1168
1882
|
if (locations.length === 1 && locations[0] !== currentDirectory) {
|
|
1169
|
-
|
|
1170
|
-
name: 'CLIUtilityInitialize.checkPath',
|
|
1171
|
-
purpose: 'notProjectRootDir',
|
|
1172
|
-
}).error([
|
|
1883
|
+
const notProjectRootDirectoryMessage = [
|
|
1173
1884
|
'Must be run inside the project root directory.',
|
|
1174
1885
|
`Current directory is "${currentDirectory}"`,
|
|
1175
|
-
].join('\n')
|
|
1886
|
+
].join('\n');
|
|
1887
|
+
Logger.customize({
|
|
1888
|
+
name: 'CliUtilityInitialize.checkPath',
|
|
1889
|
+
purpose: 'notProjectRootDirectory',
|
|
1890
|
+
}).error(notProjectRootDirectoryMessage);
|
|
1176
1891
|
return false;
|
|
1177
1892
|
}
|
|
1178
1893
|
return true;
|
|
@@ -1191,7 +1906,7 @@ export class CLIUtilityInitialize {
|
|
|
1191
1906
|
sanitized: undefined,
|
|
1192
1907
|
};
|
|
1193
1908
|
}
|
|
1194
|
-
if (
|
|
1909
|
+
if (LIB_REGEX_PATTERN_EMAIL_SIMPLE.test(trimmedValue) === false) {
|
|
1195
1910
|
return {
|
|
1196
1911
|
result: 'Enter a valid email address or leave blank.',
|
|
1197
1912
|
sanitized: undefined,
|
|
@@ -1217,7 +1932,7 @@ export class CLIUtilityInitialize {
|
|
|
1217
1932
|
};
|
|
1218
1933
|
}
|
|
1219
1934
|
if (trimmedValue.length > 214
|
|
1220
|
-
|| new RegExp(
|
|
1935
|
+
|| new RegExp(LIB_REGEX_PATTERN_SLUG_SIMPLE, 'i').test(trimmedValue) === false) {
|
|
1221
1936
|
return {
|
|
1222
1937
|
result: 'Use only letters, numbers, hyphens, or underscores, and keep it at 214 characters or fewer.',
|
|
1223
1938
|
sanitized: undefined,
|
|
@@ -1272,9 +1987,9 @@ export class CLIUtilityInitialize {
|
|
|
1272
1987
|
.map((item) => item.trim())
|
|
1273
1988
|
.filter((item) => item !== '');
|
|
1274
1989
|
for (let i = 0; i < items.length; i += 1) {
|
|
1275
|
-
const normalizedText =
|
|
1276
|
-
const result = normalizedText
|
|
1277
|
-
const sanitized = normalizedText
|
|
1990
|
+
const normalizedText = CliUtilityInitialize.normalizeText(items[i], maxLengthPerItem);
|
|
1991
|
+
const result = normalizedText['result'];
|
|
1992
|
+
const sanitized = normalizedText['sanitized'];
|
|
1278
1993
|
if (result !== true) {
|
|
1279
1994
|
return {
|
|
1280
1995
|
result: `Invalid entry "${items[i]}": Input a value under ${maxLengthPerItem} character(s) or remove entry.`,
|
|
@@ -1306,19 +2021,29 @@ export class CLIUtilityInitialize {
|
|
|
1306
2021
|
}
|
|
1307
2022
|
const rules = {
|
|
1308
2023
|
generic: {
|
|
1309
|
-
allowed: [
|
|
2024
|
+
allowed: [
|
|
2025
|
+
'http:',
|
|
2026
|
+
'https:',
|
|
2027
|
+
],
|
|
1310
2028
|
message: 'Enter a valid generic URL (e.g., https://) or leave blank.',
|
|
1311
2029
|
},
|
|
1312
2030
|
repository: {
|
|
1313
|
-
allowed: [
|
|
2031
|
+
allowed: [
|
|
2032
|
+
'git:',
|
|
2033
|
+
'git+https:',
|
|
2034
|
+
'git+ssh:',
|
|
2035
|
+
'git+http:',
|
|
2036
|
+
'http:',
|
|
2037
|
+
'https:',
|
|
2038
|
+
],
|
|
1314
2039
|
message: 'Enter a valid repository URL (e.g., git+https://) or leave blank.',
|
|
1315
2040
|
},
|
|
1316
2041
|
};
|
|
1317
|
-
const allowed = (protocol === 'repository') ? rules
|
|
1318
|
-
const errorMessage = (protocol === 'repository') ? rules
|
|
2042
|
+
const allowed = (protocol === 'repository') ? rules['repository']['allowed'] : rules['generic']['allowed'];
|
|
2043
|
+
const errorMessage = (protocol === 'repository') ? rules['repository']['message'] : rules['generic']['message'];
|
|
1319
2044
|
try {
|
|
1320
2045
|
const url = new URL(trimmedValue);
|
|
1321
|
-
if (allowed.includes(url.protocol)) {
|
|
2046
|
+
if (allowed.includes(url.protocol) === true) {
|
|
1322
2047
|
return {
|
|
1323
2048
|
result: true,
|
|
1324
2049
|
sanitized: url.toString(),
|
|
@@ -1351,15 +2076,15 @@ export class CLIUtilityInitialize {
|
|
|
1351
2076
|
.map((item) => item.trim())
|
|
1352
2077
|
.filter((item) => item !== '');
|
|
1353
2078
|
for (let i = 0; i < items.length; i += 1) {
|
|
1354
|
-
const normalizedUrl =
|
|
1355
|
-
const result = normalizedUrl
|
|
1356
|
-
const sanitized = normalizedUrl
|
|
2079
|
+
const normalizedUrl = CliUtilityInitialize.normalizeUrl(items[i], protocol);
|
|
2080
|
+
const result = normalizedUrl['result'];
|
|
2081
|
+
const sanitized = normalizedUrl['sanitized'];
|
|
1357
2082
|
if (result !== true) {
|
|
1358
2083
|
const errorMessages = {
|
|
1359
2084
|
generic: 'Enter a valid generic URL (e.g., https://) or remove entry.',
|
|
1360
2085
|
repository: 'Enter a valid repository URL (e.g., git+https://) or remove entry.',
|
|
1361
2086
|
};
|
|
1362
|
-
const errorMessage = (protocol === 'repository') ? errorMessages
|
|
2087
|
+
const errorMessage = (protocol === 'repository') ? errorMessages['repository'] : errorMessages['generic'];
|
|
1363
2088
|
return {
|
|
1364
2089
|
result: `Invalid URL "${items[i]}": ${errorMessage}`,
|
|
1365
2090
|
sanitized: undefined,
|
|
@@ -1406,7 +2131,7 @@ export class CLIUtilityInitialize {
|
|
|
1406
2131
|
sanitized: undefined,
|
|
1407
2132
|
};
|
|
1408
2133
|
}
|
|
1409
|
-
if (
|
|
2134
|
+
if (LIB_REGEX_PATTERN_SLUG_SIMPLE.test(descriptor) === false) {
|
|
1410
2135
|
return {
|
|
1411
2136
|
result: 'Descriptor must match the slug pattern (lowercase letters, numbers, hyphens, underscores).',
|
|
1412
2137
|
sanitized: undefined,
|
|
@@ -1420,7 +2145,7 @@ export class CLIUtilityInitialize {
|
|
|
1420
2145
|
case 'template':
|
|
1421
2146
|
case 'package':
|
|
1422
2147
|
default: {
|
|
1423
|
-
if (
|
|
2148
|
+
if (LIB_REGEX_PATTERN_SLUG_SIMPLE.test(trimmedValue) === true || LIB_REGEX_PATTERN_SLUG_SCOPED.test(trimmedValue) === true) {
|
|
1424
2149
|
return {
|
|
1425
2150
|
result: true,
|
|
1426
2151
|
sanitized: trimmedValue,
|