swc-plugin-component-annotate 1.11.0 → 1.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swc-plugin-component-annotate",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Use SWC to automatically annotate React components with data attributes for component tracking",
5
5
  "author": "scttcper <scttcper@gmail.com>",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "swc"
10
10
  ],
11
11
  "scripts": {
12
- "build": "cargo build --target wasm32-unknown-unknown",
12
+ "build": "cargo build --release --target wasm32-unknown-unknown",
13
13
  "test": "cargo test",
14
14
  "prepack": "cp -rf target/wasm32-unknown-unknown/release/swc_plugin_component_annotate.wasm ."
15
15
  },
package/src/jsx_utils.rs CHANGED
@@ -65,10 +65,10 @@ pub fn create_jsx_attr(name: &str, value: &str) -> JSXAttrOrSpread {
65
65
  JSXAttrOrSpread::JSXAttr(JSXAttr {
66
66
  span: Default::default(),
67
67
  name: JSXAttrName::Ident(IdentName::new(name.into(), Default::default())),
68
- value: Some(JSXAttrValue::Lit(Lit::Str(Str {
68
+ value: Some(JSXAttrValue::Str(Str {
69
69
  span: Default::default(),
70
70
  value: value.into(),
71
71
  raw: None,
72
- }))),
72
+ })),
73
73
  })
74
74
  }
package/src/lib.rs CHANGED
@@ -340,7 +340,7 @@ impl VisitMut for ReactComponentAnnotateVisitor {
340
340
  fn visit_mut_import_decl(&mut self, import_decl: &mut ImportDecl) {
341
341
  // Track imports from @emotion/styled (only if enabled)
342
342
  if self.config.experimental_rewrite_emotion_styled
343
- && import_decl.src.value.as_ref() == "@emotion/styled"
343
+ && import_decl.src.value == "@emotion/styled"
344
344
  {
345
345
  for specifier in &import_decl.specifiers {
346
346
  match specifier {
Binary file