vite-plus 0.1.12 → 0.1.13-alpha.0

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,5 +1,4 @@
1
1
  import { t as __commonJSMin } from "./chunk-CgnkrU7a.js";
2
- import { o as DEFAULT_ENVS, u as resolve$1 } from "./json-BRdVJ52a.js";
3
2
  import { n as accent } from "./help-CbTzUdXc.js";
4
3
  import path from "node:path";
5
4
  import { stripVTControlCharacters, styleText } from "node:util";
@@ -1573,36 +1572,6 @@ function displayRelative(to, from = process.cwd()) {
1573
1572
  return path.relative(from, to).replaceAll("\\", "/");
1574
1573
  }
1575
1574
  //#endregion
1576
- //#region src/resolve-fmt.ts
1577
- /**
1578
- * Oxfmt tool resolver for the vite-plus CLI.
1579
- *
1580
- * This module exports a function that resolves the oxfmt binary path
1581
- * using Node.js module resolution. The resolved path is passed back
1582
- * to the Rust core, which then executes oxfmt for code formatting.
1583
- *
1584
- * Used for: `vite-plus fmt` command
1585
- *
1586
- * Oxfmt is a fast JavaScript/TypeScript formatter written in Rust that
1587
- * provides high-performance code formatting capabilities.
1588
- */
1589
- /**
1590
- * Resolves the oxfmt binary path and environment variables.
1591
- *
1592
- * @returns Promise containing:
1593
- * - binPath: Absolute path to the oxfmt binary
1594
- * - envs: Environment variables to set when executing oxfmt
1595
- *
1596
- * The environment variables provide runtime context to oxfmt,
1597
- * including Node.js version information and package manager details.
1598
- */
1599
- async function fmt() {
1600
- return {
1601
- binPath: resolve$1("oxfmt/bin/oxfmt"),
1602
- envs: { ...DEFAULT_ENVS }
1603
- };
1604
- }
1605
- //#endregion
1606
1575
  //#region src/utils/prompts.ts
