@repdf/preview 0.0.13 → 0.0.15

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 (63) hide show
  1. package/dist/index.cjs +13 -7
  2. package/dist/index.js +13 -7
  3. package/dist/preview/.next/BUILD_ID +1 -1
  4. package/dist/preview/.next/build-manifest.json +18 -18
  5. package/dist/preview/.next/cache/.tsbuildinfo +1 -1
  6. package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
  9. package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
  12. package/dist/preview/.next/next-server.js.nft.json +1 -1
  13. package/dist/preview/.next/prerender-manifest.json +1 -1
  14. package/dist/preview/.next/react-loadable-manifest.json +2 -2
  15. package/dist/preview/.next/required-server-files.json +1 -1
  16. package/dist/preview/.next/routes-manifest.json +1 -1
  17. package/dist/preview/.next/server/chunks/288.js +4 -0
  18. package/dist/preview/.next/server/chunks/515.js +1 -0
  19. package/dist/preview/.next/server/chunks/{574.js → 76.js} +3 -3
  20. package/dist/preview/.next/server/chunks/{240.js → 992.js} +1 -1
  21. package/dist/preview/.next/server/functions-config-manifest.json +1 -1
  22. package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
  23. package/dist/preview/.next/server/middleware-react-loadable-manifest.js +1 -1
  24. package/dist/preview/.next/server/pages/_app.js +1 -1
  25. package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
  26. package/dist/preview/.next/server/pages/_document.js +1 -1
  27. package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
  28. package/dist/preview/.next/server/pages/_error.js +1 -1
  29. package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
  30. package/dist/preview/.next/server/pages/api/component.js +2 -2
  31. package/dist/preview/.next/server/pages/api/component.js.nft.json +1 -1
  32. package/dist/preview/.next/server/pages/api/pdf.js +1 -1
  33. package/dist/preview/.next/server/pages/api/pdf.js.nft.json +1 -1
  34. package/dist/preview/.next/server/pages/api/trpc/[trpc].js +1 -1
  35. package/dist/preview/.next/server/pages/api/trpc/[trpc].js.nft.json +1 -1
  36. package/dist/preview/.next/server/pages/en/404.html +1 -1
  37. package/dist/preview/.next/server/pages/en/500.html +1 -1
  38. package/dist/preview/.next/server/pages/en/hello.html +1 -1
  39. package/dist/preview/.next/server/pages/hello.js.nft.json +1 -1
  40. package/dist/preview/.next/server/pages/index.js +1 -1
  41. package/dist/preview/.next/server/pages/index.js.nft.json +1 -1
  42. package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js +1 -1
  43. package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js.nft.json +1 -1
  44. package/dist/preview/.next/server/pages-manifest.json +1 -1
  45. package/dist/preview/.next/static/1CrsRuCE0pQeCQKjv8YSV/_buildManifest.js +1 -0
  46. package/dist/preview/.next/static/chunks/11-c3207764c75fac42.js +1 -0
  47. package/dist/preview/.next/static/chunks/{framework-0cbe3b56a5f66701.js → framework-e0f347a11a70369e.js} +1 -1
  48. package/dist/preview/.next/static/chunks/main-58cc12cfc6868a7a.js +1 -0
  49. package/dist/preview/.next/static/chunks/pages/{_app-7347594c8802fbe6.js → _app-caf4749cda1fd607.js} +3 -3
  50. package/dist/preview/.next/static/chunks/pages/_error-4ad10ca9d415501b.js +1 -0
  51. package/dist/preview/.next/static/chunks/pages/{hello-f5c94797cf5d2e3e.js → hello-78aa44a690f8e32d.js} +1 -1
  52. package/dist/preview/.next/static/chunks/pages/{index-599233e1212fd4c8.js → index-87aa243f34ebeb5e.js} +1 -1
  53. package/dist/preview/.next/static/chunks/pages/preview/{[...relTemplatePath]-b754b626fb853e1b.js → [...relTemplatePath]-c13e695dc8db2407.js} +1 -1
  54. package/dist/preview/.next/trace +14 -14
  55. package/package.json +6 -4
  56. package/README.md +0 -3
  57. package/dist/preview/.next/server/chunks/316.js +0 -1
  58. package/dist/preview/.next/server/chunks/842.js +0 -4
  59. package/dist/preview/.next/static/chunks/587-e1c001181b4cec11.js +0 -1
  60. package/dist/preview/.next/static/chunks/main-b2d89a266d271543.js +0 -1
  61. package/dist/preview/.next/static/chunks/pages/_error-f68c2d645fc907f4.js +0 -1
  62. package/dist/preview/.next/static/ek5PUJ-kuCFNuyqnUz9I2/_buildManifest.js +0 -1
  63. /package/dist/preview/.next/static/{ek5PUJ-kuCFNuyqnUz9I2 → 1CrsRuCE0pQeCQKjv8YSV}/_ssgManifest.js +0 -0
