-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update sandboxes to use vite and typescript #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,17 +12,17 @@ | |
"Titus Wormer <[email protected]> (wooorm.com)" | ||
], | ||
"workspaces": [ | ||
"sandbox-templates/react-markdown-with-create-react-app", | ||
"sandbox-templates/remark-rehype-with-parcel", | ||
"sandbox-templates/remark-with-parcel" | ||
"sandbox-templates/react-markdown-with-vite", | ||
"sandbox-templates/remark-rehype-with-vite", | ||
"sandbox-templates/remark-with-vite" | ||
], | ||
"devDependencies": { | ||
"eslint-config-xo-react": "^0.26.0", | ||
"prettier": "^2.0.0", | ||
"eslint-config-xo-react": "^0.27.0", | ||
"prettier": "^3.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-frontmatter": "^4.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"xo": "^0.47.0" | ||
"xo": "^0.55.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
|
@@ -48,7 +48,8 @@ | |
"sandbox-templates/**/*.tsx" | ||
], | ||
"rules": { | ||
"@typescript-eslint/naming-convention": "off" | ||
"@typescript-eslint/naming-convention": "off", | ||
"react/react-in-jsx-scope": "off" | ||
} | ||
} | ||
] | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>react-markdown + vite + typescript</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "react-markdown-with-vite", | ||
"version": "1.0.0", | ||
"private": true, | ||
"main": "src/main.tsx", | ||
"type": "module", | ||
"dependencies": { | ||
"react": "^18.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also updates to React 18 |
||
"react-dom": "^18.0.0", | ||
"react-markdown": "^8.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.0", | ||
"@types/react-dom": "^18.0.0", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"typescript": "^5.0.0", | ||
"vite": "^4.0.0" | ||
}, | ||
"scripts": { | ||
"start": "tsc && vite" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
// eslint-disable-next-line n/file-extension-in-import | ||
import ReactDOM from 'react-dom/client' | ||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this lint rule will break the code by adding a |
||
import App from './app.js' | ||
|
||
ReactDOM.createRoot(document.querySelector<HTMLDivElement>('#root')!).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode> | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "Node16", | ||
"jsx": "react-jsx", | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"], | ||
"references": [{"path": "./tsconfig.node.json"}] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler" | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {defineConfig} from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
|
||
export default defineConfig({ | ||
plugins: [react()] | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>remark-rehype + Parcel demo</title> | ||
<title>remark-rehype + Vite demo</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
|
||
<body> | ||
<h1><code>remark-rehype</code> with Parcel</h1> | ||
<h1><code>remark-rehype</code> with Vite</h1> | ||
<h2>source</h2> | ||
<pre id="source"></pre> | ||
<h2>result</h2> | ||
<iframe id="result"></iframe> | ||
<h2>error</h2> | ||
<pre id="error">none</pre> | ||
|
||
<script type="module" src="src/index.js"></script> | ||
<script type="module" src="src/main.ts"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "Node16", | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"skipLibCheck": true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be removed, currently it is blocked by rehypejs/rehype#147 |
||
}, | ||
"include": ["src"], | ||
"references": [{"path": "./tsconfig.node.json"}] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler" | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>remark + Parcel demo</title> | ||
<title>remark + Vite demo</title> | ||
<meta charset="utf-8" /> | ||
</head> | ||
|
||
<body> | ||
<h1><code>remark</code> with Parcel</h1> | ||
<h1><code>remark</code> with Vite</h1> | ||
<h2>source</h2> | ||
<pre id="source"></pre> | ||
<h2>result</h2> | ||
<pre id="result"></pre> | ||
<h2>error</h2> | ||
<pre id="error">none</pre> | ||
|
||
<script type="module" src="src/index.js"></script> | ||
<script type="module" src="src/main.ts"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "remark-with-vite", | ||
"version": "1.0.0", | ||
"private": true, | ||
"type": "module", | ||
"main": "src/main.ts", | ||
"scripts": { | ||
"start": "tsc && vite" | ||
}, | ||
"dependencies": { | ||
"remark": "^14.0.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.0.0", | ||
"vite": "^4.0.0" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the vite react transform does not require react in scope