@o3co/ts.hocon 0.1.0 → 0.1.2

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.
Files changed (106) hide show
  1. package/README.ja.md +49 -0
  2. package/README.md +49 -0
  3. package/dist/config-D4EyvNd8.d.cts +31 -0
  4. package/dist/config-D4EyvNd8.d.ts +31 -0
  5. package/dist/index.cjs +891 -0
  6. package/dist/index.d.cts +39 -0
  7. package/dist/index.d.ts +39 -0
  8. package/dist/index.js +847 -0
  9. package/dist/zod.cjs +39 -0
  10. package/dist/zod.d.cts +7 -0
  11. package/dist/zod.d.ts +7 -0
  12. package/dist/zod.js +13 -0
  13. package/package.json +13 -10
  14. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
  15. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
  16. package/.github/pull_request_template.md +0 -17
  17. package/.github/workflows/lint.yml +0 -33
  18. package/.github/workflows/release.yml +0 -41
  19. package/.github/workflows/test.yml +0 -53
  20. package/CHANGELOG.md +0 -22
  21. package/CONTRIBUTING.md +0 -62
  22. package/SECURITY.md +0 -20
  23. package/docs/superpowers/plans/2026-03-20-ts-hocon.md +0 -2412
  24. package/docs/superpowers/specs/2026-03-20-ts-hocon-design.md +0 -368
  25. package/src/config.ts +0 -108
  26. package/src/errors.ts +0 -34
  27. package/src/index.ts +0 -5
  28. package/src/internal/lexer/lexer.ts +0 -168
  29. package/src/internal/lexer/token.ts +0 -20
  30. package/src/internal/parser/ast.ts +0 -17
  31. package/src/internal/parser/parser.ts +0 -229
  32. package/src/internal/resolver/resolver.ts +0 -428
  33. package/src/parse.ts +0 -79
  34. package/src/value.ts +0 -5
  35. package/src/zod.ts +0 -12
  36. package/tests/config.test.ts +0 -100
  37. package/tests/errors.test.ts +0 -43
  38. package/tests/lexer.test.ts +0 -141
  39. package/tests/lightbend/lightbend.test.ts +0 -39
  40. package/tests/lightbend/testdata/a_1.conf +0 -1
  41. package/tests/lightbend/testdata/b_2.conf +0 -1
  42. package/tests/lightbend/testdata/beanconfig/beanconfig01.conf +0 -131
  43. package/tests/lightbend/testdata/bom.conf +0 -2
  44. package/tests/lightbend/testdata/cycle.conf +0 -1
  45. package/tests/lightbend/testdata/env-variables.conf +0 -16
  46. package/tests/lightbend/testdata/equiv01/comments.conf +0 -45
  47. package/tests/lightbend/testdata/equiv01/equals.conf +0 -41
  48. package/tests/lightbend/testdata/equiv01/no-commas.conf +0 -55
  49. package/tests/lightbend/testdata/equiv01/no-root-braces.conf +0 -40
  50. package/tests/lightbend/testdata/equiv01/no-whitespace.json +0 -1
  51. package/tests/lightbend/testdata/equiv01/omit-colons.conf +0 -44
  52. package/tests/lightbend/testdata/equiv01/original.json +0 -41
  53. package/tests/lightbend/testdata/equiv01/path-keys.conf +0 -29
  54. package/tests/lightbend/testdata/equiv01/properties-style.conf +0 -37
  55. package/tests/lightbend/testdata/equiv01/substitutions.conf +0 -41
  56. package/tests/lightbend/testdata/equiv01/unquoted.conf +0 -41
  57. package/tests/lightbend/testdata/equiv02/original.json +0 -17
  58. package/tests/lightbend/testdata/equiv02/path-keys-weird-whitespace.conf +0 -32
  59. package/tests/lightbend/testdata/equiv02/path-keys.conf +0 -9
  60. package/tests/lightbend/testdata/equiv03/includes.conf +0 -7
  61. package/tests/lightbend/testdata/equiv03/letters/a.conf +0 -6
  62. package/tests/lightbend/testdata/equiv03/letters/b.json +0 -3
  63. package/tests/lightbend/testdata/equiv03/letters/c.conf +0 -2
  64. package/tests/lightbend/testdata/equiv03/letters/c.properties +0 -1
  65. package/tests/lightbend/testdata/equiv03/letters/numbers/1.conf +0 -1
  66. package/tests/lightbend/testdata/equiv03/letters/numbers/2.properties +0 -1
  67. package/tests/lightbend/testdata/equiv03/original.json +0 -15
  68. package/tests/lightbend/testdata/equiv03/root/foo.conf +0 -1
  69. package/tests/lightbend/testdata/equiv04/missing-substitutions.conf +0 -4
  70. package/tests/lightbend/testdata/equiv04/original.json +0 -3
  71. package/tests/lightbend/testdata/equiv05/original.json +0 -16
  72. package/tests/lightbend/testdata/equiv05/triple-quotes.conf +0 -20
  73. package/tests/lightbend/testdata/file-include.conf +0 -5
  74. package/tests/lightbend/testdata/include-from-list.conf +0 -5
  75. package/tests/lightbend/testdata/onclasspath.conf +0 -2
  76. package/tests/lightbend/testdata/subdir/bar-file.conf +0 -1
  77. package/tests/lightbend/testdata/subdir/bar.conf +0 -1
  78. package/tests/lightbend/testdata/subdir/baz.conf +0 -1
  79. package/tests/lightbend/testdata/subdir/foo.conf +0 -5
  80. package/tests/lightbend/testdata/test01.conf +0 -96
  81. package/tests/lightbend/testdata/test01.json +0 -4
  82. package/tests/lightbend/testdata/test01.properties +0 -5
  83. package/tests/lightbend/testdata/test02.conf +0 -13
  84. package/tests/lightbend/testdata/test03-included.conf +0 -9
  85. package/tests/lightbend/testdata/test03.conf +0 -36
  86. package/tests/lightbend/testdata/test04.conf +0 -305
  87. package/tests/lightbend/testdata/test05.conf +0 -154
  88. package/tests/lightbend/testdata/test06.conf +0 -14
  89. package/tests/lightbend/testdata/test07.conf +0 -4
  90. package/tests/lightbend/testdata/test08.conf +0 -6
  91. package/tests/lightbend/testdata/test09.conf +0 -17
  92. package/tests/lightbend/testdata/test10.conf +0 -11
  93. package/tests/lightbend/testdata/test11.conf +0 -7
  94. package/tests/lightbend/testdata/test12.conf +0 -43
  95. package/tests/lightbend/testdata/test13-application-override-substitutions.conf +0 -1
  96. package/tests/lightbend/testdata/test13-reference-bad-substitutions.conf +0 -1
  97. package/tests/lightbend/testdata/test13-reference-with-substitutions.conf +0 -2
  98. package/tests/lightbend/testdata/validate-invalid.conf +0 -30
  99. package/tests/lightbend/testdata/validate-reference.conf +0 -32
  100. package/tests/parse.test.ts +0 -44
  101. package/tests/parser.test.ts +0 -154
  102. package/tests/resolver.test.ts +0 -159
  103. package/tests/zod.test.ts +0 -57
  104. package/tsconfig.json +0 -16
  105. package/tsup.config.ts +0 -12
  106. package/vitest.config.ts +0 -7
