Skip to content

Commit 3fc36bd

Browse files
sirtimidclaude
andcommitted
fix: address PR #919 review comments
Export `register` as a named export from the openclaw-plugin to avoid `register.register()` pattern, and improve the dynamic import warning in `removeDynamicImportsPlugin` to also fire when mixed literal/computed imports exist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 149eb35 commit 3fc36bd

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

packages/evm-wallet-experiment/openclaw-plugin/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ const entry: PluginEntry = {
140140
register,
141141
};
142142

143+
export { register };
143144
export default entry;

packages/evm-wallet-experiment/test/integration/openclaw-plugin.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { dirname, resolve } from 'node:path';
66
import { fileURLToPath } from 'node:url';
77
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
88

9-
import register from '../../openclaw-plugin/index.ts';
9+
import { register } from '../../openclaw-plugin/index.ts';
1010
import { makeWalletClusterConfig } from '../../src/cluster-config.ts';
1111

1212
type ToolResponse = {
@@ -262,7 +262,7 @@ exec "${process.execPath}" "${ocapCliEntrypoint}" "$@"
262262
]);
263263

264264
tools = new Map<string, ToolDefinition>();
265-
register.register({
265+
register({
266266
pluginConfig: {
267267
ocapCliPath,
268268
walletKref: rootKref,

packages/evm-wallet-experiment/test/openclaw-plugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { spawn } from 'node:child_process';
22
import { EventEmitter } from 'node:events';
33
import { beforeEach, describe, expect, it, vi } from 'vitest';
44

5-
import pluginEntry from '../openclaw-plugin/index.ts';
5+
import { register } from '../openclaw-plugin/index.ts';
66

77
vi.mock('node:child_process', () => ({ spawn: vi.fn() }));
88

@@ -107,7 +107,7 @@ function setupPlugin(): Map<string, ToolDefinition> {
107107
},
108108
};
109109

110-
pluginEntry.register(api);
110+
register(api);
111111
return tools;
112112
}
113113

packages/kernel-utils/src/vite-plugins/bundle-vat.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ export function removeDynamicImportsPlugin(): RolldownPlugin {
4242
'Promise.resolve({})',
4343
);
4444

45-
if (transformed === code) {
45+
if (/\bimport\s*\(/u.test(transformed)) {
4646
this.warn(
4747
`Module "${id}" contains dynamic import() expressions that could not ` +
4848
`be replaced (e.g. computed specifiers). Rolldown may reject IIFE output.`,
4949
);
50+
}
51+
52+
if (transformed === code) {
5053
return null;
5154
}
5255

0 commit comments

Comments
 (0)