@ui5/webcomponents-tools 0.0.0-5f8ce9393 → 0.0.0-6d98d0c29

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +107 -1
  2. package/assets-meta.js +147 -0
  3. package/bin/dev.js +16 -1
  4. package/components-package/nps.js +74 -33
  5. package/components-package/rollup.js +131 -49
  6. package/components-package/wdio.js +58 -47
  7. package/icons-collection/nps.js +38 -28
  8. package/lib/copy-and-watch/index.js +122 -0
  9. package/lib/copy-list/index.js +28 -0
  10. package/lib/create-icons/index.js +27 -23
  11. package/lib/create-illustrations/index.js +95 -0
  12. package/lib/create-new-component/index.js +18 -6
  13. package/lib/documentation/index.js +43 -21
  14. package/lib/esm-abs-to-rel/index.js +54 -0
  15. package/lib/generate-json-imports/i18n.js +91 -47
  16. package/lib/generate-json-imports/themes.js +61 -13
  17. package/lib/hash/config.js +10 -0
  18. package/lib/hash/generate.js +19 -0
  19. package/lib/hash/upToDate.js +31 -0
  20. package/lib/hbs2lit/index.js +2 -4
  21. package/lib/hbs2lit/src/compiler.js +8 -7
  22. package/lib/hbs2lit/src/includesReplacer.js +22 -16
  23. package/lib/hbs2lit/src/litVisitor2.js +47 -9
  24. package/lib/hbs2lit/src/svgProcessor.js +3 -3
  25. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +5 -5
  26. package/lib/hbs2ui5/index.js +26 -20
  27. package/lib/i18n/defaults.js +25 -6
  28. package/lib/i18n/toJSON.js +15 -4
  29. package/lib/init-package/index.js +28 -11
  30. package/lib/init-package/resources/bundle.es5.js +1 -1
  31. package/lib/init-package/resources/bundle.esm.js +2 -5
  32. package/lib/init-package/resources/src/Assets.js +0 -1
  33. package/lib/init-package/resources/src/{Demo.hbs → MyFirstComponent.hbs} +0 -0
  34. package/lib/init-package/resources/src/{Demo.js → MyFirstComponent.js} +0 -0
  35. package/lib/init-package/resources/src/i18n/messagebundle.properties +1 -1
  36. package/lib/init-package/resources/src/themes/{Demo.css → MyFirstComponent.css} +2 -2
  37. package/lib/init-package/resources/src/themes/sap_belize/parameters-bundle.css +1 -1
  38. package/lib/init-package/resources/src/themes/sap_belize_hcb/parameters-bundle.css +1 -1
  39. package/lib/init-package/resources/src/themes/sap_belize_hcw/parameters-bundle.css +3 -0
  40. package/lib/init-package/resources/src/themes/sap_fiori_3/parameters-bundle.css +1 -1
  41. package/lib/init-package/resources/src/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
  42. package/lib/init-package/resources/src/themes/sap_fiori_3_hcb/parameters-bundle.css +3 -0
  43. package/lib/init-package/resources/src/themes/sap_fiori_3_hcw/parameters-bundle.css +3 -0
  44. package/lib/init-package/resources/test/pages/index.html +9 -4
  45. package/lib/jsdoc/config.json +1 -1
  46. package/lib/jsdoc/plugin.js +24 -4
  47. package/lib/jsdoc/template/publish.js +11 -2
  48. package/lib/polyfill-placeholder/index.js +5 -0
  49. package/lib/postcss-css-to-esm/index.js +31 -19
  50. package/lib/postcss-css-to-json/index.js +22 -11
  51. package/lib/postcss-new-files/index.js +36 -0
  52. package/lib/replace-global-core/index.js +20 -0
  53. package/lib/scoping/get-all-tags.js +44 -0
  54. package/lib/scoping/lint-src.js +31 -0
  55. package/lib/scoping/scope-test-pages.js +40 -0
  56. package/lib/serve/index.js +46 -0
  57. package/{components-package → lib/serve}/serve.json +0 -0
  58. package/package-lock.json +48 -0
  59. package/package.json +53 -51
