archgraph-argo-beta 0.27.0-beta.6 → 0.27.0-beta.7

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.
@@ -2,6 +2,8 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "ArchiMate 3.2 default schema bundle descriptor",
4
4
  "description": "Descriptor for the default ARGO schema bundle (ArchiMate 3.2 + ARGO extensions). A repository may override this bundle by placing its own SystemArchitecture.schema.json (plus an optional schema-bundle.config.json / schema-bundle.rules.json) under <workspace>/.argo/schema.",
5
+ "id": "default",
6
+ "aliases": ["archimate3.2", "archimate", "base"],
5
7
  "language": "ArchiMate 3.2",
6
8
  "elementTypeEnumKey": "archimateElementType",
7
9
  "relationshipTypeEnumKey": "archimateRelationshipType",
@@ -178,14 +178,38 @@ function hasExtendsConfig(dir) {
178
178
  return typeof config.extends === 'string' && config.extends.trim() !== '';
179
179
  }
180
180
 
181
+ // Symbolic names a bundle declares about itself (`id` + `aliases`) in its config.
182
+ // The framework resolves an `extends` value against these DECLARED names — never a
183
+ // name hardcoded in framework logic — so a bundle's identity/aliases are data.
184
+ function bundleSymbolicNames(dir) {
185
+ const config = bundleConfig(dir);
186
+ const names = new Set();
187
+ if (typeof config.id === 'string' && config.id.trim() !== '') {
188
+ names.add(config.id.trim());
189
+ }
190
+ if (Array.isArray(config.aliases)) {
191
+ for (const alias of config.aliases) {
192
+ if (typeof alias === 'string' && alias.trim() !== '') {
193
+ names.add(alias.trim());
194
+ }
195
+ }
196
+ }
197
+ return names;
198
+ }
199
+
181
200
  function resolveBaseBundleDir(ext, childDir) {
182
201
  const value = String(ext).trim();
183
- // Reserved, language-neutral name for the built-in default bundle. Any other
184
- // value is a path to another bundle directory — the framework never hardcodes a
185
- // modeling-language name (ArchiMate or otherwise) into bundle resolution.
202
+ // `default` is the reserved, language-neutral name of the built-in bundle.
186
203
  if (value === 'default') {
187
204
  return path.join(getArgoRoot(), 'schema');
188
205
  }
206
+ // Otherwise resolve a SYMBOLIC name against the built-in bundle's self-declared
207
+ // id/aliases (data), then fall back to a relative path. Framework logic contains
208
+ // no modeling-language names.
209
+ const defaultDir = path.join(getArgoRoot(), 'schema');
210
+ if (bundleSymbolicNames(defaultDir).has(value)) {
211
+ return defaultDir;
212
+ }
189
213
  return path.resolve(childDir, value);
190
214
  }
191
215
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo-beta",
3
- "version": "0.27.0-beta.6",
3
+ "version": "0.27.0-beta.7",
4
4
  "description": "Deploy the ArchGraph ARGO toolchain, skills, and rules (schema, scripts, argo-init skill, global rule) with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {