@c9up/atom 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +2 -3
- package/scripts/verify-wasm.mjs +27 -0
- package/wasm/atom_engine_wasm.d.ts +0 -19
package/index.darwin-arm64.node
CHANGED
|
Binary file
|
package/index.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c9up/atom",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Atom — exact decimal arithmetic for the Ream ecosystem (TypeScript + Rust N-API)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
"README.md",
|
|
22
22
|
"dist",
|
|
23
23
|
"index.*.node",
|
|
24
|
-
"index.d.ts",
|
|
25
|
-
"index.js",
|
|
26
24
|
"scripts",
|
|
27
25
|
"src",
|
|
28
26
|
"wasm"
|
|
29
27
|
],
|
|
30
28
|
"devDependencies": {
|
|
29
|
+
"@biomejs/biome": "^2.4.10",
|
|
31
30
|
"@types/node": "^22.19.15",
|
|
32
31
|
"typescript": "^6.0.2",
|
|
33
32
|
"vitest": "^4.1.2"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { existsSync, statSync } from 'node:fs'
|
|
2
|
+
import { dirname, join } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
|
|
5
|
+
// Publish-time gate: the `wasm-pack build --target web` output (JS glue + the
|
|
6
|
+
// binary) MUST be in the package. Without it the browser loader
|
|
7
|
+
// (src/native.ts) throws ATOM_ENGINE_NOT_FOUND at runtime — exactly the
|
|
8
|
+
// "stub-only tarball" failure this gate exists to prevent. Only the hand-written
|
|
9
|
+
// `atom_engine_wasm.d.ts` typecheck stub is committed; the .js/.wasm are built.
|
|
10
|
+
|
|
11
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
12
|
+
const wasmDir = join(here, '..', 'wasm')
|
|
13
|
+
|
|
14
|
+
const required = ['atom_engine_wasm.js', 'atom_engine_wasm_bg.wasm']
|
|
15
|
+
for (const name of required) {
|
|
16
|
+
const p = join(wasmDir, name)
|
|
17
|
+
if (!existsSync(p)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`[atom:wasm] missing build artifact: wasm/${name} — run \`pnpm build:wasm\` (wasm-pack) before publishing`,
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
if (statSync(p).size === 0) {
|
|
23
|
+
throw new Error(`[atom:wasm] empty build artifact: wasm/${name}`)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log('[atom:wasm] browser artifacts present')
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Hand-written stub for the wasm-pack-generated glue file. Lets `tsc --noEmit`
|
|
2
|
-
// pass on a fresh checkout before `pnpm build:wasm` has been run. wasm-pack
|
|
3
|
-
// will overwrite this file with its real generated declarations on the next
|
|
4
|
-
// `build:wasm`; the runtime shape stays compatible.
|
|
5
|
-
//
|
|
6
|
-
// Story 52.1 review patch (2026-05-09): typecheck was broken on a fresh
|
|
7
|
-
// checkout because src/native.ts:60 imports this glue file, and `tsc` could
|
|
8
|
-
// not find it without first running `build:wasm`.
|
|
9
|
-
|
|
10
|
-
export default function init(): Promise<unknown>;
|
|
11
|
-
|
|
12
|
-
export function add(a: string, b: string): string;
|
|
13
|
-
export function sub(a: string, b: string): string;
|
|
14
|
-
export function mul(a: string, b: string): string;
|
|
15
|
-
export function div(a: string, b: string, precision: number): string;
|
|
16
|
-
export function rem(a: string, b: string): string;
|
|
17
|
-
export function pow(a: string, exp: number, precision: number): string;
|
|
18
|
-
export function sqrt(a: string, precision: number): string;
|
|
19
|
-
export function cmp(a: string, b: string): number;
|