feat: Add support for TypeScript project references (#991)

* Update all package.json and tsconfig.json

* fix(contracts): Make test/utils/web3_wrapper.ts compatible with project refs

* Fix webpack config for 0x.js

* Fix linter errors by adding rootDir to tsconfig.json as needed

* Add build:ts and watch:ts commands to package.json

* Update sra-spec to work with project references

* Update tsconfig.json with latest new/removed packages

* Add TypeScript as devDependency at root

* Add missing rootDir to forwarder-helper package

* Use a separate tsconfig file for typedoc

* Fix linter errors

* Apply PR feedback (add comments)

* Fix 0x.js tsconfig
This commit is contained in:
Alex Browne 2018-08-29 11:15:30 -07:00 committed by GitHub
parent f44644ad90
commit e7d5ceb9c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
80 changed files with 276 additions and 182 deletions

View File

@ -23,10 +23,11 @@
"install:all": "yarn install",
"wsrun": "wsrun",
"lerna": "lerna",
"watch": "wsrun watch_without_deps $PKG --fast-exit -r --stages --done-criteria='complete|successfully'",
"build": "wsrun build $PKG --fast-exit -r --stages",
"build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0xproject/website",
"build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
"build:ts": "tsc -b",
"watch:ts": "tsc -b -w",
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
"remove_node_modules": "lerna clean --yes; rm -rf node_modules",
"rebuild": "run-s clean build",
@ -51,6 +52,7 @@
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"source-map-support": "^0.5.6",
"typescript": "3.0.1",
"wsrun": "^2.2.0"
},
"resolutions": {

View File

@ -15,7 +15,6 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "yarn build:all",
"build:all": "run-p build:umd:prod build:commonjs",
"lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
@ -25,8 +24,8 @@
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"clean": "shx rm -rf _bundles lib test_temp src/generated_contract_wrappers generated_docs",
"build:umd:prod": "NODE_ENV=production webpack",
"build:commonjs": "tsc",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"build:commonjs": "tsc -b",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["./src/**/*", "./test/**/*"]
"include": ["./src/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -47,8 +47,13 @@ module.exports = {
use: [
{
loader: 'awesome-typescript-loader',
// tsconfig.json contains some options required for
// project references which do not work with webback.
// We override those options here.
query: {
declaration: false,
declarationMap: false,
composite: false,
},
},
],

View File

@ -8,10 +8,9 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"lint": "tslint --project .",
"clean": "shx rm -rf lib",
"build": "tsc",
"build": "tsc -b",
"test": "yarn run_mocha",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
"test:circleci": "yarn test:coverage",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib test_temp",
"lint": "tslint --project .",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["src/**/*", "test/**/*"]
}

View File

@ -15,8 +15,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib test_temp generated_docs",
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
"lint": "tslint --project .",
@ -26,7 +25,7 @@
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"test:circleci": "yarn test:coverage",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -11,8 +11,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s update_artifacts_v2_beta update_artifacts_v2 generate_contract_wrappers copy_artifacts",
"generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|DummyERC20Token|DummyERC721Token|ZRXToken|ERC20Token|ERC721Token|WETH9|ERC20Proxy|ERC721Proxy|Forwarder|OrderValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers",
"lint": "tslint --project . --exclude **/src/contract_wrappers/**/* --exclude **/lib/**/*",
@ -26,7 +25,7 @@
"copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts",
"clean": "shx rm -rf _bundles lib test_temp test/artifacts src/contract_wrappers/generated src/artifacts generated_docs",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"contracts_v2_beta": "AssetProxyOwner Exchange ERC20Proxy ERC20Token ERC721Proxy ERC721Token WETH9 ZRXToken Forwarder OrderValidator",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -11,8 +11,7 @@
"test": "test"
},
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s compile copy_artifacts generate_contract_wrappers",
"copy_artifacts": "copyfiles -u 4 '../migrations/artifacts/2.0.0/**/*' ./lib/artifacts;",
"test": "yarn run_mocha",

View File

