package: ship declarations (dist/types, the "types" condition) and a Node JS entry for 'storebound'; Bun keeps the .ts source. 0.8.5 exported only cli/lib/config.ts, so tsc (next build, vue-tsc, tsc --noEmit) failed on a scaffolded storebound.config.ts and broke a Next app's build; a test type-checks the template against the packed entry under bundler / node16 / nodenext without @types/node. check fails on the template's own placeholders (Example Studio, bare example.com URLs and addresses)
This commit is contained in:
parent
77f141e223
commit
d717ceb4cd
10 changed files with 138 additions and 7 deletions
|
|
@ -144,6 +144,22 @@ const ageOpen = (r: Record<string, unknown>): { open: string[]; soft: string[] }
|
|||
const urlOk = (u: UrlCheck) => u.status !== null && u.status >= 200 && u.status < 300;
|
||||
const urlMsg = (u: UrlCheck) => (u.status === null ? `unreachable (${u.error ?? 'no answer'})` : `HTTP ${u.status}`);
|
||||
|
||||
/** The scaffolder's own placeholder values (templates/*storebound.config.ts) that would reach a store as the app's
|
||||
* legal and contact details: "2026 Example Studio", example.com / example.org / example.net URLs and addresses
|
||||
* (the bare domain; subdomains such as notes.example.com are a project's own test fixtures).
|
||||
* Returns the dotted paths that still hold one. Pure. */
|
||||
export function templatePlaceholders(config: { app?: object; accounts?: object; reviewAccess?: object } & Record<string, unknown>): string[] {
|
||||
const out: string[] = [];
|
||||
const bad = (v: string) => /\bexample studio\b/i.test(v) || /(^|@|\/\/)(www\.)?example\.(com|org|net)(?![\w.-])/i.test(v);
|
||||
const walk = (v: unknown, path: string) => {
|
||||
if (typeof v === 'string') { if (bad(v)) out.push(path); }
|
||||
else if (Array.isArray(v)) v.forEach((x, i) => walk(x, `${path}[${i}]`));
|
||||
else if (v && typeof v === 'object') for (const [k, x] of Object.entries(v)) walk(x, `${path}.${k}`);
|
||||
};
|
||||
for (const k of ['app', 'accounts', 'reviewAccess'] as const) walk(config[k], k);
|
||||
return out;
|
||||
}
|
||||
|
||||
export const COPYRIGHT_MISSING = "app.copyright is missing: App Store Connect requires it. Use your public brand (e.g. '2026 <brand>'); never a company name you keep private.";
|
||||
|
||||
/** Copyright: App Store Connect refuses to submit a version without one; storebound never fills it in. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue