Skip to content

Commit f484ce4

Browse files
committed
Release 4.0.0
1 parent d9766fb commit f484ce4

36 files changed

+162
-132
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ The Universal Permissive License (UPL), Version 1.0*
88
We plan to provide this functionality in the future. At that time, you will need to follow [The Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html)
99
(OCA).
1010

11-
If you have ideas, comments, or issues related to generator, swing on by the [Oracle JET discussion forum.](https://community.oracle.com/community/development_tools/oracle-jet/generators)
11+
If you have ideas, comments, or issues to discuss, swing on by the [Oracle JET discussion forum.](https://community.oracle.com/community/development_tools/oracle-jet/generators)
1212

Gruntfile.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
# oraclejet-tooling 3.2.0
1+
# @oracle/oraclejet-tooling 4.0.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-
The oraclejet-tooling API will be automatically installed if you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet320/jet/).
10-
11-
## Usage
12-
The oraclejet-tooling API contains a build API that will build the app with dev or release mode, and other options. It also contains a serve API that serves up your app to browser/simulator/device. Please refer to the source code for details on how to invoke and use the API methods.
9+
This module will be automatically installed when you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet400/jet/).
1310

1411
## [Contributing](https://github.com/oracle/oraclejet-tooling/tree/master/CONTRIBUTING.md)
1512
Oracle JET is an open source project. Pull Requests are currently not being accepted. See
@@ -18,4 +15,4 @@ for details.
1815

1916
## [License](https://github.com/oracle/oraclejet-tooling/tree/master/LICENSE.md)
2017
Copyright (c) 2014, 2017 Oracle and/or its affiliates
21-
The Universal Permissive License (UPL), Version 1.0
18+
The Universal Permissive License (UPL), Version 1.0

RELEASENOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Release Notes for oraclejet-tooling ##
22

3+
### 4.0.0
4+
* Moved module into @oracle scope, changing the name to @oracle/oraclejet-tooling
5+
36
### 3.2.0
47
* No changes
58

config/eslintcustom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
//

hooks/jetAfterPrepare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
44
The Universal Permissive License (UPL), Version 1.0
55
*/
66

hooks/jetInjector.js

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';
@@ -53,6 +53,7 @@ module.exports =
5353
content = fs.readFileSync(indexHtmlPath, 'utf-8');
5454