1607
1576
  function cancelAndExit(message = "Operation cancelled", exitCode = 0) {
1608
1577
  cancel(message);
@@ -1676,15 +1645,15 @@ async function runViteFmt(cwd, interactive, paths, options) {
1676
1645
  const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
1677
1646
  const startTime = Date.now();
1678
1647
  spinner.start(`Formatting code...`);
1679
- const { binPath, envs } = await fmt();
1680
1648
  const { exitCode, stderr, stdout } = await runCommandSilently({
1681
- command: binPath,
1682
- args: ["--write", ...paths ?? []],
1649
+ command: process.env.VITE_PLUS_CLI_BIN ?? "vp",
1650
+ args: [
1651
+ "fmt",
1652
+ "--write",
1653
+ ...paths ?? []
1654
+ ],
1683
1655
  cwd,
1684
- envs: {
1685
- ...process.env,
1686
- ...envs
1687
- }
1656
+ envs: process.env
1688
1657
  });
1689
1658
  if (exitCode === 0) {
1690
1659
  spinner.stop(`Code formatted`);
@@ -1,6 +1,6 @@
1
- import { A as note, F as Ct, M as select, O as log, T as cancel, a as hasExistingAgentInstructions, i as getAgentById, n as detectAgents, o as replaceMarkedAgentInstructionsSection, p as promptGitHooks, u as defaultInteractive, y as pkgRoot } from "./agent-l4VXJklB.js";
1
+ import { A as note, F as Ct, M as select, O as log, T as cancel, a as hasExistingAgentInstructions, i as getAgentById, n as detectAgents, o as replaceMarkedAgentInstructionsSection, p as promptGitHooks, u as defaultInteractive, y as pkgRoot } from "./agent-BNlnCNoZ.js";
2
2
  import { t as lib_default } from "./lib-DxappLRQ.js";
3
- import { i as writeJsonFile, r as readJsonFile, s as VITE_PLUS_NAME } from "./json-BRdVJ52a.js";
3
+ import { i as writeJsonFile, o as VITE_PLUS_NAME, r as readJsonFile } from "./json-Cb66925x.js";
4
4
  import { i as log$1, t as renderCliDoc } from "./help-CbTzUdXc.js";
5
5
  import { dirname, join, relative } from "node:path";
6
6
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
@@ -1,10 +1,10 @@
1
1
  import { i as __toESM, t as __commonJSMin } from "./chunk-CgnkrU7a.js";
2
- import { C as DependencyType, D as intro, E as confirm, F as Ct, M as select, N as spinner, O as log, P as text, T as cancel, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, k as multiselect, m as runViteFmt, p as promptGitHooks, r as detectExistingAgentTargetPaths, s as selectAgentTargetPaths, u as defaultInteractive, v as displayRelative, w as PackageManager, x as templatesDir } from "./agent-l4VXJklB.js";
2
+ import { C as DependencyType, D as intro, E as confirm, F as Ct, M as select, N as spinner, O as log, P as text, T as cancel, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, k as multiselect, m as runViteFmt, p as promptGitHooks, r as detectExistingAgentTargetPaths, s as selectAgentTargetPaths, u as defaultInteractive, v as displayRelative, w as PackageManager, x as templatesDir } from "./agent-BNlnCNoZ.js";
3
3
  import { t as lib_default } from "./lib-DxappLRQ.js";
4
- import { _ as rewriteMonorepo, a as detectExistingEditor, f as installGitHooks, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1, v as rewriteMonorepoProject, y as rewriteStandaloneProject } from "./workspace-CshY0VeI.js";
4
+ import { _ as rewriteMonorepo, a as detectExistingEditor, f as installGitHooks, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1, v as rewriteMonorepoProject, y as rewriteStandaloneProject } from "./workspace-DWmkrO8l.js";
5
5
  import "./browser-CBapUTD0.js";
6
- import { r as readJsonFile, t as editJsonFile } from "./json-BRdVJ52a.js";
7
- import "./package-YAMvX5PJ.js";
6
+ import { r as readJsonFile, t as editJsonFile } from "./json-Cb66925x.js";
7
+ import "./package-C5aXF8Gs.js";
8
8
  import { a as muted, i as log$1, n as accent, o as success, t as renderCliDoc } from "./help-CbTzUdXc.js";
9
9
  import path from "node:path";
10
10
  import { styleText } from "node:util";
@@ -248,6 +248,7 @@ function expandCreateShorthand(templateName) {
248
248
  const version = atIndex === -1 ? "" : templateName.slice(atIndex);
249
249
  if (name.startsWith("create-")) return templateName;
250
250
  if (name === "nitro") return `create-nitro-app${version}`;
251
+ if (name === "svelte") return `sv${version}`;
251
252
  return `create-${name}${version}`;
252
253
  }
253
254
  function inferParentDir(templateName, workspaceInfo) {
@@ -3225,7 +3226,7 @@ function formatTargetDir(input) {
3225
3226
  };
3226
3227
  }
3227
3228
  return {
3228
- directory: targetDir,
3229
+ directory: targetDir.split(path.sep).join("/"),
3229
3230
  packageName
3230
3231
  };
3231
3232
  }
@@ -3467,6 +3468,9 @@ function autoFixRemoteTemplateCommand(templateInfo, workspaceInfo) {
3467
3468
  } else if (packageName === "@tanstack/create-start") {
3468
3469
  templateInfo.args.push("--no-install");
3469
3470
  templateInfo.args.push("--no-toolchain");
3471
+ } else if (packageName === "sv") {
3472
+ if (templateInfo.args[0] !== "create") templateInfo.args.unshift("create");
3473
+ templateInfo.args.push("--no-install");
3470
3474
  }
3471
3475
  if (workspaceInfo.isMonorepo) {
3472
3476
  if (packageName === "create-nuxt") templateInfo.args.push("--no-gitInit");
@@ -3686,6 +3690,7 @@ const helpMessage = renderCliDoc({
3686
3690
  ` ${muted("# Use existing templates (shorthand expands to create-* packages)")}`,
3687
3691
  ` ${accent("vp create vite")}`,
3688
3692
  ` ${accent("vp create @tanstack/start")}`,
3693
+ ` ${accent("vp create svelte")}`,
3689
3694
  ` ${accent("vp create vite -- --template react-ts")}`,
3690
3695
  "",
3691
3696
  ` ${muted("# Full package names also work")}`,
@@ -3754,6 +3759,10 @@ const listTemplatesMessage = renderCliDoc({
3754
3759
  label: "react-router",
3755
3760
  description: "React Router application (create-react-router)"
3756
3761
  },
3762
+ {
3763
+ label: "svelte",
3764
+ description: "Svelte application (sv create)"
3765
+ },
3757
3766
  {
3758
3767
  label: "vue",
3759
3768
  description: "Vue application (create-vue)"
@@ -3997,7 +4006,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
3997
4006
  fallbackName: `vite-plus-${selectedTemplateName.split(":")[1]}`
3998
4007
  }), options.interactive);
3999
4008
  packageName = selected.packageName;
4000
- targetDir = selectedParentDir ? path.join(selectedParentDir, selected.targetDir) : selected.targetDir;
4009
+ targetDir = selectedParentDir ? path.join(selectedParentDir, selected.targetDir).split(path.sep).join("/") : selected.targetDir;
4001
4010
  }
4002
4011
  const packageManager = workspaceInfoOptional.packageManager ?? await selectPackageManager(options.interactive, compactOutput);
4003
4012
  const shouldSilencePackageManagerInstallLog = compactOutput || isMonorepo && workspaceInfoOptional.packageManager !== void 0;
@@ -4125,7 +4134,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
4125
4134
  fallbackName: `vite-plus-${templateInfo.command.split(":")[1]}`
4126
4135
  }), options.interactive);
