@cbnventures/nova 0.20.0 → 0.21.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 +10 -0
- package/bin/nova.mjs +3 -3
- package/build/package.json +9 -8
- package/build/src/cli/generate/github/funding.js +2 -2
- package/build/src/cli/generate/github/funding.js.map +1 -1
- package/build/src/cli/generate/github/issue-template.js +2 -2
- package/build/src/cli/generate/github/issue-template.js.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts +12 -0
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts.map +1 -0
- package/build/src/cli/generate/github/workflows-blueprint-validate.js +535 -0
- package/build/src/cli/generate/github/workflows-blueprint-validate.js.map +1 -0
- package/build/src/cli/generate/github/workflows-blueprint-variables.d.ts +9 -0
- package/build/src/cli/generate/github/workflows-blueprint-variables.d.ts.map +1 -0
- package/build/src/cli/generate/github/workflows-blueprint-variables.js +117 -0
- package/build/src/cli/generate/github/workflows-blueprint-variables.js.map +1 -0
- package/build/src/cli/generate/github/workflows-blueprint.d.ts +60 -0
- package/build/src/cli/generate/github/workflows-blueprint.d.ts.map +1 -0
- package/build/src/cli/generate/github/workflows-blueprint.js +2251 -0
- package/build/src/cli/generate/github/workflows-blueprint.js.map +1 -0
- package/build/src/cli/generate/must-haves/agent-conventions.js +2 -2
- package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.d.ts +1 -0
- package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.js +41 -15
- package/build/src/cli/generate/must-haves/dotenv.js.map +1 -1
- package/build/src/cli/generate/must-haves/editorconfig.js +2 -2
- package/build/src/cli/generate/must-haves/editorconfig.js.map +1 -1
- package/build/src/cli/generate/must-haves/gitignore.js +2 -2
- package/build/src/cli/generate/must-haves/gitignore.js.map +1 -1
- package/build/src/cli/generate/must-haves/license.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/license.js +4 -4
- package/build/src/cli/generate/must-haves/license.js.map +1 -1
- package/build/src/cli/generate/must-haves/read-me.d.ts +6 -2
- package/build/src/cli/generate/must-haves/read-me.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/read-me.js +103 -63
- package/build/src/cli/generate/must-haves/read-me.js.map +1 -1
- package/build/src/cli/index.js +108 -2
- package/build/src/cli/index.js.map +1 -1
- package/build/src/cli/recipe/github/sync-features.d.ts.map +1 -1
- package/build/src/cli/recipe/github/sync-features.js +5 -3
- package/build/src/cli/recipe/github/sync-features.js.map +1 -1
- package/build/src/cli/recipe/github/sync-identity.d.ts.map +1 -1
- package/build/src/cli/recipe/github/sync-identity.js +5 -3
- package/build/src/cli/recipe/github/sync-identity.js.map +1 -1
- package/build/src/cli/recipe/github/sync-policies.d.ts.map +1 -1
- package/build/src/cli/recipe/github/sync-policies.js +5 -3
- package/build/src/cli/recipe/github/sync-policies.js.map +1 -1
- package/build/src/cli/recipe/index.d.ts.map +1 -1
- package/build/src/cli/recipe/index.js +32 -0
- package/build/src/cli/recipe/index.js.map +1 -1
- package/build/src/cli/recipe/license/update-copyright.d.ts +7 -0
- package/build/src/cli/recipe/license/update-copyright.d.ts.map +1 -0
- package/build/src/cli/recipe/license/update-copyright.js +191 -0
- package/build/src/cli/recipe/license/update-copyright.js.map +1 -0
- package/build/src/cli/recipe/package-json/cleanup.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/cleanup.js +14 -13
- package/build/src/cli/recipe/package-json/cleanup.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-artifacts.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-artifacts.js +11 -6
- package/build/src/cli/recipe/package-json/normalize-artifacts.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-bundler.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-bundler.js +11 -6
- package/build/src/cli/recipe/package-json/normalize-bundler.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-dependencies.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-dependencies.js +18 -10
- package/build/src/cli/recipe/package-json/normalize-dependencies.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-modules.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-modules.js +11 -6
- package/build/src/cli/recipe/package-json/normalize-modules.js.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-tooling.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/normalize-tooling.js +12 -7
- package/build/src/cli/recipe/package-json/normalize-tooling.js.map +1 -1
- package/build/src/cli/recipe/package-json/sync-environment.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/sync-environment.js +46 -14
- package/build/src/cli/recipe/package-json/sync-environment.js.map +1 -1
- package/build/src/cli/recipe/package-json/sync-identity.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/sync-identity.js +29 -16
- package/build/src/cli/recipe/package-json/sync-identity.js.map +1 -1
- package/build/src/cli/recipe/package-json/sync-ownership.d.ts.map +1 -1
- package/build/src/cli/recipe/package-json/sync-ownership.js +18 -11
- package/build/src/cli/recipe/package-json/sync-ownership.js.map +1 -1
- package/build/src/cli/recipe/read-me/update-badges.d.ts +6 -0
- package/build/src/cli/recipe/read-me/update-badges.d.ts.map +1 -0
- package/build/src/cli/recipe/read-me/update-badges.js +115 -0
- package/build/src/cli/recipe/read-me/update-badges.js.map +1 -0
- package/build/src/cli/recipe/read-me/update-credits.d.ts +6 -0
- package/build/src/cli/recipe/read-me/update-credits.d.ts.map +1 -0
- package/build/src/cli/recipe/read-me/update-credits.js +115 -0
- package/build/src/cli/recipe/read-me/update-credits.js.map +1 -0
- package/build/src/cli/recipe/read-me/update-documentation.d.ts +6 -0
- package/build/src/cli/recipe/read-me/update-documentation.d.ts.map +1 -0
- package/build/src/cli/recipe/read-me/update-documentation.js +115 -0
- package/build/src/cli/recipe/read-me/update-documentation.js.map +1 -0
- package/build/src/cli/recipe/read-me/update-header.d.ts +6 -0
- package/build/src/cli/recipe/read-me/update-header.d.ts.map +1 -0
- package/build/src/cli/recipe/read-me/update-header.js +115 -0
- package/build/src/cli/recipe/read-me/update-header.js.map +1 -0
- package/build/src/cli/recipe/read-me/update-introduction.d.ts +6 -0
- package/build/src/cli/recipe/read-me/update-introduction.d.ts.map +1 -0
- package/build/src/cli/recipe/read-me/update-introduction.js +115 -0
- package/build/src/cli/recipe/read-me/update-introduction.js.map +1 -0
- package/build/src/cli/scaffold/starter/base.js +1 -1
- package/build/src/cli/scaffold/starter/base.js.map +1 -1
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +6 -2
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/initialize.d.ts +6 -0
- package/build/src/cli/utility/initialize.d.ts.map +1 -1
- package/build/src/cli/utility/initialize.js +676 -113
- package/build/src/cli/utility/initialize.js.map +1 -1
- package/build/src/cli/utility/run-scripts.d.ts.map +1 -1
- package/build/src/cli/utility/run-scripts.js +4 -4
- package/build/src/cli/utility/run-scripts.js.map +1 -1
- package/build/src/cli/utility/transpile.js +1 -1
- package/build/src/cli/utility/transpile.js.map +1 -1
- package/build/src/cli/utility/type-check.js +1 -1
- package/build/src/cli/utility/type-check.js.map +1 -1
- package/build/src/cli/utility/version.js +1 -1
- package/build/src/cli/utility/version.js.map +1 -1
- package/build/src/lib/env-github.d.ts +4 -0
- package/build/src/lib/env-github.d.ts.map +1 -0
- package/build/src/lib/env-github.js +57 -0
- package/build/src/lib/env-github.js.map +1 -0
- package/build/src/lib/env-managed-set.d.ts +3 -0
- package/build/src/lib/env-managed-set.d.ts.map +1 -0
- package/build/src/lib/env-managed-set.js +102 -0
- package/build/src/lib/env-managed-set.js.map +1 -0
- package/build/src/lib/env-namespace.d.ts +3 -0
- package/build/src/lib/env-namespace.d.ts.map +1 -0
- package/build/src/lib/env-namespace.js +11 -0
- package/build/src/lib/env-namespace.js.map +1 -0
- package/build/src/lib/env-reconcile.d.ts +3 -0
- package/build/src/lib/env-reconcile.d.ts.map +1 -0
- package/build/src/lib/env-reconcile.js +109 -0
- package/build/src/lib/env-reconcile.js.map +1 -0
- package/build/src/lib/env-status.d.ts +3 -0
- package/build/src/lib/env-status.d.ts.map +1 -0
- package/build/src/lib/env-status.js +113 -0
- package/build/src/lib/env-status.js.map +1 -0
- package/build/src/lib/item.d.ts +2 -1
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +26 -0
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/markdown-slug.js +1 -1
- package/build/src/lib/markdown-slug.js.map +1 -1
- package/build/src/lib/nova-config.d.ts +11 -4
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +425 -118
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/read-me-regions.d.ts +4 -0
- package/build/src/lib/read-me-regions.d.ts.map +1 -0
- package/build/src/lib/read-me-regions.js +33 -0
- package/build/src/lib/read-me-regions.js.map +1 -0
- package/build/src/lib/regex.d.ts +5 -0
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +5 -0
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/scaffold.d.ts.map +1 -1
- package/build/src/lib/scaffold.js +33 -14
- package/build/src/lib/scaffold.js.map +1 -1
- package/build/src/lib/type-declaration-engine.d.ts +2 -2
- package/build/src/lib/type-declaration-engine.d.ts.map +1 -1
- package/build/src/lib/type-declaration-engine.js +32 -6
- package/build/src/lib/type-declaration-engine.js.map +1 -1
- package/build/src/lib/utility.d.ts +2 -1
- package/build/src/lib/utility.d.ts.map +1 -1
- package/build/src/lib/utility.js +39 -7
- package/build/src/lib/utility.js.map +1 -1
- package/build/src/lib/workflow-templates.d.ts.map +1 -1
- package/build/src/lib/workflow-templates.js +86 -60
- package/build/src/lib/workflow-templates.js.map +1 -1
- package/build/src/presets/eslint/dx-code-style.d.ts.map +1 -1
- package/build/src/presets/eslint/dx-code-style.js +6 -0
- package/build/src/presets/eslint/dx-code-style.js.map +1 -1
- package/build/src/presets/eslint/fw-astro.d.ts +4 -0
- package/build/src/presets/eslint/fw-astro.d.ts.map +1 -0
- package/build/src/presets/eslint/fw-astro.js +13 -0
- package/build/src/presets/eslint/fw-astro.js.map +1 -0
- package/build/src/presets/eslint/index.d.ts +1 -0
- package/build/src/presets/eslint/index.d.ts.map +1 -1
- package/build/src/presets/eslint/index.js +1 -0
- package/build/src/presets/eslint/index.js.map +1 -1
- package/build/src/presets/tsconfig/fw-astro.json +15 -0
- package/build/src/rules/eslint/conventions/no-implicit-boolean.d.ts.map +1 -1
- package/build/src/rules/eslint/conventions/no-implicit-boolean.js +3 -2
- package/build/src/rules/eslint/conventions/no-implicit-boolean.js.map +1 -1
- package/build/src/rules/eslint/conventions/require-hash-private.js +1 -1
- package/build/src/rules/eslint/conventions/require-hash-private.js.map +1 -1
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.d.ts.map +1 -1
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.js +4 -1
- package/build/src/rules/eslint/conventions/require-kebab-case-filename.js.map +1 -1
- package/build/src/rules/eslint/conventions/require-node-protocol.d.ts +11 -0
- package/build/src/rules/eslint/conventions/require-node-protocol.d.ts.map +1 -0
- package/build/src/rules/eslint/conventions/require-node-protocol.js +76 -0
- package/build/src/rules/eslint/conventions/require-node-protocol.js.map +1 -0
- 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 +2 -1
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.js.map +1 -1
- package/build/src/rules/eslint/formatting/require-padding-lines.d.ts.map +1 -1
- package/build/src/rules/eslint/formatting/require-padding-lines.js +7 -3
- package/build/src/rules/eslint/formatting/require-padding-lines.js.map +1 -1
- package/build/src/rules/eslint/formatting/require-ternary-parens.d.ts.map +1 -1
- package/build/src/rules/eslint/formatting/require-ternary-parens.js +7 -17
- package/build/src/rules/eslint/formatting/require-ternary-parens.js.map +1 -1
- package/build/src/rules/eslint/index.d.ts +4 -0
- package/build/src/rules/eslint/index.d.ts.map +1 -1
- package/build/src/rules/eslint/index.js +4 -0
- package/build/src/rules/eslint/index.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.d.ts +3 -2
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.d.ts.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.js +22 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-body.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +2 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js +16 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js +8 -4
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.d.ts +12 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.js +169 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.d.ts +11 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.js +80 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.js.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js +2 -2
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.d.ts +15 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.d.ts.map +1 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.js +290 -0
- package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-await-in-loop.js +1 -1
- package/build/src/rules/eslint/patterns/no-await-in-loop.js.map +1 -1
- package/build/src/rules/eslint/patterns/no-bracket-method-call.d.ts.map +1 -1
- package/build/src/rules/eslint/patterns/no-bracket-method-call.js +4 -0
- package/build/src/rules/eslint/patterns/no-bracket-method-call.js.map +1 -1
- 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 +4 -1
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.js.map +1 -1
- package/build/src/rules/eslint/typescript/require-bracket-property-access.d.ts.map +1 -1
- package/build/src/rules/eslint/typescript/require-bracket-property-access.js +8 -1
- package/build/src/rules/eslint/typescript/require-bracket-property-access.js.map +1 -1
- package/build/src/rules/vitest/active-vitest.d.ts +5 -0
- package/build/src/rules/vitest/active-vitest.d.ts.map +1 -0
- package/build/src/rules/vitest/active-vitest.js +19 -0
- package/build/src/rules/vitest/active-vitest.js.map +1 -0
- package/build/src/rules/vitest/dotenv/register.d.ts.map +1 -1
- package/build/src/rules/vitest/dotenv/register.js +3 -2
- package/build/src/rules/vitest/dotenv/register.js.map +1 -1
- package/build/src/rules/vitest/dotenv/rules.d.ts.map +1 -1
- package/build/src/rules/vitest/dotenv/rules.js +2 -2
- package/build/src/rules/vitest/dotenv/rules.js.map +1 -1
- package/build/src/rules/vitest/frontmatter/register.d.ts.map +1 -1
- package/build/src/rules/vitest/frontmatter/register.js +3 -2
- package/build/src/rules/vitest/frontmatter/register.js.map +1 -1
- package/build/src/rules/vitest/frontmatter/rules.d.ts.map +1 -1
- package/build/src/rules/vitest/frontmatter/rules.js +13 -13
- package/build/src/rules/vitest/frontmatter/rules.js.map +1 -1
- package/build/src/rules/vitest/link/register.d.ts.map +1 -1
- package/build/src/rules/vitest/link/register.js +3 -2
- package/build/src/rules/vitest/link/register.js.map +1 -1
- package/build/src/rules/vitest/link/rules.d.ts.map +1 -1
- package/build/src/rules/vitest/link/rules.js +8 -8
- package/build/src/rules/vitest/link/rules.js.map +1 -1
- package/build/src/rules/vitest/markdown-table/register.d.ts.map +1 -1
- package/build/src/rules/vitest/markdown-table/register.js +3 -2
- package/build/src/rules/vitest/markdown-table/register.js.map +1 -1
- package/build/src/rules/vitest/markdown-table/rules.d.ts.map +1 -1
- package/build/src/rules/vitest/markdown-table/rules.js +3 -3
- package/build/src/rules/vitest/markdown-table/rules.js.map +1 -1
- package/build/src/rules/vitest/terminology/register.d.ts.map +1 -1
- package/build/src/rules/vitest/terminology/register.js +3 -2
- package/build/src/rules/vitest/terminology/register.js.map +1 -1
- package/build/src/rules/vitest/terminology/rules.d.ts.map +1 -1
- package/build/src/rules/vitest/terminology/rules.js +8 -8
- package/build/src/rules/vitest/terminology/rules.js.map +1 -1
- package/build/src/rules/vitest/type-declarations/register.d.ts.map +1 -1
- package/build/src/rules/vitest/type-declarations/register.js +6 -3
- package/build/src/rules/vitest/type-declarations/register.js.map +1 -1
- package/build/src/rules/vitest/type-declarations/rules.d.ts +3 -1
- package/build/src/rules/vitest/type-declarations/rules.d.ts.map +1 -1
- package/build/src/rules/vitest/type-declarations/rules.js +82 -12
- package/build/src/rules/vitest/type-declarations/rules.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/markdown-table.js +1 -1
- package/build/src/toolkit/markdown-table.js.map +1 -1
- package/build/src/toolkit/nova-identity.d.ts +19 -0
- package/build/src/toolkit/nova-identity.d.ts.map +1 -0
- package/build/src/toolkit/nova-identity.js +141 -0
- package/build/src/toolkit/nova-identity.js.map +1 -0
- package/build/src/types/cli/generate/github/funding.d.ts +4 -4
- package/build/src/types/cli/generate/github/issue-template.d.ts +11 -11
- package/build/src/types/cli/generate/github/workflows-blueprint-validate.d.ts +351 -0
- package/build/src/types/cli/generate/github/workflows-blueprint-variables.d.ts +131 -0
- package/build/src/types/cli/generate/github/workflows-blueprint.d.ts +1180 -0
- package/build/src/types/cli/generate/must-haves/agent-conventions.d.ts +4 -4
- package/build/src/types/cli/generate/must-haves/dotenv.d.ts +49 -14
- package/build/src/types/cli/generate/must-haves/editorconfig.d.ts +2 -2
- package/build/src/types/cli/generate/must-haves/gitignore.d.ts +8 -8
- package/build/src/types/cli/generate/must-haves/license.d.ts +5 -5
- package/build/src/types/cli/generate/must-haves/read-me.d.ts +136 -88
- package/build/src/types/cli/index.d.ts +14 -0
- package/build/src/types/cli/recipe/github/handle-gh-failure.d.ts +2 -2
- package/build/src/types/cli/recipe/github/sync-features.d.ts +19 -12
- package/build/src/types/cli/recipe/github/sync-identity.d.ts +18 -11
- package/build/src/types/cli/recipe/github/sync-policies.d.ts +22 -15
- package/build/src/types/cli/recipe/index.d.ts +7 -3
- package/build/src/types/cli/recipe/license/update-copyright.d.ts +142 -0
- package/build/src/types/cli/recipe/package-json/cleanup.d.ts +26 -22
- package/build/src/types/cli/recipe/package-json/normalize-artifacts.d.ts +22 -16
- package/build/src/types/cli/recipe/package-json/normalize-bundler.d.ts +20 -14
- package/build/src/types/cli/recipe/package-json/normalize-dependencies.d.ts +31 -19
- package/build/src/types/cli/recipe/package-json/normalize-modules.d.ts +20 -14
- package/build/src/types/cli/recipe/package-json/normalize-tooling.d.ts +20 -14
- package/build/src/types/cli/recipe/package-json/sync-environment.d.ts +46 -22
- package/build/src/types/cli/recipe/package-json/sync-identity.d.ts +36 -19
- package/build/src/types/cli/recipe/package-json/sync-ownership.d.ts +33 -23
- package/build/src/types/cli/recipe/read-me/update-badges.d.ts +77 -0
- package/build/src/types/cli/recipe/read-me/update-credits.d.ts +77 -0
- package/build/src/types/cli/recipe/read-me/update-documentation.d.ts +77 -0
- package/build/src/types/cli/recipe/read-me/update-header.d.ts +77 -0
- package/build/src/types/cli/recipe/read-me/update-introduction.d.ts +77 -0
- package/build/src/types/cli/scaffold/starter/base.d.ts +2 -2
- package/build/src/types/cli/utility/changelog.d.ts +74 -74
- package/build/src/types/cli/utility/initialize.d.ts +836 -374
- package/build/src/types/cli/utility/run-scripts.d.ts +1 -1
- package/build/src/types/cli/utility/transpile.d.ts +8 -3
- package/build/src/types/cli/utility/type-check.d.ts +9 -3
- package/build/src/types/cli/utility/version.d.ts +32 -32
- package/build/src/types/lib/env-github.d.ts +67 -0
- package/build/src/types/lib/env-managed-set.d.ts +90 -0
- package/build/src/types/lib/env-namespace.d.ts +22 -0
- package/build/src/types/lib/env-reconcile.d.ts +71 -0
- package/build/src/types/lib/env-status.d.ts +102 -0
- package/build/src/types/lib/item.d.ts +23 -0
- package/build/src/types/lib/nova-config.d.ts +397 -102
- package/build/src/types/lib/read-me-regions.d.ts +51 -0
- package/build/src/types/lib/scaffold.d.ts +43 -23
- package/build/src/types/lib/type-declaration-engine.d.ts +18 -2
- package/build/src/types/lib/utility.d.ts +38 -4
- package/build/src/types/lib/workflow-templates.d.ts +10 -74
- package/build/src/types/presets/eslint/fw-astro.d.ts +8 -0
- package/build/src/types/rules/eslint/conventions/no-implicit-boolean.d.ts +7 -0
- package/build/src/types/rules/eslint/conventions/require-naming-convention.d.ts +8 -4
- package/build/src/types/rules/eslint/conventions/require-node-protocol.d.ts +56 -0
- package/build/src/types/rules/eslint/formatting/require-padding-lines.d.ts +2 -0
- package/build/src/types/rules/eslint/formatting/require-ternary-parens.d.ts +8 -3
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-body.d.ts +16 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +17 -13
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts +3 -1
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-presence.d.ts +125 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-returns.d.ts +48 -0
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-tag-order.d.ts +204 -0
- package/build/src/types/rules/eslint/patterns/no-await-in-loop.d.ts +1 -1
- package/build/src/types/rules/eslint/patterns/no-bracket-method-call.d.ts +1 -1
- package/build/src/types/rules/eslint/typescript/require-bracket-property-access.d.ts +19 -7
- package/build/src/types/rules/vitest/active-vitest.d.ts +31 -0
- package/build/src/types/rules/vitest/index.d.ts +21 -1
- package/build/src/types/rules/vitest/markdown-table/rules.d.ts +2 -2
- package/build/src/types/rules/vitest/type-declarations/rules.d.ts +74 -0
- package/build/src/types/shared.d.ts +666 -32
- package/build/src/types/tests/cli/generate/github/funding.test.d.ts +14 -10
- package/build/src/types/tests/cli/generate/github/issue-template.test.d.ts +20 -16
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-generate.test.d.ts +199 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-parity.test.d.ts +75 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-publish-parity.test.d.ts +295 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-validate.test.d.ts +901 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-variables.test.d.ts +144 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint.test.d.ts +332 -0
- package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +11 -7
- package/build/src/types/tests/cli/generate/must-haves/dotenv.test.d.ts +83 -43
- package/build/src/types/tests/cli/generate/must-haves/editorconfig.test.d.ts +12 -8
- package/build/src/types/tests/cli/generate/must-haves/gitignore.test.d.ts +11 -7
- package/build/src/types/tests/cli/generate/must-haves/read-me.test.d.ts +33 -10
- package/build/src/types/tests/cli/recipe/github/handle-gh-failure.test.d.ts +25 -21
- package/build/src/types/tests/cli/recipe/github/sync-features.test.d.ts +98 -94
- package/build/src/types/tests/cli/recipe/github/sync-identity.test.d.ts +133 -129
- package/build/src/types/tests/cli/recipe/github/sync-policies.test.d.ts +125 -121
- package/build/src/types/tests/cli/recipe/license/update-copyright.test.d.ts +617 -0
- package/build/src/types/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts +27 -0
- package/build/src/types/tests/cli/recipe/package-json/sync-environment.test.d.ts +21 -0
- package/build/src/types/tests/cli/recipe/package-json/sync-identity.test.d.ts +52 -0
- package/build/src/types/tests/cli/recipe/read-me/update-badges.test.d.ts +258 -0
- package/build/src/types/tests/cli/recipe/read-me/update-credits.test.d.ts +258 -0
- package/build/src/types/tests/cli/recipe/read-me/update-documentation.test.d.ts +258 -0
- package/build/src/types/tests/cli/recipe/read-me/update-header.test.d.ts +258 -0
- package/build/src/types/tests/cli/recipe/read-me/update-introduction.test.d.ts +258 -0
- package/build/src/types/tests/cli/utility/changelog.test.d.ts +31 -0
- package/build/src/types/tests/cli/utility/initialize.test.d.ts +148 -32
- package/build/src/types/tests/lib/nova-config.test.d.ts +330 -173
- package/build/src/types/tests/lib/read-me-regions.test.d.ts +43 -0
- package/build/src/types/tests/lib/utility.test.d.ts +35 -0
- package/build/src/types/tests/lib/workflow-templates.test.d.ts +18 -2
- package/build/src/types/tests/rules/eslint/conventions/require-node-protocol.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-presence.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-returns.test.d.ts +8 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-tag-order.test.d.ts +8 -0
- package/build/src/types/tests/rules/vitest/active-vitest.test.d.ts +56 -0
- package/build/src/types/tests/rules/vitest/frontmatter.test.d.ts +14 -0
- package/build/src/types/tests/rules/vitest/terminology.test.d.ts +4 -0
- package/build/src/types/tests/toolkit/logger.test.d.ts +25 -5
- package/build/src/types/tests/toolkit/nova-identity.test.d.ts +118 -0
- package/build/src/types/tests/type-declarations.test.d.ts +14 -0
- package/build/src/types/toolkit/nova-identity.d.ts +313 -0
- package/build/templates/generators/github/workflows/publish/base.yml +2 -0
- package/build/templates/generators/github/workflows/publish/targets/cloudflare-workers.yml +36 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/universal.md +2 -0
- package/build/templates/scaffold/docs/docusaurus/docusaurus.config.ts +9 -3
- package/build/templates/scaffold/docs/docusaurus/package.json +5 -2
- package/build/templates/scaffold/docs/docusaurus/src/tests/frontmatter.test.ts +4 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/link.test.ts +2 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/markdown-table.test.ts +2 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/terminology.test.ts +2 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/type-declarations.test.ts +17 -0
- package/package.json +9 -8
- package/build/src/cli/generate/github/workflows.d.ts +0 -17
- package/build/src/cli/generate/github/workflows.d.ts.map +0 -1
- package/build/src/cli/generate/github/workflows.js +0 -856
- package/build/src/cli/generate/github/workflows.js.map +0 -1
- package/build/src/types/cli/generate/github/workflows.d.ts +0 -596
- package/build/src/types/tests/cli/generate/github/workflows-helpers.test.d.ts +0 -239
- package/build/src/types/tests/cli/generate/github/workflows.test.d.ts +0 -587
- package/build/templates/generators/github/workflows/publish/targets/aws-amplify-nextjs.yml +0 -32
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
1
|
+
import { promises as fs } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
3
|
import { Logger } from '../toolkit/index.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { libEnvNamespace } from './env-namespace.js';
|
|
5
|
+
import { libItemAllowedAgents, libItemAllowedPoliciesByRole, libItemAllowedRoles, libItemEmailFields, libItemGenericProtocols, libItemRecipesByCategory, libItemRepositoryProtocols, libItemUrlFields, } from './item.js';
|
|
6
|
+
import { LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REGEX_PATTERN_GITHUB_OWNER, LIB_REGEX_PATTERN_GITHUB_REPO, LIB_REGEX_PATTERN_SLUG_SCOPED, LIB_REGEX_PATTERN_SLUG_SIMPLE, } from './regex.js';
|
|
7
|
+
import { isFileIdentical, isPlainObject, pathExists, renameFileWithDate, } from './utility.js';
|
|
8
|
+
import { libWorkflowTemplatesMetadata } from './workflow-templates.js';
|
|
7
9
|
export class Runner {
|
|
8
10
|
#config;
|
|
11
|
+
#diagnostics = [];
|
|
9
12
|
constructor() {
|
|
10
13
|
const config = {};
|
|
11
14
|
this.#config = config;
|
|
@@ -32,17 +35,24 @@ export class Runner {
|
|
|
32
35
|
this.#config = this.parse(this.#config);
|
|
33
36
|
const currentDirectory = process.cwd();
|
|
34
37
|
const configPath = join(currentDirectory, 'nova.config.json');
|
|
35
|
-
|
|
38
|
+
const configExists = await pathExists(configPath);
|
|
39
|
+
if (configExists === true
|
|
40
|
+
&& await isFileIdentical(configPath, this.#config) === true) {
|
|
36
41
|
return;
|
|
37
42
|
}
|
|
38
|
-
if (
|
|
43
|
+
if (configExists === true
|
|
44
|
+
&& replaceFile === false) {
|
|
39
45
|
await renameFileWithDate(configPath);
|
|
40
46
|
}
|
|
41
47
|
await fs.writeFile(configPath, `${JSON.stringify(this.#config, null, 2)}\n`, 'utf-8');
|
|
42
48
|
return;
|
|
43
49
|
}
|
|
50
|
+
diagnostics() {
|
|
51
|
+
return [...this.#diagnostics];
|
|
52
|
+
}
|
|
44
53
|
parse(value) {
|
|
45
54
|
const result = {};
|
|
55
|
+
this.#diagnostics = [];
|
|
46
56
|
if (isPlainObject(value) === false) {
|
|
47
57
|
return result;
|
|
48
58
|
}
|
|
@@ -55,6 +65,9 @@ export class Runner {
|
|
|
55
65
|
const workspaces = this.parseWorkspaces(value['workspaces'], (project !== undefined && project['name'] !== undefined) ? project['name']['slug'] : undefined);
|
|
56
66
|
const gitignore = this.parseGitignore(value['gitignore']);
|
|
57
67
|
const agents = this.parseAgents(value['agents']);
|
|
68
|
+
const recipes = this.parseRecipes(value['recipes']);
|
|
69
|
+
const environment = this.parseEnvironment(value['environment'], workspaces, workflows);
|
|
70
|
+
this.validateCredContributors(value['workflows'], environment);
|
|
58
71
|
if (project !== undefined) {
|
|
59
72
|
result.project = project;
|
|
60
73
|
}
|
|
@@ -82,8 +95,36 @@ export class Runner {
|
|
|
82
95
|
if (agents !== undefined) {
|
|
83
96
|
result.agents = agents;
|
|
84
97
|
}
|
|
98
|
+
if (recipes !== undefined) {
|
|
99
|
+
result.recipes = recipes;
|
|
100
|
+
}
|
|
101
|
+
if (environment !== undefined) {
|
|
102
|
+
result.environment = environment;
|
|
103
|
+
}
|
|
85
104
|
return result;
|
|
86
105
|
}
|
|
106
|
+
pushError(name, purpose, message) {
|
|
107
|
+
this.#diagnostics.push({
|
|
108
|
+
severity: 'error',
|
|
109
|
+
message,
|
|
110
|
+
});
|
|
111
|
+
Logger.customize({
|
|
112
|
+
name,
|
|
113
|
+
purpose,
|
|
114
|
+
}).error(message);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
pushWarning(name, purpose, message) {
|
|
118
|
+
this.#diagnostics.push({
|
|
119
|
+
severity: 'warning',
|
|
120
|
+
message,
|
|
121
|
+
});
|
|
122
|
+
Logger.customize({
|
|
123
|
+
name,
|
|
124
|
+
purpose,
|
|
125
|
+
}).warn(message);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
87
128
|
parseProject(value) {
|
|
88
129
|
if (isPlainObject(value) === false) {
|
|
89
130
|
return undefined;
|
|
@@ -353,55 +394,11 @@ export class Runner {
|
|
|
353
394
|
}).warn(`Workspace "${path}" name "${nameCandidate}" does not match the required pattern for role "${matchedRole}". Skipping ...`);
|
|
354
395
|
continue;
|
|
355
396
|
}
|
|
356
|
-
let recipes = undefined;
|
|
357
|
-
const recipesCandidate = options['recipes'];
|
|
358
|
-
if (isPlainObject(recipesCandidate) === true) {
|
|
359
|
-
const parsedRecipes = {};
|
|
360
|
-
for (const allowedRecipe of libItemAllowedRecipes) {
|
|
361
|
-
const recipeTuple = Reflect.get(recipesCandidate, allowedRecipe);
|
|
362
|
-
if (Array.isArray(recipeTuple) === false || recipeTuple.length === 0) {
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
const enabled = recipeTuple[0];
|
|
366
|
-
if (typeof enabled !== 'boolean') {
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
const settings = recipeTuple[1];
|
|
370
|
-
if (settings !== undefined && isPlainObject(settings) === true) {
|
|
371
|
-
const parsedSettings = {};
|
|
372
|
-
for (const settingsEntry of Object.entries(settings)) {
|
|
373
|
-
const settingKey = settingsEntry[0];
|
|
374
|
-
const settingValue = settingsEntry[1];
|
|
375
|
-
if (typeof settingValue === 'boolean') {
|
|
376
|
-
Reflect.set(parsedSettings, settingKey, settingValue);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
if (Object.keys(parsedSettings).length > 0) {
|
|
380
|
-
Reflect.set(parsedRecipes, allowedRecipe, [
|
|
381
|
-
enabled,
|
|
382
|
-
parsedSettings,
|
|
383
|
-
]);
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
Reflect.set(parsedRecipes, allowedRecipe, [enabled]);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
Reflect.set(parsedRecipes, allowedRecipe, [enabled]);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
if (Object.keys(parsedRecipes).length > 0) {
|
|
394
|
-
recipes = parsedRecipes;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
const dotenv = this.parseWorkspaceDotenv(options['dotenv']);
|
|
398
397
|
Reflect.set(workspaces, path, {
|
|
399
398
|
role: matchedRole,
|
|
400
399
|
policy,
|
|
401
400
|
name: nameCandidate,
|
|
402
401
|
...(displayNameCandidate !== undefined) ? { displayName: displayNameCandidate } : {},
|
|
403
|
-
...(recipes !== undefined) ? { recipes } : {},
|
|
404
|
-
...(dotenv !== undefined) ? { dotenv } : {},
|
|
405
402
|
});
|
|
406
403
|
}
|
|
407
404
|
const workspaceKeys = Object.keys(workspaces);
|
|
@@ -415,6 +412,306 @@ export class Runner {
|
|
|
415
412
|
}
|
|
416
413
|
return sortedWorkspaces;
|
|
417
414
|
}
|
|
415
|
+
parseEnvironment(value, workspaces, workflows) {
|
|
416
|
+
if (isPlainObject(value) === false) {
|
|
417
|
+
return undefined;
|
|
418
|
+
}
|
|
419
|
+
const result = {};
|
|
420
|
+
const workspacePaths = (workspaces !== undefined) ? Object.keys(workspaces) : [];
|
|
421
|
+
const workflowNames = (workflows !== undefined) ? workflows.map((workflow) => workflow['suffix']) : [];
|
|
422
|
+
const collectedPrefixes = [];
|
|
423
|
+
const globalValue = value['global'];
|
|
424
|
+
if (isPlainObject(globalValue) === true) {
|
|
425
|
+
const globalPrefix = this.getNonEmptyString(globalValue['prefix']);
|
|
426
|
+
if (globalPrefix === undefined) {
|
|
427
|
+
this.pushError('Runner.parseEnvironment', 'environment', 'Environment "global" has no prefix. Skipping ...');
|
|
428
|
+
}
|
|
429
|
+
else if (libEnvNamespace.isReservedPrefix(globalPrefix) === true) {
|
|
430
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment "global" prefix "${globalPrefix}" is reserved and cannot be used. Skipping ...`);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
collectedPrefixes.push(globalPrefix);
|
|
434
|
+
const globalVariables = this.parseEnvironmentValues(globalValue['variables'], globalPrefix, 'global', false);
|
|
435
|
+
const globalResult = { prefix: globalPrefix };
|
|
436
|
+
if (globalVariables !== undefined) {
|
|
437
|
+
globalResult.variables = globalVariables;
|
|
438
|
+
}
|
|
439
|
+
result.global = globalResult;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
const appsValue = value['apps'];
|
|
443
|
+
if (isPlainObject(appsValue) === true) {
|
|
444
|
+
const apps = {};
|
|
445
|
+
for (const appEntry of Object.entries(appsValue)) {
|
|
446
|
+
const appPath = appEntry[0];
|
|
447
|
+
const appOptions = appEntry[1];
|
|
448
|
+
if (isPlainObject(appOptions) === false) {
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
451
|
+
if (workspacePaths.includes(appPath) === false) {
|
|
452
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment app "${appPath}" does not match a configured workspace. Skipping ...`);
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
const appPrefix = this.getNonEmptyString(appOptions['prefix']);
|
|
456
|
+
if (appPrefix === undefined) {
|
|
457
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment app "${appPath}" has no prefix. Skipping ...`);
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
if (libEnvNamespace.isReservedPrefix(appPrefix) === true) {
|
|
461
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment app "${appPath}" prefix "${appPrefix}" is reserved and cannot be used. Skipping ...`);
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
collectedPrefixes.push(appPrefix);
|
|
465
|
+
const appVariables = this.parseEnvironmentValues(appOptions['variables'], appPrefix, `app "${appPath}"`, true);
|
|
466
|
+
const appResult = { prefix: appPrefix };
|
|
467
|
+
if (appVariables !== undefined) {
|
|
468
|
+
appResult.variables = appVariables;
|
|
469
|
+
}
|
|
470
|
+
Reflect.set(apps, appPath, appResult);
|
|
471
|
+
}
|
|
472
|
+
if (Object.keys(apps).length > 0) {
|
|
473
|
+
result.apps = apps;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
const workflowsValue = value['workflows'];
|
|
477
|
+
if (isPlainObject(workflowsValue) === true) {
|
|
478
|
+
const workflowsResult = {};
|
|
479
|
+
for (const workflowEntry of Object.entries(workflowsValue)) {
|
|
480
|
+
const workflowName = workflowEntry[0];
|
|
481
|
+
const workflowOptions = workflowEntry[1];
|
|
482
|
+
if (isPlainObject(workflowOptions) === false) {
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
const matchCount = workflowNames.filter((name) => name === workflowName).length;
|
|
486
|
+
if (matchCount === 0) {
|
|
487
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" does not match a configured workflow. Skipping ...`);
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (matchCount > 1) {
|
|
491
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" matches more than one configured workflow. Skipping ...`);
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
const workflowPrefix = this.getNonEmptyString(workflowOptions['prefix']);
|
|
495
|
+
if (workflowPrefix === undefined) {
|
|
496
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" has no prefix. Skipping ...`);
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
499
|
+
if (libEnvNamespace.isReservedPrefix(workflowPrefix) === true) {
|
|
500
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" prefix "${workflowPrefix}" is reserved and cannot be used. Skipping ...`);
|
|
501
|
+
continue;
|
|
502
|
+
}
|
|
503
|
+
collectedPrefixes.push(workflowPrefix);
|
|
504
|
+
Reflect.set(workflowsResult, workflowName, { prefix: workflowPrefix });
|
|
505
|
+
}
|
|
506
|
+
if (Object.keys(workflowsResult).length > 0) {
|
|
507
|
+
result.workflows = workflowsResult;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
for (let i = 0; i < collectedPrefixes.length; i += 1) {
|
|
511
|
+
for (let j = i + 1; j < collectedPrefixes.length; j += 1) {
|
|
512
|
+
const prefixA = collectedPrefixes[i];
|
|
513
|
+
const prefixB = collectedPrefixes[j];
|
|
514
|
+
if (libEnvNamespace.prefixesOverlap(prefixA, prefixB) === true) {
|
|
515
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment prefixes "${prefixA}" and "${prefixB}" overlap. Skipping ...`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (Object.keys(result).length === 0) {
|
|
520
|
+
return undefined;
|
|
521
|
+
}
|
|
522
|
+
return result;
|
|
523
|
+
}
|
|
524
|
+
parseEnvironmentValues(rawVariables, prefix, context, requireBuildOnly) {
|
|
525
|
+
if (Array.isArray(rawVariables) === false) {
|
|
526
|
+
return undefined;
|
|
527
|
+
}
|
|
528
|
+
const values = [];
|
|
529
|
+
const seenNames = new Set();
|
|
530
|
+
for (const rawItem of rawVariables) {
|
|
531
|
+
const raw = rawItem;
|
|
532
|
+
if (isPlainObject(raw) === false) {
|
|
533
|
+
continue;
|
|
534
|
+
}
|
|
535
|
+
const key = this.getNonEmptyString(raw['key']);
|
|
536
|
+
if (key === undefined) {
|
|
537
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} has a value with no valid key. Skipping ...`);
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
const secretCandidate = (typeof raw['secret'] === 'boolean') ? raw['secret'] : undefined;
|
|
541
|
+
if (secretCandidate === undefined) {
|
|
542
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" has no boolean "secret" flag. Skipping ...`);
|
|
543
|
+
continue;
|
|
544
|
+
}
|
|
545
|
+
if (secretCandidate === true
|
|
546
|
+
&& (key.startsWith('PUBLIC_') === true
|
|
547
|
+
|| key.startsWith('NEXT_PUBLIC_') === true)) {
|
|
548
|
+
this.pushWarning('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" is a browser-exposed key marked secret and would leak if inlined into client output.`);
|
|
549
|
+
}
|
|
550
|
+
let hasError = false;
|
|
551
|
+
const buildOnlyCandidate = (typeof raw['buildOnly'] === 'boolean') ? raw['buildOnly'] : undefined;
|
|
552
|
+
if (requireBuildOnly === true && buildOnlyCandidate === undefined) {
|
|
553
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" has no boolean "buildOnly" flag. Skipping ...`);
|
|
554
|
+
hasError = true;
|
|
555
|
+
}
|
|
556
|
+
const defaultValueCandidate = (typeof raw['defaultValue'] === 'string') ? raw['defaultValue'] : undefined;
|
|
557
|
+
if (secretCandidate === true && defaultValueCandidate !== undefined) {
|
|
558
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" is a secret and cannot declare a "defaultValue". Skipping ...`);
|
|
559
|
+
hasError = true;
|
|
560
|
+
}
|
|
561
|
+
if (libEnvNamespace.startsWithPrefix(key, prefix) === true) {
|
|
562
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" starts with its own prefix "${prefix}". Skipping ...`);
|
|
563
|
+
hasError = true;
|
|
564
|
+
}
|
|
565
|
+
const name = libEnvNamespace.githubName(prefix, key);
|
|
566
|
+
if (libEnvNamespace.isGithubLegalName(name) === false) {
|
|
567
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" resolves to GitHub name "${name}" which is not a valid GitHub variable or secret name. Skipping ...`);
|
|
568
|
+
hasError = true;
|
|
569
|
+
}
|
|
570
|
+
const foldedName = name.toUpperCase();
|
|
571
|
+
if (seenNames.has(foldedName) === true) {
|
|
572
|
+
this.pushError('Runner.parseEnvironmentValues', 'environment', `Environment ${context} value "${key}" resolves to GitHub name "${name}" which duplicates another value in the same namespace. Skipping ...`);
|
|
573
|
+
hasError = true;
|
|
574
|
+
}
|
|
575
|
+
if (hasError === true) {
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
seenNames.add(foldedName);
|
|
579
|
+
const value = {
|
|
580
|
+
key,
|
|
581
|
+
secret: secretCandidate,
|
|
582
|
+
};
|
|
583
|
+
if (buildOnlyCandidate !== undefined) {
|
|
584
|
+
value.buildOnly = buildOnlyCandidate;
|
|
585
|
+
}
|
|
586
|
+
if (defaultValueCandidate !== undefined) {
|
|
587
|
+
value.defaultValue = defaultValueCandidate;
|
|
588
|
+
}
|
|
589
|
+
values.push(value);
|
|
590
|
+
}
|
|
591
|
+
return (values.length > 0) ? values : undefined;
|
|
592
|
+
}
|
|
593
|
+
validateCredContributors(rawWorkflows, environment) {
|
|
594
|
+
if (Array.isArray(rawWorkflows) === false) {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
if (environment === undefined) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
const globalGroup = (environment !== undefined) ? environment['global'] : undefined;
|
|
601
|
+
const hasGlobalPrefix = globalGroup !== undefined;
|
|
602
|
+
const appsGroup = (environment !== undefined) ? environment['apps'] : undefined;
|
|
603
|
+
const workflowsGroup = (environment !== undefined) ? environment['workflows'] : undefined;
|
|
604
|
+
const reported = new Set();
|
|
605
|
+
const serverBearingApps = new Set();
|
|
606
|
+
for (const rawWorkflowItem of rawWorkflows) {
|
|
607
|
+
const rawWorkflow = rawWorkflowItem;
|
|
608
|
+
if (isPlainObject(rawWorkflow) === false) {
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
const template = this.getNonEmptyString(rawWorkflow['template']);
|
|
612
|
+
if (template === undefined) {
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
const templateMeta = libWorkflowTemplatesMetadata.find((entry) => entry['name'] === template);
|
|
616
|
+
if (templateMeta === undefined) {
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
const workflowName = this.getNonEmptyString(rawWorkflow['name']);
|
|
620
|
+
const ownsConfigKeys = Object.values(templateMeta['variables']).some((variableMeta) => variableMeta['auto'] !== true && variableMeta['format'] !== 'literal');
|
|
621
|
+
const workflowGroup = (workflowsGroup !== undefined && workflowName !== undefined) ? workflowsGroup[workflowName] : undefined;
|
|
622
|
+
if (ownsConfigKeys === true
|
|
623
|
+
&& workflowName !== undefined
|
|
624
|
+
&& workflowGroup === undefined) {
|
|
625
|
+
const workflowMessage = `Environment workflow "${workflowName}" contributes config keys, but has no "workflows" entry with a prefix. Skipping ...`;
|
|
626
|
+
if (reported.has(workflowMessage) === false) {
|
|
627
|
+
reported.add(workflowMessage);
|
|
628
|
+
this.pushError('Runner.validateCredContributors', 'environment', workflowMessage);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const templateTargets = templateMeta['targets'];
|
|
632
|
+
if (templateTargets === undefined) {
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
const deployTargets = [];
|
|
636
|
+
const deployList = rawWorkflow['deploy'];
|
|
637
|
+
if (Array.isArray(deployList) === true) {
|
|
638
|
+
for (const deployItem of deployList) {
|
|
639
|
+
const deployEntry = deployItem;
|
|
640
|
+
if (isPlainObject(deployEntry) === false) {
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
const to = this.getNonEmptyString(deployEntry['to']);
|
|
644
|
+
const path = this.getNonEmptyString(deployEntry['path']);
|
|
645
|
+
if (to !== undefined && path !== undefined) {
|
|
646
|
+
deployTargets.push({
|
|
647
|
+
targetType: to,
|
|
648
|
+
appPath: path,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
const targetList = rawWorkflow['targets'];
|
|
654
|
+
if (Array.isArray(targetList) === true) {
|
|
655
|
+
for (const targetItem of targetList) {
|
|
656
|
+
const targetEntry = targetItem;
|
|
657
|
+
if (isPlainObject(targetEntry) === false) {
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
const type = this.getNonEmptyString(targetEntry['type']);
|
|
661
|
+
const workingDir = this.getNonEmptyString(targetEntry['workingDir']);
|
|
662
|
+
if (type !== undefined && workingDir !== undefined) {
|
|
663
|
+
deployTargets.push({
|
|
664
|
+
targetType: type,
|
|
665
|
+
appPath: workingDir,
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
for (const deployTarget of deployTargets) {
|
|
671
|
+
const targetMeta = templateTargets[deployTarget['targetType']];
|
|
672
|
+
if (targetMeta === undefined) {
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
if (targetMeta['supportsRuntimeSecretSync'] === true) {
|
|
676
|
+
serverBearingApps.add(deployTarget['appPath']);
|
|
677
|
+
}
|
|
678
|
+
const targetVariables = targetMeta['variables'];
|
|
679
|
+
for (const variableEntry of Object.entries(targetVariables)) {
|
|
680
|
+
const variableName = variableEntry[0];
|
|
681
|
+
const variableMeta = variableEntry[1];
|
|
682
|
+
const scope = variableMeta['scope'];
|
|
683
|
+
if (scope === 'account' && hasGlobalPrefix === false) {
|
|
684
|
+
const message = `Environment deploy target "${deployTarget['targetType']}" needs the account credential "${variableName}", but "global" has no prefix. Skipping ...`;
|
|
685
|
+
if (reported.has(message) === false) {
|
|
686
|
+
reported.add(message);
|
|
687
|
+
this.pushError('Runner.validateCredContributors', 'environment', message);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
else if (scope === 'app') {
|
|
691
|
+
const app = (appsGroup !== undefined) ? appsGroup[deployTarget['appPath']] : undefined;
|
|
692
|
+
if (app === undefined) {
|
|
693
|
+
const appMessage = `Environment deploy target "${deployTarget['targetType']}" needs the app credential "${variableName}" for "${deployTarget['appPath']}", but that app has no prefix. Skipping ...`;
|
|
694
|
+
if (reported.has(appMessage) === false) {
|
|
695
|
+
reported.add(appMessage);
|
|
696
|
+
this.pushError('Runner.validateCredContributors', 'environment', appMessage);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (appsGroup !== undefined) {
|
|
704
|
+
for (const appEntry of Object.entries(appsGroup)) {
|
|
705
|
+
const runtimeAppPath = appEntry[0];
|
|
706
|
+
const runtimeApp = appEntry[1];
|
|
707
|
+
const hasRuntimeValue = (runtimeApp['variables'] ?? []).some((variable) => variable['buildOnly'] === false);
|
|
708
|
+
if (hasRuntimeValue === true && serverBearingApps.has(runtimeAppPath) === false) {
|
|
709
|
+
this.pushError('Runner.validateCredContributors', 'environment', `Environment app "${runtimeAppPath}" declares a runtime value (buildOnly false), but deploys to no server-bearing target. Skipping ...`);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
418
715
|
parseWorkflows(value) {
|
|
419
716
|
if (Array.isArray(value) === false) {
|
|
420
717
|
return undefined;
|
|
@@ -429,7 +726,7 @@ export class Runner {
|
|
|
429
726
|
if (template === undefined) {
|
|
430
727
|
continue;
|
|
431
728
|
}
|
|
432
|
-
const suffix = this.getNonEmptyString(castItem['
|
|
729
|
+
const suffix = this.getNonEmptyString(castItem['name']);
|
|
433
730
|
if (suffix === undefined) {
|
|
434
731
|
continue;
|
|
435
732
|
}
|
|
@@ -533,10 +830,6 @@ export class Runner {
|
|
|
533
830
|
if (repo !== undefined) {
|
|
534
831
|
result.repo = repo;
|
|
535
832
|
}
|
|
536
|
-
const recipes = this.getGithubRecipes(value['recipes']);
|
|
537
|
-
if (recipes !== undefined) {
|
|
538
|
-
result.recipes = recipes;
|
|
539
|
-
}
|
|
540
833
|
const topics = this.getGithubTopics(value['topics']);
|
|
541
834
|
if (topics !== undefined) {
|
|
542
835
|
result.topics = topics;
|
|
@@ -555,73 +848,106 @@ export class Runner {
|
|
|
555
848
|
}
|
|
556
849
|
return (Object.keys(result).length > 0) ? result : undefined;
|
|
557
850
|
}
|
|
558
|
-
|
|
851
|
+
parseRecipes(value) {
|
|
559
852
|
if (isPlainObject(value) === false) {
|
|
560
853
|
return undefined;
|
|
561
854
|
}
|
|
562
855
|
const result = {};
|
|
563
|
-
const
|
|
564
|
-
if (
|
|
565
|
-
result.
|
|
856
|
+
const github = this.getRecipeEntries(value['github'], libItemRecipesByCategory['github']);
|
|
857
|
+
if (github !== undefined) {
|
|
858
|
+
result.github = github;
|
|
859
|
+
}
|
|
860
|
+
const license = this.getRecipeEntries(value['license'], libItemRecipesByCategory['license']);
|
|
861
|
+
if (license !== undefined) {
|
|
862
|
+
result.license = license;
|
|
863
|
+
}
|
|
864
|
+
const readMe = this.getRecipeEntries(value['read-me'], libItemRecipesByCategory['read-me']);
|
|
865
|
+
if (readMe !== undefined) {
|
|
866
|
+
Reflect.set(result, 'read-me', readMe);
|
|
867
|
+
}
|
|
868
|
+
const packageJson = this.getPackageJsonRecipes(value['package-json']);
|
|
869
|
+
if (packageJson !== undefined) {
|
|
870
|
+
Reflect.set(result, 'package-json', packageJson);
|
|
566
871
|
}
|
|
567
872
|
return (Object.keys(result).length > 0) ? result : undefined;
|
|
568
873
|
}
|
|
569
|
-
|
|
570
|
-
if (
|
|
874
|
+
getRecipeEntries(value, allowedNames) {
|
|
875
|
+
if (isPlainObject(value) === false) {
|
|
571
876
|
return undefined;
|
|
572
877
|
}
|
|
573
|
-
const
|
|
574
|
-
for (const
|
|
575
|
-
|
|
576
|
-
|
|
878
|
+
const result = {};
|
|
879
|
+
for (const name of allowedNames) {
|
|
880
|
+
const entry = this.getRecipeEntry(Reflect.get(value, name));
|
|
881
|
+
if (entry !== undefined) {
|
|
882
|
+
Reflect.set(result, name, entry);
|
|
577
883
|
}
|
|
578
884
|
}
|
|
579
|
-
return (
|
|
885
|
+
return (Object.keys(result).length > 0) ? result : undefined;
|
|
580
886
|
}
|
|
581
|
-
|
|
887
|
+
getPackageJsonRecipes(value) {
|
|
582
888
|
if (isPlainObject(value) === false) {
|
|
583
889
|
return undefined;
|
|
584
890
|
}
|
|
585
|
-
const
|
|
586
|
-
|
|
891
|
+
const result = {};
|
|
892
|
+
for (const valueEntry of Object.entries(value)) {
|
|
893
|
+
const workspacePath = valueEntry[0];
|
|
894
|
+
const workspaceValue = valueEntry[1];
|
|
895
|
+
const entries = this.getRecipeEntries(workspaceValue, libItemRecipesByCategory['package-json']);
|
|
896
|
+
if (entries !== undefined) {
|
|
897
|
+
Reflect.set(result, workspacePath, entries);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
return (Object.keys(result).length > 0) ? result : undefined;
|
|
901
|
+
}
|
|
902
|
+
getRecipeEntry(value) {
|
|
903
|
+
if (isPlainObject(value) === false) {
|
|
587
904
|
return undefined;
|
|
588
905
|
}
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
906
|
+
const enabled = value['enabled'];
|
|
907
|
+
if (typeof enabled !== 'boolean') {
|
|
908
|
+
return undefined;
|
|
909
|
+
}
|
|
910
|
+
const result = {
|
|
911
|
+
enabled,
|
|
912
|
+
};
|
|
913
|
+
const settingsCandidate = value['settings'];
|
|
914
|
+
if (isPlainObject(settingsCandidate) === true) {
|
|
915
|
+
const settings = {};
|
|
916
|
+
for (const settingsEntry of Object.entries(settingsCandidate)) {
|
|
917
|
+
const settingKey = settingsEntry[0];
|
|
918
|
+
const settingValue = settingsEntry[1];
|
|
919
|
+
if (typeof settingValue === 'boolean') {
|
|
920
|
+
Reflect.set(settings, settingKey, settingValue);
|
|
921
|
+
}
|
|
599
922
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
Logger.customize({
|
|
603
|
-
name: 'Runner.parseDotenv',
|
|
604
|
-
purpose: 'variables',
|
|
605
|
-
}).warn(`Dotenv variable "${key}" is reserved and managed by the dotenv template. It cannot be declared.`);
|
|
606
|
-
continue;
|
|
923
|
+
if (Object.keys(settings).length > 0) {
|
|
924
|
+
result.settings = settings;
|
|
607
925
|
}
|
|
608
|
-
const defaultValueCandidate = (typeof rawVariable['defaultValue'] === 'string') ? rawVariable['defaultValue'] : undefined;
|
|
609
|
-
const defaultValue = defaultValueCandidate ?? '';
|
|
610
|
-
variablesByKey.set(key, {
|
|
611
|
-
key,
|
|
612
|
-
defaultValue,
|
|
613
|
-
});
|
|
614
926
|
}
|
|
615
|
-
|
|
616
|
-
return (variables.length > 0) ? variables : undefined;
|
|
927
|
+
return result;
|
|
617
928
|
}
|
|
618
|
-
|
|
929
|
+
parseGitignore(value) {
|
|
619
930
|
if (isPlainObject(value) === false) {
|
|
620
931
|
return undefined;
|
|
621
932
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
933
|
+
const result = {};
|
|
934
|
+
const projectExcludes = this.getArrayOfNonEmptyStrings(value['projectExcludes']);
|
|
935
|
+
if (projectExcludes !== undefined) {
|
|
936
|
+
result.projectExcludes = projectExcludes;
|
|
937
|
+
}
|
|
938
|
+
return (Object.keys(result).length > 0) ? result : undefined;
|
|
939
|
+
}
|
|
940
|
+
parseAgents(value) {
|
|
941
|
+
if (Array.isArray(value) === false) {
|
|
942
|
+
return undefined;
|
|
943
|
+
}
|
|
944
|
+
const agents = [];
|
|
945
|
+
for (const allowedAgent of libItemAllowedAgents) {
|
|
946
|
+
if (value.some((item) => item === allowedAgent) === true) {
|
|
947
|
+
agents.push(allowedAgent);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
return (agents.length > 0) ? agents : undefined;
|
|
625
951
|
}
|
|
626
952
|
getGithubFeatures(value) {
|
|
627
953
|
if (isPlainObject(value) === false) {
|
|
@@ -704,25 +1030,6 @@ export class Runner {
|
|
|
704
1030
|
}
|
|
705
1031
|
return (Object.keys(result).length > 0) ? result : undefined;
|
|
706
1032
|
}
|
|
707
|
-
getGithubRecipes(value) {
|
|
708
|
-
if (isPlainObject(value) === false) {
|
|
709
|
-
return undefined;
|
|
710
|
-
}
|
|
711
|
-
const result = {};
|
|
712
|
-
const syncIdentity = (typeof value['sync-identity'] === 'boolean') ? value['sync-identity'] : undefined;
|
|
713
|
-
if (syncIdentity !== undefined) {
|
|
714
|
-
Reflect.set(result, 'sync-identity', syncIdentity);
|
|
715
|
-
}
|
|
716
|
-
const syncFeatures = (typeof value['sync-features'] === 'boolean') ? value['sync-features'] : undefined;
|
|
717
|
-
if (syncFeatures !== undefined) {
|
|
718
|
-
Reflect.set(result, 'sync-features', syncFeatures);
|
|
719
|
-
}
|
|
720
|
-
const syncPolicies = (typeof value['sync-policies'] === 'boolean') ? value['sync-policies'] : undefined;
|
|
721
|
-
if (syncPolicies !== undefined) {
|
|
722
|
-
Reflect.set(result, 'sync-policies', syncPolicies);
|
|
723
|
-
}
|
|
724
|
-
return (Object.keys(result).length > 0) ? result : undefined;
|
|
725
|
-
}
|
|
726
1033
|
getGithubTopics(value) {
|
|
727
1034
|
if (Array.isArray(value) === false) {
|
|
728
1035
|
return undefined;
|