-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
565 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# @oracle/oraclejet-tooling 9.2.0 | ||
# @oracle/oraclejet-tooling 10.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=jet920&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=jet1000&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) 2020 Oracle and/or its affiliates and released under the | ||
Copyright (c) 2021 Oracle and/or its affiliates and released under the | ||
[Universal Permissive License (UPL)](https://oss.oracle.com/licenses/upl/), Version 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
## Release Notes for oraclejet-tooling ## | ||
|
||
### 9.2.0 | ||
### 10.0.0 | ||
* No changes | ||
|
||
### 5.2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#! /usr/bin/env node | ||
/** | ||
Copyright (c) 2015, 2020, Oracle and/or its affiliates. | ||
Copyright (c) 2015, 2021, Oracle and/or its affiliates. | ||
Licensed under The Universal Permissive License (UPL), Version 1.0 | ||
as shown at https://oss.oracle.com/licenses/upl/ | ||
|
@@ -27,7 +27,6 @@ module.exports = function () { | |
|
||
return util.spawn('npm', ['install', | ||
`node-sass@${sassVer}`, | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'--save-dev=true']); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#! /usr/bin/env node | ||
/** | ||
Copyright (c) 2015, 2021, 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 fs = require('fs-extra'); | ||
const path = require('path'); | ||
const CONSTANTS = require('./constants'); | ||
/** | ||
* #addpwa | ||
* | ||
* @public | ||
* @returns {Promise} | ||
*/ | ||
|
||
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 = 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, write to app as js file | ||
const 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>` | ||
) | ||
); | ||
resolve(); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.