nsbp-cli 0.2.25 → 0.2.26
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 +1 -1
- package/package.json +1 -1
- package/templates/basic/config/webpack.base.js +15 -1
- package/templates/basic/gitignore +0 -3
- package/templates/basic/src/Routers.tsx +5 -5
- package/templates/basic/src/client/index.tsx +4 -4
- package/templates/basic/src/component/Header.tsx +1 -1
- package/templates/basic/src/server/index.ts +3 -3
- package/templates/basic/tsconfig.json +16 -1
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ node ./bin/nsbp.js --help # Test CLI locally
|
|
|
147
147
|
|
|
148
148
|
- **Package Name**: `nsbp-cli`
|
|
149
149
|
- **Bin Command**: `nsbp` (install globally and run `nsbp --help`)
|
|
150
|
-
- **Version**: `0.2.
|
|
150
|
+
- **Version**: `0.2.26`
|
|
151
151
|
- **Dependencies**: chalk, commander, fs-extra, inquirer
|
|
152
152
|
- **Package Manager**: Uses pnpm (also compatible with npm)
|
|
153
153
|
- **Node Version**: >=16.0.0
|
package/package.json
CHANGED
|
@@ -17,7 +17,21 @@ module.exports = ({ mode, entry, server, init }) => {
|
|
|
17
17
|
entry,
|
|
18
18
|
devtool: 'source-map',
|
|
19
19
|
resolve: {
|
|
20
|
-
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json']
|
|
20
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
|
21
|
+
alias: {
|
|
22
|
+
'@': path.resolve(__dirname, '../src'),
|
|
23
|
+
'@components': path.resolve(__dirname, '../src/component'),
|
|
24
|
+
'@utils': path.resolve(__dirname, '../src/utils'),
|
|
25
|
+
'@services': path.resolve(__dirname, '../src/services'),
|
|
26
|
+
'@styled': path.resolve(__dirname, '../src/styled'),
|
|
27
|
+
'@store': path.resolve(__dirname, '../src/store'),
|
|
28
|
+
'@reducers': path.resolve(__dirname, '../src/reducers'),
|
|
29
|
+
'@containers': path.resolve(__dirname, '../src/containers'),
|
|
30
|
+
'@server': path.resolve(__dirname, '../src/server'),
|
|
31
|
+
'@client': path.resolve(__dirname, '../src/client'),
|
|
32
|
+
'@css': path.resolve(__dirname, '../src/css'),
|
|
33
|
+
'@externals': path.resolve(__dirname, '../src/externals')
|
|
34
|
+
}
|
|
21
35
|
},
|
|
22
36
|
module: {
|
|
23
37
|
rules: [
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { loadData as homeLoadData } from '
|
|
3
|
-
import { loadData as photoLoadData } from '
|
|
2
|
+
import { loadData as homeLoadData } from '@services/home'
|
|
3
|
+
import { loadData as photoLoadData } from '@services/photo'
|
|
4
4
|
import loadable from "@loadable/component"
|
|
5
5
|
|
|
6
6
|
const Loading = () => {
|
|
7
7
|
return <div>Loading...</div>
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const Home = loadable(() => import("
|
|
10
|
+
const Home = loadable(() => import("@containers/Home"), {
|
|
11
11
|
fallback: <Loading />
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
const Login = loadable(() => import("
|
|
14
|
+
const Login = loadable(() => import("@containers/Login"), {
|
|
15
15
|
fallback: <Loading />
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
const Photo = loadable(() => import("
|
|
18
|
+
const Photo = loadable(() => import("@containers/Photo"), {
|
|
19
19
|
fallback: <Loading />
|
|
20
20
|
})
|
|
21
21
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { hydrateRoot } from 'react-dom/client'
|
|
3
3
|
import { BrowserRouter, Routes, Route } from 'react-router-dom'
|
|
4
|
-
import routers from '
|
|
4
|
+
import routers from '@/Routers'
|
|
5
5
|
import { Provider } from 'react-redux'
|
|
6
|
-
import getStore from '
|
|
7
|
-
import { isSEO } from '
|
|
8
|
-
import Theme from '
|
|
6
|
+
import getStore from '@/store'
|
|
7
|
+
import { isSEO } from '@/utils'
|
|
8
|
+
import Theme from '@components/Theme'
|
|
9
9
|
import { loadableReady } from '@loadable/component'
|
|
10
10
|
|
|
11
11
|
const App = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Link, useLocation } from 'react-router-dom'
|
|
3
|
-
import { Container, LogoWrapper as Logo, Nav, NavLink, Brand } from '
|
|
3
|
+
import { Container, LogoWrapper as Logo, Nav, NavLink, Brand } from '@styled/component/header'
|
|
4
4
|
|
|
5
5
|
const Header = () => {
|
|
6
6
|
const location = useLocation()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import express from 'express'
|
|
2
2
|
import helmet from 'helmet'
|
|
3
3
|
import rateLimit from 'express-rate-limit'
|
|
4
|
-
import { render } from '
|
|
5
|
-
import { getPhotoWH, getPhotoMenu } from '
|
|
6
|
-
import { useCurrentFlag, outPhotoDicPath } from '
|
|
4
|
+
import { render } from '@server/utils'
|
|
5
|
+
import { getPhotoWH, getPhotoMenu } from '@server/photo'
|
|
6
|
+
import { useCurrentFlag, outPhotoDicPath } from '@utils/config'
|
|
7
7
|
|
|
8
8
|
const app = express()
|
|
9
9
|
|
|
@@ -13,7 +13,22 @@
|
|
|
13
13
|
"allowSyntheticDefaultImports": true,
|
|
14
14
|
"esModuleInterop": true,
|
|
15
15
|
"preserveConstEnums": true,
|
|
16
|
-
"skipLibCheck": true
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"baseUrl": ".",
|
|
18
|
+
"paths": {
|
|
19
|
+
"@/*": ["./src/*"],
|
|
20
|
+
"@components/*": ["./src/component/*"],
|
|
21
|
+
"@utils/*": ["./src/utils/*"],
|
|
22
|
+
"@services/*": ["./src/services/*"],
|
|
23
|
+
"@styled/*": ["./src/styled/*"],
|
|
24
|
+
"@store/*": ["./src/store/*"],
|
|
25
|
+
"@reducers/*": ["./src/reducers/*"],
|
|
26
|
+
"@containers/*": ["./src/containers/*"],
|
|
27
|
+
"@server/*": ["./src/server/*"],
|
|
28
|
+
"@client/*": ["./src/client/*"],
|
|
29
|
+
"@css/*": ["./src/css/*"],
|
|
30
|
+
"@externals/*": ["./src/externals/*"]
|
|
31
|
+
}
|
|
17
32
|
},
|
|
18
33
|
"include":[
|
|
19
34
|
"./src/**/*",
|