bc-atlas 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.bca.example.json +58 -10
  2. package/CHANGELOG.md +137 -0
  3. package/LICENSE +21 -21
  4. package/README.md +166 -266
  5. package/package.json +28 -15
  6. package/src/analyzer.js +589 -60
  7. package/src/architecture.js +155 -0
  8. package/src/automation/agent.js +72 -0
  9. package/src/automation/config.js +119 -0
  10. package/src/automation/dependabot.js +36 -0
  11. package/src/automation/git.js +47 -0
  12. package/src/automation/pipelines.js +217 -0
  13. package/src/automation/run.js +133 -0
  14. package/src/automation/setup.js +541 -0
  15. package/src/automation/vscode.js +114 -0
  16. package/src/call-analysis.js +70 -0
  17. package/src/capabilities.js +570 -0
  18. package/src/cli/args.js +76 -0
  19. package/src/cli/errors.js +24 -0
  20. package/src/cli/help.js +134 -0
  21. package/src/cli.js +95 -338
  22. package/src/codegraph.js +454 -0
  23. package/src/commands/architecture.js +79 -0
  24. package/src/commands/check.js +38 -0
  25. package/src/commands/init.js +115 -0
  26. package/src/commands/report.js +191 -0
  27. package/src/commands/run.js +28 -0
  28. package/src/commands/setup.js +179 -0
  29. package/src/commands/update.js +144 -0
  30. package/src/d2.js +147 -46
  31. package/src/docs/al-ui-source.js +198 -131
  32. package/src/docs/al-ui-writer.js +141 -0
  33. package/src/docs/automation.js +109 -0
  34. package/src/docs/captions.js +201 -0
  35. package/src/docs/cli.js +139 -34
  36. package/src/docs/export.js +105 -0
  37. package/src/docs/markdown.js +18 -64
  38. package/src/docs/model.js +147 -0
  39. package/src/docs/phrases.js +249 -0
  40. package/src/docs/render/csv.js +24 -0
  41. package/src/docs/render/dita.js +84 -0
  42. package/src/docs/render/format.js +46 -0
  43. package/src/docs/render/html.js +205 -0
  44. package/src/docs/render/markdown.js +233 -0
  45. package/src/docs/steps.js +141 -0
  46. package/src/docs/tags.js +107 -0
  47. package/src/docs/task.js +293 -0
  48. package/src/health.js +237 -0
  49. package/src/mcp.js +332 -0
  50. package/src/operation-semantics.js +15 -0
  51. package/src/output.js +86 -0
  52. package/src/permission-semantics.js +71 -0
  53. package/src/relation-aggregation.js +33 -0
  54. package/src/resolver.js +90 -11
  55. package/src/svg.js +10 -7
  56. package/src/symbols.js +135 -0
  57. package/src/update-worker.js +9 -0
  58. package/src/update.js +131 -0
  59. package/src/views.js +330 -75
  60. package/src/workflow.js +19 -64
  61. package/docs/al-ui-test-documentation.md +0 -126
  62. package/docs/cli-reference.md +0 -242
  63. package/examples/README.md +0 -32
  64. package/examples/output/project.d2 +0 -86
  65. package/examples/output/project.svg +0 -225
  66. package/examples/output/ui.d2 +0 -47
  67. package/examples/output/ui.svg +0 -166
  68. package/examples/output/workflow.d2 +0 -56
  69. package/examples/output/workflow.svg +0 -194
  70. package/examples/warehouse-app/Automation.al +0 -24
  71. package/examples/warehouse-app/Inventory.al +0 -46
  72. package/examples/warehouse-app/WarehouseUI.al +0 -29
  73. package/examples/warehouse-app/app.json +0 -8
  74. package/scripts/generate-examples.js +0 -56
  75. package/scripts/update-grammar.js +0 -22
