Skip to content

Commit

Permalink
chore(components): change package.json main, module and types files-p…
Browse files Browse the repository at this point in the history
…aths to the recommended dist-folder files (#2886)

Co-authored-by: Alizé Debray <[email protected]>
  • Loading branch information
oliverschuerch and alizedebray authored Apr 10, 2024
1 parent 53b36d2 commit 9b3143c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .changeset/giant-glasses-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@swisspost/design-system-components': major
---

Updated the package entry properties in the package.json to the by stencil recommended files:

- Updated the `main` property from `loader/index.cjs.js` to `dist/index.cjs.js`
- Updated the `module` property from `loader/index.js` to `dist/loader.js`
- Updated the `types` property from `loader/index.d.ts` to `dist/types/index.d.ts`
- Removed the `es2017` property

The usage of the `@swisspost/design-system-components/loader` entry files are still available and should be used to get the lazy-loaded components.
9 changes: 4 additions & 5 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"version": "2.1.0",
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
"license": "Apache-2.0",
"main": "loader/index.cjs.js",
"module": "loader/index.js",
"es2017": "loader/index.2017.js",
"types": "loader/index.d.ts",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"types": "dist/types/index.d.ts",
"collection": "dist/collection/collection-manifest.json",
"collection:main": "dist/collection/index.js",
"unpkg": "dist/post-components/post-components.esm.js",
Expand All @@ -24,7 +23,7 @@
"linkDirectory": true
},
"scripts": {
"dev": "stencil build --serve --port 9200 --watch --docs-readme",
"dev": "stencil build --port 9200 --serve --watch --docs-readme",
"start": "stencil build --watch --docs-readme",
"build": "stencil build --docs-readme",
"clean": "rimraf www dist loader",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,33 @@ export class MigrationV67Component extends LitElement {
<h4>Web Components</h4>
<ul>
<li class="mb-3">
<p>
Updated the package entry file paths within the <em>package.json</em> to the
paths, recommended by stencil
<span class="tag tag-sm tag-danger">breaking</span>
</p>
<ul>
<li>
updated the <code>main</code> property from
<code>loader/index.cjs.js</code> to <code>dist/index.cjs.js</code>
</li>
<li>
updated the <code>module</code> property from <code>loader/index.js</code> to
<code>dist/loader.js</code>
</li>
<li>
updated the <code>types</code> property from <code>loader/index.d.ts</code> to
<code>dist/types/index.d.ts</code>
</li>
<li>removed the <code>es2017</code> property</li>
</ul>
<p class="info">
The usage of the <code>@swisspost/design-system-components/loader</code> entry
files are still available and should be used (as documented) to get the
lazy-loaded components.
</p>
</li>
<li class="mb-3">
<p>
Renamed all <em>custom-events</em> in our existing web-components
Expand Down

0 comments on commit 9b3143c

Please sign in to comment.