@workflow/vite 4.0.0-beta.2 → 4.0.0-beta.3
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/hot-update.d.ts +3 -2
- package/dist/hot-update.d.ts.map +1 -1
- package/dist/hot-update.js +10 -4
- package/dist/hot-update.js.map +1 -1
- package/package.json +4 -2
package/dist/hot-update.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type BaseBuilder } from '@workflow/builders';
|
|
1
2
|
import type { Plugin } from 'vite';
|
|
2
|
-
import type { BaseBuilder } from '@workflow/builders';
|
|
3
3
|
interface WorkflowHotUpdatePluginOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Builder instance or a getter function.
|
|
@@ -16,7 +16,8 @@ interface WorkflowHotUpdatePluginOptions {
|
|
|
16
16
|
* Vite plugin that watches for workflow/step file changes and triggers rebuilds.
|
|
17
17
|
*
|
|
18
18
|
* This plugin detects changes to files containing `"use workflow"` or `"use step"`
|
|
19
|
-
* directives
|
|
19
|
+
* directives, or custom serialization patterns (`@workflow/serde` imports or
|
|
20
|
+
* `Symbol.for('workflow-serialize')`), and calls the builder to regenerate routes.
|
|
20
21
|
*/
|
|
21
22
|
export declare function workflowHotUpdatePlugin(options: WorkflowHotUpdatePluginOptions): Plugin;
|
|
22
23
|
export {};
|
package/dist/hot-update.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot-update.d.ts","sourceRoot":"","sources":["../src/hot-update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"hot-update.d.ts","sourceRoot":"","sources":["../src/hot-update.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,MAAM,CAAC;AAErD,UAAU,8BAA8B;IACtC;;;OAGG;IACH,OAAO,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,8BAA8B,GACtC,MAAM,CAuDR"}
|
package/dist/hot-update.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { detectWorkflowPatterns, isGeneratedWorkflowFile, } from '@workflow/builders';
|
|
1
2
|
/**
|
|
2
3
|
* Vite plugin that watches for workflow/step file changes and triggers rebuilds.
|
|
3
4
|
*
|
|
4
5
|
* This plugin detects changes to files containing `"use workflow"` or `"use step"`
|
|
5
|
-
* directives
|
|
6
|
+
* directives, or custom serialization patterns (`@workflow/serde` imports or
|
|
7
|
+
* `Symbol.for('workflow-serialize')`), and calls the builder to regenerate routes.
|
|
6
8
|
*/
|
|
7
9
|
export function workflowHotUpdatePlugin(options) {
|
|
8
10
|
const { builder, enqueue } = options;
|
|
@@ -23,6 +25,10 @@ export function workflowHotUpdatePlugin(options) {
|
|
|
23
25
|
if (!jsTsRegex.test(file)) {
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
28
|
+
// Skip generated workflow route files to avoid infinite rebuild loops
|
|
29
|
+
if (isGeneratedWorkflowFile(file)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
26
32
|
// Read the file to check for workflow/step directives
|
|
27
33
|
let content;
|
|
28
34
|
try {
|
|
@@ -34,9 +40,9 @@ export function workflowHotUpdatePlugin(options) {
|
|
|
34
40
|
await runBuild(() => resolvedBuilder.build());
|
|
35
41
|
return;
|
|
36
42
|
}
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
43
|
+
// Detect workflow patterns using shared utilities
|
|
44
|
+
const patterns = detectWorkflowPatterns(content);
|
|
45
|
+
if (!patterns.hasDirective && !patterns.hasSerde) {
|
|
40
46
|
return;
|
|
41
47
|
}
|
|
42
48
|
console.log('Workflow file changed, rebuilding...');
|
package/dist/hot-update.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot-update.js","sourceRoot":"","sources":["../src/hot-update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hot-update.js","sourceRoot":"","sources":["../src/hot-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAgB5B;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAErC,kDAAkD;IAClD,MAAM,QAAQ,GAAG,OAAO,IAAI,CAAC,CAAC,EAAuB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEhE,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,KAAK,CAAC,SAAS,CAAC,GAAqB;YACnC,sEAAsE;YACtE,MAAM,eAAe,GACnB,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAEtD,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,gDAAgD;gBAChD,OAAO;YACT,CAAC;YAED,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;YAE3B,uEAAuE;YACvE,MAAM,SAAS,GAAG,4BAA4B,CAAC;YAC/C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,OAAO;YACT,CAAC;YAED,sEAAsE;YACtE,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,OAAO;YACT,CAAC;YAED,sDAAsD;YACtD,IAAI,OAAe,CAAC;YACpB,IAAI,CAAC;gBACH,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;YACzB,CAAC;YAAC,MAAM,CAAC;gBACP,4EAA4E;gBAC5E,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;gBACpD,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC9C,OAAO;YACT,CAAC;YAED,kDAAkD;YAClD,MAAM,QAAQ,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAEjD,IAAI,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACjD,OAAO;YACT,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;YACpD,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;YAC9C,sDAAsD;YACtD,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow/vite",
|
|
3
3
|
"description": "Vite plugin for Workflow DevKit",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
"default": "./dist/index.js"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@workflow/builders": "4.0.1-beta.44"
|
|
27
|
+
},
|
|
25
28
|
"devDependencies": {
|
|
26
29
|
"@types/node": "22.19.0",
|
|
27
30
|
"vite": "7.1.12",
|
|
28
|
-
"@workflow/builders": "4.0.1-beta.24",
|
|
29
31
|
"@workflow/tsconfig": "4.0.1-beta.0"
|
|
30
32
|
},
|
|
31
33
|
"scripts": {
|