@kne/fastify-task 3.0.0-alpha.11 → 3.0.0-alpha.12

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.
@@ -212,7 +212,17 @@ const createContext = (fastify, options) => {
212
212
  const getTaskDeclaration = type => {
213
213
  const declaration = resolveTaskDeclaration(type);
214
214
  if (!declaration) {
215
- throw new Error('未找到合法的任务声明');
215
+ const { taskName } = splitTaskName(type);
216
+ return registerTaskDeclaration({
217
+ namespace: mainNamespace,
218
+ taskName,
219
+ dirs: options.dirs,
220
+ scriptName: options.scriptName,
221
+ config: {},
222
+ override: false,
223
+ syncLegacyTask: false,
224
+ useGlobalDirs: true
225
+ }).declaration;
216
226
  }
217
227
  return declaration;
218
228
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-task",
3
- "version": "3.0.0-alpha.11",
3
+ "version": "3.0.0-alpha.12",
4
4
  "description": "一个 Fastify 插件,用于任务编排、追踪任务执行状态和结果。支持系统自动执行和手动执行两种模式,提供完整的任务生命周期管理",
5
5
  "main": "index.js",
6
6
  "scripts": {