@egdesk/next-api-plugin 1.5.123 → 1.5.135

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.
@@ -88,7 +88,9 @@ function generateApiWrapper(projectPath) {
88
88
  * Generated by @egdesk/next-api-plugin
89
89
  */
90
90
 
91
- export { apiFetch, getEgdeskBasePath } from '${helpersImport}';
91
+ import { apiFetch, getEgdeskBasePath } from '${helpersImport}';
92
+
93
+ export { apiFetch, getEgdeskBasePath };
92
94
 
93
95
  /** NextAuth SessionProvider basePath (EGDesk tunnel prefix + /api/auth). */
94
96
  export function getNextAuthBasePath(): string {
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * The minimum EGDesk app version this plugin version is compatible with.
9
9
  * The app checks this at setup time and warns on mismatch.
10
10
  */
11
- export declare const COMPATIBLE_APP_VERSION = "1.4.134";
11
+ export declare const COMPATIBLE_APP_VERSION = "1.4.146";
12
12
  export interface SetupOptions {
13
13
  egdeskUrl?: string;
14
14
  /** Production EGDesk server URL — written to .env.production.local. Falls back to egdeskUrl. */
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ exports.setupNextApiPlugin = setupNextApiPlugin;
46
46
  * The minimum EGDesk app version this plugin version is compatible with.
47
47
  * The app checks this at setup time and warns on mismatch.
48
48
  */
49
- exports.COMPATIBLE_APP_VERSION = '1.4.134';
49
+ exports.COMPATIBLE_APP_VERSION = '1.4.146';
50
50
  const fs = __importStar(require("fs"));
51
51
  const path = __importStar(require("path"));
52
52
  const setup_userdata_1 = require("./setup-userdata");
@@ -220,12 +220,21 @@ prodTables) {
220
220
  'NEXT_PUBLIC_EGDESK_PROJECT_ID',
221
221
  'NEXT_PUBLIC_EGDESK_ENV',
222
222
  ]);
223
- function writeEnvFile(envPath, apiUrl, label, egdeskEnv, tables) {
224
- // Preserve existing non-EGDesk vars
225
- const existing = parseEnvFile(envPath);
226
- const preserved = Object.fromEntries(Object.entries(existing).filter(([k]) => !egdeskKeys.has(k) &&
223
+ function customAssignments(envPath) {
224
+ return Object.fromEntries(Object.entries(parseEnvFile(envPath)).filter(([k]) => !egdeskKeys.has(k) &&
227
225
  k !== 'NEXT_PUBLIC_SUPABASE_URL' &&
228
226
  k !== 'NEXT_PUBLIC_SUPABASE_ANON_KEY'));
227
+ }
228
+ function writeEnvFile(envPath, apiUrl, label, egdeskEnv, tables) {
229
+ // `.env.local` is where projects keep server secrets (bridge URL, callback
230
+ // secret). Copy those into the mode file: `next build` / `next start` load
231
+ // `.env.production.local` before `.env.local`. The mode file itself wins
232
+ // when the same key is set in both.
233
+ const preserved = {
234
+ ...customAssignments(path.join(projectPath, '.env')),
235
+ ...customAssignments(path.join(projectPath, '.env.local')),
236
+ ...customAssignments(envPath),
237
+ };
229
238
  const aiWarning = egdeskEnv === 'production' ? [
230
239
  '# ============================================================',
231
240
  '# ⚠️ AI ASSISTANT — DO NOT READ, EDIT, OR USE THIS FILE ⚠️',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egdesk/next-api-plugin",
3
- "version": "1.5.123",
3
+ "version": "1.5.135",
4
4
  "description": "Next.js plugin for EGDesk database proxy integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^20.10.0",
39
- "next": "^14.0.0",
39
+ "next": "15.5.28",
40
40
  "typescript": "^5.3.0"
41
41
  }
42
42
  }