@sjunepark/fs 0.1.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.
Files changed (56) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +73 -0
  3. package/assets/guide/authoring.md +125 -0
  4. package/dist/application.js +34 -0
  5. package/dist/application.js.map +1 -0
  6. package/dist/assets.js +20 -0
  7. package/dist/assets.js.map +1 -0
  8. package/dist/bin.js +9 -0
  9. package/dist/bin.js.map +1 -0
  10. package/dist/cli.js +150 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/content.js +47 -0
  13. package/dist/content.js.map +1 -0
  14. package/dist/io.js +76 -0
  15. package/dist/io.js.map +1 -0
  16. package/dist/json.js +291 -0
  17. package/dist/json.js.map +1 -0
  18. package/dist/limits.js +15 -0
  19. package/dist/limits.js.map +1 -0
  20. package/dist/logger.js +26 -0
  21. package/dist/logger.js.map +1 -0
  22. package/dist/node-services.js +9 -0
  23. package/dist/node-services.js.map +1 -0
  24. package/dist/pathless.js +72 -0
  25. package/dist/pathless.js.map +1 -0
  26. package/dist/process.js +317 -0
  27. package/dist/process.js.map +1 -0
  28. package/dist/record-validation.js +44 -0
  29. package/dist/record-validation.js.map +1 -0
  30. package/dist/render.js +250 -0
  31. package/dist/render.js.map +1 -0
  32. package/dist/validation/calculate.js +102 -0
  33. package/dist/validation/calculate.js.map +1 -0
  34. package/dist/validation/decimal.js +63 -0
  35. package/dist/validation/decimal.js.map +1 -0
  36. package/dist/validation/identity.js +4 -0
  37. package/dist/validation/identity.js.map +1 -0
  38. package/dist/validation/model.js +10 -0
  39. package/dist/validation/model.js.map +1 -0
  40. package/dist/validation/schema.js +106 -0
  41. package/dist/validation/schema.js.map +1 -0
  42. package/dist/validation/semantic.js +179 -0
  43. package/dist/validation/semantic.js.map +1 -0
  44. package/dist/validation/snapshot.js +74 -0
  45. package/dist/validation/snapshot.js.map +1 -0
  46. package/dist/validation/validate.js +154 -0
  47. package/dist/validation/validate.js.map +1 -0
  48. package/dist/writer.js +107 -0
  49. package/dist/writer.js.map +1 -0
  50. package/examples/README.md +37 -0
  51. package/examples/manufacturing-group.json +439 -0
  52. package/examples/minimal.json +45 -0
  53. package/package.json +80 -0
  54. package/schema/fs-document.schema.json +335 -0
  55. package/schema/snapshot-diff.schema.json +96 -0
  56. package/schema/validation-result.schema.json +165 -0
@@ -0,0 +1,439 @@
1
+ {
2
+ "$schema": "https://cpaikr.github.io/fs/schema/0.1/fs-document.schema.json",
3
+ "formatVersion": "0.1",
4
+ "documentId": "manufacturing-group-2025",
5
+ "entity": {
6
+ "id": "example-group",
7
+ "name": "Example Manufacturing Group"
8
+ },
9
+ "scope": {
10
+ "id": "consolidated",
11
+ "label": "Consolidated financial statements"
12
+ },
13
+ "units": [
14
+ {
15
+ "id": "krw-millions",
16
+ "label": "KRW millions",
17
+ "measure": "KRW",
18
+ "scale": 6,
19
+ "defaultTolerance": "0"
20
+ },
21
+ {
22
+ "id": "krw-per-share",
23
+ "label": "KRW per share",
24
+ "measure": "KRW/share",
25
+ "scale": 0
26
+ }
27
+ ],
28
+ "periods": [
29
+ {
30
+ "id": "fy2025",
31
+ "kind": "duration",
32
+ "start": "2025-01-01",
33
+ "end": "2025-12-31"
34
+ },
35
+ {
36
+ "id": "fy2024",
37
+ "kind": "duration",
38
+ "start": "2024-01-01",
39
+ "end": "2024-12-31"
40
+ },
41
+ {
42
+ "id": "at-2025",
43
+ "kind": "instant",
44
+ "date": "2025-12-31"
45
+ },
46
+ {
47
+ "id": "at-2024",
48
+ "kind": "instant",
49
+ "date": "2024-12-31"
50
+ }
51
+ ],
52
+ "groupingColumns": [
53
+ "majorGroup",
54
+ "valuation"
55
+ ],
56
+ "statements": [
57
+ {
58
+ "id": "balance-sheet",
59
+ "label": "Balance sheet",
60
+ "periods": [
61
+ "at-2025",
62
+ "at-2024"
63
+ ],
64
+ "items": [
65
+ {
66
+ "id": "cash",
67
+ "label": "Cash",
68
+ "unit": "krw-millions",
69
+ "values": {
70
+ "at-2025": "400",
71
+ "at-2024": "350"
72
+ },
73
+ "rollupTo": "assets",
74
+ "groupings": {
75
+ "majorGroup": "Assets",
76
+ "valuation": "Cash"
77
+ }
78
+ },
79
+ {
80
+ "id": "inventory",
81
+ "label": "Inventory",
82
+ "unit": "krw-millions",
83
+ "values": {
84
+ "at-2025": "600",
85
+ "at-2024": "550"
86
+ },
87
+ "rollupTo": "assets",
88
+ "groupings": {
89
+ "majorGroup": "Assets",
90
+ "valuation": "NWC"
91
+ }
92
+ },
93
+ {
94
+ "id": "assets",
95
+ "label": "Total assets",
96
+ "unit": "krw-millions",
97
+ "values": {
98
+ "at-2025": "1000",
99
+ "at-2024": "900"
100
+ },
101
+ "groupings": {
102
+ "majorGroup": "Assets",
103
+ "valuation": null
104
+ }
105
+ },
106
+ {
107
+ "id": "liabilities",
108
+ "label": "Liabilities",
109
+ "unit": "krw-millions",
110
+ "values": {
111
+ "at-2025": "450",
112
+ "at-2024": "400"
113
+ },
114
+ "rollupTo": "liabilities-and-equity",
115
+ "groupings": {
116
+ "majorGroup": "Liabilities and equity",
117
+ "valuation": "Debt"
118
+ }
119
+ },
120
+ {
121
+ "id": "equity",
122
+ "label": "Equity",
123
+ "unit": "krw-millions",
124
+ "values": {
125
+ "at-2025": "550",
126
+ "at-2024": "500"
127
+ },
128
+ "rollupTo": "liabilities-and-equity",
129
+ "groupings": {
130
+ "majorGroup": "Liabilities and equity",
131
+ "valuation": "Equity"
132
+ }
133
+ },
134
+ {
135
+ "id": "liabilities-and-equity",
136
+ "label": "Liabilities and equity",
137
+ "unit": "krw-millions",
138
+ "values": {
139
+ "at-2025": "1000",
140
+ "at-2024": "900"
141
+ },
142
+ "groupings": {
143
+ "majorGroup": "Liabilities and equity",
144
+ "valuation": null
145
+ }
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "id": "income-statement",
151
+ "label": "Income statement",
152
+ "periods": [
153
+ "fy2025",
154
+ "fy2024"
155
+ ],
156
+ "items": [
157
+ {
158
+ "id": "product-revenue",
159
+ "label": "Product revenue",
160
+ "unit": "krw-millions",
161
+ "values": {
162
+ "fy2025": "60",
163
+ "fy2024": "50"
164
+ },
165
+ "rollupTo": "revenue",
166
+ "groupings": {
167
+ "majorGroup": "Revenue",
168
+ "valuation": "Revenue"
169
+ }
170
+ },
171
+ {
172
+ "id": "service-revenue",
173
+ "label": "Service revenue",
174
+ "unit": "krw-millions",
175
+ "values": {
176
+ "fy2025": "40",
177
+ "fy2024": "30"
178
+ },
179
+ "rollupTo": "revenue",
180
+ "groupings": {
181
+ "majorGroup": "Revenue",
182
+ "valuation": "Revenue"
183
+ }
184
+ },
185
+ {
186
+ "id": "revenue",
187
+ "label": "Revenue",
188
+ "unit": "krw-millions",
189
+ "values": {
190
+ "fy2025": "100",
191
+ "fy2024": "80"
192
+ },
193
+ "rollupTo": "gross-profit",
194
+ "groupings": {
195
+ "majorGroup": "Revenue",
196
+ "valuation": "Revenue"
197
+ }
198
+ },
199
+ {
200
+ "id": "materials",
201
+ "label": "Materials",
202
+ "unit": "krw-millions",
203
+ "values": {
204
+ "fy2025": "-35",
205
+ "fy2024": "-30"
206
+ },
207
+ "rollupTo": "cost-of-sales",
208
+ "groupings": {
209
+ "majorGroup": "Cost of sales",
210
+ "valuation": null
211
+ }
212
+ },
213
+ {
214
+ "id": "labor",
215
+ "label": "Labor",
216
+ "unit": "krw-millions",
217
+ "values": {
218
+ "fy2025": "-25",
219
+ "fy2024": "-20"
220
+ },
221
+ "rollupTo": "cost-of-sales",
222
+ "groupings": {
223
+ "majorGroup": "Cost of sales",
224
+ "valuation": null
225
+ }
226
+ },
227
+ {
228
+ "id": "cost-of-sales",
229
+ "label": "Cost of sales",
230
+ "unit": "krw-millions",
231
+ "values": {
232
+ "fy2025": "-60",
233
+ "fy2024": "-50"
234
+ },
235
+ "rollupTo": "gross-profit",
236
+ "groupings": {
237
+ "majorGroup": "Cost of sales",
238
+ "valuation": null
239
+ }
240
+ },
241
+ {
242
+ "id": "gross-profit",
243
+ "label": "Gross profit",
244
+ "unit": "krw-millions",
245
+ "values": {
246
+ "fy2025": "41",
247
+ "fy2024": "30"
248
+ },
249
+ "groupings": {
250
+ "majorGroup": "Profit",
251
+ "valuation": "EBITDA"
252
+ }
253
+ },
254
+ {
255
+ "id": "basic-eps",
256
+ "label": "Basic EPS",
257
+ "unit": "krw-per-share",
258
+ "values": {
259
+ "fy2025": "1250",
260
+ "fy2024": {
261
+ "unavailable": true
262
+ }
263
+ },
264
+ "groupings": {
265
+ "majorGroup": "Per share",
266
+ "valuation": "EPS"
267
+ }
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ "id": "cash-flow-statement",
273
+ "label": "Cash flow statement",
274
+ "periods": [
275
+ "fy2025",
276
+ "fy2024"
277
+ ],
278
+ "items": [
279
+ {
280
+ "id": "operating",
281
+ "label": "Operating cash flow",
282
+ "unit": "krw-millions",
283
+ "values": {
284
+ "fy2025": "30",
285
+ "fy2024": "25"
286
+ },
287
+ "rollupTo": "net-cash-flow",
288
+ "groupings": {
289
+ "majorGroup": "Cash flow",
290
+ "valuation": null
291
+ }
292
+ },
293
+ {
294
+ "id": "investing",
295
+ "label": "Investing cash flow",
296
+ "unit": "krw-millions",
297
+ "values": {
298
+ "fy2025": "-10",
299
+ "fy2024": "-8"
300
+ },
301
+ "rollupTo": "net-cash-flow",
302
+ "groupings": {
303
+ "majorGroup": "Cash flow",
304
+ "valuation": null
305
+ }
306
+ },
307
+ {
308
+ "id": "financing",
309
+ "label": "Financing cash flow",
310
+ "unit": "krw-millions",
311
+ "values": {
312
+ "fy2025": "0",
313
+ "fy2024": "-2"
314
+ },
315
+ "rollupTo": "net-cash-flow",
316
+ "groupings": {
317
+ "majorGroup": "Cash flow",
318
+ "valuation": null
319
+ }
320
+ },
321
+ {
322
+ "id": "net-cash-flow",
323
+ "label": "Net cash flow",
324
+ "unit": "krw-millions",
325
+ "values": {
326
+ "fy2025": "20",
327
+ "fy2024": "15"
328
+ },
329
+ "groupings": {
330
+ "majorGroup": "Cash flow",
331
+ "valuation": null
332
+ }
333
+ }
334
+ ]
335
+ },
336
+ {
337
+ "id": "equity-statement",
338
+ "label": "Statement of changes in equity",
339
+ "periods": [
340
+ "at-2025",
341
+ "at-2024"
342
+ ],
343
+ "items": [
344
+ {
345
+ "id": "share-capital",
346
+ "label": "Share capital",
347
+ "unit": "krw-millions",
348
+ "values": {
349
+ "at-2025": "200",
350
+ "at-2024": "180"
351
+ },
352
+ "rollupTo": "total-equity",
353
+ "groupings": {
354
+ "majorGroup": "Equity",
355
+ "valuation": "Equity"
356
+ }
357
+ },
358
+ {
359
+ "id": "retained-earnings",
360
+ "label": "Retained earnings",
361
+ "unit": "krw-millions",
362
+ "values": {
363
+ "at-2025": "350",
364
+ "at-2024": "320"
365
+ },
366
+ "rollupTo": "total-equity",
367
+ "groupings": {
368
+ "majorGroup": "Equity",
369
+ "valuation": "Equity"
370
+ }
371
+ },
372
+ {
373
+ "id": "total-equity",
374
+ "label": "Total equity",
375
+ "unit": "krw-millions",
376
+ "values": {
377
+ "at-2025": "550",
378
+ "at-2024": "500"
379
+ },
380
+ "groupings": {
381
+ "majorGroup": "Equity",
382
+ "valuation": "Equity"
383
+ }
384
+ }
385
+ ]
386
+ },
387
+ {
388
+ "id": "manufacturing-statement",
389
+ "label": "Manufacturing cost statement",
390
+ "periods": [
391
+ "fy2025",
392
+ "fy2024"
393
+ ],
394
+ "items": [
395
+ {
396
+ "id": "materials",
397
+ "label": "Materials",
398
+ "unit": "krw-millions",
399
+ "values": {
400
+ "fy2025": "35",
401
+ "fy2024": "30"
402
+ },
403
+ "rollupTo": "manufacturing-cost",
404
+ "groupings": {
405
+ "majorGroup": "Manufacturing",
406
+ "valuation": null
407
+ }
408
+ },
409
+ {
410
+ "id": "labor",
411
+ "label": "Labor",
412
+ "unit": "krw-millions",
413
+ "values": {
414
+ "fy2025": "25",
415
+ "fy2024": "20"
416
+ },
417
+ "rollupTo": "manufacturing-cost",
418
+ "groupings": {
419
+ "majorGroup": "Manufacturing",
420
+ "valuation": null
421
+ }
422
+ },
423
+ {
424
+ "id": "manufacturing-cost",
425
+ "label": "Manufacturing cost",
426
+ "unit": "krw-millions",
427
+ "values": {
428
+ "fy2025": "60",
429
+ "fy2024": "50"
430
+ },
431
+ "groupings": {
432
+ "majorGroup": "Manufacturing",
433
+ "valuation": null
434
+ }
435
+ }
436
+ ]
437
+ }
438
+ ]
439
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "formatVersion": "0.1",
3
+ "entity": {
4
+ "name": "Example Entity"
5
+ },
6
+ "scope": {
7
+ "label": "Consolidated financial statements"
8
+ },
9
+ "units": [
10
+ {
11
+ "id": "usd",
12
+ "label": "USD",
13
+ "measure": "USD",
14
+ "scale": 0
15
+ }
16
+ ],
17
+ "periods": [
18
+ {
19
+ "id": "fy2025",
20
+ "kind": "duration",
21
+ "start": "2025-01-01",
22
+ "end": "2025-12-31"
23
+ }
24
+ ],
25
+ "statements": [
26
+ {
27
+ "id": "statement",
28
+ "label": "Statement",
29
+ "periods": [
30
+ "fy2025"
31
+ ],
32
+ "items": [
33
+ {
34
+ "id": "cash",
35
+ "label": "Cash",
36
+ "unit": "usd",
37
+ "values": {
38
+ "fy2025": "1"
39
+ },
40
+ "groupings": {}
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@sjunepark/fs",
3
+ "version": "0.1.0",
4
+ "description": "Reference CLI for the FS financial statement artifact format",
5
+ "keywords": [
6
+ "financial-statements",
7
+ "json-schema",
8
+ "validation",
9
+ "cli"
10
+ ],
11
+ "homepage": "https://cpaikr.github.io/fs/spec/0.1/",
12
+ "bugs": {
13
+ "url": "https://github.com/cpaikr/cpaikr.github.io/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/cpaikr/fs.git"
18
+ },
19
+ "author": "CPAI",
20
+ "license": "Apache-2.0",
21
+ "type": "module",
22
+ "bin": {
23
+ "fs": "dist/bin.js"
24
+ },
25
+ "exports": {
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "LICENSE",
30
+ "dist",
31
+ "assets",
32
+ "examples/*.json",
33
+ "examples/README.md",
34
+ "schema/*.json",
35
+ "README.md"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org/"
40
+ },
41
+ "engines": {
42
+ "node": "^22.17.0 || ^24.15.0"
43
+ },
44
+ "packageManager": "pnpm@10.28.0",
45
+ "scripts": {
46
+ "build": "node scripts/clean-dist.mjs && tsc -p tsconfig.build.json",
47
+ "audit:prod": "pnpm audit --prod",
48
+ "check": "pnpm check:docs && pnpm verify",
49
+ "check:docs": "./scripts/check-docs.sh",
50
+ "check:effect": "effect-language-service diagnostics --project tsconfig.json --format text --strict",
51
+ "pack:check": "node scripts/check-pack.mjs",
52
+ "release:check": "pnpm check && npm publish --dry-run",
53
+ "test": "vitest run",
54
+ "test:acceptance": "pnpm build && node scripts/run-cli-acceptance.mjs",
55
+ "test:writer-integration": "pnpm build && node scripts/run-writer-integration.mjs",
56
+ "typecheck": "tsc -p tsconfig.json",
57
+ "verify": "pnpm typecheck && pnpm check:effect && pnpm test && pnpm test:acceptance && pnpm test:writer-integration && pnpm pack:check",
58
+ "prepack": "pnpm build"
59
+ },
60
+ "dependencies": {
61
+ "@effect/platform-node-shared": "4.0.0-beta.98",
62
+ "ajv": "8.20.0",
63
+ "effect": "4.0.0-beta.98"
64
+ },
65
+ "devDependencies": {
66
+ "@effect/language-service": "0.87.0",
67
+ "@types/node": "24.10.0",
68
+ "ajv-cli": "5.0.0",
69
+ "cross-spawn": "7.0.6",
70
+ "markdown-link-check": "3.13.7",
71
+ "markdownlint-cli2": "0.18.1",
72
+ "typescript": "5.9.3",
73
+ "vitest": "4.1.10"
74
+ },
75
+ "pnpm": {
76
+ "overrides": {
77
+ "@effect/platform-node-shared": "4.0.0-beta.98"
78
+ }
79
+ }
80
+ }