create-nextjs-stack 0.1.2 → 0.1.5

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/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "create-nextjs-stack",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "CLI to scaffold Next.js Landing Page and Supabase Admin Panel",
5
5
  "private": false,
6
- "bin": "./bin/cli.js",
6
+ "bin": {
7
+ "create-nextjs-stack": "./bin/cli.js"
8
+ },
7
9
  "files": [
8
10
  "bin",
9
11
  "templates"
@@ -11,6 +13,7 @@
11
13
  "scripts": {
12
14
  "test": "vitest run"
13
15
  },
16
+ "preferGlobal": false,
14
17
  "dependencies": {
15
18
  "chalk": "^4.1.2",
16
19
  "commander": "^14.0.3",
@@ -40,9 +43,14 @@
40
43
  "url": "https://github.com/mburakaltiparmak/create-nextjs-stack/issues"
41
44
  },
42
45
  "devDependencies": {
46
+ "@reduxjs/toolkit": "^2.11.2",
43
47
  "@types/fs-extra": "^11.0.4",
44
48
  "@types/node": "^25.2.3",
49
+ "@types/redux-logger": "^3.0.13",
45
50
  "execa": "^9.6.1",
51
+ "react": "^19.2.4",
52
+ "react-redux": "^9.2.0",
53
+ "redux-logger": "^3.0.6",
46
54
  "vitest": "^4.0.18"
47
55
  }
48
56
  }
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
2
2
  import { Inter } from "next/font/google";
3
3
  import "./globals.css";
4
4
  import "react-toastify/dist/ReactToastify.css";
5
+ import StoreProvider from "@/lib/providers/StoreProvider";
5
6
 
6
7
  const inter = Inter({ subsets: ["latin"] });
7
8
 
@@ -17,7 +18,9 @@ export default function RootLayout({
17
18
  }>) {
18
19
  return (
19
20
  <html lang="en">
20
- <body className={inter.className}>{children}</body>
21
+ <body className={inter.className}>
22
+ <StoreProvider>{children}</StoreProvider>
23
+ </body>
21
24
  </html>
22
25
  );
23
26
  }
@@ -9,16 +9,19 @@
9
9
  "lint": "eslint"
10
10
  },
11
11
  "dependencies": {
12
+ "@reduxjs/toolkit": "^2.11.2",
12
13
  "@supabase/ssr": "^0.8.0",
13
14
  "@supabase/supabase-js": "^2.94.1",
14
15
  "cloudinary": "^2.9.0",
15
16
  "clsx": "^2.1.1",
16
17
  "lucide-react": "^0.563.0",
17
- "next": "16.1.6",
18
- "react": "19.2.3",
19
- "react-dom": "19.2.3",
18
+ "next": "^16.1.6",
19
+ "react": "^19.2.3",
20
+ "react-dom": "^19.2.3",
20
21
  "react-hook-form": "^7.71.1",
22
+ "react-redux": "^9.2.0",
21
23
  "react-toastify": "^11.0.3",
24
+ "redux-logger": "^3.0.6",
22
25
  "tailwind-merge": "^3.5.0"
23
26
  },
24
27
  "devDependencies": {
@@ -26,9 +29,10 @@
26
29
  "@types/node": "^20",
27
30
  "@types/react": "^19",
28
31
  "@types/react-dom": "^19",
32
+ "@types/redux-logger": "^3.0.13",
29
33
  "babel-plugin-react-compiler": "1.0.0",
30
34
  "eslint": "^9",
31
- "eslint-config-next": "16.1.6",
35
+ "eslint-config-next": "^16.1.6",
32
36
  "tailwindcss": "^4",
33
37
  "typescript": "^5"
34
38
  }
