Skip to content

Commit

Permalink
fix: postinstall script to build client lib if needed, add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x committed Aug 20, 2020
1 parent 06f485b commit 868c98f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @stacks/blockchain-api-client
[![NPM Package](https://img.shields.io/npm/v/@stacks/blockchain-api-client.svg?style=flat-square)](https://www.npmjs.org/package/@stacks/blockchain-api-client)
[![Build Status](https://github.com/blockstack/stacks-blockchain-api/workflows/Build/badge.svg)](https://github.com/blockstack/stacks-blockchain-api/actions)

Client for the Stacks Blockchain API.

### Known Issues

* The TypeScript definitions for several objects involving type unions, including transactions, are incorrectly specified as only `object`.
15 changes: 12 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@
"name": "@stacks/blockchain-api-client",
"version": "0.1.0",
"access": "public",
"description": "TypeScript client for the Stacks Blockchain API",
"description": "Client for the Stacks Blockchain API",
"homepage": "https://github.com/blockstack/stacks-blockchain-api/tree/master/client#readme",
"author": "Blockstack PBC <engineering@blockstack.com> (https://blockstack.org)",
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/blockstack/stacks-blockchain-api.git"
},
"bugs": {
"url": "https://github.com/blockstack/stacks-blockchain-api/issues"
},
"main": "lib/index.js",
"unpkg": "lib/index.umd.js",
"scripts": {
"prepublishOnly": "npm run build",
"postinstall": "npx shx find lib/index.js || npm run build",
"build": "rimraf ./lib && npm run generate-openapi && npm run build:node && npm run build:browser",
"build:node": "tsc",
"build:browser": "microbundle -i src/index.ts -o lib/index.umd.js --no-pkg-main -f umd --external none --globals none --tsconfig tsconfig.browser.json --name StacksBlockchainApiClient",
Expand All @@ -15,8 +26,6 @@
"prep-openapi": "rimraf ./.tmp && swagger-cli bundle --dereference -o ./.tmp/openapi.json ../docs/openapi.yaml && shx sed -i '^.*\\$schema.*$' '' ./.tmp/openapi.json",
"generate-openapi": "npm run prep-openapi && openapi-generator generate --skip-validate-spec -g typescript-fetch --additional-properties=typescriptThreePlus=true,supportsES6=true,legacyDiscriminatorBehavior=false,enumPropertyNaming=original,modelPropertyNaming=original -i ./.tmp/openapi.json -o ./src/generated"
},
"author": "@blockstack",
"license": "ISC",
"prettier": "@blockstack/prettier-config",
"files": [
"./src",
Expand Down

0 comments on commit 868c98f

Please sign in to comment.