メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://docs.wyrly.dev/llms.txt

Use this file to discover all available pages before exploring further.

Wyrly は TypeScript の標準デコレーター向けに設計されています。 reflect-metadataemitDecoratorMetadata、parameter decorators は必要ありません。

推奨設定

TypeScript プロジェクトでは標準デコレーターを使います。
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "experimentalDecorators": false,
    "emitDecoratorMetadata": false,
    "strict": true
  }
}
正確な modulemoduleResolution の値は runtime や build tool によって変わりますが、 legacy decorator metadata を有効にすることは避けてください。

Deno

Deno 2.x をお使いの場合は JSR からインストールします。
deno add jsr:@wyrly/core
その後、@wyrly/core から import します。
import { createContainer, Injectable, token } from "@wyrly/core";

Node.js and Bun

Node.js と Bun をお使いの場合は npm からインストールします。
npm install @wyrly/core
可能な限り ESM を使います。
{
  "type": "module"
}

reflect-metadata の設定は不要

これは追加しないでください。
import "reflect-metadata";
Wyrly は実行時にパラメーターの型を読み取りません。依存関係はトークンと deps で明示的に宣言します。