Skip to content

Commit 19c442c

Browse files
committed
[refactor] upgrade Parcel v1 to v2
[add] PNPM lock for GitHub Actions cache [add] VSCode debugging configuration [add] GitHub Sponsor meta [optimize] upgrade Upstream packages
1 parent 0066018 commit 19c442c

File tree

14 files changed

+4665
-61
lines changed

14 files changed

+4665
-61
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
custom:
2+
- https://paypal.me/TechQuery
3+
- https://tech-query.me/image/TechQuery-Alipay.jpg

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI & CD
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
Build-and-Publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: pnpm/action-setup@v2
12+
with:
13+
version: 7
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 14
17+
registry-url: https://registry.npmjs.org
18+
cache: pnpm
19+
- name: Install Dependencies
20+
run: pnpm i --frozen-lockfile
21+
- name: Build & Publish
22+
run: npm publish
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
- name: Update document
26+
uses: peaceiris/actions-gh-pages@v3
27+
with:
28+
publish_dir: ./docs
29+
personal_token: ${{ secrets.GITHUB_TOKEN }}
30+
force_orphan: true

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
package-lock.json
3+
yarn.lock
34
dist/
4-
.cache/
5+
.parcel-cache/
56
docs/
6-
.vscode/
7+
.vscode/settings.json

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm test

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run build

.npmignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.editorconfig
2+
.husky/
23
.vscode/
34
test/
4-
.cache/
5+
.parcel-cache/
56
docs/
6-
.travis.yml
7+
.github/

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug Jest",
6+
"type": "node",
7+
"request": "launch",
8+
"port": 9229,
9+
"runtimeArgs": [
10+
"--inspect-brk",
11+
"${workspaceRoot}/node_modules/jest/bin/jest.js",
12+
"--runInBand"
13+
],
14+
"console": "integratedTerminal",
15+
"internalConsoleOptions": "neverOpen"
16+
}
17+
]
18+
}

ReadMe.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
[Observable Proposal][1] implement based on [Async Generator (ES 2018)][2] & [TypeScript][3]
44

5-
[![NPM Dependency](https://david-dm.org/EasyWebApp/iterable-observer.svg)][4]
6-
[![Build Status](https://travis-ci.com/EasyWebApp/iterable-observer.svg?branch=master)][5]
5+
[![CI & CD](https://github.com/EasyWebApp/iterable-observer/actions/workflows/main.yml/badge.svg)][5]
76
[![](https://data.jsdelivr.com/v1/package/npm/iterable-observer/badge?style=rounded)][6]
87

98
[![NPM](https://nodei.co/npm/iterable-observer.png?downloads=true&downloadRank=true&stars=true)][7]
@@ -78,7 +77,6 @@ app.use(BodyParser)
7877
[1]: https://github.com/tc39/proposal-observable
7978
[2]: https://tc39.es/ecma262/#sec-asyncgeneratorfunction-objects
8079
[3]: https://www.typescriptlang.org/
81-
[4]: https://david-dm.org/EasyWebApp/iterable-observer
82-
[5]: https://travis-ci.com/EasyWebApp/iterable-observer
80+
[5]: https://github.com/EasyWebApp/iterable-observer/actions/workflows/main.yml
8381
[6]: https://www.jsdelivr.com/package/npm/iterable-observer
8482
[7]: https://nodei.co/npm/iterable-observer/

package.json

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iterable-observer",
3-
"version": "1.0.0-beta.5",
3+
"version": "1.0.0-rc.1",
44
"license": "LGPL-3.0",
55
"author": "[email protected]",
66
"description": "Observable Proposal implement based on Async Generator (ES 2018) & TypeScript",
@@ -23,18 +23,21 @@
2323
},
2424
"source": "source/index.ts",
2525
"types": "dist/index.d.ts",
26+
"module": "dist/index.esm.js",
2627
"main": "dist/index.js",
2728
"devDependencies": {
28-
"@types/jest": "^26.0.4",
29-
"husky": "^4.2.5",
30-
"jest": "^26.1.0",
31-
"lint-staged": "^10.2.11",
32-
"open-cli": "^6.0.1",
33-
"parcel-bundler": "^1.12.4",
34-
"prettier": "^2.0.5",
35-
"ts-jest": "^26.1.2",
36-
"typedoc": "^0.17.8",
37-
"typescript": "^3.9.6"
29+
"@parcel/packager-ts": "^2.7.0",
30+
"@parcel/transformer-typescript-types": "^2.7.0",
31+
"@types/jest": "^28.1.6",
32+
"husky": "^8.0.1",
33+
"jest": "^28.1.3",
34+
"lint-staged": "^13.0.3",
35+
"open-cli": "^7.0.1",
36+
"parcel": "^2.7.0",
37+
"prettier": "^2.7.1",
38+
"ts-jest": "^28.0.7",
39+
"typedoc": "^0.23.10",
40+
"typescript": "~4.7.4"
3841
},
3942
"prettier": {
4043
"singleQuote": true,
@@ -43,28 +46,23 @@
4346
"tabWidth": 4
4447
},
4548
"lint-staged": {
46-
"*.{md,json,ts}": [
47-
"prettier --write"
48-
]
49+
"*.{md,json,ts}": "prettier --write"
4950
},
5051
"jest": {
5152
"preset": "ts-jest",
5253
"testTimeout": 8000
5354
},
55+
"browserslist": "> 0.5%, last 2 versions, not dead",
56+
"targets": {
57+
"main": {
58+
"optimize": true
59+
}
60+
},
5461
"scripts": {
5562
"test": "lint-staged && jest --no-cache",
56-
"debug": "node --inspect node_modules/jest/bin/jest --runInBand",
57-
"pack-type": "tsc && rm -f dist/*.{js,map}",
58-
"pack-dist": "parcel build source/index.ts --global IterableObserver",
59-
"pack-docs": "typedoc --name \"Iterable Observer\" --out docs/ source/",
60-
"build": "rm -rf dist/ && npm run pack-type && npm run pack-dist && npm run pack-docs",
61-
"help": "npm run pack-docs && open-cli docs/index.html",
63+
"pack-docs": "typedoc source/",
64+
"build": "rm -rf dist/ docs/ && parcel build && npm run pack-docs",
65+
"start": "npm run pack-docs && open-cli docs/index.html",
6266
"prepublishOnly": "npm test && npm run build"
63-
},
64-
"husky": {
65-
"hooks": {
66-
"pre-commit": "npm test",
67-
"pre-push": "npm run build"
68-
}
6967
}
7068
}

0 commit comments

Comments
 (0)