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

feat: package as a module #63

Merged
merged 6 commits into from Dec 10, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.yml
Expand Up @@ -8,7 +8,7 @@ env:
node: true

parserOptions:
ecmaVersion: 2018
ecmaVersion: 2022
sourceType: module
ecmaFeatures:
impliedStrict: true
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -17,9 +17,10 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
- run: |
npm ci
npm run build
Expand Down Expand Up @@ -52,4 +53,4 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
parallel-finished: true
2 changes: 1 addition & 1 deletion .github/workflows/compressed-size.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
13 changes: 7 additions & 6 deletions .github/workflows/npmpublish.yml
Expand Up @@ -18,9 +18,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
- name: Test
run: |
npm ci
Expand All @@ -29,10 +30,10 @@ jobs:
needs: [test, setup]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
cache: npm
registry-url: https://registry.npmjs.org/
- name: Setup and build
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ coverage/
dist/
node_modules/
*.stackdump
.DS_Store
6 changes: 3 additions & 3 deletions karma.conf.js → karma.conf.cjs
@@ -1,10 +1,10 @@
const istanbul = require('rollup-plugin-istanbul');
const resolve = require('@rollup/plugin-node-resolve').default;
const builds = require('./rollup.config');
const yargs = require('yargs');
const env = process.env.NODE_ENV;

module.exports = function(karma) {
module.exports = async function(karma) {
const builds = (await import('./rollup.config.js')).default;
const args = yargs
.option('verbose', {default: false})
.argv;
Expand Down Expand Up @@ -54,7 +54,7 @@ module.exports = function(karma) {
},

files: [
{pattern: 'node_modules/chart.js/dist/chart.js'},
{pattern: 'node_modules/chart.js/dist/chart.umd.js'},
{pattern: 'src/index.js', watched: false},
{pattern: 'test/index.js'},
{pattern: 'test/specs/**/**.js'}
Expand Down