Skip to content

Commit e0e18c0

Browse files
committed
Release 5.1.0
1 parent 2cae559 commit e0e18c0

21 files changed

+1492
-36
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# @oracle/oraclejet-tooling 5.0.1
1+
# @oracle/oraclejet-tooling 5.1.0
22

33
## About the tooling API
44
This tooling API contains methods to build and serve Oracle JET web and hybrid mobile apps. It is intended to be used with task running tools such as grunt or gulp. The APIs can also be invoked directly.
55

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

88
## Installation
9-
This module will be automatically installed when you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet500&id=homepage).
9+
This module will be automatically installed when you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet510&id=homepage).
1010

1111
## [Contributing](https://github.com/oracle/oraclejet-tooling/tree/master/CONTRIBUTING.md)
1212
Oracle JET is an open source project. Pull Requests are currently not being accepted. See

RELEASENOTES.md

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

3-
### 5.0.1
3+
### 5.1.0
4+
* No changes
5+
6+
### 5.0.0
47
* No changes
58

69
### 4.2.0

lib/add.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /usr/bin/env node
2+
/**
3+
Copyright (c) 2015, 2018, Oracle and/or its affiliates.
4+
The Universal Permissive License (UPL), Version 1.0
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* ## Dependencies
11+
*/
12+
const component = require('./scopes/component');
13+
const CONSTANTS = require('./constants');
14+
const util = require('./util');
15+
16+
/**
17+
* # Switch for 'ojet.add()'
18+
*
19+
* @public
20+
* @param {string} scope
21+
* @param {Array} parameters
22+
23+
* @returns {Promise}
24+
*/
25+
module.exports = function (scope, parameters) {
26+
switch (scope) {
27+
case (CONSTANTS.API_SCOPES.COMPONENT):
28+
return component.add(parameters);
29+
default:
30+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.ADD}() 'scope' parameter.`);
31+
return false;
32+
}
33+
};

lib/buildCommon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function _getThemeDestPath(theme, stagingPath, ext, cssonly, servePlatform, serv
7272
let base;
7373
const stylePath = config('paths').src.styles;
7474
if (cssonly) {
75-
if (servePlatform === config('paths').staging.web) {
75+
if (servePlatform === 'web') {
7676
base = path.resolve(stagingPath);
7777
} else if (serveDestination === 'browser') {
7878
base = path.resolve(stagingPath, '..', 'platforms', serveDestination, 'www');

lib/buildHybrid.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function _runCordovaBuildTasks(context) {
115115
function _runCommonBuildTasks(context) {
116116
return new Promise((resolve, reject) => {
117117
buildCommon.clean(context)
118-
.then(hookRunner('before_build', context))
118+
.then(data => hookRunner('before_build', data))
119119
.then(buildCommon.clean)
120120
.then(buildCommon.copy)
121121
.then(buildCommon.copyLibs)
@@ -137,7 +137,7 @@ function _runReleaseBuildTasks(context) {
137137
if (opts.buildType !== 'release') {
138138
resolve(context);
139139
} else {
140-
hookRunner('before_release', context)
140+
hookRunner('before_release_build', context)
141141
.then(buildCommon.uglify)
142142
.then(buildCommon.requireJs)
143143
.then(buildCommon.cleanTemp)
@@ -163,8 +163,8 @@ module.exports = function buildHybrid(buildType, platform, opts) {
163163
.then(_runWindowsLocaleFix)
164164
.then(_runReleaseBuildTasks)
165165
.then(_runCordovaBuildTasks)
166+
.then(data => hookRunner('after_build', data))
166167
.then((data) => {
167-
hookRunner('after_build', data);
168168
resolve(data);
169169
})
170170
.catch(err => reject(err));

lib/buildWeb.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function _runReleaseBuildTasks(context) {
1313
if (opts.buildType !== 'release') {
1414
resolve(context);
1515
} else {
16-
hookRunner('before_release', context)
16+
hookRunner('before_release_build', context)
1717
.then(buildCommon.uglify)
1818
.then(buildCommon.requireJs)
1919
.then(buildCommon.cleanTemp)
@@ -26,7 +26,7 @@ function _runReleaseBuildTasks(context) {
2626
function _runCommonBuildTasks(context) {
2727
return new Promise((resolve, reject) => {
2828
buildCommon.clean(context)
29-
.then(hookRunner('before_build', context))
29+
.then(data => hookRunner('before_build', data))
3030
.then(buildCommon.copy)
3131
.then(buildCommon.copyLibs)
3232
.then(buildCommon.spriteSvg)
@@ -46,8 +46,8 @@ module.exports = function buildWeb(buildType, opts) {
4646
return new Promise((resolve, reject) => {
4747
_runCommonBuildTasks(context)
4848
.then(_runReleaseBuildTasks)
49+
.then(data => hookRunner('after_build', data))
4950
.then((data) => {
50-
hookRunner('after_build', data);
5151
resolve(data);
5252
})
5353
.catch(err => reject(err));

lib/configure.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#! /usr/bin/env node
2+
/**
3+
Copyright (c) 2015, 2018, Oracle and/or its affiliates.
4+
The Universal Permissive License (UPL), Version 1.0
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* ## Dependencies
11+
*/
12+
const catalog = require('./scopes/catalog');
13+
const CONSTANTS = require('./constants');
14+
const util = require('./util');
15+
16+
/**
17+
* # Switch for 'ojet.configure()'
18+
*
19+
* @public
20+
* @param {string} scope
21+
* @param {Object} parameters
22+
*/
23+
module.exports = function (scope, parameters) {
24+
switch (scope) {
25+
case (CONSTANTS.API_SCOPES.CATALOG): {
26+
const catalogUrl = CONSTANTS.CATALOG_URL_PARAM;
27+
if (parameters && util.hasProperty(parameters, catalogUrl)) {
28+
return catalog.configureCatalogUrl(parameters[catalogUrl]);
29+
}
30+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.CONFIGURE}() '${catalogUrl}' parameter.`);
31+
return false;
32+
}
33+
default:
34+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.CONFIGURE}() 'scope' parameter.`);
35+
return false;
36+
}
37+
};

lib/constants.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,19 @@ module.exports = {
4040
PATH_TO_ORACLEJET: 'node_modules/@oracle/oraclejet/dist',
4141
PATH_MAPPING_JSON: 'path_mapping.json',
4242
PATH_MAPPING_VERSION_TOKEN: '#{version}',
43-
PATH_TO_HOOKS_CONFIG: 'scripts/hooks/hooks.json'
43+
PATH_TO_HOOKS_CONFIG: 'scripts/hooks/hooks.json',
44+
45+
API_TASKS: {
46+
ADD: 'add',
47+
CONFIGURE: 'configure',
48+
LIST: 'list',
49+
PUBLISH: 'publish',
50+
REMOVE: 'remove',
51+
SEARCH: 'search'
52+
},
53+
API_SCOPES: {
54+
CATALOG: 'catalog',
55+
COMPONENT: 'component'
56+
},
57+
CATALOG_URL_PARAM: 'catalog-url'
4458
};

lib/hookRunner.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ function _getHookPromise(type, hooksConfig, context) {
2525
const hook = require(hookPath); // eslint-disable-line
2626

2727
hook(_processContextForHooks(context))
28+
.then(() => {
29+
resolve(context);
30+
})
2831
.catch(err => reject(err));
29-
resolve(context);
3032
} else {
3133
console.log(`Hook ${type} not defined..`);
3234
resolve(context);

lib/list.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#! /usr/bin/env node
2+
/**
3+
Copyright (c) 2015, 2018, Oracle and/or its affiliates.
4+
The Universal Permissive License (UPL), Version 1.0
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* ## Dependencies
11+
*/
12+
const component = require('./scopes/component');
13+
const CONSTANTS = require('./constants');
14+
const util = require('./util');
15+
16+
/**
17+
* # Switch for 'ojet.list()'
18+
*
19+
* @public
20+
* @param {string} scope
21+
* @returns {Promise}
22+
*/
23+
module.exports = function (scope) {
24+
switch (scope) {
25+
case (CONSTANTS.API_SCOPES.COMPONENT):
26+
return component.list();
27+
default:
28+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.LIST}() 'scope' parameter.`);
29+
return false;
30+
}
31+
};

