Skip to content
This repository was archived by the owner on Jul 2, 2020. It is now read-only.

Commit 5e06cb2

Browse files
committed
Release 3.2.0
1 parent 4f083c0 commit 5e06cb2

File tree

18 files changed

+125
-59
lines changed

18 files changed

+125
-59
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# generator-oraclejet 3.1.0
1+
# generator-oraclejet 3.2.0
22

33
## About the generator
44
This Yeoman generator for Oracle JET lets you quickly set up a project for use as a web application or hybrid mobile application for Android, iOS or Windows 10.
55

66
This is an open source project maintained by Oracle Corp.
77

88
## Installation
9-
For step-by-step instructions on using Yeoman and this generator to build an Oracle JET application, including possible pre-requisites for installation, please see the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet310/jet/)
9+
For step-by-step instructions on using Yeoman and this generator to build an Oracle JET application, including possible pre-requisites for installation, please see the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet320/jet/)
1010
```bash
1111
npm install -g generator-oraclejet
1212
```
1313

1414
## Usage
15-
Once you have the generator installed, the following commands will scaffold up a JET based application. See the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet310/jet/) for information about all of the available command line options as well as details on pre-requisites for installation.
15+
Once you have the generator installed, the following commands will scaffold up a JET based application. See the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet320/jet/) for information about all of the available command line options as well as details on pre-requisites for installation.
1616