@ -1,5 +1,5 @@
import { devConstants, env, EnvVars, web3Factory } from '@0xproject/dev-utils';
import { prependSubprovider } from '@0xproject/subproviders';
import { prependSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
import { logUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
@ -47,7 +47,7 @@ const ganacheConfigs = {
};
const providerConfigs = testProvider === ProviderType.Ganache ? ganacheConfigs : gethConfigs;
export const provider = web3Factory.getRpcProvider(providerConfigs);
export const provider: Web3ProviderEngine = web3Factory.getRpcProvider(providerConfigs);
const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
const isProfilerEnabled = env.parseBoolean(EnvVars.SolidityProfiler);
const isRevertTraceEnabled = env.parseBoolean(EnvVars.SolidityRevertTrace);

View File

@ -2,13 +2,11 @@
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
"baseUrl": ".",
"declaration": false,
"allowJs": true
"rootDir": "."
},
"include": [
"./globals.d.ts",
"./contract_wrappers",
"./generated_contract_wrappers",
"./src/**/*",
"./utils/**/*",
"./test/**/*",

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,11 +8,10 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib generated_docs",
"lint": "tslint --project .",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -2,7 +2,8 @@
"extends": "../../tsconfig",
"compilerOptions": {
"typeRoots": ["../../node_modules/@types"],
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}

View File

@ -0,0 +1,8 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"typeRoots": ["../../node_modules/@types"],
"outDir": "lib"
},
"include": ["src/**/*"]
}

View File

@ -5,8 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s update_artifacts generate_contract_wrappers",
"update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json lib/artifacts; done;",
"generate_contract_wrappers": "abi-gen --abis 'lib/artifacts/@(Exchange|DummyERC20Token|DummyERC721Token).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}

View File

