@live-codes/browser-compilers 0.5.0 → 0.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-codes/browser-compilers",
3
- "version": "0.5.0",
3
+ "version": "0.5.3",
4
4
  "description": "Compilers that run in the browser, for use in livecodes.io",
5
5
  "author": "Hatem Hosny",
6
6
  "license": "MIT",
@@ -34,8 +34,8 @@
34
34
  "babel-preset-solid": "1.3.5",
35
35
  "esbuild-plugin-cache": "0.2.9",
36
36
  "esbuild-plugin-velcro": "0.1.1",
37
+ "eslint": "8.11.0",
37
38
  "less": "4.1.2",
38
- "monaco-editor": "0.29.1",
39
39
  "postcss": "8.4.6",
40
40
  "postcss-preset-env": "7.3.1",
41
41
  "react": "17.0.2",
@@ -50,18 +50,17 @@
50
50
  "@types/live-server": "1.2.0",
51
51
  "@types/node": "14.0.4",
52
52
  "@types/prettier": "2.1.6",
53
- "@typescript-eslint/eslint-plugin": "4.8.2",
54
- "@typescript-eslint/parser": "4.8.2",
53
+ "@typescript-eslint/eslint-plugin": "5.16.0",
54
+ "@typescript-eslint/parser": "5.16.0",
55
55
  "autoprefixer": "10.4.2",
56
56
  "cz-conventional-changelog": "3.2.0",
57
57
  "esbuild": "0.11.12",
58
58
  "esbuild-plugin-node-polyfills": "1.0.2",
59
- "eslint": "7.32.0",
60
- "eslint-config-prettier": "6.11.0",
61
- "eslint-plugin-import": "2.20.2",
62
- "eslint-plugin-jest": "23.13.1",
63
- "eslint-plugin-jsdoc": "25.4.2",
64
- "eslint-plugin-prefer-arrow": "1.2.1",
59
+ "eslint-config-prettier": "8.5.0",
60
+ "eslint-plugin-import": "2.25.4",
61
+ "eslint-plugin-jest": "26.1.3",
62
+ "eslint-plugin-jsdoc": "38.0.6",
63
+ "eslint-plugin-prefer-arrow": "1.2.3",
65
64
  "gh-pages": "2.2.0",
66
65
  "live-server": "1.2.1",
67
66
  "mkdirp": "1.0.4",
package/scripts/patch.js CHANGED
@@ -11,7 +11,7 @@ const patch = (
11
11
 
12
12
  var result = data;
13
13
  for (const key of Object.keys(replacements)) {
14
- result = result.replace(key, replacements[key]);
14
+ result = result.split(key).join(replacements[key]);
15
15
  }
16
16
 
17
17
  fs.writeFile(path.resolve(filePath), result, 'utf8', function (err) {
@@ -4,10 +4,6 @@ var path = require('path');
4
4
  const esbuild = require('esbuild');
5
5
  const NodeModulesPolyfills = require('@esbuild-plugins/node-modules-polyfill').default;
6
6
  const GlobalsPolyfills = require('@esbuild-plugins/node-globals-polyfill').default;
7
- // const ESBuildNodePolyfillsPlugin = require('esbuild-plugin-node-polyfills');
8
- // const { createPlugin } = require('esbuild-plugin-velcro');
9
-
10
- const Bundler = require('parcel-bundler');
11
7
 
12
8
  const { patch } = require('./patch');
13
9
 
@@ -37,38 +33,6 @@ const baseOptions = {
37
33
  define: { global: 'window', 'process.env.NODE_ENV': '"production"' },
38
34
  };
39
35
 
40
- // Monaco editor
41
- esbuild.buildSync({
42
- ...baseOptions,
43
- entryPoints: ['vendor_modules/imports/monaco-editor.ts'],
44
- outfile: 'dist/monaco-editor/monaco-editor.js',
45
- loader: { '.ttf': 'file' },
46
- format: 'esm',
47
- });
48
-
49
- // Monaco editor workers
50
- const entryFiles = [
51
- 'node_modules/monaco-editor/esm/vs/language/json/json.worker.js',
52
- 'node_modules/monaco-editor/esm/vs/language/css/css.worker.js',
53
- 'node_modules/monaco-editor/esm/vs/language/html/html.worker.js',
54
- 'node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js',
55
- 'node_modules/monaco-editor/esm/vs/editor/editor.worker.js',
56
- ];
57
-
58
- /** @type {Bundler.ParcelOptions} */
59
- const options = {
60
- outDir: './dist/monaco-editor',
61
- minify: true,
62
- target: 'browser',
63
- sourceMaps: false,
64
- watch: false,
65
- };
66
-
67
- entryFiles.forEach(async (file) => {
68
- const parcelBundler = new Bundler([file], options);
69
- await parcelBundler.bundle();
70
- });
71
-
72
36
  // sass
73
37
  patch('node_modules/sass/sass.dart.js', {
74
38
  'var self = Object.create(dartNodePreambleSelf);': 'var self = window;',
@@ -82,6 +46,15 @@ patch('node_modules/sass/sass.dart.js', {
82
46
  });
83
47
  });
84
48
 
49
+ // Eslint
50
+ esbuild.build({
51
+ ...baseOptions,
52
+ entryPoints: ['node_modules/eslint/lib/linter/linter.js'],
53
+ outfile: 'dist/eslint/eslint.js',
54
+ globalName: 'eslint',
55
+ plugins: nodePolyfills,
56
+ });
57
+
85
58
  // Less
86
59
  esbuild.buildSync({
87
60
  ...baseOptions,