diff --git a/README.md b/README.md index 72167b1..e2d2c3c 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 diff --git a/apex-frontend-boost.ico b/apex-frontend-boost.ico deleted file mode 100644 index 725963a..0000000 Binary files a/apex-frontend-boost.ico and /dev/null differ diff --git a/apex-frontend-boost.lnk b/apex-frontend-boost.lnk deleted file mode 100644 index f0d5f61..0000000 Binary files a/apex-frontend-boost.lnk and /dev/null differ diff --git a/changelog.md b/changelog.md index 5f6a646..fd1f144 100644 --- a/changelog.md +++ b/changelog.md @@ -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` @@ -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 diff --git a/default.json b/default.json index a02ae76..d8251b2 100644 --- a/default.json +++ b/default.json @@ -6,12 +6,12 @@ "enabled": false, "packageJsonPath": "" }, - "javascriptConcat": { - "enabled": true, + "jsConcat": { + "enabled": false, "finalName": "app" }, "cssConcat": { - "enabled": true, + "enabled": false, "finalName": "app" }, "sass": { @@ -25,6 +25,8 @@ "browsersync": { "enabled": true, "port": 3000, + "uiPort": 3001, + "weinrePort": 8080, "notify": true }, "themeroller":{ diff --git a/docs/config.json.md b/docs/config.json.md index 9cdca32..2678de4 100644 --- a/docs/config.json.md +++ b/docs/config.json.md @@ -1,4 +1,4 @@ -# APEX Front-End Boost Configuration +# Configuration A basic `config.json` file is generated when the project's installed: ```json @@ -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 { @@ -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": { @@ -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":{ @@ -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 @@ -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` @@ -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` @@ -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. diff --git a/docs/linux.md b/docs/linux.md new file mode 100644 index 0000000..3901855 --- /dev/null +++ b/docs/linux.md @@ -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 npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm + +> node-sass@3.5.3 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`. diff --git a/gulpfile.js b/gulpfile.js index f23b65a..df467ee 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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."); } @@ -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."); @@ -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(); }; @@ -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)) @@ -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 + } + } }); }); @@ -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']); }); diff --git a/package.json b/package.json index fb1fc18..9a252f9 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,33 @@ { "name": "apex-frontend-boost", - "author": "Vincent Morneau", - "version": "2.0.0", + "author": "OraOpenSource", + "version": "2.1.0", "description": "Enhance your productivity with a complete Front-End Stack for Oracle APEX development", "license": "MIT", + "keywords": [ + "oracle", + "apex", + "orclapex", + "css", + "javascript", + "front-end", + "responsive", + "framework", + "web" + ], "repository": { "type": "git", "url": "https://github.com/OraOpenSource/apex-frontend-boost.git" }, + "bugs": { + "url": "https://github.com/OraOpenSource/apex-frontend-boost/issues" + }, "scripts": { "start": "gulp", "postinstall": "node generateConfig.js" }, "dependencies": { - "browser-sync": "2.11.x", + "browser-sync": "2.12.x", "del": "2.2.x", "gulp": "3.9.x", "gulp-autoprefixer": "3.1.x", @@ -25,10 +39,10 @@ "gulp-cssnano": "2.1.x", "gulp-plumber": "1.1.x", "gulp-rename": "1.2.x", - "gulp-sass": "2.2.x", + "gulp-sass": "2.3.x", "gulp-less": "3.0.x", "gulp-size": "2.1.x", - "gulp-sourcemaps": "1.6.x", + "gulp-sourcemaps": "2.0.0-alpha", "gulp-uglify": "1.5.x", "gulp-util": "3.0.x", "gulp-clone": "1.0.x", @@ -36,7 +50,7 @@ "jshint": "2.x", "jshint-stylish": "2.1.x", "run-sequence": "1.1.x", - "yargs": "4.4.x", + "yargs": "4.6.x", "node.extend": "1.1.x", "merge-stream": "1.0.x", "rtlcss": "2.0.x",