4127
4136
  packageName = selected.packageName;
4128
- targetDir = templateInfo.parentDir ? path.join(templateInfo.parentDir, selected.targetDir) : selected.targetDir;
4137
+ targetDir = templateInfo.parentDir ? path.join(templateInfo.parentDir, selected.targetDir).split(path.sep).join("/") : selected.targetDir;
4129
4138
  }
4130
4139
  pauseCreateProgress();
4131
4140
  await checkProjectDirExists(targetDir, options.interactive);
@@ -7,16 +7,9 @@ const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VITE_PLUS_OVERRIDE_PACKAGES ? JS
7
7
  vite: "npm:@voidzero-dev/vite-plus-core@latest",
8
8
  vitest: "npm:@voidzero-dev/vite-plus-test@latest"
9
9
  };
10
- const require = createRequire(import.meta.url);
11
- function resolve(path) {
12
- return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
13
- }
10
+ createRequire(import.meta.url);
14
11
  const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: tsconfig.json contains baseUrl which is not yet supported by the oxlint type checker.\n Run `npx @andrewbranch/ts5to6 --fixBaseUrl .` to remove baseUrl from your tsconfig.";
15
- const DEFAULT_ENVS = {
16
- JS_RUNTIME_VERSION: process.versions.node,
17
- JS_RUNTIME_NAME: process.release.name,
18
- NODE_PACKAGE_MANAGER: "vite-plus"
19
- };
12
+ process.versions.node, process.release.name;
20
13
  //#endregion
21
14
  //#region ../../node_modules/.pnpm/detect-indent@7.0.2/node_modules/detect-indent/index.js
22
15
  const INDENT_REGEX = /^(?:( )+|\t+)/;
@@ -153,4 +146,4 @@ function isJsonFile(file) {
153
146
  }
154
147
  }
155
148
  //#endregion
156
- export { BASEURL_TSCONFIG_WARNING as a, VITE_PLUS_OVERRIDE_PACKAGES as c, writeJsonFile as i, VITE_PLUS_VERSION as l, isJsonFile as n, DEFAULT_ENVS as o, readJsonFile as r, VITE_PLUS_NAME as s, editJsonFile as t, resolve as u };
149
+ export { BASEURL_TSCONFIG_WARNING as a, VITE_PLUS_VERSION as c, writeJsonFile as i, isJsonFile as n, VITE_PLUS_NAME as o, readJsonFile as r, VITE_PLUS_OVERRIDE_PACKAGES as s, editJsonFile as t };
@@ -1,10 +1,10 @@
1
1
  import { i as __toESM } from "./chunk-CgnkrU7a.js";
2
- import { E as confirm, F as Ct, M as select, N as spinner, O as log, _ as upgradeYarn, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, j as outro, l as cancelAndExit, p as promptGitHooks, r as detectExistingAgentTargetPaths, s as selectAgentTargetPaths, t as detectAgentConflicts, u as defaultInteractive, v as displayRelative, w as PackageManager } from "./agent-l4VXJklB.js";
2
+ import { E as confirm, F as Ct, M as select, N as spinner, O as log, _ as upgradeYarn, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, j as outro, l as cancelAndExit, p as promptGitHooks, r as detectExistingAgentTargetPaths, s as selectAgentTargetPaths, t as detectAgentConflicts, u as defaultInteractive, v as displayRelative, w as PackageManager } from "./agent-BNlnCNoZ.js";
3
3
  import { t as lib_default } from "./lib-DxappLRQ.js";