package/dist/index.cjs CHANGED
@@ -29,7 +29,7 @@ var import_commander = require("commander");
29
29
  // package.json
30
30
  var package_default = {
31
31
  name: "@repdf/preview",
32
- version: "0.0.13",
32
+ version: "0.0.15",
33
33
  type: "module",
34
34
  main: "dist/index.js",
35
35
  bin: {
@@ -58,9 +58,11 @@ var package_default = {
58
58
  start: "next start",
59
59
  "check-exports": "attw --pack .",
60
60
  format: "biome check --write .",
61
- "local-release": "bun publish --access public"
61
+ "local-release": "bun publish --access public",
62
+ clean: "rm -rf dist"
62
63
  },
63
64
  dependencies: {
65
+ "@repdf/core": "workspace:*",
64
66
  "@react-email/render": "1.0.1",
65
67
  "@react-email/tailwind": "0.1.0",
66
68
  "@tanstack/react-query": "^5.59.15",
@@ -106,7 +108,7 @@ var package_default = {
106
108
  "@types/js-beautify": "^1.14.3",
107
109
  "@types/node": "^20.14.10",
108
110
  "@types/react": "^18.3.11",
109
- "@types/react-dom": "^18.3.0",
111
+ "@types/react-dom": "^18.3.1",
110
112
  "@types/ws": "^8.5.12",
111
113
  postcss: "^8.4.39",
112
114
  "prettier-plugin-tailwindcss": "^0.6.8",
@@ -133,9 +135,9 @@ var logger_default = logger;
133
135
  // src/cli/commands/server.ts
134
136
  var import_node_url = require("url");
135
137
  var import_path = __toESM(require("path"), 1);
138
+ var import_url = require("url");
136
139
  var import_express = __toESM(require("express"), 1);
137
140
  var import_next = __toESM(require("next"), 1);
138
- var import_url = require("url");
139
141
  var import_ws = __toESM(require("ws"), 1);
140
142
  var import_ws2 = require("ws");
141
143
 
@@ -278,8 +280,6 @@ var isDev = !__filename.endsWith("index.js");
278
280
  console.log("cli script is in dev mode", isDev);
279
281
  var cliPackageLocation = isDev ? import_path.default.resolve(__dirname, "../..") : import_path.default.resolve(__dirname, "../..");
280
282
  var previewServerLocation = isDev ? import_path.default.resolve(__dirname, "../../..") : import_path.default.resolve(__dirname, "./preview");
281
- console.log("isDev", isDev);
282
- console.log("previewServerLocation", previewServerLocation);
283
283
  var getEnvVariablesForPreviewApp = (relativePathToPdfsDirectory, cwd) => {
284
284
  return {
285
285
  RELATIVE_PATH_TO_PDF_FOLDER: relativePathToPdfsDirectory,
@@ -297,7 +297,8 @@ var startPreviewServer = async (pdfsDirRelativePath, port) => {
297
297
  const wss = new import_ws2.WebSocketServer({ noServer: true });
298
298
  process.env = {
299
299
  ...process.env,
300
- NODE_ENV: "development",
300
+ NODE_ENV: isDev ? "development" : "production",
301
+ // TODO: why is this set to devlopment and is that right?
301
302
  PORT: port.toString(),
302
303
  ...getEnvVariablesForPreviewApp(
303
304
  // If we don't do normalization here, stuff like https://github.com/resend/react-email/issues/1354 happens.
@@ -317,12 +318,17 @@ var startPreviewServer = async (pdfsDirRelativePath, port) => {
317
318
  port,
318
319
  dir: previewServerLocation
319
320
  });
321
+ logger_default.info("preparing next app");
320
322
  nextApp.prepare().then(() => {
323
+ const url = `http://localhost:${port}`;
324
+ const clickableUrl = `\x1B]8;;${url}\x07${url}\x1B]8;;\x07`;
325
+ console.log(clickableUrl);
321
326
  previewServer.use((req, res, next2) => {
322
327
  nextApp.getRequestHandler()(req, res, (0, import_node_url.parse)(req.url, true));
323
328
  });
324
329
  watcher = pdfTemplateWatcher();
325
330
  watcher.on("all", () => {
331
+ logger_default.info("watcher: file changed");
326
332
  for (const client of Array.from(clients)) {
327
333
  client.send(`file changed ${(/* @__PURE__ */ new Date()).toISOString()}`);
328
334
  }
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { program } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@repdf/preview",
9
- version: "0.0.13",
9
+ version: "0.0.15",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -35,9 +35,11 @@ var package_default = {
35
35
  start: "next start",
36
36
  "check-exports": "attw --pack .",
37
37
  format: "biome check --write .",
38
- "local-release": "bun publish --access public"
38
+ "local-release": "bun publish --access public",
39
+ clean: "rm -rf dist"
39
40
  },
40
41
  dependencies: {
42
+ "@repdf/core": "workspace:*",
41
43
  "@react-email/render": "1.0.1",
42
44
  "@react-email/tailwind": "0.1.0",
43
45
  "@tanstack/react-query": "^5.59.15",
@@ -83,7 +85,7 @@ var package_default = {
83
85
  "@types/js-beautify": "^1.14.3",
84
86
  "@types/node": "^20.14.10",
85
87
  "@types/react": "^18.3.11",
86
- "@types/react-dom": "^18.3.0",
88
+ "@types/react-dom": "^18.3.1",
87
89
  "@types/ws": "^8.5.12",
88
90
  postcss: "^8.4.39",
89
91
  "prettier-plugin-tailwindcss": "^0.6.8",
@@ -110,9 +112,9 @@ var logger_default = logger;
110
112
  // src/cli/commands/server.ts
111
113
  import { parse } from "node:url";
112
114
  import path2 from "path";
115
+ import { fileURLToPath } from "url";
113
116
  import express from "express";
114
117
  import next from "next";
115
- import { fileURLToPath } from "url";
116
118
  import WebSocket from "ws";
117
119
  import { WebSocketServer } from "ws";
118
120
 
@@ -254,8 +256,6 @@ var isDev = !__filename.endsWith("index.js");
254
256
  console.log("cli script is in dev mode", isDev);
255
257
  var cliPackageLocation = isDev ? path2.resolve(__dirname, "../..") : path2.resolve(__dirname, "../..");
256
258
  var previewServerLocation = isDev ? path2.resolve(__dirname, "../../..") : path2.resolve(__dirname, "./preview");
257
- console.log("isDev", isDev);
258
- console.log("previewServerLocation", previewServerLocation);
259
259
  var getEnvVariablesForPreviewApp = (relativePathToPdfsDirectory, cwd) => {
260
260
  return {
261
261
  RELATIVE_PATH_TO_PDF_FOLDER: relativePathToPdfsDirectory,
@@ -273,7 +273,8 @@ var startPreviewServer = async (pdfsDirRelativePath, port) => {
273
273
  const wss = new WebSocketServer({ noServer: true });
274
274
  process.env = {
275
275
  ...process.env,
276
- NODE_ENV: "development",
276
+ NODE_ENV: isDev ? "development" : "production",
277
+ // TODO: why is this set to devlopment and is that right?
277
278
  PORT: port.toString(),
278
279
  ...getEnvVariablesForPreviewApp(
279
280
  // If we don't do normalization here, stuff like https://github.com/resend/react-email/issues/1354 happens.
@@ -293,12 +294,17 @@ var startPreviewServer = async (pdfsDirRelativePath, port) => {
293
294
  port,
294
295
  dir: previewServerLocation
295
296
  });
297
+ logger_default.info("preparing next app");
296
298
  nextApp.prepare().then(() => {
299
+ const url = `http://localhost:${port}`;
300
+ const clickableUrl = `\x1B]8;;${url}\x07${url}\x1B]8;;\x07`;
301
+ console.log(clickableUrl);
297
302
  previewServer.use((req, res, next2) => {
298
303
  nextApp.getRequestHandler()(req, res, parse(req.url, true));
299
304
  });
300
305
  watcher = pdfTemplateWatcher();
301
306
  watcher.on("all", () => {
307
+ logger_default.info("watcher: file changed");
302
308
  for (const client of Array.from(clients)) {
303
309
  client.send(`file changed ${(/* @__PURE__ */ new Date()).toISOString()}`);
304
310
  }
@@ -1 +1 @@
1
- ek5PUJ-kuCFNuyqnUz9I2
1
+ 1CrsRuCE0pQeCQKjv8YSV
@@ -5,42 +5,42 @@
5
5
  "devFiles": [],
6
6
  "ampDevFiles": [],
7
7
  "lowPriorityFiles": [
8
- "static/ek5PUJ-kuCFNuyqnUz9I2/_buildManifest.js",
9
- "static/ek5PUJ-kuCFNuyqnUz9I2/_ssgManifest.js"
8
+ "static/1CrsRuCE0pQeCQKjv8YSV/_buildManifest.js",
9
+ "static/1CrsRuCE0pQeCQKjv8YSV/_ssgManifest.js"
10
10
  ],
11
11
  "rootMainFiles": [],
12
12
  "pages": {
13
13
  "/": [
14
14
  "static/chunks/webpack-b8f8d6679aaa5f42.js",
15
- "static/chunks/framework-0cbe3b56a5f66701.js",
16
- "static/chunks/main-b2d89a266d271543.js",
17
- "static/chunks/pages/index-599233e1212fd4c8.js"
15
+ "static/chunks/framework-e0f347a11a70369e.js",
16
+ "static/chunks/main-58cc12cfc6868a7a.js",
17
+ "static/chunks/pages/index-87aa243f34ebeb5e.js"
18
18
  ],
19
19
  "/_app": [
20
20
  "static/chunks/webpack-b8f8d6679aaa5f42.js",
21
- "static/chunks/framework-0cbe3b56a5f66701.js",
22
- "static/chunks/main-b2d89a266d271543.js",
21
+ "static/chunks/framework-e0f347a11a70369e.js",
22
+ "static/chunks/main-58cc12cfc6868a7a.js",
23
23
  "static/css/4775703643ebce7c.css",
24
- "static/chunks/pages/_app-7347594c8802fbe6.js"
24
+ "static/chunks/pages/_app-caf4749cda1fd607.js"
25
25
  ],
26
26
  "/_error": [
27
27
  "static/chunks/webpack-b8f8d6679aaa5f42.js",
28
- "static/chunks/framework-0cbe3b56a5f66701.js",
29
- "static/chunks/main-b2d89a266d271543.js",
30
- "static/chunks/pages/_error-f68c2d645fc907f4.js"
28
+ "static/chunks/framework-e0f347a11a70369e.js",
29
+ "static/chunks/main-58cc12cfc6868a7a.js",
30
+ "static/chunks/pages/_error-4ad10ca9d415501b.js"
31
31
  ],
32
32
  "/hello": [
33
33
  "static/chunks/webpack-b8f8d6679aaa5f42.js",
34
- "static/chunks/framework-0cbe3b56a5f66701.js",
35
- "static/chunks/main-b2d89a266d271543.js",
36
- "static/chunks/pages/hello-f5c94797cf5d2e3e.js"
34
+ "static/chunks/framework-e0f347a11a70369e.js",
35
+ "static/chunks/main-58cc12cfc6868a7a.js",
36
+ "static/chunks/pages/hello-78aa44a690f8e32d.js"
37
37
  ],
38
38
  "/preview/[...relTemplatePath]": [
39
39
  "static/chunks/webpack-b8f8d6679aaa5f42.js",
40
- "static/chunks/framework-0cbe3b56a5f66701.js",
41
- "static/chunks/main-b2d89a266d271543.js",
42
- "static/chunks/587-e1c001181b4cec11.js",
43
- "static/chunks/pages/preview/[...relTemplatePath]-b754b626fb853e1b.js"
40
+ "static/chunks/framework-e0f347a11a70369e.js",
41
+ "static/chunks/main-58cc12cfc6868a7a.js",
42
+ "static/chunks/11-c3207764c75fac42.js",
43
+ "static/chunks/pages/preview/[...relTemplatePath]-c13e695dc8db2407.js"
44
44
  ]
45
45
  },
46
46
  "ampFirstPages": []