Skip to content

Commit 3940625

Browse files
committed
Lint and format
1 parent d87193f commit 3940625

35 files changed

+614
-488
lines changed

biome.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
@@ -8,15 +8,11 @@
88
"files": {
99
"includes": [
1010
"**",
11-
"!!apps/job-board",
11+
"!!.claude",
12+
"!!.opencode",
1213
"!!node_modules",
1314
"!!.github",
14-
"!!.turbo",
15-
"!!.next",
16-
"!!.vscode",
17-
"!!dist",
18-
"!!_generated",
19-
"!!drizzle"
15+
"!!dist"
2016
]
2117
},
2218
"linter": {
@@ -25,13 +21,6 @@
2521
"recommended": true,
2622
"style": {
2723
"noNonNullAssertion": "off"
28-
},
29-
"a11y": {
30-
"noSvgWithoutTitle": "off",
31-
"noStaticElementInteractions": "off"
32-
},
33-
"security": {
34-
"noDangerouslySetInnerHtml": "warn"
3524
}
3625
}
3726
},
@@ -45,11 +34,6 @@
4534
"quoteStyle": "double"
4635
}
4736
},
48-
"css": {
49-
"parser": {
50-
"tailwindDirectives": true
51-
}
52-
},
5337
"json": {
5438
"formatter": {
5539
"indentStyle": "tab",

script/publish.ts

Lines changed: 73 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,135 @@
11
#!/usr/bin/env bun
22

3-
import { $ } from "bun"
3+
import { $ } from "bun";
44

55
// Get bump type from environment
6-
const bump = process.env.BUMP
7-
if (!bump || !['patch', 'minor', 'major'].includes(bump)) {
8-
console.error("Invalid or missing BUMP environment variable. Must be patch, minor, or major.")
9-
process.exit(1)
6+
const bump = process.env.BUMP;
7+
if (!bump || !["patch", "minor", "major"].includes(bump)) {
8+
console.error(
9+
"Invalid or missing BUMP environment variable. Must be patch, minor, or major.",
10+
);
11+
process.exit(1);
1012
}
1113

1214
// Get current version
13-
const pkg = await Bun.file('package.json').json()
14-
const currentVersion = pkg.version
15-
console.log(`Current version: ${currentVersion}`)
15+
const pkg = await Bun.file("package.json").json();
16+
const currentVersion = pkg.version;
17+
console.log(`Current version: ${currentVersion}`);
1618

1719
// Calculate new version
18-
const [major, minor, patch] = currentVersion.split('.').map(Number)
20+
const [major, minor, patch] = currentVersion.split(".").map(Number);
1921
const newVersion: string = (() => {
2022
switch (bump) {
21-
case 'patch':
22-
return `${major}.${minor}.${patch + 1}`
23-
case 'minor':
24-
return `${major}.${minor + 1}.0`
25-
case 'major':
26-
return `${major + 1}.0.0`
23+
case "patch":
24+
return `${major}.${minor}.${patch + 1}`;
25+
case "minor":
26+
return `${major}.${minor + 1}.0`;
27+
case "major":
28+
return `${major + 1}.0.0`;
2729
default:
28-
throw new Error(`Invalid bump type: ${bump}`)
30+
throw new Error(`Invalid bump type: ${bump}`);
2931
}
30-
})()
32+
})();
3133

32-
console.log(`New version: ${newVersion}`)
34+
console.log(`New version: ${newVersion}`);
3335

3436
// Update package.json
35-
pkg.version = newVersion
36-
await Bun.file('package.json').write(JSON.stringify(pkg, null, 2) + '\n')
37-
console.log("Updated package.json")
37+
pkg.version = newVersion;
38+
await Bun.file("package.json").write(`${JSON.stringify(pkg, null, 2)}\n`);
39+
console.log("Updated package.json");
3840

3941
// Build the project
40-
console.log("Building project...")
41-
await $`bun run build`
42-
console.log("Build completed")
42+
console.log("Building project...");
43+
await $`bun run build`;
44+
console.log("Build completed");
4345

4446
// Publish to npm
45-
console.log("Publishing to npm...")
46-
await $`npm publish --access public`
47-
console.log("Published to npm")
47+
console.log("Publishing to npm...");
48+
await $`npm publish --access public`;
49+
console.log("Published to npm");
4850

4951
// Git operations
50-
console.log("Committing changes...")
51-
await $`git add package.json`
52-
await $`git commit -m "release: v${newVersion}"`
53-
await $`git tag v${newVersion}`
54-
await $`git push origin main --tags`
55-
console.log("Git operations completed")
52+
console.log("Committing changes...");
53+
await $`git add package.json`;
54+
await $`git commit -m "release: v${newVersion}"`;
55+
await $`git tag v${newVersion}`;
56+
await $`git push origin main --tags`;
57+
console.log("Git operations completed");
5658

5759
// Generate release notes
58-
console.log("Generating release notes...")
60+
console.log("Generating release notes...");
5961

6062
// Get latest tag for comparison
61-
let latestTag = 'HEAD~1'
63+
let latestTag = "HEAD~1";
6264
try {
63-
const result = await $`git describe --tags --abbrev=0 HEAD~1`.text()
64-
latestTag = result.trim()
65-
} catch (e) {
65+
const result = await $`git describe --tags --abbrev=0 HEAD~1`.text();
66+
latestTag = result.trim();
67+
} catch (_e) {
6668
// No previous tags, use first commit
67-
latestTag = await $`git rev-list --max-parents=0 HEAD`.text().then(t => t.trim())
69+
latestTag = await $`git rev-list --max-parents=0 HEAD`
70+
.text()
71+
.then((t) => t.trim());
6872
}
6973

70-
console.log(`Comparing ${latestTag}..HEAD`)
74+
console.log(`Comparing ${latestTag}..HEAD`);
7175

7276
// Get commits since last tag
73-
let commits: string[] = []
77+
let commits: string[] = [];
7478
try {
75-
const result = await $`git log --oneline --pretty=format:"%h %s" ${latestTag}..HEAD`
76-
commits = result.text().split('\n').filter(line => line.trim())
77-
} catch (e) {
79+
const result =
80+
await $`git log --oneline --pretty=format:"%h %s" ${latestTag}..HEAD`;
81+
commits = result
82+
.text()
83+
.split("\n")
84+
.filter((line) => line.trim());
85+
} catch (_e) {
7886
// No commits or error
7987
}
8088

81-
console.log(`Found ${commits.length} commits`)
89+
console.log(`Found ${commits.length} commits`);
8290

8391
// Get contributors (excluding author "Donald Silveira")
84-
const contributors = new Set<string>()
92+
const contributors = new Set<string>();
8593
for (const commit of commits) {
8694
try {
87-
const hash = commit.split(' ')[0]
88-
const author = await $`git show -s --format='%an' ${hash}`.text().trim()
89-
if (author !== 'Donald Silveira') {
90-
contributors.add(`@${author.replace(/\s+/g, '').toLowerCase()}`)
95+
const hash = commit.split(" ")[0];
96+
const author = await $`git show -s --format='%an' ${hash}`.text().trim();
97+
if (author !== "Donald Silveira") {
98+
contributors.add(`@${author.replace(/\s+/g, "").toLowerCase()}`);
9199
}
92-
} catch (e) {
100+
} catch (_e) {
93101
// Skip if can't get author
94102
}
95103
}
96104

97105
// Format release notes
98-
let notes = `## Changes\n`
106+
let notes = `## Changes\n`;
99107
if (commits.length === 0) {
100-
notes += `- Initial release\n`
108+
notes += `- Initial release\n`;
101109
} else {
102-
for (const commit of commits.slice(0, 10)) { // Limit to 10 commits
103-
const message = commit.split(' ').slice(1).join(' ')
104-
notes += `- ${message}\n`
110+
for (const commit of commits.slice(0, 10)) {
111+
// Limit to 10 commits
112+
const message = commit.split(" ").slice(1).join(" ");
113+
notes += `- ${message}\n`;
105114
}
106115
if (commits.length > 10) {
107-
notes += `- ... and ${commits.length - 10} more changes\n`
116+
notes += `- ... and ${commits.length - 10} more changes\n`;
108117
}
109118
}
110119

111120
if (contributors.size > 0) {
112-
notes += `\n## Contributors\n${Array.from(contributors).join(', ')}\n`
121+
notes += `\n## Contributors\n${Array.from(contributors).join(", ")}\n`;
113122
}
114123

115124
// Create GitHub release
116-
console.log("Creating GitHub release...")
117-
await $`gh release create v${newVersion} --title "v${newVersion}" --notes ${notes} --draft=false`
118-
console.log("Release created")
125+
console.log("Creating GitHub release...");
126+
await $`gh release create v${newVersion} --title "v${newVersion}" --notes ${notes} --draft=false`;
127+
console.log("Release created");
119128

120129
// Output for GitHub Actions
121-
const output = `version=${newVersion}\ntag=v${newVersion}\n`
130+
const output = `version=${newVersion}\ntag=v${newVersion}\n`;
122131
if (process.env.GITHUB_OUTPUT) {
123-
await Bun.write(process.env.GITHUB_OUTPUT, output)
132+
await Bun.write(process.env.GITHUB_OUTPUT, output);
124133
}
125134

126-
console.log(`Successfully released v${newVersion}!`)
135+
console.log(`Successfully released v${newVersion}!`);

src/adapters/amp.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
* Amp adapter
33
*/
44

5-
import { join } from "path";
6-
import type {
7-
AgentAdapter,
8-
Platform,
9-
ImportResult,
10-
ExportResult,
11-
} from "./types";
5+
import { unlinkSync } from "node:fs";
6+
import { join } from "node:path";
127
import {
13-
exists,
148
copyDir,
15-
ensureDir,
169
createSymlink,
10+
ensureDir,
11+
exists,
1712
isSymlink,
1813
removeDir,
1914
} from "../utils/fs";
20-
import { unlinkSync } from "fs";
2115
import { contractHome } from "../utils/paths";
16+
import type {
17+
AgentAdapter,
18+
ExportResult,
19+
ImportResult,
20+
Platform,
21+
} from "./types";
2222

2323
export class AmpAdapter implements AgentAdapter {
2424
readonly id = "amp";
@@ -29,7 +29,7 @@ export class AmpAdapter implements AgentAdapter {
2929
export: "symlink" as const,
3030
};
3131

32-
getConfigPath(platform: Platform): string {
32+
getConfigPath(_platform: Platform): string {
3333
return join(process.env.HOME || "", ".config/amp");
3434
}
3535

@@ -42,7 +42,12 @@ export class AmpAdapter implements AgentAdapter {
4242
}
4343

4444
detect(): boolean {
45-
const platform = process.platform === "darwin" ? "macos" : process.platform === "win32" ? "windows" : "linux";
45+
const platform =
46+
process.platform === "darwin"
47+
? "macos"
48+
: process.platform === "win32"
49+
? "windows"
50+
: "linux";
4651
return this.isInstalled(platform);
4752
}
4853

@@ -89,7 +94,7 @@ export class AmpAdapter implements AgentAdapter {
8994
removeDir(backupPath);
9095
}
9196
}
92-
require("fs").renameSync(systemPath, backupPath);
97+
require("node:fs").renameSync(systemPath, backupPath);
9398
}
9499
}
95100

src/adapters/antigravity.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
* Antigravity adapter
33
*/
44

5-
import { join } from "path";
6-
import type {
7-
AgentAdapter,
8-
Platform,
9-
ImportResult,
10-
ExportResult,
11-
} from "./types";
5+
import { unlinkSync } from "node:fs";
6+
import { join } from "node:path";
127
import {
13-
exists,
148
copyDir,
15-
ensureDir,
169
createSymlink,
10+
ensureDir,
11+
exists,
1712
isSymlink,
1813
removeDir,
1914
} from "../utils/fs";
20-
import { unlinkSync } from "fs";
2115
import { contractHome } from "../utils/paths";
16+
import type {
17+
AgentAdapter,
18+
ExportResult,
19+
ImportResult,
20+
Platform,
21+
} from "./types";
2222

2323
export class AntigravityAdapter implements AgentAdapter {
2424
readonly id = "antigravity";
@@ -29,7 +29,7 @@ export class AntigravityAdapter implements AgentAdapter {
2929
export: "symlink" as const,
3030
};
3131

32-
getConfigPath(platform: Platform): string {
32+
getConfigPath(_platform: Platform): string {
3333
return join(process.env.HOME || "", ".gemini/antigravity");
3434
}
3535

@@ -44,7 +44,12 @@ export class AntigravityAdapter implements AgentAdapter {
4444
}
4545

4646
detect(): boolean {
47-
const platform = process.platform === "darwin" ? "macos" : process.platform === "win32" ? "windows" : "linux";
47+
const platform =
48+
process.platform === "darwin"
49+
? "macos"
50+
: process.platform === "win32"
51+
? "windows"
52+
: "linux";
4853
return this.isInstalled(platform);
4954
}
5055

@@ -91,7 +96,7 @@ export class AntigravityAdapter implements AgentAdapter {
9196
removeDir(backupPath);
9297
}
9398
}
94-
require("fs").renameSync(systemPath, backupPath);
99+
require("node:fs").renameSync(systemPath, backupPath);
95100
}
96101
}
97102

0 commit comments

Comments
 (0)