nsbp-cli 0.2.20 → 0.2.21

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
@@ -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.20`
150
+ - **Version**: `0.2.21`
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsbp-cli",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "CLI tool for creating NSBP (Node React SSR by Webpack) projects",
5
5
  "main": "index.js",
6
6
  "homepage": "https://nsbp.erishen.cn/",
@@ -4,7 +4,7 @@ import Loading from './Loading'
4
4
 
5
5
  const Layout = ({ children, query }: any) => {
6
6
  let seo: any = 0
7
- if (query) {
7
+ if (query !== undefined && query !== null) {
8
8
  seo = query.seo
9
9
  }
10
10
 
@@ -73,7 +73,7 @@ const Photo = ({ query, data, menu, getPhotoMenu }: any) => {
73
73
  if (!isSEO()) {
74
74
  doGetPhotoMenu()
75
75
  } else {
76
- if(from === 'link'){
76
+ if (from === 'link') {
77
77
  doGetPhotoMenu()
78
78
  }
79
79
  }
@@ -154,7 +154,7 @@ const mapStateToProps = (state: any) => {
154
154
  }
155
155
 
156
156
  const mapDispatchToProps = (dispatch: any) => ({
157
- getPhotoMenu(dic:any) {
157
+ getPhotoMenu: (dic: any) => {
158
158
  dispatch(loadData(null, dic))
159
159
  }
160
160
  })
@@ -2,15 +2,10 @@ import { GITHUB_ZEITNEXT_GET } from '../store/constants'
2
2
 
3
3
  export const homeReducer = (state = { data: {} }, action: any) => {
4
4
  const { type, data } = action
5
- let newState = null
6
5
 
7
6
  switch (type) {
8
7
  case GITHUB_ZEITNEXT_GET:
9
- newState = Object.assign({}, state)
10
-
11
- if (data) newState.data = data
12
-
13
- return newState
8
+ return { ...state, data: data !== undefined ? data : state.data }
14
9
  default:
15
10
  return state
16
11
  }
@@ -5,7 +5,7 @@ let prefix = 'http://localhost:3001'
5
5
  export const doGet = (action:any) => {
6
6
  return new Promise((resolve, reject) => {
7
7
 
8
- if(typeof window !== "undefined"){
8
+ if(typeof window !== "undefined") {
9
9
  prefix = window.location.origin
10
10
  }
11
11