Skip to content

Commit 4c2df3f

Browse files
committed
docs: simplify project structure (remove sig/, types/ folders)
RBS files are now output to build/ directory by default alongside .rb files. Removed types/ folder and Type Resolution section as custom .rbs definitions are not supported. rbs_dir option remains available for separating output.
1 parent d440b71 commit 4c2df3f

File tree

3 files changed

+30
-120
lines changed

3 files changed

+30
-120
lines changed

docs/getting-started/project-configuration.md

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ source:
3434

3535
# Output configuration
3636
output:
37-
# Where to write compiled .rb files
37+
# Where to write compiled .rb and .rbs files
3838
ruby_dir: build
39-
# Where to write .rbs signature files
40-
rbs_dir: sig
4139
# Preserve source directory structure
4240
preserve_structure: true
4341

@@ -96,15 +94,15 @@ source:
9694

9795
```yaml
9896
output:
99-
# Directory for compiled Ruby files
97+
# Directory for compiled .rb and .rbs files
10098
ruby_dir: build
10199
102-
# Directory for RBS signature files
103-
rbs_dir: sig
100+
# Separate directory for RBS files (optional, defaults to ruby_dir)
101+
# rbs_dir: sig
104102
105103
# Preserve source directory structure in output
106-
# true: src/models/user.trb → build/models/user.rb
107-
# false: src/models/user.trb → build/user.rb
104+
# true: src/models/user.trb → build/models/user.rb + build/models/user.rbs
105+
# false: src/models/user.trb → build/user.rb + build/user.rbs
108106
preserve_structure: true
109107
110108
# Clean output directory before compilation
@@ -160,48 +158,25 @@ watch:
160158
on_success: "bundle exec rspec"
161159
```
162160

163-
### Type Resolution
164-
165-
```yaml
166-
types:
167-
# Additional type definition paths
168-
paths:
169-
- types
170-
- vendor/types
171-
172-
# Auto-import standard library types
173-
stdlib: true
174-
175-
# External type definitions
176-
external:
177-
- rails
178-
- rspec
179-
```
180-
181161
## Directory Structure
182162

183163
A typical T-Ruby project structure:
184164

185165
```
186166
my-project/
187-
├── trbconfig.yml # Configuration
188-
├── src/ # T-Ruby source files
167+
├── trbconfig.yml # Configuration
168+
├── src/ # T-Ruby source files (.trb)
189169
│ ├── models/
190170
│ │ ├── user.trb
191171
│ │ └── post.trb
192172
│ ├── services/
193173
│ │ └── auth_service.trb
194174
│ └── main.trb
195-
├── types/ # Custom type definitions
196-
│ └── external.rbs
197-
├── build/ # Compiled Ruby output
175+
├── build/ # Compiled output (.rb + .rbs)
198176
│ ├── models/
199177
│ │ ├── user.rb
200-
│ │ └── post.rb
201-
│ └── ...
202-
├── sig/ # Generated RBS files
203-
│ ├── models/
204178
│ │ ├── user.rbs
179+
│ │ ├── post.rb
205180
│ │ └── post.rbs
206181
│ └── ...
207182
└── test/ # Tests (can be .rb or .trb)
@@ -284,11 +259,6 @@ output:
284259
285260
compiler:
286261
strictness: standard
287-
288-
types:
289-
external:
290-
- rails
291-
- activerecord
292262
```
293263

294264
Add to your `config/application.rb`:

i18n/ja/docusaurus-plugin-content-docs/current/getting-started/project-configuration.md

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ source:
3434

3535
# 出力設定
3636
output:
37-
# コンパイルされた.rbファイルの書き込み先
37+
# コンパイルされた.rbおよび.rbsファイルの書き込み先
3838
ruby_dir: build
39-
# .rbsシグネチャファイルの書き込み先
40-
rbs_dir: sig
4139
# ソースディレクトリ構造を保持
4240
preserve_structure: true
4341

@@ -96,15 +94,15 @@ source:
9694

9795
```yaml
9896
output:
99-
# コンパイルされたRubyファイル用ディレクトリ
97+
# コンパイルされた.rbおよび.rbsファイル用ディレクトリ
10098
ruby_dir: build
10199
102-
# RBSシグネチャファイル用ディレクトリ
103-
rbs_dir: sig
100+
# RBSファイル用別ディレクトリ(オプション、デフォルトはruby_dir)
101+
# rbs_dir: sig
104102
105103
# 出力でソースディレクトリ構造を保持
106-
# true: src/models/user.trb → build/models/user.rb
107-
# false: src/models/user.trb → build/user.rb
104+
# true: src/models/user.trb → build/models/user.rb + build/models/user.rbs
105+
# false: src/models/user.trb → build/user.rb + build/user.rbs
108106
preserve_structure: true
109107
110108
# コンパイル前に出力ディレクトリをクリーン
@@ -160,48 +158,25 @@ watch:
160158
on_success: "bundle exec rspec"
161159
```
162160

