From c7a28bb7352b07059a32e0ed7e2580941d18d38c Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 31 May 2026 08:20:47 +0100 Subject: [PATCH] =?UTF-8?q?feat(deno):=20migrate=20root=20package.json=20?= =?UTF-8?q?=E2=86=92=20deno.json=20imports=20(Class=20B,=20standards#253?= =?UTF-8?q?=20longtail)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit excel-economic-numbers-tool is a ReScript-driven Office add-in (Excel + LibreOffice). The package.json had `@microsoft/office-js` as the lone runtime dep + `@rescript/core` + `rescript` as devDeps. Class B migration: - Add `npm:rescript@^12.0.0` + `npm:@rescript/core@^1.6.0` + `npm:@microsoft/office-js@^1.1.0` to `deno.json` `imports`. - Replace the broken bare `rescript build` in the `build` task with the canonical `deno run -A --node-modules-dir=auto npm:rescript@^12.0.0` pattern (the bare form would fail in Deno-only environments — Deno doesn't have npx). - Add `nodeModulesDir: "auto"` for rescript's install lifecycle. - Delete `package.json` (now redundant — `deno.json` covers all runtime + dev deps + scripts). Office host integration unaffected: `@microsoft/office-js` is loaded by the Office host from the served manifest, not from the local `node_modules/`. Deno's `--node-modules-dir=auto` regenerates the local `node_modules/` at build time for rescript's lifecycle hooks. Per per-repo follow-up tracker for standards#253 (campaign closed 2026-05-31, longtail tracked in project_estate_npm_to_deno_2026_05_28.md). Refs hyperpolymath/standards#253. Co-Authored-By: Claude Opus 4.7 (1M context) --- deno.json | 12 +++++++++--- package.json | 50 -------------------------------------------------- 2 files changed, 9 insertions(+), 53 deletions(-) delete mode 100644 package.json diff --git a/deno.json b/deno.json index 74b3459..892cb80 100644 --- a/deno.json +++ b/deno.json @@ -5,7 +5,9 @@ "tasks": { "dev": "deno run --watch --allow-net --allow-read --allow-env src/server.ts", "start": "deno run --allow-net --allow-read --allow-env src/server.ts", - "build": "rescript build && deno bundle src/mod.ts dist/economic-toolkit.js", + "rescript:build": "deno run -A --node-modules-dir=auto npm:rescript@^12.0.0 build", + "rescript:clean": "deno run -A --node-modules-dir=auto npm:rescript@^12.0.0 clean", + "build": "deno task rescript:build && deno bundle src/mod.ts dist/economic-toolkit.js", "build:excel": "just build-excel", "build:libre": "just build-libre", "test": "deno test --allow-net --allow-read --allow-env", @@ -54,6 +56,10 @@ "@std/path": "jsr:@std/path@^1.0.0", "@std/fs": "jsr:@std/fs@^1.0.0", "@std/http": "jsr:@std/http@^1.0.0", - "@std/testing": "jsr:@std/testing@^1.0.0" - } + "@std/testing": "jsr:@std/testing@^1.0.0", + "rescript": "npm:rescript@^12.0.0", + "@rescript/core": "npm:@rescript/core@^1.6.0", + "@microsoft/office-js": "npm:@microsoft/office-js@^1.1.0" + }, + "nodeModulesDir": "auto" } diff --git a/package.json b/package.json deleted file mode 100644 index 88ad537..0000000 --- a/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "economic-toolkit", - "version": "2.0.0", - "description": "Cross-platform Excel/LibreOffice add-in for economic modelling and investigative research", - "main": "dist/index.js", - "type": "module", - "scripts": { - "dev": "deno task dev", - "build": "rescript build && deno task build", - "build:rescript": "rescript build", - "build:excel": "deno task build:excel", - "build:libre": "deno task build:libre", - "test": "deno test", - "test:watch": "deno test --watch", - "test:coverage": "deno test --coverage", - "lint": "deno lint", - "lint:fix": "deno lint --fix", - "format": "deno fmt", - "watch": "deno task watch", - "clean": "rm -rf dist build lib", - "prepack": "deno task build" - }, - "keywords": [ - "excel", - "libreoffice", - "economics", - "data", - "addin", - "office.js", - "uno", - "rescript", - "julia" - ], - "author": "Hyperpolymath Contributors", - "license": "MPL-2.0", - "repository": { - "type": "git", - "url": "https://github.com/hyperpolymath/excel-economic-numbers-tool.git" - }, - "devDependencies": { - "@rescript/core": "^1.0.0", - "rescript": "^12.0.0" - }, - "dependencies": { - "@microsoft/office-js": "^1.1.0" - }, - "engines": { - "deno": ">=2.0.0" - } -}