gristlabs / ts-interface-builder

Compile TypeScript interfaces into a description that allows runtime validation
Apache License 2.0
132 stars 28 forks source link

feat: globbing gristlabs#33 #35

Closed rattkin closed 3 years ago

rattkin commented 3 years ago

I did the simplification you suggested. I'm not that good with syntax yet to do something like it myself, sorry.

the test is failing on lib/macro.ts I didn't touch. What gives?

lib/macro.ts:51:3 - error TS2531: Object is possibly 'null'.
51   programPath.scope.rename(tsInterfaceCheckerIdentifier);
     ~~~~~~~~~~~
lib/macro.ts:52:3 - error TS2531: Object is possibly 'null'.
52   programPath.scope.rename(onceIdentifier);
     ~~~~~~~~~~~
lib/macro.ts:130:6 - error TS2531: Object is possibly 'null'.
130     (programPath.get("body.0") as NodePath).insertBefore(statement);
         ~~~~~~~~~~~
rattkin commented 3 years ago

Can I do something please to move this forward? Do I submit the PR again?

dsagal commented 3 years ago

Thank you @rattkin and thank you @zenflow for the help!! The diff looks good now!

I agree with @zenflow on the last cosmetic tweak (inline ([] as string[])), so if you don't mind to make it, I'll wait for that before merging in.

zenflow commented 3 years ago

Looks like there is a new (empty) file added named git.. this should probably be removed

dsagal commented 3 years ago

OK, I am not sure myself how to add a tweak to this PR. I'll land as is and follow up with a minor commit, to clean up the stray file and clarify the import statement.

rattkin commented 3 years ago

Thanks guys!