Skip to content

Commit

Permalink
feat: Add Deno build (dsherret#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Mar 7, 2021
1 parent 6608c25 commit a244830
Show file tree
Hide file tree
Showing 44 changed files with 196,055 additions and 41 deletions.
9 changes: 9 additions & 0 deletions .bvmrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"binaries": [
{
"path": "https://bvm.land/deno/1.8.0.json",
"checksum": "9a25bbee6ac0f588c47cec372e58acedbf48fc0d6141884c1a81dadf230e6ecf",
"version": "1.8.0"
}
]
}
3 changes: 2 additions & 1 deletion .dprintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"packages/*/lib/*.ts",
"**/CHANGELOG.md",
"**/wrapped-nodes.md",
"packages/ts-morph/src/compiler/ast/common/Node.ts"
"packages/ts-morph/src/compiler/ast/common/Node.ts",
"./deno"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.34.0.wasm",
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
with:
node-version: '10'
check-latest: true
- uses: bvm/[email protected]
- name: Build
run: |
yarn install
Expand All @@ -22,6 +23,8 @@ jobs:
run: |
npx lerna run test:ci
npx lerna run test:ts-versions
- name: Deno Test
run: deno test --allow-read --unstable deno
- name: Code Verification
run: |
npx lerna run code-verification
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ packages/*/node_modules
packages/*/temp
packages/*/dist-cg
packages/*/dist
packages/*/dist-deno
packages/*/coverage
packages/*/dist-scripts
packages/*/dist-declarations
Expand Down
12 changes: 12 additions & 0 deletions deno/basic_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import { Project } from "./mod.ts";

// todo: Eventually all tests run for the node package should also be run for Deno
Deno.test("ts-morph basic tests", () => {
const project = new Project({ useInMemoryFileSystem: true });
const sourceFile = project.createSourceFile("test.ts", "class T {\n}");
sourceFile.addClass({
name: "Other",
});
assertEquals(sourceFile.getText(), `class T {\n}\n\nclass Other {\n}\n`);
});
9 changes: 9 additions & 0 deletions deno/bootstrap/basic_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import { createProjectSync } from "./mod.ts";

// todo: Eventually all tests run for the node package should also be run for Deno
Deno.test("bootstrap general tests", () => {
const project = createProjectSync({ useInMemoryFileSystem: true });
const sourceFile = project.createSourceFile("test.ts", "class T {\n}\n");
assertEquals(sourceFile.statements[0].getText(), `class T {\n}`);
});
2 changes: 2 additions & 0 deletions deno/bootstrap/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @deno-types="./ts_morph_bootstrap.d.ts"
export * from "./ts_morph_bootstrap.js";
Loading

0 comments on commit a244830

Please sign in to comment.