Skip to content

Commit 599ca2e

Browse files
committed
chore: up
1 parent 4eef48b commit 599ca2e

File tree

6 files changed

+53
-29
lines changed

6 files changed

+53
-29
lines changed

.changeset/fair-bats-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"abitype": patch
3+
---
4+
5+
Enabled trusted publisher

.github/workflows/changesets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
uses: wevm/actions/.github/actions/pnpm@main
7171

7272
- name: Prepare
73-
run: pnpm version:update && cd packages/abitype && cp ../../LICENSE LICENSE
73+
run: pnpm bun scripts/genJsrJson.ts && pnpm version:update && cd packages/abitype && cp ../../LICENSE LICENSE
7474

7575
- name: Publish to JSR
7676
run: cd packages/abitype && pnpx jsr publish --allow-slow-types --allow-dirty

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ coverage
1111
dist
1212
node_modules
1313
packages/abitype/abis
14+
packages/abitype/jsr.json
1415
packages/abitype/zod
1516
playgrounds/performance/out
1617
tsconfig*.tsbuildinfo

packages/abitype/jsr.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

scripts/genJsrJson.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Generates jsr.json
2+
3+
console.log('Generating jsr.json')
4+
5+
await Bun.write(
6+
'packages/abitype/jsr.json',
7+
`${JSON.stringify(
8+
{
9+
name: '@wevm/abitype',
10+
version: '1.1.0',
11+
license: 'MIT',
12+
exports: {
13+
'.': './src/exports/index.ts',
14+
'./abis': './src/exports/abis.ts',
15+
'./zod': './src/exports/zod.ts',
16+
},
17+
publish: {
18+
include: ['LICENSE', 'README.md', 'CHANGELOG.md', 'src/**/*.ts'],
19+
exclude: [
20+
'src/**/*.bench.ts',
21+
'src/**/*.bench-d.ts',
22+
'src/**/*.test.ts',
23+
'src/**/*.test-d.ts',
24+
],
25+
},
26+
},
27+
undefined,
28+
2,
29+
)}\n`,
30+
)
31+
32+
console.log('Done.')

scripts/updateVersion.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,20 @@ for (const packagePath of packagePaths) {
4646
)
4747
await Bun.write(versionFilePath, `export const version = '${version}'\n`)
4848

49-
const jsrFilePath = path.resolve(path.dirname(packagePath), 'jsr.json')
50-
const jsrJson = await Bun.file(jsrFilePath).json()
51-
jsrJson.version = version
52-
await Bun.write(jsrFilePath, JSON.stringify(jsrJson, null, 2))
49+
try {
50+
const jsrFilePath = path.resolve(path.dirname(packagePath), 'jsr.json')
51+
const jsrJson = await Bun.file(jsrFilePath).json()
52+
jsrJson.version = version
53+
await Bun.write(jsrFilePath, JSON.stringify(jsrJson, null, 2))
54+
} catch (error) {
55+
if (
56+
error &&
57+
typeof error === 'object' &&
58+
'code' in error &&
59+
error.code !== 'ENOENT'
60+
)
61+
throw error
62+
}
5363

5464
if (Bun.env.PKG_PR_NEW) {
5565
packageJson.version = version

0 commit comments

Comments
 (0)