From d78829521a990d3534ef5097cc63b3c03e21acdc Mon Sep 17 00:00:00 2001 From: David Pertiller Date: Mon, 25 Jan 2021 00:35:45 +0100 Subject: [PATCH] chore(workspace): update Stencil from v1.16 to v2.3. Include defineCustomElements script for backwards compatibility --- libs/ui-components/package.json | 4 ++-- libs/ui-components/stencil.config.ts | 2 ++ package.json | 7 ++++--- tsconfig.base.json | 6 +++--- yarn.lock | 31 +++++++++++----------------- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/libs/ui-components/package.json b/libs/ui-components/package.json index 6596b4f..c523b45 100644 --- a/libs/ui-components/package.json +++ b/libs/ui-components/package.json @@ -5,8 +5,8 @@ "keywords": ["web components", "custom elements", "stencil", "ui", "components"], "version": "1.0.0", "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "main": "dist/index.cjs.js", + "module": "dist/index.js", "es2015": "dist/esm/index.mjs", "es2017": "dist/esm/index.mjs", "types": "dist/types/index.d.ts", diff --git a/libs/ui-components/stencil.config.ts b/libs/ui-components/stencil.config.ts index eb0622e..f1eee8e 100644 --- a/libs/ui-components/stencil.config.ts +++ b/libs/ui-components/stencil.config.ts @@ -10,6 +10,8 @@ export const config: Config = { reactOutputTarget({ componentCorePackage: 'ui-components', proxiesFile: '../generated/ui-components-react/src/components.ts', + includeDefineCustomElements: true, + includePolyfills: false }), { type: 'dist', diff --git a/package.json b/package.json index 0aede2f..d96a499 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "author": "David Pertiller", "license": "MIT", "scripts": { + "postinstall": "nx run ui-components:build", "nx": "nx", "start": "nx run-many --target=serve --all=true --parallel=true --with-deps=true --open=true", "build": "nx build", @@ -49,9 +50,9 @@ "@nrwl/web": "11.1.5", "@nrwl/workspace": "11.1.5", "@nxext/stencil": "11.0.0", - "@stencil/core": "1.16.4", - "@stencil/react-output-target": "^0.0.7", - "@stencil/sass": "1.3.1", + "@stencil/core": "^2.3.0", + "@stencil/react-output-target": "^0.0.9", + "@stencil/sass": "^1.4.1", "@testing-library/react": "11.1.2", "@types/jest": "26.0.8", "@types/node": "12.12.38", diff --git a/tsconfig.base.json b/tsconfig.base.json index 1fb28fa..70bf8df 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -3,9 +3,9 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "ui-components": ["dist/libs/ui-components/"], - "ui-components/loader": ["dist/libs/ui-components/loader/index.cjs.js"], - "ui-components-react": ["dist/libs/generated/ui-components-react/src/index.ts"] + "ui-components": ["dist/libs/ui-components"], + "ui-components/loader": ["dist/libs/ui-components/loader"], + "ui-components-react": ["dist/libs/generated/ui-components-react/src/components.ts"] }, "rootDir": ".", "sourceMap": true, diff --git a/yarn.lock b/yarn.lock index aff39bf..7671544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2678,22 +2678,20 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@stencil/core@1.16.4": - version "1.16.4" - resolved "https://registry.yarnpkg.com/@stencil/core/-/core-1.16.4.tgz#132fcee3bc6c6c0db5af799c8279b42b559877d9" - integrity sha512-RN1xoGyzNCXAAzN8HHDDoGEbGrms1YpEnfp86kd37ZHOOwX500GwxjsTOpzFcBOfkUoiuBjKVnONTqWO04H8/Q== - dependencies: - typescript "3.9.7" +"@stencil/core@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@stencil/core/-/core-2.3.0.tgz#9190df3a0064537730be1546545e13531d701da8" + integrity sha512-VZ/Ox0E1kngcmHbJhHUufuLELi+xG3of3LuRI3X2AMWyE82JUVYlOEsQci/YBZWpfc9BS9I36R88prBew22oew== -"@stencil/react-output-target@^0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@stencil/react-output-target/-/react-output-target-0.0.7.tgz#47e0b52336bdebd8e74680dd4b49c80b557c173a" - integrity sha512-Z3w+Mj3cyNutltrkEs1FMW0ABWTWQXJn1nxmFmvDmMknAtAgKl0qrazdVS5+uQ0XneiCp5lfYgqMcKfP5CM9Yw== +"@stencil/react-output-target@^0.0.9": + version "0.0.9" + resolved "https://registry.yarnpkg.com/@stencil/react-output-target/-/react-output-target-0.0.9.tgz#b225611c5743f0285c37d92bb47d9369ba462c54" + integrity sha512-t2sSkm/VGftBqewK47eZonaHIXW7CYWlsDy6Ln4jqNVpr93CuPWkg7rsnPiZrJrU1NBuTgA0hC2xoRcAJVm7Sw== -"@stencil/sass@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@stencil/sass/-/sass-1.3.1.tgz#d49f09b4e720eafea13a77e0940cc86039370644" - integrity sha512-5qsEyhLGTywpG4zlWv6eBhhj/z2Z37nbUGa87Ak0KqfsEiclJCYRA/AMM9FiN1jHfBvr968G4zE8rNlYmiPLsQ== +"@stencil/sass@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@stencil/sass/-/sass-1.4.1.tgz#ef5a1dd1b56c024ed08e80475e8a6f8d1c25bb10" + integrity sha512-aFKoqtxZ/8BRbvNFiWRycGiqvMI22Ifn5qsKfq0U23j43XD81jT6d7K0WQd55ejNpoSpdxJcbOuFgQy3mXizfA== "@svgr/babel-plugin-add-jsx-attribute@^5.4.0": version "5.4.0" @@ -13102,11 +13100,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.9.7: - version "3.9.7" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" - integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== - typescript@4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389"