@skirtle/create-vue-lib 0.0.5 → 0.0.7
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/README.md +0 -2
- package/dist/index.cjs +115 -36
- package/dist/template/base/config/package.json.ejs +25 -25
- package/dist/template/base/config/packages/@projectName@/vite.config.mts.ejs +6 -4
- package/dist/template/playground/config/packages/playground/package.json +8 -8
- package/dist/template/playground/config/packages/playground/vite.config.mts.ejs +3 -1
- package/dist/template/playground/examples/packages/playground/src/App.vue +4 -1
- package/dist/template/vitepress/config/packages/docs/.vitepress/config.mts.ejs +3 -2
- package/dist/template/vitepress/config/packages/docs/package.json +10 -10
- package/package.json +6 -9
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -5613,17 +5613,91 @@ var require_ejs = __commonJS({
|
|
|
5613
5613
|
}
|
|
5614
5614
|
});
|
|
5615
5615
|
|
|
5616
|
+
// ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
5617
|
+
var require_picocolors = __commonJS({
|
|
5618
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
5619
|
+
"use strict";
|
|
5620
|
+
var p = process || {};
|
|
5621
|
+
var argv = p.argv || [];
|
|
5622
|
+
var env = p.env || {};
|
|
5623
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
5624
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
5625
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
5626
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
5627
|
+
};
|
|
5628
|
+
var replaceClose = (string, close, replace, index) => {
|
|
5629
|
+
let result = "", cursor = 0;
|
|
5630
|
+
do {
|
|
5631
|
+
result += string.substring(cursor, index) + replace;
|
|
5632
|
+
cursor = index + close.length;
|
|
5633
|
+
index = string.indexOf(close, cursor);
|
|
5634
|
+
} while (~index);
|
|
5635
|
+
return result + string.substring(cursor);
|
|
5636
|
+
};
|
|
5637
|
+
var createColors = (enabled = isColorSupported) => {
|
|
5638
|
+
let f = enabled ? formatter : () => String;
|
|
5639
|
+
return {
|
|
5640
|
+
isColorSupported: enabled,
|
|
5641
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
5642
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
5643
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
5644
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
5645
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
5646
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
5647
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
5648
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
5649
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
5650
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
5651
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
5652
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
5653
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
5654
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
5655
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
5656
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
5657
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
5658
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
5659
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
5660
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
5661
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
5662
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
5663
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
5664
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
5665
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
5666
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
5667
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
5668
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
5669
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
5670
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
5671
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
5672
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
5673
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
5674
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
5675
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
5676
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
5677
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
5678
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
5679
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
5680
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
5681
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
5682
|
+
};
|
|
5683
|
+
};
|
|
5684
|
+
module2.exports = createColors();
|
|
5685
|
+
module2.exports.createColors = createColors;
|
|
5686
|
+
}
|
|
5687
|
+
});
|
|
5688
|
+
|
|
5616
5689
|
// src/index.ts
|
|
5617
5690
|
var fs = __toESM(require("fs"), 1);
|
|
5618
5691
|
var path = __toESM(require("path"), 1);
|
|
5619
5692
|
var import_node_util = require("util");
|
|
5620
5693
|
var import_prompts = __toESM(require_prompts3(), 1);
|
|
5621
5694
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
5695
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
5622
5696
|
|
|
5623
5697
|
// package.json
|
|
5624
5698
|
var package_default = {
|
|
5625
5699
|
name: "@skirtle/create-vue-lib",
|
|
5626
|
-
version: "0.0.
|
|
5700
|
+
version: "0.0.7",
|
|
5627
5701
|
author: "skirtle",
|
|
5628
5702
|
license: "MIT",
|
|
5629
5703
|
description: "Create a library using Vue and Vite",
|
|
@@ -5636,10 +5710,6 @@ var package_default = {
|
|
|
5636
5710
|
},
|
|
5637
5711
|
funding: "https://github.com/sponsors/skirtles-code",
|
|
5638
5712
|
type: "module",
|
|
5639
|
-
packageManager: "pnpm@9.15.4",
|
|
5640
|
-
engines: {
|
|
5641
|
-
node: ">=v18.3.0"
|
|
5642
|
-
},
|
|
5643
5713
|
bin: {
|
|
5644
5714
|
"create-vue-lib": "dist/index.cjs"
|
|
5645
5715
|
},
|
|
@@ -5649,16 +5719,17 @@ var package_default = {
|
|
|
5649
5719
|
devDependencies: {
|
|
5650
5720
|
"@tsconfig/node22": "^22.0.0",
|
|
5651
5721
|
"@types/ejs": "^3.1.5",
|
|
5652
|
-
"@types/node": "^22.13.
|
|
5722
|
+
"@types/node": "^22.13.9",
|
|
5653
5723
|
"@types/prompts": "^2.4.9",
|
|
5654
5724
|
copyfiles: "^2.4.1",
|
|
5655
5725
|
ejs: "^3.1.10",
|
|
5656
5726
|
"npm-run-all2": "^7.0.2",
|
|
5727
|
+
picocolors: "^1.1.1",
|
|
5657
5728
|
prompts: "^2.4.2",
|
|
5658
5729
|
publint: "^0.3.8",
|
|
5659
5730
|
rimraf: "^6.0.1",
|
|
5660
|
-
tsup: "^8.
|
|
5661
|
-
typescript: "
|
|
5731
|
+
tsup: "^8.4.0",
|
|
5732
|
+
typescript: "~5.8.0"
|
|
5662
5733
|
},
|
|
5663
5734
|
scripts: {
|
|
5664
5735
|
clean: "rimraf dist LICENSE README.md",
|
|
@@ -5668,8 +5739,7 @@ var package_default = {
|
|
|
5668
5739
|
"build:templates": 'copyfiles -u 1 -a "src/template/**" dist',
|
|
5669
5740
|
"build:ts": "tsup src/index.ts --format cjs --target node18",
|
|
5670
5741
|
build: "run-s clean build:copy build:templates build:ts lint:package",
|
|
5671
|
-
start: "node ./dist/index.cjs"
|
|
5672
|
-
preinstall: "npx only-allow pnpm"
|
|
5742
|
+
start: "node ./dist/index.cjs"
|
|
5673
5743
|
}
|
|
5674
5744
|
};
|
|
5675
5745
|
|
|
@@ -5689,7 +5759,7 @@ async function prompt(options) {
|
|
|
5689
5759
|
);
|
|
5690
5760
|
return result.name;
|
|
5691
5761
|
} catch (cancelled) {
|
|
5692
|
-
console.log(cancelled.message);
|
|
5762
|
+
console.log((0, import_picocolors.red)(`${cancelled.message}`));
|
|
5693
5763
|
process.exit(1);
|
|
5694
5764
|
}
|
|
5695
5765
|
}
|
|
@@ -5716,16 +5786,17 @@ async function textPromptIf(condition, message, initial) {
|
|
|
5716
5786
|
async function togglePromptIf(condition, message, initial = false, active = "Yes", inactive = "No") {
|
|
5717
5787
|
return condition ? togglePrompt(message, initial, active, inactive) : initial;
|
|
5718
5788
|
}
|
|
5719
|
-
var helpMessage = `
|
|
5789
|
+
var helpMessage = `
|
|
5790
|
+
${(0, import_picocolors.bold)("Usage:")} ${(0, import_picocolors.bold)((0, import_picocolors.green)("create-vue-lib"))} ${(0, import_picocolors.green)("[OPTIONS...]")}
|
|
5720
5791
|
|
|
5721
5792
|
Create a new Vite project to build a Vue-based library.
|
|
5722
5793
|
|
|
5723
|
-
Options:
|
|
5724
|
-
--extended, -x
|
|
5794
|
+
${(0, import_picocolors.bold)("Options:")}
|
|
5795
|
+
${(0, import_picocolors.cyan)("--extended")}, ${(0, import_picocolors.cyan)("-x")}
|
|
5725
5796
|
Prompt for extra configuration options.
|
|
5726
|
-
--help, -h
|
|
5797
|
+
${(0, import_picocolors.cyan)("--help")}, ${(0, import_picocolors.cyan)("-h")}
|
|
5727
5798
|
Display this help message.
|
|
5728
|
-
--version, -v
|
|
5799
|
+
${(0, import_picocolors.cyan)("--version")}, ${(0, import_picocolors.cyan)("-v")}
|
|
5729
5800
|
Display the version number for create-vue-lib.
|
|
5730
5801
|
|
|
5731
5802
|
Full documentation at https://skirtles-code.github.io/create-vue-lib/
|
|
@@ -5753,8 +5824,8 @@ function processArgs() {
|
|
|
5753
5824
|
argValues = args.values;
|
|
5754
5825
|
} catch (err) {
|
|
5755
5826
|
if (err.code === "ERR_PARSE_ARGS_UNKNOWN_OPTION") {
|
|
5756
|
-
console.log("
|
|
5757
|
-
console.log(err.message);
|
|
5827
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5828
|
+
console.log((0, import_picocolors.red)(`${err.message}`));
|
|
5758
5829
|
console.log("See --help for valid options");
|
|
5759
5830
|
process.exit(1);
|
|
5760
5831
|
} else {
|
|
@@ -5783,9 +5854,9 @@ async function init() {
|
|
|
5783
5854
|
const cwd = process.cwd();
|
|
5784
5855
|
const { extended } = processArgs();
|
|
5785
5856
|
console.log();
|
|
5786
|
-
console.log(`Welcome to ${package_default.name} v${package_default.version}`);
|
|
5857
|
+
console.log(`Welcome to ${(0, import_picocolors.bold)((0, import_picocolors.green)(package_default.name))} v${(0, import_picocolors.bold)((0, import_picocolors.cyan)(package_default.version))}`);
|
|
5787
5858
|
console.log();
|
|
5788
|
-
console.log(
|
|
5859
|
+
console.log(`This tool will help you to scaffold a ${(0, import_picocolors.bold)((0, import_picocolors.magenta)("Vite"))} project for your ${(0, import_picocolors.bold)((0, import_picocolors.green)("Vue"))}-based library.`);
|
|
5789
5860
|
console.log();
|
|
5790
5861
|
console.log("It is recommended to use a scoped package name for your library.");
|
|
5791
5862
|
console.log("e.g. @username/package-name");
|
|
@@ -5793,37 +5864,41 @@ async function init() {
|
|
|
5793
5864
|
console.log();
|
|
5794
5865
|
const scopedPackageName = await textPrompt("Package name", "");
|
|
5795
5866
|
if (!isValidPackageName(scopedPackageName)) {
|
|
5796
|
-
console.log(
|
|
5867
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5868
|
+
console.log((0, import_picocolors.red)("Invalid package name: " + scopedPackageName));
|
|
5797
5869
|
process.exit(1);
|
|
5798
5870
|
}
|
|
5799
5871
|
const unscopedPackageName = scopedPackageName.replace(/.*\//, "");
|
|
5800
5872
|
const packageNameAsObjectKey = /^[a-zA-Z_$][\w$]*$/.test(scopedPackageName) ? scopedPackageName : `'${scopedPackageName}'`;
|
|
5801
5873
|
const targetDirName = await textPrompt("Target directory", unscopedPackageName);
|
|
5802
5874
|
if (targetDirName !== "." && !isValidDirName(targetDirName)) {
|
|
5803
|
-
console.log(
|
|
5875
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5876
|
+
console.log((0, import_picocolors.red)("Invalid directory name: " + targetDirName));
|
|
5804
5877
|
process.exit(1);
|
|
5805
5878
|
}
|
|
5806
5879
|
const targetDirPath = path.join(cwd, targetDirName);
|
|
5807
5880
|
if (targetDirName === ".") {
|
|
5808
5881
|
if (fs.existsSync(path.join(targetDirPath, "package.json"))) {
|
|
5809
|
-
console.log("Target directory already contains package.json
|
|
5882
|
+
console.log(`${(0, import_picocolors.bgYellowBright)((0, import_picocolors.black)("\u26A0 WARNING"))} Target directory already contains package.json`);
|
|
5810
5883
|
}
|
|
5811
5884
|
} else {
|
|
5812
5885
|
if (fs.existsSync(targetDirPath)) {
|
|
5813
|
-
console.log("Target directory already exists
|
|
5886
|
+
console.log(`${(0, import_picocolors.bgYellowBright)((0, import_picocolors.black)("\u26A0 WARNING"))} Target directory already exists`);
|
|
5814
5887
|
}
|
|
5815
5888
|
}
|
|
5816
5889
|
const includePackagesDir = await togglePromptIf(extended, `Use 'packages' directory?`, true);
|
|
5817
5890
|
const packagesDir = includePackagesDir ? "packages/" : "";
|
|
5818
5891
|
const mainPackageDirName = await textPromptIf(extended, "Main package directory", unscopedPackageName);
|
|
5819
5892
|
if (!isValidDirName(mainPackageDirName)) {
|
|
5820
|
-
console.log(
|
|
5893
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5894
|
+
console.log((0, import_picocolors.red)("Invalid directory name: " + mainPackageDirName));
|
|
5821
5895
|
process.exit(1);
|
|
5822
5896
|
}
|
|
5823
5897
|
const defaultGlobalVariableName = unscopedPackageName.replace(/\W+/g, " ").trim().split(" ").map((s) => s[0].toUpperCase() + s.slice(1)).join("");
|
|
5824
5898
|
const globalVariableName = await textPromptIf(extended, "Global variable name", defaultGlobalVariableName);
|
|
5825
5899
|
if (!/^[a-zA-Z$_][\w$]*$/.test(globalVariableName)) {
|
|
5826
|
-
console.log(
|
|
5900
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5901
|
+
console.log((0, import_picocolors.red)("Invalid variable name: " + globalVariableName));
|
|
5827
5902
|
process.exit(1);
|
|
5828
5903
|
}
|
|
5829
5904
|
console.log();
|
|
@@ -5833,7 +5908,8 @@ async function init() {
|
|
|
5833
5908
|
const rawGithubPath = await textPrompt("GitHub path (optional)");
|
|
5834
5909
|
const githubPath = rawGithubPath.replace(/^(https:\/\/github.com\/|\/)/, "");
|
|
5835
5910
|
if (rawGithubPath && !/^[\w-]+\/[\w-.]+$/.test(githubPath)) {
|
|
5836
|
-
console.log(
|
|
5911
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5912
|
+
console.log((0, import_picocolors.red)("Invalid GitHub path: " + rawGithubPath));
|
|
5837
5913
|
process.exit(1);
|
|
5838
5914
|
}
|
|
5839
5915
|
const includeEsLint = await togglePrompt("Include ESLint?", true);
|
|
@@ -5851,17 +5927,20 @@ async function init() {
|
|
|
5851
5927
|
}
|
|
5852
5928
|
}
|
|
5853
5929
|
if (includeDocs && mainPackageDirName === "docs") {
|
|
5854
|
-
console.log(
|
|
5930
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5931
|
+
console.log((0, import_picocolors.red)(`The directory name 'docs' is reserved for the documentation, please choose a different name.`));
|
|
5855
5932
|
suggestExtended();
|
|
5856
5933
|
process.exit(1);
|
|
5857
5934
|
}
|
|
5858
5935
|
if (includePlayground && mainPackageDirName === "playground") {
|
|
5859
|
-
console.log(
|
|
5936
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5937
|
+
console.log((0, import_picocolors.red)(`The directory name 'playground' is reserved for the playground, please choose a different name.`));
|
|
5860
5938
|
suggestExtended();
|
|
5861
5939
|
process.exit(1);
|
|
5862
5940
|
}
|
|
5863
5941
|
if (!includePackagesDir && mainPackageDirName === "scripts") {
|
|
5864
|
-
console.log(
|
|
5942
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5943
|
+
console.log((0, import_picocolors.red)(`The directory name 'scripts' is reserved for the scripts, please choose a different name.`));
|
|
5865
5944
|
suggestExtended();
|
|
5866
5945
|
process.exit(1);
|
|
5867
5946
|
}
|
|
@@ -5918,19 +5997,19 @@ async function init() {
|
|
|
5918
5997
|
copyTemplate("vitest", config);
|
|
5919
5998
|
}
|
|
5920
5999
|
console.log();
|
|
5921
|
-
console.log("Project created
|
|
6000
|
+
console.log(`${(0, import_picocolors.bgGreen)((0, import_picocolors.bold)((0, import_picocolors.black)("DONE")))} Project created`);
|
|
5922
6001
|
console.log();
|
|
5923
|
-
console.log("
|
|
6002
|
+
console.log(`${(0, import_picocolors.bgYellowBright)((0, import_picocolors.black)("NOTE"))} pnpm must be used as the package manager`);
|
|
5924
6003
|
console.log();
|
|
5925
|
-
console.log("Next steps:");
|
|
6004
|
+
console.log((0, import_picocolors.bold)("Next steps:"));
|
|
5926
6005
|
console.log();
|
|
5927
6006
|
if (targetDirName !== ".") {
|
|
5928
|
-
console.log(" cd " + targetDirName);
|
|
6007
|
+
console.log((0, import_picocolors.bold)((0, import_picocolors.green)(" cd " + targetDirName)));
|
|
5929
6008
|
}
|
|
5930
6009
|
if (!fs.existsSync(path.join(targetDirPath, ".git"))) {
|
|
5931
|
-
console.log(" git init -b main");
|
|
6010
|
+
console.log((0, import_picocolors.bold)((0, import_picocolors.green)(" git init -b main")));
|
|
5932
6011
|
}
|
|
5933
|
-
console.log(" pnpm install");
|
|
6012
|
+
console.log((0, import_picocolors.bold)((0, import_picocolors.green)(" pnpm install")));
|
|
5934
6013
|
console.log();
|
|
5935
6014
|
console.log("See https://skirtles-code.github.io/create-vue-lib/next-steps for more suggestions.");
|
|
5936
6015
|
}
|
|
@@ -5,6 +5,29 @@
|
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=v18.3.0"
|
|
7
7
|
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
<%_ if (config.includeEsLint) { _%>
|
|
10
|
+
"@eslint/compat": "^1.2.7",
|
|
11
|
+
<%_ if (config.includeEsLintStylistic) { _%>
|
|
12
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
13
|
+
<%_ } _%>
|
|
14
|
+
"@tsconfig/node22": "^22.0.0",
|
|
15
|
+
"@types/node": "^22.13.9",
|
|
16
|
+
<%_ if (config.includeVitest) { _%>
|
|
17
|
+
"@vitest/eslint-plugin": "^1.1.36",
|
|
18
|
+
<%_ } _%>
|
|
19
|
+
"@vue/eslint-config-typescript": "^14.5.0",
|
|
20
|
+
"eslint": "^9.21.0",
|
|
21
|
+
"eslint-plugin-vue": "~10.0.0",
|
|
22
|
+
"jiti": "^2.4.2",
|
|
23
|
+
"lint-staged": "^15.4.3",
|
|
24
|
+
"npm-run-all2": "^7.0.2",
|
|
25
|
+
<%_ } _%>
|
|
26
|
+
"simple-git-hooks": "^2.11.1",
|
|
27
|
+
<%_ if (config.includeEsLint) { _%>
|
|
28
|
+
"typescript": "~5.8.0"
|
|
29
|
+
<%_ } _%>
|
|
30
|
+
},
|
|
8
31
|
"scripts": {
|
|
9
32
|
"clean": "pnpm run -r clean",
|
|
10
33
|
<%_ if (config.includePlayground) { _%>
|
|
@@ -38,33 +61,10 @@
|
|
|
38
61
|
},
|
|
39
62
|
"lint-staged": {
|
|
40
63
|
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --fix"
|
|
41
|
-
}
|
|
64
|
+
}
|
|
42
65
|
<%_ } else { _%>
|
|
43
66
|
"simple-git-hooks": {
|
|
44
67
|
"pre-commit": "pnpm run type-check"
|
|
45
|
-
},
|
|
46
|
-
<%_ } _%>
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
<%_ if (config.includeEsLint) { _%>
|
|
49
|
-
"@eslint/compat": "^1.2.7",
|
|
50
|
-
<%_ if (config.includeEsLintStylistic) { _%>
|
|
51
|
-
"@stylistic/eslint-plugin": "^4.2.0",
|
|
52
|
-
<%_ } _%>
|
|
53
|
-
"@tsconfig/node22": "^22.0.0",
|
|
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",
|
|
61
|
-
"jiti": "^2.4.2",
|
|
62
|
-
"lint-staged": "^15.4.3",
|
|
63
|
-
"npm-run-all2": "^7.0.2",
|
|
64
|
-
<%_ } _%>
|
|
65
|
-
"simple-git-hooks": "^2.11.1",
|
|
66
|
-
<%_ if (config.includeEsLint) { _%>
|
|
67
|
-
"typescript": "~5.8.0"
|
|
68
|
-
<%_ } _%>
|
|
69
68
|
}
|
|
69
|
+
<%_ } _%>
|
|
70
70
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { resolve } from 'node:path'
|
|
2
|
-
<%_ if (config.includeAtAliases) { _%>
|
|
3
1
|
import { fileURLToPath, URL } from 'node:url'
|
|
4
|
-
<%_ } _%>
|
|
5
2
|
|
|
6
3
|
import { defineConfig, type UserConfig } from 'vite'
|
|
7
4
|
import replace from '@rollup/plugin-replace'
|
|
@@ -43,6 +40,7 @@ export default defineConfig(({ mode }): UserConfig => {
|
|
|
43
40
|
}),
|
|
44
41
|
dtsPlugin
|
|
45
42
|
],
|
|
43
|
+
|
|
46
44
|
<%_ if (config.includeAtAliases) { _%>
|
|
47
45
|
resolve: {
|
|
48
46
|
alias: {
|
|
@@ -50,17 +48,20 @@ export default defineConfig(({ mode }): UserConfig => {
|
|
|
50
48
|
}
|
|
51
49
|
},
|
|
52
50
|
<%_ } _%>
|
|
51
|
+
|
|
53
52
|
<%_ if (config.includeTestVariable) { _%>
|
|
54
53
|
define: {
|
|
55
54
|
__TEST__: mode === 'test'
|
|
56
55
|
},
|
|
57
56
|
<%_ } _%>
|
|
57
|
+
|
|
58
58
|
build: {
|
|
59
59
|
target: 'es2019',
|
|
60
60
|
emptyOutDir: false,
|
|
61
61
|
minify: mode === 'production',
|
|
62
|
+
|
|
62
63
|
lib: {
|
|
63
|
-
entry:
|
|
64
|
+
entry: fileURLToPath(new URL('./src/index.ts', import.meta.url)),
|
|
64
65
|
name: '<%- config.globalVariableName %>',
|
|
65
66
|
formats: mode === 'neutral' ? ['cjs', 'es'] : ['es', 'iife'],
|
|
66
67
|
cssFileName: mode === 'production' ? '<%- config.unscopedPackageName %>.prod' : '<%- config.unscopedPackageName %>',
|
|
@@ -98,6 +99,7 @@ export default defineConfig(({ mode }): UserConfig => {
|
|
|
98
99
|
return `${name}.${extension}`
|
|
99
100
|
}
|
|
100
101
|
},
|
|
102
|
+
|
|
101
103
|
rollupOptions: {
|
|
102
104
|
external: ['vue'],
|
|
103
105
|
output: {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
3
|
"type": "module",
|
|
4
|
-
"scripts": {
|
|
5
|
-
"clean": "rimraf dist",
|
|
6
|
-
"dev": "vite --port 5051",
|
|
7
|
-
"type-check": "vue-tsc --build",
|
|
8
|
-
"build:only": "vite build",
|
|
9
|
-
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
10
|
-
"preview": "vite preview --port 4051"
|
|
11
|
-
},
|
|
12
4
|
"dependencies": {
|
|
13
5
|
"vue": "^3.5.13"
|
|
14
6
|
},
|
|
@@ -23,5 +15,13 @@
|
|
|
23
15
|
"vite": "^6.2.1",
|
|
24
16
|
"vite-plugin-vue-devtools": "^7.7.2",
|
|
25
17
|
"vue-tsc": "^2.2.8"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"dev": "vite --port 5051",
|
|
22
|
+
"type-check": "vue-tsc --build",
|
|
23
|
+
"build:only": "vite build",
|
|
24
|
+
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
25
|
+
"preview": "vite preview --port 4051"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -14,6 +14,7 @@ export default defineConfig(({ mode }): UserConfig => ({
|
|
|
14
14
|
vue(),
|
|
15
15
|
vueDevTools()
|
|
16
16
|
],
|
|
17
|
+
|
|
17
18
|
resolve: {
|
|
18
19
|
<%_ if (config.includeAtAliases) { _%>
|
|
19
20
|
alias: [
|
|
@@ -37,10 +38,11 @@ export default defineConfig(({ mode }): UserConfig => ({
|
|
|
37
38
|
}
|
|
38
39
|
<%_ } _%>
|
|
39
40
|
},
|
|
41
|
+
|
|
40
42
|
define: {
|
|
41
43
|
__DEV__: mode !== 'production',
|
|
42
44
|
<%_ if (config.includeTestVariable) { _%>
|
|
43
45
|
__TEST__: false
|
|
44
|
-
<%_ } %>
|
|
46
|
+
<%_ } _%>
|
|
45
47
|
}
|
|
46
48
|
}))
|
|
@@ -59,9 +59,10 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
|
|
|
59
59
|
},
|
|
60
60
|
|
|
61
61
|
define: {
|
|
62
|
-
__DEV__: mode !== 'production'
|
|
62
|
+
__DEV__: mode !== 'production',
|
|
63
|
+
<%_ if (config.includeTestVariable) { _%>
|
|
63
64
|
__TEST__: false
|
|
64
|
-
<%_ } %>
|
|
65
|
+
<%_ } _%>
|
|
65
66
|
}
|
|
66
67
|
},
|
|
67
68
|
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
3
|
"type": "module",
|
|
4
|
-
"scripts": {
|
|
5
|
-
"clean": "rimraf dist .vitepress/cache",
|
|
6
|
-
"dev": "vitepress dev .",
|
|
7
|
-
"type-check:code": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
|
8
|
-
"type-check:config": "vue-tsc --noEmit -p tsconfig.node.json --composite false",
|
|
9
|
-
"type-check": "run-p -c type-check:*",
|
|
10
|
-
"build:only": "vitepress build .",
|
|
11
|
-
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
12
|
-
"preview": "vitepress preview ."
|
|
13
|
-
},
|
|
14
4
|
"dependencies": {
|
|
15
5
|
"vue": "^3.5.13"
|
|
16
6
|
},
|
|
@@ -23,5 +13,15 @@
|
|
|
23
13
|
"typescript": "~5.8.0",
|
|
24
14
|
"vitepress": "^1.6.3",
|
|
25
15
|
"vue-tsc": "^2.2.8"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"clean": "rimraf dist .vitepress/cache",
|
|
19
|
+
"dev": "vitepress dev .",
|
|
20
|
+
"type-check:code": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
|
21
|
+
"type-check:config": "vue-tsc --noEmit -p tsconfig.node.json --composite false",
|
|
22
|
+
"type-check": "run-p -c type-check:*",
|
|
23
|
+
"build:only": "vitepress build .",
|
|
24
|
+
"build": "run-p -c type-check \"build:only {@}\" --",
|
|
25
|
+
"preview": "vitepress preview ."
|
|
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.7",
|
|
4
4
|
"author": "skirtle",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Create a library using Vue and Vite",
|
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"funding": "https://github.com/sponsors/skirtles-code",
|
|
21
21
|
"type": "module",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=v18.3.0"
|
|
24
|
-
},
|
|
25
22
|
"bin": {
|
|
26
23
|
"create-vue-lib": "dist/index.cjs"
|
|
27
24
|
},
|
|
@@ -31,16 +28,17 @@
|
|
|
31
28
|
"devDependencies": {
|
|
32
29
|
"@tsconfig/node22": "^22.0.0",
|
|
33
30
|
"@types/ejs": "^3.1.5",
|
|
34
|
-
"@types/node": "^22.13.
|
|
31
|
+
"@types/node": "^22.13.9",
|
|
35
32
|
"@types/prompts": "^2.4.9",
|
|
36
33
|
"copyfiles": "^2.4.1",
|
|
37
34
|
"ejs": "^3.1.10",
|
|
38
35
|
"npm-run-all2": "^7.0.2",
|
|
36
|
+
"picocolors": "^1.1.1",
|
|
39
37
|
"prompts": "^2.4.2",
|
|
40
38
|
"publint": "^0.3.8",
|
|
41
39
|
"rimraf": "^6.0.1",
|
|
42
|
-
"tsup": "^8.
|
|
43
|
-
"typescript": "
|
|
40
|
+
"tsup": "^8.4.0",
|
|
41
|
+
"typescript": "~5.8.0"
|
|
44
42
|
},
|
|
45
43
|
"scripts": {
|
|
46
44
|
"clean": "rimraf dist LICENSE README.md",
|
|
@@ -50,7 +48,6 @@
|
|
|
50
48
|
"build:templates": "copyfiles -u 1 -a \"src/template/**\" dist",
|
|
51
49
|
"build:ts": "tsup src/index.ts --format cjs --target node18",
|
|
52
50
|
"build": "run-s clean build:copy build:templates build:ts lint:package",
|
|
53
|
-
"start": "node ./dist/index.cjs"
|
|
54
|
-
"preinstall": "npx only-allow pnpm"
|
|
51
|
+
"start": "node ./dist/index.cjs"
|
|
55
52
|
}
|
|
56
53
|
}
|