@yahoo/uds-create-config 4.46.2 → 4.47.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/dist/configs/build-options.d.ts +5 -2
- package/dist/configs/build-options.js +21 -2
- package/dist/configs/react-native-system.d.ts +2 -0
- package/dist/configs/system.js +4 -0
- package/dist/entities/native/NativeSettings.d.ts +2 -0
- package/dist/entities/system/Settings.d.ts +4 -0
- package/dist/entities/system/component-module.d.ts +43 -1
- package/dist/entities/system/component-module.js +118 -3
- package/dist/framework/Config.d.ts +1 -1
- package/dist/framework/Config.js +1 -1
- package/dist/framework/registry-dir.d.ts +24 -4
- package/dist/framework/registry-dir.js +26 -5
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/migrations/20260930152239_registry_dir_beside_components.d.ts +12 -0
- package/dist/migrations/20260930152239_registry_dir_beside_components.js +10 -0
- package/dist/migrations/20260930153059_build_import_aliases.d.ts +11 -0
- package/dist/migrations/20260930153059_build_import_aliases.js +10 -0
- package/dist/renderer/runtimeComponent.d.ts +3 -0
- package/dist/renderer/runtimeComponent.js +27 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { BUILD_DEFAULTS } from "./configs/build-options.js";
|
|
|
27
27
|
import { resolveValueType, sniffValueType } from "./css/value-type.js";
|
|
28
28
|
import { parseRootFontSize } from "./css/root-font-size.js";
|
|
29
29
|
import { createSliceMemo } from "./framework/memo.js";
|
|
30
|
-
import { resolveInputDir, resolveOutDir, resolveRegistryDir } from "./framework/registry-dir.js";
|
|
30
|
+
import { resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, resolveSourceAlias } from "./framework/registry-dir.js";
|
|
31
31
|
import { safelistEntrySchema } from "./entities/system/safelist.js";
|
|
32
32
|
import { BuildSection, CSS_DEFAULTS, CssSection, PLAYGROUND_DEFAULTS, PlaygroundSection, Settings, SystemSection, classPrefixOf, cssPrefixes, varPrefixOf } from "./entities/system/Settings.js";
|
|
33
33
|
import { isIdentifier, isReservedWord } from "./framework/utils/identifier.js";
|
|
@@ -73,7 +73,7 @@ import { GlobalStyle, globalStyleName } from "./entities/system/GlobalStyle.js";
|
|
|
73
73
|
import { Guidance, guidanceReaches, guidanceScopeOf, guidanceTextOf } from "./entities/system/Guidance.js";
|
|
74
74
|
import { GuidanceStyle } from "./entities/system/GuidanceStyle.js";
|
|
75
75
|
import { isNativeConfig, isSystemConfig } from "./configs/platform.js";
|
|
76
|
-
import { COMPONENT_ENTRY_STATIC, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports } from "./entities/system/component-module.js";
|
|
76
|
+
import { COMPONENT_ENTRY_STATIC, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, linkedComponentModule, linkedModuleView } from "./entities/system/component-module.js";
|
|
77
77
|
import { planCopy, sourceEntries } from "./entities/system/copy-plan.js";
|
|
78
78
|
import { planBreak, planLink, planUnlink, sourceRowStates } from "./entities/system/link-plan.js";
|
|
79
79
|
import { LINK_SLUG, LINK_SLUG_MESSAGE, LinkedSystem, borrowedGroup, borrowedItem, isLinkSlug, resolvedSource, sourceOfGroup, sourceOfItem, sourceSlugFor, sourceUnavailable, suggestLinkSlug } from "./entities/system/LinkedSystem.js";
|
|
@@ -102,4 +102,4 @@ import { inferredRenames } from "./framework/rename-inference.js";
|
|
|
102
102
|
import { ConfigSession, memoryConfigSource } from "./framework/session.js";
|
|
103
103
|
import { EXPORT_MEMBER, packageKey, packageName } from "./framework/utils/package-path.js";
|
|
104
104
|
import { validateSpec } from "./framework/validate-spec.js";
|
|
105
|
-
export { AI_LANES, ANATOMY_MARKER, AiChat, AiFlow, AiGeneration, AiMessage, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, CanvasSection, CapturedNode, Component, Composite, Config, ConfigFormatError, ConfigRejection, ConfigSession, CssSection, DERIVED_COLOR_SPACE, DERIVED_MUTATIONS, Device, Documentation, DocumentationLibrary, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, Entity, File, Font, FontFile, GROUP, GUIDANCE_LANES, GlobalStyle, Guidance, GuidanceStyle, ICON_METADATA_FORMATS, Icon, LINK_SLUG, LINK_SLUG_MESSAGE, LinkedSystem, MINTED, MODIFIER_CATEGORIES, Modifier, Motion, NATIVE_ACTIVATIONS, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, Operation, PLAYGROUND_DEFAULTS, Package, Page, PlaygroundSection, RN_STYLE_KEYS, ReactNativeSystem, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, SLOT_CODE_FORMS, STYLE_PROPERTIES, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, SchemaVersionTooNew, Settings, Snapshot, StyleProperty, System, SystemSection, SystemSource, TOKEN_READERS, Token, Tool, UNCONDITIONAL_PREVIEW_KEY, UNREACHABLE, VOID_ELEMENTS, WEB_ACTIVATIONS, addressOf, alpha, anatomyElementComponent, anatomyIssueKey, anatomyTextProp, applyPathDelta, authoredBag, authoredValue, authoringSignatures, baseOf, bindStateRef, bindingPath, blankComponentBody, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, capturedFromDom, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, className, classPrefixOf, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSpec, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, condArms, condValue, containsMarker, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssString, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropDefaults, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, editOp, elementFromCaptured, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, heldLinked, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, iconResolver, iconToolAxisOptions, iconToolFor, iconToolLibraries, iconToolOf, iconToolsOf, iconVariantAs, inferredRenames, inlineRuleComposites, inputOf, instanceHolding, instanceSpec, intoName, isAuthored, isBinaryAsset, isComposedValue, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isIdentifier, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isPreviewElement, isRef, isReservedWord, isShadow, isSystemConfig, isTokenReader, isTransition, isValueSlot, kebabComponent, keyedPreviewConditions, kindOf, kindsOf, layerPropDrivers, layerPropRoutes, layerRef, layerRoutedProps, layerStyles, layerTextProp, leafAddresses, leafVerb, leavesOfStylePropValue, librariesBoundBy, libraryHolding, lighten, linearGradient, linkedVarNaming, liveStateProps, markerKind, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, nameIconsInTree, namedFields, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, parseRootFontSize, partsOf, pathDelta, pathOf, pathSegments, placedGlyphElement, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propApplies, propInto, propOwner, propRegistryRef, propValueDomain, propValueFromAxis, propsIntoLayer, readStatePointer, readsState, redundantQualifiers, ref, refGraphOf, refLeaf, refListOf, refSchema, refTo, registerSchemaMigrations, renderBindingsOf, renderComposedValue, renderDerivedColor, renderGradient, renderShadow, renderSignature, renderStyleValue, renderTransition, renderedElement, renderedSignatureOf, renderedTarget, resolutionSchema, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValue, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootFontSize, rootLayerOf, routeOf, routedBag, routedProp, routedPropIn, routesContent, routesOf, ruleApplies, ruleCondition, runChangeHooks, safelistEntrySchema, schemaVersionOf, searchEntities, searchTokens, setAtPath, shadow, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitStyleProps, stamp, standsInForCode, statePointerProp, stateRef, stateTest, storedPreview, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, tablerExportName, tablerStyledExportName, toCssPropertyName, tokenBinding, tokenExists, tokenValueRow, tokenValueRows, touchedFields, transition, unadoptedDirectives, unconditionalPreviewProps, unknownStyleLeaves, unreadableBorrows, unstatableConditions, unstatableOverrides, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueForwardsOf, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey };
|
|
105
|
+
export { AI_LANES, ANATOMY_MARKER, AiChat, AiFlow, AiGeneration, AiMessage, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, CanvasSection, CapturedNode, Component, Composite, Config, ConfigFormatError, ConfigRejection, ConfigSession, CssSection, DERIVED_COLOR_SPACE, DERIVED_MUTATIONS, Device, Documentation, DocumentationLibrary, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, Entity, File, Font, FontFile, GROUP, GUIDANCE_LANES, GlobalStyle, Guidance, GuidanceStyle, ICON_METADATA_FORMATS, Icon, LINK_SLUG, LINK_SLUG_MESSAGE, LinkedSystem, MINTED, MODIFIER_CATEGORIES, Modifier, Motion, NATIVE_ACTIVATIONS, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, Operation, PLAYGROUND_DEFAULTS, Package, Page, PlaygroundSection, RN_STYLE_KEYS, ReactNativeSystem, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, SLOT_CODE_FORMS, STYLE_PROPERTIES, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, SchemaVersionTooNew, Settings, Snapshot, StyleProperty, System, SystemSection, SystemSource, TOKEN_READERS, Token, Tool, UNCONDITIONAL_PREVIEW_KEY, UNREACHABLE, VOID_ELEMENTS, WEB_ACTIVATIONS, addressOf, alpha, anatomyElementComponent, anatomyIssueKey, anatomyTextProp, applyPathDelta, authoredBag, authoredValue, authoringSignatures, baseOf, bindStateRef, bindingPath, blankComponentBody, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, capturedFromDom, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, className, classPrefixOf, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSpec, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, condArms, condValue, containsMarker, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssString, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropDefaults, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, editOp, elementFromCaptured, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, heldLinked, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, iconResolver, iconToolAxisOptions, iconToolFor, iconToolLibraries, iconToolOf, iconToolsOf, iconVariantAs, inferredRenames, inlineRuleComposites, inputOf, instanceHolding, instanceSpec, intoName, isAuthored, isBinaryAsset, isComposedValue, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isIdentifier, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isPreviewElement, isRef, isReservedWord, isShadow, isSystemConfig, isTokenReader, isTransition, isValueSlot, kebabComponent, keyedPreviewConditions, kindOf, kindsOf, layerPropDrivers, layerPropRoutes, layerRef, layerRoutedProps, layerStyles, layerTextProp, leafAddresses, leafVerb, leavesOfStylePropValue, librariesBoundBy, libraryHolding, lighten, linearGradient, linkedComponentModule, linkedModuleView, linkedVarNaming, liveStateProps, markerKind, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, nameIconsInTree, namedFields, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, parseRootFontSize, partsOf, pathDelta, pathOf, pathSegments, placedGlyphElement, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propApplies, propInto, propOwner, propRegistryRef, propValueDomain, propValueFromAxis, propsIntoLayer, readStatePointer, readsState, redundantQualifiers, ref, refGraphOf, refLeaf, refListOf, refSchema, refTo, registerSchemaMigrations, renderBindingsOf, renderComposedValue, renderDerivedColor, renderGradient, renderShadow, renderSignature, renderStyleValue, renderTransition, renderedElement, renderedSignatureOf, renderedTarget, resolutionSchema, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, resolveSourceAlias, resolveTokenValue, resolveTokenValueUnder, resolveValue, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootFontSize, rootLayerOf, routeOf, routedBag, routedProp, routedPropIn, routesContent, routesOf, ruleApplies, ruleCondition, runChangeHooks, safelistEntrySchema, schemaVersionOf, searchEntities, searchTokens, setAtPath, shadow, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitStyleProps, stamp, standsInForCode, statePointerProp, stateRef, stateTest, storedPreview, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, tablerExportName, tablerStyledExportName, toCssPropertyName, tokenBinding, tokenExists, tokenValueRow, tokenValueRows, touchedFields, transition, unadoptedDirectives, unconditionalPreviewProps, unknownStyleLeaves, unreadableBorrows, unstatableConditions, unstatableOverrides, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueForwardsOf, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `build.registryDir`'s default moves beside the system's components.
|
|
3
|
+
*
|
|
4
|
+
* Unset, `uds install` now writes linked systems' sources to `registry/` under the root the authored
|
|
5
|
+
* `inputDir` names — `src/uds/registry` in the conventional layout — instead of `.uds-registry` at the
|
|
6
|
+
* project root, so they are imported the way the system's own sources are (`@/uds/registry/<slug>/…`
|
|
7
|
+
* beside `@/uds/components/…`). Only the field's documented default changed; no stored value does, and
|
|
8
|
+
* a config that set `registryDir` keeps it. The hop is identity.
|
|
9
|
+
*/
|
|
10
|
+
import type { SchemaMigration } from '../framework/schema-version';
|
|
11
|
+
export declare const REGISTRY_DIR_BESIDE_COMPONENTS_VERSION = 20260930152239;
|
|
12
|
+
export declare const registryDirBesideComponentsMigration: SchemaMigration;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/migrations/20260930152239_registry_dir_beside_components.ts
|
|
2
|
+
const REGISTRY_DIR_BESIDE_COMPONENTS_VERSION = 20260930152239;
|
|
3
|
+
const registryDirBesideComponentsMigration = {
|
|
4
|
+
version: REGISTRY_DIR_BESIDE_COMPONENTS_VERSION,
|
|
5
|
+
up(json) {
|
|
6
|
+
return json;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { REGISTRY_DIR_BESIDE_COMPONENTS_VERSION, registryDirBesideComponentsMigration };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `build.sourceAlias` and `build.outputAlias` join the build settings.
|
|
3
|
+
*
|
|
4
|
+
* The prefixes a system's sources (`@/uds`) and build output (`#uds`) are imported by, so the tsconfig
|
|
5
|
+
* paths, the loader's rewrite and a linked system's source alias (`<sourceAlias>/registry/<slug>/…`)
|
|
6
|
+
* all follow one declaration instead of a spelling each tool hard-codes. Both optional, defaulting to
|
|
7
|
+
* what every tool already assumed, so the hop is identity.
|
|
8
|
+
*/
|
|
9
|
+
import type { SchemaMigration } from '../framework/schema-version';
|
|
10
|
+
export declare const BUILD_IMPORT_ALIASES_VERSION = 20260930153059;
|
|
11
|
+
export declare const buildImportAliasesMigration: SchemaMigration;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/migrations/20260930153059_build_import_aliases.ts
|
|
2
|
+
const BUILD_IMPORT_ALIASES_VERSION = 20260930153059;
|
|
3
|
+
const buildImportAliasesMigration = {
|
|
4
|
+
version: BUILD_IMPORT_ALIASES_VERSION,
|
|
5
|
+
up(json) {
|
|
6
|
+
return json;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BUILD_IMPORT_ALIASES_VERSION, buildImportAliasesMigration };
|
|
@@ -13,6 +13,9 @@ interface RuntimeComponentStore {
|
|
|
13
13
|
readonly error?: (componentRef: string) => unknown;
|
|
14
14
|
readonly subscribe: (componentRef: string, listener: () => void) => () => void;
|
|
15
15
|
readonly version: (componentRef: string) => number;
|
|
16
|
+
/** Whether the store holds an entry for this exact ref — what a linked module's scoped lookup asks
|
|
17
|
+
* before falling back to the ref as its owner spelled it. */
|
|
18
|
+
readonly has?: (componentRef: string) => boolean;
|
|
16
19
|
}
|
|
17
20
|
type RuntimeComponentRebuildReporter = (componentRef: string, delta: 1 | -1) => void;
|
|
18
21
|
type RuntimeComponentFailureReporter = (componentRef: string, error: unknown, delta: 1 | -1) => void;
|
|
@@ -65,6 +65,29 @@ function branchIdFromUrl(moduleUrl) {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
/** The linked system a module belongs to, when it was served as one (`&slug=yos`). */
|
|
69
|
+
function slugFromUrl(moduleUrl) {
|
|
70
|
+
if (!moduleUrl) return void 0;
|
|
71
|
+
try {
|
|
72
|
+
return new URL(moduleUrl).searchParams.get("slug") ?? void 0;
|
|
73
|
+
} catch {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The ref a linked module's import resolves by in the store it renders into.
|
|
79
|
+
*
|
|
80
|
+
* The module was built against its owner's config, so it names `component:Button` — its OWN Button.
|
|
81
|
+
* A system that links it and authors a Button of its own reaches the owner's as
|
|
82
|
+
* `component:Button@yos`, and `component:Button` there is the other one. The qualified ref is asked
|
|
83
|
+
* first, and the bare one only when nothing is held under it, which is every component the linking
|
|
84
|
+
* system didn't shadow.
|
|
85
|
+
*/
|
|
86
|
+
function scopedRef(componentRef, slug, store) {
|
|
87
|
+
if (!slug || componentRef.includes("@") || !store?.has) return componentRef;
|
|
88
|
+
const qualified = `${componentRef}@${slug}`;
|
|
89
|
+
return store.has(qualified) ? qualified : componentRef;
|
|
90
|
+
}
|
|
68
91
|
const noopUnsubscribe = () => {};
|
|
69
92
|
/**
|
|
70
93
|
* A normal React component import whose implementation resolves through the branch's live registry.
|
|
@@ -75,8 +98,11 @@ const noopUnsubscribe = () => {};
|
|
|
75
98
|
*/
|
|
76
99
|
function runtimeComponent(componentRef, scope) {
|
|
77
100
|
const branchId = scope?.branchId || branchIdFromUrl(scope?.moduleUrl);
|
|
101
|
+
const slug = slugFromUrl(scope?.moduleUrl);
|
|
102
|
+
const authoredRef = componentRef;
|
|
78
103
|
const DynamicComponent = forwardRef((props, forwardedRef) => {
|
|
79
104
|
const store = useContext(RuntimeComponentStoreContext) ?? storeFor(branchId);
|
|
105
|
+
const componentRef = scopedRef(authoredRef, slug, store);
|
|
80
106
|
const subscribe = useCallback((listener) => store?.subscribe(componentRef, listener) ?? noopUnsubscribe, [componentRef, store]);
|
|
81
107
|
const snapshot = useCallback(() => store?.version(componentRef) ?? 0, [componentRef, store]);
|
|
82
108
|
useSyncExternalStore(subscribe, snapshot, snapshot);
|
|
@@ -108,7 +134,7 @@ function runtimeComponent(componentRef, scope) {
|
|
|
108
134
|
ref: forwardedRef
|
|
109
135
|
});
|
|
110
136
|
});
|
|
111
|
-
DynamicComponent.displayName = `RuntimeComponent(${
|
|
137
|
+
DynamicComponent.displayName = `RuntimeComponent(${authoredRef})`;
|
|
112
138
|
return DynamicComponent;
|
|
113
139
|
}
|
|
114
140
|
//#endregion
|