@ -20,7 +20,7 @@
"build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
"docs:stage": "node scripts/stage_docs.js",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES",
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
},
"config": {
@ -63,7 +63,7 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
"typedoc": "0xProject/typedoc",
"typedoc": "0.12.0",
"typescript": "3.0.1"
},
"publishConfig": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,7 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc -b",
"lint": "tslint --project .",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
@ -17,8 +17,7 @@
"test:circleci": "yarn test:coverage",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
"clean": "shx rm -rf lib test_temp generated_docs",
"build": "tsc",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
"include": ["./src/**/*", "./test/**/*", "./schemas/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,8 +8,7 @@
"description": "Example solidity project using 0x dev tools",
"scripts": {
"lint": "tslint --project . --exclude **/src/contract_wrappers/**/*",
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s compile generate_contract_wrappers copy_artifacts",
"clean": "shx rm -rf lib artifacts src/contract_wrappers",
"copy_artifacts": "copyfiles './artifacts/**/*' './contracts/**/*' ./lib",

View File

@ -1,8 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
"lib": ["es2017"],
"skipLibCheck": true,
"rootDir": ".",
"typeRoots": [
"comment: for building within 0x-monorepo:",
"../../node_modules/@0xproject/typescript-typings/types",

View File

@ -8,8 +8,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s compile:v2 copy_artifacts generate_contract_wrappers",
"copy_artifacts": "copyfiles 'artifacts/**/*' ./lib",
"clean": "shx rm -rf lib src/1.0.0/contract_wrappers src/2.0.0/contract_wrappers src/2.0.0-beta-testnet/contract_wrappers artifacts/2.0.0",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}

View File

@ -9,8 +9,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"lint": "tslint --project .",
"clean": "shx rm -rf lib",
"test:publish": "run-s build script:publish",

View File

@ -2,7 +2,8 @@
"extends": "../../tsconfig",
"compilerOptions": {
"typeRoots": ["../../node_modules/@types", "node_modules/@types"],
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["./src/**/*"]
}

View File

@ -8,10 +8,8 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "run-s pre_build transpile",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s update_artifacts_v2_beta generate_contract_wrappers",
"transpile": "tsc",
"generate_contract_wrappers": "abi-gen --abis 'lib/src/artifacts/@(Exchange|IWallet|IValidator|DummyERC20Token|ERC20Proxy|ERC20Token).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
"update_artifacts_v2_beta": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json lib/src/artifacts; done;",
"test": "yarn run_mocha",
@ -22,7 +20,7 @@
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"clean": "shx rm -rf lib lib/src/artifacts src/generated_contract_wrappers generated_docs",
"lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"contracts_v2_beta": "IWallet IValidator Exchange ERC20Proxy ERC20Token DummyERC20Token",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["src/**/*", "test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["src/**/*", "test/**/*"]
}

View File

@ -12,8 +12,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s update_artifacts copy_artifacts generate_contract_wrappers",
"lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
"generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
@ -26,7 +25,7 @@
"update_artifacts": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json src/artifacts; done;",
"clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers generated_docs",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"contracts_v2_beta": "AssetProxyOwner ERC20Proxy ERC20Token ERC721Proxy ERC721Token Exchange Forwarder OrderValidator WETH9 ZRXToken",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -9,8 +9,7 @@
"types": "lib/index.d.ts",
"scripts": {
"lint": "tslint --project .",
"build": "tsc",
"watch_without_deps": "tsc -w",
"build": "tsc -b",
"clean": "shx rm -rf lib"
},
"author": "Fabio Berger",

View File

@ -1,9 +1,10 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "./lib/",
"outDir": "lib",
"rootDir": "src",
"jsx": "react",
"baseUrl": "./",
"baseUrl": ".",
"strictNullChecks": false,
"paths": {
"*": ["node_modules/@types/*", "*"]

View File

@ -1,9 +1,10 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "./lib/",
"outDir": "lib",
"rootDir": "src",
"jsx": "react",
"baseUrl": "./",
"baseUrl": ".",
"paths": {
"*": ["node_modules/@types/*", "*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s update_contract_fixtures",
"update_contract_fixtures": "copyfiles 'test/fixtures/contracts/**/*' ./lib",
"test": "yarn run_mocha",
@ -21,7 +20,7 @@
"migrate": "npm run build; node lib/src/cli.js migrate",
"lint": "tslint --project .",
"test:circleci": "yarn test:coverage",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -2,6 +2,7 @@
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": ".",
"strictFunctionTypes": false
},
"include": ["./src/**/*", "./test/**/*"]

View File

@ -0,0 +1,8 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib",
"strictFunctionTypes": false
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && tsc",
"build": "yarn pre_build && tsc -b",
"pre_build": "run-s copy_test_fixtures",
"lint": "tslint --project .",
"test": "run-s compile_test run_mocha",
@ -21,7 +20,7 @@
"clean": "shx rm -rf lib test/fixtures/artifacts src/artifacts generated_docs",
"copy_test_fixtures": "copyfiles 'test/fixtures/**/*' ./lib",
"compile_test": "sol-compiler compile",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib",
"lint": "tslint --project ."
},

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}

View File

@ -8,9 +8,8 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"clean": "shx rm -rf lib",
"build": "tsc",
"build": "tsc -b",
"lint": "tslint --project .",
"test:circleci": "yarn test:coverage",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -5,8 +5,8 @@
"node": ">=6.12"
},
"description": "Standard Relayer API Open API Spec",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"serve": "redoc-cli serve lib/api.json --watch",
"watch_without_deps": "run-p build-json:watch serve",
@ -17,10 +17,10 @@
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"test:circleci": "yarn test:coverage",
"clean": "shx rm -rf lib",
"build": "tsc && yarn copy_md_files && yarn build-json",
"build-json": "ts-node build_scripts/buildJson.ts",
"build": "tsc -b && yarn copy_md_files && yarn build-json",
"build-json": "node ./lib/build_scripts/buildJson",
"build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' ",
"copy_md_files": "copyfiles -u 2 './src/md/**/*.md' ./lib/md",
"copy_md_files": "copyfiles -u 2 './src/md/**/*.md' ./lib/src/md",
"deploy-site": "discharge deploy"
},
"repository": {
@ -54,7 +54,7 @@
"swagger-cli": "^2.1.1",
"ts-node": "^7.0.0",
"tslint": "5.11.0",
"typescript": "2.7.1"
"typescript": "3.0.1"
},
"publishConfig": {
"access": "public"

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/*"]
"include": ["./src/**/*", "./test/*", "./build_scripts/*", "./md/*"]
}

View File

@ -8,8 +8,7 @@
"types": "lib/src/index.d.ts",
"license": "Apache-2.0",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib generated_docs",
"lint": "tslint --project .",
"run_mocha_unit": "mocha --require source-map-support/register --require make-promises-safe lib/test/unit/**/*_test.js --timeout 10000 --bail --exit",
@ -21,7 +20,7 @@
"test:all": "run-s test:unit test:integration",
"test:unit": "run-s clean build run_mocha_unit",
"test:integration": "run-s clean build run_mocha_integration",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@ -8,7 +8,6 @@
"description": "A faucet micro-service that dispenses test ERC20 tokens or Ether",
"main": "server.js",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "node ../../node_modules/gulp/bin/gulp.js build",
"dev": "node ../../node_modules/gulp/bin/gulp.js run",
"start": "node ./server/server.js",

View File

@ -2,6 +2,7 @@
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src/ts",
"strictPropertyInitialization": false
},
"include": ["./src/ts/**/*"]

