Skip to content

Commit

Permalink
fix(agoric): disable RESM
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Sep 21, 2023
1 parent 58a6d49 commit 8355af4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/agoric-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"commander": "^10.0.0",
"dd-trace": "^3.3.0",
"deterministic-json": "^1.0.5",
"esm": "agoric-labs/esm#Agoric-built",
"inquirer": "^8.2.2",
"opener": "^1.5.2",
"tmp": "^0.2.1",
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/src/entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/* global process */

import '@endo/init/pre.js';
import 'esm';
import '@agoric/casting/node-fetch-shim.js';
import '@endo/init';

Expand Down
6 changes: 2 additions & 4 deletions packages/agoric-cli/src/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import bundleSource from '@endo/bundle-source';
import { E } from '@endo/captp';
import { search as readContainingPackageDescriptor } from '@endo/compartment-mapper';

import createEsmRequire from 'esm';
import { createRequire } from 'module';
import path from 'path';
import url from 'url';

const require = createRequire(import.meta.url);
const esmRequire = createEsmRequire(/** @type {NodeModule} */ ({}));

const PATH_SEP_RE = new RegExp(`${path.sep.replace(/\\/g, '\\\\')}`, 'g');

Expand Down Expand Up @@ -154,9 +152,9 @@ export { bootPlugin } from ${JSON.stringify(absPath)};
);

const modulePath = pathResolve(moduleFile);
let mainNS = await (nativeEsm && import(modulePath));
const mainNS = await (nativeEsm && import(modulePath));
if (!mainNS) {
mainNS = esmRequire(modulePath);
throw Error('standardthings/esm emulation disabled');
}

const allEndowments = harden({
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/test/test-main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* global globalThis */
import '@agoric/casting/node-fetch-shim.js';
import '@endo/init/pre.js';
import 'esm';
import '@endo/init/debug.js';
import test from 'ava';
import fs from 'fs';
Expand Down

0 comments on commit 8355af4

Please sign in to comment.