Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(www): playground #1182

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ jobs:
if: contains(matrix.os, 'ubuntu')
run: diff <(./target/release/examples/dlint rules --json) www/static/docs.json

- name: Check if wasm is up-to-date
if : contains(matrix.os, 'ubuntu')
run: deno task wasmbuild --check

- name: Benchmarks
if: contains(matrix.os, 'ubuntu')
run: deno run -A --quiet benchmarks/benchmarks.ts
Expand Down
196 changes: 190 additions & 6 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exclude = [

[lib]
name = "deno_lint"
crate-type = ["cdylib", "rlib"]

[[example]]
name = "dlint"
Expand All @@ -23,6 +24,7 @@ test = true
[features]
default = []
docs = []
wasm = ["wasm-bindgen", "wee_alloc", "miette"]

[dependencies]
deno_ast = { version = "0.38.0", features = ["scopes", "transforms", "utils", "visit", "view"] }
Expand All @@ -34,6 +36,9 @@ once_cell = "1.19.0"
derive_more = { version = "0.99.17", features = ["display"] }
anyhow = "1.0.79"
if_chain = "1.0.2"
wasm-bindgen = { version = "0.2.92", optional = true }
wee_alloc = { version = "0.4", optional = true }
miette = { version = "4.3.0", features = ["fancy-no-backtrace"], optional = true }

[dev-dependencies]
ansi_term = "0.12.1"
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"lock": false,
"tasks": {
"wasmbuild": "deno run -A jsr:@deno/wasmbuild@0.17.1 --features wasm --out www/static",
"update-docs": "cargo run --features=docs --example dlint rules --json > www/static/docs.json"
},
"exclude": [
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct LintFix {
pub changes: Vec<LintFixChange>,
}

#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct LintDiagnostic {
pub specifier: ModuleSpecifier,
pub range: SourceRange,
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ pub mod linter;
mod performance_mark;
pub mod rules;
pub mod swc_util;
#[cfg(feature = "wasm")]
pub mod wasm;

pub use deno_ast::view::Program;
pub use deno_ast::view::ProgramRef;
#[cfg(feature = "wasm")]
pub use wasm::run;

#[cfg(test)]
mod lint_tests {
Expand Down
Loading
Loading