vite-plus 0.1.2 → 0.1.4

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 (41) hide show
  1. package/binding/index.cjs +2 -0
  2. package/binding/index.d.cts +32 -0
  3. package/dist/global/{prompts-CAIahN1u.js → agent-CpNB3GIY.js} +475 -1350
  4. package/dist/global/{browser-CY4NBwxR.js → browser-CBapUTD0.js} +579 -1023
  5. package/dist/global/{browser-DFpJ6sKb.js → browser-EZnNDcaO.js} +2 -3
  6. package/dist/global/{chunk-CtfvYSle.js → chunk-CgnkrU7a.js} +13 -22
  7. package/dist/global/{cli-truncate-BxinOqz5.js → cli-truncate-Da6Y8aM8.js} +25 -74
  8. package/dist/global/config.js +86 -166
  9. package/dist/global/create.js +626 -615
  10. package/dist/global/{terminal-Cb-NuRkb.js → help-BAGHa8fD.js} +22 -54
  11. package/dist/global/{json-Bfvtp2rL.js → json-BRdVJ52a.js} +24 -58
  12. package/dist/global/{lib-CibYHP32.js → lib-DxappLRQ.js} +19 -43
  13. package/dist/global/{log-update-DdU6_LCN.js → log-update-C8WCYCbc.js} +102 -281
  14. package/dist/global/mcp.js +97 -169
  15. package/dist/global/migrate.js +330 -86
  16. package/dist/global/{package-Pq2biU7_.js → package-YAMvX5PJ.js} +6 -13
  17. package/dist/global/{slice-ansi-BhwAwMdF.js → slice-ansi-Fap0ehe9.js} +21 -52
  18. package/dist/global/{src-C6aLHRsS.js → src-DwSJ0s0I.js} +28 -110
  19. package/dist/global/staged.js +1353 -2112
  20. package/dist/global/{strip-ansi-BL-dgd7n.js → strip-ansi-CE-VDMdw.js} +20 -67
  21. package/dist/global/version.js +16 -37
  22. package/dist/global/{workspace-MTwAF3M9.js → workspace-CiqQdO1L.js} +1711 -2834
  23. package/dist/global/wrap-ansi-Ou9oAs-a.js +3 -0
  24. package/dist/global/{wrap-ansi-Iww6Ak1s.js → wrap-ansi-eywLlPVQ.js} +29 -80
  25. package/dist/index.d.ts +1 -1
  26. package/dist/init-config.js +10 -2
  27. package/dist/utils/agent.d.ts +15 -1
  28. package/dist/utils/agent.js +104 -20
  29. package/dist/utils/constants.d.ts +1 -0
  30. package/dist/utils/constants.js +2 -0
  31. package/dist/utils/editor.d.ts +16 -3
  32. package/dist/utils/editor.js +55 -17
  33. package/dist/utils/prompts.d.ts +33 -4
  34. package/dist/utils/prompts.js +34 -10
  35. package/dist/utils/tsconfig.d.ts +6 -0
  36. package/dist/utils/tsconfig.js +16 -0
  37. package/package.json +14 -14
  38. package/templates/monorepo/package.json +1 -1
  39. package/dist/global/wrap-ansi-BJxjUEQR.js +0 -4
  40. package/dist/oxlint-config.d.ts +0 -498
  41. package/dist/oxlint-config.js +0 -309
