@withstudiocms/component-registry 0.1.0-beta.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 (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +21 -0
  3. package/README.md +308 -0
  4. package/dist/component-proxy/decoder/decode-codepoint.d.ts +18 -0
  5. package/dist/component-proxy/decoder/decode-codepoint.js +58 -0
  6. package/dist/component-proxy/decoder/decode-data-html.d.ts +1 -0
  7. package/dist/component-proxy/decoder/decode-data-html.js +7 -0
  8. package/dist/component-proxy/decoder/decode-data-xml.d.ts +1 -0
  9. package/dist/component-proxy/decoder/decode-data-xml.js +7 -0
  10. package/dist/component-proxy/decoder/index.d.ts +34 -0
  11. package/dist/component-proxy/decoder/index.js +18 -0
  12. package/dist/component-proxy/decoder/util.d.ts +208 -0
  13. package/dist/component-proxy/decoder/util.js +415 -0
  14. package/dist/component-proxy/index.d.ts +14 -0
  15. package/dist/component-proxy/index.js +39 -0
  16. package/dist/errors.d.ts +76 -0
  17. package/dist/errors.js +48 -0
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.js +6 -0
  20. package/dist/registry/PropsParser.d.ts +15 -0
  21. package/dist/registry/PropsParser.js +210 -0
  22. package/dist/registry/Registry.d.ts +44 -0
  23. package/dist/registry/Registry.js +77 -0
  24. package/dist/registry/consts.d.ts +42 -0
  25. package/dist/registry/consts.js +19 -0
  26. package/dist/registry/handler.d.ts +92 -0
  27. package/dist/registry/handler.js +161 -0
  28. package/dist/registry/index.d.ts +3 -0
  29. package/dist/registry/index.js +3 -0
  30. package/dist/runtime.d.ts +34 -0
  31. package/dist/runtime.js +49 -0
  32. package/dist/transform-html.d.ts +11 -0
  33. package/dist/transform-html.js +10 -0
  34. package/dist/types.d.ts +64 -0
  35. package/dist/types.js +0 -0
  36. package/dist/utils.d.ts +52 -0
  37. package/dist/utils.js +41 -0
  38. package/dist/virtual.d.ts +80 -0
  39. package/package.json +90 -0
@@ -0,0 +1,161 @@
1
+ import { deepmerge, Effect, runEffect } from "@withstudiocms/effect";
2
+ import { z } from "astro/zod";
3
+ import { addVirtualImports, createResolver, defineUtility } from "astro-integration-kit";
4
+ import { convertHyphensToUnderscores, integrationLogger } from "../utils.js";
5
+ import {
6
+ buildAliasExports,
7
+ buildVirtualImport,
8
+ InternalId,
9
+ NameInternalId,
10
+ RuntimeInternalId
11
+ } from "./consts.js";
12
+ import { ComponentRegistry } from "./Registry.js";
13
+ const ComponentRegistryHandlerOptionSchema = z.object({
14
+ config: z.object({
15
+ /**
16
+ * The name of the integration
17
+ */
18
+ name: z.string(),
19
+ /**
20
+ * The virtual module ID for generated imports
21
+ *
22
+ * @example 'virtual:my-integration'
23
+ */
24
+ virtualId: z.string().optional(),
25
+ /**
26
+ * Enables verbose logging
27
+ */
28
+ verbose: z.boolean().default(false).optional()
29
+ }),
30
+ /**
31
+ * A record of user-provided component names to file paths.
32
+ */
33
+ componentRegistry: z.record(z.string(), z.string()).optional(),
34
+ /**
35
+ * A record of built-in component names to file paths.
36
+ */
37
+ builtInComponents: z.record(z.string(), z.string()).optional()
38
+ });
39
+ const resolver = Effect.fn(function* (base) {
40
+ const { resolve: _resolve } = createResolver(base);
41
+ return Effect.fn(
42
+ (fn) => Effect.try({
43
+ try: () => fn(_resolve),
44
+ catch: (error) => {
45
+ console.error("Error occurred while resolving component:", error);
46
+ return new Error("Failed to resolve component", { cause: error });
47
+ }
48
+ })
49
+ );
50
+ });
51
+ const componentRegistryHandler = defineUtility("astro:config:setup")(
52
+ async (params, {
53
+ config: { verbose = false, name, virtualId },
54
+ builtInComponents = {},
55
+ componentRegistry = {}
56
+ }) => await runEffect(
57
+ Effect.gen(function* () {
58
+ const logger = params.logger.fork(`${name}:component-registry`);
59
+ const logInfo = { logger, logLevel: "info", verbose };
60
+ integrationLogger(logInfo, "Setting up component registry...");
61
+ const [resolve, astroConfigResolve, registry] = yield* Effect.all([
62
+ resolver(import.meta.url),
63
+ resolver(params.config.root.pathname),
64
+ ComponentRegistry
65
+ ]);
66
+ const componentKeys = [];
67
+ const components = [];
68
+ const componentRegistryToCheck = yield* deepmerge(
69
+ (fn) => fn({}, builtInComponents, componentRegistry)
70
+ );
71
+ const componentRegistryEntries = Object.entries(componentRegistryToCheck);
72
+ if (Object.keys(componentRegistryToCheck).length === 0) {
73
+ integrationLogger(logInfo, "No components found in the registry, skipping...");
74
+ } else {
75
+ integrationLogger(
76
+ logInfo,
77
+ `Checking ${Object.keys(componentRegistryToCheck).length} components...`
78
+ );
79
+ integrationLogger(logInfo, "Iterating over component registry entries...");
80
+ for (const [key, value] of componentRegistryEntries) {
81
+ integrationLogger(logInfo, `Component "${key}" resolved to "${value}"`);
82
+ if (!value) {
83
+ integrationLogger(logInfo, `Component "${key}" is not defined, skipping...`);
84
+ continue;
85
+ }
86
+ if (typeof value !== "string") {
87
+ integrationLogger(logInfo, `Component "${key}" is not a string, skipping...`);
88
+ continue;
89
+ }
90
+ if (!value.endsWith(".astro")) {
91
+ integrationLogger(
92
+ logInfo,
93
+ `Component "${key}" does not end with .astro, skipping...`
94
+ );
95
+ continue;
96
+ }
97
+ integrationLogger(logInfo, `Resolving path for component "${key}"...`);
98
+ const resolvedPath = yield* astroConfigResolve((fn) => fn(value)).pipe(
99
+ Effect.catchAll((error) => {
100
+ integrationLogger(
101
+ logInfo,
102
+ `Failed to resolve path for component "${key}": ${error}`
103
+ );
104
+ return Effect.succeed(null);
105
+ })
106
+ );
107
+ if (!resolvedPath) {
108
+ integrationLogger(logInfo, `Component "${key}" resolved path is empty, skipping...`);
109
+ continue;
110
+ }
111
+ integrationLogger(logInfo, `Component "${key}" resolved path: "${resolvedPath}"`);
112
+ const keyName = key.toLowerCase();
113
+ const safeKeyName = convertHyphensToUnderscores(keyName);
114
+ componentKeys.push(safeKeyName);
115
+ components.push(`export { default as ${safeKeyName} } from '${resolvedPath}';`);
116
+ yield* registry.registerComponentFromFile(resolvedPath, keyName);
117
+ }
118
+ }
119
+ integrationLogger(logInfo, `Total components found: ${componentKeys.length}`);
120
+ integrationLogger(logInfo, "Extracting component props...");
121
+ const componentProps = yield* registry.getAllComponents().pipe(
122
+ Effect.map((map) => Array.from(map.entries())),
123
+ Effect.map(
124
+ (array) => array.map(([iName, data]) => ({
125
+ ...data,
126
+ name: iName,
127
+ safeName: convertHyphensToUnderscores(iName)
128
+ }))
129
+ )
130
+ );
131
+ integrationLogger(logInfo, `Total component props extracted: ${componentProps.length}`);
132
+ if (verbose && componentProps.length <= 10) {
133
+ integrationLogger(
134
+ logInfo,
135
+ `Registered components:
136
+ ${JSON.stringify(componentProps, null, 2)}`
137
+ );
138
+ } else {
139
+ integrationLogger(
140
+ logInfo,
141
+ `Registered ${componentProps.length} components. Use verbose mode with fewer components to see details.`
142
+ );
143
+ }
144
+ const virtualRuntimeImport = yield* resolve((fn) => fn("../runtime.js"));
145
+ addVirtualImports(params, {
146
+ name,
147
+ imports: {
148
+ [InternalId]: buildVirtualImport(componentKeys, componentProps, components),
149
+ [NameInternalId]: `export default '${name}'; export const name = '${name}';`,
150
+ [RuntimeInternalId]: `export * from '${virtualRuntimeImport}';`,
151
+ ...virtualId ? buildAliasExports(virtualId) : {}
152
+ }
153
+ });
154
+ integrationLogger(logInfo, "Component registry setup complete.");
155
+ }).pipe(Effect.provide(ComponentRegistry.Default))
156
+ )
157
+ );
158
+ export {
159
+ ComponentRegistryHandlerOptionSchema,
160
+ componentRegistryHandler
161
+ };
@@ -0,0 +1,3 @@
1
+ export * from './handler.js';
2
+ export * from './PropsParser.js';
3
+ export * from './Registry.js';
@@ -0,0 +1,3 @@
1
+ export * from "./handler.js";
2
+ export * from "./PropsParser.js";
3
+ export * from "./Registry.js";
@@ -0,0 +1,34 @@
1
+ import { componentProps } from 'virtual:component-registry-internal-proxy';
2
+ import type { SSRResult } from 'astro';
3
+ import type { SanitizeOptions } from 'ultrahtml/transformers/sanitize';
4
+ import type { ComponentRegistryEntry } from './types.js';
5
+ export * from './utils.js';
6
+ export { componentProps };
7
+ export type { ComponentRegistryEntry } from './types.js';
8
+ /**
9
+ * Returns the component registry entries.
10
+ *
11
+ * @returns {ComponentRegistryEntry[]} An object mapping safe component names to their registry entries.
12
+ */
13
+ export declare function getRegistryComponents(): ComponentRegistryEntry[];
14
+ /**
15
+ * @returns A promise that resolves to an object containing the imported components.
16
+ */
17
+ export declare function getRendererComponents(): Promise<Record<string, any>>;
18
+ /**
19
+ * Sets up a component proxy for the renderer.
20
+ *
21
+ * @param result - The SSRResult object from Astro.
22
+ * @returns A promise that resolves to a component proxy containing the components.
23
+ * @throws {ComponentProxyError} If there is an error during setup, it will be prefixed and logged.
24
+ */
25
+ export declare function setupRendererComponentProxy(result: SSRResult): Promise<import("./types.js").ComponentType>;
26
+ /**
27
+ * Creates a renderer function that transforms HTML content using the provided components and sanitization options.
28
+ *
29
+ * @param result - The SSRResult object from Astro.
30
+ * @param sanitizeOpts - Optional sanitization options for the HTML content.
31
+ * @param preRenderer - An optional function to preprocess the HTML content before rendering.
32
+ * @returns A function that takes HTML content as input and returns the transformed HTML.
33
+ */
34
+ export declare function createRenderer(result: SSRResult, sanitizeOpts?: SanitizeOptions, preRenderer?: (content: string) => Promise<string>): Promise<(content: string) => Promise<string>>;
@@ -0,0 +1,49 @@
1
+ import * as registry from "virtual:component-registry-internal-proxy";
2
+ import { componentKeys, componentProps } from "virtual:component-registry-internal-proxy";
3
+ import { name } from "virtual:component-registry-internal-proxy/name";
4
+ import { createComponentProxy } from "./component-proxy/index.js";
5
+ import { toComponentProxyError } from "./errors.js";
6
+ import { transformHTML } from "./transform-html.js";
7
+ import { convertUnderscoresToHyphens } from "./utils.js";
8
+ export * from "./utils.js";
9
+ function getRegistryComponents() {
10
+ return componentProps;
11
+ }
12
+ const buildPrefix = (key, name2) => `Failed to import component "${key}" from [${name2}] component-registry`;
13
+ async function getRendererComponents() {
14
+ const predefinedComponents = {};
15
+ for (const key of componentKeys) {
16
+ try {
17
+ predefinedComponents[convertUnderscoresToHyphens(key)] = registry[key];
18
+ } catch (e) {
19
+ if (e instanceof Error) {
20
+ throw toComponentProxyError(e, buildPrefix(key, name));
21
+ }
22
+ throw toComponentProxyError(new Error("Unknown error"), buildPrefix(key, name));
23
+ }
24
+ }
25
+ return predefinedComponents;
26
+ }
27
+ async function setupRendererComponentProxy(result) {
28
+ const components = await getRendererComponents();
29
+ return createComponentProxy(result, components);
30
+ }
31
+ async function createRenderer(result, sanitizeOpts, preRenderer) {
32
+ const components = await setupRendererComponentProxy(result);
33
+ return async (content) => {
34
+ let html;
35
+ if (preRenderer && typeof preRenderer === "function") {
36
+ html = await preRenderer(content);
37
+ } else {
38
+ html = content;
39
+ }
40
+ return await transformHTML(html, components, sanitizeOpts);
41
+ };
42
+ }
43
+ export {
44
+ componentProps,
45
+ createRenderer,
46
+ getRegistryComponents,
47
+ getRendererComponents,
48
+ setupRendererComponentProxy
49
+ };
@@ -0,0 +1,11 @@
1
+ import type { SanitizeOptions } from 'ultrahtml/transformers/sanitize';
2
+ import type { ComponentType } from './types.js';
3
+ /**
4
+ * Transforms the provided HTML string by applying sanitization and component swapping.
5
+ *
6
+ * @param html - The HTML string to be transformed.
7
+ * @param components - A record of components to be swapped within the HTML. The keys are component names and the values are the corresponding component implementations.
8
+ * @param sanitizeOpts - Optional sanitization options to be applied to the HTML.
9
+ * @returns A promise that resolves to the transformed HTML string.
10
+ */
11
+ export declare function transformHTML(html: string, components: ComponentType, sanitizeOpts?: SanitizeOptions): Promise<string>;
@@ -0,0 +1,10 @@
1
+ import { transform } from "ultrahtml";
2
+ import sanitize from "ultrahtml/transformers/sanitize";
3
+ import swap from "ultrahtml/transformers/swap";
4
+ import { dedent } from "./utils.js";
5
+ async function transformHTML(html, components, sanitizeOpts) {
6
+ return await transform(dedent(html), [sanitize(sanitizeOpts), swap(components)]);
7
+ }
8
+ export {
9
+ transformHTML
10
+ };
@@ -0,0 +1,64 @@
1
+ export type ComponentType = Record<string, any>;
2
+ export type AstroProps = Record<string, any>;
3
+ export type AstroComponentChildren = {
4
+ value: any;
5
+ };
6
+ /**
7
+ * Represents a JSDoc tag with its name and optional text content.
8
+ *
9
+ * @property tagName - The name of the JSDoc tag (e.g., 'param', 'returns').
10
+ * @property text - Optional text associated with the tag, such as a description or type.
11
+ */
12
+ export interface JSDocTag {
13
+ tagName: string;
14
+ text?: string;
15
+ name?: string;
16
+ type?: string;
17
+ }
18
+ /**
19
+ * Represents a property of an Astro component.
20
+ *
21
+ * @property name - The name of the property.
22
+ * @property type - The type of the property as a string.
23
+ * @property optional - Indicates whether the property is optional.
24
+ * @property description - An optional description of the property.
25
+ * @property defaultValue - An optional default value for the property.
26
+ */
27
+ export interface AstroComponentProp {
28
+ readonly name: string;
29
+ readonly type: string;
30
+ readonly optional: boolean;
31
+ readonly description?: string;
32
+ readonly defaultValue?: string;
33
+ readonly jsDocTags?: JSDocTag[];
34
+ }
35
+ /**
36
+ * Represents the properties of an Astro component.
37
+ *
38
+ * @property name - The unique name of the Astro component.
39
+ * @property props - A readonly array of properties (`AstroComponentProp`) associated with the component.
40
+ */
41
+ export interface AstroComponentProps {
42
+ readonly name: string;
43
+ readonly props: ReadonlyArray<AstroComponentProp>;
44
+ }
45
+ /**
46
+ * Represents an entry in the component registry.
47
+ *
48
+ * Extends the `AstroComponentProps` interface to include additional metadata.
49
+ *
50
+ * @property safeName - A readonly string representing a safe, unique identifier for the component.
51
+ */
52
+ export interface ComponentRegistryEntry extends AstroComponentProps {
53
+ readonly safeName: string;
54
+ }
55
+ /**
56
+ * Represents the result of validating a set of properties.
57
+ *
58
+ * @property valid - Indicates whether the validation was successful.
59
+ * @property errors - A readonly array of error messages describing validation failures.
60
+ */
61
+ export interface PropValidationResult {
62
+ readonly valid: boolean;
63
+ readonly errors: ReadonlyArray<string>;
64
+ }
package/dist/types.js ADDED
File without changes
@@ -0,0 +1,52 @@
1
+ import type { AstroIntegrationLogger } from 'astro';
2
+ /**
3
+ * Options for configuring the logger.
4
+ *
5
+ * @property logLevel - The minimum level of messages to log. Can be 'info', 'warn', 'error', or 'debug'.
6
+ * @property logger - The logger instance to use, typically an AstroIntegrationLogger.
7
+ * @property verbose - Optional flag to enable verbose logging output.
8
+ */
9
+ export type LoggerOpts = {
10
+ logLevel: 'info' | 'warn' | 'error' | 'debug';
11
+ logger: AstroIntegrationLogger;
12
+ verbose?: boolean;
13
+ };
14
+ /**
15
+ * Logs a message using the provided logger and options.
16
+ *
17
+ * @param opts - The logger options, including log level, logger instance, and verbosity flag.
18
+ * @param opts.logLevel - The log level to use (e.g., 'debug', 'info', 'warn', 'error').
19
+ * @param opts.logger - The logger object with methods corresponding to log levels.
20
+ * @param opts.verbose - If true, always logs the message; if false, logs only if the level is not 'debug' or 'info'.
21
+ * @param message - The message to log.
22
+ * @returns A promise that resolves when logging is complete.
23
+ */
24
+ export declare const integrationLogger: (opts: LoggerOpts, message: string) => Promise<void>;
25
+ /**
26
+ * Converts all hyphens in a given string to underscores.
27
+ *
28
+ * @param str - The input string containing hyphens to be converted.
29
+ * @returns A new string with all hyphens replaced by underscores.
30
+ */
31
+ export declare function convertHyphensToUnderscores(str: string): string;
32
+ /**
33
+ * Converts all underscores in a given string to hyphens.
34
+ *
35
+ * @param str - The input string containing underscores to be converted.
36
+ * @returns A new string with all underscores replaced by hyphens.
37
+ */
38
+ export declare function convertUnderscoresToHyphens(str: string): string;
39
+ /**
40
+ * Determines the indentation of a given line of text.
41
+ *
42
+ * @param ln - The line of text to analyze.
43
+ * @returns The leading whitespace characters of the line, or an empty string if there is no indentation.
44
+ */
45
+ export declare function getIndent(ln: string): string;
46
+ /**
47
+ * Removes leading indentation from a multi-line string.
48
+ *
49
+ * @param str - The string from which to remove leading indentation.
50
+ * @returns The dedent string output.
51
+ */
52
+ export declare function dedent(str: string): string;
package/dist/utils.js ADDED
@@ -0,0 +1,41 @@
1
+ const integrationLogger = async (opts, message) => {
2
+ const { logLevel, logger, verbose } = opts;
3
+ switch (verbose) {
4
+ case true:
5
+ logger[logLevel](message);
6
+ break;
7
+ case false:
8
+ if (logLevel !== "debug" && logLevel !== "info") {
9
+ logger[logLevel](message);
10
+ }
11
+ break;
12
+ default:
13
+ logger[logLevel](message);
14
+ }
15
+ };
16
+ function convertHyphensToUnderscores(str) {
17
+ return str.replace(/-/g, "_");
18
+ }
19
+ function convertUnderscoresToHyphens(str) {
20
+ return str.replace(/_/g, "-");
21
+ }
22
+ function getIndent(ln) {
23
+ if (ln.trimStart() === ln) return "";
24
+ return ln.slice(0, ln.length - ln.trimStart().length);
25
+ }
26
+ function dedent(str) {
27
+ const lns = str.replace(/^[\r\n]+/, "").split("\n");
28
+ let indent = getIndent(lns[0]);
29
+ if (indent.length === 0 && lns.length > 1) {
30
+ indent = getIndent(lns[1]);
31
+ }
32
+ if (indent.length === 0) return lns.join("\n");
33
+ return lns.map((ln) => ln.startsWith(indent) ? ln.slice(indent.length) : ln).join("\n");
34
+ }
35
+ export {
36
+ convertHyphensToUnderscores,
37
+ convertUnderscoresToHyphens,
38
+ dedent,
39
+ getIndent,
40
+ integrationLogger
41
+ };
@@ -0,0 +1,80 @@
1
+ declare module 'virtual:component-registry-internal-proxy' {
2
+ /**
3
+ * List of component keys that are registered in the component registry.
4
+ */
5
+ export const componentKeys: string[];
6
+
7
+ /**
8
+ * List of component properties that are registered in the component registry.
9
+ *
10
+ * Each entry in the array is an object with a `name` and `props` property.
11
+ * The `props` property is an array of objects representing the properties of the component.
12
+ */
13
+ export const componentProps: import('./types.js').ComponentRegistryEntry[];
14
+ }
15
+
16
+ declare module 'virtual:component-registry-internal-proxy/name' {
17
+ export const name: string;
18
+ export default name;
19
+ }
20
+
21
+ declare module 'virtual:component-registry-internal-proxy/runtime' {
22
+ /**
23
+ * Represents an entry in the component registry.
24
+ *
25
+ * Extends the `AstroComponentProps` interface to include additional metadata.
26
+ *
27
+ * @property safeName - A readonly string representing a safe, unique identifier for the component.
28
+ */
29
+ export type ComponentRegistryEntry = import('./runtime.js').ComponentRegistryEntry;
30
+
31
+ /**
32
+ * Imports components by their keys from the 'studiocms:markdown-remark/user-components' module.
33
+ *
34
+ * @param keys - An array of strings representing the keys of the components to import.
35
+ * @returns A promise that resolves to an object containing the imported components.
36
+ * @throws {MarkdownRemarkError} If any component fails to import, an error is thrown with a prefixed message.
37
+ * @deprecated This function is deprecated and will be removed in future versions.
38
+ * Use `getRendererComponents` instead for importing components from the component registry.
39
+ */
40
+ export const importComponentsKeys: typeof import('./runtime.js').importComponentsKeys;
41
+
42
+ /**
43
+ * @returns A promise that resolves to an object containing the imported components.
44
+ */
45
+ export const getRendererComponents: typeof import('./runtime.js').getRendererComponents;
46
+
47
+ /**
48
+ * Returns the component registry entries.
49
+ *
50
+ * @returns {ComponentRegistryEntry[]} An object mapping safe component names to their registry entries.
51
+ */
52
+ export const getRegistryComponents: typeof import('./runtime.js').getRegistryComponents;
53
+
54
+ /**
55
+ * List of component properties that are registered in the component registry.
56
+ *
57
+ * Each entry in the array is an object with a `name` and `props` property.
58
+ * The `props` property is an array of objects representing the properties of the component.
59
+ */
60
+ export const componentProps: import('./runtime.js').ComponentRegistryEntry[];
61
+
62
+ /**
63
+ * Converts all underscores in a given string to hyphens.
64
+ *
65
+ * @param str - The input string containing underscores to be converted.
66
+ * @returns A new string with all underscores replaced by hyphens.
67
+ */
68
+ export const convertUnderscoresToHyphens: typeof import('./runtime.js').convertUnderscoresToHyphens;
69
+ /**
70
+ * Converts all hyphens in a given string to underscores.
71
+ *
72
+ * @param str - The input string containing hyphens to be converted.
73
+ * @returns A new string with all hyphens replaced by underscores.
74
+ */
75
+ export const convertHyphensToUnderscores: typeof import('./runtime.js').convertHyphensToUnderscores;
76
+
77
+ export const setupRendererComponentProxy: typeof import('./runtime.js').setupRendererComponentProxy;
78
+
79
+ export const createRenderer: typeof import('./runtime.js').createRenderer;
80
+ }
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@withstudiocms/component-registry",
3
+ "version": "0.1.0-beta.1",
4
+ "description": "Component Registry Utilities for Astro",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "withstudiocms",
8
+ "url": "https://studiocms.dev"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/withstudiocms/studiocms.git",
13
+ "directory": "packages/@withstudiocms/component-registry"
14
+ },
15
+ "keywords": [
16
+ "astro-studiocms",
17
+ "cms",
18
+ "studiocms",
19
+ "astro",
20
+ "withastro"
21
+ ],
22
+ "homepage": "https://studiocms.dev",
23
+ "contributors": [
24
+ "Adammatthiesen",
25
+ "jdtjenkins",
26
+ "dreyfus92",
27
+ "code.spirit"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "provenance": true
32
+ },
33
+ "sideEffects": false,
34
+ "files": [
35
+ "dist",
36
+ "LICENSE",
37
+ "CHANGELOG.md",
38
+ "README.md"
39
+ ],
40
+ "exports": {
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "default": "./dist/index.js"
44
+ },
45
+ "./component-proxy": {
46
+ "types": "./dist/component-proxy/index.d.ts",
47
+ "default": "./dist/component-proxy/index.js"
48
+ },
49
+ "./errors": {
50
+ "types": "./dist/errors.d.ts",
51
+ "default": "./dist/errors.js"
52
+ },
53
+ "./runtime": {
54
+ "types": "./dist/runtime.d.ts",
55
+ "default": "./dist/runtime.js"
56
+ },
57
+ "./transform-html": {
58
+ "types": "./dist/transform-html.d.ts",
59
+ "default": "./dist/transform-html.js"
60
+ },
61
+ "./types": {
62
+ "types": "./dist/types.d.ts",
63
+ "default": "./dist/types.js"
64
+ },
65
+ "./utils": {
66
+ "types": "./dist/utils.d.ts",
67
+ "default": "./dist/utils.js"
68
+ }
69
+ },
70
+ "type": "module",
71
+ "dependencies": {
72
+ "astro-integration-kit": "^0.19.0",
73
+ "ts-morph": "^26.0.0",
74
+ "ultrahtml": "1.6.0",
75
+ "@withstudiocms/effect": "0.1.0-beta.1"
76
+ },
77
+ "devDependencies": {
78
+ "@types/node": "^22.0.0",
79
+ "typescript": "^5.9.2"
80
+ },
81
+ "peerDependencies": {
82
+ "astro": "^5.12.9"
83
+ },
84
+ "scripts": {
85
+ "build": "buildkit build 'src/**/*.{ts,d.ts}'",
86
+ "dev": "buildkit dev 'src/**/*.{ts,d.ts}'",
87
+ "test": "buildkit test 'test/**/*.test.js'",
88
+ "typecheck": "tspc -p tsconfig.tspc.json"
89
+ }
90
+ }