0.3.0: .archify files are YAML and open straight into the diagram
- .archify content is YAML (JSON still accepted); converted to JSON for the renderer - Archify Diagram custom editor is the default for *.archify; Show Source opens the YAML beside it - YAML syntax errors and validation problems mapped to YAML lines - yamlValidation for schema completion with redhat.vscode-yaml - scripts/to-yaml.mjs converts existing .archify files
This commit is contained in:
@@ -24,7 +24,7 @@ function load(name: string) {
|
||||
const text = fs.readFileSync(path.join(fixtures, name), 'utf8');
|
||||
const source = readDiagramSource(text, name);
|
||||
assert.ok(source, `${name} is a diagram source`);
|
||||
return { ...source, text };
|
||||
return source;
|
||||
}
|
||||
|
||||
for (const name of fs.readdirSync(fixtures).filter((file) => !file.startsWith('mco-'))) {
|
||||
@@ -46,7 +46,7 @@ test('reports schema problems with JSON pointer paths', async () => {
|
||||
|
||||
test('render failure returns the CLI error', async () => {
|
||||
const text = JSON.stringify({ schema_version: 1, diagram_type: 'architecture', meta: {}, components: [] });
|
||||
const result = await renderDiagram(runtime(), { type: 'architecture', diagram: JSON.parse(text), text }, 'fallback');
|
||||
const result = await renderDiagram(runtime(), { type: 'architecture', diagram: JSON.parse(text), format: 'json', json: text }, 'fallback');
|
||||
assert.equal(result.ok, false);
|
||||
assert.match(result.error ?? '', /schema validation failed/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user