@hexagen-monaco/sync 0.8.0 → 0.9.0

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.
@@ -10,8 +10,8 @@ if it is not here (or is in "Never Suggest"), do not introduce it without asking
10
10
  | Next.js | Web framework | App Router. Do not add Pages Router. |
11
11
  | React | UI | Function components + hooks; no class components. |
12
12
  | TypeScript | Language | `strict: true`. No `any` — narrow or use `unknown`. |
13
- | node:test | Test runner | Built-in; `import { test } from "node:test"`. |
14
- | node:assert | Assertions | `node:assert/strict`; never `expect()`. |
13
+ | Vitest | Test runner | `vitest run`; `import { describe, it } from "vitest"`. |
14
+ | node:assert / `expect()` | Assertions | `node:assert/strict` or Vitest's `expect()` — either is fine. |
15
15
 
16
16
  > Keep this table accurate. When you add a dependency (or a Hexagen template
17
17
  > adds one), add its row here in the same change — a stale stack reference is
@@ -19,8 +19,7 @@ if it is not here (or is in "Never Suggest"), do not introduce it without asking
19
19
 
20
20
  ## Never Suggest
21
21
 
22
- - **Jest / Vitest / Mocha / Chai** — this project uses `node:test` + `node:assert`.
23
- - **The `expect()` API** — use `assert.*`.
22
+ - **Jest / Mocha / Chai** — this project uses Vitest.
24
23
  - **Pages Router** — App Router only.
25
24
  - **`any`** — use a precise type, a generic, or `unknown` with narrowing.
26
25
  - A new HTTP client, date library, or state manager **before checking** whether
@@ -2,17 +2,17 @@
2
2
 
3
3
  ## Runner & Assertions
4
4
 
5
- - **Runner:** the Node.js built-in test runner — `import { test } from "node:test"`.
6
- - **Assertions:** `node:assert/strict` — e.g. `assert.equal()`, `assert.deepEqual()`.
7
- - **Never** introduce Jest, Vitest, Mocha, Chai, or an `expect()` API. If you
8
- see them suggested, stop and use `node:test` / `node:assert`.
5
+ - **Runner:** Vitest — `import { describe, it, expect } from "vitest"` (or `test`).
6
+ - **Assertions:** either Vitest's `expect()` or `node:assert/strict` (e.g.
7
+ `assert.equal()`, `assert.deepEqual()`) — both are fine; stay consistent per file.
8
+ - **Never** introduce Jest, Mocha, or Chai. Vitest is the project's runner.
9
9
 
10
10
  ## Conventions
11
11
 
12
- - **File naming:** `*.test.ts` (not `*.spec.ts`).
12
+ - **File naming:** `*.test.ts` (or `*.test.tsx` for component tests).
13
13
  - **Location:** a `__tests__/` directory adjacent to the module under test.
14
- - **Mocks:** prefer `node:test`'s built-in `mock.fn()` over external mock
15
- libraries. Mock at the boundary (ports/adapters), not deep internals.
14
+ - **Mocks:** prefer Vitest's built-in `vi.fn()` / `vi.spyOn()` / `vi.mock()` over
15
+ external mock libraries. Mock at the boundary (ports/adapters), not deep internals.
16
16
  - **Determinism:** no real network, clock, or filesystem in unit tests — inject
17
17
  a fake at the seam. Integration tests that need real I/O are named and
18
18
  isolated.
@@ -26,5 +26,5 @@
26
26
 
27
27
  ## Before You Commit
28
28
 
29
- Run the full suite (`npm test`). A red suite blocks the commit — diagnose, do
30
- not skip or delete the failing test to make it pass.
29
+ Run the full suite (`yarn test`, i.e. `vitest run`). A red suite blocks the
30
+ commit — diagnose, do not skip or delete the failing test to make it pass.
@@ -1,5 +1,5 @@
1
1
  // @hexagen-server-only
2
- import { describe, it } from "node:test";
2
+ import { describe, it } from "vitest";
3
3
  import assert from "node:assert/strict";
4
4
 
5
5
  import {
@@ -1,5 +1,5 @@
1
1
  // @hexagen-server-only
2
- import { describe, it } from "node:test";
2
+ import { describe, it } from "vitest";
3
3
  import assert from "node:assert/strict";
4
4
 
5
5
  import { exampleTool } from "./example.tool.js";
@@ -1,4 +1,4 @@
1
- import { describe, it, afterEach } from "node:test";
1
+ import { describe, it, afterEach } from "vitest";
2
2
  import assert from "node:assert/strict";
3
3
  import type { IncomingMessage } from "node:http";
4
4
  import { authenticate, assertConfigured } from "./bearer.js";
@@ -1,4 +1,4 @@
1
- import { describe, it, afterEach } from "node:test";
1
+ import { describe, it, afterEach } from "vitest";
2
2
  import assert from "node:assert/strict";
3
3
  import type { IncomingMessage } from "node:http";
4
4
  import { authenticate, assertConfigured } from "./oauth.js";
@@ -1,4 +1,4 @@
1
- import { describe, it } from "node:test";
1
+ import { describe, it } from "vitest";
2
2
  import assert from "node:assert/strict";
3
3
  import { assertSafeTransport } from "./guard.js";
4
4
 
@@ -1,5 +1,5 @@
1
1
  export type AppDriver = "next.js" | "fastify" | "express" | "cli";
2
- export type AppFramework = "next.js" | "fastify" | "express" | "plain-ts" | "nitro";
2
+ export type AppFramework = "next.js" | "fastify" | "express" | "nestjs" | "serverless" | "plain-ts" | "nitro" | "vue" | "react-router" | "remix" | "angular";
3
3
  export interface App {
4
4
  name: string;
5
5
  driver?: AppDriver;
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/types/manifest/apps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;AAElE,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,OAAO,eAAe,EAAE,YAAY,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,eAAe,EAAE,gBAAgB,CAAC;IACpD,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC;CAChE"}
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/types/manifest/apps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;AAElE,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,OAAO,GACP,KAAK,GACL,cAAc,GACd,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,OAAO,eAAe,EAAE,YAAY,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,eAAe,EAAE,gBAAgB,CAAC;IACpD,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC;CAChE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexagen-monaco/sync",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "HexaGen Sync Engine — Generate and sync modular monorepos",
6
6
  "keywords": [