Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion packages/eslint-config-skuba/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/seek-oss/skuba.git"
"url": "git+https://github.com/seek-oss/skuba.git",
"directory": "packages/eslint-config-skuba"
},
"license": "MIT",
"sideEffects": false,
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin-skuba/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/seek-oss/skuba.git"
"url": "git+https://github.com/seek-oss/skuba.git",
"directory": "packages/eslint-plugin-skuba"
},
"license": "MIT",
"sideEffects": false,
Expand Down
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
29 changes: 29 additions & 0 deletions packages/pnpm-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "pnpm-plugin-skuba",
"version": "0.0.0",
"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": {
"name": "SEEK"
},
"type": "module",
"main": "pnpmfile.cjs",
"files": [
"pnpmfile.cjs"
],
"devDependencies": {
"@pnpm/types": "^1000.8.0"
},
"peerDependencies": {
"pnpm": "<10.13.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.

}
33 changes: 33 additions & 0 deletions packages/pnpm-plugin/pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// @ts-check
module.exports = {
hooks: {
/** @param {import("@pnpm/types").PnpmSettings & {
* publicHoistPattern?: string[],
* ignorePatchFailures?: boolean,
* packageManagerStrictVersion?: boolean,
* minimumReleaseAge?: number,
* minimumReleaseAgeExclude?: string[],
*
}} config */
updateConfig(config) {
config.publicHoistPattern ??= [
'@types*',
'eslint',
'eslint-config-skuba',
'prettier',
'esbuild',
'jest',
'tsconfig-seek',
'typescript',
];
Comment on lines +13 to +22
Copy link
Member

Choose a reason for hiding this comment

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

To support merging, the array configs could be like

Suggested change
config.publicHoistPattern ??= [
'@types*',
'eslint',
'eslint-config-skuba',
'prettier',
'esbuild',
'jest',
'tsconfig-seek',
'typescript',
];
(config.publicHoistPattern ??= []).unshift(
'@types*',
'eslint',
'eslint-config-skuba',
'prettier',
'esbuild',
'jest',
'tsconfig-seek',
'typescript',
);

Or, if the above is too spooky to look at:

Suggested change
config.publicHoistPattern ??= [
'@types*',
'eslint',
'eslint-config-skuba',
'prettier',
'esbuild',
'jest',
'tsconfig-seek',
'typescript',
];
config.publicHoistPattern = [
'@types*',
'eslint',
'eslint-config-skuba',
'prettier',
'esbuild',
'jest',
'tsconfig-seek',
'typescript',
...(config.publicHoistPattern ?? []),
];

Copy link
Contributor

Choose a reason for hiding this comment

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

:\ I'm still not a huge fan of this being done in the background where it's less obvious to consumers

Copy link
Member

Choose a reason for hiding this comment

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

This seems to imply that plugins don't work properly with pnpm fetch and pnpm install --offline 🤔


config.ignorePatchFailures ??= false;
config.packageManagerStrictVersion ??= true;

config.minimumReleaseAge ??= 4320; // 3 days
config.minimumReleaseAgeExclude ??= ['@seek/*'];

return config;
},
},
};
3 changes: 2 additions & 1 deletion packages/skuba-dive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/seek-oss/skuba.git"
"url": "git+https://github.com/seek-oss/skuba.git",
"directory": "packages/skuba-dive"
},
"license": "MIT",
"sideEffects": true,
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.