package/.bca.example.json CHANGED
@@ -1,32 +1,60 @@
1
1
  {
2
2
  "view": "project",
3
+ "projectRoot": ".",
3
4
  "direction": "right",
4
5
  "title": "Business Central architecture",
5
6
  "groupBy": "role",
6
- "namespaces": ["Contoso.**"],
7
- "exclude": ["**/test/**"],
7
+ "roleMappings": {
8
+ "Domain": [
9
+ "Contoso.Sales:table:*",
10
+ "Contoso.Sales:codeunit:*"
11
+ ]
12
+ },
13
+ "namespaces": [
14
+ "Contoso.**"
15
+ ],
16
+ "exclude": [
17
+ "**/test/**"
18
+ ],
8
19
  "moduleDepth": "auto",
9
20
  "folderDepth": 1,
10
21
  "includeUnresolvedCalls": false,
11
22
  "maxEdges": 500,
12
23
  "workflow": {
13
- "entries": ["ProcessDocument"],
24
+ "entries": [
25
+ "ProcessDocument"
26
+ ],
14
27
  "depth": 8,
15
28
  "maxNodes": 100,
16
29
  "maxEdges": 250,
17
- "edgeTypes": ["calls", "events", "writes"],
30
+ "edgeTypes": [
31
+ "calls",
32
+ "events",
33
+ "writes"
34
+ ],
18
35
  "phases": {
19
- "Validation": ["Validate*"],
20
- "Processing": ["Process*", "Post*"]
36
+ "Validation": [
37
+ "Validate*"
38
+ ],
39
+ "Processing": [
40
+ "Process*",
41
+ "Post*"
42
+ ]
21
43
  },
22
- "stop": ["Finalize*"],
23
- "collapse": ["*Telemetry*"]
44
+ "stop": [
45
+ "Finalize*"
46
+ ],
47
+ "collapse": [
48
+ "*Telemetry*"
49
+ ]
24
50
  },
25
51
  "details": false,
26
52
  "noExternal": false,
27
53
  "layout": "elk",
28
54
  "theme": 0,
29
- "sourceUrl": "https://github.com/example/repo/blob/main/{file}#L{line}",
55
+ "sourceUrl": "https://github.com/example/repo/blob/{ref}/{file}#L{line}",
56
+ "sourceRef": "main",
57
+ "sourcePathPrefix": "apps/Sales",
30
58
  "forbiddenDependencies": [
31
59
  {
32
60
  "from": "Contoso.Core:**",
@@ -34,5 +62,25 @@
34
62
  "severity": "warning",
35
63
  "message": "Core must not depend on UI"
36
64
  }
37
- ]
65
+ ],
66
+ "check": {
67
+ "failOn": "error",
68
+ "cycles": "warning",
69
+ "maxFanIn": 25,
70
+ "maxFanOut": 25
71
+ },
72
+ "report": {
73
+ "outputDir": "docs/atlas",
74
+ "views": [
75
+ "project",
76
+ "module",
77
+ "data",
78
+ "contracts",
79
+ "events",
80
+ "ui"
81
+ ],
82
+ "format": "svg",
83
+ "codegraph": false,
84
+ "json": false
85
+ }
38
86
  }
