Skip to content

Commit 0537fff

Browse files
committed
docs(bcasl,acasl): clarify plugin location under API/ and emphasize BCASL tag importance
- Add IMPORTANT notes: plugins must live under API/<plugin_id>/ (not under acasl/ or bcasl/)\n- Fix Quick Navigation anchors and add 'Why tags matter' subsection\n- Expand tag guidance and recommended stage tags
1 parent d85f96e commit 0537fff

2 files changed

Lines changed: 28 additions & 6 deletions

File tree

docs/how_to_create_a_bcasl_API.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Quick Navigation
99
- [Layout](#2-folder-layout)
1010
- [Minimal plugin](#3-minimal-plugin-with-metadata)
1111
- [Tags](#4-tag-taxonomy-and-default-ordering-minify-before-obfuscation)
12+
- [Why tags matter](#why-tags-matter)
1213
- [Progress](#5-progress-and-non-interactive-considerations)
1314
- [Configuration](#6-configuration-patterns)
14-
- [System installs](#61-system-install-helpers-pip-global--package-managers)
15+
- [System installs (6.1)](#61-system-install-helpers-pip-global--package-managers)
1516
- [Context](#7-context-essentials)
1617
- [i18n](#8-i18n-async)
1718
- [Workspace](#9-workspace-switching-safe)
@@ -28,7 +29,9 @@ Highlights (what changed)
2829
- Better examples: minimal plugin, minifier sample, obfuscation sample, and system installs sample.
2930

3031
Strict rules (BCASL package signature)
31-
- Your plugin must be a Python package under API/<plugin_id>/ with an __init__.py.
32+
33+
> IMPORTANT: BCASL plugins must always live under API/<plugin_id>/ as Python packages (folder with an __init__.py). Paths such as bcasl/<plugin_id>/ or acasl/<plugin_id>/ are invalid and will not be discovered.
34+
- Your plugin must be a Python package under API/<plugin_id>/ with an __init__.py (not under acasl/ or bcasl/).
3235
- In __init__.py, declare at least:
3336
- BCASL_PLUGIN = True
3437
- BCASL_ID = "your_id"
@@ -128,6 +131,7 @@ def bcasl_register(manager):
128131

129132
2) Folder layout
130133

134+
Place plugins exclusively under API/<plugin_id>/ (never under acasl/ or bcasl/):
131135
```
132136
<project root>
133137
└── API/
@@ -199,6 +203,22 @@ Notes:
199203
- Using tags improves default ordering and UX; the user remains free to override order in bcasl.* or via the UI.
200204
- Absence of tags falls back to textual heuristics on name/description with the same taxonomy.
201205

206+
### Why tags matter
207+
- Drive default ordering deterministically across projects and workspaces.
208+
- Prevent anti-patterns like running obfuscation before minification or packaging before validation.
209+
- Improve the UI: grouping, filtering, and tooltips leverage tags to present clearer pipelines.
210+
- Reduce manual configuration: fewer per-workspace overrides and fewer ordering mistakes.
211+
- Aid onboarding: contributors understand intent and stage from tags at a glance.
212+
213+
Recommended baseline tags by stage:
214+
- Early: clean, validation
215+
- Prepare: prepare, resources, configure, codegen
216+
- Quality: lint, format, typecheck
217+
- Transform: minify, obfuscation
218+
- Package: packaging, bundle, archive
219+
- Meta: manifest, version, docs
220+
- Delivery: publish, release
221+
202222
---
203223

204224
5) Progress and non‑interactive considerations
@@ -453,7 +473,7 @@ def bcasl_register(manager):
453473
---
454474

455475
11) Troubleshooting
456-
- Plugin not visible → ensure BCASL_PLUGIN/ID/DESCRIPTION exist; use @plugin; register via bcasl_register; open API Loader; check logs
476+
- Plugin not visible → ensure BCASL_PLUGIN/ID/DESCRIPTION exist; it's under API/<plugin_id>/ (not under acasl/ or bcasl/); use @plugin; register via bcasl_register; open API Loader; check logs
457477
- Config invalid → use UI raw editor; validate formats; fall back to JSON
458478
- Long operations → use progress; split work; no modal blocking in background
459479
- Ordering not as expected → add/adjust BCASL_TAGS (e.g., "minify", "obfuscation") or override order in the UI

docs/how_to_create_an_acasl_API.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Highlights (what changed)
2626
- Examples updated to demonstrate system installs and best practices.
2727

2828
Important rules (strict)
29+
30+
> IMPORTANT: ACASL plugins must always live under API/<plugin_id>/ as Python packages (folder with an __init__.py). Paths such as acasl/<plugin_id>/ or bcasl/<plugin_id>/ are not valid for ACASL plugins and will not be discovered.
2931
- ACASL plugins must be Python packages under API/<plugin_id>/ (folder with an __init__.py).
3032
- Mandatory package signature in __init__.py:
3133
- ACASL_PLUGIN = True
@@ -87,11 +89,11 @@ ACASL is the post‑compilation counterpart to BCASL. It runs automatically afte
8789
## Execution flow and integration
8890
- ACASL is triggered after all builds complete.
8991
- The default artifact collector scans `<workspace>/dist` and `<workspace>/build` and passes the file list to plugins.
90-
- Plugins are discovered under API/ at the project root. Only Python packages that declare ACASL_PLUGIN = True and expose acasl_run(ctx) are considered. The runtime further validates ACASL_ID/ACASL_DESCRIPTION; extended metadata are optional but recommended.
92+
- Plugins are discovered exclusively under API/ at the project root (never under acasl/ or bcasl/). Only Python packages that declare ACASL_PLUGIN = True and expose acasl_run(ctx) are considered. The runtime further validates ACASL_ID/ACASL_DESCRIPTION; extended metadata are optional but recommended.
9193
- ACASL runs asynchronously (non‑blocking UI). A soft timeout can be configured; each plugin run is measured (duration in ms).
9294

9395
## Where to place your plugins (package layout)
94-
Create Python packages under API/ (not loose .py files):
96+
Create Python packages under API/ (not loose .py files). Do not place ACASL plugins under acasl/ or bcasl/:
9597
```
9698
API/
9799
├── hash_report/
@@ -288,7 +290,7 @@ def acasl_run(ctx):
288290
- Ensure `acasl/__init__.py` points to `acasl/acasl_loader.py`.
289291
- Ensure UI connects to `from acasl import open_acasl_loader_dialog`.
290292
- Plugin not listed
291-
- Your plugin must be a Python package under API/<plugin_id>/ with an __init__.py.
293+
- Your plugin must be a Python package under API/<plugin_id>/ with an __init__.py (not under acasl/ or bcasl/).
292294
- __init__.py must define ACASL_PLUGIN = True and a callable acasl_run(ctx).
293295
- Required metadata missing: ensure ACASL_ID and ACASL_DESCRIPTION are defined (strings) — the loader/runtime enforce these.
294296
- No artifacts

0 commit comments

Comments
 (0)