@live-codes/browser-compilers 0.7.4 → 0.7.5

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.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Compilers that run in the browser, for use in livecodes.io",
5
5
  "author": "Hatem Hosny",
6
6
  "license": "MIT",
@@ -72,9 +72,9 @@
72
72
  "react-dom": "18.2.0",
73
73
  "react-native-web": "0.19.4",
74
74
  "remark-gfm": "3.0.1",
75
- "sass": "1.63.2",
75
+ "sass": "1.63.6",
76
76
  "sucrase": "3.32.0",
77
- "svelte": "3.59.1",
77
+ "svelte": "4.0.0",
78
78
  "windicss": "3.5.6"
79
79
  },
80
80
  "devDependencies": {
@@ -162,7 +162,7 @@ patch('node_modules/@prettier/plugin-pug/dist/printer.js', {
162
162
  // svelte
163
163
  esbuild.buildSync({
164
164
  ...baseOptions,
165
- entryPoints: ['node_modules/svelte/compiler.js'],
165
+ entryPoints: ['node_modules/svelte/compiler.cjs'],
166
166
  outfile: 'dist/svelte/svelte-compiler.min.js',
167
167
  globalName: 'svelte',
168
168
  });
@@ -431,29 +431,41 @@ esbuild.build({
431
431
  });
432
432
 
433
433
  // assemblyscript
434
- esbuild.build({
435
- ...baseOptions,
436
- entryPoints: ['vendor_modules/imports/assemblyscript.js'],
437
- outfile: 'dist/assemblyscript/assemblyscript.esm.js',
438
- format: 'esm',
439
- plugins: nodePolyfills,
440
- }).then(() => {
441
- // workaround for top level await in iife bundle
442
- // https://github.com/evanw/esbuild/issues/253
443
- const content = fs.readFileSync(path.resolve('dist/assemblyscript/assemblyscript.esm.js'), 'utf8');
444
- const patchedContent = 'self.assemblyscriptLoaded = (async() => {self.window = self;' +
445
- content.replace(/export{(\w{1,3}) as asc};/g, (_, token) => {
446
- return `self.assemblyscript={asc:${token}};})();`;
447
- });
448
- fs.writeFileSync(path.resolve('dist/assemblyscript/assemblyscript.patched.js'), patchedContent, 'utf8');
449
-
450
- esbuild.build({
434
+ esbuild
435
+ .build({
451
436
  ...baseOptions,
452
- entryPoints: ['dist/assemblyscript/assemblyscript.patched.js'],
453
- outfile: 'dist/assemblyscript/assemblyscript.js',
454
- platform: 'browser',
455
- }).then(() => {
456
- fs.unlinkSync(path.resolve('dist/assemblyscript/assemblyscript.esm.js'));
457
- fs.unlinkSync(path.resolve('dist/assemblyscript/assemblyscript.patched.js'));
437
+ entryPoints: ['vendor_modules/imports/assemblyscript.js'],
438
+ outfile: 'dist/assemblyscript/assemblyscript.esm.js',
439
+ format: 'esm',
440
+ plugins: nodePolyfills,
441
+ })
442
+ .then(() => {
443
+ // workaround for top level await in iife bundle
444
+ // https://github.com/evanw/esbuild/issues/253
445
+ const content = fs.readFileSync(
446
+ path.resolve('dist/assemblyscript/assemblyscript.esm.js'),
447
+ 'utf8',
448
+ );
449
+ const patchedContent =
450
+ 'self.assemblyscriptLoaded = (async() => {self.window = self;' +
451
+ content.replace(/export{(\w{1,3}) as asc};/g, (_, token) => {
452
+ return `self.assemblyscript={asc:${token}};})();`;
453
+ });
454
+ fs.writeFileSync(
455
+ path.resolve('dist/assemblyscript/assemblyscript.patched.js'),
456
+ patchedContent,
457
+ 'utf8',
458
+ );
459
+
460
+ esbuild
461
+ .build({
462
+ ...baseOptions,
463
+ entryPoints: ['dist/assemblyscript/assemblyscript.patched.js'],
464
+ outfile: 'dist/assemblyscript/assemblyscript.js',
465
+ platform: 'browser',
466
+ })
467
+ .then(() => {
468
+ fs.unlinkSync(path.resolve('dist/assemblyscript/assemblyscript.esm.js'));
469
+ fs.unlinkSync(path.resolve('dist/assemblyscript/assemblyscript.patched.js'));
470
+ });
458
471
  });
459
- });