silgi 0.8.52 → 0.8.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const version = "0.8.52";
1
+ const version = "0.8.54";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -1061,6 +1061,13 @@ async function _resolveSilgiModule(mod, silgi) {
1061
1061
  if (silgi.scanModules.some((m) => m.meta?.configKey === buildTimeModuleMeta.configKey)) {
1062
1062
  throw new Error(`Module with key \`${buildTimeModuleMeta.configKey}\` already exists`);
1063
1063
  }
1064
+ const options = await mod.getOptions?.() || {};
1065
+ if (options) {
1066
+ silgi.options._c12.config[buildTimeModuleMeta.configKey] = {
1067
+ ...silgi.options._c12.config[buildTimeModuleMeta.configKey],
1068
+ ...options
1069
+ };
1070
+ }
1064
1071
  silgi.scanModules.push({
1065
1072
  meta: buildTimeModuleMeta,
1066
1073
  entryPath: _url,
@@ -241,7 +241,7 @@ ${this.stack}`;
241
241
  };
242
242
  }
243
243
  static isError(error) {
244
- return error instanceof SilgiError;
244
+ return error instanceof SilgiError || typeof error === "object" && error !== null && "name" in error && error.name === "SilgiError";
245
245
  }
246
246
  static from(error) {
247
247
  if (error instanceof SilgiError) {
@@ -1,4 +1,4 @@
1
- const version = "0.8.52";
1
+ const version = "0.8.54";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -1,4 +1,4 @@
1
- const version = "0.8.52";
1
+ const version = "0.8.54";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -446,6 +446,7 @@ interface ModuleMeta {
446
446
  as?: string;
447
447
  from?: string;
448
448
  type?: boolean;
449
+ options?: Record<string, any>;
449
450
  }[];
450
451
  /** Module version. */
451
452
  version?: string;
@@ -446,6 +446,7 @@ interface ModuleMeta {
446
446
  as?: string;
447
447
  from?: string;
448
448
  type?: boolean;
449
+ options?: Record<string, any>;
449
450
  }[];
450
451
  /** Module version. */
451
452
  version?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.8.52",
4
+ "version": "0.8.54",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {