Skip to content

Commit

Permalink
fix(shared): Add missing entries to "files" array in package.json (#4172
Browse files Browse the repository at this point in the history
)
  • Loading branch information
LekoArts authored Sep 17, 2024
1 parent 4ce6f68 commit 3743eb9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-lobsters-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/shared": patch
---

Set correct "files" property in package.json
5 changes: 4 additions & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"main": "./dist/index.js",
"files": [
"authorization",
"dist",
"browser",
"callWithRetry",
Expand Down Expand Up @@ -73,7 +74,9 @@
"scripts",
"telemetry",
"logger",
"webauthn"
"webauthn",
"router",
"pathToRegexp"
],
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/subpaths.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is a helper for the "subpath-workaround.mjs" script
// We have to polyfill our "exports" subpaths :cry:
// When adding an entry to "subpathNames" also add it to "files" in package.json

export const subpathNames = [
'authorization',
Expand Down
5 changes: 5 additions & 0 deletions scripts/subpath-workaround.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ async function run() {
...subpathHelperFile.ignoredFolders,
'dist',
];

if (pkgFile.files.length !== allFilesNames.length) {
throw new Error('The package.json "files" array length does not match the subpaths.mjs');
}

const hasAllSubpathsInFiles = pkgFile.files.every(name => allFilesNames.includes(name));

if (!hasAllSubpathsInFiles) {
Expand Down

0 comments on commit 3743eb9

Please sign in to comment.