refactor: adopt shared page and workspace layouts
This commit is contained in:
@@ -17,6 +17,26 @@ const sources = sourceFiles(sourceRoot).map((file) => ({
|
||||
value: fs.readFileSync(file, "utf8"),
|
||||
}));
|
||||
|
||||
for (const { file, value } of sources) {
|
||||
assert.ok(
|
||||
!value.includes('className="content-pad workspace-data-page'),
|
||||
`${path.relative(sourceRoot, file)} must use Core PageLayout instead of a raw page frame`,
|
||||
);
|
||||
assert.ok(
|
||||
!/<div\s+className="workspace(?:\s|\")/.test(value),
|
||||
`${path.relative(sourceRoot, file)} must use Core WorkspaceLayout instead of a raw workspace`,
|
||||
);
|
||||
}
|
||||
|
||||
for (const relativePath of [
|
||||
"features/campaigns/CampaignWorkspace.tsx",
|
||||
"features/campaigns/CampaignModulePage.tsx",
|
||||
"features/templates/TemplatesPage.tsx",
|
||||
]) {
|
||||
const value = fs.readFileSync(path.join(sourceRoot, relativePath), "utf8");
|
||||
assert.ok(value.includes("<WorkspaceLayout"), `${relativePath} must retain the shared workspace shell`);
|
||||
}
|
||||
|
||||
const nonSemanticClicks = sources.flatMap(({ file, value }) =>
|
||||
[...value.matchAll(/<(div|span|li|tr)\b[^>]*\bonClick\s*=/g)].map(
|
||||
(match) => `${path.relative(sourceRoot, file)}:${match.index}`,
|
||||
|
||||
Reference in New Issue
Block a user