firefly-compiler 0.4.60 → 0.4.62

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/bin/Release.ff CHANGED
@@ -22,13 +22,13 @@ release(
22
22
  }
23
23
  requireNpmLoggedIn(system, system.path(".."))
24
24
  requireVsceLoggedIn(system, system.path("../vscode"))
25
- runSuccessful(system, "node", ".exe", ["output/js/ff/compiler/Main.mjs", "bootstrap"], system.path(".."))
26
- runSuccessful(system, "node", ".exe", ["output/js/ff/compiler/Main.mjs", "bootstrap"], system.path(".."))
27
- runSuccessful(system, "node", ".exe", ["output/js/ff/compiler/Main.mjs", "bootstrap"], system.path(".."))
25
+ runSuccessful(system, "node", ["output/js/ff/compiler/Main.mjs", "bootstrap"], system.path(".."))
26
+ runSuccessful(system, "node", ["output/js/ff/compiler/Main.mjs", "bootstrap"], system.path(".."))
27
+ runSuccessful(system, "node", ["output/js/ff/compiler/Main.mjs", "bootstrap"], system.path(".."))
28
28
  let version = bumpMinorVersion(system, system.path("../package.json"))
29
29
  bumpMinorVersion(system, system.path("../vscode/package.json"))
30
- runSuccessful(system, "npm", ".cmd", ["publish"], system.path(".."))
31
- runSuccessful(system, "vsce", ".cmd", ["publish"], system.path("../vscode"))
30
+ runSuccessful(system, "npm", ["publish"], system.path(".."))
31
+ runSuccessful(system, "vsce", ["publish"], system.path("../vscode"))
32
32
  releaseFireflyPackage(system, accessKeyId, secretAccessKey, "compiler")
33
33
  releaseFireflyPackage(system, accessKeyId, secretAccessKey, "core")
34
34
  releaseFireflyPackage(system, accessKeyId, secretAccessKey, "lux")
@@ -37,8 +37,8 @@ release(
37
37
  releaseFireflyPackage(system, accessKeyId, secretAccessKey, "s3")
38
38
  releaseFireflyPackage(system, accessKeyId, secretAccessKey, "unsafejs")
39
39
  releaseFireflyPackage(system, accessKeyId, secretAccessKey, "webserver")
40
- runSuccessful(system, "git", ".exe", ["commit", "-a", "-m", "Autorelease " + version], system.path(".."))
41
- runSuccessful(system, "git", ".exe", ["push"], system.path(".."))
40
+ runSuccessful(system, "git", ["commit", "-a", "-m", "Autorelease " + version], system.path(".."))
41
+ runSuccessful(system, "git", ["push"], system.path(".."))
42
42
  }
43
43
 
