@skirtle/create-vue-lib 0.0.2 → 0.0.4
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 +29 -5
- package/dist/template/base/config/.gitignore.ejs +2 -3
- package/dist/template/base/config/.vscode/extensions.json.ejs +2 -0
- package/dist/template/base/config/package.json.ejs +17 -14
- package/dist/template/base/config/packages/@projectName@/package.json.ejs +81 -0
- package/dist/template/base/config/packages/@projectName@/{tsconfig.json → tsconfig.json.ejs} +2 -0
- package/dist/template/base/config/packages/@projectName@/vite.config.mts.ejs +20 -4
- package/dist/template/base/config/pnpm-workspace.yaml.ejs +12 -0
- package/dist/template/eslint/config/eslint.config.mts.ejs +4 -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/vite.config.mts.ejs +4 -3
- package/dist/template/vitepress/config/packages/docs/.vitepress/config.mts.ejs +4 -4
- package/dist/template/vitepress/config/packages/docs/package.json +5 -5
- package/package.json +4 -2
- package/dist/template/base/config/packages/@projectName@/package.json +0 -70
- package/dist/template/base/config/pnpm-workspace.yaml +0 -2
- /package/dist/template/{base → vitest}/config/packages/@projectName@/tsconfig.vitest.json +0 -0
- /package/dist/template/{base → vitest}/examples/packages/@projectName@/src/components/__tests__/MyPanel.spec.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -5623,7 +5623,7 @@ var import_ejs = __toESM(require_ejs(), 1);
|
|
|
5623
5623
|
// package.json
|
|
5624
5624
|
var package_default = {
|
|
5625
5625
|
name: "@skirtle/create-vue-lib",
|
|
5626
|
-
version: "0.0.
|
|
5626
|
+
version: "0.0.4",
|
|
5627
5627
|
author: "skirtle",
|
|
5628
5628
|
license: "MIT",
|
|
5629
5629
|
description: "Create a library using Vue and Vite",
|
|
@@ -5655,6 +5655,7 @@ var package_default = {
|
|
|
5655
5655
|
ejs: "^3.1.10",
|
|
5656
5656
|
"npm-run-all2": "^7.0.2",
|
|
5657
5657
|
prompts: "^2.4.2",
|
|
5658
|
+
publint: "^0.3.8",
|
|
5658
5659
|
rimraf: "^6.0.1",
|
|
5659
5660
|
tsup: "^8.3.6",
|
|
5660
5661
|
typescript: "^5.7.3"
|
|
@@ -5662,10 +5663,11 @@ var package_default = {
|
|
|
5662
5663
|
scripts: {
|
|
5663
5664
|
clean: "rimraf dist LICENSE README.md",
|
|
5664
5665
|
"type-check": "tsc",
|
|
5666
|
+
"lint:package": "publint",
|
|
5665
5667
|
"build:copy": "copyfiles -f ../../LICENSE ../../README.md .",
|
|
5666
5668
|
"build:templates": 'copyfiles -u 1 -a "src/template/**" dist',
|
|
5667
5669
|
"build:ts": "tsup src/index.ts --format cjs --target node18",
|
|
5668
|
-
build: "run-s clean build:copy build:templates build:ts",
|
|
5670
|
+
build: "run-s clean build:copy build:templates build:ts lint:package",
|
|
5669
5671
|
start: "node ./dist/index.cjs",
|
|
5670
5672
|
preinstall: "npx only-allow pnpm"
|
|
5671
5673
|
}
|
|
@@ -5795,6 +5797,7 @@ async function init() {
|
|
|
5795
5797
|
process.exit(1);
|
|
5796
5798
|
}
|
|
5797
5799
|
const unscopedPackageName = scopedPackageName.replace(/.*\//, "");
|
|
5800
|
+
const packageNameAsObjectKey = /^[a-zA-Z_$][\w$]*$/.test(scopedPackageName) ? scopedPackageName : `'${scopedPackageName}'`;
|
|
5798
5801
|
const targetDirName = await textPrompt("Target directory", unscopedPackageName);
|
|
5799
5802
|
if (targetDirName !== "." && !isValidDirName(targetDirName)) {
|
|
5800
5803
|
console.log("Invalid directory name: " + targetDirName);
|
|
@@ -5810,6 +5813,8 @@ async function init() {
|
|
|
5810
5813
|
console.log("Target directory already exists");
|
|
5811
5814
|
}
|
|
5812
5815
|
}
|
|
5816
|
+
const includePackagesDir = await togglePromptIf(extended, `Use 'packages' directory?`, true);
|
|
5817
|
+
const packagesDir = includePackagesDir ? "packages/" : "";
|
|
5813
5818
|
const mainPackageDirName = await textPromptIf(extended, "Main package directory", unscopedPackageName);
|
|
5814
5819
|
if (!isValidDirName(mainPackageDirName)) {
|
|
5815
5820
|
console.log("Invalid directory name: " + mainPackageDirName);
|
|
@@ -5833,6 +5838,7 @@ async function init() {
|
|
|
5833
5838
|
}
|
|
5834
5839
|
const includeEsLint = await togglePrompt("Include ESLint?", true);
|
|
5835
5840
|
const includeEsLintStylistic = await togglePromptIf(includeEsLint, "Include ESLint Stylistic for formatting?", includeEsLint);
|
|
5841
|
+
const includeVitest = await togglePromptIf(extended, "Include Vitest for testing?", true);
|
|
5836
5842
|
const includeDocs = await togglePrompt("Include VitePress for documentation?", true);
|
|
5837
5843
|
const includeGithubPages = includeDocs && await togglePrompt("Include GitHub Pages config for documentation?");
|
|
5838
5844
|
const includePlayground = await togglePrompt("Include playground application for development?", true);
|
|
@@ -5854,6 +5860,11 @@ async function init() {
|
|
|
5854
5860
|
suggestExtended();
|
|
5855
5861
|
process.exit(1);
|
|
5856
5862
|
}
|
|
5863
|
+
if (!includePackagesDir && mainPackageDirName === "scripts") {
|
|
5864
|
+
console.log(`The directory name 'scripts' is reserved for the scripts, please choose a different name.`);
|
|
5865
|
+
suggestExtended();
|
|
5866
|
+
process.exit(1);
|
|
5867
|
+
}
|
|
5857
5868
|
const [githubUserName, githubRepoName] = (githubPath || "/").split("/");
|
|
5858
5869
|
const githubUrl = githubPath ? `https://github.com/${githubPath}` : "";
|
|
5859
5870
|
const githubIssues = githubPath ? `${githubUrl}/issues` : "";
|
|
@@ -5865,9 +5876,11 @@ async function init() {
|
|
|
5865
5876
|
const config = {
|
|
5866
5877
|
scopedPackageName,
|
|
5867
5878
|
unscopedPackageName,
|
|
5879
|
+
packageNameAsObjectKey,
|
|
5868
5880
|
globalVariableName,
|
|
5869
5881
|
targetDirName,
|
|
5870
5882
|
targetDirPath,
|
|
5883
|
+
packagesDir,
|
|
5871
5884
|
mainPackageDirName,
|
|
5872
5885
|
templateDirPath,
|
|
5873
5886
|
githubPath,
|
|
@@ -5877,12 +5890,14 @@ async function init() {
|
|
|
5877
5890
|
githubPagesOrigin,
|
|
5878
5891
|
docsBase,
|
|
5879
5892
|
homepageUrl,
|
|
5893
|
+
includePackagesDir,
|
|
5880
5894
|
includeDocs,
|
|
5881
5895
|
includeGithubPages,
|
|
5882
5896
|
includePlayground,
|
|
5883
5897
|
includeExamples,
|
|
5884
5898
|
includeEsLint,
|
|
5885
5899
|
includeEsLintStylistic,
|
|
5900
|
+
includeVitest,
|
|
5886
5901
|
includeAtAliases,
|
|
5887
5902
|
includeTestVariable
|
|
5888
5903
|
};
|
|
@@ -5899,6 +5914,9 @@ async function init() {
|
|
|
5899
5914
|
if (config.includeEsLint) {
|
|
5900
5915
|
copyTemplate("eslint", config);
|
|
5901
5916
|
}
|
|
5917
|
+
if (config.includeVitest) {
|
|
5918
|
+
copyTemplate("vitest", config);
|
|
5919
|
+
}
|
|
5902
5920
|
console.log();
|
|
5903
5921
|
console.log("Project created");
|
|
5904
5922
|
console.log();
|
|
@@ -5935,7 +5953,11 @@ function copyFiles(templateFile, config) {
|
|
|
5935
5953
|
const templatePath = path.join(config.templateDirPath, templateFile);
|
|
5936
5954
|
const stats = fs.statSync(templatePath);
|
|
5937
5955
|
const basename2 = path.basename(templatePath);
|
|
5938
|
-
|
|
5956
|
+
let targetFile = templateFile.replace(/@projectName@/g, config.mainPackageDirName);
|
|
5957
|
+
if (!config.includePackagesDir) {
|
|
5958
|
+
targetFile = targetFile.replace(/^packages/, ".");
|
|
5959
|
+
}
|
|
5960
|
+
const targetPath = path.join(config.targetDirPath, targetFile);
|
|
5939
5961
|
if (stats.isDirectory()) {
|
|
5940
5962
|
if (basename2 === "node_modules") {
|
|
5941
5963
|
return;
|
|
@@ -5951,8 +5973,10 @@ function copyFiles(templateFile, config) {
|
|
|
5951
5973
|
const template = fs.readFileSync(templatePath, "utf-8");
|
|
5952
5974
|
const target = targetPath.replace(/\.ejs$/, "");
|
|
5953
5975
|
let content = import_ejs.default.render(template, { config });
|
|
5954
|
-
if (
|
|
5955
|
-
content = content.replace(
|
|
5976
|
+
if (/\.(json|m?[jt]s)$/.test(target)) {
|
|
5977
|
+
content = content.replace(/ +\n/g, "\n");
|
|
5978
|
+
content = content.replace(/\n\n+/g, "\n\n");
|
|
5979
|
+
content = content.replace(/, *(?:\n+(\n\s*)|(\s*))([}\])])/g, "$1$2$3");
|
|
5956
5980
|
}
|
|
5957
5981
|
fs.writeFileSync(target, content);
|
|
5958
5982
|
} else if (["package.json", "vite.config.mts", "config.mts", "index.md", "introduction.md", "App.vue", "tsconfig.app.json", "env.d.ts"].includes(filename)) {
|
|
@@ -13,9 +13,8 @@ dist
|
|
|
13
13
|
dist-ssr
|
|
14
14
|
coverage
|
|
15
15
|
*.local
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
packages/<%- config.mainPackageDirName %>/README.md
|
|
16
|
+
<%- config.packagesDir %>docs/.vitepress/cache
|
|
17
|
+
<%- config.packagesDir %><%- config.mainPackageDirName %>/README.md
|
|
19
18
|
|
|
20
19
|
/cypress/videos/
|
|
21
20
|
/cypress/screenshots/
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"clean": "pnpm run -r clean",
|
|
10
10
|
<%_ if (config.includePlayground) { _%>
|
|
11
|
-
"dev": "pnpm run --filter
|
|
11
|
+
"dev": "pnpm run --filter ./<%- config.packagesDir %>playground -r dev",
|
|
12
12
|
<%_ } _%>
|
|
13
13
|
<%_ if (config.includeDocs) { _%>
|
|
14
|
-
"docs:dev": "pnpm run --filter
|
|
15
|
-
"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",
|
|
16
20
|
<%_ } _%>
|
|
17
|
-
"test:unit": "pnpm run --filter ./packages/<%- config.mainPackageDirName %> -r test:unit",
|
|
18
|
-
"coverage": "pnpm run --filter ./packages/<%- config.mainPackageDirName %> -r coverage",
|
|
19
21
|
<%_ if (config.includeEsLint) { _%>
|
|
20
22
|
"type-check": "run-p type-check:*",
|
|
21
23
|
"type-check:packages": "pnpm run -r type-check",
|
|
@@ -44,24 +46,25 @@
|
|
|
44
46
|
<%_ } _%>
|
|
45
47
|
"devDependencies": {
|
|
46
48
|
<%_ if (config.includeEsLint) { _%>
|
|
47
|
-
"@eslint/compat": "^1.2.
|
|
49
|
+
"@eslint/compat": "^1.2.7",
|
|
48
50
|
<%_ if (config.includeEsLintStylistic) { _%>
|
|
49
|
-
"@stylistic/eslint-plugin": "^4.
|
|
51
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
50
52
|
<%_ } _%>
|
|
51
53
|
"@tsconfig/node22": "^22.0.0",
|
|
52
|
-
"@types/node": "^22.13.
|
|
53
|
-
|
|
54
|
-
"@vitest/eslint-plugin": "1.1.
|
|
55
|
-
|
|
56
|
-
"eslint": "^
|
|
57
|
-
"eslint
|
|
54
|
+
"@types/node": "^22.13.9",
|
|
55
|
+
<%_ if (config.includeVitest) { _%>
|
|
56
|
+
"@vitest/eslint-plugin": "^1.1.36",
|
|
57
|
+
<%_ } _%>
|
|
58
|
+
"@vue/eslint-config-typescript": "^14.5.0",
|
|
59
|
+
"eslint": "^9.21.0",
|
|
60
|
+
"eslint-plugin-vue": "~10.0.0",
|
|
58
61
|
"jiti": "^2.4.2",
|
|
59
62
|
"lint-staged": "^15.4.3",
|
|
60
63
|
"npm-run-all2": "^7.0.2",
|
|
61
64
|
<%_ } _%>
|
|
62
65
|
"simple-git-hooks": "^2.11.1",
|
|
63
66
|
<%_ if (config.includeEsLint) { _%>
|
|
64
|
-
"typescript": "
|
|
67
|
+
"typescript": "~5.8.0"
|
|
65
68
|
<%_ } _%>
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"main": "dist/<%- config.unscopedPackageName %>.cjs",
|
|
18
|
+
"module": "dist/<%- config.unscopedPackageName %>.esm-bundler.prod.mjs",
|
|
19
|
+
"unpkg": "dist/<%- config.unscopedPackageName %>.global.dev.js",
|
|
20
|
+
"jsdelivr": "dist/<%- config.unscopedPackageName %>.global.dev.js",
|
|
21
|
+
"types": "dist/<%- config.unscopedPackageName %>.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/<%- config.unscopedPackageName %>.d.ts",
|
|
25
|
+
"import": {
|
|
26
|
+
"development": "./dist/<%- config.unscopedPackageName %>.esm.dev.mjs",
|
|
27
|
+
"default": "./dist/<%- config.unscopedPackageName %>.esm-bundler.prod.mjs"
|
|
28
|
+
},
|
|
29
|
+
"require": "./dist/<%- config.unscopedPackageName %>.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./dist/*": "./dist/*",
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"vue": "^3.2.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
42
|
+
"@tsconfig/node22": "^22.0.0",
|
|
43
|
+
"@types/jsdom": "^21.1.7",
|
|
44
|
+
"@types/node": "^22.13.9",
|
|
45
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
46
|
+
<%_ if (config.includeVitest) { _%>
|
|
47
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
48
|
+
"@vue/test-utils": "^2.4.6",
|
|
49
|
+
<%_ } _%>
|
|
50
|
+
"@vue/tsconfig": "^0.7.0",
|
|
51
|
+
"copyfiles": "^2.4.1",
|
|
52
|
+
"cross-env": "^7.0.3",
|
|
53
|
+
"jsdom": "^26.0.0",
|
|
54
|
+
"npm-run-all2": "^7.0.2",
|
|
55
|
+
"publint": "^0.3.8",
|
|
56
|
+
"rimraf": "^5.0.1",
|
|
57
|
+
"typescript": "~5.8.0",
|
|
58
|
+
"vite": "^6.2.1",
|
|
59
|
+
"vite-plugin-dts": "^4.5.3",
|
|
60
|
+
<%_ if (config.includeVitest) { _%>
|
|
61
|
+
"vitest": "^3.0.8",
|
|
62
|
+
<%_ } _%>
|
|
63
|
+
"vue": "^3.5.13",
|
|
64
|
+
"vue-tsc": "^2.2.8"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"clean:dist": "rimraf dist",
|
|
68
|
+
"clean": "rimraf dist coverage README.md",
|
|
69
|
+
<%_ if (config.includeVitest) { _%>
|
|
70
|
+
"test:unit": "vitest --environment jsdom",
|
|
71
|
+
"coverage": "vitest run --coverage --environment jsdom",
|
|
72
|
+
<%_ } _%>
|
|
73
|
+
"type-check": "vue-tsc --build",
|
|
74
|
+
"lint:package": "publint",
|
|
75
|
+
"build:copy": "copyfiles -f ../../README.md .",
|
|
76
|
+
"build:dev": "cross-env NODE_ENV=development vite build --mode development",
|
|
77
|
+
"build:neutral": "vite build --mode neutral",
|
|
78
|
+
"build:prod": "vite build --mode production",
|
|
79
|
+
"build": "run-s clean:dist build:* type-check lint:package"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -13,6 +13,13 @@ export default defineConfig(({ mode }): UserConfig => {
|
|
|
13
13
|
throw new Error(`Unknown mode: ${mode}`)
|
|
14
14
|
}
|
|
15
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
|
+
|
|
16
23
|
const dtsPlugin = mode === 'neutral'
|
|
17
24
|
? dts({
|
|
18
25
|
rollupTypes: true,
|
|
@@ -61,7 +68,19 @@ export default defineConfig(({ mode }): UserConfig => {
|
|
|
61
68
|
name += '.global'
|
|
62
69
|
}
|
|
63
70
|
else if (format === 'es') {
|
|
64
|
-
name += '.esm
|
|
71
|
+
name += '.esm'
|
|
72
|
+
extension = 'mjs'
|
|
73
|
+
|
|
74
|
+
if (mode === 'neutral') {
|
|
75
|
+
name += '-bundler.prod'
|
|
76
|
+
}
|
|
77
|
+
else if (mode === 'production') {
|
|
78
|
+
name += '-browser'
|
|
79
|
+
extension = 'js'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
extension = 'cjs'
|
|
65
84
|
}
|
|
66
85
|
|
|
67
86
|
if (mode === 'production') {
|
|
@@ -70,9 +89,6 @@ export default defineConfig(({ mode }): UserConfig => {
|
|
|
70
89
|
else if (mode === 'development') {
|
|
71
90
|
name += '.dev'
|
|
72
91
|
}
|
|
73
|
-
else if (mode === 'neutral') {
|
|
74
|
-
extension = format === 'cjs' ? 'cjs' : 'mjs'
|
|
75
|
-
}
|
|
76
92
|
|
|
77
93
|
return `${name}.${extension}`
|
|
78
94
|
}
|
|
@@ -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,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
|
+
"type": "module",
|
|
3
4
|
"scripts": {
|
|
4
5
|
"clean": "rimraf dist",
|
|
5
6
|
"dev": "vite --port 5051",
|
|
6
7
|
"type-check": "vue-tsc --build",
|
|
7
8
|
"build:only": "vite build",
|
|
8
9
|
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
9
|
-
"preview": "vite preview --port 4051"
|
|
10
|
-
"preinstall": "node ../../scripts/preinstall.js"
|
|
10
|
+
"preview": "vite preview --port 4051"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"vue": "^3.5.13"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@tsconfig/node22": "^22.0.0",
|
|
17
|
-
"@types/node": "^22.
|
|
17
|
+
"@types/node": "^22.13.9",
|
|
18
18
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
19
19
|
"@vue/tsconfig": "^0.7.0",
|
|
20
20
|
"npm-run-all2": "^7.0.2",
|
|
21
21
|
"rimraf": "^5.0.1",
|
|
22
|
-
"typescript": "~5.
|
|
23
|
-
"vite": "^6.
|
|
24
|
-
"vite-plugin-vue-devtools": "^7.7.
|
|
25
|
-
"vue-tsc": "^2.2.
|
|
22
|
+
"typescript": "~5.8.0",
|
|
23
|
+
"vite": "^6.2.1",
|
|
24
|
+
"vite-plugin-vue-devtools": "^7.7.2",
|
|
25
|
+
"vue-tsc": "^2.2.8"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -7,8 +7,8 @@ import vueDevTools from 'vite-plugin-vue-devtools'
|
|
|
7
7
|
<%_ if (config.includeAtAliases) { _%>
|
|
8
8
|
const librarySrc = fileURLToPath(new URL('../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
9
9
|
const playgroundSrc = fileURLToPath(new URL('./src/', import.meta.url))
|
|
10
|
-
|
|
11
10
|
<%_ } _%>
|
|
11
|
+
|
|
12
12
|
export default defineConfig(({ mode }): UserConfig => ({
|
|
13
13
|
plugins: [
|
|
14
14
|
vue(),
|
|
@@ -33,12 +33,13 @@ export default defineConfig(({ mode }): UserConfig => ({
|
|
|
33
33
|
]
|
|
34
34
|
<%_ } else { _%>
|
|
35
35
|
alias: {
|
|
36
|
-
|
|
36
|
+
<%- config.packageNameAsObjectKey %>: fileURLToPath(new URL('../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
37
37
|
}
|
|
38
38
|
<%_ } _%>
|
|
39
39
|
},
|
|
40
40
|
define: {
|
|
41
|
-
__DEV__: mode !== 'production'
|
|
41
|
+
__DEV__: mode !== 'production',
|
|
42
|
+
<%_ if (config.includeTestVariable) { _%>
|
|
42
43
|
__TEST__: false
|
|
43
44
|
<%_ } %>
|
|
44
45
|
}
|
|
@@ -5,8 +5,8 @@ import { defineConfigWithTheme } from 'vitepress'
|
|
|
5
5
|
<%_ if (config.includeAtAliases) { _%>
|
|
6
6
|
const librarySrc = fileURLToPath(new URL('../../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
7
7
|
const playgroundSrc = fileURLToPath(new URL('../src/', import.meta.url))
|
|
8
|
-
|
|
9
8
|
<%_ } _%>
|
|
9
|
+
|
|
10
10
|
export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
11
11
|
srcDir: './src',
|
|
12
12
|
outDir: './dist',
|
|
@@ -31,8 +31,8 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
|
31
31
|
return [['link', { rel: 'canonical', href: canonicalUrl }]]
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
|
|
35
34
|
<%_ } _%>
|
|
35
|
+
|
|
36
36
|
vite: {
|
|
37
37
|
resolve: {
|
|
38
38
|
<%_ if (config.includeAtAliases) { _%>
|
|
@@ -53,7 +53,7 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
|
53
53
|
]
|
|
54
54
|
<%_ } else { _%>
|
|
55
55
|
alias: {
|
|
56
|
-
|
|
56
|
+
<%- config.packageNameAsObjectKey %>: fileURLToPath(new URL('../../<%- config.mainPackageDirName %>/src/', import.meta.url))
|
|
57
57
|
}
|
|
58
58
|
<%_ } _%>
|
|
59
59
|
},
|
|
@@ -78,8 +78,8 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
|
78
78
|
socialLinks: [
|
|
79
79
|
{ icon: 'github', link: '<%- config.githubUrl %>' }
|
|
80
80
|
],
|
|
81
|
-
|
|
82
81
|
<%_ } _%>
|
|
82
|
+
|
|
83
83
|
sidebar: [
|
|
84
84
|
{
|
|
85
85
|
text: 'Getting started',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
|
+
"type": "module",
|
|
3
4
|
"scripts": {
|
|
4
5
|
"clean": "rimraf dist .vitepress/cache",
|
|
5
6
|
"dev": "vitepress dev .",
|
|
@@ -8,20 +9,19 @@
|
|
|
8
9
|
"type-check": "run-p -c type-check:*",
|
|
9
10
|
"build:only": "vitepress build .",
|
|
10
11
|
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
11
|
-
"preview": "vitepress preview ."
|
|
12
|
-
"preinstall": "node ../../scripts/preinstall.js"
|
|
12
|
+
"preview": "vitepress preview ."
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"vue": "^3.5.13"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@tsconfig/node22": "^22.0.0",
|
|
19
|
-
"@types/node": "^22.13.
|
|
19
|
+
"@types/node": "^22.13.9",
|
|
20
20
|
"@vue/tsconfig": "^0.7.0",
|
|
21
21
|
"npm-run-all2": "^7.0.2",
|
|
22
22
|
"rimraf": "^6.0.1",
|
|
23
|
-
"typescript": "~5.
|
|
23
|
+
"typescript": "~5.8.0",
|
|
24
24
|
"vitepress": "^1.6.3",
|
|
25
|
-
"vue-tsc": "^2.2.
|
|
25
|
+
"vue-tsc": "^2.2.8"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skirtle/create-vue-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"author": "skirtle",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Create a library using Vue and Vite",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"ejs": "^3.1.10",
|
|
38
38
|
"npm-run-all2": "^7.0.2",
|
|
39
39
|
"prompts": "^2.4.2",
|
|
40
|
+
"publint": "^0.3.8",
|
|
40
41
|
"rimraf": "^6.0.1",
|
|
41
42
|
"tsup": "^8.3.6",
|
|
42
43
|
"typescript": "^5.7.3"
|
|
@@ -44,10 +45,11 @@
|
|
|
44
45
|
"scripts": {
|
|
45
46
|
"clean": "rimraf dist LICENSE README.md",
|
|
46
47
|
"type-check": "tsc",
|
|
48
|
+
"lint:package": "publint",
|
|
47
49
|
"build:copy": "copyfiles -f ../../LICENSE ../../README.md .",
|
|
48
50
|
"build:templates": "copyfiles -u 1 -a \"src/template/**\" dist",
|
|
49
51
|
"build:ts": "tsup src/index.ts --format cjs --target node18",
|
|
50
|
-
"build": "run-s clean build:copy build:templates build:ts",
|
|
52
|
+
"build": "run-s clean build:copy build:templates build:ts lint:package",
|
|
51
53
|
"start": "node ./dist/index.cjs",
|
|
52
54
|
"preinstall": "npx only-allow pnpm"
|
|
53
55
|
}
|
|
@@ -1,70 +0,0 @@
|
|
|
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
|
-
"copyfiles": "^2.4.1",
|
|
46
|
-
"cross-env": "^7.0.3",
|
|
47
|
-
"jsdom": "^26.0.0",
|
|
48
|
-
"npm-run-all2": "^7.0.2",
|
|
49
|
-
"rimraf": "^5.0.1",
|
|
50
|
-
"typescript": "~5.7.3",
|
|
51
|
-
"vite": "^6.0.11",
|
|
52
|
-
"vite-plugin-dts": "4.5.0",
|
|
53
|
-
"vitest": "^3.0.2",
|
|
54
|
-
"vue": "^3.5.13",
|
|
55
|
-
"vue-tsc": "^2.2.0"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"clean:dist": "rimraf dist",
|
|
59
|
-
"clean": "rimraf dist coverage LICENSE README.md",
|
|
60
|
-
"test:unit": "vitest --environment jsdom",
|
|
61
|
-
"coverage": "vitest run --coverage --environment jsdom",
|
|
62
|
-
"type-check": "vue-tsc --build",
|
|
63
|
-
"build:copy": "copyfiles -f ../../LICENSE ../../README.md .",
|
|
64
|
-
"build:dev": "cross-env NODE_ENV=development vite build --mode development",
|
|
65
|
-
"build:neutral": "vite build --mode neutral",
|
|
66
|
-
"build:prod": "vite build --mode production",
|
|
67
|
-
"build": "run-s clean:dist build:* type-check",
|
|
68
|
-
"preinstall": "node ../../scripts/preinstall.js"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
File without changes
|
|
File without changes
|