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

add CommonJS (CJS) compatibility #91

Merged
merged 4 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
},
"modules": "commonjs"
}
]
],
"plugins": [
"add-module-exports"
],
"sourceMaps": true
}
3 changes: 3 additions & 0 deletions .github/workflows/nodejs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install dependencies
run:
yarn install
- name: Build
run:
yarn build
- name: Run tests
env:
apiKey: ${{ secrets.APIKEY }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/

.yarn/*
!.yarn/patches
!.yarn/plugins
Expand Down
7 changes: 7 additions & 0 deletions .mocharc.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extension": ["js"],
"spec": ["test/cjs/*.{test,spec}.cjs", "test/package.test.cjs"],
"require": ["@babel/register"],
"timeout": 60000,
"exit": true
}
6 changes: 6 additions & 0 deletions .mocharc.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extension": ["mjs"],
"spec": "test/**/*.{test,spec}.mjs",
"timeout": 60000,
"exit": true
}
4 changes: 0 additions & 4 deletions .mocharc.json

This file was deleted.

Loading