- 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.
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { spawnSync } from 'node:child_process';
|
|
import fs from 'node:fs';
|
|
import os from 'node:os';
|
|
import path from 'node:path';
|
|
import test from 'node:test';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
const skillRoot = path.resolve(here, '..');
|
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-base-input-compatibility-'));
|
|
|
|
function renderBaseFixture(type, name) {
|
|
const input = path.join(skillRoot, 'test', 'fixtures', 'v1-baseline', name);
|
|
const output = path.join(tmp, `${name}.html`);
|
|
return spawnSync(process.execPath, [
|
|
path.join(skillRoot, 'bin', 'archify.mjs'),
|
|
'render',
|
|
type,
|
|
input,
|
|
output,
|
|
], {
|
|
cwd: skillRoot,
|
|
encoding: 'utf8',
|
|
});
|
|
}
|
|
|
|
test('base named-route fixtures remain valid without redundant authored endpoint sides', () => {
|
|
for (const [type, name] of [
|
|
['dataflow', 'event-stream.dataflow.json'],
|
|
['architecture', 'production-deployment.architecture.json'],
|
|
]) {
|
|
const result = renderBaseFixture(type, name);
|
|
assert.equal(
|
|
result.status,
|
|
0,
|
|
`${type} base input must remain valid:\n${result.stdout || result.stderr}`,
|
|
);
|
|
}
|
|
});
|
|
|
|
process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));
|