dispersa 1.2.0 → 1.3.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/README.md +1 -2
- package/dist/{builders.d.cts → builders-B7_pBy58.d.cts} +180 -6
- package/dist/{builders.d.ts → builders-BEoMaLal.d.ts} +180 -6
- package/dist/{types-8MLtztK3.d.ts → config-schemas-DnEBhIg0.d.cts} +1 -158
- package/dist/{types-BHBHRm0a.d.cts → config-schemas-DnEBhIg0.d.ts} +1 -158
- package/dist/dispersa-DF2ZkG2O.d.ts +567 -0
- package/dist/dispersa-DJeCN0cP.d.cts +567 -0
- package/dist/index.cjs +2117 -2098
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2117 -2098
- package/dist/index.js.map +1 -1
- package/dist/{lint.cjs → lint/index.cjs} +2 -2
- package/dist/lint/index.cjs.map +1 -0
- package/dist/{lint.d.ts → lint/index.d.cts} +8 -7
- package/dist/{lint.d.cts → lint/index.d.ts} +8 -7
- package/dist/{lint.js → lint/index.js} +2 -2
- package/dist/lint/index.js.map +1 -0
- package/dist/{renderers.d.ts → output-tree-BRbfWSmG.d.ts} +3 -10
- package/dist/{renderers.d.cts → output-tree-Hmi77EMv.d.cts} +3 -10
- package/dist/{builders.cjs → outputs/builders.cjs} +30 -30
- package/dist/outputs/builders.cjs.map +1 -0
- package/dist/outputs/builders.d.cts +7 -0
- package/dist/outputs/builders.d.ts +7 -0
- package/dist/{builders.js → outputs/builders.js} +30 -30
- package/dist/outputs/builders.js.map +1 -0
- package/dist/outputs/index.cjs +3750 -0
- package/dist/outputs/index.cjs.map +1 -0
- package/dist/outputs/index.d.cts +73 -0
- package/dist/outputs/index.d.ts +73 -0
- package/dist/outputs/index.js +3730 -0
- package/dist/outputs/index.js.map +1 -0
- package/dist/{filters.cjs → processing/filters/index.cjs} +24 -18
- package/dist/processing/filters/index.cjs.map +1 -0
- package/dist/processing/filters/index.d.cts +36 -0
- package/dist/processing/filters/index.d.ts +36 -0
- package/dist/{filters.js → processing/filters/index.js} +24 -18
- package/dist/processing/filters/index.js.map +1 -0
- package/dist/{preprocessors.cjs → processing/preprocessors/index.cjs} +3 -3
- package/dist/processing/preprocessors/index.cjs.map +1 -0
- package/dist/processing/preprocessors/index.d.cts +29 -0
- package/dist/processing/preprocessors/index.d.ts +29 -0
- package/dist/{preprocessors.js → processing/preprocessors/index.js} +3 -3
- package/dist/processing/preprocessors/index.js.map +1 -0
- package/dist/{transforms.cjs → processing/transforms/index.cjs} +2 -7
- package/dist/processing/transforms/index.cjs.map +1 -0
- package/dist/{transforms.d.ts → processing/transforms/index.d.cts} +2 -2
- package/dist/{transforms.d.cts → processing/transforms/index.d.ts} +2 -2
- package/dist/{transforms.js → processing/transforms/index.js} +2 -7
- package/dist/processing/transforms/index.js.map +1 -0
- package/dist/{errors.cjs → shared/errors/index.cjs} +12 -2
- package/dist/shared/errors/index.cjs.map +1 -0
- package/dist/{errors-qT4sJgSA.d.ts → shared/errors/index.d.cts} +11 -2
- package/dist/{errors-qT4sJgSA.d.cts → shared/errors/index.d.ts} +11 -2
- package/dist/{errors.js → shared/errors/index.js} +12 -3
- package/dist/shared/errors/index.js.map +1 -0
- package/dist/types-B0cI70Bt.d.cts +453 -0
- package/dist/types-BxDEUCos.d.ts +453 -0
- package/dist/types-DUc4vLZH.d.cts +36 -0
- package/dist/types-s3UoDRKl.d.ts +36 -0
- package/package.json +26 -36
- package/dist/android-CRDfSB3_.d.cts +0 -126
- package/dist/android-DANJjjPO.d.ts +0 -126
- package/dist/builders.cjs.map +0 -1
- package/dist/builders.js.map +0 -1
- package/dist/dispersa-BC1kDF5u.d.ts +0 -118
- package/dist/dispersa-DL3J_Pmz.d.cts +0 -118
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.d.cts +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/filters.cjs.map +0 -1
- package/dist/filters.d.cts +0 -83
- package/dist/filters.d.ts +0 -83
- package/dist/filters.js.map +0 -1
- package/dist/index-Dajm5rvM.d.ts +0 -895
- package/dist/index-De6SjZYH.d.cts +0 -895
- package/dist/lint.cjs.map +0 -1
- package/dist/lint.js.map +0 -1
- package/dist/preprocessors.cjs.map +0 -1
- package/dist/preprocessors.d.cts +0 -17
- package/dist/preprocessors.d.ts +0 -17
- package/dist/preprocessors.js.map +0 -1
- package/dist/renderers.cjs +0 -28
- package/dist/renderers.cjs.map +0 -1
- package/dist/renderers.js +0 -24
- package/dist/renderers.js.map +0 -1
- package/dist/transforms.cjs.map +0 -1
- package/dist/transforms.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { K as InternalTokenDocument } from './types-TQHV1MrY.cjs';
|
|
2
1
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -88,123 +87,6 @@ declare const preprocessorPluginSchema: {
|
|
|
88
87
|
};
|
|
89
88
|
};
|
|
90
89
|
};
|
|
91
|
-
/**
|
|
92
|
-
* Output Configuration Schema
|
|
93
|
-
*
|
|
94
|
-
* Validates output-specific configuration including renderer,
|
|
95
|
-
* output file path, transforms, and filters.
|
|
96
|
-
*/
|
|
97
|
-
declare const outputConfigSchema: {
|
|
98
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
99
|
-
readonly type: "object";
|
|
100
|
-
readonly required: readonly ["name", "renderer"];
|
|
101
|
-
readonly properties: {
|
|
102
|
-
readonly name: {
|
|
103
|
-
readonly type: "string";
|
|
104
|
-
readonly minLength: 1;
|
|
105
|
-
readonly description: "Unique identifier for this output";
|
|
106
|
-
};
|
|
107
|
-
readonly renderer: {
|
|
108
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
109
|
-
readonly type: "object";
|
|
110
|
-
readonly required: readonly ["format"];
|
|
111
|
-
readonly properties: {
|
|
112
|
-
readonly preset: {
|
|
113
|
-
readonly type: "string";
|
|
114
|
-
readonly description: "Preset identifier (e.g., \"bundle\", \"standalone\", \"modifier\")";
|
|
115
|
-
};
|
|
116
|
-
readonly format: {
|
|
117
|
-
readonly description: "Format function for token-to-output conversion (validated at runtime)";
|
|
118
|
-
};
|
|
119
|
-
readonly name: {
|
|
120
|
-
readonly type: "string";
|
|
121
|
-
readonly minLength: 1;
|
|
122
|
-
readonly description: "Unique identifier for the plugin";
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
readonly additionalProperties: true;
|
|
126
|
-
readonly errorMessage: {
|
|
127
|
-
readonly required: {
|
|
128
|
-
readonly format: "Renderer must have a \"format\" function property";
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
readonly filters: {
|
|
133
|
-
readonly type: "array";
|
|
134
|
-
readonly items: {
|
|
135
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
136
|
-
readonly type: "object";
|
|
137
|
-
readonly required: readonly ["filter"];
|
|
138
|
-
readonly properties: {
|
|
139
|
-
readonly filter: {
|
|
140
|
-
readonly description: "Filter function (validated at runtime)";
|
|
141
|
-
};
|
|
142
|
-
readonly name: {
|
|
143
|
-
readonly type: "string";
|
|
144
|
-
readonly minLength: 1;
|
|
145
|
-
readonly description: "Unique identifier for the plugin";
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
readonly additionalProperties: true;
|
|
149
|
-
readonly errorMessage: {
|
|
150
|
-
readonly required: {
|
|
151
|
-
readonly filter: "Filter must have a \"filter\" function property";
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
readonly description: "Array of filter objects to apply";
|
|
156
|
-
};
|
|
157
|
-
readonly transforms: {
|
|
158
|
-
readonly type: "array";
|
|
159
|
-
readonly items: {
|
|
160
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
161
|
-
readonly type: "object";
|
|
162
|
-
readonly required: readonly ["transform"];
|
|
163
|
-
readonly properties: {
|
|
164
|
-
readonly matcher: {
|
|
165
|
-
readonly description: "Optional filter function (validated at runtime)";
|
|
166
|
-
};
|
|
167
|
-
readonly transform: {
|
|
168
|
-
readonly description: "Transform function (validated at runtime)";
|
|
169
|
-
};
|
|
170
|
-
readonly name: {
|
|
171
|
-
readonly type: "string";
|
|
172
|
-
readonly minLength: 1;
|
|
173
|
-
readonly description: "Unique identifier for the plugin";
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
readonly additionalProperties: true;
|
|
177
|
-
readonly errorMessage: {
|
|
178
|
-
readonly required: {
|
|
179
|
-
readonly name: "Transform must have a \"name\" property";
|
|
180
|
-
readonly transform: "Transform must have a \"transform\" function property";
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
readonly description: "Array of transform objects to apply";
|
|
185
|
-
};
|
|
186
|
-
readonly file: {
|
|
187
|
-
readonly description: "Output file path relative to buildPath. Supports subdirectories (e.g., \"css/tokens.css\"), pattern strings (e.g., \"tokens-{theme}.css\"), or function for dynamic naming";
|
|
188
|
-
};
|
|
189
|
-
readonly options: {
|
|
190
|
-
readonly type: "object";
|
|
191
|
-
readonly description: "Renderer-specific options passed to the formatter";
|
|
192
|
-
readonly additionalProperties: true;
|
|
193
|
-
};
|
|
194
|
-
readonly hooks: {
|
|
195
|
-
readonly type: "object";
|
|
196
|
-
readonly description: "Per-output lifecycle hooks (functions, validated at runtime)";
|
|
197
|
-
readonly additionalProperties: true;
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
readonly errorMessage: {
|
|
201
|
-
readonly required: {
|
|
202
|
-
readonly name: "Output must have a \"name\" property";
|
|
203
|
-
readonly renderer: "Output must have a \"renderer\" property";
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
readonly additionalProperties: false;
|
|
207
|
-
};
|
|
208
90
|
/**
|
|
209
91
|
* Dispersa Options Schema
|
|
210
92
|
*
|
|
@@ -427,13 +309,6 @@ type JsonRendererOptions = FromSchema<typeof jsonRendererOptionsSchema>;
|
|
|
427
309
|
* JS Module Renderer Options type generated from jsModuleRendererOptionsSchema
|
|
428
310
|
*/
|
|
429
311
|
type JsModuleRendererOptions = FromSchema<typeof jsModuleRendererOptionsSchema>;
|
|
430
|
-
/**
|
|
431
|
-
* Output Config type generated from outputConfigSchema
|
|
432
|
-
*
|
|
433
|
-
* Note: This is a base type. The actual OutputConfig type in config/index.ts
|
|
434
|
-
* extends this with additional TypeScript features like conditional types for options.
|
|
435
|
-
*/
|
|
436
|
-
type OutputConfigBase = FromSchema<typeof outputConfigSchema>;
|
|
437
312
|
/**
|
|
438
313
|
* Dispersa Options type generated from dispersaOptionsSchema
|
|
439
314
|
*/
|
|
@@ -450,36 +325,4 @@ type BuildConfigBase = FromSchema<typeof buildConfigSchema>;
|
|
|
450
325
|
*/
|
|
451
326
|
type PreprocessorPluginBase = FromSchema<typeof preprocessorPluginSchema>;
|
|
452
327
|
|
|
453
|
-
|
|
454
|
-
* @fileoverview Preprocessor system types for raw token transformation
|
|
455
|
-
*/
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* Preprocessor definition for transforming raw token data
|
|
459
|
-
*
|
|
460
|
-
* Preprocessors operate on the raw token object before parsing and resolution.
|
|
461
|
-
* They are useful for normalizing data, stripping metadata, or adapting tokens
|
|
462
|
-
* from external sources to match expected formats.
|
|
463
|
-
*
|
|
464
|
-
* @example
|
|
465
|
-
* ```typescript
|
|
466
|
-
* const stripMetadata: Preprocessor = {
|
|
467
|
-
* name: 'strip-metadata',
|
|
468
|
-
* preprocess: (rawTokens) => {
|
|
469
|
-
* const { _metadata, ...tokens } = rawTokens
|
|
470
|
-
* return tokens
|
|
471
|
-
* }
|
|
472
|
-
* }
|
|
473
|
-
* ```
|
|
474
|
-
*/
|
|
475
|
-
type Preprocessor = Pick<PreprocessorPluginBase, 'name'> & {
|
|
476
|
-
/**
|
|
477
|
-
* Function that transforms raw token data
|
|
478
|
-
*
|
|
479
|
-
* @param rawTokens - Raw token object before parsing
|
|
480
|
-
* @returns Transformed token object (can be async)
|
|
481
|
-
*/
|
|
482
|
-
preprocess: (rawTokens: InternalTokenDocument) => InternalTokenDocument | Promise<InternalTokenDocument>;
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
export type { BuildConfigBase as B, DispersaOptionsBase as D, JsModuleRendererOptions as J, OutputConfigBase as O, Preprocessor as P, JsonRendererOptions as a };
|
|
328
|
+
export type { BuildConfigBase as B, DispersaOptionsBase as D, JsModuleRendererOptions as J, PreprocessorPluginBase as P, JsonRendererOptions as a };
|