create-next-structure 1.0.0 → 1.0.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
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
2
3
|
# create-next-structure
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
Opinionated, industry-standard Next.js template focused on teaching a clear, maintainable folder structure so developers and teams can quickly learn, adopt, and maintain best practices. Easy to use and follow — includes Redux Toolkit, RTK Query, auth helpers, reusable UI components, and detailed documentation.
|
|
6
|
+
|
|
7
|
+
CLI tool to create a **Next.js + Redux Toolkit** project structure with auth, RTK Query, and a ready-to-use template.
|
|
5
8
|
|
|
6
9
|
## ✅ Features
|
|
7
10
|
|
package/bin/index.js
CHANGED
|
@@ -69,7 +69,14 @@ async function createProject() {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// copy template files to target dir
|
|
72
|
-
await fs.copy(templateDir, targetDir
|
|
72
|
+
await fs.copy(templateDir, targetDir, {
|
|
73
|
+
filter: (src) => {
|
|
74
|
+
const normalized = src.split(path.sep).join("/");
|
|
75
|
+
if (normalized.includes("/node_modules/")) return false;
|
|
76
|
+
if (normalized.includes("/.git/")) return false;
|
|
77
|
+
return true;
|
|
78
|
+
},
|
|
79
|
+
});
|
|
73
80
|
|
|
74
81
|
spinner.succeed("Project structure created successfully!");
|
|
75
82
|
console.log(
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-next-structure",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-next-structure": "bin/index.js"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"description": "
|
|
9
|
+
"description": "Opinionated, industry-standard Next.js template that makes it easy to create and maintain projects. Designed to teach a clear folder structure and coding patterns so teams and learners can follow best practices. Includes Redux Toolkit, RTK Query, auth helpers, reusable UI components, and example pages.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"nextjs",
|
|
12
12
|
"redux",
|
|
13
13
|
"rtk-query",
|
|
14
14
|
"template",
|
|
15
|
-
"
|
|
15
|
+
"create",
|
|
16
16
|
"cli",
|
|
17
17
|
"starter"
|
|
18
18
|
],
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Loading spinner component
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
const Loading = ({ message = "Loading..." }) => {
|
|
10
10
|
return (
|
|
11
11
|
<div className="loading-container">
|
|
12
12
|
<div className="spinner"></div>
|
|
@@ -14,3 +14,6 @@ export const Loading = ({ message = "Loading..." }) => {
|
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
export default Loading;
|
|
19
|
+
export { Loading };
|
package/templates/docs/README.md
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
# Template Guide (Docs)
|
|
2
2
|
|
|
3
|
-
This document explains how to use the **Next.js + Redux template** in the `templates/` folder. It focuses only on the template files and how to work with them.
|
|
3
|
+
This document explains how to use the **Next.js + Redux template** in the `templates/` folder. The template is intentionally opinionated: its primary goal is to teach and enforce an industry-standard, easy-to-follow folder structure so developers (and teams) can quickly understand, maintain, and scale the codebase. It focuses only on the template files and how to work with them.
|
|
4
4
|
|
|
5
5
|
## ✅ What this template includes
|
|
6
6
|
|
|
7
7
|
- Next.js App Router setup (`app/`)
|
|
8
8
|
- Redux Toolkit + RTK Query (`store/`)
|
|
9
9
|
- Auth helpers (`components/auth/` + `hooks/useAuth.js`)
|
|
10
|
+
|
|
11
|
+
This template includes Redux Toolkit and RTK Query for state and data fetching, auth helpers and HOCs for route protection, reusable UI components, and example pages to help you learn the patterns used throughout.
|
|
10
12
|
- Layout shell (`components/layout/`)
|
|
11
13
|
- Reusable UI primitives (`components/ui/`)
|
|
12
14
|
- Docs for API integration, architecture, and examples (`docs/`)
|
|
13
15
|
|
|
14
16
|
## 🚀 How to use the template
|
|
15
17
|
|
|
16
|
-
### 1) Copy or
|
|
18
|
+
### 1) Copy or create the template
|
|
17
19
|
|
|
18
20
|
- Use this folder as your project base, or copy its contents into a fresh Next.js project.
|
|
19
21
|
- The template already has `package.json`, `next.config.js`, and `jsconfig.json`.
|
|
@@ -126,3 +128,13 @@ templates/
|
|
|
126
128
|
- `app/layout.jsx` wraps the app in `ReduxProvider`
|
|
127
129
|
- Protected pages use `withAuth`
|
|
128
130
|
- You reference APIs via RTK Query hooks (not manual fetch)
|
|
131
|
+
|
|
132
|
+
## 🔄 Keep dependencies updated
|
|
133
|
+
|
|
134
|
+
Package versions change over time. To upgrade to the latest safe versions, run:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
npm run deps:update
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
This updates `package.json` and installs the latest versions available.
|
package/templates/package.json
CHANGED
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
"dev": "next dev",
|
|
8
8
|
"build": "next build",
|
|
9
9
|
"start": "next start",
|
|
10
|
-
"lint": "next lint"
|
|
10
|
+
"lint": "next lint",
|
|
11
|
+
"deps:update": "npx npm-check-updates -u && npm install"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
|
-
"next": "^
|
|
14
|
-
"react": "^
|
|
15
|
-
"react-dom": "^
|
|
16
|
-
"@reduxjs/toolkit": "^2.
|
|
17
|
-
"react-redux": "^9.0
|
|
14
|
+
"next": "^16.1.6",
|
|
15
|
+
"react": "^19.2.4",
|
|
16
|
+
"react-dom": "^19.2.4",
|
|
17
|
+
"@reduxjs/toolkit": "^2.11.2",
|
|
18
|
+
"react-redux": "^9.2.0"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"eslint": "^
|
|
21
|
-
"eslint-config-next": "^
|
|
21
|
+
"eslint": "^10.0.0",
|
|
22
|
+
"eslint-config-next": "^16.1.6"
|
|
22
23
|
}
|
|
23
24
|
}
|
|
@@ -96,13 +96,6 @@ const baseQueryWithReauth = async (args, api, extraOptions) => {
|
|
|
96
96
|
export const apiSlice = createApi({
|
|
97
97
|
reducerPath: "api",
|
|
98
98
|
baseQuery: baseQueryWithReauth,
|
|
99
|
-
tagTypes: ["User"
|
|
100
|
-
✓ Starting...
|
|
101
|
-
`destination` does not start with `/`, `http://`, or `https://` for route {"source":"/api/:path*","destination":"undefined/:path*"}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Error: Invalid rewrite found
|
|
105
|
-
|
|
106
|
-
coder-bird@root-bird:~/Desktop/next-template$ , "Auth"], // Add more tag types as needed
|
|
99
|
+
tagTypes: ["User", "Auth"], // Add more tag types as needed
|
|
107
100
|
endpoints: (builder) => ({}), // Endpoints will be injected from other files
|
|
108
101
|
});
|