-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathconstants.ts
61 lines (51 loc) · 2.17 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import * as path from "path";
import { ModuleFormat } from "./buildSchema";
export let platformDir =
process.arch == "arm64" ? process.platform + process.arch : process.platform;
// See https://microsoft.github.io/language-server-protocol/specification Abstract Message
// version is fixed to 2.0
export let jsonrpcVersion = "2.0";
export let platformPath = path.join("rescript", platformDir);
export let nodeModulesPlatformPath = path.join("node_modules", platformPath);
export let bscExeName = "bsc.exe";
export let editorAnalysisName = "rescript-editor-analysis.exe";
export let bscNativeReScriptPartialPath = path.join(
nodeModulesPlatformPath,
bscExeName
);
export let builtinAnalysisDevPath = path.join(
path.dirname(__dirname),
"..",
editorAnalysisName
);
export let builtinAnalysisProdPath = path.join(
path.dirname(__dirname),
"analysis_binaries",
platformDir,
editorAnalysisName
);
export let rescriptBinName = "rescript";
export let bscBinName = "bsc";
export let nodeModulesBinDir = path.join("node_modules", ".bin");
// can't use the native bsb/rescript since we might need the watcher -w flag, which is only in the JS wrapper
export let rescriptNodePartialPath = path.join(
nodeModulesBinDir,
rescriptBinName
);
export let bsbLock = ".bsb.lock";
export let bsconfigPartialPath = "bsconfig.json";
export let rescriptJsonPartialPath = "rescript.json";
export let compilerDirPartialPath = path.join("lib", "bs");
export let compilerOcamlDirPartialPath = path.join("lib", "ocaml");
export let compilerLogPartialPath = path.join("lib", "bs", ".compiler.log");
export let buildNinjaPartialPath = path.join("lib", "bs", "build.ninja");
export let rewatchLockPartialPath = path.join("lib", "rewatch.lock");
export let resExt = ".res";
export let resiExt = ".resi";
export let cmiExt = ".cmi";
export let startBuildAction = "Start Build";
// bsconfig defaults according configuration schema (https://rescript-lang.org/docs/manual/latest/build-configuration-schema)
export let bsconfigModuleDefault = ModuleFormat.Commonjs;
export let bsconfigSuffixDefault = ".js";
export let configurationRequestId = "rescript_configuration_request";
export let pullConfigurationInterval = 10_000;