eolang 0.10.0 → 0.10.1

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/mvnw/pom.xml CHANGED
@@ -34,12 +34,12 @@ SOFTWARE.
34
34
  <dependency>
35
35
  <groupId>org.junit.jupiter</groupId>
36
36
  <artifactId>junit-jupiter-api</artifactId>
37
- <version>5.9.1</version>
37
+ <version>5.9.2</version>
38
38
  </dependency>
39
39
  <dependency>
40
40
  <groupId>org.junit.jupiter</groupId>
41
41
  <artifactId>junit-jupiter-engine</artifactId>
42
- <version>5.9.1</version>
42
+ <version>5.9.2</version>
43
43
  </dependency>
44
44
  </dependencies>
45
45
  <build>
@@ -63,7 +63,7 @@ SOFTWARE.
63
63
  </plugin>
64
64
  <plugin>
65
65
  <artifactId>maven-compiler-plugin</artifactId>
66
- <version>3.8.1</version>
66
+ <version>3.10.1</version>
67
67
  <configuration>
68
68
  <source>1.8</source>
69
69
  <target>1.8</target>
@@ -82,7 +82,7 @@ SOFTWARE.
82
82
  </plugin>
83
83
  <plugin>
84
84
  <artifactId>maven-surefire-plugin</artifactId>
85
- <version>3.0.0-M7</version>
85
+ <version>3.0.0-M8</version>
86
86
  <configuration>
87
87
  <failIfNoTests>true</failIfNoTests>
88
88
  </configuration>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eolang",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "author": "Yegor Bugayenko <yegor256@gmail.com> (https://www.yegor256.com/)",
5
5
  "license": "MIT",
6
6
  "repository": "objectionary/eoc",
@@ -22,18 +22,18 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "colors": "1.4.0",
25
- "commander": "9.4.1",
26
- "fast-xml-parser": "4.0.12",
25
+ "commander": "10.0.0",
26
+ "fast-xml-parser": "4.0.13",
27
27
  "xmlhttprequest": "1.8.0"
28
28
  },
29
29
  "devDependencies": {
30
- "eslint": "8.30.0",
30
+ "eslint": "8.32.0",
31
31
  "eslint-config-google": "0.14.0",
32
32
  "grunt": "1.5.3",
33
33
  "grunt-contrib-clean": "2.0.1",
34
34
  "grunt-eslint": "24.0.1",
35
35
  "grunt-mocha-cli": "7.0.0",
36
- "mocha": "^10.1.0"
36
+ "mocha": "^10.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "test": "mocha --timeout 120000"
@@ -43,7 +43,7 @@ module.exports = function(opts) {
43
43
  `-Deo.placed=${path.resolve(opts.target, 'eo-placed.csv')}`,
44
44
  `-Deo.placedFormat=csv`,
45
45
  ], opts.target).then((r) => {
46
- console.info('EO program assembled in %s', path.resolve(opts.target));
47
- return r;
46
+ console.info('EO program assembled in %s', path.resolve(opts.target));
47
+ return r;
48
48
  });
49
49
  };
@@ -42,7 +42,7 @@ module.exports = function(opts) {
42
42
  `-Deo.generatedDir=${path.resolve(opts.target, 'generated-sources')}`,
43
43
  '-Deo.version=' + (opts.parser ? opts.parser : parserVersion.get()),
44
44
  ], opts.target).then((r) => {
45
- console.info('Java .class files compiled into %s', target);
46
- return r;
45
+ console.info('Java .class files compiled into %s', target);
46
+ return r;
47
47
  });
48
48
  };
@@ -38,7 +38,7 @@ module.exports = function(opts) {
38
38
  `-Deo.targetDir=${path.resolve(opts.target)}`,
39
39
  '-Deo.version=' + (opts.parser ? opts.parser : parserVersion.get()),
40
40
  ], opts.target).then((r) => {
41
- console.info('Executable JAR created at %s', path.resolve(opts.target, 'eoc.jar'));
42
- return r;
41
+ console.info('Executable JAR created at %s', path.resolve(opts.target, 'eoc.jar'));
42
+ return r;
43
43
  });
44
44
  };
@@ -40,7 +40,7 @@ module.exports = function(opts) {
40
40
  `-Deo.targetDir=${path.resolve(opts.target)}`,
41
41
  `-Deo.sourcesDir=${path.resolve(opts.sources)}`,
42
42
  ], opts.target).then((r) => {
43
- console.info('EO objects registered in %s', foreign);
44
- return r;
43
+ console.info('EO objects registered in %s', foreign);
44
+ return r;
45
45
  });
