@workflow/nitro 4.0.1-beta.22 → 4.0.1-beta.24
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/vite.d.ts.map +1 -1
- package/dist/vite.js +8 -21
- package/dist/vite.js.map +1 -1
- package/package.json +5 -5
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,MAAM,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,MAAM,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKhD,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,EAAE,CA2F1D"}
|
package/dist/vite.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { LocalBuilder } from './builders.js';
|
|
2
2
|
import nitroModule from './index.js';
|
|
3
3
|
import { workflowTransformPlugin } from '@workflow/rollup';
|
|
4
|
+
import { createBuildQueue } from '@workflow/builders';
|
|
4
5
|
export function workflow(options) {
|
|
5
6
|
let builder;
|
|
7
|
+
const enqueue = createBuildQueue();
|
|
6
8
|
return [
|
|
7
9
|
workflowTransformPlugin(),
|
|
8
10
|
{
|
|
@@ -21,7 +23,7 @@ export function workflow(options) {
|
|
|
21
23
|
},
|
|
22
24
|
},
|
|
23
25
|
// NOTE: This is a workaround because Nitro passes the 404 requests to the dev server to handle.
|
|
24
|
-
//
|
|
26
|
+
// For workflow routes, we override to send an empty body to prevent Hono/Vite's SPA fallback.
|
|
25
27
|
configureServer(server) {
|
|
26
28
|
// Add middleware to intercept 404s on workflow routes before Vite's SPA fallback
|
|
27
29
|
return () => {
|
|
@@ -35,7 +37,7 @@ export function workflow(options) {
|
|
|
35
37
|
res.writeHead = function (...args) {
|
|
36
38
|
const statusCode = typeof args[0] === 'number' ? args[0] : 200;
|
|
37
39
|
// NOTE: Workaround because Nitro passes 404 requests to the vite to handle.
|
|
38
|
-
//
|
|
40
|
+
// Causes `webhook route with invalid token` test to fail.
|
|
39
41
|
// For 404s on workflow routes, ensure we're sending the right headers
|
|
40
42
|
if (statusCode === 404) {
|
|
41
43
|
// Set content-length to 0 to prevent Vite from overriding
|
|
@@ -50,7 +52,7 @@ export function workflow(options) {
|
|
|
50
52
|
},
|
|
51
53
|
// TODO: Move this to @workflow/vite or something since this is vite specific
|
|
52
54
|
async hotUpdate(options) {
|
|
53
|
-
const { file,
|
|
55
|
+
const { file, read } = options;
|
|
54
56
|
// Check if this is a TS/JS file that might contain workflow directives
|
|
55
57
|
const jsTsRegex = /\.(ts|tsx|js|jsx|mjs|cjs)$/;
|
|
56
58
|
if (!jsTsRegex.test(file)) {
|
|
@@ -63,15 +65,8 @@ export function workflow(options) {
|
|
|
63
65
|
}
|
|
64
66
|
catch {
|
|
65
67
|
// File might have been deleted - trigger rebuild to update generated routes
|
|
66
|
-
console.log('Workflow file
|
|
67
|
-
|
|
68
|
-
await builder.build();
|
|
69
|
-
}
|
|
70
|
-
// NOTE: Might be too aggressive
|
|
71
|
-
server.ws.send({
|
|
72
|
-
type: 'full-reload',
|
|
73
|
-
path: '*',
|
|
74
|
-
});
|
|
68
|
+
console.log('Workflow file changed, rebuilding...');
|
|
69
|
+
await enqueue(() => builder.build());
|
|
75
70
|
return;
|
|
76
71
|
}
|
|
77
72
|
const useWorkflowPattern = /^\s*(['"])use workflow\1;?\s*$/m;
|
|
@@ -80,16 +75,8 @@ export function workflow(options) {
|
|
|
80
75
|
!useStepPattern.test(content)) {
|
|
81
76
|
return;
|
|
82
77
|
}
|
|
83
|
-
// Trigger full reload - this will cause Nitro's dev:reload hook to fire,
|
|
84
|
-
// which will rebuild workflows and update routes
|
|
85
78
|
console.log('Workflow file changed, rebuilding...');
|
|
86
|
-
|
|
87
|
-
await builder.build();
|
|
88
|
-
}
|
|
89
|
-
server.ws.send({
|
|
90
|
-
type: 'full-reload',
|
|
91
|
-
path: '*',
|
|
92
|
-
});
|
|
79
|
+
await enqueue(() => builder.build());
|
|
93
80
|
// Let Vite handle the normal HMR for the changed file
|
|
94
81
|
return;
|
|
95
82
|
},
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,WAAW,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,WAAW,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,UAAU,QAAQ,CAAC,OAAuB;IAC9C,IAAI,OAAqB,CAAC;IAC1B,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IAEnC,OAAO;QACL,uBAAuB,EAAgB;QACvC;YACE,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE;gBACL,KAAK,EAAE,CAAC,KAAY,EAAE,EAAE;oBACtB,KAAK,CAAC,OAAO,CAAC,QAAQ,GAAG;wBACvB,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ;wBACzB,GAAG,OAAO;wBACV,KAAK,EAAE,IAAI;qBACZ,CAAC;oBACF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I,EAAE,GAAG,OAAO,CAAC;gBAE/B,uEAAuE;gBACvE,MAAM,SAAS,GAAG,4BAA4B,CAAC;gBAC/C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC1B,OAAO;gBACT,CAAC;gBAED,sDAAsD;gBACtD,IAAI,OAAe,CAAC;gBACpB,IAAI,CAAC;oBACH,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;gBACzB,CAAC;gBAAC,MAAM,CAAC;oBACP,4EAA4E;oBAC5E,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;oBACpD,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;oBACrC,OAAO;gBACT,CAAC;gBAED,MAAM,kBAAkB,GAAG,iCAAiC,CAAC;gBAC7D,MAAM,cAAc,GAAG,6BAA6B,CAAC;gBAErD,IACE,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC;oBACjC,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAC7B,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;gBACpD,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;gBACrC,sDAAsD;gBACtD,OAAO;YACT,CAAC;SACF;KACF,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.24",
|
|
4
4
|
"description": "Nitro integration for Workflow DevKit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@swc/core": "1.11.24",
|
|
25
25
|
"exsolve": "1.0.7",
|
|
26
26
|
"pathe": "2.0.3",
|
|
27
|
-
"@workflow/swc-plugin": "4.0.1-beta.
|
|
28
|
-
"@workflow/
|
|
29
|
-
"@workflow/
|
|
30
|
-
"@workflow/rollup": "4.0.0-beta.
|
|
27
|
+
"@workflow/swc-plugin": "4.0.1-beta.10",
|
|
28
|
+
"@workflow/builders": "4.0.1-beta.20",
|
|
29
|
+
"@workflow/core": "4.0.1-beta.21",
|
|
30
|
+
"@workflow/rollup": "4.0.0-beta.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "22.19.0",
|