generator-nitro 7.0.8 → 7.1.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/generators/app/templates/.editorconfig +1 -1
- package/generators/app/templates/.eslintrc.js +2 -0
- package/generators/app/templates/.node-version +1 -1
- package/generators/app/templates/CUTAWAYpackage.json +12 -12
- package/generators/app/templates/project/docs/nitro.md +6 -0
- package/generators/app/templates/readme.md +6 -0
- package/generators/app/templates/src/patterns/atoms/lottie/js/lottie.ts +4 -4
- package/generators/app/templates/src/patterns/molecules/example/js/example.ts +24 -22
- package/generators/app/templates/src/shared/assets/img/icon/site.webmanifest +2 -2
- package/generators/app/templates/tests/backstop/backstop.config.js +8 -6
- package/generators/app/templates/tests/backstop/config/basic.js +2 -2
- package/generators/app/templates/tests/backstop/config/utils.js +44 -0
- package/package.json +2 -2
|
@@ -9,6 +9,8 @@ module.exports = {
|
|
|
9
9
|
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
|
|
10
10
|
'new-cap': [2, { capIsNew: false }],
|
|
11
11
|
'@typescript-eslint/member-ordering': 1,
|
|
12
|
+
// due to issues with outdated @typescript-eslint
|
|
13
|
+
'@typescript-eslint/no-unused-vars': 0,
|
|
12
14
|
},
|
|
13
15
|
parserOptions: {
|
|
14
16
|
project: './tsconfig.json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
16.
|
|
1
|
+
16.18.0
|
|
@@ -83,39 +83,39 @@
|
|
|
83
83
|
"dependencies": {<% if (options.exampleCode) { %>
|
|
84
84
|
"@gondel/core": "1.2.7",
|
|
85
85
|
"@gondel/plugin-hot": "1.2.7",
|
|
86
|
-
"bootstrap": "5.2.
|
|
87
|
-
"core-js": "3.25.
|
|
86
|
+
"bootstrap": "5.2.2",<% } %>
|
|
87
|
+
"core-js": "3.25.5"<% if (options.exampleCode) { %>,
|
|
88
88
|
"flatpickr": "4.6.13",
|
|
89
89
|
"handlebars": "4.7.7",
|
|
90
90
|
"jquery": "3.6.1",
|
|
91
91
|
"lazysizes": "5.3.2",
|
|
92
92
|
"lottie-web": "5.9.6",
|
|
93
93
|
"prevent-window-opener-attacks": "0.3.0"<% } %><% if (options.jsCompiler === 'js') { %>,
|
|
94
|
-
"regenerator-runtime": "0.13.
|
|
94
|
+
"regenerator-runtime": "0.13.10"<% } %><% if (options.exampleCode) { %>,
|
|
95
95
|
"svg4everybody": "2.1.9"<% } %>
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {<% if (options.jsCompiler === 'js') { %>
|
|
98
98
|
"@babel/eslint-parser": "7.19.1",<% } %>
|
|
99
99
|
"@khanacademy/tota11y": "0.2.0",
|
|
100
|
-
"@merkle-open/html-validate-config": "0.1.
|
|
100
|
+
"@merkle-open/html-validate-config": "0.1.1",
|
|
101
101
|
"@namics/eslint-config": "9.1.1",
|
|
102
|
-
"@namics/prettier-config": "
|
|
103
|
-
"@namics/stylelint-config": "
|
|
104
|
-
"@namics/ts-config": "
|
|
102
|
+
"@namics/prettier-config": "3.0.0",
|
|
103
|
+
"@namics/stylelint-config": "2.0.0",
|
|
104
|
+
"@namics/ts-config": "2.0.0",
|
|
105
105
|
"@nitro/app": "<%= version %>",
|
|
106
106
|
"@nitro/exporter": "<%= version %>",
|
|
107
107
|
"@nitro/gulp": "<%= version %>",
|
|
108
108
|
"@nitro/webpack": "<%= version %>",<% if (options.jsCompiler === 'ts') { %>
|
|
109
|
-
"@types/bootstrap": "5.2.
|
|
109
|
+
"@types/bootstrap": "5.2.5",<% if (options.exampleCode ) { %>
|
|
110
110
|
"@types/jquery": "3.5.14",<% } %>
|
|
111
111
|
"@types/svg4everybody": "2.1.2",
|
|
112
112
|
"@types/webpack-env": "1.18.0",<% } %>
|
|
113
|
-
"backstopjs": "6.1.
|
|
113
|
+
"backstopjs": "6.1.3",
|
|
114
114
|
"check-node-version": "4.2.1",
|
|
115
115
|
"commitizen": "4.2.5",
|
|
116
116
|
"config": "3.3.8",
|
|
117
117
|
"cross-env": "7.0.3",
|
|
118
|
-
"cypress": "10.
|
|
118
|
+
"cypress": "10.10.0",
|
|
119
119
|
"cz-conventional-changelog": "3.3.0",
|
|
120
120
|
"env-linter": "1.0.0",
|
|
121
121
|
"eslint": "7.32.0",
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
"lighthouse": "9.6.7",
|
|
129
129
|
"lint-staged": "13.0.3",<% if (options.themes) { %>
|
|
130
130
|
"node-sass": "6.0.1",<% } %>
|
|
131
|
-
"npm-check-updates": "16.3.
|
|
131
|
+
"npm-check-updates": "16.3.15",
|
|
132
132
|
"npm-run-all": "4.1.5",
|
|
133
133
|
"prettier": "2.7.1",
|
|
134
134
|
"rimraf": "3.0.2",
|
|
135
135
|
"stylelint": "13.13.1",<% if (options.jsCompiler === 'ts') { %>
|
|
136
|
-
"typescript": "4.
|
|
136
|
+
"typescript": "4.8.4",<% } %>
|
|
137
137
|
"webpack-cli": "4.10.0",
|
|
138
138
|
"yo": "4.3.0"
|
|
139
139
|
},
|
|
@@ -4,16 +4,16 @@ import { Component, EventListener, GondelBaseComponent } from '@gondel/core';
|
|
|
4
4
|
export class Lottie extends GondelBaseComponent {
|
|
5
5
|
private _animation: any;
|
|
6
6
|
|
|
7
|
+
public start() {
|
|
8
|
+
this._initializeAnimation();
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
@EventListener('click')
|
|
8
12
|
private _handleClick(): void {
|
|
9
13
|
const action = this._animation.isPaused ? 'play' : 'pause';
|
|
10
14
|
this._animation[action]();
|
|
11
15
|
}
|
|
12
16
|
|
|
13
|
-
public start() {
|
|
14
|
-
this._initializeAnimation();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
17
|
private _initializeAnimation(): void {
|
|
18
18
|
const jsonPath = this._ctx.dataset.jsonPath;
|
|
19
19
|
|
|
@@ -22,7 +22,30 @@ enum Selectors {
|
|
|
22
22
|
}<% } %>
|
|
23
23
|
|
|
24
24
|
@Component('Example')
|
|
25
|
-
export class Example extends GondelBaseComponent {
|
|
25
|
+
export class Example extends GondelBaseComponent {
|
|
26
|
+
|
|
27
|
+
public start() {
|
|
28
|
+
/* eslint-disable no-console */
|
|
29
|
+
console.warn('Example #start(): remove or implement component');
|
|
30
|
+
console.log(
|
|
31
|
+
'everything ok?'.startsWith('every')
|
|
32
|
+
? 'ES2015/ES6 startWith string method works'
|
|
33
|
+
: 'broken ES2015/ES6 startWith string method'
|
|
34
|
+
);
|
|
35
|
+
console.log(
|
|
36
|
+
[2, 4, 16, 256].includes(16)
|
|
37
|
+
? 'ES2016/ES7 includes array method works'
|
|
38
|
+
: 'broken ES2016/ES7 includes array method'
|
|
39
|
+
);
|
|
40
|
+
/* eslint-enable no-console */
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public sync() {
|
|
44
|
+
/* eslint-disable no-console */
|
|
45
|
+
console.warn('Example #sync(): remove or implement component');
|
|
46
|
+
/* eslint-enable no-console */
|
|
47
|
+
}<% if (options.clientTpl) { %>
|
|
48
|
+
|
|
26
49
|
@EventListener('click', Selectors.Add)
|
|
27
50
|
private _handleAdd(e: MouseEvent) {
|
|
28
51
|
e.preventDefault();
|
|
@@ -75,25 +98,4 @@ export class Example extends GondelBaseComponent {<% if (options.clientTpl) { %>
|
|
|
75
98
|
|
|
76
99
|
$ctx.find(Selectors.List).append($links);
|
|
77
100
|
}<% } %>
|
|
78
|
-
public start() {
|
|
79
|
-
/* eslint-disable no-console */
|
|
80
|
-
console.warn('Example #start(): remove or implement component');
|
|
81
|
-
console.log(
|
|
82
|
-
'everything ok?'.startsWith('every')
|
|
83
|
-
? 'ES2015/ES6 startWith string method works'
|
|
84
|
-
: 'broken ES2015/ES6 startWith string method'
|
|
85
|
-
);
|
|
86
|
-
console.log(
|
|
87
|
-
[2, 4, 16, 256].includes(16)
|
|
88
|
-
? 'ES2016/ES7 includes array method works'
|
|
89
|
-
: 'broken ES2016/ES7 includes array method'
|
|
90
|
-
);
|
|
91
|
-
/* eslint-enable no-console */
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public sync() {
|
|
95
|
-
/* eslint-disable no-console */
|
|
96
|
-
console.warn('Example #sync(): remove or implement component');
|
|
97
|
-
/* eslint-enable no-console */
|
|
98
|
-
}
|
|
99
101
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"short_name": "Nitro",
|
|
4
4
|
"icons": [
|
|
5
5
|
{
|
|
6
|
-
"src": "
|
|
6
|
+
"src": "icon-192x192.png",
|
|
7
7
|
"sizes": "192x192",
|
|
8
8
|
"type": "image/png"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"src": "
|
|
11
|
+
"src": "icon-512x512.png",
|
|
12
12
|
"sizes": "512x512",
|
|
13
13
|
"type": "image/png"
|
|
14
14
|
}
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
* requires a build
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const utils = require('./config/utils');
|
|
9
|
+
|
|
10
|
+
const baseScenario = utils.getBaseScenario();
|
|
9
11
|
|
|
10
12
|
const scenarios = [
|
|
11
13
|
{
|
|
12
|
-
|
|
13
|
-
label: '
|
|
14
|
-
url:
|
|
14
|
+
baseScenario,
|
|
15
|
+
label: 'Example',
|
|
16
|
+
url: 'index',
|
|
15
17
|
removeSelectors: ['.m-example--blue'],
|
|
16
18
|
selectors: ['.m-example'],
|
|
17
19
|
selectorExpansion: true,
|
|
@@ -19,6 +21,6 @@ const scenarios = [
|
|
|
19
21
|
];
|
|
20
22
|
|
|
21
23
|
module.exports = {
|
|
22
|
-
...
|
|
23
|
-
scenarios,
|
|
24
|
+
...utils.getBaseConfig(),
|
|
25
|
+
scenarios: utils.getFinalScenarios(scenarios),
|
|
24
26
|
};
|
|
@@ -24,7 +24,7 @@ const viewports = [
|
|
|
24
24
|
module.exports = {
|
|
25
25
|
host,
|
|
26
26
|
baseConfig: {
|
|
27
|
-
id: '
|
|
27
|
+
id: 'Screen',
|
|
28
28
|
viewports,
|
|
29
29
|
onBeforeScript: 'puppet/onBefore.js',
|
|
30
30
|
onReadyScript: 'puppet/onReady.js',
|
|
@@ -66,7 +66,7 @@ module.exports = {
|
|
|
66
66
|
selectors: [],
|
|
67
67
|
selectorExpansion: false,
|
|
68
68
|
expect: 0,
|
|
69
|
-
misMatchThreshold: 0.
|
|
69
|
+
misMatchThreshold: 0.01,
|
|
70
70
|
requireSameDimensions: true,
|
|
71
71
|
},
|
|
72
72
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const config = require('config');
|
|
4
|
+
|
|
5
|
+
const backstopConfig = require('./basic');
|
|
6
|
+
const pkg = require('../../../package.json');
|
|
7
|
+
|
|
8
|
+
const getBaseConfig = () => {
|
|
9
|
+
return backstopConfig.baseConfig;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const getBaseScenario = () => {
|
|
13
|
+
return backstopConfig.baseScenario;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const createScenarios = (scenarios) => {
|
|
17
|
+
// this default will take screenshots from all configured themes
|
|
18
|
+
const validThemes =
|
|
19
|
+
config.has('themes') && Array.isArray(config.get('themes'))
|
|
20
|
+
? config.get('themes')
|
|
21
|
+
: [{ id: 'default', name: pkg.name, isDefault: true }];
|
|
22
|
+
|
|
23
|
+
return validThemes.flatMap((theme) => {
|
|
24
|
+
return scenarios.map((scenario) => {
|
|
25
|
+
return {
|
|
26
|
+
...scenario,
|
|
27
|
+
label: `${theme.name} ${scenario.label}`,
|
|
28
|
+
url: theme.isDefault
|
|
29
|
+
? `${backstopConfig.host}/${scenario.url}`
|
|
30
|
+
: `${backstopConfig.host}/theme/${theme.id}?ref=/${scenario.url}`,
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const getFinalScenarios = (scenarios) => {
|
|
37
|
+
return createScenarios(scenarios);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
module.exports = {
|
|
41
|
+
getBaseConfig,
|
|
42
|
+
getBaseScenario,
|
|
43
|
+
getFinalScenarios,
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-nitro",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Yeoman generator for the nitro frontend framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "merkle-open/generator-nitro",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"find-git-root": "1.0.4",
|
|
39
39
|
"git-config": "0.0.7",
|
|
40
40
|
"glob": "8.0.3",
|
|
41
|
-
"got": "11.8.
|
|
41
|
+
"got": "11.8.5",
|
|
42
42
|
"lodash": "4.17.21",
|
|
43
43
|
"yeoman-generator": "5.7.0",
|
|
44
44
|
"yosay": "2.0.2"
|