New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@koishijs/loader

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koishijs/loader - npm Package Compare versions

Comparing version 2.0.9 to 2.1.0

1

lib/browser.d.ts

@@ -5,3 +5,2 @@ import { Loader } from './shared';

extname: string;
meta: any;
config: {

@@ -8,0 +7,0 @@ plugins: {};

5

lib/shared.d.ts

@@ -8,2 +8,5 @@ import { Context, Dict } from 'koishi';

}
interface Events {
'config'(): void;
}
namespace Context {

@@ -18,3 +21,2 @@ interface Config {

interface State<C> {
[Loader.kUpdate]?: boolean;
[Loader.kRecord]?: Dict<Fork<C>>;

@@ -25,3 +27,2 @@ alias?: string;

export declare abstract class Loader {
static readonly kUpdate: unique symbol;
static readonly kRecord: unique symbol;

@@ -28,0 +29,0 @@ static readonly exitCode = 51;

@@ -128,3 +128,4 @@ var __defProp = Object.defineProperty;

};
ctx.emit(self, "internal/service", name);
ctx.emit(self, "internal/before-service", name, null);
ctx.emit(self, "internal/service", name, null);
}

@@ -160,2 +161,23 @@ }

}
ctx.accept((neo) => {
const old = ctx.state.config;
if (!(0, import_koishi2.deepEqual)(old.$filter || {}, neo.$filter || {})) {
patch.filter(ctx.state.parent, neo.$filter);
}
if (!(0, import_koishi2.deepEqual)(old.$isolate || [], neo.$isolate || [])) {
patch.isolate(ctx.state.parent, neo.$isolate);
}
for (const key in { ...old, ...neo }) {
if (key.startsWith("~") || key.startsWith("$"))
continue;
const fork = ctx.state[Loader.kRecord][key];
if (!fork) {
ctx.loader.reloadPlugin(ctx, key, neo[key]);
} else if (!(key in neo)) {
ctx.loader.unloadPlugin(ctx, key);
} else {
ctx.loader.reloadPlugin(ctx, key, neo[key] || {});
}
}
}, { passive: true });
}

@@ -182,5 +204,3 @@ };

if (fork) {
logger.info(`reload plugin %c`, key);
patch(fork.parent, config);
fork[_Loader.kUpdate] = true;
fork.update(config);

@@ -222,9 +242,10 @@ } else {

this.entry = fork.ctx;
app.on("internal/update", (fork2, value) => {
if (fork2[_Loader.kUpdate]) {
fork2[_Loader.kUpdate] = false;
return;
}
const { runtime } = fork2.parent.state;
const record = runtime[_Loader.kRecord];
app.accept(["plugins"], (config) => {
fork.update(config.plugins);
}, { passive: true });
app.on("dispose", () => {
this.fullReload();
});
app.on("internal/update", (fork2) => {
const record = fork2.parent.state[_Loader.kRecord];
if (!record)

@@ -235,4 +256,3 @@ return;

continue;
runtime.config[name] = value;
return this.writeConfig();
logger.info(`reload plugin %c`, name);
}

@@ -245,3 +265,2 @@ });

__name(Loader, "Loader");
Loader.kUpdate = Symbol.for("koishi.loader.update");
Loader.kRecord = Symbol.for("koishi.loader.record");

@@ -248,0 +267,0 @@ Loader.exitCode = 51;

{
"name": "@koishijs/loader",
"description": "Config Loader for Koishi",
"version": "2.0.9",
"version": "2.1.0",
"main": "lib/node.js",

@@ -41,3 +41,3 @@ "typings": "lib/index.d.ts",

"peerDependencies": {
"koishi": "^4.9.1"
"koishi": "^4.9.3"
},

@@ -47,3 +47,3 @@ "devDependencies": {

"@types/js-yaml": "^4.0.5",
"koishi": "^4.9.1"
"koishi": "^4.9.3"
},

@@ -50,0 +50,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc