anymorph 0.9.0 → 0.11.0
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/index.js +50 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12221,6 +12221,14 @@ var require_src = __commonJS({
|
|
|
12221
12221
|
var cmsThemeTokens = require_cms_theme_tokens();
|
|
12222
12222
|
var HOSTNAME_LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;
|
|
12223
12223
|
var CMS_MDX_COMPONENT_CONTRACTS2 = Object.freeze({
|
|
12224
|
+
ArticleHeader: Object.freeze({
|
|
12225
|
+
reserved: true,
|
|
12226
|
+
reason: "ArticleHeader is renderer-owned and must be derived from frontmatter/meta, not authored in MDX."
|
|
12227
|
+
}),
|
|
12228
|
+
RelatedContent: Object.freeze({
|
|
12229
|
+
reserved: true,
|
|
12230
|
+
reason: "RelatedContent is backend-owned and must be derived from related page data, not authored in MDX."
|
|
12231
|
+
}),
|
|
12224
12232
|
Callout: Object.freeze({
|
|
12225
12233
|
props: Object.freeze({
|
|
12226
12234
|
tone: Object.freeze({
|
|
@@ -12234,12 +12242,35 @@ var require_src = __commonJS({
|
|
|
12234
12242
|
reason: "CTA renders title + description side-by-side with the button; missing description leaves the column empty."
|
|
12235
12243
|
})
|
|
12236
12244
|
});
|
|
12245
|
+
var CMS_RELATED_CONTENT_TITLE_BY_LANG2 = Object.freeze({
|
|
12246
|
+
en: "Related reading",
|
|
12247
|
+
ko: "\uD568\uAED8 \uC77D\uC73C\uBA74 \uC88B\uC740 \uAE00",
|
|
12248
|
+
ja: "\u95A2\u9023\u8A18\u4E8B",
|
|
12249
|
+
zh: "\u76F8\u5173\u9605\u8BFB",
|
|
12250
|
+
"zh-TW": "\u76F8\u95DC\u95B1\u8B80",
|
|
12251
|
+
th: "\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E17\u0E35\u0E48\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07"
|
|
12252
|
+
});
|
|
12253
|
+
function getCmsRelatedContentTitle2(lang) {
|
|
12254
|
+
return CMS_RELATED_CONTENT_TITLE_BY_LANG2[lang] ?? CMS_RELATED_CONTENT_TITLE_BY_LANG2.en;
|
|
12255
|
+
}
|
|
12237
12256
|
function validateCmsMdxComponentContracts2(mdx) {
|
|
12238
12257
|
const issues = [];
|
|
12258
|
+
checkReservedComponents(mdx, issues);
|
|
12239
12259
|
checkRequiredComponentProps(mdx, issues);
|
|
12240
12260
|
checkEnumComponentProps(mdx, issues);
|
|
12241
12261
|
return issues;
|
|
12242
12262
|
}
|
|
12263
|
+
function checkReservedComponents(mdx, issues) {
|
|
12264
|
+
for (const [component, contract] of Object.entries(CMS_MDX_COMPONENT_CONTRACTS2)) {
|
|
12265
|
+
if (!contract.reserved) continue;
|
|
12266
|
+
if (!findComponentAttrs(mdx, component).length) continue;
|
|
12267
|
+
issues.push({
|
|
12268
|
+
code: "reserved_component",
|
|
12269
|
+
component,
|
|
12270
|
+
message: `<${component}> is renderer/backend-owned and must not be authored in MDX. ${contract.reason ?? ""}`.trim()
|
|
12271
|
+
});
|
|
12272
|
+
}
|
|
12273
|
+
}
|
|
12243
12274
|
function checkRequiredComponentProps(mdx, issues) {
|
|
12244
12275
|
for (const [component, contract] of Object.entries(CMS_MDX_COMPONENT_CONTRACTS2)) {
|
|
12245
12276
|
if (!Array.isArray(contract.requiredProps) || contract.requiredProps.length === 0) continue;
|
|
@@ -13431,7 +13462,9 @@ var require_src = __commonJS({
|
|
|
13431
13462
|
normalizeCmsThemeTokens: cmsThemeTokens.normalizeCmsThemeTokens,
|
|
13432
13463
|
validateCmsThemeTokens: cmsThemeTokens.validateCmsThemeTokens,
|
|
13433
13464
|
CMS_MDX_COMPONENT_CONTRACTS: CMS_MDX_COMPONENT_CONTRACTS2,
|
|
13434
|
-
validateCmsMdxComponentContracts: validateCmsMdxComponentContracts2
|
|
13465
|
+
validateCmsMdxComponentContracts: validateCmsMdxComponentContracts2,
|
|
13466
|
+
CMS_RELATED_CONTENT_TITLE_BY_LANG: CMS_RELATED_CONTENT_TITLE_BY_LANG2,
|
|
13467
|
+
getCmsRelatedContentTitle: getCmsRelatedContentTitle2
|
|
13435
13468
|
};
|
|
13436
13469
|
}
|
|
13437
13470
|
});
|
|
@@ -22443,6 +22476,8 @@ var normalizeCmsThemeTokens = import_index2.default.normalizeCmsThemeTokens;
|
|
|
22443
22476
|
var validateCmsThemeTokens = import_index2.default.validateCmsThemeTokens;
|
|
22444
22477
|
var CMS_MDX_COMPONENT_CONTRACTS = import_index2.default.CMS_MDX_COMPONENT_CONTRACTS;
|
|
22445
22478
|
var validateCmsMdxComponentContracts = import_index2.default.validateCmsMdxComponentContracts;
|
|
22479
|
+
var CMS_RELATED_CONTENT_TITLE_BY_LANG = import_index2.default.CMS_RELATED_CONTENT_TITLE_BY_LANG;
|
|
22480
|
+
var getCmsRelatedContentTitle = import_index2.default.getCmsRelatedContentTitle;
|
|
22446
22481
|
var reasonTagSchema = import_index2.default.reasonTagSchema;
|
|
22447
22482
|
var reasonClassSchema = import_index2.default.reasonClassSchema;
|
|
22448
22483
|
var REASON_TAG_CLASS = import_index2.default.REASON_TAG_CLASS;
|
|
@@ -45307,7 +45342,12 @@ async function validateMdx(mdx) {
|
|
|
45307
45342
|
// src/geo/mdx-validate.ts
|
|
45308
45343
|
async function validateCmsMdxFileContent(input) {
|
|
45309
45344
|
const verdict = await validateMdx(input.mdx);
|
|
45310
|
-
const issues =
|
|
45345
|
+
const issues = validateCmsMdxComponentContracts(input.mdx).map(
|
|
45346
|
+
(issue) => ({
|
|
45347
|
+
code: "cms_component_contract_violation",
|
|
45348
|
+
message: issue.message
|
|
45349
|
+
})
|
|
45350
|
+
);
|
|
45311
45351
|
if (verdict.ok) {
|
|
45312
45352
|
if (isCommerceWorkspace(input.workspace) && !hasHeroImage(input.mdx)) {
|
|
45313
45353
|
issues.push({
|
|
@@ -45321,6 +45361,13 @@ async function validateCmsMdxFileContent(input) {
|
|
|
45321
45361
|
issues
|
|
45322
45362
|
};
|
|
45323
45363
|
}
|
|
45364
|
+
if (issues.length > 0) {
|
|
45365
|
+
return {
|
|
45366
|
+
file: input.file,
|
|
45367
|
+
ok: false,
|
|
45368
|
+
issues
|
|
45369
|
+
};
|
|
45370
|
+
}
|
|
45324
45371
|
return {
|
|
45325
45372
|
file: input.file,
|
|
45326
45373
|
ok: false,
|
|
@@ -46651,7 +46698,7 @@ function printScaffoldError(prefix, err) {
|
|
|
46651
46698
|
|
|
46652
46699
|
// src/index.ts
|
|
46653
46700
|
var program2 = new Command();
|
|
46654
|
-
program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.
|
|
46701
|
+
program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.11.0");
|
|
46655
46702
|
program2.command("login").description("Sign in to your Anymorph account").addHelpText(
|
|
46656
46703
|
"after",
|
|
46657
46704
|
`
|