Files
trackgo-fe/.agents/skills/archify/test/repository-language-metadata.test.mjs
T
shancheas 166e0d40ac feat: introduce archify skill for generating architecture diagrams
- Added a new Archify skill, enabling users to create polished architecture, workflow, sequence, data-flow, and lifecycle diagrams.
- Implemented comprehensive functionality including rendering, validation, and delivery of diagrams in various formats.
- Integrated a user-friendly command-line interface for generating and previewing diagrams.
- Developed supporting files including package.json, LICENSE, and SKILL.md for documentation and licensing.
- Added unit tests to ensure reliability and functionality of the new skill.

These changes enhance the application by providing a structured approach to visualizing system architecture and workflows, improving user experience and data representation.
2026-08-31 11:31:29 +07:00

53 lines
1.6 KiB
JavaScript

import { test } from 'node:test';
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');
function linguistGenerated(relativePath) {
const output = execFileSync(
'git',
['check-attr', 'linguist-generated', '--', relativePath],
{ cwd: repoRoot, encoding: 'utf8' },
).trim();
return output.slice(output.lastIndexOf(':') + 1).trim();
}
test('repository language metadata separates generated artifacts from implementation source', () => {
for (const generatedPath of [
'archify/examples/web-app-rendered.html',
'examples/web-app.html',
'docs/cases/mco-runtime.architecture.html',
'docs/gallery.html',
'docs/gallery/artifacts/web-app.architecture.html',
'docs/guide.html',
'docs/start.html',
'experiments/mco-showcase/mco-runtime.html',
'archify/renderers/shared/generated-brand-marks.mjs',
'archify/renderers/shared/generated-validators.mjs',
]) {
assert.equal(
linguistGenerated(generatedPath),
'true',
`${generatedPath} must be excluded from GitHub language statistics`,
);
}
for (const sourcePath of [
'archify/assets/template.html',
'scripts/gallery-template.html',
'scripts/guide-template.html',
'scripts/start-template.html',
'docs/index.html',
'archify/renderers/shared/geometry.mjs',
]) {
assert.equal(
linguistGenerated(sourcePath),
'unspecified',
`${sourcePath} must remain visible as implementation source`,
);
}
});