Skip to content

Commit

Permalink
Merge pull request #2 from krutoo/using-deno
Browse files Browse the repository at this point in the history
Using Deno instead NPM, TypeScript, Babel, SWC, ts-node...
  • Loading branch information
krutoo committed Apr 4, 2024
2 parents d666d0f + 80e864b commit 3889cdc
Show file tree
Hide file tree
Showing 39 changed files with 596 additions and 5,904 deletions.
87 changes: 0 additions & 87 deletions .babel/plugin-node-module-resolution.mjs

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/npm-publish.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish NPM package

on:
release:
types: [published]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Lint
run: |
deno task lint
- name: Unit tests
run: |
deno test
- name: Get tag version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT

- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Build npm package
run: |
deno task build-npm ${{ github.event.release.tag_name }}
- name: npm publish
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd npm && npm publish
19 changes: 5 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
node-version: 20

- name: Install dependencies
run: npm ci
deno-version: v1.x

- name: Lint
run: |
npm run type-check
deno task lint
- name: Unit tests
run: |
npm run test
- name: Package tests
working-directory: ./tests
run: |
npm run preparing
npm run test
deno test
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
node_modules
dist

# npm pack default output
krutoo-fetch-tools-0.0.0.tgz
# build artifacts
npm
Loading

0 comments on commit 3889cdc

Please sign in to comment.