Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
17 changes: 17 additions & 0 deletions packages/pnpm-plugin/README.md
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
24 changes: 24 additions & 0 deletions packages/pnpm-plugin/package.json
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"
Copy link
Member

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

},
"license": "MIT",
"author": "SEEK",
"type": "module",
"main": "pnpmfile.cjs",
"files": [
"pnpmfile.cjs"
],
"devDependencies": {
"@pnpm/types": "^1000.8.0"
}
Comment on lines +26 to +28
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The 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.

}
34 changes: 34 additions & 0 deletions packages/pnpm-plugin/pnpmfile.cjs
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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should our patterns be prepended so consumers can define overrides with !?

https://pnpm.io/settings#publichoistpattern

'@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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar question on whether stuff like this should be ??= to allow consumer to override 🤔


// @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;
},
},
};
Loading
Loading