Skip to content

Commit

Permalink
refactor: remap ts typings from types to lib
Browse files Browse the repository at this point in the history
This was necessary because if we import JSON files and
then re-use their schema as types, then the d.ts files
will need to have access to said JSON file which does
not happen if the typings and the actual .js code are
in separate directories because then the relative paths
are not working as they should.

Moving the lib and the types together means that now
the d.ts files can import with the same relative paths
that the orignial source code (.ts files) can as well.

Signed-off-by: Youngone Lee <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
  • Loading branch information
Leeyoungone authored and petermetz committed Aug 13, 2021
1 parent 3d68fe3 commit 22eac9a
Show file tree
Hide file tree
Showing 64 changed files with 128 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-example-carbon-accounting-backend.web.umd.js",
"browserMinified": "dist/cactus-example-carbon-accounting-backend.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -99,4 +99,4 @@
"http-status-codes": "2.1.4",
"jose": "1.27.2"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import {
ICarbonAccountingFabricContractDeploymentInfo,
ICarbonAccountingXdaiContractDeploymentInfo,
} from "@hyperledger/cactus-example-carbon-accounting-business-logic-plugin/dist/types/main/typescript/i-carbon-accounting-contract-deployment-info";
} from "@hyperledger/cactus-example-carbon-accounting-business-logic-plugin/dist/lib/main/typescript/i-carbon-accounting-contract-deployment-info";

export interface ICarbonAccountingAppDummyInfrastructureOptions {
logLevel?: LogLevelDesc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-example-carbon-accounting-backend.tsbuildinfo"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-example-carbon-accounting-business-logic-plugin.web.umd.js",
"browserMinified": "dist/cactus-example-carbon-accounting-business-logic-plugin.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -92,4 +92,4 @@
"@types/ssh2": "0.5.46",
"@types/uuid": "8.0.1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-example-carbon-accounting-business-logic-plugin.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/cactus-example-supply-chain-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-example-supply-chain-backend.web.umd.js",
"browserMinified": "dist/cactus-example-supply-chain-backend.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -91,4 +91,4 @@
"@types/express": "4.17.8",
"@types/uuid": "8.0.1"
}
}
}
2 changes: 1 addition & 1 deletion examples/cactus-example-supply-chain-backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-example-supply-chain-backend.tsbuildinfo"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-example-supply-chain-business-logic-plugin.web.umd.js",
"browserMinified": "dist/cactus-example-supply-chain-business-logic-plugin.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -93,4 +93,4 @@
"@types/ssh2": "0.5.46",
"@types/uuid": "8.0.1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-example-supply-chain-business-logic-plugin.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions extensions/cactus-plugin-object-store-ipfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-object-store-ipfs.web.umd.js",
"browserMinified": "dist/cactus-plugin-object-store-ipfs.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -87,4 +87,4 @@
"express": "4.17.1",
"ipfs-core-types": "0.5.0"
}
}
}
2 changes: 1 addition & 1 deletion extensions/cactus-plugin-object-store-ipfs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-object-store-ipfs.tsbuildinfo",
"skipLibCheck": true
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-api-client.web.umd.js",
"browserMinified": "dist/cactus-api-client.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -68,4 +68,4 @@
"@hyperledger/cactus-core-api": "0.7.0",
"@hyperledger/cactus-plugin-consortium-manual": "0.7.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-api-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-api-client.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-cmd-api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"browser": "dist/cactus-cmd-api-server.web.umd.js",
"browserMinified": "dist/cactus-cmd-api-server.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"scripts": {
"generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected",
"codegen:openapi": "npm run generate-sdk",
Expand Down Expand Up @@ -120,4 +120,4 @@
"@types/uuid": "7.0.2",
"@types/xml2js": "0.4.8"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-cmd-api-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-cmd-api-server.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-common.web.umd.js",
"browserMinified": "dist/cactus-common.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -76,4 +76,4 @@
"@types/uuid": "8.3.0",
"uuid": "8.3.1"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-common.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-core-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-core-api.web.umd.js",
"browserMinified": "dist/cactus-core-api.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -80,4 +80,4 @@
"@hyperledger/cactus-common": "0.7.0",
"axios": "0.21.1"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-core-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-core-api.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-core.web.umd.js",
"browserMinified": "dist/cactus-core.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -73,4 +73,4 @@
"@types/express": "4.17.8",
"uuid": "8.3.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"resolveJsonModule": true,
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-core.tsbuildinfo"
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-plugin-consortium-manual/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-consortium-manual.web.umd.js",
"browserMinified": "dist/cactus-plugin-consortium-manual.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -89,4 +89,4 @@
"@types/json-stable-stringify": "1.0.32",
"@types/uuid": "8.3.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-plugin-consortium-manual/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-consortium-manual.tsbuildinfo"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-htlc-eth-besu-erc20/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-htlc-eth-besu-erc20.web.umd.js",
"browserMinified": "dist/cactus-plugin-htlc-eth-besu-erc20.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-htlc-eth-besu-erc20/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"resolveJsonModule": true,
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-htlc-eth-besu-erc20.tsbuildinfo"
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-htlc-eth-besu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-htlc-eth-besu.web.umd.js",
"browserMinified": "dist/cactus-plugin-htlc-eth-besu.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-htlc-eth-besu/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"resolveJsonModule": true,
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-htlc-eth-besu.tsbuildinfo"
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-aws-sm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-keychain-aws-sm.web.umd.js",
"browserMinified": "dist/cactus-plugin-keychain-aws-sm.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-aws-sm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-keychain-aws-sm.tsbuildinfo"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-azure-kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-keychain-azure-kv.web.umd.js",
"browserMinified": "dist/cactus-plugin-keychain-azure-kv.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-azure-kv/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-keychain-azure-kv.tsbuildinfo"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-google-sm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-keychain-google-sm.web.umd.js",
"browserMinified": "dist/cactus-plugin-keychain-google-sm.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-google-sm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-keychain-google-sm.tsbuildinfo"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-plugin-keychain-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browser": "dist/cactus-plugin-keychain-memory.web.umd.js",
"browserMinified": "dist/cactus-plugin-keychain-memory.web.umd.min.js",
"module": "dist/lib/main/typescript/index.js",
"types": "dist/types/main/typescript/index.d.ts",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -83,4 +83,4 @@
"devDependencies": {
"@types/express": "4.17.8"
}
}
}
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-memory/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"outDir": "./dist/lib/",
"declarationDir": "dist/types",
"declarationDir": "dist/lib",
"rootDir": "./src",
"tsBuildInfoFile": "../../.build-cache/cactus-plugin-keychain-memory.tsbuildinfo"
},
Expand Down
Loading

0 comments on commit 22eac9a

Please sign in to comment.