1// Which site a seed or a reader targets — the templates' twin of install/context.mjs (the templates2// ship without the skill's install/ folder in reach, so the reading is repeated here, in full).3//4// A project's `wix.config.json` names the DEPLOY site; `.env.local` (what `wix env pull` writes) names5// the CONTENT site's app, and on a migration preview also the site being migrated (the parent). Seeds6// and readers are admin calls about content, so they target the content site: the config's site7// normally, the parent on a migration. `env pull` runs when `.env.local` is missing.8import { runWix } from "./wix-cli.mjs";9import { existsSync, readFileSync } from "node:fs";10import { join } from "node:path"
65 if (!ctx.deploySiteId) throw new Error("wix.config.json has no siteId — is this a Wix CLI project?");
66 if (ctx.migration.active && !argv.includes("--allow-parent")) {
67 throw new Error(`this project deploys a migration preview of site ${ctx.migration.parentSiteId}: seeding would write into the live original. The site owns its content — skip the seed; if the user asked for content to be created there, re-run with --allow-parent.`);