ezlogs-nextjs 0.1.0

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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +779 -0
  3. package/bin/install-triggers.cjs +75 -0
  4. package/dist/actors/index.cjs +111 -0
  5. package/dist/actors/index.d.cts +52 -0
  6. package/dist/actors/index.d.ts +52 -0
  7. package/dist/actors/index.js +107 -0
  8. package/dist/configuration-D9x9Gvds.d.cts +190 -0
  9. package/dist/configuration-D9x9Gvds.d.ts +190 -0
  10. package/dist/db/drizzle.cjs +898 -0
  11. package/dist/db/drizzle.d.cts +68 -0
  12. package/dist/db/drizzle.d.ts +68 -0
  13. package/dist/db/drizzle.js +893 -0
  14. package/dist/db/prisma.cjs +826 -0
  15. package/dist/db/prisma.d.cts +3 -0
  16. package/dist/db/prisma.d.ts +3 -0
  17. package/dist/db/prisma.js +824 -0
  18. package/dist/db/supabase.cjs +1027 -0
  19. package/dist/db/supabase.d.cts +32 -0
  20. package/dist/db/supabase.d.ts +32 -0
  21. package/dist/db/supabase.js +1024 -0
  22. package/dist/index.cjs +3329 -0
  23. package/dist/index.d.cts +305 -0
  24. package/dist/index.d.ts +305 -0
  25. package/dist/index.js +3317 -0
  26. package/dist/jobs/bullmq.cjs +624 -0
  27. package/dist/jobs/bullmq.d.cts +33 -0
  28. package/dist/jobs/bullmq.d.ts +33 -0
  29. package/dist/jobs/bullmq.js +621 -0
  30. package/dist/jobs/inngest.cjs +645 -0
  31. package/dist/jobs/inngest.d.cts +21 -0
  32. package/dist/jobs/inngest.d.ts +21 -0
  33. package/dist/jobs/inngest.js +642 -0
  34. package/dist/jobs/supabase-queues.cjs +661 -0
  35. package/dist/jobs/supabase-queues.d.cts +37 -0
  36. package/dist/jobs/supabase-queues.d.ts +37 -0
  37. package/dist/jobs/supabase-queues.js +657 -0
  38. package/dist/jobs/trigger.cjs +622 -0
  39. package/dist/jobs/trigger.d.cts +46 -0
  40. package/dist/jobs/trigger.d.ts +46 -0
  41. package/dist/jobs/trigger.js +619 -0
  42. package/dist/jobs/upstash-workflow.cjs +673 -0
  43. package/dist/jobs/upstash-workflow.d.cts +57 -0
  44. package/dist/jobs/upstash-workflow.d.ts +57 -0
  45. package/dist/jobs/upstash-workflow.js +669 -0
  46. package/dist/nextjs-plugin/index.cjs +232 -0
  47. package/dist/nextjs-plugin/index.d.cts +68 -0
  48. package/dist/nextjs-plugin/index.d.ts +68 -0
  49. package/dist/nextjs-plugin/index.js +229 -0
  50. package/dist/nextjs-plugin/loader.cjs +16248 -0
  51. package/dist/nextjs-plugin/loader.d.cts +61 -0
  52. package/dist/nextjs-plugin/loader.d.ts +61 -0
  53. package/dist/nextjs-plugin/loader.js +16242 -0
  54. package/dist/triggers/index.cjs +1354 -0
  55. package/dist/triggers/index.d.cts +243 -0
  56. package/dist/triggers/index.d.ts +243 -0
  57. package/dist/triggers/index.js +1337 -0
  58. package/package.json +150 -0
  59. package/sql/postgres/00_install.sql +205 -0