4
- import { _ as rewriteMonorepo, b as createMigrationReport, c as checkViteVersion, d as detectPrettierProject, f as installGitHooks, g as preflightGitHooksSetup, h as migratePrettierToOxfmt, i as detectEditorConflicts, l as checkVitestVersion, m as migrateEslintToOxlint, o as selectEditor, p as mergeViteConfigFiles, s as writeEditorConfigs, t as detectWorkspace$1, u as detectEslintProject, x as require_semver, y as rewriteStandaloneProject } from "./workspace-CshY0VeI.js";
4
+ import { _ as rewriteMonorepo, b as createMigrationReport, c as checkViteVersion, d as detectPrettierProject, f as installGitHooks, g as preflightGitHooksSetup, h as migratePrettierToOxfmt, i as detectEditorConflicts, l as checkVitestVersion, m as migrateEslintToOxlint, o as selectEditor, p as mergeViteConfigFiles, s as writeEditorConfigs, t as detectWorkspace$1, u as detectEslintProject, x as require_semver, y as rewriteStandaloneProject } from "./workspace-DWmkrO8l.js";
5
5
  import "./browser-CBapUTD0.js";
6
- import "./json-BRdVJ52a.js";
7
- import { i as readNearestPackageJson, r as hasVitePlusDependency } from "./package-YAMvX5PJ.js";
6
+ import "./json-Cb66925x.js";
7
+ import { i as readNearestPackageJson, r as hasVitePlusDependency } from "./package-C5aXF8Gs.js";
8
8
  import { a as muted, i as log$1, n as accent, t as renderCliDoc } from "./help-CbTzUdXc.js";
9
9
  import path from "node:path";
10
10
  import { styleText } from "node:util";
@@ -1,4 +1,4 @@
1
- import { r as readJsonFile } from "./json-BRdVJ52a.js";
1
+ import { r as readJsonFile } from "./json-Cb66925x.js";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs";
4
4
  import { createRequire } from "node:module";
@@ -1,5 +1,5 @@
1
- import { s as VITE_PLUS_NAME } from "./json-BRdVJ52a.js";
2
- import { r as hasVitePlusDependency, t as detectPackageMetadata } from "./package-YAMvX5PJ.js";
1
+ import { o as VITE_PLUS_NAME } from "./json-Cb66925x.js";
2
+ import { r as hasVitePlusDependency, t as detectPackageMetadata } from "./package-C5aXF8Gs.js";
3
3
  import { i as log, n as accent, t as renderCliDoc } from "./help-CbTzUdXc.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs";
@@ -1,8 +1,8 @@
1
1
  import { i as __toESM, t as __commonJSMin } from "./chunk-CgnkrU7a.js";
2
- import { F as Ct, M as select, O as log, S as runCommandSilently, b as rulesDir, f as getSpinner, v as displayRelative, w as PackageManager } from "./agent-l4VXJklB.js";
2
+ import { F as Ct, M as select, O as log, S as runCommandSilently, b as rulesDir, f as getSpinner, v as displayRelative, w as PackageManager } from "./agent-BNlnCNoZ.js";
3
3
  import { _ as YAMLMap, g as YAMLSeq, i as parseDocument, n as parse, y as Scalar } from "./browser-CBapUTD0.js";
4
- import { a as BASEURL_TSCONFIG_WARNING, c as VITE_PLUS_OVERRIDE_PACKAGES, i as writeJsonFile, l as VITE_PLUS_VERSION, n as isJsonFile, r as readJsonFile, s as VITE_PLUS_NAME, t as editJsonFile } from "./json-BRdVJ52a.js";
5
- import { n as getScopeFromPackageName, t as detectPackageMetadata } from "./package-YAMvX5PJ.js";
4
+ import { a as BASEURL_TSCONFIG_WARNING, c as VITE_PLUS_VERSION, i as writeJsonFile, n as isJsonFile, o as VITE_PLUS_NAME, r as readJsonFile, s as VITE_PLUS_OVERRIDE_PACKAGES, t as editJsonFile } from "./json-Cb66925x.js";
5
+ import { n as getScopeFromPackageName, t as detectPackageMetadata } from "./package-C5aXF8Gs.js";
6
6
  import path, { posix, win32 } from "node:path";
