Skip to content

Commit f51c707

Browse files
committed
feat: exporting factories and types
1 parent 8274812 commit f51c707

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"name": "@govtechsg/document-store",
33
"version": "1.0.0",
4-
"main": "dist/index.js",
54
"files": [
65
"dist",
76
"src",
87
"types",
98
"truffle-config.js"
109
],
11-
"types": "dist/ts",
10+
"main": "dist/index.js",
11+
"types": "dist/ts/index.d.ts",
1212
"repository": "git@github.com:Open-Attestation/document-store-contract.git",
1313
"author": "GovTech",
1414
"license": "Apache-2.0",
1515
"scripts": {
1616
"build:sol": "truffle build",
1717
"build:js:copy-src": "babel src -d dist --ignore src/**/*.spec.ts,src/**/*.test.ts -x .js,.ts,.tsx --copy-files",
18-
"build:js": "tsc --emitDeclarationOnly && npm run build:js:copy-src",
18+
"build:js:copy-types": "cp src/contracts/*.d.ts dist/ts/contracts",
19+
"build:js": "tsc --emitDeclarationOnly && npm run build:js:copy-src && npm run build:js:copy-types",
1920
"build": "npm run build:sol && npm run build:js",
2021
"commit": "git-cz",
2122
"commit:retry": "npm run commit -- --retry",

src/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe("deployAndWait", () => {
3535
describe("connect", () => {
3636
it("connects to existing contract", async () => {
3737
const {address} = await deployAndWait("My Store", signer, {documentStoreCreatorAddressOverride});
38+
console.log(address);
3839
const instance = await connect(address, signer);
3940
const owner = await instance.owner();
4041
expect(owner).toBe(account);

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ export const connect = async (address: string, signerOrProvider: Signer | provid
2727
return DocumentStoreFactory.connect(address, signerOrProvider);
2828
};
2929

30+
export {DocumentStore} from "./contracts/DocumentStore";
3031
export {DocumentStoreFactory} from "./contracts/DocumentStoreFactory";
32+
export {DocumentStoreCreator} from "./contracts/DocumentStoreCreator";
33+
export {DocumentStoreCreatorFactory} from "./contracts/DocumentStoreCreatorFactory";

0 commit comments

Comments
 (0)