Add shared Quixos React controls and delayed component fallback
This commit is contained in:
@@ -100,7 +100,9 @@ export async function buildComponents({ config, compiler, plan, pkg, output, rec
|
||||
await fs.writeFile(
|
||||
shim,
|
||||
`export * from ${JSON.stringify(url)};` +
|
||||
(name === "@quixos/camino-react" ? "" : `export {default} from ${JSON.stringify(url)};`),
|
||||
(["@quixos/camino-react", "@quixos/camino-react/ui"].includes(name)
|
||||
? ""
|
||||
: `export {default} from ${JSON.stringify(url)};`),
|
||||
);
|
||||
sharedAliases.push("--alias:" + name + "=" + shim, "--external:" + url);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ for (const [id, entry] of Object.entries(config.members)) {
|
||||
`import type {${entry.export} as Props} from ${typeImport};
|
||||
type Assert<T extends true> = T;
|
||||
type ObjectProps = Assert<Props extends object ? true : false>;
|
||||
type ReservedSubject = Assert<"subject" extends keyof Props ? false : true>;
|
||||
type ReservedRendererProps = Assert<Extract<keyof Props, "subject" | "usingComponent" | "provider" | "coverage" | "componentCodeFallback"> extends never ? true : false>;
|
||||
${member.contract === "org.quixos.react.subject-only/1" ? "type SubjectOnly = Assert<{} extends Props ? true : false>;" : ""}
|
||||
export type {Props};\n`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user