refactor(plugins): 部分插件改用运行时导入依赖替代静态导入

将所有插件内的静态依赖导入改为通过access.importRuntime动态导入,并调整package.json依赖顺序
This commit is contained in:
xiaojunnuo
2026-06-21 23:43:19 +08:00
parent 1f1b1858c7
commit f32c99d4a1
15 changed files with 42 additions and 42 deletions
@@ -14,7 +14,7 @@ export class VolcengineCdnClient {
if (this.service) {
return this.service;
}
const { cdn } = await import("@volcengine/openapi");
const { cdn } = await this.opts.access.importRuntime("@volcengine/openapi");
const service = new cdn.CdnService();
// 设置ak、sk
service.setAccessKeyId(this.opts.access.accessKeyId);
@@ -21,7 +21,7 @@ export class VolcengineDnsClient {
}
async doRequest(req: VolcengineReq) {
const { Signer } = await import("@volcengine/openapi");
const { Signer } = await this.opts.access.importRuntime("@volcengine/openapi");
// http request data
const openApiRequestData: any = {
@@ -1,4 +1,4 @@
import { VolcengineAccess } from "./access.js";
import { VolcengineAccess } from "./access.js";
import { HttpClient, ILogger } from "@certd/basic";
export type VolcengineOpts = {
@@ -140,7 +140,7 @@ export class VolcengineClient {
}
async getTOSService(opts: { region?: string }) {
const { TosClient } = await import("@volcengine/tos-sdk");
const { TosClient } = await this.opts.access.importRuntime("@volcengine/tos-sdk");
const client = new TosClient({
accessKeyId: this.opts.access.accessKeyId,
@@ -169,7 +169,7 @@ export class VolcengineClient {
if (this.CommonService) {
return this.CommonService;
}
const { Service } = await import("@volcengine/openapi");
const { Service } = await this.opts.access.importRuntime("@volcengine/openapi");
class CommonService extends Service {
Generic: any;