likec4 1.29.1 → 1.31.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.
package/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
- import { ProjectId, DiagramView, NonEmptyArray } from '@likec4/core';
2
- export { AbstractRelation, AutoLayoutDirection, BBox, Color, ComputedDeploymentView, ComputedDynamicView, ComputedEdge, ComputedElementView, ComputedLikeC4ModelData, ComputedNode, ComputedView, DeployedInstance, DeploymentElement, DeploymentNode, DeploymentNodeKind, DeploymentRelation, DeploymentView, DiagramEdge, DiagramNode, DiagramView, DynamicView, EdgeId, Element, ElementKind, ElementView, Fqn, HexColorLiteral, LayoutedLikeC4ModelData, LikeC4View, NodeId, ParsedLikeC4ModelData, Point, RelationExpr, RelationId, StepEdgeId, Tag, ThemeColor, ViewId, XYPoint } from '@likec4/core';
3
1
  import { LikeC4Model } from '@likec4/core/model';
4
2
  export { AnyAux, Aux, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel } from '@likec4/core/model';
5
- import { W as WorkspaceFolder, a as LikeC4Services, G as GraphvizLayouter, L as LikeC4LanguageServices, b as LikeC4Views, R as Range } from './shared/likec4.tyGQtUCS.mjs';
3
+ import { DiagramView } from '@likec4/core/types';
4
+ export { AbstractRelation, AutoLayoutDirection, BBox, Color, ComputedDeploymentView, ComputedDynamicView, ComputedEdge, ComputedElementView, ComputedLikeC4ModelData, ComputedNode, ComputedView, DeployedInstance, DeploymentElement, DeploymentNode, DeploymentNodeKind, DeploymentRelation, DeploymentView, DiagramEdge, DiagramNode, DiagramView, DynamicView, EdgeId, Element, ElementKind, ElementView, Fqn, HexColorLiteral, LayoutedLikeC4ModelData, LikeC4View, NodeId, ParsedLikeC4ModelData, Point, RelationExpr, RelationId, StepEdgeId, Tag, ThemeColor, ViewId, XYPoint } from '@likec4/core/types';
5
+ import { W as WorkspaceFolder, a as LikeC4Services, G as GraphvizLayouter, L as LikeC4LanguageServices, b as LikeC4Views, R as Range } from './shared/likec4.BaUvDeNQ.mjs';
6
+ import { ProjectId, NonEmptyArray } from '@likec4/core';
6
7
  import 'type-fest';
7
8
  import '/home/runner/work/likec4/likec4/node_modules/.pnpm/@types+picomatch@4.0.0/node_modules/@types/picomatch/posix.d.ts';
8
- import '@likec4/core/types';
9
9
  import '@likec4/core/utils';
10
10
 
