-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from arnim279/use-deno
Switch to deno and refactor code
- Loading branch information
Showing
76 changed files
with
1,742 additions
and
3,585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Check formatting | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
check_formatting: | ||
name: Check code formatting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: vx.x.x | ||
|
||
- name: Check formatting | ||
run: deno fmt --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
name: Publish to NPM | ||
name: Publish module | ||
|
||
on: | ||
release: | ||
types: [published] | ||
on: [release] | ||
|
||
jobs: | ||
publish: | ||
name: Build and publish to NPM | ||
publish_npm: | ||
name: Publish on NPM | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: vx.x.x | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: "https://registry.npmjs.org" | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Get tag version | ||
if: startsWith(github.ref, 'refs/tags/') | ||
id: get_tag_version | ||
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Transform to NPM package | ||
run: deno task build_npm ${{steps.get_tag_version.outputs.TAG_VERSION}} | ||
|
||
- name: Publish to NPM | ||
run: npm publish --access public | ||
- name: Publish on NPM | ||
run: | | ||
cd npm | ||
npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Run Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
run_tests: | ||
name: Type-check code and run tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: vx.x.x | ||
|
||
- name: Type-check code | ||
run: deno check mod.ts | ||
|
||
- name: Type-check examples | ||
run: | | ||
shopt -s globstar | ||
for f in examples/**/*.ts; do deno check $f; done | ||
- name: Run tests | ||
run: deno test --allow-none --doc | ||
|
||
- name: Lint code | ||
run: deno lint --compact |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
dist | ||
node_modules | ||
/npm |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["denoland.vscode-deno"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"deno.enable": true, | ||
"typescript.validate.enable": false, | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"importMap": "import_map.json", | ||
|
||
"lint": { | ||
"files": { "exclude": ["npm"] }, | ||
"rules": { | ||
"exclude": ["prefer-const"], | ||
"include": [ | ||
"camelcase", | ||
"explicit-function-return-type", | ||
"explicit-module-boundary-types", | ||
"eqeqeq", | ||
"no-external-import", | ||
"ban-untagged-todo" | ||
] | ||
} | ||
}, | ||
|
||
"test": { | ||
"files": { "exclude": ["npm"] } | ||
}, | ||
|
||
"fmt": { | ||
"files": { "exclude": ["npm"] } | ||
}, | ||
|
||
"tasks": { | ||
"build_npm": "deno run -A scripts/build_npm.ts" | ||
}, | ||
|
||
"compilerOptions": { | ||
"noFallthroughCasesInSwitch": true, | ||
"noUncheckedIndexedAccess": true | ||
} | ||
} |
Oops, something went wrong.