@skirtle/create-vue-lib 0.0.1 → 0.0.3
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/dist/index.cjs +197 -160
- package/dist/template/base/config/{.editorconfig → .editorconfig.ejs} +6 -0
- package/dist/template/base/config/.gitignore.ejs +32 -0
- package/dist/template/base/config/.vscode/extensions.json.ejs +12 -0
- package/dist/template/base/config/.vscode/settings.json.ejs +13 -0
- package/dist/template/base/config/LICENSE +0 -0
- package/dist/template/base/config/package.json.ejs +31 -16
- package/dist/template/base/config/packages/@projectName@/package.json.ejs +78 -0
- package/dist/template/base/config/packages/@projectName@/src/global.d.ts.ejs +4 -0
- package/dist/template/base/config/packages/@projectName@/{tsconfig.app.json → tsconfig.app.json.ejs} +3 -1
- package/dist/template/base/config/packages/@projectName@/{tsconfig.json → tsconfig.json.ejs} +2 -0
- package/dist/template/base/config/packages/@projectName@/tsconfig.node.json +1 -1
- package/dist/template/base/config/packages/@projectName@/{vite.config.mts → vite.config.mts.ejs} +29 -5
- package/dist/template/base/config/pnpm-workspace.yaml.ejs +12 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/{ExampleComponent.vue → ExampleComponent.vue.ejs} +3 -0
- package/dist/template/eslint/config/eslint.config.mts.ejs +4 -0
- package/dist/template/eslint/config/tsconfig.json +10 -0
- package/dist/template/gh-pages/config/.github/workflows/{pages.yml → pages.yml.ejs} +1 -1
- package/dist/template/playground/config/packages/playground/package.json +7 -7
- package/dist/template/playground/config/packages/playground/tsconfig.app.json.ejs +13 -0
- package/dist/template/playground/config/packages/playground/tsconfig.node.json +1 -1
- package/dist/template/playground/config/packages/playground/vite.config.mts.ejs +46 -0
- package/dist/template/vitepress/config/packages/docs/.vitepress/config.mts.ejs +30 -5
- package/dist/template/vitepress/config/packages/docs/package.json +6 -7
- package/dist/template/vitepress/config/packages/docs/{tsconfig.app.json → tsconfig.app.json.ejs} +4 -2
- package/dist/template/vitepress/config/packages/docs/tsconfig.node.json +0 -1
- package/dist/template/{base → vitest}/config/packages/@projectName@/tsconfig.vitest.json +1 -1
- package/package.json +6 -9
- package/LICENSE +0 -21
- package/dist/template/base/config/packages/@projectName@/README.md.ejs +0 -5
- package/dist/template/base/config/packages/@projectName@/package.json +0 -68
- package/dist/template/base/config/packages/@projectName@/src/global.d.ts +0 -1
- package/dist/template/base/config/pnpm-workspace.yaml +0 -2
- package/dist/template/base/config/tsconfig.json +0 -4
- package/dist/template/playground/config/packages/playground/tsconfig.app.json +0 -11
- package/dist/template/playground/config/packages/playground/vite.config.mts +0 -22
- /package/dist/template/{base → vitest}/examples/packages/@projectName@/src/components/__tests__/MyPanel.spec.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
.DS_Store
|
|
12
|
+
dist
|
|
13
|
+
dist-ssr
|
|
14
|
+
coverage
|
|
15
|
+
*.local
|
|
16
|
+
<%- config.packagesDir %>docs/.vitepress/cache
|
|
17
|
+
<%- config.packagesDir %><%- config.mainPackageDirName %>/README.md
|
|
18
|
+
|
|
19
|
+
/cypress/videos/
|
|
20
|
+
/cypress/screenshots/
|
|
21
|
+
|
|
22
|
+
# Editor directories and files
|
|
23
|
+
.vscode/*
|
|
24
|
+
!.vscode/extensions.json
|
|
25
|
+
.idea
|
|
26
|
+
*.suo
|
|
27
|
+
*.ntvs*
|
|
28
|
+
*.njsproj
|
|
29
|
+
*.sln
|
|
30
|
+
*.sw?
|
|
31
|
+
|
|
32
|
+
*.tsbuildinfo
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"explorer.fileNesting.enabled": true,
|
|
3
|
+
"explorer.fileNesting.patterns": {
|
|
4
|
+
"tsconfig.json": "tsconfig.*.json, env.d.ts",
|
|
5
|
+
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
|
|
6
|
+
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig"
|
|
7
|
+
},
|
|
8
|
+
<%_ if (config.includeEsLint) { _%>
|
|
9
|
+
"editor.codeActionsOnSave": {
|
|
10
|
+
"source.fixAll": "explicit"
|
|
11
|
+
}
|
|
12
|
+
<%_ } _%>
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -7,27 +7,34 @@
|
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"clean": "pnpm run -r clean",
|
|
10
|
-
"build": "pnpm run -r build",
|
|
11
|
-
"type-check": "pnpm run -r type-check",
|
|
12
|
-
<%_ if (config.includeEsLint) { _%>
|
|
13
|
-
"lint": "eslint",
|
|
14
|
-
"lint:fix": "eslint --fix",
|
|
15
|
-
<%_ } _%>
|
|
16
10
|
<%_ if (config.includePlayground) { _%>
|
|
17
|
-
"dev": "pnpm run --filter
|
|
11
|
+
"dev": "pnpm run --filter ./<%- config.packagesDir %>playground -r dev",
|
|
18
12
|
<%_ } _%>
|
|
19
13
|
<%_ if (config.includeDocs) { _%>
|
|
20
|
-
"docs:dev": "pnpm run --filter
|
|
21
|
-
"docs:build": "pnpm run --filter
|
|
14
|
+
"docs:dev": "pnpm run --filter ./<%- config.packagesDir %>docs -r dev",
|
|
15
|
+
"docs:build": "pnpm run --filter ./<%- config.packagesDir %>docs -r build",
|
|
16
|
+
<%_ } _%>
|
|
17
|
+
<%_ if (config.includeVitest) { _%>
|
|
18
|
+
"test:unit": "pnpm run --filter ./<%- config.packagesDir %><%- config.mainPackageDirName %> -r test:unit",
|
|
19
|
+
"coverage": "pnpm run --filter ./<%- config.packagesDir %><%- config.mainPackageDirName %> -r coverage",
|
|
20
|
+
<%_ } _%>
|
|
21
|
+
<%_ if (config.includeEsLint) { _%>
|
|
22
|
+
"type-check": "run-p type-check:*",
|
|
23
|
+
"type-check:packages": "pnpm run -r type-check",
|
|
24
|
+
"type-check:self": "tsc",
|
|
25
|
+
"lint": "eslint",
|
|
26
|
+
"lint:fix": "eslint --fix",
|
|
27
|
+
"lint:staged": "lint-staged",
|
|
28
|
+
<%_ } else { _%>
|
|
29
|
+
"type-check": "pnpm run -r type-check",
|
|
22
30
|
<%_ } _%>
|
|
23
|
-
"
|
|
24
|
-
"coverage": "pnpm run --filter ./packages/<%- config.mainPackageDirName %> -r coverage",
|
|
31
|
+
"build": "pnpm run -r build",
|
|
25
32
|
"preinstall": "node scripts/preinstall.js",
|
|
26
33
|
"postinstall": "simple-git-hooks"
|
|
27
34
|
},
|
|
28
35
|
<%_ if (config.includeEsLint) { _%>
|
|
29
36
|
"simple-git-hooks": {
|
|
30
|
-
"pre-commit": "pnpm run type-check
|
|
37
|
+
"pre-commit": "pnpm exec run-s type-check lint:staged"
|
|
31
38
|
},
|
|
32
39
|
"lint-staged": {
|
|
33
40
|
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --fix"
|
|
@@ -43,14 +50,22 @@
|
|
|
43
50
|
<%_ if (config.includeEsLintStylistic) { _%>
|
|
44
51
|
"@stylistic/eslint-plugin": "^4.0.0",
|
|
45
52
|
<%_ } _%>
|
|
53
|
+
"@tsconfig/node22": "^22.0.0",
|
|
54
|
+
"@types/node": "^22.13.4",
|
|
46
55
|
"@typescript-eslint/parser": "^8.23.0",
|
|
47
|
-
|
|
48
|
-
"@
|
|
49
|
-
|
|
56
|
+
<%_ if (config.includeVitest) { _%>
|
|
57
|
+
"@vitest/eslint-plugin": "1.1.31",
|
|
58
|
+
<%_ } _%>
|
|
59
|
+
"@vue/eslint-config-typescript": "^14.4.0",
|
|
60
|
+
"eslint": "^9.20.1",
|
|
50
61
|
"eslint-plugin-vue": "^9.32.0",
|
|
51
62
|
"jiti": "^2.4.2",
|
|
52
63
|
"lint-staged": "^15.4.3",
|
|
64
|
+
"npm-run-all2": "^7.0.2",
|
|
65
|
+
<%_ } _%>
|
|
66
|
+
"simple-git-hooks": "^2.11.1",
|
|
67
|
+
<%_ if (config.includeEsLint) { _%>
|
|
68
|
+
"typescript": "~5.7.3"
|
|
53
69
|
<%_ } _%>
|
|
54
|
-
"simple-git-hooks": "^2.11.1"
|
|
55
70
|
}
|
|
56
71
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "<%- config.scopedPackageName %>",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "",
|
|
7
|
+
"description": "",
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"homepage": "<%- config.homepageUrl %>",
|
|
10
|
+
"bugs": "<%- config.githubIssues %>",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "<%- config.githubRepository %>"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "dist/<%- config.unscopedPackageName %>.cjs",
|
|
17
|
+
"module": "dist/<%- config.unscopedPackageName %>.esm-bundler.prod.mjs",
|
|
18
|
+
"unpkg": "dist/<%- config.unscopedPackageName %>.global.dev.js",
|
|
19
|
+
"jsdelivr": "dist/<%- config.unscopedPackageName %>.global.dev.js",
|
|
20
|
+
"types": "dist/<%- config.unscopedPackageName %>.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/<%- config.unscopedPackageName %>.d.ts",
|
|
24
|
+
"import": {
|
|
25
|
+
"development": "./dist/<%- config.unscopedPackageName %>.esm.dev.js",
|
|
26
|
+
"default": "./dist/<%- config.unscopedPackageName %>.esm-bundler.prod.mjs"
|
|
27
|
+
},
|
|
28
|
+
"require": "./dist/<%- config.unscopedPackageName %>.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./dist/*": "./dist/*",
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"vue": "^3.2.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
41
|
+
"@tsconfig/node22": "^22.0.0",
|
|
42
|
+
"@types/jsdom": "^21.1.7",
|
|
43
|
+
"@types/node": "^22.13.4",
|
|
44
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
45
|
+
<%_ if (config.includeVitest) { _%>
|
|
46
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
47
|
+
"@vue/test-utils": "^2.4.6",
|
|
48
|
+
<%_ } _%>
|
|
49
|
+
"@vue/tsconfig": "^0.7.0",
|
|
50
|
+
"copyfiles": "^2.4.1",
|
|
51
|
+
"cross-env": "^7.0.3",
|
|
52
|
+
"jsdom": "^26.0.0",
|
|
53
|
+
"npm-run-all2": "^7.0.2",
|
|
54
|
+
"rimraf": "^5.0.1",
|
|
55
|
+
"typescript": "~5.7.3",
|
|
56
|
+
"vite": "^6.1.0",
|
|
57
|
+
"vite-plugin-dts": "^4.5.3",
|
|
58
|
+
<%_ if (config.includeVitest) { _%>
|
|
59
|
+
"vitest": "^3.0.5",
|
|
60
|
+
<%_ } _%>
|
|
61
|
+
"vue": "^3.5.13",
|
|
62
|
+
"vue-tsc": "^2.2.2"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"clean:dist": "rimraf dist",
|
|
66
|
+
"clean": "rimraf dist coverage README.md",
|
|
67
|
+
<%_ if (config.includeVitest) { _%>
|
|
68
|
+
"test:unit": "vitest --environment jsdom",
|
|
69
|
+
"coverage": "vitest run --coverage --environment jsdom",
|
|
70
|
+
<%_ } _%>
|
|
71
|
+
"type-check": "vue-tsc --build",
|
|
72
|
+
"build:copy": "copyfiles -f ../../README.md .",
|
|
73
|
+
"build:dev": "cross-env NODE_ENV=development vite build --mode development",
|
|
74
|
+
"build:neutral": "vite build --mode neutral",
|
|
75
|
+
"build:prod": "vite build --mode production",
|
|
76
|
+
"build": "run-s clean:dist build:* type-check"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/dist/template/base/config/packages/@projectName@/{tsconfig.app.json → tsconfig.app.json.ejs}
RENAMED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
4
|
"exclude": ["src/**/__tests__/*"],
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"tsBuildInfoFile": "
|
|
6
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
7
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
7
8
|
"paths": {
|
|
8
9
|
"@/*": ["./src/*"]
|
|
9
10
|
}
|
|
11
|
+
<%_ } _%>
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"compilerOptions": {
|
|
12
12
|
"noEmit": true,
|
|
13
|
-
"tsBuildInfoFile": "
|
|
13
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
14
14
|
"module": "ESNext",
|
|
15
15
|
"moduleResolution": "Bundler",
|
|
16
16
|
"types": ["node"]
|
package/dist/template/base/config/packages/@projectName@/{vite.config.mts → vite.config.mts.ejs}
RENAMED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { resolve } from 'node:path'
|
|
2
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
2
3
|
import { fileURLToPath, URL } from 'node:url'
|
|
4
|
+
<%_ } _%>
|
|
3
5
|
|
|
4
|
-
import { defineConfig } from 'vite'
|
|
6
|
+
import { defineConfig, type UserConfig } from 'vite'
|
|
5
7
|
import replace from '@rollup/plugin-replace'
|
|
6
8
|
import vue from '@vitejs/plugin-vue'
|
|
7
9
|
import dts from 'vite-plugin-dts'
|
|
8
10
|
|
|
9
|
-
export default defineConfig(({ mode }) => {
|
|
11
|
+
export default defineConfig(({ mode }): UserConfig => {
|
|
10
12
|
if (mode !== 'production' && mode !== 'development' && mode !== 'neutral' && mode !== 'test') {
|
|
11
13
|
throw new Error(`Unknown mode: ${mode}`)
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
const expectedNodeEnv = mode === 'neutral' ? 'production' : mode
|
|
17
|
+
const nodeEnv = process.env.NODE_ENV
|
|
18
|
+
|
|
19
|
+
if (nodeEnv !== expectedNodeEnv) {
|
|
20
|
+
console.warn(`Expected NODE_ENV to be '${expectedNodeEnv}' for mode '${mode}', found '${nodeEnv}'`)
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
const dtsPlugin = mode === 'neutral'
|
|
15
24
|
? dts({
|
|
16
25
|
rollupTypes: true,
|
|
@@ -29,29 +38,44 @@ export default defineConfig(({ mode }) => {
|
|
|
29
38
|
vue(),
|
|
30
39
|
dtsPlugin
|
|
31
40
|
],
|
|
41
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
32
42
|
resolve: {
|
|
33
43
|
alias: {
|
|
34
44
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
35
45
|
}
|
|
36
46
|
},
|
|
47
|
+
<%_ } _%>
|
|
48
|
+
<%_ if (config.includeTestVariable) { _%>
|
|
49
|
+
define: {
|
|
50
|
+
__TEST__: mode === 'test'
|
|
51
|
+
},
|
|
52
|
+
<%_ } _%>
|
|
37
53
|
build: {
|
|
38
54
|
target: 'es2019',
|
|
39
55
|
emptyOutDir: false,
|
|
40
56
|
minify: mode === 'production',
|
|
41
57
|
lib: {
|
|
42
58
|
entry: resolve(__dirname, 'src/index.ts'),
|
|
43
|
-
name: '
|
|
59
|
+
name: '<%- config.globalVariableName %>',
|
|
44
60
|
formats: mode === 'neutral' ? ['cjs', 'es'] : ['es', 'iife'],
|
|
61
|
+
cssFileName: mode === 'production' ? '<%- config.unscopedPackageName %>.prod' : '<%- config.unscopedPackageName %>',
|
|
45
62
|
|
|
46
63
|
fileName(format) {
|
|
47
|
-
let name = '
|
|
64
|
+
let name = '<%- config.unscopedPackageName %>'
|
|
48
65
|
let extension = 'js'
|
|
49
66
|
|
|
50
67
|
if (format === 'iife') {
|
|
51
68
|
name += '.global'
|
|
52
69
|
}
|
|
53
70
|
else if (format === 'es') {
|
|
54
|
-
name += '.esm
|
|
71
|
+
name += '.esm'
|
|
72
|
+
|
|
73
|
+
if (mode === 'neutral') {
|
|
74
|
+
name += '-bundler.prod'
|
|
75
|
+
}
|
|
76
|
+
else if (mode === 'production') {
|
|
77
|
+
name += '-browser'
|
|
78
|
+
}
|
|
55
79
|
}
|
|
56
80
|
|
|
57
81
|
if (mode === 'production') {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
packages:
|
|
2
|
+
<%_ if (config.includePackagesDir) { _%>
|
|
3
|
+
- '<%- config.packagesDir %>*'
|
|
4
|
+
<%_ } else { _%>
|
|
5
|
+
- '<%- config.mainPackageDirName %>'
|
|
6
|
+
<%_ if (config.includeDocs) { _%>
|
|
7
|
+
- 'docs'
|
|
8
|
+
<%_ } _%>
|
|
9
|
+
<%_ if (config.includePlayground) { _%>
|
|
10
|
+
- 'playground'
|
|
11
|
+
<%_ } _%>
|
|
12
|
+
<%_ } _%>
|
|
@@ -7,7 +7,9 @@ import pluginVue from 'eslint-plugin-vue'
|
|
|
7
7
|
import stylistic from '@stylistic/eslint-plugin'
|
|
8
8
|
<%_ } _%>
|
|
9
9
|
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
|
10
|
+
<%_ if (config.includeVitest) { _%>
|
|
10
11
|
import pluginVitest from '@vitest/eslint-plugin'
|
|
12
|
+
<%_ } _%>
|
|
11
13
|
|
|
12
14
|
export default defineConfigWithVueTs(
|
|
13
15
|
{
|
|
@@ -26,8 +28,10 @@ export default defineConfigWithVueTs(
|
|
|
26
28
|
}),
|
|
27
29
|
<%_ } _%>
|
|
28
30
|
|
|
31
|
+
<%_ if (config.includeVitest) { _%>
|
|
29
32
|
{
|
|
30
33
|
...pluginVitest.configs.recommended,
|
|
31
34
|
files: ['src/**/__tests__/*']
|
|
32
35
|
}
|
|
36
|
+
<%_ } _%>
|
|
33
37
|
)
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
3
|
"scripts": {
|
|
4
|
+
"clean": "rimraf dist",
|
|
4
5
|
"dev": "vite --port 5051",
|
|
5
6
|
"type-check": "vue-tsc --build",
|
|
6
|
-
"build
|
|
7
|
-
"build": "run-p -c type-check \"build
|
|
8
|
-
"preview": "vite preview --port 4051"
|
|
9
|
-
"clean": "rimraf dist"
|
|
7
|
+
"build:only": "vite build",
|
|
8
|
+
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
9
|
+
"preview": "vite preview --port 4051"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"vue": "^3.5.13"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@tsconfig/node22": "^22.0.0",
|
|
16
|
-
"@types/node": "^22.
|
|
16
|
+
"@types/node": "^22.13.4",
|
|
17
17
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
18
18
|
"@vue/tsconfig": "^0.7.0",
|
|
19
19
|
"npm-run-all2": "^7.0.2",
|
|
20
20
|
"rimraf": "^5.0.1",
|
|
21
21
|
"typescript": "~5.7.3",
|
|
22
|
-
"vite": "^6.0
|
|
22
|
+
"vite": "^6.1.0",
|
|
23
23
|
"vite-plugin-vue-devtools": "^7.7.0",
|
|
24
|
-
"vue-tsc": "^2.2.
|
|
24
|
+
"vue-tsc": "^2.2.2"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
6
|
+
"paths": {
|
|
7
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
8
|
+
"@/*": ["./src/*"],
|
|
9
|
+
<%_ } _%>
|
|
10
|
+
"<%- config.scopedPackageName %>": ["../<%- config.mainPackageDirName %>/src/index.ts"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"compilerOptions": {
|
|
12
12
|
"noEmit": true,
|
|
13
|
-
"tsBuildInfoFile": "
|
|
13
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
14
14
|
"module": "ESNext",
|
|
15
15
|
"moduleResolution": "Bundler",
|
|
16
16
|
"types": ["node"]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { defineConfig, type UserConfig } from 'vite'
|
|
4
|
+
import vue from '@vitejs/plugin-vue'
|
|
5
|
+
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
6
|
+
|
|
7
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
8
|
+
const librarySrc = fileURLToPath(new URL('../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
9
|
+
const playgroundSrc = fileURLToPath(new URL('./src/', import.meta.url))
|
|
10
|
+
<%_ } _%>
|
|
11
|
+
|
|
12
|
+
export default defineConfig(({ mode }): UserConfig => ({
|
|
13
|
+
plugins: [
|
|
14
|
+
vue(),
|
|
15
|
+
vueDevTools()
|
|
16
|
+
],
|
|
17
|
+
resolve: {
|
|
18
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
19
|
+
alias: [
|
|
20
|
+
{
|
|
21
|
+
find: '@',
|
|
22
|
+
replacement: '@',
|
|
23
|
+
customResolver(source, importer) {
|
|
24
|
+
return source.replace(
|
|
25
|
+
/^@\//,
|
|
26
|
+
importer?.startsWith(librarySrc) ? librarySrc : playgroundSrc
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
find: '<%- config.scopedPackageName %>',
|
|
31
|
+
replacement: librarySrc
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
<%_ } else { _%>
|
|
35
|
+
alias: {
|
|
36
|
+
<%- config.packageNameAsObjectKey %>: fileURLToPath(new URL('../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
37
|
+
}
|
|
38
|
+
<%_ } _%>
|
|
39
|
+
},
|
|
40
|
+
define: {
|
|
41
|
+
__DEV__: mode !== 'production',
|
|
42
|
+
<%_ if (config.includeTestVariable) { _%>
|
|
43
|
+
__TEST__: false
|
|
44
|
+
<%_ } %>
|
|
45
|
+
}
|
|
46
|
+
}))
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
2
|
|
|
3
3
|
import { defineConfigWithTheme } from 'vitepress'
|
|
4
4
|
|
|
5
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
6
|
+
const librarySrc = fileURLToPath(new URL('../../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
7
|
+
const playgroundSrc = fileURLToPath(new URL('../src/', import.meta.url))
|
|
8
|
+
<%_ } _%>
|
|
9
|
+
|
|
5
10
|
export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
6
11
|
srcDir: './src',
|
|
7
12
|
outDir: './dist',
|
|
@@ -26,17 +31,37 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
|
26
31
|
return [['link', { rel: 'canonical', href: canonicalUrl }]]
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
|
-
|
|
30
34
|
<%_ } _%>
|
|
35
|
+
|
|
31
36
|
vite: {
|
|
32
37
|
resolve: {
|
|
38
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
39
|
+
alias: [
|
|
40
|
+
{
|
|
41
|
+
find: '@',
|
|
42
|
+
replacement: '@',
|
|
43
|
+
customResolver(source, importer) {
|
|
44
|
+
return source.replace(
|
|
45
|
+
/^@\//,
|
|
46
|
+
importer?.startsWith(librarySrc) ? librarySrc : playgroundSrc
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
find: '<%- config.scopedPackageName %>',
|
|
51
|
+
replacement: librarySrc
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
<%_ } else { _%>
|
|
33
55
|
alias: {
|
|
34
|
-
|
|
56
|
+
<%- config.packageNameAsObjectKey %>: fileURLToPath(new URL('../../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
35
57
|
}
|
|
58
|
+
<%_ } _%>
|
|
36
59
|
},
|
|
37
60
|
|
|
38
61
|
define: {
|
|
39
|
-
__DEV__:
|
|
62
|
+
__DEV__: mode !== 'production'<%_ if (config.includeTestVariable) { _%>,
|
|
63
|
+
__TEST__: false
|
|
64
|
+
<%_ } %>
|
|
40
65
|
}
|
|
41
66
|
},
|
|
42
67
|
|
|
@@ -53,8 +78,8 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
|
53
78
|
socialLinks: [
|
|
54
79
|
{ icon: 'github', link: '<%- config.githubUrl %>' }
|
|
55
80
|
],
|
|
56
|
-
|
|
57
81
|
<%_ } _%>
|
|
82
|
+
|
|
58
83
|
sidebar: [
|
|
59
84
|
{
|
|
60
85
|
text: 'Getting started',
|
|
@@ -3,25 +3,24 @@
|
|
|
3
3
|
"scripts": {
|
|
4
4
|
"clean": "rimraf dist .vitepress/cache",
|
|
5
5
|
"dev": "vitepress dev .",
|
|
6
|
-
"type-check": "run-p -c type-check:*",
|
|
7
6
|
"type-check:code": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
|
8
7
|
"type-check:config": "vue-tsc --noEmit -p tsconfig.node.json --composite false",
|
|
9
|
-
"
|
|
10
|
-
"build": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
8
|
+
"type-check": "run-p -c type-check:*",
|
|
9
|
+
"build:only": "vitepress build .",
|
|
10
|
+
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
11
|
+
"preview": "vitepress preview ."
|
|
13
12
|
},
|
|
14
13
|
"dependencies": {
|
|
15
14
|
"vue": "^3.5.13"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
17
|
"@tsconfig/node22": "^22.0.0",
|
|
19
|
-
"@types/node": "^22.13.
|
|
18
|
+
"@types/node": "^22.13.4",
|
|
20
19
|
"@vue/tsconfig": "^0.7.0",
|
|
21
20
|
"npm-run-all2": "^7.0.2",
|
|
22
21
|
"rimraf": "^6.0.1",
|
|
23
22
|
"typescript": "~5.7.3",
|
|
24
23
|
"vitepress": "^1.6.3",
|
|
25
|
-
"vue-tsc": "^2.2.
|
|
24
|
+
"vue-tsc": "^2.2.2"
|
|
26
25
|
}
|
|
27
26
|
}
|
package/dist/template/vitepress/config/packages/docs/{tsconfig.app.json → tsconfig.app.json.ejs}
RENAMED
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
"src/**/*.md"
|
|
10
10
|
],
|
|
11
11
|
"compilerOptions": {
|
|
12
|
-
"tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.docs.app.tsbuildinfo",
|
|
13
12
|
"paths": {
|
|
14
|
-
|
|
13
|
+
<%_ if (config.includeAtAliases) { _%>
|
|
14
|
+
"@/*": ["./src/*"],
|
|
15
|
+
<%_ } _%>
|
|
16
|
+
"<%- config.scopedPackageName %>": ["../<%- config.mainPackageDirName %>/src/index.ts"]
|
|
15
17
|
}
|
|
16
18
|
},
|
|
17
19
|
"vueCompilerOptions": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"include": ["src/**/__tests__/*", "env.d.ts"],
|
|
4
4
|
"exclude": [],
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"tsBuildInfoFile": "
|
|
6
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
|
|
7
7
|
"lib": [],
|
|
8
8
|
"types": ["node", "jsdom"]
|
|
9
9
|
}
|