1717
```bash
1818
# Generate a web application with default blank template

RELEASENOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## Release Notes for generator-oraclejet ##
22

3-
### 3.1.0
3+
### 3.2.0
4+
* No changes
45

6+
### 3.1.0
57
* No changes
68

79
### 3.0.0

common/template/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const _WEB = 'web';
1818

1919
const BLANK_TEMPLATE = blankTemplate.BLANK_TEMPLATE;
2020

21-
const _TEMPLATES_NPM_URL = 'oraclejet-templates@~3.1.0';
21+
const _TEMPLATES_NPM_URL = 'oraclejet-templates@~3.2.0';
2222

2323
const _TEMPLATES = [BLANK_TEMPLATE, 'basic', 'navbar', 'navdrawer'];
2424

@@ -101,7 +101,9 @@ function _validateTemplateType(templateType) {
101101
}
102102

103103
function _getLocalFileAbsolutePath(generator, templatePath) {
104-
const absolutePath = path.isAbsolute(templatePath) ? templatePath
105-
: path.resolve(process.cwd(), templatePath);
104+
const tempPath = (templatePath[0] !== '~') ? templatePath
105+
: path.join(process.env.HOME, templatePath.slice(1));
106+
const absolutePath = path.isAbsolute(tempPath) ? tempPath
107+
: path.resolve(process.cwd(), tempPath);
106108
return util.fsExistsSync(absolutePath) ? absolutePath : null;
107109
}

generators/add-hybrid/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
'use strict';
66

7+
const childProcess = require('child_process');
78
const generators = require('yeoman-generator');
89
const fs = require('fs-extra');
910
const path = require('path');
@@ -46,6 +47,7 @@ const OracleJetAddHybridGenerator = generators.Base.extend(
4647
const done = this.async();
4748
_setConfigPaths(paths.getConfiguredPaths(this.destinationPath()));
4849
common.validateArgs(this)
50+
.then(_checkIfCordovaIsInstalled)
4951
.then(common.validateFlags)
5052
.then(_validateAppDirForAddHybrid)
5153
.then(() => {
@@ -94,6 +96,18 @@ const OracleJetAddHybridGenerator = generators.Base.extend(
9496

9597
});
9698

99+
function _checkIfCordovaIsInstalled(generator) {
100+
return new Promise((resolve, reject) => {
101+
childProcess.exec('cordova', (error) => {
102+
if (error) {
103+
reject('Cordova not installed. Please install by: "npm install -g cordova"');
104+
} else {
105+
resolve(generator);
106+
}
107+
});
108+
});
109+
}
110+
97111
function _setConfigPaths(configPathObj) {
98112
Object.keys(configPathObj).forEach((key) => {
99113
_configPaths[key] = configPathObj[key];

generators/app/templates/blank/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<meta name="apple-mobile-web-app-title" content="Oracle JET">
3333

3434
<!-- injector:theme -->
35-
<link rel="stylesheet" href="css/libs/oj/v3.1.0/alta/oj-alta-min.css" id="css" />
35+
<link rel="stylesheet" href="css/libs/oj/v3.2.0/alta/oj-alta-min.css" id="css" />
3636
<!-- endinjector -->
3737

3838
<!-- This is where you would add any app specific styling -->

generators/app/templates/blank/js/main-release-paths.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"promise": "libs/es6-promise/es6-promise.min",
66
"hammerjs": "libs/hammer/hammer-2.0.8.min",
77
"ojdnd": "libs/dnd-polyfill/dnd-polyfill-1.0.0.min",
8-
"ojs": "libs/oj/v3.1.0/min",
9-
"ojL10n": "libs/oj/v3.1.0/ojL10n",
10-
"ojtranslations": "libs/oj/v3.1.0/resources",
8+
"ojs": "libs/oj/v3.2.0/min",
9+
"ojL10n": "libs/oj/v3.2.0/ojL10n",
10+
"ojtranslations": "libs/oj/v3.2.0/resources",
1111
"text": "libs/require/text",
1212
"signals": "libs/js-signals/signals.min",
1313
"customElements": "libs/webcomponents/CustomElements.min",

generators/app/templates/blank/js/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ requirejs.config(
2323
'promise': 'libs/es6-promise/es6-promise',
2424
'hammerjs': 'libs/hammer/hammer-2.0.8',
2525
'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.0',
26-
'ojs': 'libs/oj/v3.1.0/debug',
27-
'ojL10n': 'libs/oj/v3.1.0/ojL10n',
28-
'ojtranslations': 'libs/oj/v3.1.0/resources',
26+
'ojs': 'libs/oj/v3.2.0/debug',
27+
'ojL10n': 'libs/oj/v3.2.0/ojL10n',
28+
'ojtranslations': 'libs/oj/v3.2.0/resources',
2929
'text': 'libs/require/text',
3030
'signals': 'libs/js-signals/signals',
3131
'customElements': 'libs/webcomponents/CustomElements',

generators/app/templates/common/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"homepage": "http://www.oraclejet.org"
88
},
99
"dependencies": {
10-
"oraclejet": "~3.1.0"
10+
"oraclejet": "~3.2.0"
1111
},
1212
"devDependencies": {
1313
"grunt": "^1.0.1",
14-
"grunt-oraclejet": "~3.1.0",
14+
"grunt-oraclejet": "~3.2.0",
1515
"load-grunt-config": "0.19.2",
16-
"oraclejet-tooling": "~3.1.0"
16+
"oraclejet-tooling": "~3.2.0"
1717
},
1818
"engines": {
1919
"node": ">=0.10.0"

generators/hybrid/templates/blank/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<link rel="icon" href="css/images/favicon.ico" type="image/x-icon" />
3131

3232
<!-- injector:theme -->
33-
<link rel="stylesheet" href="css/libs/oj/v3.1.0/alta/oj-alta-min.css" id="css" />
33+
<link rel="stylesheet" href="css/libs/oj/v3.2.0/alta/oj-alta-min.css" id="css" />
3434
<!-- endinjector -->
3535

3636
<!-- This is where you would add any app specific styling -->

generators/hybrid/templates/blank/js/main-debug-paths-windows.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"promise": "libs/es6-promise/es6-promise",
66
"hammerjs": "libs/hammer/hammer-2.0.8",
77
"ojdnd": "libs/dnd-polyfill/dnd-polyfill-1.0.0",
8-
"ojs": "libs/oj/v3.1.0/debug",
9-
"ojL10n": "libs/oj/v3.1.0/ojL10n",
10-
"ojtranslations": "libs/oj/v3.1.0/resources",
11-
"ojtranslations/nls/ojtranslations": "libs/oj/v3.1.0/resources/root/ojtranslations",
12-
"ojtranslations/nls/localeElements": "libs/oj/v3.1.0/resources/root/localeElements",
13-
"ojtranslations/nls/timezoneData": "libs/oj/v3.1.0/resources/root/timezoneData",
8+
"ojs": "libs/oj/v3.2.0/debug",
9+
"ojL10n": "libs/oj/v3.2.0/ojL10n",
10+
"ojtranslations": "libs/oj/v3.2.0/resources",
11+
"ojtranslations/nls/ojtranslations": "libs/oj/v3.2.0/resources/root/ojtranslations",
12+
"ojtranslations/nls/localeElements": "libs/oj/v3.2.0/resources/root/localeElements",
13+
"ojtranslations/nls/timezoneData": "libs/oj/v3.2.0/resources/root/timezoneData",
1414
"text": "libs/require/text",
1515
"signals": "libs/js-signals/signals",
1616
"customElements": "libs/webcomponents/CustomElements.min",

generators/hybrid/templates/blank/js/main-release-paths-windows.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"promise": "libs/es6-promise/es6-promise.min",
66
"hammerjs": "libs/hammer/hammer-2.0.8.min",
77
"ojdnd": "libs/dnd-polyfill/dnd-polyfill-1.0.0.min",
8-
"ojs": "libs/oj/v3.1.0/min",
9-
"ojL10n": "libs/oj/v3.1.0/ojL10n",
10-
"ojtranslations": "libs/oj/v3.1.0/resources",
11-
"ojtranslations/nls/ojtranslations": "libs/oj/v3.1.0/resources/root/ojtranslations",
12-
"ojtranslations/nls/localeElements": "libs/oj/v3.1.0/resources/root/localeElements",
13-
"ojtranslations/nls/timezoneData": "libs/oj/v3.1.0/resources/root/timezoneData",
8+
"ojs": "libs/oj/v3.2.0/min",
9+
"ojL10n": "libs/oj/v3.2.0/ojL10n",
10+
"ojtranslations": "libs/oj/v3.2.0/resources",
11+
"ojtranslations/nls/ojtranslations": "libs/oj/v3.2.0/resources/root/ojtranslations",
12+
"ojtranslations/nls/localeElements": "libs/oj/v3.2.0/resources/root/localeElements",
13+
"ojtranslations/nls/timezoneData": "libs/oj/v3.2.0/resources/root/timezoneData",
1414
"text": "libs/require/text",
1515
"signals": "libs/js-signals/signals.min",
1616
"customElements": "libs/webcomponents/CustomElements.min",

generators/hybrid/templates/blank/js/main-release-paths.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"promise": "libs/es6-promise/es6-promise.min",
66
"hammerjs": "libs/hammer/hammer-2.0.8.min",
77
"ojdnd": "libs/dnd-polyfill/dnd-polyfill-1.0.0.min",
8-
"ojs": "libs/oj/v3.1.0/min",
9-
"ojL10n": "libs/oj/v3.1.0/ojL10n",
10-
"ojtranslations": "libs/oj/v3.1.0/resources",
8+
"ojs": "libs/oj/v3.2.0/min",
9+
"ojL10n": "libs/oj/v3.2.0/ojL10n",
10+
"ojtranslations": "libs/oj/v3.2.0/resources",
1111
"text": "libs/require/text",
1212
"signals": "libs/js-signals/signals.min",
1313
"customElements": "libs/webcomponents/CustomElements.min",

generators/hybrid/templates/blank/js/main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ requirejs.config(
1717
paths:
1818
//injector:mainReleasePaths
1919
{
20-
knockout: 'libs/knockout/knockout-3.4.0.debug',
21-
jquery: 'libs/jquery/jquery-3.1.1',
20+
'knockout': 'libs/knockout/knockout-3.4.0.debug',
21+
'jquery': 'libs/jquery/jquery-3.1.1',
2222
'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.12.0',
23-
promise: 'libs/es6-promise/es6-promise',
24-
hammerjs: 'libs/hammer/hammer-2.0.8',
25-
ojdnd: 'libs/dnd-polyfill/dnd-polyfill-1.0.0',
26-
ojs: 'libs/oj/v3.1.0/debug',
27-
ojL10n: 'libs/oj/v3.1.0/ojL10n',
28-
ojtranslations: 'libs/oj/v3.1.0/resources',
29-
text: 'libs/require/text',
30-
signals: 'libs/js-signals/signals',
31-
customElements: 'libs/webcomponents/CustomElements',
32-
proj4: 'libs/proj4js/dist/proj4-src',
33-
css: 'libs/require-css/css'
23+
'promise': 'libs/es6-promise/es6-promise',
24+
'hammerjs': 'libs/hammer/hammer-2.0.8',
25+
'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.0',
26+
'ojs': 'libs/oj/v3.2.0/debug',
27+
'ojL10n': 'libs/oj/v3.2.0/ojL10n',
28+
'ojtranslations': 'libs/oj/v3.2.0/resources',
29+
'text': 'libs/require/text',
30+
'signals': 'libs/js-signals/signals',
31+
'customElements': 'libs/webcomponents/CustomElements',
32+
'proj4': 'libs/proj4js/dist/proj4-src',
33+
'css': 'libs/require-css/css'
3434
}
3535
//endinjector
3636
,

generators/hybrid/templates/common/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"homepage": "http://www.oraclejet.org"
88
},
99
"dependencies": {
10-
"oraclejet": "~3.1.0"
10+
"oraclejet": "~3.2.0"
1111
},
1212
"devDependencies": {
1313
"fs-extra": "0.30.0",
1414
"grunt": "^1.0.1",
15-
"grunt-oraclejet": "~3.1.0",
15+
"grunt-oraclejet": "~3.2.0",
1616
"load-grunt-config": "0.19.2",
17-
"oraclejet-tooling": "~3.1.0"
17+
"oraclejet-tooling": "~3.2.0"
1818
},
1919
"engines": {
2020
"node": ">=0.10.0"

generators/restore-hybrid/index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
*/
55
'use strict';
66

7+
const exec = require('child_process').exec;
78
const generators = require('yeoman-generator');
89
const common = require('../../common');
910
const commonHybrid = require('../../hybrid');
1011
const commonMessages = require('../../common/messages');
1112
const commonRestore = require('../../common/restore');
1213
const path = require('path');
14+
const paths = require('../../util/paths');
15+
const fs = require('fs-extra');
1316

1417
/*
1518
* Generator for the restore step
@@ -40,7 +43,9 @@ const OracleJetHybridRestoreGenerator = generators.Base.extend(
4043

4144
commonRestore.npmInstall({ generator: this })
4245
.then(commonHybrid.copyHooks)
46+
.then(commonHybrid.copyResources)
4347
.then(commonRestore.writeOracleJetConfigFile)
48+
.then(_invokeCordovaPrepare)
4449
.then(() => {
4550
done();
4651
})
@@ -59,4 +64,23 @@ const OracleJetHybridRestoreGenerator = generators.Base.extend(
5964

6065
});
6166

67+
function _invokeCordovaPrepare(context) {
68+
const generator = context.generator || context;
69+
if (!generator.options.invokedByRestore) return Promise.resolve(context);
70+
const cwd = paths.getConfiguredPaths(generator.destinationPath()).stagingHybrid;
71+
fs.ensureDirSync(path.join(cwd, 'www'));
72+
console.log('Restoring hybrid plugins and platforms....');
73+
return new Promise((resolve, reject) => {
74+
const cmd = 'cordova prepare';
75+
const cmdOpts = { cwd, stdio: [0, 'pipe', 'pipe'], maxBuffer: 1024 * 20000 };
76+
exec(cmd, cmdOpts, (error) => {
77+
// When www/index.html files are missing, cordova reports error
78+
if (error && !/index\.html/.test(error)) {
79+
reject(error);
80+
}
81+
resolve(context);
82+
});
83+
});
84+
}
85+
6286
module.exports = OracleJetHybridRestoreGenerator;

hybrid/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ module.exports =
6767
});
6868
},
6969

70-
copyResources: function _copyResources(generator) {
70+
copyResources: function _copyResources(context) {
71+
const generator = context.generator || context;
7172
const source = generator.templatePath('../../hybrid/templates/common/res');
7273
const dest = _getHybridPath(generator, 'res/');
7374

7475
return new Promise((resolve, reject) => {
75-
fs.copy(source, dest, (err) => {
76+
// do not overwrite existing icons
77+
fs.copy(source, dest, { overwrite: false }, (err) => {
7678
if (err) {
7779
reject(err);
7880
return;
7981
}
80-
resolve(generator);
82+
resolve(context);
8183
});
8284
});
8385
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-oraclejet",
3-
"version": "3.1.0",
3+
"version": "3.2.0",
44
"license": "UPL-1.0",
55
"description": "Yeoman generator for Oracle JET web and mobile applications",
66
"homepage": "http://oraclejet.org",
@@ -43,6 +43,6 @@
4343
"yeoman-test": "^1.5.1"
4444
},
4545
"preferGlobal": true,
46-
"jetversion": "3.1.0",
47-
"jetdocversion": "310"
46+
"jetversion": "3.2.0",
47+
"jetdocversion": "320"
4848
}

template/scripts/grunt/config/oraclejet-build.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,14 @@ module.exports = function (grunt) {
3434
* Example: {cwd: 'app', src: ['**', '!test.js'], dest: 'staging', rename: function (dest, file) {return renamed path}}
3535
*/
3636
// copyCustomLibsToStaging: {
37-
// fileList: []
38-
// },
37+
// fileList: [
38+
// {
39+
// cwd:'node_modules/oraclejet/',
40+
// src: ['*'],
41+
// dest: 'web/js/libs/oraclejet'
42+
// }
43+
// ]
44+
// }
3945

4046
/**
4147
* # copySrcToStaging
@@ -111,15 +117,31 @@ module.exports = function (grunt) {
111117
* The web specific configurations will override the general configuration.
112118
*/
113119
web: {
114-
120+
// copyCustomLibsToStaging: {
121+
// fileList: [
122+
// {
123+
// cwd:'node_modules/oraclejet/',
124+
// src: ['*'],
125+
// dest: 'web/js/libs/oraclejet'
126+
// }
127+
// ]
128+
// }
115129
},
116130

117131
/**
118132
* This is the hybrid specific configuration. You can specify configurations targeted only hybrid apps.
119133
* The hybrid specific configurations will override the general configuration.
120134
*/
121135
hybrid: {
122-
136+
// copyCustomLibsToStaging: {
137+
// fileList: [
138+
// {
139+
// cwd:'node_modules/oraclejet/',
140+
// src: ['*'],
141+
// dest: 'hybrid/www/js/libs/oraclejet'
142+
// }
143+
// ]
144+
// }
123145
}
124146
};
125147
};

0 commit comments

Comments
 (0)