@holo-js/adapter-next 0.1.8 → 0.1.9

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/config.d.ts CHANGED
@@ -8,6 +8,7 @@ interface TurbopackConfig {
8
8
  }
9
9
  interface NextConfig {
10
10
  readonly serverExternalPackages?: string[];
11
+ readonly transpilePackages?: string[];
11
12
  readonly outputFileTracingExcludes?: Record<string, string[]>;
12
13
  readonly experimental?: Record<string, unknown>;
13
14
  readonly turbopack?: TurbopackConfig;
package/dist/config.mjs CHANGED
@@ -9,7 +9,6 @@ var HOLO_SERVER_EXTERNAL_PACKAGES = [
9
9
  "esbuild"
10
10
  ];
11
11
  var HOLO_OPTIONAL_SERVER_EXTERNAL_PACKAGES = [
12
- "@holo-js/auth",
13
12
  "@holo-js/auth-clerk",
14
13
  "@holo-js/auth-social",
15
14
  "@holo-js/auth-social-apple",
@@ -37,6 +36,10 @@ var HOLO_OPTIONAL_SERVER_EXTERNAL_PACKAGES = [
37
36
  "@holo-js/storage-s3",
38
37
  "@holo-js/validation"
39
38
  ];
39
+ var HOLO_TRANSPILED_PACKAGES = [
40
+ "@holo-js/auth"
41
+ ];
42
+ var HOLO_TRANSPILED_PACKAGE_SET = new Set(HOLO_TRANSPILED_PACKAGES);
40
43
  var PACKAGE_DEPENDENCY_FIELDS = [
41
44
  "dependencies",
42
45
  "devDependencies",
@@ -73,6 +76,9 @@ function withHolo(nextConfig = {}) {
73
76
  const installedOptionalExternal = HOLO_OPTIONAL_SERVER_EXTERNAL_PACKAGES.filter((packageName) => isOptionalServerExternalPackageInstalled(packageName, packageManifest));
74
77
  const mergedExternal = [
75
78
  .../* @__PURE__ */ new Set([...HOLO_SERVER_EXTERNAL_PACKAGES, ...installedOptionalExternal, ...existingExternal])
79
+ ].filter((packageName) => !HOLO_TRANSPILED_PACKAGE_SET.has(packageName));
80
+ const mergedTranspilePackages = [
81
+ .../* @__PURE__ */ new Set([...HOLO_TRANSPILED_PACKAGES, ...nextConfig.transpilePackages ?? []])
76
82
  ];
77
83
  const existingExcludes = nextConfig.outputFileTracingExcludes ?? {};
78
84
  const existingGlobalExcludes = existingExcludes["/*"] ?? [];
@@ -100,6 +106,7 @@ function withHolo(nextConfig = {}) {
100
106
  authInterrupts: true
101
107
  },
102
108
  serverExternalPackages: mergedExternal,
109
+ transpilePackages: mergedTranspilePackages,
103
110
  outputFileTracingExcludes: mergedExcludes,
104
111
  turbopack: mergedTurbopack,
105
112
  async rewrites() {
package/dist/runtime.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  // src/runtime.ts
2
- import { cookies, headers } from "next/headers";
3
- import { forbidden, notFound } from "next/navigation";
2
+ import { createRequire } from "module";
4
3
  import { initializeHolo } from "@holo-js/core";
5
4
 
6
5
  // src/request-context.ts
@@ -18,6 +17,7 @@ function runWithNextRequest(request, callback) {
18
17
  }
19
18
 
20
19
  // src/runtime.ts
20
+ var requireNextModule = createRequire(import.meta.url);
21
21
  function safeDecodeCookieSegment(value) {
22
22
  try {
23
23
  return decodeURIComponent(value);
@@ -90,6 +90,7 @@ function resolveNextAuthRequestAccessors() {
90
90
  if (request) {
91
91
  return request.cookies.get(name)?.value;
92
92
  }
93
+ const { cookies } = await import("next/headers.js");
93
94
  const store = await cookies();
94
95
  return store.get(name)?.value;
95
96
  },
@@ -98,6 +99,7 @@ function resolveNextAuthRequestAccessors() {
98
99
  if (request) {
99
100
  return request.headers.get(name) ?? void 0;
100
101
  }
102
+ const { headers } = await import("next/headers.js");
101
103
  const requestHeaders = await headers();
102
104
  return requestHeaders.get(name) ?? void 0;
103
105
  },
@@ -106,11 +108,12 @@ function resolveNextAuthRequestAccessors() {
106
108
  if (!parsed) {
107
109
  return;
108
110
  }
111
+ const { cookies } = await import("next/headers.js");
109
112
  const store = await cookies();
110
113
  store.set(parsed.name, parsed.value, parsed.options);
111
114
  },
112
115
  async redirectResponse(url) {
113
- const { redirect } = await import("next/navigation");
116
+ const { redirect } = await import("next/navigation.js");
114
117
  redirect(url);
115
118
  }
116
119
  };
@@ -121,10 +124,11 @@ function createNextHoloHelpers(options) {
121
124
  authRequest: options.authRequest ?? resolveNextAuthRequestAccessors(),
122
125
  authorizationError: options.authorizationError ?? {
123
126
  createError(decision) {
127
+ const { forbidden, notFound } = requireNextModule("next/navigation.js");
124
128
  if (decision.status === 404) {
125
- notFound();
129
+ return notFound();
126
130
  }
127
- forbidden();
131
+ return forbidden();
128
132
  }
129
133
  }
130
134
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holo-js/adapter-next",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Holo-JS Framework - Next.js adapter",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,11 +38,11 @@
38
38
  "test": "vitest --run"
39
39
  },
40
40
  "dependencies": {
41
- "@holo-js/config": "^0.1.8",
42
- "@holo-js/core": "^0.1.8"
41
+ "@holo-js/config": "^0.1.9",
42
+ "@holo-js/core": "^0.1.9"
43
43
  },
44
44
  "peerDependencies": {
45
- "@holo-js/forms": "^0.1.8",
45
+ "@holo-js/forms": "^0.1.9",
46
46
  "next": "^16.2.4",
47
47
  "react": "^19.2.6"
48
48
  },