163-
### 型解決
164-
165-
```yaml
166-
types:
167-
# 追加の型定義パス
168-
paths:
169-
- types
170-
- vendor/types
171-
172-
# 標準ライブラリ型を自動インポート
173-
stdlib: true
174-
175-
# 外部型定義
176-
external:
177-
- rails
178-
- rspec
179-
```
180-
181161
## ディレクトリ構造
182162

183163
典型的なT-Rubyプロジェクト構造:
184164

185165
```
186166
my-project/
187-
├── trbconfig.yml # 設定
188-
├── src/ # T-Rubyソースファイル
167+
├── trbconfig.yml # 設定
168+
├── src/ # T-Rubyソースファイル(.trb)
189169
│ ├── models/
190170
│ │ ├── user.trb
191171
│ │ └── post.trb
192172
│ ├── services/
193173
│ │ └── auth_service.trb
194174
│ └── main.trb
195-
├── types/ # カスタム型定義
196-
│ └── external.rbs
197-
├── build/ # コンパイルされたRuby出力
175+
├── build/ # コンパイル出力(.rb + .rbs)
198176
│ ├── models/
199177
│ │ ├── user.rb
200-
│ │ └── post.rb
201-
│ └── ...
202-
├── sig/ # 生成されたRBSファイル
203-
│ ├── models/
204178
│ │ ├── user.rbs
179+
│ │ ├── post.rb
205180
│ │ └── post.rbs
206181
│ └── ...
207182
└── test/ # テスト(.rbまたは.trb)
@@ -284,11 +259,6 @@ output:
284259

285260
compiler:
286261
strictness: standard
287-
288-
types:
289-
external:
290-
- rails
291-
- activerecord
292262
```
293263
294264
`config/application.rb`に追加:

i18n/ko/docusaurus-plugin-content-docs/current/getting-started/project-configuration.md

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ source:
3434

3535
# 출력 구성
3636
output:
37-
# 컴파일된 .rb 파일을 작성할 위치
37+
# 컴파일된 .rb 및 .rbs 파일을 작성할 위치
3838
ruby_dir: build
39-
# .rbs 서명 파일을 작성할 위치
40-
rbs_dir: sig
4139
# 소스 디렉토리 구조 유지
4240
preserve_structure: true
4341

@@ -96,15 +94,15 @@ source:
9694

9795
```yaml
9896
output:
99-
# 컴파일된 Ruby 파일용 디렉토리
97+
# 컴파일된 .rb 및 .rbs 파일용 디렉토리
10098
ruby_dir: build
10199
102-
# RBS 서명 파일용 디렉토리
103-
rbs_dir: sig
100+
# RBS 파일 별도 디렉토리 (선택사항, 기본값은 ruby_dir)
101+
# rbs_dir: sig
104102
105103
# 출력에서 소스 디렉토리 구조 유지
106-
# true: src/models/user.trb → build/models/user.rb
107-
# false: src/models/user.trb → build/user.rb
104+
# true: src/models/user.trb → build/models/user.rb + build/models/user.rbs
105+
# false: src/models/user.trb → build/user.rb + build/user.rbs
108106
preserve_structure: true
109107
110108
# 컴파일 전 출력 디렉토리 정리
@@ -160,48 +158,25 @@ watch:
160158
on_success: "bundle exec rspec"
161159
```
162160

163-
### 타입 해결
164-
165-
```yaml
166-
types:
167-
# 추가 타입 정의 경로
168-
paths:
169-
- types
170-
- vendor/types
171-
172-
# 표준 라이브러리 타입 자동 가져오기
173-
stdlib: true
174-
175-
# 외부 타입 정의
176-
external:
177-
- rails
178-
- rspec
179-
```
180-
181161
## 디렉토리 구조
182162

183163
일반적인 T-Ruby 프로젝트 구조:
184164

185165
```
186166
my-project/
187-
├── trbconfig.yml # 구성
188-
├── src/ # T-Ruby 소스 파일
167+
├── trbconfig.yml # 구성
168+
├── src/ # T-Ruby 소스 파일 (.trb)
189169
│ ├── models/
190170
│ │ ├── user.trb
191171
│ │ └── post.trb
192172
│ ├── services/
193173
│ │ └── auth_service.trb
194174
│ └── main.trb
195-
├── types/ # 사용자 정의 타입 정의
196-
│ └── external.rbs
197-
├── build/ # 컴파일된 Ruby 출력
175+
├── build/ # 컴파일 출력 (.rb + .rbs)
198176
│ ├── models/
199177
│ │ ├── user.rb
200-
│ │ └── post.rb
201-
│ └── ...
202-
├── sig/ # 생성된 RBS 파일
203-
│ ├── models/
204178
│ │ ├── user.rbs
179+
│ │ ├── post.rb
205180
│ │ └── post.rbs
206181
│ └── ...
207182
└── test/ # 테스트 (.rb 또는 .trb 가능)
@@ -288,11 +263,6 @@ output:
288263
289264
compiler:
290265
strictness: standard
291-
292-
types:
293-
external:
294-
- rails
295-
- activerecord
296266
```
297267

298268
`config/application.rb`에 추가:

0 commit comments

Comments
 (0)