package/CHANGELOG.md ADDED
@@ -0,0 +1,137 @@
1
+ # Changelog
2
+
3
+ All notable changes to BC Atlas will be documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project
5
+ follows [Semantic Versioning](https://semver.org/).
6
+
7
+ ## Unreleased
8
+
9
+ ## 0.7.0 - 2026-10-04
10
+
11
+ ### Added
12
+
13
+ - Documentation website on GitHub Pages
14
+ (https://schulzoli.github.io/BC-Atlas/), built with VitePress from the
15
+ repository Markdown, with search, a sidebar by feature area, and the
16
+ generated examples.
17
+ - `bca setup`: guided setup of features, Git hooks (Husky or plain Git),
18
+ pipelines (GitHub Actions or Azure Pipelines), cron schedules, and sync of
19
+ generated files, as a terminal wizard or with `--yes`.
20
+ - `bca setup plan` and `bca setup apply`: the same setup as detectable facts,
21
+ questions with recommendations, and a validated, idempotent apply with
22
+ `--dry-run`.
23
+ - `bca setup --editor vscode`: VS Code tasks for the local loop: health check
24
+ with findings in the Problems panel, report and docs builds, hook dry runs,
25
+ a live architecture diagram, and the setup wizard. Existing tasks are kept.
26
+ - `bca setup agent --agent claude|copilot|cursor`: a `/bca-setup` command that
27
+ lets the user's AI agent guide the setup through the CLI.
28
+ - `bca run --trigger pre-commit|pre-push|ci|schedule`: one entry point for
29
+ every trigger, configured in the new `automation` section of `.bca.json`,
30
+ with `verify` and `stage` sync and `docs`, `codegraph`, and `diagrams` tasks.
31
+ - A GitHub Action (`uses: SchulzOli/BC-Atlas@v0.7.0`) with `outputs` and
32
+ `passed` outputs.
33
+ - MCP tools `bc_atlas_setup_plan`, `bc_atlas_setup_apply`, `bc_atlas_run`, and
34
+ `bc_atlas_update_check`.
35
+ - Update cycle: interactive commands show a notice when a newer version is
36
+ available (checked at most once a day in the background, off in CI, hooks,
37
+ `bca run`, and JSON output, or with `BCA_NO_UPDATE_CHECK`).
38
+ - `bca update`: release notes since the installed version, a confirmed update
39
+ of the global or project installation, and regenerated hooks, VS Code tasks,
40
+ pipelines, and agent commands. `--check` exits with `1` when an update exists.
41
+ - `bca setup --updates dependabot`: Dependabot pull requests for new
42
+ `bc-atlas` versions; `bca setup apply --from-config` reproduces an existing
43
+ setup.
44
+ - With a `package.json` that declares `bc-atlas`, generated pipelines and VS
45
+ Code tasks use that version (`npm ci`, `npx --no-install bca`).
46
+
47
+ ### Added
48
+
49
+ - `bca docs generate` presents scenarios in the structure of an OASIS DITA 1.3
50
+ task topic (prerequisites, steps, step results, result, related links).
51
+ The AL tags are unchanged.
52
+ - `--export markdown,html,dita,ado-csv`: Markdown, one self-contained HTML
53
+ file, DITA 1.3 task topics with a map, and an Azure DevOps Test Plans CSV.
54
+ - `--as testcase`: test case specification with preconditions, an
55
+ action/expected result/pass-fail table, and a sign-off block.
56
+ - `--app`: real page, field, part, and action captions and tooltips from the
57
+ app's AL source, plus page and action coverage in the index.
58
+ - `--language`: German and English wording; captions and tooltips from the
59
+ app's XLIFF translations.
60
+ - Use-case pages per `[FEATURE]`, a journey diagram of scenario links, and
61
+ indexes by page and permission set.
62
+ - `[THEN]` between two `[WHEN]` phases becomes the result of that phase.
63
+ - The MCP tool `bc_atlas_docs_generate` accepts formats, mode, app, and
64
+ language.
65
+ - Generated example documentation in `examples/docs`.
66
+
67
+ ### Changed
68
+
69
+ - Instructions follow Business Central help conventions ("Choose the 🔍
70
+ icon, enter ...", "In the **Field** field, enter ...", "Choose the
71
+ **Action** action."). Scenarios with one `[WHEN]` phase list their
72
+ instructions as top-level steps; repeated blocks become sub-steps.
73
+ - Node.js 22 or later is required; Node.js 20 reached end of life in April 2026.
74
+ The Docker image and generated pipelines use Node.js 24.
75
+ - CI runs once per pull request instead of twice, starts with one fast check
76
+ job, then tests Node.js 22 and 24 on Linux and Node.js 24 on Windows.
77
+
78
+ ## 0.6.0 - 2026-10-04
79
+
80
+ ### Added
81
+
82
+ - `bca init` creates a `.bca.json` tailored to the project: app title, excluded
83
+ test folders, and source links for GitHub, GitLab, or Azure DevOps remotes.
84
+ - `bca report` writes a static Markdown architecture report with an
85
+ at-a-glance table, diagrams for six views, the health summary, and optional
86
+ object catalog and JSON model.
87
+ - `bca check` evaluates architecture health (diagnostics, forbidden
88
+ dependencies, cycles, fan-in/fan-out hot spots, orphans, unresolved
89
+ references) with `--fail-on` levels and text, JSON, or Markdown output.
90
+ - `bca mcp` starts the MCP server; new MCP tools `bc_atlas_check` and
91
+ `bc_atlas_report`.
92
+ - `bca help <command>` and per-command `--help` with grouped options and
93
+ examples; `bca` without arguments shows all features by area.
94
+ - Feature areas and views in the `bca capabilities` contract.
95
+ - `check` and `report` sections in `.bca.json`.
96
+ - Example report in `examples/report`, regenerated by `npm run examples`.
97
+ - Public contribution, support, conduct, and security policies.
98
+ - Reproducible example project, generated diagrams, and feature screenshots.
99
+
100
+ ### Changed
101
+
102
+ - Every command is defined once in `src/capabilities.js`; help, parsing, enum
103
+ validation, the JSON contract, and generated docs derive from it.
104
+ - Commands only accept their own options and validate enum values; invalid
105
+ usage exits with code `2`, failed operations and checks with `1`.
106
+ - `[app-root]` defaults to the current directory.
107
+ - Clearer errors for missing paths, empty results, and unknown commands.
108
+ - Several views of one project share a single parse.
109
+ - Documentation reorganized by feature area; repository URLs point to
110
+ `SchulzOli/BC-Atlas`.
111
+ - The npm package ships only runtime files.
112
+ - Updated `@modelcontextprotocol/server`, `zod`, and `web-tree-sitter` (0.27).
113
+
114
+ ### Removed
115
+
116
+ - The local web Control Center: `bca serve`, `bca docs serve`, and the
117
+ `marked` and `dompurify` dependencies. Use `bca report` for a browsable
118
+ overview.
119
+
120
+ ### Fixed
121
+
122
+ - Rendering more than one SVG in a single process could exit early because the
123
+ D2 worker was unreferenced between renders.
124
+ - `bca-mcp` did not start when invoked through an npm bin symlink.
125
+ - `codegraph` no longer deletes a non-empty output directory that it did not
126
+ generate.
127
+
128
+ ## 0.5.0 - 2026-07-30
129
+
130
+ ### Added
131
+
132
+ - Project, module, object, data, call, boundary, contracts, events, UI, and
133
+ workflow diagram views.
134
+ - D2, JSON, and WebAssembly-rendered SVG output.
135
+ - AL UI-test-to-Markdown documentation generation.
136
+ - Configuration, watch mode, diagnostics, dependency policies, and Docker
137
+ support.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BC Atlas contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BC Atlas contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.