@ahmedrowaihi/pdf-forge-cli 1.0.0-canary.0 → 1.0.0-canary.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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/index.js +5 -2
- package/package.json +3 -3
- package/src/utils/preview/start-dev-server.ts +6 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @ahmedrowaihi/pdf-forge-cli@1.0.0-canary.
|
|
2
|
+
> @ahmedrowaihi/pdf-forge-cli@1.0.0-canary.1 build /__w/react-pdf-forge-monorepo/react-pdf-forge-monorepo/packages/react-pdf
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.15.12[22m powered by rolldown [2mv1.0.0-beta.45[22m
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
10
10
|
[34mℹ[39m Build start
|
|
11
11
|
[34mℹ[39m Granting execute permission to [4mdist/index.js[24m
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m43.
|
|
13
|
-
[34mℹ[39m 1 files, total: 43.
|
|
14
|
-
[32m✔[39m Build complete in [
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m43.43 kB[22m [2m│ gzip: 11.69 kB[22m
|
|
13
|
+
[34mℹ[39m 1 files, total: 43.43 kB
|
|
14
|
+
[32m✔[39m Build complete in [32m36ms[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { spawn } from "node:child_process";
|
|
|
27
27
|
//#region package.json
|
|
28
28
|
var package_default = {
|
|
29
29
|
name: "@ahmedrowaihi/pdf-forge-cli",
|
|
30
|
-
version: "1.0.0-canary.
|
|
30
|
+
version: "1.0.0-canary.1",
|
|
31
31
|
description: "A live preview of your PDF templates right in your browser.",
|
|
32
32
|
bin: { "pdf-dev": "./dist/index.js" },
|
|
33
33
|
type: "module",
|
|
@@ -718,7 +718,10 @@ const startDevServer = async (templatesDirRelativePath, staticBaseDirRelativePat
|
|
|
718
718
|
res.setHeader("Pragma", "no-cache");
|
|
719
719
|
res.setHeader("Expires", "-1");
|
|
720
720
|
try {
|
|
721
|
-
|
|
721
|
+
const pathname = parsedUrl.pathname || "";
|
|
722
|
+
const hasFileExtension = /\.[^/]+$/.test(pathname);
|
|
723
|
+
const isStaticFileRequest = pathname.startsWith("/static") || hasFileExtension;
|
|
724
|
+
if (parsedUrl.path && isStaticFileRequest && !parsedUrl.path.startsWith("/preview/") && !parsedUrl.path.startsWith("/api/") && !parsedUrl.path.includes("_next/")) serveStaticFile(res, parsedUrl, staticBaseDirRelativePath, templatesDirRelativePath, req);
|
|
722
725
|
else if (!isNextReady) nextReadyPromise.then(() => nextHandleRequest?.(req, res, parsedUrl));
|
|
723
726
|
else nextHandleRequest?.(req, res, parsedUrl);
|
|
724
727
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahmedrowaihi/pdf-forge-cli",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.1",
|
|
4
4
|
"description": "A live preview of your PDF templates right in your browser.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"pdf-dev": "./dist/index.js"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"react": "^19",
|
|
48
48
|
"react-dom": "^19",
|
|
49
49
|
"typescript": "5.8.3",
|
|
50
|
-
"@ahmedrowaihi/pdf-forge-components": "1.0.0-canary.
|
|
51
|
-
"@ahmedrowaihi/pdf-forge-core": "1.0.0-canary.
|
|
50
|
+
"@ahmedrowaihi/pdf-forge-components": "1.0.0-canary.1",
|
|
51
|
+
"@ahmedrowaihi/pdf-forge-core": "1.0.0-canary.1"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsdown",
|
|
@@ -60,8 +60,14 @@ export const startDevServer = async (
|
|
|
60
60
|
res.setHeader('Expires', '-1');
|
|
61
61
|
|
|
62
62
|
try {
|
|
63
|
+
const pathname = parsedUrl.pathname || '';
|
|
64
|
+
const hasFileExtension = /\.[^/]+$/.test(pathname);
|
|
65
|
+
const isStaticFileRequest =
|
|
66
|
+
pathname.startsWith('/static') || hasFileExtension;
|
|
67
|
+
|
|
63
68
|
if (
|
|
64
69
|
parsedUrl.path &&
|
|
70
|
+
isStaticFileRequest &&
|
|
65
71
|
!parsedUrl.path.startsWith('/preview/') &&
|
|
66
72
|
!parsedUrl.path.startsWith('/api/') &&
|
|
67
73
|
!parsedUrl.path.includes('_next/')
|