@live-codes/browser-compilers 0.7.1 → 0.7.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.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Compilers that run in the browser, for use in livecodes.io",
5
5
  "author": "Hatem Hosny",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "@esbuild-plugins/node-modules-polyfill": "0.1.4",
28
28
  "@fullhuman/postcss-purgecss": "5.0.0",
29
29
  "@mdx-js/mdx": "2.3.0",
30
- "@prettier/plugin-pug": "2.4.0",
30
+ "@prettier/plugin-pug": "2.5.1",
31
31
  "@tailwindcss/aspect-ratio": "0.4.2",
32
32
  "@tailwindcss/forms": "0.5.3",
33
33
  "@tailwindcss/line-clamp": "0.4.4",
@@ -74,14 +74,27 @@ fs.copyFileSync(
74
74
  path.resolve(targetDir + '/stylus/stylus.min.js'),
75
75
  );
76
76
 
77
- // pug
78
- esbuild.build({
79
- ...baseOptions,
80
- entryPoints: ['vendor_modules/imports/pug.js'],
81
- outfile: 'dist/pug/pug.min.js',
82
- globalName: 'pug',
83
- plugins: nodePolyfills,
84
- });
77
+ patch('node_modules/is-core-module/index.js', {
78
+ "throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');":
79
+ "return false; // throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');",
80
+ })
81
+ .then(() =>
82
+ // pug
83
+ esbuild.build({
84
+ ...baseOptions,
85
+ entryPoints: ['vendor_modules/imports/pug.js'],
86
+ outfile: 'dist/pug/pug.min.js',
87
+ globalName: 'pug',
88
+ plugins: nodePolyfills,
89
+ sourcemap: 'inline',
90
+ }),
91
+ )
92
+ .then(() => {
93
+ patch('node_modules/is-core-module/index.js', {
94
+ "return false; // throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');":
95
+ "throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');",
96
+ });
97
+ });
85
98
 
86
99
  // postcss
87
100
  esbuild.build({
@@ -132,13 +145,19 @@ patch('node_modules/browserslist/index.js', {
132
145
  });
133
146
  });
134
147
 
135
- // @prettier/plugin-pug
136
- esbuild.buildSync({
137
- ...baseOptions,
138
- entryPoints: ['node_modules/@prettier/plugin-pug/dist/index.js'],
139
- outfile: 'dist/prettier/parser-pug.js',
140
- globalName: 'pluginPug',
141
- });
148
+ patch('node_modules/@prettier/plugin-pug/dist/printer.js', {
149
+ 'const node_util_1 = require("node:util");':
150
+ 'const node_util_1 = {types: {isNativeError: () => false}};',
151
+ }).then(() =>
152
+ // @prettier/plugin-pug
153
+ esbuild.build({
154
+ ...baseOptions,
155
+ entryPoints: ['node_modules/@prettier/plugin-pug/dist/index.js'],
156
+ outfile: 'dist/prettier/parser-pug.js',
157
+ globalName: 'pluginPug',
158
+ plugins: nodePolyfills,
159
+ }),
160
+ );
142
161
 
143
162
  // svelte
144
163
  esbuild.buildSync({