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

Better typescript setup for monorepo #17

Merged
merged 15 commits into from
Sep 3, 2019
2 changes: 1 addition & 1 deletion packages/asset-registry/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"rootDir": "./",
"outDir": "./dist/js"
},
"include": ["./src/**/*", "./build/**/*.json"],
"include": ["./src/**/*", "./schemas/*.json", "./build/**/*.json"],
"references": [
{
"path": "../user-registry/tsconfig.build.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
createBlockchainProperties as issuerCreateBlockchainProperties
} from '@energyweb/origin';
import { Configuration, ContractEventHandler, EventHandlerManager } from '@energyweb/utils-general';
import { EthAccount } from '@energyweb/utils-general/dist/js/blockchain-facade/Configuration';
import Web3 from 'web3';

import { logger } from '../Logger';
Expand Down Expand Up @@ -67,7 +66,7 @@ export const initMatchingManager = async (controller: Controller, conf: Configur

export const createBlockchainConf = async (
blockchainSectionConfFile: IBlockchainDataSource,
matcherAccount: EthAccount
matcherAccount: Configuration.EthAccount
): Promise<Configuration.Entity> => {
const web3 = new Web3(blockchainSectionConfFile.web3Url);
const marketConf = await marketCreateBlockchainProperties(
Expand Down
4 changes: 2 additions & 2 deletions packages/market-matcher/src/schema-defs/MatcherConf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EthAccount } from '@energyweb/utils-general/dist/js/blockchain-facade/Configuration';
import { Configuration } from '@energyweb/utils-general';

export enum BlockchainDataSourceType {
Blockchain = 'BLOCKCHAIN'
Expand All @@ -20,7 +20,7 @@ export interface IBlockchainDataSource {
offChainDataSourceUrl: string;
marketContractLookupAddress: string;
originContractLookupAddress: string;
matcherAccount: EthAccount;
matcherAccount: Configuration.EthAccount;
}

export interface ISimulationDataSource {
Expand Down
2 changes: 1 addition & 1 deletion packages/market-matcher/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outDir": "./dist/js",
"types": ["mocha"]
},
"include": ["./src/**/*", "./src/test/*"],
"include": ["./src/**/*", "./src/test/*", "./schemas/**/*.json"],
"references": [
{
"path": "../user-registry/tsconfig.build.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/market/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"rootDir": "./",
"outDir": "./dist/js"
},
"include": ["./src/**/**/*", "./build/**/*.json"],
"include": ["./src/**/**/*", "./build/**/*.json", "./schemas/**/*.json"],
"references": [
{
"path": "../user-registry/tsconfig.build.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/origin/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"rootDir": "./",
"outDir": "./dist/js"
},
"include": ["./src/**/*", "./dist/ts/**/*", "./build/**/.json"],
"include": ["./src/**/*", "./dist/ts/**/*", "./build/**/*.json"],
"references": [
{
"path": "../user-registry/tsconfig.build.json"
Expand Down
1 change: 0 additions & 1 deletion packages/solar-simulator/.npmignore

This file was deleted.

1 change: 1 addition & 0 deletions packages/solar-simulator/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"composite": true,
"rootDir": "./",
"outDir": "./dist/js",
"types": ["node"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/user-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"main": "dist/js/src/index.js",
"files": [
"contracts",
"dist"
"dist/js/build",
"dist/js/src"
],
"directories": {
"test": "test"
Expand Down
6 changes: 3 additions & 3 deletions packages/user-registry/src/test/UserLogicFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('UserLogic Facade', () => {

delete user.configuration;

assert.deepEqual(user, {
assert.deepEqual<Partial<User>>(user, {
id: user1,
proofs: [],
organization: 'Testorganization',
Expand All @@ -131,7 +131,7 @@ describe('UserLogic Facade', () => {
const emptyAccount = await new User(user2, conf).sync();
delete emptyAccount.configuration;

assert.deepEqual(emptyAccount, {
assert.deepEqual<Partial<User>>(emptyAccount, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

id: user2,
proofs: [],
organization: '',
Expand All @@ -142,7 +142,7 @@ describe('UserLogic Facade', () => {
const adminAccount = await new User(accountDeployment, conf).sync();
delete adminAccount.configuration;

assert.deepEqual(adminAccount, {
assert.deepEqual<Partial<User>>(adminAccount, {
id: accountDeployment,
proofs: [],
organization: '',
Expand Down
Empty file removed packages/utils-demo/.npmignore
Empty file.
1 change: 0 additions & 1 deletion packages/utils-general/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@energyweb/utils-general",
"description": "",
"license": "GPL-3.0",
"author": "slock.it GmbH; Martin Kuechler, martin.kuechler@slock.it; Heiko Burkhardt, heiko.burkhardt@slock.it",
"homepage": "https://github.com/energywebfoundation/ewf-monorepo/packages/utils-general#readme",
"repository": {
"type": "git",
Expand Down