Skip to content

Commit b99f1eb

Browse files
committed
Release 5.2.0
1 parent e0e18c0 commit b99f1eb

24 files changed

+2160
-610
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.1.0
1+
# @oracle/oraclejet-tooling 5.2.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=jet510&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=jet520&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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Release Notes for oraclejet-tooling ##
22

3+
### 5.2.0
4+
* No changes
5+
36
### 5.1.0
47
* No changes
58

@@ -38,3 +41,4 @@
3841
* Allow multiple themes to be included in a built app
3942
* Grunt serve to specific iOS emulator fails
4043
* no-build option missing from grunt serve
44+
>>>>>>> 0f5544d... Merge branch 'master' into ListPacks

THIRDPARTYLICENSE.txt

Lines changed: 475 additions & 0 deletions
Large diffs are not rendered by default.

lib/add.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
const component = require('./scopes/component');
1313
const CONSTANTS = require('./constants');
14+
const pack = require('./scopes/pack');
1415
const util = require('./util');
1516

1617
/**
@@ -19,13 +20,16 @@ const util = require('./util');
1920
* @public
2021
* @param {string} scope
2122
* @param {Array} parameters
23+
* @param {Object} options
2224
2325
* @returns {Promise}
2426
*/
25-
module.exports = function (scope, parameters) {
27+
module.exports = function (scope, parameters, options) {
2628
switch (scope) {
2729
case (CONSTANTS.API_SCOPES.COMPONENT):
28-
return component.add(parameters);
30+
return component.add(parameters, options);
31+
case (CONSTANTS.API_SCOPES.PACK):
32+
return pack.add(parameters);
2933
default:
3034
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.ADD}() 'scope' parameter.`);
3135
return false;

lib/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const config = require('./config');
1717
* @param {string} [options.buildType] - buildType 'dev' or 'release'
1818
* @param {string} [options.theme] - Theme, default to alta:platform
1919
* @param {Array} [options.themes] - Themes, default to first theme in the array
20-
* @param {string} [options.sassCompile] - Whether to compile sass
20+
* @param {boolean} [options.sassCompile] - Whether to compile sass
2121
* @param {string} [options.destination='emulator'] -Cordova build flag --emulator or --device
2222
* @param {string} [options.buildConfig] - Path to build configuration file
2323
* @param {boolean} [options.buildForServe] - Whether to invoke build just for Serve

lib/buildCommon.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,32 @@ module.exports = {
425425
return resolve(context);
426426
});
427427
},
428+
copyLocalCca: function _copyLocalCca(context) {
429+
return new Promise((resolve) => {
430+
const srcBase = path.join(config('paths').src.common, config('paths').src.javascript, config('paths').composites);
431+
const destBase = path.join(config('paths').staging.stagingPath, config('paths').src.javascript, config('paths').composites);
432+
433+
const components = glob.sync('**/component.json', { cwd: srcBase });
434+
components.forEach((componentPath) => {
435+
const componentJson = util.readJsonAndReturnObject(path.join(srcBase, componentPath));
436+
let destPath = path.join(destBase, componentPath);
437+
// if the component doesn't belong to a pack
438+
if (!Object.prototype.hasOwnProperty.call(componentJson, 'pack')) {
439+
destPath = path.join(destPath, '..', componentJson.version);
440+
} else {
441+
const packName = path.dirname(path.join(componentPath, '..'));
442+
const packJsonPath = path.join(srcBase, packName, 'component.json');
443+
let packVersion = '1.0.0';
444+
if (util.fsExistsSync(packJsonPath)) {
445+
const packJson = util.readJsonAndReturnObject(packJsonPath);
446+
packVersion = packJson.version;
447+
}
448+
destPath = path.join(destBase, packName, packVersion, componentJson.name);
449+
}
450+
451+
fs.copySync(path.join(srcBase, componentPath, '..'), destPath);
452+
});
453+
return resolve(context);
454+
});
455+
},
428456
};

lib/buildHybrid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function _runCordovaBuildTasks(context) {
103103
if (opts.buildForServe) {
104104
resolve(context);
105105
} else {
106-
hookRunner('before_release_build', context)
106+
hookRunner('before_hybrid_build', context)
107107
.then(_invokeCordovaPrepare)
108108
.then(_invokeCordovaCompile)
109109
.then(data => resolve(data))
@@ -119,6 +119,7 @@ function _runCommonBuildTasks(context) {
119119
.then(buildCommon.clean)
120120
.then(buildCommon.copy)
121121
.then(buildCommon.copyLibs)
122+
.then(buildCommon.copyLocalCca)
122123
.then(buildCommon.spriteSvg)
123124
.then(buildCommon.sass)
124125
.then(buildCommon.injectCdnBundleScript)

lib/buildWeb.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function _runCommonBuildTasks(context) {
2929
.then(data => hookRunner('before_build', data))
3030
.then(buildCommon.copy)
3131
.then(buildCommon.copyLibs)
32+
.then(buildCommon.copyLocalCca)
3233
.then(buildCommon.spriteSvg)
3334
.then(buildCommon.sass)
3435
.then(buildCommon.injectCdnBundleScript)

lib/config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ config.getConfiguredPaths = (platform) => {
7373
const configuredPlatform = platform || config.data.platform;
7474
staging.stagingPath = (configuredPlatform === 'web') ? staging.web : path.join(staging.hybrid, 'www');
7575
src.platformSpecific = (configuredPlatform === 'web') ? src.web : src.hybrid;
76-
return { src, staging };
76+
return {
77+
src,
78+
staging,
79+
components: `${CONSTANTS.JET_COMPONENTS_DIRECTORY}`,
80+
composites: `${CONSTANTS.JET_COMPOSITE_DIRECTORY}`
81+
};
7782
};
7883

7984
function _readConfigJson() {

lib/configure.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* ## Dependencies
1111
*/
12-
const catalog = require('./scopes/catalog');
12+
const exchange = require('./scopes/exchange');
1313
const CONSTANTS = require('./constants');
1414
const util = require('./util');
1515

@@ -22,12 +22,12 @@ const util = require('./util');
2222
*/
2323
module.exports = function (scope, parameters) {
2424
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]);
25+
case (CONSTANTS.API_SCOPES.EXCHANGE): {
26+
const exchangeUrl = CONSTANTS.EXCHANGE_URL_PARAM;
27+
if (parameters && util.hasProperty(parameters, exchangeUrl)) {
28+
return exchange.configureUrl(parameters[exchangeUrl]);
2929
}
30-
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.CONFIGURE}() '${catalogUrl}' parameter.`);
30+
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.CONFIGURE}() '${exchangeUrl}' parameter.`);
3131
return false;
3232
}
3333
default:

lib/constants.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = {
1515
DEFAULT_BROWSER: 'chrome',
1616
COMMON_THEME_DIRECTORY: 'common',
1717
JET_COMPOSITE_DIRECTORY: 'jet-composites',
18+
JET_COMPONENTS_DIRECTORY: 'jet_components',
19+
JET_COMPONENT_JSON: 'component.json',
1820
SUPPORTED_PLATFORMS: ['android', 'ios', 'web', 'windows'],
1921
SUPPORTED_THEME_PLATFORMS: ['android', 'ios', 'web', 'windows', 'common'],
2022
SUPPORTED_HYBRID_PLATFORMS: ['android', 'ios', 'windows'],
@@ -51,8 +53,9 @@ module.exports = {
5153
SEARCH: 'search'
5254
},
5355
API_SCOPES: {
54-
CATALOG: 'catalog',
55-
COMPONENT: 'component'
56+
EXCHANGE: 'exchange',
57+
COMPONENT: 'component',
58+
PACK: 'pack'
5659
},
57-
CATALOG_URL_PARAM: 'catalog-url'
60+
EXCHANGE_URL_PARAM: 'exchange-url'
5861
};

lib/defaultconfig.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ module.exports = {
107107
`!${paths.src.javascript}/libs/**/*debug*/**`,
108108
`!${paths.src.javascript}/main-release-paths.json`,
109109
`!${paths.staging.themes}/**`,
110+
`!${paths.src.javascript}/${paths.composites}/**`,
110111
'!cordova.js'
111112
],
112113
dest: paths.staging.stagingPath
@@ -116,6 +117,7 @@ module.exports = {
116117
cwd: paths.src.common,
117118
src: [
118119
'**',
120+
`!${paths.src.javascript}/${paths.composites}/**`,
119121
`!${paths.src.javascript}/main-release-paths.json`,
120122
`!${paths.staging.themes}/**`,
121123
],
@@ -137,7 +139,12 @@ module.exports = {
137139
cwd: `${paths.src.common}/${paths.src.themes}`,
138140
src: ['**', '!**/*.scss', '!**.map'],
139141
dest: paths.staging.themes
140-
}
142+
},
143+
{
144+
cwd: `${paths.components}`,
145+
src: ['**'],
146+
dest: `${paths.staging.stagingPath}/${paths.src.javascript}/${paths.composites}`
147+
},
141148
],
142149
}),
143150

