Restructuring in prep for being a usable package.
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 9 Mar 2020 21:55:46 +0000 (17:55 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 10 Mar 2020 04:03:42 +0000 (00:03 -0400)
Moves file modules out of src/*.ts and into src/core, which is now peer
to src/fed2019.

This also adds index.ts re-exports for the modules.

40 files changed:
jest.config.js
package.json
src/core/Errors.ts [moved from src/Errors.ts with 100% similarity]
src/core/Form.test.ts [moved from src/Form.test.ts with 100% similarity]
src/core/Form.ts [moved from src/Form.ts with 100% similarity]
src/core/Line.test.ts [moved from src/Line.test.ts with 100% similarity]
src/core/Line.ts [moved from src/Line.ts with 100% similarity]
src/core/Math.test.ts [moved from src/Math.test.ts with 100% similarity]
src/core/Math.ts [moved from src/Math.ts with 100% similarity]
src/core/Person.test.ts [moved from src/Person.test.ts with 100% similarity]
src/core/Person.ts [moved from src/Person.ts with 100% similarity]
src/core/TaxReturn.test.ts [moved from src/TaxReturn.test.ts with 100% similarity]
src/core/TaxReturn.ts [moved from src/TaxReturn.ts with 100% similarity]
src/core/index.ts [new file with mode: 0644]
src/fed2019/Form1040.test.ts
src/fed2019/Form1040.ts
src/fed2019/Form1099B.ts
src/fed2019/Form1099DIV.ts
src/fed2019/Form1099INT.ts
src/fed2019/Form1099R.ts
src/fed2019/Form1116.test.ts
src/fed2019/Form1116.ts
src/fed2019/Form8606.test.ts
src/fed2019/Form8606.ts
src/fed2019/Form8949.test.ts
src/fed2019/Form8949.ts
src/fed2019/Form8959.test.ts
src/fed2019/Form8959.ts
src/fed2019/Form8960.test.ts
src/fed2019/Form8960.ts
src/fed2019/FormW2.test.ts
src/fed2019/FormW2.ts
src/fed2019/Schedule1.test.ts
src/fed2019/Schedule1.ts
src/fed2019/Schedule2.ts
src/fed2019/Schedule3.test.ts
src/fed2019/Schedule3.ts
src/fed2019/ScheduleD.ts
src/fed2019/index.ts [new file with mode: 0644]
src/index.ts

index 2d41c1a91ae14b438d4977fd5eec29dc8b4e6dc0..c131434955ffe37a4f78c3ec8cefd6b36d4e2a8d 100644 (file)
@@ -2,7 +2,10 @@ module.exports = {
   preset: 'ts-jest',
   testEnvironment: 'node',
   collectCoverage: true,
-  collectCoverageFrom: ['src/**/*.ts'],
+  collectCoverageFrom: [
+    '**/*.ts',
+    '!dist/**/*'
+  ],
   testPathIgnorePatterns: [
     '/node_modules/',
     '/dist/'
index faad98f128e5fe04d59cc6bfcdb7b08ce67f8026..a503be26ceaeff60ab8b792f3a6b9b5a42d76299 100644 (file)
@@ -2,8 +2,6 @@
   "name": "ustaxlib",
   "version": "0.1.0",
   "description": "A library for modeling individual US tax returns.",
-  "main": "dist/index.js",
-  "types": "dist/index.d.ts",
   "scripts": {
     "dev": "jest --watch",
     "test": "jest",
similarity index 100%
rename from src/Errors.ts
rename to src/core/Errors.ts
similarity index 100%
rename from src/Form.test.ts
rename to src/core/Form.test.ts
similarity index 100%
rename from src/Form.ts
rename to src/core/Form.ts
similarity index 100%
rename from src/Line.test.ts
rename to src/core/Line.test.ts
similarity index 100%
rename from src/Line.ts
rename to src/core/Line.ts
similarity index 100%
rename from src/Math.test.ts
rename to src/core/Math.test.ts
similarity index 100%
rename from src/Math.ts
rename to src/core/Math.ts
similarity index 100%
rename from src/Person.test.ts
rename to src/core/Person.test.ts
similarity index 100%
rename from src/Person.ts
rename to src/core/Person.ts
similarity index 100%
rename from src/TaxReturn.ts
rename to src/core/TaxReturn.ts
diff --git a/src/core/index.ts b/src/core/index.ts
new file mode 100644 (file)
index 0000000..510da88
--- /dev/null
@@ -0,0 +1,4 @@
+export { Line } from './Line';
+export { default as Form } from './Form';
+export { default as Person } from './Person';
+export { default as TaxReturn } from './TaxReturn';
index 6549ac6eb3bce063f00cf992a9ce70c284fb58b1..6653c46167de932b7b2931c05c90376a45ee957c 100644 (file)
@@ -1,6 +1,6 @@
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
-import { NotFoundError } from '../Errors';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
+import { NotFoundError } from '../core/Errors';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form1099DIV from './Form1099DIV';
index 13de9cd9ee35d3ba689505cf523dcdaa94191c69..a6f865befee8797cca734e4367b6e0ebe38d9ec3 100644 (file)
@@ -1,8 +1,8 @@
-import Form, { FormClass } from '../Form';
-import TaxReturn from '../TaxReturn';
-import { Line, AccumulatorLine, ComputedLine, ReferenceLine, sumLineOfForms } from '../Line';
-import { UnsupportedFeatureError } from '../Errors';
-import { reduceBySum } from '../Math';
+import Form, { FormClass } from '../core/Form';
+import { TaxReturn } from '../core';
+import { Line, AccumulatorLine, ComputedLine, ReferenceLine, sumLineOfForms } from '../core/Line';
+import { UnsupportedFeatureError } from '../core/Errors';
+import { reduceBySum } from '../core/Math';
 
 import Form8606 from './Form8606';
 import Form8959 from './Form8959';
index 7eb1af8f543adcc69bb168aeb3b0b2ab0f54fc76..ba3d2ebd87707c87e2143b59bebbe5562d4ecbf4 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
-import { InputLine } from '../Line';
+import { Form } from '../core';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
+import { InputLine } from '../core/Line';
 
 export enum GainType {
   ShortTerm = 'ST',
index 4f575df32ea41830544cb4e7ecc9ec79043dd38d..53ee8cd950ab05d3d068bd40192e56875540ab19 100644 (file)
@@ -1,6 +1,6 @@
-import Form from '../Form';
-import { InputLine } from '../Line';
-import Person from '../Person';
+import { Form } from '../core';
+import { InputLine } from '../core/Line';
+import { Person } from '../core';
 
 export interface Form1099DIVInput {
   payer: string;
index 5721cda7e2ece773411fe91a97733903601009c9..1e93e560793afb45abb9d635b2b0808b0ee2ce0c 100644 (file)
@@ -1,6 +1,6 @@
-import Form from '../Form';
-import { InputLine } from '../Line';
-import Person from '../Person';
+import { Form } from '../core';
+import { InputLine } from '../core/Line';
+import { Person } from '../core';
 
 export interface Form1099INTInput {
   payer: string;
index 631a7df001237fe631161fd84347cbfecce4a2c8..cfe2f372fd28927061adfb3c0650ddb85cc027db 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
-import { InputLine } from '../Line';
+import { Form } from '../core';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
+import { InputLine } from '../core/Line';
 
 export enum Box7Code {
   _1  = '1',  // Early distribution, no known exception
index 99ada28743081167fc26ace7a2371090ec75d3b3..6a4d705b32c722b7d0a7733bf844a5111b581407 100644 (file)
@@ -1,6 +1,6 @@
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
-import { UnsupportedFeatureError } from '../Errors';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
+import { UnsupportedFeatureError } from '../core/Errors';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form1116, { ForeignIncomeCategory } from './Form1116';
index 5d8246671ebd723078e0f2dae8a35e4cf1c8cd81..e9c0aae71b59b264788ac5ef43915916828a6c04 100644 (file)
@@ -1,9 +1,9 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
-import { ComputedLine, InputLine, ReferenceLine } from '../Line';
-import { UnsupportedFeatureError } from '../Errors';
-import { reduceBySum } from '../Math';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
+import { ComputedLine, InputLine, ReferenceLine } from '../core/Line';
+import { UnsupportedFeatureError } from '../core/Errors';
+import { reduceBySum } from '../core/Math';
 
 import Form1040 from './Form1040';
 import Form8949 from './Form8949';
index 90047a174da14b6d8c54293554f300cefd366503..2e276d4177c7fcd05f9e7cf2fac1c38f6da3ee8c 100644 (file)
@@ -1,5 +1,5 @@
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form8606 from './Form8606';
index 61490840e765afa64f4e6e7fa82dc48116cf24b8..95fde541e28134f1f3f357b3a19eb53802b20b82 100644 (file)
@@ -1,8 +1,8 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
-import { Line, AccumulatorLine, ComputedLine, InputLine, ReferenceLine } from '../Line';
-import { clampToZero } from '../Math';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
+import { Line, AccumulatorLine, ComputedLine, InputLine, ReferenceLine } from '../core/Line';
+import { clampToZero } from '../core/Math';
 
 export interface Form8606Input {
   person: Person;
index d966e33ce73017e2f986f4c4817fd50d3da297fa..ffc82b7da38be364923a96e3622c9f9da82412df 100644 (file)
@@ -1,5 +1,5 @@
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form1099B, { GainType } from './Form1099B';
index 944061fa0d451abae107b95c4ef917f9723ab95c..1c581c3f41e11f237a2e87de1f3aeceed7fa13da 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
-import { Line, InputLine, ComputedLine, sumLineOfForms } from '../Line';
+import { Form } from '../core';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
+import { Line, InputLine, ComputedLine, sumLineOfForms } from '../core/Line';
 
 import Form1099B, { GainType } from './Form1099B';
 
index ed55f94c1eb537113685fccd414c4daeb08abb0c..a17117eeb7e5912beec439aaa2035b1671dc5fc2 100644 (file)
@@ -1,5 +1,5 @@
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
 
 import FormW2 from './FormW2';
 import Form8959 from './Form8959';
index 2c3e76861867276da6316db9f12bf1735564a2cf..b4e38890f0fc36a1a49feae76d8c616088e1b074 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import { Line, AccumulatorLine, ComputedLine, ReferenceLine } from '../Line';
-import { clampToZero } from '../Math';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { Line, AccumulatorLine, ComputedLine, ReferenceLine } from '../core/Line';
+import { clampToZero } from '../core/Math';
 
 import Form1040, { FilingStatus } from './Form1040';
 import FormW2 from './FormW2';
index d77cebad4b530cf9b24863762a674eb90365c703..3eebf66c8b294d0dd3a143343d44f15c63bb6133 100644 (file)
@@ -1,5 +1,5 @@
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
 
 import FormW2 from './FormW2';
 import Form1040, { FilingStatus } from './Form1040';
index 9d732207fe266a58e66b0724f92b381badfa0439..6bd1e0c221e4fa6bbeff6719e2389e24602c7b71 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import { ComputedLine, ReferenceLine } from '../Line';
-import { clampToZero } from '../Math';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { ComputedLine, ReferenceLine } from '../core/Line';
+import { clampToZero } from '../core/Math';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Schedule1 from './Schedule1';
index 5b02b267e7c5526f6b23d2636599f2e7c79ef89e..5b260d2e20eef56bcdba73c8cafe13a1f58e42f7 100644 (file)
@@ -1,6 +1,6 @@
 import W2 from './FormW2';
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
 
 test('input', () => {
   const p = Person.self('Bob');
index b9558e4baca4de0b42987a9d18240a5672f40fa9..a554c5b8a43ce5ee3f809616ba1a74254ce2193d 100644 (file)
@@ -1,6 +1,6 @@
-import Form from '../Form';
-import { Line, InputLine } from '../Line';
-import Person from '../Person';
+import { Form } from '../core';
+import { Line, InputLine } from '../core/Line';
+import { Person } from '../core';
 
 export enum Box13 {
   StatutoryEmployee,
index 117ef9203710c9dcc8ea01418d1db22b5b67976e..88fd60bd8e4774012f64c31cc3865f50e6a41d43 100644 (file)
@@ -1,6 +1,6 @@
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
-import { UnsupportedFeatureError } from '../Errors';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
+import { UnsupportedFeatureError } from '../core/Errors';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Schedule1, { Schedule1Input } from './Schedule1';
index 4d0bb0edd0213111c4ce567834a73f73246771fc..7bd817e32bdbe0287e4aa99374418299a65f9426 100644 (file)
@@ -1,8 +1,8 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import { ComputedLine, InputLine } from '../Line';
-import { NotFoundError, UnsupportedFeatureError } from '../Errors';
-import { undefinedToZero } from '../Math';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { ComputedLine, InputLine } from '../core/Line';
+import { NotFoundError, UnsupportedFeatureError } from '../core/Errors';
+import { undefinedToZero } from '../core/Math';
 
 import Form1040 from './Form1040';
 
index 58863b4d402d61f15f168f9202e02ef63d65c0b1..ec0103cd2181d6d32681f48d61e7365f45fc3b77 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import { ComputedLine } from '../Line';
-import { UnsupportedFeatureError } from '../Errors';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { ComputedLine } from '../core/Line';
+import { UnsupportedFeatureError } from '../core/Errors';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form1099DIV from './Form1099DIV';
index a22507cf0fbe78ef1db46550f4501e3c616cc42e..25b2ecd5ae1b41d41cc18b9a9d6f4b8036dfa701 100644 (file)
@@ -1,6 +1,6 @@
-import TaxReturn from '../TaxReturn';
-import Person from '../Person';
-import { NotFoundError } from '../Errors';
+import { TaxReturn } from '../core';
+import { Person } from '../core';
+import { NotFoundError } from '../core/Errors';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form1099DIV from './Form1099DIV';
index c9fed018f33cc7e61094bb7a18f70d594e8dd996..1e36975a3c670e7eb158de3ac42d1b65e1370115 100644 (file)
@@ -1,7 +1,7 @@
-import Form from '../Form';
-import TaxReturn from '../TaxReturn';
-import { AccumulatorLine, ComputedLine, InputLine, ReferenceLine } from '../Line';
-import { NotFoundError, UnsupportedFeatureError } from '../Errors';
+import { Form } from '../core';
+import { TaxReturn } from '../core';
+import { AccumulatorLine, ComputedLine, InputLine, ReferenceLine } from '../core/Line';
+import { NotFoundError, UnsupportedFeatureError } from '../core/Errors';
 
 import Form1040, { FilingStatus } from './Form1040';
 import Form1099DIV from './Form1099DIV';
index f36e47f90a7044def5dabccec4d3f9d17a92e85c..748ce5afebea34b1e9e6b592de170c5a19f72415 100644 (file)
@@ -1,9 +1,9 @@
-import Form from '../Form';
-import Person from '../Person';
-import TaxReturn from '../TaxReturn';
-import { Line, AccumulatorLine, ComputedLine, ReferenceLine, sumLineOfForms } from '../Line';
-import { clampToZero } from '../Math';
-import { UnsupportedFeatureError } from '../Errors';
+import { Form } from '../core';
+import { Person } from '../core';
+import { TaxReturn } from '../core';
+import { Line, AccumulatorLine, ComputedLine, ReferenceLine, sumLineOfForms } from '../core/Line';
+import { clampToZero } from '../core/Math';
+import { UnsupportedFeatureError } from '../core/Errors';
 
 import Form8949, { Form8949Box } from './Form8949';
 import Form1099DIV from './Form1099DIV';
diff --git a/src/fed2019/index.ts b/src/fed2019/index.ts
new file mode 100644 (file)
index 0000000..e972492
--- /dev/null
@@ -0,0 +1,22 @@
+export { default as Form1040 } from './Form1040';
+export { default as Form1099B } from './Form1099B';
+export { default as Form1099DIV } from './Form1099DIV';
+export { default as Form1099INT } from './Form1099INT';
+export { default as Form1099R } from './Form1099R';
+export { default as Form1116 } from './Form1116';
+export { default as Form8606 } from './Form8606';
+export { default as Form8949 } from './Form8949';
+export { default as Form8959 } from './Form8959';
+export { default as Form8960 } from './Form8960';
+export { default as Schedule1 } from './Schedule1';
+export { default as Schedule2 } from './Schedule2';
+export { default as Schedule3 } from './Schedule3';
+export { default as ScheduleD } from './ScheduleD';
+export { default as W2 } from './FormW2';
+
+export * from './Form1040';
+export * from './Form1099B';
+export * from './Form1099R';
+export * from './Form1116';
+export * from './Form8949';
+export * from './FormW2';
index 5f6298c0f6fc4eb7b7e2cfa5b695319279d4faa0..21f09e2e41c388ff4ee6c9b571377379dbdf207b 100644 (file)
@@ -1,4 +1,2 @@
-import Person from './Person';
-import TaxReturn from './TaxReturn';
-
-export { Person, TaxReturn };
+import './core';
+import './fed2019';