lib/publish.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /usr/bin/env node
2+
/**
3+
Copyright (c) 2015, 2018, Oracle and/or its affiliates.
4+
The Universal Permissive License (UPL), Version 1.0
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* ## Dependencies
11+
*/
12+
const component = require('./scopes/component');
13+
const CONSTANTS = require('./constants');
14+
const util = require('./util');
15+
16+
/**
17+
* # Switch for 'ojet.publish()'
18+
*
19+
* @public
20+
* @param {string} scope
21+
* @param {string} parameter
22+
* @param {Object} options
23+
* @returns {Promise}
24+
*/
25+
module.exports = function (scope, parameter, options) {
26+
switch (scope) {
27+
case (CONSTANTS.API_SCOPES.COMPONENT):
28+
return component.publish(parameter, options);
29+
default:
30+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.PUBLISH}() 'scope' parameter.`);
31+
return false;
32+
}
33+
};

lib/remove.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /usr/bin/env node
2+
/**
3+
Copyright (c) 2015, 2018, Oracle and/or its affiliates.
4+
The Universal Permissive License (UPL), Version 1.0
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* ## Dependencies
11+
*/
12+
const component = require('./scopes/component');
13+
const CONSTANTS = require('./constants');
14+
const util = require('./util');
15+
16+
/**
17+
* # Switch for 'ojet.remove()'
18+
*
19+
* @public
20+
* @param {string} scope
21+
* @param {Array} parameters
22+
* @param {boolean} isStrip
23+
* @returns {Promise}
24+
*/
25+
module.exports = function (scope, parameters, isStrip) {
26+
switch (scope) {
27+
case (CONSTANTS.API_SCOPES.COMPONENT):
28+
return component.remove(parameters, isStrip);
29+
default:
30+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.REMOVE}() 'scope' parameter.`);
31+
return false;
32+
}
33+
};

lib/rjsConfigGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function _processVersionToken(libName, libPath) {
6363
function _getRJsConfig(buildType, masterJson, config) {
6464
// Update the requirejs optimizer config to skip bundling any cdn resouces
6565
const newConfig = config;
66-
const useCdn = masterJson.cdn;
66+
const useCdn = masterJson.use;
6767
Object.keys(masterJson.libs).forEach((lib) => {
6868
if (_isCdnPath(masterJson.libs[lib], useCdn, masterJson.cdns, buildType)) {
6969
if (config.paths === undefined) {

0 commit comments

Comments
 (0)