rolldown 1.0.0-beta.1-commit.c170008 → 1.0.0-beta.1-commit.3484a68

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 (30) hide show
  1. package/dist/cjs/cli.cjs +50 -1333
  2. package/dist/cjs/experimental-index.cjs +1 -1
  3. package/dist/cjs/index.cjs +1 -1
  4. package/dist/cjs/parallel-plugin-worker.cjs +1 -1
  5. package/dist/esm/cli.mjs +35 -1318
  6. package/dist/esm/experimental-index.mjs +1 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/esm/parallel-plugin-worker.mjs +1 -1
  9. package/dist/shared/{consola_36c0034f-C_-uQ5ge.cjs → consola_36c0034f-BBnpcLZ5.cjs} +2 -2
  10. package/dist/shared/{consola_36c0034f-DnM2mwLf.mjs → consola_36c0034f-BwyQ494_.mjs} +2 -2
  11. package/dist/shared/{prompt-BNaEjAIz.cjs → prompt-BKuli-WV.cjs} +48 -48
  12. package/dist/shared/{prompt-DhKXGIIR.mjs → prompt-CqEsx-3v.mjs} +1 -1
  13. package/dist/shared/{src-CQK3Jfvf.mjs → src-CtFcwTp3.mjs} +341 -25
  14. package/dist/shared/{src-CKrS_jGA.cjs → src-D_KTGKvd.cjs} +369 -59
  15. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  16. package/dist/types/cli/arguments/alias.d.ts +8 -1
  17. package/dist/types/cli/arguments/index.d.ts +1 -1
  18. package/dist/types/cli/arguments/normalize.d.ts +1 -1
  19. package/dist/types/cli/arguments/utils.d.ts +4 -2
  20. package/dist/types/log/logging.d.ts +0 -6
  21. package/dist/types/options/input-options.d.ts +4 -4
  22. package/dist/types/{treeshake → types}/module-side-effects.d.ts +0 -4
  23. package/dist/types/types/schema.d.ts +33 -0
  24. package/dist/types/utils/validator.d.ts +7 -1
  25. package/package.json +16 -18
  26. package/dist/types/cli/arguments/schema.d.ts +0 -12
  27. package/dist/types/options/input-options-schema.d.ts +0 -4
  28. package/dist/types/options/output-options-schema.d.ts +0 -3
  29. package/dist/types/treeshake/index.d.ts +0 -1
  30. package/dist/types/utils/zod-ext.d.ts +0 -16
