Skip to content

Commit

Permalink
feat(cli,code-gen): remove compas visualise
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
- Use the 'includeEntityDiagram' option of the database generator instead.
  • Loading branch information
dirkdev98 committed Apr 30, 2023
1 parent 0a3ba6e commit 4c67841
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 445 deletions.
19 changes: 0 additions & 19 deletions docs/references/cli.md
Expand Up @@ -298,25 +298,6 @@ Print the installed Compas version and exit
| ---------- | -------------------------------------------------------- |
| -h, --help | Display information about the current command. (boolean) |

## `compas visualise`

Visualise various code-generated structures.

| Option | Description |
| ---------- | -------------------------------------------------------- |
| -h, --help | Display information about the current command. (boolean) |

### `compas visualise erd`

Visualise entity structure and relations in a diagram.

| Option | Description |
| --------------------- | ------------------------------------------------------------------------------ |
| --generated-directory | The directory containing the generated files. (string, required) |
| --format | Output file format. Supports png, webp, pdf and svg. Defaults to svg. (string) |
| --output | Path to write the output to. Defaults to a random temporary file. (string) |
| -h, --help | Display information about the current command. (boolean) |

## `compas help`

Display help for any of the available commands.
Expand Down
38 changes: 4 additions & 34 deletions packages/cli/src/cli/internal-commands/completions.test.js
Expand Up @@ -230,46 +230,16 @@ test("cli/internal-commands/completions", async (t) => {
t.ok(isNil(flagCompletions.find((it) => it.name === "--timings")));
});

t.test("custom flag completion function is called", async (t) => {
t.test("file completion is returned", async (t) => {
const { flagCompletions } = await generateCompletions([
"compas",
"visualise",
"erd",
"--format",
"",
]);

t.ok(flagCompletions.length > 0);
t.ok(isNil(flagCompletions.find((it) => it.name.startsWith("--"))));
t.ok(flagCompletions.find((it) => it.name === "svg"));
});

t.test("--flag=svg syntax is supported", async (t) => {
const { flagCompletions } = await generateCompletions([
"compas",
"visualise",
"erd",
"--format=",
]);

t.ok(flagCompletions.length > 0);
t.ok(
isNil(flagCompletions.find((it) => !it.name.startsWith("--format="))),
);
t.ok(flagCompletions.find((it) => it.name === "--format=svg"));
});

t.test("directory completion is returned", async (t) => {
const { flagCompletions } = await generateCompletions([
"compas",
"visualise",
"erd",
"--generated-directory",
"migrate",
"--connection-settings",
"./",
]);

t.equal(flagCompletions.length, 1);
t.ok(flagCompletions.find((it) => it.type === "directory"));
t.ok(flagCompletions.find((it) => it.type === "file"));
t.equal(flagCompletions.length, 1);
});

Expand Down
15 changes: 0 additions & 15 deletions packages/cli/src/compas/commands/visualise.d.ts

This file was deleted.

0 comments on commit 4c67841

Please sign in to comment.