@o3co/ts.hocon 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +10 -4
- package/README.md +18 -4
- package/dist/index.cjs +325 -162
- package/dist/index.js +325 -162
- package/dist/zod.cjs +325 -162
- package/dist/zod.js +325 -162
- package/package.json +4 -4
package/README.ja.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://codecov.io/gh/o3co/ts.hocon)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
[Lightbend HOCON](https://github.com/lightbend/config/blob/main/HOCON.md)
|
|
8
|
+
[Lightbend HOCON](https://github.com/lightbend/config/blob/main/HOCON.md) 仕様の TypeScript パーサー。現在の準拠率は [仕様準拠](#仕様準拠) を参照。
|
|
9
9
|
|
|
10
10
|
> **[Claude](https://claude.ai/)(Anthropic)による実装** — Claude Code を用いて設計・実装されました。
|
|
11
11
|
> [GitHub Copilot](https://github.com/features/copilot) および [OpenAI Codex](https://openai.com/index/openai-codex/) によるレビュー。
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
npm install @o3co/ts.hocon
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Node.js
|
|
25
|
+
Node.js 22 以上が必要です。
|
|
26
26
|
|
|
27
27
|
### 2. 使い方
|
|
28
28
|
|
|
@@ -177,7 +177,13 @@ description = """
|
|
|
177
177
|
|
|
178
178
|
## 仕様準拠
|
|
179
179
|
|
|
180
|
-
[Lightbend
|
|
180
|
+
[Lightbend HOCON 仕様](https://github.com/lightbend/config/blob/main/HOCON.md) への準拠状況は [`docs/spec-compliance.md`](docs/spec-compliance.md) に項目単位で記載しています。以下の表は 2026-05-13 時点のスナップショットです — 最新値は [`xx.hocon/docs/compliance-matrix.md`](https://github.com/o3co/xx.hocon/blob/main/docs/compliance-matrix.md) を参照してください。
|
|
181
|
+
|
|
182
|
+
| 指標 | 状況 |
|
|
183
|
+
| -------------------------------------- | ------------- |
|
|
184
|
+
| 仕様全体(out-of-scope を含む) | **74.2%** |
|
|
185
|
+
| In-scope のみ | **83.3%** |
|
|
186
|
+
| Lightbend `test01`–`test13` テスト群 | 13/13 合格 |
|
|
181
187
|
|
|
182
188
|
v0.1.0 で未対応の機能:
|
|
183
189
|
- `include url(...)`
|
|
@@ -294,7 +300,7 @@ const config = parseWithSchema(hoconInput, schema) // 起動時に即座に失
|
|
|
294
300
|
| [rs.hocon](https://github.com/o3co/rs.hocon) | Rust | [crates.io](https://crates.io/crates/o3co-hocon) | Rust 向け HOCON パーサー |
|
|
295
301
|
| [hocon2](https://github.com/o3co/hocon2) | Go | [pkg.go.dev](https://pkg.go.dev/github.com/o3co/hocon2) | HOCON → JSON/YAML/TOML/Properties 変換 CLI |
|
|
296
302
|
|
|
297
|
-
|
|
303
|
+
3 つのパーサー実装([ts.hocon](https://github.com/o3co/ts.hocon)、[rs.hocon](https://github.com/o3co/rs.hocon)、[go.hocon](https://github.com/o3co/go.hocon))はすべて同じ Lightbend HOCON 仕様で追跡されています — 実装ごとの準拠率は [横断ロールアップ](https://github.com/o3co/xx.hocon/blob/main/docs/compliance-matrix.md) を参照してください。
|
|
298
304
|
|
|
299
305
|
## ライセンス
|
|
300
306
|
|
package/README.md
CHANGED
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
[](https://codecov.io/gh/o3co/ts.hocon)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
A
|
|
8
|
+
A [Lightbend HOCON](https://github.com/lightbend/config/blob/main/HOCON.md) parser for TypeScript. See [Spec Compliance](#spec-compliance) for the current conformance rate.
|
|
9
9
|
|
|
10
10
|
> **Implemented by [Claude](https://claude.ai/) (Anthropic)** — designed and built end-to-end with Claude Code.
|
|
11
11
|
> Reviewed by [GitHub Copilot](https://github.com/features/copilot) and [OpenAI Codex](https://openai.com/index/openai-codex/).
|
|
12
12
|
|
|
13
13
|
[日本語](README.ja.md)
|
|
14
14
|
|
|
15
|
+
> **Library stance:** ts.hocon is a HOCON config loader — its purpose is reading `.hocon` config files and providing typed access via the Config API (`getString`, `getNumber`, `getBoolean`, `getDuration`, `getBytes`, `toObject`). It is not a low-level parser API. Internal types like `HoconValue` may change between minor versions.
|
|
16
|
+
>
|
|
17
|
+
> **Cross-language conformance:** This implementation is tested against shared expected-JSON fixtures from [o3co/xx.hocon](https://github.com/o3co/xx.hocon) alongside [go.hocon](https://github.com/o3co/go.hocon) and [rs.hocon](https://github.com/o3co/rs.hocon) to ensure all three implementations meet the same Lightbend HOCON specification.
|
|
18
|
+
|
|
15
19
|
---
|
|
16
20
|
|
|
17
21
|
## Quick Start
|
|
@@ -22,7 +26,7 @@ A full [Lightbend HOCON](https://github.com/lightbend/config/blob/main/HOCON.md)
|
|
|
22
26
|
npm install @o3co/ts.hocon
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
Requires Node.js
|
|
29
|
+
Requires Node.js 22+.
|
|
26
30
|
|
|
27
31
|
### 2. Use
|
|
28
32
|
|
|
@@ -202,7 +206,13 @@ Supported byte units: `B`, `KB`/`KiB`, `MB`/`MiB`, `GB`/`GiB`, `TB`/`TiB` (and l
|
|
|
202
206
|
|
|
203
207
|
## Spec Compliance
|
|
204
208
|
|
|
205
|
-
|
|
209
|
+
Conformance against the [Lightbend HOCON specification](https://github.com/lightbend/config/blob/main/HOCON.md) is tracked at item granularity in [`docs/spec-compliance.md`](docs/spec-compliance.md). The table below is a snapshot as of 2026-05-13; see [`xx.hocon/docs/compliance-matrix.md`](https://github.com/o3co/xx.hocon/blob/main/docs/compliance-matrix.md) for live cross-impl values.
|
|
210
|
+
|
|
211
|
+
| Metric | Status |
|
|
212
|
+
| ------------------------------------- | ------------- |
|
|
213
|
+
| Spec total (incl. out-of-scope) | **74.2%** |
|
|
214
|
+
| In-scope only | **83.3%** |
|
|
215
|
+
| Lightbend `test01`–`test13` suite | 13/13 passing |
|
|
206
216
|
|
|
207
217
|
Not supported in v0.1.0:
|
|
208
218
|
|
|
@@ -213,6 +223,10 @@ Supported since v0.2.0 (P1):
|
|
|
213
223
|
|
|
214
224
|
- `.properties` file parsing
|
|
215
225
|
|
|
226
|
+
### Stricter than Lightbend
|
|
227
|
+
|
|
228
|
+
- **S8.6 leading-hyphen rejection** (Unreleased): `a = -foo`, `a = -bar`, `a = -` etc. now raise a lex error per HOCON.md L270–276, where Lightbend silently falls back to unquoted strings. Mitigation: quote the value (`a = "-foo"`). See [CHANGELOG](CHANGELOG.md#unreleased) and [`docs/spec-compliance.md`](docs/spec-compliance.md) §S8.6.
|
|
229
|
+
|
|
216
230
|
## Performance
|
|
217
231
|
|
|
218
232
|
### ts.hocon Parsing Cost
|
|
@@ -323,7 +337,7 @@ const config = parseWithSchema(hoconInput, schema) // fails fast on startup
|
|
|
323
337
|
| [rs.hocon](https://github.com/o3co/rs.hocon) | Rust | [crates.io](https://crates.io/crates/o3co-hocon) | HOCON parser for Rust |
|
|
324
338
|
| [hocon2](https://github.com/o3co/hocon2) | Go | [pkg.go.dev](https://pkg.go.dev/github.com/o3co/hocon2) | HOCON → JSON/YAML/TOML/Properties CLI |
|
|
325
339
|
|
|
326
|
-
|
|
340
|
+
The three parser implementations ([ts.hocon](https://github.com/o3co/ts.hocon), [rs.hocon](https://github.com/o3co/rs.hocon), [go.hocon](https://github.com/o3co/go.hocon)) are all tracked against the same Lightbend HOCON spec — see the [cross-impl roll-up](https://github.com/o3co/xx.hocon/blob/main/docs/compliance-matrix.md) for per-impl conformance rates.
|
|
327
341
|
|
|
328
342
|
## Known Limitations
|
|
329
343
|
|