Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/production' into alpha
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/build.yml
#	docs/package.json
#	lerna.json
#	package.json
#	packages/core/package.json
#	packages/di/package.json
#	packages/di/src/common/decorators/lazyInject.ts
#	packages/engines/package.json
#	packages/graphql/apollo/package.json
#	packages/graphql/apollo/vitest.config.mts
#	packages/graphql/graphql-ws/package.json
#	packages/graphql/typegraphql/package.json
#	packages/graphql/typegraphql/vitest.config.mts
#	packages/orm/adapters-redis/package.json
#	packages/orm/adapters/package.json
#	packages/orm/adapters/src/adapters/FileSyncAdapter.ts
#	packages/orm/adapters/src/adapters/LowDbAdapter.ts
#	packages/orm/adapters/src/adapters/MemoryAdapter.ts
#	packages/orm/ioredis/package.json
#	packages/orm/mikro-orm/package.json
#	packages/orm/mikro-orm/test/integration.spec.ts
#	packages/orm/mikro-orm/tsconfig.json
#	packages/orm/mongoose/package.json
#	packages/orm/mongoose/test/array.integration.spec.ts
#	packages/orm/mongoose/test/buffer.integration.spec.ts
#	packages/orm/mongoose/test/circularRef.integration.spec.ts
#	packages/orm/mongoose/tsconfig.json
#	packages/orm/objection/package.json
#	packages/orm/prisma/package.json
#	packages/orm/testcontainers-mongo/package.json
#	packages/orm/testcontainers-mongo/src/services/TestContainersMongo.ts
#	packages/orm/testcontainers-mongo/tsconfig.json
#	packages/orm/testing-mongoose/package.json
#	packages/orm/typeorm/package.json
#	packages/perf/package.json
#	packages/platform/common/package.json
#	packages/platform/common/vitest.config.mts
#	packages/platform/platform-cache/package.json
#	packages/platform/platform-cache/vitest.config.mts
#	packages/platform/platform-exceptions/package.json
#	packages/platform/platform-exceptions/vitest.config.mts
#	packages/platform/platform-express/package.json
#	packages/platform/platform-koa/package.json
#	packages/platform/platform-log-middleware/package.json
#	packages/platform/platform-log-middleware/vitest.config.mts
#	packages/platform/platform-log-request/vitest.config.mts
#	packages/platform/platform-middlewares/package.json
#	packages/platform/platform-params/package.json
#	packages/platform/platform-params/vitest.config.mts
#	packages/platform/platform-response-filter/package.json
#	packages/platform/platform-response-filter/vitest.config.mts
#	packages/platform/platform-router/package.json
#	packages/platform/platform-router/vitest.config.mts
#	packages/platform/platform-serverless-http/package.json
#	packages/platform/platform-serverless-testing/package.json
#	packages/platform/platform-serverless/package.json
#	packages/platform/platform-serverless/vitest.config.mts
#	packages/platform/platform-test-sdk/package.json
#	packages/platform/platform-views/package.json
#	packages/platform/platform-views/vitest.config.mts
#	packages/security/jwks/package.json
#	packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json
#	packages/security/oidc-provider-plugin-wildcard-redirect-uri/vitest.config.mts
#	packages/security/oidc-provider/package.json
#	packages/security/oidc-provider/src/services/OidcInteractionContext.ts
#	packages/security/oidc-provider/vitest.config.mts
#	packages/security/passport/package.json
#	packages/security/passport/vitest.config.mts
#	packages/specs/ajv/package.json
#	packages/specs/exceptions/package.json
#	packages/specs/json-mapper/package.json
#	packages/specs/openspec/package.json
#	packages/specs/schema/package.json
#	packages/specs/swagger/package.json
#	packages/third-parties/agenda/package.json
#	packages/third-parties/agenda/vitest.config.mts
#	packages/third-parties/bullmq/package.json
#	packages/third-parties/bullmq/vitest.config.mts
#	packages/third-parties/components-scan/package.json
#	packages/third-parties/event-emitter/package.json
#	packages/third-parties/event-emitter/vitest.config.mts
#	packages/third-parties/formio-types/package.json
#	packages/third-parties/formio/package.json
#	packages/third-parties/formio/vitest.config.mts
#	packages/third-parties/pulse/package.json
#	packages/third-parties/pulse/vitest.config.mts
#	packages/third-parties/schema-formio/package.json
#	packages/third-parties/socketio-testing/package.json
#	packages/third-parties/socketio/package.json
#	packages/third-parties/socketio/vitest.config.mts
#	packages/third-parties/sse/package.json
#	packages/third-parties/sse/vitest.config.mts
#	packages/third-parties/stripe/package.json
#	packages/third-parties/stripe/vitest.config.mts
#	packages/third-parties/temporal/package.json
#	packages/third-parties/temporal/vitest.config.mts
#	packages/third-parties/terminus/package.json
#	packages/third-parties/terminus/vitest.config.mts
#	packages/third-parties/vike/package.json
#	packages/third-parties/vike/vitest.config.mts
#	packages/third-parties/vite-ssr-plugin/package.json
#	packages/utils/normalize-path/package.json
#	tools/barrels/package.json
#	tools/github-sponsors/package.json
#	tools/integration/package.json
#	tools/typescript/package.json
#	tools/vitest/package.json
#	tools/webpack/package.json
#	yarn.lock
  • Loading branch information
