@swc-contrib/mut-cjs-exports 13.1.0 → 14.0.1

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-contrib/mut-cjs-exports",
3
- "version": "13.1.0",
3
+ "version": "14.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -38,8 +38,8 @@
38
38
  "@swc/jest": "^0.2.37"
39
39
  },
40
40
  "scripts": {
41
- "build": "cargo build --release --target wasm32-unknown-unknown && cp ../../target/wasm32-unknown-unknown/release/swc_mut_cjs_exports.wasm .",
42
- "build:debug": "cargo build --target wasm32-unknown-unknown && cp ../../target/wasm32-unknown-unknown/debug/swc_mut_cjs_exports.wasm ./swc_mut_cjs_exports_debug.wasm",
41
+ "build": "RUSTFLAGS='--cfg swc_ast_unknown' cargo build --release --target wasm32-unknown-unknown && cp ../../target/wasm32-unknown-unknown/release/swc_mut_cjs_exports.wasm .",
42
+ "build:debug": "RUSTFLAGS='--cfg swc_ast_unknown' cargo build --target wasm32-unknown-unknown && cp ../../target/wasm32-unknown-unknown/debug/swc_mut_cjs_exports.wasm ./swc_mut_cjs_exports_debug.wasm",
43
43
  "test": "pnpm run build:debug && jest"
44
44
  }
45
45
  }
@@ -117,6 +117,8 @@ impl VisitMut for LocalExportStrip {
117
117
  _ => list.push(module_decl.into()),
118
118
  };
119
119
  }
120
+ #[cfg(swc_ast_unknown)]
121
+ _ => panic!("unknown node"),
120
122
  };
121
123
  }
122
124
 
@@ -186,6 +188,8 @@ impl VisitMut for LocalExportStrip {
186
188
  ModuleExportName::Str(_) => {
187
189
  unreachable!(r#"`export {{ "foo" }}` without src is invalid"#)
188
190
  }
191
+ #[cfg(swc_ast_unknown)]
192
+ _ => panic!("unknown node"),
189
193
  };
190
194
 
191
195
  if let Some(exported) = exported {
@@ -198,6 +202,8 @@ impl VisitMut for LocalExportStrip {
198
202
  },
199
203
  span,
200
204
  ),
205
+ #[cfg(swc_ast_unknown)]
206
+ _ => panic!("unknown node"),
201
207
  };
202
208
 
203
209
  (export_name, ExportItem::new(export_name_span, orig))
@@ -205,7 +211,10 @@ impl VisitMut for LocalExportStrip {
205
211
  (orig.sym.clone(), ExportItem::new(orig.span, orig))
206
212
  }
207
213
  }
214
+ #[cfg(swc_ast_unknown)]
215
+ _ => panic!("unknown node"),
208
216
  }))
217
+
209
218
  }
210
219
 
211
220
  /// ```javascript
@@ -236,6 +245,8 @@ impl VisitMut for LocalExportStrip {
236
245
  }
237
246
  }
238
247
  DefaultDecl::TsInterfaceDecl(_) => {}
248
+ #[cfg(swc_ast_unknown)]
249
+ _ => panic!("unknown node"),
239
250
  }
240
251
  }
241
252
 
package/src/utils.rs CHANGED
@@ -133,6 +133,8 @@ pub(crate) fn key_from_export_name(n: &ModuleExportName) -> (Atom, Span) {
133
133
  },
134
134
  s.span,
135
135
  ),
136
+ #[cfg(swc_ast_unknown)]
137
+ _ => panic!("unknown node"),
136
138
  }
137
139
  }
138
140
 
@@ -143,6 +145,8 @@ pub(crate) fn local_ident_from_export_name(n: ModuleExportName) -> Ident {
143
145
  Some(s) => s.clone(),
144
146
  None => panic!("non-utf8 export name: {:?}", s.value),
145
147
  },
148
+ #[cfg(swc_ast_unknown)]
149
+ _ => panic!("unknown node"),
146
150
  };
147
151
 
148
152
  match Ident::verify_symbol(&name) {
Binary file