create-next-mui 0.0.1 → 0.0.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 (46) hide show
  1. package/LICENSE +21 -21
  2. package/next-mui-template-js/.vscode/settings.json +7 -0
  3. package/next-mui-template-js/.vscode/typescript.code-snippets +10 -0
  4. package/next-mui-template-js/esling.config.mjs +90 -0
  5. package/next-mui-template-js/next.config.ts +7 -0
  6. package/next-mui-template-js/package-lock.json +6689 -0
  7. package/next-mui-template-js/package.json +31 -0
  8. package/next-mui-template-js/public/next.svg +1 -0
  9. package/next-mui-template-js/public/vercel.svg +1 -0
  10. package/next-mui-template-js/src/app/favicon.ico +0 -0
  11. package/next-mui-template-js/src/app/globals.css +28 -0
  12. package/next-mui-template-js/src/app/layout.tsx +42 -0
  13. package/next-mui-template-js/src/app/page.tsx +7 -0
  14. package/next-mui-template-js/src/lib/router-link/index.ts +5 -0
  15. package/next-mui-template-js/src/sections/home/view.tsx +49 -0
  16. package/next-mui-template-js/src/theme/core/colors.json +46 -0
  17. package/next-mui-template-js/src/theme/core/components/button.ts +35 -0
  18. package/next-mui-template-js/src/theme/core/components/card.ts +17 -0
  19. package/next-mui-template-js/src/theme/core/components/index.ts +9 -0
  20. package/next-mui-template-js/src/theme/core/palette.ts +34 -0
  21. package/next-mui-template-js/src/theme/core/typography.ts +51 -0
  22. package/next-mui-template-js/src/theme/create-theme.ts +24 -0
  23. package/next-mui-template-js/src/theme/theme-provider.tsx +19 -0
  24. package/next-mui-template-js/tsconfig.json +34 -0
  25. package/next-mui-template-ts/.vscode/settings.json +7 -7
  26. package/next-mui-template-ts/.vscode/typescript.code-snippets +10 -10
  27. package/next-mui-template-ts/esling.config.mjs +90 -97
  28. package/next-mui-template-ts/next.config.ts +7 -7
  29. package/next-mui-template-ts/package-lock.json +6689 -6689
  30. package/next-mui-template-ts/package.json +31 -31
  31. package/next-mui-template-ts/src/app/globals.css +28 -28
  32. package/next-mui-template-ts/src/app/layout.tsx +42 -42
  33. package/next-mui-template-ts/src/app/page.tsx +7 -7
  34. package/next-mui-template-ts/src/lib/router-link/index.ts +5 -5
  35. package/next-mui-template-ts/src/sections/home/view.tsx +49 -49
  36. package/next-mui-template-ts/src/theme/core/colors.json +46 -46
  37. package/next-mui-template-ts/src/theme/core/components/button.ts +35 -35
  38. package/next-mui-template-ts/src/theme/core/components/card.ts +17 -17
  39. package/next-mui-template-ts/src/theme/core/components/index.ts +9 -9
  40. package/next-mui-template-ts/src/theme/core/palette.ts +34 -34
  41. package/next-mui-template-ts/src/theme/core/typography.ts +51 -51
  42. package/next-mui-template-ts/src/theme/create-theme.ts +24 -24
  43. package/next-mui-template-ts/src/theme/theme-provider.tsx +19 -19
  44. package/next-mui-template-ts/tsconfig.json +34 -34
  45. package/package.json +1 -1
  46. package/src/index.js +88 -88