@@ -1,4 +1,11 @@
1
- import { CliOptions } from './schema';
1
+ import type { InputCliOptions } from '../../options/input-options';
2
+ import type { OutputCliOptions } from '../../options/output-options';
3
+ export interface CliOptions extends InputCliOptions, OutputCliOptions {
4
+ config?: string | boolean;
5
+ help?: boolean;
6
+ version?: boolean;
7
+ watch?: boolean;
8
+ }
2
9
  export interface OptionConfig {
3
10
  abbreviation?: string;
4
11
  description?: string;
@@ -1,5 +1,5 @@
1
1
  import { type NormalizedCliOptions } from './normalize';
2
- import type { Schema } from './types';
2
+ import type { Schema } from '../../types/schema';
3
3
  export declare const flattenedSchema: Record<string, Schema>;
4
4
  export declare const options: {
5
5
  [k: string]: {
@@ -1,4 +1,4 @@
1
- import { CliOptions } from './schema';
1
+ import type { CliOptions } from './alias';
2
2
  import type { InputOptions } from '../../options/input-options';
3
3
  import type { OutputOptions } from '../../options/output-options';
4
4
  export interface NormalizedCliOptions {
@@ -1,6 +1,8 @@
1
- import type { Schema } from './types';
2
- export declare function getSchemaType(schema: Schema): 'string' | 'boolean' | 'object' | 'number' | 'array';
1
+ import type { Schema } from '../../types/schema';
2
+ type SchemaType = 'string' | 'boolean' | 'object' | 'number' | 'array';
3
+ export declare function getSchemaType(schema: Schema): SchemaType;
3
4
  export declare function flattenSchema(schema: Record<string, Schema>, base?: Record<string, Schema>, parent?: string): Record<string, Schema>;
4
5
  export declare function setNestedProperty<T extends object, K>(obj: T, path: string, value: K): void;
5
6
  export declare function camelCaseToKebabCase(str: string): string;
6
7
  export declare function kebabCaseToCamelCase(str: string): string;
8
+ export {};
@@ -1,17 +1,11 @@
1
- import type Z from 'zod';
2
1
  export type LogLevel = 'info' | 'debug' | 'warn';
3
2
  export type LogLevelOption = LogLevel | 'silent';
4
3
  export type LogLevelWithError = LogLevel | 'error';
5
4
  export type RollupLog = any;
6
5
  export type RollupLogWithString = RollupLog | string;
7
- export declare const LogLevelSchema: Z.ZodType<LogLevel>;
8
- export declare const LogLevelOptionSchema: Z.ZodType<LogLevelOption>;
9
- export declare const LogLevelWithErrorSchema: Z.ZodType<LogLevelWithError>;
10
6
  export declare const LOG_LEVEL_SILENT: LogLevelOption;
11
7
  export declare const LOG_LEVEL_ERROR = "error";
12
8
  export declare const LOG_LEVEL_WARN: LogLevel;
13
9
  export declare const LOG_LEVEL_INFO: LogLevel;
14
10
  export declare const LOG_LEVEL_DEBUG: LogLevel;
15
11
  export declare const logLevelPriority: Record<LogLevelOption, number>;
16
- export declare const RollupLogSchema: Z.ZodAny;
17
- export declare const RollupLogWithStringSchema: Z.ZodUnion<[Z.ZodAny, Z.ZodString]>;
@@ -1,7 +1,7 @@
1
- import { RolldownPluginOption } from '../plugin';
2
- import { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging';
3
- import { TreeshakingOptions } from '../treeshake';
4
- import { NullValue, StringOrRegExp } from '../types/utils';
1
+ import type { RolldownPluginOption } from '../plugin';
2
+ import type { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging';
3
+ import type { NullValue, StringOrRegExp } from '../types/utils';
4
+ import type { TreeshakingOptions } from '../types/module-side-effects';
5
5
  export type InputOption = string | string[] | Record<string, string>;
6
6
  export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
7
7
  export type ModuleTypes = Record<string, 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | 'css'>;
@@ -1,14 +1,10 @@
1
- import type Z from 'zod';
2
1
  export interface ModuleSideEffectsRule {
3
2
  test?: RegExp;
4
3
  external?: boolean;
5
4
  sideEffects: boolean;
6
5
  }
7
- export declare const ModuleSideEffectsRuleSchema: Z.ZodType<ModuleSideEffectsRule>;
8
6
  export type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id: string, isResolved: boolean) => boolean | undefined) | 'no-external';
9
- export declare const ModuleSideEffectsOptionSchema: Z.ZodType<ModuleSideEffectsOption>;
10
7
  export type TreeshakingOptions = {
11
8
  moduleSideEffects?: ModuleSideEffectsOption;
12
9
  annotations?: boolean;
13
10
  } | boolean;
14
- export declare const TreeshakingOptionsSchema: Z.ZodType<TreeshakingOptions>;
@@ -0,0 +1,33 @@
1
+ export interface JsonSchema {
2
+ type: string;
3
+ description?: string;
4
+ }
5
+ export interface ObjectSchema extends JsonSchema {
6
+ type: 'object';
7
+ properties: Record<string, Schema>;
8
+ required?: string[];
9
+ additionalProperties?: boolean | {
10
+ type: 'string';
11
+ };
12
+ }
13
+ export interface ArraySchema extends JsonSchema {
14
+ type: 'array';
15
+ items: Schema;
16
+ }
17
+ export interface StringConstantSchema extends JsonSchema {
18
+ type: 'string';
19
+ const: string;
20
+ }
21
+ export interface StringEnumSchema extends JsonSchema {
22
+ type: 'string';
23
+ enum: string[];
24
+ }
25
+ export interface BooleanSchema extends JsonSchema {
26
+ type: 'boolean';
27
+ }
28
+ export type StringSchema = StringConstantSchema | StringEnumSchema;
29
+ export interface AnyOfSchema {
30
+ anyOf: (StringSchema | ObjectSchema | BooleanSchema | ArraySchema)[];
31
+ description?: string;
32
+ }
33
+ export type Schema = StringSchema | ObjectSchema | ArraySchema | BooleanSchema | AnyOfSchema | JsonSchema;
@@ -1 +1,7 @@
1
- export declare function validateCliOptions(options: any): boolean;
1
+ import type { ObjectSchema } from '../types/schema';
2
+ import type { TreeshakingOptions } from '../types/module-side-effects';
3
+ export declare function validateTreeShakingOptions(options: TreeshakingOptions): void;
4
+ export declare function validateCliOptions<T>(options: T): [T, string[]?];
5
+ export declare function getInputCliKeys(): string[];
6
+ export declare function getOutputCliKeys(): string[];
7
+ export declare function getJsonSchema(): ObjectSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.1-commit.c170008",
3
+ "version": "1.0.0-beta.1-commit.3484a68",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -80,8 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@valibot/to-json-schema": "1.0.0-beta.3",
83
- "valibot": "1.0.0-beta.9",
84
- "zod": "^3.23.8"
83
+ "valibot": "1.0.0-beta.9"
85
84
  },
86
85
  "peerDependencies": {
87
86
  "@babel/runtime": ">=7"
@@ -113,23 +112,22 @@
113
112
  "type-fest": "^4.20.0",
114
113
  "unbuild": "^3.0.0",
115
114
  "why-is-node-running": "^3.0.0",
116
- "zod-to-json-schema": "^3.23.2",
117
- "rolldown": "1.0.0-beta.1-commit.c170008",
118
- "@rolldown/testing": "0.0.1"
115
+ "@rolldown/testing": "0.0.1",
116
+ "rolldown": "1.0.0-beta.1-commit.3484a68"
119
117
  },
120
118
  "optionalDependencies": {
121
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.1-commit.c170008",
122
- "@rolldown/binding-darwin-x64": "1.0.0-beta.1-commit.c170008",
123
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.1-commit.c170008",
124
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.1-commit.c170008",
125
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.1-commit.c170008",
126
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.1-commit.c170008",
127
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.1-commit.c170008",
128
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.1-commit.c170008",
129
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.1-commit.c170008",
130
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.1-commit.c170008",
131
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.1-commit.c170008",
132
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.1-commit.c170008"
119
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.1-commit.3484a68",
120
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.1-commit.3484a68",
121
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.1-commit.3484a68",
122
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.1-commit.3484a68",
123
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.1-commit.3484a68",
124
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.1-commit.3484a68",
125
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.1-commit.3484a68",
126
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.1-commit.3484a68",
127
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.1-commit.3484a68",
128
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.1-commit.3484a68",
129
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.1-commit.3484a68",
130
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.1-commit.3484a68"
133
131
  },
134
132
  "scripts": {
135
133
  "# Scrips for binding #": "_",
@@ -1,12 +0,0 @@
1
- import { InputCliOptions } from '../../options/input-options';
2
- import { OutputCliOptions } from '../../options/output-options';
3
- import type { ObjectSchema } from './types';
4
- import type Z from 'zod';
5
- export interface CliOptions extends InputCliOptions, OutputCliOptions {
6
- config?: string | boolean;
7
- help?: boolean;
8
- version?: boolean;
9
- watch?: boolean;
10
- }
11
- export declare const cliOptionsSchema: Z.ZodType<CliOptions>;
12
- export declare const schema: ObjectSchema;
@@ -1,4 +0,0 @@
1
- import { z } from 'zod';
2
- import type { InputCliOptions, InputOptions } from '../options/input-options';
3
- export declare const inputOptionsSchema: z.ZodType<InputOptions>;
4
- export declare const inputCliOptionsSchema: z.ZodType<InputCliOptions>;
@@ -1,3 +0,0 @@
1
- import { z } from 'zod';
2
- import type { OutputCliOptions } from '../options/output-options';
3
- export declare const outputCliOptionsSchema: z.ZodType<OutputCliOptions>;
@@ -1 +0,0 @@
1
- export * from './module-side-effects';
@@ -1,16 +0,0 @@
1
- import type Z from 'zod';
2
- import { z } from 'zod';
3
- export declare const stringOrRegExp: () => Z.ZodUnion<[Z.ZodString, Z.ZodType<RegExp, Z.ZodTypeDef, RegExp>]>;
4
- export declare const optionalStringArray: () => Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>;
5
- /**
6
- * We use this to ensure the type of a value is `T` but the value is not checked.
7
- */
8
- export declare const phantom: <T>() => Z.ZodType<T>;
9
- /**
10
- * @description Shortcut for `T | null | undefined | void`
11
- */
12
- export declare const voidNullableWith: <T extends z.ZodTypeAny>(t: T) => Z.ZodUnion<[Z.ZodUnion<[Z.ZodUnion<[Z.ZodVoid, Z.ZodNull]>, Z.ZodUndefined]>, T]>;
13
- /**
14
- * @description Shortcut for `T | null | undefined | void`
15
- */
16
- export declare const voidNullable: () => Z.ZodUnion<[Z.ZodUnion<[Z.ZodVoid, Z.ZodNull]>, Z.ZodUndefined]>;