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.
Files changed (87) hide show
  1. package/README.md +23 -22
  2. package/bin/cli.js +1 -6
  3. package/package.json +2 -2
  4. package/schema/fixtures/v2/valid/next-app-router-feature-based.json +1 -1
  5. package/schema/fixtures/v2/valid/next-app-router-none.json +1 -1
  6. package/schema/fixtures/v2/valid/next-pages-router-feature-based.json +1 -1
  7. package/schema/fixtures/v2/valid/next-pages-router-none.json +1 -1
  8. package/schema/lumen.config.v2.json +30 -2
  9. package/src/agent-context.js +71 -47
  10. package/src/cleanup.js +34 -1
  11. package/src/cli-args.js +79 -2
  12. package/src/configure.js +36 -8
  13. package/src/css.js +3 -4
  14. package/src/dependencies.js +42 -15
  15. package/src/engine/capabilities.js +51 -2
  16. package/src/engine/composition.js +282 -23
  17. package/src/env.js +159 -4
  18. package/src/format.js +14 -6
  19. package/src/injector.js +66 -14
  20. package/src/main.js +62 -17
  21. package/src/manifest/emit.js +35 -6
  22. package/src/manifest/paths.js +1 -25
  23. package/src/manifest/schema.js +32 -2
  24. package/src/prompts.js +101 -11
  25. package/src/readme.js +0 -16
  26. package/src/utils/dev-server.js +6 -1
  27. package/templates/.env.example +1 -1
  28. package/templates/architectures/feature-based/scripts/create-feature.mjs +2 -2
  29. package/templates/conditional/database/prisma/db.js +14 -0
  30. package/templates/conditional/database/prisma/db.ts +16 -0
  31. package/templates/conditional/database/prisma/schema.prisma +9 -0
  32. package/templates/conditional/database/prisma/seed.js +16 -0
  33. package/templates/conditional/database/prisma/seed.ts +16 -0
  34. package/templates/conditional/docker/.dockerignore +10 -0
  35. package/templates/conditional/docker/Dockerfile +57 -0
  36. package/templates/conditional/docker/docker-compose.yml +35 -0
  37. package/templates/conditional/linting/biome/biome.json +17 -11
  38. package/templates/conditional/linting/eslint/next/eslint.config.mjs +2 -11
  39. package/templates/conditional/next/route-groups/js/src/app/(admin)/layout.jsx +23 -0
  40. package/templates/conditional/next/route-groups/js/src/app/(auth)/layout.jsx +17 -0
  41. package/templates/conditional/next/route-groups/js/src/app/(private)/layout.jsx +27 -0
  42. package/templates/conditional/next/route-groups/js/src/app/(public)/layout.jsx +28 -0
  43. package/templates/conditional/next/route-groups/js/src/app/(public)/page.jsx +38 -0
  44. package/templates/conditional/next/route-groups/js/src/middleware.js +48 -0
  45. package/templates/conditional/next/route-groups/ts/src/app/(admin)/layout.tsx +28 -0
  46. package/templates/conditional/next/route-groups/ts/src/app/(auth)/layout.tsx +22 -0
  47. package/templates/conditional/next/route-groups/ts/src/app/(private)/layout.tsx +32 -0
  48. package/templates/conditional/next/route-groups/ts/src/app/(public)/layout.tsx +33 -0
  49. package/templates/conditional/next/route-groups/ts/src/app/(public)/page.tsx +38 -0
  50. package/templates/conditional/next/route-groups/ts/src/middleware.ts +49 -0
  51. package/templates/conditional/testing/jest/next/app-router/src/__tests__/page.test.jsx +10 -0
  52. package/templates/conditional/testing/jest/next/app-router/src/__tests__/page.test.tsx +10 -0
  53. package/templates/conditional/testing/jest/next/jest.config.mjs +20 -0
  54. package/templates/conditional/testing/jest/next/jest.config.ts +20 -0
  55. package/templates/conditional/testing/jest/next/pages-router/src/__tests__/index.test.jsx +10 -0
  56. package/templates/conditional/testing/jest/next/pages-router/src/__tests__/index.test.tsx +10 -0
  57. package/templates/conditional/testing/vitest/next/app-router/src/__tests__/page.test.jsx +11 -0
  58. package/templates/conditional/testing/vitest/next/app-router/src/__tests__/page.test.tsx +11 -0
  59. package/templates/conditional/testing/vitest/next/pages-router/src/__tests__/index.test.jsx +11 -0
  60. package/templates/conditional/testing/vitest/next/pages-router/src/__tests__/index.test.tsx +11 -0
  61. package/templates/conditional/testing/vitest/next/vitest.config.js +16 -0
  62. package/templates/conditional/testing/vitest/next/vitest.config.ts +16 -0
  63. package/templates/css/tailwind/postcss.config.mjs +3 -1
  64. package/schema/fixtures/v2/valid/next-app-router-hybrid.json +0 -35
  65. package/schema/fixtures/v2/valid/next-pages-router-hybrid.json +0 -35
  66. package/templates/architectures/hybrid/main.jsx +0 -10
  67. package/templates/architectures/hybrid/main.tsx +0 -10
  68. package/templates/architectures/hybrid/src/App.jsx +0 -20
  69. package/templates/architectures/hybrid/src/App.tsx +0 -20
  70. package/templates/architectures/hybrid/src/features/.gitkeep +0 -1
  71. package/templates/architectures/hybrid/src/shared/components/ui/Button.jsx +0 -31
  72. package/templates/architectures/hybrid/src/shared/components/ui/Button.tsx +0 -36
  73. package/templates/architectures/hybrid/src/shared/components/ui/index.js +0 -1
  74. package/templates/architectures/hybrid/src/shared/components/ui/index.ts +0 -1
  75. package/templates/architectures/hybrid/src/shared/hooks/useLocalStorage.jsx +0 -28
  76. package/templates/architectures/hybrid/src/shared/hooks/useLocalStorage.ts +0 -28
  77. package/templates/architectures/hybrid/src/shared/layouts/.gitkeep +0 -0
  78. package/templates/architectures/hybrid/src/shared/stores/.gitkeep +0 -0
  79. package/templates/architectures/hybrid/src/shared/styles/.gitkeep +0 -0
  80. package/templates/architectures/hybrid/src/shared/types/index.js +0 -20
  81. package/templates/architectures/hybrid/src/shared/types/index.ts +0 -16
  82. package/templates/architectures/hybrid/src/shared/utils/cn.jsx +0 -3
  83. package/templates/architectures/hybrid/src/shared/utils/cn.ts +0 -5
  84. package/templates/conditional/testing/jest/hybrid/src/__tests__/App.test.jsx +0 -11
  85. package/templates/conditional/testing/jest/hybrid/src/__tests__/App.test.tsx +0 -11
  86. package/templates/conditional/testing/vitest/hybrid/src/__tests__/App.test.jsx +0 -10
  87. 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
- }
@@ -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,3 +0,0 @@
1
- export function cn(...inputs) {
2
- return inputs.filter(Boolean).join(" ");
3
- }
@@ -1,5 +0,0 @@
1
- type ClassValue = string | false | null | undefined;
2
-
3
- export function cn(...inputs: ClassValue[]): string {
4
- return inputs.filter(Boolean).join(" ");
5
- }
@@ -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
- });