Skip to content

Commit 2300093

Browse files
committed
refactor: use wopjs template
1 parent 9498f89 commit 2300093

24 files changed

+7571
-3067
lines changed

.eslintignore

-4
This file was deleted.

.eslintrc.cjs

-22
This file was deleted.

.github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
groups:
13+
dev-dependencies:
14+
patterns:
15+
- "*"
16+
dependencies:
17+
patterns:
18+
- "*"

.github/workflows/build.yml

+19-22
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,40 @@ on:
66
jobs:
77
build-and-deploy:
88
runs-on: ubuntu-latest
9-
environment: production
109
steps:
1110
- name: Checkout 🛎️
1211
uses: actions/checkout@v4
1312

14-
- name: Install pnpm 📦
15-
uses: pnpm/action-setup@v4
13+
- uses: actions/setup-node@v4
1614
with:
17-
run_install: false
18-
19-
- name: Install Node.js 🚀
20-
uses: actions/setup-node@v4
21-
with:
22-
cache: "pnpm"
15+
node-version: lts/*
16+
cache: npm
2317

2418
- name: Install dependencies 📦
25-
run: pnpm install
19+
run: npm ci
20+
env:
21+
npm_config_audit: "false"
22+
npm_config_fund: "false"
23+
npm_config_loglevel: "error"
2624

2725
- name: Lint 🧹
28-
run: pnpm run lint
29-
30-
- name: Test 🧪
31-
run: pnpm run coverage
26+
run: |
27+
npm run lint
28+
npm run ts-check
3229
3330
- name: Build 🔧
34-
run: pnpm run build
31+
run: npm run build
3532

36-
- name: Upload Coverage
37-
uses: paambaati/codeclimate-action@v8
38-
env:
39-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
33+
- name: Test 🧪
34+
run: npm run test:ci
35+
36+
- name: Coveralls 🎉
37+
uses: coverallsapp/github-action@v2
4038
with:
41-
coverageLocations: ${{github.workspace}}/coverage/clover.xml:clover
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
4240

4341
- name: Build Docs 📖
44-
run: |
45-
pnpm run docs
42+
run: npm run docs
4643

4744
- name: Deploy 🚀
4845
uses: JamesIves/github-pages-deploy-action@v4

.github/workflows/pr.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,25 @@ jobs:
1010
- name: Checkout 🛎️
1111
uses: actions/checkout@v4
1212

13-
- name: Install pnpm 📦
14-
uses: pnpm/action-setup@v4
13+
- uses: actions/setup-node@v4
1514
with:
16-
run_install: false
17-
18-
- name: Install Node.js 🚀
19-
uses: actions/setup-node@v4
20-
with:
21-
cache: "pnpm"
15+
node-version: lts/*
16+
cache: npm
2217

2318
- name: Install dependencies 📦
24-
run: pnpm install
19+
run: npm ci
20+
env:
21+
npm_config_audit: "false"
22+
npm_config_fund: "false"
23+
npm_config_loglevel: "error"
2524

2625
- name: Lint 🧹
27-
run: pnpm run lint
28-
29-
- name: Test 🧪
30-
run: pnpm run coverage
26+
run: |
27+
npm run lint
28+
npm run ts-check
3129
3230
- name: Build 🔧
33-
run: pnpm run build
31+
run: npm run build
32+
33+
- name: Test 🧪
34+
run: npm run test:ci

.github/workflows/publish.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Node.js Package
2+
3+
on:
4+
push:
5+
tags: "v**"
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
steps:
18+
- name: Checkout 🛎️
19+
uses: actions/checkout@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: lts/*
24+
registry-url: "https://registry.npmjs.org"
25+
cache: npm
26+
27+
- name: Install dependencies 📦
28+
run: npm ci
29+
env:
30+
npm_config_audit: "false"
31+
npm_config_fund: "false"
32+
npm_config_loglevel: "error"
33+
34+
- name: Build 🔧
35+
run: npm run build
36+
37+
- name: Publish Package 🚀
38+
run: npm publish --provenance --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.prettierignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
dist/*
2-
coverage/*
3-
docs/*
41
CHANGELOG.md
52
pnpm-lock.yaml
3+
package-lock.json

.prettierrc.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
{
2-
"trailingComma": "es5",
2+
"printWidth": 120,
3+
"trailingComma": "all",
34
"tabWidth": 2,
45
"semi": true,
56
"singleQuote": false,
67
"endOfLine": "auto",
7-
"arrowParens": "avoid"
8+
"arrowParens": "avoid",
9+
"overrides": [
10+
{
11+
"files": "*.json",
12+
"options": {
13+
"printWidth": 80
14+
}
15+
}
16+
]
817
}

.vscode/settings.json

+11-53
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,28 @@
11
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"cSpell.enabled": true,
4+
"eslint.enable": true,
5+
"prettier.enable": true,
6+
"conventionalCommits.gitmoji": false,
7+
"conventionalCommits.promptFooter": false,
28
"editor.tabSize": 2,
39
"editor.formatOnSave": true,
4-
"editor.defaultFormatter": "esbenp.prettier-vscode",
510
"editor.codeActionsOnSave": {
611
"source.fixAll": "explicit",
7-
"source.addMissingImports": "explicit"
8-
},
9-
"eslint.probe": [
10-
"javascript",
11-
"javascriptreact",
12-
"typescript",
13-
"typescriptreact",
14-
"html",
15-
"vue",
16-
"svelte",
17-
"markdown"
18-
],
19-
"eslint.validate": [
20-
"javascript",
21-
"javascriptreact",
22-
"typescript",
23-
"typescriptreact",
24-
"html",
25-
"vue",
26-
"svelte",
27-
"markdown"
28-
],
29-
"typescript.tsdk": "node_modules/typescript/lib",
30-
"[html]": {
31-
"editor.formatOnSave": true,
32-
"editor.defaultFormatter": "esbenp.prettier-vscode"
33-
},
34-
"[css]": {
35-
"editor.formatOnSave": true,
36-
"editor.defaultFormatter": "esbenp.prettier-vscode"
37-
},
38-
"[scss]": {
39-
"editor.formatOnSave": true,
40-
"editor.defaultFormatter": "esbenp.prettier-vscode"
41-
},
42-
"[json]": {
43-
"editor.formatOnSave": true,
44-
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
"source.addMissingImports": "explicit",
13+
"source.organizeImports": "never"
4514
},
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4616
"[javascript]": {
47-
"editor.formatOnSave": true,
4817
"editor.defaultFormatter": "esbenp.prettier-vscode"
4918
},
50-
"[svelte]": {
51-
"editor.formatOnSave": true,
52-
"editor.defaultFormatter": "svelte.svelte-vscode"
19+
"[javascriptreact]": {
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5321
},
5422
"[typescript]": {
55-
"editor.formatOnSave": true,
5623
"editor.defaultFormatter": "esbenp.prettier-vscode"
5724
},
5825
"[typescriptreact]": {
59-
"editor.formatOnSave": true,
60-
"editor.defaultFormatter": "esbenp.prettier-vscode"
61-
},
62-
"[markdown]": {
63-
"editor.formatOnSave": true,
64-
"editor.defaultFormatter": "esbenp.prettier-vscode"
65-
},
66-
"[yaml]": {
67-
"editor.formatOnSave": true,
6826
"editor.defaultFormatter": "esbenp.prettier-vscode"
6927
}
7028
}

CHANGELOG.md

-9
This file was deleted.

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 wopjs
3+
Copyright (c) 2024 wopjs
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+20-10
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@
22

33
[![Docs](https://img.shields.io/badge/Docs-read-%23fdf9f5)](https://wopjs.github.io/async-seq)
44
[![Build Status](https://github.com/wopjs/async-seq/actions/workflows/build.yml/badge.svg)](https://github.com/wopjs/async-seq/actions/workflows/build.yml)
5-
[![Coverage Status](https://img.shields.io/codeclimate/coverage/wopjs/async-seq)](https://codeclimate.com/github/wopjs/async-seq)
6-
75
[![npm-version](https://img.shields.io/npm/v/@wopjs/async-seq.svg)](https://www.npmjs.com/package/@wopjs/async-seq)
6+
[![Coverage Status](https://img.shields.io/coverallsCoverage/github/wopjs/async-seq)](https://coveralls.io/github/wopjs/async-seq)
87
[![minified-size](https://img.shields.io/bundlephobia/minzip/@wopjs/async-seq)](https://bundlephobia.com/package/@wopjs/async-seq)
9-
[![no-dependencies](https://img.shields.io/badge/dependencies-none-success)](https://bundlejs.com/?q=@wopjs/async-seq)
10-
[![tree-shakable](https://img.shields.io/badge/tree-shakable-success)](https://bundlejs.com/?q=@wopjs/async-seq)
11-
[![side-effect-free](https://img.shields.io/badge/side--effect-free-success)](https://bundlejs.com/?q=@wopjs/async-seq)
128

139
Run async functions one-by-one in a sequence.
1410

15-
Docs: <https://wopjs.github.io/async-seq/>
16-
1711
## Install
1812

1913
```
@@ -36,7 +30,7 @@ await s.add(
3630
async () => {
3731
const data = await fetch("https://example.com").then(r => r.json());
3832
console.log(data);
39-
}
33+
},
4034
);
4135

4236
// or manually wait for the sequence to finish
@@ -68,6 +62,22 @@ for (let i = 0; i < 10; i++) {
6862
}
6963
```
7064

71-
## License
65+
## Development
66+
67+
### Publish New Version
68+
69+
You can use [npm version](https://docs.npmjs.com/cli/v10/commands/npm-version) to bump version.
70+
71+
```
72+
npm version patch
73+
```
74+
75+
Push the tag to remote and CI will publish the new version to npm.
76+
77+
```
78+
git push --follow-tags
79+
```
80+
81+
### CI Auto Publish
7282

73-
MIT @ [wopjs](https://github.com/wopjs)
83+
If you want to publish the package in CI, you need to set the `NPM_TOKEN` secrets [in GitHub repository settings](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). See how to [create a NPM access token](https://docs.npmjs.com/creating-and-viewing-access-tokens).

cspell.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"language": "en",
33
"words": [
4-
"Abortable",
54
"coverallsapp",
65
"CRIMX",
6+
"endregion",
77
"hyrious",
88
"lcov",
9-
"paambaati",
9+
"loglevel",
10+
"mjsx",
11+
"mtsx",
1012
"Parens",
11-
"pnpm",
1213
"preinstall",
1314
"treeshake",
1415
"tsup",
@@ -24,7 +25,6 @@
2425
"**/node_modules/**",
2526
"**/dist/**",
2627
"cspell.config.js",
27-
"pnpm-lock.yaml",
2828
"CHANGELOG.md"
2929
]
3030
}

0 commit comments

Comments
 (0)