Skip to content

Commit 6dda85e

Browse files
authored
Overall refactor to file structures and types, functions, constants usage (#28)
2 parents bdab098 + 3085872 commit 6dda85e

File tree

16 files changed

+796
-789
lines changed

16 files changed

+796
-789
lines changed

biome.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
3+
"formatter": {
4+
"enabled": true,
5+
"indentStyle": "space"
6+
},
7+
"linter": {
8+
"enabled": true
9+
}
10+
}

bundles/@yarnpkg/plugin-catalogs.js

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"build:dev": "builder build plugin --no-minify",
3030
"clean": "rimraf bundles",
3131
"test": "yarn build && vitest run",
32-
"test:watch": "yarn build && vitest watch"
32+
"test:watch": "yarn build && vitest watch",
33+
"typecheck": "tsc --noEmit"
3334
},
3435
"packageManager": "[email protected]"
3536
}

sources/__tests__/utils.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { dir as tmpDir } from "tmp-promise";
2-
import { writeFile } from "fs/promises";
3-
import { join } from "path";
4-
import { execFile } from "child_process";
5-
import { promisify } from "util";
2+
import { writeFile } from "node:fs/promises";
3+
import { join } from "node:path";
4+
import { execFile } from "node:child_process";
5+
import { promisify } from "node:util";
66
import { dump as yamlDump } from "js-yaml";
7-
import * as fs from "fs/promises";
7+
import * as fs from "node:fs/promises";
88

99
const execFileAsync = promisify(execFile);
1010

@@ -58,7 +58,7 @@ export async function createTestWorkspace(): Promise<TestWorkspace> {
5858
const existingContent = await fs
5959
.readFile(yarnrcPath, "utf8")
6060
.catch(() => "");
61-
await writeFile(yarnrcPath, existingContent + "\n" + yamlDump(content));
61+
await writeFile(yarnrcPath, `${existingContent}\n${yamlDump(content)}`);
6262
};
6363

6464
return {
@@ -75,7 +75,7 @@ export async function createTestWorkspace(): Promise<TestWorkspace> {
7575
*/
7676
export async function createTestProtocolPlugin(
7777
workspace: TestWorkspace,
78-
protocolName: string
78+
protocolName: string,
7979
): Promise<string> {
8080
const pluginCode = `
8181
module.exports = {
@@ -122,7 +122,7 @@ export function extractDependencies(log: string): string[] {
122122
.filter((str) => str != null && str.length > 0)
123123
.map(
124124
(depsString) =>
125-
JSON.parse(depsString) as { value: string; children: object }
125+
JSON.parse(depsString) as { value: string; children: object },
126126
)
127127
.reduce((result, item) => [...result, item.value], [] as string[]);
128128
}

0 commit comments

Comments
 (0)