oxc/crates
Boshen 267f7c4398
fix(minifier): skip Object.defineProperty(exports, ...) for cjs-module-lexer (#4409)
```
> monitor-oxc@ test /home/runner/work/monitor-oxc/monitor-oxc
> node src/main.test.mjs

file:///home/runner/work/monitor-oxc/monitor-oxc/node_modules/.pnpm/inquirer@[10](https://github.com/oxc-project/monitor-oxc/actions/runs/10038139357/job/27739464680#step:8:11).0.1/node_modules/inquirer/dist/esm/ui/prompt.mjs:2
import { defer, EMPTY, from, of, concatMap, filter, reduce, isObservable, lastValueFrom } from "rxjs";
                ^^^^^
SyntaxError: Named export 'EMPTY' not found. The requested module 'rxjs' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'rxjs';
const { defer, EMPTY, from, of, concatMap, filter, reduce, isObservable, lastValueFrom } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:[12](https://github.com/oxc-project/monitor-oxc/actions/runs/10038139357/job/27739464680#step:8:13)3:5)

Node.js v20.15.1
```

Export is undefined when `enumerable` is "!0".
See `https://github.com/nodejs/cjs-module-lexer/issues/64`
2024-07-22 20:32:15 +08:00
..
oxc Release crates v0.21.0 (#4344) 2024-07-18 14:39:07 +08:00
oxc_allocator Release crates v0.21.0 (#4344) 2024-07-18 14:39:07 +08:00
oxc_ast perf: replace some CompactStr usages with Cows (#4377) 2024-07-20 19:19:55 +00:00
oxc_ast_macros refactor(ast): reduce #[cfg_attr] boilerplate in AST type defs (#4375) 2024-07-20 16:41:16 +00:00
oxc_cfg Release crates v0.21.0 (#4344) 2024-07-18 14:39:07 +08:00
oxc_codegen fix(codegen): object shorthand with parens ({x: (x)}) -> ({ x }) (#4391) 2024-07-21 14:04:17 +00:00
oxc_diagnostics refactor(linter): use diagnostic codes in lint rules (#4349) 2024-07-20 03:35:00 +00:00
oxc_index Release crates v0.21.0 (#4344) 2024-07-18 14:39:07 +08:00
oxc_isolated_declarations fix(codegen): print shorthand for all { x } variants (#4374) 2024-07-21 19:54:21 +08:00
oxc_js_regex
oxc_language_server refactor(linter): use diagnostic codes in lint rules (#4349) 2024-07-20 03:35:00 +00:00
oxc_linter fix(linter): overflow in no-obj-calls (#4397) 2024-07-21 23:35:47 +00:00
oxc_macros perf(linter): disable lint rules by file type (#4380) 2024-07-21 15:22:54 +00:00
oxc_mangler fix(codegen): print shorthand for all { x } variants (#4374) 2024-07-21 19:54:21 +08:00
oxc_minifier fix(minifier): skip Object.defineProperty(exports, ...) for cjs-module-lexer (#4409) 2024-07-22 20:32:15 +08:00
oxc_module_lexer Release crates v0.21.0 (#4344) 2024-07-18 14:39:07 +08:00
oxc_parser fix(ast): visit Programs hashbang field first (#4368) 2024-07-19 16:27:51 +00:00
oxc_prettier chore: remove unsafe_code = "warn" rust lint 2024-07-15 10:39:08 +08:00
oxc_semantic perf(semantic): use Atom instead of CompactStr for UnresolvedReferencesStack (#4401) 2024-07-22 12:18:37 +00:00
oxc_sourcemap fix(sourcemap): avoid negative line if token_chunks has same prev_dst_line (#4348) 2024-07-19 18:14:35 +08:00
oxc_span perf: replace some CompactStr usages with Cows (#4377) 2024-07-20 19:19:55 +00:00
oxc_syntax fix(transformer/typescript): unexpectedly removed class binding from ExportNamedDeclaration (#4351) 2024-07-18 16:44:38 +00:00
oxc_transformer Release crates v0.21.0 (#4344) 2024-07-18 14:39:07 +08:00
oxc_traverse perf(semantic): remove a branch from add_scope (#4384) 2024-07-21 12:43:34 +00:00
oxc_wasm refactor(linter): use diagnostic codes in lint rules (#4349) 2024-07-20 03:35:00 +00:00