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

Fix type declerations #24

Merged
merged 4 commits into from
May 22, 2018
Merged

Fix type declerations #24

merged 4 commits into from
May 22, 2018

Conversation

andrew-w-ross
Copy link
Contributor

@andrew-w-ross andrew-w-ross commented May 12, 2018

Added '~' path to refer to ./src in tsconfig
Changed jest module resolution to understand that ~ referes to ./src
Added ttypescript and @zerollup/ts-transform-paths to transform paths
Changed build:types task to use ttsc with transform.
fixes prismake/typegql/issues/#23

Changed jest module resolution to understand that `~` referes to `./src`
Added `ttypescript` and `@zerollup/ts-transform-paths` to transform paths
Changed `build:types` task to use `ttsc` with transform.
fixes #/issues/23
@codecov
Copy link

codecov bot commented May 12, 2018

Codecov Report

Merging #24 into master will decrease coverage by 0.03%.
The diff coverage is 86.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
- Coverage   86.92%   86.88%   -0.04%     
==========================================
  Files          62       62              
  Lines        1086     1083       -3     
  Branches      188      188              
==========================================
- Hits          944      941       -3     
  Misses        141      141              
  Partials        1        1
Impacted Files Coverage Δ
src/domains/inputField/compiler/index.ts 91.66% <ø> (ø) ⬆️
src/domains/field/compiler/services.ts 88.88% <ø> (ø) ⬆️
src/domains/objectType/compiler/objectType.ts 83.33% <0%> (ø) ⬆️
src/domains/inputObjectType/compiler/objectType.ts 76.66% <0%> (ø) ⬆️
src/domains/field/registry.ts 100% <100%> (ø) ⬆️
src/domains/inputField/compiler/fieldType.ts 64.28% <100%> (ø) ⬆️
src/domains/hooks/registry.ts 86.66% <100%> (ø) ⬆️
src/domains/arg/registry.ts 100% <100%> (ø) ⬆️
src/domains/schema/registry.ts 100% <100%> (ø) ⬆️
src/domains/field/compiler/resolver.ts 91.02% <100%> (ø) ⬆️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f23daef...6195f2a. Read the comment docs.

@pie6k
Copy link
Collaborator

pie6k commented May 13, 2018

Hey, thanks a lot.

While I'll propably agree anyway - but could you describe motivation behind this change a bit?

Also, in many places you're using tabs instead of spaces in code formatting. Could you try to follow used convention?

Thanks again

@andrew-w-ross
Copy link
Contributor Author

Hey @pie6k,

If you look at #23 the emitted definitions aren't usable when imported to another project. This is because of this issue.

To fix that I added a transform to fix the emitted declarations and make them relative.. I described that build by adding the ttsconfig.json and changing the build:emit task to use that ttsc with that config.

As for the path change, I used ~ to refer to root. It was hard to distinguish when if you are importing a package or project files. When reading the code now it's a lot easier to see that ~/domains refers to a the src/domains vs domains that looks like a package. Also I'm not entirely sure the path transform could work without it.

@andrew-w-ross
Copy link
Contributor Author

@pie6k I've sorted out the tabs to spaces issues. Anything else needed to get this pr merged in?

@pie6k
Copy link
Collaborator

pie6k commented May 15, 2018

I'll make sure everything works and try to merge it tomorrow ;)

@andrew-w-ross
Copy link
Contributor Author

Thanks

@pie6k
Copy link
Collaborator

pie6k commented May 17, 2018

@andrew-w-ross hey, let me know if you'd be able to fix those tabs thing ;)

@andrew-w-ross
Copy link
Contributor Author

@pie6k That should be all of them.

Copy link
Collaborator

@pie6k pie6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still tabs instead of spaces :)

compileInputObjectType,
} from 'domains';
import { enumsRegistry, unionRegistry } from 'domains';
objectTypeRegistry,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still tabs here instead of spaces - do you use prettier? :) I think I'll add it to auto-format project on every commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to put the blame completely on vscode here. Apparently when using regex namely \t only checks the currently opened file or recently opened, I'm not entirely sure. Also tried prettier for a bit, wasn't bad.

return input;
}
if (isType(input)) {
return input;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs again, I'll not comment every place with tabs :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taaaaaabsss

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok that's all the tabs I could find.

return unionRegistry.get(input)();
}
if (unionRegistry.has(input)) {
return unionRegistry.get(input)();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

tabsssssss

@andrew-w-ross
Copy link
Contributor Author

@pie6k I've just double checked using several other text editors and \t is not to be found.

@pie6k pie6k merged commit 45d92e0 into prismake:master May 22, 2018
@andrew-w-ross andrew-w-ross deleted the type-decleration-fix branch May 22, 2018 12:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants