@dbml/core 8.0.0-alpha.6 → 8.0.0-alpha.8

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.
package/lib/index.mjs CHANGED
@@ -8553,11 +8553,15 @@ var ProgramInterpreter = class {
8553
8553
  let HY = P.getValue();
8554
8554
  HY && this.pushElement(VY, HY);
8555
8555
  }
8556
- let _ = this.compiler.symbolMembers(this.programSymbol).getFiltered(UNHANDLED) ?? [];
8557
- for (let VY of _) {
8558
- if (!(VY instanceof SchemaSymbol)) continue;
8559
- let _ = this.compiler.symbolMembers(VY).getFiltered(UNHANDLED) ?? [];
8560
- for (let VY of _) VY instanceof UseSymbol && this.interpretUseSymbol(VY);
8556
+ let _ = /* @__PURE__ */ new Set(), VY = this.compiler.symbolMembers(this.programSymbol).getFiltered(UNHANDLED) ?? [];
8557
+ for (let P of VY) {
8558
+ if (!(P instanceof SchemaSymbol)) continue;
8559
+ let VY = this.compiler.symbolMembers(P).getFiltered(UNHANDLED) ?? [];
8560
+ for (let P of VY) {
8561
+ if (!(P instanceof UseSymbol)) continue;
8562
+ let VY = P.originalSymbol.intern();
8563
+ _.has(VY) || (_.add(VY), this.interpretUseSymbol(P));
8564
+ }
8561
8565
  }
8562
8566
  }
8563
8567
  interpretUseSymbol(_) {
@@ -9400,9 +9404,9 @@ var useUtils = { visibleName(_, VY) {
9400
9404
  nodeSymbol(_, VY) {
9401
9405
  if (!isUseSpecifier(VY) || !VY.name) return Report.create(PASS_THROUGH);
9402
9406
  let P = VY.getSymbolKind();
9403
- if (P === void 0) return Report.create(PASS_THROUGH);
9407
+ if (P === void 0 || P === SymbolKind.Schema) return Report.create(PASS_THROUGH);
9404
9408
  let HY = _.nodeReferee(VY.name).getFiltered(UNHANDLED);
9405
- return HY && !HY.canBeImported && P !== SymbolKind.Schema ? Report.create(PASS_THROUGH) : Report.create(_.symbolFactory.create(UseSymbol, {
9409
+ return HY && !HY.canBeImported ? Report.create(PASS_THROUGH) : Report.create(_.symbolFactory.create(UseSymbol, {
9406
9410
  useSpecifierDeclaration: VY,
9407
9411
  declaration: HY?.declaration,
9408
9412
  usedSymbol: HY,
@@ -10642,12 +10646,14 @@ var schemaModule = { symbolMembers(_, VY) {
10642
10646
  for (let HY of P) KY.push(...expandTableGroup(_, VY, HY));
10643
10647
  }
10644
10648
  let qY = /* @__PURE__ */ new Set(), JY = KY.filter((_) => {
10649
+ if (_ instanceof UseSymbol && _.isKind(SymbolKind.Schema)) return !1;
10645
10650
  let VY = `${_.originalSymbol.intern()}:${_.name ?? ""}`;
10646
10651
  return qY.has(VY) ? !1 : (qY.add(VY), !0);
10647
10652
  }), YY = /* @__PURE__ */ new Map();
10648
10653
  for (let _ of JY) {
10649
10654
  let VY = `${_.kind}:${_.name}`;
10650
10655
  if (YY.get(VY)) {
10656
+ if (_.isKind(SymbolKind.Schema)) continue;
10651
10657
  let VY = _ instanceof UseSymbol ? _.useSpecifierDeclaration ?? _.declaration : _.declaration instanceof ElementDeclarationNode && _.declaration.name ? _.declaration.name : _.declaration;
10652
10658
  VY && _.name !== void 0 && GY.push(getDuplicateSchemaMemberError(_.kind, _.name, P.join("."), VY));
10653
10659
  } else YY.set(VY, _);
@@ -14393,7 +14399,7 @@ function containerScopeKind(_, VY) {
14393
14399
  }
14394
14400
  function canonicalName(_, VY) {
14395
14401
  let P = VY.originalSymbol;
14396
- if (P.filepath.intern() === _.intern()) return Report.create(fullnameToCanonical(this, P));
14402
+ if (P.filepath.equals(_)) return Report.create(fullnameToCanonical(this, P));
14397
14403
  let HY = [...this.symbolUses(P).getValue(), ...this.symbolAliases(P).getValue()].filter((VY) => VY.filepath.equals(_));
14398
14404
  for (let _ of HY) {
14399
14405
  let VY = _.name;
@@ -1825773,5 +1825779,5 @@ function findDiagramViewBlocks(_) {
1825773
1825779
  let VY = new Compiler();
1825774
1825780
  return VY.setSource(DEFAULT_ENTRY, _), VY.findDiagramViewBlocks(DEFAULT_ENTRY);
1825775
1825781
  }
1825776
- const VERSION = "8.0.0-alpha.6";
1825782
+ const VERSION = "8.0.0-alpha.8";
1825777
1825783
  export { CompilerError, ModelExporter_default as ModelExporter, Parser_default as Parser, VERSION, addDoubleQuoteIfNeeded, dbmlMonarchTokensProvider, export_default as exporter, findDiagramViewBlocks, formatRecordValue, import_default as importer, isBinaryType, isBooleanType, isDateTimeType, isFloatType, isIntegerType, isNumericType, isSerialType, isStringType, renameTable, syncDiagramView, tryExtractBoolean, tryExtractDateTime, tryExtractEnum, tryExtractInteger, tryExtractNumeric, tryExtractString };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/core",
4
- "version": "8.0.0-alpha.6",
4
+ "version": "8.0.0-alpha.8",
5
5
  "description": "> TODO: description",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "lint:fix": "eslint --fix ."
47
47
  },
48
48
  "dependencies": {
49
- "@dbml/parse": "^8.0.0-alpha.6",
49
+ "@dbml/parse": "^8.0.0-alpha.8",
50
50
  "antlr4": "^4.13.1",
51
51
  "lodash": "^4.18.1",
52
52
  "lodash-es": "^4.18.1",
@@ -57,7 +57,7 @@
57
57
  "devDependencies": {
58
58
  "bluebird": "^3.5.5"
59
59
  },
60
- "gitHead": "52721b96504df2eeb4ff7fc13292896221a837ef",
60
+ "gitHead": "ddb14ef16808f03119bcdc7e28dc88e254a4e21f",
61
61
  "engines": {
62
62
  "node": ">=16"
63
63
  }