@@ -1,51 +1,51 @@
1
- // ---------------------------------------------------------------
2
-
3
- export const typography = {
4
- h1: {
5
- fontSize: "56px",
6
- lineHeight: "64px",
7
- fontWeight: 700,
8
- },
9
- h2: {
10
- fontSize: "44px",
11
- lineHeight: "56px",
12
- fontWeight: 700,
13
- },
14
- h3: {
15
- fontSize: "36px",
16
- lineHeight: "44px",
17
- fontWeight: 700,
18
- },
19
- h4: {
20
- fontSize: "32px",
21
- lineHeight: "40px",
22
- fontWeight: 600,
23
- },
24
- h5: {
25
- fontSize: "20px",
26
- lineHeight: "28px",
27
- fontWeight: 600,
28
- },
29
- h6: {
30
- fontSize: "16px",
31
- lineHeight: "20px",
32
- fontWeight: 600,
33
- },
34
- body1: {
35
- fontSize: "16px",
36
- lineHeight: "20px",
37
- },
38
- body2: {
39
- fontSize: "14px",
40
- lineHeight: "18px",
41
- },
42
- caption: {
43
- fontSize: "12px",
44
- lineHeight: "16px",
45
- fontWeight: 500,
46
- },
47
- button: {
48
- fontWeight: 500,
49
- lineHeight: "16px",
50
- },
51
- };
1
+ // ---------------------------------------------------------------
2
+
3
+ export const typography = {
4
+ h1: {
5
+ fontSize: "56px",
6
+ lineHeight: "64px",
7
+ fontWeight: 700,
8
+ },
9
+ h2: {
10
+ fontSize: "44px",
11
+ lineHeight: "56px",
12
+ fontWeight: 700,
13
+ },
14
+ h3: {
15
+ fontSize: "36px",
16
+ lineHeight: "44px",
17
+ fontWeight: 700,
18
+ },
19
+ h4: {
20
+ fontSize: "32px",
21
+ lineHeight: "40px",
22
+ fontWeight: 600,
23
+ },
24
+ h5: {
25
+ fontSize: "20px",
26
+ lineHeight: "28px",
27
+ fontWeight: 600,
28
+ },
29
+ h6: {
30
+ fontSize: "16px",
31
+ lineHeight: "20px",
32
+ fontWeight: 600,
33
+ },
34
+ body1: {
35
+ fontSize: "16px",
36
+ lineHeight: "20px",
37
+ },
38
+ body2: {
39
+ fontSize: "14px",
40
+ lineHeight: "18px",
41
+ },
42
+ caption: {
43
+ fontSize: "12px",
44
+ lineHeight: "16px",
45
+ fontWeight: 500,
46
+ },
47
+ button: {
48
+ fontWeight: 500,
49
+ lineHeight: "16px",
50
+ },
51
+ };
@@ -1,24 +1,24 @@
1
- import { createTheme } from "@mui/material";
2
-
3
- import { palette } from "./core/palette";
4
- import { typography } from "./core/typography";
5
- import { components } from "./core/components";
6
-
7
- // ---------------------------------------------------------------
8
-
9
- const defaultFont = "var(--font-geist-sans), Arial, sans-serif";
10
-
11
- export const theme = createTheme({
12
- cssVariables: true,
13
-
14
- palette: { mode: "light", ...palette },
15
-
16
- typography: {
17
- fontFamily: defaultFont,
18
- ...typography,
19
- },
20
-
21
- spacing: "8px",
22
-
23
- components,
24
- });
1
+ import { createTheme } from "@mui/material";
2
+
3
+ import { palette } from "./core/palette";
4
+ import { typography } from "./core/typography";
5
+ import { components } from "./core/components";
6
+
7
+ // ---------------------------------------------------------------
8
+
9
+ const defaultFont = "var(--font-geist-sans), Arial, sans-serif";
10
+
11
+ export const theme = createTheme({
12
+ cssVariables: true,
13
+
14
+ palette: { mode: "light", ...palette },
15
+
16
+ typography: {
17
+ fontFamily: defaultFont,
18
+ ...typography,
19
+ },
20
+
21
+ spacing: "8px",
22
+
23
+ components,
24
+ });
@@ -1,19 +1,19 @@
1
- "use client";
2
-
3
- import { AppRouterCacheProvider } from "@mui/material-nextjs/v16-appRouter";
4
- import { CssBaseline, ThemeProvider as MuiThemeProvider } from "@mui/material";
5
-
6
- import { theme } from "./create-theme";
7
-
8
- // ---------------------------------------------------------------
9
-
10
- export function ThemeProvider({ children }: { children: React.ReactNode }) {
11
- return (
12
- <AppRouterCacheProvider>
13
- <MuiThemeProvider theme={theme}>
14
- <CssBaseline />
15
- {children}
16
- </MuiThemeProvider>
17
- </AppRouterCacheProvider>
18
- );
19
- }
1
+ "use client";
2
+
3
+ import { AppRouterCacheProvider } from "@mui/material-nextjs/v16-appRouter";
4
+ import { CssBaseline, ThemeProvider as MuiThemeProvider } from "@mui/material";
5
+
6
+ import { theme } from "./create-theme";
7
+
8
+ // ---------------------------------------------------------------
9
+
10
+ export function ThemeProvider({ children }: { children: React.ReactNode }) {
11
+ return (
12
+ <AppRouterCacheProvider>
13
+ <MuiThemeProvider theme={theme}>
14
+ <CssBaseline />
15
+ {children}
16
+ </MuiThemeProvider>
17
+ </AppRouterCacheProvider>
18
+ );
19
+ }
@@ -1,34 +1,34 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": true,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "bundler",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "react-jsx",
15
- "incremental": true,
16
- "plugins": [
17
- {
18
- "name": "next"
19
- }
20
- ],
21
- "paths": {
22
- "@/*": ["./src/*"]
23
- }
24
- },
25
- "include": [
26
- "next-env.d.ts",
27
- "**/*.ts",
28
- "**/*.tsx",
29
- ".next/types/**/*.ts",
30
- ".next/dev/types/**/*.ts",
31
- "**/*.mts"
32
- ],
33
- "exclude": ["node_modules"]
34
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [
17
+ {
18
+ "name": "next"
19
+ }
20
+ ],
21
+ "paths": {
22
+ "@/*": ["./src/*"]
23
+ }
24
+ },
25
+ "include": [
26
+ "next-env.d.ts",
27
+ "**/*.ts",
28
+ "**/*.tsx",
29
+ ".next/types/**/*.ts",
30
+ ".next/dev/types/**/*.ts",
31
+ "**/*.mts"
32
+ ],
33
+ "exclude": ["node_modules"]
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-next-mui",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "spin up your nextjs project with mui setup",
5
5
  "keywords": [
6
6
  "nextjs",
package/src/index.js CHANGED
@@ -1,88 +1,88 @@
1
- #!/usr/bin/env node
2
-
3
- import * as p from "@clack/prompts";
4
- import color from "picocolors";
5
- import fs from "node:fs/promises";
6
- import path from "node:path";
7
- import { fileURLToPath } from "node:url";
8
-
9
- // Resolve the directory where this CLI package actually lives on the user's system
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = path.dirname(__filename);
12
-
13
- async function main() {
14
- console.clear();
15
- p.intro(color.bgBlue(color.white(" create-next-mui ")));
16
-
17
- const project = await p.group(
18
- {
19
- name: () =>
20
- p.text({
21
- message: "What is your project name?",
22
- placeholder: "my-next-mui-app",
23
- validate(value) {
24
- if (value.length === 0) return "Project name is required!";
25
- if (value.match(/[^a-zA-Z0-9-_]/g))
26
- return "Keep it URL safe (no spaces or special chars)";
27
- },
28
- }),
29
- language: () =>
30
- p.select({
31
- message: "Choose your language flavor:",
32
- options: [
33
- {
34
- value: "ts",
35
- label: "TypeScript (Recommended)",
36
- hint: "Strict typings, clean architecture",
37
- },
38
- {
39
- value: "js",
40
- label: "JavaScript",
41
- hint: "Vanilla JS configuration",
42
- },
43
- ],
44
- }),
45
- },
46
- {
47
- onCancel: () => {
48
- p.cancel("Scaffolding cancelled. See you next time!");
49
- process.exit(0);
50
- },
51
- },
52
- );
53
-
54
- // Define local source paths (inside this CLI package folder)
55
- const templateFolderName =
56
- project.language === "ts" ? "next-mui-template-ts" : "next-mui-template-js";
57
- const sourceTemplateDir = path.resolve(__dirname, "..", templateFolderName);
58
-
59
- // Define destination paths (where the user is running the command)
60
- const targetProjectDir = path.resolve(process.cwd(), project.name);
61
-
62
- const s = p.spinner();
63
- s.start("Unboxing your Next.js + MUI foundation locally...");
64
-
65
- try {
66
- // Native high-speed recursive copy
67
- await fs.cp(sourceTemplateDir, targetProjectDir, {
68
- recursive: true,
69
- filter: (src) => !src.includes("node_modules") && !src.includes(".next"),
70
- });
71
-
72
- s.stop(color.green("Workspace scaffolded successfully!"));
73
- } catch (error) {
74
- s.stop(color.red("Failed to build workspace structure."));
75
- p.note(color.yellow(`Error details: ${error.message}`), "Troubleshooting:");
76
- process.exit(1);
77
- }
78
-
79
- // Clear instructions for the developer
80
- p.note(
81
- `${color.cyan(`cd ${project.name}`)}\n${color.cyan("npm install")}\n${color.cyan("npm run dev")}`,
82
- "Next Steps to Get Started:",
83
- );
84
-
85
- p.outro(`✨ Code cleanly, sort perfectly. Built with create-next-mui!`);
86
- }
87
-
88
- main().catch(console.error);
1
+ #!/usr/bin/env node
2
+
3
+ import * as p from "@clack/prompts";
4
+ import color from "picocolors";
5
+ import fs from "node:fs/promises";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ // Resolve the directory where this CLI package actually lives on the user's system
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+
13
+ async function main() {
14
+ console.clear();
15
+ p.intro(color.bgBlue(color.white(" create-next-mui ")));
16
+
17
+ const project = await p.group(
18
+ {
19
+ name: () =>
20
+ p.text({
21
+ message: "What is your project name?",
22
+ placeholder: "my-next-mui-app",
23
+ validate(value) {
24
+ if (value.length === 0) return "Project name is required!";
25
+ if (value.match(/[^a-zA-Z0-9-_]/g))
26
+ return "Keep it URL safe (no spaces or special chars)";
27
+ },
28
+ }),
29
+ language: () =>
30
+ p.select({
31
+ message: "Choose your language flavor:",
32
+ options: [
33
+ {
34
+ value: "ts",
35
+ label: "TypeScript (Recommended)",
36
+ hint: "Strict typings, clean architecture",
37
+ },
38
+ {
39
+ value: "js",
40
+ label: "JavaScript",
41
+ hint: "Vanilla JS configuration",
42
+ },
43
+ ],
44
+ }),
45
+ },
46
+ {
47
+ onCancel: () => {
48
+ p.cancel("Scaffolding cancelled. See you next time!");
49
+ process.exit(0);
50
+ },
51
+ },
52
+ );
53
+
54
+ // Define local source paths (inside this CLI package folder)
55
+ const templateFolderName =
56
+ project.language === "ts" ? "next-mui-template-ts" : "next-mui-template-js";
57
+ const sourceTemplateDir = path.resolve(__dirname, "..", templateFolderName);
58
+
59
+ // Define destination paths (where the user is running the command)
60
+ const targetProjectDir = path.resolve(process.cwd(), project.name);
61
+
62
+ const s = p.spinner();
63
+ s.start("Unboxing your Next.js + MUI foundation locally...");
64
+
65
+ try {
66
+ // Native high-speed recursive copy
67
+ await fs.cp(sourceTemplateDir, targetProjectDir, {
68
+ recursive: true,
69
+ filter: (src) => !src.includes("node_modules") && !src.includes(".next"),
70
+ });
71
+
72
+ s.stop(color.green("Workspace scaffolded successfully!"));
73
+ } catch (error) {
74
+ s.stop(color.red("Failed to build workspace structure."));
75
+ p.note(color.yellow(`Error details: ${error.message}`), "Troubleshooting:");
76
+ process.exit(1);
77
+ }
78
+
79
+ // Clear instructions for the developer
80
+ p.note(
81
+ `${color.cyan(`cd ${project.name}`)}\n${color.cyan("npm install")}\n${color.cyan("npm run dev")}`,
82
+ "Next Steps to Get Started:",
83
+ );
84
+
85
+ p.outro(`✨ Code cleanly, sort perfectly. Built with create-next-mui!`);
86
+ }
87
+
88
+ main().catch(console.error);