Skip to content

Commit

Permalink
Release 8.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benm071 committed Feb 14, 2020
1 parent 7875265 commit cd86409
Show file tree
Hide file tree
Showing 61 changed files with 999 additions and 635 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to oraclejet-tooling

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

**Pull requests are currently not being accepted for the Oracle JET project.**
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# oraclejet-tooling

Copyright (c) 2019 Oracle and/or its affiliates.
Copyright (c) 2020 Oracle and/or its affiliates.

The Universal Permissive License (UPL), Version 1.0

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# @oracle/oraclejet-tooling 8.0.0
# @oracle/oraclejet-tooling 8.1.0

## About the tooling API
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.

This is an open source project maintained by Oracle Corp.

## Installation
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).
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).

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

## [License](https://github.com/oracle/oraclejet-tooling/blob/master/LICENSE)
Copyright (c) 2019 Oracle and/or its affiliates and released under the
Copyright (c) 2020 Oracle and/or its affiliates and released under the
[Universal Permissive License (UPL)](https://oss.oracle.com/licenses/upl/), Version 1.0
2 changes: 1 addition & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Release Notes for oraclejet-tooling ##

### 8.0.0
### 8.1.0
* No changes

### 5.2.0
Expand Down
2 changes: 1 addition & 1 deletion config/eslintcustom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/
//
Expand Down
2 changes: 1 addition & 1 deletion hooks/jetAfterPrepare.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/

Expand Down
2 changes: 1 addition & 1 deletion hooks/jetInjector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion lib/add.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env node
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/addpcss.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env node
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/addsass.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env node
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/

Expand Down
93 changes: 65 additions & 28 deletions lib/addtypescript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env node
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/

Expand All @@ -11,14 +11,24 @@
*/

const util = require('./util');
const fs = require('fs');
const fs = require('fs-extra');
const exec = require('child_process').exec;
const CONSTANTS = require('./constants');
const path = require('path');

/**
* ## Helpers
*/

/**
* ## _installTypescript
*
* Install Typescript locally if environment does not
* have a valid global version
*
* @private
* @returns {Promise}
*/
function installTypescipt(validGlobalTypescriptAvailable) {
return new Promise((resolve) => {
if (validGlobalTypescriptAvailable) {
Expand All @@ -28,6 +38,7 @@ function installTypescipt(validGlobalTypescriptAvailable) {
exec('npm install typescript --save-dev=true', {
env: {
...process.env,
// speed up npm install when on vpn
NO_UPDATE_NOTIFIER: true
}
}, (error) => {
Expand All @@ -41,42 +52,68 @@ function installTypescipt(validGlobalTypescriptAvailable) {
});
}

function injectTypscriptConfig() {
util.log('Adding tsconfig.json');
function copyTsconfigToRoot(resolve) {
fs.copyFile(CONSTANTS.PATH_TO_TSCONFIG_TEMPLATE, CONSTANTS.PATH_TO_TSCONFIG, (error) => {
if (error) {
util.log.error(error);
} else {
resolve();
}
});
}
/**
* ## _injectFileIntoApplication
*
* Inject file into the application
*
* @private
* @param {string} options.name name of file
* @param {string} options.src path to file src
* @param {string} options.dest path to file dest
* @returns {Promise}
*/
function _injectFileIntoApplication({ name, src, dest }) {
util.log(`Adding ${dest}`);
return new Promise((resolve) => {
util.fsExists(CONSTANTS.PATH_TO_TSCONFIG, (fsExistsError) => {
if (fsExistsError) {
copyTsconfigToRoot(resolve);
} else {
fs.rename(CONSTANTS.PATH_TO_TSCONFIG, CONSTANTS.PATH_TO_TSCONFIG.replace('.', '_old.'), (fsRenameError) => {
if (fsRenameError) {
util.log.error(fsRenameError);
} else {
copyTsconfigToRoot(resolve);
}
});
}
});
fs.pathExists(dest)
.then((exists) => {
if (!exists) {
fs.copy(src, dest)
.then(resolve)
.catch(util.log.error);
} else {
const ext = path.extname(name);
fs.rename(dest, dest.replace(ext, `_old${ext}`))
.then(() => {
fs.copy(src, dest)
.then(resolve)
.catch(util.log.error);
})
.catch(util.log.error);
}
})
.catch(util.log.error);
});
}

/**
* ## injectTypescriptConfig
*
* Inject preset tsconfig.json file into the application
*
* @private
* @returns {Promise}
*/
function injectTypescriptConfig() {
return _injectFileIntoApplication({
name: CONSTANTS.TSCONFIG,
src: CONSTANTS.PATH_TO_TSCONFIG_TEMPLATE,
dest: CONSTANTS.TSCONFIG
});
}

/**
* # 'addTypescript'
* ## addTypescript
*
* Add Typescript support to an application
*
* @public
* @returns {Promise}
*/
module.exports = function () {
return util.validGlobalTypescriptAvailable()
.then(installTypescipt)
.then(injectTypscriptConfig);
.then(injectTypescriptConfig)
.catch(util.log.error);
};
2 changes: 1 addition & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2015, 2019, Oracle and/or its affiliates.
Copyright (c) 2015, 2020, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/
'use strict';
Expand Down
Loading

0 comments on commit cd86409

Please sign in to comment.