Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add es5 target #6

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules/

/dist/
/dist-es5/

**/*.js
**/*.js.map
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
7 changes: 7 additions & 0 deletions src/tsconfig.es5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"outDir": "../dist-es5"
},
"extends": "../tsconfig.json"
}