Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly declare and import type definitions #41

Open
mgred opened this issue Apr 8, 2018 · 13 comments
Open

Properly declare and import type definitions #41

mgred opened this issue Apr 8, 2018 · 13 comments
Assignees

Comments

@mgred
Copy link
Collaborator

mgred commented Apr 8, 2018

Run tsc -p .

tsconfig.json(49,5): error TS5023: Unknown compiler option 'esModuleInterop'.
src/auth.ts(36,33): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(36,65): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(41,33): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(41,66): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(46,33): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(46,64): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(51,33): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(51,68): error TS2339: Property 'auth' does not exist on type 'Config'.
src/auth.ts(55,24): error TS2339: Property 'auth' does not exist on type 'Config'.
src/core/core.ts(77,60): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Route'.
src/core/core.ts(133,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
src/core/custom-route.ts(4,10): error TS2339: Property 'route' does not exist on type 'CustomRoute'.
src/core/custom-route.ts(11,10): error TS2339: Property 'config' does not exist on type 'CustomRoute'.
src/core/custom-route.ts(25,51): error TS2339: Property 'config' does not exist on type 'CustomRoute'.
src/core/custom-route.ts(28,46): error TS2339: Property 'config' does not exist on type 'CustomRoute'.
src/core/custom-route.ts(70,17): error TS2339: Property 'route' does not exist on type 'CustomRoute'.
src/core/custom-route.ts(79,17): error TS2339: Property 'route' does not exist on type 'CustomRoute'.
src/core/custom-route.ts(88,17): error TS2339: Property 'route' does not exist on type 'CustomRoute'.
src/core/request.ts(26,49): error TS2339: Property 'globalParameters' does not exist on type 'Config'.
src/core/request.ts(30,15): error TS2339: Property 'params' does not exist on type 'object'.
src/core/request.ts(30,57): error TS2339: Property 'globalParameters' does not exist on type 'Config'.
src/core/request.ts(45,5): error TS2322: Type 'string' is not assignable to type 'RequestType'.
src/core/request.ts(79,22): error TS2339: Property 'allowedRequestTypes' does not exist on type 'Config'.
src/core/request.ts(81,80): error TS2339: Property 'allowedRequestTypes' does not exist on type 'Config'.
src/core/request.ts(241,24): error TS2339: Property 'beforeRequest' does not exist on type 'Config'.
src/core/request.ts(251,17): error TS2339: Property 'afterRequest' does not exist on type 'Config'.
src/core/request.ts(261,17): error TS2339: Property 'onError' does not exist on type 'Config'.
src/core/url.ts(4,8): error TS6133: 'store' is declared but its value is never read.
src/core/url.ts(4,19): error TS2307: Cannot find module '../store/index'.
src/core/url.ts(28,21): error TS2339: Property 'extension' does not exist on type 'Config'.
src/core/url.ts(29,30): error TS2339: Property 'extension' does not exist on type 'Config'.
src/debug/debugger.ts(5,10): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(6,10): error TS2339: Property 'data' does not exist on type 'default'.
src/debug/debugger.ts(7,10): error TS2339: Property 'logEnabled' does not exist on type 'default'.
src/debug/debugger.ts(11,25): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(14,5): error TS2556: Expected 2-4 arguments, but got a minimum of 0.
src/debug/debugger.ts(16,14): error TS2339: Property 'logEnabled' does not exist on type 'default'.
src/debug/debugger.ts(17,12): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(17,40): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(18,12): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(21,10): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(30,22): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(30,47): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(32,32): error TS2339: Property 'params' does not exist on type '{}'.
src/debug/debugger.ts(35,22): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(35,47): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(38,20): error TS2339: Property 'caller' does not exist on type 'default'.
src/debug/debugger.ts(40,10): error TS2339: Property 'data' does not exist on type 'default'.
src/debug/debugger.ts(46,10): error TS2339: Property 'data' does not exist on type 'default'.
src/rapid.ts(4,1): error TS2304: Cannot find name 'module'.
src/rapid.ts(5,1): error TS2304: Cannot find name 'module'.
src/rapid.ts(6,1): error TS2304: Cannot find name 'module'.
@mgred mgred self-assigned this Apr 8, 2018
@mgred
Copy link
Collaborator Author

mgred commented Apr 8, 2018

@drewjbartlett, @yihou I would start fixing these errors

@mgred
Copy link
Collaborator Author

mgred commented Apr 8, 2018

mgred added a commit to mgred/rapid.js that referenced this issue Apr 8, 2018
also adds path to nodes dir to compiler options
see: rapidjs#41
mgred added a commit to mgred/rapid.js that referenced this issue Apr 8, 2018
mgred added a commit to mgred/rapid.js that referenced this issue Apr 8, 2018
mgred added a commit to mgred/rapid.js that referenced this issue Apr 8, 2018
mgred added a commit to mgred/rapid.js that referenced this issue Apr 8, 2018
mgred added a commit to mgred/rapid.js that referenced this issue Apr 8, 2018
@mgred mgred mentioned this issue Apr 10, 2018
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
See: rapidjs#41

* Renamed to CustomeRouteOptions
* Put the interface to custome-route.ts, so we can kill
custom-route.d.ts
* Adopt change in all other files
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
rapidjs#41
* add AuthConfig interface to config.d.ts
* kill auth-config.d.ts
* adopt the changes
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
See: rapidjs#41
* merge RequestType, RequestData into core/request.ts
* remove typings/request.d.ts
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
See: rapidjs#41
* relocate to src/core
* adopt changes in depending files
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
See: rapidjs#41
* relocate interface to src/core
* remove typings dir
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
See: rapidjs#41
* add missing files to commit
mgred added a commit to mgred/rapid.js that referenced this issue Apr 30, 2018
See: rapidjs#41
* add missing files to commit
@mgred
Copy link
Collaborator Author

mgred commented May 2, 2018

I refactored so far to get rid of the typings directory.

mgred added a commit to mgred/rapid.js that referenced this issue May 2, 2018
rapidjs#41
* This will then compile js files to dist
mgred added a commit to mgred/rapid.js that referenced this issue May 2, 2018
rapidjs#41
* Set path to main types rapid.d.ts
mgred added a commit to mgred/rapid.js that referenced this issue May 2, 2018
mgred added a commit to mgred/rapid.js that referenced this issue May 2, 2018
mgred added a commit to mgred/rapid.js that referenced this issue May 2, 2018
@drewjbartlett
Copy link
Collaborator

@mgred you are the man thank you! Sorry for the delay. Just got back from a trip. Will have a look at this asap!

@drewjbartlett
Copy link
Collaborator

@mgred I know it has been forever since I have followed up with this -- finally had a moment to dive in here and honestly I am just a little lost on how I can get my tests to start passing. Do you have any thoughts?

@drewjbartlett
Copy link
Collaborator

screen shot 2018-05-18 at 11 14 36 am

screen shot 2018-05-18 at 11 14 58 am

@mgred That is the test file, that is the output. As soon as I add the line for Core, it stops working. This is what is holding me up from finishing this :(

@mgred
Copy link
Collaborator Author

mgred commented May 19, 2018

@drewjbartlett I'm on a trip currently and will have look this evening.

@drewjbartlett
Copy link
Collaborator

@mgred no worrries/rush at all :D

@mgred
Copy link
Collaborator Author

mgred commented May 19, 2018

@drewjbartlett I switched to my branch rapidjs-41 where I made some refactorings. The test passes more or less but the promise seems not be handled correctly.
test
I still don't know why it's not working on our main refactoring branch v2-refactor, but I will investigate. Maybe It's just some setting in the tsconfig.json which also used by Jest.

@drewjbartlett
Copy link
Collaborator

ah that would make sense! That's good news you can get it working partially! I really appreciate all the help @mgred

@drewjbartlett
Copy link
Collaborator

@mgred I have been thinking a bit and I need to be able to easily test this. TS is not allowing me to do this easily. If I can't get this figured out soon the reality is that v2 will not happen. I am feeling a little discouraged at committing fully to TS before fully understanding it and getting a solid workflow in place.

I appreciate all the work everyone is putting in but I just can't get caught up in the build tools, etc. Lemme know if you have any suggestions :)

@mgred
Copy link
Collaborator Author

mgred commented May 22, 2018

@drewjbartlett I still try to figure out why the tests are not running on the main refactoring branch, I updated the tsconfig.json to be like the one on my branch rapid.js-41

{
"module" : "commonjs",
"noEmit": false
}

but still it shows the same error. I will give you the MR for this issue/branch. You can then continue with a working build and test environment as far as I can say

@mgred
Copy link
Collaborator Author

mgred commented May 22, 2018

#45

This was referenced May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants