Skip to content

Commit

Permalink
Add Vite example
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Mar 11, 2023
1 parent ff22965 commit 5e2ca82
Show file tree
Hide file tree
Showing 33 changed files with 5,454 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
fail-fast: false
matrix:
node: ['16.x']
example: ['cra4', 'cra5', 'next']
example: ['cra4', 'cra5', 'next', 'vite']
defaults:
run:
working-directory: ./examples/publish-ci/${{ matrix.example }}
Expand Down
37 changes: 37 additions & 0 deletions examples/publish-ci/vite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
.yalc

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

typesversions
.cache
.yarnrc
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
*.tgz
13 changes: 13 additions & 0 deletions examples/publish-ci/vite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
39 changes: 39 additions & 0 deletions examples/publish-ci/vite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "rtk-esm-vite-normal",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"serve-app": "yarn serve -s dist",
"test": "yarn playwright test",
"format": "prettier --write \"./src/**/*.{ts,tsx}\" \"**/*.md\""
},
"dependencies": {
"@reduxjs/toolkit": "^1.9.3",
"msw": "^0.49.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5"
},
"devDependencies": {
"@playwright/test": "^1.31.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^27.5.2",
"@types/node": "^17.0.45",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.0.0",
"playwright": "^1.31.1",
"prettier": "^2.8.4",
"serve": "^14.2.0",
"typescript": "^4.9.4",
"vite": "^4.0.0"
},
"msw": {
"workerDirectory": "public"
}
}
16 changes: 16 additions & 0 deletions examples/publish-ci/vite/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from '@playwright/test'
export default defineConfig({
webServer: {
command: 'yarn serve-app',
port: 3000,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
},
timeout: 120 * 1000,
use: {
headless: true,
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
},
testDir: 'tests/playwright/',
})
Loading

0 comments on commit 5e2ca82

Please sign in to comment.