@@ -0,0 +1,232 @@
1
+ 'use strict';
2
+
3
+ var path = require('path');
4
+ var url = require('url');
5
+
6
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
+ // src/nextjs-plugin/index.ts
8
+ var INLINE_ROUTE_FILENAMES = [
9
+ "page",
10
+ "layout",
11
+ "template",
12
+ "loading",
13
+ "error",
14
+ "default",
15
+ "not-found"
16
+ ];
17
+ function withEzlogsConfig(nextConfig = {}) {
18
+ const userWebpack = nextConfig.webpack;
19
+ const loaderPath = resolveLoaderPath();
20
+ return {
21
+ ...nextConfig,
22
+ webpack(config, options) {
23
+ const merged = userWebpack ? userWebpack(config, options) : config;
24
+ if (!options.isServer) return merged;
25
+ return installLoaders(merged, options);
26
+ },
27
+ turbopack: mergeTurbopackConfig(nextConfig.turbopack, loaderPath)
28
+ };
29
+ }
30
+ function mergeTurbopackConfig(userTurbopack, loaderPath) {
31
+ const ezlogsRules = {};
32
+ for (const ext of ["ts", "tsx", "js", "jsx"]) {
33
+ ezlogsRules[`**/{app,src/app}/**/route.${ext}`] = {
34
+ condition: { not: "browser" },
35
+ loaders: [
36
+ {
37
+ loader: loaderPath,
38
+ options: { kind: "app-route-handler" }
39
+ }
40
+ ],
41
+ as: `*.${ext}`
42
+ };
43
+ ezlogsRules[`**/{pages,src/pages}/api/**/*.${ext}`] = {
44
+ condition: { not: "browser" },
45
+ loaders: [
46
+ {
47
+ loader: loaderPath,
48
+ options: { kind: "pages-api" }
49
+ }
50
+ ],
51
+ as: `*.${ext}`
52
+ };
53
+ ezlogsRules[`**/middleware.${ext}`] = {
54
+ condition: { not: "browser" },
55
+ loaders: [
56
+ {
57
+ loader: loaderPath,
58
+ options: { kind: "middleware" }
59
+ }
60
+ ],
61
+ as: `*.${ext}`
62
+ };
63
+ ezlogsRules[`**/src/middleware.${ext}`] = {
64
+ condition: { not: "browser" },
65
+ loaders: [
66
+ {
67
+ loader: loaderPath,
68
+ options: { kind: "middleware" }
69
+ }
70
+ ],
71
+ as: `*.${ext}`
72
+ };
73
+ const actionGlobs = [
74
+ `**/{actions,src/actions}/**/*.${ext}`,
75
+ `**/{app,src/app}/**/actions.${ext}`,
76
+ `**/{app,src/app}/**/actions/**/*.${ext}`
77
+ ];
78
+ for (const glob of actionGlobs) {
79
+ ezlogsRules[glob] = {
80
+ condition: { not: "browser" },
81
+ loaders: [
82
+ {
83
+ loader: loaderPath,
84
+ options: { kind: "server-action" }
85
+ }
86
+ ],
87
+ as: `*.${ext}`
88
+ };
89
+ }
90
+ const supabaseGlobs = [
91
+ `**/{lib,src/lib,utils,src/utils}/supabase/**/*.${ext}`
92
+ ];
93
+ for (const glob of supabaseGlobs) {
94
+ ezlogsRules[glob] = {
95
+ condition: { not: "browser" },
96
+ loaders: [
97
+ {
98
+ loader: loaderPath,
99
+ options: { kind: "supabase-factory" }
100
+ }
101
+ ],
102
+ as: `*.${ext}`
103
+ };
104
+ }
105
+ for (const inlineFilename of INLINE_ROUTE_FILENAMES) {
106
+ ezlogsRules[`**/{app,src/app}/**/${inlineFilename}.${ext}`] = {
107
+ condition: {
108
+ all: [{ not: "browser" }, { content: /"use server"|'use server'/ }]
109
+ },
110
+ loaders: [
111
+ {
112
+ loader: loaderPath,
113
+ options: { kind: "inline-server-action" }
114
+ }
115
+ ]
116
+ };
117
+ }
118
+ }
119
+ return {
120
+ ...userTurbopack,
121
+ rules: {
122
+ ...userTurbopack?.rules ?? {},
123
+ ...ezlogsRules
124
+ }
125
+ };
126
+ }
127
+ function installLoaders(config, context) {
128
+ const loaderPath = resolveLoaderPath();
129
+ const projectDir = context.dir;
130
+ const pageExtensions = context.config.pageExtensions ?? ["tsx", "ts", "jsx", "js"];
131
+ const extPattern = pageExtensions.join("|");
132
+ const appDir = path.resolve(projectDir, "app");
133
+ const srcAppDir = path.resolve(projectDir, "src/app");
134
+ const pagesDir = path.resolve(projectDir, "pages");
135
+ const srcPagesDir = path.resolve(projectDir, "src/pages");
136
+ const newRules = [];
137
+ newRules.push({
138
+ test: new RegExp(`[/\\\\]route\\.(${extPattern})$`),
139
+ include: [appDir, srcAppDir],
140
+ use: [
141
+ {
142
+ loader: loaderPath,
143
+ options: { kind: "app-route-handler", projectDir }
144
+ }
145
+ ]
146
+ });
147
+ newRules.push({
148
+ test: new RegExp(`[/\\\\]pages[/\\\\]api[/\\\\].*\\.(${extPattern})$`),
149
+ include: [pagesDir, srcPagesDir],
150
+ use: [
151
+ {
152
+ loader: loaderPath,
153
+ options: { kind: "pages-api", projectDir }
154
+ }
155
+ ]
156
+ });
157
+ newRules.push({
158
+ test: new RegExp(`^${escapeRegex(projectDir)}[/\\\\](src[/\\\\])?middleware\\.(${extPattern})$`),
159
+ use: [
160
+ {
161
+ loader: loaderPath,
162
+ options: { kind: "middleware", projectDir }
163
+ }
164
+ ]
165
+ });
166
+ const actionsActionsDir = path.resolve(projectDir, "actions");
167
+ const srcActionsDir = path.resolve(projectDir, "src/actions");
168
+ const appActionsDir = path.resolve(projectDir, "app/actions");
169
+ const srcAppActionsDir = path.resolve(projectDir, "src/app/actions");
170
+ newRules.push({
171
+ test: new RegExp(`\\.(${extPattern})$`),
172
+ include: [actionsActionsDir, srcActionsDir, appActionsDir, srcAppActionsDir],
173
+ use: [
174
+ {
175
+ loader: loaderPath,
176
+ options: { kind: "server-action", projectDir }
177
+ }
178
+ ]
179
+ });
180
+ const appDirForActions = path.resolve(projectDir, "app");
181
+ const srcAppDirForActions = path.resolve(projectDir, "src/app");
182
+ newRules.push({
183
+ test: new RegExp(`[/\\\\]actions\\.(${extPattern})$`),
184
+ include: [appDirForActions, srcAppDirForActions],
185
+ use: [
186
+ {
187
+ loader: loaderPath,
188
+ options: { kind: "server-action", projectDir }
189
+ }
190
+ ]
191
+ });
192
+ const libSupabase = path.resolve(projectDir, "lib/supabase");
193
+ const srcLibSupabase = path.resolve(projectDir, "src/lib/supabase");
194
+ const utilsSupabase = path.resolve(projectDir, "utils/supabase");
195
+ const srcUtilsSupabase = path.resolve(projectDir, "src/utils/supabase");
196
+ newRules.push({
197
+ test: new RegExp(`\\.(${extPattern})$`),
198
+ include: [libSupabase, srcLibSupabase, utilsSupabase, srcUtilsSupabase],
199
+ use: [
200
+ {
201
+ loader: loaderPath,
202
+ options: { kind: "supabase-factory", projectDir }
203
+ }
204
+ ]
205
+ });
206
+ newRules.push({
207
+ test: new RegExp(
208
+ `[/\\\\](${INLINE_ROUTE_FILENAMES.join("|")})\\.(${extPattern})$`
209
+ ),
210
+ include: [appDir, srcAppDir],
211
+ use: [
212
+ {
213
+ loader: loaderPath,
214
+ options: { kind: "inline-server-action", projectDir }
215
+ }
216
+ ]
217
+ });
218
+ const updated = { ...config };
219
+ if (!updated.module) updated.module = {};
220
+ if (!updated.module.rules) updated.module.rules = [];
221
+ updated.module.rules = [...updated.module.rules, ...newRules];
222
+ return updated;
223
+ }
224
+ function resolveLoaderPath() {
225
+ const here = typeof __dirname === "string" ? __dirname : path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
226
+ return path.resolve(here, "loader.cjs");
227
+ }
228
+ function escapeRegex(input) {
229
+ return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
230
+ }
231
+
232
+ exports.withEzlogsConfig = withEzlogsConfig;
@@ -0,0 +1,68 @@
1
+ interface NextConfig {
2
+ webpack?: (config: WebpackConfig, options: WebpackContext) => WebpackConfig;
3
+ pageExtensions?: string[];
4
+ turbopack?: TurbopackConfig;
5
+ [key: string]: unknown;
6
+ }
7
+ interface TurbopackConfig {
8
+ root?: string;
9
+ rules?: Record<string, TurbopackRule | TurbopackRule[]>;
10
+ resolveAlias?: Record<string, string | string[] | Record<string, string>>;
11
+ resolveExtensions?: string[];
12
+ debugIds?: boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ interface TurbopackRule {
16
+ loaders?: Array<string | {
17
+ loader: string;
18
+ options?: Record<string, unknown>;
19
+ }>;
20
+ as?: string;
21
+ type?: string;
22
+ condition?: TurbopackCondition;
23
+ }
24
+ type TurbopackCondition = string | {
25
+ not: TurbopackCondition;
26
+ } | {
27
+ all: TurbopackCondition[];
28
+ } | {
29
+ any: TurbopackCondition[];
30
+ } | {
31
+ path: string | RegExp;
32
+ } | {
33
+ content: RegExp;
34
+ } | {
35
+ query: string | RegExp;
36
+ } | {
37
+ contentType: string | RegExp;
38
+ };
39
+ interface WebpackConfig {
40
+ module?: {
41
+ rules?: WebpackRule[];
42
+ };
43
+ resolve?: {
44
+ alias?: Record<string, string | string[]>;
45
+ };
46
+ [key: string]: unknown;
47
+ }
48
+ interface WebpackRule {
49
+ test?: RegExp | ((path: string) => boolean);
50
+ include?: string | RegExp | Array<string | RegExp> | ((path: string) => boolean);
51
+ exclude?: string | RegExp | Array<string | RegExp> | ((path: string) => boolean);
52
+ use?: WebpackUseEntry | WebpackUseEntry[];
53
+ [key: string]: unknown;
54
+ }
55
+ type WebpackUseEntry = string | {
56
+ loader: string;
57
+ options?: Record<string, unknown>;
58
+ };
59
+ interface WebpackContext {
60
+ dir: string;
61
+ isServer: boolean;
62
+ dev: boolean;
63
+ buildId: string;
64
+ config: NextConfig;
65
+ }
66
+ declare function withEzlogsConfig(nextConfig?: NextConfig): NextConfig;
67
+
68
+ export { withEzlogsConfig };
@@ -0,0 +1,68 @@
1
+ interface NextConfig {
2
+ webpack?: (config: WebpackConfig, options: WebpackContext) => WebpackConfig;
3
+ pageExtensions?: string[];
4
+ turbopack?: TurbopackConfig;
5
+ [key: string]: unknown;
6
+ }
7
+ interface TurbopackConfig {
8
+ root?: string;
9
+ rules?: Record<string, TurbopackRule | TurbopackRule[]>;
10
+ resolveAlias?: Record<string, string | string[] | Record<string, string>>;
11
+ resolveExtensions?: string[];
12
+ debugIds?: boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ interface TurbopackRule {
16
+ loaders?: Array<string | {
17
+ loader: string;
18
+ options?: Record<string, unknown>;
19
+ }>;
20
+ as?: string;
21
+ type?: string;
22
+ condition?: TurbopackCondition;
23
+ }
24
+ type TurbopackCondition = string | {
25
+ not: TurbopackCondition;
26
+ } | {
27
+ all: TurbopackCondition[];
28
+ } | {
29
+ any: TurbopackCondition[];
30
+ } | {
31
+ path: string | RegExp;
32
+ } | {
33
+ content: RegExp;
34
+ } | {
35
+ query: string | RegExp;
36
+ } | {
37
+ contentType: string | RegExp;
38
+ };
39
+ interface WebpackConfig {
40
+ module?: {
41
+ rules?: WebpackRule[];
42
+ };
43
+ resolve?: {
44
+ alias?: Record<string, string | string[]>;
45
+ };
46
+ [key: string]: unknown;
47
+ }
48
+ interface WebpackRule {
49
+ test?: RegExp | ((path: string) => boolean);
50
+ include?: string | RegExp | Array<string | RegExp> | ((path: string) => boolean);
51
+ exclude?: string | RegExp | Array<string | RegExp> | ((path: string) => boolean);
52
+ use?: WebpackUseEntry | WebpackUseEntry[];
53
+ [key: string]: unknown;
54
+ }
55
+ type WebpackUseEntry = string | {
56
+ loader: string;
57
+ options?: Record<string, unknown>;
58
+ };
59
+ interface WebpackContext {
60
+ dir: string;
61
+ isServer: boolean;
62
+ dev: boolean;
63
+ buildId: string;
64
+ config: NextConfig;
65
+ }
66
+ declare function withEzlogsConfig(nextConfig?: NextConfig): NextConfig;
67
+
68
+ export { withEzlogsConfig };
@@ -0,0 +1,229 @@
1
+ import { resolve, dirname } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+
4
+ // src/nextjs-plugin/index.ts
5
+ var INLINE_ROUTE_FILENAMES = [
6
+ "page",
7
+ "layout",
8
+ "template",
9
+ "loading",
10
+ "error",
11
+ "default",
12
+ "not-found"
13
+ ];
14
+ function withEzlogsConfig(nextConfig = {}) {
15
+ const userWebpack = nextConfig.webpack;
16
+ const loaderPath = resolveLoaderPath();
17
+ return {
18
+ ...nextConfig,
19
+ webpack(config, options) {
20
+ const merged = userWebpack ? userWebpack(config, options) : config;
21
+ if (!options.isServer) return merged;
22
+ return installLoaders(merged, options);
23
+ },
24
+ turbopack: mergeTurbopackConfig(nextConfig.turbopack, loaderPath)
25
+ };
26
+ }
27
+ function mergeTurbopackConfig(userTurbopack, loaderPath) {
28
+ const ezlogsRules = {};
29
+ for (const ext of ["ts", "tsx", "js", "jsx"]) {
30
+ ezlogsRules[`**/{app,src/app}/**/route.${ext}`] = {
31
+ condition: { not: "browser" },
32
+ loaders: [
33
+ {
34
+ loader: loaderPath,
35
+ options: { kind: "app-route-handler" }
36
+ }
37
+ ],
38
+ as: `*.${ext}`
39
+ };
40
+ ezlogsRules[`**/{pages,src/pages}/api/**/*.${ext}`] = {
41
+ condition: { not: "browser" },
42
+ loaders: [
43
+ {
44
+ loader: loaderPath,
45
+ options: { kind: "pages-api" }
46
+ }
47
+ ],
48
+ as: `*.${ext}`
49
+ };
50
+ ezlogsRules[`**/middleware.${ext}`] = {
51
+ condition: { not: "browser" },
52
+ loaders: [
53
+ {
54
+ loader: loaderPath,
55
+ options: { kind: "middleware" }
56
+ }
57
+ ],
58
+ as: `*.${ext}`
59
+ };
60
+ ezlogsRules[`**/src/middleware.${ext}`] = {
61
+ condition: { not: "browser" },
62
+ loaders: [
63
+ {
64
+ loader: loaderPath,
65
+ options: { kind: "middleware" }
66
+ }
67
+ ],
68
+ as: `*.${ext}`
69
+ };
70
+ const actionGlobs = [
71
+ `**/{actions,src/actions}/**/*.${ext}`,
72
+ `**/{app,src/app}/**/actions.${ext}`,
73
+ `**/{app,src/app}/**/actions/**/*.${ext}`
74
+ ];
75
+ for (const glob of actionGlobs) {
76
+ ezlogsRules[glob] = {
77
+ condition: { not: "browser" },
78
+ loaders: [
79
+ {
80
+ loader: loaderPath,
81
+ options: { kind: "server-action" }
82
+ }
83
+ ],
84
+ as: `*.${ext}`
85
+ };
86
+ }
87
+ const supabaseGlobs = [
88
+ `**/{lib,src/lib,utils,src/utils}/supabase/**/*.${ext}`
89
+ ];
90
+ for (const glob of supabaseGlobs) {
91
+ ezlogsRules[glob] = {
92
+ condition: { not: "browser" },
93
+ loaders: [
94
+ {
95
+ loader: loaderPath,
96
+ options: { kind: "supabase-factory" }
97
+ }
98
+ ],
99
+ as: `*.${ext}`
100
+ };
101
+ }
102
+ for (const inlineFilename of INLINE_ROUTE_FILENAMES) {
103
+ ezlogsRules[`**/{app,src/app}/**/${inlineFilename}.${ext}`] = {
104
+ condition: {
105
+ all: [{ not: "browser" }, { content: /"use server"|'use server'/ }]
106
+ },
107
+ loaders: [
108
+ {
109
+ loader: loaderPath,
110
+ options: { kind: "inline-server-action" }
111
+ }
112
+ ]
113
+ };
114
+ }
115
+ }
116
+ return {
117
+ ...userTurbopack,
118
+ rules: {
119
+ ...userTurbopack?.rules ?? {},
120
+ ...ezlogsRules
121
+ }
122
+ };
123
+ }
124
+ function installLoaders(config, context) {
125
+ const loaderPath = resolveLoaderPath();
126
+ const projectDir = context.dir;
127
+ const pageExtensions = context.config.pageExtensions ?? ["tsx", "ts", "jsx", "js"];
128
+ const extPattern = pageExtensions.join("|");
129
+ const appDir = resolve(projectDir, "app");
130
+ const srcAppDir = resolve(projectDir, "src/app");
131
+ const pagesDir = resolve(projectDir, "pages");
132
+ const srcPagesDir = resolve(projectDir, "src/pages");
133
+ const newRules = [];
134
+ newRules.push({
135
+ test: new RegExp(`[/\\\\]route\\.(${extPattern})$`),
136
+ include: [appDir, srcAppDir],
137
+ use: [
138
+ {
139
+ loader: loaderPath,
140
+ options: { kind: "app-route-handler", projectDir }
141
+ }
142
+ ]
143
+ });
144
+ newRules.push({
145
+ test: new RegExp(`[/\\\\]pages[/\\\\]api[/\\\\].*\\.(${extPattern})$`),
146
+ include: [pagesDir, srcPagesDir],
147
+ use: [
148
+ {
149
+ loader: loaderPath,
150
+ options: { kind: "pages-api", projectDir }
151
+ }
152
+ ]
153
+ });
154
+ newRules.push({
155
+ test: new RegExp(`^${escapeRegex(projectDir)}[/\\\\](src[/\\\\])?middleware\\.(${extPattern})$`),
156
+ use: [
157
+ {
158
+ loader: loaderPath,
159
+ options: { kind: "middleware", projectDir }
160
+ }
161
+ ]
162
+ });
163
+ const actionsActionsDir = resolve(projectDir, "actions");
164
+ const srcActionsDir = resolve(projectDir, "src/actions");
165
+ const appActionsDir = resolve(projectDir, "app/actions");
166
+ const srcAppActionsDir = resolve(projectDir, "src/app/actions");
167
+ newRules.push({
168
+ test: new RegExp(`\\.(${extPattern})$`),
169
+ include: [actionsActionsDir, srcActionsDir, appActionsDir, srcAppActionsDir],
170
+ use: [
171
+ {
172
+ loader: loaderPath,
173
+ options: { kind: "server-action", projectDir }
174
+ }
175
+ ]
176
+ });
177
+ const appDirForActions = resolve(projectDir, "app");
178
+ const srcAppDirForActions = resolve(projectDir, "src/app");
179
+ newRules.push({
180
+ test: new RegExp(`[/\\\\]actions\\.(${extPattern})$`),
181
+ include: [appDirForActions, srcAppDirForActions],
182
+ use: [
183
+ {
184
+ loader: loaderPath,
185
+ options: { kind: "server-action", projectDir }
186
+ }
187
+ ]
188
+ });
189
+ const libSupabase = resolve(projectDir, "lib/supabase");
190
+ const srcLibSupabase = resolve(projectDir, "src/lib/supabase");
191
+ const utilsSupabase = resolve(projectDir, "utils/supabase");
192
+ const srcUtilsSupabase = resolve(projectDir, "src/utils/supabase");
193
+ newRules.push({
194
+ test: new RegExp(`\\.(${extPattern})$`),
195
+ include: [libSupabase, srcLibSupabase, utilsSupabase, srcUtilsSupabase],
196
+ use: [
197
+ {
198
+ loader: loaderPath,
199
+ options: { kind: "supabase-factory", projectDir }
200
+ }
201
+ ]
202
+ });
203
+ newRules.push({
204
+ test: new RegExp(
205
+ `[/\\\\](${INLINE_ROUTE_FILENAMES.join("|")})\\.(${extPattern})$`
206
+ ),
207
+ include: [appDir, srcAppDir],
208
+ use: [
209
+ {
210
+ loader: loaderPath,
211
+ options: { kind: "inline-server-action", projectDir }
212
+ }
213
+ ]
214
+ });
215
+ const updated = { ...config };
216
+ if (!updated.module) updated.module = {};
217
+ if (!updated.module.rules) updated.module.rules = [];
218
+ updated.module.rules = [...updated.module.rules, ...newRules];
219
+ return updated;
220
+ }
221
+ function resolveLoaderPath() {
222
+ const here = typeof __dirname === "string" ? __dirname : dirname(fileURLToPath(import.meta.url));
223
+ return resolve(here, "loader.cjs");
224
+ }
225
+ function escapeRegex(input) {
226
+ return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
227
+ }
228
+
229
+ export { withEzlogsConfig };