7
7
  import * as actualFS from "node:fs";
8
8
  import fs from "node:fs";
@@ -1,6 +1,5 @@
1
1
  import * as prompts from '@voidzero-dev/vite-plus-prompts';
2
2
  import { downloadPackageManager as downloadPackageManagerBinding } from '../../binding/index.js';
3
- import { fmt as resolveFmt } from '../resolve-fmt.js';
4
3
  import { PackageManager } from '../types/index.js';
5
4
  import { runCommandSilently } from './command.js';
6
5
  import { accent } from './terminal.js';
@@ -80,15 +79,11 @@ export async function runViteFmt(cwd, interactive, paths, options) {
80
79
  const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
81
80
  const startTime = Date.now();
82
81
  spinner.start(`Formatting code...`);
83
- const { binPath, envs } = await resolveFmt();
84
82
  const { exitCode, stderr, stdout } = await runCommandSilently({
85
- command: binPath,
86
- args: ['--write', ...(paths ?? [])],
83
+ command: process.env.VITE_PLUS_CLI_BIN ?? 'vp',
84
+ args: ['fmt', '--write', ...(paths ?? [])],
87
85
  cwd,
88
- envs: {
89
- ...process.env,
90
- ...envs,
91
- },
86
+ envs: process.env,
92
87
  });
93
88
  if (exitCode === 0) {
94
89
  spinner.stop(`Code formatted`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.1.12",
3
+ "version": "0.1.13-alpha.0",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -307,15 +307,15 @@
307
307
  }
308
308
  },
309
309
  "dependencies": {
310
- "@oxc-project/types": "=0.115.0",
310
+ "@oxc-project/types": "=0.120.0",
311
311
  "cac": "^6.7.14",
312
312
  "cross-spawn": "^7.0.5",
313
- "oxfmt": "=0.40.0",
314
- "oxlint": "=1.55.0",
313
+ "oxfmt": "=0.41.0",
314
+ "oxlint": "=1.56.0",
315
315
  "oxlint-tsgolint": "=0.17.0",
316
316
  "picocolors": "^1.1.1",
317
- "@voidzero-dev/vite-plus-test": "0.1.12",
318
- "@voidzero-dev/vite-plus-core": "0.1.12"
317
+ "@voidzero-dev/vite-plus-core": "0.1.13-alpha.0",
318
+ "@voidzero-dev/vite-plus-test": "0.1.13-alpha.0"
319
319
  },
320
320
  "devDependencies": {
321
321
  "@napi-rs/cli": "^3.4.1",
@@ -333,12 +333,12 @@
333
333
  "mri": "^1.2.0",
334
334
  "rolldown-plugin-dts": "^0.22.0",
335
335
  "semver": "^7.7.3",
336
- "tsdown": "^0.21.3",
336
+ "tsdown": "^0.21.4",
337
337
  "validate-npm-package-name": "^7.0.2",
338
338
  "yaml": "^2.8.1",
339
- "@voidzero-dev/vite-plus-prompts": "0.0.0",
340
339
  "rolldown": "1.0.0-rc.9",
341
- "vite": "npm:@voidzero-dev/vite-plus-core@0.1.12"
340
+ "@voidzero-dev/vite-plus-prompts": "0.0.0",
341
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.13-alpha.0"
342
342
  },
343
343
  "napi": {
344
344
  "binaryName": "vite-plus",
@@ -356,12 +356,12 @@
356
356
  "node": "^20.19.0 || >=22.12.0"
357
357
  },
358
358
  "optionalDependencies": {
359
- "@voidzero-dev/vite-plus-darwin-arm64": "0.1.12",
360
- "@voidzero-dev/vite-plus-darwin-x64": "0.1.12",
361
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.12",
362
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.12",
363
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.12",
364
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.12"
359
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.1.13-alpha.0",
360
+ "@voidzero-dev/vite-plus-darwin-x64": "0.1.13-alpha.0",
361
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.13-alpha.0",
362
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.13-alpha.0",
363
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.13-alpha.0",
364
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.13-alpha.0"
365
365
  },
366
366
  "scripts": {
367
367
  "build": "oxnode -C dev ./build.ts",