Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Nov 26, 2024
1 parent 7553583 commit 25cddb7
Show file tree
Hide file tree
Showing 42 changed files with 1,747 additions and 1,814 deletions.
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "5.6.3-sdk",
"version": "5.7.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs",
"bin": {
Expand Down
16 changes: 8 additions & 8 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins:
- ./packages/yarn-plugin-ts-project-linker/bundles/@yarnpkg/plugin-ts-project-linker.js

packageExtensions:
"vite@*":
debug@*:
dependencies:
supports-color: "*"
vite@*:
dependencies:
bufferutil: "*"
"vitest@*":
supports-color: "*"
vitest@*:
dependencies:
"@types/chai": "*"
"debug@*":
dependencies:
supports-color: "*"

plugins:
- ./packages/yarn-plugin-ts-project-linker/bundles/@yarnpkg/plugin-ts-project-linker.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "foundation",
"private": true,
"version": "0.0.1",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"type": "module",
"license": "MIT",
"author": "Wroud",
Expand Down
4 changes: 2 additions & 2 deletions packages/@wroud/ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@wroud/ci",
"private": true,
"type": "module",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"bin": "./lib/cli.js",
"scripts": {
"test": "tests-runner",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@types/yargs": "^17",
"@vitest/coverage-v8": "^2",
"@wroud/tsconfig": "workspace:*",
"concurrently": "^8",
"concurrently": "^9",
"rimraf": "^6",
"typescript": "^5",
"vitest": "^2"
Expand Down
4 changes: 2 additions & 2 deletions packages/@wroud/conventional-commits-bump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A utility for determining version bump types (major, minor, patch) based on conventional commit messages, facilitating semantic versioning in your projects.",
"version": "0.1.1",
"type": "module",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"bin": "./lib/cli.js",
"exports": {
".": "./lib/index.js"
Expand Down Expand Up @@ -43,7 +43,7 @@
"@wroud/ci": "workspace:*",
"@wroud/tests-runner": "workspace:*",
"@wroud/tsconfig": "workspace:*",
"concurrently": "^8",
"concurrently": "^9",
"rimraf": "^6",
"typescript": "^5",
"vitest": "^2"
Expand Down
4 changes: 2 additions & 2 deletions packages/@wroud/conventional-commits-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A TypeScript library for generating markdown changelogs from conventional commit messages, providing a structured and consistent format for documenting project updates.",
"version": "0.1.1",
"type": "module",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"exports": {
".": "./lib/index.js"
},
Expand Down Expand Up @@ -42,7 +42,7 @@
"@wroud/ci": "workspace:*",
"@wroud/tests-runner": "workspace:*",
"@wroud/tsconfig": "workspace:*",
"concurrently": "^8",
"concurrently": "^9",
"rimraf": "^6",
"typescript": "^5",
"vitest": "^2"
Expand Down
4 changes: 2 additions & 2 deletions packages/@wroud/conventional-commits-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A lightweight parser for conventional commits that supports extracting commit metadata, generating commit messages, and managing commit trailers in TypeScript.",
"version": "0.1.1",
"type": "module",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"exports": {
".": "./lib/index.js"
},
Expand Down Expand Up @@ -42,7 +42,7 @@
"@wroud/ci": "workspace:*",
"@wroud/tests-runner": "workspace:*",
"@wroud/tsconfig": "workspace:*",
"concurrently": "^8",
"concurrently": "^9",
"rimraf": "^6",
"typescript": "^5",
"vitest": "^2"
Expand Down
4 changes: 2 additions & 2 deletions packages/@wroud/di-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@wroud/di-react",
"description": "A simple and lightweight dependency injection library for React",
"version": "0.4.0",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"type": "module",
"license": "MIT",
"author": "Wroud",
Expand Down Expand Up @@ -63,7 +63,7 @@
"@wroud/ci": "workspace:*",
"@wroud/tests-runner": "workspace:*",
"@wroud/tsconfig": "workspace:*",
"concurrently": "^8",
"concurrently": "^9",
"happy-dom": "^15",
"react": "^18",
"react-dom": "^18",
Expand Down
6 changes: 3 additions & 3 deletions packages/@wroud/di-tools-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@wroud/di-tools-analyzer",
"description": "DI Tools Analyzer is a tool that helps you to analyze the dependency injection tools in your project and generate a report for them.",
"version": "0.5.0",
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"type": "module",
"license": "MIT",
"author": "Wroud",
Expand Down Expand Up @@ -49,7 +49,7 @@
"@dagrejs/dagre": "^1",
"@wroud/di": "workspace:^0",
"d3": "^7",
"uuid": "^10"
"uuid": "^11"
},
"devDependencies": {
"@types/d3": "^7",
Expand All @@ -59,7 +59,7 @@
"@wroud/ci": "workspace:*",
"@wroud/tests-runner": "workspace:*",
"@wroud/tsconfig": "workspace:*",
"concurrently": "^8",
"concurrently": "^9",
"rimraf": "^6",
"tslib": "^2",
"typescript": "^5",
Expand Down
2 changes: 1 addition & 1 deletion packages/@wroud/di-tools-benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"!lib/tests",
"!.tsbuildinfo"
],
"packageManager": "yarn@4.5.0",
"packageManager": "yarn@4.5.3",
"devDependencies": {
"@wroud/tsconfig": "workspace:^",
"rimraf": "^6",
Expand Down
17 changes: 17 additions & 0 deletions packages/@wroud/di-tools-benchmark/src/@wroud/deep_500.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { bench } from "vitest";
import { ServiceContainerBuilder } from "@wroud/di";
import { createDeepServices } from "./tests/createDeepServices.js";

const { lastService, services } = createDeepServices(500);

const builder = new ServiceContainerBuilder();

for (const { service, impl } of services) {
builder.addTransient(service, impl);
}

const serviceProvider = builder.build();

bench("[@wroud/di]", () => {
serviceProvider.getService(lastService);
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export function createDeepServices(deep: number): {

//@ts-ignore
@injectable(lastService ? () => [single(lastService)] : undefined)
class impl {
constructor(service: any) {}
}
class impl {}

lastService = service;
services.push({ service, impl });
Expand Down
67 changes: 36 additions & 31 deletions packages/@wroud/di-tools-benchmark/src/benchmark/di.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,64 @@
import { describe } from "vitest";

describe("create + register + get", async () => {
await import("@wroud/di-tools-benchmark/@wroud/createRegisterGet");
await import("@wroud/di-tools-benchmark/tsyringe/createRegisterGet");
await import("@wroud/di-tools-benchmark/brandi/createRegisterGet");
await import("@wroud/di-tools-benchmark/inversify/createRegisterGet");
await import("@wroud/di-tools-benchmark/modern/@wroud/createRegisterGet");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/createRegisterGet");
await import("@wroud/di-tools-benchmark/modern/brandi/createRegisterGet");
await import("@wroud/di-tools-benchmark/legacy/inversify/createRegisterGet");
});

describe("get singleton", async () => {
await import("@wroud/di-tools-benchmark/@wroud/get_singleton");
await import("@wroud/di-tools-benchmark/tsyringe/get_singleton");
await import("@wroud/di-tools-benchmark/brandi/get_singleton");
await import("@wroud/di-tools-benchmark/inversify/get_singleton");
await import("@wroud/di-tools-benchmark/modern/@wroud/get_singleton");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/get_singleton");
await import("@wroud/di-tools-benchmark/modern/brandi/get_singleton");
await import("@wroud/di-tools-benchmark/legacy/inversify/get_singleton");
});

describe("get scoped", async () => {
await import("@wroud/di-tools-benchmark/@wroud/get_scoped");
await import("@wroud/di-tools-benchmark/tsyringe/get_scoped");
await import("@wroud/di-tools-benchmark/brandi/get_scoped");
await import("@wroud/di-tools-benchmark/modern/@wroud/get_scoped");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/get_scoped");
await import("@wroud/di-tools-benchmark/modern/brandi/get_scoped");
});

describe("get transient", async () => {
await import("@wroud/di-tools-benchmark/@wroud/get_transient");
await import("@wroud/di-tools-benchmark/tsyringe/get_transient");
await import("@wroud/di-tools-benchmark/brandi/get_transient");
await import("@wroud/di-tools-benchmark/inversify/get_transient");
await import("@wroud/di-tools-benchmark/modern/@wroud/get_transient");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/get_transient");
await import("@wroud/di-tools-benchmark/modern/brandi/get_transient");
await import("@wroud/di-tools-benchmark/legacy/inversify/get_transient");
});

describe("get flat N=10", async () => {
await import("@wroud/di-tools-benchmark/@wroud/flat_10");
await import("@wroud/di-tools-benchmark/tsyringe/flat_10");
await import("@wroud/di-tools-benchmark/inversify/flat_10");
await import("@wroud/di-tools-benchmark/modern/@wroud/flat_10");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/flat_10");
await import("@wroud/di-tools-benchmark/legacy/inversify/flat_10");
});

describe("get deep N=10", async () => {
await import("@wroud/di-tools-benchmark/@wroud/deep_10");
await import("@wroud/di-tools-benchmark/tsyringe/deep_10");
await import("@wroud/di-tools-benchmark/inversify/deep_10");
await import("@wroud/di-tools-benchmark/modern/@wroud/deep_10");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/deep_10");
await import("@wroud/di-tools-benchmark/legacy/inversify/deep_10");
});

describe("get deep N=100", async () => {
await import("@wroud/di-tools-benchmark/@wroud/deep_100");
await import("@wroud/di-tools-benchmark/tsyringe/deep_100");
await import("@wroud/di-tools-benchmark/inversify/deep_100");
await import("@wroud/di-tools-benchmark/modern/@wroud/deep_100");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/deep_100");
await import("@wroud/di-tools-benchmark/legacy/inversify/deep_100");
});

describe("get deep N=500", async () => {
await import("@wroud/di-tools-benchmark/modern/@wroud/deep_500");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/deep_500");
});

describe("register", async () => {
await import("@wroud/di-tools-benchmark/@wroud/register");
await import("@wroud/di-tools-benchmark/tsyringe/register");
await import("@wroud/di-tools-benchmark/brandi/register");
await import("@wroud/di-tools-benchmark/inversify/register");
await import("@wroud/di-tools-benchmark/modern/@wroud/register");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/register");
await import("@wroud/di-tools-benchmark/modern/brandi/register");
await import("@wroud/di-tools-benchmark/legacy/inversify/register");
});

describe("register N=1000", async () => {
await import("@wroud/di-tools-benchmark/@wroud/register_1000");
await import("@wroud/di-tools-benchmark/tsyringe/register_1000");
await import("@wroud/di-tools-benchmark/inversify/register_1000");
await import("@wroud/di-tools-benchmark/modern/@wroud/register_1000");
await import("@wroud/di-tools-benchmark/legacy/tsyringe/register_1000");
await import("@wroud/di-tools-benchmark/legacy/inversify/register_1000");
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject, injectable } from "inversify";
import { decorate, inject, injectable } from "inversify";

interface IServicePair {
service: symbol;
Expand All @@ -15,18 +15,11 @@ export function createDeepServices(deep: number): {

for (let i = 0; i < deep; i++) {
const service = Symbol(`service${i}`);
let impl;
if (!lastService) {
@injectable()
class implementation {}
impl = implementation;
} else {
@injectable()
class implementation {
// @ts-ignore
@inject(lastService) private service: any;
}
impl = implementation;
class impl {}

decorate(injectable(), impl);
if (lastService) {
decorate(inject(lastService), impl, 0);
}

lastService = service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
createServicesTree,
type IServicePair,
} from "@wroud/di-tools-benchmark/tools/createServicesTree";
} from "@wroud/di-tools-benchmark/modern/tools/createServicesTree";
import { decorate, injectable, inject } from "inversify";

export type ServicePair = IServicePair<symbol, new (...args: any[]) => any>;
Expand Down
18 changes: 18 additions & 0 deletions packages/@wroud/di-tools-benchmark/src/tsyringe/deep_500.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { bench } from "vitest";
import "reflect-metadata";
import { container, Lifecycle } from "tsyringe";
import { createDeepServices } from "./tests/createDeepServices.js";

const { lastService, services } = createDeepServices(500);

for (const { service, impl } of services) {
container.register(
service,
{ useClass: impl },
{ lifecycle: Lifecycle.Transient },
);
}

bench("[tsyringe]", () => {
container.resolve(lastService);
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@ export function createDeepServices(deep: number): {

for (let i = 0; i < deep; i++) {
const service = Symbol(`service${i}`);
let impl;
if (!lastService) {
@injectable()
class implementation {}
impl = implementation;
} else {
@injectable()
class implementation {
// @ts-ignore
constructor(@inject(lastService) public service: any) {}
}
impl = implementation;

class impl {}

if (lastService) {
inject(lastService)(impl, undefined, 0);
}
injectable()(impl);

lastService = service;
services.push({ service, impl });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
createServicesTree,
type IServicePair,
} from "@wroud/di-tools-benchmark/tools/createServicesTree";
} from "@wroud/di-tools-benchmark/modern/tools/createServicesTree";
import { inject, injectable } from "tsyringe";

export type ServicePair = IServicePair<symbol, new (...args: any[]) => any>;
Expand Down
4 changes: 2 additions & 2 deletions packages/@wroud/di-tools-benchmark/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"extends": "@wroud/tsconfig/tsconfig.json",
"compilerOptions": {
"tsBuildInfoFile": "./lib/.tsbuildinfo",
"tsBuildInfoFile": "./lib/benchmark/.tsbuildinfo",
"rootDir": "src",
"rootDirs": [
"src"
],
"outDir": "lib",
"outDir": "lib/benchmark",
"incremental": true,
"composite": true
},
Expand Down
Loading

0 comments on commit 25cddb7

Please sign in to comment.