├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── RELEASENOTES.md
├── SECURITY.md
├── THIRDPARTYLICENSE.txt
├── config.json
├── config
└── eslintcustom.js
├── lib
├── add.js
├── addjsdoc.js
├── addpcss.js
├── addpwa.js
├── addsass.js
├── addtesting.js
├── addtypescript.js
├── addwebpack.js
├── build.js
├── buildCommon.js
├── buildCommon
│ ├── compileTypescript.js
│ ├── copyLocalComponent.js
│ ├── generateComponentsCache.js
│ ├── minifyComponent.js
│ ├── optimizeComponent.js
│ ├── restoreLocalComponentJson.js
│ ├── stripLocalComponentJson.js
│ └── webpack.js
├── buildComponent.js
├── buildWeb.js
├── clean.js
├── config.js
├── configure.js
├── constants.js
├── create.js
├── defaultconfig.js
├── hookRunner.js
├── indexHtmlInjector.js
├── injectorUtil.js
├── label.js
├── list.js
├── mainJsInjector.js
├── npmCopy.js
├── package.js
├── parser
│ ├── dom-parser.js
│ ├── dom.js
│ └── sax.js
├── pcss.js
├── publish.js
├── remove.js
├── rjs
│ └── r.js
├── rjsConfigGenerator.js
├── sass.js
├── scopes
│ ├── component.js
│ ├── exchange.js
│ └── pack.js
├── search.js
├── serve.js
├── serve
│ ├── connect.js
│ └── watch.js
├── serveWeb.js
├── serveWebFileChangeHandler.js
├── strip.js
├── svg.js
├── templates
│ ├── pack
│ │ └── component.json
│ ├── serviceWorkers
│ │ ├── assets
│ │ │ ├── icons
│ │ │ │ ├── apple-icon-180.png
│ │ │ │ ├── icon-192x192.png
│ │ │ │ └── icon-512x512.png
│ │ │ └── splashscreens
│ │ │ │ ├── splash-1125x2436.jpg
│ │ │ │ ├── splash-1242x2208.jpg
│ │ │ │ ├── splash-1242x2688.jpg
│ │ │ │ ├── splash-1536x2048.jpg
│ │ │ │ ├── splash-1668x2224.jpg
│ │ │ │ ├── splash-1668x2388.jpg
│ │ │ │ ├── splash-2048x2732.jpg
│ │ │ │ ├── splash-640x1136.jpg
│ │ │ │ ├── splash-750x1334.jpg
│ │ │ │ └── splash-828x1792.jpg
│ │ ├── manifest.json
│ │ ├── sw.txt
│ │ ├── swInit.txt
│ │ └── swinit._js
│ ├── typescript
│ │ └── tsconfig.json
│ └── webpack
│ │ └── ojet.config.js
├── util.js
├── utils.exchange.js
├── validations.js
└── webpack
│ ├── build.js
│ ├── custom-tsc
│ └── index.js
│ ├── serve.js
│ ├── setup.js
│ ├── utils.js
│ ├── webpack.common.js
│ ├── webpack.development.js
│ └── webpack.production.js
├── oraclejet-tooling.js
├── package.json
└── test
├── config.js
├── hook.js
└── util.js
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to oraclejet-tooling
2 |
3 | *Copyright (c) 2014, 2025 Oracle and/or its affiliates
4 | Licensed under The Universal Permissive License (UPL), Version 1.0
5 | as shown at https://oss.oracle.com/licenses/upl/*
6 |
7 | **Pull requests are currently not being accepted for the Oracle JET project.**
8 |
9 | We plan to provide this functionality in the future. At that time, you will need to follow [The Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html)
10 | (OCA).
11 |
12 | If you have ideas, comments, or issues to discuss, swing on by the [Oracle JET discussion forum.](https://community.oracle.com/community/development_tools/oracle-jet/generators)
13 |
14 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2025 Oracle and/or its affiliates.
2 |
3 | The Universal Permissive License (UPL), Version 1.0
4 |
5 | Subject to the condition set forth below, permission is hereby granted to any
6 | person obtaining a copy of this software, associated documentation and/or data
7 | (collectively the "Software"), free of charge and under any and all copyright
8 | rights in the Software, and any and all patent rights owned or freely
9 | licensable by each licensor hereunder covering either (i) the unmodified
10 | Software as contributed to or provided by such licensor, or (ii) the Larger
11 | Works (as defined below), to deal in both
12 |
13 | (a) the Software, and
14 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15 | one is included with the Software (each a "Larger Work" to which the Software
16 | is contributed by such licensors),
17 |
18 | without restriction, including without limitation the rights to copy, create
19 | derivative works of, display, perform, and distribute the Software and make,
20 | use, sell, offer for sale, import, export, have made, and have sold the
21 | Software and the Larger Work(s), and to sublicense the foregoing rights on
22 | either these or other terms.
23 |
24 | This license is subject to the following condition:
25 | The above copyright notice and either this complete permission notice or at
26 | a minimum a reference to the UPL must be included in all copies or
27 | substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # @oracle/oraclejet-tooling 18.1.0
2 |
3 | ## About the tooling API
4 | 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.
5 |
6 | This is an open source project maintained by Oracle Corp.
7 |
8 | ## 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=jet1810&id=homepage).
10 |
11 | ## Contributing
12 | 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).
13 |
14 | ## Security
15 |
16 | Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process
17 |
18 | ## License
19 | Copyright (c) 2025 Oracle and/or its affiliates and released under the
20 | [Universal Permissive License (UPL)](https://oss.oracle.com/licenses/upl/), Version 1.0
--------------------------------------------------------------------------------
/RELEASENOTES.md:
--------------------------------------------------------------------------------
1 | ## Release Notes for oraclejet-tooling ##
2 |
3 | ### 18.1.0
4 | * Switch to chokidar from gaze
5 |
6 | ### 11.0.0
7 | * oraclejet-tooling now requires node 12.21 or later
8 |
9 | ### 5.2.0
10 | * No changes
11 |
12 | ### 5.1.0
13 | * No changes
14 |
15 | ### 5.0.0
16 | * No changes
17 |
18 | ### 4.2.0
19 | * No changes
20 |
21 | ### 4.1.0
22 | * No changes
23 |
24 | ### 4.0.0
25 | * Moved module into @oracle scope, changing the name to @oracle/oraclejet-tooling
26 |
27 | ### 3.2.0
28 | * No changes
29 |
30 | ### 3.1.0
31 | * No changes
32 |
33 | ### 3.0.0
34 | * Replaced bower with npm
35 | * SASS tasks now run in CCA directories also
36 | * Added --destination=server-only option for web apps
37 | * Removed --destination=deviceOrEmulatorName option
38 | * Added ability to cutomize serve tasks such as watching additional files
39 | * Added gap://ready to inserted CSP meta tag for iOS 10 compatibility
40 |
41 | ### 2.3.0
42 | * No changes
43 |
44 | ### 2.2.0
45 | * Allow developers to configure release paths
46 | * Provide help page for tooling tasks
47 | * Allow multiple themes to be included in a built app
48 | * Grunt serve to specific iOS emulator fails
49 | * no-build option missing from grunt serve
50 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Reporting security vulnerabilities
2 |
3 | Oracle values the independent security research community and believes that
4 | responsible disclosure of security vulnerabilities helps us ensure the security
5 | and privacy of all our users.
6 |
7 | Please do NOT raise a GitHub Issue to report a security vulnerability. If you
8 | believe you have found a security vulnerability, please submit a report to
9 | [secalert_us@oracle.com][1] preferably with a proof of concept. Please review
10 | some additional information on [how to report security vulnerabilities to Oracle][2].
11 | We encourage people who contact Oracle Security to use email encryption using
12 | [our encryption key][3].
13 |
14 | We ask that you do not use other channels or contact the project maintainers
15 | directly.
16 |
17 | Non-vulnerability related security issues including ideas for new or improved
18 | security features are welcome on GitHub Issues.
19 |
20 | ## Security updates, alerts and bulletins
21 |
22 | Security updates will be released on a regular cadence. Many of our projects
23 | will typically release security fixes in conjunction with the
24 | Oracle Critical Patch Update program. Additional
25 | information, including past advisories, is available on our [security alerts][4]
26 | page.
27 |
28 | ## Security-related information
29 |
30 | We will provide security related information such as a threat model, considerations
31 | for secure use, or any known security issues in our documentation. Please note
32 | that labs and sample code are intended to demonstrate a concept and may not be
33 | sufficiently hardened for production use.
34 |
35 | [1]: mailto:secalert_us@oracle.com
36 | [2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
37 | [3]: https://www.oracle.com/security-alerts/encryptionkey.html
38 | [4]: https://www.oracle.com/security-alerts/
39 |
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {"eslintDirs": ["../oraclejet-tooling/lib", "../oraclejet-tooling/hooks"],
2 | "eslintFilter": ["!../oraclejet-tooling/dist/**", "!../oraclejet-tooling/**/parser/**", "!../oraclejet-tooling/**/rjs/**"],
3 | "fixup": ["package.json"]}
--------------------------------------------------------------------------------
/config/eslintcustom.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2015, 2025, Oracle and/or its affiliates.
3 | Licensed under The Universal Permissive License (UPL), Version 1.0
4 | as shown at https://oss.oracle.com/licenses/upl/
5 |
6 | */
7 | //
8 | // Custom eslint rules file, used to deal with linbreak-style
9 | //
10 | module.exports = {
11 | "installedESLint": true,
12 | "extends": "airbnb-base",
13 | "plugins": [
14 | ],
15 | "rules": {
16 | "comma-dangle": "off",
17 | "no-underscore-dangle": "off",
18 | "vars-on-top": "off",
19 | "func-names": "off",
20 | "linebreak-style": ["warn", "unix"], // currently evaluating this rule in the oraclejet-tooling repos.
21 | "no-console" : "off",
22 | "strict" : "off",
23 | "import/no-unresolved" : [2, {ignore: ['oraclejet-tooling']}], // since oraclejet-tooling is defined as a url, we need it in the ignore list.
24 | "no-use-before-define" : ["error", {"functions" : false, "classes" : true}],
25 | "no-plusplus": ["off", {"allowForLoopAfterthoughts": true }] // allow ++ in loops
26 | }
27 | };
28 |
--------------------------------------------------------------------------------
/lib/add.js:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 | /**
3 | Copyright (c) 2015, 2025, Oracle and/or its affiliates.
4 | Licensed under The Universal Permissive License (UPL), Version 1.0
5 | as shown at https://oss.oracle.com/licenses/upl/
6 |
7 | */
8 |
9 | 'use strict';
10 |
11 | /**
12 | * ## Dependencies
13 | */
14 | const component = require('./scopes/component');
15 | const CONSTANTS = require('./constants');
16 | const pack = require('./scopes/pack');
17 | const util = require('./util');
18 |
19 | /**
20 | * # Switch for 'ojet.add()'
21 | *
22 | * @public
23 | * @param {string} scope
24 | * @param {Array} parameters
25 | * @param {Object} options
26 |
27 | * @returns {Promise}
28 | */
29 | module.exports = function (scope, parameters, options) {
30 | switch (scope) {
31 | case (CONSTANTS.API_SCOPES.COMPONENT):
32 | return component.add(parameters, options);
33 | case (CONSTANTS.API_SCOPES.PACK):
34 | return pack.add(parameters, options);
35 | default:
36 | util.log.error(`Please specify ojet.${CONSTANTS.API_TASKS.ADD}() 'scope' parameter.`);
37 | return false;
38 | }
39 | };
40 |
--------------------------------------------------------------------------------
/lib/addjsdoc.js:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 | /**
3 | Copyright (c) 2015, 2025, Oracle and/or its affiliates.
4 | Licensed under The Universal Permissive License (UPL), Version 1.0
5 | as shown at https://oss.oracle.com/licenses/upl/
6 |
7 | */
8 |
9 | 'use strict';
10 |
11 | /**
12 | * ## Dependencies
13 | */
14 | const util = require('./util');
15 | const config = require('./config');
16 |
17 | /**
18 | * # 'addJsdoc'
19 | *
20 | * @public
21 | * @param {Object} options
22 | * @returns {Promise}
23 | */
24 | module.exports = function (options) {
25 | util.log('Installing jsdoc');
26 | const installer = util.getInstallerCommand({ options });
27 | const jsdocLibraries = config.data.jsdocLibraries;
28 |
29 | return util.spawn(
30 | installer.installer,
31 | [
32 | installer.verbs.install,
33 | jsdocLibraries,
34 | installer.flags.save,
35 | installer.flags.exact
36 | ]
37 | );
38 | };
39 |
--------------------------------------------------------------------------------
/lib/addpcss.js:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 | /**
3 | Copyright (c) 2015, 2025, Oracle and/or its affiliates.
4 | Licensed under The Universal Permissive License (UPL), Version 1.0
5 | as shown at https://oss.oracle.com/licenses/upl/
6 |
7 | */
8 |
9 | 'use strict';
10 |
11 | /**
12 | * ## Dependencies
13 | */
14 | const util = require('./util');
15 | const config = require('./config');
16 |
17 | /**
18 | * # 'addPcss'
19 | *
20 | * @public
21 | * @param {Object} options
22 | * @returns {Promise}
23 | */
24 | module.exports = function (options) {
25 | const installer = util.getInstallerCommand({ options });
26 | util.log('Installing sass and pcss');
27 | config.loadOraclejetConfig();
28 | const sassVer = config.data.sassVer;
29 |
30 | return util.spawn(installer.installer, [installer.verbs.install,
31 | `sass@${sassVer}`,
32 | 'postcss-calc@6.0.1',
33 | 'autoprefixer@9.1.5',
34 | installer.flags.save]);
35 | };
36 |
--------------------------------------------------------------------------------
/lib/addpwa.js:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 | /**
3 | Copyright (c) 2015, 2025, Oracle and/or its affiliates.
4 | Licensed under The Universal Permissive License (UPL), Version 1.0
5 | as shown at https://oss.oracle.com/licenses/upl/
6 |
7 | */
8 |
9 | 'use strict';
10 |
11 | /**
12 | * ## Dependencies
13 | */
14 |
15 | const fs = require('fs-extra');
16 | const path = require('path');
17 | const util = require('./util');
18 | const CONSTANTS = require('./constants');
19 | /**
20 | * #addpwa
21 | *
22 | * @public
23 | * @returns {Promise}
24 | */
25 |
26 | module.exports = function () {
27 | const appName = path.basename(process.cwd());
28 | const appNameRegex = new RegExp('@AppName@', 'g');
29 | const pathToApp = path.join('src');
30 | const pathToIndexHtml = path.join(pathToApp, 'index.html');
31 | const pathToServiceWorkerTemplates = path.join(util.getToolingPath(),
32 | CONSTANTS.PATH_TO_PWA_TEMPLATES);
33 | // 1. read index.html
34 | const indexHtmlString = fs.readFileSync(
35 | pathToIndexHtml,
36 | { encoding: 'utf-8' }
37 | );
38 | // 2. read sw.txt, replace app name token and resources to cache
39 | // according to the app's architecture, and then write to app as js file
40 | let swJsString;
41 | if (util.isVDOMApplication()) {
42 | swJsString = fs.readFileSync(
43 | path.join(pathToServiceWorkerTemplates, 'sw.txt'),
44 | { encoding: 'utf-8' });
45 | const vdomResourcesToCache = `[
46 | 'index.js',
47 | 'index.html',
48 | 'bundle.js',
49 | 'manifest.json',
50 | 'components/',
51 | 'libs/',
52 | 'styles/',
53 | 'assets/'
54 | ]`;
55 | const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/', 'assets/']";
56 | swJsString = swJsString.replace(mvvmResourcesToCache, vdomResourcesToCache);
57 | } else {
58 | swJsString = fs.readFileSync(
59 | path.join(pathToServiceWorkerTemplates, 'sw.txt'),
60 | { encoding: 'utf-8' });
61 | }
62 | const pathToAppSw = path.join(pathToApp, 'sw.js');
63 | if (fs.pathExistsSync(pathToAppSw)) {
64 | fs.renameSync(pathToAppSw, path.join(pathToApp, 'sw_old.js'));
65 | }
66 | fs.outputFileSync(
67 | pathToAppSw,
68 | swJsString.replace(appNameRegex, appName)
69 | );
70 | // 3. read manifest.json, replace app name token, write to app
71 | const manifestJsonString = fs.readFileSync(
72 | path.join(pathToServiceWorkerTemplates, 'manifest.json'),
73 | { encoding: 'utf-8' }
74 | );
75 | const pathToAppManifest = path.join(pathToApp, 'manifest.json');
76 | if (fs.pathExistsSync(pathToAppManifest)) {
77 | fs.renameSync(pathToAppManifest, path.join(pathToApp, 'manifest_old.json'));
78 | }
79 | fs.outputFileSync(
80 | path.join(pathToApp, 'manifest.json'),
81 | manifestJsonString.replace(appNameRegex, appName)
82 | );
83 | // 4. copy swInit.txt and add it to end of body tag index.html, add
84 | // and other necessary to end of header tag in index.html and update
85 | const swInitString = fs.readFileSync(
86 | path.join(pathToServiceWorkerTemplates, 'swInit.txt'),
87 | { encoding: 'utf-8' }
88 | );
89 | const additionalTagsForPWALighthouseCompliance = `
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | `;
105 | fs.outputFileSync(
106 | pathToIndexHtml,
107 | indexHtmlString.replace(
108 | new RegExp('', 'g'),
109 | `${additionalTagsForPWALighthouseCompliance}\n\n`
110 | ).replace(
111 | new RegExp('