@wix/zero-config-implementation 1.5.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.
Files changed (78) hide show
  1. package/README.md +72 -0
  2. package/dist/component-loader.d.ts +42 -0
  3. package/dist/component-renderer.d.ts +31 -0
  4. package/dist/converters/data-item-builder.d.ts +15 -0
  5. package/dist/converters/index.d.ts +1 -0
  6. package/dist/converters/to-editor-component.d.ts +3 -0
  7. package/dist/converters/utils.d.ts +16 -0
  8. package/dist/errors.d.ts +230 -0
  9. package/dist/index.d.ts +42 -0
  10. package/dist/index.js +51978 -0
  11. package/dist/information-extractors/css/index.d.ts +3 -0
  12. package/dist/information-extractors/css/parse.d.ts +7 -0
  13. package/dist/information-extractors/css/selector-matcher.d.ts +3 -0
  14. package/dist/information-extractors/css/types.d.ts +49 -0
  15. package/dist/information-extractors/react/extractors/core/index.d.ts +6 -0
  16. package/dist/information-extractors/react/extractors/core/runner.d.ts +19 -0
  17. package/dist/information-extractors/react/extractors/core/store.d.ts +17 -0
  18. package/dist/information-extractors/react/extractors/core/tree-builder.d.ts +15 -0
  19. package/dist/information-extractors/react/extractors/core/types.d.ts +40 -0
  20. package/dist/information-extractors/react/extractors/css-properties.d.ts +20 -0
  21. package/dist/information-extractors/react/extractors/index.d.ts +11 -0
  22. package/dist/information-extractors/react/extractors/prop-tracker.d.ts +24 -0
  23. package/dist/information-extractors/react/index.d.ts +9 -0
  24. package/dist/information-extractors/react/types.d.ts +51 -0
  25. package/dist/information-extractors/react/utils/mock-generator.d.ts +9 -0
  26. package/dist/information-extractors/react/utils/prop-spy.d.ts +10 -0
  27. package/dist/information-extractors/ts/components.d.ts +9 -0
  28. package/dist/information-extractors/ts/css-imports.d.ts +2 -0
  29. package/dist/information-extractors/ts/index.d.ts +3 -0
  30. package/dist/information-extractors/ts/types.d.ts +47 -0
  31. package/dist/information-extractors/ts/utils/semantic-type-resolver.d.ts +3 -0
  32. package/dist/jsx-runtime-interceptor.d.ts +42 -0
  33. package/dist/jsx-runtime-interceptor.js +63 -0
  34. package/dist/jsx-runtime-loader.d.ts +23 -0
  35. package/dist/jsx-runtime-loader.js +7 -0
  36. package/dist/manifest-pipeline.d.ts +33 -0
  37. package/dist/schema.d.ts +167 -0
  38. package/dist/ts-compiler.d.ts +13 -0
  39. package/package.json +81 -0
  40. package/src/component-loader.test.ts +277 -0
  41. package/src/component-loader.ts +256 -0
  42. package/src/component-renderer.ts +192 -0
  43. package/src/converters/data-item-builder.ts +354 -0
  44. package/src/converters/index.ts +1 -0
  45. package/src/converters/to-editor-component.ts +167 -0
  46. package/src/converters/utils.ts +21 -0
  47. package/src/errors.ts +103 -0
  48. package/src/index.ts +223 -0
  49. package/src/information-extractors/css/README.md +3 -0
  50. package/src/information-extractors/css/index.ts +3 -0
  51. package/src/information-extractors/css/parse.ts +450 -0
  52. package/src/information-extractors/css/selector-matcher.ts +88 -0
  53. package/src/information-extractors/css/types.ts +56 -0
  54. package/src/information-extractors/react/extractors/core/index.ts +6 -0
  55. package/src/information-extractors/react/extractors/core/runner.ts +89 -0
  56. package/src/information-extractors/react/extractors/core/store.ts +36 -0
  57. package/src/information-extractors/react/extractors/core/tree-builder.ts +273 -0
  58. package/src/information-extractors/react/extractors/core/types.ts +48 -0
  59. package/src/information-extractors/react/extractors/css-properties.ts +214 -0
  60. package/src/information-extractors/react/extractors/index.ts +27 -0
  61. package/src/information-extractors/react/extractors/prop-tracker.ts +132 -0
  62. package/src/information-extractors/react/index.ts +53 -0
  63. package/src/information-extractors/react/types.ts +70 -0
  64. package/src/information-extractors/react/utils/mock-generator.ts +331 -0
  65. package/src/information-extractors/react/utils/prop-spy.ts +168 -0
  66. package/src/information-extractors/ts/components.ts +300 -0
  67. package/src/information-extractors/ts/css-imports.ts +26 -0
  68. package/src/information-extractors/ts/index.ts +3 -0
  69. package/src/information-extractors/ts/types.ts +56 -0
  70. package/src/information-extractors/ts/utils/semantic-type-resolver.ts +377 -0
  71. package/src/jsx-runtime-interceptor.ts +146 -0
  72. package/src/jsx-runtime-loader.ts +38 -0
  73. package/src/manifest-pipeline.ts +362 -0
  74. package/src/schema.ts +174 -0
  75. package/src/ts-compiler.ts +41 -0
  76. package/tsconfig.json +17 -0
  77. package/typedoc.json +18 -0
  78. package/vite.config.ts +45 -0
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @wix/zero-config
2
+
3
+ CLI and library to generate component manifests from React TypeScript and CSS files. Consumes `.ts`/`.tsx` entry files and produces [EditorReactComponent](https://www.npmjs.com/package/@wix/component-protocol) manifests.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add -D @wix/zero-config
9
+ ```
10
+
11
+ Peer dependencies: `react` (^18 || ^19), `react-dom` (^18 || ^19), `typescript` (^5).
12
+
13
+ ## Usage
14
+
15
+ ### Programmatic
16
+
17
+ ```ts
18
+ import { extractComponentManifest } from '@wix/zero-config'
19
+
20
+ const result = await extractComponentManifest(
21
+ './src/MyComponent.tsx',
22
+ (name) => require(`./src/${name}`).default,
23
+ )
24
+
25
+ result.match(
26
+ (manifest) => {
27
+ console.log(manifest.components)
28
+ console.log(manifest.errors)
29
+ },
30
+ (err) => console.error(err),
31
+ )
32
+ ```
33
+
34
+ ### CLI
35
+
36
+ ```bash
37
+ npx @wix/zero-config ./src/MyComponent.tsx
38
+ # or
39
+ npx @wix/zero-config
40
+ # then enter path when prompted
41
+ ```
42
+
43
+ ## Scripts
44
+
45
+ | Script | Description |
46
+ |--------|-------------|
47
+ | `yarn build` | Build with Vite; output in `dist/` |
48
+ | `yarn dev` | Run CLI in dev (vite-node) |
49
+ | `yarn start` | Run built CLI: `node dist/cli.js` |
50
+ | `yarn lint` | Biome check on `src/` |
51
+ | `yarn test` | Vitest |
52
+ | `yarn docs` | Generate TypeDoc markdown into `docs-audit/` |
53
+
54
+ ## API layers
55
+
56
+ - **Tier 1 — High-level:** `extractComponentManifest()` — one call, default pipeline.
57
+ - **Tier 2 — Pipeline building blocks:** `compileTsFile`, `extractAllComponentInfo`, `extractCssImports`, `processComponent`, `runExtractors`, `ExtractorStore`, `buildElementTree`, `createPropTrackerExtractor`, `createCssPropertiesExtractor`, `parseCss`, `toEditorReactComponent`, and exported types (e.g. `ComponentInfo`, `PropInfo`, `ExtractionResult`, `ReactExtractor`).
58
+ - **Tier 3 — Low-level:** `renderWithExtractors`, `CreateElementListener` for custom createElement/JSX interception.
59
+
60
+ Full API reference: [docs-audit/README.md](./docs-audit/README.md) (generate with `yarn docs`).
61
+
62
+ ## Structure
63
+
64
+ - `src/cli.ts` — CLI entry (bin: `zero-config`)
65
+ - `src/index.ts` — Library exports and main API
66
+ - `src/ts-compiler.ts` — TypeScript compilation
67
+ - `src/manifest-pipeline.ts` — Per-component pipeline (load → render → CSS → conversion)
68
+ - `src/component-loader.ts` — Resolve and load component package
69
+ - `src/component-renderer/` — React createElement interception and `renderWithExtractors`
70
+ - `src/information-extractors/` — TS (AST), CSS (lightningcss), React (prop tracking, DOM coupling)
71
+ - `src/converters/` — To EditorReactComponent and data items
72
+ - `src/errors.ts` — BaseError, NotFoundError, ParseError, etc.
@@ -0,0 +1,42 @@
1
+ import { ResultAsync } from 'neverthrow';
2
+ import { ComponentType } from 'react';
3
+ import { IoError, NotFoundError } from './errors';
4
+ type NotFoundErrorInstance = InstanceType<typeof NotFoundError>;
5
+ type IoErrorInstance = InstanceType<typeof IoError>;
6
+ export type LoaderError = NotFoundErrorInstance | IoErrorInstance;
7
+ export interface ComponentLoaderResult {
8
+ loadComponent: (name: string) => ComponentType<unknown> | null;
9
+ packageName: string;
10
+ entryPath: string | undefined;
11
+ exportNames: string[];
12
+ }
13
+ /**
14
+ * Creates a component loader that dynamically loads components from the
15
+ * user's package. Finds the nearest package.json, resolves its entry point,
16
+ * and loads the module.
17
+ *
18
+ * The returned `loadComponent` is synchronous (required by processComponent).
19
+ * ESM modules are loaded via async `import()` during creation, so this
20
+ * function itself is async.
21
+ *
22
+ * @returns A `ResultAsync` containing a `ComponentLoaderResult` on success.
23
+ * @errors {NotFoundError} When no package.json is found or the package has no resolvable entry points.
24
+ * @errors {IoError} When module loading fails (CJS require or ESM import).
25
+ */
26
+ export declare function createComponentLoader(componentPath: string): ResultAsync<ComponentLoaderResult, LoaderError>;
27
+ /**
28
+ * Attempts to load a module, first via ESM `import()`, then via CJS `require`.
29
+ *
30
+ * ESM `import()` is preferred because it participates in the ESM loader hook
31
+ * pipeline (registered via `module.register()` in the CLI). This is required
32
+ * for JSX interception to work — the loader hook redirects `react/jsx-runtime`
33
+ * to the interceptable version. CJS `require()` bypasses ESM hooks even when
34
+ * loading ESM modules (Node 22+), so it's only used as a fallback.
35
+ *
36
+ * @param entryPath - Absolute path to the module entry point.
37
+ * @returns A `ResultAsync` containing the module exports on success.
38
+ * @errors {IoError} When both ESM import and CJS require fail.
39
+ */
40
+ export declare function loadModule(entryPath: string): ResultAsync<Record<string, unknown>, IoErrorInstance>;
41
+ export declare function findComponent(moduleExports: Record<string, unknown>, name: string): ComponentType<unknown> | null;
42
+ export {};
@@ -0,0 +1,31 @@
1
+ import { ComponentType } from 'react';
2
+ import { ExtractorStore } from './information-extractors/react/extractors/core/store';
3
+ import { CreateElementEvent } from './information-extractors/react/extractors/core/types';
4
+ export declare const TRACE_ATTR = "data-trace-id";
5
+ export type { CreateElementEvent };
6
+ export interface CreateElementListener {
7
+ onCreateElement: (event: CreateElementEvent) => void;
8
+ }
9
+ /**
10
+ * Renders a React component to static HTML while intercepting element creation.
11
+ *
12
+ * Uses monkey-patching of React.createElement and jsx/jsxs to notify listeners
13
+ * when DOM elements are created. Each DOM element gets a unique `data-trace-id`
14
+ * attribute for tracking.
15
+ *
16
+ * @param Component - The React component to render
17
+ * @param componentProps - Props to pass to the component
18
+ * @param listeners - Listeners to notify on each DOM element creation
19
+ * @param store - Shared ExtractorStore, included in each CreateElementEvent
20
+ * @returns Static HTML string with trace IDs on DOM elements
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const store = new ExtractorStore()
25
+ * const tracker = createPropTracker(getSpyMetadata)
26
+ * const html = renderWithExtractors(MyComponent, { title: 'Hello' }, [tracker], store)
27
+ * // html contains: <div data-trace-id="t1">...</div>
28
+ * // tracker.stores now has prop→DOM bindings
29
+ * ```
30
+ */
31
+ export declare function renderWithExtractors(Component: ComponentType<unknown>, componentProps: unknown, listeners: CreateElementListener[], store: ExtractorStore): string;
@@ -0,0 +1,15 @@
1
+ import { Result } from 'neverthrow';
2
+ import { ParseError } from '../errors';
3
+ import { PropInfo } from '../information-extractors/ts/types';
4
+ import { DataItem } from '../schema';
5
+ type ParseErrorInstance = InstanceType<typeof ParseError>;
6
+ /**
7
+ * Converts a single PropInfo to a DataItem for the Wix Editor component schema.
8
+ *
9
+ * @param propInfo - The resolved TypeScript prop information to convert.
10
+ * @param defaultValue - Optional default value for the data item.
11
+ * @returns `Ok<DataItem>` on success, `Err<ParseError>` if an invariant is violated
12
+ * (e.g. an array type missing its element type).
13
+ */
14
+ export declare function buildDataItem(propInfo: PropInfo, defaultValue?: unknown): Result<DataItem, ParseErrorInstance>;
15
+ export {};
@@ -0,0 +1 @@
1
+ export { toEditorReactComponent } from './to-editor-component';
@@ -0,0 +1,3 @@
1
+ import { ComponentInfoWithCss } from '../index';
2
+ import { EditorReactComponent } from '../schema';
3
+ export declare function toEditorReactComponent(component: ComponentInfoWithCss): EditorReactComponent;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Utility functions for the converter module
3
+ */
4
+ /**
5
+ * Formats any string format to Title Case display name
6
+ * Handles: kebab-case, camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, and mixed formats
7
+ *
8
+ * Examples:
9
+ * "input-field-weight" -> "Input Field Weight"
10
+ * "camelCaseExample" -> "Camel Case Example"
11
+ * "PascalCaseExample" -> "Pascal Case Example"
12
+ * "snake_case_example" -> "Snake Case Example"
13
+ * "SCREAMING_SNAKE_CASE" -> "Screaming Snake Case"
14
+ * "mixed-format_example" -> "Mixed Format Example"
15
+ */
16
+ export declare function formatDisplayName(input: string): string;
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Error class hierarchy using modern-errors and modern-errors-cli.
3
+ *
4
+ * Classes are organized by **failure type** (what went wrong), not by pipeline
5
+ * phase (where it happened). Phase is an orthogonal runtime property composed
6
+ * onto any error instance via `mapErr` or instance `props`.
7
+ */
8
+ /**
9
+ * Root error class for the entire project. All domain errors extend this.
10
+ *
11
+ * Plugins attached here cascade to every subclass automatically.
12
+ * The `phase` prop defaults to `"unknown"` and is overridden at the call
13
+ * site or via `mapErr` as the error propagates through pipeline stages.
14
+ */
15
+ export declare const BaseError: import('modern-errors').SpecificErrorClass<{
16
+ name: "cli";
17
+ isOptions: (options: unknown) => boolean;
18
+ getOptions: (options?: import('modern-errors-cli').Options) => {
19
+ custom: string;
20
+ stack?: boolean;
21
+ cause?: boolean;
22
+ props?: boolean;
23
+ colors?: boolean;
24
+ icon?: ("infinity" | "tick" | "info" | "warning" | "cross" | "square" | "squareSmall" | "squareSmallFilled" | "squareDarkShade" | "squareMediumShade" | "squareLightShade" | "squareTop" | "squareBottom" | "squareLeft" | "squareRight" | "squareCenter" | "circle" | "circleFilled" | "circleDotted" | "circleDouble" | "circleCircle" | "circleCross" | "circlePipe" | "circleQuestionMark" | "radioOn" | "radioOff" | "checkboxOn" | "checkboxOff" | "checkboxCircleOn" | "checkboxCircleOff" | "questionMarkPrefix" | "bullet" | "dot" | "ellipsis" | "pointer" | "pointerSmall" | "triangleUp" | "triangleUpSmall" | "triangleUpOutline" | "triangleDown" | "triangleDownSmall" | "triangleLeft" | "triangleLeftSmall" | "triangleRight" | "triangleRightSmall" | "lozenge" | "lozengeOutline" | "home" | "hamburger" | "smiley" | "mustache" | "heart" | "star" | "play" | "musicNote" | "musicNoteBeamed" | "nodejs" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowLeftRight" | "arrowUpDown" | "almostEqual" | "notEqual" | "lessOrEqual" | "greaterOrEqual" | "identical" | "subscriptZero" | "subscriptOne" | "subscriptTwo" | "subscriptThree" | "subscriptFour" | "subscriptFive" | "subscriptSix" | "subscriptSeven" | "subscriptEight" | "subscriptNine" | "oneHalf" | "oneThird" | "oneQuarter" | "oneFifth" | "oneSixth" | "oneSeventh" | "oneEighth" | "oneNinth" | "oneTenth" | "twoThirds" | "twoFifths" | "threeQuarters" | "threeFifths" | "threeEighths" | "fourFifths" | "fiveSixths" | "fiveEighths" | "sevenEighth" | "line" | "lineBold" | "lineDouble" | "lineDashed0" | "lineDashed1" | "lineDashed2" | "lineDashed3" | "lineDashed4" | "lineDashed5" | "lineDashed6" | "lineDashed7" | "lineDashed8" | "lineDashed9" | "lineDashed10" | "lineDashed11" | "lineDashed12" | "lineDashed13" | "lineDashed14" | "lineDashed15" | "lineVertical" | "lineVerticalBold" | "lineVerticalDouble" | "lineVerticalDashed0" | "lineVerticalDashed1" | "lineVerticalDashed2" | "lineVerticalDashed3" | "lineVerticalDashed4" | "lineVerticalDashed5" | "lineVerticalDashed6" | "lineVerticalDashed7" | "lineVerticalDashed8" | "lineVerticalDashed9" | "lineVerticalDashed10" | "lineVerticalDashed11" | "lineDownLeft" | "lineDownLeftArc" | "lineDownBoldLeftBold" | "lineDownBoldLeft" | "lineDownLeftBold" | "lineDownDoubleLeftDouble" | "lineDownDoubleLeft" | "lineDownLeftDouble" | "lineDownRight" | "lineDownRightArc" | "lineDownBoldRightBold" | "lineDownBoldRight" | "lineDownRightBold" | "lineDownDoubleRightDouble" | "lineDownDoubleRight" | "lineDownRightDouble" | "lineUpLeft" | "lineUpLeftArc" | "lineUpBoldLeftBold" | "lineUpBoldLeft" | "lineUpLeftBold" | "lineUpDoubleLeftDouble" | "lineUpDoubleLeft" | "lineUpLeftDouble" | "lineUpRight" | "lineUpRightArc" | "lineUpBoldRightBold" | "lineUpBoldRight" | "lineUpRightBold" | "lineUpDoubleRightDouble" | "lineUpDoubleRight" | "lineUpRightDouble" | "lineUpDownLeft" | "lineUpBoldDownBoldLeftBold" | "lineUpBoldDownBoldLeft" | "lineUpDownLeftBold" | "lineUpBoldDownLeftBold" | "lineUpDownBoldLeftBold" | "lineUpDownBoldLeft" | "lineUpBoldDownLeft" | "lineUpDoubleDownDoubleLeftDouble" | "lineUpDoubleDownDoubleLeft" | "lineUpDownLeftDouble" | "lineUpDownRight" | "lineUpBoldDownBoldRightBold" | "lineUpBoldDownBoldRight" | "lineUpDownRightBold" | "lineUpBoldDownRightBold" | "lineUpDownBoldRightBold" | "lineUpDownBoldRight" | "lineUpBoldDownRight" | "lineUpDoubleDownDoubleRightDouble" | "lineUpDoubleDownDoubleRight" | "lineUpDownRightDouble" | "lineDownLeftRight" | "lineDownBoldLeftBoldRightBold" | "lineDownLeftBoldRightBold" | "lineDownBoldLeftRight" | "lineDownBoldLeftBoldRight" | "lineDownBoldLeftRightBold" | "lineDownLeftRightBold" | "lineDownLeftBoldRight" | "lineDownDoubleLeftDoubleRightDouble" | "lineDownDoubleLeftRight" | "lineDownLeftDoubleRightDouble" | "lineUpLeftRight" | "lineUpBoldLeftBoldRightBold" | "lineUpLeftBoldRightBold" | "lineUpBoldLeftRight" | "lineUpBoldLeftBoldRight" | "lineUpBoldLeftRightBold" | "lineUpLeftRightBold" | "lineUpLeftBoldRight" | "lineUpDoubleLeftDoubleRightDouble" | "lineUpDoubleLeftRight" | "lineUpLeftDoubleRightDouble" | "lineUpDownLeftRight" | "lineUpBoldDownBoldLeftBoldRightBold" | "lineUpDownBoldLeftBoldRightBold" | "lineUpBoldDownLeftBoldRightBold" | "lineUpBoldDownBoldLeftRightBold" | "lineUpBoldDownBoldLeftBoldRight" | "lineUpBoldDownLeftRight" | "lineUpDownBoldLeftRight" | "lineUpDownLeftBoldRight" | "lineUpDownLeftRightBold" | "lineUpBoldDownBoldLeftRight" | "lineUpDownLeftBoldRightBold" | "lineUpBoldDownLeftBoldRight" | "lineUpBoldDownLeftRightBold" | "lineUpDownBoldLeftBoldRight" | "lineUpDownBoldLeftRightBold" | "lineUpDoubleDownDoubleLeftDoubleRightDouble" | "lineUpDoubleDownDoubleLeftRight" | "lineUpDownLeftDoubleRightDouble" | "lineCross" | "lineBackslash" | "lineSlash") | "";
25
+ header?: import('chalk-string').Styles | "";
26
+ classes?: {
27
+ readonly [errorName: string]: Omit<import('beautiful-error').Options, "classes">;
28
+ } & {
29
+ readonly [errorName: string]: Omit<import('handle-cli-error').Options, "classes">;
30
+ };
31
+ exitCode?: number;
32
+ silent?: boolean;
33
+ timeout?: number;
34
+ log?: (message: string) => void;
35
+ };
36
+ instanceMethods: {
37
+ exit: ({ error, options }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => void;
38
+ pretty: ({ error, options: { exitCode, silent, timeout, log, ...beautifulErrorOptions }, }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => string;
39
+ };
40
+ }[], {
41
+ /** Pipeline stage where the error originated (composed at runtime). */
42
+ phase: string;
43
+ /** True if this error represents a violated invariant, not a user error. */
44
+ isDefect: boolean;
45
+ /** Process exit code used by BaseError.exit(). */
46
+ exitCode: number;
47
+ }, import('modern-errors').CustomClass>;
48
+ /** A required resource (file, module, component) could not be found. */
49
+ export declare const NotFoundError: import('modern-errors').SpecificErrorClass<{
50
+ name: "cli";
51
+ isOptions: (options: unknown) => boolean;
52
+ getOptions: (options?: import('modern-errors-cli').Options) => {
53
+ custom: string;
54
+ stack?: boolean;
55
+ cause?: boolean;
56
+ props?: boolean;
57
+ colors?: boolean;
58
+ icon?: ("infinity" | "tick" | "info" | "warning" | "cross" | "square" | "squareSmall" | "squareSmallFilled" | "squareDarkShade" | "squareMediumShade" | "squareLightShade" | "squareTop" | "squareBottom" | "squareLeft" | "squareRight" | "squareCenter" | "circle" | "circleFilled" | "circleDotted" | "circleDouble" | "circleCircle" | "circleCross" | "circlePipe" | "circleQuestionMark" | "radioOn" | "radioOff" | "checkboxOn" | "checkboxOff" | "checkboxCircleOn" | "checkboxCircleOff" | "questionMarkPrefix" | "bullet" | "dot" | "ellipsis" | "pointer" | "pointerSmall" | "triangleUp" | "triangleUpSmall" | "triangleUpOutline" | "triangleDown" | "triangleDownSmall" | "triangleLeft" | "triangleLeftSmall" | "triangleRight" | "triangleRightSmall" | "lozenge" | "lozengeOutline" | "home" | "hamburger" | "smiley" | "mustache" | "heart" | "star" | "play" | "musicNote" | "musicNoteBeamed" | "nodejs" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowLeftRight" | "arrowUpDown" | "almostEqual" | "notEqual" | "lessOrEqual" | "greaterOrEqual" | "identical" | "subscriptZero" | "subscriptOne" | "subscriptTwo" | "subscriptThree" | "subscriptFour" | "subscriptFive" | "subscriptSix" | "subscriptSeven" | "subscriptEight" | "subscriptNine" | "oneHalf" | "oneThird" | "oneQuarter" | "oneFifth" | "oneSixth" | "oneSeventh" | "oneEighth" | "oneNinth" | "oneTenth" | "twoThirds" | "twoFifths" | "threeQuarters" | "threeFifths" | "threeEighths" | "fourFifths" | "fiveSixths" | "fiveEighths" | "sevenEighth" | "line" | "lineBold" | "lineDouble" | "lineDashed0" | "lineDashed1" | "lineDashed2" | "lineDashed3" | "lineDashed4" | "lineDashed5" | "lineDashed6" | "lineDashed7" | "lineDashed8" | "lineDashed9" | "lineDashed10" | "lineDashed11" | "lineDashed12" | "lineDashed13" | "lineDashed14" | "lineDashed15" | "lineVertical" | "lineVerticalBold" | "lineVerticalDouble" | "lineVerticalDashed0" | "lineVerticalDashed1" | "lineVerticalDashed2" | "lineVerticalDashed3" | "lineVerticalDashed4" | "lineVerticalDashed5" | "lineVerticalDashed6" | "lineVerticalDashed7" | "lineVerticalDashed8" | "lineVerticalDashed9" | "lineVerticalDashed10" | "lineVerticalDashed11" | "lineDownLeft" | "lineDownLeftArc" | "lineDownBoldLeftBold" | "lineDownBoldLeft" | "lineDownLeftBold" | "lineDownDoubleLeftDouble" | "lineDownDoubleLeft" | "lineDownLeftDouble" | "lineDownRight" | "lineDownRightArc" | "lineDownBoldRightBold" | "lineDownBoldRight" | "lineDownRightBold" | "lineDownDoubleRightDouble" | "lineDownDoubleRight" | "lineDownRightDouble" | "lineUpLeft" | "lineUpLeftArc" | "lineUpBoldLeftBold" | "lineUpBoldLeft" | "lineUpLeftBold" | "lineUpDoubleLeftDouble" | "lineUpDoubleLeft" | "lineUpLeftDouble" | "lineUpRight" | "lineUpRightArc" | "lineUpBoldRightBold" | "lineUpBoldRight" | "lineUpRightBold" | "lineUpDoubleRightDouble" | "lineUpDoubleRight" | "lineUpRightDouble" | "lineUpDownLeft" | "lineUpBoldDownBoldLeftBold" | "lineUpBoldDownBoldLeft" | "lineUpDownLeftBold" | "lineUpBoldDownLeftBold" | "lineUpDownBoldLeftBold" | "lineUpDownBoldLeft" | "lineUpBoldDownLeft" | "lineUpDoubleDownDoubleLeftDouble" | "lineUpDoubleDownDoubleLeft" | "lineUpDownLeftDouble" | "lineUpDownRight" | "lineUpBoldDownBoldRightBold" | "lineUpBoldDownBoldRight" | "lineUpDownRightBold" | "lineUpBoldDownRightBold" | "lineUpDownBoldRightBold" | "lineUpDownBoldRight" | "lineUpBoldDownRight" | "lineUpDoubleDownDoubleRightDouble" | "lineUpDoubleDownDoubleRight" | "lineUpDownRightDouble" | "lineDownLeftRight" | "lineDownBoldLeftBoldRightBold" | "lineDownLeftBoldRightBold" | "lineDownBoldLeftRight" | "lineDownBoldLeftBoldRight" | "lineDownBoldLeftRightBold" | "lineDownLeftRightBold" | "lineDownLeftBoldRight" | "lineDownDoubleLeftDoubleRightDouble" | "lineDownDoubleLeftRight" | "lineDownLeftDoubleRightDouble" | "lineUpLeftRight" | "lineUpBoldLeftBoldRightBold" | "lineUpLeftBoldRightBold" | "lineUpBoldLeftRight" | "lineUpBoldLeftBoldRight" | "lineUpBoldLeftRightBold" | "lineUpLeftRightBold" | "lineUpLeftBoldRight" | "lineUpDoubleLeftDoubleRightDouble" | "lineUpDoubleLeftRight" | "lineUpLeftDoubleRightDouble" | "lineUpDownLeftRight" | "lineUpBoldDownBoldLeftBoldRightBold" | "lineUpDownBoldLeftBoldRightBold" | "lineUpBoldDownLeftBoldRightBold" | "lineUpBoldDownBoldLeftRightBold" | "lineUpBoldDownBoldLeftBoldRight" | "lineUpBoldDownLeftRight" | "lineUpDownBoldLeftRight" | "lineUpDownLeftBoldRight" | "lineUpDownLeftRightBold" | "lineUpBoldDownBoldLeftRight" | "lineUpDownLeftBoldRightBold" | "lineUpBoldDownLeftBoldRight" | "lineUpBoldDownLeftRightBold" | "lineUpDownBoldLeftBoldRight" | "lineUpDownBoldLeftRightBold" | "lineUpDoubleDownDoubleLeftDoubleRightDouble" | "lineUpDoubleDownDoubleLeftRight" | "lineUpDownLeftDoubleRightDouble" | "lineCross" | "lineBackslash" | "lineSlash") | "";
59
+ header?: import('chalk-string').Styles | "";
60
+ classes?: {
61
+ readonly [errorName: string]: Omit<import('beautiful-error').Options, "classes">;
62
+ } & {
63
+ readonly [errorName: string]: Omit<import('handle-cli-error').Options, "classes">;
64
+ };
65
+ exitCode?: number;
66
+ silent?: boolean;
67
+ timeout?: number;
68
+ log?: (message: string) => void;
69
+ };
70
+ instanceMethods: {
71
+ exit: ({ error, options }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => void;
72
+ pretty: ({ error, options: { exitCode, silent, timeout, log, ...beautifulErrorOptions }, }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => string;
73
+ };
74
+ }[], {
75
+ /** Pipeline stage where the error originated (composed at runtime). */
76
+ phase: string;
77
+ /** True if this error represents a violated invariant, not a user error. */
78
+ isDefect: boolean;
79
+ /** Process exit code used by BaseError.exit(). */
80
+ exitCode: number;
81
+ } & object, import('modern-errors').CustomClass>;
82
+ /** Data could not be parsed or decoded (JSON, source code, config, CSS). */
83
+ export declare const ParseError: import('modern-errors').SpecificErrorClass<{
84
+ name: "cli";
85
+ isOptions: (options: unknown) => boolean;
86
+ getOptions: (options?: import('modern-errors-cli').Options) => {
87
+ custom: string;
88
+ stack?: boolean;
89
+ cause?: boolean;
90
+ props?: boolean;
91
+ colors?: boolean;
92
+ icon?: ("infinity" | "tick" | "info" | "warning" | "cross" | "square" | "squareSmall" | "squareSmallFilled" | "squareDarkShade" | "squareMediumShade" | "squareLightShade" | "squareTop" | "squareBottom" | "squareLeft" | "squareRight" | "squareCenter" | "circle" | "circleFilled" | "circleDotted" | "circleDouble" | "circleCircle" | "circleCross" | "circlePipe" | "circleQuestionMark" | "radioOn" | "radioOff" | "checkboxOn" | "checkboxOff" | "checkboxCircleOn" | "checkboxCircleOff" | "questionMarkPrefix" | "bullet" | "dot" | "ellipsis" | "pointer" | "pointerSmall" | "triangleUp" | "triangleUpSmall" | "triangleUpOutline" | "triangleDown" | "triangleDownSmall" | "triangleLeft" | "triangleLeftSmall" | "triangleRight" | "triangleRightSmall" | "lozenge" | "lozengeOutline" | "home" | "hamburger" | "smiley" | "mustache" | "heart" | "star" | "play" | "musicNote" | "musicNoteBeamed" | "nodejs" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowLeftRight" | "arrowUpDown" | "almostEqual" | "notEqual" | "lessOrEqual" | "greaterOrEqual" | "identical" | "subscriptZero" | "subscriptOne" | "subscriptTwo" | "subscriptThree" | "subscriptFour" | "subscriptFive" | "subscriptSix" | "subscriptSeven" | "subscriptEight" | "subscriptNine" | "oneHalf" | "oneThird" | "oneQuarter" | "oneFifth" | "oneSixth" | "oneSeventh" | "oneEighth" | "oneNinth" | "oneTenth" | "twoThirds" | "twoFifths" | "threeQuarters" | "threeFifths" | "threeEighths" | "fourFifths" | "fiveSixths" | "fiveEighths" | "sevenEighth" | "line" | "lineBold" | "lineDouble" | "lineDashed0" | "lineDashed1" | "lineDashed2" | "lineDashed3" | "lineDashed4" | "lineDashed5" | "lineDashed6" | "lineDashed7" | "lineDashed8" | "lineDashed9" | "lineDashed10" | "lineDashed11" | "lineDashed12" | "lineDashed13" | "lineDashed14" | "lineDashed15" | "lineVertical" | "lineVerticalBold" | "lineVerticalDouble" | "lineVerticalDashed0" | "lineVerticalDashed1" | "lineVerticalDashed2" | "lineVerticalDashed3" | "lineVerticalDashed4" | "lineVerticalDashed5" | "lineVerticalDashed6" | "lineVerticalDashed7" | "lineVerticalDashed8" | "lineVerticalDashed9" | "lineVerticalDashed10" | "lineVerticalDashed11" | "lineDownLeft" | "lineDownLeftArc" | "lineDownBoldLeftBold" | "lineDownBoldLeft" | "lineDownLeftBold" | "lineDownDoubleLeftDouble" | "lineDownDoubleLeft" | "lineDownLeftDouble" | "lineDownRight" | "lineDownRightArc" | "lineDownBoldRightBold" | "lineDownBoldRight" | "lineDownRightBold" | "lineDownDoubleRightDouble" | "lineDownDoubleRight" | "lineDownRightDouble" | "lineUpLeft" | "lineUpLeftArc" | "lineUpBoldLeftBold" | "lineUpBoldLeft" | "lineUpLeftBold" | "lineUpDoubleLeftDouble" | "lineUpDoubleLeft" | "lineUpLeftDouble" | "lineUpRight" | "lineUpRightArc" | "lineUpBoldRightBold" | "lineUpBoldRight" | "lineUpRightBold" | "lineUpDoubleRightDouble" | "lineUpDoubleRight" | "lineUpRightDouble" | "lineUpDownLeft" | "lineUpBoldDownBoldLeftBold" | "lineUpBoldDownBoldLeft" | "lineUpDownLeftBold" | "lineUpBoldDownLeftBold" | "lineUpDownBoldLeftBold" | "lineUpDownBoldLeft" | "lineUpBoldDownLeft" | "lineUpDoubleDownDoubleLeftDouble" | "lineUpDoubleDownDoubleLeft" | "lineUpDownLeftDouble" | "lineUpDownRight" | "lineUpBoldDownBoldRightBold" | "lineUpBoldDownBoldRight" | "lineUpDownRightBold" | "lineUpBoldDownRightBold" | "lineUpDownBoldRightBold" | "lineUpDownBoldRight" | "lineUpBoldDownRight" | "lineUpDoubleDownDoubleRightDouble" | "lineUpDoubleDownDoubleRight" | "lineUpDownRightDouble" | "lineDownLeftRight" | "lineDownBoldLeftBoldRightBold" | "lineDownLeftBoldRightBold" | "lineDownBoldLeftRight" | "lineDownBoldLeftBoldRight" | "lineDownBoldLeftRightBold" | "lineDownLeftRightBold" | "lineDownLeftBoldRight" | "lineDownDoubleLeftDoubleRightDouble" | "lineDownDoubleLeftRight" | "lineDownLeftDoubleRightDouble" | "lineUpLeftRight" | "lineUpBoldLeftBoldRightBold" | "lineUpLeftBoldRightBold" | "lineUpBoldLeftRight" | "lineUpBoldLeftBoldRight" | "lineUpBoldLeftRightBold" | "lineUpLeftRightBold" | "lineUpLeftBoldRight" | "lineUpDoubleLeftDoubleRightDouble" | "lineUpDoubleLeftRight" | "lineUpLeftDoubleRightDouble" | "lineUpDownLeftRight" | "lineUpBoldDownBoldLeftBoldRightBold" | "lineUpDownBoldLeftBoldRightBold" | "lineUpBoldDownLeftBoldRightBold" | "lineUpBoldDownBoldLeftRightBold" | "lineUpBoldDownBoldLeftBoldRight" | "lineUpBoldDownLeftRight" | "lineUpDownBoldLeftRight" | "lineUpDownLeftBoldRight" | "lineUpDownLeftRightBold" | "lineUpBoldDownBoldLeftRight" | "lineUpDownLeftBoldRightBold" | "lineUpBoldDownLeftBoldRight" | "lineUpBoldDownLeftRightBold" | "lineUpDownBoldLeftBoldRight" | "lineUpDownBoldLeftRightBold" | "lineUpDoubleDownDoubleLeftDoubleRightDouble" | "lineUpDoubleDownDoubleLeftRight" | "lineUpDownLeftDoubleRightDouble" | "lineCross" | "lineBackslash" | "lineSlash") | "";
93
+ header?: import('chalk-string').Styles | "";
94
+ classes?: {
95
+ readonly [errorName: string]: Omit<import('beautiful-error').Options, "classes">;
96
+ } & {
97
+ readonly [errorName: string]: Omit<import('handle-cli-error').Options, "classes">;
98
+ };
99
+ exitCode?: number;
100
+ silent?: boolean;
101
+ timeout?: number;
102
+ log?: (message: string) => void;
103
+ };
104
+ instanceMethods: {
105
+ exit: ({ error, options }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => void;
106
+ pretty: ({ error, options: { exitCode, silent, timeout, log, ...beautifulErrorOptions }, }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => string;
107
+ };
108
+ }[], {
109
+ /** Pipeline stage where the error originated (composed at runtime). */
110
+ phase: string;
111
+ /** True if this error represents a violated invariant, not a user error. */
112
+ isDefect: boolean;
113
+ /** Process exit code used by BaseError.exit(). */
114
+ exitCode: number;
115
+ } & object, import('modern-errors').CustomClass>;
116
+ /** Input or data does not satisfy validation rules. */
117
+ export declare const ValidationError: import('modern-errors').SpecificErrorClass<{
118
+ name: "cli";
119
+ isOptions: (options: unknown) => boolean;
120
+ getOptions: (options?: import('modern-errors-cli').Options) => {
121
+ custom: string;
122
+ stack?: boolean;
123
+ cause?: boolean;
124
+ props?: boolean;
125
+ colors?: boolean;
126
+ icon?: ("infinity" | "tick" | "info" | "warning" | "cross" | "square" | "squareSmall" | "squareSmallFilled" | "squareDarkShade" | "squareMediumShade" | "squareLightShade" | "squareTop" | "squareBottom" | "squareLeft" | "squareRight" | "squareCenter" | "circle" | "circleFilled" | "circleDotted" | "circleDouble" | "circleCircle" | "circleCross" | "circlePipe" | "circleQuestionMark" | "radioOn" | "radioOff" | "checkboxOn" | "checkboxOff" | "checkboxCircleOn" | "checkboxCircleOff" | "questionMarkPrefix" | "bullet" | "dot" | "ellipsis" | "pointer" | "pointerSmall" | "triangleUp" | "triangleUpSmall" | "triangleUpOutline" | "triangleDown" | "triangleDownSmall" | "triangleLeft" | "triangleLeftSmall" | "triangleRight" | "triangleRightSmall" | "lozenge" | "lozengeOutline" | "home" | "hamburger" | "smiley" | "mustache" | "heart" | "star" | "play" | "musicNote" | "musicNoteBeamed" | "nodejs" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowLeftRight" | "arrowUpDown" | "almostEqual" | "notEqual" | "lessOrEqual" | "greaterOrEqual" | "identical" | "subscriptZero" | "subscriptOne" | "subscriptTwo" | "subscriptThree" | "subscriptFour" | "subscriptFive" | "subscriptSix" | "subscriptSeven" | "subscriptEight" | "subscriptNine" | "oneHalf" | "oneThird" | "oneQuarter" | "oneFifth" | "oneSixth" | "oneSeventh" | "oneEighth" | "oneNinth" | "oneTenth" | "twoThirds" | "twoFifths" | "threeQuarters" | "threeFifths" | "threeEighths" | "fourFifths" | "fiveSixths" | "fiveEighths" | "sevenEighth" | "line" | "lineBold" | "lineDouble" | "lineDashed0" | "lineDashed1" | "lineDashed2" | "lineDashed3" | "lineDashed4" | "lineDashed5" | "lineDashed6" | "lineDashed7" | "lineDashed8" | "lineDashed9" | "lineDashed10" | "lineDashed11" | "lineDashed12" | "lineDashed13" | "lineDashed14" | "lineDashed15" | "lineVertical" | "lineVerticalBold" | "lineVerticalDouble" | "lineVerticalDashed0" | "lineVerticalDashed1" | "lineVerticalDashed2" | "lineVerticalDashed3" | "lineVerticalDashed4" | "lineVerticalDashed5" | "lineVerticalDashed6" | "lineVerticalDashed7" | "lineVerticalDashed8" | "lineVerticalDashed9" | "lineVerticalDashed10" | "lineVerticalDashed11" | "lineDownLeft" | "lineDownLeftArc" | "lineDownBoldLeftBold" | "lineDownBoldLeft" | "lineDownLeftBold" | "lineDownDoubleLeftDouble" | "lineDownDoubleLeft" | "lineDownLeftDouble" | "lineDownRight" | "lineDownRightArc" | "lineDownBoldRightBold" | "lineDownBoldRight" | "lineDownRightBold" | "lineDownDoubleRightDouble" | "lineDownDoubleRight" | "lineDownRightDouble" | "lineUpLeft" | "lineUpLeftArc" | "lineUpBoldLeftBold" | "lineUpBoldLeft" | "lineUpLeftBold" | "lineUpDoubleLeftDouble" | "lineUpDoubleLeft" | "lineUpLeftDouble" | "lineUpRight" | "lineUpRightArc" | "lineUpBoldRightBold" | "lineUpBoldRight" | "lineUpRightBold" | "lineUpDoubleRightDouble" | "lineUpDoubleRight" | "lineUpRightDouble" | "lineUpDownLeft" | "lineUpBoldDownBoldLeftBold" | "lineUpBoldDownBoldLeft" | "lineUpDownLeftBold" | "lineUpBoldDownLeftBold" | "lineUpDownBoldLeftBold" | "lineUpDownBoldLeft" | "lineUpBoldDownLeft" | "lineUpDoubleDownDoubleLeftDouble" | "lineUpDoubleDownDoubleLeft" | "lineUpDownLeftDouble" | "lineUpDownRight" | "lineUpBoldDownBoldRightBold" | "lineUpBoldDownBoldRight" | "lineUpDownRightBold" | "lineUpBoldDownRightBold" | "lineUpDownBoldRightBold" | "lineUpDownBoldRight" | "lineUpBoldDownRight" | "lineUpDoubleDownDoubleRightDouble" | "lineUpDoubleDownDoubleRight" | "lineUpDownRightDouble" | "lineDownLeftRight" | "lineDownBoldLeftBoldRightBold" | "lineDownLeftBoldRightBold" | "lineDownBoldLeftRight" | "lineDownBoldLeftBoldRight" | "lineDownBoldLeftRightBold" | "lineDownLeftRightBold" | "lineDownLeftBoldRight" | "lineDownDoubleLeftDoubleRightDouble" | "lineDownDoubleLeftRight" | "lineDownLeftDoubleRightDouble" | "lineUpLeftRight" | "lineUpBoldLeftBoldRightBold" | "lineUpLeftBoldRightBold" | "lineUpBoldLeftRight" | "lineUpBoldLeftBoldRight" | "lineUpBoldLeftRightBold" | "lineUpLeftRightBold" | "lineUpLeftBoldRight" | "lineUpDoubleLeftDoubleRightDouble" | "lineUpDoubleLeftRight" | "lineUpLeftDoubleRightDouble" | "lineUpDownLeftRight" | "lineUpBoldDownBoldLeftBoldRightBold" | "lineUpDownBoldLeftBoldRightBold" | "lineUpBoldDownLeftBoldRightBold" | "lineUpBoldDownBoldLeftRightBold" | "lineUpBoldDownBoldLeftBoldRight" | "lineUpBoldDownLeftRight" | "lineUpDownBoldLeftRight" | "lineUpDownLeftBoldRight" | "lineUpDownLeftRightBold" | "lineUpBoldDownBoldLeftRight" | "lineUpDownLeftBoldRightBold" | "lineUpBoldDownLeftBoldRight" | "lineUpBoldDownLeftRightBold" | "lineUpDownBoldLeftBoldRight" | "lineUpDownBoldLeftRightBold" | "lineUpDoubleDownDoubleLeftDoubleRightDouble" | "lineUpDoubleDownDoubleLeftRight" | "lineUpDownLeftDoubleRightDouble" | "lineCross" | "lineBackslash" | "lineSlash") | "";
127
+ header?: import('chalk-string').Styles | "";
128
+ classes?: {
129
+ readonly [errorName: string]: Omit<import('beautiful-error').Options, "classes">;
130
+ } & {
131
+ readonly [errorName: string]: Omit<import('handle-cli-error').Options, "classes">;
132
+ };
133
+ exitCode?: number;
134
+ silent?: boolean;
135
+ timeout?: number;
136
+ log?: (message: string) => void;
137
+ };
138
+ instanceMethods: {
139
+ exit: ({ error, options }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => void;
140
+ pretty: ({ error, options: { exitCode, silent, timeout, log, ...beautifulErrorOptions }, }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => string;
141
+ };
142
+ }[], {
143
+ /** Pipeline stage where the error originated (composed at runtime). */
144
+ phase: string;
145
+ /** True if this error represents a violated invariant, not a user error. */
146
+ isDefect: boolean;
147
+ /** Process exit code used by BaseError.exit(). */
148
+ exitCode: number;
149
+ } & object, import('modern-errors').CustomClass>;
150
+ /** File system or network I/O failed (permissions, disk full, timeout). */
151
+ export declare const IoError: import('modern-errors').SpecificErrorClass<{
152
+ name: "cli";
153
+ isOptions: (options: unknown) => boolean;
154
+ getOptions: (options?: import('modern-errors-cli').Options) => {
155
+ custom: string;
156
+ stack?: boolean;
157
+ cause?: boolean;
158
+ props?: boolean;
159
+ colors?: boolean;
160
+ icon?: ("infinity" | "tick" | "info" | "warning" | "cross" | "square" | "squareSmall" | "squareSmallFilled" | "squareDarkShade" | "squareMediumShade" | "squareLightShade" | "squareTop" | "squareBottom" | "squareLeft" | "squareRight" | "squareCenter" | "circle" | "circleFilled" | "circleDotted" | "circleDouble" | "circleCircle" | "circleCross" | "circlePipe" | "circleQuestionMark" | "radioOn" | "radioOff" | "checkboxOn" | "checkboxOff" | "checkboxCircleOn" | "checkboxCircleOff" | "questionMarkPrefix" | "bullet" | "dot" | "ellipsis" | "pointer" | "pointerSmall" | "triangleUp" | "triangleUpSmall" | "triangleUpOutline" | "triangleDown" | "triangleDownSmall" | "triangleLeft" | "triangleLeftSmall" | "triangleRight" | "triangleRightSmall" | "lozenge" | "lozengeOutline" | "home" | "hamburger" | "smiley" | "mustache" | "heart" | "star" | "play" | "musicNote" | "musicNoteBeamed" | "nodejs" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowLeftRight" | "arrowUpDown" | "almostEqual" | "notEqual" | "lessOrEqual" | "greaterOrEqual" | "identical" | "subscriptZero" | "subscriptOne" | "subscriptTwo" | "subscriptThree" | "subscriptFour" | "subscriptFive" | "subscriptSix" | "subscriptSeven" | "subscriptEight" | "subscriptNine" | "oneHalf" | "oneThird" | "oneQuarter" | "oneFifth" | "oneSixth" | "oneSeventh" | "oneEighth" | "oneNinth" | "oneTenth" | "twoThirds" | "twoFifths" | "threeQuarters" | "threeFifths" | "threeEighths" | "fourFifths" | "fiveSixths" | "fiveEighths" | "sevenEighth" | "line" | "lineBold" | "lineDouble" | "lineDashed0" | "lineDashed1" | "lineDashed2" | "lineDashed3" | "lineDashed4" | "lineDashed5" | "lineDashed6" | "lineDashed7" | "lineDashed8" | "lineDashed9" | "lineDashed10" | "lineDashed11" | "lineDashed12" | "lineDashed13" | "lineDashed14" | "lineDashed15" | "lineVertical" | "lineVerticalBold" | "lineVerticalDouble" | "lineVerticalDashed0" | "lineVerticalDashed1" | "lineVerticalDashed2" | "lineVerticalDashed3" | "lineVerticalDashed4" | "lineVerticalDashed5" | "lineVerticalDashed6" | "lineVerticalDashed7" | "lineVerticalDashed8" | "lineVerticalDashed9" | "lineVerticalDashed10" | "lineVerticalDashed11" | "lineDownLeft" | "lineDownLeftArc" | "lineDownBoldLeftBold" | "lineDownBoldLeft" | "lineDownLeftBold" | "lineDownDoubleLeftDouble" | "lineDownDoubleLeft" | "lineDownLeftDouble" | "lineDownRight" | "lineDownRightArc" | "lineDownBoldRightBold" | "lineDownBoldRight" | "lineDownRightBold" | "lineDownDoubleRightDouble" | "lineDownDoubleRight" | "lineDownRightDouble" | "lineUpLeft" | "lineUpLeftArc" | "lineUpBoldLeftBold" | "lineUpBoldLeft" | "lineUpLeftBold" | "lineUpDoubleLeftDouble" | "lineUpDoubleLeft" | "lineUpLeftDouble" | "lineUpRight" | "lineUpRightArc" | "lineUpBoldRightBold" | "lineUpBoldRight" | "lineUpRightBold" | "lineUpDoubleRightDouble" | "lineUpDoubleRight" | "lineUpRightDouble" | "lineUpDownLeft" | "lineUpBoldDownBoldLeftBold" | "lineUpBoldDownBoldLeft" | "lineUpDownLeftBold" | "lineUpBoldDownLeftBold" | "lineUpDownBoldLeftBold" | "lineUpDownBoldLeft" | "lineUpBoldDownLeft" | "lineUpDoubleDownDoubleLeftDouble" | "lineUpDoubleDownDoubleLeft" | "lineUpDownLeftDouble" | "lineUpDownRight" | "lineUpBoldDownBoldRightBold" | "lineUpBoldDownBoldRight" | "lineUpDownRightBold" | "lineUpBoldDownRightBold" | "lineUpDownBoldRightBold" | "lineUpDownBoldRight" | "lineUpBoldDownRight" | "lineUpDoubleDownDoubleRightDouble" | "lineUpDoubleDownDoubleRight" | "lineUpDownRightDouble" | "lineDownLeftRight" | "lineDownBoldLeftBoldRightBold" | "lineDownLeftBoldRightBold" | "lineDownBoldLeftRight" | "lineDownBoldLeftBoldRight" | "lineDownBoldLeftRightBold" | "lineDownLeftRightBold" | "lineDownLeftBoldRight" | "lineDownDoubleLeftDoubleRightDouble" | "lineDownDoubleLeftRight" | "lineDownLeftDoubleRightDouble" | "lineUpLeftRight" | "lineUpBoldLeftBoldRightBold" | "lineUpLeftBoldRightBold" | "lineUpBoldLeftRight" | "lineUpBoldLeftBoldRight" | "lineUpBoldLeftRightBold" | "lineUpLeftRightBold" | "lineUpLeftBoldRight" | "lineUpDoubleLeftDoubleRightDouble" | "lineUpDoubleLeftRight" | "lineUpLeftDoubleRightDouble" | "lineUpDownLeftRight" | "lineUpBoldDownBoldLeftBoldRightBold" | "lineUpDownBoldLeftBoldRightBold" | "lineUpBoldDownLeftBoldRightBold" | "lineUpBoldDownBoldLeftRightBold" | "lineUpBoldDownBoldLeftBoldRight" | "lineUpBoldDownLeftRight" | "lineUpDownBoldLeftRight" | "lineUpDownLeftBoldRight" | "lineUpDownLeftRightBold" | "lineUpBoldDownBoldLeftRight" | "lineUpDownLeftBoldRightBold" | "lineUpBoldDownLeftBoldRight" | "lineUpBoldDownLeftRightBold" | "lineUpDownBoldLeftBoldRight" | "lineUpDownBoldLeftRightBold" | "lineUpDoubleDownDoubleLeftDoubleRightDouble" | "lineUpDoubleDownDoubleLeftRight" | "lineUpDownLeftDoubleRightDouble" | "lineCross" | "lineBackslash" | "lineSlash") | "";
161
+ header?: import('chalk-string').Styles | "";
162
+ classes?: {
163
+ readonly [errorName: string]: Omit<import('beautiful-error').Options, "classes">;
164
+ } & {
165
+ readonly [errorName: string]: Omit<import('handle-cli-error').Options, "classes">;
166
+ };
167
+ exitCode?: number;
168
+ silent?: boolean;
169
+ timeout?: number;
170
+ log?: (message: string) => void;
171
+ };
172
+ instanceMethods: {
173
+ exit: ({ error, options }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => void;
174
+ pretty: ({ error, options: { exitCode, silent, timeout, log, ...beautifulErrorOptions }, }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => string;
175
+ };
176
+ }[], {
177
+ /** Pipeline stage where the error originated (composed at runtime). */
178
+ phase: string;
179
+ /** True if this error represents a violated invariant, not a user error. */
180
+ isDefect: boolean;
181
+ /** Process exit code used by BaseError.exit(). */
182
+ exitCode: number;
183
+ } & object, import('modern-errors').CustomClass>;
184
+ /**
185
+ * Represents an unexpected internal failure — a violated invariant or
186
+ * impossible state that should never occur during normal operation.
187
+ *
188
+ * Exit code 70 (EX_SOFTWARE) signals an internal software error.
189
+ */
190
+ export declare const DefectError: import('modern-errors').SpecificErrorClass<{
191
+ name: "cli";
192
+ isOptions: (options: unknown) => boolean;
193
+ getOptions: (options?: import('modern-errors-cli').Options) => {
194
+ custom: string;
195
+ stack?: boolean;
196
+ cause?: boolean;
197
+ props?: boolean;
198
+ colors?: boolean;
199
+ icon?: ("infinity" | "tick" | "info" | "warning" | "cross" | "square" | "squareSmall" | "squareSmallFilled" | "squareDarkShade" | "squareMediumShade" | "squareLightShade" | "squareTop" | "squareBottom" | "squareLeft" | "squareRight" | "squareCenter" | "circle" | "circleFilled" | "circleDotted" | "circleDouble" | "circleCircle" | "circleCross" | "circlePipe" | "circleQuestionMark" | "radioOn" | "radioOff" | "checkboxOn" | "checkboxOff" | "checkboxCircleOn" | "checkboxCircleOff" | "questionMarkPrefix" | "bullet" | "dot" | "ellipsis" | "pointer" | "pointerSmall" | "triangleUp" | "triangleUpSmall" | "triangleUpOutline" | "triangleDown" | "triangleDownSmall" | "triangleLeft" | "triangleLeftSmall" | "triangleRight" | "triangleRightSmall" | "lozenge" | "lozengeOutline" | "home" | "hamburger" | "smiley" | "mustache" | "heart" | "star" | "play" | "musicNote" | "musicNoteBeamed" | "nodejs" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowLeftRight" | "arrowUpDown" | "almostEqual" | "notEqual" | "lessOrEqual" | "greaterOrEqual" | "identical" | "subscriptZero" | "subscriptOne" | "subscriptTwo" | "subscriptThree" | "subscriptFour" | "subscriptFive" | "subscriptSix" | "subscriptSeven" | "subscriptEight" | "subscriptNine" | "oneHalf" | "oneThird" | "oneQuarter" | "oneFifth" | "oneSixth" | "oneSeventh" | "oneEighth" | "oneNinth" | "oneTenth" | "twoThirds" | "twoFifths" | "threeQuarters" | "threeFifths" | "threeEighths" | "fourFifths" | "fiveSixths" | "fiveEighths" | "sevenEighth" | "line" | "lineBold" | "lineDouble" | "lineDashed0" | "lineDashed1" | "lineDashed2" | "lineDashed3" | "lineDashed4" | "lineDashed5" | "lineDashed6" | "lineDashed7" | "lineDashed8" | "lineDashed9" | "lineDashed10" | "lineDashed11" | "lineDashed12" | "lineDashed13" | "lineDashed14" | "lineDashed15" | "lineVertical" | "lineVerticalBold" | "lineVerticalDouble" | "lineVerticalDashed0" | "lineVerticalDashed1" | "lineVerticalDashed2" | "lineVerticalDashed3" | "lineVerticalDashed4" | "lineVerticalDashed5" | "lineVerticalDashed6" | "lineVerticalDashed7" | "lineVerticalDashed8" | "lineVerticalDashed9" | "lineVerticalDashed10" | "lineVerticalDashed11" | "lineDownLeft" | "lineDownLeftArc" | "lineDownBoldLeftBold" | "lineDownBoldLeft" | "lineDownLeftBold" | "lineDownDoubleLeftDouble" | "lineDownDoubleLeft" | "lineDownLeftDouble" | "lineDownRight" | "lineDownRightArc" | "lineDownBoldRightBold" | "lineDownBoldRight" | "lineDownRightBold" | "lineDownDoubleRightDouble" | "lineDownDoubleRight" | "lineDownRightDouble" | "lineUpLeft" | "lineUpLeftArc" | "lineUpBoldLeftBold" | "lineUpBoldLeft" | "lineUpLeftBold" | "lineUpDoubleLeftDouble" | "lineUpDoubleLeft" | "lineUpLeftDouble" | "lineUpRight" | "lineUpRightArc" | "lineUpBoldRightBold" | "lineUpBoldRight" | "lineUpRightBold" | "lineUpDoubleRightDouble" | "lineUpDoubleRight" | "lineUpRightDouble" | "lineUpDownLeft" | "lineUpBoldDownBoldLeftBold" | "lineUpBoldDownBoldLeft" | "lineUpDownLeftBold" | "lineUpBoldDownLeftBold" | "lineUpDownBoldLeftBold" | "lineUpDownBoldLeft" | "lineUpBoldDownLeft" | "lineUpDoubleDownDoubleLeftDouble" | "lineUpDoubleDownDoubleLeft" | "lineUpDownLeftDouble" | "lineUpDownRight" | "lineUpBoldDownBoldRightBold" | "lineUpBoldDownBoldRight" | "lineUpDownRightBold" | "lineUpBoldDownRightBold" | "lineUpDownBoldRightBold" | "lineUpDownBoldRight" | "lineUpBoldDownRight" | "lineUpDoubleDownDoubleRightDouble" | "lineUpDoubleDownDoubleRight" | "lineUpDownRightDouble" | "lineDownLeftRight" | "lineDownBoldLeftBoldRightBold" | "lineDownLeftBoldRightBold" | "lineDownBoldLeftRight" | "lineDownBoldLeftBoldRight" | "lineDownBoldLeftRightBold" | "lineDownLeftRightBold" | "lineDownLeftBoldRight" | "lineDownDoubleLeftDoubleRightDouble" | "lineDownDoubleLeftRight" | "lineDownLeftDoubleRightDouble" | "lineUpLeftRight" | "lineUpBoldLeftBoldRightBold" | "lineUpLeftBoldRightBold" | "lineUpBoldLeftRight" | "lineUpBoldLeftBoldRight" | "lineUpBoldLeftRightBold" | "lineUpLeftRightBold" | "lineUpLeftBoldRight" | "lineUpDoubleLeftDoubleRightDouble" | "lineUpDoubleLeftRight" | "lineUpLeftDoubleRightDouble" | "lineUpDownLeftRight" | "lineUpBoldDownBoldLeftBoldRightBold" | "lineUpDownBoldLeftBoldRightBold" | "lineUpBoldDownLeftBoldRightBold" | "lineUpBoldDownBoldLeftRightBold" | "lineUpBoldDownBoldLeftBoldRight" | "lineUpBoldDownLeftRight" | "lineUpDownBoldLeftRight" | "lineUpDownLeftBoldRight" | "lineUpDownLeftRightBold" | "lineUpBoldDownBoldLeftRight" | "lineUpDownLeftBoldRightBold" | "lineUpBoldDownLeftBoldRight" | "lineUpBoldDownLeftRightBold" | "lineUpDownBoldLeftBoldRight" | "lineUpDownBoldLeftRightBold" | "lineUpDoubleDownDoubleLeftDoubleRightDouble" | "lineUpDoubleDownDoubleLeftRight" | "lineUpDownLeftDoubleRightDouble" | "lineCross" | "lineBackslash" | "lineSlash") | "";
200
+ header?: import('chalk-string').Styles | "";
201
+ classes?: {
202
+ readonly [errorName: string]: Omit<import('beautiful-error').Options, "classes">;
203
+ } & {
204
+ readonly [errorName: string]: Omit<import('handle-cli-error').Options, "classes">;
205
+ };
206
+ exitCode?: number;
207
+ silent?: boolean;
208
+ timeout?: number;
209
+ log?: (message: string) => void;
210
+ };
211
+ instanceMethods: {
212
+ exit: ({ error, options }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => void;
213
+ pretty: ({ error, options: { exitCode, silent, timeout, log, ...beautifulErrorOptions }, }: import('modern-errors').Info<import('modern-errors-cli').Options>["instanceMethods"]) => string;
214
+ };
215
+ }[], {
216
+ phase: string;
217
+ isDefect: boolean;
218
+ exitCode: number;
219
+ }, import('modern-errors').CustomClass>;
220
+ /**
221
+ * Wrap an async entry point with a defect boundary.
222
+ *
223
+ * If the wrapped function throws an exception (i.e. a defect that was not
224
+ * captured as a Result), it is caught, wrapped in a DefectError, and printed
225
+ * via BaseError.exit().
226
+ *
227
+ * @param fn - The entry point function to wrap
228
+ * @throws {DefectError} If an unexpected exception occurs during execution
229
+ */
230
+ export declare function withDefectBoundary(fn: () => Promise<void>): Promise<void>;
@@ -0,0 +1,42 @@
1
+ import { ResultAsync } from 'neverthrow';
2
+ import { EditorReactComponent } from './schema';
3
+ import { NotFoundError, ParseError } from './errors';
4
+ export type { ComponentInfoWithCss, ExtractedCssInfo, ExtractionWarning, ProcessComponentResult, } from './manifest-pipeline';
5
+ export interface ManifestResult {
6
+ component: EditorReactComponent;
7
+ errors: ExtractionError[];
8
+ }
9
+ export interface ExtractionError {
10
+ componentName: string;
11
+ phase: 'render' | 'coupling' | 'css' | 'loader' | 'conversion';
12
+ error: string;
13
+ }
14
+ /**
15
+ * Extract component manifest from a TypeScript source file.
16
+ *
17
+ * @param componentPath - Path to the TypeScript source file
18
+ * @param compiledEntryPath - Path to the built JS entry file of the component's package (e.g. dist/index.js)
19
+ * @returns The manifest result containing components and non-fatal warnings
20
+ * @errors
21
+ * - {@link NotFoundError} — Source file does not exist (phase: `compile`)
22
+ * - {@link ParseError} — TypeScript config or component types could not be parsed (phase: `compile` | `extract`)
23
+ */
24
+ export declare function extractComponentManifest(componentPath: string, compiledEntryPath: string): ResultAsync<ManifestResult, InstanceType<typeof NotFoundError> | InstanceType<typeof ParseError>>;
25
+ /** TypeScript compilation & static analysis */
26
+ export { compileTsFile } from './ts-compiler';
27
+ export { extractAllComponentInfo, extractDefaultComponentInfo } from './information-extractors/ts/components';
28
+ export { extractCssImports } from './information-extractors/ts/css-imports';
29
+ export type { ComponentInfo, PropInfo, ResolvedType, ResolvedKind, DefaultValue, } from './information-extractors/ts/types';
30
+ /** React render-time extraction */
31
+ export { runExtractors, ExtractorStore, buildElementTree, createPropTrackerExtractor, createCssPropertiesExtractor, } from './information-extractors/react';
32
+ export type { ExtractionResult, ReactExtractor, RenderContext, CreateElementEvent, RenderCompleteEvent, ExtractedElement, PropTrackerData, PropTrackerExtractorState, CssPropertiesData, PropSpyContext, } from './information-extractors/react';
33
+ export type { CoupledComponentInfo, CoupledProp, DOMBinding, TrackingStores, PropReadInfo, PropWriteInfo, PropSpyMeta, } from './information-extractors/react';
34
+ /** CSS parsing & selector matching */
35
+ export { parseCss } from './information-extractors/css';
36
+ export type { CSSParserAPI } from './information-extractors/css';
37
+ /** Error classes */
38
+ export { BaseError, NotFoundError, ParseError, ValidationError, IoError, DefectError, withDefectBoundary, } from './errors';
39
+ /** Component loader */
40
+ export { createComponentLoader } from './component-loader';
41
+ export { renderWithExtractors } from './component-renderer';
42
+ export type { CreateElementListener } from './component-renderer';