@skirtle/create-vue-lib 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/index.cjs +5802 -0
- package/dist/template/base/config/.editorconfig +7 -0
- package/dist/template/base/config/README.md.ejs +5 -0
- package/dist/template/base/config/package.json.ejs +35 -0
- package/dist/template/base/config/packages/@projectName@/README.md.ejs +5 -0
- package/dist/template/base/config/packages/@projectName@/env.d.ts +1 -0
- package/dist/template/base/config/packages/@projectName@/package.json +73 -0
- package/dist/template/base/config/packages/@projectName@/src/global.d.ts +1 -0
- package/dist/template/base/config/packages/@projectName@/tsconfig.app.json +11 -0
- package/dist/template/base/config/packages/@projectName@/tsconfig.json +14 -0
- package/dist/template/base/config/packages/@projectName@/tsconfig.node.json +18 -0
- package/dist/template/base/config/packages/@projectName@/tsconfig.vitest.json +10 -0
- package/dist/template/base/config/packages/@projectName@/vite.config.mts +75 -0
- package/dist/template/base/config/pnpm-workspace.yaml +2 -0
- package/dist/template/base/config/scripts/preinstall.js +6 -0
- package/dist/template/base/config/tsconfig.json +4 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/Example.vue +28 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/MyPanel.vue +62 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue +15 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/__tests__/MyPanel.spec.ts +61 -0
- package/dist/template/base/examples/packages/@projectName@/src/index.ts +3 -0
- package/dist/template/gh-pages/config/.github/workflows/pages.yml +55 -0
- package/dist/template/playground/config/packages/playground/env.d.ts +2 -0
- package/dist/template/playground/config/packages/playground/package.json +25 -0
- package/dist/template/playground/config/packages/playground/tsconfig.app.json +11 -0
- package/dist/template/playground/config/packages/playground/tsconfig.json +11 -0
- package/dist/template/playground/config/packages/playground/tsconfig.node.json +18 -0
- package/dist/template/playground/config/packages/playground/vite.config.mts +22 -0
- package/dist/template/playground/examples/packages/playground/index.html +13 -0
- package/dist/template/playground/examples/packages/playground/public/favicon.ico +0 -0
- package/dist/template/playground/examples/packages/playground/src/App.vue +28 -0
- package/dist/template/playground/examples/packages/playground/src/main.ts +4 -0
- package/dist/template/vitepress/config/packages/docs/.vitepress/config.mts.ejs +70 -0
- package/dist/template/vitepress/config/packages/docs/.vitepress/theme/index.ts +8 -0
- package/dist/template/vitepress/config/packages/docs/env.d.ts +2 -0
- package/dist/template/vitepress/config/packages/docs/package.json +24 -0
- package/dist/template/vitepress/config/packages/docs/tsconfig.app.json +13 -0
- package/dist/template/vitepress/config/packages/docs/tsconfig.json +11 -0
- package/dist/template/vitepress/config/packages/docs/tsconfig.node.json +18 -0
- package/dist/template/vitepress/examples/packages/docs/src/index.md +32 -0
- package/dist/template/vitepress/examples/packages/docs/src/introduction.md +29 -0
- package/package.json +54 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"type": "module",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"clean": "pnpm run -r clean",
|
|
6
|
+
"build": "pnpm run -r build",
|
|
7
|
+
"type-check": "pnpm run -r type-check",
|
|
8
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
9
|
+
<%_ if (config.includePlayground) { _%>
|
|
10
|
+
"dev": "pnpm run --filter ./packages/playground -r dev",
|
|
11
|
+
<%_ } _%>
|
|
12
|
+
<%_ if (config.includeDocs) { _%>
|
|
13
|
+
"docs:dev": "pnpm run --filter ./packages/docs -r dev",
|
|
14
|
+
"docs:build": "pnpm run --filter ./packages/docs -r build",
|
|
15
|
+
<%_ } _%>
|
|
16
|
+
"test:unit": "pnpm run --filter ./packages/<%- config.mainPackageDirName %> -r test:unit",
|
|
17
|
+
"coverage": "pnpm run --filter ./packages/<%- config.mainPackageDirName %> -r coverage",
|
|
18
|
+
"preinstall": "node scripts/preinstall.js",
|
|
19
|
+
"postinstall": "simple-git-hooks"
|
|
20
|
+
},
|
|
21
|
+
"simple-git-hooks": {
|
|
22
|
+
"pre-commit": "pnpm run type-check && pnpm exec lint-staged"
|
|
23
|
+
},
|
|
24
|
+
"lint-staged": {
|
|
25
|
+
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --fix"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@typescript-eslint/parser": "^8.23.0",
|
|
29
|
+
"@vue/eslint-config-typescript": "^14.3.0",
|
|
30
|
+
"eslint": "^9.18.0",
|
|
31
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
32
|
+
"lint-staged": "^15.4.3",
|
|
33
|
+
"simple-git-hooks": "^2.11.1"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "@scopedPackageName@",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "",
|
|
7
|
+
"description": "",
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"homepage": "@homepageUrl@",
|
|
10
|
+
"bugs": "@githubIssues@",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "@githubRepository@"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "dist/@unscopedPackageName@.cjs",
|
|
17
|
+
"module": "dist/@unscopedPackageName@.esm-bundler.mjs",
|
|
18
|
+
"unpkg": "dist/@unscopedPackageName@.global.dev.js",
|
|
19
|
+
"jsdelivr": "dist/@unscopedPackageName@.global.dev.js",
|
|
20
|
+
"types": "dist/@unscopedPackageName@.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/@unscopedPackageName@.d.ts",
|
|
24
|
+
"import": "./dist/@unscopedPackageName@.esm-bundler.mjs",
|
|
25
|
+
"require": "./dist/@unscopedPackageName@.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./dist/*": "./dist/*",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"vue": "^3.2.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
38
|
+
"@tsconfig/node22": "^22.0.0",
|
|
39
|
+
"@types/jsdom": "^21.1.7",
|
|
40
|
+
"@types/node": "^22.10.7",
|
|
41
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
42
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
43
|
+
"@vue/test-utils": "^2.4.6",
|
|
44
|
+
"@vue/tsconfig": "^0.7.0",
|
|
45
|
+
"jsdom": "^26.0.0",
|
|
46
|
+
"rimraf": "^5.0.1",
|
|
47
|
+
"typescript": "~5.7.3",
|
|
48
|
+
"vite": "^6.0.11",
|
|
49
|
+
"vite-plugin-dts": "^4.5.0",
|
|
50
|
+
"vitest": "^3.0.2",
|
|
51
|
+
"vue": "^3.5.13",
|
|
52
|
+
"vue-tsc": "^2.2.0",
|
|
53
|
+
|
|
54
|
+
"@vitest/eslint-plugin": "1.1.25",
|
|
55
|
+
"@vue/eslint-config-typescript": "^14.3.0",
|
|
56
|
+
"eslint": "^9.18.0",
|
|
57
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
58
|
+
"jiti": "^2.4.2",
|
|
59
|
+
"npm-run-all2": "^7.0.2",
|
|
60
|
+
"vite-plugin-vue-devtools": "^7.7.0"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"clean": "rimraf dist && rimraf coverage",
|
|
64
|
+
"test:unit": "vitest --environment jsdom",
|
|
65
|
+
"coverage": "vitest run --coverage --environment jsdom",
|
|
66
|
+
"build": "rimraf dist && pnpm build-dev && pnpm build-neutral && pnpm build-prod && pnpm type-check",
|
|
67
|
+
"build-dev": "vite build --mode development",
|
|
68
|
+
"build-neutral": "vite build --mode neutral",
|
|
69
|
+
"build-prod": "vite build --mode production",
|
|
70
|
+
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
|
71
|
+
"preinstall": "node ../../scripts/preinstall.js"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare let __DEV__: boolean
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
+
"exclude": ["src/**/__tests__/*"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@/*": ["./src/*"]
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsconfig/node22/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"vite.config.*",
|
|
5
|
+
"vitest.config.*",
|
|
6
|
+
"cypress.config.*",
|
|
7
|
+
"nightwatch.conf.*",
|
|
8
|
+
"playwright.config.*",
|
|
9
|
+
"eslint.config.*"
|
|
10
|
+
],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
14
|
+
"module": "ESNext",
|
|
15
|
+
"moduleResolution": "Bundler",
|
|
16
|
+
"types": ["node"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
3
|
+
|
|
4
|
+
import { defineConfig } from 'vite'
|
|
5
|
+
import replace from '@rollup/plugin-replace'
|
|
6
|
+
import vue from '@vitejs/plugin-vue'
|
|
7
|
+
import dts from 'vite-plugin-dts'
|
|
8
|
+
|
|
9
|
+
export default defineConfig(({ mode }) => {
|
|
10
|
+
if (mode !== 'production' && mode !== 'development' && mode !== 'neutral' && mode !== 'test') {
|
|
11
|
+
throw new Error(`Unknown mode: ${mode}`)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const dtsPlugin = mode === 'neutral' ? dts({
|
|
15
|
+
rollupTypes: true,
|
|
16
|
+
tsconfigPath: './tsconfig.app.json'
|
|
17
|
+
}) : null
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
plugins: [
|
|
21
|
+
replace({
|
|
22
|
+
preventAssignment: true,
|
|
23
|
+
values: {
|
|
24
|
+
__DEV__: mode === 'production' ? 'false' : mode === 'development' ? 'true' : '!(process.env.NODE_ENV === "production")'
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
vue(),
|
|
28
|
+
dtsPlugin
|
|
29
|
+
],
|
|
30
|
+
resolve: {
|
|
31
|
+
alias: {
|
|
32
|
+
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
build: {
|
|
36
|
+
target: 'es2019',
|
|
37
|
+
emptyOutDir: false,
|
|
38
|
+
minify: mode === 'production',
|
|
39
|
+
lib: {
|
|
40
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
41
|
+
name: '@globalVariableName@',
|
|
42
|
+
formats: mode === 'neutral' ? ['cjs', 'es'] : ['es', 'iife'],
|
|
43
|
+
|
|
44
|
+
fileName(format) {
|
|
45
|
+
let name = '@unscopedPackageName@'
|
|
46
|
+
let extension = 'js'
|
|
47
|
+
|
|
48
|
+
if (format === 'iife') {
|
|
49
|
+
name += '.global'
|
|
50
|
+
} else if (format === 'es') {
|
|
51
|
+
name += '.esm-' + (mode === 'neutral' ? 'bundler' : 'browser')
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (mode === 'production') {
|
|
55
|
+
name += '.prod'
|
|
56
|
+
} else if (mode === 'development') {
|
|
57
|
+
name += '.dev'
|
|
58
|
+
} else if (mode === 'neutral') {
|
|
59
|
+
extension = format === 'cjs' ? 'cjs' : 'mjs'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return `${name}.${extension}`
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
rollupOptions: {
|
|
66
|
+
external: ['vue'],
|
|
67
|
+
output: {
|
|
68
|
+
globals: {
|
|
69
|
+
vue: 'Vue'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
if (__DEV__) {
|
|
5
|
+
console.log('dev: creating Example component')
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const msg = ref('Hello world!')
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="outer">
|
|
13
|
+
<input v-model="msg">
|
|
14
|
+
<p>{{ msg }}</p>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
.outer {
|
|
20
|
+
border: 1px solid green;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.outer input {
|
|
25
|
+
border: 1px solid #777;
|
|
26
|
+
padding: 2px 4px;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import MyPanelSection from './MyPanelSection.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
title?: string
|
|
6
|
+
footer?: string
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="panel">
|
|
12
|
+
<slot name="header">
|
|
13
|
+
<MyPanelSection v-if="title" class="panel-header">{{ title }}</MyPanelSection>
|
|
14
|
+
</slot>
|
|
15
|
+
<slot name="body">
|
|
16
|
+
<MyPanelSection class="panel-body">
|
|
17
|
+
<slot />
|
|
18
|
+
</MyPanelSection>
|
|
19
|
+
</slot>
|
|
20
|
+
<slot name="footer">
|
|
21
|
+
<MyPanelSection v-if="footer" class="panel-footer">{{ footer }}</MyPanelSection>
|
|
22
|
+
</slot>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style scoped>
|
|
27
|
+
.panel {
|
|
28
|
+
border: 1px solid #34495e;
|
|
29
|
+
border-radius: 5px;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.panel > * + * {
|
|
37
|
+
border-top: 1px solid #34495e;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.panel-header, .panel-footer {
|
|
41
|
+
background: #34495e;
|
|
42
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
|
|
43
|
+
color: #fff;
|
|
44
|
+
letter-spacing: 0.5px;
|
|
45
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.panel-section:first-child {
|
|
49
|
+
border-top-left-radius: 5px;
|
|
50
|
+
border-top-right-radius: 5px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.panel-section:last-child {
|
|
54
|
+
border-bottom-left-radius: 5px;
|
|
55
|
+
border-bottom-right-radius: 5px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.panel-body {
|
|
59
|
+
flex: auto;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
package/dist/template/base/examples/packages/@projectName@/src/components/__tests__/MyPanel.spec.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import MyPanel from '../MyPanel.vue'
|
|
4
|
+
|
|
5
|
+
describe('MyPanel', () => {
|
|
6
|
+
test('Just a body', () => {
|
|
7
|
+
const wrapper = mount(MyPanel)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.findAll('.panel-section')).toHaveLength(1)
|
|
10
|
+
expect(wrapper.findAll('.panel-body')).toHaveLength(1)
|
|
11
|
+
expect(wrapper.findAll('.panel-footer')).toHaveLength(0)
|
|
12
|
+
expect(wrapper.findAll('.panel-header')).toHaveLength(0)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
test('title prop', () => {
|
|
16
|
+
const wrapper = mount(MyPanel, {
|
|
17
|
+
props: {
|
|
18
|
+
title: 'Title'
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
expect(wrapper.findAll('.panel-section')).toHaveLength(2)
|
|
23
|
+
expect(wrapper.findAll('.panel-body')).toHaveLength(1)
|
|
24
|
+
expect(wrapper.findAll('.panel-footer')).toHaveLength(0)
|
|
25
|
+
expect(wrapper.findAll('.panel-header')).toHaveLength(1)
|
|
26
|
+
|
|
27
|
+
expect(wrapper.get('.panel-header').text()).toBe('Title')
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
test('footer prop', () => {
|
|
31
|
+
const wrapper = mount(MyPanel, {
|
|
32
|
+
props: {
|
|
33
|
+
footer: 'Footer'
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
expect(wrapper.findAll('.panel-section')).toHaveLength(2)
|
|
38
|
+
expect(wrapper.findAll('.panel-body')).toHaveLength(1)
|
|
39
|
+
expect(wrapper.findAll('.panel-footer')).toHaveLength(1)
|
|
40
|
+
expect(wrapper.findAll('.panel-header')).toHaveLength(0)
|
|
41
|
+
|
|
42
|
+
expect(wrapper.get('.panel-footer').text()).toBe('Footer')
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
test('title and footer props', () => {
|
|
46
|
+
const wrapper = mount(MyPanel, {
|
|
47
|
+
props: {
|
|
48
|
+
title: 'Both title',
|
|
49
|
+
footer: 'and footer'
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
expect(wrapper.findAll('.panel-section')).toHaveLength(3)
|
|
54
|
+
expect(wrapper.findAll('.panel-body')).toHaveLength(1)
|
|
55
|
+
expect(wrapper.findAll('.panel-footer')).toHaveLength(1)
|
|
56
|
+
expect(wrapper.findAll('.panel-header')).toHaveLength(1)
|
|
57
|
+
|
|
58
|
+
expect(wrapper.get('.panel-header').text()).toBe('Both title')
|
|
59
|
+
expect(wrapper.get('.panel-footer').text()).toBe('and footer')
|
|
60
|
+
})
|
|
61
|
+
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
|
2
|
+
name: Deploy to GitHub Pages
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
# Runs on pushes targeting the default branch
|
|
6
|
+
push:
|
|
7
|
+
branches: ['main']
|
|
8
|
+
|
|
9
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pages: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
# Allow only one concurrent deployment
|
|
19
|
+
concurrency:
|
|
20
|
+
group: 'pages'
|
|
21
|
+
cancel-in-progress: false
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
# Single deploy job since we're just deploying
|
|
25
|
+
deploy:
|
|
26
|
+
environment:
|
|
27
|
+
name: github-pages
|
|
28
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- name: Checkout
|
|
32
|
+
uses: actions/checkout@v4
|
|
33
|
+
- name: Install pnpm
|
|
34
|
+
uses: pnpm/action-setup@v4
|
|
35
|
+
with:
|
|
36
|
+
version: 9
|
|
37
|
+
- name: Set up Node
|
|
38
|
+
uses: actions/setup-node@v4
|
|
39
|
+
with:
|
|
40
|
+
node-version: 20
|
|
41
|
+
cache: 'pnpm'
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: pnpm install
|
|
44
|
+
- name: Build
|
|
45
|
+
run: pnpm run docs:build
|
|
46
|
+
- name: Setup Pages
|
|
47
|
+
uses: actions/configure-pages@v4
|
|
48
|
+
- name: Upload artifact
|
|
49
|
+
uses: actions/upload-pages-artifact@v3
|
|
50
|
+
with:
|
|
51
|
+
# Upload docs dist directory
|
|
52
|
+
path: './packages/docs/dist'
|
|
53
|
+
- name: Deploy to GitHub Pages
|
|
54
|
+
id: deployment
|
|
55
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"scripts": {
|
|
4
|
+
"dev": "vite --port 5051",
|
|
5
|
+
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
|
6
|
+
"build-only": "vite build",
|
|
7
|
+
"build": "pnpm run type-check && pnpm run build-only",
|
|
8
|
+
"preview": "vite preview --port 4051",
|
|
9
|
+
"clean": "rimraf dist"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"vue": "^3.5.13"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@tsconfig/node22": "^22.0.0",
|
|
16
|
+
"@types/node": "^22.10.7",
|
|
17
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
18
|
+
"@vue/tsconfig": "^0.7.0",
|
|
19
|
+
"rimraf": "^5.0.1",
|
|
20
|
+
"typescript": "~5.7.3",
|
|
21
|
+
"vite": "^6.0.11",
|
|
22
|
+
"vite-plugin-vue-devtools": "^7.7.0",
|
|
23
|
+
"vue-tsc": "^2.2.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.playground.app.tsbuildinfo",
|
|
6
|
+
"paths": {
|
|
7
|
+
"@/*": ["./src/*"],
|
|
8
|
+
"@scopedPackageName@": ["../@projectName@/src/index.ts"]
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsconfig/node22/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"vite.config.*",
|
|
5
|
+
"vitest.config.*",
|
|
6
|
+
"cypress.config.*",
|
|
7
|
+
"nightwatch.conf.*",
|
|
8
|
+
"playwright.config.*",
|
|
9
|
+
"eslint.config.*"
|
|
10
|
+
],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.playground.node.tsbuildinfo",
|
|
14
|
+
"module": "ESNext",
|
|
15
|
+
"moduleResolution": "Bundler",
|
|
16
|
+
"types": ["node"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vite'
|
|
4
|
+
import vue from '@vitejs/plugin-vue'
|
|
5
|
+
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
6
|
+
|
|
7
|
+
export default defineConfig(({ mode }) => ({
|
|
8
|
+
plugins: [
|
|
9
|
+
vue(),
|
|
10
|
+
vueDevTools(),
|
|
11
|
+
],
|
|
12
|
+
resolve: {
|
|
13
|
+
alias: {
|
|
14
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
15
|
+
'@scopedPackageName@': fileURLToPath(new URL('../@projectName@/src/index.ts', import.meta.url))
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
define: {
|
|
20
|
+
__DEV__: JSON.stringify(mode !== 'production')
|
|
21
|
+
}
|
|
22
|
+
}))
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<link rel="icon" href="/favicon.ico">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Playground</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Example as ExampleComponent, MyPanel } from '@scopedPackageName@'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="main">
|
|
7
|
+
<ExampleComponent />
|
|
8
|
+
<MyPanel title="Panel title" footer="Panel footer">
|
|
9
|
+
Header and footer
|
|
10
|
+
</MyPanel>
|
|
11
|
+
<MyPanel title="Panel title">
|
|
12
|
+
Just a header
|
|
13
|
+
</MyPanel>
|
|
14
|
+
<MyPanel footer="Panel footer">
|
|
15
|
+
Just a footer
|
|
16
|
+
</MyPanel>
|
|
17
|
+
<MyPanel>
|
|
18
|
+
No header or footer
|
|
19
|
+
</MyPanel>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style scoped>
|
|
24
|
+
.main > * + * {
|
|
25
|
+
margin-top: 10px;
|
|
26
|
+
max-width: 300px;
|
|
27
|
+
}
|
|
28
|
+
</style>
|