22 lines
681 B
JavaScript
22 lines
681 B
JavaScript
// @dsh-local/business-plugins — host plugin (dsh 0.1.2-rc.1)
|
|
// 功能插件启停:功能全在 client 面(settings.section),host 面仅写加载标记,
|
|
// 证明 bundle 被 cordis 实例化。无任何 ctx 服务依赖,无副作用可抛出。
|
|
|
|
import { appendFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
const MARKER = ".dsh-biz-plugins.log";
|
|
|
|
function log(line) {
|
|
try {
|
|
const home = process.env.DSH_HOME || process.env.HOME || ".";
|
|
appendFileSync(join(home, MARKER), `${new Date().toISOString()} ${line}\n`);
|
|
} catch {
|
|
// marker 写入绝不拖垮 profile
|
|
}
|
|
}
|
|
|
|
export function apply(_ctx) {
|
|
log(`apply pid=${process.pid}`);
|
|
}
|