create-lumen 2.0.0-alpha.1 → 2.0.0-beta.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/README.md +38 -12
- package/bin/cli.js +3 -1
- package/package.json +3 -3
- package/schema/fixtures/v2/invalid/shadcn-without-tailwind.json +1 -1
- package/schema/fixtures/v2/valid/react-vite-type-based.json +1 -1
- package/schema/lumen.config.v2.json +0 -1
- package/src/cli-args.js +169 -7
- package/src/configure.js +12 -4
- package/src/css.js +14 -30
- package/src/dependencies.js +36 -20
- package/src/engine/capabilities.js +195 -4
- package/src/engine/composition.js +736 -0
- package/src/engine/index.js +1 -0
- package/src/engine/providers/base-provider.js +4 -4
- package/src/injector.js +294 -446
- package/src/main.js +38 -16
- package/src/manifest/emit.js +1 -1
- package/src/manifest/schema.js +1 -1
- package/src/prompts.js +581 -238
- package/src/readme.js +23 -2
- package/src/scaffold.js +17 -0
- package/templates/architectures/hybrid/main.jsx +10 -0
- package/templates/architectures/hybrid/main.tsx +10 -0
- package/templates/architectures/hybrid/src/App.jsx +20 -0
- package/templates/architectures/hybrid/src/App.tsx +20 -0
- package/templates/architectures/hybrid/src/shared/components/ui/Button.jsx +31 -0
- package/templates/architectures/hybrid/src/shared/components/ui/Button.tsx +36 -0
- package/templates/architectures/hybrid/src/shared/components/ui/index.js +1 -0
- package/templates/architectures/hybrid/src/shared/components/ui/index.ts +1 -0
- package/templates/architectures/hybrid/src/shared/hooks/useLocalStorage.jsx +28 -0
- package/templates/architectures/hybrid/src/shared/hooks/useLocalStorage.ts +28 -0
- package/templates/architectures/hybrid/src/shared/layouts/.gitkeep +0 -0
- package/templates/architectures/hybrid/src/shared/stores/.gitkeep +0 -0
- package/templates/architectures/hybrid/src/shared/styles/.gitkeep +0 -0
- package/templates/architectures/hybrid/src/shared/types/index.js +20 -0
- package/templates/architectures/hybrid/src/shared/types/index.ts +16 -0
- package/templates/architectures/hybrid/src/shared/utils/cn.jsx +3 -0
- package/templates/architectures/hybrid/src/shared/utils/cn.ts +5 -0
- package/templates/architectures/none/main.jsx +10 -0
- package/templates/architectures/none/main.tsx +10 -0
- package/templates/architectures/none/src/App.jsx +15 -0
- package/templates/architectures/none/src/App.tsx +15 -0
- package/templates/architectures/none/src/styles/.gitkeep +1 -0
- package/templates/architectures/none/src/types/index.js +20 -0
- package/templates/architectures/none/src/types/index.ts +16 -0
- package/templates/bases/next/app-router/js/.provenance.json +19 -0
- package/templates/bases/next/app-router/js/README.md +36 -0
- package/templates/bases/next/app-router/js/jsconfig.json +7 -0
- package/templates/bases/next/app-router/js/next.config.mjs +6 -0
- package/templates/bases/next/app-router/js/package.json +15 -0
- package/templates/bases/next/app-router/js/public/file.svg +1 -0
- package/templates/bases/next/app-router/js/public/globe.svg +1 -0
- package/templates/bases/next/app-router/js/public/next.svg +1 -0
- package/templates/bases/next/app-router/js/public/vercel.svg +1 -0
- package/templates/bases/next/app-router/js/public/window.svg +1 -0
- package/templates/bases/next/app-router/js/src/app/api/hello/route.js +5 -0
- package/templates/bases/next/app-router/js/src/app/blog/[slug]/page.js +33 -0
- package/templates/bases/next/app-router/js/src/app/favicon.ico +0 -0
- package/templates/bases/next/app-router/js/src/app/globals.css +49 -0
- package/templates/bases/next/app-router/js/src/app/layout.js +25 -0
- package/templates/bases/next/app-router/js/src/app/loading.js +15 -0
- package/templates/bases/next/app-router/js/src/app/not-found.js +29 -0
- package/templates/bases/next/app-router/js/src/app/page.js +69 -0
- package/templates/bases/next/app-router/js/src/app/page.module.css +150 -0
- package/templates/bases/next/app-router/ts/.provenance.json +19 -0
- package/templates/bases/next/app-router/ts/README.md +36 -0
- package/templates/bases/next/app-router/ts/next.config.ts +7 -0
- package/templates/bases/next/app-router/ts/package.json +21 -0
- package/templates/bases/next/app-router/ts/public/file.svg +1 -0
- package/templates/bases/next/app-router/ts/public/globe.svg +1 -0
- package/templates/bases/next/app-router/ts/public/next.svg +1 -0
- package/templates/bases/next/app-router/ts/public/vercel.svg +1 -0
- package/templates/bases/next/app-router/ts/public/window.svg +1 -0
- package/templates/bases/next/app-router/ts/src/app/api/hello/route.ts +5 -0
- package/templates/bases/next/app-router/ts/src/app/blog/[slug]/page.tsx +38 -0
- package/templates/bases/next/app-router/ts/src/app/favicon.ico +0 -0
- package/templates/bases/next/app-router/ts/src/app/globals.css +49 -0
- package/templates/bases/next/app-router/ts/src/app/layout.tsx +30 -0
- package/templates/bases/next/app-router/ts/src/app/loading.tsx +15 -0
- package/templates/bases/next/app-router/ts/src/app/not-found.tsx +29 -0
- package/templates/bases/next/app-router/ts/src/app/page.module.css +150 -0
- package/templates/bases/next/app-router/ts/src/app/page.tsx +69 -0
- package/templates/bases/next/app-router/ts/tsconfig.json +34 -0
- package/templates/bases/next/pages-router/js/.provenance.json +19 -0
- package/templates/bases/next/pages-router/js/README.md +40 -0
- package/templates/bases/next/pages-router/js/jsconfig.json +7 -0
- package/templates/bases/next/pages-router/js/next.config.mjs +7 -0
- package/templates/bases/next/pages-router/js/package.json +15 -0
- package/templates/bases/next/pages-router/js/public/favicon.ico +0 -0
- package/templates/bases/next/pages-router/js/public/file.svg +1 -0
- package/templates/bases/next/pages-router/js/public/globe.svg +1 -0
- package/templates/bases/next/pages-router/js/public/next.svg +1 -0
- package/templates/bases/next/pages-router/js/public/vercel.svg +1 -0
- package/templates/bases/next/pages-router/js/public/window.svg +1 -0
- package/templates/bases/next/pages-router/js/src/pages/404.js +35 -0
- package/templates/bases/next/pages-router/js/src/pages/500.js +35 -0
- package/templates/bases/next/pages-router/js/src/pages/_app.js +20 -0
- package/templates/bases/next/pages-router/js/src/pages/_document.js +15 -0
- package/templates/bases/next/pages-router/js/src/pages/api/hello.js +5 -0
- package/templates/bases/next/pages-router/js/src/pages/blog/[slug].js +41 -0
- package/templates/bases/next/pages-router/js/src/pages/index.js +77 -0
- package/templates/bases/next/pages-router/js/src/styles/Home.module.css +149 -0
- package/templates/bases/next/pages-router/js/src/styles/globals.css +42 -0
- package/templates/bases/next/pages-router/ts/.provenance.json +19 -0
- package/templates/bases/next/pages-router/ts/README.md +40 -0
- package/templates/bases/next/pages-router/ts/next.config.ts +8 -0
- package/templates/bases/next/pages-router/ts/package.json +21 -0
- package/templates/bases/next/pages-router/ts/public/favicon.ico +0 -0
- package/templates/bases/next/pages-router/ts/public/file.svg +1 -0
- package/templates/bases/next/pages-router/ts/public/globe.svg +1 -0
- package/templates/bases/next/pages-router/ts/public/next.svg +1 -0
- package/templates/bases/next/pages-router/ts/public/vercel.svg +1 -0
- package/templates/bases/next/pages-router/ts/public/window.svg +1 -0
- package/templates/bases/next/pages-router/ts/src/pages/404.tsx +35 -0
- package/templates/bases/next/pages-router/ts/src/pages/500.tsx +35 -0
- package/templates/bases/next/pages-router/ts/src/pages/_app.tsx +21 -0
- package/templates/bases/next/pages-router/ts/src/pages/_document.tsx +15 -0
- package/templates/bases/next/pages-router/ts/src/pages/api/hello.ts +13 -0
- package/templates/bases/next/pages-router/ts/src/pages/blog/[slug].tsx +46 -0
- package/templates/bases/next/pages-router/ts/src/pages/index.tsx +77 -0
- package/templates/bases/next/pages-router/ts/src/styles/Home.module.css +149 -0
- package/templates/bases/next/pages-router/ts/src/styles/globals.css +42 -0
- package/templates/bases/next/pages-router/ts/tsconfig.json +29 -0
- package/templates/conditional/linting/biome/biome.json +31 -0
- package/templates/conditional/next/config/cloudflare/next.config.mjs +6 -0
- package/templates/conditional/next/config/cloudflare/next.config.ts +7 -0
- package/templates/conditional/next/config/node/next.config.mjs +6 -0
- package/templates/conditional/next/config/node/next.config.ts +7 -0
- package/templates/conditional/next/config/static/next.config.mjs +6 -0
- package/templates/conditional/next/config/static/next.config.ts +7 -0
- package/templates/conditional/next/config/turbopack/next.config.mjs +7 -0
- package/templates/conditional/next/config/turbopack/next.config.ts +8 -0
- package/templates/conditional/next/config/vercel/next.config.mjs +6 -0
- package/templates/conditional/next/config/vercel/next.config.ts +7 -0
- package/templates/conditional/next/config/webpack/next.config.mjs +9 -0
- package/templates/conditional/next/config/webpack/next.config.ts +10 -0
- package/templates/conditional/next/font/BUILD_SIZE_NOTE.md +17 -0
- package/templates/conditional/next/font/app-router/src/app/layout.js +25 -0
- package/templates/conditional/next/font/app-router/src/app/layout.tsx +30 -0
- package/templates/conditional/next/font/pages-router/src/pages/_app.js +20 -0
- package/templates/conditional/next/font/pages-router/src/pages/_app.tsx +21 -0
- package/templates/conditional/next/font/pages-router/src/pages/_document.js +18 -0
- package/templates/conditional/next/font/pages-router/src/pages/_document.tsx +18 -0
- package/templates/conditional/next/font/src/app/layout.js +25 -0
- package/templates/conditional/next/font/src/app/layout.tsx +30 -0
- package/templates/conditional/next/font/src/lib/fonts.js +11 -0
- package/templates/conditional/next/font/src/lib/fonts.ts +11 -0
- package/templates/conditional/next/font/src/pages/_app.js +20 -0
- package/templates/conditional/next/font/src/pages/_app.tsx +21 -0
- package/templates/conditional/next/font/src/pages/_document.js +18 -0
- package/templates/conditional/next/font/src/pages/_document.tsx +18 -0
- package/templates/conditional/next/image/BUILD_SIZE_NOTE.md +15 -0
- package/templates/conditional/next/image/app-router/src/components/ImageExample.jsx +34 -0
- package/templates/conditional/next/image/app-router/src/components/ImageExample.tsx +44 -0
- package/templates/conditional/next/image/pages-router/src/components/ImageExample.jsx +34 -0
- package/templates/conditional/next/image/pages-router/src/components/ImageExample.tsx +44 -0
- package/templates/conditional/next/image/src/components/ImageExample.jsx +44 -0
- package/templates/conditional/next/image/src/components/ImageExample.tsx +54 -0
- package/templates/conditional/next/image/src/components/image/index.js +1 -0
- package/templates/conditional/next/image/src/components/image/index.ts +2 -0
- package/templates/conditional/next/server-components/README.md +13 -0
- package/templates/conditional/next/server-components/eslint.config.mjs +47 -0
- package/templates/conditional/next/server-components/rules/no-server-imports-in-client.js +89 -0
- package/templates/conditional/next/server-components/rules/no-server-imports-in-client.mjs +88 -0
- package/templates/conditional/next/server-components/src/components/boundaries/ClientCounter.jsx +48 -0
- package/templates/conditional/next/server-components/src/components/boundaries/ClientCounter.tsx +53 -0
- package/templates/conditional/next/server-components/src/components/boundaries/ServerCard.jsx +41 -0
- package/templates/conditional/next/server-components/src/components/boundaries/ServerCard.tsx +46 -0
- package/templates/conditional/next/server-components/src/components/boundaries/index.js +2 -0
- package/templates/conditional/next/server-components/src/components/boundaries/index.ts +4 -0
- package/templates/conditional/testing/jest/hybrid/src/__tests__/App.test.jsx +11 -0
- package/templates/conditional/testing/jest/hybrid/src/__tests__/App.test.tsx +11 -0
- package/templates/conditional/testing/jest/none/src/__tests__/App.test.jsx +11 -0
- package/templates/conditional/testing/jest/none/src/__tests__/App.test.tsx +11 -0
- package/templates/conditional/testing/vitest/hybrid/src/__tests__/App.test.jsx +10 -0
- package/templates/conditional/testing/vitest/hybrid/src/__tests__/App.test.tsx +10 -0
- package/templates/conditional/testing/vitest/none/src/__tests__/App.test.jsx +10 -0
- package/templates/conditional/testing/vitest/none/src/__tests__/App.test.tsx +10 -0
- package/templates/css/tailwind/src/globals.css +10 -0
- package/templates/css/tailwind/src/themes.css +86 -4
- package/templates/ui/shadcn/lib/utils.js +6 -0
- package/templates/ui/shadcn/lib/utils.ts +6 -0
- package/templates/ui/shadcn/primitives/Button.jsx +48 -0
- package/templates/ui/shadcn/primitives/Button.tsx +59 -0
- package/templates/ui/shadcn/primitives/Card.jsx +55 -0
- package/templates/ui/shadcn/primitives/Card.tsx +73 -0
- package/templates/ui/shadcn/primitives/index.js +9 -0
- package/templates/ui/shadcn/primitives/index.ts +9 -0
- package/templates/css/bootstrap/src/themes.css +0 -14
- /package/templates/{css/bootstrap/src/globals.css → architectures/hybrid/src/features/.gitkeep} +0 -0
package/src/main.js
CHANGED
|
@@ -12,7 +12,7 @@ import { injectArchitecture, injectConditionals, injectFormatter } from "@/injec
|
|
|
12
12
|
import { getPkgManager } from "@/utils/pkg-manager.js";
|
|
13
13
|
import { handleDevServer } from "@/utils/dev-server.js";
|
|
14
14
|
import { getUserInputs, onCancel } from "@/prompts.js";
|
|
15
|
-
import { runBaseInstall, runGitInit, runViteCreate } from "@/scaffold.js";
|
|
15
|
+
import { runBaseInstall, runGitInit, runViteCreate, scaffoldBase } from "@/scaffold.js";
|
|
16
16
|
import { installAllDeps } from "@/dependencies.js";
|
|
17
17
|
import { generateReadme } from "@/readme.js";
|
|
18
18
|
import { runProjectFormat } from "@/format.js";
|
|
@@ -20,6 +20,8 @@ import { emitManifest } from "@/manifest/emit.js";
|
|
|
20
20
|
import { emitAgentContext } from "@/agent-context.js";
|
|
21
21
|
|
|
22
22
|
import { parseCliArgs, loadManifestSource, manifestToResponses, PRESETS } from "@/cli-args.js";
|
|
23
|
+
import { getProvider } from "@/engine/providers/base-provider.js";
|
|
24
|
+
import { normalizeFramework } from "@/engine/capabilities.js";
|
|
23
25
|
|
|
24
26
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
27
|
const __dirname = path.dirname(__filename);
|
|
@@ -48,6 +50,8 @@ export async function main(options = {}) {
|
|
|
48
50
|
projectName: nameArg,
|
|
49
51
|
manifest: manifestSource,
|
|
50
52
|
template: templateName,
|
|
53
|
+
framework: frameworkArg,
|
|
54
|
+
arch: archArg,
|
|
51
55
|
} = options;
|
|
52
56
|
const pkg = getPkgManager();
|
|
53
57
|
|
|
@@ -93,20 +97,40 @@ export async function main(options = {}) {
|
|
|
93
97
|
...preset,
|
|
94
98
|
};
|
|
95
99
|
} else {
|
|
96
|
-
responses = await getUserInputs(projectName, { quickSetup });
|
|
100
|
+
responses = await getUserInputs(projectName, { quickSetup, initialArch: archArg, framework: frameworkArg });
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
const projectPath = path.resolve(CURRENT_DIR, projectName);
|
|
100
104
|
|
|
101
|
-
// 4. Scaffold
|
|
105
|
+
// 4. Scaffold the base project (provider-owned bases; Vite shells out, Next copies)
|
|
106
|
+
const fw = normalizeFramework(
|
|
107
|
+
responses.framework || { name: responses.frameworkName, variant: responses.frameworkVariant }
|
|
108
|
+
);
|
|
102
109
|
const createSpin = spinner();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
if (fw.name === "next") {
|
|
111
|
+
createSpin.start("Creating your Next.js project...");
|
|
112
|
+
try {
|
|
113
|
+
const provider = getProvider(fw.name, fw.variant);
|
|
114
|
+
const based = await scaffoldBase(projectPath, provider, responses.language, TEMPLATES_DIR);
|
|
115
|
+
if (!based) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
`Next.js base template not found for variant "${fw.variant}" (${responses.language}).`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
createSpin.stop(chalk.green("Project created successfully!"));
|
|
121
|
+
} catch (err) {
|
|
122
|
+
createSpin.stop(chalk.red("Failed to create project."));
|
|
123
|
+
throw err;
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
createSpin.start("Creating your Vite + React project...");
|
|
127
|
+
try {
|
|
128
|
+
await runViteCreate(projectPath, projectName, pkg, responses.language);
|
|
129
|
+
createSpin.stop(chalk.green("Project created successfully!"));
|
|
130
|
+
} catch (err) {
|
|
131
|
+
createSpin.stop(chalk.red("Failed to create project."));
|
|
132
|
+
throw err;
|
|
133
|
+
}
|
|
110
134
|
}
|
|
111
135
|
|
|
112
136
|
// 5. Install base dependencies
|
|
@@ -136,7 +160,7 @@ export async function main(options = {}) {
|
|
|
136
160
|
// 7. Inject architecture templates
|
|
137
161
|
const archSpin = spinner();
|
|
138
162
|
archSpin.start(
|
|
139
|
-
`Setting up ${responses.architecture
|
|
163
|
+
`Setting up ${responses.architecture} architecture...`
|
|
140
164
|
);
|
|
141
165
|
try {
|
|
142
166
|
await injectArchitecture(
|
|
@@ -194,11 +218,9 @@ export async function main(options = {}) {
|
|
|
194
218
|
// 10. CSS framework setup
|
|
195
219
|
const cssSpin = spinner();
|
|
196
220
|
const cssLabel =
|
|
197
|
-
responses.cssFramework === "
|
|
198
|
-
? "CSS reset"
|
|
199
|
-
: responses.cssFramework === "tailwind"
|
|
221
|
+
responses.cssFramework === "tailwind"
|
|
200
222
|
? "Tailwind CSS"
|
|
201
|
-
: "
|
|
223
|
+
: "CSS reset";
|
|
202
224
|
if (responses.cssFramework !== "none") {
|
|
203
225
|
cssSpin.start(`Setting up ${cssLabel}...`);
|
|
204
226
|
}
|
|
@@ -290,7 +312,7 @@ export async function main(options = {}) {
|
|
|
290
312
|
log.step(chalk.green("\nProject setup complete!"));
|
|
291
313
|
log.message(
|
|
292
314
|
chalk.gray(
|
|
293
|
-
` Architecture: ${responses.architecture
|
|
315
|
+
` Architecture: ${responses.architecture}`
|
|
294
316
|
)
|
|
295
317
|
);
|
|
296
318
|
|
package/src/manifest/emit.js
CHANGED
|
@@ -64,7 +64,7 @@ export function buildManifest(responses, opts = {}) {
|
|
|
64
64
|
};
|
|
65
65
|
// Include optional axes only if present in responses (future overlays)
|
|
66
66
|
if (responses.bundler) framework.bundler = responses.bundler;
|
|
67
|
-
if (responses.adapter) framework.adapter = responses.adapter;
|
|
67
|
+
if (responses.adapter && responses.adapter !== "none") framework.adapter = responses.adapter;
|
|
68
68
|
|
|
69
69
|
const styling = {
|
|
70
70
|
engine: responses.cssFramework || "tailwind",
|
package/src/manifest/schema.js
CHANGED
|
@@ -12,7 +12,7 @@ export const FRAMEWORK_VARIANTS = ["vite", "app-router", "pages-router"];
|
|
|
12
12
|
export const FRAMEWORK_BUNDLERS = ["turbopack", "webpack"];
|
|
13
13
|
export const FRAMEWORK_ADAPTERS = ["node", "vercel", "cloudflare", "static"];
|
|
14
14
|
|
|
15
|
-
export const STYLING_ENGINES = ["tailwind", "
|
|
15
|
+
export const STYLING_ENGINES = ["tailwind", "none"];
|
|
16
16
|
export const ARCHITECTURE_PRESETS = ["feature-based", "type-based", "hybrid", "none"];
|
|
17
17
|
// Legacy alias: docs used architecture.type, canonical is architecture.preset.
|
|
18
18
|
// Keep both in sync; parseManifest normalizes to expose both keys.
|