Skip to content

Commit

Permalink
chore: Migrate example project to Vite (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
just-boris authored Sep 17, 2021
1 parent f6355a5 commit 915bb5a
Show file tree
Hide file tree
Showing 11 changed files with 687 additions and 17,626 deletions.
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This project demonstrates how to use [AWS UI React Components](https://www.npmjs.com/package/@awsui/components-react).
It is part of the [AWS UI Getting Started Guide](https://github.com/aws/awsui-documentation#getting-started).

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This project was bootstrapped with [Vite](https://vitejs.dev/).

## License Summary

Expand Down
12 changes: 12 additions & 0 deletions example/index.html
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>AWS-UI Demo App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/main.tsx"></script>
</body>
</html>
18,199 changes: 634 additions & 17,565 deletions example/package-lock.json

Large diffs are not rendered by default.

32 changes: 6 additions & 26 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,13 @@
"react-dom": "^17.0.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.3",
"@testing-library/user-event": "^12.6.2",
"react-scripts": "4.0.3"
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"typescript": "^4.3.2",
"vite": "^2.5.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!(@awsui)/).+\\.(js|jsx|ts|tsx)$'",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"start": "vite",
"build": "tsc && vite build"
}
}
27 changes: 0 additions & 27 deletions example/public/index.html

This file was deleted.

3 changes: 0 additions & 3 deletions example/public/robots.txt

This file was deleted.

8 changes: 4 additions & 4 deletions example/src/App.js → example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
import Form from "@awsui/components-react/form";
import FormField from "@awsui/components-react/form-field";
import Input from "@awsui/components-react/input";
import Select from "@awsui/components-react/select";
import Select, { SelectProps } from "@awsui/components-react/select";
import Container from "@awsui/components-react/container";
import Header from "@awsui/components-react/header";
import SpaceBetween from "@awsui/components-react/space-between";
import Button from "@awsui/components-react/button";
import AppLayout from "@awsui/components-react/app-layout";
import { useState } from "react";
import React, { useState } from "react";

function App() {
const [inputValue, setInputValue] = useState();
const [selectValue, setSelectValue] = useState();
const [inputValue, setInputValue] = useState("");
const [selectValue, setSelectValue] = useState<SelectProps.Option | null>(null);
return (
<AppLayout
content={
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions example/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
20 changes: 20 additions & 0 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["./src"]
}
9 changes: 9 additions & 0 deletions example/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "vite";

// https://vitejs.dev/config/
export default defineConfig({
base: "",
build: {
outDir: "build"
}
});

0 comments on commit 915bb5a

Please sign in to comment.