Update to latest swc/core and preserve JSX (#507)

This commit is contained in:
JJ Kasper
2025-12-03 11:29:27 -08:00
committed by GitHub
parent 02c41cc963
commit ac7997b855
32 changed files with 353 additions and 394 deletions
+8
View File
@@ -0,0 +1,8 @@
---
"@workflow/swc-plugin": patch
"@workflow/builders": patch
"@workflow/astro": patch
"@workflow/next": patch
---
Update to latest swc/core and preserve JSX
+6
View File
@@ -331,6 +331,9 @@ jobs:
- name: Run Initial Build
run: pnpm turbo run build --filter='!./workbench/*'
- name: Resolve symlinks
run: ./scripts/resolve-symlinks.sh workbench/${{ matrix.app.name }}
- name: Run Build Tests
run: pnpm vitest run packages/core/e2e/local-build.test.ts
env:
@@ -412,6 +415,9 @@ jobs:
- name: Setup PostgreSQL Database
run: ./packages/world-postgres/bin/setup.js
- name: Resolve symlinks
run: ./scripts/resolve-symlinks.sh workbench/${{ matrix.app.name }}
- name: Run Build Tests
run: pnpm vitest run packages/core/e2e/local-build.test.ts
Generated
+133 -279
View File
@@ -44,12 +44,6 @@ version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
[[package]]
name = "arrayvec"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "ascii"
version = "1.1.0"
@@ -58,9 +52,9 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16"
[[package]]
name = "ast_node"
version = "3.0.3"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1e2cddd48eafd883890770673b1971faceaf80a185445671abc3ea0c00593ee"
checksum = "2eb025ef00a6da925cf40870b9c8d008526b6004ece399cb0974209720f0b194"
dependencies = [
"quote",
"swc_macros_common",
@@ -170,6 +164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c60b5ce37e0b883c37eb89f79a1e26fbe9c1081945d024eee93e8d91a7e18b3"
dependencies = [
"bytes",
"rkyv",
"serde",
]
@@ -228,6 +223,12 @@ dependencies = [
"rustversion",
]
[[package]]
name = "cbor4ii"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faed1a83001dc2c9201451030cc317e35bef36c84d3781d7c5bb9f343c397da8"
[[package]]
name = "cc"
version = "1.2.29"
@@ -435,9 +436,9 @@ dependencies = [
[[package]]
name = "from_variant"
version = "2.0.2"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308530a56b099da144ebc5d8e179f343ad928fa2b3558d1eb3db9af18d6eff43"
checksum = "e5ff35a391aef949120a0340d690269b3d9f63460a6106e99bd07b961f345ea9"
dependencies = [
"swc_macros_common",
"syn",
@@ -513,14 +514,15 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hstr"
version = "1.1.5"
version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "471a459fa7175711b0baa47d5f3a8109eec4567563f6f31f3c0f21d35663417c"
checksum = "0c43c0a9e8fbdb3bb9dc8eee85e1e2ac81605418b4c83b6b7413cbf14d56ca5c"
dependencies = [
"hashbrown 0.14.5",
"new_debug_unreachable",
"once_cell",
"rustc-hash",
"serde",
"triomphe",
]
@@ -723,11 +725,11 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
[[package]]
name = "matchers"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
dependencies = [
"regex-automata 0.1.10",
"regex-automata",
]
[[package]]
@@ -788,12 +790,11 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"overload",
"winapi",
"windows-sys 0.60.2",
]
[[package]]
@@ -847,12 +848,6 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e"
[[package]]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "owo-colors"
version = "4.2.2"
@@ -861,23 +856,13 @@ checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e"
[[package]]
name = "par-core"
version = "1.0.4"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484"
checksum = "e96cbd21255b7fb29a5d51ef38a779b517a91abd59e2756c039583f43ef4c90f"
dependencies = [
"once_cell",
]
[[package]]
name = "par-iter"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a"
dependencies = [
"either",
"par-core",
]
[[package]]
name = "parking_lot"
version = "0.12.4"
@@ -1074,17 +1059,8 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.4.9",
"regex-syntax 0.8.5",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
"regex-automata",
"regex-syntax",
]
[[package]]
@@ -1095,15 +1071,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.5",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.8.5"
@@ -1214,19 +1184,35 @@ dependencies = [
]
[[package]]
name = "serde"
version = "1.0.219"
name = "seq-macro"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
[[package]]
name = "serde"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
@@ -1306,24 +1292,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "sourcemap"
version = "9.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935"
dependencies = [
"base64-simd",
"bitvec",
"data-encoding",
"debugid",
"if_chain",
"rustc-hash",
"serde",
"serde_json",
"unicode-id-start",
"url",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
@@ -1380,101 +1348,60 @@ dependencies = [
[[package]]
name = "swc_atoms"
version = "5.0.0"
version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d7077ba879f95406459bc0c81f3141c529b34580bc64d7ab7bd15e7118a0391"
checksum = "d4ccbe2ecad10ad7432100f878a107b1d972a8aee83ca53184d00c23a078bb8a"
dependencies = [
"bytecheck",
"cbor4ii",
"hstr",
"once_cell",
"rancor",
"rkyv",
"rustc-hash",
"serde",
]
[[package]]
name = "swc_atoms"
version = "6.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fda66fe4175cddc27a79643ded7ce297b6b2bf133f038ec5907fb4673e4b2ba"
dependencies = [
"hstr",
"once_cell",
"serde",
]
[[package]]
name = "swc_common"
version = "11.1.3"
version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44c332906667b0fa98622f19a19e43afa5aa63b652813f80645dd0f33eca1fbb"
checksum = "cd86b909e39cba2b3d9ab898d3fb3a912e3b9b809919394fca6fbf1ab970a8b8"
dependencies = [
"anyhow",
"ast_node",
"better_scoped_tls",
"bytecheck",
"cfg-if",
"either",
"from_variant",
"new_debug_unreachable",
"num-bigint",
"once_cell",
"parking_lot",
"rancor",
"rkyv",
"rustc-hash",
"serde",
"siphasher 0.3.11",
"sourcemap",
"swc_allocator",
"swc_atoms 5.0.0",
"swc_eq_ignore_macros",
"swc_visit",
"termcolor",
"tracing",
"unicode-width 0.1.14",
"url",
]
[[package]]
name = "swc_common"
version = "13.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e103c3a47a343a175e9f65603122c5d3c8ec007776b00a4a4bc368a1347c4770"
dependencies = [
"anyhow",
"ast_node",
"better_scoped_tls",
"bytes-str",
"cbor4ii",
"either",
"from_variant",
"new_debug_unreachable",
"num-bigint",
"once_cell",
"parking_lot",
"rancor",
"rkyv",
"rustc-hash",
"serde",
"siphasher 0.3.11",
"swc_atoms 6.0.1",
"swc_atoms",
"swc_eq_ignore_macros",
"swc_sourcemap",
"swc_visit",
"termcolor",
"tracing",
"unicode-width 0.1.14",
"unicode-width 0.2.1",
"url",
]
[[package]]
name = "swc_core"
version = "26.4.5"
version = "49.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "083af217e9715a7c1b020f7c9e71e4961285adb0333ee3f0e5e92962a0494a11"
checksum = "fabc14ac43dcd236bd2c2d9e20b498ce348005976a18df883f4384b9c0d50324"
dependencies = [
"once_cell",
"swc_allocator",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms_base",
"swc_ecma_transforms_testing",
@@ -1488,32 +1415,29 @@ dependencies = [
[[package]]
name = "swc_ecma_ast"
version = "11.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2313360a518a37c4b9ee50030d189222927a3af902903cc70c50f6929e402dc"
checksum = "724195600825cbdd2a899d5473d2ce1f24ae418bff1231f160ecf38a3bc81f46"
dependencies = [
"bitflags",
"bytecheck",
"cbor4ii",
"is-macro",
"num-bigint",
"once_cell",
"phf",
"rancor",
"rkyv",
"rustc-hash",
"scoped-tls",
"string_enum",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_visit",
"unicode-id-start",
]
[[package]]
name = "swc_ecma_codegen"
version = "13.2.0"
version = "21.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "005b9e6e4cdd15c4c437d6662e4fc6dc93f60bd1c5159a1afcf6cd9eea6fb24f"
checksum = "5c77d9d21345ca986ae3b5ff1a4fa3607b15b07ed397506e6dba32e867cf40fd"
dependencies = [
"ascii",
"compact_str",
@@ -1524,12 +1448,12 @@ dependencies = [
"rustc-hash",
"ryu-js",
"serde",
"sourcemap",
"swc_allocator",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen_macros",
"swc_sourcemap",
"tracing",
]
@@ -1544,87 +1468,55 @@ dependencies = [
"syn",
]
[[package]]
name = "swc_ecma_lexer"
version = "14.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb339d30ba6ee93da5d5638982faaa79586cd429fe331648abf42afa0eb0a7b5"
dependencies = [
"arrayvec",
"bitflags",
"either",
"new_debug_unreachable",
"num-bigint",
"num-traits",
"phf",
"rustc-hash",
"serde",
"smallvec",
"smartstring",
"stacker",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_ecma_ast",
"tracing",
"typed-arena",
]
[[package]]
name = "swc_ecma_parser"
version = "14.0.2"
version = "28.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60e07e6ecd47f748988902976d09c4022b1147772f88ad8a95852a20722ac7dc"
checksum = "495a29bd31c957a2116096a741bc6f4289c49de568706987c29452e0f8f6423c"
dependencies = [
"arrayvec",
"bitflags",
"either",
"new_debug_unreachable",
"num-bigint",
"num-traits",
"phf",
"rustc-hash",
"seq-macro",
"serde",
"smallvec",
"smartstring",
"stacker",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_lexer",
"tracing",
"typed-arena",
]
[[package]]
name = "swc_ecma_testing"
version = "12.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfca232a0a2e743c963185665bc6fb6f92b1422449aba17ccd836ff4aa02858d"
checksum = "177244625cdecd268a07534c3b087f7f263604dd40f3ec7c7a984ca95351b632"
dependencies = [
"anyhow",
"hex",
"sha2",
"testing 12.0.0",
"testing",
"tracing",
]
[[package]]
name = "swc_ecma_transforms_base"
version = "15.1.1"
version = "31.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49c0a76bff24b9fa13d5451e7a664d18158849c45434d863e0553e29fb31170b"
checksum = "f1d0e41bca41880f745c3538b3c35c81127d487cdbeb5ee5ab004f2bff741dba"
dependencies = [
"better_scoped_tls",
"bitflags",
"indexmap",
"once_cell",
"par-core",
"phf",
"rustc-hash",
"serde",
"smallvec",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_utils",
@@ -1634,9 +1526,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_testing"
version = "18.0.0"
version = "34.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "297e4f7638cfc0d6088ad637ec717b9ffbf7555a913963344cd1f3ce2864a660"
checksum = "07e8b8c1c3fc4725650be710f55cba111303a3b9b586b213c98e4064b3654462"
dependencies = [
"ansi_term",
"anyhow",
@@ -1645,9 +1537,7 @@ dependencies = [
"serde",
"serde_json",
"sha2",
"sourcemap",
"swc_allocator",
"swc_common 11.1.3",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_parser",
@@ -1655,41 +1545,40 @@ dependencies = [
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_sourcemap",
"tempfile",
"testing 12.0.0",
"testing",
]
[[package]]
name = "swc_ecma_utils"
version = "15.0.2"
version = "25.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d2c29dbfc54e02c14975aff9d2c75ae6fff0808d860d9971a493d37870e282f"
checksum = "2dd5ee449d21110a271e73d0a9f7640a8854a62cb0e2cb0c9db3445383598e21"
dependencies = [
"indexmap",
"num_cpus",
"once_cell",
"par-core",
"par-iter",
"rustc-hash",
"ryu-js",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
"tracing",
"unicode-id",
]
[[package]]
name = "swc_ecma_visit"
version = "11.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8227d1d2d76a9ccfd190ec06bb4a4720bf3edb9f954c69816b2bca5f5aa43887"
checksum = "a69d63f7f704a2ec937edef90a3eba1f64602eceb60c8deb260c01131f680e8b"
dependencies = [
"new_debug_unreachable",
"num-bigint",
"swc_atoms 5.0.0",
"swc_common 11.1.3",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_visit",
"tracing",
@@ -1708,31 +1597,15 @@ dependencies = [
[[package]]
name = "swc_error_reporters"
version = "13.0.0"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "572075b92eef780f9a13b99abcb4fbf8e6272abeed27b361632b5e3a2e8de70d"
dependencies = [
"anyhow",
"miette",
"once_cell",
"parking_lot",
"serde",
"serde_derive",
"serde_json",
"swc_common 11.1.3",
]
[[package]]
name = "swc_error_reporters"
version = "15.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09b8bad18498e57f0f904e846b270af576bbfb7b583f1ee00bdeebe46748eb01"
checksum = "bbbc236f3f44337cbc13f49c7e25e92082e59279c268cbd928c3568f339d3fe0"
dependencies = [
"anyhow",
"miette",
"once_cell",
"serde",
"swc_common 13.0.4",
"swc_common",
]
[[package]]
@@ -1768,16 +1641,14 @@ dependencies = [
[[package]]
name = "swc_plugin_proxy"
version = "11.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab1281343dca1fe02aa027e2dfdf77067e62506e77b651e3e9c1a4e3fa8bccf6"
checksum = "8f976dc63cd8b1916f265ee7d2647c28a85b433640099a5bf07153346dedffda"
dependencies = [
"better_scoped_tls",
"bytecheck",
"rancor",
"rkyv",
"cbor4ii",
"rustc-hash",
"swc_common 11.1.3",
"swc_common",
"swc_ecma_ast",
"swc_trace_macro",
"tracing",
@@ -1793,6 +1664,25 @@ dependencies = [
"swc_workflow",
]
[[package]]
name = "swc_sourcemap"
version = "9.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de08ef00f816acdd1a58ee8a81c0e1a59eefef2093aefe5611f256fa6b64c4d7"
dependencies = [
"base64-simd",
"bitvec",
"bytes-str",
"data-encoding",
"debugid",
"if_chain",
"rustc-hash",
"serde",
"serde_json",
"unicode-id-start",
"url",
]
[[package]]
name = "swc_trace_macro"
version = "2.0.2"
@@ -1805,16 +1695,14 @@ dependencies = [
[[package]]
name = "swc_transform_common"
version = "5.0.0"
version = "12.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be97f7341c59045d8ecbd5579acad8063e545d10304db086846b9dcf985c56e"
checksum = "6cc4a0e2aa9fac44d383127e01327710416dda5b637b0d134b7b8cf2ba6bde8e"
dependencies = [
"better_scoped_tls",
"once_cell",
"rustc-hash",
"serde",
"serde_json",
"swc_common 11.1.3",
"swc_common",
]
[[package]]
@@ -1834,7 +1722,7 @@ dependencies = [
"serde",
"serde_json",
"swc_core",
"testing 14.0.1",
"testing",
]
[[package]]
@@ -1889,31 +1777,9 @@ dependencies = [
[[package]]
name = "testing"
version = "12.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4afa5efbee09e27d4fa6f7d3278e351ab1feaf8d253eea84bc69975fb6da418e"
dependencies = [
"ansi_term",
"cargo_metadata 0.18.1",
"difference",
"once_cell",
"pretty_assertions",
"regex",
"rustc-hash",
"serde",
"serde_json",
"swc_common 11.1.3",
"swc_error_reporters 13.0.0",
"testing_macros",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "testing"
version = "14.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec446acef3673f1e8cc5674e70b5ed30f248495fe2cdb4aa556e4d3ab64da3e2"
checksum = "ad1506c602222ebab5d96100180f8d3c015b2394eceb00a46d20c25b8b1e5100"
dependencies = [
"cargo_metadata 0.18.1",
"difference",
@@ -1923,8 +1789,8 @@ dependencies = [
"rustc-hash",
"serde",
"serde_json",
"swc_common 13.0.4",
"swc_error_reporters 15.0.1",
"swc_common",
"swc_error_reporters",
"testing_macros",
"tracing",
"tracing-subscriber",
@@ -2075,14 +1941,14 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
version = "0.3.19"
version = "0.3.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
dependencies = [
"matchers",
"nu-ansi-term",
"once_cell",
"regex",
"regex-automata",
"sharded-slab",
"smallvec",
"thread_local",
@@ -2101,24 +1967,12 @@ dependencies = [
"stable_deref_trait",
]
[[package]]
name = "typed-arena"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
[[package]]
name = "typenum"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
[[package]]
name = "unicode-id"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10103c57044730945224467c09f71a4db0071c123a0648cc3e818913bde6b561"
[[package]]
name = "unicode-id-start"
version = "1.3.1"
+2 -2
View File
@@ -14,8 +14,8 @@ rust-version = "1.87"
[workspace.dependencies]
serde = "1"
serde_json = "1"
swc_core = "26"
testing = "14.0.1"
swc_core = "49.0"
testing = "19.0"
[profile.release]
+1 -1
View File
@@ -25,7 +25,7 @@
"clean": "tsc --build --clean && rm -rf dist"
},
"dependencies": {
"@swc/core": "1.11.24",
"@swc/core": "1.15.3",
"@workflow/builders": "workspace:*",
"@workflow/swc-plugin": "workspace:*",
"@workflow/rollup": "workspace:*",
+16 -3
View File
@@ -35,7 +35,6 @@ export async function applySwcTransform(
}> {
// Determine if this is a TypeScript file
const isTypeScript = filename.endsWith('.ts') || filename.endsWith('.tsx');
const isTsx = filename.endsWith('.tsx');
// Transform with SWC to support syntax esbuild doesn't
const result = await transform(source, {
@@ -43,8 +42,15 @@ export async function applySwcTransform(
swcrc: false,
jsc: {
parser: {
syntax: isTypeScript ? 'typescript' : 'ecmascript',
tsx: isTsx,
...(isTypeScript
? {
syntax: 'typescript',
tsx: filename.endsWith('.tsx'),
}
: {
syntax: 'ecmascript',
jsx: filename.endsWith('.jsx'),
}),
},
target: 'es2022',
experimental: mode
@@ -52,7 +58,14 @@ export async function applySwcTransform(
plugins: [[require.resolve('@workflow/swc-plugin'), { mode }]],
}
: undefined,
...jscConfig,
transform: {
react: {
runtime: 'preserve',
},
},
},
// TODO: investigate proper source map support as they
// won't even be used in Node.js by default unless we
+3
View File
@@ -365,6 +365,7 @@ export abstract class BaseBuilder {
treeShaking: true,
keepNames: true,
minify: false,
jsx: 'preserve',
resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],
// TODO: investigate proper source map support
sourcemap: EMIT_SOURCEMAPS_FOR_DEBUGGING,
@@ -674,6 +675,7 @@ export const POST = workflowEntrypoint(workflowCode);`;
bundle: true,
format: 'esm',
platform: 'node',
jsx: 'preserve',
target: 'es2022',
write: true,
treeShaking: true,
@@ -757,6 +759,7 @@ export const OPTIONS = handler;`;
outfile,
absWorkingDir: this.config.workingDir,
bundle: true,
jsx: 'preserve',
format: 'cjs',
platform: 'node',
conditions: ['import', 'module', 'node', 'default'],
+4 -5
View File
@@ -129,14 +129,13 @@ export function createSwcPlugin(options: SwcPluginOptions): Plugin {
// Handle TypeScript and JavaScript files
build.onLoad({ filter: jsTsRegex }, async (args) => {
// Determine if this is a TypeScript file
const isTypeScript =
args.path.endsWith('.ts') || args.path.endsWith('.tsx');
try {
// Determine the loader based on the output
let loader: 'js' | 'jsx' = 'js';
if (!isTypeScript && args.path.endsWith('.jsx')) {
let loader: 'js' | 'jsx' | 'tsx' = 'js';
if (args.path.endsWith('.jsx')) {
loader = 'jsx';
} else if (args.path.endsWith('.tsx')) {
loader = 'tsx';
}
const source = await readFile(args.path, 'utf8');
+22
View File
@@ -110,6 +110,28 @@ describe('e2e', () => {
]);
});
const isNext = process.env.APP_NAME?.includes('nextjs');
const isLocal = deploymentUrl.includes('localhost');
// only works with framework that transpiles react and
// doesn't work on Vercel due to eval hack so react isn't
// bundled in function
const shouldSkipReactRenderTest = !(isNext && isLocal);
test.skipIf(shouldSkipReactRenderTest)(
'should work with react rendering in step',
async () => {
const run = await triggerWorkflow(
{
workflowFile: 'workflows/8_react_render.tsx',
workflowFn: 'reactWorkflow',
},
[]
);
const returnValue = await getWorkflowReturnValue(run.runId);
expect(returnValue).toBe('<div>hello world <!-- -->2</div>');
}
);
test('promiseAllWorkflow', { timeout: 60_000 }, async () => {
const run = await triggerWorkflow('promiseAllWorkflow', []);
const returnValue = await getWorkflowReturnValue(run.runId);
+14 -3
View File
@@ -19,7 +19,6 @@ export default async function workflowLoader(
}
const isTypeScript = filename.endsWith('.ts') || filename.endsWith('.tsx');
const isTsx = filename.endsWith('.tsx');
// Calculate relative filename for SWC plugin
// The SWC plugin uses filename to generate workflowId, so it must be relative
@@ -65,8 +64,15 @@ export default async function workflowLoader(
filename: relativeFilename,
jsc: {
parser: {
syntax: isTypeScript ? 'typescript' : 'ecmascript',
tsx: isTsx,
...(isTypeScript
? {
syntax: 'typescript',
tsx: filename.endsWith('.tsx'),
}
: {
syntax: 'ecmascript',
jsx: filename.endsWith('.jsx'),
}),
},
target: 'es2022',
experimental: {
@@ -74,6 +80,11 @@ export default async function workflowLoader(
[require.resolve('@workflow/swc-plugin'), { mode: 'client' }],
],
},
transform: {
react: {
runtime: 'preserve',
},
},
},
minify: false,
inputSourceMap: sourceMap,
+14 -3
View File
@@ -15,7 +15,6 @@ export function workflowTransformPlugin(): Plugin {
}
const isTypeScript = id.endsWith('.ts') || id.endsWith('.tsx');
const isTsx = id.endsWith('.tsx');
const swcPlugin = resolveModulePath('@workflow/swc-plugin', {
from: [import.meta.url],
@@ -65,13 +64,25 @@ export function workflowTransformPlugin(): Plugin {
filename: relativeFilename,
jsc: {
parser: {
syntax: isTypeScript ? 'typescript' : 'ecmascript',
tsx: isTsx,
...(isTypeScript
? {
syntax: 'typescript',
tsx: id.endsWith('.tsx'),
}
: {
syntax: 'ecmascript',
jsx: id.endsWith('.jsx'),
}),
},
target: 'es2022',
experimental: {
plugins: [[swcPlugin, { mode: 'client' }]],
},
transform: {
react: {
runtime: 'preserve',
},
},
},
minify: false,
sourceMaps: true,
@@ -1254,7 +1254,7 @@ impl StepTransform {
// Get the property key first
let prop_key = match &kv_prop.key {
PropName::Ident(ident) => ident.sym.to_string(),
PropName::Str(s) => s.value.to_string(),
PropName::Str(s) => s.value.to_string_lossy().to_string(),
_ => continue, // Skip complex keys
};
@@ -1375,7 +1375,7 @@ impl StepTransform {
// Handle object methods like: execute() { "use step"; ... }
let prop_key = match &method_prop.key {
PropName::Ident(ident) => ident.sym.to_string(),
PropName::Str(s) => s.value.to_string(),
PropName::Str(s) => s.value.to_string_lossy().to_string(),
_ => continue, // Skip complex keys
};
@@ -1666,15 +1666,15 @@ impl StepTransform {
if !is_first_meaningful {
emit_error(WorkflowErrorKind::MisplacedDirective {
span: *stmt_span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
location: DirectiveLocation::FunctionBody,
});
}
return true;
} else if detect_similar_strings(value, "use step") {
} else if detect_similar_strings(&value.to_string_lossy().to_string(), "use step") {
emit_error(WorkflowErrorKind::MisspelledDirective {
span: *stmt_span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
expected: "use step",
});
}
@@ -1704,20 +1704,20 @@ impl StepTransform {
{
if let Expr::Lit(Lit::Str(Str { value, .. })) = &**expr {
#[cfg(debug_assertions)]
eprintln!("directive candidate: {}", value);
eprintln!("directive candidate: {:?}", value);
if value == "use workflow" {
if !is_first_meaningful {
emit_error(WorkflowErrorKind::MisplacedDirective {
span: *stmt_span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
location: DirectiveLocation::FunctionBody,
});
}
return true;
} else if detect_similar_strings(value, "use workflow") {
} else if detect_similar_strings(&value.to_string_lossy().to_string(), "use workflow") {
emit_error(WorkflowErrorKind::MisspelledDirective {
span: *stmt_span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
expected: "use workflow",
});
}
@@ -1746,7 +1746,7 @@ impl StepTransform {
if !is_first_meaningful {
emit_error(WorkflowErrorKind::MisplacedDirective {
span: *span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
location: DirectiveLocation::Module,
});
} else {
@@ -1758,14 +1758,14 @@ impl StepTransform {
if found_directive {
emit_error(WorkflowErrorKind::MisplacedDirective {
span: *span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
location: DirectiveLocation::Module,
});
}
} else if detect_similar_strings(value, "use step") {
} else if detect_similar_strings(&value.to_string_lossy().to_string(), "use step") {
emit_error(WorkflowErrorKind::MisspelledDirective {
span: *span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
expected: "use step",
});
}
@@ -1807,7 +1807,7 @@ impl StepTransform {
if !is_first_meaningful {
emit_error(WorkflowErrorKind::MisplacedDirective {
span: *span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
location: DirectiveLocation::Module,
});
} else {
@@ -1819,14 +1819,14 @@ impl StepTransform {
if found_directive {
emit_error(WorkflowErrorKind::MisplacedDirective {
span: *span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
location: DirectiveLocation::Module,
});
}
} else if detect_similar_strings(value, "use workflow") {
} else if detect_similar_strings(&value.to_string_lossy().to_string(), "use workflow") {
emit_error(WorkflowErrorKind::MisspelledDirective {
span: *span,
directive: value.to_string(),
directive: value.to_string_lossy().to_string(),
expected: "use workflow",
});
}
@@ -6066,12 +6066,12 @@ impl VisitMut for StepTransform {
let prop_key = match &**boxed_prop {
Prop::KeyValue(kv) => match &kv.key {
PropName::Ident(ident) => Some(ident.sym.to_string()),
PropName::Str(s) => Some(s.value.to_string()),
PropName::Str(s) => Some(s.value.to_string_lossy().to_string()),
_ => None,
},
Prop::Method(m) => match &m.key {
PropName::Ident(ident) => Some(ident.sym.to_string()),
PropName::Str(s) => Some(s.value.to_string()),
PropName::Str(s) => Some(s.value.to_string_lossy().to_string()),
_ => None,
},
_ => None,
@@ -1,5 +1,5 @@
// Error: Can't have both directives in the same file
/**__internal_workflows{"steps":{"input.js":{"test":{"stepId":"step//input.js//test"}}}}*/;
// Error: Can't have both directives in the same file
'use step';
'use workflow';
export var test = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//test");
@@ -1,5 +1,5 @@
// Error: sync function with use step
/**__internal_workflows{"workflows":{"input.js":{"validWorkflow":{"workflowId":"workflow//input.js//validWorkflow"}}},"steps":{"input.js":{"validStep":{"stepId":"step//input.js//validStep"}}}}*/;
// Error: sync function with use step
export function syncStep() {
'use step';
return 42;
@@ -1,6 +1,6 @@
// Error: sync function with use step
import { registerStepFunction } from "workflow/internal/private";
/**__internal_workflows{"workflows":{"input.js":{"validWorkflow":{"workflowId":"workflow//input.js//validWorkflow"}}},"steps":{"input.js":{"validStep":{"stepId":"step//input.js//validStep"}}}}*/;
// Error: sync function with use step
export function syncStep() {
'use step';
return 42;
@@ -1,5 +1,5 @@
// Error: sync function with use step
/**__internal_workflows{"workflows":{"input.js":{"validWorkflow":{"workflowId":"workflow//input.js//validWorkflow"}}},"steps":{"input.js":{"validStep":{"stepId":"step//input.js//validStep"}}}}*/;
// Error: sync function with use step
export function syncStep() {
'use step';
return 42;
@@ -1,6 +1,6 @@
/**__internal_workflows{"workflows":{"input.js":{"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
// Test case for functions used in default parameter values
// The createDefaultDownloadFunction should NOT be removed by DCE
/**__internal_workflows{"workflows":{"input.js":{"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
const createDefaultDownloadFunction = (download = defaultDownload)=>(requestedDownloads)=>Promise.all(requestedDownloads.map(async (r)=>r.isUrlSupportedByModel ? null : download(r)));
async function defaultDownload(request) {
return fetch(request.url);
@@ -1,6 +1,6 @@
/**__internal_workflows{"workflows":{"input.js":{"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
// Test case for functions used in default parameter values
// The createDefaultDownloadFunction should NOT be removed by DCE
/**__internal_workflows{"workflows":{"input.js":{"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
const createDefaultDownloadFunction = (download = defaultDownload)=>(requestedDownloads)=>Promise.all(requestedDownloads.map(async (r)=>r.isUrlSupportedByModel ? null : download(r)));
async function defaultDownload(request) {
return fetch(request.url);
@@ -1,5 +1,5 @@
// Existing variable named __default
/**__internal_workflows{"workflows":{"input.js":{"default":{"workflowId":"workflow//input.js//default"}}}}*/;
// Existing variable named __default
const __default = "existing variable";
// Use it to avoid unused variable
console.log(__default);
@@ -1,5 +1,5 @@
// Existing variable named __default
/**__internal_workflows{"workflows":{"input.js":{"default":{"workflowId":"workflow//input.js//default"}}}}*/;
// Existing variable named __default
const __default = "existing variable";
// Use it to avoid unused variable
console.log(__default);
@@ -1,5 +1,5 @@
// Existing variable named __default
/**__internal_workflows{"workflows":{"input.js":{"default":{"workflowId":"workflow//input.js//default"}}}}*/;
// Existing variable named __default
const __default = "existing variable";
// Use it to avoid unused variable
console.log(__default);
@@ -1,6 +1,6 @@
/**__internal_workflows{"workflows":{"input.js":{"__default":{"workflowId":"workflow//input.js//__default"}}}}*/;
// User explicitly names their workflow function __default
// The workflow ID should use "__default", not normalize to "default"
/**__internal_workflows{"workflows":{"input.js":{"__default":{"workflowId":"workflow//input.js//__default"}}}}*/;
export async function __default() {
throw new Error("You attempted to execute workflow __default function directly. To start a workflow, use start(__default) from workflow/api");
}
@@ -1,6 +1,6 @@
/**__internal_workflows{"workflows":{"input.js":{"__default":{"workflowId":"workflow//input.js//__default"}}}}*/;
// User explicitly names their workflow function __default
// The workflow ID should use "__default", not normalize to "default"
/**__internal_workflows{"workflows":{"input.js":{"__default":{"workflowId":"workflow//input.js//__default"}}}}*/;
export async function __default() {
throw new Error("You attempted to execute workflow __default function directly. To start a workflow, use start(__default) from workflow/api");
}
@@ -1,6 +1,6 @@
/**__internal_workflows{"workflows":{"input.js":{"__default":{"workflowId":"workflow//input.js//__default"}}}}*/;
// User explicitly names their workflow function __default
// The workflow ID should use "__default", not normalize to "default"
/**__internal_workflows{"workflows":{"input.js":{"__default":{"workflowId":"workflow//input.js//__default"}}}}*/;
export async function __default() {
const result = await someStep();
return result;
@@ -1,5 +1,5 @@
// Test workflow functions in client mode
/**__internal_workflows{"workflows":{"input.js":{"arrowWorkflow":{"workflowId":"workflow//input.js//arrowWorkflow"},"default":{"workflowId":"workflow//input.js//defaultWorkflow"},"internalWorkflow":{"workflowId":"workflow//input.js//internalWorkflow"},"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
// Test workflow functions in client mode
export async function myWorkflow() {
throw new Error("You attempted to execute workflow myWorkflow function directly. To start a workflow, use start(myWorkflow) from workflow/api");
}
@@ -1,5 +1,5 @@
// Test workflow functions in client mode
/**__internal_workflows{"workflows":{"input.js":{"arrowWorkflow":{"workflowId":"workflow//input.js//arrowWorkflow"},"default":{"workflowId":"workflow//input.js//defaultWorkflow"},"internalWorkflow":{"workflowId":"workflow//input.js//internalWorkflow"},"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
// Test workflow functions in client mode
export async function myWorkflow() {
throw new Error("You attempted to execute workflow myWorkflow function directly. To start a workflow, use start(myWorkflow) from workflow/api");
}
@@ -1,5 +1,5 @@
// Test workflow functions in client mode
/**__internal_workflows{"workflows":{"input.js":{"arrowWorkflow":{"workflowId":"workflow//input.js//arrowWorkflow"},"default":{"workflowId":"workflow//input.js//defaultWorkflow"},"internalWorkflow":{"workflowId":"workflow//input.js//internalWorkflow"},"myWorkflow":{"workflowId":"workflow//input.js//myWorkflow"}}}}*/;
// Test workflow functions in client mode
export async function myWorkflow() {
const result = await someStep();
return result;
+59 -59
View File
@@ -10,8 +10,8 @@ catalogs:
specifier: ^2.2.7
version: 2.3.3
'@swc/core':
specifier: 1.11.24
version: 1.11.24
specifier: 1.15.3
version: 1.15.3
'@types/node':
specifier: 22.19.0
version: 22.19.0
@@ -335,8 +335,8 @@ importers:
packages/astro:
dependencies:
'@swc/core':
specifier: 1.11.24
version: 1.11.24
specifier: 1.15.3
version: 1.15.3
'@workflow/builders':
specifier: workspace:*
version: link:../builders
@@ -367,7 +367,7 @@ importers:
dependencies:
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@workflow/core':
specifier: workspace:*
version: link:../core
@@ -416,7 +416,7 @@ importers:
version: 6.2.31(typescript@5.9.3)
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@workflow/builders':
specifier: workspace:*
version: link:../builders
@@ -599,7 +599,7 @@ importers:
dependencies:
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@workflow/builders':
specifier: workspace:*
version: link:../builders
@@ -636,7 +636,7 @@ importers:
dependencies:
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@workflow/builders':
specifier: workspace:*
version: link:../builders
@@ -698,7 +698,7 @@ importers:
dependencies:
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@workflow/swc-plugin':
specifier: workspace:*
version: link:../swc-plugin-workflow
@@ -720,7 +720,7 @@ importers:
dependencies:
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@workflow/builders':
specifier: workspace:*
version: link:../builders
@@ -757,7 +757,7 @@ importers:
dependencies:
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
packages/tsconfig: {}
@@ -1657,7 +1657,7 @@ importers:
version: 6.1.1(@sveltejs/kit@2.48.4(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.43.3)(vite@7.1.12(@types/node@24.6.2)(jiti@2.6.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)))(svelte@5.43.3)(vite@7.1.12(@types/node@24.6.2)(jiti@2.6.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)))(rollup@4.53.2)
'@swc/core':
specifier: 'catalog:'
version: 1.11.24
version: 1.15.3
'@vercel/otel':
specifier: ^1.13.0
version: 1.13.0(@opentelemetry/api-logs@0.57.2)(@opentelemetry/api@1.9.0)(@opentelemetry/instrumentation@0.57.2(@opentelemetry/api@1.9.0))(@opentelemetry/resources@1.30.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-logs@0.57.2(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-metrics@1.30.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@1.30.1(@opentelemetry/api@1.9.0))
@@ -5966,68 +5966,68 @@ packages:
'@svta/common-media-library@0.12.4':
resolution: {integrity: sha512-9EuOoaNmz7JrfGwjsrD9SxF9otU5TNMnbLu1yU4BeLK0W5cDxVXXR58Z89q9u2AnHjIctscjMTYdlqQ1gojTuw==}
'@swc/core-darwin-arm64@1.11.24':
resolution: {integrity: sha512-dhtVj0PC1APOF4fl5qT2neGjRLgHAAYfiVP8poJelhzhB/318bO+QCFWAiimcDoyMgpCXOhTp757gnoJJrheWA==}
'@swc/core-darwin-arm64@1.15.3':
resolution: {integrity: sha512-AXfeQn0CvcQ4cndlIshETx6jrAM45oeUrK8YeEY6oUZU/qzz0Id0CyvlEywxkWVC81Ajpd8TQQ1fW5yx6zQWkQ==}
engines: {node: '>=10'}
cpu: [arm64]
os: [darwin]
'@swc/core-darwin-x64@1.11.24':
resolution: {integrity: sha512-H/3cPs8uxcj2Fe3SoLlofN5JG6Ny5bl8DuZ6Yc2wr7gQFBmyBkbZEz+sPVgsID7IXuz7vTP95kMm1VL74SO5AQ==}
'@swc/core-darwin-x64@1.15.3':
resolution: {integrity: sha512-p68OeCz1ui+MZYG4wmfJGvcsAcFYb6Sl25H9TxWl+GkBgmNimIiRdnypK9nBGlqMZAcxngNPtnG3kEMNnvoJ2A==}
engines: {node: '>=10'}
cpu: [x64]
os: [darwin]
'@swc/core-linux-arm-gnueabihf@1.11.24':
resolution: {integrity: sha512-PHJgWEpCsLo/NGj+A2lXZ2mgGjsr96ULNW3+T3Bj2KTc8XtMUkE8tmY2Da20ItZOvPNC/69KroU7edyo1Flfbw==}
'@swc/core-linux-arm-gnueabihf@1.15.3':
resolution: {integrity: sha512-Nuj5iF4JteFgwrai97mUX+xUOl+rQRHqTvnvHMATL/l9xE6/TJfPBpd3hk/PVpClMXG3Uvk1MxUFOEzM1JrMYg==}
engines: {node: '>=10'}
cpu: [arm]
os: [linux]
'@swc/core-linux-arm64-gnu@1.11.24':
resolution: {integrity: sha512-C2FJb08+n5SD4CYWCTZx1uR88BN41ZieoHvI8A55hfVf2woT8+6ZiBzt74qW2g+ntZ535Jts5VwXAKdu41HpBg==}
'@swc/core-linux-arm64-gnu@1.15.3':
resolution: {integrity: sha512-2Nc/s8jE6mW2EjXWxO/lyQuLKShcmTrym2LRf5Ayp3ICEMX6HwFqB1EzDhwoMa2DcUgmnZIalesq2lG3krrUNw==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
'@swc/core-linux-arm64-musl@1.11.24':
resolution: {integrity: sha512-ypXLIdszRo0re7PNNaXN0+2lD454G8l9LPK/rbfRXnhLWDBPURxzKlLlU/YGd2zP98wPcVooMmegRSNOKfvErw==}
'@swc/core-linux-arm64-musl@1.15.3':
resolution: {integrity: sha512-j4SJniZ/qaZ5g8op+p1G9K1z22s/EYGg1UXIb3+Cg4nsxEpF5uSIGEE4mHUfA70L0BR9wKT2QF/zv3vkhfpX4g==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
'@swc/core-linux-x64-gnu@1.11.24':
resolution: {integrity: sha512-IM7d+STVZD48zxcgo69L0yYptfhaaE9cMZ+9OoMxirNafhKKXwoZuufol1+alEFKc+Wbwp+aUPe/DeWC/Lh3dg==}
'@swc/core-linux-x64-gnu@1.15.3':
resolution: {integrity: sha512-aKttAZnz8YB1VJwPQZtyU8Uk0BfMP63iDMkvjhJzRZVgySmqt/apWSdnoIcZlUoGheBrcqbMC17GGUmur7OT5A==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
'@swc/core-linux-x64-musl@1.11.24':
resolution: {integrity: sha512-DZByJaMVzSfjQKKQn3cqSeqwy6lpMaQDQQ4HPlch9FWtDx/dLcpdIhxssqZXcR2rhaQVIaRQsCqwV6orSDGAGw==}
'@swc/core-linux-x64-musl@1.15.3':
resolution: {integrity: sha512-oe8FctPu1gnUsdtGJRO2rvOUIkkIIaHqsO9xxN0bTR7dFTlPTGi2Fhk1tnvXeyAvCPxLIcwD8phzKg6wLv9yug==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
'@swc/core-win32-arm64-msvc@1.11.24':
resolution: {integrity: sha512-Q64Ytn23y9aVDKN5iryFi8mRgyHw3/kyjTjT4qFCa8AEb5sGUuSj//AUZ6c0J7hQKMHlg9do5Etvoe61V98/JQ==}
'@swc/core-win32-arm64-msvc@1.15.3':
resolution: {integrity: sha512-L9AjzP2ZQ/Xh58e0lTRMLvEDrcJpR7GwZqAtIeNLcTK7JVE+QineSyHp0kLkO1rttCHyCy0U74kDTj0dRz6raA==}
engines: {node: '>=10'}
cpu: [arm64]
os: [win32]
'@swc/core-win32-ia32-msvc@1.11.24':
resolution: {integrity: sha512-9pKLIisE/Hh2vJhGIPvSoTK4uBSPxNVyXHmOrtdDot4E1FUUI74Vi8tFdlwNbaj8/vusVnb8xPXsxF1uB0VgiQ==}
'@swc/core-win32-ia32-msvc@1.15.3':
resolution: {integrity: sha512-B8UtogMzErUPDWUoKONSVBdsgKYd58rRyv2sHJWKOIMCHfZ22FVXICR4O/VwIYtlnZ7ahERcjayBHDlBZpR0aw==}
engines: {node: '>=10'}
cpu: [ia32]
os: [win32]
'@swc/core-win32-x64-msvc@1.11.24':
resolution: {integrity: sha512-sybnXtOsdB+XvzVFlBVGgRHLqp3yRpHK7CrmpuDKszhj/QhmsaZzY/GHSeALlMtLup13M0gqbcQvsTNlAHTg3w==}
'@swc/core-win32-x64-msvc@1.15.3':
resolution: {integrity: sha512-SpZKMR9QBTecHeqpzJdYEfgw30Oo8b/Xl6rjSzBt1g0ZsXyy60KLXrp6IagQyfTYqNYE/caDvwtF2FPn7pomog==}
engines: {node: '>=10'}
cpu: [x64]
os: [win32]
'@swc/core@1.11.24':
resolution: {integrity: sha512-MaQEIpfcEMzx3VWWopbofKJvaraqmL6HbLlw2bFZ7qYqYw3rkhM0cQVEgyzbHtTWwCwPMFZSC2DUbhlZgrMfLg==}
'@swc/core@1.15.3':
resolution: {integrity: sha512-Qd8eBPkUFL4eAONgGjycZXj1jFCBW8Fd+xF0PzdTlBCWQIV1xnUT7B93wUANtW3KGjl3TRcOyxwSx/u/jyKw/Q==}
engines: {node: '>=10'}
peerDependencies:
'@swc/helpers': '>=0.5.17'
@@ -6041,8 +6041,8 @@ packages:
'@swc/helpers@0.5.15':
resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}
'@swc/types@0.1.23':
resolution: {integrity: sha512-u1iIVZV9Q0jxY+yM2vw/hZGDNudsN85bBpTqzAQ9rzkxW9D+e3aEM4Han+ow518gSewkXgjmEK0BD79ZcNVgPw==}
'@swc/types@0.1.25':
resolution: {integrity: sha512-iAoY/qRhNH8a/hBvm3zKj9qQ4oc2+3w1unPJa2XvTK3XjeLXtzcCingVPw/9e5mn1+0yPqxcBGp9Jf0pkfMb1g==}
'@tailwindcss/node@4.1.13':
resolution: {integrity: sha512-eq3ouolC1oEFOAvOMOBAmfCIqZBJuvWvvYWh5h5iOYfe1HFC6+GZ6EIL0JdM3/niGRJmnrOc+8gl9/HGUaaptw==}
@@ -18289,51 +18289,51 @@ snapshots:
'@svta/common-media-library@0.12.4': {}
'@swc/core-darwin-arm64@1.11.24':
'@swc/core-darwin-arm64@1.15.3':
optional: true
'@swc/core-darwin-x64@1.11.24':
'@swc/core-darwin-x64@1.15.3':
optional: true
'@swc/core-linux-arm-gnueabihf@1.11.24':
'@swc/core-linux-arm-gnueabihf@1.15.3':
optional: true
'@swc/core-linux-arm64-gnu@1.11.24':
'@swc/core-linux-arm64-gnu@1.15.3':
optional: true
'@swc/core-linux-arm64-musl@1.11.24':
'@swc/core-linux-arm64-musl@1.15.3':
optional: true
'@swc/core-linux-x64-gnu@1.11.24':
'@swc/core-linux-x64-gnu@1.15.3':
optional: true
'@swc/core-linux-x64-musl@1.11.24':
'@swc/core-linux-x64-musl@1.15.3':
optional: true
'@swc/core-win32-arm64-msvc@1.11.24':
'@swc/core-win32-arm64-msvc@1.15.3':
optional: true
'@swc/core-win32-ia32-msvc@1.11.24':
'@swc/core-win32-ia32-msvc@1.15.3':
optional: true
'@swc/core-win32-x64-msvc@1.11.24':
'@swc/core-win32-x64-msvc@1.15.3':
optional: true
'@swc/core@1.11.24':
'@swc/core@1.15.3':
dependencies:
'@swc/counter': 0.1.3
'@swc/types': 0.1.23
'@swc/types': 0.1.25
optionalDependencies:
'@swc/core-darwin-arm64': 1.11.24
'@swc/core-darwin-x64': 1.11.24
'@swc/core-linux-arm-gnueabihf': 1.11.24
'@swc/core-linux-arm64-gnu': 1.11.24
'@swc/core-linux-arm64-musl': 1.11.24
'@swc/core-linux-x64-gnu': 1.11.24
'@swc/core-linux-x64-musl': 1.11.24
'@swc/core-win32-arm64-msvc': 1.11.24
'@swc/core-win32-ia32-msvc': 1.11.24
'@swc/core-win32-x64-msvc': 1.11.24
'@swc/core-darwin-arm64': 1.15.3
'@swc/core-darwin-x64': 1.15.3
'@swc/core-linux-arm-gnueabihf': 1.15.3
'@swc/core-linux-arm64-gnu': 1.15.3
'@swc/core-linux-arm64-musl': 1.15.3
'@swc/core-linux-x64-gnu': 1.15.3
'@swc/core-linux-x64-musl': 1.15.3
'@swc/core-win32-arm64-msvc': 1.15.3
'@swc/core-win32-ia32-msvc': 1.15.3
'@swc/core-win32-x64-msvc': 1.15.3
'@swc/counter@0.1.3': {}
@@ -18341,7 +18341,7 @@ snapshots:
dependencies:
tslib: 2.8.1
'@swc/types@0.1.23':
'@swc/types@0.1.25':
dependencies:
'@swc/counter': 0.1.3
+1 -1
View File
@@ -5,7 +5,7 @@ packages:
catalog:
"@biomejs/biome": ^2.2.7
"@swc/core": 1.11.24
"@swc/core": 1.15.3
"@types/json-schema": ^7.0.15
"@types/node": 22.19.0
"@vercel/functions": ^3.1.4
@@ -0,0 +1,16 @@
async function render(a: number, b: number): Promise<string> {
'use step';
// biome-ignore lint/security/noGlobalEval: need to avoid next.js rule about using react-dom directly
const ReactDOM = eval('require("react-dom/server")');
return ReactDOM.renderToString(<div>hello world {a + b}</div>);
}
export async function reactWorkflow() {
'use workflow';
console.log('calling render step');
const result = await render(1, 1);
return result;
}
@@ -0,0 +1,16 @@
async function render(a: number, b: number): Promise<string> {
'use step';
// biome-ignore lint/security/noGlobalEval: need to avoid next.js rule about using react-dom directly
const ReactDOM = eval('require("react-dom/server")');
return ReactDOM.renderToString(<div>hello world {a + b}</div>);
}
export async function reactWorkflow() {
'use workflow';
console.log('calling render step');
const result = await render(1, 1);
return result;
}
@@ -31,7 +31,7 @@ function generateSafeIdentifier(filename) {
// Convert filename to safe JS identifier
// e.g., "1_simple.ts" -> "workflow_1_simple"
return (
'workflow_' + filename.replace(/\.ts$/, '').replace(/[^a-zA-Z0-9_]/g, '_')
'workflow_' + filename.replace(/\.tsx?$/, '').replace(/[^a-zA-Z0-9_]/g, '_')
);
}
@@ -47,7 +47,7 @@ function generateRegistry() {
.readdirSync(workflowsDir)
.filter((file) => {
// Only .ts files
if (!file.endsWith('.ts')) return false;
if (!file.endsWith('.ts') && !file.endsWith('.tsx')) return false;
// Skip helpers and files starting with _
if (SKIP_FILES.includes(file)) return false;
if (file.startsWith(SKIP_PREFIX)) return false;
@@ -67,9 +67,9 @@ function generateRegistry() {
// Don't add .js extension - let the bundler resolve it
let importPath;
if (relativeWorkflowsPath && relativeWorkflowsPath !== 'workflows') {
importPath = `${relativeWorkflowsPath}/${file.replace(/\.ts$/, '')}`;
importPath = `${relativeWorkflowsPath}/${file.replace(/\.tsx?$/, '')}`;
} else {
importPath = `./workflows/${file.replace(/\.ts$/, '')}`;
importPath = `./workflows/${file.replace(/\.tsx?$/, '')}`;
}
return `import * as ${identifier} from '${importPath}';`;
})