nitro-web 0.0.12 → 0.0.13
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/_example/package.json +1 -0
- package/_example/tsconfig.json +6 -2
- package/package.json +4 -4
- package/readme.md +1 -1
- package/server/router.js +5 -0
- package/tsconfig.json +6 -1
package/_example/package.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"build": "NODE_ENV=production webpack --target=web",
|
|
10
10
|
"dev": "clear && npm run dev:lint --silent & npm run dev:server --silent & npm run dev:client --silent",
|
|
11
11
|
"dev:client": "webpack serve --progress --config ./webpack.config.js",
|
|
12
|
+
"dev:client-only": "isStatic=true npm run dev:client",
|
|
12
13
|
"dev:server": "nodemon ./server -q -w ./server/ -w ./components/ -e js",
|
|
13
14
|
"dev:lint": "eslint ./components ./server/",
|
|
14
15
|
"minor": "standard-version --release-as minor && git push staging",
|
package/_example/tsconfig.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"allowJs": true,
|
|
4
|
-
"checkJs": true,
|
|
5
4
|
"allowSyntheticDefaultImports": true,
|
|
6
5
|
"downlevelIteration": true,
|
|
7
6
|
"esModuleInterop": true,
|
|
@@ -27,5 +26,10 @@
|
|
|
27
26
|
"strict": true,
|
|
28
27
|
"target": "es6"
|
|
29
28
|
},
|
|
30
|
-
"include": [
|
|
29
|
+
"include": [
|
|
30
|
+
"client",
|
|
31
|
+
"components/**/*.tsx",
|
|
32
|
+
"components/**/*.ts",
|
|
33
|
+
"types"
|
|
34
|
+
]
|
|
31
35
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.13",
|
|
7
7
|
"main": "./client/index.ts",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"keywords": [
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"dev:client-only": "isStatic=true npm run dev:client -w example",
|
|
40
40
|
"dev:server": "npm run dev:server -w example",
|
|
41
41
|
"build": "isStatic=true npm run build -w example",
|
|
42
|
-
"major": "standard-version --release-as major && npm publish",
|
|
43
|
-
"minor": "standard-version --release-as minor && npm publish",
|
|
44
|
-
"patch": "standard-version --release-as patch && npm publish",
|
|
42
|
+
"major": "npm run types && standard-version --release-as major && npm publish",
|
|
43
|
+
"minor": "npm run types && standard-version --release-as minor && npm publish",
|
|
44
|
+
"patch": "npm run types && standard-version --release-as patch && npm publish",
|
|
45
45
|
"start": "npm run start -w example",
|
|
46
46
|
"types": "tsc util.js --declaration --declarationMap --allowJs --emitDeclarationOnly --jsx react-jsx --esModuleInterop --outDir types"
|
|
47
47
|
},
|
package/readme.md
CHANGED
|
@@ -11,7 +11,7 @@ npm i nitro-web
|
|
|
11
11
|
### Install
|
|
12
12
|
|
|
13
13
|
1. Copy ./_example into your project
|
|
14
|
-
2. In package.json, replace `"nitro-web": "file:.."` with `"nitro-web": "~0.0.
|
|
14
|
+
2. In package.json, replace `"nitro-web": "file:.."` with `"nitro-web": "~0.0.13"`
|
|
15
15
|
3. In package.json, replace `"../.eslintrc.json"` with `"./node_modules/nitro-web/.eslintrc.json"`
|
|
16
16
|
4. Run `npm i`
|
|
17
17
|
|
package/server/router.js
CHANGED
|
@@ -44,6 +44,11 @@ export async function setupRouter (config) {
|
|
|
44
44
|
let name = filepath.replace(/^.*[\\\/]|\.api\.js$/g, '') // eslint-disable-line
|
|
45
45
|
controllers[name] = file
|
|
46
46
|
|
|
47
|
+
if (!file) {
|
|
48
|
+
console.warn(`API warning: no default export found on file ${filepath}`)
|
|
49
|
+
continue
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
if (file.setup) file.setup(allMiddleware, config)
|
|
48
53
|
if (file.routes) {
|
|
49
54
|
util.each(file.routes, (_middleware, key) => {
|