Skip to content

Commit

Permalink
📦 Move to ESM only (#11)
Browse files Browse the repository at this point in the history
- vitest instead of jest
- update dependencies (open peer deps)
- simplify and update GitHub action

Maintains `requirejs` bundles to be used in the browser.
No code changes.
  • Loading branch information
rowanc1 authored Sep 26, 2023
1 parent 032fe46 commit ec3b88e
Show file tree
Hide file tree
Showing 8 changed files with 4,270 additions and 10,305 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ env:
node: true
browser: true
es6: true
jest: true
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:jest/recommended"
- "plugin:prettier/recommended"
parser: "@typescript-eslint/parser"
parserOptions:
Expand Down
47 changes: 12 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,26 @@ on:
jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cache packages
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint

node-version: 18.x
- run: npm ci
- run: npm run lint
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]

node-version: [16.x, 18.x]
steps:
- uses: actions/checkout@v2
- name: Cache packages
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- uses: actions/checkout@v3
- 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
run: npm ci
- run: npm ci
- name: Run tests and generate coverage report
run: npm test -- --coverage
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
- name: Test the build
run: npm run build
run: npm run test -- --coverage
- run: npm run build
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const text = mdit.render("$a = 1$")
In the browser:

```html
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Example Page</title>
Expand Down Expand Up @@ -88,7 +88,7 @@ In the browser:
- TypeScript
- Code Formatting ([prettier])
- Code Linting ([eslint])
- Testing and coverage ([jest])
- Testing and coverage ([vitest])
- Continuous Integration ([GitHub Actions])
- Bundled as both UMD and ESM ([rollup])
- Upload as [NPM] package and [unpkg] CDN
Expand Down Expand Up @@ -126,7 +126,7 @@ This can be deployed by [GitHub Pages].
[github pages]: https://docs.github.com/en/pages
[prettier]: https://prettier.io/
[eslint]: https://eslint.org/
[jest]: https://facebook.github.io/jest/
[vitest]: https://vitest.dev/
[rollup]: https://rollupjs.org
[npm]: https://www.npmjs.com
[unpkg]: https://unpkg.com/
Loading

0 comments on commit ec3b88e

Please sign in to comment.