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,
|
||||
type: "module",
|
||||
dependencies: {
|
||||
"@ai-ui/tokens": toFileDependency(projectDir, tokensTarball),
|
||||
"@ai-ui/ui": toFileDependency(projectDir, uiTarball),
|
||||
react: uiPackage.devDependencies.react,
|
||||
"react-dom": uiPackage.devDependencies["react-dom"]
|
||||
@@ -172,13 +171,9 @@ import {
|
||||
DialogTrigger,
|
||||
Input
|
||||
} from "@ai-ui/ui";
|
||||
import { setDynamicColor, setTheme } from "@ai-ui/tokens";
|
||||
|
||||
import "./styles.css";
|
||||
|
||||
setTheme("violet");
|
||||
setDynamicColor("#6750A4");
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<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");
|
||||
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
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user