Skip to content

Commit c57e75a

Browse files
committed
Release 18.0.0
1 parent 0e8e251 commit c57e75a

Some content is hidden

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

78 files changed

+735
-417
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, 2024 Oracle and/or its affiliates
3+
*Copyright (c) 2014, 2025 Oracle and/or its affiliates
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/*
66

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2024 Oracle and/or its affiliates.
1+
Copyright (c) 2025 Oracle and/or its affiliates.
22

33
The Universal Permissive License (UPL), Version 1.0
44

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# @oracle/oraclejet-tooling 17.1.0
1+
# @oracle/oraclejet-tooling 18.0.0
22

33
## About the tooling API
44
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.
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 app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1710&id=homepage).
9+
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=jet1800&id=homepage).
1010

1111
## Contributing
1212
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).
@@ -16,5 +16,5 @@ This project is not accepting external contributions at this time. For bugs or e
1616
Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process
1717

1818
## License
19-
Copyright (c) 2024 Oracle and/or its affiliates and released under the
19+
Copyright (c) 2025 Oracle and/or its affiliates and released under the
2020
[Universal Permissive License (UPL)](https://oss.oracle.com/licenses/upl/), Version 1.0

RELEASENOTES.md

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

3-
### 17.1.0
3+
### 18.0.0
4+
* Switch to chokidar from gaze
45

56
### 11.0.0
67
* oraclejet-tooling now requires node 12.21 or later

THIRDPARTYLICENSE.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@ THIRD-PARTY COMPONENT LICENSE
1313
--------------------------------------------------------------------------------
1414
node_modules/fs-extra/ MIT
1515
node_modules/glob/ ISC
16-
node_modules/lodash.difference/ MIT
17-
node_modules/lodash.escaperegexp/ MIT
18-
node_modules/lodash.isfunction/ MIT
19-
node_modules/lodash.remove/ MIT
20-
node_modules/lodash.union/ MIT
2116
node_modules/lodash.mergewith/ MIT
2217
node_modules/requirejs/ MIT
2318
node_modules/terser/ BSD-2-Clause
24-
node_modules/gaze/ MIT
19+
node_modules/chokidar/ MIT
2520
node_modules/connect/ MIT
2621
node_modules/connect-livereload/ MIT
2722
node_moduels/tiny-lr/ MIT

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, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
33
Licensed under The Universal Permissive License (UPL), Version 1.0
44
as shown at https://oss.oracle.com/licenses/upl/
55

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, 2024, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

lib/addjsdoc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66
@@ -12,6 +12,7 @@
1212
* ## Dependencies
1313
*/
1414
const util = require('./util');
15+
const config = require('./config');
1516

