@swc/plugin-styled-jsx 0.1.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 +21 -0
- package/package.json +20 -0
- package/src/lib.rs +16 -0
- package/swc_plugin_styled_jsx.wasm +0 -0
package/Cargo.toml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
|
|
3
|
+
description = "SWC plugin for styled-jsx"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
license = "Apache-2.0"
|
|
6
|
+
name = "swc_plugin_styled_jsx"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
|
|
9
|
+
[lib]
|
|
10
|
+
crate-type = ["cdylib", "rlib"]
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
anyhow = "1.0.56"
|
|
14
|
+
easy-error = "1.0.0"
|
|
15
|
+
swc_atoms = "0.2.11"
|
|
16
|
+
swc_common = "0.17.18"
|
|
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"
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@swc/plugin-styled-jsx",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SWC plugin for styled-jsx",
|
|
5
|
+
"main": "swc_plugin_styled_jsx.wasm",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepack": "cp ../../target/wasm32-wasi/release/swc_plugin_styled_jsx.wasm ."
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://swc.rs",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "+https://github.com/swc-project/plugins.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/swc-project/plugins/issues"
|
|
16
|
+
},
|
|
17
|
+
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
|
18
|
+
"keywords": [],
|
|
19
|
+
"license": "Apache-2.0"
|
|
20
|
+
}
|
package/src/lib.rs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
use swc_common::{sync::Lrc, FileName, SourceMap};
|
|
2
|
+
use swc_ecmascript::{ast::Program, visit::FoldWith};
|
|
3
|
+
use swc_plugin::plugin_transform;
|
|
4
|
+
|
|
5
|
+
#[plugin_transform]
|
|
6
|
+
fn styled_jsx(program: Program, _plugin_config: String, _: String) -> Program {
|
|
7
|
+
// TODO(kdy1): This is wrong, but it does not use cm
|
|
8
|
+
let cm = Lrc::new(SourceMap::default());
|
|
9
|
+
|
|
10
|
+
let program = program.fold_with(&mut imp::styled_jsx(cm, FileName::Anon));
|
|
11
|
+
|
|
12
|
+
program
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#[path = "../../../vendor/next.js/packages/next-swc/crates/core/src/styled_jsx/mod.rs"]
|
|
16
|
+
mod imp;
|
|
Binary file
|