-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(shared): Add missing entries to "files" array in package.json #4172
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@clerk/shared": patch | ||
--- | ||
|
||
Set correct "files" property in package.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'); | ||
} | ||
|
||
Comment on lines
+33
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ is this almost the same error as the one that exists right below? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could merge these 2 checks and throw a single error if any of these checks fail. |
||
const hasAllSubpathsInFiles = pkgFile.files.every(name => allFilesNames.includes(name)); | ||
|
||
if (!hasAllSubpathsInFiles) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just replace this with package.files ? In order to use package.json as the source of truth ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
files
array contains directories (likedist
,scripts
,react
) that need special handling and/or shouldn't get subdirectories created. So one way or another you'd need to add special handling. I can adjust the logic in another PR probably so thatfiles
array is the source of truth