Skip to content

Commit

Permalink
feat: add vue2 pages
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed May 30, 2023
1 parent 7cef91f commit 393c98b
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ jobs:
with:
version: 8

- name: Run scripts
- name: Run scripts
run: |
pnpm i @antfu/ni -g
ni
nr build:preview
nr i
nr -C=playgrounds/vue3 build
nr build:deploy
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: ./playgrounds/vue3/dist
path: ./dist

- name: Deploy to GitHub Pages
id: deployment
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
"scripts": {
"dev3": "nr -C=playgrounds/vue3 dev & nr u --watch",
"dev2": "nr -C=playgrounds/vue2.7 dev",
"preview:dev3": "nr build && nr inject:pkg && ni -C=playgrounds/vue3 --force && nr -C=playgrounds/vue3 build && nr -C=playgrounds/vue3 preview",
"preview:dev2": "nr build && nr inject:pkg && ni -C=playgrounds/vue2.7 --force && nr -C=playgrounds/vue2.7 build && nr -C=playgrounds/vue2.7 preview",
"preview:dev3": "nr build:preview && ni -C=playgrounds/vue3 --force && nr -C=playgrounds/vue3 build && nr -C=playgrounds/vue3 preview",
"preview:dev2": "nr build:preview && ni -C=playgrounds/vue2.7 --force && nr -C=playgrounds/vue2.7 build && nr -C=playgrounds/vue2.7 preview",
"u": "unocss src/index.ts -o=dist/index.css",
"i": "ni -C=playgrounds/vue3 & ni -C=playgrounds/vue2.7",
"r": "lvr --pkg --main-pkg --no-push",
"build:deploy": "node ./scripts/buildDeploy.mjs",
"build:preview": "nr build && nr inject:pkg",
"build": "unbuild && nr u && nr inject:css",
"inject:css": "node ./scripts/injectCSS.mjs",
Expand All @@ -64,9 +65,10 @@
"@unocss/cli": "^0.52.4",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.41.0",
"execa": "^7.1.1",
"unbuild": "^1.2.1",
"unocss": "^0.52.4",
"unocss-transformer-attribute-values-group": "^0.2.2",
"vue": "^3.3.4"
}
}
}
68 changes: 64 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions scripts/buildDeploy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { $ } from 'execa'
import fsp from 'node:fs/promises'

await Promise.all([
$`nr -C=playgrounds/vue3 build`,
$`nr -C=playgrounds/vue2.7 build`,
])

await fsp.cp('./playgrounds/vue3/dist', './dist', { recursive: true })
await fsp.cp('./playgrounds/vue2.7/dist', './dist/vue2', { recursive: true })

0 comments on commit 393c98b

Please sign in to comment.