Skip to content

Commit 35e0791

Browse files
authored
Merge pull request #3 from krutoo/deno
Migrate to Deno
2 parents fa0afe7 + 5a7b805 commit 35e0791

35 files changed

+928
-19049
lines changed

.eslintignore

-10
This file was deleted.

.eslintrc.js

-35
This file was deleted.

.github/workflows/gh-pages.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ name: Deploy demo on Github Pages
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
14-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1514
with:
16-
node-version: 16
15+
node-version: 20
1716
registry-url: https://registry.npmjs.org/
1817

1918
- name: Install and Build

.github/workflows/npm-publish.yml

-38
This file was deleted.

.github/workflows/publish-npm.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish NPM package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: denoland/setup-deno@v1
14+
with:
15+
deno-version: v1.x
16+
17+
- name: Lint
18+
run: |
19+
deno task lint
20+
21+
- name: Test
22+
run: |
23+
deno test
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
registry-url: 'https://registry.npmjs.org'
29+
30+
- name: Build npm package
31+
run: |
32+
deno task build-npm ${{ github.event.release.tag_name }}
33+
34+
- name: Publish package
35+
if: startsWith(github.ref, 'refs/tags/')
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
run: |
39+
cd npm && npm publish --access public

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
node_modules
2-
build
3-
dist
2+
npm
43
.DS_Store
5-
.parcel-cache

.prettierrc.json

-11
This file was deleted.

.swcrc

-14
This file was deleted.

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"deno.enable": true,
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "denoland.vscode-deno"
5+
}

readme.md renamed to README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm install --save @krutoo/input-mask
1919
Usage:
2020

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

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

deno.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@krutoo/input-mask",
3+
"version": "0.0.0",
4+
"tasks": {
5+
"lint": "deno lint && deno check src/**/*.ts",
6+
"build-npm": "deno run -A scripts/build-npm.ts"
7+
},
8+
"imports": {
9+
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
10+
"@std/expect": "jsr:@std/expect@^0.224.5",
11+
"@std/testing": "jsr:@std/testing@^0.225.3"
12+
},
13+
"exports": {
14+
"./core": "./src/core/mod.ts",
15+
"./dom": "./src/dom/mod.ts"
16+
},
17+
"fmt": {
18+
"lineWidth": 100,
19+
"indentWidth": 2,
20+
"semiColons": true,
21+
"singleQuote": true,
22+
"exclude": ["npm/**/*", "example/**/*"]
23+
},
24+
"compilerOptions": {
25+
"lib": [
26+
"deno.ns",
27+
"esnext",
28+
"dom",
29+
"dom.iterable"
30+
]
31+
},
32+
"exclude": ["npm/**/*", "example/**/*"]
33+
}

0 commit comments

Comments
 (0)