Skip to content

Commit d648de6

Browse files
committed
chore: update scripts
1 parent 456937e commit d648de6

File tree

7 files changed

+45
-42
lines changed

7 files changed

+45
-42
lines changed

examples/next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@types/react-dom": "^19.0.2",
2727
"autoprefixer": "10.4.20",
2828
"eslint": "^9.17.0",
29-
"eslint-config-flat-gitignore": "^0.3.0",
29+
"eslint-config-flat-gitignore": "^1.0.0",
3030
"eslint-plugin-react-hooks": "^5.1.0",
3131
"eslint-plugin-react-refresh": "^0.4.16",
3232
"postcss": "8.4.49",

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@
7373
"cspell": "^8.17.1",
7474
"dedent": "^1.5.3",
7575
"dprint": "^0.48.0",
76+
"effect": "^3.12.1",
7677
"esbuild": "^0.24.2",
7778
"eslint": "^9.17.0",
78-
"eslint-config-flat-gitignore": "^0.3.0",
79+
"eslint-config-flat-gitignore": "^1.0.0",
7980
"eslint-import-resolver-oxc": "^0.8.0",
8081
"eslint-plugin-eslint-plugin": "^6.4.0",
8182
"eslint-plugin-import-x": "^4.6.1",
@@ -100,7 +101,7 @@
100101
"tsup": "^8.3.5",
101102
"tsx": "^4.19.2",
102103
"turbo": "^2.3.3",
103-
"type-fest": "^4.31.0",
104+
"type-fest": "^4.32.0",
104105
"typedoc": "^0.27.6",
105106
"typedoc-plugin-markdown": "^4.4.1",
106107
"typedoc-plugin-rename-defaults": "^0.7.2",

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-resize-observer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default createRule<[], MessageID>({
203203
}
204204
const oentries = oEntries.filter(e => isInstanceIDEqual(e.observer, id, context));
205205
const uentries = uEntries.filter(e => isInstanceIDEqual(e.observer, id, context));
206-
const isDynamic = or(AST.isConditional, AST.is(T.CallExpression));
206+
const isDynamic = (node: TSESTree.Node) => node.type === T.CallExpression || AST.isConditional(node);
207207
const isPhaseNode = (node: TSESTree.Node) => node === phaseNode;
208208
const hasDynamicallyAdded = oentries
209209
.some(e => O.exists(AST.findParentNode(e.node, or(isDynamic, isPhaseNode)), not(isPhaseNode)));

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"fast-equals": "^5.2.2",
5252
"micro-memoize": "^4.1.3",
5353
"tsup": "^8.3.5",
54-
"type-fest": "^4.31.0",
54+
"type-fest": "^4.32.0",
5555
"valibot": "^1.0.0-beta.11"
5656
},
5757
"engines": {

pnpm-lock.yaml

Lines changed: 17 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/update-version.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pc from "picocolors";
12
import { isMatching, match, P } from "ts-pattern";
23

34
import { ignores } from "./ignores";
@@ -6,32 +7,30 @@ import { version } from "./version";
67

78
const GLOB_PACKAGE_JSON = ["package.json", "packages/*/package.json", "packages/*/*/package.json"];
89

9-
const mkTask = (path: string) => {
10-
return async () => {
11-
const packageJson = await readJsonFile(path);
12-
if (!isMatching({ version: P.string }, packageJson)) {
13-
throw new Error(`Invalid package.json at ${path}`);
14-
}
15-
const newVersion = version;
16-
const oldVersion = match(packageJson)
17-
.with({ version: P.select(P.string) }, v => v)
18-
.otherwise(() => "0.0.0");
19-
if (oldVersion === newVersion) {
20-
console.info(`Skipping ${path} as it's already on version ${newVersion}`);
21-
return;
22-
}
23-
const packageJsonUpdated = {
24-
...packageJson,
25-
version: newVersion,
26-
};
27-
await writeJsonFile(path, packageJsonUpdated);
28-
console.info(`Updated ${path} to version ${packageJsonUpdated.version}`);
10+
async function update(path: string) {
11+
const packageJson = await readJsonFile(path);
12+
if (!isMatching({ version: P.string }, packageJson)) {
13+
throw new Error(`Invalid package.json at ${path}`);
14+
}
15+
const newVersion = version;
16+
const oldVersion = match(packageJson)
17+
.with({ version: P.select(P.string) }, v => v)
18+
.otherwise(() => "0.0.0");
19+
if (oldVersion === newVersion) {
20+
console.info(pc.greenBright(`Skipping ${path} as it's already on version ${newVersion}`));
21+
return;
22+
}
23+
const packageJsonUpdated = {
24+
...packageJson,
25+
version: newVersion,
2926
};
30-
};
27+
await writeJsonFile(path, packageJsonUpdated);
28+
console.info(pc.green(`Updated ${path} to version ${packageJsonUpdated.version}`));
29+
}
3130

3231
async function main() {
3332
const tasks = glob(GLOB_PACKAGE_JSON, ignores);
34-
await Promise.all(tasks.map(mkTask));
33+
await Promise.all(tasks.map(path => update(path)));
3534
}
3635

3736
await main();

scripts/verify-lockfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { x } from "tinyexec";
44
const { stdout } = await x("git", ["diff", "HEAD@{1}", "--stat", "--", "./pnpm-lock.yaml"]);
55
if (stdout.split("\n").length > 0) {
66
console.log("");
7-
console.info(pc.greenBright("Detected changes in pnpm-lock.yaml!"));
7+
console.info(pc.green("Detected changes in pnpm-lock.yaml!"));
88
console.info(pc.greenBright("Please run `pnpm install` to update local dependencies."));
99
}

0 commit comments

Comments
 (0)