create-lumen 2.0.0-beta.1 → 2.0.0-beta.3
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 +23 -22
- package/bin/cli.js +1 -6
- package/package.json +2 -2
- package/schema/fixtures/v2/valid/next-app-router-feature-based.json +1 -1
- package/schema/fixtures/v2/valid/next-app-router-none.json +1 -1
- package/schema/fixtures/v2/valid/next-pages-router-feature-based.json +1 -1
- package/schema/fixtures/v2/valid/next-pages-router-none.json +1 -1
- package/schema/lumen.config.v2.json +30 -2
- package/src/agent-context.js +71 -47
- package/src/cleanup.js +34 -1
- package/src/cli-args.js +79 -2
- package/src/configure.js +36 -8
- package/src/css.js +3 -4
- package/src/dependencies.js +42 -15
- package/src/engine/capabilities.js +51 -2
- package/src/engine/composition.js +282 -23
- package/src/env.js +159 -4
- package/src/format.js +14 -6
- package/src/injector.js +66 -14
- package/src/main.js +62 -17
- package/src/manifest/emit.js +35 -6
- package/src/manifest/paths.js +1 -25
- package/src/manifest/schema.js +32 -2
- package/src/prompts.js +101 -11
- package/src/readme.js +0 -16
- package/src/utils/dev-server.js +6 -1
- package/templates/.env.example +1 -1
- package/templates/architectures/feature-based/scripts/create-feature.mjs +2 -2
- package/templates/conditional/database/prisma/db.js +14 -0
- package/templates/conditional/database/prisma/db.ts +16 -0
- package/templates/conditional/database/prisma/schema.prisma +9 -0
- package/templates/conditional/database/prisma/seed.js +16 -0
- package/templates/conditional/database/prisma/seed.ts +16 -0
- package/templates/conditional/docker/.dockerignore +10 -0
- package/templates/conditional/docker/Dockerfile +57 -0
- package/templates/conditional/docker/docker-compose.yml +35 -0
- package/templates/conditional/linting/biome/biome.json +17 -11
- package/templates/conditional/linting/eslint/next/eslint.config.mjs +2 -11
- package/templates/conditional/next/route-groups/js/src/app/(admin)/layout.jsx +23 -0
- package/templates/conditional/next/route-groups/js/src/app/(auth)/layout.jsx +17 -0
- package/templates/conditional/next/route-groups/js/src/app/(private)/layout.jsx +27 -0
- package/templates/conditional/next/route-groups/js/src/app/(public)/layout.jsx +28 -0
- package/templates/conditional/next/route-groups/js/src/app/(public)/page.jsx +38 -0
- package/templates/conditional/next/route-groups/js/src/middleware.js +48 -0
- package/templates/conditional/next/route-groups/ts/src/app/(admin)/layout.tsx +28 -0
- package/templates/conditional/next/route-groups/ts/src/app/(auth)/layout.tsx +22 -0
- package/templates/conditional/next/route-groups/ts/src/app/(private)/layout.tsx +32 -0
- package/templates/conditional/next/route-groups/ts/src/app/(public)/layout.tsx +33 -0
- package/templates/conditional/next/route-groups/ts/src/app/(public)/page.tsx +38 -0
- package/templates/conditional/next/route-groups/ts/src/middleware.ts +49 -0
- package/templates/conditional/testing/jest/next/app-router/src/__tests__/page.test.jsx +10 -0
- package/templates/conditional/testing/jest/next/app-router/src/__tests__/page.test.tsx +10 -0
- package/templates/conditional/testing/jest/next/jest.config.mjs +20 -0
- package/templates/conditional/testing/jest/next/jest.config.ts +20 -0
- package/templates/conditional/testing/jest/next/pages-router/src/__tests__/index.test.jsx +10 -0
- package/templates/conditional/testing/jest/next/pages-router/src/__tests__/index.test.tsx +10 -0
- package/templates/conditional/testing/vitest/next/app-router/src/__tests__/page.test.jsx +11 -0
- package/templates/conditional/testing/vitest/next/app-router/src/__tests__/page.test.tsx +11 -0
- package/templates/conditional/testing/vitest/next/pages-router/src/__tests__/index.test.jsx +11 -0
- package/templates/conditional/testing/vitest/next/pages-router/src/__tests__/index.test.tsx +11 -0
- package/templates/conditional/testing/vitest/next/vitest.config.js +16 -0
- package/templates/conditional/testing/vitest/next/vitest.config.ts +16 -0
- package/templates/css/tailwind/postcss.config.mjs +3 -1
- package/schema/fixtures/v2/valid/next-app-router-hybrid.json +0 -35
- package/schema/fixtures/v2/valid/next-pages-router-hybrid.json +0 -35
- package/templates/architectures/hybrid/main.jsx +0 -10
- package/templates/architectures/hybrid/main.tsx +0 -10
- package/templates/architectures/hybrid/src/App.jsx +0 -20
- package/templates/architectures/hybrid/src/App.tsx +0 -20
- package/templates/architectures/hybrid/src/features/.gitkeep +0 -1
- package/templates/architectures/hybrid/src/shared/components/ui/Button.jsx +0 -31
- package/templates/architectures/hybrid/src/shared/components/ui/Button.tsx +0 -36
- package/templates/architectures/hybrid/src/shared/components/ui/index.js +0 -1
- package/templates/architectures/hybrid/src/shared/components/ui/index.ts +0 -1
- package/templates/architectures/hybrid/src/shared/hooks/useLocalStorage.jsx +0 -28
- package/templates/architectures/hybrid/src/shared/hooks/useLocalStorage.ts +0 -28
- 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 +0 -20
- package/templates/architectures/hybrid/src/shared/types/index.ts +0 -16
- package/templates/architectures/hybrid/src/shared/utils/cn.jsx +0 -3
- package/templates/architectures/hybrid/src/shared/utils/cn.ts +0 -5
- package/templates/conditional/testing/jest/hybrid/src/__tests__/App.test.jsx +0 -11
- package/templates/conditional/testing/jest/hybrid/src/__tests__/App.test.tsx +0 -11
- package/templates/conditional/testing/vitest/hybrid/src/__tests__/App.test.jsx +0 -10
- package/templates/conditional/testing/vitest/hybrid/src/__tests__/App.test.tsx +0 -10
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
-
variant?: "primary" | "secondary";
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export function Button({
|
|
7
|
-
variant = "primary",
|
|
8
|
-
children,
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: ButtonProps) {
|
|
12
|
-
const styles = {
|
|
13
|
-
primary: { backgroundColor: "var(--color-primary)", color: "white" },
|
|
14
|
-
secondary: {
|
|
15
|
-
backgroundColor: "var(--color-border)",
|
|
16
|
-
color: "var(--color-fg)",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
style={{
|
|
23
|
-
padding: "8px 16px",
|
|
24
|
-
borderRadius: "8px",
|
|
25
|
-
fontWeight: 500,
|
|
26
|
-
border: "none",
|
|
27
|
-
cursor: "pointer",
|
|
28
|
-
...styles[variant],
|
|
29
|
-
}}
|
|
30
|
-
className={className}
|
|
31
|
-
{...props}
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</button>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button } from "./Button";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button } from "./Button";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from "react";
|
|
2
|
-
|
|
3
|
-
export function useLocalStorage(key, initialValue) {
|
|
4
|
-
const [storedValue, setStoredValue] = useState(() => {
|
|
5
|
-
try {
|
|
6
|
-
const item = window.localStorage.getItem(key);
|
|
7
|
-
return item ? JSON.parse(item) : initialValue;
|
|
8
|
-
} catch {
|
|
9
|
-
return initialValue;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const setValue = useCallback(
|
|
14
|
-
(value) => {
|
|
15
|
-
try {
|
|
16
|
-
const valueToStore =
|
|
17
|
-
value instanceof Function ? value(storedValue) : value;
|
|
18
|
-
setStoredValue(valueToStore);
|
|
19
|
-
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.error(error);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
[key, storedValue]
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return [storedValue, setValue];
|
|
28
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from "react";
|
|
2
|
-
|
|
3
|
-
export function useLocalStorage<T>(key: string, initialValue: T) {
|
|
4
|
-
const [storedValue, setStoredValue] = useState<T>(() => {
|
|
5
|
-
try {
|
|
6
|
-
const item = window.localStorage.getItem(key);
|
|
7
|
-
return item ? (JSON.parse(item) as T) : initialValue;
|
|
8
|
-
} catch {
|
|
9
|
-
return initialValue;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const setValue = useCallback(
|
|
14
|
-
(value: T | ((prev: T) => T)) => {
|
|
15
|
-
try {
|
|
16
|
-
const valueToStore =
|
|
17
|
-
value instanceof Function ? value(storedValue) : value;
|
|
18
|
-
setStoredValue(valueToStore);
|
|
19
|
-
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.error(error);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
[key, storedValue]
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return [storedValue, setValue] as const;
|
|
28
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} User
|
|
3
|
-
* @property {string} id
|
|
4
|
-
* @property {string} email
|
|
5
|
-
* @property {string} name
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {Object} ApiResponse
|
|
10
|
-
* @property {*} data
|
|
11
|
-
* @property {string} message
|
|
12
|
-
* @property {boolean} success
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {Object} CreateUserPayload
|
|
17
|
-
* @property {string} email
|
|
18
|
-
* @property {string} name
|
|
19
|
-
*/
|
|
20
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface User {
|
|
2
|
-
id: string;
|
|
3
|
-
email: string;
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ApiResponse<T> {
|
|
8
|
-
data: T;
|
|
9
|
-
message: string;
|
|
10
|
-
success: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface CreateUserPayload {
|
|
14
|
-
email: string;
|
|
15
|
-
name: string;
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "@jest/globals";
|
|
2
|
-
import { render, screen } from "@testing-library/react";
|
|
3
|
-
import "@testing-library/jest-dom/jest-globals";
|
|
4
|
-
import App from "@/App";
|
|
5
|
-
|
|
6
|
-
describe("App", () => {
|
|
7
|
-
it("renders without crashing", () => {
|
|
8
|
-
render(<App />);
|
|
9
|
-
expect(screen.getByText(/Welcome/i)).toBeInTheDocument();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "@jest/globals";
|
|
2
|
-
import { render, screen } from "@testing-library/react";
|
|
3
|
-
import "@testing-library/jest-dom/jest-globals";
|
|
4
|
-
import App from "@/App";
|
|
5
|
-
|
|
6
|
-
describe("App", () => {
|
|
7
|
-
it("renders without crashing", () => {
|
|
8
|
-
render(<App />);
|
|
9
|
-
expect(screen.getByText(/Welcome/i)).toBeInTheDocument();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { render, screen } from "@testing-library/react";
|
|
2
|
-
import { describe, it, expect } from "vitest";
|
|
3
|
-
import App from "@/App";
|
|
4
|
-
|
|
5
|
-
describe("App", () => {
|
|
6
|
-
it("renders without crashing", () => {
|
|
7
|
-
render(<App />);
|
|
8
|
-
expect(screen.getByText(/Welcome/i)).toBeInTheDocument();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { render, screen } from "@testing-library/react";
|
|
2
|
-
import { describe, it, expect } from "vitest";
|
|
3
|
-
import App from "@/App";
|
|
4
|
-
|
|
5
|
-
describe("App", () => {
|
|
6
|
-
it("renders without crashing", () => {
|
|
7
|
-
render(<App />);
|
|
8
|
-
expect(screen.getByText(/Welcome/i)).toBeInTheDocument();
|
|
9
|
-
});
|
|
10
|
-
});
|