View File

@ -7,8 +7,7 @@
"description": "Lint rules related to 0xProject for TSLint",
"main": "tslint.json",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib",
"lint": "tslint --project ."
},

View File

@ -1,8 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"typeRoots": ["../../node_modules/@types", "node_modules/@types"],
"outDir": "lib"
"outDir": "lib",
"rootDir": "rules"
},
"include": ["./rules/**/*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib",
"lint": "tslint --project ."
},

View File

@ -1,8 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"typeRoots": ["../../node_modules/@types", "node_modules/@types"],
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}

View File

@ -6,8 +6,7 @@
},
"description": "0x project typescript type definitions",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib"
},
"repository": {
@ -32,6 +31,7 @@
},
"devDependencies": {
"copyfiles": "^2.0.0",
"typescript": "3.0.1",
"shx": "^0.2.2"
},
"publishConfig": {

View File

@ -1,6 +1,7 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
}
}

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib",
"lint": "tslint --project .",
"test": "yarn run_mocha",

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["src/**/*", "test/**/*"]
}

View File

@ -8,8 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc",
"build": "tsc -b",
"clean": "shx rm -rf lib generated_docs",
"lint": "tslint --project .",
"test": "yarn run_mocha",
@ -18,7 +17,7 @@
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {

View File

@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["src/**/*", "test/**/*"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["src/**/*", "test/**/*"]
}

View File

@ -8,7 +8,12 @@
"allowJs": true,
"strictNullChecks": false,
"noImplicitThis": false,
// tsconfig.json at the monorepo root contains some options required for
// project references which do not work for website. We override those
// options here.
"declaration": false,
"declarationMap": false,
"composite": false,
"paths": {
"*": ["node_modules/@types/*", "*"]
}

View File

@ -3,14 +3,56 @@
"module": "commonjs",
"target": "es5",
"lib": ["es2017", "dom"],
"sourceMap": true,
"declaration": true,
"experimentalDecorators": true,
"downlevelIteration": true,
"noImplicitReturns": true,
"pretty": true,
"skipLibCheck": true,
"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
"strict": true
}
"strict": true,
// These settings are required for TypeScript project references
"composite": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
// The root of the project is just a list of references and does not contain
// any top-level TypeScript code.
"include": [],
"references": [
{ "path": "./packages/0x.js" },
{ "path": "./packages/abi-gen" },
{ "path": "./packages/assert" },
{ "path": "./packages/base-contract" },
{ "path": "./packages/connect" },
{ "path": "./packages/contract-wrappers" },
{ "path": "./packages/contracts" },
{ "path": "./packages/dev-utils" },
{ "path": "./packages/ethereum-types" },
{ "path": "./packages/fill-scenarios" },
{ "path": "./packages/forwarder-helper" },
{ "path": "./packages/json-schemas" },
{ "path": "./packages/metacoin" },
{ "path": "./packages/migrations" },
{ "path": "./packages/monorepo-scripts" },
{ "path": "./packages/order-utils" },
{ "path": "./packages/order-watcher" },
{ "path": "./packages/react-docs" },
{ "path": "./packages/react-shared" },
{ "path": "./packages/sol-compiler" },
{ "path": "./packages/sol-cov" },
{ "path": "./packages/sol-resolver" },
{ "path": "./packages/sra-report" },
{ "path": "./packages/sra-spec" },
{ "path": "./packages/subproviders" },
{ "path": "./packages/testnet-faucets" },
{ "path": "./packages/tslint-config" },
{ "path": "./packages/types" },
{ "path": "./packages/typescript-typings" },
{ "path": "./packages/utils" },
{ "path": "./packages/web3-wrapper" }
// Skipping website because it requires allowJs: false and this is
// incompatible with project references.
// { "path": "./packages/website" }
]
}

16
typedoc-tsconfig.json Normal file
View File

@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": ["es2017", "dom"],
"sourceMap": true,
"declaration": true,
"experimentalDecorators": true,
"downlevelIteration": true,
"noImplicitReturns": true,
"pretty": true,
"skipLibCheck": true,
"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
"strict": true
}
}

View File

