自己写的插件不能打包

插件在本地源码执行都正常,试图用yarn build 打包上传出错 y
F:/workspace/project/dxcenter/my-nocobase/packages/core/database/lib/collection.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_NodeEventTarget’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
F:/workspace/project/dxcenter/my-nocobase/packages/core/database/lib/database.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘StaticEventEmitterOptions’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
F:/workspace/project/dxcenter/my-nocobase/packages/core/database/lib/database.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_DOMEventTarget’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
F:/workspace/project/dxcenter/my-nocobase/packages/core/database/lib/database.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_NodeEventTarget’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
F:/workspace/project/dxcenter/my-nocobase/packages/core/database/lib/fields/relation-field.js(1,1): error TS9005: Declaration emit for this file requires using private name ‘_RelationField.TargetModel’. An explicit type annotation may unblock declaration emit.
packages\plugins@silverwise\plugin-auth-mock\src\server\wechatAuth.ts(11,10): error TS2305: Module ‘“…/…/…/…/…/core/database/lib”’ has no exported member ‘Model’.
TypeScript: 1 semantic error
TypeScript: 17 declaration errors
TypeScript: -10 emit errors
TypeScript: emit succeeded (with errors)
(node:29308) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use node --trace-deprecation ... to show where the warning was created)
F:\workspace\project\dxcenter\my-nocobase\node_modules\gulp-typescript\release\output.js:131
this.streamFull.emit(‘error’, new Error(“TypeScript: Compilation failed”));
^

Error: TypeScript: Compilation failed
at Output.mightFinish (F:\workspace\project\dxcenter\my-nocobase\node_modules\gulp-typescript\release\output.js:131:43)
at F:\workspace\project\dxcenter\my-nocobase\node_modules\gulp-typescript\release\output.js:66:22
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted ‘error’ event on CompileStream instance at:
at F:\workspace\project\dxcenter\my-nocobase\node_modules\gulp-typescript\release\output.js:117:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v22.2.0
F:\workspace\project\dxcenter\my-nocobase\node_modules\execa\lib\error.js:60
error = new Error(message);
^

Error: Command failed with exit code 1: nocobase-build @silverwise/plugin-auth-mock
at makeError (F:\workspace\project\dxcenter\my-nocobase\node_modules\execa\lib\error.js:60:11)
at handlePromise (F:\workspace\project\dxcenter\my-nocobase\node_modules\execa\index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command. (F:\workspace\project\dxcenter\my-nocobase\packages\core\cli\src\commands\build.js:40:7) {
shortMessage: 'Command failed with exit code 1: nocobase-build @silverwise/plugin-auth-mock ',
command: 'nocobase-build @silverwise/plugin-auth-mock ',
escapedCommand: ‘nocobase-build “@silverwise/plugin-auth-mock” “” “” “” “”’,
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}

Node.js v22.2.0
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.

引用内核插件包应该通过包名引用,例如 @nocobase/database, 而不是相对路径

之前是1.7.1,在自定义auth模块是定义了let user: Model ,然后用userRepository访问用户库,做认证。在本地调式都可以,但build不行。后来修为为let user: AuthModel, git源码到1.7.14貌似可以build了,但还有一些问题