vite-plus 0.1.22 → 0.1.23
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/binding/index.cjs +119 -52
- package/binding/index.d.cts +3222 -2
- package/dist/agent-aSGY0osq.js +2461 -0
- package/dist/bin.js +6 -5
- package/dist/cli-truncate-CWsmbK3p.js +867 -0
- package/dist/{compat-OlmU9EQz.js → compat-DXZgnEyq.js} +1 -1
- package/dist/config/bin.js +18 -5
- package/dist/{constants-kDaYqyWd.js → constants-DCBWlNrn.js} +7 -2
- package/dist/create/bin.js +135 -64
- package/dist/{define-config-IMCGDS2K.d.ts → define-config-COdn-tsn.d.ts} +7 -5
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/dist-Bapm49IR.js +3 -0
- package/dist/{dist-owlRxmBM.js → dist-BgQuvbtq.js} +136 -110
- package/dist/fmt.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/is-fullwidth-code-point-BUNlIICg.js +8 -0
- package/dist/lint.d.ts +1 -1
- package/dist/{log-update-NRrY6krx.js → log-update-lyIiuflf.js} +111 -24
- package/dist/migration/bin.js +71 -30
- package/dist/{oxlint-plugin-config-BkQeR4FR.js → oxlint-plugin-config-B89iKTKN.js} +1 -1
- package/dist/oxlint-plugin.d.ts +2 -4
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +1 -1
- package/dist/pack.d.ts +1 -1
- package/dist/{package-BoLLED6j.js → package-PmBUZ-ve.js} +2 -2
- package/dist/staged/bin.js +10 -10
- package/dist/strip-ansi-C3wrWz9t.js +853 -0
- package/dist/{agent-BWLe0i9g.js → tsconfig-DlUVXT3J.js} +648 -2089
- package/dist/version.js +5 -5
- package/dist/versions.js +6 -6
- package/dist/{workspace-Bi_9spVt.js → workspace-DElv730L.js} +13 -12
- package/dist/wrap-ansi-CeQuiQ31.js +2 -0
- package/dist/{wrap-ansi-DtUeUCjE.js → wrap-ansi-k7Dn4VtV.js} +1 -1
- package/docs/config/run.md +39 -4
- package/docs/guide/cache.md +10 -1
- package/docs/guide/env.md +3 -0
- package/docs/guide/ide-integration.md +2 -2
- package/docs/guide/install.md +2 -0
- package/docs/guide/run.md +2 -0
- package/docs/guide/troubleshooting.md +5 -2
- package/package.json +18 -18
- package/templates/monorepo/_gitignore +1 -0
- package/dist/cli-truncate-B62YnW2m.js +0 -138
- package/dist/dist-DZfItHAr.js +0 -3
- package/dist/slice-ansi-e4todZeH.js +0 -113
- package/dist/strip-ansi-D-eYYcD2.js +0 -198
- package/dist/tsconfig-BVyzXJ_o.js +0 -517
- package/dist/wrap-ansi-3S3qJ7j8.js +0 -2
- /package/dist/{chunk-q7NCDQ7-.js → chunk-DnnnRqeS.js} +0 -0
- /package/dist/{define-config-GqLoRwH9.cjs → define-config-BR1Y88zz.cjs} +0 -0
- /package/dist/{define-config-CzWdQTt2.js → define-config-BRC7qPNE.js} +0 -0
- /package/dist/{help-DK5wuu34.js → help-YP84FSEz.js} +0 -0
- /package/dist/{lib-DpwyUJWo.js → lib-L3DWSRQp.js} +0 -0
- /package/dist/{main-DhsO6ndq.js → main-DpJl3LoU.js} +0 -0
- /package/dist/{pack-K7H72Cum.d.ts → pack-Ciiho0Tq.d.ts} +0 -0
- /package/dist/{report-CYPv1VK1.js → report-DgSBQUdz.js} +0 -0
- /package/dist/{resolve-vite-config-C5AjksTj.js → resolve-vite-config-TTvhycU1.js} +0 -0
- /package/dist/{terminal-D_Kg-AA6.js → terminal-uTv0ZaMr.js} +0 -0
package/dist/config/bin.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as lib_default } from "../lib-
|
|
4
|
-
import {
|
|
1
|
+
import { c as defaultInteractive, d as promptGitHooks } from "../tsconfig-DlUVXT3J.js";
|
|
2
|
+
import { a as printHeader, r as log } from "../terminal-uTv0ZaMr.js";
|
|
3
|
+
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
4
|
+
import { o as updateExistingAgentInstructions, x as hasStagedConfigInViteConfig, y as ensurePreCommitHook } from "../agent-aSGY0osq.js";
|
|
5
|
+
import { t as renderCliDoc } from "../help-YP84FSEz.js";
|
|
5
6
|
import { join } from "node:path";
|
|
6
7
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
7
8
|
import { spawnSync } from "node:child_process";
|
|
@@ -42,8 +43,20 @@ i="\${XDG_CONFIG_HOME:-$HOME/.config}/vite-plus/hooks-init.sh"
|
|
|
42
43
|
{ [ "\${HUSKY-}" = "0" ] || [ "\${VITE_GIT_HOOKS-}" = "0" ]; } && exit 0
|
|
43
44
|
|
|
44
45
|
d=${nestedDirname(dir.split("/").filter((s) => s !== "" && s !== ".").length + 2)}
|
|
46
|
+
__vp_shell=/bin/sh
|
|
47
|
+
[ -x "$__vp_shell" ] || __vp_shell=$(command -v sh)
|
|
48
|
+
|
|
49
|
+
if [ -n "\${VP_HOME-}" ]; then
|
|
50
|
+
__vp_bin="$VP_HOME/bin"
|
|
51
|
+
elif [ -n "\${HOME-}" ]; then
|
|
52
|
+
__vp_bin="$HOME/.vite-plus/bin"
|
|
53
|
+
else
|
|
54
|
+
__vp_bin=""
|
|
55
|
+
fi
|
|
56
|
+
[ -n "$__vp_bin" ] && [ -d "$__vp_bin" ] && export PATH="$PATH:$__vp_bin"
|
|
57
|
+
|
|
45
58
|
export PATH="$d/node_modules/.bin:$PATH"
|
|
46
|
-
|
|
59
|
+
"$__vp_shell" -e "$s" "$@"
|
|
47
60
|
c=$?
|
|
48
61
|
|
|
49
62
|
[ $c != 0 ] && echo "VITE+ - $n script failed (code $c)"
|
|
@@ -18,11 +18,16 @@ const require = createRequire(import.meta.url);
|
|
|
18
18
|
function resolve(path) {
|
|
19
19
|
return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
|
|
20
20
|
}
|
|
21
|
-
const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: tsconfig
|
|
21
|
+
const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: a tsconfig file contains baseUrl which is not yet supported by the oxlint type checker.\n Run `vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>` to remove baseUrl from your tsconfig.";
|
|
22
|
+
const BASEURL_TSCONFIG_FIX_PACKAGE = "@andrewbranch/ts5to6";
|
|
23
|
+
const BASEURL_TSCONFIG_FIX_FLAG = "--fixBaseUrl";
|
|
24
|
+
function createBaseUrlTsconfigFixArgs(target = ".") {
|
|
25
|
+
return [BASEURL_TSCONFIG_FIX_FLAG, target];
|
|
26
|
+
}
|
|
22
27
|
const DEFAULT_ENVS = {
|
|
23
28
|
JS_RUNTIME_VERSION: process.versions.node,
|
|
24
29
|
JS_RUNTIME_NAME: process.release.name,
|
|
25
30
|
NODE_PACKAGE_MANAGER: "vite-plus"
|
|
26
31
|
};
|
|
27
32
|
//#endregion
|
|
28
|
-
export {
|
|
33
|
+
export { VITE_PLUS_OVERRIDE_PACKAGES as a, isForceOverrideMode as c, VITE_PLUS_NAME as i, resolve as l, BASEURL_TSCONFIG_WARNING as n, VITE_PLUS_VERSION as o, DEFAULT_ENVS as r, createBaseUrlTsconfigFixArgs as s, BASEURL_TSCONFIG_FIX_PACKAGE as t };
|
package/dist/create/bin.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "../chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { a as printHeader, i as muted, o as success, r as log, t as accent } from "../terminal-
|
|
4
|
-
import { i as resolveViteConfig, n as hasViteConfig, t as findWorkspaceRoot } from "../resolve-vite-config-
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as detectExistingEditors, c as writeEditorConfigs, n as updatePackageJsonWithDeps, r as updateWorkspaceConfig, s as selectEditors, t as detectWorkspace$1 } from "../workspace-
|
|
9
|
-
import { t as renderCliDoc } from "../help-
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "../chunk-DnnnRqeS.js";
|
|
2
|
+
import { A as q, C as log, D as spinner, E as select, M as runCommandSilently, N as require_cross_spawn, O as text, S as intro, _ as DependencyType, b as cancel, c as defaultInteractive, d as promptGitHooks, f as promptGitInit, h as selectPackageManager, j as runCommand$1, k as require_picocolors, l as downloadPackageManager$1, m as runViteInstall, p as runViteFmt, v as PackageManager, w as multiselect, x as confirm } from "../tsconfig-DlUVXT3J.js";
|
|
3
|
+
import { a as printHeader, i as muted, o as success, r as log$1, t as accent } from "../terminal-uTv0ZaMr.js";
|
|
4
|
+
import { i as resolveViteConfig, n as hasViteConfig, t as findWorkspaceRoot } from "../resolve-vite-config-TTvhycU1.js";
|
|
5
|
+
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
6
|
+
import { c as editJsonFile, o as fetchNpmResource, s as getNpmRegistry, t as checkNpmPackageExists, u as readJsonFile } from "../package-PmBUZ-ve.js";
|
|
7
|
+
import { A as promptEslintMigration, F as setPackageManager, H as displayRelative, M as rewriteMonorepo, N as rewriteMonorepoProject, P as rewriteStandaloneProject, S as injectCreateDefaultTemplate, U as templatesDir, a as selectAgentTargets, b as hasFrameworkShim, c as writeCopilotSetupWorkflow, h as detectFramework, j as promptPrettierMigration, l as addFrameworkShim, m as detectEslintProject, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, t as COPILOT_AGENT_ID, v as detectPrettierProject, w as installGitHooks } from "../agent-aSGY0osq.js";
|
|
8
|
+
import { a as detectExistingEditors, c as writeEditorConfigs, n as updatePackageJsonWithDeps, r as updateWorkspaceConfig, s as selectEditors, t as detectWorkspace$1 } from "../workspace-DElv730L.js";
|
|
9
|
+
import { t as renderCliDoc } from "../help-YP84FSEz.js";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { runCommand, vitePlusHeader } from "../../binding/index.js";
|
|
12
12
|
import fs from "node:fs";
|
|
@@ -3870,6 +3870,35 @@ function ensureGitignoreNodeModules(projectDir) {
|
|
|
3870
3870
|
const prefix = content === "" || content.endsWith("\n") ? "" : "\n";
|
|
3871
3871
|
fs.appendFileSync(gitignorePath, `${prefix}node_modules\n`);
|
|
3872
3872
|
}
|
|
3873
|
+
const VSCODE_SETTINGS_PATH = ".vscode/settings.json";
|
|
3874
|
+
const VSCODE_CONFIG_UNIGNORE_BLOCK = [
|
|
3875
|
+
"!.vscode/",
|
|
3876
|
+
`!${VSCODE_SETTINGS_PATH}`,
|
|
3877
|
+
`!.vscode/extensions.json`
|
|
3878
|
+
];
|
|
3879
|
+
/**
|
|
3880
|
+
* Make generated VS Code workspace config trackable when `vp create` writes VS Code config.
|
|
3881
|
+
*/
|
|
3882
|
+
function ensureGitignoreVsCodeEditorConfigs(projectDir) {
|
|
3883
|
+
if (!fs.existsSync(path.join(projectDir, VSCODE_SETTINGS_PATH))) return;
|
|
3884
|
+
const gitignorePath = path.join(projectDir, ".gitignore");
|
|
3885
|
+
let content;
|
|
3886
|
+
try {
|
|
3887
|
+
content = fs.readFileSync(gitignorePath, "utf-8");
|
|
3888
|
+
} catch {
|
|
3889
|
+
return;
|
|
3890
|
+
}
|
|
3891
|
+
appendGitignoreVsCodeEditorConfigsBlock(gitignorePath, content);
|
|
3892
|
+
}
|
|
3893
|
+
function appendGitignoreVsCodeEditorConfigsBlock(gitignorePath, content) {
|
|
3894
|
+
if (content.trimEnd().endsWith(VSCODE_CONFIG_UNIGNORE_BLOCK.join("\n"))) return;
|
|
3895
|
+
appendGitignoreLines(gitignorePath, content, VSCODE_CONFIG_UNIGNORE_BLOCK);
|
|
3896
|
+
}
|
|
3897
|
+
function appendGitignoreLines(gitignorePath, content, lines) {
|
|
3898
|
+
if (lines.length === 0) return;
|
|
3899
|
+
const prefix = content === "" || content.endsWith("\n") ? "" : "\n";
|
|
3900
|
+
fs.appendFileSync(gitignorePath, `${prefix}${lines.join("\n")}\n`);
|
|
3901
|
+
}
|
|
3873
3902
|
function formatDisplayTargetDir(targetDir) {
|
|
3874
3903
|
const normalized = targetDir.split(path.sep).join("/");
|
|
3875
3904
|
if (normalized === "" || normalized === ".") return "./";
|
|
@@ -3907,7 +3936,7 @@ async function promptPackageNameAndTargetDir(defaultPackageName, interactive) {
|
|
|
3907
3936
|
} else {
|
|
3908
3937
|
packageName = defaultPackageName;
|
|
3909
3938
|
targetDir = getProjectDirFromPackageName(packageName);
|
|
3910
|
-
log
|
|
3939
|
+
log.info(`Using default package name: ${accent(packageName)}`);
|
|
3911
3940
|
}
|
|
3912
3941
|
return {
|
|
3913
3942
|
packageName,
|
|
@@ -3927,7 +3956,7 @@ async function promptTargetDir(defaultTargetDir, interactive, options) {
|
|
|
3927
3956
|
targetDir = validateTargetDir(selected ?? defaultTargetDir, options?.cwd).directory;
|
|
3928
3957
|
} else {
|
|
3929
3958
|
targetDir = validateTargetDir(defaultTargetDir, options?.cwd).directory;
|
|
3930
|
-
log
|
|
3959
|
+
log.info(`Using default target directory: ${accent(targetDir)}`);
|
|
3931
3960
|
}
|
|
3932
3961
|
return targetDir;
|
|
3933
3962
|
}
|
|
@@ -3943,7 +3972,7 @@ function suggestAvailableTargetDir(defaultTargetDir, cwd) {
|
|
|
3943
3972
|
async function checkProjectDirExists(projectDirFullPath, interactive) {
|
|
3944
3973
|
if (isTargetDirAvailable(projectDirFullPath)) return;
|
|
3945
3974
|
if (!interactive) {
|
|
3946
|
-
log
|
|
3975
|
+
log.info("Use --directory to specify a different location or remove the directory first");
|
|
3947
3976
|
cancelAndExit(`Target directory "${projectDirFullPath}" is not empty`, 1);
|
|
3948
3977
|
}
|
|
3949
3978
|
const overwrite = await select({
|
|
@@ -4031,7 +4060,7 @@ function printNonInteractiveTable(manifest, orgSpec, isMonorepo) {
|
|
|
4031
4060
|
}
|
|
4032
4061
|
function rejectMonorepoEntryInsideMonorepo(entry, isMonorepo) {
|
|
4033
4062
|
if (entry.monorepo && isMonorepo) {
|
|
4034
|
-
log
|
|
4063
|
+
log.info("You are already in a monorepo workspace.\nUse a different template or run this command outside the monorepo");
|
|
4035
4064
|
cancelAndExit("Cannot create a monorepo inside an existing monorepo", 1);
|
|
4036
4065
|
}
|
|
4037
4066
|
}
|
|
@@ -4068,7 +4097,7 @@ async function resolveOrgManifestForCreate(args) {
|
|
|
4068
4097
|
}
|
|
4069
4098
|
if (!manifest) {
|
|
4070
4099
|
if (orgSpec.name !== void 0) cancelAndExit(`No \`createConfig.templates\` manifest in ${orgSpec.scope}/create — \`@org:name\` requires one.`, 1);
|
|
4071
|
-
log
|
|
4100
|
+
log.info(`No \`createConfig.templates\` manifest in ${orgSpec.scope}/create — running it as a normal package.`);
|
|
4072
4101
|
return { kind: "passthrough" };
|
|
4073
4102
|
}
|
|
4074
4103
|
if (orgSpec.name === void 0) {
|
|
@@ -4079,7 +4108,7 @@ async function resolveOrgManifestForCreate(args) {
|
|
|
4079
4108
|
const picked = await pickOrgTemplate(manifest, { isMonorepo: args.isMonorepo });
|
|
4080
4109
|
if (picked === ORG_PICKER_CANCEL) cancelAndExit();
|
|
4081
4110
|
if (picked === ORG_PICKER_BUILTIN_ESCAPE) {
|
|
4082
|
-
if (args.isMonorepo && manifest.templates.every((t) => t.monorepo)) log
|
|
4111
|
+
if (args.isMonorepo && manifest.templates.every((t) => t.monorepo)) log.info(`No templates from ${manifest.packageName} are applicable inside a monorepo — showing Vite+ built-in templates instead.`);
|
|
4083
4112
|
return { kind: "escape-hatch" };
|
|
4084
4113
|
}
|
|
4085
4114
|
rejectMonorepoEntryInsideMonorepo(picked.entry, args.isMonorepo);
|
|
@@ -4116,7 +4145,7 @@ async function getConfiguredDefaultTemplate(startDir) {
|
|
|
4116
4145
|
//#endregion
|
|
4117
4146
|
//#region src/create/templates/generator.ts
|
|
4118
4147
|
async function executeGeneratorScaffold(workspaceInfo, templateInfo, options) {
|
|
4119
|
-
if (!options?.silent) log
|
|
4148
|
+
if (!options?.silent) log.step("Creating generator scaffold...");
|
|
4120
4149
|
let description;
|
|
4121
4150
|
if (templateInfo.interactive) {
|
|
4122
4151
|
const defaultDescription = "Generate new components for our monorepo";
|
|
@@ -4135,7 +4164,7 @@ async function executeGeneratorScaffold(workspaceInfo, templateInfo, options) {
|
|
|
4135
4164
|
if (description) pkg.description = description;
|
|
4136
4165
|
return pkg;
|
|
4137
4166
|
});
|
|
4138
|
-
if (!options?.silent) log
|
|
4167
|
+
if (!options?.silent) log.success("Generator scaffold created");
|
|
4139
4168
|
return {
|
|
4140
4169
|
exitCode: 0,
|
|
4141
4170
|
projectDir: templateInfo.targetDir
|
|
@@ -4147,14 +4176,14 @@ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
|
4147
4176
|
const { gray, yellow } = import_picocolors.default;
|
|
4148
4177
|
async function executeRemoteTemplate(workspaceInfo, templateInfo, options) {
|
|
4149
4178
|
const silent = options?.silent ?? false;
|
|
4150
|
-
if (!silent) log
|
|
4179
|
+
if (!silent) log.step("Generating project…");
|
|
4151
4180
|
let isGitHubTemplate = templateInfo.command === "degit";
|
|
4152
4181
|
let result;
|
|
4153
4182
|
if (templateInfo.command === "node") {
|
|
4154
4183
|
const command = templateInfo.command;
|
|
4155
4184
|
const args = templateInfo.args;
|
|
4156
4185
|
const envs = templateInfo.envs;
|
|
4157
|
-
if (!silent) log
|
|
4186
|
+
if (!silent) log.info(`Running: ${gray(`${command} ${args.join(" ")}`)}`);
|
|
4158
4187
|
result = await runCommandAndDetectProjectDir({
|
|
4159
4188
|
command,
|
|
4160
4189
|
args,
|
|
@@ -4164,7 +4193,7 @@ async function executeRemoteTemplate(workspaceInfo, templateInfo, options) {
|
|
|
4164
4193
|
} else {
|
|
4165
4194
|
if (!isGitHubTemplate) {
|
|
4166
4195
|
if (!await checkNpmPackageExists(templateInfo.command)) {
|
|
4167
|
-
if (!silent) log
|
|
4196
|
+
if (!silent) log.error(`Template "${templateInfo.command}" not found on npm. Run ${yellow("vp create --list")} to see available templates.`);
|
|
4168
4197
|
return { exitCode: 1 };
|
|
4169
4198
|
}
|
|
4170
4199
|
}
|
|
@@ -4172,13 +4201,13 @@ async function executeRemoteTemplate(workspaceInfo, templateInfo, options) {
|
|
|
4172
4201
|
}
|
|
4173
4202
|
const exitCode = result.exitCode;
|
|
4174
4203
|
if (exitCode === 127) {
|
|
4175
|
-
log
|
|
4176
|
-
log
|
|
4204
|
+
log.info(yellow("\nTroubleshooting:"));
|
|
4205
|
+
log.info(` ${gray("•")} Command not found. Make sure Node.js is installed`);
|
|
4177
4206
|
} else if (isGitHubTemplate && exitCode !== 0) {
|
|
4178
|
-
log
|
|
4179
|
-
log
|
|
4180
|
-
log
|
|
4181
|
-
log
|
|
4207
|
+
log.info(yellow("\nTroubleshooting:"));
|
|
4208
|
+
log.info(` ${gray("•")} Make sure the GitHub repository exists`);
|
|
4209
|
+
log.info(` ${gray("•")} Check your internet connection`);
|
|
4210
|
+
log.info(` ${gray("•")} Repository might be private (requires authentication)`);
|
|
4182
4211
|
}
|
|
4183
4212
|
return result;
|
|
4184
4213
|
}
|
|
@@ -4188,7 +4217,7 @@ async function runRemoteTemplateCommand(workspaceInfo, cwd, templateInfo, detect
|
|
|
4188
4217
|
const execArgs = [...templateInfo.args];
|
|
4189
4218
|
const envs = templateInfo.envs;
|
|
4190
4219
|
const { command, args } = formatDlxCommand(remotePackageName, execArgs, workspaceInfo);
|
|
4191
|
-
if (!silent) log
|
|
4220
|
+
if (!silent) log.info(`Running: ${gray(`${command} ${args.join(" ")}`)}`);
|
|
4192
4221
|
if (detectCreatedProjectDir) return await runCommandAndDetectProjectDir({
|
|
4193
4222
|
command,
|
|
4194
4223
|
args,
|
|
@@ -4249,7 +4278,7 @@ async function executeBuiltinTemplate(workspaceInfo, templateInfo, options) {
|
|
|
4249
4278
|
};
|
|
4250
4279
|
}
|
|
4251
4280
|
if (templateInfo.command.startsWith("vite:")) {
|
|
4252
|
-
if (!options?.silent) log
|
|
4281
|
+
if (!options?.silent) log.error(`Unknown builtin template "${templateInfo.command}". Run ${import_picocolors.default.yellow("vp create --list")} to see available templates.`);
|
|
4253
4282
|
return { exitCode: 1 };
|
|
4254
4283
|
}
|
|
4255
4284
|
const result = await runRemoteTemplateCommand(workspaceInfo, workspaceInfo.rootDir, templateInfo, false, options?.silent ?? false);
|
|
@@ -4295,8 +4324,8 @@ async function executeMonorepoTemplate(workspaceInfo, templateInfo, options) {
|
|
|
4295
4324
|
workspaceInfo.monorepoScope = getScopeFromPackageName(templateInfo.packageName);
|
|
4296
4325
|
const fullPath = path.join(workspaceInfo.rootDir, templateInfo.targetDir);
|
|
4297
4326
|
if (!options?.silent) {
|
|
4298
|
-
log
|
|
4299
|
-
log
|
|
4327
|
+
log.info(`Target directory: ${formatDisplayTargetDir(templateInfo.targetDir)}`);
|
|
4328
|
+
log.step("Creating Vite+ monorepo...");
|
|
4300
4329
|
}
|
|
4301
4330
|
copyDir(path.join(templatesDir, "monorepo"), fullPath);
|
|
4302
4331
|
renameFiles(fullPath);
|
|
@@ -4329,8 +4358,8 @@ async function executeMonorepoTemplate(workspaceInfo, templateInfo, options) {
|
|
|
4329
4358
|
const yarnrcPath = path.join(fullPath, ".yarnrc.yml");
|
|
4330
4359
|
if (fs.existsSync(yarnrcPath)) fs.unlinkSync(yarnrcPath);
|
|
4331
4360
|
}
|
|
4332
|
-
if (!options?.silent) log
|
|
4333
|
-
if (!options?.silent) log
|
|
4361
|
+
if (!options?.silent) log.success("Monorepo template created");
|
|
4362
|
+
if (!options?.silent) log.step("Creating default application in apps/website...");
|
|
4334
4363
|
const appResult = await runRemoteTemplateCommand(workspaceInfo, fullPath, discoverTemplate("create-vite@latest", [
|
|
4335
4364
|
InitialMonorepoAppDir,
|
|
4336
4365
|
"--template",
|
|
@@ -4338,18 +4367,26 @@ async function executeMonorepoTemplate(workspaceInfo, templateInfo, options) {
|
|
|
4338
4367
|
"--no-interactive"
|
|
4339
4368
|
], workspaceInfo), false, options?.silent ?? false);
|
|
4340
4369
|
if (appResult.exitCode !== 0) {
|
|
4341
|
-
log
|
|
4370
|
+
log.error(`Failed to create default application: ${appResult.exitCode}`);
|
|
4342
4371
|
return appResult;
|
|
4343
4372
|
}
|
|
4344
4373
|
const appPackageName = workspaceInfo.monorepoScope ? `${workspaceInfo.monorepoScope}/website` : "website";
|
|
4345
4374
|
const appProjectPath = path.join(fullPath, InitialMonorepoAppDir);
|
|
4346
4375
|
setPackageName(appProjectPath, appPackageName);
|
|
4347
4376
|
rewriteMonorepoProject(appProjectPath, workspaceInfo.packageManager, void 0, options?.silent ?? false);
|
|
4348
|
-
|
|
4377
|
+
editJsonFile(path.join(appProjectPath, "package.json"), (pkg) => {
|
|
4378
|
+
let changed = false;
|
|
4379
|
+
for (const name of ["vite", "vitest"]) if (pkg.devDependencies?.[name]) {
|
|
4380
|
+
delete pkg.devDependencies[name];
|
|
4381
|
+
changed = true;
|
|
4382
|
+
}
|
|
4383
|
+
return changed ? pkg : void 0;
|
|
4384
|
+
});
|
|
4385
|
+
if (!options?.silent) log.step("Creating default library in packages/utils...");
|
|
4349
4386
|
const libraryDir = "packages/utils";
|
|
4350
4387
|
const libraryResult = await runRemoteTemplateCommand(workspaceInfo, fullPath, discoverTemplate(LibraryTemplateRepo, [libraryDir], workspaceInfo), false, options?.silent ?? false);
|
|
4351
4388
|
if (libraryResult.exitCode !== 0) {
|
|
4352
|
-
log
|
|
4389
|
+
log.error(`Failed to create default library, exit code: ${libraryResult.exitCode}`);
|
|
4353
4390
|
return libraryResult;
|
|
4354
4391
|
}
|
|
4355
4392
|
const libraryPackageName = workspaceInfo.monorepoScope ? `${workspaceInfo.monorepoScope}/utils` : "utils";
|
|
@@ -4552,6 +4589,11 @@ const listTemplatesMessage = renderCliDoc({
|
|
|
4552
4589
|
}
|
|
4553
4590
|
]
|
|
4554
4591
|
});
|
|
4592
|
+
function normalizeAgentOption(agent) {
|
|
4593
|
+
if (!Array.isArray(agent)) return agent;
|
|
4594
|
+
if (agent.includes(false)) return false;
|
|
4595
|
+
return agent.filter((value) => typeof value === "string");
|
|
4596
|
+
}
|
|
4555
4597
|
function parseArgs() {
|
|
4556
4598
|
const args = process.argv.slice(3);
|
|
4557
4599
|
const separatorIndex = args.indexOf("--");
|
|
@@ -4584,7 +4626,7 @@ function parseArgs() {
|
|
|
4584
4626
|
list: parsed.list || false,
|
|
4585
4627
|
help: parsed.help || false,
|
|
4586
4628
|
verbose: parsed.verbose || false,
|
|
4587
|
-
agent: parsed.agent,
|
|
4629
|
+
agent: normalizeAgentOption(parsed.agent),
|
|
4588
4630
|
editor: parsed.editor,
|
|
4589
4631
|
git: parsed.git,
|
|
4590
4632
|
hooks: parsed.hooks,
|
|
@@ -4636,19 +4678,32 @@ function getNextCommand(projectDir, command) {
|
|
|
4636
4678
|
if (!projectDir || projectDir === ".") return command;
|
|
4637
4679
|
return `cd ${projectDir} && ${command}`;
|
|
4638
4680
|
}
|
|
4681
|
+
function findGitRoot(startPath) {
|
|
4682
|
+
let dir = startPath;
|
|
4683
|
+
while (true) {
|
|
4684
|
+
if (fs.existsSync(path.join(dir, ".git"))) return dir;
|
|
4685
|
+
const parent = path.dirname(dir);
|
|
4686
|
+
if (parent === dir) return;
|
|
4687
|
+
dir = parent;
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
function getCopilotSetupRoot(projectRoot, isExistingMonorepo) {
|
|
4691
|
+
if (!isExistingMonorepo) return projectRoot;
|
|
4692
|
+
return findGitRoot(projectRoot) ?? projectRoot;
|
|
4693
|
+
}
|
|
4639
4694
|
function showCreateSummary(options) {
|
|
4640
4695
|
const { description, installSummary, nextCommand, packageManager, packageManagerVersion, projectDir } = options;
|
|
4641
|
-
log(`${styleText("magenta", "◇")} Scaffolded ${accent(projectDir)}${description ? ` with ${description}` : ""}`);
|
|
4642
|
-
log(`${styleText("gray", "•")} Node ${process.versions.node} ${packageManager} ${packageManagerVersion}`);
|
|
4643
|
-
if (installSummary?.status === "installed") log(`${styleText("green", "✓")} Dependencies installed in ${formatDuration(installSummary.durationMs)}`);
|
|
4644
|
-
log(`${styleText("blue", "→")} Next: ${accent(nextCommand)}`);
|
|
4696
|
+
log$1(`${styleText("magenta", "◇")} Scaffolded ${accent(projectDir)}${description ? ` with ${description}` : ""}`);
|
|
4697
|
+
log$1(`${styleText("gray", "•")} Node ${process.versions.node} ${packageManager} ${packageManagerVersion}`);
|
|
4698
|
+
if (installSummary?.status === "installed") log$1(`${styleText("green", "✓")} Dependencies installed in ${formatDuration(installSummary.durationMs)}`);
|
|
4699
|
+
log$1(`${styleText("blue", "→")} Next: ${accent(nextCommand)}`);
|
|
4645
4700
|
}
|
|
4646
4701
|
async function main() {
|
|
4647
4702
|
const { templateName, options, templateArgs } = parseArgs();
|
|
4648
4703
|
let compactOutput = !options.verbose;
|
|
4649
4704
|
if (options.help) {
|
|
4650
4705
|
printHeader();
|
|
4651
|
-
log(helpMessage);
|
|
4706
|
+
log$1(helpMessage);
|
|
4652
4707
|
return;
|
|
4653
4708
|
}
|
|
4654
4709
|
if (options.list) {
|
|
@@ -4661,7 +4716,7 @@ async function main() {
|
|
|
4661
4716
|
if (options.directory) {
|
|
4662
4717
|
const formatted = formatTargetDir(options.directory);
|
|
4663
4718
|
if (formatted.error) {
|
|
4664
|
-
log
|
|
4719
|
+
log.error(formatted.error);
|
|
4665
4720
|
cancelAndExit("The --directory option is invalid", 1);
|
|
4666
4721
|
}
|
|
4667
4722
|
targetDir = formatted.directory;
|
|
@@ -4678,6 +4733,7 @@ async function main() {
|
|
|
4678
4733
|
let selectedTemplateName = templateName;
|
|
4679
4734
|
let selectedTemplateArgs = [...templateArgs];
|
|
4680
4735
|
let selectedAgentTargetPaths;
|
|
4736
|
+
let shouldWriteCopilotSetupWorkflow = false;
|
|
4681
4737
|
let selectedEditors;
|
|
4682
4738
|
let selectedParentDir;
|
|
4683
4739
|
let remoteTargetDir;
|
|
@@ -4730,14 +4786,14 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4730
4786
|
if (!isDirectScaffoldTemplate) compactOutput = false;
|
|
4731
4787
|
if (targetDir && !isDirectScaffoldTemplate) cancelAndExit("The --directory option is only available for builtin and bundled @org templates", 1);
|
|
4732
4788
|
if (selectedTemplateName === BuiltinTemplate.monorepo && isMonorepo) {
|
|
4733
|
-
log
|
|
4789
|
+
log.info("You are already in a monorepo workspace.\nUse a different template or run this command outside the monorepo");
|
|
4734
4790
|
cancelAndExit("Cannot create a monorepo inside an existing monorepo", 1);
|
|
4735
4791
|
}
|
|
4736
4792
|
if (selectedTemplateName === BuiltinTemplate.generator && !isMonorepo) {
|
|
4737
|
-
log
|
|
4793
|
+
log.info("The vite:generator template requires a monorepo workspace.\nRun this command inside a Vite+ monorepo, or create one first with `vp create vite:monorepo`");
|
|
4738
4794
|
cancelAndExit("Cannot create a generator outside a monorepo", 1);
|
|
4739
4795
|
}
|
|
4740
|
-
if (isInSubdirectory && !compactOutput) log
|
|
4796
|
+
if (isInSubdirectory && !compactOutput) log.info(`Detected monorepo root at ${accent(workspaceInfoOptional.rootDir)}`);
|
|
4741
4797
|
if (isMonorepo && options.interactive && !targetDir) {
|
|
4742
4798
|
let parentDir;
|
|
4743
4799
|
if (workspaceInfoOptional.parentDirs.length > 0 || isInSubdirectory) {
|
|
@@ -4778,7 +4834,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4778
4834
|
selectedParentDir = parentDir;
|
|
4779
4835
|
}
|
|
4780
4836
|
if (isMonorepo && !options.interactive && !targetDir) {
|
|
4781
|
-
if (isInSubdirectory && !compactOutput) log
|
|
4837
|
+
if (isInSubdirectory && !compactOutput) log.info(`Use ${accent("--directory")} to specify a different target location.`);
|
|
4782
4838
|
selectedParentDir = inferParentDir(selectedTemplateName, workspaceInfoOptional) ?? workspaceInfoOptional.parentDirs[0];
|
|
4783
4839
|
}
|
|
4784
4840
|
if (isGitHubUrl(selectedTemplateName)) if (hasExplicitTargetDir(selectedTemplateArgs)) remoteTargetDir = selectedTemplateArgs[0];
|
|
@@ -4786,7 +4842,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4786
4842
|
const inferredTargetDir = inferGitHubRepoName(selectedTemplateName) ?? "template";
|
|
4787
4843
|
const remoteTargetBaseDir = selectedParentDir ? path.join(workspaceInfoOptional.rootDir, selectedParentDir) : workspaceInfoOptional.rootDir;
|
|
4788
4844
|
const defaultTargetDir = suggestAvailableTargetDir(inferredTargetDir, remoteTargetBaseDir);
|
|
4789
|
-
if (defaultTargetDir !== inferredTargetDir && options.interactive) log
|
|
4845
|
+
if (defaultTargetDir !== inferredTargetDir && options.interactive) log.info(` Target directory "${inferredTargetDir}" already exists. Suggested: ${accent(defaultTargetDir)}`);
|
|
4790
4846
|
remoteTargetDir = await promptTargetDir(defaultTargetDir, options.interactive, { cwd: remoteTargetBaseDir });
|
|
4791
4847
|
selectedTemplateArgs = [remoteTargetDir, ...selectedTemplateArgs];
|
|
4792
4848
|
}
|
|
@@ -4799,7 +4855,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4799
4855
|
if (enclosingPackage) cancelAndExit(`Cannot scaffold inside existing package "${enclosingPackage.name}" (${enclosingPackage.path}). Use --directory to specify a different location`, 1);
|
|
4800
4856
|
targetDir = cwdRelativeToRoot;
|
|
4801
4857
|
}
|
|
4802
|
-
log
|
|
4858
|
+
log.info(`Using package name: ${accent(packageName)}`);
|
|
4803
4859
|
} else if (selectedTemplateName === BuiltinTemplate.monorepo) {
|
|
4804
4860
|
const selected = await promptPackageNameAndTargetDir(getRandomProjectName({ fallbackName: "vite-plus-monorepo" }), options.interactive);
|
|
4805
4861
|
packageName = selected.packageName;
|
|
@@ -4814,7 +4870,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4814
4870
|
}
|
|
4815
4871
|
if (options.packageManager && !Object.values(PackageManager).includes(options.packageManager)) {
|
|
4816
4872
|
const valid = Object.values(PackageManager).join(", ");
|
|
4817
|
-
log
|
|
4873
|
+
log.error(`Invalid package manager: ${options.packageManager}. Must be one of: ${valid}`);
|
|
4818
4874
|
cancelAndExit("Invalid --package-manager value", 1);
|
|
4819
4875
|
}
|
|
4820
4876
|
const packageManager = workspaceInfoOptional.packageManager ?? options.packageManager ?? await selectPackageManager(options.interactive, compactOutput);
|
|
@@ -4826,11 +4882,16 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4826
4882
|
downloadPackageManager: downloadResult
|
|
4827
4883
|
};
|
|
4828
4884
|
const existingAgentTargetPaths = options.agent !== void 0 || !options.interactive ? void 0 : detectExistingAgentTargetPaths(workspaceInfoOptional.rootDir);
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4885
|
+
if (existingAgentTargetPaths !== void 0) selectedAgentTargetPaths = existingAgentTargetPaths;
|
|
4886
|
+
else {
|
|
4887
|
+
const agentSelection = await selectAgentTargets({
|
|
4888
|
+
interactive: options.interactive,
|
|
4889
|
+
agent: options.agent,
|
|
4890
|
+
onCancel: () => cancelAndExit()
|
|
4891
|
+
});
|
|
4892
|
+
selectedAgentTargetPaths = agentSelection.targetPaths;
|
|
4893
|
+
shouldWriteCopilotSetupWorkflow = agentSelection.selectedAgents.some((agent) => agent.id === COPILOT_AGENT_ID);
|
|
4894
|
+
}
|
|
4834
4895
|
selectedEditors = (options.editor || !options.interactive ? void 0 : detectExistingEditors(workspaceInfoOptional.rootDir)) ?? await selectEditors({
|
|
4835
4896
|
interactive: options.interactive,
|
|
4836
4897
|
editor: options.editor,
|
|
@@ -4895,10 +4956,10 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4895
4956
|
});
|
|
4896
4957
|
resumeCreateProgress();
|
|
4897
4958
|
if (q(selected)) {
|
|
4898
|
-
log
|
|
4959
|
+
log.info("Operation cancelled. Skipping git initialization");
|
|
4899
4960
|
shouldInitGit = false;
|
|
4900
4961
|
} else shouldInitGit = selected;
|
|
4901
|
-
} else if (shouldInitGit && !compactOutput) log
|
|
4962
|
+
} else if (shouldInitGit && !compactOutput) log.info("Initializing git repository (default: yes)");
|
|
4902
4963
|
updateCreateProgress("Creating monorepo");
|
|
4903
4964
|
await checkProjectDirExists(path.join(workspaceInfo.rootDir, targetDir), options.interactive);
|
|
4904
4965
|
const result = isBundledMonorepo ? await executeBundledTemplate(workspaceInfo, {
|
|
@@ -4922,11 +4983,11 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4922
4983
|
cwd: fullPath
|
|
4923
4984
|
});
|
|
4924
4985
|
if (gitResult.status === 0) {
|
|
4925
|
-
if (!compactOutput) log
|
|
4986
|
+
if (!compactOutput) log.success("Git repository initialized");
|
|
4926
4987
|
ensureGitignoreNodeModules(fullPath);
|
|
4927
4988
|
} else {
|
|
4928
|
-
log
|
|
4929
|
-
if (gitResult.stderr) log
|
|
4989
|
+
log.warn("Failed to initialize git repository");
|
|
4990
|
+
if (gitResult.stderr) log.info(gitResult.stderr.toString());
|
|
4930
4991
|
}
|
|
4931
4992
|
}
|
|
4932
4993
|
updateCreateProgress("Writing agent instructions");
|
|
@@ -4937,6 +4998,10 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4937
4998
|
interactive: options.interactive,
|
|
4938
4999
|
silent: compactOutput
|
|
4939
5000
|
});
|
|
5001
|
+
if (shouldWriteCopilotSetupWorkflow) await writeCopilotSetupWorkflow({
|
|
5002
|
+
projectRoot: fullPath,
|
|
5003
|
+
silent: compactOutput
|
|
5004
|
+
});
|
|
4940
5005
|
resumeCreateProgress();
|
|
4941
5006
|
updateCreateProgress("Writing editor configs");
|
|
4942
5007
|
pauseCreateProgress();
|
|
@@ -4947,6 +5012,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4947
5012
|
silent: compactOutput,
|
|
4948
5013
|
extraVsCodeSettings: { "npm.scriptRunner": "vp" }
|
|
4949
5014
|
});
|
|
5015
|
+
if (selectedEditors?.includes("vscode")) ensureGitignoreVsCodeEditorConfigs(fullPath);
|
|
4950
5016
|
resumeCreateProgress();
|
|
4951
5017
|
workspaceInfo.rootDir = fullPath;
|
|
4952
5018
|
updateCreateProgress("Integrating monorepo");
|
|
@@ -4967,7 +5033,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
4967
5033
|
await runViteFmt(fullPath, options.interactive, void 0, { silent: compactOutput });
|
|
4968
5034
|
if (shouldSetupGit) {
|
|
4969
5035
|
updateCreateProgress("Creating initial commit");
|
|
4970
|
-
if (!await createInitialCommit(fullPath)) log
|
|
5036
|
+
if (!await createInitialCommit(fullPath)) log.warn("Initial commit failed. Check your git user.name/user.email config");
|
|
4971
5037
|
}
|
|
4972
5038
|
clearCreateProgress();
|
|
4973
5039
|
showCreateSummary({
|
|
@@ -5032,6 +5098,10 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5032
5098
|
interactive: options.interactive,
|
|
5033
5099
|
silent: compactOutput
|
|
5034
5100
|
});
|
|
5101
|
+
if (shouldWriteCopilotSetupWorkflow) await writeCopilotSetupWorkflow({
|
|
5102
|
+
projectRoot: getCopilotSetupRoot(agentInstructionsRoot, isMonorepo),
|
|
5103
|
+
silent: compactOutput
|
|
5104
|
+
});
|
|
5035
5105
|
resumeCreateProgress();
|
|
5036
5106
|
updateCreateProgress("Writing editor configs");
|
|
5037
5107
|
pauseCreateProgress();
|
|
@@ -5042,6 +5112,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5042
5112
|
silent: compactOutput,
|
|
5043
5113
|
extraVsCodeSettings: { "npm.scriptRunner": "vp" }
|
|
5044
5114
|
});
|
|
5115
|
+
if (selectedEditors?.includes("vscode")) ensureGitignoreVsCodeEditorConfigs(fullPath);
|
|
5045
5116
|
resumeCreateProgress();
|
|
5046
5117
|
const shouldMigrateLintFmtTools = detectEslintProject(fullPath).hasDependency || detectPrettierProject(fullPath).hasDependency;
|
|
5047
5118
|
let installSummary;
|
|
@@ -5065,7 +5136,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5065
5136
|
resumeCreateProgress();
|
|
5066
5137
|
};
|
|
5067
5138
|
if (isMonorepo) {
|
|
5068
|
-
if (!compactOutput) log
|
|
5139
|
+
if (!compactOutput) log.step("Monorepo integration...");
|
|
5069
5140
|
if (workspaceInfo.packages.length > 0) {
|
|
5070
5141
|
if (options.interactive) {
|
|
5071
5142
|
pauseCreateProgress();
|
|
@@ -5135,7 +5206,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5135
5206
|
await runViteFmt(fullPath, options.interactive, void 0, { silent: compactOutput });
|
|
5136
5207
|
if (shouldSetupGit) {
|
|
5137
5208
|
updateCreateProgress("Creating initial commit");
|
|
5138
|
-
if (!await createInitialCommit(fullPath)) log
|
|
5209
|
+
if (!await createInitialCommit(fullPath)) log.warn("Initial commit failed. Check your git user.name/user.email config");
|
|
5139
5210
|
}
|
|
5140
5211
|
}
|
|
5141
5212
|
clearCreateProgress();
|
|
@@ -5150,10 +5221,10 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5150
5221
|
}
|
|
5151
5222
|
async function showAvailableTemplates() {
|
|
5152
5223
|
printHeader();
|
|
5153
|
-
log(listTemplatesMessage);
|
|
5224
|
+
log$1(listTemplatesMessage);
|
|
5154
5225
|
}
|
|
5155
5226
|
main().catch((err) => {
|
|
5156
|
-
log
|
|
5227
|
+
log.error(err.message);
|
|
5157
5228
|
console.error(err);
|
|
5158
5229
|
cancelAndExit(`Failed to generate code: ${err.message}`, 1);
|
|
5159
5230
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PackUserConfig } from "./pack-
|
|
1
|
+
import { t as PackUserConfig } from "./pack-Ciiho0Tq.js";
|
|
2
2
|
import { ConfigEnv } from "@voidzero-dev/vite-plus-test/config";
|
|
3
3
|
import { PluginOption, UserConfig } from "@voidzero-dev/vite-plus-core";
|
|
4
4
|
import { OxfmtConfig } from "oxfmt";
|
|
@@ -11,6 +11,7 @@ type AutoInput = {
|
|
|
11
11
|
*/
|
|
12
12
|
auto: boolean;
|
|
13
13
|
};
|
|
14
|
+
type Command = string | Array<string>;
|
|
14
15
|
type GlobWithBase = {
|
|
15
16
|
/**
|
|
16
17
|
* The glob pattern (positive or negative starting with `!`)
|
|
@@ -24,9 +25,9 @@ type GlobWithBase = {
|
|
|
24
25
|
type InputBase = "package" | "workspace";
|
|
25
26
|
type Task = {
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Command to run, or an array of commands to run in order.
|
|
28
29
|
*/
|
|
29
|
-
command:
|
|
30
|
+
command: Command;
|
|
30
31
|
/**
|
|
31
32
|
* The working directory for the task, relative to the package root (not workspace root).
|
|
32
33
|
*/
|
|
@@ -74,6 +75,7 @@ type Task = {
|
|
|
74
75
|
*/
|
|
75
76
|
cache: false;
|
|
76
77
|
});
|
|
78
|
+
type TaskDefinition = Task | Command;
|
|
77
79
|
type UserGlobalCacheConfig = boolean | {
|
|
78
80
|
/**
|
|
79
81
|
* Enable caching for package.json scripts not defined in the `tasks` map.
|
|
@@ -104,9 +106,9 @@ type RunConfig = {
|
|
|
104
106
|
*/
|
|
105
107
|
cache?: UserGlobalCacheConfig;
|
|
106
108
|
/**
|
|
107
|
-
* Task definitions
|
|
109
|
+
* Task definitions: full task objects, command strings, or command string arrays.
|
|
108
110
|
*/
|
|
109
|
-
tasks?: { [key in string]:
|
|
111
|
+
tasks?: { [key in string]: TaskDefinition };
|
|
110
112
|
/**
|
|
111
113
|
* Whether to automatically run `preX`/`postX` package.json scripts as
|
|
112
114
|
* lifecycle hooks when script `X` is executed.
|
package/dist/define-config.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_define_config = require("./define-config-
|
|
2
|
+
const require_define_config = require("./define-config-BR1Y88zz.cjs");
|
|
3
3
|
require_define_config.init_define_config();
|
|
4
4
|
exports.defineConfig = require_define_config.defineConfig;
|
|
5
5
|
exports.lazyPlugins = require_define_config.lazyPlugins;
|
package/dist/define-config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as lazyPlugins, t as defineConfig } from "./define-config-
|
|
1
|
+
import { n as lazyPlugins, t as defineConfig } from "./define-config-COdn-tsn.js";
|
|
2
2
|
export { defineConfig, lazyPlugins };
|
package/dist/define-config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as lazyPlugins, t as defineConfig } from "./define-config-
|
|
1
|
+
import { n as lazyPlugins, t as defineConfig } from "./define-config-BRC7qPNE.js";
|
|
2
2
|
export { defineConfig, lazyPlugins };
|