@workflow/nitro 4.0.1-beta.5 → 4.0.1-beta.50
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.md +201 -21
- package/dist/builders.d.ts +1 -3
- package/dist/builders.d.ts.map +1 -1
- package/dist/builders.js +31 -29
- package/dist/builders.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +160 -8
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vite.d.ts +4 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +78 -0
- package/dist/vite.js.map +1 -0
- package/package.json +14 -11
- package/dist/rollup-plugin.d.ts +0 -5
- package/dist/rollup-plugin.d.ts.map +0 -1
- package/dist/rollup-plugin.js +0 -43
- package/dist/rollup-plugin.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
<http://www.apache.org/licenses/>
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Vercel Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/builders.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BaseBuilder } from '@workflow/
|
|
2
|
-
import { VercelBuildOutputAPIBuilder } from '@workflow/cli/dist/lib/builders/vercel-build-output-api';
|
|
1
|
+
import { BaseBuilder, VercelBuildOutputAPIBuilder } from '@workflow/builders';
|
|
3
2
|
import type { Nitro } from 'nitro/types';
|
|
4
3
|
export declare class VercelBuilder extends VercelBuildOutputAPIBuilder {
|
|
5
4
|
constructor(nitro: Nitro);
|
|
@@ -10,5 +9,4 @@ export declare class LocalBuilder extends BaseBuilder {
|
|
|
10
9
|
constructor(nitro: Nitro);
|
|
11
10
|
build(): Promise<void>;
|
|
12
11
|
}
|
|
13
|
-
export declare function getWorkflowDirs(nitro: Nitro): string[];
|
|
14
12
|
//# sourceMappingURL=builders.d.ts.map
|
package/dist/builders.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EAEX,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,qBAAa,aAAc,SAAQ,2BAA2B;gBAChD,KAAK,EAAE,KAAK;IAUT,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAWtC;AAED,qBAAa,YAAa,SAAQ,WAAW;;gBAE/B,KAAK,EAAE,KAAK;IAaT,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAwCtC"}
|
package/dist/builders.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { BaseBuilder } from '@workflow/
|
|
3
|
-
import {
|
|
4
|
-
import { join, resolve } from 'pathe';
|
|
5
|
-
const CommonBuildOptions = {
|
|
6
|
-
buildTarget: 'next', // unused in base
|
|
7
|
-
stepsBundlePath: '', // unused in base
|
|
8
|
-
workflowsBundlePath: '', // unused in base
|
|
9
|
-
webhookBundlePath: '', // unused in base
|
|
10
|
-
};
|
|
2
|
+
import { BaseBuilder, createBaseBuilderConfig, VercelBuildOutputAPIBuilder, } from '@workflow/builders';
|
|
3
|
+
import { join } from 'pathe';
|
|
11
4
|
export class VercelBuilder extends VercelBuildOutputAPIBuilder {
|
|
12
5
|
constructor(nitro) {
|
|
13
6
|
super({
|
|
14
|
-
...
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
...createBaseBuilderConfig({
|
|
8
|
+
workingDir: nitro.options.rootDir,
|
|
9
|
+
dirs: ['.'], // Different apps that use nitro have different directories
|
|
10
|
+
runtime: nitro.options.workflow?.runtime,
|
|
11
|
+
}),
|
|
12
|
+
buildTarget: 'vercel-build-output-api',
|
|
17
13
|
});
|
|
18
14
|
}
|
|
19
15
|
async build() {
|
|
@@ -30,42 +26,48 @@ export class LocalBuilder extends BaseBuilder {
|
|
|
30
26
|
constructor(nitro) {
|
|
31
27
|
const outDir = join(nitro.options.buildDir, 'workflow');
|
|
32
28
|
super({
|
|
33
|
-
...
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
...createBaseBuilderConfig({
|
|
30
|
+
workingDir: nitro.options.rootDir,
|
|
31
|
+
watch: nitro.options.dev,
|
|
32
|
+
dirs: ['.'], // Different apps that use nitro have different directories
|
|
33
|
+
}),
|
|
34
|
+
buildTarget: 'next', // Placeholder, not actually used
|
|
37
35
|
});
|
|
38
36
|
this.#outDir = outDir;
|
|
39
37
|
}
|
|
40
38
|
async build() {
|
|
41
39
|
const inputFiles = await this.getInputFiles();
|
|
42
40
|
await mkdir(this.#outDir, { recursive: true });
|
|
43
|
-
await this.createWorkflowsBundle({
|
|
41
|
+
const { manifest: workflowsManifest } = await this.createWorkflowsBundle({
|
|
44
42
|
outfile: join(this.#outDir, 'workflows.mjs'),
|
|
45
43
|
bundleFinalOutput: false,
|
|
46
44
|
format: 'esm',
|
|
47
45
|
inputFiles,
|
|
48
46
|
});
|
|
49
|
-
await this.createStepsBundle({
|
|
47
|
+
const { manifest: stepsManifest } = await this.createStepsBundle({
|
|
50
48
|
outfile: join(this.#outDir, 'steps.mjs'),
|
|
51
49
|
externalizeNonSteps: true,
|
|
52
50
|
format: 'esm',
|
|
53
51
|
inputFiles,
|
|
54
52
|
});
|
|
53
|
+
const webhookRouteFile = join(this.#outDir, 'webhook.mjs');
|
|
55
54
|
await this.createWebhookBundle({
|
|
56
|
-
outfile:
|
|
55
|
+
outfile: webhookRouteFile,
|
|
57
56
|
bundle: false,
|
|
58
57
|
});
|
|
58
|
+
// Merge manifests from both bundles
|
|
59
|
+
const manifest = {
|
|
60
|
+
steps: { ...stepsManifest.steps, ...workflowsManifest.steps },
|
|
61
|
+
workflows: { ...stepsManifest.workflows, ...workflowsManifest.workflows },
|
|
62
|
+
classes: { ...stepsManifest.classes, ...workflowsManifest.classes },
|
|
63
|
+
};
|
|
64
|
+
// Generate manifest
|
|
65
|
+
const workflowBundlePath = join(this.#outDir, 'workflows.mjs');
|
|
66
|
+
await this.createManifest({
|
|
67
|
+
workflowBundlePath,
|
|
68
|
+
manifestDir: this.#outDir,
|
|
69
|
+
manifest,
|
|
70
|
+
});
|
|
59
71
|
}
|
|
60
72
|
}
|
|
61
|
-
export function getWorkflowDirs(nitro) {
|
|
62
|
-
return unique([
|
|
63
|
-
...(nitro.options.workflow?.dirs ?? []),
|
|
64
|
-
join(nitro.options.rootDir, 'workflows'),
|
|
65
|
-
...nitro.options.scanDirs.map((dir) => join(dir, 'workflows')),
|
|
66
|
-
].map((dir) => resolve(nitro.options.rootDir, dir))).sort();
|
|
67
|
-
}
|
|
68
|
-
function unique(array) {
|
|
69
|
-
return Array.from(new Set(array));
|
|
70
|
-
}
|
|
71
73
|
//# sourceMappingURL=builders.js.map
|
package/dist/builders.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../src/builders.ts"],"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,CAAC,CAAC;QAE3D,MAAM,IAAI,CAAC,mBAAmB,CAAC;YAC7B,OAAO,EAAE,gBAAgB;YACzB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QAEH,oCAAoC;QACpC,MAAM,QAAQ,GAAG;YACf,KAAK,EAAE,EAAE,GAAG,aAAa,CAAC,KAAK,EAAE,GAAG,iBAAiB,CAAC,KAAK,EAAE;YAC7D,SAAS,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,EAAE,GAAG,iBAAiB,CAAC,SAAS,EAAE;YACzE,OAAO,EAAE,EAAE,GAAG,aAAa,CAAC,OAAO,EAAE,GAAG,iBAAiB,CAAC,OAAO,EAAE;SACpE,CAAC;QAEF,oBAAoB;QACpB,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAC/D,MAAM,IAAI,CAAC,cAAc,CAAC;YACxB,kBAAkB;YAClB,WAAW,EAAE,IAAI,CAAC,OAAO;YACzB,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAA6B,MAAM,aAAa,CAAC;AAGpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,YAAY,EAAE,aAAa,EAAE,CAAC;;;6BAIT,KAAK;;AAF1B,wBAwHwB"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,43 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { workflowTransformPlugin } from '@workflow/rollup';
|
|
1
3
|
import { join } from 'pathe';
|
|
2
|
-
import { LocalBuilder, VercelBuilder } from './builders';
|
|
3
|
-
import { workflowRollupPlugin } from './rollup-plugin';
|
|
4
|
+
import { LocalBuilder, VercelBuilder } from './builders.js';
|
|
4
5
|
export default {
|
|
5
6
|
name: 'workflow/nitro',
|
|
6
7
|
async setup(nitro) {
|
|
7
8
|
const isVercelDeploy = !nitro.options.dev && nitro.options.preset === 'vercel';
|
|
8
|
-
//
|
|
9
|
+
// Pre-built workflow bundles directory - must be excluded from re-transformation
|
|
10
|
+
const workflowBuildDir = join(nitro.options.buildDir, 'workflow');
|
|
11
|
+
// Add transform plugin at the BEGINNING to run before other transforms
|
|
12
|
+
// (especially before class property transforms that rename classes like _ClassName)
|
|
9
13
|
nitro.hooks.hook('rollup:before', (_nitro, config) => {
|
|
10
|
-
config.plugins.
|
|
14
|
+
config.plugins.unshift(workflowTransformPlugin({
|
|
15
|
+
// Exclude pre-built workflow bundles from re-transformation
|
|
16
|
+
// These are already processed and re-processing causes issues like
|
|
17
|
+
// undefined class references when Nitro's bundler renames variables
|
|
18
|
+
exclude: [workflowBuildDir],
|
|
19
|
+
}));
|
|
11
20
|
});
|
|
12
|
-
// Temporary workaround for debug unenv mock
|
|
13
|
-
nitro.options.
|
|
21
|
+
// NOTE: Temporary workaround for debug unenv mock
|
|
22
|
+
if (!nitro.options.workflow?._vite) {
|
|
23
|
+
nitro.options.alias['debug'] ??= 'debug';
|
|
24
|
+
}
|
|
25
|
+
// NOTE: Externalize .nitro/workflow to prevent dev reloads
|
|
26
|
+
if (nitro.options.dev) {
|
|
27
|
+
nitro.options.externals ||= {};
|
|
28
|
+
nitro.options.externals.external ||= [];
|
|
29
|
+
const outDir = join(nitro.options.buildDir, 'workflow');
|
|
30
|
+
nitro.options.externals.external.push((id) => id.startsWith(outDir));
|
|
31
|
+
}
|
|
32
|
+
// Add tsConfig plugin
|
|
33
|
+
if (nitro.options.workflow?.typescriptPlugin) {
|
|
34
|
+
nitro.options.typescript.tsConfig ||= {};
|
|
35
|
+
nitro.options.typescript.tsConfig.compilerOptions ||= {};
|
|
36
|
+
nitro.options.typescript.tsConfig.compilerOptions.plugins ||= [];
|
|
37
|
+
nitro.options.typescript.tsConfig.compilerOptions.plugins.push({
|
|
38
|
+
name: 'workflow',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
14
41
|
// Generate functions for vercel build
|
|
15
42
|
if (isVercelDeploy) {
|
|
16
43
|
nitro.hooks.hook('compiled', async () => {
|
|
@@ -19,12 +46,46 @@ export default {
|
|
|
19
46
|
}
|
|
20
47
|
// Generate local bundles for dev and local prod
|
|
21
48
|
if (!isVercelDeploy) {
|
|
49
|
+
const builder = new LocalBuilder(nitro);
|
|
50
|
+
let isInitialBuild = true;
|
|
22
51
|
nitro.hooks.hook('build:before', async () => {
|
|
23
|
-
await
|
|
52
|
+
await builder.build();
|
|
53
|
+
// For prod: write the manifest handler file with inlined content
|
|
54
|
+
// now that the builder has generated the manifest. Rollup will
|
|
55
|
+
// bundle this file into the compiled output.
|
|
56
|
+
if (!nitro.options.dev &&
|
|
57
|
+
process.env.WORKFLOW_PUBLIC_MANIFEST === '1') {
|
|
58
|
+
writeManifestHandler(nitro);
|
|
59
|
+
}
|
|
24
60
|
});
|
|
61
|
+
// Allows for HMR - but skip the first dev:reload since build:before already ran
|
|
62
|
+
if (nitro.options.dev) {
|
|
63
|
+
nitro.hooks.hook('dev:reload', async () => {
|
|
64
|
+
if (isInitialBuild) {
|
|
65
|
+
isInitialBuild = false;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
await builder.build();
|
|
69
|
+
});
|
|
70
|
+
}
|
|
25
71
|
addVirtualHandler(nitro, '/.well-known/workflow/v1/webhook/:token', 'workflow/webhook.mjs');
|
|
26
72
|
addVirtualHandler(nitro, '/.well-known/workflow/v1/step', 'workflow/steps.mjs');
|
|
27
73
|
addVirtualHandler(nitro, '/.well-known/workflow/v1/flow', 'workflow/workflows.mjs');
|
|
74
|
+
// Expose manifest as a public HTTP route when WORKFLOW_PUBLIC_MANIFEST=1
|
|
75
|
+
if (process.env.WORKFLOW_PUBLIC_MANIFEST === '1') {
|
|
76
|
+
// Write a placeholder manifest-data.mjs so rollup can resolve the
|
|
77
|
+
// import. It will be overwritten with the real manifest in build:before.
|
|
78
|
+
// Write a placeholder handler file so rollup can resolve the path
|
|
79
|
+
// during prod compilation. It will be overwritten with the real
|
|
80
|
+
// manifest content by writeManifestHandler() in build:before.
|
|
81
|
+
if (!nitro.options.dev) {
|
|
82
|
+
const dir = join(nitro.options.buildDir, 'workflow');
|
|
83
|
+
mkdirSync(dir, { recursive: true });
|
|
84
|
+
const handlerPath = join(dir, 'manifest-handler.mjs');
|
|
85
|
+
writeFileSync(handlerPath, 'export default async () => new Response("Manifest not found", { status: 404 });\n');
|
|
86
|
+
}
|
|
87
|
+
addManifestHandler(nitro);
|
|
88
|
+
}
|
|
28
89
|
}
|
|
29
90
|
},
|
|
30
91
|
};
|
|
@@ -45,8 +106,99 @@ function addVirtualHandler(nitro, route, buildPath) {
|
|
|
45
106
|
// Nitro v3+ (native web handlers)
|
|
46
107
|
nitro.options.virtual[`#${buildPath}`] = /* js */ `
|
|
47
108
|
import { POST } from "${join(nitro.options.buildDir, buildPath)}";
|
|
48
|
-
export default ({ req }) =>
|
|
109
|
+
export default async ({ req }) => {
|
|
110
|
+
try {
|
|
111
|
+
return await POST(req);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
console.error('Handler error:', error);
|
|
114
|
+
return new Response('Internal Server Error', { status: 500 });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
49
117
|
`;
|
|
50
118
|
}
|
|
51
119
|
}
|
|
120
|
+
const MANIFEST_VIRTUAL_ID = '#workflow/manifest-handler';
|
|
121
|
+
function addManifestHandler(nitro) {
|
|
122
|
+
const route = '/.well-known/workflow/v1/manifest.json';
|
|
123
|
+
const manifestPath = join(nitro.options.buildDir, 'workflow/manifest.json');
|
|
124
|
+
const handlerPath = join(nitro.options.buildDir, 'workflow/manifest-handler.mjs');
|
|
125
|
+
if (nitro.options.dev) {
|
|
126
|
+
// Dev mode: use a virtual handler that reads the manifest from disk at
|
|
127
|
+
// request time. The absolute path is valid because we're on the build machine.
|
|
128
|
+
nitro.options.handlers.push({ route, handler: MANIFEST_VIRTUAL_ID });
|
|
129
|
+
nitro.options.virtual[MANIFEST_VIRTUAL_ID] = !nitro.routing
|
|
130
|
+
? /* js */ `
|
|
131
|
+
import { fromWebHandler } from "h3";
|
|
132
|
+
import { readFileSync } from "node:fs";
|
|
133
|
+
function GET() {
|
|
134
|
+
try {
|
|
135
|
+
const manifest = readFileSync(${JSON.stringify(manifestPath)}, "utf-8");
|
|
136
|
+
return new Response(manifest, {
|
|
137
|
+
headers: { "content-type": "application/json" },
|
|
138
|
+
});
|
|
139
|
+
} catch {
|
|
140
|
+
return new Response("Manifest not found", { status: 404 });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export default fromWebHandler(GET);
|
|
144
|
+
`
|
|
145
|
+
: /* js */ `
|
|
146
|
+
import { readFileSync } from "node:fs";
|
|
147
|
+
export default async () => {
|
|
148
|
+
try {
|
|
149
|
+
const manifest = readFileSync(${JSON.stringify(manifestPath)}, "utf-8");
|
|
150
|
+
return new Response(manifest, {
|
|
151
|
+
headers: { "content-type": "application/json" },
|
|
152
|
+
});
|
|
153
|
+
} catch {
|
|
154
|
+
return new Response("Manifest not found", { status: 404 });
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
`;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// Prod mode: register a physical handler file that will be written by
|
|
161
|
+
// writeManifestHandler() after the builder generates the manifest.
|
|
162
|
+
// This file is bundled by rollup into the compiled output.
|
|
163
|
+
nitro.options.handlers.push({ route, handler: handlerPath });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Writes a physical manifest handler file with the manifest content inlined.
|
|
168
|
+
* Must be called after the builder generates the manifest (during build:before)
|
|
169
|
+
* and before Nitro compiles the bundle with rollup.
|
|
170
|
+
*/
|
|
171
|
+
function writeManifestHandler(nitro) {
|
|
172
|
+
const manifestPath = join(nitro.options.buildDir, 'workflow/manifest.json');
|
|
173
|
+
const handlerPath = join(nitro.options.buildDir, 'workflow/manifest-handler.mjs');
|
|
174
|
+
const dir = join(nitro.options.buildDir, 'workflow');
|
|
175
|
+
mkdirSync(dir, { recursive: true });
|
|
176
|
+
try {
|
|
177
|
+
const manifestContent = readFileSync(manifestPath, 'utf-8');
|
|
178
|
+
JSON.parse(manifestContent); // validate
|
|
179
|
+
const handlerCode = !nitro.routing
|
|
180
|
+
? `import { fromWebHandler } from "h3";
|
|
181
|
+
const manifest = ${JSON.stringify(manifestContent)};
|
|
182
|
+
export default fromWebHandler(() => new Response(manifest, {
|
|
183
|
+
headers: { "content-type": "application/json" },
|
|
184
|
+
}));
|
|
185
|
+
`
|
|
186
|
+
: `const manifest = ${JSON.stringify(manifestContent)};
|
|
187
|
+
export default async () => new Response(manifest, {
|
|
188
|
+
headers: { "content-type": "application/json" },
|
|
189
|
+
});
|
|
190
|
+
`;
|
|
191
|
+
writeFileSync(handlerPath, handlerCode);
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
// Write a 404 fallback handler
|
|
195
|
+
const fallback = !nitro.routing
|
|
196
|
+
? `import { fromWebHandler } from "h3";
|
|
197
|
+
export default fromWebHandler(() => new Response("Manifest not found", { status: 404 }));
|
|
198
|
+
`
|
|
199
|
+
: `export default async () => new Response("Manifest not found", { status: 404 });
|
|
200
|
+
`;
|
|
201
|
+
writeFileSync(handlerPath, fallback);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
52
204
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SA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AC1C,CAAC;IAAC,MAAM,CAAC;QACP,+BAA+B;QAC/B,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,OAAO;YAC7B,CAAC,CAAC;;CAEP;YACK,CAAC,CAAC;CACP,CAAC;QACE,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
export interface ModuleOptions {
|
|
2
|
+
/** @internal */
|
|
3
|
+
_vite?: boolean;
|
|
2
4
|
/**
|
|
3
5
|
* Directories to scan for workflows and steps.
|
|
4
6
|
*
|
|
5
7
|
* By default, `workflows/` directory will be scanned from root and all layer source dirs.
|
|
6
8
|
*/
|
|
7
9
|
dirs?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Enable workflow TypeScript plugin in generated tsconfig.json
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
typescriptPlugin?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Node.js runtime version for Vercel Functions.
|
|
17
|
+
* @example "nodejs22.x"
|
|
18
|
+
* @example "nodejs24.x"
|
|
19
|
+
*/
|
|
20
|
+
runtime?: string;
|
|
8
21
|
}
|
|
9
22
|
declare module 'nitro/types' {
|
|
10
23
|
interface NitroOptions {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,gBAAgB;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,YAAY;QACpB,QAAQ,CAAC,EAAE,aAAa,CAAC;KAC1B;CACF;AAGD,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,YAAY;QACpB,QAAQ,CAAC,EAAE,aAAa,CAAC;KAC1B;CACF"}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,EAAE,CA4E1D"}
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createBuildQueue } from '@workflow/builders';
|
|
2
|
+
import { workflowTransformPlugin } from '@workflow/rollup';
|
|
3
|
+
import { workflowHotUpdatePlugin } from '@workflow/vite';
|
|
4
|
+
import { join } from 'pathe';
|
|
5
|
+
import { LocalBuilder } from './builders.js';
|
|
6
|
+
import nitroModule from './index.js';
|
|
7
|
+
export function workflow(options) {
|
|
8
|
+
let builder;
|
|
9
|
+
let workflowBuildDir;
|
|
10
|
+
const enqueue = createBuildQueue();
|
|
11
|
+
// Create a lazy transform plugin that excludes the workflow build directory
|
|
12
|
+
// The exclusion path is set during nitro setup, so we need to defer plugin creation
|
|
13
|
+
const lazyTransformPlugin = {
|
|
14
|
+
name: 'workflow:transform',
|
|
15
|
+
transform(code, id) {
|
|
16
|
+
// Delegate to the actual transform plugin with exclusion
|
|
17
|
+
// workflowBuildDir is set during nitro setup before transforms run
|
|
18
|
+
const plugin = workflowTransformPlugin({
|
|
19
|
+
exclude: workflowBuildDir ? [workflowBuildDir] : [],
|
|
20
|
+
});
|
|
21
|
+
return plugin.transform?.call(this, code, id);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
return [
|
|
25
|
+
lazyTransformPlugin,
|
|
26
|
+
{
|
|
27
|
+
name: 'workflow:nitro',
|
|
28
|
+
nitro: {
|
|
29
|
+
setup: (nitro) => {
|
|
30
|
+
// Capture the workflow build directory for exclusion
|
|
31
|
+
workflowBuildDir = join(nitro.options.buildDir, 'workflow');
|
|
32
|
+
nitro.options.workflow = {
|
|
33
|
+
...nitro.options.workflow,
|
|
34
|
+
...options,
|
|
35
|
+
_vite: true,
|
|
36
|
+
};
|
|
37
|
+
if (nitro.options.dev) {
|
|
38
|
+
builder = new LocalBuilder(nitro);
|
|
39
|
+
}
|
|
40
|
+
return nitroModule.setup(nitro);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
// NOTE: This is a workaround because Nitro passes the 404 requests to the dev server to handle.
|
|
44
|
+
// For workflow routes, we override to send an empty body to prevent Hono/Vite's SPA fallback.
|
|
45
|
+
configureServer(server) {
|
|
46
|
+
// Add middleware to intercept 404s on workflow routes before Vite's SPA fallback
|
|
47
|
+
return () => {
|
|
48
|
+
server.middlewares.use((req, res, next) => {
|
|
49
|
+
// Only handle workflow webhook routes
|
|
50
|
+
if (!req.url?.startsWith('/.well-known/workflow/v1/')) {
|
|
51
|
+
return next();
|
|
52
|
+
}
|
|
53
|
+
// Wrap writeHead to ensure we send empty body for 404s
|
|
54
|
+
const originalWriteHead = res.writeHead;
|
|
55
|
+
res.writeHead = function (...args) {
|
|
56
|
+
const statusCode = typeof args[0] === 'number' ? args[0] : 200;
|
|
57
|
+
// NOTE: Workaround because Nitro passes 404 requests to the vite to handle.
|
|
58
|
+
// Causes `webhook route with invalid token` test to fail.
|
|
59
|
+
// For 404s on workflow routes, ensure we're sending the right headers
|
|
60
|
+
if (statusCode === 404) {
|
|
61
|
+
// Set content-length to 0 to prevent Vite from overriding
|
|
62
|
+
res.setHeader('Content-Length', '0');
|
|
63
|
+
}
|
|
64
|
+
// @ts-expect-error - Complex overload signature
|
|
65
|
+
return originalWriteHead.apply(this, args);
|
|
66
|
+
};
|
|
67
|
+
next();
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
workflowHotUpdatePlugin({
|
|
73
|
+
builder: () => builder,
|
|
74
|
+
enqueue,
|
|
75
|
+
}),
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,WAAW,MAAM,YAAY,CAAC;AAErC,MAAM,UAAU,QAAQ,CAAC,OAAuB;IAC9C,IAAI,OAAqB,CAAC;IAC1B,IAAI,gBAAwB,CAAC;IAC7B,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IAEnC,4EAA4E;IAC5E,oFAAoF;IACpF,MAAM,mBAAmB,GAAW;QAClC,IAAI,EAAE,oBAAoB;QAC1B,SAAS,CAAC,IAAI,EAAE,EAAE;YAChB,yDAAyD;YACzD,mEAAmE;YACnE,MAAM,MAAM,GAAG,uBAAuB,CAAC;gBACrC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE;aACpD,CAAC,CAAC;YACH,OAAQ,MAAM,CAAC,SAAsB,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,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E,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;gCACvB,0DAA0D;gCAC1D,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;4BACvC,CAAC;4BAED,gDAAgD;4BAChD,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;wBAC7C,CAAQ,CAAC;wBAET,IAAI,EAAE,CAAC;oBACT,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC;YACJ,CAAC;SACF;QACD,uBAAuB,CAAC;YACtB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;YACtB,OAAO;SACR,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow/nitro",
|
|
3
|
-
"version": "4.0.1-beta.
|
|
3
|
+
"version": "4.0.1-beta.50",
|
|
4
4
|
"description": "Nitro integration for Workflow DevKit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"license": "
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "https://github.com/vercel/workflow.git",
|
|
@@ -18,19 +18,22 @@
|
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
".": "./dist/index.js",
|
|
21
|
-
"./
|
|
21
|
+
"./vite": "./dist/vite.js"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@swc/core": "1.
|
|
25
|
-
"exsolve": "
|
|
26
|
-
"pathe": "
|
|
27
|
-
"@workflow/
|
|
28
|
-
"@workflow/core": "4.0
|
|
29
|
-
"@workflow/
|
|
24
|
+
"@swc/core": "1.15.3",
|
|
25
|
+
"exsolve": "1.0.7",
|
|
26
|
+
"pathe": "2.0.3",
|
|
27
|
+
"@workflow/builders": "4.0.1-beta.46",
|
|
28
|
+
"@workflow/core": "4.1.0-beta.55",
|
|
29
|
+
"@workflow/rollup": "4.0.0-beta.12",
|
|
30
|
+
"@workflow/swc-plugin": "4.1.0-beta.18",
|
|
31
|
+
"@workflow/vite": "4.0.0-beta.5"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
|
-
"@types/node": "
|
|
33
|
-
"nitro": "
|
|
34
|
+
"@types/node": "22.19.0",
|
|
35
|
+
"nitro": "3.0.1-alpha.1",
|
|
36
|
+
"vite": "7.1.12",
|
|
34
37
|
"@workflow/tsconfig": "4.0.1-beta.0"
|
|
35
38
|
},
|
|
36
39
|
"scripts": {
|
package/dist/rollup-plugin.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { RollupConfig } from 'nitro/types';
|
|
2
|
-
type RollupPlugin = Exclude<RollupConfig['plugins'], undefined | void | null | false | Promise<unknown> | Array<unknown>>;
|
|
3
|
-
export declare function workflowRollupPlugin(): RollupPlugin;
|
|
4
|
-
export {};
|
|
5
|
-
//# sourceMappingURL=rollup-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin.d.ts","sourceRoot":"","sources":["../src/rollup-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,YAAY,GAAG,OAAO,CACzB,YAAY,CAAC,SAAS,CAAC,EACvB,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CACpE,CAAC;AAIF,wBAAgB,oBAAoB,IAAI,YAAY,CA0CnD"}
|
package/dist/rollup-plugin.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { transform } from '@swc/core';
|
|
2
|
-
import { resolveModulePath } from 'exsolve';
|
|
3
|
-
// https://github.com/vercel/workflow/blob/feat/nitro/packages/next/src/loader.ts
|
|
4
|
-
export function workflowRollupPlugin() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'workflow-rollup-plugin',
|
|
7
|
-
// This transform applies the "use workflow"/"use step"
|
|
8
|
-
// client transformation
|
|
9
|
-
async transform(code, id) {
|
|
10
|
-
// only apply the transform if file needs it
|
|
11
|
-
if (!code.match(/(use step|use workflow)/)) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const isTypeScript = id.endsWith('.ts') || id.endsWith('.tsx');
|
|
15
|
-
const isTsx = id.endsWith('.tsx');
|
|
16
|
-
const swcPlugin = resolveModulePath('@workflow/swc-plugin', {
|
|
17
|
-
from: [import.meta.url],
|
|
18
|
-
});
|
|
19
|
-
// Transform with SWC
|
|
20
|
-
const result = await transform(code, {
|
|
21
|
-
filename: id,
|
|
22
|
-
jsc: {
|
|
23
|
-
parser: {
|
|
24
|
-
syntax: isTypeScript ? 'typescript' : 'ecmascript',
|
|
25
|
-
tsx: isTsx,
|
|
26
|
-
},
|
|
27
|
-
target: 'es2022',
|
|
28
|
-
experimental: {
|
|
29
|
-
plugins: [[swcPlugin, { mode: 'client' }]],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
minify: false,
|
|
33
|
-
sourceMaps: true,
|
|
34
|
-
inlineSourcesContent: true,
|
|
35
|
-
});
|
|
36
|
-
return {
|
|
37
|
-
code: result.code,
|
|
38
|
-
map: result.map ? JSON.parse(result.map) : null,
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=rollup-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin.js","sourceRoot":"","sources":["../src/rollup-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAA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