@cbnventures/nova 0.18.0 → 0.20.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/build/package.json +6 -3
- package/build/src/cli/generate/github/issue-template.d.ts.map +1 -1
- package/build/src/cli/generate/github/issue-template.js +4 -93
- package/build/src/cli/generate/github/issue-template.js.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.js +12 -3
- package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.d.ts +4 -7
- package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.js +120 -417
- package/build/src/cli/generate/must-haves/dotenv.js.map +1 -1
- package/build/src/cli/generate/must-haves/gitignore.d.ts +0 -8
- package/build/src/cli/generate/must-haves/gitignore.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/gitignore.js +7 -395
- package/build/src/cli/generate/must-haves/gitignore.js.map +1 -1
- package/build/src/cli/index.js +31 -31
- package/build/src/cli/index.js.map +1 -1
- package/build/src/cli/recipe/github/sync-identity.js +1 -1
- 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 +8 -1
- package/build/src/cli/recipe/github/sync-policies.js.map +1 -1
- package/build/src/cli/utility/changelog.d.ts +2 -0
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +154 -2
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/initialize.d.ts +3 -0
- package/build/src/cli/utility/initialize.d.ts.map +1 -1
- package/build/src/cli/utility/initialize.js +305 -1
- package/build/src/cli/utility/initialize.js.map +1 -1
- package/build/src/lib/dotenv.d.ts +3 -0
- package/build/src/lib/dotenv.d.ts.map +1 -0
- package/build/src/lib/dotenv.js +66 -0
- package/build/src/lib/dotenv.js.map +1 -0
- package/build/src/lib/file-discovery.d.ts +3 -0
- package/build/src/lib/file-discovery.d.ts.map +1 -0
- package/build/src/lib/file-discovery.js +32 -0
- package/build/src/lib/file-discovery.js.map +1 -0
- package/build/src/lib/item.d.ts +3 -1
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +9 -0
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/markdown-slug.d.ts +4 -0
- package/build/src/lib/markdown-slug.d.ts.map +1 -0
- package/build/src/lib/markdown-slug.js +25 -0
- package/build/src/lib/markdown-slug.js.map +1 -0
- package/build/src/lib/nova-config.d.ts +5 -0
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +135 -13
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/regex.d.ts +68 -0
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +70 -2
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/type-declaration-engine.d.ts +32 -0
- package/build/src/lib/type-declaration-engine.d.ts.map +1 -0
- package/build/src/lib/type-declaration-engine.js +770 -0
- package/build/src/lib/type-declaration-engine.js.map +1 -0
- package/build/src/lib/utility.d.ts.map +1 -1
- package/build/src/lib/utility.js +8 -8
- package/build/src/lib/utility.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.map +1 -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 +3 -3
- package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.d.ts.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js +3 -2
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js +2 -2
- package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts.map +1 -1
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js +102 -6
- package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js.map +1 -1
- package/build/src/rules/eslint/regex/no-regex-literals.d.ts +1 -0
- package/build/src/rules/eslint/regex/no-regex-literals.d.ts.map +1 -1
- package/build/src/rules/eslint/regex/no-regex-literals.js +39 -1
- package/build/src/rules/eslint/regex/no-regex-literals.js.map +1 -1
- package/build/src/rules/eslint/typescript/require-type-naming.js +2 -2
- package/build/src/rules/eslint/typescript/require-type-naming.js.map +1 -1
- package/build/src/rules/vitest/dotenv/register.d.ts +3 -0
- package/build/src/rules/vitest/dotenv/register.d.ts.map +1 -0
- package/build/src/rules/vitest/dotenv/register.js +21 -0
- package/build/src/rules/vitest/dotenv/register.js.map +1 -0
- package/build/src/rules/vitest/dotenv/rules.d.ts +3 -0
- package/build/src/rules/vitest/dotenv/rules.d.ts.map +1 -0
- package/build/src/rules/vitest/dotenv/rules.js +32 -0
- package/build/src/rules/vitest/dotenv/rules.js.map +1 -0
- package/build/src/rules/vitest/enable.d.ts +3 -0
- package/build/src/rules/vitest/enable.d.ts.map +1 -0
- package/build/src/rules/vitest/enable.js +7 -0
- package/build/src/rules/vitest/enable.js.map +1 -0
- package/build/src/rules/vitest/frontmatter/register.d.ts +3 -0
- package/build/src/rules/vitest/frontmatter/register.d.ts.map +1 -0
- package/build/src/rules/vitest/frontmatter/register.js +51 -0
- package/build/src/rules/vitest/frontmatter/register.js.map +1 -0
- package/build/src/rules/vitest/frontmatter/rules.d.ts +15 -0
- package/build/src/rules/vitest/frontmatter/rules.d.ts.map +1 -0
- package/build/src/rules/vitest/frontmatter/rules.js +498 -0
- package/build/src/rules/vitest/frontmatter/rules.js.map +1 -0
- package/build/src/rules/vitest/index.d.ts +8 -0
- package/build/src/rules/vitest/index.d.ts.map +1 -0
- package/build/src/rules/vitest/index.js +7 -0
- package/build/src/rules/vitest/index.js.map +1 -0
- package/build/src/rules/vitest/link/register.d.ts +3 -0
- package/build/src/rules/vitest/link/register.d.ts.map +1 -0
- package/build/src/rules/vitest/link/register.js +43 -0
- package/build/src/rules/vitest/link/register.js.map +1 -0
- package/build/src/rules/vitest/link/rules.d.ts +12 -0
- package/build/src/rules/vitest/link/rules.d.ts.map +1 -0
- package/build/src/rules/vitest/link/rules.js +313 -0
- package/build/src/rules/vitest/link/rules.js.map +1 -0
- package/build/src/rules/vitest/markdown-table/register.d.ts +3 -0
- package/build/src/rules/vitest/markdown-table/register.d.ts.map +1 -0
- package/build/src/rules/vitest/markdown-table/register.js +25 -0
- package/build/src/rules/vitest/markdown-table/register.js.map +1 -0
- package/build/src/rules/vitest/markdown-table/rules.d.ts +3 -0
- package/build/src/rules/vitest/markdown-table/rules.d.ts.map +1 -0
- package/build/src/rules/vitest/markdown-table/rules.js +99 -0
- package/build/src/rules/vitest/markdown-table/rules.js.map +1 -0
- package/build/src/rules/vitest/terminology/register.d.ts +3 -0
- package/build/src/rules/vitest/terminology/register.d.ts.map +1 -0
- package/build/src/rules/vitest/terminology/register.js +38 -0
- package/build/src/rules/vitest/terminology/register.js.map +1 -0
- package/build/src/rules/vitest/terminology/rules.d.ts +10 -0
- package/build/src/rules/vitest/terminology/rules.d.ts.map +1 -0
- package/build/src/rules/vitest/terminology/rules.js +202 -0
- package/build/src/rules/vitest/terminology/rules.js.map +1 -0
- package/build/src/rules/vitest/type-declarations/register.d.ts +3 -0
- package/build/src/rules/vitest/type-declarations/register.d.ts.map +1 -0
- package/build/src/rules/vitest/type-declarations/register.js +30 -0
- package/build/src/rules/vitest/type-declarations/register.js.map +1 -0
- package/build/src/rules/vitest/type-declarations/rules.d.ts +11 -0
- package/build/src/rules/vitest/type-declarations/rules.d.ts.map +1 -0
- package/build/src/rules/vitest/type-declarations/rules.js +666 -0
- package/build/src/rules/vitest/type-declarations/rules.js.map +1 -0
- package/build/src/toolkit/logger.d.ts.map +1 -1
- package/build/src/toolkit/logger.js +3 -1
- package/build/src/toolkit/logger.js.map +1 -1
- package/build/src/types/cli/generate/github/issue-template.d.ts +10 -30
- package/build/src/types/cli/generate/github/workflows.d.ts +7 -7
- package/build/src/types/cli/generate/must-haves/agent-conventions.d.ts +8 -1
- package/build/src/types/cli/generate/must-haves/dotenv.d.ts +79 -327
- package/build/src/types/cli/generate/must-haves/gitignore.d.ts +12 -342
- package/build/src/types/cli/recipe/github/sync-features.d.ts +1 -1
- package/build/src/types/cli/recipe/github/sync-identity.d.ts +2 -2
- package/build/src/types/cli/recipe/github/sync-policies.d.ts +3 -1
- package/build/src/types/cli/utility/changelog.d.ts +92 -0
- package/build/src/types/cli/utility/initialize.d.ts +195 -0
- package/build/src/types/lib/constants.d.ts +1 -1
- package/build/src/types/lib/dotenv.d.ts +67 -0
- package/build/src/types/lib/file-discovery.d.ts +40 -0
- package/build/src/types/lib/item.d.ts +19 -0
- package/build/src/types/lib/markdown-slug.d.ts +25 -0
- package/build/src/types/lib/nova-config.d.ts +108 -16
- package/build/src/types/lib/regex.d.ts +193 -18
- package/build/src/types/lib/type-declaration-engine.d.ts +1036 -0
- package/build/src/types/lib/utility.d.ts +2 -2
- package/build/src/types/lib/workflow-templates.d.ts +1 -1
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +2 -2
- package/build/src/types/rules/eslint/jsdoc/require-jsdoc-since.d.ts +71 -1
- package/build/src/types/rules/eslint/regex/no-regex-literals.d.ts +44 -0
- package/build/src/types/rules/eslint/typescript/require-type-naming.d.ts +3 -3
- package/build/src/types/rules/vitest/dotenv/register.d.ts +31 -0
- package/build/src/types/rules/vitest/dotenv/rules.d.ts +29 -0
- package/build/src/types/rules/vitest/enable.d.ts +12 -0
- package/build/src/types/rules/vitest/frontmatter/register.d.ts +63 -0
- package/build/src/types/rules/vitest/frontmatter/rules.d.ts +430 -0
- package/build/src/types/rules/vitest/index.d.ts +399 -0
- package/build/src/types/rules/vitest/link/register.d.ts +79 -0
- package/build/src/types/rules/vitest/link/rules.d.ts +368 -0
- package/build/src/types/rules/vitest/markdown-table/register.d.ts +33 -0
- package/build/src/types/rules/vitest/markdown-table/rules.d.ts +55 -0
- package/build/src/types/rules/vitest/terminology/register.d.ts +48 -0
- package/build/src/types/rules/vitest/terminology/rules.d.ts +190 -0
- package/build/src/types/rules/vitest/type-declarations/register.d.ts +46 -0
- package/build/src/types/rules/vitest/type-declarations/rules.d.ts +820 -0
- package/build/src/types/shared.d.ts +71 -4
- package/build/src/types/tests/cli/generate/github/issue-template.test.d.ts +34 -17
- package/build/src/types/tests/cli/generate/github/workflows-helpers.test.d.ts +8 -8
- package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +79 -11
- package/build/src/types/tests/cli/generate/must-haves/dotenv.test.d.ts +105 -15
- package/build/src/types/tests/cli/generate/must-haves/gitignore.test.d.ts +11 -20
- package/build/src/types/tests/cli/recipe/github/handle-gh-failure.test.d.ts +3 -3
- package/build/src/types/tests/cli/recipe/github/sync-features.test.d.ts +17 -17
- package/build/src/types/tests/cli/recipe/github/sync-identity.test.d.ts +69 -23
- package/build/src/types/tests/cli/recipe/github/sync-policies.test.d.ts +89 -20
- package/build/src/types/tests/cli/scaffold/docs/docusaurus.test.d.ts +4 -0
- package/build/src/types/tests/cli/utility/changelog.test.d.ts +262 -0
- package/build/src/types/tests/cli/utility/initialize.test.d.ts +31 -0
- package/build/src/types/tests/lib/dotenv.test.d.ts +95 -0
- package/build/src/types/tests/lib/file-discovery.test.d.ts +37 -0
- package/build/src/types/tests/lib/item.test.d.ts +21 -0
- package/build/src/types/tests/lib/markdown-slug.test.d.ts +24 -0
- package/build/src/types/tests/lib/nova-config.test.d.ts +263 -0
- package/build/src/types/tests/lib/regex.test.d.ts +252 -0
- package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-since.test.d.ts +18 -0
- package/build/src/types/tests/rules/vitest/dotenv.test.d.ts +19 -0
- package/build/src/types/tests/rules/vitest/enable.test.d.ts +27 -0
- package/build/src/types/tests/rules/vitest/frontmatter.test.d.ts +8 -0
- package/build/src/types/tests/rules/vitest/link.test.d.ts +74 -0
- package/build/src/types/tests/rules/vitest/markdown-table.test.d.ts +28 -0
- package/build/src/types/tests/rules/vitest/terminology.test.d.ts +39 -0
- package/build/src/types/tests/rules/vitest/type-declarations.test.d.ts +10 -0
- package/build/src/types/tests/scaffold-version-drift.test.d.ts +42 -0
- package/build/src/types/tests/since-version.test.d.ts +137 -0
- package/build/src/types/tests/toolkit/logger.test.d.ts +45 -0
- package/build/src/types/tests/type-declarations.test.d.ts +34 -1821
- package/build/src/types/toolkit/logger.d.ts +4 -0
- package/build/templates/generators/github/workflows/check-sponsor-gated-issues/base.yml +1 -1
- package/build/templates/generators/github/workflows/publish/base.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/aws-amplify-nextjs.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/cloudflare-pages-docusaurus.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/docker-hub.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/ghcr.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/github-action.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/github-packages.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/github-pages-docusaurus.yml +4 -4
- package/build/templates/generators/github/workflows/publish/targets/npm.yml +1 -1
- package/build/templates/generators/github/workflows/publish/targets/vercel-nextjs.yml +1 -1
- package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +1 -2
- package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +1 -2
- package/build/templates/generators/must-haves/agent-conventions/conventions/java.md +5 -5
- package/build/templates/generators/must-haves/agent-conventions/conventions/kotlin.md +4 -4
- package/build/templates/generators/must-haves/agent-conventions/conventions/php.md +2 -2
- package/build/templates/generators/must-haves/agent-conventions/conventions/typescript.md +6 -6
- package/build/templates/generators/must-haves/dotenv/env +5 -2
- package/build/templates/generators/must-haves/dotenv/env.sample +6 -3
- package/build/templates/generators/must-haves/gitignore/gitignore +6 -0
- package/build/templates/scaffold/app/express/package.json +5 -5
- package/build/templates/scaffold/app/nextjs/package.json +7 -7
- package/build/templates/scaffold/app/vite/package.json +3 -3
- package/build/templates/scaffold/app/workers/package.json +3 -3
- package/build/templates/scaffold/docs/docusaurus/docs/intro.md +6 -0
- package/build/templates/scaffold/docs/docusaurus/package.json +11 -7
- package/build/templates/scaffold/docs/docusaurus/src/tests/frontmatter.test.ts +21 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/link.test.ts +14 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/markdown-table.test.ts +14 -0
- package/build/templates/scaffold/docs/docusaurus/src/tests/terminology.test.ts +14 -0
- package/build/templates/scaffold/docs/docusaurus/vitest.config.ts +22 -0
- package/build/templates/scaffold/docs/docusaurus/vitest.setup.ts +26 -0
- package/package.json +6 -3
- package/build/templates/generators/must-haves/agent-conventions/cursorrules +0 -55
|
@@ -2,7 +2,7 @@ import { promises as fs } from 'fs';
|
|
|
2
2
|
import { join, relative, sep } from 'path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import prompts from 'prompts';
|
|
5
|
-
import { libItemAllowedPoliciesByRole, libItemAllowedRecipes, libItemSyncRoles, libItemValidEntityRoles, } from '../../lib/item.js';
|
|
5
|
+
import { libItemAllowedAgents, libItemAllowedPoliciesByRole, libItemAllowedRecipes, libItemSyncRoles, libItemValidEntityRoles, } from '../../lib/item.js';
|
|
6
6
|
import { Runner as LibNovaConfig } from '../../lib/nova-config.js';
|
|
7
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
8
|
import { discoverPathsWithFile, pathExists, resolveTemplatePath } from '../../lib/utility.js';
|
|
@@ -95,6 +95,16 @@ export class Runner {
|
|
|
95
95
|
description: 'Review workspace packages, assigning roles and policies.',
|
|
96
96
|
handler: Runner['promptWorkspaces'],
|
|
97
97
|
},
|
|
98
|
+
gitignore: {
|
|
99
|
+
label: 'Ignores',
|
|
100
|
+
description: 'Manage project-specific .gitignore excludes.',
|
|
101
|
+
handler: Runner['promptGitignore'],
|
|
102
|
+
},
|
|
103
|
+
agents: {
|
|
104
|
+
label: 'AI Tools',
|
|
105
|
+
description: 'Select the AI tools (Claude Code, Codex) to generate conventions for.',
|
|
106
|
+
handler: Runner['promptAgents'],
|
|
107
|
+
},
|
|
98
108
|
};
|
|
99
109
|
while (true) {
|
|
100
110
|
const categoryKeys = Object.keys(category);
|
|
@@ -1297,6 +1307,81 @@ export class Runner {
|
|
|
1297
1307
|
...((githubPoliciesAutoDeleteValue !== 'skip') ? { autoDeleteHeadBranch: githubPoliciesAutoDeleteValue } : {}),
|
|
1298
1308
|
};
|
|
1299
1309
|
}
|
|
1310
|
+
const existingGithubForIssueTemplate = (config['github'] !== undefined) ? config['github']['issueTemplate'] : undefined;
|
|
1311
|
+
const existingBugReportFields = (existingGithubForIssueTemplate !== undefined) ? (existingGithubForIssueTemplate['bugReportFields'] ?? []) : [];
|
|
1312
|
+
const issueTemplateOutput = await Runner.promptWithCancel({
|
|
1313
|
+
type: 'multiselect',
|
|
1314
|
+
name: 'bugReportFields',
|
|
1315
|
+
message: 'Issue-template bug-report fields (space to select)',
|
|
1316
|
+
choices: [
|
|
1317
|
+
{
|
|
1318
|
+
title: 'Node.js',
|
|
1319
|
+
value: 'nodejs.yml',
|
|
1320
|
+
selected: existingBugReportFields.includes('nodejs.yml'),
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
title: 'Apple',
|
|
1324
|
+
value: 'apple.yml',
|
|
1325
|
+
selected: existingBugReportFields.includes('apple.yml'),
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
title: 'Android',
|
|
1329
|
+
value: 'android.yml',
|
|
1330
|
+
selected: existingBugReportFields.includes('android.yml'),
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
title: 'C# / .NET',
|
|
1334
|
+
value: 'csharp.yml',
|
|
1335
|
+
selected: existingBugReportFields.includes('csharp.yml'),
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
title: 'PHP',
|
|
1339
|
+
value: 'php.yml',
|
|
1340
|
+
selected: existingBugReportFields.includes('php.yml'),
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
title: 'Python',
|
|
1344
|
+
value: 'python.yml',
|
|
1345
|
+
selected: existingBugReportFields.includes('python.yml'),
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
title: 'Homebridge',
|
|
1349
|
+
value: 'homebridge.yml',
|
|
1350
|
+
selected: existingBugReportFields.includes('homebridge.yml'),
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
title: 'pfSense',
|
|
1354
|
+
value: 'pfsense.yml',
|
|
1355
|
+
selected: existingBugReportFields.includes('pfsense.yml'),
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
title: 'Synology',
|
|
1359
|
+
value: 'synology.yml',
|
|
1360
|
+
selected: existingBugReportFields.includes('synology.yml'),
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
title: 'Docker',
|
|
1364
|
+
value: 'docker.yml',
|
|
1365
|
+
selected: existingBugReportFields.includes('docker.yml'),
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
title: 'Web Browser',
|
|
1369
|
+
value: 'web.yml',
|
|
1370
|
+
selected: existingBugReportFields.includes('web.yml'),
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
title: 'Screenshots',
|
|
1374
|
+
value: 'screenshots.yml',
|
|
1375
|
+
selected: existingBugReportFields.includes('screenshots.yml'),
|
|
1376
|
+
},
|
|
1377
|
+
],
|
|
1378
|
+
hint: '- Space to select. Return to submit',
|
|
1379
|
+
});
|
|
1380
|
+
if (issueTemplateOutput['cancelled'] === true) {
|
|
1381
|
+
return 'back';
|
|
1382
|
+
}
|
|
1383
|
+
const bugReportFields = issueTemplateOutput['result'].bugReportFields ?? [];
|
|
1384
|
+
const issueTemplateInput = (bugReportFields.length > 0) ? { bugReportFields } : undefined;
|
|
1300
1385
|
const githubConfig = {
|
|
1301
1386
|
owner: githubOwnerInput,
|
|
1302
1387
|
repo: githubRepoInput,
|
|
@@ -1304,6 +1389,7 @@ export class Runner {
|
|
|
1304
1389
|
...(githubTopicsInput !== undefined ? { topics: githubTopicsInput } : {}),
|
|
1305
1390
|
...(githubFeaturesInput !== undefined ? { features: githubFeaturesInput } : {}),
|
|
1306
1391
|
...(githubPoliciesInput !== undefined ? { policies: githubPoliciesInput } : {}),
|
|
1392
|
+
...(issueTemplateInput !== undefined ? { issueTemplate: issueTemplateInput } : {}),
|
|
1307
1393
|
};
|
|
1308
1394
|
Object.assign(config, { github: githubConfig });
|
|
1309
1395
|
Logger.customize({
|
|
@@ -2161,6 +2247,222 @@ export class Runner {
|
|
|
2161
2247
|
const confirmOutputResult = confirmOutput['result'];
|
|
2162
2248
|
return confirmOutputResult.confirm;
|
|
2163
2249
|
}
|
|
2250
|
+
static async promptGitignore(config) {
|
|
2251
|
+
const existing = config['gitignore'];
|
|
2252
|
+
const excludes = (existing !== undefined && Array.isArray(existing['projectExcludes']) === true) ? [...existing['projectExcludes']] : [];
|
|
2253
|
+
if (excludes.length === 0) {
|
|
2254
|
+
const imported = await Runner.importGitignoreExcludes();
|
|
2255
|
+
excludes.push(...imported);
|
|
2256
|
+
}
|
|
2257
|
+
const sync = () => {
|
|
2258
|
+
if (excludes.length > 0) {
|
|
2259
|
+
Object.assign(config, {
|
|
2260
|
+
gitignore: {
|
|
2261
|
+
projectExcludes: [...excludes],
|
|
2262
|
+
},
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
else {
|
|
2266
|
+
Reflect.deleteProperty(config, 'gitignore');
|
|
2267
|
+
}
|
|
2268
|
+
return;
|
|
2269
|
+
};
|
|
2270
|
+
while (true) {
|
|
2271
|
+
const choices = [];
|
|
2272
|
+
for (let i = 0; i < excludes.length; i += 1) {
|
|
2273
|
+
const pattern = excludes[i];
|
|
2274
|
+
if (pattern === undefined) {
|
|
2275
|
+
continue;
|
|
2276
|
+
}
|
|
2277
|
+
choices.push({
|
|
2278
|
+
title: `${chalk.yellow.bold('[EDIT]')} ${pattern}`,
|
|
2279
|
+
description: 'Update this pattern.',
|
|
2280
|
+
value: {
|
|
2281
|
+
kind: 'edit',
|
|
2282
|
+
index: i,
|
|
2283
|
+
},
|
|
2284
|
+
});
|
|
2285
|
+
choices.push({
|
|
2286
|
+
title: `${chalk.red.bold('[REMOVE]')} ${pattern}`,
|
|
2287
|
+
description: 'Delete this pattern.',
|
|
2288
|
+
value: {
|
|
2289
|
+
kind: 'remove',
|
|
2290
|
+
index: i,
|
|
2291
|
+
},
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
choices.push({
|
|
2295
|
+
title: 'Add a pattern',
|
|
2296
|
+
description: 'Add a new ".gitignore" exclude.',
|
|
2297
|
+
value: {
|
|
2298
|
+
kind: 'add',
|
|
2299
|
+
},
|
|
2300
|
+
});
|
|
2301
|
+
choices.push({
|
|
2302
|
+
title: 'Back',
|
|
2303
|
+
description: 'Return to the category selection.',
|
|
2304
|
+
value: {
|
|
2305
|
+
kind: 'back',
|
|
2306
|
+
},
|
|
2307
|
+
});
|
|
2308
|
+
const menuOutput = await Runner.promptWithCancel({
|
|
2309
|
+
type: 'select',
|
|
2310
|
+
name: 'action',
|
|
2311
|
+
message: (excludes.length > 0) ? 'Select a pattern to manage.' : 'No patterns found. Choose an option.',
|
|
2312
|
+
choices,
|
|
2313
|
+
});
|
|
2314
|
+
if (menuOutput['cancelled'] === true) {
|
|
2315
|
+
sync();
|
|
2316
|
+
return 'back';
|
|
2317
|
+
}
|
|
2318
|
+
const menuOutputResultValue = menuOutput['result'];
|
|
2319
|
+
if (menuOutputResultValue.action === undefined
|
|
2320
|
+
|| menuOutputResultValue.action['kind'] === 'back') {
|
|
2321
|
+
sync();
|
|
2322
|
+
return 'back';
|
|
2323
|
+
}
|
|
2324
|
+
if (menuOutputResultValue.action['kind'] === 'add') {
|
|
2325
|
+
const addOutput = await Runner.promptWithCancel({
|
|
2326
|
+
type: 'text',
|
|
2327
|
+
name: 'pattern',
|
|
2328
|
+
message: 'Pattern to ignore (e.g. logs/):',
|
|
2329
|
+
validate: Runner['isNonEmptyLiteralInput'],
|
|
2330
|
+
});
|
|
2331
|
+
if (addOutput['cancelled'] === true) {
|
|
2332
|
+
continue;
|
|
2333
|
+
}
|
|
2334
|
+
const addOutputResultValue = addOutput['result'];
|
|
2335
|
+
const addPattern = addOutputResultValue.pattern.trim();
|
|
2336
|
+
if (addPattern === '') {
|
|
2337
|
+
continue;
|
|
2338
|
+
}
|
|
2339
|
+
excludes.push(addPattern);
|
|
2340
|
+
sync();
|
|
2341
|
+
Logger.customize({
|
|
2342
|
+
name: 'Runner.promptGitignore',
|
|
2343
|
+
purpose: 'add',
|
|
2344
|
+
padTop: 1,
|
|
2345
|
+
padBottom: 1,
|
|
2346
|
+
}).info('Added new pattern.');
|
|
2347
|
+
continue;
|
|
2348
|
+
}
|
|
2349
|
+
if (menuOutputResultValue.action['kind'] === 'edit') {
|
|
2350
|
+
const editIndex = menuOutputResultValue.action['index'];
|
|
2351
|
+
if (editIndex < 0 || editIndex >= excludes.length) {
|
|
2352
|
+
continue;
|
|
2353
|
+
}
|
|
2354
|
+
const patternToEdit = excludes[editIndex];
|
|
2355
|
+
if (patternToEdit === undefined) {
|
|
2356
|
+
continue;
|
|
2357
|
+
}
|
|
2358
|
+
const editOutput = await Runner.promptWithCancel({
|
|
2359
|
+
type: 'text',
|
|
2360
|
+
name: 'pattern',
|
|
2361
|
+
message: 'Pattern to ignore (e.g. logs/):',
|
|
2362
|
+
initial: patternToEdit,
|
|
2363
|
+
validate: Runner['isNonEmptyLiteralInput'],
|
|
2364
|
+
});
|
|
2365
|
+
if (editOutput['cancelled'] === true) {
|
|
2366
|
+
continue;
|
|
2367
|
+
}
|
|
2368
|
+
const editOutputResultValue = editOutput['result'];
|
|
2369
|
+
const editPattern = editOutputResultValue.pattern.trim();
|
|
2370
|
+
if (editPattern === '') {
|
|
2371
|
+
continue;
|
|
2372
|
+
}
|
|
2373
|
+
Reflect.set(excludes, editIndex, editPattern);
|
|
2374
|
+
sync();
|
|
2375
|
+
Logger.customize({
|
|
2376
|
+
name: 'Runner.promptGitignore',
|
|
2377
|
+
purpose: 'edit',
|
|
2378
|
+
padTop: 1,
|
|
2379
|
+
padBottom: 1,
|
|
2380
|
+
}).info('Updated pattern.');
|
|
2381
|
+
continue;
|
|
2382
|
+
}
|
|
2383
|
+
if (menuOutputResultValue.action['kind'] === 'remove') {
|
|
2384
|
+
const removeIndex = menuOutputResultValue.action['index'];
|
|
2385
|
+
if (removeIndex < 0 || removeIndex >= excludes.length) {
|
|
2386
|
+
continue;
|
|
2387
|
+
}
|
|
2388
|
+
const patternToRemove = excludes[removeIndex];
|
|
2389
|
+
if (patternToRemove === undefined) {
|
|
2390
|
+
continue;
|
|
2391
|
+
}
|
|
2392
|
+
const removeOutput = await Runner.promptWithCancel({
|
|
2393
|
+
type: 'confirm',
|
|
2394
|
+
name: 'confirm',
|
|
2395
|
+
message: `Remove pattern "${patternToRemove}"?`,
|
|
2396
|
+
initial: false,
|
|
2397
|
+
});
|
|
2398
|
+
if (removeOutput['cancelled'] === true) {
|
|
2399
|
+
continue;
|
|
2400
|
+
}
|
|
2401
|
+
const removeOutputResultValue = removeOutput['result'];
|
|
2402
|
+
if (removeOutputResultValue.confirm !== true) {
|
|
2403
|
+
continue;
|
|
2404
|
+
}
|
|
2405
|
+
excludes.splice(removeIndex, 1);
|
|
2406
|
+
sync();
|
|
2407
|
+
Logger.customize({
|
|
2408
|
+
name: 'Runner.promptGitignore',
|
|
2409
|
+
purpose: 'remove',
|
|
2410
|
+
padTop: 1,
|
|
2411
|
+
padBottom: 1,
|
|
2412
|
+
}).info('Removed pattern.');
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
static async promptAgents(config) {
|
|
2417
|
+
const existing = (Array.isArray(config['agents']) === true) ? config['agents'] : [];
|
|
2418
|
+
const choices = libItemAllowedAgents.map((allowedAgent) => ({
|
|
2419
|
+
title: (allowedAgent === 'claude-code') ? 'Claude Code' : 'Codex',
|
|
2420
|
+
value: allowedAgent,
|
|
2421
|
+
selected: existing.includes(allowedAgent),
|
|
2422
|
+
}));
|
|
2423
|
+
const agentsOutput = await Runner.promptWithCancel({
|
|
2424
|
+
type: 'multiselect',
|
|
2425
|
+
name: 'agents',
|
|
2426
|
+
message: 'AI tools to generate conventions for',
|
|
2427
|
+
choices,
|
|
2428
|
+
min: 1,
|
|
2429
|
+
});
|
|
2430
|
+
if (agentsOutput['cancelled'] === true) {
|
|
2431
|
+
return 'back';
|
|
2432
|
+
}
|
|
2433
|
+
const agentsInput = agentsOutput['result'].agents;
|
|
2434
|
+
const agents = libItemAllowedAgents.filter((allowedAgent) => agentsInput.includes(allowedAgent));
|
|
2435
|
+
if (agents.length > 0) {
|
|
2436
|
+
Object.assign(config, {
|
|
2437
|
+
agents,
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
else {
|
|
2441
|
+
Reflect.deleteProperty(config, 'agents');
|
|
2442
|
+
}
|
|
2443
|
+
return 'back';
|
|
2444
|
+
}
|
|
2445
|
+
static async importGitignoreExcludes() {
|
|
2446
|
+
const gitignorePath = join(process.cwd(), '.gitignore');
|
|
2447
|
+
const exists = await pathExists(gitignorePath);
|
|
2448
|
+
if (exists === false) {
|
|
2449
|
+
return [];
|
|
2450
|
+
}
|
|
2451
|
+
const raw = await fs.readFile(gitignorePath, 'utf-8');
|
|
2452
|
+
const lines = raw.split('\n');
|
|
2453
|
+
const markerIndex = lines.findIndex((line) => line.includes('#### Project Excludes ####'));
|
|
2454
|
+
if (markerIndex === -1) {
|
|
2455
|
+
return [];
|
|
2456
|
+
}
|
|
2457
|
+
const result = [];
|
|
2458
|
+
for (const line of lines.slice(markerIndex + 1)) {
|
|
2459
|
+
const trimmed = line.trim();
|
|
2460
|
+
if (trimmed !== '' && trimmed.startsWith('#') === false) {
|
|
2461
|
+
result.push(trimmed);
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
return result;
|
|
2465
|
+
}
|
|
2164
2466
|
static async promptWorkspaces(config) {
|
|
2165
2467
|
const workspaces = (config['workspaces'] !== undefined) ? { ...(config['workspaces']) } : {};
|
|
2166
2468
|
const rawWorkspacePaths = await discoverPathsWithFile('package.json', 'forward');
|
|
@@ -2373,6 +2675,7 @@ export class Runner {
|
|
|
2373
2675
|
}
|
|
2374
2676
|
const workspaceDisplayNameInput = Runner.normalizeText(displayNamePrompt['result'].workspaceDisplayName, Infinity)['sanitized'];
|
|
2375
2677
|
const existingRecipes = (options['existingWorkspace'] !== undefined && options['existingWorkspace']['recipes'] !== undefined) ? options['existingWorkspace']['recipes'] : undefined;
|
|
2678
|
+
const existingDotenv = (options['existingWorkspace'] !== undefined && options['existingWorkspace']['dotenv'] !== undefined) ? options['existingWorkspace']['dotenv'] : undefined;
|
|
2376
2679
|
const recipesPrompt = await Runner.promptWithCancel({
|
|
2377
2680
|
type: 'multiselect',
|
|
2378
2681
|
name: 'workspaceRecipes',
|
|
@@ -2615,6 +2918,7 @@ export class Runner {
|
|
|
2615
2918
|
role: selectedRole,
|
|
2616
2919
|
policy: selectedPolicy,
|
|
2617
2920
|
...(Object.keys(recipes).length > 0) ? { recipes } : {},
|
|
2921
|
+
...(existingDotenv !== undefined) ? { dotenv: existingDotenv } : {},
|
|
2618
2922
|
},
|
|
2619
2923
|
};
|
|
2620
2924
|
}
|