Skip to content

Commit 93059f7

Browse files
authored
Merge pull request #177 from PSDTools/bump
refactor: tweak pnpm settings
2 parents 97e65c2 + 3473ac4 commit 93059f7

File tree

8 files changed

+239
-327
lines changed

8 files changed

+239
-327
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171
run: pnpm run build
7272
- name: 🕵️ Merge Checks
7373
run: pnpm run merge-checks --continue
74-
# - name: 🧹 Check for deduped dependencies
75-
# run: pnpm exec turbo check-deduped-deps
74+
- name: 🧹 Check for deduped dependencies
75+
run: pnpm exec turbo check-deduped-deps
7676
- name: ⚙️ Upload GPA Calculator
7777
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7878
with:

.pnpmfile.cjs

Lines changed: 1 addition & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -1,197 +1,2 @@
11
// @ts-check
2-
3-
/// PNPM Typedefs.
4-
// From <https://github.com/pnpm/pnpm/blob/eeb76cd1d0a3133d71d96de5646e305f34474652/hooks/pnpmfile/src/Hooks.ts> & <https://github.com/pnpm/pnpm/blob/d500d9f12e8819bf2659abece126938fb3a9ac87/packages/types/src/package.ts>.
5-
6-
const VERBOSE = false;
7-
8-
/**
9-
* A local `package.json` or a remote manifest from a registry as deserialized JSON.
10-
*
11-
* @typedef {Object} Pkg
12-
* @property {string?} name
13-
* @property {string?} version
14-
* @property {Record<string, string>?} dependencies
15-
*/
16-
17-
/**
18-
* A context object passed to hooks.
19-
* Currently contains naught but a logger.
20-
*
21-
* @typedef {Object} HookContext
22-
* @property {(message: string) => void} log
23-
*/
24-
25-
/// Ported code from the Yarn plugin.
26-
27-
/**
28-
* A full list of nolyfilled packages.
29-
*
30-
* Based on <https://github.com/wojtekmaj/yarn-plugin-nolyfill/blob/main/src/index.ts>.
31-
* Keep in sync with <https://github.com/SukkaW/nolyfill/blob/master/packages/tools/cli/src/all-packages.ts>.
32-
* Do note that nolyfill doesn't use CD, so check that the versions listed there have been published.
33-
*
34-
* @type {string[]}
35-
*/
36-
const allPackages = [
37-
"abab",
38-
"array-buffer-byte-length",
39-
"array-flatten",
40-
"array-includes",
41-
"array.from",
42-
"array.of",
43-
"array.prototype.at",
44-
"array.prototype.every",
45-
"array.prototype.find",
46-
"array.prototype.findlast",
47-
"array.prototype.findlastindex",
48-
"array.prototype.flat",
49-
"array.prototype.flatmap",
50-
"array.prototype.flatmap",
51-
"array.prototype.foreach",
52-
"array.prototype.reduce",
53-
"array.prototype.toreversed",
54-
"array.prototype.tosorted",
55-
"arraybuffer.prototype.slice",
56-
"assert",
57-
"asynciterator.prototype",
58-
"available-typed-arrays",
59-
"deep-equal",
60-
"deep-equal-json",
61-
"define-properties",
62-
"es-aggregate-error",
63-
"es-iterator-helpers",
64-
"es-set-tostringtag",
65-
"es6-object-assign",
66-
"function-bind",
67-
"function.prototype.name",
68-
"get-symbol-description",
69-
"globalthis",
70-
"gopd",
71-
"harmony-reflect",
72-
"has",
73-
"has-property-descriptors",
74-
"has-proto",
75-
"has-symbols",
76-
"has-tostringtag",
77-
"hasown",
78-
"internal-slot",
79-
"is-arguments",
80-
"is-array-buffer",
81-
"is-core-module",
82-
"is-date-object",
83-
"is-generator-function",
84-
"is-nan",
85-
"is-regex",
86-
"is-shared-array-buffer",
87-
"is-string",
88-
"is-symbol",
89-
"is-typed-array",
90-
"is-weakref",
91-
"isarray",
92-
"iterator.prototype",
93-
"json-stable-stringify",
94-
"jsonify",
95-
"number-is-nan",
96-
"object-is",
97-
"object-keys",
98-
"object.assign",
99-
"object.entries",
100-
"object.fromentries",
101-
"object.getownpropertydescriptors",
102-
"object.groupby",
103-
"object.hasown",
104-
"object.values",
105-
"promise.allsettled",
106-
"promise.any",
107-
"reflect.getprototypeof",
108-
"reflect.ownkeys",
109-
"regexp.prototype.flags",
110-
"safe-array-concat",
111-
"safe-buffer",
112-
"safe-regex-test",
113-
"safer-buffer",
114-
"set-function-length",
115-
"side-channel",
116-
"string.prototype.at",
117-
"string.prototype.codepointat",
118-
"string.prototype.includes",
119-
"string.prototype.matchall",
120-
"string.prototype.padend",
121-
"string.prototype.padstart",
122-
"string.prototype.repeat",
123-
"string.prototype.replaceall",
124-
"string.prototype.split",
125-
"string.prototype.startswith",
126-
"string.prototype.trim",
127-
"string.prototype.trimend",
128-
"string.prototype.trimleft",
129-
"string.prototype.trimright",
130-
"string.prototype.trimstart",
131-
"typed-array-buffer",
132-
"typed-array-byte-length",
133-
"typed-array-byte-offset",
134-
"typed-array-length",
135-
"typedarray",
136-
"typedarray.prototype.slice",
137-
"unbox-primitive",
138-
"util.promisify",
139-
"which-boxed-primitive",
140-
"which-typed-array",
141-
];
142-
143-
/**
144-
* A map of all nolyfilled packages.
145-
* The keys are the original package names, the values are the nolyfilled package names.
146-
*
147-
* @type {Map<string, string>}
148-
*/
149-
const PATCHES = new Map(allPackages.map((name) => [name, `@nolyfill/${name}`]));
150-
151-
/// Wiring code (pnpm specific)
152-
153-
/**
154-
* @param {Pkg} pkg - The package read.
155-
* @param {HookContext} context - The context of the hook.
156-
* @returns {Pkg} - The package to use.
157-
*/
158-
function readPackage(pkg, context) {
159-
// Not really necessary, but I prefer to keep the original package unmodified.
160-
const newPkg = { ...pkg };
161-
162-
// If the package has dependencies, check if any of them need to be nolyfilled.
163-
if (newPkg.dependencies) {
164-
// Iterate over all dependencies.
165-
for (const name of Object.keys(newPkg.dependencies)) {
166-
// Get the possible nolyfill package name.
167-
const nolyfill = PATCHES.get(name);
168-
169-
// Check if there is nolyfill for the package.
170-
if (nolyfill !== undefined) {
171-
// Replace the original package with the nolyfill.
172-
newPkg.dependencies[name] = `npm:${nolyfill}@^1`;
173-
174-
if (VERBOSE) {
175-
// Tell the user that the package has been nolyfilled.
176-
context.log(`${name} => ${nolyfill}`);
177-
}
178-
}
179-
}
180-
}
181-
182-
// Return the (possibly modified) package.
183-
return newPkg;
184-
}
185-
186-
/// Exports
187-
188-
/**
189-
* A pnpmfile allows you to use hooks to modify the behavior of pnpm.
190-
*
191-
* From <https://pnpm.io/pnpmfile>.
192-
*/
193-
module.exports = {
194-
hooks: {
195-
readPackage,
196-
},
197-
};
2+
module.exports = require("./node_modules/.pnpm-config/@pnpmfiles/nolyfill/.pnpmfile.cjs");

