@nexus-framework/cli 0.2.0 → 0.3.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 +62 -6
- package/dist/cli.js +87 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts +4 -2
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +47 -8
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pack.d.ts +28 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +206 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/skill.d.ts +53 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +371 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/update.d.ts +24 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +100 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/generators/ai-config.js +40 -1
- package/dist/generators/ai-config.js.map +1 -1
- package/dist/generators/docs.d.ts +10 -1
- package/dist/generators/docs.d.ts.map +1 -1
- package/dist/generators/docs.js +40 -65
- package/dist/generators/docs.js.map +1 -1
- package/dist/generators/index.d.ts +2 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +85 -9
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/skills.d.ts +32 -0
- package/dist/generators/skills.d.ts.map +1 -0
- package/dist/generators/skills.js +220 -0
- package/dist/generators/skills.js.map +1 -0
- package/dist/generators/spring-boot.d.ts +12 -0
- package/dist/generators/spring-boot.d.ts.map +1 -0
- package/dist/generators/spring-boot.js +220 -0
- package/dist/generators/spring-boot.js.map +1 -0
- package/dist/generators/structure.d.ts +1 -0
- package/dist/generators/structure.d.ts.map +1 -1
- package/dist/generators/structure.js +129 -24
- package/dist/generators/structure.js.map +1 -1
- package/dist/prompts/adoption.d.ts +35 -0
- package/dist/prompts/adoption.d.ts.map +1 -0
- package/dist/prompts/adoption.js +153 -0
- package/dist/prompts/adoption.js.map +1 -0
- package/dist/prompts/frameworks.d.ts +5 -1
- package/dist/prompts/frameworks.d.ts.map +1 -1
- package/dist/prompts/frameworks.js +49 -1
- package/dist/prompts/frameworks.js.map +1 -1
- package/dist/prompts/index.d.ts +2 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +32 -7
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/project-type.d.ts.map +1 -1
- package/dist/prompts/project-type.js +6 -1
- package/dist/prompts/project-type.js.map +1 -1
- package/dist/prompts/skill-config.d.ts +19 -0
- package/dist/prompts/skill-config.d.ts.map +1 -0
- package/dist/prompts/skill-config.js +22 -0
- package/dist/prompts/skill-config.js.map +1 -0
- package/dist/types/config.d.ts +9 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +4 -2
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/logger.d.ts +2 -2
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +49 -36
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/project-detector.d.ts +20 -4
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +156 -27
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/update-check.d.ts +27 -0
- package/dist/utils/update-check.d.ts.map +1 -0
- package/dist/utils/update-check.js +111 -0
- package/dist/utils/update-check.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-type.d.ts","sourceRoot":"","sources":["../../src/prompts/project-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"project-type.d.ts","sourceRoot":"","sources":["../../src/prompts/project-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,CA0B9D"}
|
|
@@ -16,7 +16,12 @@ export async function promptProjectType() {
|
|
|
16
16
|
{
|
|
17
17
|
value: 'api',
|
|
18
18
|
name: '⚡ API / Backend Service',
|
|
19
|
-
description: 'REST or GraphQL API (Express, Fastify, NestJS)',
|
|
19
|
+
description: 'REST or GraphQL API (Express, Fastify, NestJS, Spring Boot)',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 'ui-library',
|
|
23
|
+
name: '🎨 UI Component Library',
|
|
24
|
+
description: 'Reusable component library with Storybook & documentation',
|
|
20
25
|
},
|
|
21
26
|
{
|
|
22
27
|
value: 'monorepo',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-type.js","sourceRoot":"","sources":["../../src/prompts/project-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,MAAM,CAAc;QACzB,OAAO,EAAE,wBAAwB;QACjC,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,+DAA+D;aAC7E;YACD;gBACE,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"project-type.js","sourceRoot":"","sources":["../../src/prompts/project-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,MAAM,CAAc;QACzB,OAAO,EAAE,wBAAwB;QACjC,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,+DAA+D;aAC7E;YACD;gBACE,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,6DAA6D;aAC3E;YACD;gBACE,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,2DAA2D;aACzE;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,qCAAqC;aACnD;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Skill Config Prompt
|
|
3
|
+
*
|
|
4
|
+
* Asks the user whether to enable the NEXUS Skills System and whether
|
|
5
|
+
* to install the matching framework skills at init time.
|
|
6
|
+
*
|
|
7
|
+
* Both questions default to Yes — skills are opt-in but strongly recommended.
|
|
8
|
+
*/
|
|
9
|
+
export interface SkillConfig {
|
|
10
|
+
/** Whether to generate .nexus/skills/ with framework-matched core skills */
|
|
11
|
+
enableSkills: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Prompt the user for skill system preferences.
|
|
15
|
+
*
|
|
16
|
+
* @param frameworkLabel - Human-readable framework name for the prompt copy
|
|
17
|
+
*/
|
|
18
|
+
export declare function promptSkillConfig(frameworkLabel: string): Promise<SkillConfig>;
|
|
19
|
+
//# sourceMappingURL=skill-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-config.d.ts","sourceRoot":"","sources":["../../src/prompts/skill-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAOpF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Skill Config Prompt
|
|
3
|
+
*
|
|
4
|
+
* Asks the user whether to enable the NEXUS Skills System and whether
|
|
5
|
+
* to install the matching framework skills at init time.
|
|
6
|
+
*
|
|
7
|
+
* Both questions default to Yes — skills are opt-in but strongly recommended.
|
|
8
|
+
*/
|
|
9
|
+
import { confirm } from '@inquirer/prompts';
|
|
10
|
+
/**
|
|
11
|
+
* Prompt the user for skill system preferences.
|
|
12
|
+
*
|
|
13
|
+
* @param frameworkLabel - Human-readable framework name for the prompt copy
|
|
14
|
+
*/
|
|
15
|
+
export async function promptSkillConfig(frameworkLabel) {
|
|
16
|
+
const enableSkills = await confirm({
|
|
17
|
+
message: `🧠 Enable NEXUS Skills System? (Installs ${frameworkLabel} AI task skills in .nexus/skills/)`,
|
|
18
|
+
default: true,
|
|
19
|
+
});
|
|
20
|
+
return { enableSkills };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=skill-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-config.js","sourceRoot":"","sources":["../../src/prompts/skill-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAO5C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,cAAsB;IAC5D,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC;QACjC,OAAO,EAAE,4CAA4C,cAAc,oCAAoC;QACvG,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Core configuration types used throughout the CLI.
|
|
5
5
|
*/
|
|
6
6
|
/** Supported project types */
|
|
7
|
-
export type ProjectType = 'web' | 'api' | 'monorepo' | 'mobile' | 'desktop';
|
|
7
|
+
export type ProjectType = 'web' | 'api' | 'monorepo' | 'mobile' | 'desktop' | 'ui-library';
|
|
8
8
|
/** Data strategy options */
|
|
9
9
|
export type DataStrategy = 'local-only' | 'local-first' | 'cloud-first' | 'hybrid';
|
|
10
10
|
/** Application pattern flags */
|
|
11
11
|
export type AppPattern = 'pwa' | 'offline-first' | 'theming' | 'white-label' | 'i18n' | 'real-time';
|
|
12
12
|
/** Supported frontend frameworks */
|
|
13
|
-
export type FrontendFramework = 'nextjs' | 'react-vite' | 'sveltekit' | 'nuxt' | 'remix' | 'astro';
|
|
13
|
+
export type FrontendFramework = 'nextjs' | 'react-vite' | 'sveltekit' | 'nuxt' | 'remix' | 'astro' | 'none';
|
|
14
14
|
/** Supported backend frameworks */
|
|
15
|
-
export type BackendFramework = 'express' | 'fastify' | 'nestjs' | 'none';
|
|
15
|
+
export type BackendFramework = 'express' | 'fastify' | 'nestjs' | 'spring-boot' | 'none';
|
|
16
16
|
/** Backend strategy options */
|
|
17
17
|
export type BackendStrategy = 'integrated' | 'separate' | 'serverless' | 'baas';
|
|
18
18
|
/** Supported test frameworks */
|
|
@@ -60,6 +60,10 @@ export interface NexusConfig {
|
|
|
60
60
|
installDeps: boolean;
|
|
61
61
|
/** AI agent personality — how agents communicate when synced with the NEXUS brain */
|
|
62
62
|
persona: NexusPersona;
|
|
63
|
+
/** Whether .nexus/ should be gitignored (local-only mode) */
|
|
64
|
+
localOnly?: boolean;
|
|
65
|
+
/** Whether to generate .nexus/skills/ with framework-matched core skills */
|
|
66
|
+
enableSkills?: boolean;
|
|
63
67
|
}
|
|
64
68
|
/** Partial config for incremental prompt building */
|
|
65
69
|
export type PartialNexusConfig = Partial<NexusConfig> & {
|
|
@@ -74,5 +78,7 @@ export interface NexusManifest {
|
|
|
74
78
|
version: string;
|
|
75
79
|
name: string;
|
|
76
80
|
};
|
|
81
|
+
/** Whether .nexus/ is gitignored (local-only mode) */
|
|
82
|
+
localOnly?: boolean;
|
|
77
83
|
}
|
|
78
84
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;AAE3F,4BAA4B;AAC5B,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEnF,gCAAgC;AAChC,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,WAAW,CAAC;AAEpG,oCAAoC;AACpC,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5G,mCAAmC;AACnC,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAEzF,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;AAEhF,gCAAgC;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AED,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/utils/file-system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEhG;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhF;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMvE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,aAAa,EAAE,EACtB,WAAW,EAAE,kBAAkB,EAAE,GAChC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/utils/file-system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEhG;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhF;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMvE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,aAAa,EAAE,EACtB,WAAW,EAAE,kBAAkB,EAAE,GAChC,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAEjF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvE"}
|
|
@@ -50,9 +50,11 @@ export async function writeGeneratorResult(projectRoot, files, directories) {
|
|
|
50
50
|
for (const dir of directories) {
|
|
51
51
|
await ensureDirectory(path.join(projectRoot, dir.path));
|
|
52
52
|
}
|
|
53
|
-
// Then write files
|
|
53
|
+
// Then write files (skip empty content files)
|
|
54
54
|
for (const file of files) {
|
|
55
|
-
|
|
55
|
+
if (file.content.trim()) {
|
|
56
|
+
await writeFile(path.join(projectRoot, file.path), file.content);
|
|
57
|
+
}
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
@@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;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,WAAmB,EACnB,KAAsB,EACtB,WAAiC;IAEjC,2BAA2B;IAC3B,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,8CAA8C;IAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACxB,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,OAAwB;IACvE,OAAO,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAe;IACnD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NEXUS CLI - Logger Utility
|
|
3
3
|
*
|
|
4
|
-
* Pretty, color-coded terminal output using Chalk.
|
|
4
|
+
* Pretty, color-coded terminal output using Chalk, gradient-string, and boxen.
|
|
5
5
|
*/
|
|
6
6
|
/** Log an informational message */
|
|
7
7
|
export declare function info(message: string): void;
|
|
@@ -17,7 +17,7 @@ export declare function nexus(message: string): void;
|
|
|
17
17
|
export declare function newline(): void;
|
|
18
18
|
/** Print a horizontal rule */
|
|
19
19
|
export declare function divider(): void;
|
|
20
|
-
/** Print the NEXUS banner */
|
|
20
|
+
/** Print the NEXUS banner with gradient */
|
|
21
21
|
export declare function banner(version: string): void;
|
|
22
22
|
/** Print final success with next steps */
|
|
23
23
|
export declare function complete(projectName: string, displayName?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,mCAAmC;AACnC,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,4BAA4B;AAC5B,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,4BAA4B;AAC5B,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,2BAA2B;AAC3B,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,kCAAkC;AAClC,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,yBAAyB;AACzB,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED,8BAA8B;AAC9B,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAO5C;AAED,0CAA0C;AAC1C,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAyBxE;AAED,kDAAkD;AAClD,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CA6BvD;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;CAWlB,CAAC"}
|
package/dist/utils/logger.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NEXUS CLI - Logger Utility
|
|
3
3
|
*
|
|
4
|
-
* Pretty, color-coded terminal output using Chalk.
|
|
4
|
+
* Pretty, color-coded terminal output using Chalk, gradient-string, and boxen.
|
|
5
5
|
*/
|
|
6
|
+
import boxen from 'boxen';
|
|
6
7
|
import chalk from 'chalk';
|
|
8
|
+
import gradient from 'gradient-string';
|
|
9
|
+
/** NEXUS brand gradient (cyan → blue → purple) */
|
|
10
|
+
const nexusGradient = gradient(['#00f2ff', '#0090ff', '#7b61ff']);
|
|
7
11
|
/** Brand colors */
|
|
8
12
|
const COLORS = {
|
|
9
13
|
primary: chalk.cyan,
|
|
@@ -42,10 +46,11 @@ export function newline() {
|
|
|
42
46
|
export function divider() {
|
|
43
47
|
console.log(COLORS.dim('━'.repeat(50)));
|
|
44
48
|
}
|
|
45
|
-
/** Print the NEXUS banner */
|
|
49
|
+
/** Print the NEXUS banner with gradient */
|
|
46
50
|
export function banner(version) {
|
|
47
51
|
newline();
|
|
48
|
-
|
|
52
|
+
const title = nexusGradient(' 🔮 NEXUS CLI');
|
|
53
|
+
console.log(title + COLORS.dim(` v${version}`));
|
|
49
54
|
console.log(COLORS.dim(' AI-Native Project Scaffolding'));
|
|
50
55
|
divider();
|
|
51
56
|
newline();
|
|
@@ -54,44 +59,52 @@ export function banner(version) {
|
|
|
54
59
|
export function complete(projectName, displayName) {
|
|
55
60
|
const prettyName = displayName ?? projectName;
|
|
56
61
|
newline();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
const message = [
|
|
63
|
+
COLORS.success.bold('✅ Project created successfully!'),
|
|
64
|
+
'',
|
|
65
|
+
COLORS.bold(prettyName),
|
|
66
|
+
'',
|
|
67
|
+
COLORS.bold('Next steps:'),
|
|
68
|
+
COLORS.primary(` cd ${projectName}`),
|
|
69
|
+
COLORS.primary(' npm run dev'),
|
|
70
|
+
'',
|
|
71
|
+
COLORS.dim('Open .nexus/docs/ to start filling in your project documentation.'),
|
|
72
|
+
COLORS.dim('AI tools will use these files to understand your project.'),
|
|
73
|
+
].join('\n');
|
|
74
|
+
console.log(boxen(message, {
|
|
75
|
+
padding: 1,
|
|
76
|
+
margin: 0,
|
|
77
|
+
borderStyle: 'round',
|
|
78
|
+
borderColor: 'cyan',
|
|
79
|
+
}));
|
|
71
80
|
newline();
|
|
72
81
|
}
|
|
73
82
|
/** Print adopt-mode completion with next steps */
|
|
74
83
|
export function adoptComplete(displayName) {
|
|
75
84
|
newline();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
const message = [
|
|
86
|
+
COLORS.success.bold('✅ NEXUS adopted successfully!'),
|
|
87
|
+
'',
|
|
88
|
+
COLORS.bold(`"${displayName}" now has NEXUS documentation & AI config.`),
|
|
89
|
+
'',
|
|
90
|
+
COLORS.bold('What happens next:'),
|
|
91
|
+
COLORS.primary(' 1. Open your AI coding tool (Copilot, Cursor, Windsurf, etc.)'),
|
|
92
|
+
COLORS.primary(' 2. Ask it to do anything (e.g., "add a feature", "fix a bug")'),
|
|
93
|
+
COLORS.primary(' 3. It will detect the template docs and auto-populate them first'),
|
|
94
|
+
COLORS.primary(' 4. It will ask you questions for things it can\'t infer from code'),
|
|
95
|
+
'',
|
|
96
|
+
COLORS.dim('Files added:'),
|
|
97
|
+
COLORS.dim(' .nexus/docs/ — 8 structured documentation files (status: template)'),
|
|
98
|
+
COLORS.dim(' .nexus/ai/ — AI agent instructions (single source of truth)'),
|
|
99
|
+
COLORS.dim(' .cursorrules, .windsurfrules, .clinerules, AGENTS.md — AI tool pointers'),
|
|
100
|
+
COLORS.dim(' .github/copilot-instructions.md — GitHub Copilot config'),
|
|
101
|
+
].join('\n');
|
|
102
|
+
console.log(boxen(message, {
|
|
103
|
+
padding: 1,
|
|
104
|
+
margin: 0,
|
|
105
|
+
borderStyle: 'round',
|
|
106
|
+
borderColor: 'cyan',
|
|
107
|
+
}));
|
|
95
108
|
newline();
|
|
96
109
|
}
|
|
97
110
|
export const logger = {
|
package/dist/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,kDAAkD;AAClD,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAElE,mBAAmB;AACnB,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK,CAAC,IAAI;IACnB,OAAO,EAAE,KAAK,CAAC,KAAK;IACpB,OAAO,EAAE,KAAK,CAAC,MAAM;IACrB,KAAK,EAAE,KAAK,CAAC,GAAG;IAChB,IAAI,EAAE,KAAK,CAAC,IAAI;IAChB,GAAG,EAAE,KAAK,CAAC,GAAG;IACd,IAAI,EAAE,KAAK,CAAC,IAAI;CACjB,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,OAAO,CAAC,iEAAiE,CAAC;QACjF,MAAM,CAAC,OAAO,CAAC,iEAAiE,CAAC;QACjF,MAAM,CAAC,OAAO,CAAC,oEAAoE,CAAC;QACpF,MAAM,CAAC,OAAO,CAAC,qEAAqE,CAAC;QACrF,EAAE;QACF,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;QAC1B,MAAM,CAAC,GAAG,CAAC,wEAAwE,CAAC;QACpF,MAAM,CAAC,GAAG,CAAC,mEAAmE,CAAC;QAC/E,MAAM,CAAC,GAAG,CAAC,2EAA2E,CAAC;QACvF,MAAM,CAAC,GAAG,CAAC,2DAA2D,CAAC;KACxE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE;QACzB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC,CAAC,CAAC;IAEJ,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,aAAa;CACd,CAAC"}
|
|
@@ -14,6 +14,14 @@ export interface ProjectSignals {
|
|
|
14
14
|
hasSrc: boolean;
|
|
15
15
|
hasTsConfig: boolean;
|
|
16
16
|
hasNodeModules: boolean;
|
|
17
|
+
hasGoMod: boolean;
|
|
18
|
+
hasCargoToml: boolean;
|
|
19
|
+
hasPyProjectToml: boolean;
|
|
20
|
+
hasFirebaseJson: boolean;
|
|
21
|
+
hasPomXml: boolean;
|
|
22
|
+
hasBuildGradle: boolean;
|
|
23
|
+
isInsideMonorepo: boolean;
|
|
24
|
+
monorepoRoot: string | null;
|
|
17
25
|
}
|
|
18
26
|
/** Information extracted from an existing project */
|
|
19
27
|
export interface ProjectInfo {
|
|
@@ -39,7 +47,15 @@ export interface ProjectInfo {
|
|
|
39
47
|
/**
|
|
40
48
|
* Check whether a directory looks like it already contains a project.
|
|
41
49
|
*
|
|
42
|
-
*
|
|
50
|
+
* Now supports:
|
|
51
|
+
* - Node.js projects (package.json)
|
|
52
|
+
* - Spring Boot projects (pom.xml, build.gradle)
|
|
53
|
+
* - Cloud Functions (firebase.json, .firebaserc)
|
|
54
|
+
* - Go projects (go.mod)
|
|
55
|
+
* - Rust projects (Cargo.toml)
|
|
56
|
+
* - Python projects (pyproject.toml)
|
|
57
|
+
* - Monorepos (checks parent directories for workspace root)
|
|
58
|
+
*
|
|
43
59
|
* This is a fast check used to decide whether to show the
|
|
44
60
|
* "--adopt" suggestion before any heavier analysis.
|
|
45
61
|
*/
|
|
@@ -47,9 +63,9 @@ export declare function isExistingProject(targetDir: string): boolean;
|
|
|
47
63
|
/**
|
|
48
64
|
* Inspect a directory and return detailed project information.
|
|
49
65
|
*
|
|
50
|
-
* This reads package.json (if present)
|
|
51
|
-
*
|
|
52
|
-
*
|
|
66
|
+
* This reads package.json (if present), checks for non-Node.js project
|
|
67
|
+
* markers (go.mod, Cargo.toml, etc.), and detects monorepo structure.
|
|
68
|
+
* The adopt generator uses this to pre-fill NEXUS documentation.
|
|
53
69
|
*/
|
|
54
70
|
export declare function detectProject(targetDir: string): Promise<ProjectInfo>;
|
|
55
71
|
//# sourceMappingURL=project-detector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../src/utils/project-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-detector.d.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AW,CAAC,CA6E3E"}
|
|
@@ -15,25 +15,68 @@ import fs from 'fs-extra';
|
|
|
15
15
|
/**
|
|
16
16
|
* Check whether a directory looks like it already contains a project.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Now supports:
|
|
19
|
+
* - Node.js projects (package.json)
|
|
20
|
+
* - Spring Boot projects (pom.xml, build.gradle)
|
|
21
|
+
* - Cloud Functions (firebase.json, .firebaserc)
|
|
22
|
+
* - Go projects (go.mod)
|
|
23
|
+
* - Rust projects (Cargo.toml)
|
|
24
|
+
* - Python projects (pyproject.toml)
|
|
25
|
+
* - Monorepos (checks parent directories for workspace root)
|
|
26
|
+
*
|
|
19
27
|
* This is a fast check used to decide whether to show the
|
|
20
28
|
* "--adopt" suggestion before any heavier analysis.
|
|
21
29
|
*/
|
|
22
30
|
export function isExistingProject(targetDir) {
|
|
23
|
-
|
|
31
|
+
// Check Node.js
|
|
32
|
+
if (fs.existsSync(path.join(targetDir, 'package.json')))
|
|
33
|
+
return true;
|
|
34
|
+
// Check Spring Boot / Maven
|
|
35
|
+
if (fs.existsSync(path.join(targetDir, 'pom.xml')))
|
|
36
|
+
return true;
|
|
37
|
+
if (fs.existsSync(path.join(targetDir, 'build.gradle')))
|
|
38
|
+
return true;
|
|
39
|
+
if (fs.existsSync(path.join(targetDir, 'build.gradle.kts')))
|
|
40
|
+
return true;
|
|
41
|
+
// Check Cloud Functions
|
|
42
|
+
if (fs.existsSync(path.join(targetDir, 'firebase.json')))
|
|
43
|
+
return true;
|
|
44
|
+
if (fs.existsSync(path.join(targetDir, '.firebaserc')))
|
|
45
|
+
return true;
|
|
46
|
+
// Check Go
|
|
47
|
+
if (fs.existsSync(path.join(targetDir, 'go.mod')))
|
|
48
|
+
return true;
|
|
49
|
+
// Check Rust
|
|
50
|
+
if (fs.existsSync(path.join(targetDir, 'Cargo.toml')))
|
|
51
|
+
return true;
|
|
52
|
+
// Check Python
|
|
53
|
+
if (fs.existsSync(path.join(targetDir, 'pyproject.toml')))
|
|
54
|
+
return true;
|
|
55
|
+
// Check if we're inside a monorepo (has parent package.json with workspaces)
|
|
56
|
+
const monorepoRoot = findMonorepoRoot(targetDir);
|
|
57
|
+
if (monorepoRoot)
|
|
58
|
+
return true;
|
|
59
|
+
return false;
|
|
24
60
|
}
|
|
25
61
|
/**
|
|
26
62
|
* Inspect a directory and return detailed project information.
|
|
27
63
|
*
|
|
28
|
-
* This reads package.json (if present)
|
|
29
|
-
*
|
|
30
|
-
*
|
|
64
|
+
* This reads package.json (if present), checks for non-Node.js project
|
|
65
|
+
* markers (go.mod, Cargo.toml, etc.), and detects monorepo structure.
|
|
66
|
+
* The adopt generator uses this to pre-fill NEXUS documentation.
|
|
31
67
|
*/
|
|
32
68
|
export async function detectProject(targetDir) {
|
|
33
69
|
const signals = await detectSignals(targetDir);
|
|
34
70
|
// Default empty info
|
|
35
71
|
const info = {
|
|
36
|
-
detected: signals.hasPackageJson
|
|
72
|
+
detected: signals.hasPackageJson ||
|
|
73
|
+
signals.hasGoMod ||
|
|
74
|
+
signals.hasCargoToml ||
|
|
75
|
+
signals.hasPyProjectToml ||
|
|
76
|
+
signals.hasFirebaseJson ||
|
|
77
|
+
signals.hasPomXml ||
|
|
78
|
+
signals.hasBuildGradle ||
|
|
79
|
+
signals.isInsideMonorepo,
|
|
37
80
|
signals,
|
|
38
81
|
name: null,
|
|
39
82
|
description: null,
|
|
@@ -43,28 +86,50 @@ export async function detectProject(targetDir) {
|
|
|
43
86
|
hasNexus: false,
|
|
44
87
|
dependencies: [],
|
|
45
88
|
};
|
|
46
|
-
|
|
89
|
+
// Handle Spring Boot projects (Java/Kotlin)
|
|
90
|
+
if (signals.hasPomXml || signals.hasBuildGradle) {
|
|
91
|
+
info.framework = 'spring-boot';
|
|
92
|
+
info.name = path.basename(targetDir);
|
|
93
|
+
info.description = 'Spring Boot API';
|
|
94
|
+
info.hasNexus = fs.existsSync(path.join(targetDir, '.nexus'));
|
|
47
95
|
return info;
|
|
48
96
|
}
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
97
|
+
// If no package.json at this level but we're in a monorepo, try reading from monorepo root
|
|
98
|
+
const pkgPath = signals.hasPackageJson
|
|
99
|
+
? path.join(targetDir, 'package.json')
|
|
100
|
+
: signals.monorepoRoot
|
|
101
|
+
? path.join(signals.monorepoRoot, 'package.json')
|
|
102
|
+
: null;
|
|
103
|
+
if (pkgPath && fs.existsSync(pkgPath)) {
|
|
104
|
+
try {
|
|
105
|
+
const pkg = (await fs.readJSON(pkgPath));
|
|
106
|
+
info.name = typeof pkg.name === 'string' ? pkg.name : null;
|
|
107
|
+
info.description = typeof pkg.description === 'string' ? pkg.description : null;
|
|
108
|
+
// Collect all dependency names
|
|
109
|
+
const deps = Object.keys(pkg.dependencies ?? {});
|
|
110
|
+
const devDeps = Object.keys(pkg.devDependencies ?? {});
|
|
111
|
+
info.dependencies = [...deps, ...devDeps];
|
|
112
|
+
// Detect framework
|
|
113
|
+
info.framework = detectFramework(info.dependencies);
|
|
114
|
+
// Detect test framework
|
|
115
|
+
info.testFramework = detectTestFramework(info.dependencies);
|
|
116
|
+
// Detect package manager
|
|
117
|
+
info.packageManager = await detectPM(targetDir);
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// package.json unreadable — keep defaults
|
|
121
|
+
}
|
|
65
122
|
}
|
|
66
|
-
|
|
67
|
-
|
|
123
|
+
// For non-Node.js projects, set framework to the detected language
|
|
124
|
+
if (!info.framework) {
|
|
125
|
+
if (signals.hasGoMod)
|
|
126
|
+
info.framework = 'go';
|
|
127
|
+
else if (signals.hasCargoToml)
|
|
128
|
+
info.framework = 'rust';
|
|
129
|
+
else if (signals.hasPyProjectToml)
|
|
130
|
+
info.framework = 'python';
|
|
131
|
+
else if (signals.hasFirebaseJson)
|
|
132
|
+
info.framework = 'cloud-functions';
|
|
68
133
|
}
|
|
69
134
|
// Check for existing .nexus/
|
|
70
135
|
info.hasNexus = fs.existsSync(path.join(targetDir, '.nexus'));
|
|
@@ -74,16 +139,80 @@ export async function detectProject(targetDir) {
|
|
|
74
139
|
* Internal helpers
|
|
75
140
|
* ────────────────────────────────────────────────────────────── */
|
|
76
141
|
async function detectSignals(dir) {
|
|
77
|
-
const [hasPackageJson, hasGit, hasSrc, hasTsConfig, hasNodeModules] = await Promise.all([
|
|
142
|
+
const [hasPackageJson, hasGit, hasSrc, hasTsConfig, hasNodeModules, hasGoMod, hasCargoToml, hasPyProjectToml, hasFirebaseJson, hasPomXml, hasBuildGradle,] = await Promise.all([
|
|
78
143
|
fs.pathExists(path.join(dir, 'package.json')),
|
|
79
144
|
fs.pathExists(path.join(dir, '.git')),
|
|
80
145
|
fs.pathExists(path.join(dir, 'src')),
|
|
81
146
|
fs.pathExists(path.join(dir, 'tsconfig.json')),
|
|
82
147
|
fs.pathExists(path.join(dir, 'node_modules')),
|
|
148
|
+
fs.pathExists(path.join(dir, 'go.mod')),
|
|
149
|
+
fs.pathExists(path.join(dir, 'Cargo.toml')),
|
|
150
|
+
fs.pathExists(path.join(dir, 'pyproject.toml')),
|
|
151
|
+
fs.pathExists(path.join(dir, 'firebase.json')),
|
|
152
|
+
fs.pathExists(path.join(dir, 'pom.xml')),
|
|
153
|
+
fs.pathExists(path.join(dir, 'build.gradle')).then(async (exists) => exists || await fs.pathExists(path.join(dir, 'build.gradle.kts'))),
|
|
83
154
|
]);
|
|
84
|
-
|
|
155
|
+
// Check if we're inside a monorepo
|
|
156
|
+
const monorepoRoot = findMonorepoRoot(dir);
|
|
157
|
+
const isInsideMonorepo = !!monorepoRoot && monorepoRoot !== dir;
|
|
158
|
+
return {
|
|
159
|
+
hasPackageJson,
|
|
160
|
+
hasGit,
|
|
161
|
+
hasSrc,
|
|
162
|
+
hasTsConfig,
|
|
163
|
+
hasNodeModules,
|
|
164
|
+
hasGoMod,
|
|
165
|
+
hasCargoToml,
|
|
166
|
+
hasPyProjectToml,
|
|
167
|
+
hasFirebaseJson,
|
|
168
|
+
hasPomXml,
|
|
169
|
+
hasBuildGradle,
|
|
170
|
+
isInsideMonorepo,
|
|
171
|
+
monorepoRoot,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Walk up the directory tree to find a monorepo root.
|
|
176
|
+
*
|
|
177
|
+
* A monorepo root is identified by a package.json with a `workspaces` field
|
|
178
|
+
* (Yarn/npm/pnpm workspaces) or a `pnpm-workspace.yaml` file.
|
|
179
|
+
*
|
|
180
|
+
* Returns the absolute path to the monorepo root, or null if not found.
|
|
181
|
+
*/
|
|
182
|
+
function findMonorepoRoot(startDir) {
|
|
183
|
+
let currentDir = startDir;
|
|
184
|
+
const root = path.parse(currentDir).root;
|
|
185
|
+
// Walk up until we hit the filesystem root
|
|
186
|
+
while (currentDir !== root) {
|
|
187
|
+
const parentDir = path.dirname(currentDir);
|
|
188
|
+
// Check for pnpm-workspace.yaml
|
|
189
|
+
if (fs.existsSync(path.join(parentDir, 'pnpm-workspace.yaml'))) {
|
|
190
|
+
return parentDir;
|
|
191
|
+
}
|
|
192
|
+
// Check for package.json with workspaces
|
|
193
|
+
const pkgPath = path.join(parentDir, 'package.json');
|
|
194
|
+
if (fs.existsSync(pkgPath)) {
|
|
195
|
+
try {
|
|
196
|
+
const pkg = fs.readJSONSync(pkgPath);
|
|
197
|
+
if (pkg.workspaces) {
|
|
198
|
+
return parentDir;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
// Ignore unreadable package.json
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
currentDir = parentDir;
|
|
206
|
+
}
|
|
207
|
+
return null;
|
|
85
208
|
}
|
|
86
209
|
function detectFramework(deps) {
|
|
210
|
+
// Cloud Functions
|
|
211
|
+
if (deps.includes('firebase-functions'))
|
|
212
|
+
return 'cloud-functions';
|
|
213
|
+
if (deps.includes('@google-cloud/functions-framework'))
|
|
214
|
+
return 'cloud-functions';
|
|
215
|
+
// Frontend frameworks
|
|
87
216
|
if (deps.includes('next'))
|
|
88
217
|
return 'nextjs';
|
|
89
218
|
if (deps.includes('nuxt') || deps.includes('nuxt3'))
|