5555
content = _addPlatformStyleClasses(content, platform);
56+
content = _updateCspGapReady(content);
5657
if (_isLiveReloadEnabled()) {
5758
content = _updateCspForLiveReload(content, platform);
5859
content = _addLiveReloadElement(content, platform);
@@ -177,16 +178,16 @@ function _addPlatformStyleClasses(content, platform) {
177178
*/
178179
function _addPlatformStyleClassesIfMissing(classStr, classesToAdd) {
179180
const classes = (classesToAdd instanceof Array) ? classesToAdd : [classesToAdd];
180-
181+
let newClassStr = classStr;
181182
for (let i = 0; i < classes.length; i++) {
182-
if (classStr.indexOf(classes[i]) < 0) {
183-
if (classStr.length > 0) {
184-
classStr += ' ';
183+
if (newClassStr.indexOf(classes[i]) < 0) {
184+
if (newClassStr.length > 0) {
185+
newClassStr += ' ';
185186
}
186-
classStr += classes[i];
187+
newClassStr += classes[i];
187188
}
188189
}
189-
return classStr;
190+
return newClassStr;
190191
}
191192

192193
/**
@@ -259,6 +260,23 @@ function _injectCspRule(content, category, cspRule) {
259260
return newContent;
260261
}
261262

263+
/**
264+
* ## _updateCspGapReady
265+
* Updates Content Security Policy for livereload
266+
*
267+
* @private
268+
* @param {string} content - Original content
269+
* @returns {string} newContent - Updated content
270+
*/
271+
272+
function _updateCspGapReady(content) {
273+
let newContent = content;
274+
// Must have for iOS10
275+
newContent = _injectCspRule(newContent, 'connect-src', 'ws: *');
276+
newContent = _injectCspRule(newContent, 'default-src', 'gap://ready');
277+
return newContent;
278+
}
279+
262280
/**
263281
* ## _updateCspForLiveReload
264282
* Updates Content Security Policy for livereload
@@ -284,10 +302,6 @@ function _updateCspForLiveReload(content, platform) {
284302

285303
newContent = _injectCspRule(newContent, 'script-src', liveReloadSrc);
286304

287-
// Must have for iOS10
288-
newContent = _injectCspRule(newContent, 'connect-src', 'ws: *');
289-
newContent = _injectCspRule(newContent, 'default-src', 'gap://ready');
290-
291305
return newContent;
292306
}
293307

lib/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/buildCommon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';
@@ -234,7 +234,7 @@ module.exports = {
234234
const opts = context.opts;
235235
const buildType = context.buildType;
236236
const platform = context.platform;
237-
const ojetLibs = npmCopy.getCopyLibFileList(platform);
237+
const ojetLibs = npmCopy.getCopyLibFileList(platform, buildType);
238238
const thirdPartyLibs = util.getFileList(buildType, opts.copyLibsToStaging.fileList);
239239
const customLibs = util.getFileList(buildType, opts.copyCustomLibsToStaging.fileList);
240240
return _copyFileToStaging(ojetLibs.concat(thirdPartyLibs, customLibs))

lib/buildHybrid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/buildWeb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/clean.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55

@@ -10,12 +10,13 @@ const util = require('./util');
1010
const CONSTANTS = require('./constants');
1111
const path = require('path');
1212

13-
const config = module.exports = function (prop, value) {
13+
const config = function (prop, value) {
1414
if (arguments.length === 2) {
1515
return config.set(prop, value);
1616
}
1717
return config.get(prop);
1818
};
19+
module.exports = config;
1920

2021
config.data = {};
2122

@@ -58,6 +59,7 @@ config.getConfiguredPaths = (platform) => {
5859
src.javascript = srcConfig.javascript ? path.normalize(srcConfig.javascript) : 'js';
5960
src.styles = srcConfig.styles ? path.normalize(srcConfig.styles) : 'css';
6061
src.themes = srcConfig.themes ? path.normalize(srcConfig.themes) : 'themes';
62+
src.tests = srcConfig.tests ? path.normalize(srcConfig.tests) : 'tests';
6163
src.web = srcConfig.web ? path.normalize(srcConfig.web) : CONSTANTS.APP_SRC_WEB_DIRECTORY;
6264
src.hybrid = srcConfig.hybrid ? path.normalize(srcConfig.hybrid) :
6365
CONSTANTS.APP_SRC_HYBRID_DIRECTORY;

lib/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/defaultconfig.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';
@@ -179,8 +179,11 @@ module.exports = {
179179
files: [
180180
`${paths.src.common}/${paths.src.styles}/!(libs)/**/*.css`,
181181
`${paths.src.common}/${paths.src.javascript}/!(libs)/**/*.js`,
182+
`${paths.src.common}/${paths.src.javascript}/!(libs)/**/*.json`,
182183
`${paths.src.common}/${paths.src.javascript}/{,*/}*.js`,
183184
`${paths.src.common}/${paths.src.styles}/{,*/}*.css`,
185+
`${paths.src.common}/${paths.src.tests}/{,*/}*.css`,
186+
`${paths.src.common}/${paths.src.tests}/{,*/}*.js`,
184187
`${paths.src.common}/**/*.html`,
185188
],
186189
options:

lib/indexHtmlInjector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/injectorUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/mainJsInjector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';
@@ -86,7 +86,7 @@ function _writeRequirePathToFile(context) {
8686
*/
8787
function _injectWindowsResourcePaths(content) {
8888
const lineEnding = /\r\n/.test(String(content)) ? '\r\n' : '\n';
89-
const translationsPattern = /([\t ]*)('|")ojtranslations['"]\s*:\s*['"](.*?)['"],/gi;
89+
const translationsPattern = /([\t ]*)('|")?ojtranslations['"]?\s*:\s*['"](.*?)['"],/gi;
9090

9191
const result = translationsPattern.exec(content);
9292

@@ -97,7 +97,7 @@ function _injectWindowsResourcePaths(content) {
9797

9898
const translationsEntry = result[0];
9999
const indentStr = result[1];
100-
const stringChar = result[2];
100+
const stringChar = result[2] || "'";
101101
const resourcesPath = result[3];
102102

103103
const resourceEntries = `${translationsEntry + lineEnding

0 commit comments

Comments
 (0)