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

Modernize #66

Merged
merged 8 commits into from
Apr 19, 2024
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
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ on:
- 'docs/**'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js LTS
uses: actions/setup-node@v1
with:
node-version: '18.x'
- uses: bahmutov/npm-install@v1
- name: Lint Check
run: npx @biomejs/biome lint src
- name: Format Check
run: npx @biomejs/biome format src
unit-test:
runs-on: ubuntu-latest
steps:
Expand All @@ -20,7 +34,7 @@ jobs:
- name: Use Node.js LTS
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 18 is required to run biome

- uses: bahmutov/npm-install@v1
- name: Unit Tests
run: make test
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ install:
@bower install

build-dev:
@${CURDIR}/node_modules/.bin/webpack
@NODE_ENV=development npm run build

build:
@${CURDIR}/node_modules/.bin/webpack --mode=production
@NODE_ENV=production npm run build

watch:
@${CURDIR}/node_modules/.bin/webpack --watch
@NODE_ENV=development npm run build --watch

test:
@npm run test

format:
@npm run format

lint:
@npm run lint
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Intercept AJAX calls to fake a REST server based on JSON data. Use it on top of [Sinon.js](http://sinonjs.org/) (for `XMLHTTPRequest`) or [fetch-mock](https://github.com/wheresrhys/fetch-mock) (for `fetch`) to test JavaScript REST clients on the browser side (e.g. single page apps) without a server.

See it in action in the [react-admin](https://marmelab.com/react-admin/) [demo](https://marmelab.com/react-admin-demo) ([source code](https://github.com/marmelab/react-admin/tree/master/examples/demo)).

## Usage

### Fake XMLHTTPRequest
Expand Down
22 changes: 22 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
33 changes: 0 additions & 33 deletions bower.json

This file was deleted.

78 changes: 0 additions & 78 deletions example/fetch.html

This file was deleted.

81 changes: 0 additions & 81 deletions example/index.html

This file was deleted.

22 changes: 0 additions & 22 deletions example/ng-admin/Readme.md

This file was deleted.

19 changes: 0 additions & 19 deletions example/ng-admin/bower.json

This file was deleted.

Loading
Loading