test(consumer): simplify ui package smoke fixture
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -100,7 +100,6 @@ async function writeConsumerFixture({
|
|||||||
private: true,
|
private: true,
|
||||||
type: "module",
|
type: "module",
|
||||||
dependencies: {
|
dependencies: {
|
||||||
"@ai-ui/tokens": toFileDependency(projectDir, tokensTarball),
|
|
||||||
"@ai-ui/ui": toFileDependency(projectDir, uiTarball),
|
"@ai-ui/ui": toFileDependency(projectDir, uiTarball),
|
||||||
react: uiPackage.devDependencies.react,
|
react: uiPackage.devDependencies.react,
|
||||||
"react-dom": uiPackage.devDependencies["react-dom"]
|
"react-dom": uiPackage.devDependencies["react-dom"]
|
||||||
@@ -172,13 +171,9 @@ import {
|
|||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
Input
|
Input
|
||||||
} from "@ai-ui/ui";
|
} from "@ai-ui/ui";
|
||||||
import { setDynamicColor, setTheme } from "@ai-ui/tokens";
|
|
||||||
|
|
||||||
import "./styles.css";
|
import "./styles.css";
|
||||||
|
|
||||||
setTheme("violet");
|
|
||||||
setDynamicColor("#6750A4");
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<main className="min-h-screen bg-[var(--color-background)] p-8 text-[var(--color-foreground)]">
|
<main className="min-h-screen bg-[var(--color-background)] p-8 text-[var(--color-foreground)]">
|
||||||
@@ -286,12 +281,12 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
console.log("Verifying CommonJS package entrypoints");
|
console.log("Verifying CommonJS package entrypoints");
|
||||||
await run(process.execPath, ["-e", 'const ui=require("@ai-ui/ui"); const tokens=require("@ai-ui/tokens"); if(!ui.Button||!tokens.setTheme||!tokens.setDynamicColor){throw new Error("Missing CommonJS export.");}'], {
|
await run(process.execPath, ["-e", 'const ui=require("@ai-ui/ui"); if(!ui.Button||!ui.Dialog||!ui.Input){throw new Error("Missing CommonJS export.");}'], {
|
||||||
cwd: projectDir
|
cwd: projectDir
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Verifying ESM package entrypoints");
|
console.log("Verifying ESM package entrypoints");
|
||||||
await run(process.execPath, ["--input-type=module", "-e", 'const ui=await import("@ai-ui/ui"); const tokens=await import("@ai-ui/tokens"); if(!ui.Button||!tokens.setTheme||!tokens.setDynamicColor){throw new Error("Missing ESM export.");}'], {
|
await run(process.execPath, ["--input-type=module", "-e", 'const ui=await import("@ai-ui/ui"); if(!ui.Button||!ui.Dialog||!ui.Input){throw new Error("Missing ESM export.");}'], {
|
||||||
cwd: projectDir
|
cwd: projectDir
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user