chore: export compiled artifact (#107)

This commit is contained in:
Zak Angelle 2021-04-16 18:09:56 -05:00 committed by GitHub
parent e961003b2e
commit 58720252b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 10 deletions

7
index.d.ts vendored
View File

@ -1,5 +1,4 @@
import { Protocol } from "./types"; declare module "@boardroom/protocol-info" {
function protocolInfo(): void;
declare module "boardroomInfo" { export = protocolInfo;
export = Protocol;
} }

View File

@ -2,7 +2,8 @@
"name": "@boardroom/protocol-info", "name": "@boardroom/protocol-info",
"version": "2.1.2", "version": "2.1.2",
"description": "Project information which will be served to display on the Boardroom Governance Portal.", "description": "Project information which will be served to display on the Boardroom Governance Portal.",
"main": "dist/index.ts", "main": "dist/index.js",
"typings": "dist/index.d.ts",
"repository": "https://github.com/boardroom-inc/protocol-Info.git", "repository": "https://github.com/boardroom-inc/protocol-Info.git",
"author": "sudheer <sudheer.105@gmail.com>", "author": "sudheer <sudheer.105@gmail.com>",
"license": "MIT", "license": "MIT",
@ -18,7 +19,7 @@
"typescript": "^4.1.3" "typescript": "^4.1.3"
}, },
"scripts": { "scripts": {
"build": "ts-node ./scripts/build.ts", "build": "ts-node ./scripts/build.ts && tsc -d",
"prepare": "yarn build", "prepare": "yarn build",
"validate": "yarn build && ts-node ./scripts/validate.ts" "validate": "yarn build && ts-node ./scripts/validate.ts"
} }

View File

@ -8,9 +8,12 @@ const protocolInfo = protocols.map((protocol) =>
); );
mkdirp.sync("./dist"); mkdirp.sync("./dist");
fs.copyFileSync("./index.d.ts", "./dist/index.d.ts");
fs.copyFileSync("./types.ts", "./dist/types.ts"); fs.copyFileSync("./types.ts", "./dist/types.ts");
fs.writeFileSync( fs.writeFileSync(
"./dist/index.ts", "./dist/index.ts",
`export default [${protocolInfo.toString()}];` `
import { Protocol } from "../types";
export default [${protocolInfo.toString()}] as Protocol[];
`
); );

View File

@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"module": "commonjs", "module": "commonjs",
"outDir": "dist", "outDir": ".",
"strict": true, "strict": true,
"noImplicitAny": true, "noImplicitAny": true,
"strictNullChecks": true, "strictNullChecks": true,
@ -10,5 +10,7 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"esModuleInterop": true, "esModuleInterop": true,
"resolveJsonModule": true "resolveJsonModule": true
} },
"include": ["./dist"],
"exclude": ["./node_modules"]
} }