@repdf/preview 0.3.1 → 0.3.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.js +14 -6
- package/dist/preview/.next/BUILD_ID +1 -1
- package/dist/preview/.next/build-manifest.json +6 -5
- 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/next-minimal-server.js.nft.json +1 -1
- package/dist/preview/.next/next-server.js.nft.json +1 -1
- package/dist/preview/.next/prerender-manifest.json +1 -1
- package/dist/preview/.next/routes-manifest.json +1 -1
- package/dist/preview/.next/server/chunks/239.js +3 -3
- package/dist/preview/.next/server/chunks/276.js +1 -0
- package/dist/preview/.next/server/chunks/444.js +2 -2
- package/dist/preview/.next/server/chunks/478.js +1 -0
- package/dist/preview/.next/server/functions-config-manifest.json +1 -1
- package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
- package/dist/preview/.next/server/pages/_app.js +1 -1
- package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/_document.js +1 -1
- package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/_error.js +1 -1
- package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/api/component.js +2 -63
- package/dist/preview/.next/server/pages/api/component.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/api/pdf.js +2 -2
- package/dist/preview/.next/server/pages/api/trpc/[trpc].js +1 -1
- package/dist/preview/.next/server/pages/api/trpc/[trpc].js.nft.json +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/server/pages/index.js +2 -2
- package/dist/preview/.next/server/pages/index.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js +1 -1
- package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js.nft.json +1 -1
- package/dist/preview/.next/server/pages/test.js.nft.json +1 -1
- package/dist/preview/.next/server/pages-manifest.json +1 -1
- package/dist/preview/.next/static/2qhpHXmKu1a7HPYW0h8qX/_buildManifest.js +1 -0
- package/dist/preview/.next/static/chunks/837-9d4cc2d57e81e85c.js +1 -0
- package/dist/preview/.next/static/chunks/pages/{_app-fb23116bf8c2175a.js → _app-1fae2008e3549d5a.js} +28 -27
- package/dist/preview/.next/static/chunks/pages/preview/[...relTemplatePath]-e0152b67b748423c.js +1 -0
- package/dist/preview/.next/static/css/{c7f6a8bc767cd2f6.css → 35ecb02d4842937d.css} +1 -1
- package/dist/preview/.next/trace +13 -13
- package/package.json +4 -3
- package/dist/preview/.next/server/chunks/865.js +0 -1
- package/dist/preview/.next/server/chunks/900.js +0 -1
- package/dist/preview/.next/static/7nZIXWS8ShPv20tmMeSGr/_buildManifest.js +0 -1
- package/dist/preview/.next/static/chunks/pages/preview/[...relTemplatePath]-d13b73e31965195a.js +0 -1
- /package/dist/preview/.next/static/{7nZIXWS8ShPv20tmMeSGr → 2qhpHXmKu1a7HPYW0h8qX}/_ssgManifest.js +0 -0
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import http$1 from "node:http";
|
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
13
|
var name = "@repdf/preview";
|
|
14
|
-
var version = "0.3.
|
|
14
|
+
var version = "0.3.2";
|
|
15
15
|
var type = "module";
|
|
16
16
|
var main = "dist/index.js";
|
|
17
17
|
var bin = { "repdf": "./dist/index.js" };
|
|
@@ -65,6 +65,7 @@ var dependencies = {
|
|
|
65
65
|
"js-dependency-extractor": "^1.0.3",
|
|
66
66
|
"lucide-react": "^0.453.0",
|
|
67
67
|
"next": "^14.2.17",
|
|
68
|
+
"nuqs": "^2.8.9",
|
|
68
69
|
"ora": "^8.1.0",
|
|
69
70
|
"pino": "^9.4.0",
|
|
70
71
|
"pino-pretty": "^11.2.2",
|
|
@@ -129,15 +130,14 @@ var logger_default = logger;
|
|
|
129
130
|
//#endregion
|
|
130
131
|
//#region src/utils/checkPortAvailability.ts
|
|
131
132
|
function checkPortAvailability(port) {
|
|
132
|
-
return new Promise((resolve) => {
|
|
133
|
+
return new Promise((resolve, reject) => {
|
|
133
134
|
const server = http.createServer();
|
|
134
135
|
server.once("error", (err) => {
|
|
135
136
|
if (err.code === "EADDRINUSE") resolve(false);
|
|
136
|
-
else
|
|
137
|
+
else reject(err);
|
|
137
138
|
});
|
|
138
139
|
server.once("listening", () => {
|
|
139
|
-
server.close();
|
|
140
|
-
resolve(true);
|
|
140
|
+
server.close(() => resolve(true));
|
|
141
141
|
});
|
|
142
142
|
server.listen(port);
|
|
143
143
|
});
|
|
@@ -161,10 +161,18 @@ const getEnvVariablesForPreviewApp = (relativePathToPdfsDirectory, cwd) => {
|
|
|
161
161
|
let previewServer;
|
|
162
162
|
const startPreviewServer = async (pdfsDirRelativePath, port) => {
|
|
163
163
|
let actualPort = port;
|
|
164
|
-
while (
|
|
164
|
+
while (actualPort <= 65535) {
|
|
165
|
+
let isAvailable = false;
|
|
166
|
+
try {
|
|
167
|
+
isAvailable = await checkPortAvailability(actualPort);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
throw new Error(`Failed to check port ${actualPort}: ${error.message}`);
|
|
170
|
+
}
|
|
171
|
+
if (isAvailable) break;
|
|
165
172
|
logger_default.info(`port ${actualPort} in use, trying ${actualPort + 1}`);
|
|
166
173
|
actualPort++;
|
|
167
174
|
}
|
|
175
|
+
if (actualPort > 65535) throw new Error(`No available ports found starting from ${port} (checked through 65535)`);
|
|
168
176
|
process.env = {
|
|
169
177
|
...process.env,
|
|
170
178
|
NODE_ENV: "development",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2qhpHXmKu1a7HPYW0h8qX
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"ampDevFiles": [],
|
|
7
7
|
"lowPriorityFiles": [
|
|
8
|
-
"static/
|
|
9
|
-
"static/
|
|
8
|
+
"static/2qhpHXmKu1a7HPYW0h8qX/_buildManifest.js",
|
|
9
|
+
"static/2qhpHXmKu1a7HPYW0h8qX/_ssgManifest.js"
|
|
10
10
|
],
|
|
11
11
|
"rootMainFiles": [],
|
|
12
12
|
"pages": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"static/chunks/webpack-0b5d8249fb15f5f3.js",
|
|
22
22
|
"static/chunks/framework-e0f347a11a70369e.js",
|
|
23
23
|
"static/chunks/main-32f0addb06a02100.js",
|
|
24
|
-
"static/css/
|
|
25
|
-
"static/chunks/pages/_app-
|
|
24
|
+
"static/css/35ecb02d4842937d.css",
|
|
25
|
+
"static/chunks/pages/_app-1fae2008e3549d5a.js"
|
|
26
26
|
],
|
|
27
27
|
"/_error": [
|
|
28
28
|
"static/chunks/webpack-0b5d8249fb15f5f3.js",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"static/chunks/framework-e0f347a11a70369e.js",
|
|
36
36
|
"static/chunks/main-32f0addb06a02100.js",
|
|
37
37
|
"static/chunks/64-33135d2a0b032c99.js",
|
|
38
|
-
"static/chunks/
|
|
38
|
+
"static/chunks/837-9d4cc2d57e81e85c.js",
|
|
39
|
+
"static/chunks/pages/preview/[...relTemplatePath]-e0152b67b748423c.js"
|
|
39
40
|
],
|
|
40
41
|
"/test": [
|
|
41
42
|
"static/chunks/webpack-0b5d8249fb15f5f3.js",
|