Skip to content

Commit

Permalink
Adde docker, fixed gulp and modify env variables setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Tarazaga committed Sep 6, 2019
1 parent aa1d063 commit c5d96b8
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 209 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:10
ARG BUILD

# Create app directory
WORKDIR /app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
COPY lerna*.json ./
COPY packages/editor/package*.json ./packages/editor/
COPY packages/web-server/package*.json ./packages/web-server/

# RUN npm i
# If you are building your code for production
RUN npx lerna bootstrap --hoist

# Bundle app source
COPY . .

RUN npm run $BUILD

EXPOSE 80
CMD [ "npm", "run", "start:prod" ]
2 changes: 1 addition & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { series } = require('gulp');

function copyDashboard() {
return gulp
.src('packages/dashboard/dist/**/*')
.src('packages/editor/dist/**/*')
.pipe(
gulp.dest('www')
);
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@ To try it out, go to [lab.superblocks.com](https://lab.superblocks.com).
Below is described how to get the **Superblocks Lab** _PreactJS_ project setup and running locally.

### Install node modules
Use `yarn` [Yarn](https://yarnpkg.com/).
```sh
yarn install
npx lerna bootstrap --hoist
```

### Run in development mode
```sh
yarn start
npm start
```

Browse to `http://localhost:3000`. Note that if you use any other hostname/IP than `localhost`, then instead run update 'ORIGIN' value in 'env.development', this is important so that the iframes can communicate with the main window.

### Make a production build
```sh
yarn build
npm build
```

The dist files will be inside `./dist`. Note that the this command uses production version of ".env" file, so in order to test it locally please create a ".env.local" with proper ORIGIN variable value prior to build.
Expand All @@ -60,7 +59,7 @@ Run this script to fix that for you:
Consider double-checking and updating the `CHANGELOG` to reflect the changes. Tag the new version.

## Issues
Bug reports and suggestions can be filed at the project [Issues](https://github.com/SuperblocksHQ/superblocks-lab/issues) page.
Bug reports and suggestions can be filed at the project [Issues](https://github.com/SuperblocksHQ/superblocks-lab/issues) page.
For more information about the process involved, please refer to the Wiki: [Submitting Bugs and Suggestions](https://github.com/SuperblocksHQ/superblocks-lab/wiki/Submitting-Bugs-and-Suggestions).

## Contributing
Expand Down
3 changes: 0 additions & 3 deletions packages/editor/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ ORIGIN=superblocks.com
REACT_APP_INFURA_API_KEY=148bee2b5da148a7b77a83f7504d00e7
REACT_APP_AMPLITUDE_API_KEY=1889a5439f9ff971ee38b86964e337a5
REACT_APP_API_BASE_URL=https://ethereum-api.superblocks.com
REACT_APP_GITHUB_CLIENT_ID=Iv1.ebee2363725473ce
REACT_APP_GITHUB_REDIRECT_URI=http://localhost:3000/github/callback
REACT_APP_AUTH_REFRESH_OFFSET=15
7 changes: 0 additions & 7 deletions packages/editor/.env.beta

This file was deleted.

11 changes: 4 additions & 7 deletions packages/editor/.env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
ORIGIN=localhost:4000
REACT_APP_INFURA_API_KEY=58b57895912346bf8aefba3cab0db459
REACT_APP_AMPLITUDE_API_KEY=19a451bb21fb9979e45493b6b562024a
REACT_APP_API_BASE_URL=http://localhost:4002
REACT_APP_GITHUB_CLIENT_ID=Iv1.ebee2363725473ce
REACT_APP_GITHUB_REDIRECT_URI=http://localhost:4000/github/callback
REACT_APP_AUTH_REFRESH_OFFSET=15
ORIGIN=superblocks.com
REACT_APP_INFURA_API_KEY=148bee2b5da148a7b77a83f7504d00e7
REACT_APP_AMPLITUDE_API_KEY=4af7a1553f9e3f4d666764f163639186
REACT_APP_API_BASE_URL=https://ethereum-api.superblocks.com
4 changes: 4 additions & 0 deletions packages/editor/.env.development.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ORIGIN=localhost:4000
REACT_APP_INFURA_API_KEY=58b57895912346bf8aefba3cab0db459
REACT_APP_AMPLITUDE_API_KEY=19a451bb21fb9979e45493b6b562024a
REACT_APP_API_BASE_URL=http://localhost:4002
3 changes: 2 additions & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"build:beta": "sh -ac '. .env.beta; node scripts/build.js'",
"build:development": "sh -ac '. ./.env.development; node scripts/build.js'",
"build:clean": "rimraf dist",
"test": "mocha ./test/*.js",
"test:watch": "npm test -- --watch",
"format": "prettier --trailing-comma es5 --single-quote --write 'src/*/*.js' 'src/*/!(node_modules)/**/*.js' '!src/services/solc/**/*.js' '!src/services/evm/**/*.js' webpack.config.js",
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/services/preview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Superblocks Lab. If not, see <http://www.gnu.org/licenses/>.

// import { buildProjectHtml } from './utils/buildProjectHtml';
import SuperProvider from '../components/superProvider';
import Networks from '../networks';
import { IEnvironment, IAccount } from '../models/state';
Expand Down
182 changes: 0 additions & 182 deletions packages/editor/src/services/utils/buildProjectHtml.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/editor/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"no-switch-case-fall-through": true,
"no-trailing-whitespace": [true, "ignore-comments"],
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"prefer-object-spread": true,
Expand Down
1 change: 0 additions & 1 deletion packages/web-server/src/api/routers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './badge.router';
export * from './catch-all.router';
export * from './robots-txt.router';

0 comments on commit c5d96b8

Please sign in to comment.