@design-embed/target-react 0.1.0 → 1.0.1

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 (31) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +66 -1
  3. package/dist/design-embed/src/core/diagnostics/diagnostic.d.mts +16 -0
  4. package/dist/design-embed/src/core/nodes.d.mts +63 -0
  5. package/dist/design-embed/src/core/plugins/pluginApi.d.mts +41 -0
  6. package/dist/design-embed/src/core/types.d.mts +98 -0
  7. package/dist/index.d.mts +20 -0
  8. package/dist/index.mjs +964 -0
  9. package/dist/index.test.d.mts +1 -0
  10. package/dist/index.test.mjs +75 -0
  11. package/package.json +12 -10
  12. package/src/index.ts +699 -64
  13. package/dist/index.js +0 -744
  14. package/node_modules/@design-embed/config/README.md +0 -5
  15. package/node_modules/@design-embed/config/dist/index.js +0 -283
  16. package/node_modules/@design-embed/config/package.json +0 -19
  17. package/node_modules/@design-embed/config/src/index.ts +0 -518
  18. package/node_modules/@design-embed/core/README.md +0 -5
  19. package/node_modules/@design-embed/core/dist/diagnostics/diagnostic.js +0 -3
  20. package/node_modules/@design-embed/core/dist/diagnostics/jsonDiagnostic.js +0 -35
  21. package/node_modules/@design-embed/core/dist/index.js +0 -351
  22. package/node_modules/@design-embed/core/dist/pipeline/checkMode.js +0 -29
  23. package/node_modules/@design-embed/core/dist/plugins/pluginApi.js +0 -1
  24. package/node_modules/@design-embed/core/dist/plugins/pluginRegistry.js +0 -25
  25. package/node_modules/@design-embed/core/package.json +0 -19
  26. package/node_modules/@design-embed/core/src/diagnostics/diagnostic.ts +0 -18
  27. package/node_modules/@design-embed/core/src/diagnostics/jsonDiagnostic.ts +0 -51
  28. package/node_modules/@design-embed/core/src/index.ts +0 -591
  29. package/node_modules/@design-embed/core/src/pipeline/checkMode.ts +0 -46
  30. package/node_modules/@design-embed/core/src/plugins/pluginApi.ts +0 -78
  31. package/node_modules/@design-embed/core/src/plugins/pluginRegistry.ts +0 -37
@@ -1,37 +0,0 @@
1
- import type { SourcePlugin, TransformerPlugin } from "./pluginApi.ts";
2
-
3
- export class PluginRegistry {
4
- #sourcePlugins = new Map<string, SourcePlugin>();
5
- #transformers: TransformerPlugin[] = [];
6
-
7
- registerSource(plugin: SourcePlugin): void {
8
- this.#sourcePlugins.set(plugin.name, plugin);
9
- }
10
-
11
- getSource(name: string): SourcePlugin | undefined {
12
- return this.#sourcePlugins.get(name);
13
- }
14
-
15
- listSources(): SourcePlugin[] {
16
- return [...this.#sourcePlugins.values()].sort((left, right) =>
17
- left.name.localeCompare(right.name),
18
- );
19
- }
20
-
21
- registerTransformer(plugin: TransformerPlugin): void {
22
- this.#transformers.push(plugin);
23
- }
24
-
25
- listTransformers(): TransformerPlugin[] {
26
- return sortTransformers(this.#transformers);
27
- }
28
- }
29
-
30
- export function sortTransformers(
31
- transformers: TransformerPlugin[],
32
- ): TransformerPlugin[] {
33
- return [...transformers].sort((left, right) => {
34
- const orderDelta = (left.order ?? 0) - (right.order ?? 0);
35
- return orderDelta || left.name.localeCompare(right.name);
36
- });
37
- }