generator-nitro 6.0.0-rc.1 → 6.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/generators/app/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const got = require('got');
|
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const fs = require('fs');
|
|
11
11
|
const childProcess = require('child_process');
|
|
12
|
+
const findGitRoot = require('find-git-root')
|
|
12
13
|
const glob = require('glob');
|
|
13
14
|
const _ = require('lodash');
|
|
14
15
|
|
|
@@ -30,6 +31,10 @@ module.exports = class extends Generator {
|
|
|
30
31
|
exporter: this.options.exporter,
|
|
31
32
|
};
|
|
32
33
|
|
|
34
|
+
this._git = {
|
|
35
|
+
root: false,
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
this.option('name', {
|
|
34
39
|
desc: 'the name of your app',
|
|
35
40
|
type: String,
|
|
@@ -91,7 +96,27 @@ module.exports = class extends Generator {
|
|
|
91
96
|
this._skipQuestions = this.options.skipQuestions;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
|
|
99
|
+
initializing() {
|
|
100
|
+
// find git root
|
|
101
|
+
try {
|
|
102
|
+
const dest = this.destinationPath();
|
|
103
|
+
const gitRoot = findGitRoot(dest).replace('.git', '');
|
|
104
|
+
let gitPath = false;
|
|
105
|
+
|
|
106
|
+
if (gitRoot) {
|
|
107
|
+
const relative = path.relative(dest, gitRoot);
|
|
108
|
+
if (relative) {
|
|
109
|
+
gitPath = `${relative.replace(/\\/g, '/')}/`;
|
|
110
|
+
} else {
|
|
111
|
+
gitPath = './';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this._git.root = gitPath;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
this.log(chalk.red(e.message));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
95
120
|
|
|
96
121
|
prompting() {
|
|
97
122
|
this.log(yosay(`Welcome to the awe-inspiring ${chalk.cyan('Nitro')} generator!`));
|
|
@@ -390,6 +415,9 @@ module.exports = class extends Generator {
|
|
|
390
415
|
name: this.options.name,
|
|
391
416
|
version: this._pkg.version,
|
|
392
417
|
options: this.options,
|
|
418
|
+
git: {
|
|
419
|
+
root: this._git.root,
|
|
420
|
+
}
|
|
393
421
|
};
|
|
394
422
|
|
|
395
423
|
files.forEach((file) => {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"nitro:update": "npm uninstall generator-nitro && npm install generator-nitro@latest --save-dev --save-exact && yo nitro",
|
|
21
21
|
"update-dependencies": "npm-check-updates -u",
|
|
22
22
|
"\n# MISC ------- ": "",
|
|
23
|
-
"postinstall": "cd
|
|
23
|
+
"postinstall": "<% if (git.root) { %>cd <%= git.root %> && husky install && <% } %><% if (options.themes) { %>npm rebuild node-sass && <% } %>env-linter<% if (git.root) { %> --hooksInstalled<% } %> --saveExact --dependenciesExactVersion --lts",
|
|
24
24
|
"\n# LINT/TEST ------- ": "",
|
|
25
25
|
"check-node-version": "check-node-version --print --package",
|
|
26
26
|
"cypress-test": "npm run build && cross-env PORT=8888 NITRO_MODE=test npm-run-all --parallel --race test:cypress:serve cypress-test:open",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"handlebars": "4.7.7",
|
|
91
91
|
"jquery": "3.6.0",
|
|
92
92
|
"lazysizes": "5.3.2",
|
|
93
|
-
"lottie-web": "5.
|
|
93
|
+
"lottie-web": "5.8.1",
|
|
94
94
|
"prevent-window-opener-attacks": "0.3.0"<% } %><% if (options.jsCompiler === 'js') { %>,
|
|
95
95
|
"regenerator-runtime": "0.13.9"<% } %><% if (options.exampleCode) { %>,
|
|
96
96
|
"svg4everybody": "2.1.9"<% } %>
|
|
@@ -106,34 +106,34 @@
|
|
|
106
106
|
"@nitro/gulp": "<%= version %>",
|
|
107
107
|
"@nitro/webpack": "<%= version %>",<% if (options.jsCompiler === 'ts') { %>
|
|
108
108
|
"@types/bootstrap": "5.1.6",<% if (options.exampleCode ) { %>
|
|
109
|
-
"@types/jquery": "3.5.
|
|
109
|
+
"@types/jquery": "3.5.9",<% } %>
|
|
110
110
|
"@types/svg4everybody": "2.1.2",
|
|
111
111
|
"@types/webpack-env": "1.16.3",<% } %>
|
|
112
|
-
"backstopjs": "
|
|
112
|
+
"backstopjs": "6.0.1",
|
|
113
113
|
"check-node-version": "4.2.1",
|
|
114
114
|
"commitizen": "4.2.4",
|
|
115
115
|
"config": "3.3.6",
|
|
116
116
|
"cross-env": "7.0.3",
|
|
117
|
-
"cypress": "
|
|
117
|
+
"cypress": "9.1.0",
|
|
118
118
|
"cz-conventional-changelog": "3.3.0",
|
|
119
119
|
"env-linter": "0.5.1",
|
|
120
120
|
"eslint": "7.32.0",
|
|
121
|
-
"eslint-plugin-import": "2.25.
|
|
121
|
+
"eslint-plugin-import": "2.25.3",
|
|
122
122
|
"extend": "3.0.2",
|
|
123
123
|
"generator-nitro": "<%= version %>",
|
|
124
124
|
"gulp": "4.0.2",
|
|
125
125
|
"husky": "7.0.4",
|
|
126
126
|
"license-checker": "25.0.1",
|
|
127
|
-
"lighthouse": "
|
|
128
|
-
"lint-staged": "
|
|
127
|
+
"lighthouse": "9.1.0",
|
|
128
|
+
"lint-staged": "12.1.2",<% if (options.themes) { %>
|
|
129
129
|
"node-sass": "6.0.1",<% } %>
|
|
130
|
-
"npm-check-updates": "12.0.
|
|
130
|
+
"npm-check-updates": "12.0.2",
|
|
131
131
|
"npm-run-all": "4.1.5",
|
|
132
132
|
"opener": "1.5.2",
|
|
133
133
|
"prettier": "2.4.1",
|
|
134
134
|
"rimraf": "3.0.2",
|
|
135
135
|
"stylelint": "13.13.1",<% if (options.jsCompiler === 'ts') { %>
|
|
136
|
-
"typescript": "4.
|
|
136
|
+
"typescript": "4.5.2",<% } %>
|
|
137
137
|
"webpack-cli": "4.9.1",
|
|
138
138
|
"yo": "4.3.0"
|
|
139
139
|
},
|
|
@@ -22,8 +22,8 @@ Nitro is simple, fast and flexible. Use this app for all your frontend work.
|
|
|
22
22
|
This application was created by the yeoman generator for nitro.
|
|
23
23
|
Before using, you need of course [node](https://nodejs.org/) installed.
|
|
24
24
|
Nitro is always tested with the current
|
|
25
|
-
["Active LTS"
|
|
26
|
-
and at the moment also with the LTS maintenance versions (release
|
|
25
|
+
["Active LTS" version of node.js](https://github.com/nodejs/Release#release-schedule) (release 16.x)
|
|
26
|
+
and at the moment also with the LTS maintenance versions (release 12.x and 14.x).
|
|
27
27
|
|
|
28
28
|
Install the project dependencies in the project root:
|
|
29
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-nitro",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Yeoman generator for the nitro frontend framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "merkle-open/generator-nitro",
|
|
@@ -35,9 +35,10 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"chalk": "4.1.2",
|
|
37
37
|
"config": "3.3.6",
|
|
38
|
+
"find-git-root": "1.0.4",
|
|
38
39
|
"git-config": "0.0.7",
|
|
39
40
|
"glob": "7.2.0",
|
|
40
|
-
"got": "11.8.
|
|
41
|
+
"got": "11.8.3",
|
|
41
42
|
"lodash": "4.17.21",
|
|
42
43
|
"yeoman-generator": "5.4.2",
|
|
43
44
|
"yosay": "2.0.2"
|
package/readme.md
CHANGED
|
@@ -17,11 +17,13 @@ Nitro is simple, fast and flexible. It works on macOS, Windows and Linux. Use th
|
|
|
17
17
|
|
|
18
18
|
Before using, you need of course [node](https://nodejs.org/) installed.
|
|
19
19
|
Nitro and the Nitro generator are always tested with the current
|
|
20
|
-
["Active LTS"
|
|
21
|
-
and at the moment also with the LTS maintenance versions (release
|
|
20
|
+
["Active LTS" version of node.js](https://github.com/nodejs/Release#release-schedule) (release 16.x)
|
|
21
|
+
and at the moment also with the LTS maintenance versions (release 12.x and 14.x).
|
|
22
22
|
|
|
23
23
|
### Create a new project
|
|
24
24
|
|
|
25
|
+
Make sure you are in an existing git repo, or create one with `git init`.
|
|
26
|
+
|
|
25
27
|
This creates a new project in the current directory
|
|
26
28
|
using [npx](https://www.npmjs.com/package/npx) (npm >= 5.2):
|
|
27
29
|
|