vite-plus 0.2.6 → 0.2.8

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.
Files changed (61) hide show
  1. package/AGENTS.md +4 -0
  2. package/LICENSE +5 -1
  3. package/README.md +1 -1
  4. package/bin/vpr +3 -2
  5. package/binding/index.cjs +193 -80
  6. package/binding/index.d.cts +99 -8
  7. package/dist/agent-CI79DuSy.js +600 -0
  8. package/dist/bin.js +1367 -11
  9. package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
  10. package/dist/client/bundledDevClient.mjs +1 -0
  11. package/dist/config/bin.js +13 -126
  12. package/dist/{constants-CaXMuYUG.js → constants-BppDcRc1.js} +1 -1
  13. package/dist/create/bin.js +90 -77
  14. package/dist/{define-config-iGV0CGUk.cjs → define-config-CEm_MtvJ.cjs} +1 -1
  15. package/dist/{define-config-hV8qyU8p.js → define-config-DPnHe1Mx.js} +2 -2
  16. package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
  17. package/dist/define-config.cjs +1 -1
  18. package/dist/define-config.d.ts +1 -1
  19. package/dist/define-config.js +1 -1
  20. package/dist/{dist-CKz3vcoG.js → dist-CSQWHI6y.js} +3 -8
  21. package/dist/dist-DT25H9pj.js +3 -0
  22. package/dist/{agent-0gFJkIKu.js → editor-CGWdbLgD.js} +709 -579
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/{json-DiRs8ceZ.js → json-BU88uu6o.js} +2 -6
  27. package/dist/migration/bin.js +60 -50
  28. package/dist/{oxlint-plugin-config-CMSCIkks.js → oxlint-plugin-config-BHOzlwMw.js} +1 -1
  29. package/dist/oxlint-plugin.js +1 -1
  30. package/dist/pack-bin.js +2 -2
  31. package/dist/{package-CP5EUXlu.js → package-hV-77cBb.js} +2 -2
  32. package/dist/{tsconfig-Cac-NNdT.js → prompts-DYap08te.js} +32 -174
  33. package/dist/{resolve-vite-config-BY7PB-LW.js → resolve-vite-config-EWXclqvV.js} +1 -1
  34. package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
  35. package/dist/staged/bin.js +20 -23
  36. package/dist/{help-YP84FSEz.js → terminal-CrqqK8WT.js} +39 -2
  37. package/dist/tsconfig-CVUKLfL8.js +151 -0
  38. package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-eMZT-oea.js} +4 -2
  39. package/dist/tsgolint-path.js +1 -1
  40. package/dist/version.js +5 -5
  41. package/dist/versions.js +5 -5
  42. package/docs/config/index.md +13 -0
  43. package/docs/config/staged.md +2 -1
  44. package/docs/guide/build.md +1 -1
  45. package/docs/guide/ci.md +28 -3
  46. package/docs/guide/commit-hooks.md +76 -9
  47. package/docs/guide/dev.md +4 -0
  48. package/docs/guide/env.md +8 -4
  49. package/docs/guide/index.md +1 -1
  50. package/docs/guide/install.md +2 -0
  51. package/docs/guide/installer-env-vars.md +3 -3
  52. package/docs/guide/migrate.md +11 -3
  53. package/docs/guide/monorepo.md +94 -6
  54. package/docs/guide/run.md +15 -0
  55. package/docs/guide/test.md +4 -0
  56. package/docs/guide/troubleshooting.md +9 -5
  57. package/package.json +18 -24
  58. package/dist/dist-CtM2JRbM.js +0 -3
  59. package/dist/editor-D4T70tKk.js +0 -675
  60. package/dist/terminal-uTv0ZaMr.js +0 -33
  61. package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
@@ -2137,6 +2137,7 @@ export interface BindingDevtoolsOptions {
2137
2137
  }
2138
2138
 
