Skip to content

Commit

Permalink
feat: package as a module (#63)
Browse files Browse the repository at this point in the history
* feat: package as a module

* move date-fns to peer dependencies

* update actions

* move module as first build config

* add .DS_Store to .gitignore

* use date-fns 2.19 for bundle
  • Loading branch information
kurkle authored Dec 10, 2022
1 parent e0b341d commit 40c75c0
Show file tree
Hide file tree
Showing 9 changed files with 2,279 additions and 2,187 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 40c75c0

Please sign in to comment.