@moldesk/core 0.0.2 → 0.0.3

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/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.0.1";
1
+ export declare const VERSION: string;
package/dist/version.js CHANGED
@@ -1 +1,9 @@
1
- export const VERSION = "0.0.1";
1
+ import fs from "node:fs";
2
+ // Read from this package's own package.json (one level above both src/ and dist/)
3
+ // so the reported version can never drift from the published one. A hard-coded
4
+ // constant was missed by the 0.0.2 bump and made `moldesk --version` print 0.0.1.
5
+ function readVersion() {
6
+ const manifest = new URL("../package.json", import.meta.url);
7
+ return JSON.parse(fs.readFileSync(manifest, "utf8")).version;
8
+ }
9
+ export const VERSION = readVersion();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import fs from "node:fs";
2
+ import { describe, expect, it } from "vitest";
3
+ import { VERSION } from "./version.js";
4
+ describe("VERSION", () => {
5
+ it("equals the version in this package's package.json", () => {
6
+ const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"));
7
+ expect(VERSION).toBe(pkg.version);
8
+ expect(VERSION).toMatch(/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/);
9
+ });
10
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moldesk/core",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Shared engine logic for MoleculeDesk (CLI + desktop)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,9 +19,9 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@moldesk/adapters": "0.0.2",
23
- "@moldesk/runtime": "0.0.2",
24
- "@moldesk/registry": "0.0.2"
22
+ "@moldesk/runtime": "0.0.3",
23
+ "@moldesk/adapters": "0.0.3",
24
+ "@moldesk/registry": "0.0.3"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^5.6.3",