1 | import * as path from 'path';
|
2 | import ts from 'typescript';
|
3 | import { LinkedContracts } from './compile/types';
|
4 | import { compileContract as compileContractBase, CompileContractResult } from './compileContract';
|
5 | import { getSemanticDiagnostics as getSemanticDiagnosticsBase } from './getSemanticDiagnostics';
|
6 | import { throwOnDiagnosticErrorOrWarning } from './utils';
|
7 |
|
8 | export const getSemanticDiagnostics = (
|
9 | filePath: string,
|
10 | languageService: ts.LanguageService,
|
11 | smartContractDir: string = path.dirname(require.resolve('@neo-one/smart-contract')),
|
12 | ): ReadonlyArray<ts.Diagnostic> => getSemanticDiagnosticsBase({ filePath, languageService, smartContractDir });
|
13 |
|
14 | export const compileContract = (
|
15 | filePath: string,
|
16 | contractName: string,
|
17 | linked: LinkedContracts = {},
|
18 | ignoreWarnings = false,
|
19 | ): CompileContractResult => {
|
20 | const result = compileContractBase({ filePath, name: contractName, linked });
|
21 |
|
22 | throwOnDiagnosticErrorOrWarning(result.diagnostics, ignoreWarnings);
|
23 |
|
24 | return result;
|
25 | };
|
26 |
|
27 | export { CompileContractResult, LinkedContracts };
|
28 | export { scan, Contracts } from './scan';
|