Skip to content

Commit

Permalink
Merge pull request #135 from hiroki0525/tsup
Browse files Browse the repository at this point in the history
Change build system
  • Loading branch information
hiroki0525 authored Jan 28, 2024
2 parents b636cc7 + a176733 commit 32f0406
Show file tree
Hide file tree
Showing 11 changed files with 2,232 additions and 1,737 deletions.
16 changes: 16 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Setup
description: "Setup Node.js, pnpm and dependencies"

runs:
using: "composite"
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
shell: bash
14 changes: 2 additions & 12 deletions .github/workflows/check-bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@ jobs:
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build
run: pnpm build
- name: Run BundleMon
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,8 @@ jobs:
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build
run: pnpm build
- name: Deploy Package
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,14 @@ jobs:
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Lint Commit Messages
uses: wagoid/commitlint-github-action@v5
- uses: ./.github/actions/setup
# Broken this step
# https://github.com/wagoid/commitlint-github-action/issues/755
# - name: Lint Commit Messages
# uses: wagoid/commitlint-github-action@v5
- name: Test
run: pnpm t
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
18.19.0
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ setIdleTask(yourFunction1);
npm i idle-task
```

You can also use CDN.

```html
<script crossorigin src="https://unpkg.com/idle-task/dist/umd/index.js"></script>
```

## Quick Start

The simplest way is to use `setIdleTask` .
Expand Down
66 changes: 31 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"name": "idle-task",
"version": "4.2.2",
"description": "Improve your website performance by executing JavaScript during a browser's idle periods🚀",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"exports": {
"development": {
"require": "./dist/index.development.cjs.js",
"default": "./dist/index.development.es.js"
"require": "./dist/index.development.cjs",
"import": "./dist/index.development.mjs",
"default": "./dist/index.development.js"
},
"production": {
"require": "./dist/cjs/index.js",
"default": "./dist/es/index.js"
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
}
},
"types": "/dist/types/index.d.ts",
"types": "/dist/index.d.ts",
"sideEffects": false,
"files": [
"dist"
Expand All @@ -25,8 +27,7 @@
"test:server": "jest --env=node",
"test:lint": "eslint src/",
"test:prettier": "prettier src/",
"prebuild": "rm -rf dist/",
"build": "rollup -c",
"build": "tsup",
"prepare": "husky install"
},
"repository": {
Expand All @@ -47,32 +48,30 @@
},
"homepage": "https://github.com/hiroki0525/idle-task#readme",
"devDependencies": {
"@commitlint/cli": "17.7.2",
"@commitlint/config-conventional": "17.7.0",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "11.1.6",
"@commitlint/cli": "18.6.0",
"@commitlint/config-conventional": "18.6.0",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@types/jest": "29.5.11",
"@types/node": "18.17.19",
"@typescript-eslint/eslint-plugin": "6.6.0",
"@typescript-eslint/parser": "6.6.0",
"bundlemon": "^2.0.0",
"eslint": "8.48.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"@types/node": "^18",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"bundlemon": "^2.0.2",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-unused-imports": "3.0.0",
"husky": "8.0.3",
"jest": "29.6.4",
"jest-environment-jsdom": "^29.3.0",
"husky": "9.0.6",
"jest": "29.7.0",
"jest-environment-jsdom": "^29.7.0",
"npm-run-all": "^4.1.5",
"prettier": "3.0.3",
"rollup": "3.28.1",
"semantic-release": "21.1.2",
"prettier": "3.2.4",
"semantic-release": "23.0.0",
"ts-jest": "29.1.2",
"ts-loader": "9.4.4",
"tslib": "^2.6.0",
"typescript": "5.2.2"
"ts-loader": "9.5.1",
"tslib": "^2.6.2",
"tsup": "^8.0.1",
"typescript": "5.3.3"
},
"release": {
"plugins": [
Expand All @@ -94,15 +93,12 @@
],
"files": [
{
"path": "index.cjs.js"
"path": "index.cjs"
},
{
"path": "index.umd.js"
},
{
"path": "index.es.js"
"path": "index.js"
}
]
},
"packageManager": "pnpm@8.7.6"
"packageManager": "pnpm@8.14.3"
}
Loading

0 comments on commit 32f0406

Please sign in to comment.