Skip to content

Commit eb6c5ef

Browse files
committed
chore: migrate from yarn to pnpm & support cdn output & update CI
1 parent 6701f38 commit eb6c5ef

File tree

5 files changed

+3148
-2468
lines changed

5 files changed

+3148
-2468
lines changed

.github/workflows/main.yml

+26-16
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,57 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node: ['14.x', '16.x']
16+
node: ['18.x', '20.x']
1717

1818
steps:
1919
- name: Checkout repo
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121

22-
- name: Use Node ${{ matrix.node }}
23-
uses: actions/setup-node@v1
22+
- name: Setup PNPM
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Install Node.js ${{ matrix.node }}
26+
uses: actions/setup-node@v4
2427
with:
2528
node-version: ${{ matrix.node }}
26-
27-
- name: Install deps and build (with cache)
28-
uses: bahmutov/npm-install@v1
29+
cache: "pnpm"
30+
31+
- name: Install dependencies
32+
shell: bash
33+
run: pnpm install
2934

3035
- name: Lint
31-
run: yarn lint --quiet
36+
run: pnpm lint --quiet
3237

3338
- name: Test
34-
run: yarn test:coverage
39+
run: pnpm test:coverage
3540

3641
- name: Build
37-
run: yarn build
42+
run: pnpm build
3843

3944
test-and-publish:
4045
name: 🎉 Publish to NPM
4146
needs: [build]
4247
if: github.repository == 'quran/api-js' && (github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
4348
runs-on: ubuntu-latest
4449
steps:
45-
- uses: actions/checkout@v2
50+
- uses: actions/checkout@v4
51+
52+
- name: Setup PNPM
53+
uses: pnpm/action-setup@v4
4654

47-
- uses: actions/setup-node@v2
55+
- uses: actions/setup-node@v4
4856
with:
49-
node-version: 14
57+
node-version: 20
5058
registry-url: https://registry.npmjs.org/
59+
cache: "pnpm"
5160

52-
- name: Install deps (with cache)
53-
uses: bahmutov/npm-install@v1
61+
- name: Install dependencies
62+
shell: bash
63+
run: pnpm install
5464

5565
- name: Build
56-
run: yarn build
66+
run: pnpm build
5767

5868
- run: npx semantic-release@17
5969
env:

package.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@
55
"publishConfig": {
66
"access": "public"
77
},
8+
"packageManager": "[email protected]",
89
"version": "1.0.0",
910
"license": "MIT",
1011
"main": "dist/index.js",
11-
"typings": "dist/index.d.ts",
1212
"module": "dist/index.mjs",
13+
"browser": "dist/umd/index.global.js",
14+
"types": "dist/index.d.ts",
15+
"exports": {
16+
".": {
17+
"require": "./dist/index.js",
18+
"import": "./dist/index.mjs"
19+
},
20+
"./cdn": "./dist/umd/index.global.js"
21+
},
1322
"files": [
14-
"dist",
15-
"src"
23+
"dist"
1624
],
1725
"scripts": {
1826
"start": "tsup --watch",

0 commit comments

Comments
 (0)