Skip to content

Commit

Permalink
Migrate from Webpack and Jest to Vite and Vitest (#3104)
Browse files Browse the repository at this point in the history
* Replace Webpack with Vite

* Bulk rename component test files to use jsx

* Don't mock `react-dom` when we don't have to

* Repalce Jest with Vitest

* Fix tests after vitest migration

* Rename dist folder for publish-to-gh-pages
  • Loading branch information
grahamalama authored Jan 16, 2024
1 parent 8ade740 commit 47ed19d
Show file tree
Hide file tree
Showing 54 changed files with 4,278 additions and 3,130 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"env": {
"es6": true,
"browser": true,
"node": true,
"jest": true
"node": true
},
"extends": ["prettier"],
"parserOptions": {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ This will generate a production-ready assets in a `build` directory, ready to be
Use the following options to customize the Kinto Admin build.

### Single Server
By default, Kinto Admin gives you the option to connect to multiple Kinto Servers. If you only want Kinto Admin to connect to the server from which it's being served, you can set the `SINGLE_SERVER` flag as an environment variable:
By default, Kinto Admin gives you the option to connect to multiple Kinto Servers. If you only want Kinto Admin to connect to the server from which it's being served, you can set the `KINTO_ADMIN_SINGLE_SERVER` flag as an environment variable:

```
SINGLE_SERVER=1 npm run build
KINTO_ADMIN_SINGLE_SERVER=1 npm run build
```

### Building for relative paths
Expand Down
6 changes: 0 additions & 6 deletions StubModule.js

This file was deleted.

13 changes: 13 additions & 0 deletions __mocks__/kinto-http.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { DEFAULT_SERVERINFO } from "../src/reducers/session";
import { vi } from 'vitest';

export const mockFetchServerInfo = vi.fn().mockReturnValue(DEFAULT_SERVERINFO);

const mock = vi.fn().mockImplementation(server => {
return {
fetchServerInfo: mockFetchServerInfo,
remote: server,
};
});

export default mock;
12 changes: 0 additions & 12 deletions html/index.html

This file was deleted.

17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Kinto Administration</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.png">
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/index.tsx"></script>
</body>


</html>
10 changes: 0 additions & 10 deletions jest.config.js

This file was deleted.

Loading

0 comments on commit 47ed19d

Please sign in to comment.