@repdf/preview 0.5.0 → 0.5.1

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/index.mjs CHANGED
@@ -12,8 +12,11 @@ import * as chokidar from "chokidar";
12
12
  import path$1 from "node:path";
13
13
  import dependencyTree from "dependency-tree";
14
14
  import { glob } from "glob";
15
+ import "esbuild";
16
+ import "source-map-js";
17
+ import "stacktrace-parser";
15
18
  //#region package.json
16
- var version = "0.4.0";
19
+ var version = "0.5.0";
17
20
  //#endregion
18
21
  //#region src/logger.ts
19
22
  const logger = pino({
@@ -152,6 +155,14 @@ function pdfTemplateWatcher() {
152
155
  }
153
156
  }
154
157
  //#endregion
158
+ //#region src/template-loader/get-pdf-component.ts
159
+ const componentCache = /* @__PURE__ */ new Map();
160
+ const inflightBuilds = /* @__PURE__ */ new Map();
161
+ const clearPdfComponentCache = () => {
162
+ componentCache.clear();
163
+ inflightBuilds.clear();
164
+ };
165
+ //#endregion
155
166
  //#region src/cli/commands/server.ts
156
167
  const __filename = fileURLToPath(import.meta.url);
157
168
  const __dirname = path.dirname(__filename);
@@ -260,6 +271,7 @@ const startPreviewServer = async (pdfsDirRelativePath, port) => {
260
271
  };
261
272
  templateWatcher = pdfTemplateWatcher();
262
273
  templateWatcher.on("all", (event, filePath) => {
274
+ clearPdfComponentCache();
263
275
  const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(absolutePathToPdfsDir, filePath);
264
276
  const relPath = path.relative(absolutePathToPdfsDir, absolutePath);
265
277
  pendingChanges.push({
@@ -1 +1 @@
1
- uQjdkl4yTW6Zpf-3uNg2P
1
+ FpcN7f3WcKAegtkQ_R6bq
@@ -4,8 +4,8 @@
4
4
  ],
5
5
  "devFiles": [],
6
6
  "lowPriorityFiles": [
7
- "static/uQjdkl4yTW6Zpf-3uNg2P/_buildManifest.js",
8
- "static/uQjdkl4yTW6Zpf-3uNg2P/_ssgManifest.js"
7
+ "static/FpcN7f3WcKAegtkQ_R6bq/_buildManifest.js",
8
+ "static/FpcN7f3WcKAegtkQ_R6bq/_ssgManifest.js"
9
9
  ],
10
10
  "rootMainFiles": [],
11
11
  "rootMainFilesTree": {},
@@ -1 +1 @@
1
- {"previewModeId":"5f739dd66df2bf0113e6397704146612","previewModeSigningKey":"3e30d460d9841ae936dac02de5699520f6320e828e4abd538d486f9690129811","previewModeEncryptionKey":"72ee6230aaed11e742c6358be39da1f9ca4c55d1ddf746837e23a6e493d02856","expireAt":1774379152992}
1
+ {"previewModeId":"977d7ef8220f24dcb3b8c1b2374e6e1f","previewModeSigningKey":"78cfa27a4ecebdca175bb5fc0c123ff9db79dc21c0c6d044068ab0c5a785745b","previewModeEncryptionKey":"337640af08b52984be6ceaed0cae53006ba2736a7ec287962573d7606c01fe49","expireAt":1774391020545}
@@ -1 +1 @@
1
- {"encryption.key":"y8rBNN9f5CqnZkTMrMg2bW1z7Z+WN1OTeLAibgr6Wpg=","encryption.expire_at":1774379152987}
1
+ {"encryption.key":"TpaNGh0ywVdf3u1xqIyUAcvDNy43b3eLYghnqB3C8YA=","encryption.expire_at":1774391020541}