@artel/artc 0.6.25208 → 0.6.25209

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Compiler
3
- } from "./chunk-FABHNF5H.js";
3
+ } from "./chunk-4EDLYSNW.js";
4
4
  import {
5
5
  ArtelVersion,
6
6
  Cached,
@@ -14,7 +14,7 @@ import {
14
14
  __async,
15
15
  performanceMeasurementStageNames,
16
16
  performanceMeasurementStages
17
- } from "./chunk-PNUVVKWZ.js";
17
+ } from "./chunk-5SWGY25I.js";
18
18
 
19
19
  // source/executor/FileSystemUri.ts
20
20
  import { platform } from "os";
@@ -224,18 +224,20 @@ var NodeCompiler = class {
224
224
  return new PhysicalTypeScriptLibrariesProvider(standardLibraryUri);
225
225
  });
226
226
  }
227
- static loadCompilation(projectPath, tsLibrariesProvider, diagnostics, workspacePath, standardPackagesPath, cancellationToken) {
227
+ static loadCompilation(projectPath, tsLibrariesProvider, diagnostics, options, cancellationToken) {
228
228
  return __async(this, null, function* () {
229
229
  const projectUri = FileSystemUri.pathToUri(projectPath);
230
- const workspaceUri = workspacePath !== void 0 ? FileSystemUri.pathToUri(workspacePath) : void 0;
231
- const standardPackagesUri = standardPackagesPath !== void 0 ? FileSystemUri.pathToUri(standardPackagesPath) : void 0;
230
+ const loadCompilationOptions = {
231
+ workspaceUri: options?.workspacePath !== void 0 ? FileSystemUri.pathToUri(options.workspacePath) : void 0,
232
+ builtInsStandardPackagesUri: options?.builtInsStandardPackagesPath !== void 0 ? FileSystemUri.pathToUri(options.builtInsStandardPackagesPath) : void 0,
233
+ userStandardPackagesUri: options?.userStandardPackagesPath !== void 0 ? FileSystemUri.pathToUri(options.userStandardPackagesPath) : void 0
234
+ };
232
235
  return yield Compiler.loadCompilation(
233
236
  projectUri,
234
237
  this.fileSystem,
235
238
  tsLibrariesProvider,
236
239
  diagnostics,
237
- workspaceUri,
238
- standardPackagesUri,
240
+ loadCompilationOptions,
239
241
  cancellationToken
240
242
  );
241
243
  });
@@ -282,8 +284,7 @@ var NodeCompiler = class {
282
284
  task.projectPath,
283
285
  typeScriptLibrariesProvider,
284
286
  task.diagnostics,
285
- task.workspacePath,
286
- task.standardPackagesPath,
287
+ task.loadCompilationOptions,
287
288
  task.cancellationToken
288
289
  );
289
290
  if (compilation === void 0) {
@@ -386,9 +387,12 @@ var CommandLineCompiler = class {
386
387
  fileURLToPath(new URL("..", import.meta.url))
387
388
  ],
388
389
  projectPath: parsedArguments.projectPath,
390
+ loadCompilationOptions: {
391
+ workspacePath: parsedArguments.workspacePath,
392
+ userStandardPackagesPath: parsedArguments.standardPackagesPath,
393
+ builtInsStandardPackagesPath: parsedArguments.builtInStandardPackagesPath
394
+ },
389
395
  outputPath: parsedArguments.outputPath,
390
- workspacePath: parsedArguments.workspacePath,
391
- standardPackagesPath: parsedArguments.standardPackagesPath,
392
396
  diagnostics,
393
397
  defaultTsLibraryPath: parsedArguments.defaultTsLibraryPath,
394
398
  emitOptions: {
@@ -464,7 +468,8 @@ var ArgumentsParser = class {
464
468
  measurePerformance: false,
465
469
  defaultTsLibraryPath: void 0,
466
470
  workspacePath: void 0,
467
- standardPackagesPath: void 0
471
+ standardPackagesPath: void 0,
472
+ builtInStandardPackagesPath: void 0
468
473
  };
469
474
  const index = this.parseMainCommand(0, args, result);
470
475
  this.parseNamedArguments(index, args, result);
@@ -562,6 +567,15 @@ var ArgumentsParser = class {
562
567
  }
563
568
  break;
564
569
  }
570
+ case "--built-in-standard-packages":
571
+ case "--\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0435-\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u044B\u0435-\u043F\u0430\u043A\u0435\u0442\u044B": {
572
+ const path = this.tryParseStringArgument(index + 1, args);
573
+ if (path !== void 0) {
574
+ result.builtInStandardPackagesPath = resolve(cwd, path);
575
+ index++;
576
+ }
577
+ break;
578
+ }
565
579
  case "--\u0431\u0435\u0437-\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0439":
566
580
  case "--no-warnings": {
567
581
  result.noWarnings = true;
@@ -56,9 +56,10 @@ export declare class AnalyzedTranslationPackage {
56
56
  private createVariants;
57
57
  private createTranslatedSubprogramSignatureFromPackageMethodTranslation;
58
58
  private createTranslatedSubprogramSignatureFromTypeMethodTranslation;
59
- private createTranslatedSubprogramSignatureFromMethodTypeAlias;
60
- private createTranslatedSubprogramSignatureFromConstructorAlias;
61
- private createTranslatedSubprogramSignatureFromIndexerAlias;
59
+ private createTranslatedSubprogramSignatureFromMethodTypeTranslation;
60
+ private createTranslatedSubprogramSignatureFromConstructorTranslation;
61
+ private createTranslatedSubprogramSignatureFromIndexerTranslation;
62
+ private createTranslatedSubprogramSignatureForDefaultConstructor;
62
63
  private createTranslatedTypeSignature;
63
64
  private enumerateTranslationsDeclarations;
64
65
  private findTypeTranslation;
@@ -503,7 +503,6 @@ declare class DefaultConstructors {
503
503
  private readonly _defaultConstructorEntities;
504
504
  constructor(_analyzer: Analyzer);
505
505
  ofStructuredType(type: StructuredTypeDeclaration): readonly ConstructorEntity[];
506
- createAliasTypeDefaultConstructors(aliasTypeEntity: AliasTypeEntity, hasDeclaredConstructors: boolean): readonly ConstructorEntity[];
507
506
  private createDefaultConstructors;
508
507
  private getPublicInstanceStoredVariables;
509
508
  }
@@ -12,10 +12,26 @@ export declare class Resolver {
12
12
  }
13
13
  export type Meaning = Meaning_constructorCall | Meaning_unresolved;
14
14
  declare class Meaning_constructorCall {
15
+ /**
16
+ * Тип объекта, получаемого в результате вызова конструктора.
17
+ *
18
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
19
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
20
+ * с ним совместим.
21
+ */
22
+ readonly type: types.Type;
15
23
  readonly candidates: readonly FoundAnonymousDeclaration<types.Constructor>[];
16
24
  readonly suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[];
17
25
  readonly kind = "constructor-call";
18
- constructor(candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
26
+ constructor(
27
+ /**
28
+ * Тип объекта, получаемого в результате вызова конструктора.
29
+ *
30
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
31
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
32
+ * с ним совместим.
33
+ */
34
+ type: types.Type, candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
19
35
  }
20
36
  declare class Meaning_unresolved {
21
37
  readonly diagnostics: readonly Diagnostic[];
@@ -29,10 +29,26 @@ declare class Meaning_baseObjectAccess {
29
29
  constructor(type: types.Type);
30
30
  }
31
31
  declare class Meaning_baseConstructorAccess {
32
+ /**
33
+ * Тип объекта, получаемого в результате вызова конструктора.
34
+ *
35
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
36
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
37
+ * с ним совместим.
38
+ */
39
+ readonly type: types.Type;
32
40
  readonly candidates: readonly FoundAnonymousDeclaration<types.Constructor>[];
33
41
  readonly suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[];
34
42
  readonly kind = "base-constructor-access";
35
- constructor(candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
43
+ constructor(
44
+ /**
45
+ * Тип объекта, получаемого в результате вызова конструктора.
46
+ *
47
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
48
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
49
+ * с ним совместим.
50
+ */
51
+ type: types.Type, candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
36
52
  }
37
53
  declare class Meaning_overriddenMethodAccess {
38
54
  readonly method: types.Method;
@@ -26,10 +26,26 @@ declare class Meaning_objectMethodCall {
26
26
  constructor(type: types.MethodType);
27
27
  }
28
28
  declare class Meaning_constructorCall {
29
+ /**
30
+ * Тип объекта, получаемого в результате вызова конструктора.
31
+ *
32
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
33
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
34
+ * с ним совместим.
35
+ */
36
+ readonly type: types.Type;
29
37
  readonly candidates: readonly FoundAnonymousDeclaration<types.Constructor>[];
30
38
  readonly suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[];
31
39
  readonly kind = "constructor-call";
32
- constructor(candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
40
+ constructor(
41
+ /**
42
+ * Тип объекта, получаемого в результате вызова конструктора.
43
+ *
44
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
45
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
46
+ * с ним совместим.
47
+ */
48
+ type: types.Type, candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
33
49
  }
34
50
  declare class Meaning_unresolved {
35
51
  readonly diagnostics: readonly Diagnostic[];
@@ -32,11 +32,14 @@ export declare class DiagnosticCollector {
32
32
  private checkTypeVariableSetterDeclaration;
33
33
  private checkTypeIndexedGetterDeclaration;
34
34
  private checkTypeIndexedSetterDeclaration;
35
+ private checkTypeDereferencedVariableGetterDeclaration;
36
+ private checkTypeDereferencedVariableSetterDeclaration;
35
37
  private checkNestedMethodDeclaration;
36
38
  private checkPossibleGeneratorMethodReturnType;
37
39
  private checkReturnStatement;
38
40
  private checkYieldStatement;
39
41
  private checkTypeMemberBodyPresence;
42
+ private tryGetTypeMemberDeclarationEntity;
40
43
  private isAspectTypeMemberDeclaration;
41
44
  private collectIdentifierExpressionDiagnostics;
42
45
  private collectPropertyAccessExpressionDiagnostics;
@@ -20,10 +20,26 @@ export declare class Resolver {
20
20
  }
21
21
  export type Meaning = Meaning_ownConstructorAccess | Meaning_objectAccess | Meaning_unresolved;
22
22
  declare class Meaning_ownConstructorAccess {
23
+ /**
24
+ * Тип объекта, получаемого в результате вызова конструктора.
25
+ *
26
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
27
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
28
+ * с ним совместим.
29
+ */
30
+ readonly type: types.Type;
23
31
  readonly candidates: readonly FoundAnonymousDeclaration<types.Constructor>[];
24
32
  readonly suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[];
25
33
  readonly kind = "own-constructor-access";
26
- constructor(candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
34
+ constructor(
35
+ /**
36
+ * Тип объекта, получаемого в результате вызова конструктора.
37
+ *
38
+ * При поиске конструктора в типе-псевдониме конструктор может быть найден в оригинальном типе. В таком случае тип,
39
+ * создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
40
+ * с ним совместим.
41
+ */
42
+ type: types.Type, candidates: readonly FoundAnonymousDeclaration<types.Constructor>[], suitableConstructors: readonly FoundAnonymousDeclaration<types.Constructor>[]);
27
43
  }
28
44
  declare class Meaning_objectAccess {
29
45
  readonly type: types.Type;
@@ -30,5 +30,6 @@ export declare class WellKnownDeclarations {
30
30
  parameterArray: AliasTypeEntity;
31
31
  defaultImport: StructuredTypeEntity;
32
32
  realName: StructuredTypeEntity;
33
+ builtIntoPlatform: StructuredTypeEntity;
33
34
  typeVariableProxy: StructuredTypeEntity;
34
35
  }
@@ -14,7 +14,7 @@ export declare abstract class Query<T> implements Iterable<T> {
14
14
  toMap<K, V>(keySelector: (t: T) => K, valueSelector: (t: T) => V): Map<K, V>;
15
15
  flatMap<K>(fn: (t: T) => Iterable<K>): Query<K>;
16
16
  toArray(): T[];
17
- count(): number;
17
+ count(fn?: (t: T) => boolean): number;
18
18
  chain(other: Iterable<T>): Query<T>;
19
19
  filter<K extends T>(fn: (t: T) => t is K): Query<K>;
20
20
  filter(fn: (t: T) => boolean): Query<T>;
@@ -37,6 +37,7 @@ export declare abstract class Query<T> implements Iterable<T> {
37
37
  uniqueWithComparator(comparator: (t1: T, t2: T) => boolean): Query<T>;
38
38
  uniqueToSet(): Set<T>;
39
39
  maxByValue(valueSelector: (t: T) => number): T | undefined;
40
+ minByValue(valueSelector: (t: T) => number): T | undefined;
40
41
  single(): T | undefined;
41
42
  single<K extends T>(fn: (t: T) => t is K): K | undefined;
42
43
  single(fn: (t: T) => boolean): T | undefined;
@@ -1,3 +1,4 @@
1
+ import { Tag } from '../analysis/Tags.js';
1
2
  import * as types from '../types/index.js';
2
3
  import { DefinitionKind, EntityHidingLevel, EntityKind, TypeMemberEntityContainer } from './index.js';
3
4
  export interface BinaryOperatorEntity {
@@ -9,6 +10,7 @@ export interface BinaryOperatorEntity {
9
10
  getDefinition(): BinaryOperatorDefinition;
10
11
  getContainer(): TypeMemberEntityContainer;
11
12
  isHidden(): EntityHidingLevel | undefined;
13
+ getTags(): readonly Tag[];
12
14
  }
13
15
  export type BinaryOperatorDefinition = {
14
16
  kind: DefinitionKind.Intrinsic;
@@ -45,4 +47,5 @@ export declare class IntrinsicBinaryOperatorEntity implements BinaryOperatorEnti
45
47
  getDefinition(): BinaryOperatorDefinition;
46
48
  getContainer(): TypeMemberEntityContainer;
47
49
  isHidden(): EntityHidingLevel | undefined;
50
+ getTags(): readonly Tag[];
48
51
  }
@@ -3,7 +3,7 @@ import { Tag } from '../analysis/Tags.js';
3
3
  import { Analyzer } from '../analysis/index.js';
4
4
  import { TypeConstructorDeclaration } from '../tree/index.js';
5
5
  import * as types from '../types/index.js';
6
- import type { AliasTypeEntity, TypeEntityWithMembers } from './index.js';
6
+ import type { TypeEntityWithMembers } from './index.js';
7
7
  import { DefinitionKind, EntityHidingLevel, EntityKind, ParameterVariableEntity, TypeMemberEntityContainer, TypeVariableEntity } from './index.js';
8
8
  export interface ConstructorEntity {
9
9
  readonly kind: EntityKind.Constructor;
@@ -17,9 +17,20 @@ export interface ConstructorEntity {
17
17
  }
18
18
  export declare class DefaultConstructorEntityInfo {
19
19
  readonly baseConstructor: types.Constructor | undefined;
20
- readonly orderedParametersForBaseConstructor: readonly ParameterVariableEntity[];
20
+ readonly orderedParametersForBaseConstructor: readonly DefaultConstructorParameterForBaseConstructorInfo[];
21
21
  readonly hasParametersForFieldInitialization: boolean;
22
- constructor(baseConstructor: types.Constructor | undefined, orderedParametersForBaseConstructor: readonly ParameterVariableEntity[], hasParametersForFieldInitialization: boolean);
22
+ readonly parametersForOwnFieldsInitialization: readonly ConstructorParameterInitializingFieldInfo[] | undefined;
23
+ constructor(baseConstructor: types.Constructor | undefined, orderedParametersForBaseConstructor: readonly DefaultConstructorParameterForBaseConstructorInfo[], hasParametersForFieldInitialization: boolean, parametersForOwnFieldsInitialization: readonly ConstructorParameterInitializingFieldInfo[] | undefined);
24
+ }
25
+ export declare class DefaultConstructorParameterForBaseConstructorInfo {
26
+ readonly parameter: ParameterVariableEntity;
27
+ readonly baseConstructorParameter: ParameterVariableEntity;
28
+ constructor(parameter: ParameterVariableEntity, baseConstructorParameter: ParameterVariableEntity);
29
+ }
30
+ export declare class ConstructorParameterInitializingFieldInfo {
31
+ readonly parameter: ParameterVariableEntity;
32
+ readonly field: TypeVariableEntity;
33
+ constructor(parameter: ParameterVariableEntity, field: TypeVariableEntity);
23
34
  }
24
35
  export type ConstructorEntityDefinition = {
25
36
  kind: DefinitionKind.Source;
@@ -65,8 +76,7 @@ export declare class DefaultConstructorEntity implements ConstructorEntity {
65
76
  private readonly _variablesToInitialize;
66
77
  private readonly _baseConstructor;
67
78
  readonly kind = EntityKind.Constructor;
68
- private readonly _valueParameters;
69
- private readonly _orderedParametersForBaseConstructor;
79
+ private readonly _parametersInfo;
70
80
  constructor(_analyzer: Analyzer, _containingType: TypeEntityWithMembers, _variablesToInitialize: readonly VariableToInitialize[], _baseConstructor: FoundAnonymousDeclaration<types.Constructor> | undefined);
71
81
  getValueParameters(): readonly ParameterVariableEntity[];
72
82
  getDefinition(): ConstructorEntityDefinition;
@@ -75,25 +85,11 @@ export declare class DefaultConstructorEntity implements ConstructorEntity {
75
85
  isHidden(): EntityHidingLevel | undefined;
76
86
  isAbstract(): boolean;
77
87
  getTags(): readonly Tag[];
78
- private getOrderedParametersForBaseConstructor;
88
+ private getParametersInfo;
89
+ private createOrderedParametersForBaseConstructor;
79
90
  }
80
91
  export declare class VariableToInitialize {
81
92
  readonly entity: TypeVariableEntity;
82
93
  readonly hasInitializer: boolean;
83
94
  constructor(entity: TypeVariableEntity, hasInitializer: boolean);
84
95
  }
85
- export declare class SynthesizedAliasTypeConstructor implements ConstructorEntity {
86
- private readonly _analyzer;
87
- private readonly _originalConstructor;
88
- private readonly _aliasTypeEntity;
89
- readonly kind = EntityKind.Constructor;
90
- private readonly _valueParameters;
91
- constructor(_analyzer: Analyzer, _originalConstructor: types.Constructor, _aliasTypeEntity: AliasTypeEntity);
92
- getValueParameters(): readonly ParameterVariableEntity[];
93
- getDefinition(): ConstructorEntityDefinition;
94
- getContainer(): TypeMemberEntityContainer;
95
- isDefault(): DefaultConstructorEntityInfo | undefined;
96
- isHidden(): EntityHidingLevel | undefined;
97
- isAbstract(): boolean;
98
- getTags(): readonly Tag[];
99
- }
@@ -1,3 +1,4 @@
1
+ import { Tag } from '../analysis/Tags.js';
1
2
  import * as types from '../types/index.js';
2
3
  import { DefinitionKind, EntityHidingLevel, EntityKind, TypeMemberEntityContainer } from './index.js';
3
4
  export interface UnaryOperatorEntity {
@@ -8,6 +9,7 @@ export interface UnaryOperatorEntity {
8
9
  getDefinition(): UnaryOperatorDefinition;
9
10
  getContainer(): TypeMemberEntityContainer;
10
11
  isHidden(): EntityHidingLevel | undefined;
12
+ getTags(): readonly Tag[];
11
13
  }
12
14
  export type UnaryOperatorDefinition = {
13
15
  kind: DefinitionKind.Intrinsic;
@@ -30,4 +32,5 @@ export declare class IntrinsicUnaryOperatorEntity implements UnaryOperatorEntity
30
32
  getDefinition(): UnaryOperatorDefinition;
31
33
  getContainer(): TypeMemberEntityContainer;
32
34
  isHidden(): EntityHidingLevel | undefined;
35
+ getTags(): readonly Tag[];
33
36
  }
@@ -78,7 +78,7 @@ export declare function isNamedTypeEntity(entity: TypeEntity): entity is NamedTy
78
78
  export type PackageMemberEntity = PackageVariableEntity | PackageMethodEntity | PackageTypeEntity | TypeExtensionEntity;
79
79
  export declare function isPackageMemberEntity(entity: Entity): entity is PackageMemberEntity;
80
80
  export type NamedPackageMemberEntity = PackageVariableEntity | PackageMethodEntity | PackageTypeEntity;
81
- export type EntityWithTags = AliasTypeEntity | ConstructorEntity | DestructorEntity | IndexerEntity | DereferenceOperatorEntity | MethodEntity | MethodTypeEntity | StructuredTypeEntity | VariableEntity | VariantEntity | VariantTypeEntity;
81
+ export type EntityWithTags = AliasTypeEntity | ConstructorEntity | DestructorEntity | IndexerEntity | DereferenceOperatorEntity | MethodEntity | MethodTypeEntity | StructuredTypeEntity | VariableEntity | VariantEntity | VariantTypeEntity | GetterEntity | SetterEntity;
82
82
  export declare function isEntityWithTags(entity: Entity): entity is EntityWithTags;
83
83
  export type TypeMemberEntity = TypeVariableEntity | TypeMethodEntity | ConstructorEntity | DestructorEntity | IndexerEntity | DereferenceOperatorEntity | UnaryOperatorEntity | BinaryOperatorEntity;
84
84
  export declare function isTypeMemberEntity(entity: Entity): entity is TypeMemberEntity;
@@ -7,9 +7,14 @@ import { SourcesProvider } from '../project/CompilationLoader.js';
7
7
  import { TypeScriptLibrariesProvider } from '../ts-interop/TsLibrariesProvider.js';
8
8
  export type LaunchUri = Uri;
9
9
  export declare class Compiler {
10
- static loadCompilation(projectUri: Uri, sourcesProvider: SourcesProvider, tsLibrariesProvider: TypeScriptLibrariesProvider, diagnostics: DiagnosticAcceptor | undefined, workspaceUri?: Uri, standardPackagesUri?: Uri, cancellationToken?: CancellationToken): Promise<Compilation | undefined>;
10
+ static loadCompilation(projectUri: Uri, sourcesProvider: SourcesProvider, tsLibrariesProvider: TypeScriptLibrariesProvider, diagnostics: DiagnosticAcceptor | undefined, options?: LoadCompilationOptions, cancellationToken?: CancellationToken): Promise<Compilation | undefined>;
11
11
  static createAnalyzer(compilation: Compilation, tsLibrariesProvider: TypeScriptLibrariesProvider, diagnostics: DiagnosticAcceptor | undefined, _cancellationToken?: CancellationToken): Promise<Analyzer | undefined>;
12
12
  static analyze(analyzer: Analyzer, diagnostics: DiagnosticAcceptor | undefined, cancellationToken?: CancellationToken): Promise<boolean>;
13
13
  static emit(analyzer: Analyzer, outputUri: Uri, outputAcceptor: OutputAcceptor, _diagnostics: DiagnosticAcceptor | undefined, emitOptions?: EmitOptions, cancellationToken?: CancellationToken): Promise<LaunchUri | undefined>;
14
14
  static emitToString(analyzer: Analyzer, _diagnostics: DiagnosticAcceptor | undefined, emitOptions?: EmitOptions, cancellationToken?: CancellationToken): Promise<string>;
15
15
  }
16
+ export interface LoadCompilationOptions {
17
+ workspaceUri?: Uri;
18
+ builtInsStandardPackagesUri?: Uri;
19
+ userStandardPackagesUri?: Uri;
20
+ }
@@ -10,19 +10,23 @@ export declare class NodeCompiler {
10
10
  private static get fileSystem();
11
11
  static findStandardTypeScriptLibrary(nodeModulesSearchPaths: readonly string[], defaultTsLibraryPath?: string): Promise<Uri | undefined>;
12
12
  static createTypeScriptLibrariesProvider(nodeModulesSearchPaths: readonly string[], defaultTsLibraryPath: string | undefined, diagnostics: DiagnosticAcceptor | undefined): Promise<TypeScriptLibrariesProvider | undefined>;
13
- static loadCompilation(projectPath: string, tsLibrariesProvider: TypeScriptLibrariesProvider, diagnostics: DiagnosticAcceptor | undefined, workspacePath?: string, standardPackagesPath?: string, cancellationToken?: CancellationToken): Promise<Compilation | undefined>;
13
+ static loadCompilation(projectPath: string, tsLibrariesProvider: TypeScriptLibrariesProvider, diagnostics: DiagnosticAcceptor | undefined, options?: NodeCompilerLoadCompilationOptions, cancellationToken?: CancellationToken): Promise<Compilation | undefined>;
14
14
  static createAnalyzer(compilation: Compilation, tsLibrariesProvider: TypeScriptLibrariesProvider, diagnostics: DiagnosticAcceptor | undefined, cancellationToken?: CancellationToken): Promise<Analyzer | undefined>;
15
15
  static analyze(analyzer: Analyzer, diagnostics: DiagnosticAcceptor | undefined, cancellationToken?: CancellationToken): Promise<boolean>;
16
16
  static emit(analyzer: Analyzer, outputPath: string, diagnostics: DiagnosticAcceptor | undefined, emitOptions?: EmitOptions, cancellationToken?: CancellationToken): Promise<LaunchPath | undefined>;
17
17
  static compile(task: NodeCompilerTask): Promise<LaunchPath | undefined>;
18
18
  }
19
+ export interface NodeCompilerLoadCompilationOptions {
20
+ workspacePath?: string;
21
+ builtInsStandardPackagesPath?: string;
22
+ userStandardPackagesPath?: string;
23
+ }
19
24
  export interface NodeCompilerTask {
20
25
  nodeModulesWithTypeScriptSearchPaths: readonly string[];
21
26
  projectPath: string;
22
27
  outputPath: string;
23
- workspacePath?: string;
24
- standardPackagesPath?: string;
25
28
  diagnostics: DiagnosticAcceptor | undefined;
29
+ loadCompilationOptions?: NodeCompilerLoadCompilationOptions;
26
30
  defaultTsLibraryPath?: string;
27
31
  emitOptions?: EmitOptions;
28
32
  cancellationToken?: CancellationToken;
@@ -1,5 +1,6 @@
1
1
  import * as ls from 'vscode-languageserver';
2
2
  import { CancellationToken, Uri } from '../common/index.js';
3
+ import { PackageContent } from '../project/PackageContent.js';
3
4
  import { TypeScriptLibrariesProvider } from '../ts-interop/TsLibrariesProvider.js';
4
5
  import { WorkspaceFileSystem } from './workspace/index.js';
5
6
  export declare class LanguageServer {
@@ -102,6 +103,7 @@ export interface LanguageServerConfig {
102
103
  readonly connection: ls.Connection;
103
104
  readonly fileSystemSynchronizationMode: FileSystemSynchronizationMode;
104
105
  readonly tsLibrariesProvider: TypeScriptLibrariesProvider;
106
+ readonly additionalPackageContents?: PackageContent[];
105
107
  }
106
108
  export type FileSystemSynchronizationMode = FileSystemSynchronizationMode.ClientSideFSWatcher | FileSystemSynchronizationMode.ClientToServerRequests;
107
109
  export declare namespace FileSystemSynchronizationMode {
@@ -60,4 +60,5 @@ export interface WorkspaceConfig {
60
60
  readonly standardPackagesUri?: Uri;
61
61
  readonly showErrorMessage?: (message: string) => Promise<void>;
62
62
  readonly builtInStandardPackagesUri?: Uri;
63
+ readonly additionalPackageContents?: readonly PackageContent[];
63
64
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@artel/artc",
3
- "version": "0.6.25208",
3
+ "version": "0.6.25209",
4
4
  "description": "Артель Компилятор | Artel Compiler",
5
5
  "author": "Nezaboodka Team <contact@nezaboodka.com>",
6
- "license": "Apache License 2.0",
6
+ "license": "LGPL-3.0-or-later",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "build/**/*.*js",
@@ -67,6 +67,7 @@
67
67
  "copy-global-storage": "node ../vscode-extension/scripts/copy-global-storage.js projects/compiler/СистемныеПакеты",
68
68
  "install-global": "npm run prepare-for-publish && npm i -g .",
69
69
  "generate-tree": "npm run bundle:debug && node build/Cli.js build ../tree-generator/ ../tree-generator/build --workspace ../.. --standard-packages ../СтандартныеПакеты && node ../tree-generator/build/launch.mjs ../compiler/source/tree",
70
- "generate-configuration-json-schemas": "node ./scripts/generateConfigurationJsonSchemas.mjs"
70
+ "generate-configuration-json-schemas": "node ./scripts/generateConfigurationJsonSchemas.mjs",
71
+ "create-minimal-required-standard-package-contents-json": "esbuild ./scripts/createMinimalStandardPackageContentsJson.ts --bundle --outfile=../../build/scripts/createMinimalStandardPackageContentsJson.mjs --format=esm --platform=node --packages=external --supported:async-await=false && node ../../build/scripts/createMinimalStandardPackageContentsJson.mjs"
71
72
  }
72
73
  }