superslate 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +27 -24
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1141,7 +1141,7 @@ var BRAND_MANIFEST = [
|
|
|
1141
1141
|
{ path: "apps/web/src/configs/config.ts", occurrences: 2 },
|
|
1142
1142
|
{ path: "apps/web/index.html", occurrences: 4 },
|
|
1143
1143
|
{ path: "apps/web/public/favicon/site.webmanifest", occurrences: 2 },
|
|
1144
|
-
{ path: "apps/web/public/offline.html", occurrences:
|
|
1144
|
+
{ path: "apps/web/public/offline.html", occurrences: 6 },
|
|
1145
1145
|
{ path: "apps/docs/lib/shared.ts", occurrences: 1 },
|
|
1146
1146
|
{ path: "apps/server/.env.example", occurrences: 1 },
|
|
1147
1147
|
{ path: "apps/server/src/config/env.ts", occurrences: 2 },
|
|
@@ -1341,10 +1341,10 @@ function removeParagraphContaining(content, fragment) {
|
|
|
1341
1341
|
`);
|
|
1342
1342
|
}
|
|
1343
1343
|
function rewriteBuyerAgentInstructions(content) {
|
|
1344
|
-
if (content.includes("Audit and remediate the complete buyer-owned SaaS application") && !/landing\/|seller-surface|studio-owned/i.test(content)) {
|
|
1344
|
+
if (content.includes("Audit and remediate the complete buyer-owned SaaS application") && !/internal\/|landing\/|seller-surface|studio-owned/i.test(content)) {
|
|
1345
1345
|
return content;
|
|
1346
1346
|
}
|
|
1347
|
-
let rewritten = removeParagraphContaining(content, "`
|
|
1347
|
+
let rewritten = removeParagraphContaining(content, "`internal/` holds every seller-only surface");
|
|
1348
1348
|
rewritten = removeParagraphContaining(rewritten, "The root pnpm workspace includes only `apps/*` and `packages/*`.");
|
|
1349
1349
|
rewritten = replaceMarkdownSection(rewritten, "Product security audit scope", `## Product security audit scope
|
|
1350
1350
|
|
|
@@ -1357,18 +1357,26 @@ into this repository.
|
|
|
1357
1357
|
`);
|
|
1358
1358
|
rewritten = replaceMarkdownSection(rewritten, "Landing boundary", "");
|
|
1359
1359
|
rewritten = rewritten.split(`
|
|
1360
|
-
`).filter((line) => !line.includes("| `
|
|
1361
|
-
`).replace("real env files, `
|
|
1362
|
-
if (/landing\/|seller-surface|studio-owned/i.test(rewritten)) {
|
|
1360
|
+
`).filter((line) => !line.includes("| `internal`")).join(`
|
|
1361
|
+
`).replace("real env files, `internal/`, or\n `bun.lock`", "real env files, or `bun.lock`");
|
|
1362
|
+
if (/internal\/|landing\/|seller-surface|studio-owned/i.test(rewritten)) {
|
|
1363
1363
|
throw new Error("Buyer agent instructions still contain seller-only guidance.");
|
|
1364
1364
|
}
|
|
1365
1365
|
return rewritten;
|
|
1366
1366
|
}
|
|
1367
|
+
var SELLER_ONLY_ROOT_SCRIPTS = ["release:distribute"];
|
|
1368
|
+
function stripSellerOnlyRootScripts(content) {
|
|
1369
|
+
const manifest = JSON.parse(content);
|
|
1370
|
+
for (const script of SELLER_ONLY_ROOT_SCRIPTS)
|
|
1371
|
+
delete manifest.scripts?.[script];
|
|
1372
|
+
return `${JSON.stringify(manifest, null, 2)}
|
|
1373
|
+
`;
|
|
1374
|
+
}
|
|
1367
1375
|
function rewriteBuyerClaudeInstructions(content) {
|
|
1368
|
-
if (!/landing\/|studio-owned/i.test(content))
|
|
1376
|
+
if (!/internal\/|landing\/|studio-owned/i.test(content))
|
|
1369
1377
|
return content;
|
|
1370
|
-
const rewritten = removeParagraphContaining(content, "`landing/AGENTS.md`");
|
|
1371
|
-
if (/landing\/|studio-owned/i.test(rewritten)) {
|
|
1378
|
+
const rewritten = removeParagraphContaining(content, "`internal/landing/AGENTS.md`");
|
|
1379
|
+
if (/internal\/|landing\/|studio-owned/i.test(rewritten)) {
|
|
1372
1380
|
throw new Error("Buyer Claude instructions still contain seller-only guidance.");
|
|
1373
1381
|
}
|
|
1374
1382
|
return rewritten;
|
|
@@ -1424,14 +1432,16 @@ function isTemplatePathExcluded(relativePath) {
|
|
|
1424
1432
|
return true;
|
|
1425
1433
|
if (normalized === "skills-lock.json")
|
|
1426
1434
|
return true;
|
|
1427
|
-
if (normalized === "
|
|
1435
|
+
if (normalized === "internal" || normalized.startsWith("internal/"))
|
|
1436
|
+
return true;
|
|
1437
|
+
if (normalized === ".github/workflows/publish-npm.yml")
|
|
1438
|
+
return true;
|
|
1439
|
+
if (normalized === ".github/workflows/internal-commercial.yml")
|
|
1428
1440
|
return true;
|
|
1429
1441
|
if (normalized === "apps/worker" || normalized.startsWith("apps/worker/"))
|
|
1430
1442
|
return true;
|
|
1431
1443
|
if (parts.includes("dist") || parts.includes("out"))
|
|
1432
1444
|
return true;
|
|
1433
|
-
if (normalized === "landing" || normalized.startsWith("landing/"))
|
|
1434
|
-
return true;
|
|
1435
1445
|
if (normalized === "bun.lock")
|
|
1436
1446
|
return true;
|
|
1437
1447
|
if (normalized === ".vercelignore")
|
|
@@ -1448,10 +1458,6 @@ function isTemplatePathExcluded(relativePath) {
|
|
|
1448
1458
|
return true;
|
|
1449
1459
|
if (normalized === "packages/create-app/README.md")
|
|
1450
1460
|
return true;
|
|
1451
|
-
if (normalized === "docs/phase2" || normalized.startsWith("docs/phase2/"))
|
|
1452
|
-
return true;
|
|
1453
|
-
if (/^docs\/evaluations\/(?:tec|pro2)-[^/]+\.md$/.test(normalized))
|
|
1454
|
-
return true;
|
|
1455
1461
|
if (normalized === "apps/server/server")
|
|
1456
1462
|
return true;
|
|
1457
1463
|
if (basename.endsWith(".tsbuildinfo"))
|
|
@@ -1601,9 +1607,6 @@ async function applyScopeRewrite(target, scope) {
|
|
|
1601
1607
|
if (result.replacements > 0 && (path.endsWith(".ts") || path.endsWith(".tsx"))) {
|
|
1602
1608
|
result.content = wrapLongNamedImports(result.content);
|
|
1603
1609
|
}
|
|
1604
|
-
if (result.replacements > 0 && path.endsWith("/apps/docs/README.md")) {
|
|
1605
|
-
result.content = result.content.replace("root workspace filter: `pnpm", "root workspace filter:\n`pnpm").replace("<command>`.\nThe product deployment", "<command>`. The product deployment").replace("not deploy this Next.js application. See `docs/docs-site.md`\nfor publication", "not deploy this\nNext.js application. See `docs/docs-site.md` for publication");
|
|
1606
|
-
}
|
|
1607
1610
|
return result;
|
|
1608
1611
|
});
|
|
1609
1612
|
if (replacements > 0)
|
|
@@ -1644,6 +1647,8 @@ async function neutralizeAgentInstructions(target) {
|
|
|
1644
1647
|
const claudePath = join6(target, "CLAUDE.md");
|
|
1645
1648
|
await writeFile4(agentPath, rewriteBuyerAgentInstructions(await readFile5(agentPath, "utf8")));
|
|
1646
1649
|
await writeFile4(claudePath, rewriteBuyerClaudeInstructions(await readFile5(claudePath, "utf8")));
|
|
1650
|
+
const rootPackagePath = join6(target, "package.json");
|
|
1651
|
+
await writeFile4(rootPackagePath, stripSellerOnlyRootScripts(await readFile5(rootPackagePath, "utf8")));
|
|
1647
1652
|
}
|
|
1648
1653
|
async function neutralizeSourceCli(target, scope, brandName) {
|
|
1649
1654
|
if (String(CLI_NAME2) === BUYER_CLI_NAME && String(CLI_PACKAGE_NAME) === BUYER_CLI_PACKAGE_NAME)
|
|
@@ -1662,17 +1667,15 @@ async function neutralizeSourceCli(target, scope, brandName) {
|
|
|
1662
1667
|
if (cliPackage.name !== CLI_PACKAGE_NAME || !cliPackage.bin?.[CLI_NAME2]) {
|
|
1663
1668
|
throw new Error(`Source CLI package must expose ${CLI_PACKAGE_NAME} as ${CLI_NAME2}.`);
|
|
1664
1669
|
}
|
|
1665
|
-
|
|
1666
|
-
cliPackage.name = BUYER_CLI_PACKAGE_NAME;
|
|
1667
|
-
cliPackage.private = true;
|
|
1668
|
-
cliPackage.bin = { [BUYER_CLI_NAME]: executable };
|
|
1670
|
+
cliPackage.bin = { [BUYER_CLI_NAME]: "./src/cli.ts" };
|
|
1669
1671
|
delete cliPackage.description;
|
|
1670
1672
|
delete cliPackage.homepage;
|
|
1671
1673
|
delete cliPackage.repository;
|
|
1672
1674
|
delete cliPackage.keywords;
|
|
1673
1675
|
delete cliPackage.files;
|
|
1674
1676
|
delete cliPackage.publishConfig;
|
|
1675
|
-
|
|
1677
|
+
const { name: _sourceName, version: cliVersion, ...cliPackageRemainder } = cliPackage;
|
|
1678
|
+
await writeFile4(cliPackagePath, `${JSON.stringify({ name: BUYER_CLI_PACKAGE_NAME, version: cliVersion, private: true, ...cliPackageRemainder }, null, 2)}
|
|
1676
1679
|
`);
|
|
1677
1680
|
const constantsPath = join6(target, "packages/create-app/src/constants.ts");
|
|
1678
1681
|
const constants3 = await readFile5(constantsPath, "utf8");
|