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.
- package/LICENSE +21 -0
- package/README.md +779 -0
- package/bin/install-triggers.cjs +75 -0
- package/dist/actors/index.cjs +111 -0
- package/dist/actors/index.d.cts +52 -0
- package/dist/actors/index.d.ts +52 -0
- package/dist/actors/index.js +107 -0
- package/dist/configuration-D9x9Gvds.d.cts +190 -0
- package/dist/configuration-D9x9Gvds.d.ts +190 -0
- package/dist/db/drizzle.cjs +898 -0
- package/dist/db/drizzle.d.cts +68 -0
- package/dist/db/drizzle.d.ts +68 -0
- package/dist/db/drizzle.js +893 -0
- package/dist/db/prisma.cjs +826 -0
- package/dist/db/prisma.d.cts +3 -0
- package/dist/db/prisma.d.ts +3 -0
- package/dist/db/prisma.js +824 -0
- package/dist/db/supabase.cjs +1027 -0
- package/dist/db/supabase.d.cts +32 -0
- package/dist/db/supabase.d.ts +32 -0
- package/dist/db/supabase.js +1024 -0
- package/dist/index.cjs +3329 -0
- package/dist/index.d.cts +305 -0
- package/dist/index.d.ts +305 -0
- package/dist/index.js +3317 -0
- package/dist/jobs/bullmq.cjs +624 -0
- package/dist/jobs/bullmq.d.cts +33 -0
- package/dist/jobs/bullmq.d.ts +33 -0
- package/dist/jobs/bullmq.js +621 -0
- package/dist/jobs/inngest.cjs +645 -0
- package/dist/jobs/inngest.d.cts +21 -0
- package/dist/jobs/inngest.d.ts +21 -0
- package/dist/jobs/inngest.js +642 -0
- package/dist/jobs/supabase-queues.cjs +661 -0
- package/dist/jobs/supabase-queues.d.cts +37 -0
- package/dist/jobs/supabase-queues.d.ts +37 -0
- package/dist/jobs/supabase-queues.js +657 -0
- package/dist/jobs/trigger.cjs +622 -0
- package/dist/jobs/trigger.d.cts +46 -0
- package/dist/jobs/trigger.d.ts +46 -0
- package/dist/jobs/trigger.js +619 -0
- package/dist/jobs/upstash-workflow.cjs +673 -0
- package/dist/jobs/upstash-workflow.d.cts +57 -0
- package/dist/jobs/upstash-workflow.d.ts +57 -0
- package/dist/jobs/upstash-workflow.js +669 -0
- package/dist/nextjs-plugin/index.cjs +232 -0
- package/dist/nextjs-plugin/index.d.cts +68 -0
- package/dist/nextjs-plugin/index.d.ts +68 -0
- package/dist/nextjs-plugin/index.js +229 -0
- package/dist/nextjs-plugin/loader.cjs +16248 -0
- package/dist/nextjs-plugin/loader.d.cts +61 -0
- package/dist/nextjs-plugin/loader.d.ts +61 -0
- package/dist/nextjs-plugin/loader.js +16242 -0
- package/dist/triggers/index.cjs +1354 -0
- package/dist/triggers/index.d.cts +243 -0
- package/dist/triggers/index.d.ts +243 -0
- package/dist/triggers/index.js +1337 -0
- package/package.json +150 -0
- package/sql/postgres/00_install.sql +205 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface PitchContext {
|
|
2
|
+
query: string | {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
resourcePath: string;
|
|
6
|
+
resource: string;
|
|
7
|
+
request: string;
|
|
8
|
+
remainingRequest: string;
|
|
9
|
+
callback?: (error: Error | null, content?: string, sourceMap?: unknown) => void;
|
|
10
|
+
async?: () => (error: Error | null, content?: string, sourceMap?: unknown) => void;
|
|
11
|
+
data?: Record<string, unknown>;
|
|
12
|
+
emitWarning?: (warning: Error | string) => void;
|
|
13
|
+
getOptions?: () => Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Loader entry point. Receives the user's source file as a string,
|
|
17
|
+
* returns transformed source. Both Webpack and Turbopack call this
|
|
18
|
+
* the same way (Turbopack uses loader-runner under the hood).
|
|
19
|
+
*/
|
|
20
|
+
declare function loader(this: PitchContext, source: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Pitch is intentionally a no-op. We don't use the pitch bypass
|
|
23
|
+
* pattern any more — both Webpack and Turbopack send the source
|
|
24
|
+
* through the main loader function, which we transform inline.
|
|
25
|
+
*/
|
|
26
|
+
declare function pitch(this: PitchContext, _remainingRequest: string): undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Rewrite inline `"use server"` actions inside RSC components
|
|
29
|
+
* (page/layout/etc.) so each one runs through
|
|
30
|
+
* `__ezlogs_run_inline_server_action`. We KEEP the original function
|
|
31
|
+
* declaration AND the literal `"use server"` directive as the first
|
|
32
|
+
* inner statement — both are required for SWC's Server Reference
|
|
33
|
+
* registration to pick up the symbol. Only the statements AFTER the
|
|
34
|
+
* directive are wrapped:
|
|
35
|
+
*
|
|
36
|
+
* async function deletePost(formData) {
|
|
37
|
+
* "use server"
|
|
38
|
+
* ...body...
|
|
39
|
+
* }
|
|
40
|
+
* ↓
|
|
41
|
+
* async function deletePost(formData) {
|
|
42
|
+
* "use server"
|
|
43
|
+
* return await __ezlogs_run_inline_server_action(deletePost, async () => {
|
|
44
|
+
* ...body...
|
|
45
|
+
* })
|
|
46
|
+
* }
|
|
47
|
+
*
|
|
48
|
+
* Three function shapes are recognized — the only shapes inline
|
|
49
|
+
* actions actually take in the wild:
|
|
50
|
+
*
|
|
51
|
+
* async function NAME(args) { "use server"; ... }
|
|
52
|
+
* const NAME = async (args) => { "use server"; ... }
|
|
53
|
+
* const NAME = async function NAME?(args) { "use server"; ... }
|
|
54
|
+
*
|
|
55
|
+
* Files with no `"use server"` substring fast-path out unchanged.
|
|
56
|
+
* Any sucrase parse error returns the source unchanged with a
|
|
57
|
+
* `console.warn` — never break the user's build.
|
|
58
|
+
*/
|
|
59
|
+
declare function rewriteInlineServerActions(source: string, filename: string): string;
|
|
60
|
+
|
|
61
|
+
export { loader as default, pitch, rewriteInlineServerActions };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface PitchContext {
|
|
2
|
+
query: string | {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
resourcePath: string;
|
|
6
|
+
resource: string;
|
|
7
|
+
request: string;
|
|
8
|
+
remainingRequest: string;
|
|
9
|
+
callback?: (error: Error | null, content?: string, sourceMap?: unknown) => void;
|
|
10
|
+
async?: () => (error: Error | null, content?: string, sourceMap?: unknown) => void;
|
|
11
|
+
data?: Record<string, unknown>;
|
|
12
|
+
emitWarning?: (warning: Error | string) => void;
|
|
13
|
+
getOptions?: () => Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Loader entry point. Receives the user's source file as a string,
|
|
17
|
+
* returns transformed source. Both Webpack and Turbopack call this
|
|
18
|
+
* the same way (Turbopack uses loader-runner under the hood).
|
|
19
|
+
*/
|
|
20
|
+
declare function loader(this: PitchContext, source: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Pitch is intentionally a no-op. We don't use the pitch bypass
|
|
23
|
+
* pattern any more — both Webpack and Turbopack send the source
|
|
24
|
+
* through the main loader function, which we transform inline.
|
|
25
|
+
*/
|
|
26
|
+
declare function pitch(this: PitchContext, _remainingRequest: string): undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Rewrite inline `"use server"` actions inside RSC components
|
|
29
|
+
* (page/layout/etc.) so each one runs through
|
|
30
|
+
* `__ezlogs_run_inline_server_action`. We KEEP the original function
|
|
31
|
+
* declaration AND the literal `"use server"` directive as the first
|
|
32
|
+
* inner statement — both are required for SWC's Server Reference
|
|
33
|
+
* registration to pick up the symbol. Only the statements AFTER the
|
|
34
|
+
* directive are wrapped:
|
|
35
|
+
*
|
|
36
|
+
* async function deletePost(formData) {
|
|
37
|
+
* "use server"
|
|
38
|
+
* ...body...
|
|
39
|
+
* }
|
|
40
|
+
* ↓
|
|
41
|
+
* async function deletePost(formData) {
|
|
42
|
+
* "use server"
|
|
43
|
+
* return await __ezlogs_run_inline_server_action(deletePost, async () => {
|
|
44
|
+
* ...body...
|
|
45
|
+
* })
|
|
46
|
+
* }
|
|
47
|
+
*
|
|
48
|
+
* Three function shapes are recognized — the only shapes inline
|
|
49
|
+
* actions actually take in the wild:
|
|
50
|
+
*
|
|
51
|
+
* async function NAME(args) { "use server"; ... }
|
|
52
|
+
* const NAME = async (args) => { "use server"; ... }
|
|
53
|
+
* const NAME = async function NAME?(args) { "use server"; ... }
|
|
54
|
+
*
|
|
55
|
+
* Files with no `"use server"` substring fast-path out unchanged.
|
|
56
|
+
* Any sucrase parse error returns the source unchanged with a
|
|
57
|
+
* `console.warn` — never break the user's build.
|
|
58
|
+
*/
|
|
59
|
+
declare function rewriteInlineServerActions(source: string, filename: string): string;
|
|
60
|
+
|
|
61
|
+
export { loader as default, pitch, rewriteInlineServerActions };
|