summaryrefslogtreecommitdiff
path: root/cli/swc_util.rs
AgeCommit message (Collapse)Author
2020-09-14refactor: use ParsedModule and improve MediaTypes enum (#7456)Kitson Kelly
2020-09-06Move JSON ops to deno_core (#7336)Bert Belder
2020-09-03upgrade: swc, deno_doc, deno_lint, dprint (#7332)Bartek Iwańczuk
2020-09-02fix: support missing features in --no-check (#7289)Bartek Iwańczuk
This commit adds "EmitTranspileOptions" to "transpile()" function, that allows to configure transpilation process based on the currently loaded "tsconfig.json".
2020-08-26refactor: remove OpError, use ErrBox everywhere (#7187)Bert Belder
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-08-23fix(doc): stack overflow for .d.ts files (#7167)Bartek Iwańczuk
2020-08-23upgrade: swc, dprint, deno_lint, deno_doc (#7162)Bartek Iwańczuk
2020-08-19refactor: move cli/doc/ to separate crate (#7103)Bartek Iwańczuk
2020-08-13upgrade: swc, deno_lint, dprint (#7040)Bartek Iwańczuk
2020-07-31upgrade: deno_lint, dprint, swc (#6928)Bartek Iwańczuk
This commit upgrades: deno_lint 0.1.20 dprint-plugin-typescript 0.25.0 swc_ecmascript 0.1.0 SWC is no longer reexported from dprint nor deno_lint.
2020-07-28refactor: Use SWC to strip types for "--no-check" flag (#6895)Bartek Iwańczuk
2020-07-28fix: downcast from SwcDiagnosticBuffer to OpError (#6909)Bartek Iwańczuk
2020-06-19refactor(compiler): split code paths for compile and bundle (#6304)Bartek Iwańczuk
* refactor "compile" and "runtimeCompile" in "compiler.ts" and factor out separate methods for "compile" and "bundle" operations * remove noisy debug output from "compiler.ts" * provide "Serialize" implementations for enums in "msg.rs" * rename "analyze_dependencies_and_references" to "pre_process_file" and move it to "tsc.rs" * refactor ModuleGraph to use more concrete types and properly annotate locations where errors occur * remove dead code from "file_fetcher.rs" - "SourceFile.types_url" is no longer needed, as type reference parsing is done in "ModuleGraph" * remove unneeded field "source_path" from ".meta" files stored for compiled source file (towards #6080)
2020-06-10fix: handle @deno-types in export {} (#6202)Bartek Iwańczuk
* fix: handle @deno-types in export {} * lint * fix tests * fmt * fix test
2020-06-09upgrade: deno_lint v0.1.8 (#6208)Bartek Iwańczuk
2020-06-05ci: upgrade to Rust 1.44.0 (#6113)Bert Belder
2020-05-30fix: ES private fields parsing in SWC (#5964)Bartek Iwańczuk
2020-05-29refactor: TS compiler and module graph (#5817)Bartek Iwańczuk
This PR addresses many problems with module graph loading introduced in #5029, as well as many long standing issues. "ModuleGraphLoader" has been wired to "ModuleLoader" implemented on "State" - that means that dependency analysis and fetching is done before spinning up TS compiler worker. Basic dependency tracking for TS compilation has been implemented. Errors caused by import statements are now annotated with import location. Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-05-26fix: parsing of JSX and TSX in SWC (#5870)Bartek Iwańczuk
2020-05-23fix: TSX analysis in module graph loader (#5785)Bartek Iwańczuk
2020-05-22fix: SWC lexer settings and silent errors (#5752)Bartek Iwańczuk
This commit changes how error occurring in SWC are handled. Changed lexer settings to properly handle TS decorators. Changed output of SWC error to annotate with position in file.
2020-05-22fix: ts type imports (#5733)Bartek Iwańczuk
2020-05-18refactor: rewrite TS dependency analysis in Rust (#5029)Bartek Iwańczuk
This commit completely overhauls how module analysis is performed in TS compiler by moving the logic to Rust. In the current setup module analysis is performed using "ts.preProcessFile" API in a special TS compiler worker running on a separate thread. "ts.preProcessFile" allowed us to build a lot of functionality in CLI including X-TypeScript-Types header support and @deno-types directive support. Unfortunately at the same time complexity of the ops required to perform supporting tasks exploded and caused some hidden permission escapes. This PR introduces "ModuleGraphLoader" which can parse source and load recursively all dependent source files; as well as declaration files. All dependencies used in TS compiler and now fetched and collected upfront in Rust before spinning up TS compiler. To achieve feature parity with existing APIs this commit includes a lot of changes: * add "ModuleGraphLoader" - can fetch local and remote sources - parses source code using SWC and extracts imports, exports, file references, special headers - this struct inherited all of the hidden complexity and cruft from TS version and requires several follow up PRs * rewrite cli/tsc.rs to perform module analysis upfront and send all required source code to TS worker in one message * remove op_resolve_modules and op_fetch_source_files from cli/ops/compiler.rs * run TS worker on the same thread
2020-05-15fix some clippy warning (#5462)Yiyu Lin
2020-04-30feat: add SWC dependency analyzer (#5015)Bartek Iwańczuk
This commit adds "analyze_dependencies" function that uses SWC (by the means of AstParser) to perform analysis of static and dynamic imports.
2020-04-27refactor: factor out AstParser from DocParser (#4923)Bartek Iwańczuk