From 21d5132c5d1c36f239b80fbedf2d78bc6bd06b5d Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 8 Dec 2023 15:03:55 +0200 Subject: [PATCH 01/16] wip --- packages/main/package.json | 3 +- .../themes/sap_fiori_3/Avatar-parameters.css | 1 + packages/main/test.css | 7 ++ packages/tools/components-package/nps.js | 4 +- .../tools/lib/postcss-css-to-esm/index.js | 1 + packages/tools/lib/postcss-p/postcss-p2.mjs | 62 +++++++++++++++++ packages/tools/lib/postcss-p/postcss-p3.mjs | 62 +++++++++++++++++ .../tools/lib/postcss-scope-vars/index.js | 2 +- packages/tools/package.json | 1 + yarn.lock | 67 +++++++++++++++++++ 10 files changed, 207 insertions(+), 3 deletions(-) create mode 100644 packages/main/test.css create mode 100644 packages/tools/lib/postcss-p/postcss-p2.mjs create mode 100644 packages/tools/lib/postcss-p/postcss-p3.mjs diff --git a/packages/main/package.json b/packages/main/package.json index 7ef397012165..eee678d0bc2e 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -57,6 +57,7 @@ }, "devDependencies": { "@ui5/webcomponents-tools": "1.21.0-rc.0", - "chromedriver": "119.0.1" + "chromedriver": "119.0.1", + "lightningcss-cli": "^1.22.1" } } diff --git a/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css b/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css index 686d857d9636..b0fa9c77746f 100644 --- a/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css +++ b/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css @@ -6,4 +6,5 @@ --_ui5_avatar_fontsize_M: 1.5rem; --_ui5_avatar_fontsize_L: 2.25rem; --_ui5_avatar_fontsize_XL: 3rem; + --_ui5_avatar_fontsize_S: 1.125rem; } \ No newline at end of file diff --git a/packages/main/test.css b/packages/main/test.css new file mode 100644 index 000000000000..69dd66eeafc8 --- /dev/null +++ b/packages/main/test.css @@ -0,0 +1,7 @@ +:root { + --var1: 1; +} + +:root { + --var1: 2; +} diff --git a/packages/tools/components-package/nps.js b/packages/tools/components-package/nps.js index d695bf690798..1739636cb22a 100644 --- a/packages/tools/components-package/nps.js +++ b/packages/tools/components-package/nps.js @@ -73,10 +73,12 @@ const getScripts = (options) => { default: "nps prepare lint build.bundle", // build.bundle2 templates: `mkdirp src/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`, styles: { - default: `concurrently "nps build.styles.themes" "nps build.styles.components"`, + default: `concurrently "nps build.styles.themes2" "nps build.styles.components2"`, default2: `nps build.styles.themes build.styles.components`, themes: `node "${LIB}/postcss-p/postcss-p.mjs"`, + themes2: `node "${LIB}/postcss-p/postcss-p2.mjs"`, components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script + components2: `node "${LIB}/postcss-p/postcss-p3.mjs"`, }, i18n: { default: "nps build.i18n.defaultsjs build.i18n.json", diff --git a/packages/tools/lib/postcss-css-to-esm/index.js b/packages/tools/lib/postcss-css-to-esm/index.js index 003309cb154e..d73f4a9c038c 100644 --- a/packages/tools/lib/postcss-css-to-esm/index.js +++ b/packages/tools/lib/postcss-css-to-esm/index.js @@ -88,3 +88,4 @@ module.exports = function (opts) { }; }; module.exports.postcss = true; +module.exports.getFileContent = getFileContent; diff --git a/packages/tools/lib/postcss-p/postcss-p2.mjs b/packages/tools/lib/postcss-p/postcss-p2.mjs new file mode 100644 index 000000000000..65eae9255da1 --- /dev/null +++ b/packages/tools/lib/postcss-p/postcss-p2.mjs @@ -0,0 +1,62 @@ +import 'zx/globals'; +import * as esbuild from 'esbuild' +import * as fs from "fs"; +import * as path from "path"; +import { writeFile, mkdir } from "fs/promises"; +import { getFileContent } from '../postcss-css-to-esm/index.js'; + +const packageJSON = JSON.parse(fs.readFileSync("./package.json")) +let inputFiles = await globby("src/**/parameters-bundle.css"); +const restArgs = process.argv.slice(2); + +const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); +const versionStr = escapeVersion(packageJSON.version); +const expr = /(--_?ui5)([^\,\:\)\s]+)/g + +let scopingPlugin = { + name: 'scoping', + setup(build) { + build.initialOptions.write = false; + + build.onEnd(result => { + result.outputFiles.forEach(async f => { + // scoping + const newText = f.text.replaceAll(expr, `$1-${versionStr}$2`); + await mkdir(path.dirname(f.path), {recursive: true}); + writeFile(f.path, newText); + + // json + const jsonPath = f.path.replace("dist/css2", "src/generated2/assets").replace(".css", ".css.json"); + await mkdir(path.dirname(jsonPath), {recursive: true}); + + const data = { + packageName: packageJSON.name, + fileName: jsonPath.substr(jsonPath.lastIndexOf("themes")), + content: newText, + }; + + writeFile(jsonPath, JSON.stringify({_: data})) + + // JS/TS + const jsPath = f.path.replace("dist/css2", "src/generated2/").replace(".css", ".css.ts"); + await mkdir(path.dirname(jsPath), {recursive: true}); + const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`"); + writeFile(jsPath, jsContent); + // console.log(f.path, newText); + }); + }) + }, +} + +// $`esbuild ${file} --bundle --minify --outdir=dist/css2 --outbase=src ${restArgs}`; +const result = await esbuild.build({ + entryPoints: inputFiles, + bundle: true, + minify: true, + outdir: 'dist/css2', + outbase: 'src', + plugins: [ + scopingPlugin, + ] +}) +// console.log({result}) \ No newline at end of file diff --git a/packages/tools/lib/postcss-p/postcss-p3.mjs b/packages/tools/lib/postcss-p/postcss-p3.mjs new file mode 100644 index 000000000000..0e3f1b871a0d --- /dev/null +++ b/packages/tools/lib/postcss-p/postcss-p3.mjs @@ -0,0 +1,62 @@ +import 'zx/globals'; +import * as esbuild from 'esbuild' +import * as fs from "fs"; +import * as path from "path"; +import { writeFile, mkdir } from "fs/promises"; +import { getFileContent } from '../postcss-css-to-esm/index.js'; + +const packageJSON = JSON.parse(fs.readFileSync("./package.json")) +let inputFiles = await globby("src/themes/*.css"); +const restArgs = process.argv.slice(2); + +const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); +const versionStr = escapeVersion(packageJSON.version); +const expr = /(--_?ui5)([^\,\:\)\s]+)/g + +let scopingPlugin = { + name: 'scoping', + setup(build) { + build.initialOptions.write = false; + + build.onEnd(result => { + result.outputFiles.forEach(async f => { + // scoping + const newText = f.text.replaceAll(expr, `$1-${versionStr}$2`); + await mkdir(path.dirname(f.path), {recursive: true}); + writeFile(f.path, newText); + + // json + // const jsonPath = f.path.replace("dist/css2", "src/generated/assets").replace(".css", ".css.json"); + // await mkdir(path.dirname(jsonPath), {recursive: true}); + + // const data = { + // packageName: packageJSON.name, + // fileName: jsonPath.substr(jsonPath.lastIndexOf("themes")), + // content: newText, + // }; + + // writeFile(jsonPath, JSON.stringify({_: data})) + + // JS/TS + const jsPath = f.path.replace("dist/css2", "src/generated/").replace(".css", ".css.ts"); + await mkdir(path.dirname(jsPath), {recursive: true}); + const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`", true); + writeFile(jsPath, jsContent); + // console.log(f.path, newText); + }); + }) + }, +} + +// $`esbuild ${file} --bundle --minify --outdir=dist/css2 --outbase=src ${restArgs}`; +const result = await esbuild.build({ + entryPoints: inputFiles, + bundle: true, + minify: true, + outdir: 'dist/css2', + outbase: 'src', + plugins: [ + scopingPlugin, + ] +}) +// console.log({result}) \ No newline at end of file diff --git a/packages/tools/lib/postcss-scope-vars/index.js b/packages/tools/lib/postcss-scope-vars/index.js index ba20bc0c35e0..d4201c86e2f0 100644 --- a/packages/tools/lib/postcss-scope-vars/index.js +++ b/packages/tools/lib/postcss-scope-vars/index.js @@ -6,7 +6,7 @@ const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, " /** * Tries to detect an override for a package * @param {*} filePath For example: /my_project/src/themes/overrides/@ui5/webcomponents/my_custom_theme/parameters-bundle.css - * @returns + * @returns */ const getOverrideVersion = filePath => { console.log(filePath); diff --git a/packages/tools/package.json b/packages/tools/package.json index 1eaed8b2e9b6..fa7135e9438f 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -76,6 +76,7 @@ } }, "devDependencies": { + "lightningcss-cli": "^1.22.1", "yargs": "^17.5.1" } } diff --git a/yarn.lock b/yarn.lock index 0066b3b2266d..248e5e01d57a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6229,6 +6229,11 @@ detect-indent@^6.1.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== + detect-package-manager@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/detect-package-manager/-/detect-package-manager-2.0.1.tgz#6b182e3ae5e1826752bfef1de9a7b828cffa50d8" @@ -9372,6 +9377,68 @@ lighthouse@8.6.0: yargs "^16.1.1" yargs-parser "^20.2.4" +lightningcss-cli-darwin-arm64@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-darwin-arm64/-/lightningcss-cli-darwin-arm64-1.22.1.tgz#19df9956118b08abffc87fda22e1f393466c070d" + integrity sha512-wYbAvHL8T25KHIfHrrQnwNtwp8OXuGIWV3O2IAlY5NwtrNsfTBF0odfHKE/M3vWv/c+JDSoU9hBqPqw9lgIbaA== + +lightningcss-cli-darwin-x64@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-darwin-x64/-/lightningcss-cli-darwin-x64-1.22.1.tgz#b134754f79888ecebe912c74b01e77d8ebb0c94e" + integrity sha512-r634KvNQU8iBpVq1GGWG4G361ReREVTtdx9n+0mxrZVelWrQOXUHysHSvZbD+UBf3O2Iy1ie6kLJQEbN+Xk87A== + +lightningcss-cli-freebsd-x64@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-freebsd-x64/-/lightningcss-cli-freebsd-x64-1.22.1.tgz#f173eb0fca32a51b81219f231d7a415b4b6d4f96" + integrity sha512-7djPCTq7eW709ZVuD0UIEiQawF7PBHG1cZ6kWoRgBjk7NuFBLhJA/RrzsdWDC79R8xJc+rSk28qky5vh3Zl6rg== + +lightningcss-cli-linux-arm-gnueabihf@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-arm-gnueabihf/-/lightningcss-cli-linux-arm-gnueabihf-1.22.1.tgz#dd67ecf07555f1db179a79e7d95769beca745ec2" + integrity sha512-kMAjQBL4fJjMH9usR/7p9gf9ILtP31lA3Pn+RjS7+pElzJ0pjkErID4NCnyHdKmXrlzcN/9o02xI+0FOskhf6g== + +lightningcss-cli-linux-arm64-gnu@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-arm64-gnu/-/lightningcss-cli-linux-arm64-gnu-1.22.1.tgz#ccbb97cacb92da9b99f6cb17e2d7778108df515b" + integrity sha512-d5Vw3XZC6Z6Brbtyn99WaFH3viMNqWR7GxZl7KcHIfE9zOHEJfTJZBrCMEJ5DP+r14IVBH+c3cIoLtZHUUXibg== + +lightningcss-cli-linux-arm64-musl@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-arm64-musl/-/lightningcss-cli-linux-arm64-musl-1.22.1.tgz#5c75bae21f0a9e6c7a2154f2803bf61cdaa3b0e7" + integrity sha512-rkJnLZo5ZaFzh2UN3RjB9K/JIhtgcJMhIeE9tMvDeB3B3UUQjfMEqIYfW/KshIoMLk32ZVEuNkKAgztCcn4csw== + +lightningcss-cli-linux-x64-gnu@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-x64-gnu/-/lightningcss-cli-linux-x64-gnu-1.22.1.tgz#d47074ae4f682d64f26c4ce5c6169e297227607a" + integrity sha512-OgfjE7DcBMaCo1gSOR5rL9441ujEbWsA32SRjS7MRw/LKavpFKn+bbqLV5/NC2yvXPDnL6cNuJykvp0EHzqpIw== + +lightningcss-cli-linux-x64-musl@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-x64-musl/-/lightningcss-cli-linux-x64-musl-1.22.1.tgz#d4347844cbe626d4a5d966d6ea8820efe1e5a4f3" + integrity sha512-RyXSN3friFZBWfGZoN9Xtv3GjeDM5/CQcn35ECPo0IC+Y5ZrENRpXab5FR87BWm1qFdqfF28wTAFb8k6eBnAvA== + +lightningcss-cli-win32-x64-msvc@1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli-win32-x64-msvc/-/lightningcss-cli-win32-x64-msvc-1.22.1.tgz#69dbfcd664be0c0e46c95a482c5ba6eb935fc38b" + integrity sha512-VB1IcMsKeHJVyd0bUrcbMSRI+ZQwxvLdk7RX1HfZDNt8wEt63skfGU3DVYDXYibAuDpkwe7BTIG2BiARWtC5xA== + +lightningcss-cli@^1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/lightningcss-cli/-/lightningcss-cli-1.22.1.tgz#ad19ae59f7e335d6c761b26c8703d56a58644c28" + integrity sha512-J4c4n6HOx6Q1qIYHwi169YJIFWkzPibIk5NmbSbZBc63HEGjDRQFJIPWizMWJUjqEmeF8CDnsFCC2R6tGKWpcQ== + dependencies: + detect-libc "^1.0.3" + optionalDependencies: + lightningcss-cli-darwin-arm64 "1.22.1" + lightningcss-cli-darwin-x64 "1.22.1" + lightningcss-cli-freebsd-x64 "1.22.1" + lightningcss-cli-linux-arm-gnueabihf "1.22.1" + lightningcss-cli-linux-arm64-gnu "1.22.1" + lightningcss-cli-linux-arm64-musl "1.22.1" + lightningcss-cli-linux-x64-gnu "1.22.1" + lightningcss-cli-linux-x64-musl "1.22.1" + lightningcss-cli-win32-x64-msvc "1.22.1" + lilconfig@^2.0.5, lilconfig@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" From baf5aaba4aaeedac028d29ab125729d19f780b82 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Tue, 12 Dec 2023 10:07:57 +0200 Subject: [PATCH 02/16] improve combine selector --- .../index.js | 20 ++++++++++++++----- packages/tools/lib/postcss-p/postcss-p2.mjs | 19 ++++++++++++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/packages/tools/lib/postcss-combine-duplicated-selectors/index.js b/packages/tools/lib/postcss-combine-duplicated-selectors/index.js index c337b08d2eb5..6f97a89eb19f 100644 --- a/packages/tools/lib/postcss-combine-duplicated-selectors/index.js +++ b/packages/tools/lib/postcss-combine-duplicated-selectors/index.js @@ -67,6 +67,9 @@ function removeDupProperties(selector, exact) { if (!exact) { // Remove duplicated properties, regardless of value const retainedProps = new Set(); + if (!selector.nodes) { + // console.log(selector) + } for (let actIndex = selector.nodes.length - 1; actIndex >= 1; actIndex--) { const prop = selector.nodes[actIndex].prop; if (prop !== undefined) { @@ -154,22 +157,29 @@ module.exports = (options) => { options.removeDuplicatedProperties || options.removeDuplicatedValues ) { - removeDupProperties( - destination, - options.removeDuplicatedValues, - ); + // removeDupProperties( + // destination, + // options.removeDuplicatedValues, + // ); } } else { if ( options.removeDuplicatedProperties || options.removeDuplicatedValues ) { - removeDupProperties(rule, options.removeDuplicatedValues); + // removeDupProperties(rule, options.removeDuplicatedValues); } // add new selector to symbol table map.set(selector, rule); } }, + OnceExit(root) { + root.nodes.forEach(node => { + if (node.type === "rule") { + removeDupProperties(node, options.removeDuplicatedValues); + } + }) + } }; }, }; diff --git a/packages/tools/lib/postcss-p/postcss-p2.mjs b/packages/tools/lib/postcss-p/postcss-p2.mjs index 65eae9255da1..e6107b2404e8 100644 --- a/packages/tools/lib/postcss-p/postcss-p2.mjs +++ b/packages/tools/lib/postcss-p/postcss-p2.mjs @@ -4,6 +4,8 @@ import * as fs from "fs"; import * as path from "path"; import { writeFile, mkdir } from "fs/promises"; import { getFileContent } from '../postcss-css-to-esm/index.js'; +import postcss from "postcss"; +import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/index.js" const packageJSON = JSON.parse(fs.readFileSync("./package.json")) let inputFiles = await globby("src/**/parameters-bundle.css"); @@ -13,6 +15,12 @@ const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, " const versionStr = escapeVersion(packageJSON.version); const expr = /(--_?ui5)([^\,\:\)\s]+)/g +const removeDuplicateSelectors = async (text) => { + const result = await postcss(combineDuplicatedSelectors).process(text); + // console.log(result.css); + return result.css; +} + let scopingPlugin = { name: 'scoping', setup(build) { @@ -20,13 +28,16 @@ let scopingPlugin = { build.onEnd(result => { result.outputFiles.forEach(async f => { + // remove duplicate selectors + let newText = await removeDuplicateSelectors(f.text); + // scoping - const newText = f.text.replaceAll(expr, `$1-${versionStr}$2`); + newText = newText.replaceAll(expr, `$1-${versionStr}$2`); await mkdir(path.dirname(f.path), {recursive: true}); writeFile(f.path, newText); // json - const jsonPath = f.path.replace("dist/css2", "src/generated2/assets").replace(".css", ".css.json"); + const jsonPath = f.path.replace("dist/css", "src/generated/assets").replace(".css", ".css.json"); await mkdir(path.dirname(jsonPath), {recursive: true}); const data = { @@ -38,7 +49,7 @@ let scopingPlugin = { writeFile(jsonPath, JSON.stringify({_: data})) // JS/TS - const jsPath = f.path.replace("dist/css2", "src/generated2/").replace(".css", ".css.ts"); + const jsPath = f.path.replace("dist/css2", "src/generated/").replace(".css", ".css.ts"); await mkdir(path.dirname(jsPath), {recursive: true}); const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`"); writeFile(jsPath, jsContent); @@ -53,7 +64,7 @@ const result = await esbuild.build({ entryPoints: inputFiles, bundle: true, minify: true, - outdir: 'dist/css2', + outdir: 'dist/css', outbase: 'src', plugins: [ scopingPlugin, From 9398bac76b2267285c366ab0a056c597f825addb Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 15 Dec 2023 12:10:26 +0200 Subject: [PATCH 03/16] chore: working mode --- package.json | 12 +-- packages/fiori/package.json | 1 - packages/localization/package-scripts.cjs | 17 +---- packages/localization/package.json | 1 - packages/main/package.json | 1 - packages/theming/package-scripts.cjs | 15 ++-- packages/theming/package.json | 1 - packages/tools/components-package/nps.js | 22 ++---- .../css-processor-components.mjs | 75 +++++++++++++++++++ .../css-processor-themes.mjs} | 41 +++++----- .../lib/css-processors/scope-variables.mjs | 11 +++ packages/tools/lib/css-processors/shared.mjs | 25 +++++++ .../dev-server/custom-hot-update-plugin.js | 8 +- .../index.js | 3 - packages/tools/lib/postcss-new-files/index.js | 36 --------- packages/tools/lib/postcss-p/postcss-p3.mjs | 62 --------------- vite.config.js | 9 +++ 17 files changed, 170 insertions(+), 170 deletions(-) create mode 100644 packages/tools/lib/css-processors/css-processor-components.mjs rename packages/tools/lib/{postcss-p/postcss-p2.mjs => css-processors/css-processor-themes.mjs} (65%) create mode 100644 packages/tools/lib/css-processors/scope-variables.mjs create mode 100644 packages/tools/lib/css-processors/shared.mjs delete mode 100644 packages/tools/lib/postcss-new-files/index.js delete mode 100644 packages/tools/lib/postcss-p/postcss-p3.mjs diff --git a/package.json b/package.json index 6e0302d7b958..9ed71d69d170 100644 --- a/package.json +++ b/package.json @@ -13,21 +13,21 @@ "generateAPI": "wsrun --exclude-missing generateAPI", "ts": "tsc -b packages/fiori/tsconfig.json", "bundle": "wsrun --exclude-missing bundle", - "copy:generated": "wsrun --exclude-missing copyGenerated", "clean": "wsrun --exclude-missing clean", "scopePrepare:main": "yarn workspace @ui5/webcomponents nps scope.prepare", "scopePrepare:fiori": "yarn workspace @ui5/webcomponents-fiori nps scope.prepare", "watch:base": "yarn workspace @ui5/webcomponents-base nps watch", - "watch:localization": "yarn workspace @ui5/webcomponents-localization nps watch", "watch:main": "yarn workspace @ui5/webcomponents nps watch", "watch:fiori": "yarn workspace @ui5/webcomponents-fiori nps watch", + "watch:allWithDelay": "sleep 5 && npm-run-all --parallel copy-css watch:base watch:main watch:fiori", "scopeWatch:main": "yarn workspace @ui5/webcomponents nps scope.watch", "scopeWatch:fiori": "yarn workspace @ui5/webcomponents-fiori nps scope.watch", "start": "npm-run-all --sequential generate start:all", "startWithScope": "npm-run-all --sequential generate scopePrepare:main scopePrepare:fiori copy-css scopeStart:all", - "start:all": "npm-run-all --parallel copy-css watch:base watch:localization watch:main watch:fiori dev", + "start:all": "npm-run-all --parallel watch:allWithDelay dev", + "start:all2": "npm-run-all generate dev", "dev": "node packages/tools/lib/dev-server/dev-server.js", - "scopeStart:all": "npm-run-all --parallel watch:base watch:localization scopeWatch:main scopeWatch:fiori dev", + "scopeStart:all": "npm-run-all --parallel watch:base scopeWatch:main scopeWatch:fiori dev", "start:playground": "yarn ci:releasebuild && yarn copy-css && yarn workspace @ui5/webcomponents-playground start", "test:base": "yarn workspace @ui5/webcomponents-base test", "test:main": "yarn workspace @ui5/webcomponents test", @@ -36,9 +36,9 @@ "test:fiori": "yarn workspace @ui5/webcomponents-fiori test", "test": "yarn wsrun --exclude-missing test", - "ci:releasebuild": "npm-run-all --sequential generate copy:generated ts generateAPI", + "ci:releasebuild": "npm-run-all --sequential generate ts generateAPI", "ci:lint": "npm-run-all --sequential generate lint", - "ci:testbuild": "npm-run-all --sequential generate copy:generated ts bundle", + "ci:testbuild": "npm-run-all --sequential generate ts bundle", "ci:deploybuild": "yarn ci:testbuild && yarn generateAPI && yarn copy-css && yarn workspace @ui5/webcomponents-playground build", "lint": "wsrun --exclude-missing lint", diff --git a/packages/fiori/package.json b/packages/fiori/package.json index 6494efb170b0..0c6d100d867e 100644 --- a/packages/fiori/package.json +++ b/packages/fiori/package.json @@ -34,7 +34,6 @@ "build": "wc-dev build", "generate": "nps generate", "generateAPI": "nps generateAPI", - "copyGenerated": "nps copyGenerated", "bundle": "nps build.bundle", "test": "wc-dev test", "create-ui5-element": "wc-create-ui5-element", diff --git a/packages/localization/package-scripts.cjs b/packages/localization/package-scripts.cjs index 243185eb91dc..b3c7e82724ba 100644 --- a/packages/localization/package-scripts.cjs +++ b/packages/localization/package-scripts.cjs @@ -1,17 +1,15 @@ const resolve = require("resolve"); -const path = require("path"); const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js"); const replaceGlobalCore = resolve.sync("@ui5/webcomponents-tools/lib/replace-global-core/index.js"); const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/index.js"); -const LIB = path.join(__dirname, `../tools/lib/`); const scripts = { clean: "rimraf dist", lint: "eslint .", - generate: "nps clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports copy.src", + generate: "nps copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports", build: { - "default": "nps clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports build.typescript copy.src", + "default": "nps clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports build.typescript", "replace-amd": "replace-in-file sap.ui.define define dist/**/*.js", "replace-export-true": `replace-in-file ", /* bExport= */ true" "" dist/**/*.js`, "replace-export-false": `replace-in-file ", /* bExport= */ false" "" dist/**/*.js`, @@ -19,21 +17,14 @@ const scripts = { "replace-global-core-usage": `node "${replaceGlobalCore}" dist/`, "esm-abs-to-rel": `node "${esmAbsToRel}" dist/`, typescript: "tsc --build", - jsonImports: "node ./lib/generate-json-imports/cldr.js" + jsonImports: "node ./lib/generate-json-imports/cldr.js", }, typescript: "tsc --build", copy: { "used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`, - cldr: `node ./lib/copy-and-strip-cldr/index.js "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/" src/generated/assets/cldr/`, + cldr: `node ./lib/copy-and-strip-cldr/index.js "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/" dist/generated/assets/cldr/`, overlay: `copy-and-watch "overlay/**/*.js" dist/`, - src: `copy-and-watch "src/**/*.js" dist/`, }, - copyGenerated: `node "${LIB}/copy-and-watch/index.js" --silent "src/generated/**/*.{js,json}" dist/generated/`, - watch: { - "default": "nps watch.src", - src: `nps "copy.src --watch --skip-initial-copy"`, - }, - start: "nps watch", }; module.exports = { diff --git a/packages/localization/package.json b/packages/localization/package.json index 76649dd0ac97..03b52a9195d2 100644 --- a/packages/localization/package.json +++ b/packages/localization/package.json @@ -26,7 +26,6 @@ "start": "nps start", "build": "nps build", "generate": "nps generate", - "copyGenerated": "nps copyGenerated", "prepublishOnly": "npm run clean && npm run build" }, "devDependencies": { diff --git a/packages/main/package.json b/packages/main/package.json index eee678d0bc2e..1e3432108119 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -23,7 +23,6 @@ "watch": "wc-dev watch", "generate": "nps generate", "generateAPI": "nps generateAPI", - "copyGenerated": "nps copyGenerated", "build": "wc-dev build", "bundle": "nps build.bundle", "test": "wc-dev test", diff --git a/packages/theming/package-scripts.cjs b/packages/theming/package-scripts.cjs index 602d01732381..97769421be20 100644 --- a/packages/theming/package-scripts.cjs +++ b/packages/theming/package-scripts.cjs @@ -1,23 +1,24 @@ const resolve = require("resolve"); const assets = require('@ui5/webcomponents-tools/assets-meta.js'); +const path = require('path'); const jsonImportsScript = resolve.sync("@ui5/webcomponents-tools/lib/generate-json-imports/themes.js"); const generateReportScript = resolve.sync("@ui5/webcomponents-theming/lib/generate-css-vars-usage-report/index.js"); +const LIB = path.join(__dirname, `../tools/lib/`); + module.exports = { scripts: { clean: "rimraf dist && rimraf src/generated", - generate: `cross-env UI5_TS=true nps clean build.src build.postcss build.jsonImports`, + generate: `cross-env UI5_TS=true nps build.postcss build.jsonImports`, build: { default: `cross-env UI5_TS=true nps clean build.src build.postcss build.jsonImports build.typescript generateReport`, - src: `copy-and-watch "src/**/*.{js,css}" dist/`, + src: `copy-and-watch "src/**/*.{json}" dist/`, typescript: "tsc", - postcss: "postcss dist/**/parameters-bundle.css --config config/postcss.themes --base dist/ --dir dist/css/", - jsonImports: `node "${jsonImportsScript}" src/generated/assets/themes src/generated/json-imports`, + postcss: `node "${LIB}/css-processors/css-processor-themes.mjs"`, + postcss2: "postcss dist/**/parameters-bundle.css --config config/postcss.themes --base dist/ --dir dist/css/", + jsonImports: `node "${jsonImportsScript}" dist/generated/assets/themes src/generated/json-imports`, }, - copyGenerated: `copy-and-watch "src/generated/**/*.{js,css,json}" dist/generated/`, generateReport: `node "${generateReportScript}"`, }, }; - -console.log(JSON.stringify(module.exports, 2, 2)) diff --git a/packages/theming/package.json b/packages/theming/package.json index 2b8f3c2f4e17..3a20845721d5 100644 --- a/packages/theming/package.json +++ b/packages/theming/package.json @@ -20,7 +20,6 @@ "clean": "nps clean", "build": "nps build", "generate": "nps generate", - "copyGenerated": "nps copyGenerated", "start": "nps start", "verify": "node ./lib/verify-vars/index.js", "prepublishOnly": "npm run clean && npm run build" diff --git a/packages/tools/components-package/nps.js b/packages/tools/components-package/nps.js index 1739636cb22a..1e01b0be72da 100644 --- a/packages/tools/components-package/nps.js +++ b/packages/tools/components-package/nps.js @@ -68,27 +68,23 @@ const getScripts = (options) => { styleRelated: "nps build.styles build.jsonImports build.jsImports", typescript: tsCommandOld, }, - copyGenerated: `node "${LIB}/copy-and-watch/index.js" --silent "src/generated/**/*.{js,json}" dist/generated/`, build: { default: "nps prepare lint build.bundle", // build.bundle2 templates: `mkdirp src/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`, styles: { - default: `concurrently "nps build.styles.themes2" "nps build.styles.components2"`, - default2: `nps build.styles.themes build.styles.components`, - themes: `node "${LIB}/postcss-p/postcss-p.mjs"`, - themes2: `node "${LIB}/postcss-p/postcss-p2.mjs"`, - components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script - components2: `node "${LIB}/postcss-p/postcss-p3.mjs"`, + default: `concurrently "nps build.styles.themes" "nps build.styles.components"`, + themes: `node "${LIB}/css-processors/css-processor-themes.mjs"`, + components: `node "${LIB}/css-processors/css-processor-components.mjs"`, }, i18n: { default: "nps build.i18n.defaultsjs build.i18n.json", defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`, - json: `node "${LIB}/i18n/toJSON.js" src/i18n src/generated/assets/i18n`, + json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`, }, jsonImports: { default: "mkdirp src/generated/json-imports && nps build.jsonImports.themes build.jsonImports.i18n", - themes: `node "${LIB}/generate-json-imports/themes.js" src/generated/assets/themes src/generated/json-imports`, - i18n: `node "${LIB}/generate-json-imports/i18n.js" src/generated/assets/i18n src/generated/json-imports`, + themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes src/generated/json-imports`, + i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n src/generated/json-imports`, }, jsImports: { default: "mkdirp src/generated/js-imports && nps build.jsImports.illustrationsLoaders", @@ -114,11 +110,7 @@ const getScripts = (options) => { styles: { default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"', themes: 'nps "build.styles.themes -w"', - components: { - default: 'concurrently "nps watch.styles.components.existingFiles" "nps watch.styles.components.newFiles"', - existingFiles: `nps "build.styles.components -w"`, - newFiles: `node "${LIB}/postcss-new-files/index.js" --srcFiles="src/themes/*.css"`, - }, + components: `nps "build.styles.components -w"`, }, templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"', api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"', diff --git a/packages/tools/lib/css-processors/css-processor-components.mjs b/packages/tools/lib/css-processors/css-processor-components.mjs new file mode 100644 index 000000000000..9c3f5f75d1e4 --- /dev/null +++ b/packages/tools/lib/css-processors/css-processor-components.mjs @@ -0,0 +1,75 @@ +import 'zx/globals'; +import * as esbuild from 'esbuild' +import * as fs from "fs"; +import * as path from "path"; +import { writeFile, readFile, mkdir } from "fs/promises"; +import { getFileContent } from '../postcss-css-to-esm/index.js'; +import chokidar from "chokidar"; +import scopeVariables from "./scope-variables.mjs"; +import { writeFileIfChanged } from "./shared.mjs"; + +const packageJSON = JSON.parse(fs.readFileSync("./package.json")) +const inputFilesGlob = "src/themes/*.css"; +const restArgs = process.argv.slice(2); + +let customPlugin = { + name: 'ui5-tools', + setup(build) { + build.initialOptions.write = false; + + build.onEnd(result => { + result.outputFiles.forEach(async f => { + // scoping + const newText = scopeVariables(f.text, packageJSON); + await mkdir(path.dirname(f.path), {recursive: true}); + writeFile(f.path, newText); + + // JS/TS + const jsPath = f.path.replace("dist/css", "src/generated/").replace(".css", ".css.ts"); + const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`", true); + writeFileIfChanged(jsPath, jsContent); + }); + }) + }, +} + +const getConfig = async () => { + const config = { + entryPoints: await globby(inputFilesGlob), + bundle: true, + minify: true, + outdir: 'dist/css', + outbase: 'src', + plugins: [ + customPlugin, + ] + }; + return config; +} + +if (restArgs.includes("-w")) { + let ready; + let config = await getConfig(); + let ctx = await esbuild.context(config); + await ctx.watch() + console.log('watching...') + + // when new component css files are added, they do not trigger a build as no one directly imports them + // restart the watch mode with the new entry points if a css file is added. + const watcher = chokidar.watch(inputFilesGlob); + watcher.on("ready", () => { + ready = true; // Initial scan is over -> waiting for new files + }); + watcher.on("add", async path => { + if (ready) { + // new file + ctx.dispose(); + config = await getConfig(); + ctx = await esbuild.context(config); + ctx.watch(); + } + }); +} else { + const config = await getConfig(); + const result = await esbuild.build(config); +} diff --git a/packages/tools/lib/postcss-p/postcss-p2.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs similarity index 65% rename from packages/tools/lib/postcss-p/postcss-p2.mjs rename to packages/tools/lib/css-processors/css-processor-themes.mjs index e6107b2404e8..90118fbf5063 100644 --- a/packages/tools/lib/postcss-p/postcss-p2.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -6,18 +6,16 @@ import { writeFile, mkdir } from "fs/promises"; import { getFileContent } from '../postcss-css-to-esm/index.js'; import postcss from "postcss"; import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/index.js" +import { writeFileIfChanged } from "./shared.mjs"; +import scopeVariables from "./scope-variables.mjs"; const packageJSON = JSON.parse(fs.readFileSync("./package.json")) + let inputFiles = await globby("src/**/parameters-bundle.css"); const restArgs = process.argv.slice(2); -const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); -const versionStr = escapeVersion(packageJSON.version); -const expr = /(--_?ui5)([^\,\:\)\s]+)/g - const removeDuplicateSelectors = async (text) => { const result = await postcss(combineDuplicatedSelectors).process(text); - // console.log(result.css); return result.css; } @@ -32,35 +30,30 @@ let scopingPlugin = { let newText = await removeDuplicateSelectors(f.text); // scoping - newText = newText.replaceAll(expr, `$1-${versionStr}$2`); + newText = scopeVariables(newText, packageJSON); await mkdir(path.dirname(f.path), {recursive: true}); writeFile(f.path, newText); - // json - const jsonPath = f.path.replace("dist/css", "src/generated/assets").replace(".css", ".css.json"); + // JSON + const jsonPath = f.path.replace("dist/css", "dist/generated/assets").replace(".css", ".css.json"); await mkdir(path.dirname(jsonPath), {recursive: true}); - const data = { packageName: packageJSON.name, fileName: jsonPath.substr(jsonPath.lastIndexOf("themes")), content: newText, }; - - writeFile(jsonPath, JSON.stringify({_: data})) + writeFileIfChanged(jsonPath, JSON.stringify({_: data})); // JS/TS - const jsPath = f.path.replace("dist/css2", "src/generated/").replace(".css", ".css.ts"); - await mkdir(path.dirname(jsPath), {recursive: true}); + const jsPath = f.path.replace("dist/css", "src/generated/").replace(".css", ".css.ts"); const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`"); - writeFile(jsPath, jsContent); - // console.log(f.path, newText); + writeFileIfChanged(jsPath, jsContent); }); }) }, } -// $`esbuild ${file} --bundle --minify --outdir=dist/css2 --outbase=src ${restArgs}`; -const result = await esbuild.build({ +const config = { entryPoints: inputFiles, bundle: true, minify: true, @@ -68,6 +61,14 @@ const result = await esbuild.build({ outbase: 'src', plugins: [ scopingPlugin, - ] -}) -// console.log({result}) \ No newline at end of file + ], + external: ["*.ttf", "*.woff", "*.woff2"], +}; + +if (restArgs.includes("-w")) { + let ctx = await esbuild.context(config); + await ctx.watch() + console.log('watching...') +} else { + const result = await esbuild.build(config); +} \ No newline at end of file diff --git a/packages/tools/lib/css-processors/scope-variables.mjs b/packages/tools/lib/css-processors/scope-variables.mjs new file mode 100644 index 000000000000..054c015fe3b4 --- /dev/null +++ b/packages/tools/lib/css-processors/scope-variables.mjs @@ -0,0 +1,11 @@ + +const scopeVariables = (cssText, packageJSON) => { + const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); + const versionStr = escapeVersion(packageJSON.version); + const expr = /(--_?ui5)([^\,\:\)\s]+)/g; + + return cssText.replaceAll(expr, `$1-${versionStr}$2`); +} + +export default scopeVariables; + diff --git a/packages/tools/lib/css-processors/shared.mjs b/packages/tools/lib/css-processors/shared.mjs new file mode 100644 index 000000000000..fc670037c8aa --- /dev/null +++ b/packages/tools/lib/css-processors/shared.mjs @@ -0,0 +1,25 @@ +import { writeFile, readFile, mkdir } from "fs/promises"; + +const readOldContent = async (fileName) => { + // it seems slower to read the old content, but writing the same content with no real changes + // (as in initial build and then watch mode) will cause an unnecessary dev server refresh + let oldContent = ""; + try { + oldContent = (await readFile(fileName)).toString(); + } catch (e) { + // file not found + } + return oldContent; +} + +const writeFileIfChanged = async (fileName, content) => { + const oldContent = await readOldContent(fileName); + if (content !== oldContent) { + if (!oldContent) { + await mkdir(path.dirname(fileName), {recursive: true}); + } + return writeFile(fileName, content); + } +} + +export { writeFileIfChanged } \ No newline at end of file diff --git a/packages/tools/lib/dev-server/custom-hot-update-plugin.js b/packages/tools/lib/dev-server/custom-hot-update-plugin.js index 52e19cc7b45a..6a41f652c99a 100644 --- a/packages/tools/lib/dev-server/custom-hot-update-plugin.js +++ b/packages/tools/lib/dev-server/custom-hot-update-plugin.js @@ -3,15 +3,15 @@ const fs = require("fs"); /** * A change is observed on MacOS since 13.5, where the build generates a large amount * of JSON file that spotlight search has to index, as they are considered new files. - * + * * Starting the vitejs dev server reads all of these files and this triggers the indexing. * The indexing has a side effect of changing some file metadata (can be checked with `mdls `). * This metadata change is changing the ctime of the file, but not the mtime. This can be checked with `stat -x - * + * * Essentially only metadata is changed, not content. This should not cause a page refresh, * but chokidar reports this change and vite refreshes the page. * The indexing is running with a 10 second interval, so for roughtly 20 minutes vite is refreshing the page every 10 seconds - * + * * This plugin checks if the file causing the refresh is a generated json file (dist/*.json) and if ctime is changed after mtime * In that case, returing an empty array tells vitejs that a custom update will be made by the plugin, * which is in effect ignoring the page refresh. @@ -22,7 +22,7 @@ const customHotUpdate = async () => { name: 'custom-hot-update', handleHotUpdate(ctx) { // custom check for generated json files - if (ctx.file.includes("src/") && ctx.file.endsWith(".json")) { + if (ctx.file.endsWith(".json")) { const stat = fs.statSync(ctx.file); // metadata change only diff --git a/packages/tools/lib/postcss-combine-duplicated-selectors/index.js b/packages/tools/lib/postcss-combine-duplicated-selectors/index.js index 6f97a89eb19f..ca6eb33e7aa5 100644 --- a/packages/tools/lib/postcss-combine-duplicated-selectors/index.js +++ b/packages/tools/lib/postcss-combine-duplicated-selectors/index.js @@ -67,9 +67,6 @@ function removeDupProperties(selector, exact) { if (!exact) { // Remove duplicated properties, regardless of value const retainedProps = new Set(); - if (!selector.nodes) { - // console.log(selector) - } for (let actIndex = selector.nodes.length - 1; actIndex >= 1; actIndex--) { const prop = selector.nodes[actIndex].prop; if (prop !== undefined) { diff --git a/packages/tools/lib/postcss-new-files/index.js b/packages/tools/lib/postcss-new-files/index.js deleted file mode 100644 index a3bd4f95f4f5..000000000000 --- a/packages/tools/lib/postcss-new-files/index.js +++ /dev/null @@ -1,36 +0,0 @@ -const chokidar = require("chokidar"); -const commandLineArgs = require("command-line-args"); -const { exec } = require("child_process"); - -const options = commandLineArgs([ - { name: "srcFiles", type: String }, -]); - -const runPostcss = path => { - let command = `postcss ${path} --config config/postcss.components --base src --dir dist/css/`; - console.log(`Executing: ${command}`); - exec(command, (err, stdout, stderr) => { - if (err) { - console.log(`Could not run postcss for ${path}. Error: ${err}`); - } - }); - - command = `${command} -w`; - console.log(`Executing: ${command}`); - exec(command, (err, stdout, stderr) => { - if (err) { - console.log(`Could not run postcss in watch mode for ${path}. Error: ${err}`); - } - }); -}; - -let ready = false; // Do nothing until the ready event has been fired (we don't want to recompile all files initially) -const watcher = chokidar.watch(options.srcFiles); -watcher.on("ready", () => { - ready = true; // Initial scan is over -> waiting for new files -}); -watcher.on("add", path => { - if (ready) { - runPostcss(path); - } -}); diff --git a/packages/tools/lib/postcss-p/postcss-p3.mjs b/packages/tools/lib/postcss-p/postcss-p3.mjs deleted file mode 100644 index 0e3f1b871a0d..000000000000 --- a/packages/tools/lib/postcss-p/postcss-p3.mjs +++ /dev/null @@ -1,62 +0,0 @@ -import 'zx/globals'; -import * as esbuild from 'esbuild' -import * as fs from "fs"; -import * as path from "path"; -import { writeFile, mkdir } from "fs/promises"; -import { getFileContent } from '../postcss-css-to-esm/index.js'; - -const packageJSON = JSON.parse(fs.readFileSync("./package.json")) -let inputFiles = await globby("src/themes/*.css"); -const restArgs = process.argv.slice(2); - -const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); -const versionStr = escapeVersion(packageJSON.version); -const expr = /(--_?ui5)([^\,\:\)\s]+)/g - -let scopingPlugin = { - name: 'scoping', - setup(build) { - build.initialOptions.write = false; - - build.onEnd(result => { - result.outputFiles.forEach(async f => { - // scoping - const newText = f.text.replaceAll(expr, `$1-${versionStr}$2`); - await mkdir(path.dirname(f.path), {recursive: true}); - writeFile(f.path, newText); - - // json - // const jsonPath = f.path.replace("dist/css2", "src/generated/assets").replace(".css", ".css.json"); - // await mkdir(path.dirname(jsonPath), {recursive: true}); - - // const data = { - // packageName: packageJSON.name, - // fileName: jsonPath.substr(jsonPath.lastIndexOf("themes")), - // content: newText, - // }; - - // writeFile(jsonPath, JSON.stringify({_: data})) - - // JS/TS - const jsPath = f.path.replace("dist/css2", "src/generated/").replace(".css", ".css.ts"); - await mkdir(path.dirname(jsPath), {recursive: true}); - const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`", true); - writeFile(jsPath, jsContent); - // console.log(f.path, newText); - }); - }) - }, -} - -// $`esbuild ${file} --bundle --minify --outdir=dist/css2 --outbase=src ${restArgs}`; -const result = await esbuild.build({ - entryPoints: inputFiles, - bundle: true, - minify: true, - outdir: 'dist/css2', - outbase: 'src', - plugins: [ - scopingPlugin, - ] -}) -// console.log({result}) \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 0d7f1a21a60f..b3563a55830f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -28,6 +28,15 @@ const customResolver = (id, source, options) => { return resolved; } + // json files are always in dist, this saves a separate copy task + if (id.endsWith(".json")) { + let absoluteId = join(dirname(source), id); + // join returns paths with \\ on windows, so the replaces won't work unless converted to posix paths / + absoluteId = toPosixPath(absoluteId); + const resolved = absoluteId.replace("/src/", "/dist/"); + return resolved; + } + if (id.startsWith("./") || id.startsWith("../")) { // `/sap/base/` and `sap/ui/core/` files imported from `src` are actually in dist // except 4 files with are ts files in src and could be imported from `dist` From 456b2fb50e95170d2557b767ea9bb8e3c65ebcbc Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 15 Dec 2023 12:27:50 +0200 Subject: [PATCH 04/16] chore: cleanup --- packages/main/package.json | 3 +-- packages/main/src/themes/sap_fiori_3/Avatar-parameters.css | 1 - packages/main/test.css | 7 ------- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 packages/main/test.css diff --git a/packages/main/package.json b/packages/main/package.json index 1e3432108119..a9cc16eb882d 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -56,7 +56,6 @@ }, "devDependencies": { "@ui5/webcomponents-tools": "1.21.0-rc.0", - "chromedriver": "119.0.1", - "lightningcss-cli": "^1.22.1" + "chromedriver": "119.0.1" } } diff --git a/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css b/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css index b0fa9c77746f..686d857d9636 100644 --- a/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css +++ b/packages/main/src/themes/sap_fiori_3/Avatar-parameters.css @@ -6,5 +6,4 @@ --_ui5_avatar_fontsize_M: 1.5rem; --_ui5_avatar_fontsize_L: 2.25rem; --_ui5_avatar_fontsize_XL: 3rem; - --_ui5_avatar_fontsize_S: 1.125rem; } \ No newline at end of file diff --git a/packages/main/test.css b/packages/main/test.css deleted file mode 100644 index 69dd66eeafc8..000000000000 --- a/packages/main/test.css +++ /dev/null @@ -1,7 +0,0 @@ -:root { - --var1: 1; -} - -:root { - --var1: 2; -} From dc9df07289c6c24ae78f09cbd518fda8e6b1cd36 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 15 Dec 2023 12:57:30 +0200 Subject: [PATCH 05/16] fix: var scoping for overrides --- .../css-processors/css-processor-themes.mjs | 2 +- .../lib/css-processors/scope-variables.mjs | 39 ++++++++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/packages/tools/lib/css-processors/css-processor-themes.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs index 90118fbf5063..f4dc3642a52d 100644 --- a/packages/tools/lib/css-processors/css-processor-themes.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -30,7 +30,7 @@ let scopingPlugin = { let newText = await removeDuplicateSelectors(f.text); // scoping - newText = scopeVariables(newText, packageJSON); + newText = scopeVariables(newText, packageJSON, f.path); await mkdir(path.dirname(f.path), {recursive: true}); writeFile(f.path, newText); diff --git a/packages/tools/lib/css-processors/scope-variables.mjs b/packages/tools/lib/css-processors/scope-variables.mjs index 054c015fe3b4..a248204ef678 100644 --- a/packages/tools/lib/css-processors/scope-variables.mjs +++ b/packages/tools/lib/css-processors/scope-variables.mjs @@ -1,7 +1,42 @@ +import * as path from "path"; -const scopeVariables = (cssText, packageJSON) => { +/** + * Tries to detect an override for a package + * @param {*} filePath For example: /my_project/src/themes/overrides/@ui5/webcomponents/my_custom_theme/parameters-bundle.css + * @returns + */ +const getOverrideVersion = filePath => { + if (!filePath) { + return; + } + + if (!filePath.includes(`overrides${path.sep}`)) { + return; // The "overrides/" directory is the marker + } + const override = filePath.split(`overrides${path.sep}`)[1]; // For example, this will be: @ui5/webcomponents/my_custom_theme/parameters-bundle.css + if (!override) { + return; // There must be other directories after overrides/, the path can't end with it + } + const parts = override.split(path.sep); + if (parts.length < 3) { + return; // There must be at least a directory for the theme that is being overridden (my_custom_theme) and the name of the CSS file after the name of the package that is overridden + } + const packageName = parts.slice(0, -2).join(path.sep); // After the last 2 parts are removed (my_custom_theme and parameters-bundle.css from the example), the rest is the package + + let overrideVersion; + try { + overrideVersion = require(`${packageName}${path.sep}package.json`).version; + } catch (e) { + console.log(`Error requiring package ${packageName}: ${e.message}`); + } + + return overrideVersion; +} + +const scopeVariables = (cssText, packageJSON, inputFile) => { const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); - const versionStr = escapeVersion(packageJSON.version); + const versionStr = escapeVersion(getOverrideVersion(inputFile) || packageJSON.version); + const expr = /(--_?ui5)([^\,\:\)\s]+)/g; return cssText.replaceAll(expr, `$1-${versionStr}$2`); From 0719dd881f6d536bee59bbd303dad7b00cd9d71b Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 15 Dec 2023 14:15:33 +0200 Subject: [PATCH 06/16] fix: strip theming base content --- .../tools/lib/css-processors/css-processor-themes.mjs | 5 ++++- packages/tools/lib/css-processors/shared.mjs | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/tools/lib/css-processors/css-processor-themes.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs index f4dc3642a52d..b05732e6c93a 100644 --- a/packages/tools/lib/css-processors/css-processor-themes.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -6,7 +6,7 @@ import { writeFile, mkdir } from "fs/promises"; import { getFileContent } from '../postcss-css-to-esm/index.js'; import postcss from "postcss"; import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/index.js" -import { writeFileIfChanged } from "./shared.mjs"; +import { writeFileIfChanged, stripThemingBaseContent } from "./shared.mjs"; import scopeVariables from "./scope-variables.mjs"; const packageJSON = JSON.parse(fs.readFileSync("./package.json")) @@ -29,6 +29,9 @@ let scopingPlugin = { // remove duplicate selectors let newText = await removeDuplicateSelectors(f.text); + // strip unnecessary theming-base-content + newText = stripThemingBaseContent(newText); + // scoping newText = scopeVariables(newText, packageJSON, f.path); await mkdir(path.dirname(f.path), {recursive: true}); diff --git a/packages/tools/lib/css-processors/shared.mjs b/packages/tools/lib/css-processors/shared.mjs index fc670037c8aa..5fc93f376346 100644 --- a/packages/tools/lib/css-processors/shared.mjs +++ b/packages/tools/lib/css-processors/shared.mjs @@ -22,4 +22,13 @@ const writeFileIfChanged = async (fileName, content) => { } } -export { writeFileIfChanged } \ No newline at end of file +// strips the unnecessary theming data coming from @sap-theming/theming-base-content and leaves only the css parameters +const stripThemingBaseContent = css => { + css = css.replace(/\.sapThemeMeta[\s\S]*?:root/, ":root"); + css = css.replace(/\.background-image.*{.*}/, ""); + css = css.replace(/\.sapContrast[ ]*:root[\s\S]*?}/, ""); + css = css.replace(/--sapFontUrl.*\);?/, ""); + return JSON.stringify(css); +} + +export { writeFileIfChanged, stripThemingBaseContent } \ No newline at end of file From 31915cfa488e2e05bd5e27196dd88ff656e49cf1 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 15 Dec 2023 16:56:01 +0200 Subject: [PATCH 07/16] fix: strip content returns string --- packages/tools/lib/css-processors/shared.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tools/lib/css-processors/shared.mjs b/packages/tools/lib/css-processors/shared.mjs index 5fc93f376346..19eb45790ae7 100644 --- a/packages/tools/lib/css-processors/shared.mjs +++ b/packages/tools/lib/css-processors/shared.mjs @@ -28,7 +28,7 @@ const stripThemingBaseContent = css => { css = css.replace(/\.background-image.*{.*}/, ""); css = css.replace(/\.sapContrast[ ]*:root[\s\S]*?}/, ""); css = css.replace(/--sapFontUrl.*\);?/, ""); - return JSON.stringify(css); + return css; } export { writeFileIfChanged, stripThemingBaseContent } \ No newline at end of file From 4620051ec0366464d7ac93b25c88589ffd46f0af Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 18 Dec 2023 11:42:24 +0200 Subject: [PATCH 08/16] fix: windows support --- package.json | 2 +- packages/tools/lib/css-processors/css-processor-themes.mjs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9ed71d69d170..b3c333775d9c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "watch:base": "yarn workspace @ui5/webcomponents-base nps watch", "watch:main": "yarn workspace @ui5/webcomponents nps watch", "watch:fiori": "yarn workspace @ui5/webcomponents-fiori nps watch", - "watch:allWithDelay": "sleep 5 && npm-run-all --parallel copy-css watch:base watch:main watch:fiori", + "watch:allWithDelay": "node -e 'setTimeout(function(){}, 5000)' && npm-run-all --parallel copy-css watch:base watch:main watch:fiori", "scopeWatch:main": "yarn workspace @ui5/webcomponents nps scope.watch", "scopeWatch:fiori": "yarn workspace @ui5/webcomponents-fiori nps scope.watch", "start": "npm-run-all --sequential generate start:all", diff --git a/packages/tools/lib/css-processors/css-processor-themes.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs index b05732e6c93a..3f10be8264f1 100644 --- a/packages/tools/lib/css-processors/css-processor-themes.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -38,7 +38,7 @@ let scopingPlugin = { writeFile(f.path, newText); // JSON - const jsonPath = f.path.replace("dist/css", "dist/generated/assets").replace(".css", ".css.json"); + const jsonPath = f.path.replace(/dist[\/\\]css/, "dist/generated/assets").replace(".css", ".css.json"); await mkdir(path.dirname(jsonPath), {recursive: true}); const data = { packageName: packageJSON.name, @@ -48,7 +48,7 @@ let scopingPlugin = { writeFileIfChanged(jsonPath, JSON.stringify({_: data})); // JS/TS - const jsPath = f.path.replace("dist/css", "src/generated/").replace(".css", ".css.ts"); + const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", ".css.ts"); const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`"); writeFileIfChanged(jsPath, jsContent); }); From 1bccbedb1a1ce7acd29f5b2a38a45839581e56ed Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 18 Dec 2023 12:22:43 +0200 Subject: [PATCH 09/16] fix: windows start --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b3c333775d9c..ac1c749980fd 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "watch:base": "yarn workspace @ui5/webcomponents-base nps watch", "watch:main": "yarn workspace @ui5/webcomponents nps watch", "watch:fiori": "yarn workspace @ui5/webcomponents-fiori nps watch", - "watch:allWithDelay": "node -e 'setTimeout(function(){}, 5000)' && npm-run-all --parallel copy-css watch:base watch:main watch:fiori", + "watch:allWithDelay": "node -e \"setTimeout(function(){}, 5000)\" && npm-run-all --parallel copy-css watch:base watch:main watch:fiori", "scopeWatch:main": "yarn workspace @ui5/webcomponents nps scope.watch", "scopeWatch:fiori": "yarn workspace @ui5/webcomponents-fiori nps scope.watch", "start": "npm-run-all --sequential generate start:all", From f2c201e5bb494179bacdc0dc00d3f3acdac312ae Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 18 Dec 2023 13:37:09 +0200 Subject: [PATCH 10/16] fix: more windows fixes --- packages/tools/lib/css-processors/css-processor-components.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tools/lib/css-processors/css-processor-components.mjs b/packages/tools/lib/css-processors/css-processor-components.mjs index 9c3f5f75d1e4..cbfc70dd5652 100644 --- a/packages/tools/lib/css-processors/css-processor-components.mjs +++ b/packages/tools/lib/css-processors/css-processor-components.mjs @@ -25,7 +25,7 @@ let customPlugin = { writeFile(f.path, newText); // JS/TS - const jsPath = f.path.replace("dist/css", "src/generated/").replace(".css", ".css.ts"); + const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", ".css.ts"); const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`", true); writeFileIfChanged(jsPath, jsContent); }); From 4f0ed2931a78deec14eede85709df2a6fba52bc1 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 18 Dec 2023 20:44:04 +0200 Subject: [PATCH 11/16] chore: add esbuild dep --- packages/tools/package.json | 2 +- yarn.lock | 205 ++++++++++++++++++++++++------------ 2 files changed, 139 insertions(+), 68 deletions(-) diff --git a/packages/tools/package.json b/packages/tools/package.json index ef4266c7e8b0..4803601ea4e1 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -76,7 +76,7 @@ } }, "devDependencies": { - "lightningcss-cli": "^1.22.1", + "esbuild": "^0.19.9", "yargs": "^17.5.1" } } diff --git a/yarn.lock b/yarn.lock index 248e5e01d57a..f41ebcf6cab3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1514,6 +1514,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.13.tgz#70ef455455654c7800c31ae55ae295d81712238c" integrity sha512-j7NhycJUoUAG5kAzGf4fPWfd17N6SM3o1X6MlXVqfHvs2buFraCJzos9vbeWjLxOyBKHyPOnuCuipbhvbYtTAg== +"@esbuild/android-arm64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.9.tgz#683794bdc3d27222d3eced7b74cad15979548031" + integrity sha512-q4cR+6ZD0938R19MyEW3jEsMzbb/1rulLXiNAJQADD/XYp7pT+rOS5JGxvpRW8dFDEfjW4wLgC/3FXIw4zYglQ== + "@esbuild/android-arm@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" @@ -1524,6 +1529,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.13.tgz#15db83099855fc4193658a40687893ee5c95d7a9" integrity sha512-KwqFhxRFMKZINHzCqf8eKxE0XqWlAVPRxwy6rc7CbVFxzUWB2sA/s3hbMZeemPdhN3fKBkqOaFhTbS8xJXYIWQ== +"@esbuild/android-arm@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.9.tgz#21a4de41f07b2af47401c601d64dfdefd056c595" + integrity sha512-jkYjjq7SdsWuNI6b5quymW0oC83NN5FdRPuCbs9HZ02mfVdAP8B8eeqLSYU3gb6OJEaY5CQabtTFbqBf26H3GA== + "@esbuild/android-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" @@ -1534,6 +1544,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.13.tgz#473d589219e1c06e305cf61ca77b8f69d9b6ffab" integrity sha512-M2eZkRxR6WnWfVELHmv6MUoHbOqnzoTVSIxgtsyhm/NsgmL+uTmag/VVzdXvmahak1I6sOb1K/2movco5ikDJg== +"@esbuild/android-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.9.tgz#e2d7674bc025ddc8699f0cc76cb97823bb63c252" + integrity sha512-KOqoPntWAH6ZxDwx1D6mRntIgZh9KodzgNOy5Ebt9ghzffOk9X2c1sPwtM9P+0eXbefnDhqYfkh5PLP5ULtWFA== + "@esbuild/darwin-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" @@ -1544,6 +1559,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.13.tgz#0f525b2c1821a0591a06963582e5dc749ba51d45" integrity sha512-f5goG30YgR1GU+fxtaBRdSW3SBG9pZW834Mmhxa6terzcboz7P2R0k4lDxlkP7NYRIIdBbWp+VgwQbmMH4yV7w== +"@esbuild/darwin-arm64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.9.tgz#ae7a582289cc5c0bac15d4b9020a90cb7288f1e9" + integrity sha512-KBJ9S0AFyLVx2E5D8W0vExqRW01WqRtczUZ8NRu+Pi+87opZn5tL4Y0xT0mA4FtHctd0ZgwNoN639fUUGlNIWw== + "@esbuild/darwin-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" @@ -1554,6 +1574,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.13.tgz#81965b690bae86bf1289b2ce0732506fd41fb545" integrity sha512-RIrxoKH5Eo+yE5BtaAIMZaiKutPhZjw+j0OCh8WdvKEKJQteacq0myZvBDLU+hOzQOZWJeDnuQ2xgSScKf1Ovw== +"@esbuild/darwin-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.9.tgz#8a216c66dcf51addeeb843d8cfaeff712821d12b" + integrity sha512-vE0VotmNTQaTdX0Q9dOHmMTao6ObjyPm58CHZr1UK7qpNleQyxlFlNCaHsHx6Uqv86VgPmR4o2wdNq3dP1qyDQ== + "@esbuild/freebsd-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" @@ -1564,6 +1589,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.13.tgz#895bb37fdea886db09549119158e044f146861f0" integrity sha512-AfRPhHWmj9jGyLgW/2FkYERKmYR+IjYxf2rtSLmhOrPGFh0KCETFzSjx/JX/HJnvIqHt/DRQD/KAaVsUKoI3Xg== +"@esbuild/freebsd-arm64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.9.tgz#63d4f603e421252c3cd836b18d01545be7c6c440" + integrity sha512-uFQyd/o1IjiEk3rUHSwUKkqZwqdvuD8GevWF065eqgYfexcVkxh+IJgwTaGZVu59XczZGcN/YMh9uF1fWD8j1g== + "@esbuild/freebsd-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" @@ -1574,6 +1604,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.13.tgz#0b1dfde3ff1b18f03f71e460f91dc463e6a23903" integrity sha512-pGzWWZJBInhIgdEwzn8VHUBang8UvFKsvjDkeJ2oyY5gZtAM6BaxK0QLCuZY+qoj/nx/lIaItH425rm/hloETA== +"@esbuild/freebsd-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.9.tgz#a3db52595be65360eae4de1d1fa3c1afd942e1e4" + integrity sha512-WMLgWAtkdTbTu1AWacY7uoj/YtHthgqrqhf1OaEWnZb7PQgpt8eaA/F3LkV0E6K/Lc0cUr/uaVP/49iE4M4asA== + "@esbuild/linux-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" @@ -1584,6 +1619,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.13.tgz#350febed5d32d8ec1a424a4c4d7c9ba885604960" integrity sha512-hCzZbVJEHV7QM77fHPv2qgBcWxgglGFGCxk6KfQx6PsVIdi1u09X7IvgE9QKqm38OpkzaAkPnnPqwRsltvLkIQ== +"@esbuild/linux-arm64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.9.tgz#4ae5811ce9f8d7df5eb9edd9765ea9401a534f13" + integrity sha512-PiPblfe1BjK7WDAKR1Cr9O7VVPqVNpwFcPWgfn4xu0eMemzRp442hXyzF/fSwgrufI66FpHOEJk0yYdPInsmyQ== + "@esbuild/linux-arm@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" @@ -1594,6 +1634,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.13.tgz#47639d73d894026350eaccf7c174f1d26b747d6a" integrity sha512-4iMxLRMCxGyk7lEvkkvrxw4aJeC93YIIrfbBlUJ062kilUUnAiMb81eEkVvCVoh3ON283ans7+OQkuy1uHW+Hw== +"@esbuild/linux-arm@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.9.tgz#9807e92cfd335f46326394805ad488e646e506f2" + integrity sha512-C/ChPohUYoyUaqn1h17m/6yt6OB14hbXvT8EgM1ZWaiiTYz7nWZR0SYmMnB5BzQA4GXl3BgBO1l8MYqL/He3qw== + "@esbuild/linux-ia32@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" @@ -1604,6 +1649,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.13.tgz#a901a16349c58bf6f873bced36bdf46a5f4dac5d" integrity sha512-I3OKGbynl3AAIO6onXNrup/ttToE6Rv2XYfFgLK/wnr2J+1g+7k4asLrE+n7VMhaqX+BUnyWkCu27rl+62Adug== +"@esbuild/linux-ia32@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.9.tgz#18892c10f3106652b16f9da88a0362dc95ed46c7" + integrity sha512-f37i/0zE0MjDxijkPSQw1CO/7C27Eojqb+r3BbHVxMLkj8GCa78TrBZzvPyA/FNLUMzP3eyHCVkAopkKVja+6Q== + "@esbuild/linux-loong64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" @@ -1614,6 +1664,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.13.tgz#faa08db402c18e351234719e00aba98867aa34ce" integrity sha512-8pcKDApAsKc6WW51ZEVidSGwGbebYw2qKnO1VyD8xd6JN0RN6EUXfhXmDk9Vc4/U3Y4AoFTexQewQDJGsBXBpg== +"@esbuild/linux-loong64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.9.tgz#dc2ebf9a125db0a1bba18c2bbfd4fbdcbcaf61c2" + integrity sha512-t6mN147pUIf3t6wUt3FeumoOTPfmv9Cc6DQlsVBpB7eCpLOqQDyWBP1ymXn1lDw4fNUSb/gBcKAmvTP49oIkaA== + "@esbuild/linux-mips64el@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" @@ -1624,6 +1679,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.13.tgz#2123a54b49ddc1a1dff057bba8a9a5e9f26e5009" integrity sha512-6GU+J1PLiVqWx8yoCK4Z0GnfKyCGIH5L2KQipxOtbNPBs+qNDcMJr9euxnyJ6FkRPyMwaSkjejzPSISD9hb+gg== +"@esbuild/linux-mips64el@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.9.tgz#4c2f7c5d901015e3faf1563c4a89a50776cb07fd" + integrity sha512-jg9fujJTNTQBuDXdmAg1eeJUL4Jds7BklOTkkH80ZgQIoCTdQrDaHYgbFZyeTq8zbY+axgptncko3v9p5hLZtw== + "@esbuild/linux-ppc64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" @@ -1634,6 +1694,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.13.tgz#9a9befd275a6a3f5baeed89aaafb746df7ba735d" integrity sha512-pfn/OGZ8tyR8YCV7MlLl5hAit2cmS+j/ZZg9DdH0uxdCoJpV7+5DbuXrR+es4ayRVKIcfS9TTMCs60vqQDmh+w== +"@esbuild/linux-ppc64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.9.tgz#8385332713b4e7812869622163784a5633f76fc4" + integrity sha512-tkV0xUX0pUUgY4ha7z5BbDS85uI7ABw3V1d0RNTii7E9lbmV8Z37Pup2tsLV46SQWzjOeyDi1Q7Wx2+QM8WaCQ== + "@esbuild/linux-riscv64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" @@ -1644,6 +1709,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.13.tgz#6644a5b5840fa0c3ffade6f87d943413ece520a8" integrity sha512-aIbhU3LPg0lOSCfVeGHbmGYIqOtW6+yzO+Nfv57YblEK01oj0mFMtvDJlOaeAZ6z0FZ9D13oahi5aIl9JFphGg== +"@esbuild/linux-riscv64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.9.tgz#23f1db24fa761be311874f32036c06249aa20cba" + integrity sha512-DfLp8dj91cufgPZDXr9p3FoR++m3ZJ6uIXsXrIvJdOjXVREtXuQCjfMfvmc3LScAVmLjcfloyVtpn43D56JFHg== + "@esbuild/linux-s390x@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" @@ -1654,6 +1724,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.13.tgz#c1367a0a02b37f6b0382e71d9c9d97352ca23013" integrity sha512-Pct1QwF2sp+5LVi4Iu5Y+6JsGaV2Z2vm4O9Dd7XZ5tKYxEHjFtb140fiMcl5HM1iuv6xXO8O1Vrb1iJxHlv8UA== +"@esbuild/linux-s390x@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.9.tgz#2dffe497726b897c9f0109e774006e25b33b4fd0" + integrity sha512-zHbglfEdC88KMgCWpOl/zc6dDYJvWGLiUtmPRsr1OgCViu3z5GncvNVdf+6/56O2Ca8jUU+t1BW261V6kp8qdw== + "@esbuild/linux-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" @@ -1664,6 +1739,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.13.tgz#892674f0918ee3f5e523270cf49a69a557fb64c0" integrity sha512-zTrIP0KzYP7O0+3ZnmzvUKgGtUvf4+piY8PIO3V8/GfmVd3ZyHJGz7Ht0np3P1wz+I8qJ4rjwJKqqEAbIEPngA== +"@esbuild/linux-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.9.tgz#ceb1d62cd830724ff5b218e5d3172a8bad59420e" + integrity sha512-JUjpystGFFmNrEHQnIVG8hKwvA2DN5o7RqiO1CVX8EN/F/gkCjkUMgVn6hzScpwnJtl2mPR6I9XV1oW8k9O+0A== + "@esbuild/netbsd-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" @@ -1674,6 +1754,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.13.tgz#67954292195ecbdae33ab09a9ae6a7f566e49d04" integrity sha512-I6zs10TZeaHDYoGxENuksxE1sxqZpCp+agYeW039yqFwh3MgVvdmXL5NMveImOC6AtpLvE4xG5ujVic4NWFIDQ== +"@esbuild/netbsd-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.9.tgz#0cbca65e9ef4d3fc41502d3e055e6f49479a8f18" + integrity sha512-GThgZPAwOBOsheA2RUlW5UeroRfESwMq/guy8uEe3wJlAOjpOXuSevLRd70NZ37ZrpO6RHGHgEHvPg1h3S1Jug== + "@esbuild/openbsd-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" @@ -1684,6 +1769,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.13.tgz#b3eef873dfab547fbe7bcdb3573e1c59dea676b7" integrity sha512-W5C5nczhrt1y1xPG5bV+0M12p2vetOGlvs43LH8SopQ3z2AseIROu09VgRqydx5qFN7y9qCbpgHLx0kb0TcW7g== +"@esbuild/openbsd-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.9.tgz#1f57adfbee09c743292c6758a3642e875bcad1cf" + integrity sha512-Ki6PlzppaFVbLnD8PtlVQfsYw4S9n3eQl87cqgeIw+O3sRr9IghpfSKY62mggdt1yCSZ8QWvTZ9jo9fjDSg9uw== + "@esbuild/sunos-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" @@ -1694,6 +1784,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.13.tgz#b368080f42dbb5ae926d0567c02bcd68a34c5efd" integrity sha512-X/xzuw4Hzpo/yq3YsfBbIsipNgmsm8mE/QeWbdGdTTeZ77fjxI2K0KP3AlhZ6gU3zKTw1bKoZTuKLnqcJ537qw== +"@esbuild/sunos-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.9.tgz#116be6adbd2c7479edeeb5f6ea0441002ab4cb9c" + integrity sha512-MLHj7k9hWh4y1ddkBpvRj2b9NCBhfgBt3VpWbHQnXRedVun/hC7sIyTGDGTfsGuXo4ebik2+3ShjcPbhtFwWDw== + "@esbuild/win32-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" @@ -1704,6 +1799,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.13.tgz#11dedda0e8cfb5f781411ea362b2040304be0fc3" integrity sha512-4CGYdRQT/ILd+yLLE5i4VApMPfGE0RPc/wFQhlluDQCK09+b4JDbxzzjpgQqTPrdnP7r5KUtGVGZYclYiPuHrw== +"@esbuild/win32-arm64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.9.tgz#2be22131ab18af4693fd737b161d1ef34de8ca9d" + integrity sha512-GQoa6OrQ8G08guMFgeXPH7yE/8Dt0IfOGWJSfSH4uafwdC7rWwrfE6P9N8AtPGIjUzdo2+7bN8Xo3qC578olhg== + "@esbuild/win32-ia32@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" @@ -1714,6 +1814,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.13.tgz#6b8aa95515c05827b7c24c9db9581943566e0dcb" integrity sha512-D+wKZaRhQI+MUGMH+DbEr4owC2D7XnF+uyGiZk38QbgzLcofFqIOwFs7ELmIeU45CQgfHNy9Q+LKW3cE8g37Kg== +"@esbuild/win32-ia32@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.9.tgz#e10ead5a55789b167b4225d2469324538768af7c" + integrity sha512-UOozV7Ntykvr5tSOlGCrqU3NBr3d8JqPes0QWN2WOXfvkWVGRajC+Ym0/Wj88fUgecUCLDdJPDF0Nna2UK3Qtg== + "@esbuild/win32-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" @@ -1724,6 +1829,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.13.tgz#031f69b1f4cf62a18c38d502458c0b8b02625461" integrity sha512-iVl6lehAfJS+VmpF3exKpNQ8b0eucf5VWfzR8S7xFve64NBNz2jPUgx1X93/kfnkfgP737O+i1k54SVQS7uVZA== +"@esbuild/win32-x64@0.19.9": + version "0.19.9" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.9.tgz#b2da6219b603e3fa371a78f53f5361260d0c5585" + integrity sha512-oxoQgglOP7RH6iasDrhY+R/3cHrfwIDvRlT4CGChflq6twk8iENeVvMJjmvBb94Ik1Z+93iGO27err7w6l54GQ== + "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -6229,11 +6339,6 @@ detect-indent@^6.1.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== - detect-package-manager@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/detect-package-manager/-/detect-package-manager-2.0.1.tgz#6b182e3ae5e1826752bfef1de9a7b828cffa50d8" @@ -6663,6 +6768,34 @@ esbuild@^0.18.10: "@esbuild/win32-ia32" "0.18.13" "@esbuild/win32-x64" "0.18.13" +esbuild@^0.19.9: + version "0.19.9" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.9.tgz#423a8f35153beb22c0b695da1cd1e6c0c8cdd490" + integrity sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg== + optionalDependencies: + "@esbuild/android-arm" "0.19.9" + "@esbuild/android-arm64" "0.19.9" + "@esbuild/android-x64" "0.19.9" + "@esbuild/darwin-arm64" "0.19.9" + "@esbuild/darwin-x64" "0.19.9" + "@esbuild/freebsd-arm64" "0.19.9" + "@esbuild/freebsd-x64" "0.19.9" + "@esbuild/linux-arm" "0.19.9" + "@esbuild/linux-arm64" "0.19.9" + "@esbuild/linux-ia32" "0.19.9" + "@esbuild/linux-loong64" "0.19.9" + "@esbuild/linux-mips64el" "0.19.9" + "@esbuild/linux-ppc64" "0.19.9" + "@esbuild/linux-riscv64" "0.19.9" + "@esbuild/linux-s390x" "0.19.9" + "@esbuild/linux-x64" "0.19.9" + "@esbuild/netbsd-x64" "0.19.9" + "@esbuild/openbsd-x64" "0.19.9" + "@esbuild/sunos-x64" "0.19.9" + "@esbuild/win32-arm64" "0.19.9" + "@esbuild/win32-ia32" "0.19.9" + "@esbuild/win32-x64" "0.19.9" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -9377,68 +9510,6 @@ lighthouse@8.6.0: yargs "^16.1.1" yargs-parser "^20.2.4" -lightningcss-cli-darwin-arm64@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-darwin-arm64/-/lightningcss-cli-darwin-arm64-1.22.1.tgz#19df9956118b08abffc87fda22e1f393466c070d" - integrity sha512-wYbAvHL8T25KHIfHrrQnwNtwp8OXuGIWV3O2IAlY5NwtrNsfTBF0odfHKE/M3vWv/c+JDSoU9hBqPqw9lgIbaA== - -lightningcss-cli-darwin-x64@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-darwin-x64/-/lightningcss-cli-darwin-x64-1.22.1.tgz#b134754f79888ecebe912c74b01e77d8ebb0c94e" - integrity sha512-r634KvNQU8iBpVq1GGWG4G361ReREVTtdx9n+0mxrZVelWrQOXUHysHSvZbD+UBf3O2Iy1ie6kLJQEbN+Xk87A== - -lightningcss-cli-freebsd-x64@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-freebsd-x64/-/lightningcss-cli-freebsd-x64-1.22.1.tgz#f173eb0fca32a51b81219f231d7a415b4b6d4f96" - integrity sha512-7djPCTq7eW709ZVuD0UIEiQawF7PBHG1cZ6kWoRgBjk7NuFBLhJA/RrzsdWDC79R8xJc+rSk28qky5vh3Zl6rg== - -lightningcss-cli-linux-arm-gnueabihf@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-arm-gnueabihf/-/lightningcss-cli-linux-arm-gnueabihf-1.22.1.tgz#dd67ecf07555f1db179a79e7d95769beca745ec2" - integrity sha512-kMAjQBL4fJjMH9usR/7p9gf9ILtP31lA3Pn+RjS7+pElzJ0pjkErID4NCnyHdKmXrlzcN/9o02xI+0FOskhf6g== - -lightningcss-cli-linux-arm64-gnu@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-arm64-gnu/-/lightningcss-cli-linux-arm64-gnu-1.22.1.tgz#ccbb97cacb92da9b99f6cb17e2d7778108df515b" - integrity sha512-d5Vw3XZC6Z6Brbtyn99WaFH3viMNqWR7GxZl7KcHIfE9zOHEJfTJZBrCMEJ5DP+r14IVBH+c3cIoLtZHUUXibg== - -lightningcss-cli-linux-arm64-musl@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-arm64-musl/-/lightningcss-cli-linux-arm64-musl-1.22.1.tgz#5c75bae21f0a9e6c7a2154f2803bf61cdaa3b0e7" - integrity sha512-rkJnLZo5ZaFzh2UN3RjB9K/JIhtgcJMhIeE9tMvDeB3B3UUQjfMEqIYfW/KshIoMLk32ZVEuNkKAgztCcn4csw== - -lightningcss-cli-linux-x64-gnu@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-x64-gnu/-/lightningcss-cli-linux-x64-gnu-1.22.1.tgz#d47074ae4f682d64f26c4ce5c6169e297227607a" - integrity sha512-OgfjE7DcBMaCo1gSOR5rL9441ujEbWsA32SRjS7MRw/LKavpFKn+bbqLV5/NC2yvXPDnL6cNuJykvp0EHzqpIw== - -lightningcss-cli-linux-x64-musl@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-linux-x64-musl/-/lightningcss-cli-linux-x64-musl-1.22.1.tgz#d4347844cbe626d4a5d966d6ea8820efe1e5a4f3" - integrity sha512-RyXSN3friFZBWfGZoN9Xtv3GjeDM5/CQcn35ECPo0IC+Y5ZrENRpXab5FR87BWm1qFdqfF28wTAFb8k6eBnAvA== - -lightningcss-cli-win32-x64-msvc@1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli-win32-x64-msvc/-/lightningcss-cli-win32-x64-msvc-1.22.1.tgz#69dbfcd664be0c0e46c95a482c5ba6eb935fc38b" - integrity sha512-VB1IcMsKeHJVyd0bUrcbMSRI+ZQwxvLdk7RX1HfZDNt8wEt63skfGU3DVYDXYibAuDpkwe7BTIG2BiARWtC5xA== - -lightningcss-cli@^1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/lightningcss-cli/-/lightningcss-cli-1.22.1.tgz#ad19ae59f7e335d6c761b26c8703d56a58644c28" - integrity sha512-J4c4n6HOx6Q1qIYHwi169YJIFWkzPibIk5NmbSbZBc63HEGjDRQFJIPWizMWJUjqEmeF8CDnsFCC2R6tGKWpcQ== - dependencies: - detect-libc "^1.0.3" - optionalDependencies: - lightningcss-cli-darwin-arm64 "1.22.1" - lightningcss-cli-darwin-x64 "1.22.1" - lightningcss-cli-freebsd-x64 "1.22.1" - lightningcss-cli-linux-arm-gnueabihf "1.22.1" - lightningcss-cli-linux-arm64-gnu "1.22.1" - lightningcss-cli-linux-arm64-musl "1.22.1" - lightningcss-cli-linux-x64-gnu "1.22.1" - lightningcss-cli-linux-x64-musl "1.22.1" - lightningcss-cli-win32-x64-msvc "1.22.1" - lilconfig@^2.0.5, lilconfig@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" From 7b2241e381c83c1705ebe7f75f495b6552d0fa37 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 18 Dec 2023 21:18:52 +0200 Subject: [PATCH 12/16] chore: cleanup --- .../postcss.components/postcss.config.js | 1 - .../config/postcss.themes/postcss.config.js | 1 - .../postcss.components/postcss.config.cjs | 1 - .../config/postcss.themes/postcss.config.cjs | 1 - .../postcss.components/postcss.config.cjs | 1 - .../config/postcss.themes/postcss.config.cjs | 1 - .../config/postcss.themes/postcss.config.cjs | 24 - packages/theming/package-scripts.cjs | 1 - packages/theming/package.json | 1 - .../components-package/postcss.components.js | 23 +- .../components-package/postcss.themes.js | 31 +- .../css-processor-components.mjs | 7 +- .../css-processors/css-processor-themes.mjs | 5 +- packages/tools/lib/css-processors/shared.mjs | 44 +- .../tools/lib/postcss-css-to-esm/index.js | 91 ---- .../tools/lib/postcss-css-to-json/index.js | 47 -- packages/tools/lib/postcss-p/postcss-p.mjs | 14 - .../tools/lib/postcss-scope-vars/index.js | 59 -- packages/tools/package.json | 5 +- yarn.lock | 505 +----------------- 20 files changed, 61 insertions(+), 802 deletions(-) delete mode 100644 packages/create-package/template/config/postcss.components/postcss.config.js delete mode 100644 packages/create-package/template/config/postcss.themes/postcss.config.js delete mode 100644 packages/fiori/config/postcss.components/postcss.config.cjs delete mode 100644 packages/fiori/config/postcss.themes/postcss.config.cjs delete mode 100644 packages/main/config/postcss.components/postcss.config.cjs delete mode 100644 packages/main/config/postcss.themes/postcss.config.cjs delete mode 100644 packages/theming/config/postcss.themes/postcss.config.cjs delete mode 100644 packages/tools/lib/postcss-css-to-esm/index.js delete mode 100644 packages/tools/lib/postcss-css-to-json/index.js delete mode 100644 packages/tools/lib/postcss-p/postcss-p.mjs delete mode 100644 packages/tools/lib/postcss-scope-vars/index.js diff --git a/packages/create-package/template/config/postcss.components/postcss.config.js b/packages/create-package/template/config/postcss.components/postcss.config.js deleted file mode 100644 index eaa8b02e568c..000000000000 --- a/packages/create-package/template/config/postcss.components/postcss.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("@ui5/webcomponents-tools/components-package/postcss.components.js"); // eslint-disable-line diff --git a/packages/create-package/template/config/postcss.themes/postcss.config.js b/packages/create-package/template/config/postcss.themes/postcss.config.js deleted file mode 100644 index 687327313cb6..000000000000 --- a/packages/create-package/template/config/postcss.themes/postcss.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("@ui5/webcomponents-tools/components-package/postcss.themes.js"); // eslint-disable-line diff --git a/packages/fiori/config/postcss.components/postcss.config.cjs b/packages/fiori/config/postcss.components/postcss.config.cjs deleted file mode 100644 index b496f7835c1a..000000000000 --- a/packages/fiori/config/postcss.components/postcss.config.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("@ui5/webcomponents-tools/components-package/postcss.components.js"); diff --git a/packages/fiori/config/postcss.themes/postcss.config.cjs b/packages/fiori/config/postcss.themes/postcss.config.cjs deleted file mode 100644 index f7b0dfe5e3e8..000000000000 --- a/packages/fiori/config/postcss.themes/postcss.config.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("@ui5/webcomponents-tools/components-package/postcss.themes.js"); diff --git a/packages/main/config/postcss.components/postcss.config.cjs b/packages/main/config/postcss.components/postcss.config.cjs deleted file mode 100644 index b496f7835c1a..000000000000 --- a/packages/main/config/postcss.components/postcss.config.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("@ui5/webcomponents-tools/components-package/postcss.components.js"); diff --git a/packages/main/config/postcss.themes/postcss.config.cjs b/packages/main/config/postcss.themes/postcss.config.cjs deleted file mode 100644 index f7b0dfe5e3e8..000000000000 --- a/packages/main/config/postcss.themes/postcss.config.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("@ui5/webcomponents-tools/components-package/postcss.themes.js"); diff --git a/packages/theming/config/postcss.themes/postcss.config.cjs b/packages/theming/config/postcss.themes/postcss.config.cjs deleted file mode 100644 index 8c85d4c3db90..000000000000 --- a/packages/theming/config/postcss.themes/postcss.config.cjs +++ /dev/null @@ -1,24 +0,0 @@ -const combineSelectors = require('@ui5/webcomponents-tools/lib/postcss-combine-duplicated-selectors/index.js'); -const postcssImport = require('postcss-import'); -const cssnano = require('cssnano'); -const postcssCSStoJSON = require('@ui5/webcomponents-tools/lib/postcss-css-to-json/index.js'); -const postcssCSStoESM = require('@ui5/webcomponents-tools/lib/postcss-css-to-esm/index.js'); - -module.exports = { - plugins: [ - postcssImport(), - combineSelectors({ - removeDuplicatedProperties: true - }), - cssnano({ - preset: [ - 'default', { - mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675 - }, - ] - }, - ), - postcssCSStoJSON({ toReplace: `dist`, packageName: "@ui5/webcomponents-theming" }), - postcssCSStoESM({ toReplace: `dist`, packageName: "@ui5/webcomponents-theming" }), - ] -}; diff --git a/packages/theming/package-scripts.cjs b/packages/theming/package-scripts.cjs index 97769421be20..b83810bb2e8b 100644 --- a/packages/theming/package-scripts.cjs +++ b/packages/theming/package-scripts.cjs @@ -16,7 +16,6 @@ module.exports = { src: `copy-and-watch "src/**/*.{json}" dist/`, typescript: "tsc", postcss: `node "${LIB}/css-processors/css-processor-themes.mjs"`, - postcss2: "postcss dist/**/parameters-bundle.css --config config/postcss.themes --base dist/ --dir dist/css/", jsonImports: `node "${jsonImportsScript}" dist/generated/assets/themes src/generated/json-imports`, }, generateReport: `node "${generateReportScript}"`, diff --git a/packages/theming/package.json b/packages/theming/package.json index 0e4f4d5cdc56..5199d3241d09 100644 --- a/packages/theming/package.json +++ b/packages/theming/package.json @@ -35,7 +35,6 @@ }, "devDependencies": { "@ui5/webcomponents-tools": "1.21.0-rc.2", - "cssnano": "^6.0.1", "globby": "^13.1.1", "json-beautify": "^1.1.1", "nps": "^5.10.0", diff --git a/packages/tools/components-package/postcss.components.js b/packages/tools/components-package/postcss.components.js index bd99875b4bf5..0ee66edbdf4c 100644 --- a/packages/tools/components-package/postcss.components.js +++ b/packages/tools/components-package/postcss.components.js @@ -1,24 +1,3 @@ -const postcssImport = require('postcss-import'); -const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js'); -const postcssScopeVars = require('../lib/postcss-scope-vars/index.js'); -const cssnano = require('cssnano'); -const fs = require("fs") - - const packageJSON = JSON.parse(fs.readFileSync("./package.json")) -module.exports = { - plugins: [ - postcssImport(), - cssnano({ - preset: [ - 'default', { - mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675 - mergeRules: false, // https://github.com/cssnano/cssnano/issues/730 - }, - ] - }), - postcssScopeVars({version: packageJSON.version}), - postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName: packageJSON.name }), - ] -} +module.exports = {} diff --git a/packages/tools/components-package/postcss.themes.js b/packages/tools/components-package/postcss.themes.js index 7d3da0c7cc7d..f053ebf7976e 100644 --- a/packages/tools/components-package/postcss.themes.js +++ b/packages/tools/components-package/postcss.themes.js @@ -1,30 +1 @@ -const postcssImport = require('postcss-import'); -const combineSelectors = require('../lib/postcss-combine-duplicated-selectors/index.js'); -const postcssCSStoJSON = require('../lib/postcss-css-to-json/index.js'); -const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js'); -const postcssScopeVars = require('../lib/postcss-scope-vars/index.js'); -const cssnano = require('cssnano'); -const fs = require("fs"); - - -const packageJSON = JSON.parse(fs.readFileSync("./package.json")) -const packageName = packageJSON.name; - -module.exports = { - plugins: [ - postcssScopeVars({version: packageJSON.version}), - postcssImport(), - combineSelectors({ - removeDuplicatedProperties: true - }), - cssnano({ - preset: [ - 'default', { - mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675 - }, - ] - },), - postcssCSStoJSON({ toReplace: 'src', packageName }), - postcssCSStoESM({ toReplace: 'src', packageName }), - ] -}; +module.exports = {}; diff --git a/packages/tools/lib/css-processors/css-processor-components.mjs b/packages/tools/lib/css-processors/css-processor-components.mjs index cbfc70dd5652..9834d2c269c9 100644 --- a/packages/tools/lib/css-processors/css-processor-components.mjs +++ b/packages/tools/lib/css-processors/css-processor-components.mjs @@ -1,12 +1,11 @@ -import 'zx/globals'; +import { globby } from "globby"; import * as esbuild from 'esbuild' import * as fs from "fs"; import * as path from "path"; -import { writeFile, readFile, mkdir } from "fs/promises"; -import { getFileContent } from '../postcss-css-to-esm/index.js'; +import { writeFile, mkdir } from "fs/promises"; import chokidar from "chokidar"; import scopeVariables from "./scope-variables.mjs"; -import { writeFileIfChanged } from "./shared.mjs"; +import { writeFileIfChanged, getFileContent } from "./shared.mjs"; const packageJSON = JSON.parse(fs.readFileSync("./package.json")) const inputFilesGlob = "src/themes/*.css"; diff --git a/packages/tools/lib/css-processors/css-processor-themes.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs index 3f10be8264f1..15501ab24678 100644 --- a/packages/tools/lib/css-processors/css-processor-themes.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -1,12 +1,11 @@ -import 'zx/globals'; +import { globby } from "globby"; import * as esbuild from 'esbuild' import * as fs from "fs"; import * as path from "path"; import { writeFile, mkdir } from "fs/promises"; -import { getFileContent } from '../postcss-css-to-esm/index.js'; import postcss from "postcss"; import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/index.js" -import { writeFileIfChanged, stripThemingBaseContent } from "./shared.mjs"; +import { writeFileIfChanged, stripThemingBaseContent, getFileContent } from "./shared.mjs"; import scopeVariables from "./scope-variables.mjs"; const packageJSON = JSON.parse(fs.readFileSync("./package.json")) diff --git a/packages/tools/lib/css-processors/shared.mjs b/packages/tools/lib/css-processors/shared.mjs index 19eb45790ae7..b19101eaab52 100644 --- a/packages/tools/lib/css-processors/shared.mjs +++ b/packages/tools/lib/css-processors/shared.mjs @@ -1,4 +1,6 @@ import { writeFile, readFile, mkdir } from "fs/promises"; +import * as path from "path"; +import assets from "../../assets-meta.js"; const readOldContent = async (fileName) => { // it seems slower to read the old content, but writing the same content with no real changes @@ -31,4 +33,44 @@ const stripThemingBaseContent = css => { return css; } -export { writeFileIfChanged, stripThemingBaseContent } \ No newline at end of file + +const DEFAULT_THEME = assets.themes.default; + +const getDefaultThemeCode = packageName => { + return `import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js"; + +import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/${DEFAULT_THEME}/parameters-bundle.css.js"; +import defaultTheme from "./${DEFAULT_THEME}/parameters-bundle.css.js"; + +registerThemePropertiesLoader("@ui5/webcomponents-theming", "${DEFAULT_THEME}", async () => defaultThemeBase); +registerThemePropertiesLoader("${packageName}", "${DEFAULT_THEME}", async () => defaultTheme); +`; +}; + +const getFileContent = (tsMode, targetFile, packageName, css, includeDefaultTheme) => { + if (tsMode) { + return getTSContent(targetFile, packageName, css, includeDefaultTheme); + } + + return getJSContent(targetFile, packageName, css, includeDefaultTheme); +} + +const getTSContent = (targetFile, packageName, css, includeDefaultTheme) => { + const typeImport = "import type { StyleData } from \"@ui5/webcomponents-base/dist/types.js\";" + const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : ""; + + // tabs are intentionally mixed to have proper identation in the produced file + return `${typeImport} +${defaultTheme} +const styleData: StyleData = {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}}; +export default styleData; + `; +} + +const getJSContent = (targetFile, packageName, css, includeDefaultTheme) => { + const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : ""; + + return `${defaultTheme}export default {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}}` +} + +export { writeFileIfChanged, stripThemingBaseContent, getFileContent} \ No newline at end of file diff --git a/packages/tools/lib/postcss-css-to-esm/index.js b/packages/tools/lib/postcss-css-to-esm/index.js deleted file mode 100644 index d73f4a9c038c..000000000000 --- a/packages/tools/lib/postcss-css-to-esm/index.js +++ /dev/null @@ -1,91 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const mkdirp = require('mkdirp'); -const assets = require("../../assets-meta.js"); - -const DEFAULT_THEME = assets.themes.default; - -const getDefaultThemeCode = packageName => { - return `import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js"; - -import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/${DEFAULT_THEME}/parameters-bundle.css.js"; -import defaultTheme from "./${DEFAULT_THEME}/parameters-bundle.css.js"; - -registerThemePropertiesLoader("@ui5/webcomponents-theming", "${DEFAULT_THEME}", async () => defaultThemeBase); -registerThemePropertiesLoader("${packageName}", "${DEFAULT_THEME}", async () => defaultTheme); -`; -}; - -const getFileContent = (tsMode, targetFile, packageName, css, includeDefaultTheme) => { - if (tsMode) { - return getTSContent(targetFile, packageName, css, includeDefaultTheme); - } - - return getJSContent(targetFile, packageName, css, includeDefaultTheme); -} - -const getTSContent = (targetFile, packageName, css, includeDefaultTheme) => { - const typeImport = "import type { StyleData } from \"@ui5/webcomponents-base/dist/types.js\";" - const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : ""; - - // tabs are intentionally mixed to have proper identation in the produced file - return `${typeImport} -${defaultTheme} -const styleData: StyleData = {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}}; -export default styleData; - `; -} - -const getJSContent = (targetFile, packageName, css, includeDefaultTheme) => { - const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : ""; - - return `${defaultTheme}export default {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}}` -} - - -const proccessCSS = css => { - css = css.replace(/\.sapThemeMeta[\s\S]*?:root/, ":root"); - css = css.replace(/\.background-image.*{.*}/, ""); - css = css.replace(/\.sapContrast[ ]*:root[\s\S]*?}/, ""); - css = css.replace(/--sapFontUrl.*\);?/, ""); - return JSON.stringify(css); -} - -module.exports = function (opts) { - opts = opts || {}; - - const packageName = opts.packageName; - const includeDefaultTheme = opts.includeDefaultTheme; - const toReplace = opts.toReplace; - - return { - postcssPlugin: 'postcss-css-to-esm', - OnceExit(root) { - const tsMode = process.env.UI5_TS === "true"; - - let css = root.toString(); - css = proccessCSS(css); - - const targetFile = root.source.input.from.replace(`/${toReplace}/`, "/src/generated/").replace(`\\${toReplace}\\`, "\\src\\generated\\"); - mkdirp.sync(path.dirname(targetFile)); - - const filePath = `${targetFile}.${tsMode ? "ts" : "js"}`; - - // it seems slower to read the old content, but writing the same content with no real changes - // (as in initial build and then watch mode) will cause an unnecessary dev server refresh - let oldContent = ""; - try { - oldContent = fs.readFileSync(filePath).toString(); - } catch (e) { - // file not found - } - - const content = getFileContent(tsMode, targetFile, packageName, css, includeDefaultTheme); - if (content !== oldContent) { - fs.writeFileSync(filePath, content); - } - } - }; -}; -module.exports.postcss = true; -module.exports.getFileContent = getFileContent; diff --git a/packages/tools/lib/postcss-css-to-json/index.js b/packages/tools/lib/postcss-css-to-json/index.js deleted file mode 100644 index def405c74921..000000000000 --- a/packages/tools/lib/postcss-css-to-json/index.js +++ /dev/null @@ -1,47 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const mkdirp = require('mkdirp'); - -const proccessCSS = css => { - css = css.replace(/\.sapThemeMeta[\s\S]*?:root/, ":root"); - css = css.replace(/\.background-image.*{.*}/, ""); - css = css.replace(/\.sapContrast[ ]*:root[\s\S]*?}/, ""); - css = css.replace(/--sapFontUrl.*\);?/, ""); - return css; -} - -module.exports = function (opts) { - opts = opts || {}; - - return { - postcssPlugin: 'postcss-css-to-json', - OnceExit (root) { - let css = root.toString(); - css = proccessCSS(css); - - const targetFile = root.source.input.from.replace(`/${opts.toReplace}/`, "/src/generated/assets/").replace(`\\${opts.toReplace}\\`, "\\src\\generated\\assets\\"); - mkdirp.sync(path.dirname(targetFile)); - - const filePath = `${targetFile}.json`; - const data = { - packageName: opts.packageName, - fileName: targetFile.substr(targetFile.lastIndexOf("themes")), - content: css - }; - // it seems slower to read the old content, but writing the same content with no real changes - // (as in initial build and then watch mode) will cause an unnecessary dev server refresh - let oldContent = ""; - try { - oldContent = fs.readFileSync(filePath).toString(); - } catch (e) { - // file not found - } - const content = JSON.stringify({_: data}); - if (content !== oldContent) { - fs.writeFileSync(filePath, content); - } - } - }; -}; - -module.exports.postcss = true; diff --git a/packages/tools/lib/postcss-p/postcss-p.mjs b/packages/tools/lib/postcss-p/postcss-p.mjs deleted file mode 100644 index 185adcd289cb..000000000000 --- a/packages/tools/lib/postcss-p/postcss-p.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import 'zx/globals'; - -// don't print executed commands and their output -$.verbose = false; - -let inputFiles = await globby("src/**/parameters-bundle.css"); -// inputFiles = inputFiles.filter(x => x.includes("fiori_3")) -const restArgs = process.argv.slice(2); - -// run all postcss processes in parallel as passing the glob directly to postcss makes them processed sequentially. -// and the amount of imports give a big speed up when run in parallel -await Promise.all(inputFiles.map(file => { - return $`postcss ${file} --config config/postcss.themes --base src --dir dist/css/ ${restArgs}`; -})); diff --git a/packages/tools/lib/postcss-scope-vars/index.js b/packages/tools/lib/postcss-scope-vars/index.js deleted file mode 100644 index d4201c86e2f0..000000000000 --- a/packages/tools/lib/postcss-scope-vars/index.js +++ /dev/null @@ -1,59 +0,0 @@ -const path = require("path"); -const name = "postcss-scope-vars"; - -const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-"); - -/** - * Tries to detect an override for a package - * @param {*} filePath For example: /my_project/src/themes/overrides/@ui5/webcomponents/my_custom_theme/parameters-bundle.css - * @returns - */ -const getOverrideVersion = filePath => { - console.log(filePath); - if (!filePath.includes(`overrides${path.sep}`)) { - return; // The "overrides/" directory is the marker - } - const override = filePath.split(`overrides${path.sep}`)[1]; // For example, this will be: @ui5/webcomponents/my_custom_theme/parameters-bundle.css - if (!override) { - return; // There must be other directories after overrides/, the path can't end with it - } - const parts = override.split(path.sep); - if (parts.length < 3) { - return; // There must be at least a directory for the theme that is being overridden (my_custom_theme) and the name of the CSS file after the name of the package that is overridden - } - const packageName = parts.slice(0, -2).join(path.sep); // After the last 2 parts are removed (my_custom_theme and parameters-bundle.css from the example), the rest is the package - - let overrideVersion; - try { - overrideVersion = require(`${packageName}${path.sep}package.json`).version; - } catch (e) { - console.log(`Error requiring package ${packageName}: ${e.message}`); - } - - return overrideVersion; -} - -module.exports = (options) => { - return { - postcssPlugin: name, - prepare(opts) { - const filePath = opts.root.source.input.file; - const versionStr = escapeVersion(getOverrideVersion(filePath) || options?.version); - - return { - Declaration: (declaration) => { - if (declaration.__ui5_replaced) { - return; - } - // add version after ui5 - const expr = /(--_?ui5)([^\,\:\)\s]+)/g - declaration.prop = declaration.prop.replaceAll(expr, `$1-${versionStr}$2`) - declaration.value = declaration.value.replaceAll(expr, `$1-${versionStr}$2`) - declaration.__ui5_replaced = true; - }, - }; - }, - }; -}; - -module.exports.postcss = true; diff --git a/packages/tools/package.json b/packages/tools/package.json index 4803601ea4e1..c9f1985539aa 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -36,7 +36,6 @@ "command-line-args": "^5.1.1", "concurrently": "^6.0.0", "cross-env": "^7.0.3", - "cssnano": "^6.0.1", "escodegen": "^2.0.0", "eslint": "^7.22.0", "eslint-config-airbnb-base": "^14.2.1", @@ -54,7 +53,6 @@ "nps": "^5.10.0", "postcss": "^8.4.5", "postcss-cli": "^9.1.0", - "postcss-import": "^14.0.2", "postcss-selector-parser": "^6.0.10", "prompts": "^2.4.2", "properties-reader": "^2.2.0", @@ -63,8 +61,7 @@ "rimraf": "^3.0.2", "slash": "3.0.0", "vite": "^4.4.9", - "wdio-chromedriver-service": "^7.3.2", - "zx": "^7.2.3" + "wdio-chromedriver-service": "^7.3.2" }, "peerDependencies": { "chromedriver": "*", diff --git a/yarn.lock b/yarn.lock index f41ebcf6cab3..0ecfd077b9b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3314,11 +3314,6 @@ resolved "https://registry.yarnpkg.com/@tracerbench/trace-event/-/trace-event-7.0.0.tgz#bf359796b6135559e2f884e010af9fe096bc04aa" integrity sha512-dTyRKhZ973nWe2DvFItWka1sbwKqKGLQxylrJSOWB6ck4ZHwcIpRRY4rOUyFsGZFO/OPhUibXCDQ/clSEvfxpQ== -"@trysound/sax@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" - integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== - "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -3661,7 +3656,7 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/minimist@^1.2.0", "@types/minimist@^1.2.2": +"@types/minimist@^1.2.0": version "1.2.2" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== @@ -3701,7 +3696,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.38.tgz#1dcdb6c54d02b323f621213745f2e44af30c73e6" integrity sha512-6sfo1qTulpVbkxECP+AVrHV9OoJqhzCsfTNp5NIG+enM4HyM3HvZCO798WShIXBN0+QtDIcutJCjsVYnQP5rIQ== -"@types/node@^18.0.0", "@types/node@^18.16.3": +"@types/node@^18.0.0": version "18.16.19" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.19.tgz#cb03fca8910fdeb7595b755126a8a78144714eea" integrity sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA== @@ -3744,11 +3739,6 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== -"@types/ps-tree@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@types/ps-tree/-/ps-tree-1.1.2.tgz#5c60773a38ffb1402e049902a7b7a8d3c67cd59a" - integrity sha512-ZREFYlpUmPQJ0esjxoG1fMvB2HNaD3z+mjqdSosZvd3RalncI9NEur73P8ZJz4YQdL64CmV1w0RuqoRUlhQRBw== - "@types/qs@*", "@types/qs@^6.9.5": version "6.9.7" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" @@ -3880,11 +3870,6 @@ resolved "https://registry.yarnpkg.com/@types/which/-/which-1.3.2.tgz#9c246fc0c93ded311c8512df2891fb41f6227fdf" integrity sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA== -"@types/which@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/which/-/which-3.0.0.tgz#849afdd9fdcb0b67339b9cfc80fa6ea4e0253fc5" - integrity sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ== - "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" @@ -4875,11 +4860,6 @@ body-parser@1.20.1: type-is "~1.6.18" unpipe "1.0.0" -boolbase@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== - boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" @@ -4940,7 +4920,7 @@ browserify-zlib@^0.1.4: dependencies: pako "~0.2.0" -browserslist@^4.0.0, browserslist@^4.21.4, browserslist@^4.21.9: +browserslist@^4.21.9: version "4.21.9" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== @@ -5159,17 +5139,7 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-api@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" - integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw== - dependencies: - browserslist "^4.0.0" - caniuse-lite "^1.0.0" - lodash.memoize "^4.1.2" - lodash.uniq "^4.5.0" - -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001503: +caniuse-lite@^1.0.30001503: version "1.0.30001516" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001516.tgz#621b1be7d85a8843ee7d210fd9d87b52e3daab3a" integrity sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g== @@ -5243,11 +5213,6 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== - character-entities-legacy@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" @@ -5523,11 +5488,6 @@ color-support@^1.1.2, color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -colord@^2.9.1: - version "2.9.3" - resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" - integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw== - colorette@^2.0.19: version "2.0.20" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" @@ -5578,11 +5538,6 @@ commander@^6.2.1: resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commander@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - commander@^8.0.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" @@ -5983,113 +5938,21 @@ csp_evaluator@1.1.0: resolved "https://registry.yarnpkg.com/csp_evaluator/-/csp_evaluator-1.1.0.tgz#7fb3378a08163de4caf0a5297e92a5f70ef42d21" integrity sha512-TcB+ZH9wZBG314jAUpKHPl1oYbRJV+nAT2YwZ9y4fmUN0FkEJa8e/hKZoOgzLYp1Z/CJdFhbhhGIGh0XG8W54Q== -css-declaration-sorter@^6.3.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz#28beac7c20bad7f1775be3a7129d7eae409a3a71" - integrity sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g== - -css-select@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" - integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== - dependencies: - boolbase "^1.0.0" - css-what "^6.1.0" - domhandler "^5.0.2" - domutils "^3.0.1" - nth-check "^2.0.1" - css-shorthand-properties@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/css-shorthand-properties/-/css-shorthand-properties-1.1.1.tgz#1c808e63553c283f289f2dd56fcee8f3337bd935" integrity sha512-Md+Juc7M3uOdbAFwOYlTrccIZ7oCFuzrhKYQjdeUEW/sE1hv17Jp/Bws+ReOPpGVBTYCBoYo+G17V5Qo8QQ75A== -css-tree@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.3.1.tgz#10264ce1e5442e8572fc82fbe490644ff54b5c20" - integrity sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw== - dependencies: - mdn-data "2.0.30" - source-map-js "^1.0.1" - -css-tree@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.2.1.tgz#36115d382d60afd271e377f9c5f67d02bd48c032" - integrity sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA== - dependencies: - mdn-data "2.0.28" - source-map-js "^1.0.1" - css-value@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/css-value/-/css-value-0.0.1.tgz#5efd6c2eea5ea1fd6b6ac57ec0427b18452424ea" integrity sha512-FUV3xaJ63buRLgHrLQVlVgQnQdR4yqdLGaDu7g8CQcWjInDfM9plBTPI9FRfpahju1UBSaMckeb2/46ApS/V1Q== -css-what@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" - integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== - cssesc@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-6.0.1.tgz#2a93247140d214ddb9f46bc6a3562fa9177fe301" - integrity sha512-7VzyFZ5zEB1+l1nToKyrRkuaJIx0zi/1npjvZfbBwbtNTzhLtlvYraK/7/uqmX2Wb2aQtd983uuGw79jAjLSuQ== - dependencies: - css-declaration-sorter "^6.3.1" - cssnano-utils "^4.0.0" - postcss-calc "^9.0.0" - postcss-colormin "^6.0.0" - postcss-convert-values "^6.0.0" - postcss-discard-comments "^6.0.0" - postcss-discard-duplicates "^6.0.0" - postcss-discard-empty "^6.0.0" - postcss-discard-overridden "^6.0.0" - postcss-merge-longhand "^6.0.0" - postcss-merge-rules "^6.0.1" - postcss-minify-font-values "^6.0.0" - postcss-minify-gradients "^6.0.0" - postcss-minify-params "^6.0.0" - postcss-minify-selectors "^6.0.0" - postcss-normalize-charset "^6.0.0" - postcss-normalize-display-values "^6.0.0" - postcss-normalize-positions "^6.0.0" - postcss-normalize-repeat-style "^6.0.0" - postcss-normalize-string "^6.0.0" - postcss-normalize-timing-functions "^6.0.0" - postcss-normalize-unicode "^6.0.0" - postcss-normalize-url "^6.0.0" - postcss-normalize-whitespace "^6.0.0" - postcss-ordered-values "^6.0.0" - postcss-reduce-initial "^6.0.0" - postcss-reduce-transforms "^6.0.0" - postcss-svgo "^6.0.0" - postcss-unique-selectors "^6.0.0" - -cssnano-utils@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-4.0.0.tgz#d1da885ec04003ab19505ff0e62e029708d36b08" - integrity sha512-Z39TLP+1E0KUcd7LGyF4qMfu8ZufI0rDzhdyAMsa/8UyNUU8wpS0fhdBxbQbv32r64ea00h4878gommRVg2BHw== - -cssnano@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-6.0.1.tgz#87c38c4cd47049c735ab756d7e77ac3ca855c008" - integrity sha512-fVO1JdJ0LSdIGJq68eIxOqFpIJrZqXUsBt8fkrBcztCQqAjQD51OhZp7tc0ImcbwXD4k7ny84QTV90nZhmqbkg== - dependencies: - cssnano-preset-default "^6.0.1" - lilconfig "^2.1.0" - -csso@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/csso/-/csso-5.0.5.tgz#f9b7fe6cc6ac0b7d90781bb16d5e9874303e2ca6" - integrity sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ== - dependencies: - css-tree "~2.2.0" - cssom@0.3.x: version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -6119,11 +5982,6 @@ dargs@^7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== -data-uri-to-buffer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" - integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== - date-fns@^2.16.1: version "2.30.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" @@ -6429,36 +6287,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-serializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" - integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== - dependencies: - domelementtype "^2.3.0" - domhandler "^5.0.2" - entities "^4.2.0" - -domelementtype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - -domhandler@^5.0.2, domhandler@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" - integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== - dependencies: - domelementtype "^2.3.0" - -domutils@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" - integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== - dependencies: - dom-serializer "^2.0.0" - domelementtype "^2.3.0" - domhandler "^5.0.3" - dot-prop@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" @@ -6588,11 +6416,6 @@ enquirer@^2.3.5, enquirer@^2.3.6, enquirer@~2.3.6: dependencies: ansi-colors "^4.1.1" -entities@^4.2.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" - integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== - entities@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" @@ -7269,14 +7092,6 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" -fetch-blob@^3.1.2, fetch-blob@^3.1.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" - integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== - dependencies: - node-domexception "^1.0.0" - web-streams-polyfill "^3.0.3" - fetch-retry@^5.0.2: version "5.0.6" resolved "https://registry.yarnpkg.com/fetch-retry/-/fetch-retry-5.0.6.tgz#17d0bc90423405b7a88b74355bf364acd2a7fa56" @@ -7477,13 +7292,6 @@ format@^0.2.0: resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" integrity sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww== -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== - dependencies: - fetch-blob "^3.1.2" - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -7581,11 +7389,6 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -fx@*: - version "28.0.0" - resolved "https://registry.yarnpkg.com/fx/-/fx-28.0.0.tgz#67087b31377039bab42f51db32c8758ccb4708e8" - integrity sha512-vKQDA9g868cZiW8ulgs2uN1yx1i7/nsS33jTMOxekk0Z03BJLffVcdW6AVD32fWb3E6RtmWWuBXBZOk8cLXFNQ== - gauge@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" @@ -7963,7 +7766,7 @@ globby@^12.0.0: merge2 "^1.4.1" slash "^4.0.0" -globby@^13.1.1, globby@^13.1.4: +globby@^13.1.1: version "13.2.2" resolved "https://registry.yarnpkg.com/globby/-/globby-13.2.2.tgz#63b90b1bf68619c2135475cbd4e71e66aa090592" integrity sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w== @@ -9510,7 +9313,7 @@ lighthouse@8.6.0: yargs "^16.1.1" yargs-parser "^20.2.4" -lilconfig@^2.0.5, lilconfig@^2.1.0: +lilconfig@^2.0.5: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== @@ -9678,11 +9481,6 @@ lodash.isplainobject@^4.0.6: resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== -lodash.memoize@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== - lodash.merge@^4.6.1, lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -9718,11 +9516,6 @@ lodash.union@^4.6.0: resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" integrity sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw== -lodash.uniq@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" - integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== - lodash.zip@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" @@ -10107,16 +9900,6 @@ mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: dependencies: "@types/mdast" "^3.0.0" -mdn-data@2.0.28: - version "2.0.28" - resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.28.tgz#5ec48e7bef120654539069e1ae4ddc81ca490eba" - integrity sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g== - -mdn-data@2.0.30: - version "2.0.30" - resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc" - integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA== - mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -10590,7 +10373,7 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.8: +minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -10850,11 +10633,6 @@ node-dir@^0.1.17: dependencies: minimatch "^3.0.2" -node-domexception@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== - node-fetch-native@^1.0.2: version "1.2.0" resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.2.0.tgz#13ec6df98f33168958dbfb6945f10aedf42e7ea8" @@ -10867,15 +10645,6 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.1.tgz#b3eea7b54b3a48020e46f4f88b9c5a7430d20b2e" - integrity sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow== - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.4" - formdata-polyfill "^4.0.10" - node-fetch@^2.0.0, node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.6.12" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" @@ -11199,13 +10968,6 @@ nps@^5.10.0: type-detect "^4.0.3" yargs "14.2.0" -nth-check@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" - integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== - dependencies: - boolbase "^1.0.0" - nx@15.9.4, "nx@>=15.5.2 < 16": version "15.9.4" resolved "https://registry.yarnpkg.com/nx/-/nx-15.9.4.tgz#1075bc33fe8ee6c6546c21ec6ffcfd2e000946c6" @@ -11877,14 +11639,6 @@ polished@^4.2.2: dependencies: "@babel/runtime" "^7.17.8" -postcss-calc@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-9.0.1.tgz#a744fd592438a93d6de0f1434c572670361eb6c6" - integrity sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ== - dependencies: - postcss-selector-parser "^6.0.11" - postcss-value-parser "^4.2.0" - postcss-cli@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/postcss-cli/-/postcss-cli-9.1.0.tgz#1a86404cbe848e370127b4bdf5cd2be83bc45ebe" @@ -11903,44 +11657,6 @@ postcss-cli@^9.1.0: slash "^4.0.0" yargs "^17.0.0" -postcss-colormin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-6.0.0.tgz#d4250652e952e1c0aca70c66942da93d3cdeaafe" - integrity sha512-EuO+bAUmutWoZYgHn2T1dG1pPqHU6L4TjzPlu4t1wZGXQ/fxV16xg2EJmYi0z+6r+MGV1yvpx1BHkUaRrPa2bw== - dependencies: - browserslist "^4.21.4" - caniuse-api "^3.0.0" - colord "^2.9.1" - postcss-value-parser "^4.2.0" - -postcss-convert-values@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-6.0.0.tgz#ec94a954957e5c3f78f0e8f65dfcda95280b8996" - integrity sha512-U5D8QhVwqT++ecmy8rnTb+RL9n/B806UVaS3m60lqle4YDFcpbS3ae5bTQIh3wOGUSDHSEtMYLs/38dNG7EYFw== - dependencies: - browserslist "^4.21.4" - postcss-value-parser "^4.2.0" - -postcss-discard-comments@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-6.0.0.tgz#9ca335e8b68919f301b24ba47dde226a42e535fe" - integrity sha512-p2skSGqzPMZkEQvJsgnkBhCn8gI7NzRH2683EEjrIkoMiwRELx68yoUJ3q3DGSGuQ8Ug9Gsn+OuDr46yfO+eFw== - -postcss-discard-duplicates@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.0.tgz#c26177a6c33070922e67e9a92c0fd23d443d1355" - integrity sha512-bU1SXIizMLtDW4oSsi5C/xHKbhLlhek/0/yCnoMQany9k3nPBq+Ctsv/9oMmyqbR96HYHxZcHyK2HR5P/mqoGA== - -postcss-discard-empty@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-6.0.0.tgz#06c1c4fce09e22d2a99e667c8550eb8a3a1b9aee" - integrity sha512-b+h1S1VT6dNhpcg+LpyiUrdnEZfICF0my7HAKgJixJLW7BnNmpRH34+uw/etf5AhOlIhIAuXApSzzDzMI9K/gQ== - -postcss-discard-overridden@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-6.0.0.tgz#49c5262db14e975e349692d9024442de7cd8e234" - integrity sha512-4VELwssYXDFigPYAZ8vL4yX4mUepF/oCBeeIT4OXsJPYOtvJumyz9WflmJWTfDwCUcpDR+z0zvCWBXgTx35SVw== - postcss-import@^14.0.2: version "14.1.0" resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-14.1.0.tgz#a7333ffe32f0b8795303ee9e40215dac922781f0" @@ -11958,141 +11674,6 @@ postcss-load-config@^3.0.0: lilconfig "^2.0.5" yaml "^1.10.2" -postcss-merge-longhand@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-6.0.0.tgz#6f627b27db939bce316eaa97e22400267e798d69" - integrity sha512-4VSfd1lvGkLTLYcxFuISDtWUfFS4zXe0FpF149AyziftPFQIWxjvFSKhA4MIxMe4XM3yTDgQMbSNgzIVxChbIg== - dependencies: - postcss-value-parser "^4.2.0" - stylehacks "^6.0.0" - -postcss-merge-rules@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-6.0.1.tgz#39f165746404e646c0f5c510222ccde4824a86aa" - integrity sha512-a4tlmJIQo9SCjcfiCcCMg/ZCEe0XTkl/xK0XHBs955GWg9xDX3NwP9pwZ78QUOWB8/0XCjZeJn98Dae0zg6AAw== - dependencies: - browserslist "^4.21.4" - caniuse-api "^3.0.0" - cssnano-utils "^4.0.0" - postcss-selector-parser "^6.0.5" - -postcss-minify-font-values@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-6.0.0.tgz#68d4a028f9fa5f61701974724b2cc9445d8e6070" - integrity sha512-zNRAVtyh5E8ndZEYXA4WS8ZYsAp798HiIQ1V2UF/C/munLp2r1UGHwf1+6JFu7hdEhJFN+W1WJQKBrtjhFgEnA== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-minify-gradients@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-6.0.0.tgz#22b5c88cc63091dadbad34e31ff958404d51d679" - integrity sha512-wO0F6YfVAR+K1xVxF53ueZJza3L+R3E6cp0VwuXJQejnNUH0DjcAFe3JEBeTY1dLwGa0NlDWueCA1VlEfiKgAA== - dependencies: - colord "^2.9.1" - cssnano-utils "^4.0.0" - postcss-value-parser "^4.2.0" - -postcss-minify-params@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-6.0.0.tgz#2b3a85a9e3b990d7a16866f430f5fd1d5961b539" - integrity sha512-Fz/wMQDveiS0n5JPcvsMeyNXOIMrwF88n7196puSuQSWSa+/Ofc1gDOSY2xi8+A4PqB5dlYCKk/WfqKqsI+ReQ== - dependencies: - browserslist "^4.21.4" - cssnano-utils "^4.0.0" - postcss-value-parser "^4.2.0" - -postcss-minify-selectors@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-6.0.0.tgz#5046c5e8680a586e5a0cad52cc9aa36d6be5bda2" - integrity sha512-ec/q9JNCOC2CRDNnypipGfOhbYPuUkewGwLnbv6omue/PSASbHSU7s6uSQ0tcFRVv731oMIx8k0SP4ZX6be/0g== - dependencies: - postcss-selector-parser "^6.0.5" - -postcss-normalize-charset@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-6.0.0.tgz#36cc12457259064969fb96f84df491652a4b0975" - integrity sha512-cqundwChbu8yO/gSWkuFDmKrCZ2vJzDAocheT2JTd0sFNA4HMGoKMfbk2B+J0OmO0t5GUkiAkSM5yF2rSLUjgQ== - -postcss-normalize-display-values@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.0.tgz#8d2961415078644d8c6bbbdaf9a2fdd60f546cd4" - integrity sha512-Qyt5kMrvy7dJRO3OjF7zkotGfuYALETZE+4lk66sziWSPzlBEt7FrUshV6VLECkI4EN8Z863O6Nci4NXQGNzYw== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-positions@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-6.0.0.tgz#25b96df99a69f8925f730eaee0be74416865e301" - integrity sha512-mPCzhSV8+30FZyWhxi6UoVRYd3ZBJgTRly4hOkaSifo0H+pjDYcii/aVT4YE6QpOil15a5uiv6ftnY3rm0igPg== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-repeat-style@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.0.tgz#ddf30ad8762feb5b1eb97f39f251acd7b8353299" - integrity sha512-50W5JWEBiOOAez2AKBh4kRFm2uhrT3O1Uwdxz7k24aKtbD83vqmcVG7zoIwo6xI2FZ/HDlbrCopXhLeTpQib1A== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-string@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-6.0.0.tgz#948282647a51e409d69dde7910f0ac2ff97cb5d8" - integrity sha512-KWkIB7TrPOiqb8ZZz6homet2KWKJwIlysF5ICPZrXAylGe2hzX/HSf4NTX2rRPJMAtlRsj/yfkrWGavFuB+c0w== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-timing-functions@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.0.tgz#5f13e650b8c43351989fc5de694525cc2539841c" - integrity sha512-tpIXWciXBp5CiFs8sem90IWlw76FV4oi6QEWfQwyeREVwUy39VSeSqjAT7X0Qw650yAimYW5gkl2Gd871N5SQg== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-unicode@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-6.0.0.tgz#741b3310f874616bdcf07764f5503695d3604730" - integrity sha512-ui5crYkb5ubEUDugDc786L/Me+DXp2dLg3fVJbqyAl0VPkAeALyAijF2zOsnZyaS1HyfPuMH0DwyY18VMFVNkg== - dependencies: - browserslist "^4.21.4" - postcss-value-parser "^4.2.0" - -postcss-normalize-url@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-6.0.0.tgz#d0a31e962a16401fb7deb7754b397a323fb650b4" - integrity sha512-98mvh2QzIPbb02YDIrYvAg4OUzGH7s1ZgHlD3fIdTHLgPLRpv1ZTKJDnSAKr4Rt21ZQFzwhGMXxpXlfrUBKFHw== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-whitespace@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.0.tgz#accb961caa42e25ca4179b60855b79b1f7129d4d" - integrity sha512-7cfE1AyLiK0+ZBG6FmLziJzqQCpTQY+8XjMhMAz8WSBSCsCNNUKujgIgjCAmDT3cJ+3zjTXFkoD15ZPsckArVw== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-ordered-values@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-6.0.0.tgz#374704cdff25560d44061d17ba3c6308837a3218" - integrity sha512-K36XzUDpvfG/nWkjs6d1hRBydeIxGpKS2+n+ywlKPzx1nMYDYpoGbcjhj5AwVYJK1qV2/SDoDEnHzlPD6s3nMg== - dependencies: - cssnano-utils "^4.0.0" - postcss-value-parser "^4.2.0" - -postcss-reduce-initial@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-6.0.0.tgz#7d16e83e60e27e2fa42f56ec0b426f1da332eca7" - integrity sha512-s2UOnidpVuXu6JiiI5U+fV2jamAw5YNA9Fdi/GRK0zLDLCfXmSGqQtzpUPtfN66RtCbb9fFHoyZdQaxOB3WxVA== - dependencies: - browserslist "^4.21.4" - caniuse-api "^3.0.0" - -postcss-reduce-transforms@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.0.tgz#28ff2601a6d9b96a2f039b3501526e1f4d584a46" - integrity sha512-FQ9f6xM1homnuy1wLe9lP1wujzxnwt1EwiigtWwuyf8FsqqXUDUp2Ulxf9A5yjlUOTdCJO6lonYjg1mgqIIi2w== - dependencies: - postcss-value-parser "^4.2.0" - postcss-reporter@^7.0.0: version "7.0.5" resolved "https://registry.yarnpkg.com/postcss-reporter/-/postcss-reporter-7.0.5.tgz#e55bd0fdf8d17e4f25fb55e9143fcd79349a2ceb" @@ -12101,7 +11682,7 @@ postcss-reporter@^7.0.0: picocolors "^1.0.0" thenby "^1.3.4" -postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5: +postcss-selector-parser@^6.0.10: version "6.0.13" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== @@ -12109,22 +11690,7 @@ postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.11, postcss-select cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-svgo@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-6.0.0.tgz#7b18742d38d4505a0455bbe70d52b49f00eaf69d" - integrity sha512-r9zvj/wGAoAIodn84dR/kFqwhINp5YsJkLoujybWG59grR/IHx+uQ2Zo+IcOwM0jskfYX3R0mo+1Kip1VSNcvw== - dependencies: - postcss-value-parser "^4.2.0" - svgo "^3.0.2" - -postcss-unique-selectors@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-6.0.0.tgz#c94e9b0f7bffb1203894e42294b5a1b3fb34fbe1" - integrity sha512-EPQzpZNxOxP7777t73RQpZE5e9TrnCrkvp7AH7a0l89JmZiPnS82y216JowHXwpBCQitfyxrof9TK3rYbi7/Yw== - dependencies: - postcss-selector-parser "^6.0.5" - -postcss-value-parser@^4.0.0, postcss-value-parser@^4.2.0: +postcss-value-parser@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== @@ -13392,7 +12958,7 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-map-js@^1.0.1, source-map-js@^1.0.2: +source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== @@ -13746,14 +13312,6 @@ strong-log-transformer@2.1.0, strong-log-transformer@^2.1.0: minimist "^1.2.0" through "^2.3.4" -stylehacks@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-6.0.0.tgz#9fdd7c217660dae0f62e14d51c89f6c01b3cb738" - integrity sha512-+UT589qhHPwz6mTlCLSt/vMNTJx8dopeJlZAlBMJPWA3ORqu6wmQY7FBXf+qD+FsqoBJODyqNxOUP3jdntFRdw== - dependencies: - browserslist "^4.21.4" - postcss-selector-parser "^6.0.4" - suffix@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/suffix/-/suffix-0.1.1.tgz#cc58231646a0ef1102f79478ef3a9248fd9c842f" @@ -13790,18 +13348,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -svgo@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-3.0.2.tgz#5e99eeea42c68ee0dc46aa16da093838c262fe0a" - integrity sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ== - dependencies: - "@trysound/sax" "0.2.0" - commander "^7.2.0" - css-select "^5.1.0" - css-tree "^2.2.1" - csso "^5.0.5" - picocolors "^1.0.0" - synchronous-promise@^2.0.15: version "2.0.17" resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.17.tgz#38901319632f946c982152586f2caf8ddc25c032" @@ -14806,11 +14352,6 @@ wdio-chromedriver-service@^7.3.2: split2 "^3.2.2" tcp-port-used "^1.0.1" -web-streams-polyfill@^3.0.3: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - webdriver@7.31.1: version "7.31.1" resolved "https://registry.yarnpkg.com/webdriver/-/webdriver-7.31.1.tgz#2dafdef92b59dc6456023ac92a9707d7331ecdb6" @@ -14874,11 +14415,6 @@ webpack-virtual-modules@^0.4.5: resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.4.6.tgz#3e4008230731f1db078d9cb6f68baf8571182b45" integrity sha512-5tyDlKLqPfMqjT3Q9TAqf2YqjwmnUleZwzJi1A5qXnlBCdj2AtOJ6wAWdglTIDOPgOiOrXeBeFcsQ8+aGQ6QbA== -webpod@^0: - version "0.0.2" - resolved "https://registry.yarnpkg.com/webpod/-/webpod-0.0.2.tgz#b577c93604fd23596488735887168b3236e3adae" - integrity sha512-cSwwQIeg8v4i3p4ajHhwgR7N6VyxAf+KYSSsY6Pd3aETE+xEU4vbitz7qQkB0I321xnhDdgtxuiSfk5r/FVtjg== - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -15296,24 +14832,3 @@ zwitch@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== - -zx@^7.2.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/zx/-/zx-7.2.3.tgz#d9fef6bd084f7e21994080de09fb20e441074c39" - integrity sha512-QODu38nLlYXg/B/Gw7ZKiZrvPkEsjPN3LQ5JFXM7h0JvwhEdPNNl+4Ao1y4+o3CLNiDUNcwzQYZ4/Ko7kKzCMA== - dependencies: - "@types/fs-extra" "^11.0.1" - "@types/minimist" "^1.2.2" - "@types/node" "^18.16.3" - "@types/ps-tree" "^1.1.2" - "@types/which" "^3.0.0" - chalk "^5.2.0" - fs-extra "^11.1.1" - fx "*" - globby "^13.1.4" - minimist "^1.2.8" - node-fetch "3.3.1" - ps-tree "^1.2.0" - webpod "^0" - which "^3.0.0" - yaml "^2.2.2" From b8f49e5d2223d6833ede5e62b9fab4ab912a219c Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Tue, 19 Dec 2023 07:26:00 +0200 Subject: [PATCH 13/16] chore: cleanup --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac1c749980fd..a66b0152d188 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "start": "npm-run-all --sequential generate start:all", "startWithScope": "npm-run-all --sequential generate scopePrepare:main scopePrepare:fiori copy-css scopeStart:all", "start:all": "npm-run-all --parallel watch:allWithDelay dev", - "start:all2": "npm-run-all generate dev", "dev": "node packages/tools/lib/dev-server/dev-server.js", "scopeStart:all": "npm-run-all --parallel watch:base scopeWatch:main scopeWatch:fiori dev", "start:playground": "yarn ci:releasebuild && yarn copy-css && yarn workspace @ui5/webcomponents-playground start", @@ -36,6 +35,7 @@ "test:fiori": "yarn workspace @ui5/webcomponents-fiori test", "test": "yarn wsrun --exclude-missing test", + "build": "yarn ci:releasebuild", "ci:releasebuild": "npm-run-all --sequential generate ts generateAPI", "ci:lint": "npm-run-all --sequential generate lint", "ci:testbuild": "npm-run-all --sequential generate ts bundle", From 27a4d161c3c3a882863fd4c4df606f822d6452ff Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Tue, 19 Dec 2023 11:30:11 +0200 Subject: [PATCH 14/16] fix: js code for 3rd party packages --- packages/tools/components-package/postcss.components.js | 2 -- .../tools/lib/css-processors/css-processor-components.mjs | 7 +++++-- packages/tools/lib/css-processors/css-processor-themes.mjs | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/tools/components-package/postcss.components.js b/packages/tools/components-package/postcss.components.js index 0ee66edbdf4c..4ba52ba2c8df 100644 --- a/packages/tools/components-package/postcss.components.js +++ b/packages/tools/components-package/postcss.components.js @@ -1,3 +1 @@ -const packageJSON = JSON.parse(fs.readFileSync("./package.json")) - module.exports = {} diff --git a/packages/tools/lib/css-processors/css-processor-components.mjs b/packages/tools/lib/css-processors/css-processor-components.mjs index 9834d2c269c9..7c0565fc3624 100644 --- a/packages/tools/lib/css-processors/css-processor-components.mjs +++ b/packages/tools/lib/css-processors/css-processor-components.mjs @@ -7,6 +7,9 @@ import chokidar from "chokidar"; import scopeVariables from "./scope-variables.mjs"; import { writeFileIfChanged, getFileContent } from "./shared.mjs"; +const tsMode = process.env.UI5_TS === "true"; +const extension = tsMode ? ".css.ts" : ".css.js"; + const packageJSON = JSON.parse(fs.readFileSync("./package.json")) const inputFilesGlob = "src/themes/*.css"; const restArgs = process.argv.slice(2); @@ -24,8 +27,8 @@ let customPlugin = { writeFile(f.path, newText); // JS/TS - const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", ".css.ts"); - const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`", true); + const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", extension); + const jsContent = getFileContent(tsMode, jsPath, packageJSON.name, "\`" + newText + "\`", true); writeFileIfChanged(jsPath, jsContent); }); }) diff --git a/packages/tools/lib/css-processors/css-processor-themes.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs index 15501ab24678..8ec918a8c94a 100644 --- a/packages/tools/lib/css-processors/css-processor-themes.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -8,6 +8,9 @@ import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/ import { writeFileIfChanged, stripThemingBaseContent, getFileContent } from "./shared.mjs"; import scopeVariables from "./scope-variables.mjs"; +const tsMode = process.env.UI5_TS === "true"; +const extension = tsMode ? ".css.ts" : ".css.js"; + const packageJSON = JSON.parse(fs.readFileSync("./package.json")) let inputFiles = await globby("src/**/parameters-bundle.css"); @@ -47,8 +50,8 @@ let scopingPlugin = { writeFileIfChanged(jsonPath, JSON.stringify({_: data})); // JS/TS - const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", ".css.ts"); - const jsContent = getFileContent(true, jsPath, packageJSON.name, "\`" + newText + "\`"); + const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", extension); + const jsContent = getFileContent(tsMode, jsPath, packageJSON.name, "\`" + newText + "\`"); writeFileIfChanged(jsPath, jsContent); }); }) From 52675f6082b34d9009419df8603415bc4d5f5c42 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Tue, 19 Dec 2023 15:44:41 +0200 Subject: [PATCH 15/16] chore: localization without clean --- packages/tools/lib/esm-abs-to-rel/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tools/lib/esm-abs-to-rel/index.js b/packages/tools/lib/esm-abs-to-rel/index.js index 425e4db20664..3f65baad53f5 100644 --- a/packages/tools/lib/esm-abs-to-rel/index.js +++ b/packages/tools/lib/esm-abs-to-rel/index.js @@ -7,8 +7,11 @@ const basePath = process.argv[2]; const convertImports = async (srcPath) => { let changed = false; - // console.log("scanning imports of", srcPath); let code = (await fs.readFile(srcPath)).toString(); + if (code.includes("import(")) { + // esprima can't parse this, but it's from the project files + return; + } const tree = esprima.parseModule(code); const importer = srcPath.replace(basePath, ""); const importerDir = path.dirname(importer); From 958b961ad4911a993307bbd343386ba40c1fa0dd Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Tue, 19 Dec 2023 17:19:41 +0200 Subject: [PATCH 16/16] fix: return clean for localization --- packages/localization/package-scripts.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/localization/package-scripts.cjs b/packages/localization/package-scripts.cjs index b3c7e82724ba..2a92c25f4dd2 100644 --- a/packages/localization/package-scripts.cjs +++ b/packages/localization/package-scripts.cjs @@ -7,7 +7,7 @@ const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/in const scripts = { clean: "rimraf dist", lint: "eslint .", - generate: "nps copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports", + generate: "nps clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports", build: { "default": "nps clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports build.typescript", "replace-amd": "replace-in-file sap.ui.define define dist/**/*.js",