Skip to content

Commit

Permalink
Merge pull request #3 from krutoo/deno
Browse files Browse the repository at this point in the history
Migrate to Deno
  • Loading branch information
krutoo authored Jun 28, 2024
2 parents fa0afe7 + 5a7b805 commit 35e0791
Show file tree
Hide file tree
Showing 35 changed files with 928 additions and 19,049 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

35 changes: 0 additions & 35 deletions .eslintrc.js

This file was deleted.

9 changes: 4 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ name: Deploy demo on Github Pages
on:
push:
branches:
- master
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install and Build
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/npm-publish.yml

This file was deleted.

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

on:
release:
types: [published]

jobs:
publish-npm:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Lint
run: |
deno task lint
- name: Test
run: |
deno test
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Build npm package
run: |
deno task build-npm ${{ github.event.release.tag_name }}
- name: Publish package
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd npm && npm publish --access public
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
node_modules
build
dist
npm
.DS_Store
.parcel-cache
11 changes: 0 additions & 11 deletions .prettierrc.json

This file was deleted.

14 changes: 0 additions & 14 deletions .swcrc

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"deno.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
}
2 changes: 1 addition & 1 deletion readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install --save @krutoo/input-mask
Usage:

```ts
import { InputMask } from '@krutoo/input-mask/dist/dom';
import { InputMask } from '@krutoo/input-mask/dom';

const input = document.querySelector('input#phone');

Expand Down
33 changes: 33 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@krutoo/input-mask",
"version": "0.0.0",
"tasks": {
"lint": "deno lint && deno check src/**/*.ts",
"build-npm": "deno run -A scripts/build-npm.ts"
},
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
"@std/expect": "jsr:@std/expect@^0.224.5",
"@std/testing": "jsr:@std/testing@^0.225.3"
},
"exports": {
"./core": "./src/core/mod.ts",
"./dom": "./src/dom/mod.ts"
},
"fmt": {
"lineWidth": 100,
"indentWidth": 2,
"semiColons": true,
"singleQuote": true,
"exclude": ["npm/**/*", "example/**/*"]
},
"compilerOptions": {
"lib": [
"deno.ns",
"esnext",
"dom",
"dom.iterable"
]
},
"exclude": ["npm/**/*", "example/**/*"]
}
Loading

0 comments on commit 35e0791

Please sign in to comment.