Skip to content

Commit cd86409

Browse files
committed
Release 8.1.0
1 parent 7875265 commit cd86409

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+999
-635
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to oraclejet-tooling
22

3-
*Copyright (c) 2014, 2019 Oracle and/or its affiliates
3+
*Copyright (c) 2014, 2020 Oracle and/or its affiliates
44
The Universal Permissive License (UPL), Version 1.0*
55

66
**Pull requests are currently not being accepted for the Oracle JET project.**

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# oraclejet-tooling
22

3-
Copyright (c) 2019 Oracle and/or its affiliates.
3+
Copyright (c) 2020 Oracle and/or its affiliates.
44

55
The Universal Permissive License (UPL), Version 1.0
66

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# @oracle/oraclejet-tooling 8.0.0
1+
# @oracle/oraclejet-tooling 8.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=jet800&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=jet810&id=homepage).
1010

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

1616
## [License](https://github.com/oracle/oraclejet-tooling/blob/master/LICENSE)
17-
Copyright (c) 2019 Oracle and/or its affiliates and released under the
17+
Copyright (c) 2020 Oracle and/or its affiliates and released under the
1818
[Universal Permissive License (UPL)](https://oss.oracle.com/licenses/upl/), Version 1.0

RELEASENOTES.md

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

3-
### 8.0.0
3+
### 8.1.0
44
* No changes
55

66
### 5.2.0

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, 2019, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2020, 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, 2019, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
44
The Universal Permissive License (UPL), Version 1.0
55
*/
66

hooks/jetInjector.js

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

lib/add.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, 2019, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
44
The Universal Permissive License (UPL), Version 1.0
55
*/
66

lib/addpcss.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, 2019, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
44
The Universal Permissive License (UPL), Version 1.0
55
*/
66

lib/addsass.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, 2019, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
44
The Universal Permissive License (UPL), Version 1.0
55
*/
66

lib/addtypescript.js

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

@@ -11,14 +11,24 @@
1111
*/
1212

1313
const util = require('./util');
14-
const fs = require('fs');
14+
const fs = require('fs-extra');
1515
const exec = require('child_process').exec;
1616
const CONSTANTS = require('./constants');
17+
const path = require('path');
1718

1819
/**
1920
* ## Helpers
2021
*/
2122

23+
/**
24+
* ## _installTypescript
25+
*
26+
* Install Typescript locally if environment does not
27+
* have a valid global version
28+
*
29+
* @private
30+
* @returns {Promise}
31+
*/
2232
function installTypescipt(validGlobalTypescriptAvailable) {
2333
return new Promise((resolve) => {
2434
if (validGlobalTypescriptAvailable) {
@@ -28,6 +38,7 @@ function installTypescipt(validGlobalTypescriptAvailable) {
2838
exec('npm install typescript --save-dev=true', {
2939
env: {
3040
...process.env,
41+
// speed up npm install when on vpn
3142
NO_UPDATE_NOTIFIER: true
3243
}
3344
}, (error) => {
@@ -41,42 +52,68 @@ function installTypescipt(validGlobalTypescriptAvailable) {
4152
});
4253
}
4354

44-
function injectTypscriptConfig() {
45-
util.log('Adding tsconfig.json');
46-
function copyTsconfigToRoot(resolve) {
47-
fs.copyFile(CONSTANTS.PATH_TO_TSCONFIG_TEMPLATE, CONSTANTS.PATH_TO_TSCONFIG, (error) => {
48-
if (error) {
49-
util.log.error(error);
50-
} else {
51-
resolve();
52-
}
53-
});
54-
}
55+
/**
56+
* ## _injectFileIntoApplication
57+
*
58+
* Inject file into the application
59+
*
60+
* @private
61+
* @param {string} options.name name of file
62+
* @param {string} options.src path to file src
63+
* @param {string} options.dest path to file dest
64+
* @returns {Promise}
65+
*/
66+
function _injectFileIntoApplication({ name, src, dest }) {
67+
util.log(`Adding ${dest}`);
5568
return new Promise((resolve) => {
56-
util.fsExists(CONSTANTS.PATH_TO_TSCONFIG, (fsExistsError) => {
57-
if (fsExistsError) {
58-
copyTsconfigToRoot(resolve);
59-
} else {
60-
fs.rename(CONSTANTS.PATH_TO_TSCONFIG, CONSTANTS.PATH_TO_TSCONFIG.replace('.', '_old.'), (fsRenameError) => {
61-
if (fsRenameError) {
62-
util.log.error(fsRenameError);
63-
} else {
64-
copyTsconfigToRoot(resolve);
65-
}
66-
});
67-
}
68-
});
69+
fs.pathExists(dest)
70+
.then((exists) => {
71+
if (!exists) {
72+
fs.copy(src, dest)
73+
.then(resolve)
74+
.catch(util.log.error);
75+
} else {
76+
const ext = path.extname(name);
77+
fs.rename(dest, dest.replace(ext, `_old${ext}`))
78+
.then(() => {
79+
fs.copy(src, dest)
80+
.then(resolve)
81+
.catch(util.log.error);
82+
})
83+
.catch(util.log.error);
84+
}
85+
})
86+
.catch(util.log.error);
87+
});
88+
}
89+
90+
/**
91+
* ## injectTypescriptConfig
92+
*
93+
* Inject preset tsconfig.json file into the application
94+
*
95+
* @private
96+
* @returns {Promise}
97+
*/
98+
function injectTypescriptConfig() {
99+
return _injectFileIntoApplication({
100+
name: CONSTANTS.TSCONFIG,
101+
src: CONSTANTS.PATH_TO_TSCONFIG_TEMPLATE,
102+
dest: CONSTANTS.TSCONFIG
69103
});
70104
}
71105

72106
/**
73-
* # 'addTypescript'
107+
* ## addTypescript
108+
*
109+
* Add Typescript support to an application
74110
*
75111
* @public
76112
* @returns {Promise}
77113
*/
78114
module.exports = function () {
79115
return util.validGlobalTypescriptAvailable()
80116
.then(installTypescipt)
81-
.then(injectTypscriptConfig);
117+
.then(injectTypescriptConfig)
118+
.catch(util.log.error);
82119
};

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, 2019, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

0 commit comments

Comments
 (0)