vite-plus 0.1.23 → 0.2.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.
- package/LICENSE +30 -0
- package/README.md +8 -6
- package/bin/oxfmt +5 -2
- package/bin/oxlint +12 -2
- package/binding/index.cjs +84 -67
- package/binding/index.d.cts +155 -4
- package/dist/{agent-aSGY0osq.js → agent-BD31CsvU.js} +969 -89
- package/dist/bin.js +29 -33
- package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
- package/dist/config/bin.js +30 -14
- package/dist/constants-CrfJQIUX.js +66 -0
- package/dist/create/bin.d.ts +7 -1
- package/dist/create/bin.js +578 -266
- package/dist/define-config-2tfJoXr1.d.ts +305 -0
- package/dist/define-config-BGSjF6Xp.cjs +488 -0
- package/dist/define-config-DJUehepE.js +445 -0
- package/dist/define-config.cjs +8 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +2 -2
- package/dist/dist-DRJUd9bL.js +3 -0
- package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
- package/dist/index.cjs +9 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
- package/dist/migration/bin.js +301 -84
- package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
- package/dist/oxlint-plugin.js +11 -3
- package/dist/pack-bin.js +44 -15
- package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
- package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
- package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
- package/dist/staged/bin.js +150 -417
- package/dist/test/_at-vitest-browser/context.d.ts +2 -0
- package/dist/test/_at-vitest-browser.d.ts +2 -0
- package/dist/test/browser/context.d.ts +2 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.d.ts +1 -0
- package/dist/test/browser/providers/playwright/context.js +1 -0
- package/dist/test/browser/providers/playwright.d.ts +124 -2
- package/dist/test/browser/providers/playwright.js +1 -1
- package/dist/test/browser/providers/preview/context.d.ts +1 -0
- package/dist/test/browser/providers/preview/context.js +1 -0
- package/dist/test/browser/providers/preview.d.ts +32 -2
- package/dist/test/browser/providers/preview.js +1 -1
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
- package/dist/test/browser/providers/webdriverio/context.js +1 -0
- package/dist/test/browser/providers/webdriverio.d.ts +77 -2
- package/dist/test/browser/providers/webdriverio.js +1 -1
- package/dist/test/browser-compat.d.ts +2 -0
- package/dist/test/browser-compat.js +1 -1
- package/dist/test/browser-playwright/context.d.ts +1 -0
- package/dist/test/browser-playwright/context.js +1 -0
- package/dist/test/browser-playwright.d.ts +124 -2
- package/dist/test/browser-playwright.js +1 -1
- package/dist/test/browser-preview/context.d.ts +1 -0
- package/dist/test/browser-preview/context.js +1 -0
- package/dist/test/browser-preview.d.ts +32 -2
- package/dist/test/browser-preview.js +1 -1
- package/dist/test/browser-webdriverio/context.d.ts +1 -0
- package/dist/test/browser-webdriverio/context.js +1 -0
- package/dist/test/browser-webdriverio.d.ts +77 -2
- package/dist/test/browser-webdriverio.js +1 -1
- package/dist/test/browser.d.ts +2 -2
- package/dist/test/browser.js +1 -1
- package/dist/test/client.js +1 -1
- package/dist/test/config.cjs +1 -1
- package/dist/test/config.d.ts +2 -2
- package/dist/test/config.js +1 -1
- package/dist/test/context.d.ts +942 -2
- package/dist/test/context.js +1 -1
- package/dist/test/coverage.d.ts +2 -2
- package/dist/test/coverage.js +1 -1
- package/dist/test/environments.d.ts +2 -2
- package/dist/test/environments.js +1 -1
- package/dist/test/globals.d.ts +2 -2
- package/dist/test/import-meta.d.ts +2 -2
- package/dist/test/importMeta.d.ts +2 -2
- package/dist/test/index.cjs +1 -1
- package/dist/test/index.d.cts +2 -2
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +1 -1
- package/dist/test/internal/browser.d.ts +2 -2
- package/dist/test/internal/browser.js +1 -1
- package/dist/test/jsdom.d.ts +2 -2
- package/dist/test/locators.d.ts +294 -0
- package/dist/test/locators.js +1 -1
- package/dist/test/matchers.d.ts +29 -0
- package/dist/test/matchers.js +1 -1
- package/dist/test/node.d.ts +2 -2
- package/dist/test/node.js +1 -1
- package/dist/test/optional-runtime-types.js.d.ts +2 -2
- package/dist/test/optional-types.js.d.ts +2 -2
- package/dist/test/plugins/browser-client.js +1 -1
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.js +1 -1
- package/dist/test/plugins/browser-playwright.js +1 -1
- package/dist/test/plugins/browser-preview.js +1 -1
- package/dist/test/plugins/browser-webdriverio.js +1 -1
- package/dist/test/plugins/browser.js +1 -1
- package/dist/test/plugins/expect.js +1 -1
- package/dist/test/plugins/mocker-automock.js +1 -1
- package/dist/test/plugins/mocker-browser.js +1 -1
- package/dist/test/plugins/mocker-node.js +1 -1
- package/dist/test/plugins/mocker-redirect.js +1 -1
- package/dist/test/plugins/mocker-register.js +1 -1
- package/dist/test/plugins/mocker-transforms.js +1 -1
- package/dist/test/plugins/mocker.js +1 -1
- package/dist/test/plugins/pretty-format.js +1 -1
- package/dist/test/plugins/runner-types.js +1 -1
- package/dist/test/plugins/runner-utils.js +1 -1
- package/dist/test/plugins/runner.js +1 -1
- package/dist/test/plugins/snapshot-environment.js +1 -1
- package/dist/test/plugins/snapshot-manager.js +1 -1
- package/dist/test/plugins/snapshot.js +1 -1
- package/dist/test/plugins/spy.js +1 -1
- package/dist/test/plugins/utils-constants.js +1 -1
- package/dist/test/plugins/utils-diff.js +1 -1
- package/dist/test/plugins/utils-display.js +1 -1
- package/dist/test/plugins/utils-error.js +1 -1
- package/dist/test/plugins/utils-helpers.js +1 -1
- package/dist/test/plugins/utils-offset.js +1 -1
- package/dist/test/plugins/utils-resolver.js +1 -1
- package/dist/test/plugins/utils-serialize.js +1 -1
- package/dist/test/plugins/utils-source-map-node.js +1 -1
- package/dist/test/plugins/utils-source-map.js +1 -1
- package/dist/test/plugins/utils-timers.js +1 -1
- package/dist/test/plugins/utils.js +1 -1
- package/dist/test/reporters.d.ts +2 -2
- package/dist/test/reporters.js +1 -1
- package/dist/test/runners.d.ts +2 -2
- package/dist/test/runners.js +1 -1
- package/dist/test/runtime.d.ts +2 -2
- package/dist/test/runtime.js +1 -1
- package/dist/test/snapshot.d.ts +2 -2
- package/dist/test/snapshot.js +1 -1
- package/dist/test/suite.d.ts +2 -2
- package/dist/test/suite.js +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/worker.d.ts +2 -2
- package/dist/test/worker.js +1 -1
- package/dist/{tsconfig-DlUVXT3J.js → tsconfig-CJ_StdFc.js} +605 -263
- package/dist/tsgolint-path-B-yOos8p.js +32 -0
- package/dist/tsgolint-path.d.ts +8 -0
- package/dist/tsgolint-path.js +2 -0
- package/dist/version.js +3 -3
- package/dist/versions.d.ts +1 -1
- package/dist/versions.js +7 -7
- package/dist/{workspace-DElv730L.js → workspace-Cjoc1c_A.js} +20 -18
- package/docs/_data/team.ts +5 -4
- package/docs/config/create.md +36 -1
- package/docs/config/index.md +7 -5
- package/docs/guide/commit-hooks.md +9 -0
- package/docs/guide/create.md +106 -2
- package/docs/guide/env.md +33 -5
- package/docs/guide/index.md +9 -3
- package/docs/guide/install.md +46 -10
- package/docs/guide/migrate.md +13 -3
- package/docs/guide/troubleshooting.md +3 -29
- package/docs/guide/upgrade.md +36 -6
- package/docs/package.json +3 -3
- package/docs/pnpm-lock.yaml +298 -395
- package/package.json +104 -56
- package/templates/generator/bin/index.ts +6 -3
- package/templates/generator/package.json +2 -3
- package/templates/generator/src/template.ts +0 -2
- package/templates/monorepo/package.json +1 -1
- package/dist/constants-DCBWlNrn.js +0 -33
- package/dist/define-config-BR1Y88zz.cjs +0 -84
- package/dist/define-config-BRC7qPNE.js +0 -21
- package/dist/define-config-COdn-tsn.d.ts +0 -177
- package/dist/dist-Bapm49IR.js +0 -3
- package/dist/test/plugins/utils-highlight.js +0 -1
- /package/dist/{chunk-DnnnRqeS.js → rolldown-runtime-DnnnRqeS.js} +0 -0
package/binding/index.d.cts
CHANGED
|
@@ -41,7 +41,7 @@ export interface CompressOptions {
|
|
|
41
41
|
*
|
|
42
42
|
* @default 'esnext'
|
|
43
43
|
*
|
|
44
|
-
* @see [
|
|
44
|
+
* @see [oxc#target](https://oxc.rs/docs/guide/usage/transformer/lowering#target)
|
|
45
45
|
*/
|
|
46
46
|
target?: string | Array<string>;
|
|
47
47
|
/**
|
|
@@ -1184,6 +1184,97 @@ export interface PluginsOptions {
|
|
|
1184
1184
|
taggedTemplateEscape?: boolean;
|
|
1185
1185
|
}
|
|
1186
1186
|
|
|
1187
|
+
/** Dynamic gating for {@link ReactCompilerOptions#dynamicGating}. */
|
|
1188
|
+
export interface ReactCompilerDynamicGating {
|
|
1189
|
+
/** Module the gating import comes from. */
|
|
1190
|
+
source: string;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/** Static gating for {@link ReactCompilerOptions#gating}. */
|
|
1194
|
+
export interface ReactCompilerGating {
|
|
1195
|
+
/** Module the gating import comes from. */
|
|
1196
|
+
source: string;
|
|
1197
|
+
/** Imported specifier used as the gate. */
|
|
1198
|
+
importSpecifierName: string;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* Options for the experimental [React Compiler](https://github.com/facebook/react/pull/36173).
|
|
1203
|
+
*
|
|
1204
|
+
* Mirrors the compiler's `PluginOptions`. The deep `environment` configuration
|
|
1205
|
+
* (inference / validation flags) is not surfaced here.
|
|
1206
|
+
*
|
|
1207
|
+
* @see {@link TransformOptions#reactCompiler}
|
|
1208
|
+
*/
|
|
1209
|
+
export interface ReactCompilerOptions {
|
|
1210
|
+
/**
|
|
1211
|
+
* Which functions to compile.
|
|
1212
|
+
*
|
|
1213
|
+
* @default 'infer'
|
|
1214
|
+
*/
|
|
1215
|
+
compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all';
|
|
1216
|
+
/**
|
|
1217
|
+
* What to do when a function cannot be compiled.
|
|
1218
|
+
*
|
|
1219
|
+
* @default 'none'
|
|
1220
|
+
*/
|
|
1221
|
+
panicThreshold?: 'none' | 'critical_errors' | 'all_errors';
|
|
1222
|
+
/**
|
|
1223
|
+
* React runtime version target. `17` and `18` require the
|
|
1224
|
+
* `react-compiler-runtime` package; `19` ships the runtime in `react`.
|
|
1225
|
+
*
|
|
1226
|
+
* @default '19'
|
|
1227
|
+
*/
|
|
1228
|
+
target?: '17' | '18' | '19';
|
|
1229
|
+
/**
|
|
1230
|
+
* Analyze and report diagnostics only; emit no transformed code.
|
|
1231
|
+
*
|
|
1232
|
+
* @default false
|
|
1233
|
+
*/
|
|
1234
|
+
noEmit?: boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* Compiler output mode.
|
|
1237
|
+
*
|
|
1238
|
+
* @default undefined
|
|
1239
|
+
*/
|
|
1240
|
+
outputMode?: 'client' | 'ssr' | 'lint';
|
|
1241
|
+
/**
|
|
1242
|
+
* Compile even functions marked with the `"use no memo"` / `"use no forget"`
|
|
1243
|
+
* opt-out directives.
|
|
1244
|
+
*
|
|
1245
|
+
* @default false
|
|
1246
|
+
*/
|
|
1247
|
+
ignoreUseNoForget?: boolean;
|
|
1248
|
+
/**
|
|
1249
|
+
* Treat Flow suppression comments as opt-outs.
|
|
1250
|
+
*
|
|
1251
|
+
* @default true
|
|
1252
|
+
*/
|
|
1253
|
+
flowSuppressions?: boolean;
|
|
1254
|
+
/**
|
|
1255
|
+
* Enable `react-native-reanimated` support.
|
|
1256
|
+
*
|
|
1257
|
+
* @default false
|
|
1258
|
+
*/
|
|
1259
|
+
enableReanimated?: boolean;
|
|
1260
|
+
/**
|
|
1261
|
+
* Development mode (extra validation / instrumentation).
|
|
1262
|
+
*
|
|
1263
|
+
* @default false
|
|
1264
|
+
*/
|
|
1265
|
+
isDev?: boolean;
|
|
1266
|
+
/** Source file name, used for the fast-refresh hash and in diagnostics. */
|
|
1267
|
+
filename?: string;
|
|
1268
|
+
/** ESLint rules whose suppressions opt a function out of compilation. */
|
|
1269
|
+
eslintSuppressionRules?: Array<string>;
|
|
1270
|
+
/** Extra directives that opt a function out of compilation. */
|
|
1271
|
+
customOptOutDirectives?: Array<string>;
|
|
1272
|
+
/** Also emit a gated (feature-flagged) version of each compiled function. */
|
|
1273
|
+
gating?: ReactCompilerGating;
|
|
1274
|
+
/** Dynamically-gated compilation. */
|
|
1275
|
+
dynamicGating?: ReactCompilerDynamicGating;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1187
1278
|
export interface ReactRefreshOptions {
|
|
1188
1279
|
/**
|
|
1189
1280
|
* Specify the identifier of the refresh registration variable.
|
|
@@ -1365,6 +1456,14 @@ export interface TransformOptions {
|
|
|
1365
1456
|
inject?: Record<string, string | [string, string]>;
|
|
1366
1457
|
/** Decorator plugin */
|
|
1367
1458
|
decorator?: DecoratorOptions;
|
|
1459
|
+
/**
|
|
1460
|
+
* Enable the experimental [React Compiler](https://github.com/facebook/react/pull/36173).
|
|
1461
|
+
*
|
|
1462
|
+
* `true` enables it with default options; an object enables it with the
|
|
1463
|
+
* given options; `false` or omitted disables it. When enabled, the compiler
|
|
1464
|
+
* runs as the first transform and memoizes React components and hooks.
|
|
1465
|
+
*/
|
|
1466
|
+
reactCompiler?: boolean | ReactCompilerOptions;
|
|
1368
1467
|
/**
|
|
1369
1468
|
* Third-party plugins to use.
|
|
1370
1469
|
* @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins}
|
|
@@ -1599,12 +1698,12 @@ export declare class BindingDevEngine {
|
|
|
1599
1698
|
run(): Promise<void>;
|
|
1600
1699
|
ensureCurrentBuildFinish(): Promise<void>;
|
|
1601
1700
|
getBundleState(): Promise<BindingBundleState>;
|
|
1602
|
-
ensureLatestBuildOutput(): Promise<
|
|
1701
|
+
ensureLatestBuildOutput(): Promise<BindingResult<undefined>>;
|
|
1603
1702
|
triggerFullBuild(): void;
|
|
1604
1703
|
invalidate(
|
|
1605
1704
|
caller: string,
|
|
1606
1705
|
firstInvalidatedBy?: string | undefined | null,
|
|
1607
|
-
): Promise<Array<BindingClientHmrUpdate
|
|
1706
|
+
): Promise<BindingResult<Array<BindingClientHmrUpdate>>>;
|
|
1608
1707
|
registerModules(clientId: string, modules: Array<string>): Promise<void>;
|
|
1609
1708
|
removeClient(clientId: string): Promise<void>;
|
|
1610
1709
|
close(): Promise<void>;
|
|
@@ -2023,6 +2122,7 @@ export interface BindingChecksOptions {
|
|
|
2023
2122
|
unsupportedTsconfigOption?: boolean;
|
|
2024
2123
|
ineffectiveDynamicImport?: boolean;
|
|
2025
2124
|
largeBarrelModules?: boolean;
|
|
2125
|
+
sourcemapBroken?: boolean;
|
|
2026
2126
|
}
|
|
2027
2127
|
|
|
2028
2128
|
export interface BindingChunkImportMap {
|
|
@@ -2352,7 +2452,11 @@ export interface BindingHookLoadOutput {
|
|
|
2352
2452
|
|
|
2353
2453
|
export interface BindingHookRenderChunkOutput {
|
|
2354
2454
|
code: string;
|
|
2355
|
-
|
|
2455
|
+
/**
|
|
2456
|
+
* A sourcemap, or `null` to explicitly signal "no sourcemap" (distinct from
|
|
2457
|
+
* omitting the field, which mirrors Rollup's "possibly broken" semantics).
|
|
2458
|
+
*/
|
|
2459
|
+
map?: BindingSourcemap | null;
|
|
2356
2460
|
}
|
|
2357
2461
|
|
|
2358
2462
|
export interface BindingHookResolveIdExtraArgs {
|
|
@@ -2543,6 +2647,7 @@ export interface BindingMatchGroup {
|
|
|
2543
2647
|
entriesAware?: boolean;
|
|
2544
2648
|
entriesAwareMergeThreshold?: number;
|
|
2545
2649
|
tags?: Array<string>;
|
|
2650
|
+
includeDependenciesRecursively?: boolean;
|
|
2546
2651
|
}
|
|
2547
2652
|
|
|
2548
2653
|
export interface BindingModulePreloadOptions {
|
|
@@ -3607,5 +3712,51 @@ export interface RunCommandResult {
|
|
|
3607
3712
|
*/
|
|
3608
3713
|
export declare function shouldPrintVitePlusHeader(): boolean;
|
|
3609
3714
|
|
|
3715
|
+
/**
|
|
3716
|
+
* Set the value of a top-level config key in a vite config file (upsert)
|
|
3717
|
+
*
|
|
3718
|
+
* Unlike `mergeJsonConfig`, which prepends a new key (and duplicates it when
|
|
3719
|
+
* the key already exists), this targets only direct config objects
|
|
3720
|
+
* (`defineConfig({...})`, `export default {...}`, direct callback returns):
|
|
3721
|
+
* it replaces the value of an existing `config_key` (pair or shorthand
|
|
3722
|
+
* property) or inserts the key when absent. Unrecognized shapes (e.g.
|
|
3723
|
+
* `module.exports`, `return someVar`) report `updated: false` instead of
|
|
3724
|
+
* being corrupted. The splice is raw, the JS caller is expected to reformat
|
|
3725
|
+
* afterwards.
|
|
3726
|
+
*
|
|
3727
|
+
* # Arguments
|
|
3728
|
+
*
|
|
3729
|
+
* * `vite_config_path` - Path to the vite.config.ts or vite.config.js file
|
|
3730
|
+
* * `json_config_path` - Path to the JSON config file whose contents become the new value
|
|
3731
|
+
* * `config_key` - The top-level key whose value should be set
|
|
3732
|
+
*
|
|
3733
|
+
* # Returns
|
|
3734
|
+
*
|
|
3735
|
+
* Returns a `MergeJsonConfigResult`. `updated` is `true` only when at least
|
|
3736
|
+
* one direct config object was updated; otherwise the original content is
|
|
3737
|
+
* returned unchanged.
|
|
3738
|
+
*
|
|
3739
|
+
* # Example
|
|
3740
|
+
*
|
|
3741
|
+
* ```javascript
|
|
3742
|
+
* const result = upsertJsonConfig('vite.config.ts', 'create.json', 'create');
|
|
3743
|
+
* if (result.updated) {
|
|
3744
|
+
* fs.writeFileSync('vite.config.ts', result.content);
|
|
3745
|
+
* }
|
|
3746
|
+
* ```
|
|
3747
|
+
*/
|
|
3748
|
+
export declare function upsertJsonConfig(
|
|
3749
|
+
viteConfigPath: string,
|
|
3750
|
+
jsonConfigPath: string,
|
|
3751
|
+
configKey: string,
|
|
3752
|
+
): MergeJsonConfigResult;
|
|
3753
|
+
|
|
3610
3754
|
/** Render the Vite+ header using the Rust implementation. */
|
|
3611
3755
|
export declare function vitePlusHeader(): string;
|
|
3756
|
+
|
|
3757
|
+
/**
|
|
3758
|
+
* Wrap safe inline `plugins: [...]` arrays in recognized Vite config objects
|
|
3759
|
+
* with `lazyPlugins(() => [...])` and add a `lazyPlugins` import from
|
|
3760
|
+
* `vite-plus` when needed.
|
|
3761
|
+
*/
|
|
3762
|
+
export declare function wrapLazyPlugins(viteConfigPath: string): MergeJsonConfigResult;
|