-
Notifications
You must be signed in to change notification settings - Fork 36
RFC: pnpm config dependency #2070
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
728556b
bb8041e
ca7bfde
eff96c9
6653ccb
ad086d6
1a13bcd
6dd87db
8a278c3
9565c4d
0eae658
54f8265
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,17 @@ | ||
| # `pnpm-plugin-skuba` | ||
|
|
||
| [PNPM config dependency] for `skuba` that configures recommended PNPM settings. | ||
|
|
||
| ## Usage | ||
|
|
||
| > [!IMPORTANT] | ||
| > This package is intended to be used with `pnpm` version [10.13] or later. | ||
| > It will _not_ be automatically loaded in `pnpm` versions prior to 10.13. | ||
|
|
||
| ```sh | ||
| pnpm add --config pnpm-plugin-skuba | ||
| pnpm install | ||
| ``` | ||
|
|
||
| [PNPM config dependency]: https://pnpm.io/config-dependencies | ||
| [10.13]: https://github.com/pnpm/pnpm/releases/tag/v10.13.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "name": "pnpm-plugin-skuba", | ||
| "version": "0.0.1", | ||
| "description": "PNPM config dependency for skuba that configures recommended PNPM settings", | ||
| "homepage": "https://github.com/seek-oss/skuba#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/seek-oss/skuba/issues" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/seek-oss/skuba.git", | ||
| "directory": "packages/pnpm-plugin" | ||
| }, | ||
| "license": "MIT", | ||
| "author": "SEEK", | ||
| "type": "module", | ||
| "main": "pnpmfile.cjs", | ||
| "files": [ | ||
| "pnpmfile.cjs" | ||
| ], | ||
| "devDependencies": { | ||
| "@pnpm/types": "^1000.8.0" | ||
| } | ||
|
Comment on lines
+26
to
+28
Contributor
Author
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. I don't know if this will do the same thing as https://github.com/seek-oss/sku/blob/831bf9151023c9b5ec7b13288f3f40626deacf90/packages/utils/src/packageManager/packageManager.ts#L89-L94
Member
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. I would assume not, but worth testing alongside https://docs.npmjs.com/cli/v11/configuring-npm/package-json#engines and https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines. Also depends on whether we want to log a warning or fail the install if an older pnpm version is detected. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // @ts-check | ||
| module.exports = { | ||
| hooks: { | ||
| /** @param {import("@pnpm/types").PnpmSettings} config */ | ||
| updateConfig(config) { | ||
| // @ts-expect-error Property isn't in PnpmSettings for some reason | ||
| config.publicHoistPattern ??= []; | ||
| // @ts-expect-error Property isn't in PnpmSettings for some reason | ||
| config.publicHoistPattern.push( | ||
|
||
| '@types*', | ||
| 'eslint', | ||
| 'eslint-config-skuba', | ||
| 'prettier', | ||
| 'esbuild', | ||
| 'jest', | ||
| 'tsconfig-seek', | ||
| 'typescript', | ||
| ); | ||
|
|
||
| config.ignorePatchFailures = false; | ||
| // @ts-expect-error Property isn't in PnpmSettings for some reason | ||
| config.packageManagerStrictVersion = true; | ||
|
||
|
|
||
| // @ts-expect-error Property isn't in PnpmSettings for some reason | ||
| config.minimumReleaseAge = 4320 // 3 days | ||
| // @ts-expect-error Property isn't in PnpmSettings for some reason | ||
| config.minimumReleaseAgeExclude ??= [] | ||
| // @ts-expect-error Property isn't in PnpmSettings for some reason | ||
| config.minimumReleaseAgeExclude.push('@seek/*') | ||
|
|
||
| return config; | ||
| }, | ||
| }, | ||
| }; | ||
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.
Oh TIL
directory, we should probably set it for our other packages