Skip to content

Commit 3d936c7

Browse files
authored
Merge pull request #1 from OrbisK/feat/update-template
feat: update template
2 parents 8787645 + 2f21a3e commit 3d936c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+17375
-6197
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- uses: pnpm/action-setup@v4
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: pnpm
21+
- name: Setup Pages
22+
uses: actions/configure-pages@v5
23+
- name: Install dependencies
24+
run: pnpm install
25+
- name: Install playwright browsers
26+
run: npx playwright install --with-deps
27+
- name: Run tests
28+
run: pnpm vitest run
29+
- name: Run type checks
30+
run: pnpm vue-tsc --noEmit
31+
- name: Run linting
32+
run: pnpm lint

.github/workflows/docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy VitePress site to Pages
2+
3+
on:
4+
# Allows you to run this workflow manually from the Actions tab
5+
workflow_dispatch:
6+
7+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
14+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: false
18+
19+
jobs:
20+
# Build job
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
- uses: pnpm/action-setup@v4
29+
- name: Setup Node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: pnpm
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v5
36+
- name: Install dependencies
37+
run: pnpm install
38+
- name: Build with VitePress
39+
run: pnpm docs:build
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: docs/.vitepress/dist
44+
45+
# Deployment job
46+
deploy:
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
needs: build
51+
runs-on: ubuntu-latest
52+
name: Deploy
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ node_modules
88
.temp
99
.tmp
1010
.cache
11+
**/.vitepress/cache
1112

1213
# Yarn
1314
**/.yarn/cache

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
shamefully-hoist=true
1+
shamefully-hoist=true
2+
ignore-workspace-root-check=true

.prettierrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ A minimalist starting point for your next Vue 3 composable.
77
- 🤹 Testing using [**Vitest**](https://vitest.dev)
88
- ☑️ Linting using [**@antfu/eslint-config**](https://github.com/antfu/eslint-config)
99
- 🌐 [**Nuxt 3**](https://nuxtjs.org) as a playground
10-
- 📸 Demo ready to be written and deployed using [**Vite**](https://vitejs.dev)
10+
- 📸 Playgrounds using [**Vite**](https://vitejs.dev) and [Nuxt](https://nuxt.com/)
1111
- 🚚 Built using [**unbuild**](https://github.com/unjs/unbuild)
12+
- 📚 Documentation using [**Vitepress**](https://vitepress.dev)
1213

1314
> Edit [variables](#to-do), implement, test, publish 🏎
1415
@@ -20,28 +21,28 @@ Build the package:
2021
pnpm build
2122
```
2223

23-
Build with watcher:
24+
Run the development environment (vite):
2425

2526
```bash
2627
pnpm dev
2728
```
2829

29-
Run the demo:
30+
Run the docs:
3031

3132
```bash
32-
pnpm dev:demo
33+
pnpm dev:docs
3334
```
3435

35-
Build the demo:
36+
Build the docs:
3637

3738
```bash
38-
pnpm build:demo
39+
pnpm build:docs
3940
```
4041

4142
Lint the package:
4243

4344
```bash
44-
pnpm link
45+
pnpm lint
4546
```
4647

4748
Run test suite:
@@ -50,25 +51,19 @@ Run test suite:
5051
pnpm test
5152
```
5253

53-
Test typings:
54-
55-
```bash
56-
pnpm test:types
57-
```
58-
59-
Start Nuxt 3 env:
54+
Start Nuxt dev environment:
6055

6156
```bash
6257
pnpm dev:nuxt
6358
```
6459

65-
Build Nuxt 3 env:
60+
Build Nuxt environment:
6661

6762
```bash
6863
pnpm build:nuxt
6964
```
7065

71-
Preview Nuxt 3 env:
66+
Preview Nuxt environment:
7267

7368
```bash
7469
pnpm start:nuxt
@@ -97,11 +92,12 @@ The general Nuxt environment does not differ from a classic Vue app.
9792
## To-Do
9893

9994
- [ ] Edit package.json `name`, `description`, `repository` and `author` keys.
95+
- [ ] Rename all `vue-composable-starter` with your package name.
96+
- [ ] Rename `VueComposableStarterPluginOptions` with your plugin options.
10097
- [ ] Remove .vscode folder (containing recommended extensions)
10198
- [ ] Edit README.md.
10299
- [ ] Implement my composable.
103100
- [ ] Test my composable.
104-
- [ ] Make a demo of my composable in the `demo` folder.
105101
- [ ] Document my composable.
106102
- [ ] Publish on [NPM](npmjs.com), [awesome-vue](https://github.com/vuejs/awesome-vue), [vue-forum](https://forum.vuejs.org/), [Vue Discord](https://fr.vuejs.org/v2/guide/join.html).
107103

build.config.ts

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,45 @@
1-
import { copySync } from 'fs-extra'
2-
import consola from 'consola'
31
import { defineBuildConfig } from 'unbuild'
42

53
export default defineBuildConfig({
6-
declaration: true,
74
rollup: {
8-
emitCJS: true
5+
emitCJS: true,
96
},
10-
externals: ['@nuxt/schema', '@nuxt/schema-edge', '@nuxt/kit', '@nuxt/kit-edge', 'nuxt', 'nuxt-edge', 'nuxt3', 'vue'],
7+
declaration: true,
8+
// warnings triggered by nuxt exports not being built - happens in separate script
9+
failOnWarn: false,
10+
// TODO: check if all are needed
11+
externals: [
12+
'@nuxt/kit',
13+
'@nuxt/schema',
14+
'nuxt3',
15+
'nuxt',
16+
'vue',
17+
'defu',
18+
'@vueuse/motion',
19+
'csstype',
20+
'@vueuse/shared',
21+
'framesync',
22+
'style-value-types',
23+
'@vue/compiler-core',
24+
'@babel/parser',
25+
'@vue/shared',
26+
'@vueuse/core',
27+
],
1128
entries: [
1229
// Plugin
1330
{
1431
input: 'src/index.ts',
1532
outDir: 'dist',
1633
name: 'index',
1734
format: 'esm',
18-
ext: 'mjs'
35+
ext: 'mjs',
1936
},
2037
{
2138
input: 'src/index.ts',
2239
outDir: 'dist',
2340
name: 'index',
2441
format: 'cjs',
25-
ext: 'cjs'
42+
ext: 'cjs',
2643
},
27-
// Nuxt
28-
{
29-
input: 'src/nuxt/module.ts',
30-
outDir: 'dist',
31-
name: 'nuxt',
32-
format: 'esm',
33-
ext: 'mjs'
34-
},
35-
{
36-
input: 'src/nuxt/module.ts',
37-
outDir: 'dist',
38-
name: 'nuxt',
39-
format: 'cjs',
40-
ext: 'cjs'
41-
}
4244
],
43-
hooks: {
44-
'build:done': () => {
45-
copySync('src/nuxt/runtime', 'dist/runtime')
46-
47-
// eslint-disable-next-line no-console
48-
consola.info('Nuxt runtime copied to `dist/`!')
49-
}
50-
}
5145
})

demo/index.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)