Skip to content

Commit

Permalink
17.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benm071 committed Aug 14, 2024
1 parent e144b23 commit 3345ab2
Showing 44 changed files with 435 additions and 212 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# @oracle/oraclejet-tooling 16.1.0
# @oracle/oraclejet-tooling 17.0.0

## About the tooling API
This tooling API contains methods to build and serve Oracle JET web 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 app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1610&id=homepage).
This module will be automatically installed when you scaffold a web app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1700&id=homepage).

## Contributing
This project is not accepting external contributions at this time. For bugs or enhancement requests, please file a GitHub issue unless it’s security related. When filing a bug remember that the better written the bug is, the more likely it is to be fixed. If you think you’ve found a security vulnerability, do not raise a GitHub issue and follow the instructions in our [security policy](./SECURITY.md).
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 ##

### 16.1.0
### 17.0.0

### 11.0.0
* oraclejet-tooling now requires node 12.21 or later
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -35,4 +35,4 @@ sufficiently hardened for production use.
[1]: mailto:[email protected]
[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
[3]: https://www.oracle.com/security-alerts/encryptionkey.html
[4]: https://www.oracle.com/security-alerts/
[4]: https://www.oracle.com/security-alerts/
47 changes: 42 additions & 5 deletions lib/addpwa.js
Original file line number Diff line number Diff line change
@@ -49,9 +49,10 @@ module.exports = function () {
'manifest.json',
'components/',
'libs/',
'styles/'
'styles/',
'assets/'
]`;
const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/']";
const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/', 'assets/']";
swJsString = swJsString.replace(mvvmResourcesToCache, vdomResourcesToCache);
} else {
swJsString = fs.readFileSync(
@@ -80,23 +81,59 @@ module.exports = function () {
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
// and other necessary to end of header tag in index.html and update
const swInitString = fs.readFileSync(
path.join(pathToServiceWorkerTemplates, 'swInit.txt'),
{ encoding: 'utf-8' }
);
const additionalTagsForPWALighthouseCompliance = `
<meta name="apple-mobile-web-app-title" content="Oracle JET" />
<meta name="theme-color" content="#000000">
<!-- Splash screens -->
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-640x1136.jpg" media="(device-width: 320px) and (device-height: 568px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-750x1334.jpg" media="(device-width: 375px) and (device-height: 667px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-1242x2208.jpg" media="(device-width: 414px) and (device-height: 736px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-1125x2436.jpg" media="(device-width: 375px) and (device-height: 812px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-828x1792.jpg" media="(device-width: 414px) and (device-height: 896px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-1242x2688.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-1536x2048.jpg" media="(device-width: 768px) and (device-height: 1024px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-1668x2224.jpg" media="(device-width: 834px) and (device-height: 1112px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-1668x2388.jpg" media="(device-width: 834px) and (device-height: 1194px)">
<link rel="apple-touch-startup-image" href="assets/splashscreens/splash-2048x2732.jpg" media="(device-width: 1024px) and (device-height: 1366px)">
`;
fs.outputFileSync(
pathToIndexHtml,
indexHtmlString.replace(
new RegExp('</head>', 'g'),
'<link rel="manifest" href="manifest.json">\n</head>'
`${additionalTagsForPWALighthouseCompliance}\n<link rel="manifest" href="manifest.json">\n</head>`
).replace(
new RegExp('</body>', 'g'),
`${swInitString.replace(appNameRegex, appName)}\n</body>`
)
);
// Copy over swinit.js

// 5. Copy the assets into the /src folder: This will add the needed
// icons and splashscreens, among others.
fs.copySync(
path.join(pathToServiceWorkerTemplates, 'assets'),
path.join(pathToApp, 'assets')
);

// 6. Copy over swinit.js
fs.copyFileSync(path.join(pathToServiceWorkerTemplates, 'swinit._js'),
path.join(pathToApp, 'swinit.js'));

// 7. Ensure that the app name token is replaced by the app name:
fs.outputFileSync(
path.join(pathToApp, 'swinit.js'),
fs.readFileSync(
path.join(pathToApp, 'swinit.js'), { encoding: 'utf-8' }
).replace(
appNameRegex,
appName
)
);

return Promise.resolve();
};
45 changes: 42 additions & 3 deletions lib/buildCommon.js
Original file line number Diff line number Diff line change
@@ -75,9 +75,11 @@ function _getThemeDestPath(theme, stagingPath, ext, cssonly, servePlatform, serv
} else {
base = path.resolve(stagingPath, '..', 'platforms', servePlatform, 'app/src/main/assets', 'www');
}
dest = util.destPath(path.join(base, stylePath, theme.name, theme.version, themePlatform, '/'));
dest = util.destPath(path.join(base, stylePath, theme.name, theme.version,
themePlatform, path.sep));
} else {
dest = util.destPath(path.join(stagingPath, stylePath, theme.name, theme.version, themePlatform, '/'));
dest = util.destPath(path.join(stagingPath, stylePath, theme.name, theme.version,
themePlatform, path.sep));
}
return dest;
}
@@ -212,6 +214,8 @@ function _copyMultiThemesToStaging(opts, stagingPath, livereload) {

const src = path.join(srcBase, singleTheme.name, themePlatform);
const dest = util.destPath(path.join(stagingPath, config('paths').src.styles, singleTheme.name, singleTheme.version, themePlatform, '/'));
// Code not hit in tests

fs.copySync(src, dest, { dereference: true });

// copy common dir
@@ -235,8 +239,27 @@ function _copyThemesToStaging(context) {
// copy the entire theme/platform folder during build
const ext = util.getThemeCssExtention(buildType);
const src = _getThemeSrcPath(theme, ext, livereload);
let themePreactName;

if (theme.basetheme === CONSTANTS.DEFAULT_PCSS_THEME ||
theme.basetheme === CONSTANTS.DEFAULT_STABLE_THEME) {
themePreactName = `theme-${theme.basetheme}`;
} else if (theme.name === CONSTANTS.DEFAULT_PCSS_THEME ||
theme.name === CONSTANTS.DEFAULT_STABLE_THEME) {
themePreactName = `theme-${theme.name}`;
} else {
// use default theme:
themePreactName = `theme-${config('defaultTheme')}`;
}

const themePreact = Object.assign({},
{ name: `theme-${theme.name}`, platform: theme.platform, compile: false, version: util.getJETVersion() });
{
name: themePreactName,
platform: theme.platform,
compile: false,
version: util.getJETVersion()
}
);
const preactSrc = _getThemeSrcPath(themePreact, ext, livereload);

const dest = _getThemeDestPath(theme, stgPath, ext, livereload, platform, opts.destination);
@@ -507,6 +530,17 @@ module.exports = {
.catch(err => Promise.reject(err));
},

injectFont: function _injectFont(context) {
util.log('Running font injection task.');

return indexHtmlInjector.injectFontPath(context)
.then(() => {
util.log('Task index.html font path injection finished.');
return Promise.resolve(context);
})
.catch(err => Promise.reject(err));
},

copyThemes: function _copyThemes(context) {
util.log('Running theme copy task.');
return _copyThemesToStaging(context)
@@ -580,6 +614,9 @@ module.exports = {
if (context.opts.sassCompile === false && svg !== true) {
util.log('Sass compile skipped.');
resolve(context);
} else if (!util.validateSassInstall()) {
util.log.warning('Sass compile skipped: node-sass is not installed. To install it, run ojet add sass.');
resolve(context);
} else {
// require sass here to avoid depency error if node-sass is not installed
const sass = require('./sass'); // eslint-disable-line global-require
@@ -835,6 +872,8 @@ module.exports = {
if (npmPckgInitFileRelativePath !== undefined && retObj.npm) {
// Extract out the filename portion of the path.
const npmPckgInitFileNameArray = npmPckgInitFileRelativePath.split('/');
// code not hit in tests

const npmPckgInitFileName = npmPckgInitFileNameArray[npmPckgInitFileNameArray.length - 1]; // eslint-disable-line max-len
const npmPckgSrcPath = `./${CONSTANTS.NODE_MODULES_DIRECTORY}/${npmPckgName}/${npmPckgInitFileRelativePath}`; // eslint-disable-line max-len
//
Loading

0 comments on commit 3345ab2

Please sign in to comment.