1617
/**
1718
* # 'addJsdoc'
@@ -23,6 +24,15 @@ const util = require('./util');
2324
module.exports = function (options) {
2425
util.log('Installing jsdoc');
2526
const installer = util.getInstallerCommand({ options });
27+
const jsdocLibraries = config.data.jsdocLibraries;
2628

27-
return util.spawn(installer.installer, [installer.verbs.install, 'jsdoc@3.5.5', installer.flags.save, installer.flags.exact]);
29+
return util.spawn(
30+
installer.installer,
31+
[
32+
installer.verbs.install,
33+
jsdocLibraries,
34+
installer.flags.save,
35+
installer.flags.exact
36+
]
37+
);
2838
};

lib/addpcss.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66
@@ -28,7 +28,7 @@ module.exports = function (options) {
2828
const sassVer = config.data.sassVer;
2929

3030
return util.spawn(installer.installer, [installer.verbs.install,
31-
`node-sass@${sassVer}`,
31+
`sass@${sassVer}`,
3232
'postcss-calc@6.0.1',
3333
'autoprefixer@9.1.5',
3434
installer.flags.save]);

lib/addpwa.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, 2024, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

lib/addsass.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66
@@ -26,6 +26,6 @@ module.exports = function (options) {
2626
const sassVer = config.data.sassVer;
2727
const installer = util.getInstallerCommand({ options });
2828

29-
util.log('Installing node-sass');
30-
return util.spawn(installer.installer, [installer.verbs.install, `node-sass@${sassVer}`, installer.flags.save]);
29+
util.log('Installing sass');
30+
return util.spawn(installer.installer, [installer.verbs.install, `sass@${sassVer}`, installer.flags.save]);
3131
};

lib/addtesting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
33
Licensed under The Universal Permissive License (UPL), Version 1.0
44
as shown at https://oss.oracle.com/licenses/upl/
55

lib/addtypescript.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, 2024, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

lib/addwebpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
33
Licensed under The Universal Permissive License (UPL), Version 1.0
44
as shown at https://oss.oracle.com/licenses/upl/
55

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, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
33
Licensed under The Universal Permissive License (UPL), Version 1.0
44
as shown at https://oss.oracle.com/licenses/upl/
55

lib/buildCommon.js

Lines changed: 105 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
33
Licensed under The Universal Permissive License (UPL), Version 1.0
44
as shown at https://oss.oracle.com/licenses/upl/
55
@@ -365,6 +365,104 @@ function _requireJsInvoker(context) {
365365
});
366366
}
367367

368+
/**
369+
* ## _restoreOjcssPluginReference
370+
*
371+
* Restores the ojcss plugin reference in the paths.
372+
*
373+
* @private
374+
* @param {object} context build context
375+
* @returns {Promise} promise
376+
*/
377+
function _restoreOjcssPluginReference(context) {
378+
try {
379+
const importsAndFilePathsArray = context.importsAndFilePathsArray || [];
380+
if (importsAndFilePathsArray.length > 0) {
381+
importsAndFilePathsArray.forEach((item) => {
382+
if (item.matches.length > 0) {
383+
let fileContent = fs.readFileSync(item.file, { encoding: 'utf-8' });
384+
item.matches.forEach((match) => {
385+
fileContent = fileContent.replace(match.replace('ojcss!', ''), match);
386+
});
387+
util.writeFileSync(item.file, fileContent);
388+
}
389+
});
390+
}
391+
392+
if (context.importsAndFilePathsArray) {
393+
// eslint-disable-next-line no-param-reassign
394+
delete context.importsAndFilePathsArray;
395+
}
396+
397+
return Promise.resolve(context);
398+
} catch (error) {
399+
util.log.error(error);
400+
return Promise.reject(error);
401+
}
402+
}
403+
404+
/**
405+
* ## _removeOjcssPluginReference
406+
*
407+
* Removes the ojcss reference in the paths before invoking requirejs.
408+
*
409+
* @private
410+
* @param {object} context build context
411+
* @returns {Promise} promise
412+
*/
413+
function _removeOjcssPluginReference(context) {
414+
try {
415+
const importsAndFilePathsArray = [];
416+
const isVDOMApplication = util.isVDOMApplication();
417+
const configPaths = util.getConfiguredPaths();
418+
const pattern = util.posixPattern(path.join(
419+
util.destPath(),
420+
configPaths.staging.web,
421+
isVDOMApplication ? configPaths.components : configPaths.src.javascript,
422+
'**/*.js'
423+
));
424+
const excludeLibsPattern = util.posixPattern(path.join(
425+
util.destPath(),
426+
configPaths.staging.web,
427+
configPaths.src.javascript,
428+
'libs',
429+
'**/*.js'
430+
));
431+
const srcFiles = isVDOMApplication ? glob.sync(pattern) :
432+
glob.sync(pattern, { ignore: excludeLibsPattern });
433+
434+
// Remove any ojcss! that exists in the files:
435+
srcFiles.forEach((file) => {
436+
const fileContent = util.readFileSync(file, { encoding: 'utf-8' });
437+
const ojCssRegex = /ojcss!/g;
438+
if (ojCssRegex.test(fileContent)) {
439+
const matches = [];
440+
const pathRegex = /ojcss![^'"\s]*\.css/g;
441+
let match = pathRegex.exec(fileContent);
442+
443+
while (match !== null) {
444+
matches.push(match[0]);
445+
match = pathRegex.exec(fileContent);
446+
}
447+
448+
const updatedFileContent = fileContent.replace(ojCssRegex, '');
449+
450+
util.writeFileSync(file, updatedFileContent);
451+
452+
if (matches.length > 0) {
453+
importsAndFilePathsArray.push({ file, matches });
454+
}
455+
}
456+
});
457+
458+
// eslint-disable-next-line no-param-reassign
459+
context.importsAndFilePathsArray = importsAndFilePathsArray;
460+
return Promise.resolve(context);
461+
} catch (error) {
462+
util.log.error(error);
463+
return Promise.reject(error);
464+
}
465+
}
368466

369467
/**
370468
* ## _requireJsSetup
@@ -576,7 +674,9 @@ module.exports = {
576674
const promiseFuncRJS = [
577675
() => _requireJsSetup(context),
578676
() => hookRunner('before_optimize', context),
579-
() => _requireJsInvoker(context)
677+
() => _removeOjcssPluginReference(context),
678+
() => _requireJsInvoker(context),
679+
() => _restoreOjcssPluginReference(context)
580680
];
581681
return util.runPromisesInSeries(promiseFuncRJS);
582682
},
@@ -595,7 +695,7 @@ module.exports = {
595695
util.log('pcss compile skipped.');
596696
resolve(context);
597697
} else {
598-
// require pcss here to avoid depency error if node-sass is not installed
698+
// require pcss here to avoid depency error if sass is not installed
599699
const pcss = require('./pcss'); // eslint-disable-line global-require
600700
const pcssPromise = pcss.getPromises(context);
601701
Promise.all(pcssPromise)
@@ -615,10 +715,10 @@ module.exports = {
615715
util.log('Sass compile skipped.');
616716
resolve(context);
617717
} else if (!util.validateSassInstall()) {
618-
util.log.warning('Sass compile skipped: node-sass is not installed. To install it, run ojet add sass.');
718+
util.log.warning('Sass compile skipped: sass (or node-sass) is not installed. To install it, run ojet add sass.');
619719
resolve(context);
620720
} else {
621-
// require sass here to avoid depency error if node-sass is not installed
721+
// require sass here to avoid depency error if sass is not installed
622722
const sass = require('./sass'); // eslint-disable-line global-require
623723
const sassPromises = sass.getPromises(context);
624724
Promise.all(sassPromises)

0 commit comments

Comments
 (0)