Romakita committed Oct 6, 2024
2 parents 9417b39 + 6d5cae8 commit 086f3ba
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 34 deletions.
4 changes: 2 additions & 2 deletions docs/getting-started/migrate-from-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can get the latest version of Ts.ED using the following npm command:

```bash
$ yarn add -D typescript @types/express
$ yarn add -D express@4 @tsed/core @tsed/di @tsed/common @tsed/schema @tsed/json-mapper @tsed/exceptions @tsed/platform-express
$ yarn add express@4 @tsed/core @tsed/di @tsed/common @tsed/schema @tsed/json-mapper @tsed/exceptions @tsed/platform-express
```

</Tab>
Expand All @@ -30,7 +30,7 @@ $ yarn add -D express@4 @tsed/core @tsed/di @tsed/common @tsed/schema @tsed/json
$ npm install --save-dev typescript @types/express
$ npm install --save express@4 @tsed/core @tsed/di @tsed/common @tsed/schema @tsed/json-mapper @tsed/exceptions @tsed/platform-express
```

</Tab>
</Tabs>

Expand Down
24 changes: 24 additions & 0 deletions packages/di/src/common/decorators/lazyInject.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,28 @@ describe("LazyInject", () => {

expect(lazyService).toEqual({});
});

it("should not return undefined if the package is imported but the bean has not been assigned yet", async () => {
@Injectable()
class MyInjectable {
@LazyInject("MyLazyModule", () => import("./__mock__/lazy.import.module.js"))
lazy: Promise<MyLazyModule>;
}

const injector = new InjectorService();
const service = await injector.invoke<MyInjectable>(MyInjectable);
const originalLazyInvoke = injector.lazyInvoke.bind(injector);
const promise1 = service.lazy;
let promise2: Promise<MyLazyModule> | undefined;

vi.spyOn(injector, "lazyInvoke").mockImplementationOnce((token) => {
promise2 = service.lazy;
return originalLazyInvoke(token);
});

const lazyService1 = await promise1;
const lazyService2 = await promise2;
expect(lazyService1).not.toBeUndefined();
expect(lazyService2).not.toBeUndefined();
});
});
2 changes: 1 addition & 1 deletion packages/di/src/common/decorators/lazyInject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function LazyInject(
catchError(() => Reflect.deleteProperty(target, propertyKey));
Reflect.defineProperty(target, propertyKey, {
async get() {
if (!token) {
if (!token || !bean) {
const injector = InjectorService.getInstance();
const exports = await importPackage(packageName, resolver, optional);
token = exports[key];
Expand Down
10 changes: 5 additions & 5 deletions packages/platform/platform-middlewares/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default defineConfig(
coverage: {
...presets.test.coverage,
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
statements: 0,
branches: 0,
functions: 0,
lines: 0
}
}
}
}
);
);
2 changes: 1 addition & 1 deletion packages/platform/platform-params/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig(
...presets.test.coverage,
thresholds: {
statements: 99.2,
branches: 90.62,
branches: 90.55,
functions: 100,
lines: 99.2
}
Expand Down
10 changes: 5 additions & 5 deletions packages/platform/platform-serverless-http/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default defineConfig(
coverage: {
...presets.test.coverage,
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
statements: 0,
branches: 0,
functions: 0,
lines: 0
}
}
}
}
);
);
10 changes: 5 additions & 5 deletions packages/security/jwks/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default defineConfig(
coverage: {
...presets.test.coverage,
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
statements: 0,
branches: 0,
functions: 0,
lines: 0
}
}
}
}
);
);
10 changes: 5 additions & 5 deletions packages/third-parties/components-scan/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default defineConfig(
coverage: {
...presets.test.coverage,
thresholds: {
statements: 97.77,
branches: 88.46,
functions: 100,
lines: 97.77
statements: 0,
branches: 0,
functions: 0,
lines: 0
}
}
}
}
);
);
10 changes: 5 additions & 5 deletions packages/third-parties/schema-formio/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default defineConfig(
coverage: {
...presets.test.coverage,
thresholds: {
statements: 99.62,
branches: 98.71,
functions: 100,
lines: 99.62
statements: 0,
branches: 0,
functions: 0,
lines: 0
}
}
}
}
);
);
10 changes: 5 additions & 5 deletions packages/utils/normalize-path/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default defineConfig(
coverage: {
...presets.test.coverage,
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
statements: 0,
branches: 0,
functions: 0,
lines: 0
}
}
}
}
);
);

0 comments on commit 086f3ba

Please sign in to comment.