Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ plugin/tegg/test/fixtures/apps/**/*.js
!plugin/config/test/fixtures/**/node_modules
.node
.egg
fixtures/tmp/
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)


### Bug Fixes

* repo dir ([2e7351b](https://github.com/eggjs/tegg/commit/2e7351bc62161b203f7a98a978d9a901165fb516))


### Features

* module plugin ([#325](https://github.com/eggjs/tegg/issues/325)) ([d10bcb6](https://github.com/eggjs/tegg/commit/d10bcb611dbc499ae86558828f91bae3f7266766))





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package tegg
Expand Down
8 changes: 8 additions & 0 deletions core/ajv-decorator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)

**Note:** Version bump only for package @eggjs/ajv-decorator





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/ajv-decorator
Expand Down
2 changes: 1 addition & 1 deletion core/ajv-decorator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eggjs/ajv-decorator",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"description": "tegg ajv decorator",
"keywords": [
"egg",
Expand Down
8 changes: 8 additions & 0 deletions core/aop-decorator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)

**Note:** Version bump only for package @eggjs/aop-decorator





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/aop-decorator
Expand Down
10 changes: 5 additions & 5 deletions core/aop-decorator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eggjs/aop-decorator",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"description": "tegg aop decorator",
"keywords": [
"tegg",
Expand All @@ -16,10 +16,10 @@
"directory": "core/aop-decorator"
},
"dependencies": {
"@eggjs/core-decorator": "^3.57.14",
"@eggjs/tegg-common-util": "^3.57.14",
"@eggjs/tegg-metadata": "^3.57.14",
"@eggjs/tegg-types": "^3.57.14"
"@eggjs/core-decorator": "^3.57.15-alpha.0",
"@eggjs/tegg-common-util": "^3.57.15-alpha.0",
"@eggjs/tegg-metadata": "^3.57.15-alpha.0",
"@eggjs/tegg-types": "^3.57.15-alpha.0"
},
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
Expand Down
11 changes: 11 additions & 0 deletions core/aop-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)


### Features

* module plugin ([#325](https://github.com/eggjs/tegg/issues/325)) ([d10bcb6](https://github.com/eggjs/tegg/commit/d10bcb611dbc499ae86558828f91bae3f7266766))





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/tegg-aop-runtime
Expand Down
20 changes: 10 additions & 10 deletions core/aop-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eggjs/tegg-aop-runtime",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"description": "tegg aop",
"main": "dist/index.js",
"eggModule": {
Expand Down Expand Up @@ -43,18 +43,18 @@
"access": "public"
},
"dependencies": {
"@eggjs/aop-decorator": "^3.57.14",
"@eggjs/core-decorator": "^3.57.14",
"@eggjs/tegg-common-util": "^3.57.14",
"@eggjs/tegg-lifecycle": "^3.57.14",
"@eggjs/tegg-metadata": "^3.57.14",
"@eggjs/tegg-runtime": "^3.57.14",
"@eggjs/tegg-types": "^3.57.14",
"@eggjs/aop-decorator": "^3.57.15-alpha.0",
"@eggjs/core-decorator": "^3.57.15-alpha.0",
"@eggjs/tegg-common-util": "^3.57.15-alpha.0",
"@eggjs/tegg-lifecycle": "^3.57.15-alpha.0",
"@eggjs/tegg-metadata": "^3.57.15-alpha.0",
"@eggjs/tegg-runtime": "^3.57.15-alpha.0",
"@eggjs/tegg-types": "^3.57.15-alpha.0",
"koa-compose": "^4.1.0"
},
"devDependencies": {
"@eggjs/module-test-util": "^3.57.14",
"@eggjs/tegg-loader": "^3.57.14",
"@eggjs/module-test-util": "^3.57.15-alpha.0",
"@eggjs/tegg-loader": "^3.57.15-alpha.0",
"@types/mocha": "^10.0.1",
"@types/node": "^20.2.4",
"cross-env": "^7.0.3",
Expand Down
1 change: 1 addition & 0 deletions core/aop-runtime/src/LoadUnitAopHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class LoadUnitAopHook implements LifecycleHook<LoadUnitLifecycleContext,
}

async postCreate(_: LoadUnitLifecycleContext, loadUnit: LoadUnit): Promise<void> {

for (const proto of loadUnit.iterateEggPrototype()) {
const protoWithClazz = proto as EggPrototypeWithClazz;
const clazz = protoWithClazz.clazz;
Expand Down
8 changes: 8 additions & 0 deletions core/background-task/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)

**Note:** Version bump only for package @eggjs/tegg-background-task





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/tegg-background-task
Expand Down
12 changes: 6 additions & 6 deletions core/background-task/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@eggjs/tegg-background-task",
"description": "background util for tegg",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"keywords": [
"egg",
"typescript",
Expand Down Expand Up @@ -37,13 +37,13 @@
"author": "killagu <killa123@126.com>",
"license": "MIT",
"dependencies": {
"@eggjs/core-decorator": "^3.57.14",
"@eggjs/tegg-lifecycle": "^3.57.14",
"@eggjs/tegg-runtime": "^3.57.14",
"@eggjs/tegg-types": "^3.57.14"
"@eggjs/core-decorator": "^3.57.15-alpha.0",
"@eggjs/tegg-lifecycle": "^3.57.15-alpha.0",
"@eggjs/tegg-runtime": "^3.57.15-alpha.0",
"@eggjs/tegg-types": "^3.57.15-alpha.0"
},
"devDependencies": {
"@eggjs/tegg-common-util": "^3.57.14",
"@eggjs/tegg-common-util": "^3.57.15-alpha.0",
"@types/mocha": "^10.0.1",
"@types/node": "^20.2.4",
"cross-env": "^7.0.3",
Expand Down
8 changes: 8 additions & 0 deletions core/common-util/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)

**Note:** Version bump only for package @eggjs/tegg-common-util





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/tegg-common-util
Expand Down
4 changes: 2 additions & 2 deletions core/common-util/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@eggjs/tegg-common-util",
"description": "common util for tegg",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"keywords": [
"egg",
"typescript",
Expand Down Expand Up @@ -36,7 +36,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@eggjs/tegg-types": "^3.57.14",
"@eggjs/tegg-types": "^3.57.15-alpha.0",
"extend2": "^1.0.0",
"globby": "^11.1.0",
"js-yaml": "^3.14.0"
Expand Down
8 changes: 8 additions & 0 deletions core/controller-decorator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)

**Note:** Version bump only for package @eggjs/controller-decorator





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/controller-decorator
Expand Down
12 changes: 6 additions & 6 deletions core/controller-decorator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eggjs/controller-decorator",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"description": "tegg controller decorator",
"keywords": [
"egg",
Expand Down Expand Up @@ -37,12 +37,12 @@
"node": ">=14.0.0"
},
"dependencies": {
"@eggjs/aop-decorator": "^3.57.14",
"@eggjs/aop-decorator": "^3.57.15-alpha.0",
"@eggjs/cookies": "^3.0.1",
"@eggjs/core-decorator": "^3.57.14",
"@eggjs/tegg-common-util": "^3.57.14",
"@eggjs/tegg-metadata": "^3.57.14",
"@eggjs/tegg-types": "^3.57.14",
"@eggjs/core-decorator": "^3.57.15-alpha.0",
"@eggjs/tegg-common-util": "^3.57.15-alpha.0",
"@eggjs/tegg-metadata": "^3.57.15-alpha.0",
"@eggjs/tegg-types": "^3.57.15-alpha.0",
"@modelcontextprotocol/sdk": "^1.10.0",
"is-type-of": "^1.2.1",
"path-to-regexp": "^1.8.0",
Expand Down
11 changes: 11 additions & 0 deletions core/core-decorator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.57.15-alpha.0](https://github.com/eggjs/tegg/compare/v3.57.14...v3.57.15-alpha.0) (2025-06-27)


### Features

* module plugin ([#325](https://github.com/eggjs/tegg/issues/325)) ([d10bcb6](https://github.com/eggjs/tegg/commit/d10bcb611dbc499ae86558828f91bae3f7266766))





## [3.57.14](https://github.com/eggjs/tegg/compare/v3.57.13...v3.57.14) (2025-06-18)

**Note:** Version bump only for package @eggjs/core-decorator
Expand Down
2 changes: 2 additions & 0 deletions core/core-decorator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export * from './src/decorator/EggQualifier';
export * from './src/decorator/MultiInstanceProto';
export * from './src/decorator/MultiInstanceInfo';
export * from './src/decorator/ConfigSource';
export * from './src/decorator/EggLifecycleProto';
export * from './src/decorator/InnerObjectProto';

export * from './src/util/MetadataUtil';
export * from './src/util/PrototypeUtil';
Expand Down
6 changes: 3 additions & 3 deletions core/core-decorator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eggjs/core-decorator",
"version": "3.57.14",
"version": "3.57.15-alpha.0",
"description": "tegg core decorator",
"keywords": [
"egg",
Expand Down Expand Up @@ -36,8 +36,8 @@
"node": ">=14.0.0"
},
"dependencies": {
"@eggjs/tegg-common-util": "^3.57.14",
"@eggjs/tegg-types": "^3.57.14",
"@eggjs/tegg-common-util": "^3.57.15-alpha.0",
"@eggjs/tegg-types": "^3.57.15-alpha.0",
"reflect-metadata": "^0.1.13"
},
"publishConfig": {
Expand Down
26 changes: 26 additions & 0 deletions core/core-decorator/src/decorator/EggLifecycleProto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import assert from 'node:assert';
import type { CommonEggLifecycleProtoParams, EggLifecycleProtoParams, EggProtoImplClass } from '@eggjs/tegg-types';
import { PrototypeUtil } from '../util/PrototypeUtil';
import { InnerObjectProto } from './InnerObjectProto';

export function EggLifecycleProto(params: CommonEggLifecycleProtoParams) {
return function(clazz: EggProtoImplClass) {
const { type, ...protoParams } = params || {};
assert(type, 'EggLifecycle decorator should have type property');

InnerObjectProto(protoParams)(clazz);

PrototypeUtil.setIsEggLifecyclePrototype(clazz);
PrototypeUtil.setEggLifecyclePrototypeMetadata(clazz, { type });
};
}

const createLifecycleProto = (type: CommonEggLifecycleProtoParams['type']) => {
return (params?: EggLifecycleProtoParams) => EggLifecycleProto({ type, ...params });
};

export const LoadUnitLifecycleProto = createLifecycleProto('LoadUnit');
export const LoadUnitInstanceLifecycleProto = createLifecycleProto('LoadUnitInstance');
export const EggObjectLifecycleProto = createLifecycleProto('EggObject');
export const EggPrototypeLifecycleProto = createLifecycleProto('EggPrototype');
export const EggContextLifecycleProto = createLifecycleProto('EggContext');
14 changes: 14 additions & 0 deletions core/core-decorator/src/decorator/InnerObjectProto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { EGG_INNER_OBJECT_PROTO_IMPL_TYPE, EggProtoImplClass, InnerObjectProtoParams } from '@eggjs/tegg-types';
import { PrototypeUtil } from '../util/PrototypeUtil';
import { SingletonProto } from './SingletonProto';

export function InnerObjectProto(params?: InnerObjectProtoParams) {
return function(clazz: EggProtoImplClass) {
const protoParams = {
protoImplType: EGG_INNER_OBJECT_PROTO_IMPL_TYPE,
...params,
};
SingletonProto(protoParams)(clazz);
PrototypeUtil.setIsEggInnerObject(clazz);
};
}
Loading
Loading