nextia 3.0.2 → 4.0.0
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 +2 -7
- package/create-nextia/LICENSE +21 -0
- package/create-nextia/README.md +17 -0
- package/create-nextia/package.json +38 -0
- package/{src → create-nextia/src}/bin.js +76 -22
- package/create-nextia/templates/nextjs/README.md +34 -0
- package/create-nextia/templates/nextjs/_env.development +4 -0
- package/create-nextia/templates/nextjs/_env.production +3 -0
- package/create-nextia/templates/nextjs/_env.test +3 -0
- package/create-nextia/templates/nextjs/_gitignore +9 -0
- package/create-nextia/templates/nextjs/jsconfig.json +5 -0
- package/create-nextia/templates/nextjs/next.config.js +18 -0
- package/create-nextia/templates/nextjs/package.json +39 -0
- package/create-nextia/templates/nextjs/public/logo.svg +865 -0
- package/create-nextia/templates/nextjs/src/app/counter/functions.js +6 -0
- package/create-nextia/templates/nextjs/src/app/counter/page.js +42 -0
- package/create-nextia/templates/nextjs/src/app/counter/style.css +2 -0
- package/create-nextia/templates/nextjs/src/app/env/functions.js +4 -0
- package/create-nextia/templates/nextjs/src/app/env/page.js +24 -0
- package/create-nextia/templates/nextjs/src/app/env/style.css +1 -0
- package/create-nextia/templates/nextjs/src/app/functions.js +33 -0
- package/create-nextia/templates/nextjs/src/app/home/functions.js +43 -0
- package/create-nextia/templates/nextjs/src/app/home/page.js +184 -0
- package/create-nextia/templates/nextjs/src/app/home/style.css +51 -0
- package/create-nextia/templates/nextjs/src/app/images/functions.js +4 -0
- package/create-nextia/templates/nextjs/src/app/images/page.jsx +26 -0
- package/create-nextia/templates/nextjs/src/app/images/style.css +10 -0
- package/create-nextia/templates/nextjs/src/app/layout.js +109 -0
- package/create-nextia/templates/nextjs/src/app/media-query/functions.js +4 -0
- package/create-nextia/templates/nextjs/src/app/media-query/page.js +33 -0
- package/create-nextia/templates/nextjs/src/app/media-query/style.css +38 -0
- package/create-nextia/templates/nextjs/src/app/mockapi/functions.js +71 -0
- package/create-nextia/templates/nextjs/src/app/mockapi/page.js +95 -0
- package/create-nextia/templates/nextjs/src/app/mockapi/style.css +57 -0
- package/create-nextia/templates/nextjs/src/app/my-context/functions.js +11 -0
- package/create-nextia/templates/nextjs/src/app/my-context/page.js +27 -0
- package/create-nextia/templates/nextjs/src/app/my-context/style.css +1 -0
- package/create-nextia/templates/nextjs/src/app/not-found.js +7 -0
- package/create-nextia/templates/nextjs/src/app/page.js +3 -0
- package/create-nextia/templates/nextjs/src/app/search-params/functions.js +4 -0
- package/create-nextia/templates/nextjs/src/app/search-params/page.js +49 -0
- package/create-nextia/templates/nextjs/src/app/search-params/style.css +1 -0
- package/create-nextia/templates/nextjs/src/app/subpage/hello/functions.js +4 -0
- package/create-nextia/templates/nextjs/src/app/subpage/hello/page.js +16 -0
- package/create-nextia/templates/nextjs/src/app/subpage/hello/style.css +1 -0
- package/create-nextia/templates/nextjs/src/app/translate/functions.js +4 -0
- package/create-nextia/templates/nextjs/src/app/translate/page.js +35 -0
- package/create-nextia/templates/nextjs/src/app/translate/style.css +1 -0
- package/create-nextia/templates/nextjs/src/assets/fonts/Roboto-Regular.ttf +0 -0
- package/create-nextia/templates/nextjs/src/assets/i18n/index.js +26 -0
- package/create-nextia/templates/nextjs/src/assets/icon/icons.svg +498 -0
- package/create-nextia/templates/nextjs/src/assets/img/image.jpg +0 -0
- package/create-nextia/templates/nextjs/src/assets/theme/animations.css +89 -0
- package/create-nextia/templates/nextjs/src/assets/theme/index.css +38 -0
- package/create-nextia/templates/nextjs/src/assets/theme/util.css +71 -0
- package/create-nextia/templates/nextjs/src/components/Counter/index.js +37 -0
- package/create-nextia/templates/nextjs/src/components/Counter/style.css +5 -0
- package/create-nextia/templates/nextjs/src/components/Icon/index.jsx +55 -0
- package/create-nextia/templates/nextjs/src/components/Link/index.jsx +10 -0
- package/create-nextia/templates/nextjs/src/components/Translation/index.jsx +12 -0
- package/create-nextia/templates/nextjs/src/components/Translation/style.css +1 -0
- package/create-nextia/templates/nextjs/src/components/index.js +6 -0
- package/create-nextia/templates/nextjs/src/containers/I18n/index.jsx +23 -0
- package/create-nextia/templates/nextjs/src/containers/Translate/index.jsx +30 -0
- package/create-nextia/templates/nextjs/src/containers/Translate/style.css +2 -0
- package/create-nextia/templates/nextjs/src/containers/index.js +7 -0
- package/create-nextia/templates/nextjs/src/services/api.js +10 -0
- package/create-nextia/templates/nextjs/src/services/http.js +135 -0
- package/create-nextia/templates/nextjs/src/utils/hooks.js +26 -0
- package/create-nextia/templates/nextjs/src/utils/index.js +21 -0
- package/create-nextia/templates/nextjs/vitest.config.js +38 -0
- package/create-nextia/templates/vitejs/README.md +33 -0
- package/create-nextia/templates/vitejs/_env.development +4 -0
- package/create-nextia/templates/vitejs/_env.production +2 -0
- package/create-nextia/templates/vitejs/_env.test +2 -0
- package/create-nextia/templates/vitejs/_gitignore +6 -0
- package/create-nextia/templates/vitejs/package.json +39 -0
- package/create-nextia/templates/vitejs/public/error.html +14 -0
- package/create-nextia/templates/vitejs/public/logo.svg +865 -0
- package/create-nextia/templates/vitejs/src/assets/fonts/Roboto-Regular.ttf +0 -0
- package/create-nextia/templates/vitejs/src/assets/i18n/index.js +26 -0
- package/create-nextia/templates/vitejs/src/assets/icon/icons.svg +498 -0
- package/create-nextia/templates/vitejs/src/assets/img/image.jpg +0 -0
- package/create-nextia/templates/vitejs/src/assets/theme/animations.css +89 -0
- package/create-nextia/templates/vitejs/src/assets/theme/index.css +38 -0
- package/create-nextia/templates/vitejs/src/assets/theme/util.css +71 -0
- package/create-nextia/templates/vitejs/src/components/Counter/index.jsx +38 -0
- package/create-nextia/templates/vitejs/src/components/Counter/style.css +5 -0
- package/create-nextia/templates/vitejs/src/components/Icon/index.jsx +51 -0
- package/create-nextia/templates/vitejs/src/components/Link/index.jsx +12 -0
- package/create-nextia/templates/vitejs/src/components/Translation/index.jsx +12 -0
- package/create-nextia/templates/vitejs/src/components/Translation/style.css +1 -0
- package/create-nextia/templates/vitejs/src/components/index.js +6 -0
- package/create-nextia/templates/vitejs/src/containers/I18n/index.jsx +23 -0
- package/create-nextia/templates/vitejs/src/containers/Translate/index.jsx +30 -0
- package/create-nextia/templates/vitejs/src/containers/Translate/style.css +2 -0
- package/create-nextia/templates/vitejs/src/containers/index.js +7 -0
- package/create-nextia/templates/vitejs/src/index.html +18 -0
- package/create-nextia/templates/vitejs/src/index.jsx +9 -0
- package/create-nextia/templates/vitejs/src/pages/counter/functions.js +6 -0
- package/create-nextia/templates/vitejs/src/pages/counter/index.jsx +39 -0
- package/create-nextia/templates/vitejs/src/pages/counter/style.css +1 -0
- package/create-nextia/templates/vitejs/src/pages/env/functions.js +4 -0
- package/create-nextia/templates/vitejs/src/pages/env/index.jsx +28 -0
- package/create-nextia/templates/vitejs/src/pages/env/style.css +1 -0
- package/create-nextia/templates/vitejs/src/pages/functions.js +27 -0
- package/create-nextia/templates/vitejs/src/pages/home/functions.js +43 -0
- package/create-nextia/templates/vitejs/src/pages/home/index.jsx +182 -0
- package/create-nextia/templates/vitejs/src/pages/home/style.css +51 -0
- package/create-nextia/templates/vitejs/src/pages/http/not-found/index.jsx +17 -0
- package/create-nextia/templates/vitejs/src/pages/http/not-found/style.css +1 -0
- package/create-nextia/templates/vitejs/src/pages/images/functions.js +4 -0
- package/create-nextia/templates/vitejs/src/pages/images/index.jsx +23 -0
- package/create-nextia/templates/vitejs/src/pages/images/style.css +9 -0
- package/create-nextia/templates/vitejs/src/pages/index.jsx +104 -0
- package/create-nextia/templates/vitejs/src/pages/media-query/functions.js +4 -0
- package/create-nextia/templates/vitejs/src/pages/media-query/index.jsx +30 -0
- package/create-nextia/templates/vitejs/src/pages/media-query/style.css +38 -0
- package/create-nextia/templates/vitejs/src/pages/mockapi/functions.js +71 -0
- package/create-nextia/templates/vitejs/src/pages/mockapi/index.jsx +98 -0
- package/create-nextia/templates/vitejs/src/pages/mockapi/style.css +57 -0
- package/create-nextia/templates/vitejs/src/pages/my-context/functions.js +8 -0
- package/create-nextia/templates/vitejs/src/pages/my-context/index.jsx +27 -0
- package/create-nextia/templates/vitejs/src/pages/my-context/style.css +1 -0
- package/create-nextia/templates/vitejs/src/pages/search-params/functions.js +4 -0
- package/create-nextia/templates/vitejs/src/pages/search-params/index.jsx +42 -0
- package/create-nextia/templates/vitejs/src/pages/search-params/style.css +1 -0
- package/create-nextia/templates/vitejs/src/pages/subpage/hello/functions.js +3 -0
- package/create-nextia/templates/vitejs/src/pages/subpage/hello/index.jsx +14 -0
- package/create-nextia/templates/vitejs/src/pages/subpage/hello/style.css +1 -0
- package/create-nextia/templates/vitejs/src/pages/translate/functions.js +5 -0
- package/create-nextia/templates/vitejs/src/pages/translate/index.jsx +32 -0
- package/create-nextia/templates/vitejs/src/pages/translate/style.css +12 -0
- package/create-nextia/templates/vitejs/src/services/api.js +9 -0
- package/create-nextia/templates/vitejs/src/services/http.js +135 -0
- package/create-nextia/templates/vitejs/src/utils/hooks.js +44 -0
- package/create-nextia/templates/vitejs/src/utils/index.js +25 -0
- package/create-nextia/templates/vitejs/vite.config.js +100 -0
- package/package.json +3 -8
package/README.md
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sinuhe Maceda https://sinuhe.dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# create-nextia
|
|
2
|
+
|
|
3
|
+
## nextia command
|
|
4
|
+
|
|
5
|
+
# Go to test
|
|
6
|
+
```sh
|
|
7
|
+
npm i
|
|
8
|
+
npm run test:my-app
|
|
9
|
+
node --run test:my-app
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## create project
|
|
13
|
+
```sh
|
|
14
|
+
npm create nextia@latest my-app
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
[npm](https://www.npmjs.com/package/create-nextia)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-nextia",
|
|
3
|
+
"description": "nextia command",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">22"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Sinuhe Maceda",
|
|
12
|
+
"email": "sinuhe.dev@gmail.com",
|
|
13
|
+
"url": "https://sinuhe.dev"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/sinuhedev/nextia.git",
|
|
18
|
+
"directory": "create-nextia"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/sinuhedev/nextia/create-nextia#readme",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"react"
|
|
23
|
+
],
|
|
24
|
+
"bin": {
|
|
25
|
+
"create-nextia": "src/bin.js"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"start": "node src/bin.js ",
|
|
29
|
+
"clean": "rm -fr node_modules package-lock.json && [ -d 'my-app' ] && rm -r 'my-app'",
|
|
30
|
+
"make": "npm run clean && npm install",
|
|
31
|
+
"lint": "standard src",
|
|
32
|
+
"test:my-app": " [ -d 'my-app' ] && rm -r 'my-app' ; node src/bin.js ",
|
|
33
|
+
"test:page": "cd my-app ; node ../src/bin.js page my-page",
|
|
34
|
+
"test:component": "cd my-app ; node ../src/bin.js component MyComponent",
|
|
35
|
+
"test:container": "cd my-app ; node ../src/bin.js container MyContainer",
|
|
36
|
+
"test:next:page": "cd my-app ; node ../src/bin.js next:page my-page"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
|
-
* https://github.com/sinuhedev/nextia
|
|
9
|
+
* https://github.com/sinuhedev/nextia/create-nextia
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { fileURLToPath } from 'node:url'
|
|
13
|
+
import { dirname } from 'node:path'
|
|
14
|
+
import { mkdir, writeFile, readFile, cp, rename, access } from 'node:fs/promises'
|
|
15
|
+
import readline from 'node:readline/promises'
|
|
16
|
+
import { stdin as input, stdout as output } from 'node:process'
|
|
13
17
|
|
|
14
|
-
async function createPage (name, isNext
|
|
18
|
+
async function createPage (name, isNext) {
|
|
15
19
|
const toPascalCase = str => str
|
|
16
20
|
.toLowerCase()
|
|
17
21
|
.replace(/[^a-zA-Z0-9 ]/g, ' ') // replace special characters
|
|
@@ -72,7 +76,7 @@ export default { initialState }
|
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
async function createComponent (name
|
|
79
|
+
async function createComponent (name) {
|
|
76
80
|
const dirName = `./src/components/${name}`
|
|
77
81
|
|
|
78
82
|
try {
|
|
@@ -104,7 +108,7 @@ export default function ${name} ({ className, style }) {
|
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
async function createContainer (name
|
|
111
|
+
async function createContainer (name) {
|
|
108
112
|
const dirName = `./src/containers/${name}`
|
|
109
113
|
|
|
110
114
|
try {
|
|
@@ -146,42 +150,92 @@ export default { initialState }
|
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
|
|
153
|
+
async function createProject () {
|
|
154
|
+
const rl = readline.createInterface({ input, output })
|
|
155
|
+
const templates = ['', 'vitejs', 'nextjs']
|
|
156
|
+
let projectName, projectPath, template
|
|
157
|
+
|
|
158
|
+
// inputs
|
|
159
|
+
try {
|
|
160
|
+
projectName = await rl.question('Project name: ')
|
|
161
|
+
template = await rl.question('1) vitejs \n2) nextjs \n: ')
|
|
162
|
+
} catch (err) {
|
|
163
|
+
if (err.name !== 'AbortError') {
|
|
164
|
+
console.error('Unexpected error:', err)
|
|
165
|
+
}
|
|
166
|
+
} finally {
|
|
167
|
+
rl.close()
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Is new project
|
|
171
|
+
try {
|
|
172
|
+
projectPath = process.cwd() + `/${projectName}/`
|
|
173
|
+
await access(projectPath)
|
|
174
|
+
console.error(`The "${projectName}" already exists.`)
|
|
175
|
+
return
|
|
176
|
+
} catch (error) {
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// templates
|
|
180
|
+
const num = Number(template)
|
|
181
|
+
if (!(Number.isInteger(num) && num >= 1 && num <= templates.length)) {
|
|
182
|
+
console.error('The template does not exist.')
|
|
183
|
+
return
|
|
184
|
+
}
|
|
185
|
+
template = dirname(fileURLToPath(import.meta.url)) + '/../templates/' + templates[template]
|
|
186
|
+
|
|
187
|
+
// Create new project
|
|
188
|
+
try {
|
|
189
|
+
const mv = fileName => rename(projectPath + `_${fileName}`, projectPath + `.${fileName}`)
|
|
190
|
+
await cp(template, projectPath, { recursive: true })
|
|
191
|
+
const replaceToken = async (filename, token, value) => {
|
|
192
|
+
const content = await readFile(projectPath + filename, 'utf8')
|
|
193
|
+
const updated = content.replaceAll(token, value)
|
|
194
|
+
await writeFile(projectPath + filename, updated, 'utf8')
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
await mv('env.development')
|
|
198
|
+
await mv('env.production')
|
|
199
|
+
await mv('env.test')
|
|
200
|
+
await mv('gitignore')
|
|
201
|
+
|
|
202
|
+
// replace tokens
|
|
203
|
+
await replaceToken('README.md', 'TEMPLATE', projectName)
|
|
204
|
+
await replaceToken('package.json', 'TEMPLATE', projectName)
|
|
205
|
+
} catch (err) {
|
|
206
|
+
console.error(err)
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
149
210
|
/**
|
|
150
211
|
* main
|
|
151
212
|
*/
|
|
152
213
|
|
|
153
214
|
const CMD = process.argv[2]
|
|
154
|
-
const PROJECT_NAME = process.argv[2]
|
|
155
215
|
const FILE_NAME = process.argv[3]
|
|
156
216
|
|
|
157
217
|
switch (CMD) {
|
|
158
218
|
case 'page':
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
case 'next:page:type':
|
|
162
|
-
if (FILE_NAME) {
|
|
163
|
-
createPage(
|
|
164
|
-
FILE_NAME,
|
|
165
|
-
['next:page', 'next:page:type'].includes(CMD),
|
|
166
|
-
['page:type', 'next:page:type'].includes(CMD))
|
|
167
|
-
} else console.warn('npm run page <page-name>')
|
|
219
|
+
if (FILE_NAME) createPage(FILE_NAME, false)
|
|
220
|
+
else console.warn('npm run page <page-name>')
|
|
168
221
|
break
|
|
169
222
|
|
|
170
223
|
case 'component':
|
|
171
|
-
|
|
172
|
-
if (FILE_NAME) createComponent(FILE_NAME, CMD === 'component:type')
|
|
224
|
+
if (FILE_NAME) createComponent(FILE_NAME)
|
|
173
225
|
else console.warn('npm run component <ComponentName>')
|
|
174
226
|
break
|
|
175
227
|
|
|
176
228
|
case 'container':
|
|
177
|
-
|
|
178
|
-
if (FILE_NAME) createContainer(FILE_NAME, CMD === 'component:type')
|
|
229
|
+
if (FILE_NAME) createContainer(FILE_NAME)
|
|
179
230
|
else console.warn('npm run container <ContainerName>')
|
|
180
231
|
break
|
|
181
232
|
|
|
233
|
+
case 'next:page':
|
|
234
|
+
if (FILE_NAME) createPage(FILE_NAME, true)
|
|
235
|
+
else console.warn('npm run next:page <page-name>')
|
|
236
|
+
break
|
|
237
|
+
|
|
182
238
|
default:
|
|
183
|
-
|
|
184
|
-
if (PROJECT_NAME) console.info(`Project name: ${PROJECT_NAME}`)
|
|
185
|
-
else console.warn('npx nextia@latest <my-app>')
|
|
239
|
+
createProject()
|
|
186
240
|
break
|
|
187
241
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# TEMPLATE
|
|
2
|
+
|
|
3
|
+
## To start
|
|
4
|
+
|
|
5
|
+
Open http://localhost:3000 to view it in the browser.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i
|
|
9
|
+
npm start
|
|
10
|
+
node --run start
|
|
11
|
+
#
|
|
12
|
+
npm test
|
|
13
|
+
npm run build <ENV>
|
|
14
|
+
npm run serve
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## env
|
|
18
|
+
|
|
19
|
+
```.env
|
|
20
|
+
.env # loaded in all cases
|
|
21
|
+
.env.[ENV] # only loaded in specified ENV [ development, test, production ]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
* .env.development
|
|
25
|
+
* .env.production
|
|
26
|
+
* .env.test
|
|
27
|
+
|
|
28
|
+
```env
|
|
29
|
+
NEXT_PUBLIC_LOGGER=true
|
|
30
|
+
NEXT_PUBLIC_TITLE=<ENV>-nextjs
|
|
31
|
+
#
|
|
32
|
+
API=https://65fd14fb9fc4425c653119c5.mockapi.io/api/v1
|
|
33
|
+
```
|
|
34
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import packageJson from './package.json' with { type: "json" }
|
|
2
|
+
import { execSync } from 'node:child_process'
|
|
3
|
+
|
|
4
|
+
let gitHash = ''
|
|
5
|
+
try {
|
|
6
|
+
gitHash = execSync('git rev-parse --short HEAD 2> /dev/null').toString()
|
|
7
|
+
} catch (e) { }
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
reactStrictMode: false,
|
|
11
|
+
devIndicators: false,
|
|
12
|
+
|
|
13
|
+
env: {
|
|
14
|
+
VERSION: packageJson.version,
|
|
15
|
+
GIT_HASH: gitHash
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TEMPLATE",
|
|
3
|
+
"description": "description",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": true,
|
|
7
|
+
"eslintConfig": {
|
|
8
|
+
"extends": "./node_modules/standard/eslintrc.json"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "NODE_OPTIONS='--inspect' next dev",
|
|
12
|
+
"start:turbopack": "NODE_OPTIONS='--inspect' next dev --turbopack",
|
|
13
|
+
"clean": "rm -fr package-lock.json node_modules .next .coverage .swc",
|
|
14
|
+
"make": "npm run clean && npm install",
|
|
15
|
+
"build": "next build",
|
|
16
|
+
"serve": "next start",
|
|
17
|
+
"lint": "standard 'src/**/*.{js,jsx}' 'test/**/*.{js,jsx}' --verbose",
|
|
18
|
+
"page": "npm create nextia@latest next:page",
|
|
19
|
+
"component": "npm create nextia@latest component",
|
|
20
|
+
"container": "npm create nextia@latest container",
|
|
21
|
+
"test": "vitest",
|
|
22
|
+
"test:name": "vitest --testNamePattern",
|
|
23
|
+
"test:silent": "vitest --silent",
|
|
24
|
+
"test:coverage": "vitest --coverage --silent"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
28
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
29
|
+
"jsdom": "^26.1.0",
|
|
30
|
+
"vitest": "^3.0.4",
|
|
31
|
+
"standard": "^17.1.2"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"next": "^15.4.6",
|
|
35
|
+
"nextia": "4.0.0",
|
|
36
|
+
"react": "^19.1.1",
|
|
37
|
+
"react-dom": "^19.1.1"
|
|
38
|
+
}
|
|
39
|
+
}
|