@brandlab-digital/conformance 1.0.0-rc.15 → 1.0.0-rc.17

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.
@@ -0,0 +1,20 @@
1
+ export declare const BRANDLAB_ANALYTICS_V3_RULESET_ID = "analytics-v3@1.0.0-rc.17";
2
+ export interface BrandlabAnalyticsV3Issue {
3
+ ruleId: string;
4
+ surface: "analytics";
5
+ severity: "blocker" | "warning" | "info";
6
+ evidenceKind: "static";
7
+ path?: string;
8
+ line?: number;
9
+ expected: string;
10
+ actual: string;
11
+ remediation: string;
12
+ }
13
+ export interface BrandlabAnalyticsV3Inspection {
14
+ rulesetId: typeof BRANDLAB_ANALYTICS_V3_RULESET_ID;
15
+ websiteCallsDeclared: boolean;
16
+ leadDiagnosticsDeclared: boolean;
17
+ issues: BrandlabAnalyticsV3Issue[];
18
+ }
19
+ export declare function inspectBrandlabAnalyticsV3(root: string): BrandlabAnalyticsV3Inspection;
20
+ //# sourceMappingURL=analytics-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-contract.d.ts","sourceRoot":"","sources":["../src/analytics-contract.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC,6BACjB,CAAC;AAE7B,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACzC,YAAY,EAAE,QAAQ,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,OAAO,gCAAgC,CAAC;IACnD,oBAAoB,EAAE,OAAO,CAAC;IAC9B,uBAAuB,EAAE,OAAO,CAAC;IACjC,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACpC;AAaD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAkDtF"}
@@ -0,0 +1,211 @@
1
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
2
+ import { extname, join, relative } from "node:path";
3
+ import * as ts from "typescript";
4
+ export const BRANDLAB_ANALYTICS_V3_RULESET_ID = "analytics-v3@1.0.0-rc.17";
5
+ const SOURCE_EXTENSIONS = new Set([".js", ".jsx", ".mjs", ".ts", ".tsx"]);
6
+ const SKIPPED_DIRECTORIES = new Set([
7
+ ".git",
8
+ ".next",
9
+ ".turbo",
10
+ "coverage",
11
+ "dist",
12
+ "generated",
13
+ "node_modules",
14
+ ]);
15
+ export function inspectBrandlabAnalyticsV3(root) {
16
+ const sourceRoot = join(root, "src");
17
+ const files = existsSync(sourceRoot) ? walkSourceFiles(sourceRoot) : [];
18
+ const sources = files.map((path) => ({
19
+ path,
20
+ relativePath: relative(root, path).split(/[/\\]/).join("/"),
21
+ source: readFileSync(path, "utf8"),
22
+ }));
23
+ const issues = [];
24
+ const inspections = sources.map((entry) => inspectAnalyticsSource(entry, issues));
25
+ const websiteCallsDeclared = inspections.some((inspection) => inspection.websiteCallsDeclared);
26
+ const leadDiagnosticsDeclared = inspections.some((inspection) => inspection.leadDiagnosticsDeclared);
27
+ if (websiteCallsDeclared) {
28
+ const sharedGoogleTagRendered = inspections.some((inspection) => inspection.sharedGoogleTagRendered);
29
+ if (!sharedGoogleTagRendered) {
30
+ issues.push(analyticsIssue({
31
+ ruleId: "brandlab-analytics-website-call-renderer",
32
+ expected: "Projects declaring websiteCalls render BrandlabGoogleTag from @brandlab-digital/site-next/analytics/google-tag.",
33
+ actual: "The website-call contract is declared without the shared Google tag renderer.",
34
+ remediation: "Render BrandlabGoogleTag once from the root layout and pass the verified public business phone number.",
35
+ }));
36
+ }
37
+ }
38
+ if (leadDiagnosticsDeclared) {
39
+ const sharedDiagnosticsCalled = inspections.some((inspection) => inspection.sharedDiagnosticCalled);
40
+ if (!sharedDiagnosticsCalled) {
41
+ issues.push(analyticsIssue({
42
+ ruleId: "brandlab-analytics-lead-diagnostics-unused",
43
+ expected: "An enabled leadDiagnostics contract is consumed through at least one shared helper.",
44
+ actual: "leadDiagnostics is enabled but no shared diagnostic helper is imported.",
45
+ remediation: "Instrument the intended form or CTA through the shared helpers, or remove the unused opt-in.",
46
+ }));
47
+ }
48
+ }
49
+ return {
50
+ rulesetId: BRANDLAB_ANALYTICS_V3_RULESET_ID,
51
+ websiteCallsDeclared,
52
+ leadDiagnosticsDeclared,
53
+ issues: issues.sort((first, second) => first.ruleId.localeCompare(second.ruleId) ||
54
+ (first.path ?? "").localeCompare(second.path ?? "") ||
55
+ (first.line ?? 0) - (second.line ?? 0)),
56
+ };
57
+ }
58
+ function inspectAnalyticsSource(entry, issues) {
59
+ const sourceFile = ts.createSourceFile(entry.path, entry.source, ts.ScriptTarget.Latest, true, scriptKind(entry.path));
60
+ const googleTagBindings = new Set();
61
+ const diagnosticBindings = new Set();
62
+ const emittedRules = new Set();
63
+ let websiteCallsDeclared = false;
64
+ let leadDiagnosticsDeclared = false;
65
+ let sharedGoogleTagRendered = false;
66
+ let sharedDiagnosticCalled = false;
67
+ for (const statement of sourceFile.statements) {
68
+ if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier))
69
+ continue;
70
+ const imports = statement.importClause?.namedBindings;
71
+ if (!imports || !ts.isNamedImports(imports))
72
+ continue;
73
+ for (const specifier of imports.elements) {
74
+ const importedName = specifier.propertyName?.text ?? specifier.name.text;
75
+ if (statement.moduleSpecifier.text === "@brandlab-digital/site-next/analytics/google-tag" &&
76
+ importedName === "BrandlabGoogleTag") {
77
+ googleTagBindings.add(specifier.name.text);
78
+ }
79
+ if (statement.moduleSpecifier.text === "@brandlab-digital/site-next/analytics" &&
80
+ ["trackLeadFormStart", "trackLeadFormError", "trackLeadCtaClick"].includes(importedName)) {
81
+ diagnosticBindings.add(specifier.name.text);
82
+ }
83
+ }
84
+ }
85
+ const emitIssue = (node, options) => {
86
+ if (emittedRules.has(options.ruleId))
87
+ return;
88
+ emittedRules.add(options.ruleId);
89
+ issues.push(analyticsIssue({
90
+ ...options,
91
+ path: entry.relativePath,
92
+ line: sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1,
93
+ actual: `A local implementation appears in ${entry.relativePath}.`,
94
+ }));
95
+ };
96
+ const visit = (node) => {
97
+ if (ts.isPropertyAssignment(node)) {
98
+ const name = propertyName(node.name);
99
+ if (name === "websiteCalls" && ts.isObjectLiteralExpression(node.initializer)) {
100
+ websiteCallsDeclared = true;
101
+ }
102
+ if (name === "leadDiagnostics" &&
103
+ ts.isObjectLiteralExpression(node.initializer) &&
104
+ node.initializer.properties.some((property) => ts.isPropertyAssignment(property) &&
105
+ propertyName(property.name) === "enabled" &&
106
+ property.initializer.kind === ts.SyntaxKind.TrueKeyword)) {
107
+ leadDiagnosticsDeclared = true;
108
+ }
109
+ if (name === "phone_conversion_number") {
110
+ emitIssue(node, {
111
+ ruleId: "brandlab-analytics-local-website-call-snippet",
112
+ expected: "Website-call forwarding configuration is rendered by BrandlabGoogleTag.",
113
+ remediation: "Remove the local phone snippet and use @brandlab-digital/site-next/analytics/google-tag.",
114
+ });
115
+ }
116
+ }
117
+ if ((ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) &&
118
+ ts.isIdentifier(node.tagName) &&
119
+ googleTagBindings.has(node.tagName.text)) {
120
+ sharedGoogleTagRendered = true;
121
+ }
122
+ if (ts.isCallExpression(node)) {
123
+ if (ts.isIdentifier(node.expression) &&
124
+ diagnosticBindings.has(node.expression.text)) {
125
+ sharedDiagnosticCalled = true;
126
+ }
127
+ if (ts.isPropertyAccessExpression(node.expression) &&
128
+ node.expression.name.text === "createElement" &&
129
+ node.arguments[0] &&
130
+ ts.isIdentifier(node.arguments[0]) &&
131
+ googleTagBindings.has(node.arguments[0].text)) {
132
+ sharedGoogleTagRendered = true;
133
+ }
134
+ const eventName = gtagEventName(node);
135
+ if (["lead_form_start", "lead_form_error", "lead_cta_click"].includes(eventName ?? "")) {
136
+ emitIssue(node, {
137
+ ruleId: "brandlab-analytics-local-lead-diagnostic",
138
+ expected: "Lead diagnostics use the privacy-safe shared analytics helpers.",
139
+ remediation: "Use trackLeadFormStart, trackLeadFormError or trackLeadCtaClick from @brandlab-digital/site-next/analytics.",
140
+ });
141
+ }
142
+ if (eventName === "conversion") {
143
+ emitIssue(node, {
144
+ ruleId: "brandlab-analytics-local-ads-conversion",
145
+ expected: "Direct form conversion transport stays inside the shared accepted-delivery runtime.",
146
+ remediation: "Remove the local Google Ads conversion event and use trackDeliveredContact or trackDeliveredContactWithEnhancedConversions.",
147
+ });
148
+ }
149
+ }
150
+ ts.forEachChild(node, visit);
151
+ };
152
+ visit(sourceFile);
153
+ return {
154
+ websiteCallsDeclared,
155
+ leadDiagnosticsDeclared,
156
+ sharedGoogleTagRendered,
157
+ sharedDiagnosticCalled,
158
+ };
159
+ }
160
+ function propertyName(name) {
161
+ return ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)
162
+ ? name.text
163
+ : null;
164
+ }
165
+ function gtagEventName(node) {
166
+ const callee = node.expression;
167
+ const isGtag = (ts.isIdentifier(callee) && callee.text === "gtag") ||
168
+ (ts.isPropertyAccessExpression(callee) && callee.name.text === "gtag");
169
+ if (!isGtag || node.arguments.length < 2)
170
+ return null;
171
+ const command = node.arguments[0];
172
+ const event = node.arguments[1];
173
+ return command && ts.isStringLiteralLike(command) && command.text === "event" &&
174
+ event && ts.isStringLiteralLike(event)
175
+ ? event.text
176
+ : null;
177
+ }
178
+ function scriptKind(path) {
179
+ switch (extname(path)) {
180
+ case ".tsx": return ts.ScriptKind.TSX;
181
+ case ".jsx": return ts.ScriptKind.JSX;
182
+ case ".js":
183
+ case ".mjs": return ts.ScriptKind.JS;
184
+ default: return ts.ScriptKind.TS;
185
+ }
186
+ }
187
+ function analyticsIssue(options) {
188
+ return {
189
+ surface: "analytics",
190
+ severity: "blocker",
191
+ evidenceKind: "static",
192
+ ...options,
193
+ };
194
+ }
195
+ function walkSourceFiles(directory) {
196
+ const files = [];
197
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
198
+ if (entry.isSymbolicLink())
199
+ continue;
200
+ const path = join(directory, entry.name);
201
+ if (entry.isDirectory()) {
202
+ if (!SKIPPED_DIRECTORIES.has(entry.name))
203
+ files.push(...walkSourceFiles(path));
204
+ continue;
205
+ }
206
+ if (entry.isFile() && SOURCE_EXTENSIONS.has(extname(entry.name)))
207
+ files.push(path);
208
+ }
209
+ return files.sort();
210
+ }
211
+ //# sourceMappingURL=analytics-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-contract.js","sourceRoot":"","sources":["../src/analytics-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,CAAC,MAAM,gCAAgC,GAC3C,0BAA0B,CAAC;AAqB7B,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1E,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,MAAM;IACN,WAAW;IACX,cAAc;CACf,CAAC,CAAC;AAEH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,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EAAE,IAAI,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const BRANDLAB_PROJECT_DOCUMENTATION_RULESET_ID = "architecture-v5-project-documentation@1.0.0-rc.17";
2
+ export interface BrandlabProjectDocumentationIssue {
3
+ ruleId: string;
4
+ surface: "documentation" | "security";
5
+ severity: "blocker" | "warning" | "info";
6
+ evidenceKind: "static";
7
+ path?: string;
8
+ line?: number;
9
+ expected: string;
10
+ actual: string;
11
+ remediation: string;
12
+ }
13
+ export interface BrandlabProjectDocumentationReport {
14
+ rulesetId: typeof BRANDLAB_PROJECT_DOCUMENTATION_RULESET_ID;
15
+ files: Readonly<Record<string, {
16
+ bytes: number;
17
+ lines: number;
18
+ } | null>>;
19
+ issues: BrandlabProjectDocumentationIssue[];
20
+ }
21
+ export interface InspectBrandlabProjectDocumentationOptions {
22
+ /** Portfolio and OS adapters may require this when design work is in scope. */
23
+ requireDesign?: boolean;
24
+ /** Portfolio and OS adapters may require this for managed SEO, Ads or content work. */
25
+ requireStrategy?: boolean;
26
+ }
27
+ export declare function inspectBrandlabProjectDocumentation(root: string, options?: InspectBrandlabProjectDocumentationOptions): BrandlabProjectDocumentationReport;
28
+ //# sourceMappingURL=project-documentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-documentation.d.ts","sourceRoot":"","sources":["../src/project-documentation.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yCAAyC,sDACD,CAAC;AAEtD,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,GAAG,UAAU,CAAC;IACtC,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACzC,YAAY,EAAE,QAAQ,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,OAAO,yCAAyC,CAAC;IAC5D,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IACzE,MAAM,EAAE,iCAAiC,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,0CAA0C;IACzD,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uFAAuF;IACvF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA6DD,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,0CAA+C,GACvD,kCAAkC,CA+IpC"}