44
44
  releaseFireflyPackage(
@@ -71,7 +71,7 @@ releaseFireflyPackage(
71
71
  }
72
72
 
73
73
  requireNpmLoggedIn(system: NodeSystem, workingDirectory: Path) {
74
- let out = run(system, "npm", ".cmd", ["whoami"], workingDirectory)
74
+ let out = run(system, "npm", ["whoami"], workingDirectory)
75
75
  if(out.exitCode != 0) {
76
76
  system.writeErrorLine("")
77
77
  system.writeErrorLine("You are not logged into npm")
@@ -81,7 +81,7 @@ requireNpmLoggedIn(system: NodeSystem, workingDirectory: Path) {
81
81
  }
82
82
 
83
83
  requireVsceLoggedIn(system: NodeSystem, workingDirectory: Path) {
84
- let out = runSuccessful(system, "vsce", ".cmd", ["ls-publishers"], workingDirectory)
84
+ let out = runSuccessful(system, "vsce", ["ls-publishers"], workingDirectory)
85
85
  if(!out.toString().lines().any {_ == "firefly-team"}) {
86
86
  system.writeErrorLine("")
87
87
  system.writeErrorLine("You are not logged into vsce")
@@ -92,14 +92,14 @@ requireVsceLoggedIn(system: NodeSystem, workingDirectory: Path) {
92
92
  }
93
93
  }
94
94
 
95
- run(system: NodeSystem, command: String, windowsExtension: String, arguments: List[String], workingDirectory: Path): ProcessResult {
95
+ run(system: NodeSystem, command: String, arguments: List[String], workingDirectory: Path): ProcessResult {
96
96
  system.writeLine("")
97
97
  system.writeLine(command + " " + arguments.join(" "))
98
- system.execute(command, arguments, workingDirectory = Some(workingDirectory), windowsExtension = windowsExtension)
98
+ system.execute(command, arguments, workingDirectory = Some(workingDirectory))
99
99
  }
100
100
 
101
- runSuccessful(system: NodeSystem, command: String, windowsExtension: String, arguments: List[String], workingDirectory: Path): Buffer {
102
- let out = run(system, command, windowsExtension, arguments, workingDirectory)
101
+ runSuccessful(system: NodeSystem, command: String, arguments: List[String], workingDirectory: Path): Buffer {
102
+ let out = run(system, command, arguments, workingDirectory)
103
103
  if(out.exitCode != 0) {
104
104
  system.writeBuffer(out.standardOut)
105
105
  system.writeErrorBuffer(out.standardError)
@@ -106,7 +106,7 @@ extend self: NodeSystem {
106
106
  environment: Option[Map[String, String]] = None
107
107
  maxBuffer: Int = 16777216
108
108
  killSignal: Int = 9
109
- windowsExtension: String = ""
109
+ windowsWhich: Bool = True
110
110
  ): ProcessResult
111
111
  target node async """
112
112
  import * as childProcess from 'node:child_process';
@@ -118,7 +118,11 @@ extend self: NodeSystem {
118
118
  ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String
119
119
  );
120
120
  }
121
- if(process.platform === 'win32') command_ += windowsExtension_;
121
+ if(windowsWhich_ && process.platform === 'win32') {
122
+ command_ =
123
+ (await internalWhich_$(self_, command_, workingDirectory_, environment_, $task)).value_ ||
124
+ command_;
125
+ }
122
126
  const newProcess = childProcess.spawn(command_, arguments_, {
123
127
  cwd: workingDirectory_.value_,
124
128
  windowsHide: true,
@@ -196,3 +200,37 @@ internalFindCommand(out: String): String {
196
200
  l.endsWith(".exe") || l.endsWith(".cmd") || l.endsWith(".bat") || l.endsWith(".com")
197
201
  }.else {""}
198
202
  }
203
+
204
+ internalIsWindows(): Bool
205
+ target node sync """
206
+ return process.platform === 'win32';
207
+ """
208
+
209
+ internalWhich(
210
+ system: NodeSystem
211
+ command: String
212
+ workingDirectory: Option[Path] = None
213
+ environment: Option[Map[String, String]] = None
214
+ ): Option[String] {
215
+ let out = if(internalIsWindows()) {
216
+ system.execute(
217
+ "cmd.exe",
218
+ ["/c", "where", command],
219
+ workingDirectory = workingDirectory
220
+ environment = environment
221
+ windowsWhich = False
222
+ )
223
+ } else {
224
+ system.execute(
225
+ "which",
226
+ [command],
227
+ workingDirectory = workingDirectory
228
+ environment = environment
229
+ windowsWhich = False
230
+ )
231
+ }
232
+ out.standardOut.toString().lines().filter {line =>
233
+ out.exitCode == 0 &&
234
+ (!internalIsWindows() || line.split('\\').last().any {_.contains(".")})
235
+ }.first()
236
+ }
@@ -136,6 +136,23 @@ return ""
136
136
  }))
137
137
  }
138
138
 
139
+ export function internalIsWindows_() {
140
+
141
+ return process.platform === 'win32';
142
+
143
+ }
144
+
145
+ export function internalWhich_(system_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None()) {
146
+ const out_ = (ff_core_NodeSystem.internalIsWindows_()
147
+ ? ff_core_NodeSystem.NodeSystem_execute(system_, "cmd.exe", ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false)
148
+ : ff_core_NodeSystem.NodeSystem_execute(system_, "which", [command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false));
149
+ return ff_core_List.List_first(ff_core_List.List_filter(ff_core_String.String_lines(ff_core_Buffer.Buffer_toString(out_.standardOut_, "utf8")), ((line_) => {
150
+ return ((out_.exitCode_ === 0) && ((!ff_core_NodeSystem.internalIsWindows_()) || ff_core_Option.Option_any(ff_core_List.List_last(ff_core_String.String_split(line_, 92)), ((_w1) => {
151
+ return ff_core_String.String_contains(_w1, ".")
152
+ }))))
153
+ })))
154
+ }
155
+
139
156
  export async function internalAssets_$(system_, $task) {
140
157
  return system_.assets_
141
158
  }
@@ -166,6 +183,21 @@ return ""
166
183
  }))
167
184
  }
168
185
 
186
+ export async function internalIsWindows_$($task) {
187
+ throw new Error('Function internalIsWindows is missing on this target in async context.');
188
+ }
189
+
190
+ export async function internalWhich_$(system_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), $task) {
191
+ const out_ = (ff_core_NodeSystem.internalIsWindows_()
192
+ ? (await ff_core_NodeSystem.NodeSystem_execute$(system_, "cmd.exe", ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false, $task))
193
+ : (await ff_core_NodeSystem.NodeSystem_execute$(system_, "which", [command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false, $task)));
194
+ return ff_core_List.List_first(ff_core_List.List_filter(ff_core_String.String_lines(ff_core_Buffer.Buffer_toString(out_.standardOut_, "utf8")), ((line_) => {
195
+ return ((out_.exitCode_ === 0) && ((!ff_core_NodeSystem.internalIsWindows_()) || ff_core_Option.Option_any(ff_core_List.List_last(ff_core_String.String_split(line_, 92)), ((_w1) => {
196
+ return ff_core_String.String_contains(_w1, ".")
197
+ }))))
198
+ })))
199
+ }
200
+
169
201
  export function NodeSystem_arguments(self_) {
170
202
  throw new Error('Function NodeSystem_arguments is missing on this target in sync context.');
171
203
  }
@@ -262,7 +294,7 @@ export function NodeSystem_environment(self_) {
262
294
  throw new Error('Function NodeSystem_environment is missing on this target in sync context.');
263
295
  }
264
296
 
265
- export function NodeSystem_execute(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsExtension_ = "") {
297
+ export function NodeSystem_execute(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsWhich_ = true) {
266
298
  throw new Error('Function NodeSystem_execute is missing on this target in sync context.');
267
299
  }
268
300
 
@@ -376,7 +408,7 @@ export async function NodeSystem_environment$(self_, $task) {
376
408
 
377
409
  }
378
410
 
379
- export async function NodeSystem_execute$(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsExtension_ = "", $task) {
411
+ export async function NodeSystem_execute$(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsWhich_ = true, $task) {
380
412
 
381
413
  const childProcess = import$3;
382
414
  const environment = environment_.value_ !== void 0 ? {} : process.env;
@@ -387,7 +419,11 @@ export async function NodeSystem_execute$(self_, command_, arguments_, standardI
387
419
  ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String
388
420
  );
389
421
  }
390
- if(process.platform === 'win32') command_ += windowsExtension_;
422
+ if(windowsWhich_ && process.platform === 'win32') {
423
+ command_ =
424
+ (await internalWhich_$(self_, command_, workingDirectory_, environment_, $task)).value_ ||
425
+ command_;
426
+ }
391
427
  const newProcess = childProcess.spawn(command_, arguments_, {
392
428
  cwd: workingDirectory_.value_,
393
429
  windowsHide: true,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly compiler",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.4.60",
7
+ "version": "0.4.62",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly language support",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.4.60",
7
+ "version": "0.4.62",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"