-
Notifications
You must be signed in to change notification settings - Fork 85
Conversation
Added very rough lerna build, still lots to do, but packages are split and building. Instructions are:
Things still to do (non-complete list):
|
Implemented lerna build in the best way possible (I hope 😃):
This combination allows running tests or dev/debug build in watch mode for easier development and is producing loosely coupled Instruction:
Things I still plan to do:
Except for these things it's ready for some review (just to confirm that approach taken is good one). |
Fixed docker build, but not sure what's with circleCI. |
Technically everything should be complete, but CircleCI tests are timing out for some reason (work locally and don't take too much time). Cannot troubleshoot this as output is truncated. |
Cause for failure was that it was requesting too many workers and correspondingly allocating too much memory. Fixed by limiting workers to 2. |
@evgeniuz thanks for the submission! I fixed the jest configuration to honor the worker limitation (not sure where this came from), and updated all versions. Could you please integrate these changes on your branch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few initial comments.
@@ -8,6 +8,8 @@ export type EthqlServiceDefinition<Config, Service> = { | |||
}; | |||
}; | |||
|
|||
export interface EthqlServiceDefinitions {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface is extended in every service but had no "empty" definition. This caused problem compiling @ethql/base
as there is just one service and it's not imported anywhere in itself (it's imported in ethql
package, but since we need to be able to build @ethql/base
in isolation, this is not relevant here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add: this empty definition makes sense here as it should be object where keys are services, and without any services defined it would be an empty object (that later can be extended).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
packages/ens/src/index.ts
Outdated
import resolvers from './resolvers'; | ||
|
||
import {} from '@ethql/base/dist/core/services/web3'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's incorrect to import compiled javascript from a Typescript file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s correct way to approach this: if you intend to publish all packages on NPM, there will be no TS sources in packages, only compiled files. So if we refer to TS files, these imports will be unresolved when installed from NPM.
No types information is lost, as all those compiled files always have accompanying .d.ts with them.
Ideally, base package should export single index.ts file that will contain all other exports in it to remove paths and just import @ethql/base everywhere, but I think this should be done after this PR is integrated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And tsc build mode intended to work with this approach: it checks if referenced compiled import is present and if not present it builds it from TS.
packages/ens/src/index.ts
Outdated
import resolvers from './resolvers'; | ||
|
||
import {} from '@ethql/base/dist/core/services/web3'; | ||
import {} from './services/ens'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I get this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has similar cause to EthqlServiceDefinitions
change. plugin: EthqlPluginFactory
has references to both ens
service and web3
service, but those are not imported at this point, so TS complains that there are no web3
EthqlServiceDefinition
defined. So we need to import this file here. Basically, we need to import file that defines service if we depend on it.
@raulk Rebased on top of recent master changes. |
Are there any changes I need to implement here? |
I pushed a commit a few days ago performing some further refactor, but didn't have time to comment on it. Here it goes:
|
Just pushed a few more commits to rationalise the build commands; hopefully it'll now pass on CI. I also fixed the Dockerfile. |
Fixes #107