Skip to content

Commit

Permalink
Migrate to ES Module (#1573)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Aug 5, 2021
1 parent 6c34723 commit 1b48826
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 172 deletions.
23 changes: 0 additions & 23 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ module.exports = {
rules: {},
plugins: [],
globals: {},
overrides: [],
overrides: [{files: ['test/**/*'], extends: ['@fisker/ava']}],
}
3 changes: 0 additions & 3 deletions .github/funding.yml

This file was deleted.

54 changes: 24 additions & 30 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
pull_request:
# schedule:
# - cron: "0 23 * * 6"
Expand All @@ -18,9 +18,9 @@ jobs:
- "macos-latest"
- "windows-latest"
node_version:
- "16"
- "14"
- "12"
- "10"
# exclude:
# - os: "macos-latest"
# node_version: "12"
Expand All @@ -30,20 +30,18 @@ jobs:
# needs: [build]
steps:
- name: Checkout
uses: actions/checkout@master
with:
depth: 1
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@master
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}

- name: Install Dependencies
run: yarn

# - name: Download Artifact
# uses: actions/download-artifact@master
# uses: actions/download-artifact@v2
# with:
# name: dist
# path: dist
Expand Down Expand Up @@ -75,39 +73,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@master
uses: actions/setup-node@v2

- name: Install Dependencies
run: yarn

- name: Run Lint
run: yarn lint

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
# build:
# name: Build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@master
# - name: Setup Node.js
# uses: actions/setup-node@v2

- name: Install Dependencies
run: yarn
# - name: Install Dependencies
# run: yarn

- name: Build Package
run: yarn build
# - name: Build Package
# run: yarn build

- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
# - name: Upload Artifact
# uses: actions/upload-artifact@v2
# with:
# name: dist
# path: dist
File renamed without changes.
26 changes: 0 additions & 26 deletions babel.config.js

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions src/index.js → index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Buffer} from 'node:buffer'
import {decode, encode, toRGBA8} from 'lib-upng'
import isPng from 'is-png'

Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js → lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* config file for `lint-staged`
*
* update: wget -O lint-staged.config.js https://git.io/fhNpr
* update: wget -O lint-staged.config.js https://git.io/fjVj9
* document: https://git.io/fhNpF
*
*/
Expand Down
47 changes: 16 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
"url": "https://www.fiskercheung.com/"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "module",
"exports": "./index.js",
"files": [
"dist"
"index.js"
],
"scripts": {
"build": "run-p build:*",
"build:js": "rollup --config",
"build": "echo no need",
"clean": "run-p clean:*",
"clean:dist": "del-cli dist",
"dist": "run-p dist:*",
Expand All @@ -59,10 +58,6 @@
}
},
"ava": {
"babel": true,
"require": [
"esm"
],
"verbose": true
},
"nyc": {
Expand All @@ -72,38 +67,28 @@
]
},
"dependencies": {
"is-png": "2.0.0",
"is-png": "3.0.0",
"lib-upng": "2.0.1"
},
"devDependencies": {
"@ava/babel": "1.0.1",
"@babel/cli": "7.13.16",
"@babel/core": "7.14.2",
"@babel/plugin-proposal-object-rest-spread": "7.14.2",
"@babel/preset-env": "7.14.2",
"@commitlint/cli": "12.1.4",
"@commitlint/cli": "13.1.0",
"@fisker/commitlint-config": "1.3.6",
"@fisker/eslint-config": "6.0.1",
"@fisker/eslint-config": "7.1.1",
"@fisker/eslint-config-ava": "2.0.2",
"@fisker/husky-config": "4.0.4",
"@fisker/lint-staged-config": "3.0.4",
"@fisker/prettier-config": "4.0.4",
"@fisker/husky-config": "4.1.0",
"@fisker/lint-staged-config": "3.1.0",
"@fisker/prettier-config": "4.1.1",
"ava": "3.15.0",
"babel-plugin-transform-async-to-promises": "0.8.15",
"cz-conventional-changelog": "3.3.0",
"del-cli": "3.0.1",
"eslint": "7.26.0",
"esm": "3.2.25",
"husky": "6.0.0",
"del-cli": "4.0.1",
"eslint": "7.32.0",
"husky": "7.0.1",
"imagemin": "8.0.0",
"lint-staged": "11.0.0",
"markdownlint-cli": "0.27.1",
"lint-staged": "11.1.1",
"markdownlint-cli": "0.28.1",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"prettier": "2.3.0",
"rollup": "2.48.0",
"rollup-plugin-babel": "4.4.0",
"rollup-plugin-prettier": "2.1.0",
"prettier": "2.3.2",
"sort-package-json": "1.50.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion prettier.config.js → prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* config file for `prettier`
*
* update: wget -O prettier.config.js https://git.io/fjJKh
* update: wget -O prettier.config.js https://git.io/fjVjd
* document: https://prettier.io/docs/en/options.html
*/

Expand Down
22 changes: 0 additions & 22 deletions rollup.config.js

This file was deleted.

20 changes: 0 additions & 20 deletions test/.eslintrc.js

This file was deleted.

Loading

0 comments on commit 1b48826

Please sign in to comment.