Skip to content

Commit

Permalink
chore: fix netlify build
Browse files Browse the repository at this point in the history
chore: make demo use React 18
  • Loading branch information
RIP21 committed Oct 1, 2022
1 parent 62a7f49 commit ff82606
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 43 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
- name: Install pnpm
run: npm install pnpm -g

- name: Install dependencies
run: pnpm install

Expand Down
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build.environment]
NODE_VERSION = "20"
NPM_FLAGS = "--version" # prevent Netlify npm install
[build]
publish = "./dist"
command = "npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npm run build:demo"
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
"devDependencies": {
"@playwright-testing-library/test": "~4.5.0",
"@playwright/test": "~1.26.1",
"@testing-library/react": "~12.1.5",
"@testing-library/react": "~13.4.0",
"@testing-library/user-event": "~14.4.3",
"@types/codemirror": "~5.60.5",
"@types/node": "~16.11.62",
"@types/react": "~17.0.50",
"@types/react-dom": "~17.0.11",
"@types/react": "~18.0.21",
"@types/react-dom": "~18.0.6",
"easymde": "~2.18.0",
"happy-dom": "~6.0.4",
"jsdom": "~20.0.0",
"prettier": "~2.7.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"tsup": "~6.2.3",
"typescript": "~4.8.4",
"vite": "~3.1.4",
Expand Down
65 changes: 31 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import * as ReactDOM from "react-dom";
import { createRoot } from "react-dom/client";
import Demo from "./demo/Demo";
import React from "react";
import React, { StrictMode } from "react";

ReactDOM.render(<Demo />, document.getElementById("root"));
const container = document.getElementById("root");
const root = createRoot(container!);

root.render(
<StrictMode>
<Demo />
</StrictMode>
);
2 changes: 2 additions & 0 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import "vitest-dom/extend-expect";
// @ts-ignore
globalThis.IS_REACT_ACT_ENVIRONMENT = true;

0 comments on commit ff82606

Please sign in to comment.