@nexus-framework/cli 0.1.1
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/LICENSE +201 -0
- package/README.md +545 -0
- package/bin/nexus.js +3 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +30 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/adopt.d.ts +25 -0
- package/dist/commands/adopt.d.ts.map +1 -0
- package/dist/commands/adopt.js +73 -0
- package/dist/commands/adopt.js.map +1 -0
- package/dist/commands/init.d.ts +24 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +102 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/generators/ai-config.d.ts +26 -0
- package/dist/generators/ai-config.d.ts.map +1 -0
- package/dist/generators/ai-config.js +305 -0
- package/dist/generators/ai-config.js.map +1 -0
- package/dist/generators/ci-cd.d.ts +12 -0
- package/dist/generators/ci-cd.d.ts.map +1 -0
- package/dist/generators/ci-cd.js +60 -0
- package/dist/generators/ci-cd.js.map +1 -0
- package/dist/generators/config.d.ts +12 -0
- package/dist/generators/config.d.ts.map +1 -0
- package/dist/generators/config.js +92 -0
- package/dist/generators/config.js.map +1 -0
- package/dist/generators/docs.d.ts +19 -0
- package/dist/generators/docs.d.ts.map +1 -0
- package/dist/generators/docs.js +431 -0
- package/dist/generators/docs.js.map +1 -0
- package/dist/generators/index.d.ts +24 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +154 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/landing-page.d.ts +13 -0
- package/dist/generators/landing-page.d.ts.map +1 -0
- package/dist/generators/landing-page.js +448 -0
- package/dist/generators/landing-page.js.map +1 -0
- package/dist/generators/structure.d.ts +24 -0
- package/dist/generators/structure.d.ts.map +1 -0
- package/dist/generators/structure.js +174 -0
- package/dist/generators/structure.js.map +1 -0
- package/dist/generators/tests.d.ts +12 -0
- package/dist/generators/tests.d.ts.map +1 -0
- package/dist/generators/tests.js +97 -0
- package/dist/generators/tests.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/data-strategy.d.ts +8 -0
- package/dist/prompts/data-strategy.d.ts.map +1 -0
- package/dist/prompts/data-strategy.js +34 -0
- package/dist/prompts/data-strategy.js.map +1 -0
- package/dist/prompts/features.d.ts +14 -0
- package/dist/prompts/features.d.ts.map +1 -0
- package/dist/prompts/features.js +46 -0
- package/dist/prompts/features.js.map +1 -0
- package/dist/prompts/frameworks.d.ts +9 -0
- package/dist/prompts/frameworks.d.ts.map +1 -0
- package/dist/prompts/frameworks.js +44 -0
- package/dist/prompts/frameworks.js.map +1 -0
- package/dist/prompts/index.d.ts +13 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +67 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/patterns.d.ts +8 -0
- package/dist/prompts/patterns.d.ts.map +1 -0
- package/dist/prompts/patterns.js +44 -0
- package/dist/prompts/patterns.js.map +1 -0
- package/dist/prompts/project-type.d.ts +8 -0
- package/dist/prompts/project-type.d.ts.map +1 -0
- package/dist/prompts/project-type.js +29 -0
- package/dist/prompts/project-type.js.map +1 -0
- package/dist/types/config.d.ts +50 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +7 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/prompts.d.ts +39 -0
- package/dist/types/prompts.d.ts.map +1 -0
- package/dist/types/prompts.js +7 -0
- package/dist/types/prompts.js.map +1 -0
- package/dist/types/templates.d.ts +38 -0
- package/dist/types/templates.d.ts.map +1 -0
- package/dist/types/templates.js +7 -0
- package/dist/types/templates.js.map +1 -0
- package/dist/utils/file-system.d.ts +27 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +53 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/git.d.ts +14 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +40 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +38 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +106 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/package-manager.d.ts +16 -0
- package/dist/utils/package-manager.d.ts.map +1 -0
- package/dist/utils/package-manager.js +51 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/project-detector.d.ts +55 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +125 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/validator.d.ts +25 -0
- package/dist/utils/validator.d.ts.map +1 -0
- package/dist/utils/validator.js +59 -0
- package/dist/utils/validator.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Generator Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Coordinates all generators to produce a complete project.
|
|
5
|
+
* Also provides `adoptProject()` for adding .nexus/ to existing projects.
|
|
6
|
+
*/
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { execa } from 'execa';
|
|
9
|
+
import ora from 'ora';
|
|
10
|
+
import { logger, writeGeneratorResult, getInstallCommand, gitInit } from '../utils/index.js';
|
|
11
|
+
import { generateAiConfig } from './ai-config.js';
|
|
12
|
+
import { generateCiCd } from './ci-cd.js';
|
|
13
|
+
import { generateConfigs } from './config.js';
|
|
14
|
+
import { generateDocs } from './docs.js';
|
|
15
|
+
import { generateLandingPage } from './landing-page.js';
|
|
16
|
+
import { generateDirectories, generatePackageJson, generateGitignore, generateReadme, } from './structure.js';
|
|
17
|
+
import { generateTests } from './tests.js';
|
|
18
|
+
/**
|
|
19
|
+
* Run all generators and write the project to disk.
|
|
20
|
+
*/
|
|
21
|
+
export async function generateProject(config) {
|
|
22
|
+
const projectRoot = path.resolve(process.cwd(), config.projectName);
|
|
23
|
+
const spinner = ora('Generating project structure...').start();
|
|
24
|
+
try {
|
|
25
|
+
// Collect all directories and files
|
|
26
|
+
const directories = generateDirectories(config);
|
|
27
|
+
const files = [
|
|
28
|
+
generatePackageJson(config),
|
|
29
|
+
generateGitignore(),
|
|
30
|
+
generateReadme(config),
|
|
31
|
+
...generateDocs(config),
|
|
32
|
+
...generateConfigs(config),
|
|
33
|
+
...generateTests(config),
|
|
34
|
+
...generateCiCd(config),
|
|
35
|
+
...generateLandingPage(config),
|
|
36
|
+
...generateAiConfig(config),
|
|
37
|
+
];
|
|
38
|
+
// Write everything to disk
|
|
39
|
+
await writeGeneratorResult(projectRoot, files, directories);
|
|
40
|
+
spinner.succeed('Project structure generated.');
|
|
41
|
+
// Install dependencies
|
|
42
|
+
if (config.installDeps) {
|
|
43
|
+
const installCmd = getInstallCommand(config.packageManager);
|
|
44
|
+
const installSpinner = ora(`Installing dependencies with ${config.packageManager}...`).start();
|
|
45
|
+
try {
|
|
46
|
+
const [cmd, ...args] = installCmd.split(' ');
|
|
47
|
+
await execa(cmd, args, { cwd: projectRoot });
|
|
48
|
+
installSpinner.succeed('Dependencies installed.');
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
installSpinner.warn('Dependency installation failed. Run it manually.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Initialize git
|
|
55
|
+
if (config.git) {
|
|
56
|
+
const gitSpinner = ora('Initializing git repository...').start();
|
|
57
|
+
const success = await gitInit(projectRoot);
|
|
58
|
+
if (success) {
|
|
59
|
+
gitSpinner.succeed('Git repository initialized.');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
gitSpinner.warn('Git initialization skipped.');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Done!
|
|
66
|
+
logger.complete(config.projectName);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
spinner.fail('Project generation failed.');
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/* ──────────────────────────────────────────────────────────────
|
|
74
|
+
* Adopt mode — add .nexus/ to an existing project
|
|
75
|
+
* ────────────────────────────────────────────────────────────── */
|
|
76
|
+
/**
|
|
77
|
+
* Add NEXUS documentation and AI config to an existing project.
|
|
78
|
+
*
|
|
79
|
+
* This generates only:
|
|
80
|
+
* - .nexus/docs/ (8 documentation files + index + manifest)
|
|
81
|
+
* - .nexus/ai/ (AI agent instructions)
|
|
82
|
+
* - Root AI pointer files (.cursorrules, AGENTS.md, etc.)
|
|
83
|
+
*
|
|
84
|
+
* It does NOT scaffold source code, configs, tests, or landing pages.
|
|
85
|
+
*/
|
|
86
|
+
export async function adoptProject(targetDir, projectInfo) {
|
|
87
|
+
const spinner = ora('Generating NEXUS documentation & AI config...').start();
|
|
88
|
+
try {
|
|
89
|
+
// Build a minimal NexusConfig from detected project info
|
|
90
|
+
const config = buildAdoptConfig(targetDir, projectInfo);
|
|
91
|
+
// Directories to create
|
|
92
|
+
const directories = [
|
|
93
|
+
{ path: '.nexus' },
|
|
94
|
+
{ path: '.nexus/docs' },
|
|
95
|
+
{ path: '.nexus/ai' },
|
|
96
|
+
{ path: '.github' },
|
|
97
|
+
];
|
|
98
|
+
// Files to generate — docs + AI config only
|
|
99
|
+
const files = [
|
|
100
|
+
...generateDocs(config),
|
|
101
|
+
...generateAiConfig(config),
|
|
102
|
+
];
|
|
103
|
+
// Write to disk
|
|
104
|
+
await writeGeneratorResult(targetDir, files, directories);
|
|
105
|
+
spinner.succeed('NEXUS documentation & AI config generated.');
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
spinner.fail('Adopt failed.');
|
|
109
|
+
throw err;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Build a NexusConfig from detected ProjectInfo.
|
|
114
|
+
*
|
|
115
|
+
* Maps detected values to the closest NexusConfig equivalents,
|
|
116
|
+
* using sensible defaults for anything not detected.
|
|
117
|
+
*/
|
|
118
|
+
function buildAdoptConfig(targetDir, info) {
|
|
119
|
+
return {
|
|
120
|
+
projectName: info.name ?? path.basename(targetDir),
|
|
121
|
+
projectType: 'web',
|
|
122
|
+
dataStrategy: 'cloud-first',
|
|
123
|
+
appPatterns: [],
|
|
124
|
+
frontendFramework: mapFramework(info.framework),
|
|
125
|
+
backendStrategy: 'integrated',
|
|
126
|
+
backendFramework: 'none',
|
|
127
|
+
testFramework: mapTestFramework(info.testFramework),
|
|
128
|
+
packageManager: mapPackageManager(info.packageManager),
|
|
129
|
+
git: true,
|
|
130
|
+
installDeps: false,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function mapFramework(detected) {
|
|
134
|
+
const valid = ['nextjs', 'react-vite', 'sveltekit', 'nuxt', 'remix', 'astro'];
|
|
135
|
+
if (detected && valid.includes(detected)) {
|
|
136
|
+
return detected;
|
|
137
|
+
}
|
|
138
|
+
return 'nextjs'; // safe default
|
|
139
|
+
}
|
|
140
|
+
function mapTestFramework(detected) {
|
|
141
|
+
if (detected === 'vitest')
|
|
142
|
+
return 'vitest';
|
|
143
|
+
if (detected === 'jest')
|
|
144
|
+
return 'jest';
|
|
145
|
+
return 'vitest'; // default
|
|
146
|
+
}
|
|
147
|
+
function mapPackageManager(detected) {
|
|
148
|
+
if (detected === 'yarn')
|
|
149
|
+
return 'yarn';
|
|
150
|
+
if (detected === 'pnpm')
|
|
151
|
+
return 'pnpm';
|
|
152
|
+
return 'npm';
|
|
153
|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|
+
* Generates a branded NEXUS landing page for each supported frontend framework.
|
|
5
|
+
* Also generates the NEXUS logo SVG and favicon for the public/ directory.
|
|
6
|
+
*/
|
|
7
|
+
import type { NexusConfig } from '../types/config.js';
|
|
8
|
+
import type { GeneratedFile } from '../types/templates.js';
|
|
9
|
+
/**
|
|
10
|
+
* Generate all landing page files for the chosen framework.
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateLandingPage(config: NexusConfig): GeneratedFile[];
|
|
13
|
+
//# sourceMappingURL=landing-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landing-page.d.ts","sourceRoot":"","sources":["../../src/generators/landing-page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAuE3D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,EAAE,CAiBxE"}
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Landing Page Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates a branded NEXUS landing page for each supported frontend framework.
|
|
5
|
+
* Also generates the NEXUS logo SVG and favicon for the public/ directory.
|
|
6
|
+
*/
|
|
7
|
+
/* ──────────────────────────────────────────────────────────────
|
|
8
|
+
* Shared: inline SVG logo (the "Neural Network" concept)
|
|
9
|
+
* ────────────────────────────────────────────────────────────── */
|
|
10
|
+
const NEXUS_SVG_LOGO = `<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200" fill="none">
|
|
11
|
+
<!-- Connection lines -->
|
|
12
|
+
<path d="M100 100 L60 60" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
13
|
+
<path d="M100 100 L140 60" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
14
|
+
<path d="M100 100 L60 140" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
15
|
+
<path d="M100 100 L140 140" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
16
|
+
<path d="M100 100 L100 40" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
17
|
+
<path d="M100 100 L100 160" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
18
|
+
<path d="M100 100 L40 100" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
19
|
+
<path d="M100 100 L160 100" stroke="#00D9FF" stroke-width="2" opacity="0.3"/>
|
|
20
|
+
<!-- Nodes -->
|
|
21
|
+
<circle cx="100" cy="100" r="20" fill="#00D9FF" opacity="1"/>
|
|
22
|
+
<circle cx="60" cy="60" r="12" fill="#00D9FF" opacity="0.7"/>
|
|
23
|
+
<circle cx="140" cy="60" r="12" fill="#00D9FF" opacity="0.7"/>
|
|
24
|
+
<circle cx="60" cy="140" r="12" fill="#00D9FF" opacity="0.7"/>
|
|
25
|
+
<circle cx="140" cy="140" r="12" fill="#00D9FF" opacity="0.7"/>
|
|
26
|
+
<circle cx="100" cy="40" r="10" fill="#00D9FF" opacity="0.5"/>
|
|
27
|
+
<circle cx="100" cy="160" r="10" fill="#00D9FF" opacity="0.5"/>
|
|
28
|
+
<circle cx="40" cy="100" r="10" fill="#00D9FF" opacity="0.5"/>
|
|
29
|
+
<circle cx="160" cy="100" r="10" fill="#00D9FF" opacity="0.5"/>
|
|
30
|
+
</svg>`;
|
|
31
|
+
/* ──────────────────────────────────────────────────────────────
|
|
32
|
+
* Shared: favicon as a 32×32 SVG (used as favicon.svg)
|
|
33
|
+
* ────────────────────────────────────────────────────────────── */
|
|
34
|
+
const NEXUS_FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 200 200" fill="none">
|
|
35
|
+
<circle cx="100" cy="100" r="90" fill="#0A0A0A"/>
|
|
36
|
+
<path d="M100 100 L60 60" stroke="#00D9FF" stroke-width="3" opacity="0.3"/>
|
|
37
|
+
<path d="M100 100 L140 60" stroke="#00D9FF" stroke-width="3" opacity="0.3"/>
|
|
38
|
+
<path d="M100 100 L60 140" stroke="#00D9FF" stroke-width="3" opacity="0.3"/>
|
|
39
|
+
<path d="M100 100 L140 140" stroke="#00D9FF" stroke-width="3" opacity="0.3"/>
|
|
40
|
+
<circle cx="100" cy="100" r="22" fill="#00D9FF"/>
|
|
41
|
+
<circle cx="60" cy="60" r="10" fill="#00D9FF" opacity="0.7"/>
|
|
42
|
+
<circle cx="140" cy="60" r="10" fill="#00D9FF" opacity="0.7"/>
|
|
43
|
+
<circle cx="60" cy="140" r="10" fill="#00D9FF" opacity="0.7"/>
|
|
44
|
+
<circle cx="140" cy="140" r="10" fill="#00D9FF" opacity="0.7"/>
|
|
45
|
+
</svg>`;
|
|
46
|
+
/* ──────────────────────────────────────────────────────────────
|
|
47
|
+
* Shared CSS (embedded in each template)
|
|
48
|
+
* ────────────────────────────────────────────────────────────── */
|
|
49
|
+
function landingCSS() {
|
|
50
|
+
return `*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
51
|
+
html{color-scheme:dark}
|
|
52
|
+
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;background:#0a0a0a;color:#ededed;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center}
|
|
53
|
+
.nexus-landing{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem;min-height:100vh;gap:2rem}
|
|
54
|
+
.nexus-logo{width:160px;height:160px;animation:pulse 3s ease-in-out infinite}
|
|
55
|
+
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.85;transform:scale(1.04)}}
|
|
56
|
+
.nexus-title{font-size:clamp(2.5rem,6vw,4rem);font-weight:800;letter-spacing:-.03em;background:linear-gradient(135deg,#00D9FF 0%,#00FF87 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
|
|
57
|
+
.nexus-subtitle{font-size:clamp(1rem,2.5vw,1.35rem);color:#888;max-width:520px;line-height:1.6}
|
|
58
|
+
.nexus-meta{display:flex;gap:1.5rem;flex-wrap:wrap;justify-content:center;margin-top:.5rem}
|
|
59
|
+
.nexus-badge{font-size:.85rem;padding:.35rem .85rem;border-radius:9999px;border:1px solid #222;color:#aaa;background:#111}
|
|
60
|
+
.nexus-links{display:flex;gap:1rem;margin-top:1rem}
|
|
61
|
+
.nexus-links a{color:#00D9FF;text-decoration:none;font-weight:600;padding:.6rem 1.4rem;border-radius:.5rem;border:1px solid #00D9FF33;transition:all .2s}
|
|
62
|
+
.nexus-links a:hover{background:#00D9FF15;border-color:#00D9FF}
|
|
63
|
+
.nexus-footer{position:fixed;bottom:1.5rem;font-size:.8rem;color:#555}
|
|
64
|
+
.nexus-footer a{color:#00D9FF;text-decoration:none}`;
|
|
65
|
+
}
|
|
66
|
+
/* ──────────────────────────────────────────────────────────────
|
|
67
|
+
* Public API
|
|
68
|
+
* ────────────────────────────────────────────────────────────── */
|
|
69
|
+
/**
|
|
70
|
+
* Generate all landing page files for the chosen framework.
|
|
71
|
+
*/
|
|
72
|
+
export function generateLandingPage(config) {
|
|
73
|
+
const files = [];
|
|
74
|
+
// Always include the logo SVG in public/
|
|
75
|
+
files.push({ path: 'public/nexus-logo.svg', content: NEXUS_SVG_LOGO });
|
|
76
|
+
files.push({ path: 'public/favicon.svg', content: NEXUS_FAVICON_SVG });
|
|
77
|
+
// Only generate landing pages for frontend project types
|
|
78
|
+
if (config.projectType === 'api') {
|
|
79
|
+
return files;
|
|
80
|
+
}
|
|
81
|
+
// Framework-specific landing page + CSS
|
|
82
|
+
const pageFiles = getLandingPageForFramework(config.frontendFramework, config.projectName);
|
|
83
|
+
files.push(...pageFiles);
|
|
84
|
+
return files;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Return the correct landing page files based on the framework.
|
|
88
|
+
*/
|
|
89
|
+
function getLandingPageForFramework(framework, projectName) {
|
|
90
|
+
switch (framework) {
|
|
91
|
+
case 'nextjs':
|
|
92
|
+
return nextjsLandingPage(projectName);
|
|
93
|
+
case 'react-vite':
|
|
94
|
+
return reactViteLandingPage(projectName);
|
|
95
|
+
case 'sveltekit':
|
|
96
|
+
return sveltekitLandingPage(projectName);
|
|
97
|
+
case 'nuxt':
|
|
98
|
+
return nuxtLandingPage(projectName);
|
|
99
|
+
case 'astro':
|
|
100
|
+
return astroLandingPage(projectName);
|
|
101
|
+
case 'remix':
|
|
102
|
+
return nextjsLandingPage(projectName); // Remix uses React/TSX
|
|
103
|
+
default:
|
|
104
|
+
return nextjsLandingPage(projectName);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/* ──────────────────────────────────────────────────────────────
|
|
108
|
+
* Next.js (App Router) — src/app/page.tsx + src/app/layout.tsx + globals.css
|
|
109
|
+
* ────────────────────────────────────────────────────────────── */
|
|
110
|
+
function nextjsLandingPage(projectName) {
|
|
111
|
+
const page = `import Image from "next/image";
|
|
112
|
+
|
|
113
|
+
export default function Home() {
|
|
114
|
+
return (
|
|
115
|
+
<div className="nexus-landing">
|
|
116
|
+
<Image
|
|
117
|
+
className="nexus-logo"
|
|
118
|
+
src="/nexus-logo.svg"
|
|
119
|
+
alt="NEXUS Logo"
|
|
120
|
+
width={160}
|
|
121
|
+
height={160}
|
|
122
|
+
priority
|
|
123
|
+
/>
|
|
124
|
+
<h1 className="nexus-title">${projectName}</h1>
|
|
125
|
+
<p className="nexus-subtitle">
|
|
126
|
+
Built with <strong>NEXUS CLI</strong> — the AI-native project scaffolding tool by GDA Africa.
|
|
127
|
+
Your project is ready. Start building something amazing.
|
|
128
|
+
</p>
|
|
129
|
+
<div className="nexus-meta">
|
|
130
|
+
<span className="nexus-badge">Next.js 15</span>
|
|
131
|
+
<span className="nexus-badge">TypeScript</span>
|
|
132
|
+
<span className="nexus-badge">NEXUS Docs</span>
|
|
133
|
+
</div>
|
|
134
|
+
<div className="nexus-links">
|
|
135
|
+
<a href="https://github.com/GDA-Africa/nexus-cli" target="_blank" rel="noopener noreferrer">
|
|
136
|
+
Documentation
|
|
137
|
+
</a>
|
|
138
|
+
<a href="https://github.com/GDA-Africa" target="_blank" rel="noopener noreferrer">
|
|
139
|
+
GDA Africa
|
|
140
|
+
</a>
|
|
141
|
+
</div>
|
|
142
|
+
<footer className="nexus-footer">
|
|
143
|
+
Scaffolded with 🔮 <a href="https://github.com/GDA-Africa/nexus-cli">NEXUS CLI</a> by{" "}
|
|
144
|
+
<a href="https://github.com/GDA-Africa">GDA Africa</a>
|
|
145
|
+
</footer>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
const layout = `import type { Metadata } from "next";
|
|
151
|
+
import "./globals.css";
|
|
152
|
+
|
|
153
|
+
export const metadata: Metadata = {
|
|
154
|
+
title: "${projectName}",
|
|
155
|
+
description: "Generated with NEXUS CLI by GDA Africa",
|
|
156
|
+
icons: {
|
|
157
|
+
icon: "/favicon.svg",
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default function RootLayout({
|
|
162
|
+
children,
|
|
163
|
+
}: {
|
|
164
|
+
children: React.ReactNode;
|
|
165
|
+
}) {
|
|
166
|
+
return (
|
|
167
|
+
<html lang="en">
|
|
168
|
+
<body>{children}</body>
|
|
169
|
+
</html>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
173
|
+
const css = landingCSS();
|
|
174
|
+
return [
|
|
175
|
+
{ path: 'src/app/page.tsx', content: page },
|
|
176
|
+
{ path: 'src/app/layout.tsx', content: layout },
|
|
177
|
+
{ path: 'src/app/globals.css', content: css },
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
/* ──────────────────────────────────────────────────────────────
|
|
181
|
+
* React + Vite — src/App.tsx + src/main.tsx + index.html + src/index.css
|
|
182
|
+
* ────────────────────────────────────────────────────────────── */
|
|
183
|
+
function reactViteLandingPage(projectName) {
|
|
184
|
+
const app = `import "./index.css";
|
|
185
|
+
|
|
186
|
+
function App() {
|
|
187
|
+
return (
|
|
188
|
+
<div className="nexus-landing">
|
|
189
|
+
<img className="nexus-logo" src="/nexus-logo.svg" alt="NEXUS Logo" width={160} height={160} />
|
|
190
|
+
<h1 className="nexus-title">${projectName}</h1>
|
|
191
|
+
<p className="nexus-subtitle">
|
|
192
|
+
Built with <strong>NEXUS CLI</strong> — the AI-native project scaffolding tool by GDA Africa.
|
|
193
|
+
Your project is ready. Start building something amazing.
|
|
194
|
+
</p>
|
|
195
|
+
<div className="nexus-meta">
|
|
196
|
+
<span className="nexus-badge">React + Vite</span>
|
|
197
|
+
<span className="nexus-badge">TypeScript</span>
|
|
198
|
+
<span className="nexus-badge">NEXUS Docs</span>
|
|
199
|
+
</div>
|
|
200
|
+
<div className="nexus-links">
|
|
201
|
+
<a href="https://github.com/GDA-Africa/nexus-cli" target="_blank" rel="noopener noreferrer">
|
|
202
|
+
Documentation
|
|
203
|
+
</a>
|
|
204
|
+
<a href="https://github.com/GDA-Africa" target="_blank" rel="noopener noreferrer">
|
|
205
|
+
GDA Africa
|
|
206
|
+
</a>
|
|
207
|
+
</div>
|
|
208
|
+
<footer className="nexus-footer">
|
|
209
|
+
Scaffolded with 🔮 <a href="https://github.com/GDA-Africa/nexus-cli">NEXUS CLI</a> by{" "}
|
|
210
|
+
<a href="https://github.com/GDA-Africa">GDA Africa</a>
|
|
211
|
+
</footer>
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export default App;
|
|
217
|
+
`;
|
|
218
|
+
const main = `import React from "react";
|
|
219
|
+
import ReactDOM from "react-dom/client";
|
|
220
|
+
import App from "./App";
|
|
221
|
+
|
|
222
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
223
|
+
<React.StrictMode>
|
|
224
|
+
<App />
|
|
225
|
+
</React.StrictMode>,
|
|
226
|
+
);
|
|
227
|
+
`;
|
|
228
|
+
const indexHtml = `<!DOCTYPE html>
|
|
229
|
+
<html lang="en">
|
|
230
|
+
<head>
|
|
231
|
+
<meta charset="UTF-8" />
|
|
232
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
233
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
234
|
+
<title>${projectName}</title>
|
|
235
|
+
</head>
|
|
236
|
+
<body>
|
|
237
|
+
<div id="root"></div>
|
|
238
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
239
|
+
</body>
|
|
240
|
+
</html>
|
|
241
|
+
`;
|
|
242
|
+
const css = landingCSS();
|
|
243
|
+
return [
|
|
244
|
+
{ path: 'src/App.tsx', content: app },
|
|
245
|
+
{ path: 'src/main.tsx', content: main },
|
|
246
|
+
{ path: 'index.html', content: indexHtml },
|
|
247
|
+
{ path: 'src/index.css', content: css },
|
|
248
|
+
];
|
|
249
|
+
}
|
|
250
|
+
/* ──────────────────────────────────────────────────────────────
|
|
251
|
+
* SvelteKit — src/routes/+page.svelte + src/routes/+layout.svelte + src/app.css + src/app.html
|
|
252
|
+
* ────────────────────────────────────────────────────────────── */
|
|
253
|
+
function sveltekitLandingPage(projectName) {
|
|
254
|
+
const page = `<script lang="ts">
|
|
255
|
+
// ${projectName} — Landing Page
|
|
256
|
+
</script>
|
|
257
|
+
|
|
258
|
+
<div class="nexus-landing">
|
|
259
|
+
<img class="nexus-logo" src="/nexus-logo.svg" alt="NEXUS Logo" width="160" height="160" />
|
|
260
|
+
<h1 class="nexus-title">${projectName}</h1>
|
|
261
|
+
<p class="nexus-subtitle">
|
|
262
|
+
Built with <strong>NEXUS CLI</strong> — the AI-native project scaffolding tool by GDA Africa.
|
|
263
|
+
Your project is ready. Start building something amazing.
|
|
264
|
+
</p>
|
|
265
|
+
<div class="nexus-meta">
|
|
266
|
+
<span class="nexus-badge">SvelteKit</span>
|
|
267
|
+
<span class="nexus-badge">TypeScript</span>
|
|
268
|
+
<span class="nexus-badge">NEXUS Docs</span>
|
|
269
|
+
</div>
|
|
270
|
+
<div class="nexus-links">
|
|
271
|
+
<a href="https://github.com/GDA-Africa/nexus-cli" target="_blank" rel="noopener noreferrer">
|
|
272
|
+
Documentation
|
|
273
|
+
</a>
|
|
274
|
+
<a href="https://github.com/GDA-Africa" target="_blank" rel="noopener noreferrer">
|
|
275
|
+
GDA Africa
|
|
276
|
+
</a>
|
|
277
|
+
</div>
|
|
278
|
+
<footer class="nexus-footer">
|
|
279
|
+
Scaffolded with 🔮 <a href="https://github.com/GDA-Africa/nexus-cli">NEXUS CLI</a> by
|
|
280
|
+
<a href="https://github.com/GDA-Africa">GDA Africa</a>
|
|
281
|
+
</footer>
|
|
282
|
+
</div>
|
|
283
|
+
`;
|
|
284
|
+
const layout = `<script lang="ts">
|
|
285
|
+
import "../app.css";
|
|
286
|
+
let { children } = $props();
|
|
287
|
+
</script>
|
|
288
|
+
|
|
289
|
+
<svelte:head>
|
|
290
|
+
<title>${projectName}</title>
|
|
291
|
+
<meta name="description" content="Generated with NEXUS CLI by GDA Africa" />
|
|
292
|
+
<link rel="icon" href="/favicon.svg" />
|
|
293
|
+
</svelte:head>
|
|
294
|
+
|
|
295
|
+
{@render children()}
|
|
296
|
+
`;
|
|
297
|
+
const appHtml = `<!DOCTYPE html>
|
|
298
|
+
<html lang="en">
|
|
299
|
+
<head>
|
|
300
|
+
<meta charset="utf-8" />
|
|
301
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
302
|
+
%sveltekit.head%
|
|
303
|
+
</head>
|
|
304
|
+
<body>
|
|
305
|
+
<div style="display: contents">%sveltekit.body%</div>
|
|
306
|
+
</body>
|
|
307
|
+
</html>
|
|
308
|
+
`;
|
|
309
|
+
const css = landingCSS();
|
|
310
|
+
return [
|
|
311
|
+
{ path: 'src/routes/+page.svelte', content: page },
|
|
312
|
+
{ path: 'src/routes/+layout.svelte', content: layout },
|
|
313
|
+
{ path: 'src/app.html', content: appHtml },
|
|
314
|
+
{ path: 'src/app.css', content: css },
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
/* ──────────────────────────────────────────────────────────────
|
|
318
|
+
* Nuxt 3 — app.vue + pages/index.vue + assets/css/main.css + nuxt.config.ts
|
|
319
|
+
* ────────────────────────────────────────────────────────────── */
|
|
320
|
+
function nuxtLandingPage(projectName) {
|
|
321
|
+
const appVue = `<template>
|
|
322
|
+
<NuxtPage />
|
|
323
|
+
</template>
|
|
324
|
+
`;
|
|
325
|
+
const indexPage = `<template>
|
|
326
|
+
<div class="nexus-landing">
|
|
327
|
+
<img class="nexus-logo" src="/nexus-logo.svg" alt="NEXUS Logo" width="160" height="160" />
|
|
328
|
+
<h1 class="nexus-title">${projectName}</h1>
|
|
329
|
+
<p class="nexus-subtitle">
|
|
330
|
+
Built with <strong>NEXUS CLI</strong> — the AI-native project scaffolding tool by GDA Africa.
|
|
331
|
+
Your project is ready. Start building something amazing.
|
|
332
|
+
</p>
|
|
333
|
+
<div class="nexus-meta">
|
|
334
|
+
<span class="nexus-badge">Nuxt 3</span>
|
|
335
|
+
<span class="nexus-badge">TypeScript</span>
|
|
336
|
+
<span class="nexus-badge">NEXUS Docs</span>
|
|
337
|
+
</div>
|
|
338
|
+
<div class="nexus-links">
|
|
339
|
+
<a href="https://github.com/GDA-Africa/nexus-cli" target="_blank" rel="noopener noreferrer">
|
|
340
|
+
Documentation
|
|
341
|
+
</a>
|
|
342
|
+
<a href="https://github.com/GDA-Africa" target="_blank" rel="noopener noreferrer">
|
|
343
|
+
GDA Africa
|
|
344
|
+
</a>
|
|
345
|
+
</div>
|
|
346
|
+
<footer class="nexus-footer">
|
|
347
|
+
Scaffolded with 🔮 <a href="https://github.com/GDA-Africa/nexus-cli">NEXUS CLI</a> by
|
|
348
|
+
<a href="https://github.com/GDA-Africa">GDA Africa</a>
|
|
349
|
+
</footer>
|
|
350
|
+
</div>
|
|
351
|
+
</template>
|
|
352
|
+
|
|
353
|
+
<script setup lang="ts">
|
|
354
|
+
useHead({
|
|
355
|
+
title: "${projectName}",
|
|
356
|
+
meta: [{ name: "description", content: "Generated with NEXUS CLI by GDA Africa" }],
|
|
357
|
+
link: [{ rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }],
|
|
358
|
+
});
|
|
359
|
+
</script>
|
|
360
|
+
`;
|
|
361
|
+
const css = landingCSS();
|
|
362
|
+
const nuxtConfig = `// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
363
|
+
export default defineNuxtConfig({
|
|
364
|
+
compatibilityDate: "2025-01-01",
|
|
365
|
+
devtools: { enabled: true },
|
|
366
|
+
css: ["~/assets/css/main.css"],
|
|
367
|
+
app: {
|
|
368
|
+
head: {
|
|
369
|
+
link: [{ rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }],
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
});
|
|
373
|
+
`;
|
|
374
|
+
return [
|
|
375
|
+
{ path: 'app.vue', content: appVue },
|
|
376
|
+
{ path: 'pages/index.vue', content: indexPage },
|
|
377
|
+
{ path: 'assets/css/main.css', content: css },
|
|
378
|
+
{ path: 'nuxt.config.ts', content: nuxtConfig },
|
|
379
|
+
];
|
|
380
|
+
}
|
|
381
|
+
/* ──────────────────────────────────────────────────────────────
|
|
382
|
+
* Astro — src/pages/index.astro + src/layouts/Layout.astro + src/styles/global.css
|
|
383
|
+
* ────────────────────────────────────────────────────────────── */
|
|
384
|
+
function astroLandingPage(projectName) {
|
|
385
|
+
const indexAstro = `---
|
|
386
|
+
import Layout from "../layouts/Layout.astro";
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
<Layout title="${projectName}">
|
|
390
|
+
<div class="nexus-landing">
|
|
391
|
+
<img class="nexus-logo" src="/nexus-logo.svg" alt="NEXUS Logo" width="160" height="160" />
|
|
392
|
+
<h1 class="nexus-title">${projectName}</h1>
|
|
393
|
+
<p class="nexus-subtitle">
|
|
394
|
+
Built with <strong>NEXUS CLI</strong> — the AI-native project scaffolding tool by GDA Africa.
|
|
395
|
+
Your project is ready. Start building something amazing.
|
|
396
|
+
</p>
|
|
397
|
+
<div class="nexus-meta">
|
|
398
|
+
<span class="nexus-badge">Astro</span>
|
|
399
|
+
<span class="nexus-badge">TypeScript</span>
|
|
400
|
+
<span class="nexus-badge">NEXUS Docs</span>
|
|
401
|
+
</div>
|
|
402
|
+
<div class="nexus-links">
|
|
403
|
+
<a href="https://github.com/GDA-Africa/nexus-cli" target="_blank" rel="noopener noreferrer">
|
|
404
|
+
Documentation
|
|
405
|
+
</a>
|
|
406
|
+
<a href="https://github.com/GDA-Africa" target="_blank" rel="noopener noreferrer">
|
|
407
|
+
GDA Africa
|
|
408
|
+
</a>
|
|
409
|
+
</div>
|
|
410
|
+
<footer class="nexus-footer">
|
|
411
|
+
Scaffolded with 🔮 <a href="https://github.com/GDA-Africa/nexus-cli">NEXUS CLI</a> by
|
|
412
|
+
<a href="https://github.com/GDA-Africa">GDA Africa</a>
|
|
413
|
+
</footer>
|
|
414
|
+
</div>
|
|
415
|
+
</Layout>
|
|
416
|
+
`;
|
|
417
|
+
const layoutAstro = `---
|
|
418
|
+
import "../styles/global.css";
|
|
419
|
+
|
|
420
|
+
interface Props {
|
|
421
|
+
title: string;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const { title } = Astro.props;
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
<!DOCTYPE html>
|
|
428
|
+
<html lang="en">
|
|
429
|
+
<head>
|
|
430
|
+
<meta charset="UTF-8" />
|
|
431
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
432
|
+
<meta name="description" content="Generated with NEXUS CLI by GDA Africa" />
|
|
433
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
434
|
+
<title>{title}</title>
|
|
435
|
+
</head>
|
|
436
|
+
<body>
|
|
437
|
+
<slot />
|
|
438
|
+
</body>
|
|
439
|
+
</html>
|
|
440
|
+
`;
|
|
441
|
+
const css = landingCSS();
|
|
442
|
+
return [
|
|
443
|
+
{ path: 'src/pages/index.astro', content: indexAstro },
|
|
444
|
+
{ path: 'src/layouts/Layout.astro', content: layoutAstro },
|
|
445
|
+
{ path: 'src/styles/global.css', content: css },
|
|
446
|
+
];
|
|
447
|
+
}
|
|
448
|
+
//# sourceMappingURL=landing-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landing-page.js","sourceRoot":"","sources":["../../src/generators/landing-page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;oEAEoE;AAEpE,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;OAoBhB,CAAC;AAER;;oEAEoE;AAEpE,MAAM,iBAAiB,GAAG;;;;;;;;;;;OAWnB,CAAC;AAER;;oEAEoE;AAEpE,SAAS,UAAU;IACjB,OAAO;;;;;;;;;;;;;;oDAc2C,CAAC;AACrD,CAAC;AAED;;oEAEoE;AAEpE;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,yCAAyC;IACzC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACvE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAEvE,yDAAyD;IACzD,IAAI,MAAM,CAAC,WAAW,KAAK,KAAK,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,wCAAwC;IACxC,MAAM,SAAS,GAAG,0BAA0B,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3F,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAEzB,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,0BAA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E,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE;QACpC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE;QAC/C,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,GAAG,EAAE;QAC7C,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE;KAChD,CAAC;AACJ,CAAC;AAED;;oEAEoE;AAEpE,SAAS,gBAAgB,CAAC,WAAmB;IAC3C,MAAM,UAAU,GAAG;;;;iBAIJ,WAAW;;;8BAGE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;CAwBxC,CAAC;IAEA,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBrB,CAAC;IAEA,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IAEzB,OAAO;QACL,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,UAAU,EAAE;QACtD,EAAE,IAAI,EAAE,0BAA0B,EAAE,OAAO,EAAE,WAAW,EAAE;QAC1D,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,GAAG,EAAE;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Structure Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates the folder structure and base files for a new project.
|
|
5
|
+
*/
|
|
6
|
+
import type { NexusConfig } from '../types/config.js';
|
|
7
|
+
import type { GeneratedFile, GeneratedDirectory } from '../types/templates.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate the base directory structure for any project type.
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateDirectories(config: NexusConfig): GeneratedDirectory[];
|
|
12
|
+
/**
|
|
13
|
+
* Generate the project's package.json content.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generatePackageJson(config: NexusConfig): GeneratedFile;
|
|
16
|
+
/**
|
|
17
|
+
* Generate .gitignore file.
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateGitignore(): GeneratedFile;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a basic README for the created project.
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateReadme(config: NexusConfig): GeneratedFile;
|
|
24
|
+
//# sourceMappingURL=structure.d.ts.map
|