Skip to content
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

feat(examples): use vite 4.x #13848

Merged
merged 3 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 3 additions & 4 deletions examples/class-prefix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "class-prefix",
"private": true,
"version": "0.26.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand All @@ -13,10 +14,8 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "1.1.3",
"@vitejs/plugin-react": "4.0.0",
"sass": "^1.51.0",
"vite": "^2.9.5"
"vite": "^4.3.8"
}
}
4 changes: 1 addition & 3 deletions examples/class-prefix/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function ExampleComponent() {
)
}

function App() {
export default function App() {
return (
<>
<ExampleComponent />
Expand All @@ -20,5 +20,3 @@ function App() {
</>
);
}

export default App
11 changes: 6 additions & 5 deletions examples/class-prefix/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import './index.scss'

import React from 'react'
import ReactDOM from 'react-dom'
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App'

ReactDOM.render(
const domNode = document.getElementById('root');
const root = createRoot(domNode);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);
6 changes: 1 addition & 5 deletions examples/class-prefix/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxRuntime: 'classic',
}),
],
plugins: [react()],
});
9 changes: 5 additions & 4 deletions examples/codesandbox-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "codesandbox-styles",
"private": true,
"version": "0.32.0",
"type": "module",
"scripts": {
"develop": "vite"
"dev": "vite"
},
"devDependencies": {
"vite": "^2.8.0"
"sass": "^1.51.0",
"vite": "^4.3.8"
},
"dependencies": {
"@carbon/styles": "^1.29.0",
"sass": "^1.51.0"
"@carbon/styles": "^1.29.0"
}
}
7 changes: 3 additions & 4 deletions examples/custom-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "custom-theme",
"private": true,
"version": "0.27.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand All @@ -13,10 +14,8 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "1.1.3",
"@vitejs/plugin-react": "4.0.0",
"sass": "^1.51.0",
"vite": "^2.9.5"
"vite": "^4.3.8"
}
}
4 changes: 1 addition & 3 deletions examples/custom-theme/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button } from '@carbon/react';
import React from 'react';

function App() {
export default function App() {
return (
<div>
<Button>Button with custom theme</Button>
Expand All @@ -16,5 +16,3 @@ function App() {
</div>
);
}

export default App;
15 changes: 8 additions & 7 deletions examples/custom-theme/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import './index.scss'
import './index.scss';

import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';

ReactDOM.render(
const domNode = document.getElementById('root');
const root = createRoot(domNode);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);
6 changes: 1 addition & 5 deletions examples/custom-theme/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxRuntime: 'classic',
}),
],
plugins: [react()],
});
7 changes: 3 additions & 4 deletions examples/id-prefix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "id-prefix",
"private": true,
"version": "0.26.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand All @@ -13,10 +14,8 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "1.1.3",
"@vitejs/plugin-react": "4.0.0",
"sass": "^1.51.0",
"vite": "^2.9.5"
"vite": "^4.3.8"
}
}
4 changes: 1 addition & 3 deletions examples/id-prefix/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function ExampleComponent() {
)
}

function App() {
export default function App() {
return (
<>
<ExampleComponent />
Expand All @@ -20,5 +20,3 @@ function App() {
</>
);
}

export default App
15 changes: 8 additions & 7 deletions examples/id-prefix/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import './index.scss'
import './index.scss';

import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';

ReactDOM.render(
const domNode = document.getElementById('root');
const root = createRoot(domNode);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);
6 changes: 1 addition & 5 deletions examples/id-prefix/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxRuntime: 'classic',
}),
],
plugins: [react()],
});
7 changes: 3 additions & 4 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "vite",
"private": true,
"version": "0.27.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand All @@ -13,10 +14,8 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "1.1.3",
"@vitejs/plugin-react": "4.0.0",
"sass": "^1.51.0",
"vite": "^2.9.5"
"vite": "^4.3.8"
}
}
4 changes: 1 addition & 3 deletions examples/vite/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Button } from '@carbon/react';
import React from 'react';

function App() {
export default function App() {
return (
<div>
<Button>Hello world</Button>
</div>
);
}

export default App
9 changes: 5 additions & 4 deletions examples/vite/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import './index.scss';

import { StrictMode } from 'react';
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';

const root = createRoot(document.getElementById('root'));
const domNode = document.getElementById('root');
const root = createRoot(domNode);
root.render(
<StrictMode>
<React.StrictMode>
<App />
</StrictMode>
</React.StrictMode>
);
6 changes: 1 addition & 5 deletions examples/vite/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxRuntime: 'classic',
}),
],
plugins: [react()],
});
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"node-sass": "^8.0.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-is": "~18.2.0",
"react-test-renderer": "~17.0.2"
"react-is": "~18.2.0"
},
"devDependencies": {
"@babel/core": "^7.18.2",
Expand Down
Loading