@zenstackhq/language 3.0.0-alpha.3 → 3.0.0-alpha.6

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/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { LangiumServices, PartialLangiumServices, LangiumSharedServices, Default
4
4
  import { Model, DataSource, DataModel, TypeDef, Enum, Attribute, Expression, InvocationExpr, FunctionDecl } from './ast.cjs';
5
5
 
6
6
  /******************************************************************************
7
- * This file was generated by langium-cli 3.3.0.
7
+ * This file was generated by langium-cli 3.5.0.
8
8
  * DO NOT EDIT MANUALLY!
9
9
  ******************************************************************************/
10
10
 
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { LangiumServices, PartialLangiumServices, LangiumSharedServices, Default
4
4
  import { Model, DataSource, DataModel, TypeDef, Enum, Attribute, Expression, InvocationExpr, FunctionDecl } from './ast.js';
5
5
 
6
6
  /******************************************************************************
7
- * This file was generated by langium-cli 3.3.0.
7
+ * This file was generated by langium-cli 3.5.0.
8
8
  * DO NOT EDIT MANUALLY!
9
9
  ******************************************************************************/
10
10
 
package/dist/index.js CHANGED
@@ -10,9 +10,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
10
10
  // src/index.ts
11
11
  import { URI as URI3 } from "langium";
12
12
  import { NodeFileSystem } from "langium/node";
13
- import fs3 from "node:fs";
14
- import path3 from "node:path";
15
- import { fileURLToPath as fileURLToPath2 } from "node:url";
13
+ import fs3 from "fs";
14
+ import path3 from "path";
15
+ import { fileURLToPath as fileURLToPath2 } from "url";
16
16
 
17
17
  // src/constants.ts
18
18
  var SUPPORTED_PROVIDERS = [
@@ -48,7 +48,7 @@ import { inject } from "langium";
48
48
  import { createDefaultModule, createDefaultSharedModule } from "langium/lsp";
49
49
 
50
50
  // src/generated/ast.ts
51
- import { AbstractAstReflection } from "langium";
51
+ import * as langium from "langium";
52
52
  var AbstractDeclaration = "AbstractDeclaration";
53
53
  var ConfigExpr = "ConfigExpr";
54
54
  var Expression = "Expression";
@@ -207,7 +207,7 @@ __name(isTypeDefField, "isTypeDefField");
207
207
  var TypeDefFieldType = "TypeDefFieldType";
208
208
  var UnaryExpr = "UnaryExpr";
209
209
  var UnsupportedFieldType = "UnsupportedFieldType";
210
- var ZModelAstReflection = class extends AbstractAstReflection {
210
+ var ZModelAstReflection = class extends langium.AbstractAstReflection {
211
211
  static {
212
212
  __name(this, "ZModelAstReflection");
213
213
  }
@@ -1102,8 +1102,8 @@ var ZModelGrammar = /* @__PURE__ */ __name(() => loadedZModelGrammar ?? (loadedZ
1102
1102
  "rules": [
1103
1103
  {
1104
1104
  "$type": "ParserRule",
1105
- "name": "Model",
1106
1105
  "entry": true,
1106
+ "name": "Model",
1107
1107
  "definition": {
1108
1108
  "$type": "Group",
1109
1109
  "elements": [
@@ -1789,8 +1789,8 @@ var ZModelGrammar = /* @__PURE__ */ __name(() => loadedZModelGrammar ?? (loadedZ
1789
1789
  },
1790
1790
  {
1791
1791
  "$type": "ParserRule",
1792
- "name": "ConfigInvocationArgList",
1793
1792
  "fragment": true,
1793
+ "name": "ConfigInvocationArgList",
1794
1794
  "definition": {
1795
1795
  "$type": "Group",
1796
1796
  "elements": [
@@ -2097,8 +2097,8 @@ var ZModelGrammar = /* @__PURE__ */ __name(() => loadedZModelGrammar ?? (loadedZ
2097
2097
  },
2098
2098
  {
2099
2099
  "$type": "ParserRule",
2100
- "name": "ReferenceArgList",
2101
2100
  "fragment": true,
2101
+ "name": "ReferenceArgList",
2102
2102
  "definition": {
2103
2103
  "$type": "Group",
2104
2104
  "elements": [
@@ -2914,8 +2914,8 @@ var ZModelGrammar = /* @__PURE__ */ __name(() => loadedZModelGrammar ?? (loadedZ
2914
2914
  },
2915
2915
  {
2916
2916
  "$type": "ParserRule",
2917
- "name": "ArgumentList",
2918
2917
  "fragment": true,
2918
+ "name": "ArgumentList",
2919
2919
  "definition": {
2920
2920
  "$type": "Group",
2921
2921
  "elements": [
@@ -4783,8 +4783,8 @@ var ZModelGrammar = /* @__PURE__ */ __name(() => loadedZModelGrammar ?? (loadedZ
4783
4783
  },
4784
4784
  {
4785
4785
  "$type": "ParserRule",
4786
- "name": "AttributeArgList",
4787
4786
  "fragment": true,
4787
+ "name": "AttributeArgList",
4788
4788
  "definition": {
4789
4789
  "$type": "Group",
4790
4790
  "elements": [
@@ -5244,7 +5244,7 @@ import pluralize from "pluralize";
5244
5244
  // src/utils.ts
5245
5245
  import { AstUtils, URI } from "langium";
5246
5246
  import path from "path";
5247
- import fs from "node:fs";
5247
+ import fs from "fs";
5248
5248
  function hasAttribute(decl, name) {
5249
5249
  return !!getAttribute(decl, name);
5250
5250
  }
@@ -5586,7 +5586,7 @@ function findNodeModulesFile(name, cwd = process.cwd()) {
5586
5586
  ]
5587
5587
  });
5588
5588
  return resolvedPath;
5589
- } catch (error) {
5589
+ } catch {
5590
5590
  return void 0;
5591
5591
  }
5592
5592
  }
@@ -6490,7 +6490,6 @@ var EnumValidator = class {
6490
6490
  static {
6491
6491
  __name(this, "EnumValidator");
6492
6492
  }
6493
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
6494
6493
  validate(_enum, accept) {
6495
6494
  validateDuplicatedDeclarations(_enum, _enum.fields, accept);
6496
6495
  this.validateAttributes(_enum, accept);
@@ -6935,10 +6934,10 @@ var SchemaValidator = class {
6935
6934
  constructor(documents) {
6936
6935
  this.documents = documents;
6937
6936
  }
6938
- async validate(model, accept) {
6939
- await this.validateImports(model, accept);
6937
+ validate(model, accept) {
6938
+ this.validateImports(model, accept);
6940
6939
  validateDuplicatedDeclarations(model, model.declarations, accept);
6941
- const importedModels = await resolveTransitiveImports(this.documents, model);
6940
+ const importedModels = resolveTransitiveImports(this.documents, model);
6942
6941
  const importedNames = new Set(importedModels.flatMap((m) => m.declarations.map((d) => d.name)));
6943
6942
  for (const declaration of model.declarations) {
6944
6943
  if (importedNames.has(declaration.name)) {
@@ -6960,16 +6959,16 @@ var SchemaValidator = class {
6960
6959
  });
6961
6960
  }
6962
6961
  }
6963
- async validateImports(model, accept) {
6964
- await Promise.all(model.imports.map(async (imp) => {
6965
- const importedModel = await resolveImport(this.documents, imp);
6962
+ validateImports(model, accept) {
6963
+ model.imports.forEach((imp) => {
6964
+ const importedModel = resolveImport(this.documents, imp);
6966
6965
  const importPath = imp.path.endsWith(".zmodel") ? imp.path : `${imp.path}.zmodel`;
6967
6966
  if (!importedModel) {
6968
6967
  accept("error", `Cannot find model file ${importPath}`, {
6969
6968
  node: imp
6970
6969
  });
6971
6970
  }
6972
- }));
6971
+ });
6973
6972
  }
6974
6973
  };
6975
6974
 
@@ -7587,9 +7586,9 @@ __name(getCollectionPredicateContext, "getCollectionPredicateContext");
7587
7586
 
7588
7587
  // src/zmodel-workspace-manager.ts
7589
7588
  import { DefaultWorkspaceManager, URI as URI2 } from "langium";
7590
- import fs2 from "node:fs";
7591
- import path2 from "node:path";
7592
- import { fileURLToPath } from "node:url";
7589
+ import fs2 from "fs";
7590
+ import path2 from "path";
7591
+ import { fileURLToPath } from "url";
7593
7592
  var ZModelWorkspaceManager = class extends DefaultWorkspaceManager {
7594
7593
  static {
7595
7594
  __name(this, "ZModelWorkspaceManager");
@@ -7618,7 +7617,7 @@ var ZModelWorkspaceManager = class extends DefaultWorkspaceManager {
7618
7617
  console.log(`Found installed zenstack package stdlib at: ${installedStdlibPath}`);
7619
7618
  break;
7620
7619
  }
7621
- } catch (error) {
7620
+ } catch {
7622
7621
  continue;
7623
7622
  }
7624
7623
  }