Skip to content

Commit 46d7e59

Browse files
chore(components, components-react): update @stencil/react-output-target and refactor the stencil config (#6654)
1 parent f190fae commit 46d7e59

File tree

6 files changed

+35
-31
lines changed

6 files changed

+35
-31
lines changed

packages/components-react/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828
"./post-components.css": "./dist/post-components.css",
2929
".": {
3030
"types": "./dist/types/index.d.ts",
31-
"node": "./dist/index.server.js",
3231
"import": "./dist/index.js",
33-
"require": "./dist/index.js"
32+
"node": "./dist/index.server.js"
3433
},
3534
"./server": {
3635
"types": "./dist/types/index.server.d.ts",
37-
"import": "./dist/index.server.js",
38-
"require": "./dist/index.server.js"
36+
"import": "./dist/index.server.js"
3937
}
4038
},
4139
"scripts": {
@@ -47,7 +45,7 @@
4745
"copy:styles:dist": "copyfiles -f src/stencil-generated/post-components.css dist/"
4846
},
4947
"dependencies": {
50-
"@stencil/react-output-target": "0.8.2",
48+
"@stencil/react-output-target": "1.2.0",
5149
"@stencil/ssr": "0.1.1",
5250
"@swisspost/design-system-components": "workspace:10.0.0-next.54"
5351
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './stencil-generated/server/components.js';
1+
export * from './stencil-generated/components.server.js';

packages/components-react/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"noLib": false,
1717
"noUnusedLocals": true,
1818
"noUnusedParameters": true,
19+
"rootDir": "src",
1920
"outDir": "dist",
2021
"removeComments": true,
2122
"skipLibCheck": true,

packages/components/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"start": "pnpm prebuild:script && stencil build --dev --watch --docs --docs-readme",
7171
"prebuild": "pnpm clean && pnpm prebuild:script",
7272
"build": "stencil build --docs-readme",
73-
"postbuild": "pnpm copy:component-names && pnpm fix:export:components-react & pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
73+
"postbuild": "pnpm copy:component-names & pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
7474
"clean": "rimraf --glob dist hydrate loader loaders www src/styles/generated src/_generated ../components-react/**/stencil-generated/ ../components-angular/projects/components/src/lib/stencil-generated/",
7575
"unit": "stencil test --spec",
7676
"unit:watch": "stencil test --spec --watchAll --silent",
@@ -83,7 +83,6 @@
8383
"generate": "stencil generate",
8484
"prebuild:script": "node --loader ts-node/esm prebuild.ts",
8585
"copy:component-names": "copyfiles -f src/_generated/component-names.json dist/",
86-
"fix:export:components-react": "replace './components.server' './components.server.js' ../components-react/src/stencil-generated/server/components.ts",
8786
"copy:styles:components-react": "copyfiles -f www/build/post-components.css ../components-react/src/stencil-generated/",
8887
"copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/projects/components/src/lib/stencil-generated/"
8988
},
@@ -104,7 +103,7 @@
104103
"@percy/cypress": "3.1.6",
105104
"@stencil-community/eslint-plugin": "0.10.0",
106105
"@stencil/angular-output-target": "1.1.1",
107-
"@stencil/react-output-target": "=0.8.2",
106+
"@stencil/react-output-target": "1.2.0",
108107
"@stencil/sass": "3.0.12",
109108
"@swisspost/design-system-eslint": "workspace:10.0.0-next.54",
110109
"@types/jest": "29.5.14",

packages/components/stencil.config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ export const config: Config = {
9191
reactOutputTarget({
9292
customElementsDir: 'react',
9393
outDir: '../components-react/src/stencil-generated',
94-
}),
95-
reactOutputTarget({
96-
customElementsDir: 'react',
97-
outDir: '../components-react/src/stencil-generated/server',
9894
hydrateModule: '@swisspost/design-system-components/hydrate',
95+
clientModule: '@swisspost/design-system-components-react',
96+
serializeShadowRoot: 'declarative-shadow-dom',
9997
}),
10098
/**
10199
* This output-target type automates the creation of Angular component wrappers for the Stencil web-components.

pnpm-lock.yaml

Lines changed: 26 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)