-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from idmytro/unp2
Unp2
- Loading branch information
Showing
47 changed files
with
2,964 additions
and
1,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: pnpm | ||
|
||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
# Vue 3 + Vite + TS + Unplugin Router | ||
# unplugin-vue-router Demo | ||
|
||
This is the demo project for [unplugin-vue-router](https://github.com/posva/unplugin-vue-router). You can test it on [StackBlitz](https://stackblitz.com/github/posva/uvr-demo). | ||
|
||
## Project Setup | ||
|
||
```sh | ||
pnpm install | ||
``` | ||
|
||
### Compile and Hot-Reload for Development | ||
|
||
```sh | ||
pnpm run dev | ||
``` | ||
|
||
## | ||
|
||
```sh | ||
npx degit idmytro/vue3-multi-starter/_2024-unplugin-router myproject | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "@tsconfig/node20/tsconfig.json", | ||
"include": ["./**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
// See here how to get started: | ||
// https://playwright.dev/docs/intro | ||
test('visits the app root url', async ({ page }) => { | ||
await page.goto('/'); | ||
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!'); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference types="vite/client" /> | ||
/// <reference types="unplugin-vue-router/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,44 @@ | ||
{ | ||
"type": "module", | ||
"name": "uvr-demo", | ||
"version": "0.0.0", | ||
"packageManager": "[email protected]", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vue-tsc && vite build", | ||
"preview": "vite preview" | ||
"build": "run-p type-check \"build-only {@}\" --", | ||
"preview": "vite preview", | ||
"test:unit": "vitest", | ||
"test:e2e": "playwright test", | ||
"build-only": "vite build", | ||
"type-check": "vue-tsc --build --force" | ||
}, | ||
"dependencies": { | ||
"@unocss/reset": "^0.58.3", | ||
"vue": "^3.4.9" | ||
"pinia": "^2.1.7", | ||
"vue": "^3.4.21", | ||
"vue-router": "^4.3.0" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^2.18.1", | ||
"@antfu/eslint-config": "^2.6.2", | ||
"@unocss/transformer-directives": "^0.58.3", | ||
"@unocss/transformer-variant-group": "^0.58.5", | ||
"@vitejs/plugin-vue": "^5.0.3", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-no-autofix": "^1.2.3", | ||
"typescript": "5.0.4", | ||
"@playwright/test": "^1.44.1", | ||
"@tsconfig/node20": "^20.1.4", | ||
"@types/jsdom": "^21.1.6", | ||
"@types/node": "^20.12.5", | ||
"@vitejs/plugin-vue": "^5.0.4", | ||
"@vue/test-utils": "^2.4.5", | ||
"@vue/tsconfig": "^0.5.1", | ||
"jsdom": "^24.1.0", | ||
"npm-run-all2": "^6.1.2", | ||
"typescript": "~5.4.0", | ||
"unocss": "^0.58.3", | ||
"unplugin-auto-import": "^0.17.3", | ||
"unplugin-vue-markdown": "^0.26.2", | ||
"unplugin-vue-router": "^0.9.0", | ||
"vite": "^5.0.11", | ||
"vue-tsc": "^1.8.27" | ||
"vite": "^5.2.8", | ||
"vite-plugin-vue-devtools": "^7.0.25", | ||
"vitest": "^1.4.0", | ||
"vue-tsc": "^2.0.11" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import process from 'node:process' | ||
import { defineConfig, devices } from '@playwright/test' | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
testDir: './e2e', | ||
/* Maximum time one test can run for. */ | ||
timeout: 30 * 1000, | ||
expect: { | ||
/** | ||
* Maximum time expect() should wait for the condition to be met. | ||
* For example in `await expect(locator).toHaveText();` | ||
*/ | ||
timeout: 5000 | ||
}, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: process.env.CI ? 2 : 0, | ||
/* Opt out of parallel tests on CI. */ | ||
workers: process.env.CI ? 1 : undefined, | ||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
reporter: 'html', | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
use: { | ||
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ | ||
actionTimeout: 0, | ||
/* Base URL to use in actions like `await page.goto('/')`. */ | ||
baseURL: 'http://localhost:5173', | ||
|
||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: 'on-first-retry', | ||
|
||
/* Only on CI systems run the tests headless */ | ||
headless: !!process.env.CI | ||
}, | ||
|
||
/* Configure projects for major browsers */ | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { | ||
...devices['Desktop Chrome'] | ||
} | ||
}, | ||
{ | ||
name: 'firefox', | ||
use: { | ||
...devices['Desktop Firefox'] | ||
} | ||
}, | ||
{ | ||
name: 'webkit', | ||
use: { | ||
...devices['Desktop Safari'] | ||
} | ||
} | ||
|
||
/* Test against mobile viewports. */ | ||
// { | ||
// name: 'Mobile Chrome', | ||
// use: { | ||
// ...devices['Pixel 5'], | ||
// }, | ||
// }, | ||
// { | ||
// name: 'Mobile Safari', | ||
// use: { | ||
// ...devices['iPhone 12'], | ||
// }, | ||
// }, | ||
|
||
/* Test against branded browsers. */ | ||
// { | ||
// name: 'Microsoft Edge', | ||
// use: { | ||
// channel: 'msedge', | ||
// }, | ||
// }, | ||
// { | ||
// name: 'Google Chrome', | ||
// use: { | ||
// channel: 'chrome', | ||
// }, | ||
// }, | ||
], | ||
|
||
/* Folder for test artifacts such as screenshots, videos, traces, etc. */ | ||
// outputDir: 'test-results/', | ||
|
||
/* Run your local dev server before starting the tests */ | ||
webServer: { | ||
/** | ||
* Use the dev server by default for faster feedback loop. | ||
* Use the preview server on CI for more realistic testing. | ||
* Playwright will re-use the local server if there is already a dev-server running. | ||
*/ | ||
command: process.env.CI ? 'vite preview --port 5173' : 'vite dev', | ||
port: 5173, | ||
reuseExistingServer: !process.env.CI | ||
} | ||
}) |
Oops, something went wrong.