Skip to content

Commit d3e4525

Browse files
committed
fix(client): explicit mjs exports
1 parent f109ad8 commit d3e4525

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed

client/index.mjs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
import cjsImport from './index.js';
22

3-
export * from './index.js';
3+
const {
4+
Handler,
5+
Agent,
6+
RemoteConnectionToCore,
7+
ConnectionToCore,
8+
ConnectionFactory,
9+
InteractionCommand,
10+
MouseButton,
11+
ResourceType,
12+
KeyboardKeys,
13+
BlockedResourceType,
14+
Node,
15+
FrameEnvironment,
16+
Tab,
17+
XPathResult,
18+
LocationStatus,
19+
LocationTrigger,
20+
} = cjsImport;
21+
22+
export {
23+
Handler,
24+
Agent,
25+
RemoteConnectionToCore,
26+
ConnectionToCore,
27+
ConnectionFactory,
28+
InteractionCommand,
29+
MouseButton,
30+
ResourceType,
31+
KeyboardKeys,
32+
BlockedResourceType,
33+
Node,
34+
FrameEnvironment,
35+
Tab,
36+
XPathResult,
37+
LocationStatus,
38+
LocationTrigger,
39+
};
440

541
export default cjsImport.default;

core/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import cjsImport from './index.js';
22

3-
export * from './index.js';
3+
const { LocationTrigger, CoreProcess, BrowserEmulators, HumanEmulators, Viewports } = cjsImport;
44

5+
export { LocationTrigger, CoreProcess, BrowserEmulators, HumanEmulators, Viewports };
56
export default cjsImport.default;

examples/handler.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Handler } from 'secret-agent';
2+
3+
(async function run() {
4+
const handler = new Handler();
5+
handler.dispatchAgent(async agent => {
6+
await agent.goto('https://news.ycombinator.com');
7+
await agent.waitForPaintingStable();
8+
});
9+
handler.dispatchAgent(async agent => {
10+
await agent.goto('https://news.ycombinator.com/newest');
11+
await agent.waitForPaintingStable();
12+
});
13+
await handler.waitForAllDispatches();
14+
await handler.close();
15+
})();

full-client/index.mjs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
import cjsImport from './index.js';
22

3-
export * from './index.js';
3+
const {
4+
Handler,
5+
Agent,
6+
RemoteConnectionToCore,
7+
ConnectionToCore,
8+
ConnectionFactory,
9+
InteractionCommand,
10+
MouseButton,
11+
ResourceType,
12+
KeyboardKeys,
13+
BlockedResourceType,
14+
Node,
15+
FrameEnvironment,
16+
Tab,
17+
XPathResult,
18+
LocationStatus,
19+
LocationTrigger,
20+
} = cjsImport;
21+
22+
export {
23+
Handler,
24+
Agent,
25+
RemoteConnectionToCore,
26+
ConnectionToCore,
27+
ConnectionFactory,
28+
InteractionCommand,
29+
MouseButton,
30+
ResourceType,
31+
KeyboardKeys,
32+
BlockedResourceType,
33+
Node,
34+
FrameEnvironment,
35+
Tab,
36+
XPathResult,
37+
LocationStatus,
38+
LocationTrigger,
39+
};
440

541
export default cjsImport.default;

0 commit comments

Comments
 (0)