@swc/plugin-styled-jsx 0.1.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +5 -10
- package/package.json +1 -1
- package/src/lib.rs +3 -6
- package/swc_plugin_styled_jsx.wasm +0 -0
package/Cargo.toml
CHANGED
|
@@ -4,18 +4,13 @@ description = "SWC plugin for styled-jsx"
|
|
|
4
4
|
edition = "2021"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
name = "swc_plugin_styled_jsx"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
|
|
9
9
|
[lib]
|
|
10
10
|
crate-type = ["cdylib", "rlib"]
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
swc_css = "0.103.0"
|
|
18
|
-
swc_css_prefixer = "0.99.3"
|
|
19
|
-
swc_ecmascript = { version = "0.140.0", features = ["minifier", "utils", "visit"] }
|
|
20
|
-
swc_plugin = "0.39.0"
|
|
21
|
-
tracing = "0.1.32"
|
|
13
|
+
styled_jsx = "0.2.0"
|
|
14
|
+
swc_common = "0.17.21"
|
|
15
|
+
swc_ecmascript = "0.147.0"
|
|
16
|
+
swc_plugin = "0.47.0"
|
package/package.json
CHANGED
package/src/lib.rs
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
use swc_common::{sync::Lrc, FileName, SourceMap};
|
|
2
2
|
use swc_ecmascript::{ast::Program, visit::FoldWith};
|
|
3
|
-
use swc_plugin::plugin_transform;
|
|
3
|
+
use swc_plugin::{plugin_transform, TransformPluginProgramMetadata};
|
|
4
4
|
|
|
5
5
|
#[plugin_transform]
|
|
6
|
-
fn
|
|
6
|
+
fn styled_jsx_plugin(program: Program, _: TransformPluginProgramMetadata) -> Program {
|
|
7
7
|
// TODO(kdy1): This is wrong, but it does not use cm
|
|
8
8
|
let cm = Lrc::new(SourceMap::default());
|
|
9
9
|
|
|
10
|
-
let program = program.fold_with(&mut
|
|
10
|
+
let program = program.fold_with(&mut styled_jsx::styled_jsx(cm, FileName::Anon));
|
|
11
11
|
|
|
12
12
|
program
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
#[path = "../../../vendor/next.js/packages/next-swc/crates/core/src/styled_jsx/mod.rs"]
|
|
16
|
-
mod imp;
|
|
Binary file
|