@skirtle/create-vue-lib 0.0.5 → 0.0.6
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 -32
- 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/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 -6
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.6",
|
|
5627
5701
|
author: "skirtle",
|
|
5628
5702
|
license: "MIT",
|
|
5629
5703
|
description: "Create a library using Vue and Vite",
|
|
@@ -5649,16 +5723,17 @@ var package_default = {
|
|
|
5649
5723
|
devDependencies: {
|
|
5650
5724
|
"@tsconfig/node22": "^22.0.0",
|
|
5651
5725
|
"@types/ejs": "^3.1.5",
|
|
5652
|
-
"@types/node": "^22.13.
|
|
5726
|
+
"@types/node": "^22.13.9",
|
|
5653
5727
|
"@types/prompts": "^2.4.9",
|
|
5654
5728
|
copyfiles: "^2.4.1",
|
|
5655
5729
|
ejs: "^3.1.10",
|
|
5656
5730
|
"npm-run-all2": "^7.0.2",
|
|
5731
|
+
picocolors: "^1.1.1",
|
|
5657
5732
|
prompts: "^2.4.2",
|
|
5658
5733
|
publint: "^0.3.8",
|
|
5659
5734
|
rimraf: "^6.0.1",
|
|
5660
|
-
tsup: "^8.
|
|
5661
|
-
typescript: "
|
|
5735
|
+
tsup: "^8.4.0",
|
|
5736
|
+
typescript: "~5.8.0"
|
|
5662
5737
|
},
|
|
5663
5738
|
scripts: {
|
|
5664
5739
|
clean: "rimraf dist LICENSE README.md",
|
|
@@ -5668,8 +5743,7 @@ var package_default = {
|
|
|
5668
5743
|
"build:templates": 'copyfiles -u 1 -a "src/template/**" dist',
|
|
5669
5744
|
"build:ts": "tsup src/index.ts --format cjs --target node18",
|
|
5670
5745
|
build: "run-s clean build:copy build:templates build:ts lint:package",
|
|
5671
|
-
start: "node ./dist/index.cjs"
|
|
5672
|
-
preinstall: "npx only-allow pnpm"
|
|
5746
|
+
start: "node ./dist/index.cjs"
|
|
5673
5747
|
}
|
|
5674
5748
|
};
|
|
5675
5749
|
|
|
@@ -5689,7 +5763,7 @@ async function prompt(options) {
|
|
|
5689
5763
|
);
|
|
5690
5764
|
return result.name;
|
|
5691
5765
|
} catch (cancelled) {
|
|
5692
|
-
console.log(cancelled.message);
|
|
5766
|
+
console.log((0, import_picocolors.red)(`${cancelled.message}`));
|
|
5693
5767
|
process.exit(1);
|
|
5694
5768
|
}
|
|
5695
5769
|
}
|
|
@@ -5716,16 +5790,17 @@ async function textPromptIf(condition, message, initial) {
|
|
|
5716
5790
|
async function togglePromptIf(condition, message, initial = false, active = "Yes", inactive = "No") {
|
|
5717
5791
|
return condition ? togglePrompt(message, initial, active, inactive) : initial;
|
|
5718
5792
|
}
|
|
5719
|
-
var helpMessage = `
|
|
5793
|
+
var helpMessage = `
|
|
5794
|
+
${(0, import_picocolors.bold)("Usage:")} ${(0, import_picocolors.bold)((0, import_picocolors.green)("create-vue-lib"))} ${(0, import_picocolors.green)("[OPTIONS...]")}
|
|
5720
5795
|
|
|
5721
5796
|
Create a new Vite project to build a Vue-based library.
|
|
5722
5797
|
|
|
5723
|
-
Options:
|
|
5724
|
-
--extended, -x
|
|
5798
|
+
${(0, import_picocolors.bold)("Options:")}
|
|
5799
|
+
${(0, import_picocolors.cyan)("--extended")}, ${(0, import_picocolors.cyan)("-x")}
|
|
5725
5800
|
Prompt for extra configuration options.
|
|
5726
|
-
--help, -h
|
|
5801
|
+
${(0, import_picocolors.cyan)("--help")}, ${(0, import_picocolors.cyan)("-h")}
|
|
5727
5802
|
Display this help message.
|
|
5728
|
-
--version, -v
|
|
5803
|
+
${(0, import_picocolors.cyan)("--version")}, ${(0, import_picocolors.cyan)("-v")}
|
|
5729
5804
|
Display the version number for create-vue-lib.
|
|
5730
5805
|
|
|
5731
5806
|
Full documentation at https://skirtles-code.github.io/create-vue-lib/
|
|
@@ -5753,8 +5828,8 @@ function processArgs() {
|
|
|
5753
5828
|
argValues = args.values;
|
|
5754
5829
|
} catch (err) {
|
|
5755
5830
|
if (err.code === "ERR_PARSE_ARGS_UNKNOWN_OPTION") {
|
|
5756
|
-
console.log("
|
|
5757
|
-
console.log(err.message);
|
|
5831
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5832
|
+
console.log((0, import_picocolors.red)(`${err.message}`));
|
|
5758
5833
|
console.log("See --help for valid options");
|
|
5759
5834
|
process.exit(1);
|
|
5760
5835
|
} else {
|
|
@@ -5783,9 +5858,9 @@ async function init() {
|
|
|
5783
5858
|
const cwd = process.cwd();
|
|
5784
5859
|
const { extended } = processArgs();
|
|
5785
5860
|
console.log();
|
|
5786
|
-
console.log(`Welcome to ${package_default.name} v${package_default.version}`);
|
|
5861
|
+
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
5862
|
console.log();
|
|
5788
|
-
console.log(
|
|
5863
|
+
console.log(`This tool will help you to scaffold a ${(0, import_picocolors.bgMagenta)((0, import_picocolors.bold)((0, import_picocolors.yellowBright)("Vite")))} project for your ${(0, import_picocolors.bgGreen)((0, import_picocolors.bold)((0, import_picocolors.blue)("Vue")))}-based library.`);
|
|
5789
5864
|
console.log();
|
|
5790
5865
|
console.log("It is recommended to use a scoped package name for your library.");
|
|
5791
5866
|
console.log("e.g. @username/package-name");
|
|
@@ -5793,37 +5868,41 @@ async function init() {
|
|
|
5793
5868
|
console.log();
|
|
5794
5869
|
const scopedPackageName = await textPrompt("Package name", "");
|
|
5795
5870
|
if (!isValidPackageName(scopedPackageName)) {
|
|
5796
|
-
console.log(
|
|
5871
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5872
|
+
console.log((0, import_picocolors.red)("Invalid package name: " + scopedPackageName));
|
|
5797
5873
|
process.exit(1);
|
|
5798
5874
|
}
|
|
5799
5875
|
const unscopedPackageName = scopedPackageName.replace(/.*\//, "");
|
|
5800
5876
|
const packageNameAsObjectKey = /^[a-zA-Z_$][\w$]*$/.test(scopedPackageName) ? scopedPackageName : `'${scopedPackageName}'`;
|
|
5801
5877
|
const targetDirName = await textPrompt("Target directory", unscopedPackageName);
|
|
5802
5878
|
if (targetDirName !== "." && !isValidDirName(targetDirName)) {
|
|
5803
|
-
console.log(
|
|
5879
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5880
|
+
console.log((0, import_picocolors.red)("Invalid directory name: " + targetDirName));
|
|
5804
5881
|
process.exit(1);
|
|
5805
5882
|
}
|
|
5806
5883
|
const targetDirPath = path.join(cwd, targetDirName);
|
|
5807
5884
|
if (targetDirName === ".") {
|
|
5808
5885
|
if (fs.existsSync(path.join(targetDirPath, "package.json"))) {
|
|
5809
|
-
console.log("Target directory already contains package.json
|
|
5886
|
+
console.log(`${(0, import_picocolors.bgYellowBright)((0, import_picocolors.black)("\u26A0 WARNING"))} Target directory already contains package.json`);
|
|
5810
5887
|
}
|
|
5811
5888
|
} else {
|
|
5812
5889
|
if (fs.existsSync(targetDirPath)) {
|
|
5813
|
-
console.log("Target directory already exists
|
|
5890
|
+
console.log(`${(0, import_picocolors.bgYellowBright)((0, import_picocolors.black)("\u26A0 WARNING"))} Target directory already exists`);
|
|
5814
5891
|
}
|
|
5815
5892
|
}
|
|
5816
5893
|
const includePackagesDir = await togglePromptIf(extended, `Use 'packages' directory?`, true);
|
|
5817
5894
|
const packagesDir = includePackagesDir ? "packages/" : "";
|
|
5818
5895
|
const mainPackageDirName = await textPromptIf(extended, "Main package directory", unscopedPackageName);
|
|
5819
5896
|
if (!isValidDirName(mainPackageDirName)) {
|
|
5820
|
-
console.log(
|
|
5897
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5898
|
+
console.log((0, import_picocolors.red)("Invalid directory name: " + mainPackageDirName));
|
|
5821
5899
|
process.exit(1);
|
|
5822
5900
|
}
|
|
5823
5901
|
const defaultGlobalVariableName = unscopedPackageName.replace(/\W+/g, " ").trim().split(" ").map((s) => s[0].toUpperCase() + s.slice(1)).join("");
|
|
5824
5902
|
const globalVariableName = await textPromptIf(extended, "Global variable name", defaultGlobalVariableName);
|
|
5825
5903
|
if (!/^[a-zA-Z$_][\w$]*$/.test(globalVariableName)) {
|
|
5826
|
-
console.log(
|
|
5904
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5905
|
+
console.log((0, import_picocolors.red)("Invalid variable name: " + globalVariableName));
|
|
5827
5906
|
process.exit(1);
|
|
5828
5907
|
}
|
|
5829
5908
|
console.log();
|
|
@@ -5833,7 +5912,8 @@ async function init() {
|
|
|
5833
5912
|
const rawGithubPath = await textPrompt("GitHub path (optional)");
|
|
5834
5913
|
const githubPath = rawGithubPath.replace(/^(https:\/\/github.com\/|\/)/, "");
|
|
5835
5914
|
if (rawGithubPath && !/^[\w-]+\/[\w-.]+$/.test(githubPath)) {
|
|
5836
|
-
console.log(
|
|
5915
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5916
|
+
console.log((0, import_picocolors.red)("Invalid GitHub path: " + rawGithubPath));
|
|
5837
5917
|
process.exit(1);
|
|
5838
5918
|
}
|
|
5839
5919
|
const includeEsLint = await togglePrompt("Include ESLint?", true);
|
|
@@ -5851,17 +5931,20 @@ async function init() {
|
|
|
5851
5931
|
}
|
|
5852
5932
|
}
|
|
5853
5933
|
if (includeDocs && mainPackageDirName === "docs") {
|
|
5854
|
-
console.log(
|
|
5934
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5935
|
+
console.log((0, import_picocolors.red)(`The directory name 'docs' is reserved for the documentation, please choose a different name.`));
|
|
5855
5936
|
suggestExtended();
|
|
5856
5937
|
process.exit(1);
|
|
5857
5938
|
}
|
|
5858
5939
|
if (includePlayground && mainPackageDirName === "playground") {
|
|
5859
|
-
console.log(
|
|
5940
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5941
|
+
console.log((0, import_picocolors.red)(`The directory name 'playground' is reserved for the playground, please choose a different name.`));
|
|
5860
5942
|
suggestExtended();
|
|
5861
5943
|
process.exit(1);
|
|
5862
5944
|
}
|
|
5863
5945
|
if (!includePackagesDir && mainPackageDirName === "scripts") {
|
|
5864
|
-
console.log(
|
|
5946
|
+
console.log((0, import_picocolors.bgRed)((0, import_picocolors.black)("ERROR")));
|
|
5947
|
+
console.log((0, import_picocolors.red)(`The directory name 'scripts' is reserved for the scripts, please choose a different name.`));
|
|
5865
5948
|
suggestExtended();
|
|
5866
5949
|
process.exit(1);
|
|
5867
5950
|
}
|
|
@@ -5918,19 +6001,19 @@ async function init() {
|
|
|
5918
6001
|
copyTemplate("vitest", config);
|
|
5919
6002
|
}
|
|
5920
6003
|
console.log();
|
|
5921
|
-
console.log("Project created
|
|
6004
|
+
console.log(`${(0, import_picocolors.bgGreen)((0, import_picocolors.bold)((0, import_picocolors.black)("DONE")))} Project created`);
|
|
5922
6005
|
console.log();
|
|
5923
|
-
console.log("
|
|
6006
|
+
console.log(`${(0, import_picocolors.bgYellowBright)((0, import_picocolors.black)("NOTE"))} pnpm must be used as the package manager`);
|
|
5924
6007
|
console.log();
|
|
5925
|
-
console.log("Next steps:");
|
|
6008
|
+
console.log((0, import_picocolors.bold)("Next steps:"));
|
|
5926
6009
|
console.log();
|
|
5927
6010
|
if (targetDirName !== ".") {
|
|
5928
|
-
console.log(" cd " + targetDirName);
|
|
6011
|
+
console.log((0, import_picocolors.bold)((0, import_picocolors.green)(" cd " + targetDirName)));
|
|
5929
6012
|
}
|
|
5930
6013
|
if (!fs.existsSync(path.join(targetDirPath, ".git"))) {
|
|
5931
|
-
console.log(" git init -b main");
|
|
6014
|
+
console.log((0, import_picocolors.bold)((0, import_picocolors.green)(" git init -b main")));
|
|
5932
6015
|
}
|
|
5933
|
-
console.log(" pnpm install");
|
|
6016
|
+
console.log((0, import_picocolors.bold)((0, import_picocolors.green)(" pnpm install")));
|
|
5934
6017
|
console.log();
|
|
5935
6018
|
console.log("See https://skirtles-code.github.io/create-vue-lib/next-steps for more suggestions.");
|
|
5936
6019
|
}
|
|
@@ -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.6",
|
|
4
4
|
"author": "skirtle",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Create a library using Vue and Vite",
|
|
@@ -31,16 +31,17 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tsconfig/node22": "^22.0.0",
|
|
33
33
|
"@types/ejs": "^3.1.5",
|
|
34
|
-
"@types/node": "^22.13.
|
|
34
|
+
"@types/node": "^22.13.9",
|
|
35
35
|
"@types/prompts": "^2.4.9",
|
|
36
36
|
"copyfiles": "^2.4.1",
|
|
37
37
|
"ejs": "^3.1.10",
|
|
38
38
|
"npm-run-all2": "^7.0.2",
|
|
39
|
+
"picocolors": "^1.1.1",
|
|
39
40
|
"prompts": "^2.4.2",
|
|
40
41
|
"publint": "^0.3.8",
|
|
41
42
|
"rimraf": "^6.0.1",
|
|
42
|
-
"tsup": "^8.
|
|
43
|
-
"typescript": "
|
|
43
|
+
"tsup": "^8.4.0",
|
|
44
|
+
"typescript": "~5.8.0"
|
|
44
45
|
},
|
|
45
46
|
"scripts": {
|
|
46
47
|
"clean": "rimraf dist LICENSE README.md",
|
|
@@ -50,7 +51,6 @@
|
|
|
50
51
|
"build:templates": "copyfiles -u 1 -a \"src/template/**\" dist",
|
|
51
52
|
"build:ts": "tsup src/index.ts --format cjs --target node18",
|
|
52
53
|
"build": "run-s clean build:copy build:templates build:ts lint:package",
|
|
53
|
-
"start": "node ./dist/index.cjs"
|
|
54
|
-
"preinstall": "npx only-allow pnpm"
|
|
54
|
+
"start": "node ./dist/index.cjs"
|
|
55
55
|
}
|
|
56
56
|
}
|