apps/petal-notes/turbo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
"inputs": [
5454
"**/*.ts",
5555
"**/*.svelte"
56+
],
57+
"dependsOn": [
58+
"prepare"
5659
]
5760
},
5861
"typecheck": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"version": "^10.6.4"
4040
}
4141
},
42-
"packageManager": "pnpm@10.6.4+sha512.da3d715bfd22a9a105e6e8088cfc7826699332ded60c423b14ec613a185f1602206702ff0fe4c438cb15c979081ce4cb02568e364b15174503a63c7a8e2a5f6c",
42+
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39",
4343
"manypkg": {
4444
"workspaceProtocol": "require"
4545
}

patches/eslint-config-sheriff.patch

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/dist/index.js b/dist/index.js
2-
index 2b83747e0517c5883b6cadc86a6bf3b78d5abfae..b8865ef3baa146e9eef1548510e15bf76ad70f66 100644
2+
index 2b83747e0517c5883b6cadc86a6bf3b78d5abfae..c5a0f0fe6e47899f9a30e500df4ab844e241a9e5 100644
33
--- a/dist/index.js
44
+++ b/dist/index.js
55
@@ -16,7 +16,8 @@ var tsExtensions = "ts,mts,cts";
@@ -12,3 +12,20 @@ index 2b83747e0517c5883b6cadc86a6bf3b78d5abfae..b8865ef3baa146e9eef1548510e15bf7
1212
var testsFilePatterns = [
1313
`**/*.{test,spec}.{${allJsExtensions}}`,
1414
`**/tests/**/*.{${allJsExtensions}}`,
15+
@@ -1192,7 +1193,7 @@ var getExportableConfig = (userConfigChoices = sheriffStartingOptions, areAllRul
16+
};
17+
18+
// src/index.ts
19+
-import {} from "@typescript-eslint/utils";
20+
+import { TSESLint } from "@typescript-eslint/utils";
21+
import { default as default2 } from "typescript-eslint";
22+
var exportableAllJsExtensions = allJsExtensions;
23+
var exportableAllJsxExtensions = allJsxExtensions;
24+
@@ -1201,6 +1202,7 @@ var exportableSheriffStartingOptions = sheriffStartingOptions;
25+
var exportableSupportedFileTypes = supportedFileTypes;
26+
var exportableTestsFilePatterns = testsFilePatterns;
27+
export {
28+
+ TSESLint,
29+
exportableAllJsExtensions as allJsExtensions,
30+
exportableAllJsxExtensions as allJsxExtensions,
31+
getExportableConfig as default,

0 commit comments

Comments
 (0)