@repdf/preview 0.5.0 → 0.5.2
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 +21 -1
- package/dist/preview/.next/BUILD_ID +1 -1
- package/dist/preview/.next/build-manifest.json +2 -2
- package/dist/preview/.next/cache/.previewinfo +1 -1
- package/dist/preview/.next/cache/.rscinfo +1 -1
- package/dist/preview/.next/cache/.tsbuildinfo +1 -1
- package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/preview/.next/prerender-manifest.json +3 -3
- package/dist/preview/.next/routes-manifest.json +3 -3
- package/dist/preview/.next/server/chunks/539.js +1 -1
- package/dist/preview/.next/server/pages/en/404.html +1 -1
- package/dist/preview/.next/server/pages/en/500.html +1 -1
- package/dist/preview/.next/server/pages/en/test.html +1 -1
- package/dist/preview/.next/trace +9 -9
- package/dist/preview/.next/trace-build +1 -1
- package/package.json +3 -3
- /package/dist/preview/.next/static/{uQjdkl4yTW6Zpf-3uNg2P → FZ6aXlqGO-aLj-TH9yD3I}/_buildManifest.js +0 -0
- /package/dist/preview/.next/static/{uQjdkl4yTW6Zpf-3uNg2P → FZ6aXlqGO-aLj-TH9yD3I}/_ssgManifest.js +0 -0
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.
|
|
19
|
+
var version = "0.5.1";
|
|
17
20
|
//#endregion
|
|
18
21
|
//#region src/logger.ts
|
|
19
22
|
const logger = pino({
|
|
@@ -152,6 +155,22 @@ function pdfTemplateWatcher() {
|
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
//#endregion
|
|
158
|
+
//#region src/template-loader/get-pdf-component.ts
|
|
159
|
+
const COMPONENT_CACHE_STORE_KEY = "__repdf_preview_getPdfComponentCacheStore__";
|
|
160
|
+
const getComponentCacheStore = () => {
|
|
161
|
+
const globalWithStore = globalThis;
|
|
162
|
+
if (!globalWithStore[COMPONENT_CACHE_STORE_KEY]) globalWithStore[COMPONENT_CACHE_STORE_KEY] = {
|
|
163
|
+
componentCache: /* @__PURE__ */ new Map(),
|
|
164
|
+
inflightBuilds: /* @__PURE__ */ new Map()
|
|
165
|
+
};
|
|
166
|
+
return globalWithStore[COMPONENT_CACHE_STORE_KEY];
|
|
167
|
+
};
|
|
168
|
+
const { componentCache, inflightBuilds } = getComponentCacheStore();
|
|
169
|
+
const clearPdfComponentCache = () => {
|
|
170
|
+
componentCache.clear();
|
|
171
|
+
inflightBuilds.clear();
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
155
174
|
//#region src/cli/commands/server.ts
|
|
156
175
|
const __filename = fileURLToPath(import.meta.url);
|
|
157
176
|
const __dirname = path.dirname(__filename);
|
|
@@ -260,6 +279,7 @@ const startPreviewServer = async (pdfsDirRelativePath, port) => {
|
|
|
260
279
|
};
|
|
261
280
|
templateWatcher = pdfTemplateWatcher();
|
|
262
281
|
templateWatcher.on("all", (event, filePath) => {
|
|
282
|
+
clearPdfComponentCache();
|
|
263
283
|
const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(absolutePathToPdfsDir, filePath);
|
|
264
284
|
const relPath = path.relative(absolutePathToPdfsDir, absolutePath);
|
|
265
285
|
pendingChanges.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
FZ6aXlqGO-aLj-TH9yD3I
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
],
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"lowPriorityFiles": [
|
|
7
|
-
"static/
|
|
8
|
-
"static/
|
|
7
|
+
"static/FZ6aXlqGO-aLj-TH9yD3I/_buildManifest.js",
|
|
8
|
+
"static/FZ6aXlqGO-aLj-TH9yD3I/_ssgManifest.js"
|
|
9
9
|
],
|
|
10
10
|
"rootMainFiles": [],
|
|
11
11
|
"rootMainFilesTree": {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"previewModeId":"
|
|
1
|
+
{"previewModeId":"d40fbb4329b168784ada0b1c1125cf04","previewModeSigningKey":"1e1cd48697872824c45c6464b49bc34748c039459df1cef5c4c1d00c8a6dc4a2","previewModeEncryptionKey":"9483644439aa7b04a3f4bf6cd6ba0f4c32bee40d1ae63923eca381e3d11d31dc","expireAt":1774391804415}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"encryption.key":"
|
|
1
|
+
{"encryption.key":"aqaHf46LGw8Qjd/GOveOjiYrkQfNjF4RY1HJKPB6r2Y=","encryption.expire_at":1774391804411}
|