@@ -0,0 +1,12 @@
1
+ "use client";
2
+
3
+ import { Provider } from "react-redux";
4
+ import store from "@/store";
5
+
6
+ export default function StoreProvider({
7
+ children,
8
+ }: {
9
+ children: React.ReactNode;
10
+ }) {
11
+ return <Provider store={store}>{children}</Provider>;
12
+ }
@@ -0,0 +1,2 @@
1
+ // Export actions here
2
+ // export * from './exampleActions';
@@ -0,0 +1,11 @@
1
+ import { useDispatch, useSelector } from 'react-redux';
2
+ import type { AppDispatch, RootState } from '.';
3
+
4
+ /**
5
+ * Typed hook wrappers — use these instead of plain useDispatch/useSelector.
6
+ * @example const dispatch = useAppDispatch();
7
+ * @example const value = useAppSelector((state) => state.someSlice.value);
8
+ */
9
+ export const useAppDispatch = () => useDispatch<AppDispatch>();
10
+ export const useAppSelector = <T>(selector: (state: RootState) => T): T =>
11
+ useSelector(selector);
@@ -0,0 +1,17 @@
1
+ import { configureStore } from '@reduxjs/toolkit';
2
+ import logger from 'redux-logger';
3
+ import rootReducer from './reducers';
4
+
5
+ const store = configureStore({
6
+ reducer: rootReducer,
7
+ middleware: (getDefaultMiddleware) =>
8
+ process.env.NODE_ENV !== 'production'
9
+ ? getDefaultMiddleware().concat(logger)
10
+ : getDefaultMiddleware(),
11
+ });
12
+
13
+ // Inferred types — export and use via store/hooks.ts
14
+ export type RootState = ReturnType<typeof store.getState>;
15
+ export type AppDispatch = typeof store.dispatch;
16
+
17
+ export default store;
@@ -0,0 +1,11 @@
1
+ import { combineReducers } from '@reduxjs/toolkit';
2
+ // Import your reducers here
3
+ // import exampleReducer from './exampleReducer';
4
+
5
+ const rootReducer = combineReducers({
6
+ // example: exampleReducer,
7
+ // Add a placeholder to prevent error if no reducers yet
8
+ _placeholder: (state = {}) => state,
9
+ });
10
+
11
+ export default rootReducer;
@@ -0,0 +1,2 @@
1
+ // Define global types for specific actions if needed
2
+ // export const EXAMPLE_ACTION = 'EXAMPLE_ACTION';
@@ -19,7 +19,7 @@
19
19
  }
20
20
  ],
21
21
  "paths": {
22
- "@/*": ["./*"]
22
+ "@/*": ["./src/*"]
23
23
  }
24
24
  },
25
25
  "include": [
@@ -26,6 +26,7 @@
26
26
  "react-hook-form": "^7.70.0",
27
27
  "react-icons": "^5.5.0",
28
28
  "react-redux": "^9.2.0",
29
+ "redux-logger": "^3.0.6",
29
30
  "react-toastify": "^11.0.5",
30
31
  "resend": "^6.6.0",
31
32
  "zod": "^4.3.5"
@@ -36,10 +37,9 @@
36
37
  "@types/node": "^20",
37
38
  "@types/react": "^19",
38
39
  "@types/react-dom": "^19",
39
- "@types/react-redux": "^7.1.34",
40
40
  "@types/redux-logger": "^3.0.13",
41
41
  "eslint": "^9",
42
- "eslint-config-next": "15.5.9",
42
+ "eslint-config-next": "^16.1.6",
43
43
  "tailwindcss": "^4",
44
44
  "tw-animate-css": "^1.4.0",
45
45
  "typescript": "^5"
@@ -0,0 +1,11 @@
1
+ import { useDispatch, useSelector } from 'react-redux';
2
+ import type { AppDispatch, RootState } from '.';
3
+
4
+ /**
5
+ * Typed hook wrappers — use these instead of plain useDispatch/useSelector.
6
+ * @example const dispatch = useAppDispatch();
7
+ * @example const value = useAppSelector((state) => state.someSlice.value);
8
+ */
9
+ export const useAppDispatch = () => useDispatch<AppDispatch>();
10
+ export const useAppSelector = <T>(selector: (state: RootState) => T): T =>
11
+ useSelector(selector);
@@ -1,8 +1,17 @@
1
1
  import { configureStore } from '@reduxjs/toolkit';
2
+ import logger from 'redux-logger';
2
3
  import rootReducer from './reducers';
3
4
 
4
5
  const store = configureStore({
5
6
  reducer: rootReducer,
7
+ middleware: (getDefaultMiddleware) =>
8
+ process.env.NODE_ENV !== 'production'
9
+ ? getDefaultMiddleware().concat(logger)
10
+ : getDefaultMiddleware(),
6
11
  });
7
12
 
13
+ // Inferred types — export and use via store/hooks.ts
14
+ export type RootState = ReturnType<typeof store.getState>;
15
+ export type AppDispatch = typeof store.dispatch;
16
+
8
17
  export default store;
@@ -1,4 +1,4 @@
1
- import { combineReducers } from 'redux';
1
+ import { combineReducers } from '@reduxjs/toolkit';
2
2
  // Import your reducers here
3
3
  // import exampleReducer from './exampleReducer';
4
4
 
@@ -8,6 +8,4 @@ const rootReducer = combineReducers({
8
8
  _placeholder: (state = {}) => state
9
9
  });
10
10
 
11
- export type RootState = ReturnType<typeof rootReducer>;
12
-
13
11
  export default rootReducer;