Improve JSR package metadata

This commit is contained in:
2026-07-10 04:19:00 +09:00
parent 8eac5c5cb4
commit fc1f3e0b25
10 changed files with 213 additions and 19 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
}
},
"../../packages/decodal-wasm": {
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT OR Apache-2.0"
},
"node_modules/@astrojs/check": {
@@ -1,4 +1,4 @@
import { writeFileSync } from 'node:fs';
import { readFileSync, writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
const packageDir = resolve(import.meta.dirname, '../../../packages/decodal-wasm');
@@ -8,6 +8,11 @@ writeFileSync(
'# wasm-pack output is committed for the browser runtime package.\n',
);
const packageJsonPath = resolve(packageDir, 'package.json');
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
packageJson.version = '0.1.3';
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
writeFileSync(
resolve(packageDir, 'README.md'),
`# decodal-wasm
@@ -38,11 +43,8 @@ import init, { evaluateProject } from 'decodal-wasm';
await init();
const result = evaluateProject(JSON.stringify({
entry: 'main.dcdl',
files: {
'main.dcdl': 'Server = { port = Int default 8080; };',
},
const result = evaluateProject('main.dcdl', JSON.stringify({
'main.dcdl': 'Server = { port = Int default 8080; };',
}));
console.log(JSON.parse(result));
@@ -51,3 +53,27 @@ console.log(JSON.parse(result));
The exported functions return JSON strings so callers can handle diagnostics and successful results without depending on Rust data structures.
`,
);
writeFileSync(
resolve(packageDir, 'jsr.json'),
JSON.stringify(
{
name: '@hare/decodal-wasm',
version: '0.1.3',
license: 'MIT',
exports: './mod.ts',
publish: {
include: [
'README.md',
'mod.ts',
'decodal_wasm.js',
'decodal_wasm.d.ts',
'decodal_wasm_bg.wasm',
'package.json',
],
},
},
null,
2,
) + '\n',
);
+1 -1
View File
@@ -32,7 +32,7 @@ Production = Server & {
<strong>crates.io/crates/decodal</strong>
</a>
<ul class="package-list">
<li>decodal-wasm on <a href="https://jsr.io/@hare/decodal-wasm@0.1.2">jsr</a> / <a href="https://www.npmjs.com/package/decodal-wasm">npm</a></li>
<li>decodal-wasm on <a href="https://jsr.io/@hare/decodal-wasm@0.1.3">jsr</a> / <a href="https://www.npmjs.com/package/decodal-wasm">npm</a></li>
<li>decodal-codemirror on <a href="https://jsr.io/@hare/decodal-codemirror@0.1.4">jsr</a> / <a href="https://www.npmjs.com/package/decodal-codemirror">npm</a></li>
</ul>
</section>