goldstein 3.3.1 → 4.0.0

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/ChangeLog CHANGED
@@ -1,3 +1,18 @@
1
+ 2023.08.28, v4.0.0
2
+
3
+ feature:
4
+ - 37f9e82 goldstein: async
5
+ - 901a4fa rules: convert-t-raise-to-raise
6
+ - cb5d441 rules: add convert-t-raise-to-raise
7
+ - 86c5230 rules: add
8
+ - 8a8dd67 package: esbuild v0.19.2
9
+ - 8501a14 package: @putout/printer v3.6.0
10
+
11
+ 2023.08.09, v3.3.2
12
+
13
+ fix:
14
+ - 456c500 should: typo
15
+
1
16
  2023.08.07, v3.3.1
2
17
 
3
18
  feature:
package/README.md CHANGED
@@ -78,7 +78,7 @@ When you need to compile **Goldstein** to **JavaScript** use:
78
78
  ```js
79
79
  import {compile} from 'goldstein';
80
80
 
81
- compile(`
81
+ await compile(`
82
82
  fn hello() {
83
83
  guard text !== "world" else {
84
84
  return ""
@@ -117,7 +117,7 @@ const source = `
117
117
 
118
118
  const {keywordFn} = keywords;
119
119
 
120
- compile(source, {
120
+ await compile(source, {
121
121
  keywords: [
122
122
  keywordFn,
123
123
  function id(Parser) {
package/bin/gs.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  readFileSync,
6
6
  writeFileSync,
7
7
  unlinkSync,
8
- } from 'fs';
8
+ } from 'node:fs';
9
9
  import {compile} from '../packages/goldstein/index.js';
10
10
 
11
11
  const [arg] = process.argv.slice(2);
package/build/parser.cjs CHANGED
@@ -5567,7 +5567,7 @@ function newSpeak3(Parser3) {
5567
5567
  this.next();
5568
5568
  const node = super.startNode();
5569
5569
  if (this.type === types$1.braceL)
5570
- return this.raise(this.start, `After 'should' only 'await' and 'function call' can come, brakets are not supported`);
5570
+ return this.raise(this.start, `After 'should' only 'await' and 'function call' can come, brackets are not supported`);
5571
5571
  const expression = this.parseExpression();
5572
5572
  if (isCallExpression2(expression))
5573
5573
  node.expression = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goldstein",
3
- "version": "3.3.1",
3
+ "version": "4.0.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "JavaScript with no limits",
@@ -29,9 +29,9 @@
29
29
  "wisdom": "madrun wisdom"
30
30
  },
31
31
  "dependencies": {
32
- "@putout/printer": "^2.61.0",
32
+ "@putout/printer": "^3.6.0",
33
33
  "acorn": "^8.7.1",
34
- "esbuild": "^0.18.11",
34
+ "esbuild": "^0.19.2",
35
35
  "esbuild-node-builtins": "^0.1.0",
36
36
  "estree-to-babel": "^6.0.0",
37
37
  "putout": "^31.0.3",
@@ -1,13 +1,13 @@
1
- import {transform} from 'putout';
1
+ import {transformAsync} from 'putout';
2
2
  import {print} from '@putout/printer';
3
3
  import {parse} from './parser.js';
4
4
  import estreeToBabel from 'estree-to-babel';
5
5
 
6
6
  export * from './parser.js';
7
- export const compile = (source, options = {}) => {
7
+ export const compile = async (source, options = {}) => {
8
8
  const ast = estreeToBabel(parse(source, options));
9
9
 
10
- transform(ast, source, {
10
+ await transformAsync(ast, source, {
11
11
  rules: {
12
12
  ...options.rules,
13
13
  },
@@ -37,7 +37,7 @@ export default function newSpeak(Parser) {
37
37
  const node = super.startNode();
38
38
 
39
39
  if (this.type === tt.braceL)
40
- return this.raise(this.start, `After 'should' only 'await' and 'function call' can come, brakets are not supported`);
40
+ return this.raise(this.start, `After 'should' only 'await' and 'function call' can come, brackets are not supported`);
41
41
 
42
42
  const expression = this.parseExpression();
43
43