Skip to content

Commit

Permalink
Merge pull request #18 from quran/dev
Browse files Browse the repository at this point in the history
🎉  Add support for UMD
  • Loading branch information
ahmedriad1 authored Jan 7, 2025
2 parents ba1ac32 + 818682c commit 4a207f9
Show file tree
Hide file tree
Showing 8 changed files with 3,574 additions and 2,470 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
42 changes: 26 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,57 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14.x', '16.x']
node: ['18.x', '20.x']

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
- name: Setup PNPM
uses: pnpm/action-setup@v4

- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
cache: "pnpm"

- name: Install dependencies
shell: bash
run: pnpm install

- name: Lint
run: yarn lint --quiet
run: pnpm lint --quiet

- name: Test
run: yarn test:coverage
run: pnpm test:coverage

- name: Build
run: yarn build
run: pnpm build

test-and-publish:
name: 🎉 Publish to NPM
needs: [build]
if: github.repository == 'quran/api-js' && (github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
registry-url: https://registry.npmjs.org/
cache: "pnpm"

- name: Install deps (with cache)
uses: bahmutov/npm-install@v1
- name: Install dependencies
shell: bash
run: pnpm install

- name: Build
run: yarn build
run: pnpm build

- run: npx semantic-release@17
env:
Expand Down
29 changes: 20 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@
"publishConfig": {
"access": "public"
},
"version": "1.0.0",
"packageManager": "[email protected]",
"version": "1.7.1",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/index.mjs",
"main": "dist/index.min.js",
"module": "dist/index.min.mjs",
"browser": "dist/index.umd.min.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.min.js",
"import": "./dist/index.min.mjs"
},
"./cdn": "./dist/index.umd.min.js"
},
"files": [
"dist",
"src"
"dist"
],
"scripts": {
"postversion": "node ./scripts/postversion.mjs",
"start": "tsup --watch",
"build": "tsup",
"test": "vitest run",
Expand All @@ -29,12 +38,14 @@
"humps": "^2.0.1"
},
"devDependencies": {
"cross-fetch": "^3.1.5",
"@size-limit/preset-small-lib": "^7.0.8",
"@swc/core": "^1.10.4",
"@types/humps": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@vitest/coverage-c8": "^0.24.4",
"cross-fetch": "^3.1.5",
"esbuild-plugin-umd-wrapper": "^3.0.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
Expand All @@ -51,11 +62,11 @@
},
"size-limit": [
{
"path": "dist/index.js",
"path": "dist/index.min.js",
"limit": "15 KB"
},
{
"path": "dist/index.mjs",
"path": "dist/index.min.mjs",
"limit": "15 KB"
}
],
Expand Down
Loading

0 comments on commit 4a207f9

Please sign in to comment.