// Add the browser regression to an already-installed check-package consumer. // Installation/tarball preparation stays exclusively in check-package.mjs. import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const root = path.resolve(import.meta.dirname, ".."); const consumer = path.resolve(process.argv[2] ?? ""); if ( !process.argv[2] || consumer === root || !fs.existsSync(path.join(consumer, "check-client.mjs")) || !fs.existsSync( path.join(consumer, "node_modules/@heroui-vue/components/package.json"), ) ) throw Error( "Pass the independent consumer directory printed by node scripts/check-package.mjs handbook-styles", ); fs.copyFileSync( path.join(root, "tests/fixtures/field-placeholder.vue"), path.join(consumer, "field-placeholder.vue"), ); fs.writeFileSync( path.join(consumer, "main.js"), 'import {createApp} from "vue";\nimport App from "./field-placeholder.vue";\nimport "@heroui-vue/styles/css";\ncreateApp(App).mount("#app");\n', ); fs.writeFileSync( path.join(consumer, "index.html"), '