vite-plus 0.1.14-alpha.0 → 0.1.14-alpha.1

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.
@@ -1,9 +1,6 @@
1
1
  import { S as defaultInteractive, i as updateExistingAgentInstructions, u as ensurePreCommitHook, w as promptGitHooks } from "./agent-DTz-Dh1r.js";
2
2
  import { t as lib_default } from "./lib-DxappLRQ.js";
3
- import "./browser-09BZLUYM.js";
4
- import "./package-Y1UTfJnZ.js";
5
3
  import { i as log, t as renderCliDoc } from "./help-HviKaKAU.js";
6
- import "./report-C7xbSNED.js";
7
4
  import { join } from "node:path";
8
5
  import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
9
6
  import { vitePlusHeader } from "../../binding/index.js";
@@ -1,10 +1,8 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./chunk-BoAXSpZd.js";
2
2
  import { A as templatesDir, B as select, C as downloadPackageManager$1, D as selectPackageManager, E as runViteInstall, F as confirm, H as text, I as intro, L as log, M as PackageManager, P as cancel, R as multiselect, S as defaultInteractive, T as runViteFmt, U as Ct, V as spinner, _ as rewriteMonorepoProject, a as writeAgentInstructions, d as installGitHooks, g as rewriteMonorepo, j as DependencyType, k as displayRelative, n as detectExistingAgentTargetPaths, r as selectAgentTargetPaths, v as rewriteStandaloneProject, w as promptGitHooks } from "./agent-DTz-Dh1r.js";
3
3
  import { t as lib_default } from "./lib-DxappLRQ.js";
4
- import "./browser-09BZLUYM.js";
5
4
  import { c as readJsonFile, o as editJsonFile, t as checkNpmPackageExists } from "./package-Y1UTfJnZ.js";
6
5
  import { a as muted, i as log$1, n as accent, o as success, t as renderCliDoc } from "./help-HviKaKAU.js";
7
- import "./report-C7xbSNED.js";
8
6
  import { a as detectExistingEditor, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1 } from "./workspace-BlrOxcHM.js";
9
7
  import path from "node:path";
10
8
  import { styleText } from "node:util";