@@ -0,0 +1,39 @@
1
+ import { C as Config } from './config-D4EyvNd8.cjs';
2
+ export { H as HoconValue } from './config-D4EyvNd8.cjs';
3
+
4
+ declare class ParseError extends Error {
5
+ readonly line: number;
6
+ readonly col: number;
7
+ readonly file?: string | undefined;
8
+ constructor(message: string, line: number, col: number, file?: string | undefined);
9
+ }
10
+ declare class ResolveError extends Error {
11
+ readonly path: string;
12
+ readonly line: number;
13
+ readonly col: number;
14
+ readonly file?: string | undefined;
15
+ constructor(message: string, path: string, line: number, col: number, file?: string | undefined);
16
+ }
17
+ declare class ConfigError extends Error {
18
+ readonly path: string;
19
+ constructor(message: string, path: string);
20
+ }
21
+
22
+ type ParseOptions = {
23
+ baseDir?: string;
24
+ env?: Record<string, string>;
25
+ readFile?: (filePath: string) => Promise<string>;
26
+ readFileSync?: (filePath: string) => string;
27
+ };
28
+ declare function parse(input: string, opts?: ParseOptions): Config;
29
+ /**
30
+ * Async wrapper around `parse()`. Returns a resolved Promise — the parsing
31
+ * itself is synchronous. Use `parseFileAsync()` for async file I/O.
32
+ * Note: `include` directives in string input are resolved synchronously
33
+ * via `readFileSync`; `readFile` is not used by this function.
34
+ */
35
+ declare function parseAsync(input: string, opts?: ParseOptions): Promise<Config>;
36
+ declare function parseFile(filePath: string, opts?: ParseOptions): Config;
37
+ declare function parseFileAsync(filePath: string, opts?: ParseOptions): Promise<Config>;
38
+
39
+ export { Config, ConfigError, ParseError, type ParseOptions, ResolveError, parse, parseAsync, parseFile, parseFileAsync };
@@ -0,0 +1,39 @@
1
+ import { C as Config } from './config-D4EyvNd8.js';
2
+ export { H as HoconValue } from './config-D4EyvNd8.js';
3
+
4
+ declare class ParseError extends Error {
5
+ readonly line: number;
6
+ readonly col: number;
7
+ readonly file?: string | undefined;
8
+ constructor(message: string, line: number, col: number, file?: string | undefined);
9
+ }
10
+ declare class ResolveError extends Error {
11
+ readonly path: string;
12
+ readonly line: number;
13
+ readonly col: number;
14
+ readonly file?: string | undefined;
15
+ constructor(message: string, path: string, line: number, col: number, file?: string | undefined);
16
+ }
17
+ declare class ConfigError extends Error {
18
+ readonly path: string;
19
+ constructor(message: string, path: string);
20
+ }
21
+
22
+ type ParseOptions = {
23
+ baseDir?: string;
24
+ env?: Record<string, string>;
25
+ readFile?: (filePath: string) => Promise<string>;
26
+ readFileSync?: (filePath: string) => string;
27
+ };
28
+ declare function parse(input: string, opts?: ParseOptions): Config;
29
+ /**
30
+ * Async wrapper around `parse()`. Returns a resolved Promise — the parsing
31
+ * itself is synchronous. Use `parseFileAsync()` for async file I/O.
32
+ * Note: `include` directives in string input are resolved synchronously
33
+ * via `readFileSync`; `readFile` is not used by this function.
34
+ */
35
+ declare function parseAsync(input: string, opts?: ParseOptions): Promise<Config>;
36
+ declare function parseFile(filePath: string, opts?: ParseOptions): Config;
37
+ declare function parseFileAsync(filePath: string, opts?: ParseOptions): Promise<Config>;
38
+
39
+ export { Config, ConfigError, ParseError, type ParseOptions, ResolveError, parse, parseAsync, parseFile, parseFileAsync };