Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to ES Module #62

Merged
merged 15 commits into from
Oct 20, 2023
76 changes: 15 additions & 61 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ jobs:
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 12
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 18.x
- name: Install dependencies
run: npm i
- name: Run lint step
Expand All @@ -35,21 +28,14 @@ jobs:
strategy:
matrix:
node-version:
- 10.x # to be removed 2021-04-01
- 12.x # to be removed 2022-04-30
- x.x.x # safety net; don't remove
- 16.x # to be removed 2023-09-11
- 18.x # to be removed 2025-04-30
- 20.x # to be removed 2026-04-30
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
Expand All @@ -63,57 +49,32 @@ jobs:
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 12
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 18.x
- name: Install dependencies
run: npm i
- name: Setup Headless Environment
run: sudo apt-get install xvfb
- name: Run Node.js Tests
run: xvfb-run --auto-servernum npm run test:browser -- --browsers Chrome,Firefox
run: npm run test:browser
- name: Upload coverage
if: success()
uses: codecov/codecov-action@v1
- name: Cleanup Headless Environment
run: |
xvfb_pids=`ps aux | grep tmp/xvfb-run | grep -v grep | awk '{print $2}'`
if [ "$xvfb_pids" != "" ]; then
echo "Killing the following xvfb processes: $xvfb_pids"
sudo kill $xvfb_pids
else
echo "No xvfb processes to kill"
fi

test-windows-browsers:
name: Test on Windows Firefox, Chrome & Edge
runs-on: windows-latest
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: $APP_DATA/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 12
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 18.x
- name: Install dependencies
run: npm i
- name: Run Node.js Tests
run: npm run test:browser -- --browsers Chrome,Firefox,IE
run: npm run test:browser

release:
name: Publish a Release
Expand All @@ -123,17 +84,10 @@ jobs:
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 12
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 18.x
- name: Install dependencies
run: npm i
- name: Run Semantic Release
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/commitlint.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ npm-debug.log
loupe.test.js
loupe.js
.nyc_output/
lib/
2 changes: 1 addition & 1 deletion bench/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import loupe from '../index'
import loupe from '../index.js'
import { inspect as nodeInspect } from 'util'
import Benchmark from 'benchmark'
const benches = []
Expand Down
3 changes: 0 additions & 3 deletions commitlint.config.js

This file was deleted.

17 changes: 0 additions & 17 deletions karma.conf.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/arguments.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/bigint.js

This file was deleted.

10 changes: 0 additions & 10 deletions lib/function.js

This file was deleted.

27 changes: 0 additions & 27 deletions lib/map.js

This file was deleted.

16 changes: 0 additions & 16 deletions lib/set.js

This file was deleted.

3 changes: 3 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import inspect, { custom } from './src/index.ts'
export default inspect
export { custom, inspect }
Loading
Loading