@ -966,12 +966,6 @@
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/find-versions/-/find-versions-2.0.0.tgz#a976ca032ab8dd1161116604eded0620d2b85df2"
"@types/fs-extra@5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.0.tgz#d3e225b35eb5c6d3a5a782c28219df365c781413"
dependencies:
"@types/node" "*"
"@types/fs-extra@^5.0.3":
version "5.0.4"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599"
@ -986,10 +980,6 @@
"@types/minimatch" "*"
"@types/node" "*"
"@types/handlebars@4.0.36":
version "4.0.36"
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.36.tgz#ff57c77fa1ab6713bb446534ddc4d979707a3a79"
"@types/handlebars@^4.0.36":
version "4.0.37"
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.37.tgz#a3bc3eba0c0f03f753cac00841a5b21e26a02c03"
@ -1004,10 +994,6 @@
dependencies:
"@types/node" "*"
"@types/highlight.js@9.12.2":
version "9.12.2"
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.2.tgz#6ee7cd395effe5ec80b515d3ff1699068cd0cd1d"
"@types/highlight.js@^9.12.3":
version "9.12.3"
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.3.tgz#b672cfaac25cbbc634a0fd92c515f66faa18dbca"
@ -1054,10 +1040,6 @@
version "4.14.104"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80"
"@types/lodash@4.14.99":
version "4.14.99"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.99.tgz#e6e10c0a4cc16c7409b3181f1e66880d2fb7d4dc"
"@types/lodash@^4.14.110", "@types/lodash@^4.14.116":
version "4.14.116"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.116.tgz#5ccf215653e3e8c786a58390751033a9adca0eb9"
@ -1066,10 +1048,6 @@
version "1.5.3"
resolved "https://registry.yarnpkg.com/@types/loglevel/-/loglevel-1.5.3.tgz#adfce55383edc5998a2170ad581b3e23d6adb5b8"
"@types/marked@0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.3.0.tgz#583c223dd33385a1dda01aaf77b0cd0411c4b524"
"@types/marked@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.0.tgz#057a6165703e7419217f8ffc6887747f980b6315"
@ -1250,13 +1228,6 @@
"@types/express-serve-static-core" "*"
"@types/mime" "*"
"@types/shelljs@0.7.7":
version "0.7.7"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.7.tgz#1f7bfa28947661afea06365db9b1135bbc903ec4"
dependencies:
"@types/glob" "*"
"@types/node" "*"
"@types/shelljs@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.0.tgz#0caa56b68baae4f68f44e0dd666ab30b098e3632"
@ -8751,10 +8722,6 @@ marked@0.3.18:
version "0.3.18"
resolved "https://registry.npmjs.org/marked/-/marked-0.3.18.tgz#3ef058cd926101849b92a7a7c15db18c7fc76b2f"
marked@^0.3.12:
version "0.3.19"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
marked@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.4.0.tgz#9ad2c2a7a1791f10a852e0112f77b571dce10c66"
@ -12517,7 +12484,7 @@ shelljs@^0.7.3:
interpret "^1.0.0"
rechoir "^0.6.2"
shelljs@^0.8.0, shelljs@^0.8.1, shelljs@^0.8.2:
shelljs@^0.8.0, shelljs@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35"
dependencies:
@ -13900,38 +13867,12 @@ typedoc@0.12.0:
typedoc-default-themes "^0.5.0"
typescript "3.0.x"
typedoc@0xProject/typedoc:
version "0.10.0"
resolved "https://codeload.github.com/0xProject/typedoc/tar.gz/a9970a52f0924fec2df608abe30ff81153b3def2"
dependencies:
"@types/fs-extra" "5.0.0"
"@types/handlebars" "4.0.36"
"@types/highlight.js" "9.12.2"
"@types/lodash" "4.14.99"
"@types/marked" "0.3.0"
"@types/minimatch" "3.0.3"
"@types/shelljs" "0.7.7"
fs-extra "^5.0.0"
handlebars "^4.0.6"
highlight.js "^9.0.0"
lodash "^4.13.1"
marked "^0.3.12"
minimatch "^3.0.0"
progress "^2.0.0"
shelljs "^0.8.1"
typedoc-default-themes "^0.5.0"
typescript "2.7.1"
types-bn@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/types-bn/-/types-bn-0.0.1.tgz#4253c7c7251b14e1d77cdca6f58800e5e2b82c4b"
dependencies:
bn.js "4.11.7"
typescript@2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1.tgz#bb3682c2c791ac90e7c6210b26478a8da085c359"
typescript@3.0.1, typescript@3.0.x:
version "3.0.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"