diff --git a/lerna.json b/lerna.json new file mode 100644 index 00000000..93ecf82b --- /dev/null +++ b/lerna.json @@ -0,0 +1,5 @@ +{ + "version": "0.0.0", + "useWorkspaces": true, + "npmClient": "yarn" +} diff --git a/package.json b/package.json index 9bb9a9a5..b0c5d5af 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "cosm-js", - "version": "2.0.0-alpha.7", + "name": "cosm-js-monorepo-root", "description": "Transaction codec and client to communicate with any wasmd blockchain", + "private": true, "author": "Ethan Frey ", "license": "Apache-2.0", "main": "build/index.js", @@ -20,22 +20,17 @@ "publishConfig": { "access": "public" }, + "workspaces": [ + "packages/*" + ], "scripts": { - "docs": "shx rm -rf docs && typedoc --options typedoc.js", - "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", - "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .", - "autolint": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", - "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts", - "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", - "build": "shx rm -rf ./build && tsc && yarn move-types && yarn format-types", - "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", - "test-node": "node jasmine-testrunner.js", - "test-edge": "yarn pack-web && karma start --single-run --browsers Edge", - "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox", - "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadlessInsecure", - "test-safari": "yarn pack-web && karma start --single-run --browsers Safari", - "test": "yarn build-or-skip && yarn test-node", - "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js" + "format": "lerna run format", + "format-text": "prettier --write --prose-wrap always --print-width 80 \"./*.md\" \"./docs/**/*.md\" \"./scripts/**/*.{json,md}\" && lerna run format-text", + "lint": "lerna run lint", + "lint-fix": "lerna run lint-fix", + "test": "lerna run test", + "build": "lerna run build", + "docs": "lerna run docs" }, "dependencies": { "@iov/bcp": "^2.0.0-alpha.7", @@ -49,7 +44,6 @@ "xstream": "^11.11.0" }, "devDependencies": { - "@iov/keycontrol": "^2.0.0-alpha.7", "@types/jasmine": "^3.3.7", "@types/memdown": "^3.0.0", "@typescript-eslint/eslint-plugin": "^2.10.0", diff --git a/packages/bcp/.eslintignore b/packages/bcp/.eslintignore new file mode 120000 index 00000000..86039baf --- /dev/null +++ b/packages/bcp/.eslintignore @@ -0,0 +1 @@ +../../.eslintignore \ No newline at end of file diff --git a/jasmine-spec-reporter.config.json b/packages/bcp/jasmine-spec-reporter.config.json similarity index 100% rename from jasmine-spec-reporter.config.json rename to packages/bcp/jasmine-spec-reporter.config.json diff --git a/jasmine-testrunner.js b/packages/bcp/jasmine-testrunner.js similarity index 100% rename from jasmine-testrunner.js rename to packages/bcp/jasmine-testrunner.js diff --git a/karma.conf.js b/packages/bcp/karma.conf.js similarity index 100% rename from karma.conf.js rename to packages/bcp/karma.conf.js diff --git a/nonces/1570527883 b/packages/bcp/nonces/1570527883 similarity index 100% rename from nonces/1570527883 rename to packages/bcp/nonces/1570527883 diff --git a/nonces/1573026590 b/packages/bcp/nonces/1573026590 similarity index 100% rename from nonces/1573026590 rename to packages/bcp/nonces/1573026590 diff --git a/nonces/1574869843 b/packages/bcp/nonces/1574869843 similarity index 100% rename from nonces/1574869843 rename to packages/bcp/nonces/1574869843 diff --git a/nonces/1576569788 b/packages/bcp/nonces/1576569788 similarity index 100% rename from nonces/1576569788 rename to packages/bcp/nonces/1576569788 diff --git a/nonces/1576595306 b/packages/bcp/nonces/1576595306 similarity index 100% rename from nonces/1576595306 rename to packages/bcp/nonces/1576595306 diff --git a/nonces/1576678551 b/packages/bcp/nonces/1576678551 similarity index 100% rename from nonces/1576678551 rename to packages/bcp/nonces/1576678551 diff --git a/nonces/1576746493 b/packages/bcp/nonces/1576746493 similarity index 100% rename from nonces/1576746493 rename to packages/bcp/nonces/1576746493 diff --git a/nonces/1576760285 b/packages/bcp/nonces/1576760285 similarity index 100% rename from nonces/1576760285 rename to packages/bcp/nonces/1576760285 diff --git a/nonces/1576767119 b/packages/bcp/nonces/1576767119 similarity index 100% rename from nonces/1576767119 rename to packages/bcp/nonces/1576767119 diff --git a/nonces/1579019908 b/packages/bcp/nonces/1579019908 similarity index 100% rename from nonces/1579019908 rename to packages/bcp/nonces/1579019908 diff --git a/nonces/README.txt b/packages/bcp/nonces/README.txt similarity index 100% rename from nonces/README.txt rename to packages/bcp/nonces/README.txt diff --git a/packages/bcp/package.json b/packages/bcp/package.json new file mode 100644 index 00000000..8a78fd19 --- /dev/null +++ b/packages/bcp/package.json @@ -0,0 +1,54 @@ +{ + "name": "@cosmwasm/bcp", + "version": "2.0.0-alpha.7", + "description": "Transaction codec and client to communicate with any wasmd blockchain", + "author": "Ethan Frey ", + "license": "Apache-2.0", + "main": "build/index.js", + "types": "types/index.d.ts", + "files": [ + "build/", + "types/", + "*.md", + "!*.spec.*", + "!**/testdata/" + ], + "repository": { + "type": "git", + "url": "https://github.com/confio/cosm-js/tree/master/packages/bcp" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "docs": "shx rm -rf docs && typedoc --options typedoc.js", + "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .", + "lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", + "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts", + "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", + "build": "shx rm -rf ./build && tsc && yarn move-types && yarn format-types", + "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", + "test-node": "node jasmine-testrunner.js", + "test-edge": "yarn pack-web && karma start --single-run --browsers Edge", + "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox", + "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadlessInsecure", + "test-safari": "yarn pack-web && karma start --single-run --browsers Safari", + "test": "yarn build-or-skip && yarn test-node", + "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js" + }, + "dependencies": { + "@iov/bcp": "^2.0.0-alpha.7", + "@iov/crypto": "^2.0.0-alpha.7", + "@iov/encoding": "^2.0.0-alpha.7", + "@iov/stream": "^2.0.0-alpha.7", + "@tendermint/amino-js": "^0.7.0-alpha.1", + "axios": "^0.19.0", + "fast-deep-equal": "^3.1.1", + "readonly-date": "^1.0.0", + "xstream": "^11.11.0" + }, + "devDependencies": { + "@iov/keycontrol": "^2.0.0-alpha.7" + } +} diff --git a/src/address.spec.ts b/packages/bcp/src/address.spec.ts similarity index 100% rename from src/address.spec.ts rename to packages/bcp/src/address.spec.ts diff --git a/src/address.ts b/packages/bcp/src/address.ts similarity index 100% rename from src/address.ts rename to packages/bcp/src/address.ts diff --git a/src/caip5.spec.ts b/packages/bcp/src/caip5.spec.ts similarity index 100% rename from src/caip5.spec.ts rename to packages/bcp/src/caip5.spec.ts diff --git a/src/caip5.ts b/packages/bcp/src/caip5.ts similarity index 100% rename from src/caip5.ts rename to packages/bcp/src/caip5.ts diff --git a/src/cosmoscodec.spec.ts b/packages/bcp/src/cosmoscodec.spec.ts similarity index 100% rename from src/cosmoscodec.spec.ts rename to packages/bcp/src/cosmoscodec.spec.ts diff --git a/src/cosmoscodec.ts b/packages/bcp/src/cosmoscodec.ts similarity index 100% rename from src/cosmoscodec.ts rename to packages/bcp/src/cosmoscodec.ts diff --git a/src/cosmosconnection.spec.ts b/packages/bcp/src/cosmosconnection.spec.ts similarity index 100% rename from src/cosmosconnection.spec.ts rename to packages/bcp/src/cosmosconnection.spec.ts diff --git a/src/cosmosconnection.ts b/packages/bcp/src/cosmosconnection.ts similarity index 100% rename from src/cosmosconnection.ts rename to packages/bcp/src/cosmosconnection.ts diff --git a/src/cosmosconnector.ts b/packages/bcp/src/cosmosconnector.ts similarity index 100% rename from src/cosmosconnector.ts rename to packages/bcp/src/cosmosconnector.ts diff --git a/src/decode.spec.ts b/packages/bcp/src/decode.spec.ts similarity index 100% rename from src/decode.spec.ts rename to packages/bcp/src/decode.spec.ts diff --git a/src/decode.ts b/packages/bcp/src/decode.ts similarity index 100% rename from src/decode.ts rename to packages/bcp/src/decode.ts diff --git a/src/encode.spec.ts b/packages/bcp/src/encode.spec.ts similarity index 100% rename from src/encode.spec.ts rename to packages/bcp/src/encode.spec.ts diff --git a/src/encode.ts b/packages/bcp/src/encode.ts similarity index 100% rename from src/encode.ts rename to packages/bcp/src/encode.ts diff --git a/src/index.ts b/packages/bcp/src/index.ts similarity index 100% rename from src/index.ts rename to packages/bcp/src/index.ts diff --git a/src/restclient.ts b/packages/bcp/src/restclient.ts similarity index 100% rename from src/restclient.ts rename to packages/bcp/src/restclient.ts diff --git a/src/testdata.spec.ts b/packages/bcp/src/testdata.spec.ts similarity index 100% rename from src/testdata.spec.ts rename to packages/bcp/src/testdata.spec.ts diff --git a/src/testdata/cosmoshub.json b/packages/bcp/src/testdata/cosmoshub.json similarity index 100% rename from src/testdata/cosmoshub.json rename to packages/bcp/src/testdata/cosmoshub.json diff --git a/src/types.spec.ts b/packages/bcp/src/types.spec.ts similarity index 100% rename from src/types.spec.ts rename to packages/bcp/src/types.spec.ts diff --git a/src/types.ts b/packages/bcp/src/types.ts similarity index 100% rename from src/types.ts rename to packages/bcp/src/types.ts diff --git a/packages/bcp/tsconfig.json b/packages/bcp/tsconfig.json new file mode 100644 index 00000000..167e8c02 --- /dev/null +++ b/packages/bcp/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "build", + "declarationDir": "build/types", + "rootDir": "src" + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/bcp/tslint.json b/packages/bcp/tslint.json new file mode 100644 index 00000000..0946f209 --- /dev/null +++ b/packages/bcp/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tslint.json" +} diff --git a/typedoc.js b/packages/bcp/typedoc.js similarity index 100% rename from typedoc.js rename to packages/bcp/typedoc.js diff --git a/types/address.d.ts b/packages/bcp/types/address.d.ts similarity index 100% rename from types/address.d.ts rename to packages/bcp/types/address.d.ts diff --git a/types/caip5.d.ts b/packages/bcp/types/caip5.d.ts similarity index 100% rename from types/caip5.d.ts rename to packages/bcp/types/caip5.d.ts diff --git a/types/cosmoscodec.d.ts b/packages/bcp/types/cosmoscodec.d.ts similarity index 100% rename from types/cosmoscodec.d.ts rename to packages/bcp/types/cosmoscodec.d.ts diff --git a/types/cosmosconnection.d.ts b/packages/bcp/types/cosmosconnection.d.ts similarity index 100% rename from types/cosmosconnection.d.ts rename to packages/bcp/types/cosmosconnection.d.ts diff --git a/types/cosmosconnector.d.ts b/packages/bcp/types/cosmosconnector.d.ts similarity index 100% rename from types/cosmosconnector.d.ts rename to packages/bcp/types/cosmosconnector.d.ts diff --git a/types/decode.d.ts b/packages/bcp/types/decode.d.ts similarity index 100% rename from types/decode.d.ts rename to packages/bcp/types/decode.d.ts diff --git a/types/encode.d.ts b/packages/bcp/types/encode.d.ts similarity index 100% rename from types/encode.d.ts rename to packages/bcp/types/encode.d.ts diff --git a/types/index.d.ts b/packages/bcp/types/index.d.ts similarity index 100% rename from types/index.d.ts rename to packages/bcp/types/index.d.ts diff --git a/types/restclient.d.ts b/packages/bcp/types/restclient.d.ts similarity index 100% rename from types/restclient.d.ts rename to packages/bcp/types/restclient.d.ts diff --git a/types/types.d.ts b/packages/bcp/types/types.d.ts similarity index 100% rename from types/types.d.ts rename to packages/bcp/types/types.d.ts diff --git a/webpack.web.config.js b/packages/bcp/webpack.web.config.js similarity index 100% rename from webpack.web.config.js rename to packages/bcp/webpack.web.config.js diff --git a/tsconfig.json b/tsconfig.json index e1e7ec19..238448fc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,6 @@ "pretty": true, "removeComments": false, "resolveJsonModule": true, - "rootDir": "src", "sourceMap": true, "strict": true, "target": "es6", @@ -26,6 +25,5 @@ "./custom_types", "./node_modules/@types" ] - }, - "include": ["src/**/*"] -} \ No newline at end of file + } +}