Skip to content

Commit 37dcecb

Browse files
committed
Setup Github Actions
1 parent bc5ad69 commit 37dcecb

File tree

9 files changed

+194
-19
lines changed

9 files changed

+194
-19
lines changed

Diff for: .github/workflows/ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ jobs:
4848
- name: Build
4949
run: pnpm build
5050

51-
- name: Unit and e2e tests
51+
- name: Unit tests
5252
run: pnpm test
5353

54+
- name: E2e tests
55+
run: pnpm test:e2e
56+
5457
- uses: actions/upload-artifact@v3
5558
if: always()
5659
with:

Diff for: .husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm exec lint-staged

Diff for: .ladle/vite-plugin-node.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/* eslint-env node */
22

3-
import { builtinModules, createRequire } from "node:module";
3+
import { builtinModules } from "node:module";
44
import nodeLibsBrowser from "node-libs-browser";
55

6-
const require = createRequire(import.meta.url);
7-
86
function NodeBuiltinsPolyfillPlugin() {
97
return {
108
name: "vite:node-builtins-polyfill",
11-
config(config) {
9+
config() {
1210
const aliasEntries = [];
1311
for (let moduleName of builtinModules) {
1412
const polyfillPath = nodeLibsBrowser[moduleName];

Diff for: .lintstagedrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"*.{js,ts,tsx,css,scss,postcss,md,json}": [
3+
"prettier --write --plugin-search-dir=.",
4+
"prettier --check --plugin-search-dir=."
5+
],
6+
"*.{js,ts,tsx}": "eslint"
7+
}

Diff for: LICENSE-HEAD

-6
This file was deleted.

Diff for: package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"sideEffects": false,
2222
"scripts": {
2323
"build": "tsc --p tsconfig.lib.json && tsc --p tsconfig.es.json",
24-
"lint": "eslint '{examples,src}/**/*.{js,ts,tsx}' vite.config.js",
24+
"lint": "eslint '{examples,src}/**/*.{js,ts,tsx}' vite.config.js .ladle",
2525
"prebuild": "rimraf dist",
26-
"test": "tsc && yarn lint && vitest src",
27-
"test:unit": "vitest src",
28-
"test:e2e": "pnpm test:e2e:dev && pnpm test:e2e:prod",
29-
"test:e2e:dev": "export TYPE=dev && pnpm exec playwright test",
30-
"test:e2e:prod": "export TYPE=prod && pnpm exec playwright test",
26+
"test": "vitest src --run",
27+
"test:dev": "vitest src",
28+
"test:e2e": " pnpm test:e2e:dev && pnpm test:e2e:prod",
29+
"test:e2e:dev": "TYPE=dev && pnpm exec playwright test",
30+
"test:e2e:prod": "TYPE=prod && pnpm exec playwright test",
3131
"typecheck": "tsc"
3232
},
3333
"dependencies": {
@@ -65,6 +65,8 @@
6565
"eslint-config-prettier": "^9.0.0",
6666
"eslint-plugin-prettier": "^5.0.1",
6767
"eslint-plugin-react": "^7.33.2",
68+
"husky": "^8.0.3",
69+
"lint-staged": "^15.1.0",
6870
"node-libs-browser": "^2.2.1",
6971
"react": "^18.2.0",
7072
"react-dom": "^18.2.0",

Diff for: playwright.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ const config: PlaywrightTestConfig = {
2020
// Opt out of parallel tests on CI.
2121
workers: process.env.CI ? 1 : undefined,
2222
use: {
23-
baseURL: `http://localhost:61000`,
23+
baseURL: `http://127.0.0.1:${process.env.TYPE === "dev" ? 61000 : 8080}`,
2424
},
2525
webServer: {
2626
reuseExistingServer: true,
2727
command: getCommand(process.env.TYPE),
28-
url: `http://localhost:61000`,
28+
url: `http://127.0.0.1:${process.env.TYPE === "dev" ? 61000 : 8080}`,
2929
},
3030
};
3131

Diff for: pnpm-lock.yaml

+160
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)