Skip to content

Commit

Permalink
Release 14.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benm071 committed Jan 12, 2023
1 parent 803f44d commit b6f7f93
Show file tree
Hide file tree
Showing 80 changed files with 1,787 additions and 1,216 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, 2022 Oracle and/or its affiliates
*Copyright (c) 2014, 2023 Oracle and/or its affiliates
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/*

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) 2022 Oracle and/or its affiliates.
Copyright (c) 2023 Oracle and/or its affiliates.

Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
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 13.1.0
# @oracle/oraclejet-tooling 14.0.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=jet1310&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=jet1400&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) 2022 Oracle and/or its affiliates and released under the
Copyright (c) 2023 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 ##

### 13.1.0
### 14.0.0

### 11.0.0
* oraclejet-tooling now requires node 12.21 or later
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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
Expand Down
28 changes: 28 additions & 0 deletions lib/addjsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/env node
/**
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
*/

'use strict';

/**
* ## Dependencies
*/
const util = require('./util');

/**
* # 'addJsdoc'
*
* @public
* @param {Object} options
* @returns {Promise}
*/
module.exports = function (options) {
util.log('Installing jsdoc');
const installer = util.getInstallerCommand({ options });

return util.spawn(installer.installer, [installer.verbs.install, 'jsdoc@3.5.5', '--save-dev=true', '--save-exact']);
};
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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
Expand Down
155 changes: 76 additions & 79 deletions lib/addpwa.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env node
/**
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
Expand All @@ -24,82 +24,79 @@ const CONSTANTS = require('./constants');
*/

