Skip to content

Commit

Permalink
Adding wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Sep 26, 2021
1 parent 2093991 commit 37f0a38
Show file tree
Hide file tree
Showing 26 changed files with 2,751 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/target
target
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"deno.enable": true,
"deno.lint": false,
"deno.unstable": false,
"deno.suggest.imports.hosts": {
"https://deno.land": false
}
}
148 changes: 108 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 5 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
[package]
name = "d2n"
version = "0.1.0"
authors = ["the Deno authors"]
edition = "2018"
license = "MIT"
repository = "https://github.com/dsherret/d2n"
description = "Deno to Node/canonical TypeScript transform."

[dependencies]
anyhow = "1.0.44"
base64 = "0.13.0"
deno_ast = { version = "0.2.0", features = ["bundler", "codegen", "dep_graph", "module_specifier", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit", "utils"], path = "../deno_ast" }
deno_graph = { version = "0.5.0", path = "../deno_graph" }
clap = "2.33.3"
futures = "0.3.17"
pathdiff = "0.2.0"
reqwest = { version = "0.11", features = ["rustls"] }
tokio = { version = "1", features = ["full"] }
[workspace]
members = [
"rs-lib",
"wasm",
]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ import { escapeForWithinString, getStringFromStrOrFunc } from "./utils/string_ut
```rust
use std::path::PathBuf;

use d2n::ModuleSpecifier;
use d2n::transform;
use d2n::TransformOptions;

let output_files = transform(TransformOptions {
entry_point: PathBuf::from("./mod.ts"),
entry_point: ModuleSpecifier::from_file_path(PathBuf::from("./mod.ts")).unwrap(),
keep_extensions: false,
loader: None, // use the default loader
}).await?;
Expand All @@ -60,7 +61,6 @@ for output_file in output_files {

## Future Goals

1. Programmatic API available via Wasm
1. Support Deno.json to get compiler options.
1. Handle mapping from remote specifiers to bare specifiers and transforming them in the file.
1. Handle dynamic imports (at least ones that are statically analyzable and maybe warn on others)
Expand Down
Loading

0 comments on commit 37f0a38

Please sign in to comment.