11
11
  type Logger = {
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import"@likec4/core";export{LikeC4DeploymentModel,LikeC4Model,LikeC4ViewModel}from"@likec4/core/model";export{L as LikeC4}from"./shared/likec4.CLg3BMaP.mjs";import"node:fs";import"node:path";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"@likec4/core/utils";import"node:process";
2
- import"boxen";import"node:child_process";import"node:events";import"node:fs/promises";import"node:stream/promises";import"node:os";import"fs/promises";
1
+ export{LikeC4DeploymentModel,LikeC4Model,LikeC4ViewModel}from"@likec4/core/model";import"@likec4/core/types";export{L as LikeC4}from"./shared/likec4.CJIOuLMn.mjs";import"node:fs";import"node:path";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"@likec4/core/utils";import"node:process";
2
+ import"boxen";import"node:child_process";import"node:events";import"node:fs/promises";import"node:stream/promises";import"node:readline/promises";import"node:os";import"fs/promises";
@@ -1,6 +1,6 @@
1
- import { LikeC4Model } from '@likec4/core';
2
- export { AbstractRelation, AutoLayoutDirection, BBox, Color, ComputedDeploymentView, ComputedDynamicView, ComputedEdge, ComputedElementView, ComputedLikeC4ModelData, ComputedNode, ComputedView, DeployedInstance, DeploymentElement, DeploymentNode, DeploymentNodeKind, DeploymentRelation, DeploymentView, DiagramEdge, DiagramNode, DiagramView, DynamicView, EdgeId, Element, ElementKind, ElementView, Fqn, HexColorLiteral, LayoutedLikeC4ModelData, LikeC4View, NodeId, OverviewGraph, ParsedLikeC4ModelData, Point, RelationExpr, RelationId, StepEdgeId, Tag, ThemeColor, ViewId, WhereOperator, XYPoint } from '@likec4/core';
3
- export { AnyAux, Aux, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isIncoming, isNestedConnection, isOutgoing, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from '@likec4/core/model';
1
+ import { LikeC4Model } from '@likec4/core/model';
2
+ export { AnyAux, Aux, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstance, isDeploymentNode, isIncoming, isNestedConnection, isOutgoing, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from '@likec4/core/model';
3
+ export { AbstractRelation, AnyParsedLikeC4ModelData, AutoLayoutDirection, BBox, Color, ComputedDeploymentView, ComputedDynamicView, ComputedEdge, ComputedElementView, ComputedLikeC4ModelData, ComputedNode, ComputedView, DeployedInstance, DeploymentElement, DeploymentNode, DeploymentNodeKind, DeploymentRelation, DeploymentView, DiagramEdge, DiagramNode, DiagramView, DynamicView, EdgeId, Element, ElementKind, ElementView, Fqn, HexColorLiteral, LayoutedLikeC4ModelData, LikeC4View, NodeId, OverviewGraph, ParsedLikeC4ModelData, Point, RelationExpr, RelationId, StepEdgeId, Tag, ThemeColor, ViewId, WhereOperator, XYPoint, isDeploymentView, isElementView, isScopedElementView, isStepEdgeId } from '@likec4/core/types';
4
4
 
5
5
  /**
6
6
  * Used by vite plugin to generate `virtual:likec4/model`
@@ -1,2 +1,2 @@
1
- import{LikeC4Model as o}from"@likec4/core";export{ComputedNode,ComputedView,DiagramNode}from"@likec4/core";export{Connection,ConnectionModel,DeployedInstanceModel,DeploymentConnectionModel,DeploymentNodeModel,DeploymentRelationModel,EdgeModel,ElementModel,LikeC4DeploymentModel,LikeC4Model,LikeC4ViewModel,NodeModel,RelationshipModel,deploymentConnection,differenceConnections,findAscendingConnections,findDeepestNestedConnection,findDescendantConnections,hasSameSource,hasSameSourceTarget,hasSameTarget,
2
- isAnyInOut,isIncoming,isNestedConnection,isOutgoing,mergeConnections,modelConnection,sortConnectionsByBoundaryHierarchy,sortDeepestFirst}from"@likec4/core/model";function n(e){return o.create(e)}export{n as createLikeC4Model};
1
+ import{LikeC4Model as o}from"@likec4/core/model";export{Connection,ConnectionModel,DeployedInstanceModel,DeploymentConnectionModel,DeploymentNodeModel,DeploymentRelationModel,EdgeModel,ElementModel,LikeC4DeploymentModel,LikeC4Model,LikeC4ViewModel,NodeModel,RelationshipModel,deploymentConnection,differenceConnections,findAscendingConnections,findDeepestNestedConnection,findDescendantConnections,hasSameSource,hasSameSourceTarget,hasSameTarget,isAnyInOut,isDeployedInstance,isDeploymentNode,isIncoming,
2
+ isNestedConnection,isOutgoing,mergeConnections,modelConnection,sortConnectionsByBoundaryHierarchy,sortDeepestFirst}from"@likec4/core/model";export{ComputedNode,ComputedView,DiagramNode,isDeploymentView,isElementView,isScopedElementView,isStepEdgeId}from"@likec4/core/types";function n(e){return o.create(e)}export{n as createLikeC4Model};
@@ -4715,7 +4715,7 @@ interface UriComponents {
4715
4715
  }
4716
4716
 
4717
4717
  /******************************************************************************
4718
- * This file was generated by langium-cli 3.4.0.
4718
+ * This file was generated by langium-cli 3.5.0.
4719
4719
  * DO NOT EDIT MANUALLY!
4720
4720
  ******************************************************************************/
4721
4721
 
@@ -5509,10 +5509,6 @@ interface BaseParser$1 {
5509
5509
  * Executes a grammar action that modifies the currently active AST node
5510
5510
  */
5511
5511
  action($type: string, action: Action): void;
5512
- /**
5513
- * Finishes construction of the current AST node. Only used by the AST parser.
5514
- */
5515
- construct(): unknown;
5516
5512
  /**
5517
5513
  * Whether the parser is currently actually in use or in "recording mode".
5518
5514
  * Recording mode is activated once when the parser is analyzing itself.
@@ -5544,7 +5540,6 @@ declare abstract class AbstractLangiumParser implements BaseParser$1 {
5544
5540
  abstract consume(idx: number, tokenType: TokenType, feature: AbstractElement): void;
5545
5541
  abstract subrule(idx: number, rule: RuleResult, fragment: boolean, feature: AbstractElement, args: Args): void;
5546
5542
  abstract action($type: string, action: Action): void;
5547
- abstract construct(): unknown;
5548
5543
  getRule(name: string): RuleResult | undefined;
5549
5544
  isRecording(): boolean;
5550
5545
  get unorderedGroups(): Map<string, boolean[]>;
@@ -5567,6 +5562,7 @@ declare class LangiumParser extends AbstractLangiumParser {
5567
5562
  rule(rule: ParserRule, impl: RuleImpl): RuleResult;
5568
5563
  private computeRuleType;
5569
5564
  parse<T extends AstNode = AstNode>(input: string, options?: ParserOptions): ParseResult<T>;
5565
+ private doParse;
5570
5566
  private startImplementation;
5571
5567
  private extractHiddenTokens;
5572
5568
  consume(idx: number, tokenType: TokenType, feature: AbstractElement): void;
@@ -5580,7 +5576,7 @@ declare class LangiumParser extends AbstractLangiumParser {
5580
5576
  subrule(idx: number, rule: RuleResult, fragment: boolean, feature: AbstractElement, args: Args): void;
5581
5577
  private performSubruleAssignment;
5582
5578
  action($type: string, action: Action): void;
5583
- construct(): unknown;
5579
+ private construct;
5584
5580
  private getAssignment;
5585
5581
  private assign;
5586
5582
  private assignWithoutOverride;
@@ -5625,7 +5621,7 @@ declare class ChevrotainWrapper extends EmbeddedActionsParser {
5625
5621
  definitionErrors: IParserDefinitionError[];
5626
5622
  constructor(tokens: TokenVocabulary, config: IParserConfig);
5627
5623
  get IS_RECORDING(): boolean;
5628
- DEFINE_RULE(name: string, impl: RuleImpl): RuleResult;
5624
+ DEFINE_RULE(name: string, impl: RuleImpl, config?: IRuleConfig<any>): RuleResult;
5629
5625
  wrapSelfAnalysis(): void;
5630
5626
  wrapConsume(idx: number, tokenType: TokenType): IToken;
5631
5627
  wrapSubrule(idx: number, rule: RuleResult, args: Args): unknown;
@@ -6485,6 +6481,7 @@ interface DocumentationProvider {
6485
6481
  interface LanguageMetaData {
6486
6482
  languageId: string;
6487
6483
  fileExtensions: readonly string[];
6484
+ fileNames?: readonly string[];
6488
6485
  caseInsensitive: boolean;
6489
6486
  /**
6490
6487
  * Mode used to optimize code for development or production environments.
@@ -6940,6 +6937,8 @@ type ValidationChecks<T> = {
6940
6937
  AstNode?: ValidationCheck<AstNode> | Array<ValidationCheck<AstNode>>;
6941
6938
  };
6942
6939
  /**
6940
+ * There are 3 pre-defined categories: `fast`, `slow` and `built-in`.
6941
+ *
6943
6942
  * `fast` checks can be executed after every document change (i.e. as the user is typing). If a check
6944
6943
  * is too slow it can delay the response to document changes, yielding bad user experience. By marking
6945
6944
  * it as `slow`, it will be skipped for normal as-you-type validation. Then it's up to you when to
@@ -6948,8 +6947,12 @@ type ValidationChecks<T> = {
6948
6947
  *
6949
6948
  * `built-in` checks are errors produced by the lexer, the parser, or the linker. They cannot be used
6950
6949
  * for custom validation checks.
6950
+ *
6951
+ * You can also provide user-defined categories. These check will be skipped by default. Then it's up
6952
+ * to you to schedule these checks: after the fast checks are done, or after saving a document,
6953
+ * or with an explicit command, etc.
6951
6954
  */
6952
- type ValidationCategory = 'fast' | 'slow' | 'built-in';
6955
+ type ValidationCategory = 'fast' | 'slow' | 'built-in' | (string & {});
6953
6956
  declare namespace ValidationCategory {
6954
6957
  const all: readonly ValidationCategory[];
6955
6958
  }
@@ -7032,9 +7035,9 @@ interface ValidationOptions {
7032
7035
  categories?: ValidationCategory[];
7033
7036
  /** If true, no further diagnostics are reported if there are lexing errors. */
7034
7037
  stopAfterLexingErrors?: boolean;
7035
- /** If true, no further diagnostics are reported if there are parsing errors. */
7038
+ /** If true, no further diagnostics are reported if there are parsing errors. Lexing errors are reported first. */
7036
7039
  stopAfterParsingErrors?: boolean;
7037
- /** If true, no further diagnostics are reported if there are linking errors. */
7040
+ /** If true, no further diagnostics are reported if there are linking errors. Lexing and parsing errors are reported first. */
7038
7041
  stopAfterLinkingErrors?: boolean;
7039
7042
  }
7040
7043
  /**
@@ -11572,6 +11575,13 @@ type ConfigurationSectionUpdateListener = (update: ConfigurationSectionUpdate) =
11572
11575
  ******************************************************************************/
11573
11576
 
11574
11577
  interface BuildOptions {
11578
+ /**
11579
+ * Control the linking and references indexing phase with this option. The default if not specified is `true`.
11580
+ * If set to `false`, references can still be resolved - that's done lazily when you access the `ref` property of
11581
+ * a reference. But you won't get any diagnostics for linking errors and the references won't be considered
11582
+ * when updating other documents.
11583
+ */
11584
+ eagerLinking?: boolean;
11575
11585
  /**
11576
11586
  * Control the validation phase with this option:
11577
11587
  * - `true` enables all validation checks and forces revalidating the documents
@@ -11727,6 +11737,15 @@ interface WorkspaceManager {
11727
11737
  */
11728
11738
  initializeWorkspace(folders: WorkspaceFolder[], cancelToken?: CancellationToken): Promise<void>;
11729
11739
  }
11740
+ /**
11741
+ * The FileSelector provides file names and extensions used by this extension.
11742
+ */
11743
+ interface FileSelector {
11744
+ /** Allowed file extensions (e.g., ["ts", "js"]). */
11745
+ fileExtensions: string[];
11746
+ /** Allowed file names (e.g., ["config", "settings"]). */
11747
+ fileNames: string[];
11748
+ }
11730
11749
  declare class DefaultWorkspaceManager implements WorkspaceManager {
11731
11750
  initialBuildOptions: BuildOptions;
11732
11751
  protected readonly serviceRegistry: ServiceRegistry;
@@ -11763,11 +11782,11 @@ declare class DefaultWorkspaceManager implements WorkspaceManager {
11763
11782
  * Traverse the file system folder identified by the given URI and its subfolders. All
11764
11783
  * contained files that match the file extensions are added to the collector.
11765
11784
  */
11766
- protected traverseFolder(workspaceFolder: WorkspaceFolder, folderPath: URI, fileExtensions: string[], collector: (document: LangiumDocument) => void): Promise<void>;
11785
+ protected traverseFolder(workspaceFolder: WorkspaceFolder, folderPath: URI, selector: FileSelector, collector: (document: LangiumDocument) => void): Promise<void>;
11767
11786
  /**
11768
11787
  * Determine whether the given folder entry shall be included while indexing the workspace.
11769
11788
  */
11770
- protected includeEntry(_workspaceFolder: WorkspaceFolder, entry: FileSystemNode, fileExtensions: string[]): boolean;
11789
+ protected includeEntry(_workspaceFolder: WorkspaceFolder, entry: FileSystemNode, selector: FileSelector): boolean;
11771
11790
  }
11772
11791
 
11773
11792
  /******************************************************************************
@@ -13462,6 +13481,7 @@ declare abstract class AstNodeHoverProvider implements HoverProvider {
13462
13481
  constructor(services: LangiumServices);
13463
13482
  getHoverContent(document: LangiumDocument, params: HoverParams): MaybePromise$1<Hover | undefined>;
13464
13483
  protected abstract getAstNodeHoverContent(node: AstNode): MaybePromise$1<Hover | undefined>;
13484
+ protected getKeywordHoverContent(node: AstNode): MaybePromise$1<Hover | undefined>;
13465
13485
  }
13466
13486
 
13467
13487
  /******************************************************************************
@@ -15584,7 +15604,7 @@ declare const ProjectConfig: ObjectSchema<{
15584
15604
  type ProjectConfig = InferOutput<typeof ProjectConfig>;
15585
15605
 
15586
15606
  /******************************************************************************
15587
- * This file was generated by langium-cli 3.4.0.
15607
+ * This file was generated by langium-cli 3.5.0.
15588
15608
  * DO NOT EDIT MANUALLY!
15589
15609
  ******************************************************************************/
15590
15610
 
@@ -16959,7 +16979,7 @@ declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
16959
16979
  /**
16960
16980
  * Determine whether the given folder entry shall be included while indexing the workspace.
16961
16981
  */
16962
- protected includeEntry(_workspaceFolder: WorkspaceFolder, entry: FileSystemNode, fileExtensions: string[]): boolean;
16982
+ protected includeEntry(_workspaceFolder: WorkspaceFolder, entry: FileSystemNode, selector: FileSelector): boolean;
16963
16983
  workspace(): any;
16964
16984
  get workspaceUri(): URI;
16965
16985
  get workspaceURL(): URL;