module.exports = function () {
return new Promise((resolve) => {
// eslint-disable-next-line global-require
const appName = path.basename(process.cwd());
const appNameRegex = new RegExp('@AppName@', 'g');
const pathToApp = path.join('src');
const pathToIndexHtml = path.join(pathToApp, 'index.html');
const pathToServiceWorkerTemplates = path.join(util.getToolingPath(),
CONSTANTS.PATH_TO_PWA_TEMPLATES);
// 1. read index.html
const indexHtmlString = fs.readFileSync(
pathToIndexHtml,
{ encoding: 'utf-8' }
);
// 2. read sw.txt, replace app name token and resources to cache
// according to the app's architecture, and then write to app as js file
let swJsString;
if (util.isVDOMApplication()) {
swJsString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
{ encoding: 'utf-8' });
const vdomResourcesToCache = `[
'index.js',
'index.html',
'bundle.js',
'manifest.json',
'components/',
'libs/',
'styles/'
]`;
const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/']";
swJsString = swJsString.replace(mvvmResourcesToCache, vdomResourcesToCache);
} else {
swJsString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
{ encoding: 'utf-8' });
}
const pathToAppSw = path.join(pathToApp, 'sw.js');
if (fs.pathExistsSync(pathToAppSw)) {
fs.renameSync(pathToAppSw, path.join(pathToApp, 'sw_old.js'));
}
fs.outputFileSync(
pathToAppSw,
swJsString.replace(appNameRegex, appName)
);
// 3. read manifest.json, replace app name token, write to app
const manifestJsonString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'manifest.json'),
{ encoding: 'utf-8' }
);
const pathToAppManifest = path.join(pathToApp, 'manifest.json');
if (fs.pathExistsSync(pathToAppManifest)) {
fs.renameSync(pathToAppManifest, path.join(pathToApp, 'manifest_old.json'));
}
fs.outputFileSync(
path.join(pathToApp, 'manifest.json'),
manifestJsonString.replace(appNameRegex, appName)
);
// 4. copy swInit.txt and add it to end of body tag index.html, add <link>
// to end of header tag in index.html and update
const swInitString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'swInit.txt'),
{ encoding: 'utf-8' }
);
fs.outputFileSync(
pathToIndexHtml,
indexHtmlString.replace(
new RegExp('</head>', 'g'),
'<link rel="manifest" href="manifest.json">\n</head>'
).replace(
new RegExp('</body>', 'g'),
`${swInitString.replace(appNameRegex, appName)}\n</body>`
)
);
// Copy over swinit.js
fs.copyFileSync(path.join(pathToServiceWorkerTemplates, 'swinit._js'),
path.join(pathToApp, 'swinit.js'));
resolve();
});
const appName = path.basename(process.cwd());
const appNameRegex = new RegExp('@AppName@', 'g');
const pathToApp = path.join('src');
const pathToIndexHtml = path.join(pathToApp, 'index.html');
const pathToServiceWorkerTemplates = path.join(util.getToolingPath(),
CONSTANTS.PATH_TO_PWA_TEMPLATES);
// 1. read index.html
const indexHtmlString = fs.readFileSync(
pathToIndexHtml,
{ encoding: 'utf-8' }
);
// 2. read sw.txt, replace app name token and resources to cache
// according to the app's architecture, and then write to app as js file
let swJsString;
if (util.isVDOMApplication()) {
swJsString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
{ encoding: 'utf-8' });
const vdomResourcesToCache = `[
'index.js',
'index.html',
'bundle.js',
'manifest.json',
'components/',
'libs/',
'styles/'
]`;
const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/']";
swJsString = swJsString.replace(mvvmResourcesToCache, vdomResourcesToCache);
} else {
swJsString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
{ encoding: 'utf-8' });
}
const pathToAppSw = path.join(pathToApp, 'sw.js');
if (fs.pathExistsSync(pathToAppSw)) {
fs.renameSync(pathToAppSw, path.join(pathToApp, 'sw_old.js'));
}
fs.outputFileSync(
pathToAppSw,
swJsString.replace(appNameRegex, appName)
);
// 3. read manifest.json, replace app name token, write to app
const manifestJsonString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'manifest.json'),
{ encoding: 'utf-8' }
);
const pathToAppManifest = path.join(pathToApp, 'manifest.json');
if (fs.pathExistsSync(pathToAppManifest)) {
fs.renameSync(pathToAppManifest, path.join(pathToApp, 'manifest_old.json'));
}
fs.outputFileSync(
path.join(pathToApp, 'manifest.json'),
manifestJsonString.replace(appNameRegex, appName)
);
// 4. copy swInit.txt and add it to end of body tag index.html, add <link>
// to end of header tag in index.html and update
const swInitString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'swInit.txt'),
{ encoding: 'utf-8' }
);
fs.outputFileSync(
pathToIndexHtml,
indexHtmlString.replace(
new RegExp('</head>', 'g'),
'<link rel="manifest" href="manifest.json">\n</head>'
).replace(
new RegExp('</body>', 'g'),
`${swInitString.replace(appNameRegex, appName)}\n</body>`
)
);
// Copy over swinit.js
fs.copyFileSync(path.join(pathToServiceWorkerTemplates, 'swinit._js'),
path.join(pathToApp, 'swinit.js'));
return Promise.resolve();
};
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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
Expand Down
7 changes: 5 additions & 2 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, 2022, Oracle and/or its affiliates.
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
Expand All @@ -16,6 +16,7 @@ const util = require('./util');
const fs = require('fs-extra');
const path = require('path');
const CONSTANTS = require('./constants');
const config = require('./config');

/**
* ## Helpers
Expand All @@ -34,8 +35,10 @@ const CONSTANTS = require('./constants');
function installTypescipt(options) {
util.log('Installing Typescript');
const installer = util.getInstallerCommand({ options });
config.loadOraclejetConfig();
const typescriptLibraries = config.data.typescriptLibraries;

const command = `${installer.installer} ${installer.verbs.install} typescript@${CONSTANTS.TYPESCRIPT_VERSION} yargs-parser@~13.1.2 --save-dev --save-exact`;
const command = `${installer.installer} ${installer.verbs.install} ${typescriptLibraries} --save-dev --save-exact`;
return util.exec(command);
}

Expand Down
Loading

0 comments on commit b6f7f93

Please sign in to comment.