2139
2139
  export interface BindingDevWatchOptions {
2140
+ enabled?: boolean;
2140
2141
  skipWrite?: boolean;
2141
2142
  usePolling?: boolean;
2142
2143
  pollInterval?: number;
@@ -2332,7 +2333,9 @@ export interface BindingEsmExternalRequirePluginConfig {
2332
2333
  export interface BindingExperimentalDevModeOptions {
2333
2334
  host?: string;
2334
2335
  port?: number;
2335
- implement?: string;
2336
+ implement: string;
2337
+ /** @deprecated Common runtime injection will be disabled by default in the future. */
2338
+ skipCommonRuntimeInjection?: boolean;
2336
2339
  lazy?: boolean;
2337
2340
  }
2338
2341
 
@@ -2388,6 +2391,23 @@ export interface BindingHookJsLoadOutput {
2388
2391
 
2389
2392
  export interface BindingHookJsResolveIdOptions {
2390
2393
  isEntry?: boolean;
2394
+ /**
2395
+ * - `import-statement`: `import { foo } from './lib.js';`
2396
+ * - `dynamic-import`: `import('./lib.js')`
2397
+ * - `require-call`: `require('./lib.js')`
2398
+ * - `import-rule`: `@import 'bg-color.css'`
2399
+ * - `url-token`: `url('./icon.png')`
2400
+ * - `new-url`: `new URL('./worker.js', import.meta.url)`
2401
+ * - `hot-accept`: `import.meta.hot.accept('./lib.js', () => {})`
2402
+ */
2403
+ kind?:
2404
+ | 'import-statement'
2405
+ | 'dynamic-import'
2406
+ | 'require-call'
2407
+ | 'import-rule'
2408
+ | 'url-token'
2409
+ | 'new-url'
2410
+ | 'hot-accept';
2391
2411
  scan?: boolean;
2392
2412
  custom?: BindingVitePluginCustom;
2393
2413
  }
@@ -2414,6 +2434,24 @@ export interface BindingHookRenderChunkOutput {
2414
2434
  map?: BindingSourcemap | null;
2415
2435
  }
2416
2436
 
2437
+ export interface BindingHookResolveFileUrlArgs {
2438
+ /** Preliminary filename of the chunk containing the reference. */
2439
+ chunkId: string;
2440
+ /** Filename of the emitted file, relative to the output directory. */
2441
+ fileName: string;
2442
+ format: 'es' | 'cjs' | 'iife' | 'umd';
2443
+ /** Id of the module containing the `import.meta.ROLLDOWN_FILE_URL_*` reference. */
2444
+ moduleId: string;
2445
+ referenceId: string;
2446
+ /** Path from the chunk to the emitted file. */
2447
+ relativePath: string;
2448
+ /**
2449
+ * The `<urlId>` of `import.meta.ROLLDOWN_FILE_URL_<referenceId>_<urlId>`, if present.
2450
+ * Only the rolldown-specific form carries it; the `ROLLUP_FILE_URL_` alias never does.
2451
+ */
2452
+ urlId?: string;
2453
+ }
2454
+
2417
2455
  export interface BindingHookResolveIdExtraArgs {
2418
2456
  custom?: number;
2419
2457
  isEntry: boolean;
@@ -2461,6 +2499,14 @@ export interface BindingHookTransformOutput {
2461
2499
  moduleType?: string;
2462
2500
  }
2463
2501
 
2502
+ export interface BindingHotUpdateArgs {
2503
+ kind: 'create' | 'update' | 'delete';
2504
+ /** Normalized absolute path of the changed file. */
2505
+ file: string;
2506
+ /** The affected module ids as currently computed (raw module ids). */
2507
+ modules: Array<string>;
2508
+ }
2509
+
2464
2510
  export interface BindingIndentOptions {
2465
2511
  exclude?: Array<Array<number>> | Array<number>;
2466
2512
  }
@@ -2514,6 +2560,8 @@ export interface BindingInputOptions {
2514
2560
  keepNames?: boolean;
2515
2561
  checks?: BindingChecksOptions;
2516
2562
  deferSyncScanData?: undefined | (() => BindingDeferSyncScanData[]);
2563
+ /** Asked for while the build is closing, so what it returns includes `closeBundle`. */
2564
+ pluginTimings?: undefined | (() => BindingPluginTimingsMeasurement);
2517
2565
  makeAbsoluteExternalsRelative?: BindingMakeAbsoluteExternalsRelative;
2518
2566
  devtools?: BindingDevtoolsOptions;
2519
2567
  invalidateJsSideCache?: () => void;
@@ -2549,6 +2597,13 @@ export interface BindingJsWatchChangeEvent {
2549
2597
  export interface BindingLazyChunkOutput {
2550
2598
  code: string;
2551
2599
  filename: string;
2600
+ /**
2601
+ * The chunk's sourcemap, when `sourcemap` is `File` or `Hidden`. Serve it
2602
+ * under `sourcemapFilename`, which is what the chunk's `sourceMappingURL`
2603
+ * refers to.
2604
+ */
2605
+ sourcemap?: string;
2606
+ sourcemapFilename?: string;
2552
2607
  }
2553
2608
 
2554
2609
  export interface BindingLog {
@@ -2691,6 +2746,8 @@ export interface BindingOutputs {
2691
2746
 
2692
2747
  export interface BindingOverwriteOptions {
2693
2748
  contentOnly?: boolean;
2749
+ /** Stores the replaced content in the generated sourcemap's `names` field. */
2750
+ storeName?: boolean;
2694
2751
  }
2695
2752
 
2696
2753
  export interface BindingPluginContextResolvedId {
@@ -2785,6 +2842,11 @@ export interface BindingPluginOptions {
2785
2842
  chunk: BindingRenderedChunk,
2786
2843
  ) => MaybePromise<void | string>;
2787
2844
  augmentChunkHashMeta?: BindingPluginHookMeta;
2845
+ resolveFileUrl?: (
2846
+ ctx: BindingPluginContext,
2847
+ args: BindingHookResolveFileUrlArgs,
2848
+ ) => MaybePromise<void | string | null>;
2849
+ resolveFileUrlMeta?: BindingPluginHookMeta;
2788
2850
  renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void;
2789
2851
  renderStartMeta?: BindingPluginHookMeta;
2790
2852
  renderError?: (ctx: BindingPluginContext, error: BindingError[]) => void;
@@ -2810,6 +2872,11 @@ export interface BindingPluginOptions {
2810
2872
  event: string,
2811
2873
  ) => MaybePromise<VoidNullable>;
2812
2874
  watchChangeMeta?: BindingPluginHookMeta;
2875
+ hotUpdate?: (
2876
+ ctx: BindingPluginContext,
2877
+ args: BindingHotUpdateArgs,
2878
+ ) => MaybePromise<VoidNullable<Array<string>>>;
2879
+ hotUpdateMeta?: BindingPluginHookMeta;
2813
2880
  closeWatcher?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>;
2814
2881
  closeWatcherMeta?: BindingPluginHookMeta;
2815
2882
  banner?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void;
@@ -2827,6 +2894,33 @@ export declare const enum BindingPluginOrder {
2827
2894
  Post = 1,
2828
2895
  }
2829
2896
 
2897
+ /**
2898
+ * What one callback cost, measured inside it on the JavaScript side — the one place the
2899
+ * measurement exists, since this side can only bracket dispatch and completion.
2900
+ */
2901
+ export interface BindingPluginTiming {
2902
+ /** The plugin the callback belongs to, or the options it was configured on. */
2903
+ owner: string;
2904
+ kind: 'plugin' | 'outputOption' | 'inputOption';
2905
+ hook: string;
2906
+ calls: number;
2907
+ ms: number;
2908
+ maxInFlight: number;
2909
+ /** How much of `ms` is double counted because calls overlapped. */
2910
+ overlapMs: number;
2911
+ /**
2912
+ * Whether `ms` may be compared against another row's — false once two calls of this hook
2913
+ * overlapped, because then their spans cover work each other was doing.
2914
+ */
2915
+ rankable: boolean;
2916
+ }
2917
+
2918
+ export interface BindingPluginTimingsMeasurement {
2919
+ /** Wall time in which any measured callback was running, counting overlap once. */
2920
+ busyMs: number;
2921
+ rows: Array<BindingPluginTiming>;
2922
+ }
2923
+
2830
2924
  export interface BindingPluginWithIndex {
2831
2925
  index: number;
2832
2926
  plugin: BindingPluginOptions;
@@ -2982,6 +3076,8 @@ export interface BindingTsconfigResult {
2982
3076
 
2983
3077
  export interface BindingUpdateOptions {
2984
3078
  overwrite?: boolean;
3079
+ /** Stores the replaced content in the generated sourcemap's `names` field. */
3080
+ storeName?: boolean;
2985
3081
  }
2986
3082
 
2987
3083
  export interface BindingViteAliasPluginAlias {
@@ -3241,19 +3337,14 @@ export declare function resolveTsconfig(
3241
3337
  ): BindingTsconfigResult | null;
3242
3338
 
3243
3339
  /**
3244
- * Shutdown the tokio runtime manually.
3340
+ * Release one holder of the tokio runtime, shutting it down once none are left.
3245
3341
  *
3246
3342
  * This is required for the wasm target with `tokio_unstable` cfg.
3247
3343
  * In the wasm runtime, the `park` threads will hang there until the tokio::Runtime is shutdown.
3248
3344
  */
3249
3345
  export declare function shutdownAsyncRuntime(): void;
3250
3346
 
3251
- /**
3252
- * Start the async runtime manually.
3253
- *
3254
- * This is required when the async runtime is shutdown manually.
3255
- * Usually it's used in test.
3256
- */
3347
+ /** Acquire one holder of the tokio runtime, starting it if it is not running. */
3257
3348
  export declare function startAsyncRuntime(): void;
3258
3349
 
3259
3350
  export interface ViteImportGlobMeta {