@@ -3184,12 +3182,12 @@ function copyDir(srcDir, destDir) {
3184
3182
  * Examples:
3185
3183
  * ```
3186
3184
  * # invalid target directories
3187
- * ./ -> { directory: '', packageName: '', error: 'Invalid target directory' }
3188
3185
  * /foo/bar -> { directory: '', packageName: '', error: 'Absolute path is not allowed' }
3189
3186
  * @scope/ -> { directory: '', packageName: '', error: 'Invalid target directory' }
3190
3187
  * ../../foo/bar -> { directory: '', packageName: '', error: 'Invalid target directory' }
3191
3188
  *
3192
3189
  * # valid target directories
3190
+ * . -> { directory: '.', packageName: '' }
3193
3191
  * ./my-package -> { directory: './my-package', packageName: 'my-package' }
3194
3192
  * ./foo/bar-package -> { directory: './foo/bar-package', packageName: 'bar-package' }
3195
3193
  * ./foo/bar-package/ -> { directory: './foo/bar-package', packageName: 'bar-package' }
@@ -3202,6 +3200,10 @@ function copyDir(srcDir, destDir) {
3202
3200
  */
3203
3201
  function formatTargetDir(input) {
3204
3202
  let targetDir = path.normalize(input.trim());
3203
+ if (targetDir === "." || targetDir === `.${path.sep}`) return {
3204
+ directory: ".",
3205
+ packageName: ""
3206
+ };
3205
3207
  const parsed = path.parse(targetDir);
3206
3208
  if (parsed.root || path.isAbsolute(targetDir)) return {
3207
3209
  directory: "",
@@ -3249,6 +3251,14 @@ function formatDisplayTargetDir(targetDir) {
3249
3251
  if (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("/") || normalized.startsWith("~")) return normalized;
3250
3252
  return `./${normalized}`;
3251
3253
  }
3254
+ function deriveDefaultPackageName(cwd, scope, fallbackName) {
3255
+ const dirName = path.basename(cwd);
3256
+ const candidate = scope ? `${scope}/${dirName}` : dirName;
3257
+ return (0, import_lib.default)(candidate).validForNewPackages ? candidate : getRandomProjectName({
3258
+ scope,
3259
+ fallbackName
3260
+ });
3261
+ }
3252
3262
  //#endregion
3253
3263
  //#region src/create/prompts.ts
3254
3264
  async function promptPackageNameAndTargetDir(defaultPackageName, interactive) {
@@ -4007,7 +4017,17 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
4007
4017
  remoteTargetDir = await promptTargetDir(defaultTargetDir, options.interactive, { cwd: remoteTargetBaseDir });
4008
4018
  selectedTemplateArgs = [remoteTargetDir, ...selectedTemplateArgs];
4009
4019
  }
4010
- if (isBuiltinTemplate && !targetDir) if (selectedTemplateName === BuiltinTemplate.monorepo) {
4020
+ if (isBuiltinTemplate && (!targetDir || targetDir === ".")) if (targetDir === ".") {
4021
+ const fallbackName = selectedTemplateName === BuiltinTemplate.monorepo ? "vite-plus-monorepo" : `vite-plus-${selectedTemplateName.split(":")[1]}`;
4022
+ packageName = deriveDefaultPackageName(cwd, workspaceInfoOptional.monorepoScope, fallbackName);
4023
+ if (isMonorepo) {
4024
+ if (!cwdRelativeToRoot) cancelAndExit("Cannot scaffold into the monorepo root directory. Use --directory to specify a target directory", 1);
4025
+ const enclosingPackage = workspaceInfoOptional.packages.find((pkg) => cwdRelativeToRoot === pkg.path || cwdRelativeToRoot.startsWith(`${pkg.path}/`));
4026
+ if (enclosingPackage) cancelAndExit(`Cannot scaffold inside existing package "${enclosingPackage.name}" (${enclosingPackage.path}). Use --directory to specify a different location`, 1);
4027
+ targetDir = cwdRelativeToRoot;
4028
+ }
4029
+ log.info(`Using package name: ${accent(packageName)}`);
4030
+ } else if (selectedTemplateName === BuiltinTemplate.monorepo) {
4011
4031
  const selected = await promptPackageNameAndTargetDir(getRandomProjectName({ fallbackName: "vite-plus-monorepo" }), options.interactive);
4012
4032
  packageName = selected.packageName;
4013
4033
  targetDir = selected.targetDir;
@@ -4148,7 +4168,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
4148
4168
  targetDir = templateInfo.parentDir ? path.join(templateInfo.parentDir, selected.targetDir).split(path.sep).join("/") : selected.targetDir;
4149
4169
  }
4150
4170
  pauseCreateProgress();
4151
- await checkProjectDirExists(targetDir, options.interactive);
4171
+ await checkProjectDirExists(path.join(workspaceInfo.rootDir, targetDir), options.interactive);
4152
4172
  resumeCreateProgress();
4153
4173
  updateCreateProgress("Generating project");
4154
4174
  result = await executeBuiltinTemplate(workspaceInfo, {
@@ -1,7 +1,6 @@
1
1
  import { r as __toESM } from "./chunk-BoAXSpZd.js";
2
2
  import { B as select, C as downloadPackageManager$1, D as selectPackageManager, E as runViteInstall, F as confirm, L as log, M as PackageManager, N as require_semver, O as upgradeYarn, S as defaultInteractive, U as Ct, V as spinner, a as writeAgentInstructions, c as detectEslintProject, d as installGitHooks, f as mergeViteConfigFiles, g as rewriteMonorepo, h as preflightGitHooksSetup, k as displayRelative, l as detectPrettierProject, m as migratePrettierToOxfmt, n as detectExistingAgentTargetPaths, o as checkViteVersion, p as migrateEslintToOxlint, r as selectAgentTargetPaths, s as checkVitestVersion, t as detectAgentConflicts, v as rewriteStandaloneProject, w as promptGitHooks, x as cancelAndExit, z as outro } from "./agent-DTz-Dh1r.js";
3
3
  import { t as lib_default } from "./lib-DxappLRQ.js";
4
- import "./browser-09BZLUYM.js";
5
4
  import { a as readNearestPackageJson, i as hasVitePlusDependency, m as isForceOverrideMode } from "./package-Y1UTfJnZ.js";
6
5
  import { a as muted, i as log$1, n as accent, t as renderCliDoc } from "./help-HviKaKAU.js";
7
6
  import { r as createMigrationReport } from "./report-C7xbSNED.js";
@@ -1819,7 +1819,7 @@ var DefaultRenderer = class DefaultRenderer {
1819
1819
  async render() {
1820
1820
  const { createLogUpdate } = await import("./log-update-C8WCYCbc.js");
1821
1821
  const { default: truncate } = await import("./cli-truncate-Da6Y8aM8.js");
1822
- const { default: wrap } = await import("./wrap-ansi-Ou9oAs-a.js");
1822
+ const { default: wrap } = await import("./wrap-ansi-yd4eUCl_.js");
1823
1823
  this.updater = createLogUpdate(this.logger.process.stdout);
1824
1824
  this.truncate = truncate;
1825
1825
  this.wrap = wrap;
@@ -1,3 +1,2 @@
1
- import "./strip-ansi-CE-VDMdw.js";
2
1
  import { t as wrapAnsi } from "./wrap-ansi-eywLlPVQ.js";
3
2
  export { wrapAnsi as default };
@@ -0,0 +1,2 @@
1
+ import '@voidzero-dev/vite-plus-test/optional-runtime-types.js';
2
+ export * from '@voidzero-dev/vite-plus-test/optional-runtime-types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.1.14-alpha.0",
3
+ "version": "0.1.14-alpha.1",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -93,6 +93,9 @@
93
93
  "./test/optional-types.js": {
94
94
  "types": "./dist/test/optional-types.js.d.ts"
95
95
  },
96
+ "./test/optional-runtime-types.js": {
97
+ "types": "./dist/test/optional-runtime-types.js.d.ts"
98
+ },
96
99
  "./test/globals": {
97
100
  "types": "./dist/test/globals.d.ts"
98
101
  },
@@ -307,15 +310,15 @@
307
310
  }
308
311
  },
309
312
  "dependencies": {
310
- "@oxc-project/types": "=0.120.0",
313
+ "@oxc-project/types": "=0.122.0",
311
314
  "cac": "^7.0.0",
312
315
  "cross-spawn": "^7.0.5",
313
316
  "oxfmt": "=0.41.0",
314
317
  "oxlint": "=1.56.0",
315
- "oxlint-tsgolint": "=0.17.1",
318
+ "oxlint-tsgolint": "=0.17.2",
316
319
  "picocolors": "^1.1.1",
317
- "@voidzero-dev/vite-plus-core": "0.1.14-alpha.0",
318
- "@voidzero-dev/vite-plus-test": "0.1.14-alpha.0"
320
+ "@voidzero-dev/vite-plus-core": "0.1.14-alpha.1",
321
+ "@voidzero-dev/vite-plus-test": "0.1.14-alpha.1"
319
322
  },
320
323
  "devDependencies": {
321
324
  "@napi-rs/cli": "^3.4.1",
@@ -337,9 +340,9 @@
337
340
  "tsdown": "^0.21.4",
338
341
  "validate-npm-package-name": "^7.0.2",
339
342
  "yaml": "^2.8.1",
340
- "vite": "npm:@voidzero-dev/vite-plus-core@0.1.14-alpha.0",
341
343
  "@voidzero-dev/vite-plus-prompts": "0.0.0",
342
- "rolldown": "1.0.0-rc.10"
344
+ "rolldown": "1.0.0-rc.11",
345
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.14-alpha.1"
343
346
  },
344
347
  "napi": {
345
348
  "binaryName": "vite-plus",
@@ -348,7 +351,9 @@
348
351
  "aarch64-apple-darwin",
349
352
  "x86_64-apple-darwin",
350
353
  "aarch64-unknown-linux-gnu",
354
+ "aarch64-unknown-linux-musl",
351
355
  "x86_64-unknown-linux-gnu",
356
+ "x86_64-unknown-linux-musl",
352
357
  "x86_64-pc-windows-msvc",
353
358
  "aarch64-pc-windows-msvc"
354
359
  ]
@@ -357,12 +362,14 @@
357
362
  "node": "^20.19.0 || >=22.12.0"
358
363
  },
359
364
  "optionalDependencies": {
360
- "@voidzero-dev/vite-plus-darwin-arm64": "0.1.14-alpha.0",
361
- "@voidzero-dev/vite-plus-darwin-x64": "0.1.14-alpha.0",
362
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.14-alpha.0",
363
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.14-alpha.0",
364
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.14-alpha.0",
365
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.14-alpha.0"
365
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.1.14-alpha.1",
366
+ "@voidzero-dev/vite-plus-darwin-x64": "0.1.14-alpha.1",
367
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.14-alpha.1",
368
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.14-alpha.1",
369
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.14-alpha.1",
370
+ "@voidzero-dev/vite-plus-linux-x64-musl": "0.1.14-alpha.1",
371
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.14-alpha.1",
372
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.14-alpha.1"
366
373
  },
367
374
  "scripts": {
368
375
  "build": "oxnode -C dev ./build.ts",
@@ -28,6 +28,27 @@ vp help
28
28
  Vite+ will manage your global Node.js runtime and package manager. If you'd like to opt out of this behavior, run `vp env off`. If you realize Vite+ is not for you, type `vp implode`, but please [share your feedback with us](https://discord.gg/cAnsqHh5PX).
29
29
  :::
30
30
 
31
+ ::: details Using a minor platform (CPU architecture, OS) ?
32
+
33
+ Prebuilt binaries are distributed for the following platforms (grouped by [Node.js v24 platform support tier](https://github.com/nodejs/node/blob/v24.x/BUILDING.md#platform-list)):
34
+
35
+ - Tier 1
36
+ - Linux x64 glibc (`x86_64-unknown-linux-gnu`)
37
+ - Linux arm64 glibc (`aarch64-unknown-linux-gnu`)
38
+ - Windows x64 (`x86_64-pc-windows-msvc`)
39
+ - macOS x64 (`x86_64-apple-darwin`)
40
+ - macOS arm64 (`aarch64-apple-darwin`)
41
+ - Tier 2
42
+ - Windows arm64 (`aarch64-pc-windows-msvc`)
43
+ - Experimental
44
+ - Linux x64 musl (`x86_64-unknown-linux-musl`)
45
+ - Other
46
+ - Linux arm64 musl (`aarch64-unknown-linux-musl`)
47
+
48
+ If a prebuilt binary is not available for your platform, installation will fail with an error.
49
+
50
+ :::
51
+
31
52
  ## Quick Start
32
53
 
33
54
  Create a project, install dependencies, and use the default commands:
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "noEmit": true,
4
- "module": "preserve",
5
- "moduleResolution": "bundler",
4
+ "module": "nodenext",
5
+ "moduleResolution": "nodenext",
6
6
  "allowImportingTsExtensions": true,
7
7
  "esModuleInterop": true
8
8
  }