@@ -165,9 +172,14 @@ module.exports = {
165172
}
166173
},
167174
{
168-
cwd: `${paths.src.common}/${paths.src.javascript}/jet-composites`,
175+
cwd: `${paths.src.common}/${paths.src.javascript}/${paths.composites}`,
176+
src: ['**/*.scss', '!**/_*.scss'],
177+
dest: `${paths.staging.stagingPath}/${paths.src.javascript}/${paths.composites}`
178+
},
179+
{
180+
cwd: `${paths.components}`,
169181
src: ['**/*.scss', '!**/_*.scss'],
170-
dest: `${paths.staging.stagingPath}/${paths.src.javascript}/jet-composites`
182+
dest: `${paths.staging.stagingPath}/${paths.src.javascript}/${paths.composites}`
171183
}
172184
],
173185
options: {
@@ -245,7 +257,8 @@ module.exports = {
245257
sass: {
246258
files: [
247259
`${paths.src.common}/${paths.src.themes}/**/*`,
248-
`${paths.src.common}/${paths.src.javascript}/jet-composites/**/*.scss`,
260+
`${paths.components}/**/*.scss`,
261+
`${paths.src.common}/${paths.src.javascript}/${paths.composites}/**/*.scss`,
249262
],
250263
options: {
251264
livereload: true,

lib/list.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
const component = require('./scopes/component');
1313
const CONSTANTS = require('./constants');
14+
const pack = require('./scopes/pack');
1415
const util = require('./util');
1516

1617
/**
@@ -24,6 +25,8 @@ module.exports = function (scope) {
2425
switch (scope) {
2526
case (CONSTANTS.API_SCOPES.COMPONENT):
2627
return component.list();
28+
case (CONSTANTS.API_SCOPES.PACK):
29+
return pack.list();
2730
default:
2831
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.LIST}() 'scope' parameter.`);
2932
return false;

lib/publish.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
const component = require('./scopes/component');
1313
const CONSTANTS = require('./constants');
14+
const pack = require('./scopes/pack');
1415
const util = require('./util');
1516

1617
/**
@@ -26,6 +27,8 @@ module.exports = function (scope, parameter, options) {
2627
switch (scope) {
2728
case (CONSTANTS.API_SCOPES.COMPONENT):
2829
return component.publish(parameter, options);
30+
case (CONSTANTS.API_SCOPES.PACK):
31+
return pack.publish(parameter, options);
2932
default:
3033
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.PUBLISH}() 'scope' parameter.`);
3134
return false;

lib/remove.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
const component = require('./scopes/component');
1313
const CONSTANTS = require('./constants');
14+
const pack = require('./scopes/pack');
1415
const util = require('./util');
1516

1617
/**
@@ -26,6 +27,8 @@ module.exports = function (scope, parameters, isStrip) {
2627
switch (scope) {
2728
case (CONSTANTS.API_SCOPES.COMPONENT):
2829
return component.remove(parameters, isStrip);
30+
case (CONSTANTS.API_SCOPES.PACK):
31+
return pack.remove(parameters);
2932
default:
3033
util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.REMOVE}() 'scope' parameter.`);
3134
return false;

0 commit comments

Comments
 (0)