Skip to content

Commit 08e7547

Browse files
committed
update astexplorer-refmt
1 parent 8888701 commit 08e7547

6 files changed

Lines changed: 16942 additions & 12191 deletions

File tree

website/.yarn/install-state.gz

1.52 MB
Binary file not shown.

website/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"acorn-loose": "^8.1.0",
6363
"acorn-to-esprima": "^2.0.8",
6464
"astexplorer-go": "^1.0.0",
65-
"astexplorer-refmt": "^1.0.1",
65+
"astexplorer-refmt": "^2.0.0",
6666
"astexplorer-syn": "^1.0.48",
6767
"babel-core": "npm:babel-core@^6",
6868
"babel-eslint": "^7.2.3",
@@ -177,9 +177,9 @@
177177
"scripts": {
178178
"dev": "concurrently \"yarn start\" \"yarn build-dev\"",
179179
"start": "serve -l 8080 ../out",
180-
"build": "rimraf ../out/* && cross-env NODE_ENV=production webpack --mode=production",
181-
"build-dev": "rimraf ../out/* && cross-env NODE_ENV=development webpack -d --mode=development",
182-
"watch": "webpack -dw --mode=development",
180+
"build": "rimraf ../out/* && cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --mode=production",
181+
"build-dev": "rimraf ../out/* && cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development webpack -d --mode=development",
182+
"watch": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack -dw --mode=development",
183183
"lint": "node_modules/eslint/bin/eslint.js src/",
184184
"fontcustom": "fontcustom compile ./fontcustom/input-svg/ --config=./fontcustom/config.yml"
185185
}

website/src/parsers/ocaml/refmt-ml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export default {
66
...config,
77
id: ID,
88
parse: function(parser, code) {
9-
return parser.parseOcaml(code);
9+
return JSON.parse(parser.parseOcaml(code));
1010
},
1111
};

website/src/parsers/reason/refmt.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import defaultParserInterface from '../utils/defaultParserInterface';
2-
import esyPkg from 'astexplorer-refmt/esy.json';
32
import CodeMirror from 'codemirror';
43
import addCodeMirrorMode from './codeMirrorMode';
54

@@ -32,23 +31,22 @@ const locKeys = [
3231
'pval_loc',
3332
'pvb_loc',
3433
];
35-
const parserVersion = esyPkg.dependencies['@esy-ocaml/reason'];
3634

3735
export default {
3836
...defaultParserInterface,
3937

4038
id: ID,
4139
displayName: ID,
42-
version: parserVersion,
43-
homepage: `https://www.npmjs.com/package/@esy-ocaml/reason/v/${parserVersion}`,
40+
version: '3.17.2',
41+
homepage: `https://github.com/reasonml/reason`,
4442
locationProps: new Set(locKeys),
4543

4644
loadParser(callback) {
4745
require(['astexplorer-refmt'], callback);
4846
},
4947

5048
parse(parser, code) {
51-
return parser.parseReason(code);
49+
return JSON.parse(parser.parseReason(code));
5250
},
5351

5452
getNodeName(node) {

website/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ module.exports = Object.assign({
264264
/typescript\/lib/,
265265
/esprima\/dist\/esprima\.js/,
266266
/esprima-fb\/esprima\.js/,
267+
/astexplorer-refmt\/dist\/ast_explorer_refmt\.bc\.js/,
267268
// This is necessary because flow is trying to load the 'fs' module, but
268269
// dynamically. Without this webpack will throw an error at runtime.
269270
// I assume the `require(...)` call "succeeds" because 'fs' is shimmed to
270271
// be empty below.
271272
/flow-parser\/flow_parser\.js/,
272273
],
273274
},
274-
275275
node: {
276276
child_process: 'empty',
277277
fs: 'empty',

0 commit comments

Comments
 (0)