46
46
  };
@@ -61,7 +61,7 @@ module.exports = function(opts) {
61
61
  argv.push('-Deo.generateDotFiles');
62
62
  }
63
63
  return mvnw(argv, opts.target).then((r) => {
64
- console.info('SODG files generated in %s', path.resolve(opts.target));
65
- return r;
64
+ console.info('SODG files generated in %s', path.resolve(opts.target));
65
+ return r;
66
66
  });
67
67
  };
package/src/eoc.js CHANGED
@@ -89,7 +89,7 @@ program.command('assemble')
89
89
  .action((str, opts) => {
90
90
  if (program.opts().alone == undefined) {
91
91
  register(program.opts())
92
- .then((r) => assemble(program.opts()));
92
+ .then((r) => assemble(program.opts()));
93
93
  } else {
94
94
  assemble(program.opts());
95
95
  }
@@ -106,8 +106,8 @@ program.command('sodg')
106
106
  .action((str, opts) => {
107
107
  if (program.opts().alone == undefined) {
108
108
  register(program.opts())
109
- .then((r) => assemble(program.opts()))
110
- .then((r) => sodg({...program.opts(), ...str}));
109
+ .then((r) => assemble(program.opts()))
110
+ .then((r) => sodg({...program.opts(), ...str}));
111
111
  } else {
112
112
  sodg({...program.opts(), ...str});
113
113
  }
@@ -118,8 +118,8 @@ program.command('transpile')
118
118
  .action((str, opts) => {
119
119
  if (program.opts().alone == undefined) {
120
120
  register(program.opts())
121
- .then((r) => assemble(program.opts()))
122
- .then((r) => transpile(program.opts()));
121
+ .then((r) => assemble(program.opts()))
122
+ .then((r) => transpile(program.opts()));
123
123
  } else {
124
124
  transpile(program.opts());
125
125
  }
@@ -130,9 +130,9 @@ program.command('compile')
130
130
  .action((str, opts) => {
131
131
  if (program.opts().alone == undefined) {
132
132
  register(program.opts())
133
- .then((r) => assemble(program.opts()))
134
- .then((r) => transpile(program.opts()))
135
- .then((r) => compile(program.opts()));
133
+ .then((r) => assemble(program.opts()))
134
+ .then((r) => transpile(program.opts()))
135
+ .then((r) => compile(program.opts()));
136
136
  } else {
137
137
  compile(program.opts());
138
138
  }
@@ -143,12 +143,12 @@ program.command('link')
143
143
  .action((str, opts) => {
144
144
  if (program.opts().alone == undefined) {
145
145
  register(program.opts())
146
- .then((r) => assemble(program.opts()))
147
- .then((r) => transpile(program.opts()))
148
- .then((r) => compile(program.opts()))
149
- .then((r) => link(program.opts()));
146
+ .then((r) => assemble(program.opts()))
147
+ .then((r) => transpile(program.opts()))
148
+ .then((r) => compile(program.opts()))
149
+ .then((r) => link(program.opts()));
150
150
  } else {
151
- link(program.opts());
151
+ link(program.opts());
152
152
  }
153
153
  });
154
154
 
@@ -158,11 +158,11 @@ program.command('dataize')
158
158
  .action((str, opts) => {
159
159
  if (program.opts().alone == undefined) {
160
160
  register(program.opts())
161
- .then((r) => assemble(program.opts()))
162
- .then((r) => transpile(program.opts()))
163
- .then((r) => compile(program.opts()))
164
- .then((r) => link(program.opts()))
165
- .then((r) => dataize(program.args[1], program.args.slice(2), {...program.opts(), ...str}));
161
+ .then((r) => assemble(program.opts()))
162
+ .then((r) => transpile(program.opts()))
163
+ .then((r) => compile(program.opts()))
164
+ .then((r) => link(program.opts()))
165
+ .then((r) => dataize(program.args[1], program.args.slice(2), {...program.opts(), ...str}));
166
166
  } else {
167
167
  dataize(program.args[1], program.args.slice(2), {...program.opts(), ...str});
168
168
  }
@@ -173,11 +173,11 @@ program.command('test')
173
173
  .action((str, opts) => {
174
174
  if (program.opts().alone == undefined) {
175
175
  register(program.opts())
176
- .then((r) => assemble(program.opts()))
177
- .then((r) => transpile(program.opts()))
178
- .then((r) => compile(program.opts()))
179
- .then((r) => link(program.opts()))
180
- .then((r) => test(program.opts()));
176
+ .then((r) => assemble(program.opts()))
177
+ .then((r) => transpile(program.opts()))
178
+ .then((r) => compile(program.opts()))
179
+ .then((r) => link(program.opts()))
180
+ .then((r) => test(program.opts()));
181
181
  } else {
182
182
  test(program.opts());
183
183
  }
package/src/mvnw.js CHANGED
@@ -77,7 +77,7 @@ module.exports = function(args, tgt) {
77
77
  start();
78
78
  result.on('close', (code) => {
79
79
  if (code !== 0) {
80
- throw new Error('The command "' + cmd + '" exited with #' + code + ' code');
80
+ throw new Error(`The command "${cmd}" exited with #${code} code`);
81
81
  }
82
82
  stop();
83
83
  resolve(args);
@@ -85,7 +85,7 @@ module.exports = function(args, tgt) {
85
85
  } else {
86
86
  result.on('close', (code) => {
87
87
  if (code !== 0) {
88
- throw new Error('The command "' + cmd + '" exited with #' + code + ' code');
88
+ throw new Error(`The command "${cmd}" exited with #${code} code`);
89
89
  }
90
90
  resolve(args);
91
91
  });
@@ -103,8 +103,8 @@ function start() {
103
103
  beginning = Date.now();
104
104
  const check = function() {
105
105
  if (running) {
106
- print();
107
- setTimeout(check, 200);
106
+ print();
107
+ setTimeout(check, 1000);
108
108
  }
109
109
  };
110
110
  check();
@@ -144,8 +144,16 @@ function print() {
144
144
  }
145
145
  return curr;
146
146
  }
147
+ let elapsed;
148
+ if (duration < 1000) {
149
+ elapsed = `${duration}ms`;
150
+ } else if (duration < 60 * 1000) {
151
+ elapsed = `${Math.ceil(duration / 1000)}s`;
152
+ } else {
153
+ elapsed = `${Math.ceil(duration / 3600000)}min`;
154
+ }
147
155
  process.stdout.write(
148
- `\x1b[33m[${phase}] ${duration} ms. Total number of compiled files ${count(target, 0)}\x1b[0m`
156
+ `\x1b[33m[${phase}] ${elapsed}; ${count(target, 0)} files generated...\x1b[0m`
149
157
  );
150
158
  }
151
159
 
@@ -30,22 +30,22 @@ const {XMLParser} = require('fast-xml-parser');
30
30
  * @return {String} Latest version, for example '0.23.1'
31
31
  */
32
32
  const version = module.exports = {
33
- value: '',
34
- get: function() {
35
- if (version.value === '') {
36
- const repo = 'org/eolang/eo-maven-plugin';
37
- const url = 'https://repo.maven.apache.org/maven2/' + repo + '/maven-metadata.xml';
38
- const xhr = new XMLHttpRequest();
39
- xhr.open('GET', url, false);
40
- xhr.send(null);
41
- if (xhr.status != 200) {
42
- throw new Error('Invalid response status ' + xhr.status + ' from ' + url);
43
- }
44
- const xml = new XMLParser().parse(xhr.responseText);
45
- version.value = xml.metadata.versioning.release;
46
- console.debug('The latest version of %s at %s is %s', repo, url, version.value);
47
- console.info('EO version is %s', version.value);
48
- }
49
- return version.value;
33
+ value: '',
34
+ get: function() {
35
+ if (version.value === '') {
36
+ const repo = 'org/eolang/eo-maven-plugin';
37
+ const url = 'https://repo.maven.apache.org/maven2/' + repo + '/maven-metadata.xml';
38
+ const xhr = new XMLHttpRequest();
39
+ xhr.open('GET', url, false);
40
+ xhr.send(null);
41
+ if (xhr.status != 200) {
42
+ throw new Error('Invalid response status ' + xhr.status + ' from ' + url);
43
+ }
44
+ const xml = new XMLParser().parse(xhr.responseText);
45
+ version.value = xml.metadata.versioning.release;
46
+ console.debug('The latest version of %s at %s is %s', repo, url, version.value);
47
+ console.info('EO version is %s', version.value);
50
48
  }
49
+ return version.value;
50
+ }
51
51
  };
package/src/version.js CHANGED
@@ -22,4 +22,4 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- module.exports = '0.10.0';
25
+ module.exports = '0.10.1';