package/CHANGELOG.md CHANGED
@@ -3,9 +3,115 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-rc.15](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.14...v1.0.0-rc.15) (2021-07-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **tools:** fix build error on MacOS 11 from rollup-plugin-terser ([#3347](https://github.com/SAP/ui5-webcomponents/issues/3347)) ([59892c4](https://github.com/SAP/ui5-webcomponents/commit/59892c4)), closes [#2515](https://github.com/SAP/ui5-webcomponents/issues/2515)
12
+
13
+
14
+
15
+
16
+
17
+
18
+ # [1.0.0-rc.14](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.13...v1.0.0-rc.14) (2021-04-01)
19
+
20
+
21
+
22
+
23
+ # [1.0.0-rc.13](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.12...v1.0.0-rc.13) (2021-03-26)
24
+
25
+
26
+ **Note:** Version bump only for package @ui5/webcomponents-tools
27
+
28
+
29
+
30
+
31
+
32
+ # [1.0.0-rc.12](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.11...v1.0.0-rc.12) (2021-02-18)
33
+
34
+ **Note:** Version bump only for package @ui5/webcomponents-tools
35
+
36
+
37
+
38
+
39
+ # [1.0.0-rc.11](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.10...v1.0.0-rc.11) (2020-12-21)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * build error on MacOS 11 from rollup-plugin-terser ([#2515](https://github.com/SAP/ui5-webcomponents/issues/2515)) ([0629fac](https://github.com/SAP/ui5-webcomponents/commit/0629fac))
45
+
46
+
47
+
48
+
49
+
50
+ # [1.0.0-rc.10](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.9...v1.0.0-rc.10) (2020-11-12)
51
+
52
+
53
+
54
+ # [1.0.0-rc.9](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.8...v1.0.0-rc.9) (2020-10-08)
55
+
56
+
57
+ ### Features
58
+
59
+ * **framework:** dynamic custom elements scoping ([#2091](https://github.com/SAP/ui5-webcomponents/issues/2091)) ([3588542](https://github.com/SAP/ui5-webcomponents/commit/3588542))
60
+ * **framework:** make assets path configurable ([#2214](https://github.com/SAP/ui5-webcomponents/issues/2214)) ([16c46da](https://github.com/SAP/ui5-webcomponents/commit/16c46da))
61
+ * **tools:** ES5 build supports dynamic imports (inlined) ([#2063](https://github.com/SAP/ui5-webcomponents/issues/2063)) ([3fe5cac](https://github.com/SAP/ui5-webcomponents/commit/3fe5cac))
62
+ * **tools:** process HBS files in nested directories ([#2067](https://github.com/SAP/ui5-webcomponents/issues/2067)) ([13f1d2a](https://github.com/SAP/ui5-webcomponents/commit/13f1d2a)), closes [#2065](https://github.com/SAP/ui5-webcomponents/issues/2065)
63
+
64
+
65
+
66
+
67
+
68
+ # [1.0.0-rc.8](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.7...v1.0.0-rc.8) (2020-07-30)
69
+
70
+
71
+ ### Bug Fixes
72
+
73
+ * **tools:** Remove white spaces from hbs parser ([#1613](https://github.com/SAP/ui5-webcomponents/issues/1613)) ([ec5a9cf](https://github.com/SAP/ui5-webcomponents/commit/ec5a9cf))
74
+ * **tools:** Strip whitespaces around < and > ([#1623](https://github.com/SAP/ui5-webcomponents/issues/1623)) ([0fcda38](https://github.com/SAP/ui5-webcomponents/commit/0fcda38))
75
+ * **tools:** Enables 3 or more levels of inheritance with templates ([#1593](https://github.com/SAP/ui5-webcomponents/issues/1593)) ([2a426dd](https://github.com/SAP/ui5-webcomponents/commit/2a426dd))
76
+ * **tools:** Building third-party packages no longer fails ([#1994](https://github.com/SAP/ui5-webcomponents/issues/1994)) ([07aebfa](https://github.com/SAP/ui5-webcomponents/commit/07aebfa))
77
+ * **tools:** Polyfill copied correctly in all scenarios ([#1783](https://github.com/SAP/ui5-webcomponents/issues/1783)) ([a04f483](https://github.com/SAP/ui5-webcomponents/commit/a04f483))
78
+
79
+
80
+ ### Features
81
+
82
+ * **tools:** Add more commands to package.json ([#1908](https://github.com/SAP/ui5-webcomponents/issues/1908)) ([b0551b3](https://github.com/SAP/ui5-webcomponents/commit/b0551b3))
83
+ * **tools:** Templates can be imported from node_modules/ ([#1860](https://github.com/SAP/ui5-webcomponents/issues/1860)) ([6fa5847](https://github.com/SAP/ui5-webcomponents/commit/6fa5847))
84
+
85
+
86
+
87
+
88
+ # [1.0.0-rc.7](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.6...v1.0.0-rc.7) (2020-04-30)
89
+
90
+
91
+ ### Bug Fixes
92
+
93
+ * **build:** escape quotes in translation texts ([#1511](https://github.com/SAP/ui5-webcomponents/issues/1511)) ([ee7f300](https://github.com/SAP/ui5-webcomponents/commit/ee7f300))
94
+
95
+
96
+
97
+
98
+ # [1.0.0-rc.6](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.5...v1.0.0-rc.6) (2020-03-27)
99
+
100
+
101
+ ### Features
102
+
103
+ * **tools:** create an init package script ([#1010](https://github.com/SAP/ui5-webcomponents/issues/1010)) ([d93ab87](https://github.com/SAP/ui5-webcomponents/commit/d93ab87))
104
+
105
+ * **tools:** add docs to create-ui5-script ([#987](https://github.com/SAP/ui5-webcomponents/issues/987)) ([f0f5ec5](https://github.com/SAP/ui5-webcomponents/commit/f0f5ec5))
106
+
107
+
108
+
109
+
110
+
111
+
6
112
  # [1.0.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.4...v1.0.0-rc.5) (2019-12-02)
7
113
 
8
114
 
9
115
  ### Bug Fixes
10
116
 
11
- * **JS Doc** show correct since version in the playground ([#983](https://github.com/SAP/ui5-webcomponents/issues/983)) ([3051d76](https://github.com/SAP/ui5-webcomponents/commit/3051d76))
117
+ * **JS Doc** show correct since version in the playground ([#983](https://github.com/SAP/ui5-webcomponents/issues/983)) ([3051d76](https://github.com/SAP/ui5-webcomponents/commit/3051d76))
package/assets-meta.js ADDED
@@ -0,0 +1,147 @@
1
+ const assetsMeta = {
2
+ "themes": {
3
+ "default": "sap_fiori_3",
4
+ "all": [
5
+ "sap_fiori_3",
6
+ "sap_fiori_3_dark",
7
+ "sap_belize",
8
+ "sap_belize_hcb",
9
+ "sap_belize_hcw",
10
+ "sap_fiori_3_hcb",
11
+ "sap_fiori_3_hcw"
12
+ ]
13
+ },
14
+ "languages": {
15
+ "default": "en",
16
+ "all": [
17
+ "ar",
18
+ "bg",
19
+ "ca",
20
+ "cs",
21
+ "cy",
22
+ "da",
23
+ "de",
24
+ "el",
25
+ "en",
26
+ "en_GB",
27
+ "en_US_sappsd",
28
+ "en_US_saprigi",
29
+ "en_US_saptrc",
30
+ "es",
31
+ "es_MX",
32
+ "et",
33
+ "fi",
34
+ "fr",
35
+ "fr_CA",
36
+ "hi",
37
+ "hr",
38
+ "hu",
39
+ "in",
40
+ "it",
41
+ "iw",
42
+ "ja",
43
+ "kk",
44
+ "ko",
45
+ "lt",
46
+ "lv",
47
+ "ms",
48
+ "nl",
49
+ "no",
50
+ "pl",
51
+ "pt_PT",
52
+ "pt",
53
+ "ro",
54
+ "ru",
55
+ "sh",
56
+ "sk",
57
+ "sl",
58
+ "sv",
59
+ "th",
60
+ "tr",
61
+ "uk",
62
+ "vi",
63
+ "zh_CN",
64
+ "zh_TW"
65
+ ]
66
+ },
67
+ "locales": {
68
+ "default": "en",
69
+ "all": [
70
+ "ar",
71
+ "ar_EG",
72
+ "ar_SA",
73
+ "bg",
74
+ "ca",
75
+ "cs",
76
+ "da",
77
+ "de",
78
+ "de_AT",
79
+ "de_CH",
80
+ "el",
81
+ "el_CY",
82
+ "en",
83
+ "en_AU",
84
+ "en_GB",
85
+ "en_HK",
86
+ "en_IE",
87
+ "en_IN",
88
+ "en_NZ",
89
+ "en_PG",
90
+ "en_SG",
91
+ "en_ZA",
92
+ "es",
93
+ "es_AR",
94
+ "es_BO",
95
+ "es_CL",
96
+ "es_CO",
97
+ "es_MX",
98
+ "es_PE",
99
+ "es_UY",
100
+ "es_VE",
101
+ "et",
102
+ "fa",
103
+ "fi",
104
+ "fr",
105
+ "fr_BE",
106
+ "fr_CA",
107
+ "fr_CH",
108
+ "fr_LU",
109
+ "he",
110
+ "hi",
111
+ "hr",
112
+ "hu",
113
+ "id",
114
+ "it",
115
+ "it_CH",
116
+ "ja",
117
+ "kk",
118
+ "ko",
119
+ "lt",
120
+ "lv",
121
+ "ms",
122
+ "nb",
123
+ "nl",
124
+ "nl_BE",
125
+ "pl",
126
+ "pt",
127
+ "pt_PT",
128
+ "ro",
129
+ "ru",
130
+ "ru_UA",
131
+ "sk",
132
+ "sl",
133
+ "sr",
134
+ "sv",
135
+ "th",
136
+ "tr",
137
+ "uk",
138
+ "vi",
139
+ "zh_CN",
140
+ "zh_HK",
141
+ "zh_SG",
142
+ "zh_TW"
143
+ ]
144
+ }
145
+ };
146
+
147
+ module.exports = assetsMeta;
package/bin/dev.js CHANGED
@@ -2,4 +2,19 @@
2
2
 
3
3
  const child_process = require("child_process");
4
4
 
5
- child_process.execSync(`npx nps ${process.argv[2]}`, {stdio: 'inherit'});
5
+ let command = process.argv[2];
6
+ const argument = process.argv[3];
7
+
8
+ if (command === "watch") {
9
+ if (["src", "test", "bundles", "styles", "templates", "samples"].includes(argument)) {
10
+ command = `watch.${argument}`;
11
+ }
12
+ } else if (command === "test") {
13
+ if (argument === "--no-server") { // yarn test --no-server
14
+ command = `test.run`;
15
+ } else if (argument) { // yarn test test/specs/Button.spec.js
16
+ command = `test.spec --spec ${argument}`;
17
+ }
18
+ }
19
+
20
+ child_process.execSync(`npx nps "${command}"`, {stdio: 'inherit'});
@@ -1,74 +1,115 @@
1
1
  const path = require("path");
2
+ const fs = require("fs");
2
3
 
3
4
  const LIB = path.join(__dirname, `../lib/`);
4
- const NODE_MODULES_PATH = path.join(__dirname, `../../../node_modules/`);
5
- const serveConfig = path.join(__dirname, `serve.json`);
6
- const polyfillPath = path.join(NODE_MODULES_PATH, `/@webcomponents/webcomponentsjs/**/*.*`);
5
+ const polyfillDir = path.dirname(require.resolve("@webcomponents/webcomponentsjs"));
6
+ const polyfillPath = path.join(polyfillDir, "{*.js,*.map,*.md,bundles/**/*.*}");
7
+ const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
7
8
 
8
9
  const getScripts = (options) => {
9
10
 
10
- const port = options.port;
11
+ const port = options.port || 8080; // preferred port
12
+ const portStep = options.portStep || 1; // step to check for available ports, if preferred port is already used
13
+ let illustrations = options.illustrationsPath || [];
14
+
15
+ illustrations = illustrations.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
16
+
17
+ let illustrationsScript = illustrations.join(" && ");
11
18
 
12
19
  const scripts = {
13
- clean: "rimraf dist",
20
+ clean: "rimraf dist && rimraf .port",
14
21
  lint: "eslint . --config config/.eslintrc.js",
15
- prepare: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples",
22
+ lintfix: "eslint . --config config/.eslintrc.js --fix",
23
+ prepare: {
24
+ default: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples build.illustrations",
25
+ es5: "nps clean build.templates build.styles build.i18n build.jsonImports copy.es5 build.samples build.illustrations"
26
+ },
16
27
  build: {
17
- default: "nps lint prepare build.bundle",
18
- templates: `mkdirp dist/generated/templates && node ${LIB}/hbs2ui5/index.js -d src/ -o dist/generated/templates`,
28
+ default: "nps lint prepare.es5 build.bundle",
29
+ templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
19
30
  styles: {
20
31
  default: "nps build.styles.themes build.styles.components",
21
32
  themes: "postcss src/**/parameters-bundle.css --config config/postcss.themes --base src --dir dist/css/",
22
- components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/",
33
+ components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
23
34
  },
24
35
  i18n: {
25
36
  default: "nps build.i18n.defaultsjs build.i18n.json",
26
- defaultsjs: `mkdirp dist/generated/i18n && node ${LIB}/i18n/defaults.js src/i18n dist/generated/i18n`,
27
- json: `mkdirp dist/generated/assets/i18n && node ${LIB}/i18n/toJSON.js src/i18n dist/generated/assets/i18n`,
37
+ defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
38
+ json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
28
39
  },
29
40
  jsonImports: {
30
41
  default: "mkdirp dist/generated/json-imports && nps build.jsonImports.themes build.jsonImports.i18n",
31
- themes: `node ${LIB}/generate-json-imports/themes.js`,
32
- i18n: `node ${LIB}/generate-json-imports/i18n.js`,
42
+ themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
43
+ i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
33
44
  },
34
45
  bundle: "rollup --config config/rollup.config.js --environment ES5_BUILD",
35
46
  samples: {
36
47
  default: "nps build.samples.api build.samples.docs",
37
- api: `jsdoc -c ${LIB}/jsdoc/config.json`,
38
- docs: `node ${LIB}/documentation/index.js dist/api.json`,
48
+ api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
49
+ docs: `node "${LIB}/documentation/index.js" dist/api.json`,
50
+ },
51
+ illustrations: {
52
+ default: illustrationsScript
39
53
  }
40
54
  },
41
55
  copy: {
42
- default: "nps copy.src copy.test copy.webcomponents-polyfill",
43
- src: "copy-and-watch \"src/**/*.js\" dist/",
44
- test: "copy-and-watch \"test/**/*.*\" dist/test-resources",
45
- "webcomponents-polyfill": `copy-and-watch "${polyfillPath}" dist/webcomponentsjs/`,
56
+ default: "nps copy.src copy.props copy.test copy.webcomponents-polyfill-placeholder",
57
+ es5: "nps copy.src copy.props copy.test copy.webcomponents-polyfill",
58
+ src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
59
+ props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
60
+ test: `node "${LIB}/copy-and-watch/index.js" --silent "test/**/*.*" dist/test-resources`,
61
+ "webcomponents-polyfill": `node "${LIB}/copy-and-watch/index.js" --silent "${polyfillPath}" dist/webcomponentsjs/`,
62
+ "webcomponents-polyfill-placeholder": `node "${LIB}/polyfill-placeholder/index.js"`
46
63
  },
47
64
  watch: {
48
- default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles"',
49
- src: 'nps "copy.src --watch --skip-initial-copy"',
50
- test: 'nps "copy.test --watch --skip-initial-copy"',
51
- bundle: "rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV",
65
+ default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles" "nps watch.i18n"',
66
+ es5: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle.es5" "nps watch.styles" "nps watch.i18n"',
67
+ src: 'nps "copy.src --watch --safe --skip-initial-copy"',
68
+ props: 'nps "copy.props --watch --safe --skip-initial-copy"',
69
+ test: 'nps "copy.test --watch --safe --skip-initial-copy"',
70
+ bundle: {
71
+ default: 'rollup --config config/rollup.config.js -w --environment DEV,DEPLOY_PUBLIC_PATH:/resources/',
72
+ es5: 'rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV,DEPLOY_PUBLIC_PATH:/resources/'
73
+ },
52
74
  styles: {
53
75
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
54
76
  themes: 'nps "build.styles.themes -w"',
55
- components: 'nps "build.styles.components -w"',
77
+ components: {
78
+ default: 'concurrently "nps watch.styles.components.existingFiles" "nps watch.styles.components.newFiles"',
79
+ existingFiles: `nps "build.styles.components -w"`,
80
+ newFiles: `node "${LIB}/postcss-new-files/index.js" --srcFiles="src/themes/*.css"`,
81
+ },
56
82
  },
57
- templates: "chokidar \"src/**/*.hbs\" -c \"nps build.templates\"",
58
- samples: "chokidar \"test/**/*.sample.html\" -c \"nps build.samples\"",
83
+ templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
84
+ samples: 'chokidar "test/**/*.sample.html" -c "nps build.samples"',
85
+ i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
59
86
  },
60
- dev: 'concurrently "nps serve" "nps watch"',
61
- start: "nps prepare dev",
62
- serve: {
63
- default: "nps serve.prepare serve.run",
64
- prepare: `copy-and-watch "${serveConfig}" dist/`,
65
- run: `serve --no-clipboard -l ${port} dist`,
87
+ dev: {
88
+ default: 'concurrently "nps serve" "nps watch"',
89
+ es5: 'concurrently "nps serve" "nps watch.es5"'
66
90
  },
91
+ start: "nps prepare dev",
92
+ serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
67
93
  test: {
68
94
  // --success first - report the exit code of the test run (first command to finish), as serve is always terminated and has a non-0 exit code
69
95
  default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
70
- run: "cross-env WDIO_LOG_LEVEL=error FORCE_COLOR=0 wdio config/wdio.conf.js",
96
+ run: "cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js",
97
+ spec: "wdio run config/wdio.conf.js",
71
98
  },
99
+ startWithScope: "nps scope.prepare scope.dev",
100
+ scope: {
101
+ prepare: "nps scope.lint prepare scope.testPages",
102
+ lint: `node "${LIB}/scoping/lint-src.js"`,
103
+ testPages: {
104
+ default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
105
+ clean: "rimraf dist/test-resources/pages/scoped",
106
+ copy: `node "${LIB}/copy-and-watch/index.js" --silent "dist/test-resources/pages/**/*" dist/test-resources/scoped`,
107
+ replace: `node "${LIB}/scoping/scope-test-pages.js" dist/test-resources/scoped demo`,
108
+ },
109
+ dev: 'concurrently "nps serve" "nps scope.watch"',
110
+ watch: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.props" "nps scope.bundle" "nps watch.styles"',
111
+ bundle: 'rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV,SCOPE'
112
+ }
72
113
  };
73
114
 
74
115
  return scripts;