-
Notifications
You must be signed in to change notification settings - Fork 272
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
chore(repo): QoL for subpaths script #4180
Conversation
🦋 Changeset detectedLatest commit: a04b670 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
* When you add an entry to the package.json "files" field, a subfolder will be automatically created with a package.json pointing to that file | ||
*/ | ||
|
||
export const subpathNames = packageJson.files.filter(k => k !== 'dist'); |
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.
Source of truth now:
javascript/packages/localizations/package.json
Lines 53 to 92 in 26ab88c
"files": [ | |
"dist", | |
"ar-SA", | |
"ca-ES", | |
"cs-CZ", | |
"da-DK", | |
"de-DE", | |
"el-GR", | |
"en-US", | |
"es-ES", | |
"fi-FI", | |
"fr-FR", | |
"he-IL", | |
"is-IS", | |
"it-IT", | |
"ja-JP", | |
"ko-KR", | |
"mn-MN", | |
"nb-NO", | |
"nl-NL", | |
"nl-BE", | |
"pl-PL", | |
"pt-BR", | |
"pt-PT", | |
"ro-RO", | |
"ru-RU", | |
"sk-SK", | |
"sv-SE", | |
"tr-TR", | |
"uk-UA", | |
"vi-VN", | |
"zh-CN", | |
"zh-TW", | |
"es-MX", | |
"bg-BG", | |
"th-TH", | |
"hu-HU", | |
"sr-RS", | |
"hr-HR" | |
], |
* When you add an entry to the package.json "files" field, a subfolder will be automatically created with a package.json pointing to that file | ||
*/ | ||
|
||
export const subpathNames = packageJson.files.filter(k => k !== 'dist'); |
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.
javascript/packages/react/package.json
Lines 59 to 63 in 26ab88c
"files": [ | |
"dist", | |
"internal", | |
"errors" | |
], |
Previously it extracted the same from this:
javascript/packages/react/package.json
Lines 25 to 57 in 26ab88c
"exports": { | |
".": { | |
"import": { | |
"types": "./dist/index.d.mts", | |
"default": "./dist/index.mjs" | |
}, | |
"require": { | |
"types": "./dist/index.d.ts", | |
"default": "./dist/index.js" | |
} | |
}, | |
"./internal": { | |
"import": { | |
"types": "./dist/internal.d.mts", | |
"default": "./dist/internal.mjs" | |
}, | |
"require": { | |
"types": "./dist/internal.d.ts", | |
"default": "./dist/internal.js" | |
} | |
}, | |
"./errors": { | |
"import": { | |
"types": "./dist/errors.d.mts", | |
"default": "./dist/errors.mjs" | |
}, | |
"require": { | |
"types": "./dist/errors.d.ts", | |
"default": "./dist/errors.js" | |
} | |
}, | |
"./package.json": "./package.json" | |
}, |
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.
🔥
* When you add an entry to the package.json "files" field, a subfolder will be automatically created with a package.json pointing to that file | ||
*/ | ||
|
||
export const subpathNames = packageJson.files.filter(k => !['dist', 'scripts', 'react'].includes(k)); |
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.
scripts
should be left alone, react
is a barrel file so handled below
Description
Follow-up to #4172 - this makes
package.json#files
the source of truth for the subpaths.mjs scripts.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change