firefly-compiler 0.4.58 → 0.4.60

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", ["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(".."))
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(".."))
28
28
  let version = bumpMinorVersion(system, system.path("../package.json"))
29
29
  bumpMinorVersion(system, system.path("../vscode/package.json"))
30
- runSuccessful(system, "npm", ["publish"], system.path(".."))
31
- runSuccessful(system, "vsce", ["publish"], system.path("../vscode"))
30
+ runSuccessful(system, "npm", ".cmd", ["publish"], system.path(".."))
31
+ runSuccessful(system, "vsce", ".cmd", ["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", ["commit", "-a", "-m", "Autorelease " + version], system.path(".."))
41
- runSuccessful(system, "git", ["push"], system.path(".."))
40
+ runSuccessful(system, "git", ".exe", ["commit", "-a", "-m", "Autorelease " + version], system.path(".."))
41
+ runSuccessful(system, "git", ".exe", ["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", ["whoami"], workingDirectory)
74
+ let out = run(system, "npm", ".cmd", ["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", ["ls-publishers"], workingDirectory)
84
+ let out = runSuccessful(system, "vsce", ".cmd", ["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, arguments: List[String], workingDirectory: Path): ProcessResult {
95
+ run(system: NodeSystem, command: String, windowsExtension: 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))
98
+ system.execute(command, arguments, workingDirectory = Some(workingDirectory), windowsExtension = windowsExtension)
99
99
  }
100
100
 
101
- runSuccessful(system: NodeSystem, command: String, arguments: List[String], workingDirectory: Path): Buffer {
102
- let out = run(system, command, arguments, workingDirectory)
101
+ runSuccessful(system: NodeSystem, command: String, windowsExtension: String, arguments: List[String], workingDirectory: Path): Buffer {
102
+ let out = run(system, command, windowsExtension, arguments, workingDirectory)
103
103
  if(out.exitCode != 0) {
104
104
  system.writeBuffer(out.standardOut)
105
105
  system.writeErrorBuffer(out.standardError)
@@ -106,6 +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
110
  ): ProcessResult
110
111
  target node async """
111
112
  import * as childProcess from 'node:child_process';
@@ -117,12 +118,7 @@ extend self: NodeSystem {
117
118
  ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String
118
119
  );
119
120
  }
120
- if(process.platform === 'win32') {
121
- arguments_ = ['/C', ...[command_, ...arguments_].map(argument =>
122
- argument.replaceAll(/([^A-Za-z0-9/_-])/g, "^$1")
123
- )];
124
- command_ = process.env.ComSpec || 'cmd.exe';
125
- }
121
+ if(process.platform === 'win32') command_ += windowsExtension_;
126
122
  const newProcess = childProcess.spawn(command_, arguments_, {
127
123
  cwd: workingDirectory_.value_,
128
124
  windowsHide: true,
@@ -193,3 +189,10 @@ internalProcessError(problem: String): Error {
193
189
  error
194
190
  } grab()
195
191
  }
192
+
193
+ internalFindCommand(out: String): String {
194
+ out.lines().find {line =>
195
+ let l = line.lower()
196
+ l.endsWith(".exe") || l.endsWith(".cmd") || l.endsWith(".bat") || l.endsWith(".com")
197
+ }.else {""}
198
+ }
@@ -127,6 +127,15 @@ return error_
127
127
  })))
128
128
  }
129
129
 
130
+ export function internalFindCommand_(out_) {
131
+ return ff_core_Option.Option_else(ff_core_List.List_find(ff_core_String.String_lines(out_), ((line_) => {
132
+ const l_ = ff_core_String.String_lower(line_);
133
+ return (((ff_core_String.String_endsWith(l_, ".exe") || ff_core_String.String_endsWith(l_, ".cmd")) || ff_core_String.String_endsWith(l_, ".bat")) || ff_core_String.String_endsWith(l_, ".com"))
134
+ })), (() => {
135
+ return ""
136
+ }))
137
+ }
138
+
130
139
  export async function internalAssets_$(system_, $task) {
131
140
  return system_.assets_
132
141
  }
@@ -148,6 +157,15 @@ return error_
148
157
  })))
149
158
  }
150
159
 
160
+ export async function internalFindCommand_$(out_, $task) {
161
+ return ff_core_Option.Option_else(ff_core_List.List_find(ff_core_String.String_lines(out_), ((line_) => {
162
+ const l_ = ff_core_String.String_lower(line_);
163
+ return (((ff_core_String.String_endsWith(l_, ".exe") || ff_core_String.String_endsWith(l_, ".cmd")) || ff_core_String.String_endsWith(l_, ".bat")) || ff_core_String.String_endsWith(l_, ".com"))
164
+ })), (() => {
165
+ return ""
166
+ }))
167
+ }
168
+
151
169
  export function NodeSystem_arguments(self_) {
152
170
  throw new Error('Function NodeSystem_arguments is missing on this target in sync context.');
153
171
  }
@@ -244,7 +262,7 @@ export function NodeSystem_environment(self_) {
244
262
  throw new Error('Function NodeSystem_environment is missing on this target in sync context.');
245
263
  }
246
264
 
247
- 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) {
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_ = "") {
248
266
  throw new Error('Function NodeSystem_execute is missing on this target in sync context.');
249
267
  }
250
268
 
@@ -358,7 +376,7 @@ export async function NodeSystem_environment$(self_, $task) {
358
376
 
359
377
  }
360
378
 
361
- 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, $task) {
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) {
362
380
 
363
381
  const childProcess = import$3;
364
382
  const environment = environment_.value_ !== void 0 ? {} : process.env;
@@ -369,12 +387,7 @@ export async function NodeSystem_execute$(self_, command_, arguments_, standardI
369
387
  ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String
370
388
  );
371
389
  }
372
- if(process.platform === 'win32') {
373
- arguments_ = ['/C', ...[command_, ...arguments_].map(argument =>
374
- argument.replaceAll(/([^A-Za-z0-9/_-])/g, "^$1")
375
- )];
376
- command_ = process.env.ComSpec || 'cmd.exe';
377
- }
390
+ if(process.platform === 'win32') command_ += windowsExtension_;
378
391
  const newProcess = childProcess.spawn(command_, arguments_, {
379
392
  cwd: workingDirectory_.value_,
380
393
  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.58",
7
+ "version": "0.4.60",
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.58",
7
+ "version": "0.4.60",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"