@ui5/webcomponents-tools 0.0.0-7a547f8cc → 0.0.0-7b7921cd9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,171 @@
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.14.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.0...v1.14.0-rc.1) (2023-05-25)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.14.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.2...v1.14.0-rc.0) (2023-05-18)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.13.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.5...v1.13.1) (2023-05-11)
23
+
24
+ **Note:** Version bump only for package @ui5/webcomponents-tools
25
+
26
+
27
+
28
+
29
+
30
+ # [1.13.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.4...v1.13.0-rc.5) (2023-05-11)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * **create-webcomponents-package:** fix package creation issues with test and lint ([#6976](https://github.com/SAP/ui5-webcomponents/issues/6976)) ([dd70f3a](https://github.com/SAP/ui5-webcomponents/commit/dd70f3aa8ef70b592f1d4e0f3f9894c6280fb1bf))
36
+
37
+
38
+
39
+
40
+
41
+ # [1.13.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.3...v1.13.0-rc.4) (2023-05-04)
42
+
43
+
44
+ ### Features
45
+
46
+ * generate TS from HBS templates ([#6558](https://github.com/SAP/ui5-webcomponents/issues/6558)) ([02611b2](https://github.com/SAP/ui5-webcomponents/commit/02611b2e24b2c2a06129b8e60a8bc680d9501e39))
47
+
48
+
49
+
50
+
51
+
52
+ # [1.13.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.2...v1.13.0-rc.3) (2023-04-27)
53
+
54
+ **Note:** Version bump only for package @ui5/webcomponents-tools
55
+
56
+
57
+
58
+
59
+
60
+ # [1.13.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.1...v1.13.0-rc.2) (2023-04-20)
61
+
62
+ **Note:** Version bump only for package @ui5/webcomponents-tools
63
+
64
+
65
+
66
+
67
+
68
+ # [1.13.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.0...v1.13.0-rc.1) (2023-04-13)
69
+
70
+
71
+ ### Bug Fixes
72
+
73
+ * **framework:** correct fileName in component CSS import ([#6900](https://github.com/SAP/ui5-webcomponents/issues/6900)) ([4d950c5](https://github.com/SAP/ui5-webcomponents/commit/4d950c5ea3bee0e3b629e5797693ecf41a2cdfd3))
74
+
75
+
76
+
77
+
78
+
79
+ # [1.13.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0...v1.13.0-rc.0) (2023-04-06)
80
+
81
+ **Note:** Version bump only for package @ui5/webcomponents-tools
82
+
83
+
84
+
85
+
86
+
87
+ # [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * **theming:** fix icons version display for custom themes (built via the ThemeDesigner) ([#6815](https://github.com/SAP/ui5-webcomponents/issues/6815)) ([63ff800](https://github.com/SAP/ui5-webcomponents/commit/63ff8007889a66efae074fc6b4dbcb1b7ea36713)), closes [#6758](https://github.com/SAP/ui5-webcomponents/issues/6758)
93
+
94
+
95
+
96
+
97
+
98
+ # [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
99
+
100
+ **Note:** Version bump only for package @ui5/webcomponents-tools
101
+
102
+
103
+
104
+
105
+
106
+ # [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * fix eslint for JS 3rd party projects ([#6725](https://github.com/SAP/ui5-webcomponents/issues/6725)) ([215a888](https://github.com/SAP/ui5-webcomponents/commit/215a888b006e46d431edd6324812b9d39249aef4))
112
+
113
+
114
+
115
+
116
+
117
+ # [1.12.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.0...v1.12.0-rc.1) (2023-03-16)
118
+
119
+ **Note:** Version bump only for package @ui5/webcomponents-tools
120
+
121
+
122
+
123
+
124
+
125
+ # [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
126
+
127
+
128
+ ### Features
129
+
130
+ * enhance create-ui5-element command to create component in TS ([#6609](https://github.com/SAP/ui5-webcomponents/issues/6609)) ([d870065](https://github.com/SAP/ui5-webcomponents/commit/d8700650a4e5991862e2076cc2c93482011c4c90))
131
+
132
+
133
+
134
+
135
+
136
+ # [1.11.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.4...v1.11.0) (2023-03-06)
137
+
138
+ **Note:** Version bump only for package @ui5/webcomponents-tools
139
+
140
+
141
+
142
+
143
+
144
+ # [1.11.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.3...v1.11.0-rc.4) (2023-03-02)
145
+
146
+ **Note:** Version bump only for package @ui5/webcomponents-tools
147
+
148
+
149
+
150
+
151
+
152
+ # [1.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.2...v1.11.0-rc.3) (2023-02-23)
153
+
154
+
155
+ ### Features
156
+
157
+ * **playground:** next playground with storybook ([#5831](https://github.com/SAP/ui5-webcomponents/issues/5831)) ([79274c8](https://github.com/SAP/ui5-webcomponents/commit/79274c8e442cf5854a7fe6327f25aaed04312103)), closes [#5898](https://github.com/SAP/ui5-webcomponents/issues/5898)
158
+
159
+
160
+
161
+
162
+
163
+ # [1.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.1...v1.11.0-rc.2) (2023-02-16)
164
+
165
+ **Note:** Version bump only for package @ui5/webcomponents-tools
166
+
167
+
168
+
169
+
170
+
6
171
  # [1.11.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.0...v1.11.0-rc.1) (2023-02-09)
7
172
 
8
173
  **Note:** Version bump only for package @ui5/webcomponents-tools
@@ -1,3 +1,36 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
4
+
5
+ /**
6
+ * Typescript Rules
7
+ */
8
+ const overrides = tsMode ? [{
9
+ files: ["*.ts"],
10
+ parser: "@typescript-eslint/parser",
11
+ plugins: ["@typescript-eslint"],
12
+ extends: [
13
+ "plugin:@typescript-eslint/recommended",
14
+ "plugin:@typescript-eslint/recommended-requiring-type-checking"
15
+ ],
16
+ parserOptions: {
17
+ "project": ["./tsconfig.json", "./packages/*/tsconfig.json"],
18
+ },
19
+ rules: {
20
+ "no-shadow": "off",
21
+ "@typescript-eslint/no-shadow": ["error"],
22
+ "@typescript-eslint/no-unsafe-member-access": "off",
23
+ "@typescript-eslint/no-floating-promises": "off",
24
+ "@typescript-eslint/no-explicit-any": "off",
25
+ "@typescript-eslint/no-unsafe-assignment": "off",
26
+ "@typescript-eslint/ban-ts-comment": "off",
27
+ "@typescript-eslint/no-unsafe-call": "off",
28
+ "@typescript-eslint/no-non-null-assertion": "off",
29
+ "@typescript-eslint/no-empty-function": "off",
30
+ "lines-between-class-members": "off",
31
+ }
32
+ }] : [];
33
+
1
34
  module.exports = {
2
35
  "env": {
3
36
  "browser": true,
@@ -5,34 +38,7 @@ module.exports = {
5
38
  },
6
39
  "root": true,
7
40
  "extends": "airbnb-base",
8
- overrides: [{
9
- files: ["*.ts"],
10
- parser: "@typescript-eslint/parser",
11
- plugins: ["@typescript-eslint"],
12
- extends: [
13
- "plugin:@typescript-eslint/recommended",
14
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
15
- ],
16
- parserOptions: {
17
- "project": ["./tsconfig.json", "./packages/*/tsconfig.json"],
18
- },
19
- /**
20
- * Typescript Rules
21
- */
22
- rules: {
23
- "no-shadow": "off",
24
- "@typescript-eslint/no-shadow": ["error"],
25
- "@typescript-eslint/no-unsafe-member-access": "off",
26
- "@typescript-eslint/no-floating-promises": "off",
27
- "@typescript-eslint/no-explicit-any": "off",
28
- "@typescript-eslint/no-unsafe-assignment": "off",
29
- "@typescript-eslint/ban-ts-comment": "off",
30
- "@typescript-eslint/no-unsafe-call": "off",
31
- "@typescript-eslint/no-non-null-assertion": "off",
32
- "@typescript-eslint/no-empty-function": "off",
33
- "lines-between-class-members": "off",
34
- }
35
- }],
41
+ overrides,
36
42
  "parserOptions": {
37
43
  "ecmaVersion": 2018,
38
44
  "sourceType": "module"
@@ -18,6 +18,16 @@ const getScripts = (options) => {
18
18
  const tsCommand = tsOption ? "tsc" : "";
19
19
  const tsWatchCommand = tsOption ? "tsc --watch" : "";
20
20
  const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : "";
21
+ const copySrcGenerated = tsOption ? "" : "copy.srcGenerated";
22
+
23
+ if (tsOption) {
24
+ try {
25
+ require("typescript");
26
+ } catch(e) {
27
+ console.error(`TypeScript is not found. Try to install it by running \`npm install --save-dev typescript\` if you are using npm or by running \`yarn add --dev typescript\` if you are using yarn.`);
28
+ process.exit(e.code);
29
+ }
30
+ }
21
31
 
22
32
  let viteConfig;
23
33
  if (fs.existsSync("config/vite.config.js")) {
@@ -32,10 +42,7 @@ const getScripts = (options) => {
32
42
  }
33
43
 
34
44
  let eslintConfig;
35
- if (fs.existsSync("config/.eslintrc.js")) {
36
- // old project setup where config file is in separate folder
37
- eslintConfig = "--config config/.eslintrc.js";
38
- } else if (fs.existsSync(".eslintrc.js")) {
45
+ if (fs.existsSync(".eslintrc.js") || fs.existsSync(".eslintrc.cjs")) {
39
46
  // preferred way of custom configuration in root project folder
40
47
  eslintConfig = "";
41
48
  } else {
@@ -46,7 +53,7 @@ const getScripts = (options) => {
46
53
  const scripts = {
47
54
  clean: 'rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
48
55
  lint: `eslint . ${eslintConfig}`,
49
- lintfix: `eslint . ${eslintConfig}`,
56
+ lintfix: `eslint . ${eslintConfig} --fix`,
50
57
  prepare: {
51
58
  default: `${tsCrossEnv} nps clean prepare.all typescript generateAPI`,
52
59
  all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"',
@@ -55,9 +62,9 @@ const getScripts = (options) => {
55
62
  typescript: tsCommand,
56
63
  build: {
57
64
  default: "nps prepare lint build.bundle",
58
- templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
65
+ templates: `mkdirp dist/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`,
59
66
  styles: {
60
- default: "nps build.styles.themes build.styles.components",
67
+ default: `nps build.styles.themes build.styles.components ${copySrcGenerated}`,
61
68
  themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
62
69
  components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
63
70
  },
@@ -81,10 +88,11 @@ const getScripts = (options) => {
81
88
  copy: {
82
89
  default: "nps copy.src copy.props",
83
90
  src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
91
+ srcGenerated: `node "${LIB}/copy-and-watch/index.js" --silent "src/generated/**/*.js" dist/generated/`,
84
92
  props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
85
93
  },
86
94
  watch: {
87
- default: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.typescript" "nps watch.styles" "nps watch.i18n" "nps watch.props"',
95
+ default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.typescript" "nps watch.styles" "nps watch.i18n" "nps watch.props"`,
88
96
  devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
89
97
  src: 'nps "copy.src --watch --safe --skip-initial-copy"',
90
98
  typescript: tsWatchCommand,
@@ -3,6 +3,7 @@ const combineSelectors = require('../lib/postcss-combine-duplicated-selectors/in
3
3
  const postcssCSStoJSON = require('../lib/postcss-css-to-json/index.js');
4
4
  const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
5
5
  const cssnano = require('cssnano');
6
+ const modifySelectors = require("modify-selectors");
6
7
  const fs = require("fs");
7
8
 
8
9
  const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
@@ -20,6 +21,15 @@ module.exports = {
20
21
  },
21
22
  ]
22
23
  },),
24
+ modifySelectors({
25
+ enable: true,
26
+ suffix: [
27
+ {
28
+ match: '*',
29
+ with: '[_ui5host]', // Add suffix to each selector in the file (:root => :root [_ui5host])
30
+ },
31
+ ],
32
+ }),
23
33
  postcssCSStoJSON({ toReplace: 'src', packageName }),
24
34
  postcssCSStoESM({ toReplace: 'src', packageName }),
25
35
  ]
@@ -1,12 +1,13 @@
1
1
  // vite.config.js
2
- const { defineConfig } = require('vite');
3
- const virtualIndex = require("../lib/dev-server/virtual-index-html-plugin.js");
2
+ import { defineConfig } from 'vite';
3
+ import virtualIndex from '../lib/dev-server/virtual-index-html-plugin.js';
4
4
 
5
- module.exports = defineConfig(async () => {
5
+ export default defineConfig(async () => {
6
+ const data = await virtualIndex();
6
7
  return {
7
8
  build: {
8
9
  emptyOutDir: false,
9
10
  },
10
- plugins: [await virtualIndex()],
11
+ plugins: [data],
11
12
  }
12
- });
13
+ })