Skip to content

Commit

Permalink
Merge pull request #16 from negarn/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
negar-binary committed May 10, 2019
2 parents cdec6cf + 7195067 commit 46d168b
Show file tree
Hide file tree
Showing 1,593 changed files with 275 additions and 70,358 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ build/*.js
src/javascript/**/__tests__/*.js
src/javascript/_autogenerated/**/*.js
src/javascript/_common/lib/**/*.js
src/javascript/landing_pages/ico*.js
Gruntfile.js
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
browser: true,
amd : true,
mocha : true,
jquery : true,
},
globals: {
dataLayer : true,
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Deriv App
Deriv App
=============

This repository contains the static HTML, Javascript, CSS, and images content of the [deriv.app](http://www.deriv.app) website.

## Installation

In order to work on your own version of the Binary.com Javascript and CSS, please **fork this project**.
In order to work on your own version of the Deriv.com Javascript and CSS, please **fork this project**.

You will also need to install the following on your development machine:

Expand All @@ -25,7 +25,7 @@ How to work with this project
### Deploy to your gh-pages for the first time

1. Register your application [here](https://developers.binary.com/applications/). This will give you the ability to redirect back to your github pages after login.
Use `https://YOUR_GITHUB_USERNAME.github.io/binary-static/en/logged_inws.html` for the Redirect URL and `https://YOUR_GITHUB_USERNAME.github.io/binary-static/en/redirect.html` for the Verification URL.
Use `https://YOUR_GITHUB_USERNAME.github.io/deriv-com/en/logged_inws.html` for the Redirect URL and `https://YOUR_GITHUB_USERNAME.github.io/deriv-com/en/redirect.html` for the Verification URL.

If you're using a custom domain, replace the github URLs above with your domain.

Expand Down Expand Up @@ -59,7 +59,7 @@ grunt dev --path=about-us
### Using sub-folders
There are times that you are working on various branches at the same time, and you want to deploy/test each branch separately on your gh-pages, you can simply use `--branch=branchname` for grunt commands:
- `grunt dev --branch=branchname`
This will deploy your changes to a sub-folder named: `br_branchname` and it can be browsed at: https://YOUR_GITHUB_USERNAME.github.io/binary-static/br_branchname/
This will deploy your changes to a sub-folder named: `br_branchname` and it can be browsed at: https://YOUR_GITHUB_USERNAME.github.io/deriv-com/br_branchname/

In order to remove the created folders from your gh-pages, you can use either:
- `grunt dev --cleanup`: removes all `br_*` folders and deploys to the root folder.
Expand Down Expand Up @@ -103,7 +103,7 @@ grunt release --{release type}=1 --section=app|app_2 [--cleanup] [--reset]
- Your current branch will be checked to be the correct branch of the given parameter.
- `--section` (mandatory)
- In order to prevent mistakes during the release, it is mandatory to specify the section.
- Valid section depends on the release target. Please refer to `release_config` [here](https://github.com/binary-com/binary-static/blob/new-app/build/config/constants.js).
- Valid section depends on the release target. Please refer to `release_config` [here](https://github.com/binary-com/deriv-com/blob/new-app/build/config/constants.js).
- `--cleanup` [optional]
- Create CNAME file with proper value according to remote origin
- Deploy to gh-pages with the option `add: false`
Expand Down
35 changes: 8 additions & 27 deletions build/config/constants.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
const release_targets = {
production: {
repo : 'git@github.com:binary-static-deployed/binary-static.git',
CNAME: 'www.binary.com',
repo : 'git@github.com:binary-com/deriv-app.git',
target_repo: 'git@github.com:binary-com/deriv-app-production.git',
CNAME : 'deriv.app',
},
staging: {
repo : 'git@github.com:binary-com/binary-static.git',
CNAME: 'staging.binary.com',
},
binarynex: {
repo : 'git@github.com:binary-com/binarynex-deployed.git',
CNAME: 'www.binarynex.com',
repo : 'git@github.com:binary-com/deriv-app.git',
CNAME: 'staging.deriv.app',
},
};

Expand All @@ -25,14 +22,15 @@ const release_config = {
production: {
branch : 'master',
target_folder : '',
valid_sections: ['app', 'app_2', 'all'],
valid_sections: ['app_2'],
origin : release_targets.production.repo,
target_repo : release_targets.production.target_repo,
CNAME : release_targets.production.CNAME,
},
staging: {
branch : 'master',
target_folder : '',
valid_sections: ['app', 'app_2', 'all'],
valid_sections: ['app_2'],
origin : release_targets.staging.repo,
CNAME : release_targets.staging.CNAME,
},
Expand All @@ -43,26 +41,9 @@ const release_config = {
origin : release_targets.staging.repo,
CNAME : release_targets.staging.CNAME,
},
nex_production: {
branch : 'master',
target_folder : '',
valid_sections: ['app_2'],
origin : release_targets.staging.repo,
target_repo : release_targets.binarynex.repo,
CNAME : release_targets.binarynex.CNAME,
},
nex_beta: {
branch : 'master',
target_folder : 'beta',
valid_sections: ['app_2'],
origin : release_targets.staging.repo,
target_repo : release_targets.binarynex.repo,
CNAME : release_targets.binarynex.CNAME,
},
};

const node_modules_paths = {
binary_style: 'node_modules/@binary-com/binary-style',
smartcharts : 'node_modules/smartcharts-beta',
};

Expand Down
21 changes: 0 additions & 21 deletions build/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ module.exports = function (grunt) {
];

const config = {
app: {
files: [
...common,
{ expand: true, cwd: 'src/root_files/app', src: ['**', '!index.html'], dest: 'dist' }, // top level
{ expand: true, cwd: 'src/root_files/app', src: ['index.html'], dest: global.dist },

// app, static
{ expand: true, cwd: 'src/download/', src: ['**'], dest: `${global.dist}/download/` },
{ expand: true, cwd: 'src/images/', src: ['**', '!app_2/**', '!common/logos'], dest: `${global.dist}/images/` },
{ expand: true, cwd: 'src/javascript/_autogenerated/', src: ['*.js'], dest: `${global.dist}/js/texts/` },
{ expand: true, cwd: 'src/javascript/', src: ['manifest.json'], dest: global.dist },

// binary-style
{ expand: true, cwd: `${global.node_modules_paths.binary_style}/src/images/favicons`, src: ['**'], dest: `${global.dist}/images/favicons/` },
{ expand: true, cwd: `${global.node_modules_paths.binary_style}/src/images/logo`, src: ['**'], dest: `${global.dist}/images/logo/` },
],
},
app_2: {
files: [
...common,
Expand All @@ -44,9 +27,6 @@ module.exports = function (grunt) {
{ expand: true, cwd: 'src/images/app_2', src: ['**'], dest: `${global.dist_app_2}/images/` },
{ expand: true, cwd: 'src/javascript/_autogenerated/app_2/', src: ['*.js'], dest: `${global.dist_app_2}/js/texts/` },

// binary-style
{ expand: true, cwd: `${global.node_modules_paths.binary_style}/src/images/favicons`, src: ['**'], dest: `${global.dist_app_2}/images/favicons/` },

// ChartIQ dependencies
{ expand: true, cwd: `${global.node_modules_paths.smartcharts}/dist/`, src: ['*.smartcharts.*'], dest: `${global.dist_app_2}/js/smartcharts/` },
{ expand: true, cwd: `${global.node_modules_paths.smartcharts}/dist/`, src: ['smartcharts.css*'], dest: `${global.dist_app_2}/css/` },
Expand All @@ -55,7 +35,6 @@ module.exports = function (grunt) {
get all() {
return {
files: [
...this.app.files,
...this.app_2.files,
],
};
Expand Down
13 changes: 1 addition & 12 deletions build/cssmin.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
module.exports = function (grunt) {
const files = {
app: [
{
src: [
`${global.dist}/css/common.css`,
`${global.node_modules_paths.binary_style}/binary.css`,
`${global.node_modules_paths.binary_style}/binary.more.css`,
],
dest: `${global.dist}/css/common.min.css`,
},
{ src: `${global.dist}/css/app.css`, dest: `${global.dist}/css/app.min.css` },
{ src: `${global.dist}/css/static.css`, dest: `${global.dist}/css/static.min.css` },
],
app: [],
app_2: [
{ src: `${global.dist_app_2}/css/app_2.css`, dest: `${global.dist_app_2}/css/app_2.min.css` },
],
Expand Down
10 changes: 5 additions & 5 deletions build/webpack/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const getPlugins = (app, grunt) => ([
}),

...(languages.map(lang => new SWPrecachedWebpackPlugin({
cachedId : 'app_2',
dontCacheBustUrlsMatching: /\.\w{8}\./,
minify : false,
navigateFallback : '',
filepath : path.resolve(PATHS.DIST, `app/${lang.toLowerCase()}/service-worker.js`),
cachedId : 'app_2',
dontCacheBustUrlsMatching : /\.\w{8}\./,
minify : false,
navigateFallback : '',
filepath : path.resolve(PATHS.DIST, `app/${lang.toLowerCase()}/service-worker.js`),
// TODO Uncomment below lines when changing the release process order to execute `js` task after `render`
// staticFileGlobs : [
// path.resolve(PATHS.DIST, `app/${lang.toLowerCase()}/index.html`),
Expand Down
Loading

0 comments on commit 46d168b

Please sign in to comment.