Skip to content

Commit

Permalink
feat(app): add Windi playground
Browse files Browse the repository at this point in the history
  • Loading branch information
Selemondev authored and Selemondev committed Jul 27, 2023
1 parent 4b5cf58 commit d73d340
Show file tree
Hide file tree
Showing 46 changed files with 4,239 additions and 584 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write
contents: read

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
build-test:
name: 📚 Main
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3

- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile

- name: 👀 Lint
run: pnpm lint

- name: 🚀 Build
run: pnpm build

- name: 🧪 Test
run: pnpm test
env:
VITE_TEST_DB_URL: ${{ secrets.VITE_TEST_DB_URL }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}

- name: Install
run: pnpm install --no-frozen-lockfile

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test

- name: Config npm
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm
run: pnpm -r publish --access public --no-git-checks
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ dist
node_modules

# style copy with components build
packages/onu-ui/*.css
packages/windi/*.css
docs/.vitepress/cache/
docs/public/play
28 changes: 14 additions & 14 deletions docs/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@windi-ui/docs",
"version": "0.0.0",
"private": true,
"description": "Windi-UI docs",
"keywords": [
"windi-ui",
"docs"
],
"scripts": {
"dev": "vitepress dev --port 5555 --open --host",
"build": "vitepress build",
"serve": "vitepress serve"
}
}
"name": "@windi-ui/docs",
"version": "0.0.0",
"private": true,
"description": "Windi-UI docs",
"keywords": [
"windi-ui",
"docs"
],
"scripts": {
"dev": "vitepress dev --port 5555 --open --host",
"build": "vitepress build",
"serve": "vitepress serve"
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"devDependencies": {
"@antfu/eslint-config": "^0.39.8",
"@iconify/vue": "^4.1.1",
"@types/node": "^20.4.4",
"@types/node": "^20.4.5",
"@vitejs/plugin-vue": "^4.2.3",
"@vitest/coverage-c8": "^0.33.0",
"@vitest/ui": "^0.33.0",
Expand Down Expand Up @@ -53,8 +53,8 @@
"vitepress-plugin-search": "1.0.4-alpha.20",
"vitest": "^0.33.0",
"vue": "^3.3.4",
"vue-tsc": "^1.8.6",
"windi-ui": "workspace*"
"vue-tsc": "^1.8.8",
"windi": "workspace*"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
Expand Down
12 changes: 2 additions & 10 deletions packages/windi/.gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
node_modules
dist
dist-ssr
package-lock.json
coverage
*.local

/cypress/videos/
/cypress/screenshots/
Expand Down
21 changes: 21 additions & 0 deletions packages/windi/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Selemondev - Open Source

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
69 changes: 54 additions & 15 deletions packages/windi/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,64 @@
{
"name": "windi",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@8.6.10",
"description": "Build Accessible Apps 10x faster",
"author": "Selemondev",
"license": "MIT",
"funding": "https://github.com/sponsors/selemondev",
"homepage": "https://github.com/selemondev/windi-ui",
"repository": {
"type": "git",
"url": "https://github.com/selemondev/windi-ui.git"
},
"bugs": "https://github.com/selemondev/windi-ui/issues",
"keywords": [
"vue ui",
"windi ui",
"component library",
"ui",
"vue 3",
"typescript"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.es.js"
}
},
"main": "./dist/index.es.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=16",
"pnpm": ">=8"
},
"scripts": {
"build": "vite build --mode production",
"build:watch": "vite build --watch",
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
},
"dependencies": {
"vue": "^3.3.4"
"play": "pnpm --filter playground dev",
"prepublishOnly": "pnpm run build",
"release": "pnpm build && bumpp --commit --push --tag && pnpm publish",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest",
"test:watch": "vitest --watch",
"coverage": "vitest run --coverage"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.0",
"@types/node": "^18.17.0",
"@antfu/eslint-config": "^0.39.8",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/tsconfig": "^0.4.0",
"npm-run-all": "^4.1.5",
"typescript": "~5.1.6",
"vite": "^4.4.6",
"vue-tsc": "^1.8.6"
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"vite": "^4.4.7",
"vite-plugin-dts": "^2.3.0"
},
"publishConfig": {
"access": "public"
}
}
28 changes: 28 additions & 0 deletions packages/windi/playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 3 additions & 0 deletions packages/windi/playground/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
40 changes: 40 additions & 0 deletions packages/windi/playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# playground

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```
1 change: 1 addition & 0 deletions packages/windi/playground/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
13 changes: 13 additions & 0 deletions packages/windi/playground/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" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions packages/windi/playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "playground",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.3.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.1.6",
"vite": "^4.4.7",
"vue-tsc": "^1.8.8",
"windi": "workspace:^"
}
}
6 changes: 6 additions & 0 deletions packages/windi/playground/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file added packages/windi/playground/public/favicon.ico
Binary file not shown.

0 comments on commit d73d340

Please sign in to comment.