Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentmorneau committed Apr 30, 2016
2 parents a64c0d6 + aed4deb commit 6232941
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 60 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ It eliminates the need for refreshing the browser. As soon as you save your code
## Project Sponsors
Thanks to [Insum Solutions](http://insum.ca/) for sponsoring this project.

## System Requirements
- [Node.js](https://nodejs.org) 4.4 (or more)
- [Oracle APEX](https://apex.oracle.com) 5 (or more) for [Application Setup Option 1](/docs/apex-setup.md)
- [Oracle APEX](https://apex.oracle.com) 4-5 (or more) for [Application Setup Option 2](/docs/apex-setup.md)

## Install
On the command line:
```bash
git clone https://github.com/OraOpenSource/apex-frontend-boost.git
cd apex-frontend-boost
npm install
npm install apex-frontend-boost
```

*Installing on Windows? [See documentation](/docs/windows.md).*
*Having problems installing on Windows? [See documentation](/docs/windows.md).*

*Having problems installing on Linux? [See documentation](/docs/linux.md).*

## Configuration
You need to configure APEX Front-End Boost for your project(s). [See documentation](/docs/config.json.md).
Expand All @@ -62,11 +68,11 @@ Review the [APEX Setup](/docs/apex-setup.md) docs to choose the most appropriate
`npm start -- --project=yourProjectName`

**Running on Windows?**
- Execute `apex-frontend-boost` shortcut
- Launch `apex-frontend-boost.bat`
- Enter project name

**Running on Linux/OSx?**
- `./apex-frontend-boost.sh`
- Execute `./apex-frontend-boost.sh`
- Enter project name

## Usage
Expand Down
Binary file removed apex-frontend-boost.ico
Binary file not shown.
Binary file removed apex-frontend-boost.lnk
Binary file not shown.
25 changes: 18 additions & 7 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#Changelog
##2.0.0
# Changelog
## 2.1.0
- Project is now available on npm
- Fixed a bug preventing from doing POST on Chrome
- Concatenation is now disabled by default. You will have to enable it in your `config.json` file if you want your project to use `js` or `css` concatenation.
- `javascriptConcat` is now `jsConcat`
- Added ports configuration over the `browsersync` feature in `config.json` (per project)
- Simplified Windows shortcut
- Added system requirements
- Enhanced docs
- More.

## 2.0.0
- Complete project overhaul. Read documentation for a complete list of features.

##1.4.0
## 1.4.0
- Updated dependencies
- Changed terminology
- `client` to `src`
Expand All @@ -11,14 +22,14 @@
- was not generic enough for this project
- Removed assets intermediate folder

##1.3.0
## 1.3.0
- Updated dependencies

##1.2.0
## 1.2.0
- Updated dependencies

##1.1.0
## 1.1.0
- Updated dependencies

##1.0.0
## 1.0.0
- Initial Release
8 changes: 5 additions & 3 deletions default.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"enabled": false,
"packageJsonPath": ""
},
"javascriptConcat": {
"enabled": true,
"jsConcat": {
"enabled": false,
"finalName": "app"
},
"cssConcat": {
"enabled": true,
"enabled": false,
"finalName": "app"
},
"sass": {
Expand All @@ -25,6 +25,8 @@
"browsersync": {
"enabled": true,
"port": 3000,
"uiPort": 3001,
"weinrePort": 8080,
"notify": true
},
"themeroller":{
Expand Down
53 changes: 30 additions & 23 deletions docs/config.json.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# APEX Front-End Boost Configuration
# Configuration

A basic `config.json` file is generated when the project's installed:
```json
Expand All @@ -16,20 +16,19 @@ A basic `config.json` file is generated when the project's installed:
}
```

It needs to be configured to your project needs. Example:
It needs to be configured to each one of your projects. Example:
```json
{
"sandbox": {
"appURL": "https://apex.oracle.com/pls/apex/f?p=10344:101",
"srcFolder": "C:\\APEX\\sandbox\\src",
"distFolder": "C:\\APEX\\sandbox\\dist",
"sass": {
"enabled": true
}
"distFolder": "C:\\APEX\\sandbox\\dist"
}
}
```

*Both srcFolder and distFolder can be written as a relative path as well.*

It is only mandatory to fill out the `appURL` in `config.json`. The rest is optional and will be substituted from `default.json`:
```json
{
Expand All @@ -40,12 +39,12 @@ It is only mandatory to fill out the `appURL` in `config.json`. The rest is opti
"enabled": false,
"packageJsonPath": ""
},
"javascriptConcat": {
"enabled": true,
"jsConcat": {
"enabled": false,
"finalName": "app"
},
"cssConcat": {
"enabled": true,
"enabled": false,
"finalName": "app"
},
"sass": {
Expand All @@ -59,6 +58,8 @@ It is only mandatory to fill out the `appURL` in `config.json`. The rest is opti
"browsersync": {
"enabled": true,
"port": 3000,
"uiPort": 3001,
"weinrePort": 8080,
"notify": true
},
"themeroller":{
Expand All @@ -72,7 +73,7 @@ It is only mandatory to fill out the `appURL` in `config.json`. The rest is opti
}
```

##Read below for more information about each fields.
## Read below for more information about each fields.

### Application

Expand All @@ -88,19 +89,9 @@ It is only mandatory to fill out the `appURL` in `config.json`. The rest is opti
> This is the path to your application dist folder.
> If nothing is filled, the current repository will be used with the `/dist/` folder.
### Javascript Concatenation

**`javascriptConcat.enabled`** : `boolean`, default `true`
> Turns on and off the javascript concatenation feature.
**`javascriptConcat.finalName`** : `string`, default `app`
> Represents the name of the final file, after concatenation.
> Only applies if `javascriptConcat.enabled` is `true`.
> Will become `app.js` and `app.min.js`
### Header

**`header.enabled`** : `boolean`, default `true`
**`header.enabled`** : `boolean`, default `false`
> Turns on and off the automatic header comment block feature.
**`header.packageJsonPath`** : `string`
Expand All @@ -117,9 +108,19 @@ It is only mandatory to fill out the `appURL` in `config.json`. The rest is opti
*/
```

### Javascript Concatenation

**`jsConcat.enabled`** : `boolean`, default `false`
> Turns on and off the javascript concatenation feature.
**`jsConcat.finalName`** : `string`, default `app`
> Represents the name of the final file, after concatenation.
> Only applies if `jsConcat.enabled` is `true`.
> Will become `app.js` and `app.min.js`
### CSS Concatenation

**`cssConcat.enabled`** : `boolean`, default `true`
**`cssConcat.enabled`** : `boolean`, default `false`
> Turns on and off the css concatenation feature.
**`cssConcat.finalName`** : `string`, default `app`
Expand Down Expand Up @@ -153,7 +154,13 @@ It is only mandatory to fill out the `appURL` in `config.json`. The rest is opti
> Turns on and off the browsersync feature.
**`browsersync.port`** : `int`, default `3000`
> This is the port that browsersync will use to serve your static files.
> This is the port that browsersync uses to serve your static files.
**`browsersync.uiPort`** : `int`, default `3001`
> Browsersync includes a user-interface that is accessed via a separate port.
**`browsersync.weinrePort`** : `int`, default `8080`
> This is the weinre port that browsersync uses.
**`browsersync.notify`** : `boolean`, default `true`
> This option makes browsersync alert you when a file is dynamically injected to you browser.
Expand Down
37 changes: 37 additions & 0 deletions docs/linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Ubuntu

If you installed node from the package manager, you may run into issues when installing `apex-frontend-boost` - and in particular, for one of the node dependencies `node-sass`. The reason for this is that this package tries to run a node script using the `node` command, rather than `nodejs`. To get around this, we need a binary for `node` on the classpath - we can create a symbolic link for `/usr/bin/node` that points to `/usr/bin/nodejs`.

The package `nodejs` installs the node binary to `nodejs`.

```bash
$ sudo apt-get install nodejs npm
$ dpkg -L nodejs | grep /bin
/usr/bin
/usr/bin/nodejs
```

So, when attempting to install `node-sass`, you are presented with an error preventing the installation succeeding.

```bash
$ npm install node-sass
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm

> [email protected] install /tmp/node_modules/node-sass
> node scripts/install.js

sh: 1: node: not found
```

As you can see, the installation is attempting to call `node script/install.js`, but when no `node` command is found, it can not complete.

Add a symbolic link for `node`.

```
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
$ #Verify node on the classpath
$ which node
/usr/bin/node
```

Now, the installation of `node-sass` should complete without a drama, and more broadly, the installation of `apex-frontend-boost`.
30 changes: 15 additions & 15 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ if (config.sass.enabled && config.less.enabled) {
process.exit(1);
}

// missing appURL
// missing project appURL
if (util.isEmptyObject(config.appURL)) {
console.log("Missing appURL in your config.json file.");
}

// missing srcFolder
// missing project srcFolder
if (util.isEmptyObject(config.srcFolder)) {
console.log("Missing srcFolder in your config.json file.");
}

// missing distFolder
// missing project distFolder
if (util.isEmptyObject(config.distFolder)) {
console.log("Missing distFolder in your config.json file.");
}
Expand All @@ -60,7 +60,7 @@ if((util.isEmptyObject(config.appURL))
process.exit(1);
}

// missing config.header.packageJsonPath
// missing project header.packageJsonPath
if (config.header.enabled) {
if (util.isEmptyObject(config.header.packageJsonPath)) {
console.log("Missing packageJsonPath in your config.json file.");
Expand Down Expand Up @@ -119,7 +119,6 @@ var paths = {
safe: true
},
apexMiddleware = function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Set-Cookie', ['oos-apex-frontend-boost-app-images=//' + req.headers.host + '/']);
next();
};
Expand All @@ -138,7 +137,7 @@ gulp.task('js', function() {
.pipe(plugins.jshint.reporter('jshint-stylish'))
.pipe(plugins.if(config.header.enabled, plugins.header(banner, { pkg : pkg } )))
.pipe(plugins.sourcemaps.init())
.pipe(plugins.if(config.javascriptConcat.enabled, plugins.concat(config.javascriptConcat.finalName + '.js')))
.pipe(plugins.if(config.jsConcat.enabled, plugins.concat(config.jsConcat.finalName + '.js')))
.pipe(plugins.size(sizeOptions))
.pipe(plugins.sourcemaps.write(paths.sourcemaps))
.pipe(gulp.dest(paths.dist + assets.js))
Expand Down Expand Up @@ -218,22 +217,22 @@ gulp.task('themeroller', function(){
.pipe(gulp.dest(paths.dist + assets.less));
});

// starts local server
// launch browsersync server
gulp.task('browsersync', function() {
// returns the apex host URL (before f?p=)
var apexHost = config.appURL.substring(0, config.appURL.indexOf("f?p="));
// takes the apex query string from the provided apex url
var apexQueryString = config.appURL.substring(config.appURL.indexOf("f?p="))

// launch the browsersync server
browsersync.init({
port: config.browsersync.port,
notify: config.browsersync.notify,
proxy: {
target: apexHost + apexQueryString,
target: config.appURL,
middleware: apexMiddleware
},
serveStatic: [config.distFolder]
serveStatic: [config.distFolder],
ui: {
port: config.browsersync.uiPort,
weinre: {
port: config.browsersync.weinrePort
}
}
});
});

Expand All @@ -252,6 +251,7 @@ gulp.task('watch', function() {
gulp.watch(allSubFolders + files.less, { cwd: paths.src + assets.less }, ['themeroller']);
}

// img and lib
gulp.watch(allSubFolders + files.all, { cwd: paths.src + assets.img }, ['img']);
gulp.watch(allSubFolders + files.all, { cwd: paths.src + assets.lib }, ['lib']);
});
Expand Down
Loading

0 comments on commit 6232941

Please sign in to comment.