From 7baf581f6a045fdfd5b2f59a3c30969271d8752c Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 10 Feb 2024 19:15:15 -0500 Subject: [PATCH] disable JSON import --- patches/escodegen+2.0.0.patch | 14 ++++++++------ rollup.config.js | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/patches/escodegen+2.0.0.patch b/patches/escodegen+2.0.0.patch index 9780b53..8ac62b6 100644 --- a/patches/escodegen+2.0.0.patch +++ b/patches/escodegen+2.0.0.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/escodegen/escodegen.js b/node_modules/escodegen/escodegen.js -index 847fc37..0082e3b 100644 +index 847fc37..0c2bc8b 100644 --- a/node_modules/escodegen/escodegen.js +++ b/node_modules/escodegen/escodegen.js -@@ -33,1219 +33,1376 @@ +@@ -33,1219 +33,1378 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -80,7 +80,9 @@ index 847fc37..0082e3b 100644 - Primary: 21 +import * as estraverse from 'estraverse'; +import * as esutils from 'esutils'; -+import packageJson from './package.json' assert { type: 'json' }; ++// TODO - wait until rollup supports import attributes ++// https://github.com/rollup/rollup/issues/4818 ++// import packageJson from './package.json' assert { type: 'json' }; + +var Syntax, + Precedence, @@ -2375,7 +2377,7 @@ index 847fc37..0082e3b 100644 result.push(indent); result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); if (i + 1 < iz) { -@@ -1256,1392 +1413,1237 @@ +@@ -1256,1392 +1415,1237 @@ if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } @@ -4762,10 +4764,10 @@ index 847fc37..0082e3b 100644 +var attachComments = estraverse.attachComments; +var precedence = updateDeeply({}, Precedence); +var browser = false; -+var { version } = packageJson; ++// var { version } = packageJson; + +export { -+ version, ++ // version, + generate, + attachComments, + precedence as Precedence, diff --git a/rollup.config.js b/rollup.config.js index ffb2a5b..63461e5 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; -import { importAssertionsPlugin } from 'rollup-plugin-import-assert'; -import { importAssertions } from 'acorn-import-assertions'; +// import { importAssertionsPlugin } from 'rollup-plugin-import-assert'; +// import { importAssertions } from 'acorn-import-assertions'; export default { input: 'src/wcc.js', @@ -9,9 +9,9 @@ export default { file: 'dist/wcc.dist.cjs', format: 'cjs' }, - acornInjectPlugins: [ importAssertions ], // TODO this is depercated in v4.x + // acornInjectPlugins: [ importAssertions ], // TODO this is deprecated in v4.x plugins: [ - importAssertionsPlugin(), + // importAssertionsPlugin(), nodeResolve(), commonjs() ]