Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit b4c0b52

Browse files
author
Tom Linton
authored
Lerna and webpack updates (#914)
* Cleanup install:dev command * Update package-lock.json * Update lock files * Add all packages to lerna * Convert to ES6 modules * Move devDependencies to root and unify linting * Fix origin-js webpack config * Add eslint files * Update lock files * Update packages.json files * Remove webpack serving from origin-js * Fixes to deployment dockerfiles * Update lock files * Build and package fixes * Stream build output * Update lock files * Add production env var * Add universal lint to TravisCI * Remove JS formatting from origin-js in favour of universal * Set node version in linting test * Appease linter * Temporarily remove caching from TravisCI * Revert "Temporarily remove caching from TravisCI" This reverts commit 6d9fc7c. * CI test * CI test * Only install devDependencies of root for linter * CI test * Add common dependency install * Fix scoping * Fix Travis error * Comment out DApp tests * Cleanup origin-dapp tests * Update lock files * Upgrade babel polyfill * Rearrange dependencies * Fix test issue * Cleanup docs and deploy script * Remove deployment doc * Cleanup old style secrets * Fix syntax of .travis.yml * Update linting * Cleanup linting * Add missing plugin * Add missing package * Fix ipfs-proxy test * Fix test errors * Fix tests * Add missing package * Update lock files * Remove website Docker compose setup * Cleanup old messaging ipfs container * Remove screenshot * Update Docker Compose config * Fixes for origin-box * Add comment * Add lint command to discovery * Fix faucet dependencies * Move contributing file to top level * Documentation cleanup * Update origin-box docs * Docs update * More tests * Appease linter * Fixes for notifications * Notifications container and updates * Container tweaks * Update lock files * Tweak doc * Tweak container copy * Test including built contracts * Revert "Test including built contracts" This reverts commit 285a190. * Change webpack config * Update lock files * Add build step to event-listener containers * Update lock files * Make listener happy with ES6 export * Mount host dist for origin-js into event-listener * Container fixes * Update origin-js readme * Alter event-listener startup command in origin-box * Fix broken event-listener dockerfile * Toggle production NODE_ENV for dapp * Fix event-listener container * Container tweaks and commenting * Add contributing text to root readme * Change file casing * Fix linting * Fix babel references * Update README.md files * Add build and dev option to origin-messaging and update to babel 7 * Remove origin-dapp from .eslintignore * Add scoping to npm run dev command * Update messaging containers for new comands * Update lock files * Development event-listener fixes * Add VAPID key generation if not provided * Fix VAPID key generation * Remove install script * Clean up networks for postgresql * Container fixes and CORS support for origin-discovery * Remove extra semicolon * Package upgrades * Update lock files * Remove unnecessary var * Update lock files * Lock file regen * Update lock files * Make linter happy * Fix tests * Fix dev start command * Revert GraphQL upgrade due to test failure * Fix origin-discovery lock file * Fix fs calls * Change to `npm start` * Fix babel references
1 parent 1a8db4f commit b4c0b52

File tree

136 files changed

+61683
-86038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+61683
-86038
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/node_modules/*
2+
origin-contracts/*
3+
**/build/*
4+
**/dist/*

.eslintrc

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"root": true,
3+
"parser": "babel-eslint",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module",
7+
"ecmaFeatures": {
8+
"jsx": true,
9+
"impliedStrict": true
10+
}
11+
},
12+
"globals": {
13+
"web3": true,
14+
"originTest": true
15+
},
16+
"env": {
17+
"browser": true,
18+
"node": true,
19+
"es6": true,
20+
"mocha": true
21+
},
22+
"plugins": [
23+
"react"
24+
],
25+
"extends": [
26+
"eslint:recommended",
27+
"plugin:react/recommended"
28+
],
29+
"rules": {
30+
"computed-property-spacing": [
31+
"error"
32+
],
33+
"jsx-quotes": [
34+
"error"
35+
],
36+
"key-spacing": [
37+
"error"
38+
],
39+
"no-case-declarations": [
40+
"off"
41+
],
42+
"no-console": [
43+
"off"
44+
],
45+
"no-var": [
46+
"error"
47+
],
48+
"object-curly-spacing": [
49+
"error",
50+
"always"
51+
],
52+
"prefer-const": [
53+
"error"
54+
],
55+
"quotes": [
56+
"error",
57+
"single",
58+
{
59+
"avoidEscape": true,
60+
"allowTemplateLiterals": true
61+
}
62+
],
63+
"react/no-deprecated": "off",
64+
"react/no-children-prop": "off",
65+
"react/prop-types": "off",
66+
"semi": [
67+
"error",
68+
"never"
69+
]
70+
}
71+
}

.travis.yml

+112-46
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,118 @@
1+
---
12
git:
23
depth: 3
34
matrix:
45
include:
5-
- name: "origin-contracts / js / dapp unit tests"
6-
language: node_js
7-
cache:
8-
npm: true
9-
directories:
10-
- origin-contracts/node_modules
11-
- origin-dapp/node_modules
12-
- origin-js/node_modules
13-
before_cache:
14-
- rm -rf origin-contracts/node_modules/.cache
15-
- rm -rf origin-dapp/node_modules/.cache
16-
- rm -rf origin-js/node_modules/.cache
17-
node_js: 10
6+
- name: "ipfs-proxy tests"
7+
language: node_js
8+
node_js: 10
9+
cache:
10+
npm: true
11+
directories:
12+
- ipfs-proxy/node_modules
13+
before_cache:
14+
- rm -rf ipfs-proxy/node_modules/.cache
15+
install:
16+
- npm install --ignore-scripts
17+
- npm run bootstrap -- --scope ipfs-proxy
18+
script:
19+
- lerna run lint --scope ipfs-proxy
20+
- lerna run test --scope ipfs-proxy
1821

19-
- name: "Origin-discovery unit tests"
20-
language: node_js
21-
cache:
22-
npm: true
23-
directories:
24-
- origin-contracts/node_modules
25-
- origin-dapp/node_modules
26-
- origin-js/node_modules
27-
- origin-discovery/node_modules
28-
before_cache:
29-
- rm -rf origin-contracts/node_modules/.cache
30-
- rm -rf origin-dapp/node_modules/.cache
31-
- rm -rf origin-js/node_modules/.cache
32-
- rm -rf origin-discovery/node_modules/.cache
33-
node_js: 10
34-
addons:
35-
postgresql: 9.6
36-
services:
37-
- postgresql
38-
env:
39-
- DATABASE_URL=postgres://postgres@localhost/travis_ci_test
40-
before_script:
41-
- psql -c 'create database travis_ci_test;' -U postgres
42-
- cd origin-discovery
43-
- npm run migrate
22+
- name: "origin-bridge tests"
23+
language: python
24+
python: 3.6
25+
before_script:
26+
- cd origin-bridge
27+
- pip install -r requirements.txt
28+
script:
29+
- pytest --flakes --codestyle
4430

45-
- name: "Bridge server unit tests"
46-
language: python
47-
python: 3.6
48-
before_script:
49-
- cd origin-bridge
50-
- pip install -r requirements.txt
51-
script:
52-
- pytest --flakes --codestyle
31+
- name: "origin-contracts tests"
32+
language: node_js
33+
node_js: 10
34+
cache:
35+
npm: true
36+
directories:
37+
- origin-contracts/node_modules
38+
before_cache:
39+
- rm -rf origin-contracts/node_modules/.cache
40+
install:
41+
- npm install --ignore-scripts
42+
- npm run bootstrap -- --scope origin-contracts
43+
script:
44+
- lerna run test --scope origin-contracts
45+
46+
- name: "origin-dapp tests"
47+
language: node_js
48+
node_js: 10
49+
install:
50+
- npm install --ignore-scripts
51+
script:
52+
- lerna run lint --scope origin-dapp
53+
54+
- name: "origin-discovery tests"
55+
language: node_js
56+
node_js: 10
57+
cache:
58+
npm: true
59+
directories:
60+
- origin-contracts/node_modules
61+
- origin-js/node_modules
62+
- origin-discovery/node_modules
63+
before_cache:
64+
- rm -rf origin-contracts/node_modules/.cache
65+
- rm -rf origin-js/node_modules/.cache
66+
- rm -rf origin-discovery/node_modules/.cache
67+
addons:
68+
postgresql: 9.6
69+
services:
70+
- postgresql
71+
env:
72+
- DATABASE_URL=postgres://postgres@localhost/travis_ci_test
73+
before_script:
74+
- psql -c 'create database travis_ci_test;' -U postgres
75+
- lerna run migrate --scope origin-discovery
76+
install:
77+
- npm install --ignore-scripts
78+
- npm run bootstrap -- --scope origin-contracts
79+
- npm run bootstrap -- --scope origin
80+
- npm run bootstrap -- --scope origin-discovery
81+
script:
82+
- lerna run lint --scope origin-discovery
83+
- lerna run test --scope origin-discovery
84+
85+
- name: "origin-js tests"
86+
language: node_js
87+
node_js: 10
88+
cache:
89+
npm: true
90+
directories:
91+
- origin-contracts/node_modules
92+
- origin-js/node_modules
93+
before_cache:
94+
- rm -rf origin-contracts/node_modules/.cache
95+
- rm -rf origin-js/node_modules/.cache
96+
install:
97+
- npm install --ignore-scripts
98+
- npm run bootstrap -- --scope origin-contracts
99+
- npm run bootstrap -- --scope origin
100+
script:
101+
- lerna run lint --scope origin
102+
- lerna run test --scope origin
103+
104+
- name: "origin-messaging tests"
105+
language: node_js
106+
node_js: 10
107+
install:
108+
- npm install --ignore-scripts
109+
script:
110+
- lerna run lint --scope origin-messaging
111+
112+
- name: "origin-notifications tests"
113+
language: node_js
114+
node_js: 10
115+
install:
116+
- npm install --ignore-scripts
117+
script:
118+
- lerna run lint --scope origin-notifications
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Contributing to Origin.js
1+
# Contributing to Origin
22

33
Thanks for helping out! 👍
44

55
Before you summit a PR, you'll want to make sure that:
66

77
1. Any changes are tested.
8-
2. All tests pass. (See each package's readme for instructions on testing that package.)
9-
3. The formatting is correct. Just run `npm run format` in a package folder.
8+
2. All tests pass. Run `npm run test` from the root of the repository to run all packages tests or run `lerna run test --scope <package_name>` to run the tests for a single package.
9+
3. The formatting is correct. Run `npm run lint` from the root of the repository.
1010

1111
If this is a new feature, make sure you've discussed it with [our #engineering channel on Discord](https://www.originprotocol.com/discord).
1212

@@ -17,4 +17,4 @@ We use [NPM style](https://docs.npmjs.com/misc/coding-style), as automated by th
1717

1818
### Coding style: Solidity
1919

20-
We use two space indents. Just copy the surrounding style and use your good judgement.
20+
We use two space indents. Just copy the surrounding style and use your good judgement.

0 commit comments

Comments
 (0)