Skip to content

Commit

Permalink
Use package self-reference to reduce clunk of conditonal exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Mar 17, 2022
1 parent f431f1d commit 4b73064
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 42 deletions.
6 changes: 0 additions & 6 deletions packages/init/debug-node.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/init/index-node.js

This file was deleted.

20 changes: 4 additions & 16 deletions packages/init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,14 @@
"type": "module",
"main": "index.js",
"exports": {
".": {
"node": "./index-node.js",
"default": "./index.js"
},
"./debug.js": {
"node": "./debug-node.js",
"default": "./debug.js"
},
".": "./index.js",
"./debug.js": "./debug.js",
"./pre.js": {
"node": "./pre-node.js",
"default": "./pre.js"
},
"./pre-remoting.js": {
"node": "./pre-remoting-node.js",
"default": "./pre-remoting.js"
},
"./pre-bundle-source.js": {
"node": "./pre-bundle-source-node.js",
"default": "./pre-bundle-source.js"
},
"./pre-remoting.js": "./pre-remoting.js",
"./pre-bundle-source.js": "./pre-bundle-source.js",
"./package.json": "./package.json"
},
"scripts": {
Expand Down
7 changes: 0 additions & 7 deletions packages/init/pre-bundle-source-node.js

This file was deleted.

4 changes: 3 additions & 1 deletion packages/init/pre-bundle-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
// or if further vetted shim initialization is needed:
// import '@endo/init/pre.js';

import './pre.js';
// Use a package self-reference to go through the "exports" resolution
// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init/pre.js';
5 changes: 0 additions & 5 deletions packages/init/pre-remoting-node.js

This file was deleted.

4 changes: 3 additions & 1 deletion packages/init/pre-remoting.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// pre-remoting.js - shims necessary to use @endo/far

import './pre.js';
// Use a package self-reference to go through the "exports" resolution
// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init/pre.js';

export * from '@endo/eventual-send/shim.js';
2 changes: 2 additions & 0 deletions packages/init/test/test-async_hooks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* global globalThis, $262 */

// Use a package self-reference to go through the "exports" resolution
// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init';
import test from 'ava';
import { createHook } from 'async_hooks';
Expand Down

0 comments on commit 4b73064

Please sign in to comment.