Skip to content

Commit ff82606

Browse files
committed
chore: fix netlify build
chore: make demo use React 18
1 parent 62a7f49 commit ff82606

File tree

6 files changed

+58
-43
lines changed

6 files changed

+58
-43
lines changed

.github/workflows/playwright.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v2
1414
with:
15-
node-version: '14.x'
15+
node-version: '16.x'
16+
- name: Install pnpm
17+
run: npm install pnpm -g
18+
1619
- name: Install dependencies
1720
run: pnpm install
1821

netlify.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build.environment]
2+
NODE_VERSION = "20"
3+
NPM_FLAGS = "--version" # prevent Netlify npm install
4+
[build]
5+
publish = "./dist"
6+
command = "npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npm run build:demo"

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@
4040
"devDependencies": {
4141
"@playwright-testing-library/test": "~4.5.0",
4242
"@playwright/test": "~1.26.1",
43-
"@testing-library/react": "~12.1.5",
43+
"@testing-library/react": "~13.4.0",
4444
"@testing-library/user-event": "~14.4.3",
4545
"@types/codemirror": "~5.60.5",
4646
"@types/node": "~16.11.62",
47-
"@types/react": "~17.0.50",
48-
"@types/react-dom": "~17.0.11",
47+
"@types/react": "~18.0.21",
48+
"@types/react-dom": "~18.0.6",
4949
"easymde": "~2.18.0",
5050
"happy-dom": "~6.0.4",
5151
"jsdom": "~20.0.0",
5252
"prettier": "~2.7.1",
53-
"react": "17.0.2",
54-
"react-dom": "17.0.2",
53+
"react": "18.2.0",
54+
"react-dom": "18.2.0",
5555
"tsup": "~6.2.3",
5656
"typescript": "~4.8.4",
5757
"vite": "~3.1.4",

pnpm-lock.yaml

Lines changed: 31 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
import * as ReactDOM from "react-dom";
1+
import { createRoot } from "react-dom/client";
22
import Demo from "./demo/Demo";
3-
import React from "react";
3+
import React, { StrictMode } from "react";
44

5-
ReactDOM.render(<Demo />, document.getElementById("root"));
5+
const container = document.getElementById("root");
6+
const root = createRoot(container!);
7+
8+
root.render(
9+
<StrictMode>
10+
<Demo />
11+
</StrictMode>
12+
);

src/setupTests.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
import "vitest-dom/extend-expect";
2+
// @ts-ignore
3+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;

0 commit comments

Comments
 (0)