diff --git a/.circleci/config.yml b/.circleci/config.yml index e0fec4a..58ad732 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,11 +56,7 @@ jobs: - restore_cache: keys: - dist-{{ .Revision }} - # semantic-release requires node >= 8.3 and the latest version available at circle-ci is node 7.10 - # they recommend using npx to install node 8 and then use it to run semantic-release (https://github.com/semantic-release/semantic-release/blob/caribou/docs/support/node-version.md) - # since node 7.10 comes with npm 4 and npx is only available on npm >= 5 it has to be installed first, and run from the local node_modules - # TODO: we should replace the following line with just "npm run semantic-release" once there's a node:8 image available at circle-ci - - run: npm install npx && node_modules/npx/index.js -p node@8 -c "npx semantic-release" + - run: npx semantic-release # Build the docs only on deployments - run: mkdir -m 700 ~/.ssh diff --git a/.gitignore b/.gitignore index 3ea8325..3e14128 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /node_modules/ /dist/ +/dist-es5/ **/*.js **/*.js.map diff --git a/package-lock.json b/package-lock.json index 8a0d675..27121b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "decentraland-eth", - "version": "0.0.0-development", + "version": "0.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5a3f865..6f9f7d4 100644 --- a/package.json +++ b/package.json @@ -4,18 +4,22 @@ "description": "Common functionality between the different Decentraland projects", "typings": "./dist/index.d.ts", "main": "./dist/index.js", + "browser": { + "./dist/index.js": "./dist-es5/index.js" + }, "scripts": { "docs": "npx typedoc --out out src/index.ts", "lint:fix": "tslint --project tsconfig.json --fix", "lint": "tslint --project tsconfig.json", "init": "mkdir -p dist", "trim-artifacts": "node ./scripts/contracts/index.js trim-artifacts --write", - "copy-contracts": "mkdir -p dist/contracts/artifacts && cp -r src/contracts/artifacts dist/contracts", + "copy-contracts": + "mkdir -p dist/contracts/artifacts && cp -r src/contracts/artifacts dist/contracts && mkdir -p dist-es5/contracts/artifacts && cp -r src/contracts/artifacts dist-es5/contracts", "contracts-manifest": "node ./scripts/contracts/index.js generate-manifest --write", "contracts": "npm run trim-artifacts && npm run copy-contracts", - "clean": "(rm -r dist || true)", + "clean": "(rm -r dist || true) && (rm -r dist-es5 || true)", "prebuild": "npm run clean && npm run lint && tsc -p scripts/tsconfig.json && npm run contracts", - "build": "tsc -p src/tsconfig.json", + "build": "tsc -p src/tsconfig.json && tsc -p src/tsconfig.es5.json", "fastbuild": "npm run clean && tsc -p tsconfig.json", "test": "npm run build && tsc -p specs/tsconfig.json && mocha specs/**/*.spec.js", "semantic-release": "semantic-release", @@ -25,14 +29,8 @@ "type": "git", "url": "https://github.com/decentraland/decentraland-eth.git" }, - "files": [ - "dist" - ], - "keywords": [ - "common", - "modules", - "decentraland" - ], + "files": ["dist", "dist-es5"], + "keywords": ["common", "modules", "decentraland"], "author": "Decentraland", "license": "ISC", "dependencies": { diff --git a/src/tsconfig.es5.json b/src/tsconfig.es5.json new file mode 100644 index 0000000..c96cd59 --- /dev/null +++ b/src/tsconfig.es5.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "es5", + "outDir": "../dist-es5" + }, + "extends": "../tsconfig.json" +}