@sigil-dev/mail 0.9.33 → 0.10.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.
Files changed (2) hide show
  1. package/index.ts +6 -2
  2. package/package.json +3 -3
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { existsSync, readdirSync, statSync } from "node:fs";
1
+ import { existsSync, readdirSync } from "node:fs";
2
2
  import { join, relative } from "node:path";
3
3
  import type { Duration, GrimoirePlugin } from "@sigil-dev/grimoire";
4
4
  import { defineJob } from "@sigil-dev/plugin-jobs";
@@ -233,7 +233,11 @@ async function preview(
233
233
  const render = async (name: string) => {
234
234
  const file = join(dir, `${name}.tsx`);
235
235
  if (!templates(dir).includes(name)) return null;
236
- const mod = await import(`${file}?v=${statSync(file).mtimeMs}`);
236
+ // fresh on every view, so an edit shows on reload. Not with a query
237
+ // string (?v=…): Bun runs no onLoad plugin for those, so the template
238
+ // would miss the JSX compiler and render as something else
239
+ delete require.cache[file];
240
+ const mod = await import(file);
237
241
  if (typeof mod.default !== "function")
238
242
  throw new Error(`${name}: no default export`);
239
243
  return readRendered(mod.default(mod.sample ?? {}));
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "module": "index.ts",
12
12
  "type": "module",
13
13
  "private": false,
14
- "version": "0.9.33",
14
+ "version": "0.10.0",
15
15
  "keywords": [
16
16
  "grimoire",
17
17
  "sigil",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "typescript": "^5",
31
- "@sigil-dev/grimoire": "0.9.33",
32
- "@sigil-dev/plugin-jobs": "0.9.33"
31
+ "@sigil-dev/grimoire": "^0.10.0",
32
+ "@sigil-dev/plugin-jobs": "^0.10.0"
33
33
  }
34
34
  }