@@ -1,498 +0,0 @@
1
- /**
2
- * Oxlint Configuration File
3
- *
4
- * This configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).
5
- *
6
- * Usage: `oxlint -c oxlintrc.json --import-plugin`
7
- *
8
- * ::: danger NOTE
9
- *
10
- * Only the `.json` format is supported. You can use comments in configuration files.
11
- *
12
- * :::
13
- *
14
- * Example
15
- *
16
- * `.oxlintrc.json`
17
- *
18
- * ```json
19
- * {
20
- * "$schema": "./node_modules/oxlint/configuration_schema.json",
21
- * "plugins": ["import", "typescript", "unicorn"],
22
- * "env": {
23
- * "browser": true
24
- * },
25
- * "globals": {
26
- * "foo": "readonly"
27
- * },
28
- * "settings": {
29
- * },
30
- * "rules": {
31
- * "eqeqeq": "warn",
32
- * "import/no-cycle": "error",
33
- * "react/self-closing-comp": ["error", { "html": false }]
34
- * },
35
- * "overrides": [
36
- * {
37
- * "files": ["*.test.ts", "*.spec.ts"],
38
- * "rules": {
39
- * "@typescript-eslint/no-explicit-any": "off"
40
- * }
41
- * }
42
- * ]
43
- * }
44
- * ```
45
- */
46
- export interface OxlintConfig {
47
- /**
48
- * Schema URI for editor tooling.
49
- */
50
- $schema?: null | string;
51
- categories?: RuleCategories;
52
- /**
53
- * Environments enable and disable collections of global variables.
54
- */
55
- env?: {
56
- [key: string]: boolean;
57
- };
58
- /**
59
- * Paths of configuration files that this configuration file extends (inherits from). The
60
- * files
61
- * are resolved relative to the location of the configuration file that contains the
62
- * `extends`
63
- * property. The configuration files are merged from the first to the last, with the last
64
- * file
65
- * overriding the previous ones.
66
- */
67
- extends?: string[];
68
- /**
69
- * Enabled or disabled specific global variables.
70
- */
71
- globals?: {
72
- [key: string]: GlobalValue;
73
- };
74
- /**
75
- * Globs to ignore during linting. These are resolved from the configuration file path.
76
- */
77
- ignorePatterns?: string[];
78
- /**
79
- * JS plugins, allows usage of ESLint plugins with Oxlint.
80
- *
81
- * Read more about JS plugins in
82
- * [the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).
83
- *
84
- * Note: JS plugins are experimental and not subject to semver.
85
- * They are not supported in the language server (and thus editor integrations) at present.
86
- */
87
- jsPlugins?: Array<ExternalPluginEntryClass | string> | null;
88
- /**
89
- * Add, remove, or otherwise reconfigure rules for specific files or groups of files.
90
- */
91
- overrides?: OxlintOverride[];
92
- /**
93
- * Enabled built-in plugins for Oxlint.
94
- * You can view the list of available plugins on
95
- * [the website](https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins).
96
- *
97
- * NOTE: Setting the `plugins` field will overwrite the base set of plugins.
98
- * The `plugins` array should reflect all of the plugins you want to use.
99
- */
100
- plugins?: LintPluginOptionsSchema[] | null;
101
- /**
102
- * Example
103
- *
104
- * `.oxlintrc.json`
105
- *
106
- * ```json
107
- * {
108
- * "$schema": "./node_modules/oxlint/configuration_schema.json",
109
- * "rules": {
110
- * "eqeqeq": "warn",
111
- * "import/no-cycle": "error",
112
- * "prefer-const": ["error", { "ignoreReadBeforeAssign": true }]
113
- * }
114
- * }
115
- * ```
116
- *
117
- * See [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html) for the list of
118
- * rules.
119
- */
120
- rules?: {
121
- [key: string]: any[] | AllowWarnDenyEnum | number;
122
- };
123
- settings?: OxlintPluginSettings;
124
- }
125
- /**
126
- * Configure an entire category of rules all at once.
127
- *
128
- * Rules enabled or disabled this way will be overwritten by individual rules in the `rules`
129
- * field.
130
- *
131
- * Example
132
- * ```json
133
- * {
134
- * "$schema": "./node_modules/oxlint/configuration_schema.json",
135
- * "categories": {
136
- * "correctness": "warn"
137
- * },
138
- * "rules": {
139
- * "eslint/no-unused-vars": "error"
140
- * }
141
- * }
142
- * ```
143
- */
144
- export interface RuleCategories {
145
- correctness?: AllowWarnDenyEnum | number;
146
- nursery?: AllowWarnDenyEnum | number;
147
- pedantic?: AllowWarnDenyEnum | number;
148
- perf?: AllowWarnDenyEnum | number;
149
- restriction?: AllowWarnDenyEnum | number;
150
- style?: AllowWarnDenyEnum | number;
151
- suspicious?: AllowWarnDenyEnum | number;
152
- }
153
- /**
154
- * Oxlint rule.
155
- * - "allow" or "off": Turn off the rule.
156
- * - "warn": Turn the rule on as a warning (doesn't affect exit code).
157
- * - "error" or "deny": Turn the rule on as an error (will exit with a failure code).
158
- */
159
- export type AllowWarnDenyEnum = 'allow' | 'off' | 'warn' | 'error' | 'deny';
160
- export type GlobalValue = 'readonly' | 'writable' | 'off';
161
- /**
162
- * Plugin with custom name/alias
163
- */
164
- export interface ExternalPluginEntryClass {
165
- /**
166
- * Custom name/alias for the plugin.
167
- *
168
- * Note: The following plugin names are reserved because they are implemented natively in
169
- * Rust within oxlint and cannot be used for JS plugins:
170
- * - react (includes react-hooks)
171
- * - unicorn
172
- * - typescript (includes @typescript-eslint)
173
- * - oxc
174
- * - import (includes import-x)
175
- * - jsdoc
176
- * - jest
177
- * - vitest
178
- * - jsx-a11y
179
- * - nextjs
180
- * - react-perf
181
- * - promise
182
- * - node
183
- * - vue
184
- * - eslint
185
- *
186
- * If you need to use the JavaScript version of any of these plugins, provide a custom alias
187
- * to avoid conflicts.
188
- */
189
- name: string;
190
- /**
191
- * Path or package name of the plugin
192
- */
193
- specifier: string;
194
- }
195
- export interface OxlintOverride {
196
- /**
197
- * Environments enable and disable collections of global variables.
198
- */
199
- env?: {
200
- [key: string]: boolean;
201
- } | null;
202
- /**
203
- * A list of glob patterns to override.
204
- *
205
- * ## Example
206
- * `[ "*.test.ts", "*.spec.ts" ]`
207
- */
208
- files: string[];
209
- /**
210
- * Enabled or disabled specific global variables.
211
- */
212
- globals?: {
213
- [key: string]: GlobalValue;
214
- } | null;
215
- /**
216
- * JS plugins for this override, allows usage of ESLint plugins with Oxlint.
217
- *
218
- * Read more about JS plugins in
219
- * [the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).
220
- *
221
- * Note: JS plugins are experimental and not subject to semver.
222
- * They are not supported in the language server (and thus editor integrations) at present.
223
- */
224
- jsPlugins?: Array<ExternalPluginEntryClass | string> | null;
225
- /**
226
- * Optionally change what plugins are enabled for this override. When
227
- * omitted, the base config's plugins are used.
228
- */
229
- plugins?: LintPluginOptionsSchema[] | null;
230
- rules?: {
231
- [key: string]: any[] | AllowWarnDenyEnum | number;
232
- };
233
- }
234
- export type LintPluginOptionsSchema = 'eslint' | 'react' | 'unicorn' | 'typescript' | 'oxc' | 'import' | 'jsdoc' | 'jest' | 'vitest' | 'jsx-a11y' | 'nextjs' | 'react-perf' | 'promise' | 'node' | 'vue';
235
- /**
236
- * Configure the behavior of linter plugins.
237
- *
238
- * Here's an example if you're using Next.js in a monorepo:
239
- *
240
- * ```json
241
- * {
242
- * "settings": {
243
- * "next": {
244
- * "rootDir": "apps/dashboard/"
245
- * },
246
- * "react": {
247
- * "linkComponents": [
248
- * { "name": "Link", "linkAttribute": "to" }
249
- * ]
250
- * },
251
- * "jsx-a11y": {
252
- * "components": {
253
- * "Link": "a",
254
- * "Button": "button"
255
- * }
256
- * }
257
- * }
258
- * }
259
- * ```
260
- */
261
- export interface OxlintPluginSettings {
262
- jsdoc?: JSDocPluginSettings;
263
- 'jsx-a11y'?: JSXA11YPluginSettings;
264
- next?: NextPluginSettings;
265
- react?: ReactPluginSettings;
266
- vitest?: VitestPluginSettings;
267
- [property: string]: any;
268
- }
269
- export interface JSDocPluginSettings {
270
- /**
271
- * Only for `require-(yields|returns|description|example|param|throws)` rule
272
- */
273
- augmentsExtendsReplacesDocs?: boolean;
274
- /**
275
- * Only for `require-param-type` and `require-param-description` rule
276
- */
277
- exemptDestructuredRootsFromChecks?: boolean;
278
- /**
279
- * For all rules but NOT apply to `empty-tags` rule
280
- */
281
- ignoreInternal?: boolean;
282
- /**
283
- * For all rules but NOT apply to `check-access` and `empty-tags` rule
284
- */
285
- ignorePrivate?: boolean;
286
- /**
287
- * Only for `require-(yields|returns|description|example|param|throws)` rule
288
- */
289
- ignoreReplacesDocs?: boolean;
290
- /**
291
- * Only for `require-(yields|returns|description|example|param|throws)` rule
292
- */
293
- implementsReplacesDocs?: boolean;
294
- /**
295
- * Only for `require-(yields|returns|description|example|param|throws)` rule
296
- */
297
- overrideReplacesDocs?: boolean;
298
- tagNamePreference?: {
299
- [key: string]: boolean | TagNamePreferenceObject | string;
300
- };
301
- [property: string]: any;
302
- }
303
- export interface TagNamePreferenceObject {
304
- message: string;
305
- replacement?: string;
306
- [property: string]: any;
307
- }
308
- /**
309
- * Configure JSX A11y plugin rules.
310
- *
311
- * See
312
- *
313
- * [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y#configurations)'s
314
- * configuration for a full reference.
315
- */
316
- export interface JSXA11YPluginSettings {
317
- /**
318
- * Map of attribute names to their DOM equivalents.
319
- * This is useful for non-React frameworks that use different attribute names.
320
- *
321
- * Example:
322
- *
323
- * ```json
324
- * {
325
- * "settings": {
326
- * "jsx-a11y": {
327
- * "attributes": {
328
- * "for": ["htmlFor", "for"]
329
- * }
330
- * }
331
- * }
332
- * }
333
- * ```
334
- */
335
- attributes?: {
336
- [key: string]: string[];
337
- };
338
- /**
339
- * To have your custom components be checked as DOM elements, you can
340
- * provide a mapping of your component names to the DOM element name.
341
- *
342
- * Example:
343
- *
344
- * ```json
345
- * {
346
- * "settings": {
347
- * "jsx-a11y": {
348
- * "components": {
349
- * "Link": "a",
350
- * "IconButton": "button"
351
- * }
352
- * }
353
- * }
354
- * }
355
- * ```
356
- */
357
- components?: {
358
- [key: string]: string;
359
- };
360
- /**
361
- * An optional setting that define the prop your code uses to create polymorphic components.
362
- * This setting will be used to determine the element type in rules that
363
- * require semantic context.
364
- *
365
- * For example, if you set the `polymorphicPropName` to `as`, then this element:
366
- *
367
- * ```jsx
368
- * <Box as="h3">Hello</Box>
369
- * ```
370
- *
371
- * Will be treated as an `h3`. If not set, this component will be treated
372
- * as a `Box`.
373
- */
374
- polymorphicPropName?: null | string;
375
- [property: string]: any;
376
- }
377
- /**
378
- * Configure Next.js plugin rules.
379
- */
380
- export interface NextPluginSettings {
381
- /**
382
- * The root directory of the Next.js project.
383
- *
384
- * This is particularly useful when you have a monorepo and your Next.js
385
- * project is in a subfolder.
386
- *
387
- * Example:
388
- *
389
- * ```json
390
- * {
391
- * "settings": {
392
- * "next": {
393
- * "rootDir": "apps/dashboard/"
394
- * }
395
- * }
396
- * }
397
- * ```
398
- */
399
- rootDir?: string[] | string;
400
- [property: string]: any;
401
- }
402
- /**
403
- * Configure React plugin rules.
404
- *
405
- * Derived from
406
- * [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react#configuration-legacy-eslintrc-)
407
- */
408
- export interface ReactPluginSettings {
409
- /**
410
- * Components used as alternatives to `<form>` for forms, such as `<Formik>`.
411
- *
412
- * Example:
413
- *
414
- * ```jsonc
415
- * {
416
- * "settings": {
417
- * "react": {
418
- * "formComponents": [
419
- * "CustomForm",
420
- * // OtherForm is considered a form component and has an endpoint attribute
421
- * { "name": "OtherForm", "formAttribute": "endpoint" },
422
- * // allows specifying multiple properties if necessary
423
- * { "name": "Form", "formAttribute": ["registerEndpoint", "loginEndpoint"] }
424
- * ]
425
- * }
426
- * }
427
- * }
428
- * ```
429
- */
430
- formComponents?: Array<CustomComponentObject | string>;
431
- /**
432
- * Components used as alternatives to `<a>` for linking, such as `<Link>`.
433
- *
434
- * Example:
435
- *
436
- * ```jsonc
437
- * {
438
- * "settings": {
439
- * "react": {
440
- * "linkComponents": [
441
- * "HyperLink",
442
- * // Use `linkAttribute` for components that use a different prop name
443
- * // than `href`.
444
- * { "name": "MyLink", "linkAttribute": "to" },
445
- * // allows specifying multiple properties if necessary
446
- * { "name": "Link", "linkAttribute": ["to", "href"] }
447
- * ]
448
- * }
449
- * }
450
- * }
451
- * ```
452
- */
453
- linkComponents?: Array<CustomComponentObject | string>;
454
- /**
455
- * React version to use for version-specific rules.
456
- *
457
- * Accepts semver versions (e.g., "18.2.0", "17.0").
458
- *
459
- * Example:
460
- *
461
- * ```jsonc
462
- * {
463
- * "settings": {
464
- * "react": {
465
- * "version": "18.2.0"
466
- * }
467
- * }
468
- * }
469
- * ```
470
- */
471
- version?: null | string;
472
- [property: string]: any;
473
- }
474
- export interface CustomComponentObject {
475
- attribute?: string;
476
- name: string;
477
- attributes?: string[];
478
- [property: string]: any;
479
- }
480
- /**
481
- * Configure Vitest plugin rules.
482
- *
483
- * See [eslint-plugin-vitest](https://github.com/vitest-dev/eslint-plugin-vitest)'s
484
- * configuration for a full reference.
485
- */
486
- export interface VitestPluginSettings {
487
- /**
488
- * Whether to enable typecheck mode for Vitest rules.
489
- * When enabled, some rules will skip certain checks for describe blocks
490
- * to accommodate TypeScript type checking scenarios.
491
- */
492
- typecheck?: boolean;
493
- [property: string]: any;
494
- }
495
- export declare class Convert {
496
- static toOxlintConfig(json: string): OxlintConfig;
497
- static oxlintConfigToJson(value: OxlintConfig): string;
498
- }