/src/**/__tests__/**/*.spec.tsx"
16 | ]
17 | }
--------------------------------------------------------------------------------
/test/buildConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "ios": {
3 | "debug": {
4 | "provisioningProfile": "9ee22e98-ecd9-4d96-a49f-f2f0bb0ca2f0",
5 | "developmentTeam": "52QHD847TQ",
6 | "codeSignIdentity": "iPhone Distribution",
7 | "packageType": "enterprise"
8 | },
9 |
10 | "release": {
11 | "provisioningProfile": "9ee22e98-ecd9-4d96-a49f-f2f0bb0ca2f0",
12 | "developmentTeam": "52QHD847TQ",
13 | "codeSignIdentity": "iPhone Distribution",
14 | "packageType": "enterprise"
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-component/my-component-styles.css:
--------------------------------------------------------------------------------
1 | /* This file is where css selectors for the component go.
2 | There will be hard coded properties and properties controlled by variables, for example
3 |
4 | my-component .my-component-value-text {
5 | color: var(--my-component-value-text-color);
6 | display: inline-block;
7 | }
8 | */
9 |
10 | my-component:not(.oj-complete){
11 | visibility: hidden;
12 | }
13 |
14 | my-component {
15 | min-height: 50px;
16 | width: 50px;
17 | font-weight: bold;
18 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-component/my-component-styles.css:
--------------------------------------------------------------------------------
1 | /* This file is where css selectors for the component go.
2 | There will be hard coded properties and properties controlled by variables, for example
3 |
4 | my-component .my-component-value-text {
5 | color: var(--my-component-value-text-color);
6 | display: inline-block;
7 | }
8 | */
9 |
10 | my-component:not(.oj-complete){
11 | visibility: hidden;
12 | }
13 |
14 | my-component {
15 | min-height: 50px;
16 | width: 50px;
17 | font-weight: bold;
18 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-component/my-component-view.html:
--------------------------------------------------------------------------------
1 |
7 |
13 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-component/my-component-view.html:
--------------------------------------------------------------------------------
1 |
7 |
13 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-pack/component/component-view.html:
--------------------------------------------------------------------------------
1 |
7 |
13 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-pack/component/component-view.html:
--------------------------------------------------------------------------------
1 |
7 |
13 |
--------------------------------------------------------------------------------
/test/util/modSource.mjs:
--------------------------------------------------------------------------------
1 | import fs from 'fs';
2 | import path from 'path';
3 |
4 | function sleep(ms) {
5 | return new Promise(resolve => {
6 | const timer = setTimeout(() => {
7 | clearTimeout(timer);
8 | resolve();
9 | }, ms);
10 | });
11 | }
12 |
13 | const pathToIndexHTML = path.join('src', 'index.html');
14 | await sleep(2000);
15 | fs.appendFileSync(pathToIndexHTML, '', { encoding: 'utf-8' });
16 | const pathIsNewSCSS = path.join('src', 'themes', 'themestable', 'new.scss');
17 | fs.writeFileSync(pathIsNewSCSS, "// scss");
18 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-pack/component/component-styles.css:
--------------------------------------------------------------------------------
1 | /* This file is where css selectors for the component go.
2 | There will be hard coded properties and properties controlled by variables, for example
3 |
4 | my-pack-component .my-pack-component-value-text {
5 | color: var(--my-pack-component-value-text-color);
6 | display: inline-block;
7 | }
8 | */
9 |
10 | my-pack-component:not(.oj-complete){
11 | visibility: hidden;
12 | }
13 |
14 | my-pack-component {
15 | min-height: 50px;
16 | width: 50px;
17 | font-weight: bold;
18 | }
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-pack/component/component-styles.css:
--------------------------------------------------------------------------------
1 | /* This file is where css selectors for the component go.
2 | There will be hard coded properties and properties controlled by variables, for example
3 |
4 | my-pack-component .my-pack-component-value-text {
5 | color: var(--my-pack-component-value-text-color);
6 | display: inline-block;
7 | }
8 | */
9 |
10 | my-pack-component:not(.oj-complete){
11 | visibility: hidden;
12 | }
13 |
14 | my-pack-component {
15 | min-height: 50px;
16 | width: 50px;
17 | font-weight: bold;
18 | }
--------------------------------------------------------------------------------
/template/component/ts/loader.ts:
--------------------------------------------------------------------------------
1 | import Composite = require("ojs/ojcomposite");
2 | import * as view from "text!./@component-name@-view.html";
3 | import viewModel from "./@component-name@-viewModel";
4 | import * as metadata from "text!./component.json";
5 | import "css!./@component-name@-styles.css";
6 |
7 | Composite.register("@full-component-name@", {
8 | view: view,
9 | viewModel: viewModel,
10 | metadata: JSON.parse(metadata)
11 | });
12 |
13 | declare global {
14 | namespace preact.JSX {
15 | interface IntrinsicElements {
16 | "@full-component-name@": any;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/template/component/css/@component@-styles.css:
--------------------------------------------------------------------------------
1 | /* This file is where css selectors for the component go.
2 | There will be hard coded properties and properties controlled by variables, for example
3 |
4 | @full-component-name@ .@full-component-name@-value-text {
5 | color: var(--@full-component-name@-value-text-color);
6 | display: inline-block;
7 | }
8 | */
9 |
10 | @full-component-name@:not(.oj-complete){
11 | visibility: hidden;
12 | }
13 |
14 | @full-component-name@{
15 | min-height: 50px;
16 | width: 50px;
17 | }
18 |
19 | @full-component-name@[hidden]
20 | {
21 | display: none;
22 | }
--------------------------------------------------------------------------------
/template/component/js/loader.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 | define(['ojs/ojcomposite', 'text!./@component-name@-view.html', './@component-name@-viewModel', 'text!./component.json', 'css!./@component-name@-styles.css'],
8 | function(Composite, view, viewModel, metadata) {
9 | Composite.register('@full-component-name@', {
10 | view: view,
11 | viewModel: viewModel,
12 | metadata: JSON.parse(metadata)
13 | });
14 | }
15 | );
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_app_create.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function () {
16 | return new Promise((resolve) => {
17 | resolve();
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_app_create.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function () {
16 | return new Promise((resolve) => {
17 | resolve();
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_app_restore.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function () {
16 | return new Promise((resolve) => {
17 | resolve();
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_app_restore.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function () {
16 | return new Promise((resolve) => {
17 | resolve();
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/generators/app/templates/common/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "oraclejet-app",
3 | "version": "1.0.0",
4 | "description": "An Oracle JavaScript Extension Toolkit(JET) web app",
5 | "dependencies": {
6 | "@oracle/oraclejet": "~19.0.0",
7 | "@oracle/oraclejet-core-pack": "~19.0.0"
8 | },
9 | "devDependencies": {
10 | "extract-zip": "^1.7.0",
11 | "fs-extra": "^8.1.0",
12 | "glob": "10.4.5",
13 | "underscore": "^1.10.2",
14 | "@oracle/ojet-cli": "~19.0.0"
15 | },
16 | "engines": {
17 | "node": ">=16.0.0"
18 | },
19 | "private": true,
20 | "overrides": {
21 | "@types/minimatch": "5.1.2"
22 | }
23 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_app_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | resolve(configObj);
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_app_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | resolve(configObj);
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_component_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | resolve(configObj);
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_serve.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_watch.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_watch.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_component_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | resolve(configObj);
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_serve.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_watch.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_optimize.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_watch.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_optimize.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_release_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_component_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_release_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_component_build.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_component_optimize.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_component_optimize.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_app_create.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function () {
16 | return new Promise((resolve) => {
17 | console.log('Running after_app_create hook.');
18 | resolve();
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_app_restore.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function () {
16 | return new Promise((resolve) => {
17 | console.log('Running after_app_restore hook.');
18 | resolve();
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webMigrationTest",
3 | "version": "1.0.0",
4 | "description": "An Oracle JavaScript Extension Toolkit(JET) web app",
5 | "dependencies": {
6 | "@oracle/oraclejet": "https://artifacthub-phx.oci.oraclecorp.com/ojet-dev-local/oracle-oraclejet-19.0.0.tgz"
7 | },
8 | "devDependencies": {
9 | "@oracle/ojet-cli":"file:../../ojet-cli",
10 | "fs-extra": "^8.1.0",
11 | "glob": "10.4.5",
12 | "underscore": "^1.10.2",
13 | "yargs-parser": "~13.1.2",
14 | "typescript": "5.8.3"
15 | },
16 | "engines": {
17 | "node": ">=16.0.0"
18 | },
19 | "private": true
20 | }
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/after_component_create.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | // const componentPath = configObj.componentPath;
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_build.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running after_build hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_serve.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running after_serve hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_watch.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running after_watch hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_build.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running before_build hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_watch.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running before_watch hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/after_component_create.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | // const componentPath = configObj.componentPath;
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webTsApiTest",
3 | "version": "1.0.0",
4 | "description": "An Oracle JavaScript Extension Toolkit(JET) web app",
5 | "dependencies": {
6 | "@oracle/oraclejet": "https://artifacthub-phx.oci.oraclecorp.com/ojet-dev-local/oracle-oraclejet-19.0.0.tgz"
7 | },
8 | "devDependencies": {
9 | "@oracle/ojet-cli":"file:../../ojet-cli",
10 | "fs-extra": "^8.1.0",
11 | "glob": "10.4.5",
12 | "underscore": "^1.10.2",
13 | "yargs-parser": "~13.1.2",
14 | "typescript": "5.8.3",
15 | "nock": "14.0.5"
16 | },
17 | "engines": {
18 | "node": ">=16.0.0"
19 | },
20 | "private": true
21 | }
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_app_typescript.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | console.log("Running after_app_typescript hook.");
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/views/about.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
About Content Area
14 |
15 | To change the content of this section, you will make edits to the about.html file located in the /ts/views folder.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_optimize.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running before_optimize hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/setup.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 | const util = require('./util');
8 | const fs = require('fs-extra');
9 |
10 | before(async () => {
11 | console.log('Setup copy');
12 |
13 | fs.ensureDirSync(util.testDir);
14 |
15 | // Modify the built ojet-cli's package.json to use the locally built oraclejet-tooling symlink when apps are scaffolded in the tests
16 | util.makePackageSymlink();
17 |
18 | // Initial copy of current oraclejet-tooling build over "global" ojet-cli install
19 | //util.copyOracleJetTooling();
20 | });
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/views/about.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
About Content Area
14 |
15 | To change the content of this section, you will make edits to the about.html file located in the /ts/views folder.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_app_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | //const { tsconfigJson } = configObj.typescript;
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_app_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | //const { tsconfigJson } = configObj.typescript;
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_component_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | //const { tsconfigJson } = configObj.typescript;
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_component_build.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running after_component_build hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_component_typescript.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | console.log("Running after_component_typescript hook.");
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_release_build.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running before_release_build hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to ojet-cli
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 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_component_typescript.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | //const { tsconfigJson } = configObj.typescript;
18 | resolve(configObj);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/views/customers.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
Customers Content Area
14 |
15 | To change the content of this section, you will make edits to the customers.html file located in the /ts/views folder.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/views/incidents.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
Incidents Content Area
14 |
15 | To change the content of this section, you will make edits to the incidents.html file located in the /ts/views folder.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/views/customers.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
Customers Content Area
14 |
15 | To change the content of this section, you will make edits to the customers.html file located in the /ts/views folder.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/views/incidents.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
Incidents Content Area
14 |
15 | To change the content of this section, you will make edits to the incidents.html file located in the /ts/views folder.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_component_optimize.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running before_component_optimize hook.");
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@oracle/ojet-cli",
3 | "version": "19.0.0",
4 | "description": "Oracle JET Command Line Interface",
5 | "license": "UPL-1.0",
6 | "homepage": "http://www.oracle.com/jet",
7 | "bin": {
8 | "ojet": "bin/ojet"
9 | },
10 | "main": "ojet.js",
11 | "dependencies": {
12 | "adm-zip": "~0.4.7",
13 | "fs-extra": "~8.1.0",
14 | "glob": "10.4.5",
15 | "minimist": "~1.2.0",
16 | "@oracle/oraclejet-tooling": "~19.0.0",
17 | "@oracle/oraclejet-templates": "~19.0.0"
18 | },
19 | "devDependencies": {
20 | "nock": "14.0.3"
21 | },
22 | "overrides": {
23 | "glob": "10.4.5"
24 | },
25 | "engines": {
26 | "node": ">=12.21.0"
27 | },
28 | "preferGlobal": true
29 | }
--------------------------------------------------------------------------------
/template/component/theme/themes/redwood/_@component@.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // You may import variables from JET like so:
5 | // @import "oj/core/themes/redwood/_oj-core.cssvars.scss";
6 | // @import "oj/core/themes/redwood/_oj-palette.cssvars.scss";
7 |
8 | // import the css common to all themes
9 | @import "../base/_@style-component-name@.scss";
10 |
11 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
12 | @include module-include-once("_@style-component-name@.redwood") {
13 | :root {
14 |
15 | // set your variables inside of :root, an example:
16 | // --@full-component-name@-value-text-color: var(--oj-palette-red-140);
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/template/component/theme/themes/stable/_@component@.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // You may import variables from JET like so:
5 | // @import "oj/core/themes/stable/_oj-core.cssvars.scss";
6 | // @import "oj/core/themes/stable/_oj-palette.cssvars.scss";
7 |
8 | // import the css common to all themes
9 | @import "../base/_@style-component-name@.scss";
10 |
11 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
12 | @include module-include-once("_@style-component-name@.stable") {
13 | :root {
14 |
15 | // set your variables inside of :root, an example:
16 | // --@full-component-name@-value-text-color: var(--oj-palette-red-140);
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_app_typescript.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | console.log("Running before_app_typescript hook.");
18 | //const { tsconfigJson } = configObj.typescript;
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_webpack.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log("Running before_webpack hook.");
19 | // const { config } = configObj.webpack;
20 | resolve(configObj);
21 | });
22 | };
23 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/after_component_create.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | console.log('Running after_component_create hook.');
18 | // const componentPath = configObj.componentPath;
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-component/themes/redwood/_my-component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // You may import variables from JET like so:
5 | // @import "oj/core/themes/redwood/_oj-core.cssvars.scss";
6 | // @import "oj/core/themes/redwood/_oj-palette.cssvars.scss";
7 |
8 | // import the css common to all themes
9 | @import "../base/_my-component.scss";
10 |
11 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
12 | @include module-include-once("_my-component.redwood") {
13 | :root {
14 |
15 | // set your variables inside of :root, an example:
16 | // --my-component-value-text-color: var(--oj-palette-red-140);
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-component/themes/redwood/_my-component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // You may import variables from JET like so:
5 | // @import "oj/core/themes/redwood/_oj-core.cssvars.scss";
6 | // @import "oj/core/themes/redwood/_oj-palette.cssvars.scss";
7 |
8 | // import the css common to all themes
9 | @import "../base/_my-component.scss";
10 |
11 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
12 | @include module-include-once("_my-component.redwood") {
13 | :root {
14 |
15 | // set your variables inside of :root, an example:
16 | // --my-component-value-text-color: var(--oj-palette-red-140);
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-pack/component/themes/redwood/_component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // You may import variables from JET like so:
5 | // @import "oj/core/themes/redwood/_oj-core.cssvars.scss";
6 | // @import "oj/core/themes/redwood/_oj-palette.cssvars.scss";
7 |
8 | // import the css common to all themes
9 | @import "../base/_component.scss";
10 |
11 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
12 | @include module-include-once("_component.redwood") {
13 | :root {
14 |
15 | // set your variables inside of :root, an example:
16 | // --my-pack-component-value-text-color: var(--oj-palette-red-140);
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-pack/component/themes/redwood/_component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // You may import variables from JET like so:
5 | // @import "oj/core/themes/redwood/_oj-core.cssvars.scss";
6 | // @import "oj/core/themes/redwood/_oj-palette.cssvars.scss";
7 |
8 | // import the css common to all themes
9 | @import "../base/_component.scss";
10 |
11 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
12 | @include module-include-once("_component.redwood") {
13 | :root {
14 |
15 | // set your variables inside of :root, an example:
16 | // --my-pack-component-value-text-color: var(--oj-palette-red-140);
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_component_typescript.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 | 'use strict';
14 |
15 | module.exports = function (configObj) {
16 | return new Promise((resolve) => {
17 | console.log("Running before_component_typescript hook.");
18 | //const { tsconfigJson } = configObj.typescript;
19 | resolve(configObj);
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-component/themes/base/_my-component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // This file is where css selectors shared by all themes go.
5 | // There will be hard code properties and properties controlled by variables, for example
6 | //
7 | // my-component .my-component-value-text {
8 | // color: var(--my-component-value-text-color);
9 | // display: inline-block;
10 | // }
11 |
12 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
13 | @include module-include-once("my-component.base") {
14 | my-component:not(.oj-complete){
15 | visibility: hidden;
16 | }
17 |
18 | my-component{
19 | min-height: 50px;
20 | width: 50px;
21 | }
22 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-component/themes/base/_my-component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // This file is where css selectors shared by all themes go.
5 | // There will be hard code properties and properties controlled by variables, for example
6 | //
7 | // my-component .my-component-value-text {
8 | // color: var(--my-component-value-text-color);
9 | // display: inline-block;
10 | // }
11 |
12 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
13 | @include module-include-once("my-component.base") {
14 | my-component:not(.oj-complete){
15 | visibility: hidden;
16 | }
17 |
18 | my-component{
19 | min-height: 50px;
20 | width: 50px;
21 | }
22 | }
--------------------------------------------------------------------------------
/template/component/theme/themes/base/_@component@.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // This file is where css selectors shared by all themes go.
5 | // There will be hard code properties and properties controlled by variables, for example
6 | //
7 | // @full-component-name@ .@full-component-name@-value-text {
8 | // color: var(--@full-component-name@-value-text-color);
9 | // display: inline-block;
10 | // }
11 |
12 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
13 | @include module-include-once("@full-component-name@.base") {
14 | @full-component-name@:not(.oj-complete){
15 | visibility: hidden;
16 | }
17 |
18 | @full-component-name@{
19 | min-height: 50px;
20 | width: 50px;
21 | }
22 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-pack/component/themes/base/_component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // This file is where css selectors shared by all themes go.
5 | // There will be hard code properties and properties controlled by variables, for example
6 | //
7 | // my-pack-component .my-pack-component-value-text {
8 | // color: var(--my-pack-component-value-text-color);
9 | // display: inline-block;
10 | // }
11 |
12 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
13 | @include module-include-once("my-pack-component.base") {
14 | my-pack-component:not(.oj-complete){
15 | visibility: hidden;
16 | }
17 |
18 | my-pack-component{
19 | min-height: 50px;
20 | width: 50px;
21 | }
22 | }
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-pack/component/themes/base/_component.scss:
--------------------------------------------------------------------------------
1 |
2 | @import "oj/utilities/_oj.utilities.modules.scss";
3 |
4 | // This file is where css selectors shared by all themes go.
5 | // There will be hard code properties and properties controlled by variables, for example
6 | //
7 | // my-pack-component .my-pack-component-value-text {
8 | // color: var(--my-pack-component-value-text-color);
9 | // display: inline-block;
10 | // }
11 |
12 | // Even if this file is imported many times 'module-include-once' ensures the content is included just once .
13 | @include module-include-once("my-pack-component.base") {
14 | my-pack-component:not(.oj-complete){
15 | visibility: hidden;
16 | }
17 |
18 | my-pack-component{
19 | min-height: 50px;
20 | width: 50px;
21 | }
22 | }
--------------------------------------------------------------------------------
/template/test-config-karma/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "paths": {
6 | "*": [
7 | "../src/ts/jet-composites/*",
8 | "../src/js/jet-composites/*",
9 | "../node_modules/*"
10 | ],
11 | "ojs/*": ["../node_modules/@oracle/oraclejet/dist/types/*"]
12 | },
13 | "typeRoots": [
14 | "../node_modules/@types",
15 | "../node_modules/@oracle/oraclejet/dist/types"
16 | ],
17 | "lib": ["dom", "es2021"],
18 | "moduleResolution": "node",
19 | "module": "amd",
20 | "target": "es6",
21 | },
22 | "include": [
23 | "../src/ts/jet-composites/**/__tests__/**/*.ts",
24 | "../src/js/jet-composites/**/__tests__/**/*.ts",
25 | "../node_modules/@oracle/oraclejet/dist/types/requirejs-plugins.d.ts"
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webpackLegacyTest",
3 | "version": "1.0.0",
4 | "description": "An Oracle JavaScript Extension Toolkit(JET) web app",
5 | "dependencies": {
6 | "@oracle/oraclejet": "https://artifacthub-phx.oci.oraclecorp.com/ojet-dev-local/oracle-oraclejet-19.0.0.tgz"
7 | },
8 | "devDependencies": {
9 | "@oracle/ojet-cli": "file:../../ojet-cli",
10 | "fs-extra": "^8.1.0",
11 | "glob": "10.4.5",
12 | "yargs-parser": "~13.1.2",
13 | "typescript": "5.8.3",
14 | "underscore": "^1.10.2",
15 | "webpack": "5.76.0",
16 | "@types/node": "18.16.3",
17 | "text-loader": "^0.0.1",
18 | "style-loader": "^3.1.0",
19 | "css-loader": "^6.0.0",
20 | "css-fix-url-loader": "1.0.2"
21 | },
22 | "engines": {
23 | "node": ">=16.0.0"
24 | },
25 | "private": true
26 | }
27 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/root.ts:
--------------------------------------------------------------------------------
1 | import * as ko from "knockout";
2 | import rootViewModel from "./appController";
3 | import "ojs/ojknockout";
4 | import "ojs/ojmodule";
5 | import "ojs/ojnavigationlist";
6 | import "ojs/ojbutton";
7 | import "ojs/ojtoolbar";
8 |
9 | export = class Root {
10 | static init(): void {
11 | function _init(): void {
12 | // bind your ViewModel for the content of the whole page body.
13 | ko.applyBindings(rootViewModel, document.getElementById("globalBody"));
14 | }
15 | // if running in a hybrid (e.g. Cordova) environment, we need to wait for the deviceready
16 | // event before executing any code that might interact with Cordova APIs or plugins.
17 | if (document.body.classList.contains("oj-hybrid")) {
18 | document.addEventListener("deviceready", _init);
19 | } else {
20 | _init();
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/root.ts:
--------------------------------------------------------------------------------
1 | import * as ko from "knockout";
2 | import rootViewModel from "./appController";
3 | import "ojs/ojknockout";
4 | import "ojs/ojmodule";
5 | import "ojs/ojnavigationlist";
6 | import "ojs/ojbutton";
7 | import "ojs/ojtoolbar";
8 |
9 | export = class Root {
10 | static init(): void {
11 | function _init(): void {
12 | // bind your ViewModel for the content of the whole page body.
13 | ko.applyBindings(rootViewModel, document.getElementById("globalBody"));
14 | }
15 | // if running in a hybrid (e.g. Cordova) environment, we need to wait for the deviceready
16 | // event before executing any code that might interact with Cordova APIs or plugins.
17 | if (document.body.classList.contains("oj-hybrid")) {
18 | document.addEventListener("deviceready", _init);
19 | } else {
20 | _init();
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/lib/tooling/index.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 | 'use strict';
8 |
9 | const build = require('./build');
10 | const serve = require('./serve');
11 | const utils = require('../util/utils');
12 | /*
13 | * Options and Arguments processing before Invoking tooling APIs
14 | */
15 |
16 | module.exports = function (task, scope, parameter, options) {
17 | const scopeCheckedForAppValue = (scope === 'app' || scope === 'component') ? undefined : scope;
18 | const platform = parameter === undefined ? scopeCheckedForAppValue : parameter;
19 | if (task === 'build') {
20 | return build(platform, options);
21 | } else if (task === 'serve') {
22 | return serve(options);
23 | }
24 | utils.log.error(utils.toNotSupportedMessage(`${task} ${scope}`));
25 | return Promise.reject();
26 | };
27 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": true,
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "target": "es6",
6 | "strict": true,
7 | "module": "amd",
8 | "moduleResolution": "node",
9 | "jsx": "react-jsx",
10 | "jsxImportSource": "preact",
11 | "lib": [
12 | "es2021",
13 | "dom",
14 | "esnext.asynciterable"
15 | ],
16 | "typeRoots": [
17 | "./node_modules/@oracle/oraclejet/dist/types",
18 | "./node_modules/@types"
19 | ],
20 | "paths": {
21 | "ojs/*": [
22 | "./node_modules/@oracle/oraclejet/dist/types/*"
23 | ],
24 | "preact": [
25 | "./node_modules/preact"
26 | ]
27 | },
28 | "declaration": true,
29 | "noEmitOnError": true,
30 | "experimentalDecorators": true,
31 | "skipLibCheck": true,
32 | "removeComments": true
33 | },
34 | "include": [
35 | "./src/**/*"
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/oraclejetconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "paths": {
3 | "source": {
4 | "common": "src",
5 | "web": "src-web",
6 | "javascript": "js",
7 | "typescript": "ts",
8 | "styles": "css",
9 | "themes": "themes"
10 | },
11 | "staging": {
12 | "web": "web",
13 | "themes": "staged-themes"
14 | }
15 | },
16 | "defaultBrowser": "chrome",
17 | "sassVer": "1.80.5",
18 | "webpackLibraries": "webpack@5.76.0 @types/node@18.16.3 webpack-dev-server style-loader css-loader ts-loader@8.4.0 raw-loader noop-loader html-webpack-plugin html-replace-webpack-plugin copy-webpack-plugin @prefresh/webpack @prefresh/babel-plugin webpack-merge compression-webpack-plugin mini-css-extract-plugin clean-webpack-plugin css-fix-url-loader",
19 | "defaultTheme": "redwood",
20 | "fontUrl": "https://static.oracle.com/cdn/fnd/gallery/2404.0.0/images/iconfont/ojuxIconFont.min.css",
21 | "exchange-url": "https://exchange.oraclecorp.com/api/0.2.0"
22 | }
--------------------------------------------------------------------------------
/template/component/tsx/@component@.tsx:
--------------------------------------------------------------------------------
1 | import { customElement, ExtendGlobalProps } from "ojs/ojvcomponent";
2 | import { Component, ComponentChild } from "preact";
3 | import componentStrings = require("ojL10n!./resources/nls/@component-name@-strings");
4 | import "css!./@component-name@-styles.css";
5 |
6 | type Props = Readonly<{
7 | message?: string;
8 | }>;
9 |
10 | /**
11 | * @ojmetadata pack "@pack-name@"
12 | * @ojmetadata version "1.0.0"
13 | * @ojmetadata displayName "A user friendly, translatable name of the component"
14 | * @ojmetadata description "A translatable high-level description for the component"
15 | * @ojmetadata main "@pack-name@/@component-name@"
16 | */
17 | @customElement("@full-component-name@")
18 | export class @camelcasecomponent-name@ extends Component < ExtendGlobalProps < Props >> {
19 | static defaultProps: Partial < Props > = {
20 | message: "Hello from @full-component-name@!"
21 | };
22 |
23 | render(props: Props): ComponentChild {
24 | return {props.message}
;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/views/dashboard.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
Dashboard Content Area
14 |
15 |
16 | To change the content of this section, you will make edits to the dashboard.html file located in the /ts/views folder.
17 |
18 |
19 |
Web Components
20 |
21 |
22 |
23 |
24 |
25 | Hello from oj-sample-country-picker
26 |
27 |
28 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/views/dashboard.html:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
Dashboard Content Area
14 |
15 |
16 | To change the content of this section, you will make edits to the dashboard.html file located in the /ts/views folder.
17 |
18 |
19 |
Web Components
20 |
21 |
22 |
23 |
24 |
25 | Hello from oj-sample-country-picker
26 |
27 |
28 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/src/components/app.tsx:
--------------------------------------------------------------------------------
1 | import { registerCustomElement } from "ojs/ojvcomponent";
2 | import { h } from "preact";
3 | import { useEffect } from "preact/hooks";
4 | import Context = require("ojs/ojcontext");
5 | import { Footer } from "./footer";
6 | import { Header } from "./header";
7 | import { Content } from "./content/index";
8 |
9 | type Props = Readonly<{
10 | appName?: string;
11 | userLogin?: string;
12 | }>;
13 |
14 | export const App = registerCustomElement(
15 | "app-root",
16 | ({ appName = "App Name", userLogin = "john.hancock@oracle.com" }: Props) => {
17 | useEffect(() => {
18 | Context.getPageContext().getBusyContext().applicationBootstrapComplete();
19 | }, []);
20 |
21 | return (
22 |
23 |
27 |
28 |
29 |
30 | );
31 | }
32 | );
33 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": true,
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "target": "es6",
6 | "strict": true,
7 | "module": "amd",
8 | "moduleResolution": "node",
9 | "jsx": "react-jsx",
10 | "jsxImportSource": "preact",
11 | "lib": [
12 | "es2021",
13 | "dom",
14 | "esnext.asynciterable"
15 | ],
16 | "typeRoots": [
17 | "./node_modules/@oracle/oraclejet/dist/types",
18 | "./node_modules/@types"
19 | ],
20 | "paths": {
21 | "ojs/*": [
22 | "./node_modules/@oracle/oraclejet/dist/types/*"
23 | ],
24 | "my-pack/*": [
25 | "./src/ts/jet-composites/my-pack/*"
26 | ],
27 | "my-component/*": [
28 | "./src/ts/jet-composites/my-component/*"
29 | ]
30 | },
31 | "declaration": true,
32 | "noEmitOnError": true,
33 | "experimentalDecorators": true,
34 | "skipLibCheck": true,
35 | "removeComments": true
36 | },
37 | "include": [
38 | "./src/ts/**/*"
39 | ]
40 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": true,
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "target": "es6",
6 | "strict": true,
7 | "module": "amd",
8 | "moduleResolution": "node",
9 | "jsx": "react-jsx",
10 | "jsxImportSource": "preact",
11 | "lib": [
12 | "es2021",
13 | "dom",
14 | "esnext.asynciterable"
15 | ],
16 | "typeRoots": [
17 | "./node_modules/@oracle/oraclejet/dist/types",
18 | "./node_modules/@types"
19 | ],
20 | "paths": {
21 | "ojs/*": [
22 | "./node_modules/@oracle/oraclejet/dist/types/*"
23 | ],
24 | "my-pack/*": [
25 | "./src/ts/jet-composites/my-pack/*"
26 | ],
27 | "my-component/*": [
28 | "./src/ts/jet-composites/my-component/*"
29 | ]
30 | },
31 | "declaration": true,
32 | "noEmitOnError": true,
33 | "experimentalDecorators": true,
34 | "skipLibCheck": true,
35 | "removeComments": true
36 | },
37 | "include": [
38 | "./src/ts/**/*"
39 | ]
40 | }
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/oraclejetconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "paths": {
3 | "source": {
4 | "common": "src",
5 | "web": "src-web",
6 | "javascript": ".",
7 | "typescript": ".",
8 | "styles": "styles",
9 | "themes": "themes",
10 | "components": "components",
11 | "exchangeComponents": "exchange_components"
12 | },
13 | "staging": {
14 | "web": "web",
15 | "themes": "staged-themes"
16 | }
17 | },
18 | "defaultBrowser": "chrome",
19 | "sassVer": "1.80.5",
20 | "typescriptLibraries": "typescript@5.8.3 yargs-parser@~13.1.2",
21 | "webpackLibraries": "webpack@5.76.0 @types/node@18.16.3 webpack-dev-server style-loader css-loader ts-loader@8.4.0 raw-loader noop-loader html-webpack-plugin html-replace-webpack-plugin copy-webpack-plugin @prefresh/webpack @prefresh/babel-plugin webpack-merge compression-webpack-plugin mini-css-extract-plugin clean-webpack-plugin css-fix-url-loader",
22 | "defaultTheme": "redwood",
23 | "architecture": "vdom",
24 | "bundler": "webpack",
25 | "bundleName": "bundle.js"
26 | }
--------------------------------------------------------------------------------
/generators/add-pcss-theme/templates/mytheme/web/mytheme.scss:
--------------------------------------------------------------------------------
1 | // In theme.json the generatedFileType defaults to 'add-on', therefore only the
2 | // import "_<%= themename %>.cssvars.settings.scss" is uncommented here by default.
3 | // If you uncomment other imports please set generatedFileType to 'combined' in theme.json.
4 | // Please see the developer guide link below for more information
5 | // http://www.oracle.com/pls/topic/lookup?ctx=jetlatest&id=GUID-12A65AC0-4784-46FE-AC8C-09FA509737E4
6 |
7 | // import SASS custom variable overrides
8 | // @import "_<%= themename %>.sass.settings.scss";
9 |
10 | // Imports all jet components styles
11 | // @import "<%= importcomponents %>";
12 |
13 | // To optimize performance, consider commenting out the above oj-all-components
14 | // import and uncomment _<%= themename %>.components.scss below.
15 | // Then in _<%= themename %>.components.scss uncomment only the component
16 | // imports that your application needs.
17 |
18 | // @import "_<%= themename %>.optimize-components.scss";
19 |
20 | // import CSS Custom properties
21 | @import "_<%= themename %>.cssvars.settings.scss";
22 |
--------------------------------------------------------------------------------
/template/component/tsx/@component@-functional-template.tsx:
--------------------------------------------------------------------------------
1 | import { ExtendGlobalProps, registerCustomElement } from "ojs/ojvcomponent";
2 | import { ComponentProps, ComponentType } from "preact";
3 | import componentStrings = require("ojL10n!./resources/nls/@component-name@-strings");
4 | import "css!./@component-name@-styles.css";
5 |
6 | type Props = Readonly<{
7 | message?: string;
8 | }>;
9 |
10 | /**
11 | * @ojmetadata pack "@pack-name@"
12 | * @ojmetadata version "1.0.0"
13 | * @ojmetadata displayName "A user friendly, translatable name of the component"
14 | * @ojmetadata description "A translatable high-level description for the component"
15 | * @ojmetadata main "@pack-name@/@component-name@"
16 | */
17 | function @camelcasecomponent-name@Impl(
18 | { message = "Hello from @full-component-name@" }: Props
19 | ) {
20 | return {message}
21 | }
22 |
23 | export const @camelcasecomponent-name@: ComponentType <
24 | ExtendGlobalProps < ComponentProps < typeof @camelcasecomponent-name@Impl>>
25 | > = registerCustomElement(
26 | "@full-component-name@",
27 | @camelcasecomponent-name@Impl
28 | );
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/src/styles/app.css:
--------------------------------------------------------------------------------
1 | /*
2 | Document : override
3 | Created on :
4 | Author :
5 | Description:
6 | This is where any of your application specific styles should be included
7 | */
8 | .demo-oracle-icon {
9 | width:137px;
10 | height:18px
11 | }
12 |
13 | .demo-oracle-icon:before {
14 | content:url("images/oracle_logo.svg")
15 | }
16 |
17 | html:not([dir="rtl"]) .demo-oracle-icon {
18 | padding-right:4px
19 | }
20 |
21 | html[dir="rtl"] .demo-oracle-icon {
22 | padding-left:4px
23 | }
24 |
25 | .demo-oracle-icon:before {
26 | display:inline
27 | }
28 |
29 | .demo-appheader-avatar {
30 | width:24px;
31 | height:24px
32 | }
33 |
34 | .demo-appheader-avatar:before {
35 | content:url("images/avatar_24px.png")
36 | }
37 | @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx) {
38 | .demo-appheader-avatar:before {
39 | content:url("images/avatar_24px_2x.png");
40 | -webkit-transform:translate(-25%, -25%) scale(0.5);
41 | transform:translate(-25%, -25%) scale(0.5)
42 | }
43 | }
--------------------------------------------------------------------------------
/lib/util/fetchZip.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 | 'use strict';
8 |
9 | const http = require('http');
10 | const https = require('https');
11 |
12 | module.exports = function (requestedUrl) {
13 | // fetches the zip file
14 | return new Promise((resolve, reject) => {
15 | const protocol = new URL(requestedUrl).protocol === 'https:' ? https : http;
16 |
17 | // HTTP/HTTPS request
18 | // https://nodejs.org/api/http.html#http_http_request_url_options_callback
19 | // https://nodejs.org/api/https.html#https_https_request_options_callback
20 | const request = protocol.request(requestedUrl, (response) => {
21 | const buffer = [];
22 | response.on('data', (chunk) => {
23 | buffer.push(chunk);
24 | });
25 | response.on('end', () => {
26 | resolve(Buffer.concat(buffer));
27 | });
28 | });
29 |
30 | request.on('error', (error) => {
31 | reject(error);
32 | });
33 |
34 | request.end();
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/oraclejetconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "paths": {
3 | "source": {
4 | "common": "src",
5 | "web": "src-web",
6 | "javascript": "js",
7 | "typescript": "ts",
8 | "styles": "css",
9 | "themes": "themes"
10 | },
11 | "staging": {
12 | "web": "web",
13 | "themes": "staged-themes"
14 | }
15 | },
16 | "defaultBrowser": "chrome",
17 | "sassVer": "1.80.5",
18 | "webpackLibraries": "webpack@5.76.0 @types/node@18.16.3 webpack-dev-server style-loader css-loader ts-loader@8.4.0 raw-loader noop-loader html-webpack-plugin html-replace-webpack-plugin copy-webpack-plugin @prefresh/webpack @prefresh/babel-plugin webpack-merge compression-webpack-plugin mini-css-extract-plugin clean-webpack-plugin css-fix-url-loader",
19 | "defaultTheme": "redwood",
20 | "fontUrl": "https://static.oracle.com/cdn/fnd/gallery/2404.0.0/images/iconfont/ojuxIconFont.min.css",
21 | "exchange-url": "https://exchange.oraclecorp.com/api/0.2.0",
22 | "components": {
23 | "oj-sample": {
24 | "components": {
25 | "country-picker": "^3.1.2"
26 | }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/accUtils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014, 2018, Oracle and/or its affiliates.
4 | * The Universal Permissive License (UPL), Version 1.0
5 | */
6 | /*
7 | * Your application specific code will go here
8 | */
9 |
10 | /**
11 | * Method for sending notifications to the aria-live region for Accessibility.
12 | * Sending a notice when the page is loaded, as well as changing the page title
13 | * is considered best practice for making Single Page Applications Accessbible.
14 | */
15 |
16 | let validAriaLiveValues: string[] = ["off", "polite", "assertive"];
17 |
18 | export function announce(message: string, manner?: string): void {
19 | if (manner === undefined || validAriaLiveValues.indexOf(manner) === -1) {
20 | manner = "polite";
21 | }
22 |
23 | let params: {
24 | bubbles: boolean;
25 | detail: { message: string, manner: string };
26 | } = {
27 | "bubbles": true,
28 | "detail": { "message": message, "manner": manner }
29 | };
30 |
31 | let globalBodyElement: HTMLElement = document.getElementById("globalBody") as HTMLElement;
32 | globalBodyElement.dispatchEvent(new CustomEvent("announce", params));
33 | }
--------------------------------------------------------------------------------
/lib/tasks/migrate.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 config = require('../../config');
15 | const utils = require('../util/utils');
16 | const app = require('../scopes/app');
17 |
18 | /**
19 | * # Switch for 'migrate' task
20 | *
21 | * @public
22 | * @param {string} scope
23 | * @param {object} _options
24 | * @param {Array} [parameters] - Passed in just to show warning if present
25 | */
26 | module.exports = function (scope, parameters, _options) {
27 | const task = config.tasks.migrate.name;
28 | const scopes = config.tasks.migrate.scopes;
29 | utils.validateParametersCount(parameters, 0);
30 |
31 | switch (scope) {
32 | case undefined:
33 | case scopes.app.name: {
34 | utils.ensureJetApp();
35 | return app.migrate(_options);
36 | }
37 | default:
38 | utils.log.error(utils.toNotSupportedMessage(`${task} ${scope}`));
39 | return Promise.reject();
40 | }
41 | };
42 |
--------------------------------------------------------------------------------
/lib/tasks/restore.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 | 'use strict';
8 |
9 | /**
10 | * ## Dependencies
11 | */
12 | // Oracle
13 | const app = require('../scopes/app');
14 | const config = require('../../config');
15 | const utils = require('../util/utils');
16 |
17 | /**
18 | * # Switch for 'restore' task
19 | *
20 | * @public
21 | * @param {string} task
22 | * @param {string} [scope]
23 | * @param {Array} [parameters] - Passed in just to show warning if present
24 | * @param {Object} [options]
25 | */
26 | module.exports = function (task, scope, parameters, options) {
27 | if (!utils.ensureJetApp()) {
28 | return Promise.reject();
29 | }
30 | utils.validateParametersCount(parameters, 0);
31 | switch (scope) {
32 | case undefined:
33 | case config.tasks[task].scopes.app.name:
34 | return app.restore(options);
35 | default:
36 | utils.log.error(utils.toNotSupportedMessage(`${task} ${scope}`));
37 | return Promise.reject();
38 | }
39 | };
40 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/accUtils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014, 2018, Oracle and/or its affiliates.
4 | * The Universal Permissive License (UPL), Version 1.0
5 | */
6 | /*
7 | * Your application specific code will go here
8 | */
9 |
10 | /**
11 | * Method for sending notifications to the aria-live region for Accessibility.
12 | * Sending a notice when the page is loaded, as well as changing the page title
13 | * is considered best practice for making Single Page Applications Accessbible.
14 | */
15 |
16 | let validAriaLiveValues: string[] = ["off", "polite", "assertive"];
17 |
18 | export function announce(message: string, manner?: string): void {
19 | if (manner === undefined || validAriaLiveValues.indexOf(manner) === -1) {
20 | manner = "polite";
21 | }
22 |
23 | let params: {
24 | bubbles: boolean;
25 | detail: { message: string, manner: string };
26 | } = {
27 | "bubbles": true,
28 | "detail": { "message": message, "manner": manner }
29 | };
30 |
31 | let globalBodyElement: HTMLElement = document.getElementById("globalBody") as HTMLElement;
32 | globalBodyElement.dispatchEvent(new CustomEvent("announce", params));
33 | }
--------------------------------------------------------------------------------
/common/template/url.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 | 'use strict';
8 |
9 | const commonTemplateHandler = require('./common');
10 | const fs = require('fs-extra');
11 | const fetchZip = require('../../lib/util/fetchZip');
12 | const path = require('path');
13 |
14 | module.exports = {
15 |
16 | handle: function _handle(generator, template, destination) {
17 | const temp = path.resolve(`${generator.appDir}/temp`);
18 |
19 | return new Promise((resolve, reject) => {
20 | fetchZip(template)
21 | .then((values) => {
22 | _processFetchedTemplateZip(values, temp, destination);
23 | return resolve(generator);
24 | })
25 | .catch(err => reject(err));
26 | });
27 | }
28 | };
29 |
30 | function _processFetchedTemplateZip(fetchedTemplate, temp, destination) {
31 | fs.mkdirsSync(temp);
32 |
33 | commonTemplateHandler._handleZippedTemplateArchive(fetchedTemplate, destination);
34 |
35 | fs.copySync(temp, destination, { dereference: true });
36 | fs.removeSync(temp);
37 | }
38 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/viewModels/about.ts:
--------------------------------------------------------------------------------
1 | import * as AccUtils from "../accUtils";
2 | class AboutViewModel {
3 |
4 | constructor() {
5 |
6 | }
7 |
8 | /**
9 | * Optional ViewModel method invoked after the View is inserted into the
10 | * document DOM. The application can put logic that requires the DOM being
11 | * attached here.
12 | * This method might be called multiple times - after the View is created
13 | * and inserted into the DOM and after the View is reconnected
14 | * after being disconnected.
15 | */
16 | connected(): void {
17 | AccUtils.announce("About page loaded.");
18 | document.title = "About";
19 | // implement further logic if needed
20 | }
21 |
22 | /**
23 | * Optional ViewModel method invoked after the View is disconnected from the DOM.
24 | */
25 | disconnected(): void {
26 | // implement if needed
27 | }
28 |
29 | /**
30 | * Optional ViewModel method invoked after transition to the new View is complete.
31 | * That includes any possible animation between the old and the new View.
32 | */
33 | transitionCompleted(): void {
34 | // implement if needed
35 | }
36 | }
37 |
38 | export = AboutViewModel;
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/viewModels/about.ts:
--------------------------------------------------------------------------------
1 | import * as AccUtils from "../accUtils";
2 | class AboutViewModel {
3 |
4 | constructor() {
5 |
6 | }
7 |
8 | /**
9 | * Optional ViewModel method invoked after the View is inserted into the
10 | * document DOM. The application can put logic that requires the DOM being
11 | * attached here.
12 | * This method might be called multiple times - after the View is created
13 | * and inserted into the DOM and after the View is reconnected
14 | * after being disconnected.
15 | */
16 | connected(): void {
17 | AccUtils.announce("About page loaded.");
18 | document.title = "About";
19 | // implement further logic if needed
20 | }
21 |
22 | /**
23 | * Optional ViewModel method invoked after the View is disconnected from the DOM.
24 | */
25 | disconnected(): void {
26 | // implement if needed
27 | }
28 |
29 | /**
30 | * Optional ViewModel method invoked after transition to the new View is complete.
31 | * That includes any possible animation between the old and the new View.
32 | */
33 | transitionCompleted(): void {
34 | // implement if needed
35 | }
36 | }
37 |
38 | export = AboutViewModel;
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/viewModels/customers.ts:
--------------------------------------------------------------------------------
1 | import * as AccUtils from "../accUtils";
2 | class CustomersViewModel {
3 |
4 | constructor() {
5 |
6 | }
7 |
8 | /**
9 | * Optional ViewModel method invoked after the View is inserted into the
10 | * document DOM. The application can put logic that requires the DOM being
11 | * attached here.
12 | * This method might be called multiple times - after the View is created
13 | * and inserted into the DOM and after the View is reconnected
14 | * after being disconnected.
15 | */
16 | connected(): void {
17 | AccUtils.announce("Customers page loaded.");
18 | document.title = "Customers";
19 | // implement further logic if needed
20 | }
21 |
22 | /**
23 | * Optional ViewModel method invoked after the View is disconnected from the DOM.
24 | */
25 | disconnected(): void {
26 | // implement if needed
27 | }
28 |
29 | /**
30 | * Optional ViewModel method invoked after transition to the new View is complete.
31 | * That includes any possible animation between the old and the new View.
32 | */
33 | transitionCompleted(): void {
34 | // implement if needed
35 | }
36 | }
37 |
38 | export = CustomersViewModel;
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/viewModels/incidents.ts:
--------------------------------------------------------------------------------
1 | import * as AccUtils from "../accUtils";
2 | class IncidentsViewModel {
3 |
4 | constructor() {
5 |
6 | }
7 |
8 | /**
9 | * Optional ViewModel method invoked after the View is inserted into the
10 | * document DOM. The application can put logic that requires the DOM being
11 | * attached here.
12 | * This method might be called multiple times - after the View is created
13 | * and inserted into the DOM and after the View is reconnected
14 | * after being disconnected.
15 | */
16 | connected(): void {
17 | AccUtils.announce("Incidents page loaded.");
18 | document.title = "Incidents";
19 | // implement further logic if needed
20 | }
21 |
22 | /**
23 | * Optional ViewModel method invoked after the View is disconnected from the DOM.
24 | */
25 | disconnected(): void {
26 | // implement if needed
27 | }
28 |
29 | /**
30 | * Optional ViewModel method invoked after transition to the new View is complete.
31 | * That includes any possible animation between the old and the new View.
32 | */
33 | transitionCompleted(): void {
34 | // implement if needed
35 | }
36 | }
37 |
38 | export = IncidentsViewModel;
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/viewModels/customers.ts:
--------------------------------------------------------------------------------
1 | import * as AccUtils from "../accUtils";
2 | class CustomersViewModel {
3 |
4 | constructor() {
5 |
6 | }
7 |
8 | /**
9 | * Optional ViewModel method invoked after the View is inserted into the
10 | * document DOM. The application can put logic that requires the DOM being
11 | * attached here.
12 | * This method might be called multiple times - after the View is created
13 | * and inserted into the DOM and after the View is reconnected
14 | * after being disconnected.
15 | */
16 | connected(): void {
17 | AccUtils.announce("Customers page loaded.");
18 | document.title = "Customers";
19 | // implement further logic if needed
20 | }
21 |
22 | /**
23 | * Optional ViewModel method invoked after the View is disconnected from the DOM.
24 | */
25 | disconnected(): void {
26 | // implement if needed
27 | }
28 |
29 | /**
30 | * Optional ViewModel method invoked after transition to the new View is complete.
31 | * That includes any possible animation between the old and the new View.
32 | */
33 | transitionCompleted(): void {
34 | // implement if needed
35 | }
36 | }
37 |
38 | export = CustomersViewModel;
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/viewModels/incidents.ts:
--------------------------------------------------------------------------------
1 | import * as AccUtils from "../accUtils";
2 | class IncidentsViewModel {
3 |
4 | constructor() {
5 |
6 | }
7 |
8 | /**
9 | * Optional ViewModel method invoked after the View is inserted into the
10 | * document DOM. The application can put logic that requires the DOM being
11 | * attached here.
12 | * This method might be called multiple times - after the View is created
13 | * and inserted into the DOM and after the View is reconnected
14 | * after being disconnected.
15 | */
16 | connected(): void {
17 | AccUtils.announce("Incidents page loaded.");
18 | document.title = "Incidents";
19 | // implement further logic if needed
20 | }
21 |
22 | /**
23 | * Optional ViewModel method invoked after the View is disconnected from the DOM.
24 | */
25 | disconnected(): void {
26 | // implement if needed
27 | }
28 |
29 | /**
30 | * Optional ViewModel method invoked after transition to the new View is complete.
31 | * That includes any possible animation between the old and the new View.
32 | */
33 | transitionCompleted(): void {
34 | // implement if needed
35 | }
36 | }
37 |
38 | export = IncidentsViewModel;
--------------------------------------------------------------------------------
/lib/tasks/clean.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 | // Oracle
16 | const config = require('../../config');
17 | const constants = require('../util/constants');
18 | const utils = require('../util/utils');
19 |
20 | /**
21 | * # Invoked clean
22 | *
23 | * @public
24 | * @param {string} scope
25 | * @param {Array} [parameters]
26 | */
27 | module.exports = function (scope) {
28 | if (!utils.ensureJetApp()) {
29 | return Promise.reject();
30 | }
31 | // Oracle command libs
32 | let tooling;
33 | try {
34 | tooling = require(constants.ORACLEJET_TOOLING_PACKAGE_JSON_NAME); // eslint-disable-line
35 | } catch (e) {
36 | utils.log.error('Your JET project does not have oraclejet-tooling installed.');
37 | return Promise.reject();
38 | }
39 | switch (scope) {
40 | case config.tasks.clean.scopes.app.name:
41 | case undefined:
42 | default:
43 | return tooling.clean.platform();
44 | }
45 | };
46 |
--------------------------------------------------------------------------------
/test/miscTest.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 | 'use strict';
8 |
9 | const assert = require('assert');
10 | const util = require('./util');
11 |
12 | describe('ojet-cli', () => {
13 | it('should return ojet version', async () => {
14 | const result = await util.execCmd(`${util.OJET_COMMAND} --version`, { cwd: util.testDir });
15 | const version = util.getCliVersion();
16 | assert.equal(new RegExp(version).test(result.stdout), true, result.error);
17 | });
18 |
19 | it('should return help text', async () => {
20 | let result = await util.execCmd(`${util.OJET_COMMAND} --help`, { cwd: util.testDir });
21 | assert.equal(new RegExp('ojet ').test(result.stdout), true, result.error);
22 |
23 | result = await util.execCmd(`${util.OJET_COMMAND} add --help`, { cwd: util.testDir });
24 | assert.equal(new RegExp('ojet add ').test(result.stdout), true, result.error);
25 |
26 | result = await util.execCmd(`${util.OJET_COMMAND} add component --help`, { cwd: util.testDir });
27 | assert.equal(new RegExp('ojet add component commonComponent.checkThatAppExists)
29 | .then(() => commonComponent.validateComponentName(addComponent))
30 | .then(() => commonComponent.writeComponentTemplate(addComponent))
31 | .then(() => commonHookRunner.runAfterComponentCreateHook(
32 | { componentPath: commonComponent.getComponentDestPath(addComponent) }))
33 | .then(() => commonComponent.logSuccessMessage(addComponent))
34 | .catch((error) => {
35 | utils.log.error(error);
36 | return Promise.reject();
37 | });
38 | };
39 |
--------------------------------------------------------------------------------
/lib/tasks/strip.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 | // Node
15 | const fs = require('fs');
16 | const path = require('path');
17 | const constants = require('../util/constants');
18 |
19 | // Oracle
20 | const utils = require('../util/utils');
21 | /**
22 | * # Invoke 'strip' task
23 | *
24 | * @public
25 | * @param {Array} [parameters] - Passed in just to show warning if present
26 | */
27 | module.exports = function (parameters) {
28 | if (!utils.ensureJetApp()) {
29 | return Promise.reject();
30 | }
31 | utils.validateParametersCount(parameters, 0);
32 | const toolingPath = path.join(process.cwd(), constants.TOOLING_PATH);
33 | if (fs.existsSync(toolingPath)) {
34 | const tooling = require(toolingPath); // eslint-disable-line
35 | return tooling.strip();
36 | }
37 | try {
38 | // Use global install if available
39 | const tooling = require(constants.ORACLEJET_TOOLING_PACKAGE_JSON_NAME); // eslint-disable-line
40 | return tooling.strip();
41 | } catch (e) {
42 | // Don't error
43 | }
44 |
45 | utils.log.error('Your JET project has already had oraclejet-tooling removed.');
46 | return Promise.reject();
47 | };
48 |
--------------------------------------------------------------------------------
/common/template/local.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 | 'use strict';
8 |
9 | const commonTemplateHandler = require('./common');
10 | const fs = require('fs-extra');
11 | const path = require('path');
12 |
13 | module.exports = {
14 |
15 | handle: function _handle(generator, templatePath, destination) {
16 | return new Promise((resolve, reject) => {
17 | _copyLocalTemplate(templatePath, destination)
18 | .then(() => {
19 | resolve(generator);
20 | })
21 | .catch((err) => {
22 | reject(err);
23 | });
24 | });
25 | }
26 | };
27 |
28 | function _copyLocalTemplate(templatePath, destination) {
29 | try {
30 | if (fs.statSync(templatePath).isDirectory()) {
31 | const newTemplateFormat = fs.existsSync(path.join(templatePath, 'src'));
32 | fs.copySync(templatePath, newTemplateFormat ? path.join(destination, '..') : destination, { dereference: true });
33 | } else if (path.extname(templatePath) === '.zip') {
34 | commonTemplateHandler._handleZippedTemplateArchive(templatePath, destination);
35 | } else {
36 | throw new Error(`template path ${templatePath} is not valid`);
37 | }
38 | return Promise.resolve();
39 | } catch (err) {
40 | return Promise.reject(err);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/template/common/scripts/hooks/before_serve.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 | 'use strict';
9 |
10 | module.exports = function (configObj) {
11 | return new Promise((resolve, reject) => {
12 | console.log('Running before_serve hook.');
13 | // ojet custom connect and serve options
14 | // { connectOpts, serveOpts } = configObj;
15 | // const express = require('express');
16 | // const http = require('http');
17 | // pass back custom http
18 | // configObj['http'] = http;
19 | // pass back custom express app
20 | // configObj['express'] = express();
21 | // pass back custom options for http.createServer
22 | // const serverOptions = {...};
23 | // configObj['serverOptions'] = serverOptions;
24 | // pass back custom server
25 | // configObj['server'] = http.createServer(serverOptions, express());
26 | // const tinylr = require('tiny-lr');
27 | // pass back custom live reload server
28 | // configObj['liveReloadServer'] = tinylr({ port: PORT });
29 | // pass back a replacement set of middleware
30 | // configObj['middleware'] = [...];
31 | // pass back a set of middleware that goes before the default middleware
32 | // configObj['preMiddleware'] = [...];
33 | // pass back a set of middleware that goes after the default middleware
34 | // configObj['postMiddleware'] = [...];
35 | resolve(configObj);
36 | });
37 | };
38 |
--------------------------------------------------------------------------------
/lib/util/injectors.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 | 'use strict';
8 |
9 | function getInjectorTagsRegExp(starttag, endtag) {
10 | const start = escapeForRegExp(starttag);
11 | const end = escapeForRegExp(endtag);
12 | const startNoSpace = escapeForRegExp(starttag.replace(/\s/g, ''));
13 | const endNoSpace = escapeForRegExp(endtag.replace(/\s/g, ''));
14 | return new RegExp(`([\t ]*)(${start}|${startNoSpace})((\\n|\\r|.)*?)(${end}|${endNoSpace})`, 'gi');
15 | }
16 |
17 | function escapeForRegExp(str) {
18 | return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
19 | }
20 |
21 | function getLineEnding(content) {
22 | return /\r\n/.test(String(content)) ? '\r\n' : '\n';
23 | }
24 |
25 | function removeInjectorTokensContent({ content, pattern, eol, startTag, endTag }) {
26 | const injectResult = content.replace(pattern, () =>
27 | startTag + eol + endTag
28 | );
29 | return injectResult;
30 | }
31 |
32 | const scriptsInjector = {
33 | startTag: '',
34 | endTag: ''
35 | };
36 |
37 | const themeInjector = {
38 | startTag: '',
39 | endTag: ''
40 | };
41 |
42 | const fontInjector = {
43 | startTag: '',
44 | endTag: ''
45 | };
46 |
47 | module.exports = {
48 | getInjectorTagsRegExp,
49 | getLineEnding,
50 | removeInjectorTokensContent,
51 | scriptsInjector,
52 | themeInjector,
53 | fontInjector
54 | };
55 |
--------------------------------------------------------------------------------
/template/common/scripts/hooks/hooks.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "OJET-CLI hooks configuration file",
3 | "hooks": {
4 | "after_app_create": "scripts/hooks/after_app_create.js",
5 | "after_app_restore": "scripts/hooks/after_app_restore.js",
6 | "after_component_create": "scripts/hooks/after_component_create.js",
7 | "after_component_package": "scripts/hooks/after_component_package.js",
8 | "before_build": "scripts/hooks/before_build.js",
9 | "before_injection": "scripts/hooks/before_injection.js",
10 | "before_optimize": "scripts/hooks/before_optimize.js",
11 | "before_component_optimize": "scripts/hooks/before_component_optimize.js",
12 | "before_component_package": "scripts/hooks/before_component_package.js",
13 | "before_release": "scripts/hooks/before_release.js",
14 | "before_watch": "scripts/hooks/before_watch.js",
15 | "after_build": "scripts/hooks/after_build.js",
16 | "after_component_build": "scripts/hooks/after_component_build.js",
17 | "before_release_build": "scripts/hooks/before_release_build.js",
18 | "before_serve": "scripts/hooks/before_serve.js",
19 | "after_serve": "scripts/hooks/after_serve.js",
20 | "after_watch": "scripts/hooks/after_watch.js",
21 | "before_app_typescript": "scripts/hooks/before_app_typescript.js",
22 | "before_component_typescript": "scripts/hooks/before_component_typescript.js",
23 | "after_app_typescript": "scripts/hooks/after_app_typescript.js",
24 | "after_component_typescript": "scripts/hooks/after_component_typescript.js",
25 | "before_webpack": "scripts/hooks/before_webpack.js"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/hooks.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "OJET-CLI hooks configuration file",
3 | "hooks": {
4 | "after_app_create": "scripts/hooks/after_app_create.js",
5 | "after_app_restore": "scripts/hooks/after_app_restore.js",
6 | "after_component_create": "scripts/hooks/after_component_create.js",
7 | "after_component_package": "scripts/hooks/after_component_package.js",
8 | "before_build": "scripts/hooks/before_build.js",
9 | "before_injection": "scripts/hooks/before_injection.js",
10 | "before_optimize": "scripts/hooks/before_optimize.js",
11 | "before_component_optimize": "scripts/hooks/before_component_optimize.js",
12 | "before_component_package": "scripts/hooks/before_component_package.js",
13 | "before_release": "scripts/hooks/before_release.js",
14 | "before_watch": "scripts/hooks/before_watch.js",
15 | "after_build": "scripts/hooks/after_build.js",
16 | "after_component_build": "scripts/hooks/after_component_build.js",
17 | "before_release_build": "scripts/hooks/before_release_build.js",
18 | "before_serve": "scripts/hooks/before_serve.js",
19 | "after_serve": "scripts/hooks/after_serve.js",
20 | "after_watch": "scripts/hooks/after_watch.js",
21 | "before_app_typescript": "scripts/hooks/before_app_typescript.js",
22 | "before_component_typescript": "scripts/hooks/before_component_typescript.js",
23 | "after_app_typescript": "scripts/hooks/after_app_typescript.js",
24 | "after_component_typescript": "scripts/hooks/after_component_typescript.js",
25 | "before_webpack": "scripts/hooks/before_webpack.js"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/template/common/oraclejetconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "paths": {
3 | "source": {
4 | "common": "src",
5 | "web": "src-web",
6 | "javascript": "js",
7 | "typescript": "ts",
8 | "styles": "css",
9 | "themes": "themes"
10 | },
11 |
12 | "staging": {
13 | "web": "web",
14 | "themes": "staged-themes"
15 | }
16 | },
17 | "unversioned": true,
18 | "generateSourceMaps": false,
19 | "defaultBrowser": "chrome",
20 | "sassVer": "1.80.5",
21 | "defaultTheme": "redwood",
22 | "fontUrl": "https://static.oracle.com/cdn/fnd/gallery/2404.0.0/images/iconfont/ojuxIconFont.min.css",
23 | "typescriptLibraries": "typescript@5.8.3 yargs-parser@~13.1.2",
24 | "jsdocLibraries": "jsdoc@3.5.5",
25 | "translationIcuLibraries": "@oracle/oraclejet-icu-l10n",
26 | "webpackLibraries": "webpack@5.76.0 @types/node@18.16.3 webpack-dev-server style-loader css-loader sass-loader sass ts-loader@8.4.0 raw-loader noop-loader html-webpack-plugin html-replace-webpack-plugin copy-webpack-plugin @prefresh/webpack @prefresh/babel-plugin webpack-merge compression-webpack-plugin mini-css-extract-plugin clean-webpack-plugin css-fix-url-loader",
27 | "mochaTestingLibraries": "karma mocha sinon chai@4.5.0 coverage karma-chai@0.1.0 karma-coverage@2.2.0 karma-chrome-launcher@3.1.1 karma-mocha@2.0.1 karma-mocha-reporter@2.2.5 karma-requirejs@1.1.0 karma-fixture@0.2.6 karma-sinon@1.0.5 karma-typescript@5.5.4 @types/chai@4.3.4 @types/karma-fixture@0.2.5 @types/mocha@10.0.1 @types/sinon@10.0.13",
28 | "jestTestingLibraries": "jest@29.6.2 @testing-library/preact@3.2.3 @types/jest@29.5.3 jest-environment-jsdom@29.6.2 regenerator-runtime@^0.13.9 @oracle/oraclejet-jest-preset@~19.0.0"
29 | }
30 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/hooks.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "OJET-CLI hooks configuration file",
3 | "hooks": {
4 | "after_app_create": "scripts/hooks/after_app_create.js",
5 | "after_app_restore": "scripts/hooks/after_app_restore.js",
6 | "after_component_create": "scripts/hooks/after_component_create.js",
7 | "after_component_package": "scripts/hooks/after_component_package.js",
8 | "before_build": "scripts/hooks/before_build.js",
9 | "before_injection": "scripts/hooks/before_injection.js",
10 | "before_optimize": "scripts/hooks/before_optimize.js",
11 | "before_component_optimize": "scripts/hooks/before_component_optimize.js",
12 | "before_component_package": "scripts/hooks/before_component_package.js",
13 | "before_release": "scripts/hooks/before_release.js",
14 | "before_watch": "scripts/hooks/before_watch.js",
15 | "after_build": "scripts/hooks/after_build.js",
16 | "after_component_build": "scripts/hooks/after_component_build.js",
17 | "before_release_build": "scripts/hooks/before_release_build.js",
18 | "before_serve": "scripts/hooks/before_serve.js",
19 | "after_serve": "scripts/hooks/after_serve.js",
20 | "after_watch": "scripts/hooks/after_watch.js",
21 | "before_app_typescript": "scripts/hooks/before_app_typescript.js",
22 | "before_component_typescript": "scripts/hooks/before_component_typescript.js",
23 | "after_app_typescript": "scripts/hooks/after_app_typescript.js",
24 | "after_component_typescript": "scripts/hooks/after_component_typescript.js",
25 | "before_webpack": "scripts/hooks/before_webpack.js"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/hooks.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "OJET-CLI hooks configuration file",
3 | "hooks": {
4 | "after_app_create": "scripts/hooks/after_app_create.js",
5 | "after_app_restore": "scripts/hooks/after_app_restore.js",
6 | "after_component_create": "scripts/hooks/after_component_create.js",
7 | "after_component_package": "scripts/hooks/after_component_package.js",
8 | "before_build": "scripts/hooks/before_build.js",
9 | "before_injection": "scripts/hooks/before_injection.js",
10 | "before_optimize": "scripts/hooks/before_optimize.js",
11 | "before_component_optimize": "scripts/hooks/before_component_optimize.js",
12 | "before_component_package": "scripts/hooks/before_component_package.js",
13 | "before_release": "scripts/hooks/before_release.js",
14 | "before_watch": "scripts/hooks/before_watch.js",
15 | "after_build": "scripts/hooks/after_build.js",
16 | "after_component_build": "scripts/hooks/after_component_build.js",
17 | "before_release_build": "scripts/hooks/before_release_build.js",
18 | "before_serve": "scripts/hooks/before_serve.js",
19 | "after_serve": "scripts/hooks/after_serve.js",
20 | "after_watch": "scripts/hooks/after_watch.js",
21 | "before_app_typescript": "scripts/hooks/before_app_typescript.js",
22 | "before_component_typescript": "scripts/hooks/before_component_typescript.js",
23 | "after_app_typescript": "scripts/hooks/after_app_typescript.js",
24 | "after_component_typescript": "scripts/hooks/after_component_typescript.js",
25 | "before_webpack": "scripts/hooks/before_webpack.js"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/scripts/hooks/before_serve.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | // ojet custom connect and serve options
19 | // { connectOpts, serveOpts } = configObj;
20 | // const express = require('express');
21 | // const http = require('http');
22 | // pass back custom http
23 | // configObj['http'] = http;
24 | // pass back custom express app
25 | // configObj['express'] = express();
26 | // pass back custom options for http.createServer
27 | // const serverOptions = {...};
28 | // configObj['serverOptions'] = serverOptions;
29 | // pass back custom server
30 | // configObj['server'] = http.createServer(serverOptions, express());
31 | // const tinylr = require('tiny-lr');
32 | // pass back custom live reload server
33 | // configObj['liveReloadServer'] = tinylr({ port: PORT });
34 | // pass back a replacement set of middleware
35 | // configObj['middleware'] = [...];
36 | // pass back a set of middleware that goes before the default middleware
37 | // configObj['preMiddleware'] = [...];
38 | // pass back a set of middleware that goes after the default middleware
39 | // configObj['postMiddleware'] = [...];
40 | resolve(configObj);
41 | });
42 | };
43 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/scripts/hooks/before_serve.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 | Copyright (c) 2015, 2020, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | // ojet custom connect and serve options
19 | // { connectOpts, serveOpts } = configObj;
20 | // const express = require('express');
21 | // const http = require('http');
22 | // pass back custom http
23 | // configObj['http'] = http;
24 | // pass back custom express app
25 | // configObj['express'] = express();
26 | // pass back custom options for http.createServer
27 | // const serverOptions = {...};
28 | // configObj['serverOptions'] = serverOptions;
29 | // pass back custom server
30 | // configObj['server'] = http.createServer(serverOptions, express());
31 | // const tinylr = require('tiny-lr');
32 | // pass back custom live reload server
33 | // configObj['liveReloadServer'] = tinylr({ port: PORT });
34 | // pass back a replacement set of middleware
35 | // configObj['middleware'] = [...];
36 | // pass back a set of middleware that goes before the default middleware
37 | // configObj['preMiddleware'] = [...];
38 | // pass back a set of middleware that goes after the default middleware
39 | // configObj['postMiddleware'] = [...];
40 | resolve(configObj);
41 | });
42 | };
43 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/scripts/hooks/before_serve.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 | Copyright (c) 2015, 2021, Oracle and/or its affiliates.
9 | Licensed under The Universal Permissive License (UPL), Version 1.0
10 | as shown at https://oss.oracle.com/licenses/upl/
11 |
12 | */
13 |
14 | 'use strict';
15 |
16 | module.exports = function (configObj) {
17 | return new Promise((resolve, reject) => {
18 | console.log('Running before_serve hook.');
19 | // ojet custom connect and serve options
20 | // { connectOpts, serveOpts } = configObj;
21 | // const express = require('express');
22 | // const http = require('http');
23 | // pass back custom http
24 | // configObj['http'] = http;
25 | // pass back custom express app
26 | // configObj['express'] = express();
27 | // pass back custom options for http.createServer
28 | // const serverOptions = {...};
29 | // configObj['serverOptions'] = serverOptions;
30 | // pass back custom server
31 | // configObj['server'] = http.createServer(serverOptions, express());
32 | // const tinylr = require('tiny-lr');
33 | // pass back custom live reload server
34 | // configObj['liveReloadServer'] = tinylr({ port: PORT });
35 | // pass back a replacement set of middleware
36 | // configObj['middleware'] = [...];
37 | // pass back a set of middleware that goes before the default middleware
38 | // configObj['preMiddleware'] = [...];
39 | // pass back a set of middleware that goes after the default middleware
40 | // configObj['postMiddleware'] = [...];
41 | resolve(configObj);
42 | });
43 | };
44 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/src/components/footer.tsx:
--------------------------------------------------------------------------------
1 | import { h } from "preact";
2 |
3 | type Props = {
4 | links?: FooterLink[]
5 | }
6 |
7 | type FooterLink = {
8 | name: string;
9 | linkId: string;
10 | linkTarget: string;
11 | }
12 |
13 | const _DEFAULT_LINKS: FooterLink[] = [
14 | {
15 | name: "About Oracle",
16 | linkId: "aboutOracle",
17 | linkTarget: "http://www.oracle.com/us/corporate/index.html#menu-about"
18 | },
19 | {
20 | name: "Contact Us",
21 | linkId: "contactUs",
22 | linkTarget: "http://www.oracle.com/us/corporate/contact/index.html"
23 | },
24 | {
25 | name: "Legal Notices",
26 | linkId: "legalNotices",
27 | linkTarget: "http://www.oracle.com/us/legal/index.html"
28 | },
29 | {
30 | name: "Terms Of Use",
31 | linkId: "termsOfUse",
32 | linkTarget: "http://www.oracle.com/us/legal/terms/index.html"
33 | },
34 | {
35 | name: "Your Privacy Rights",
36 | linkId: "yourPrivacyRights",
37 | linkTarget: "http://www.oracle.com/us/legal/privacy/index.html"
38 | }
39 | ]
40 |
41 | export function Footer({ links = _DEFAULT_LINKS } : Props ) {
42 | return (
43 |
59 | );
60 | }
61 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/tasks/label.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 config = require('../../config');
15 | const utils = require('../util/utils');
16 |
17 | /**
18 | * # Switch for 'label' task
19 | *
20 | * @public
21 | * @param {string} scope
22 | * @param {Array} [parameters]
23 | */
24 | module.exports = function (scope, parameters, options) {
25 | const task = config.tasks.list.name;
26 | const scopes = config.tasks.list.scopes;
27 | const parameter = parameters[0];
28 |
29 | /*
30 | The command structure for labeling components:
31 | 1. ojet label component componentName@
32 | 2. ojet label pack packName@
33 |
34 | The parameter array becomes: [componentName@, labelName].
35 | Hence, to propagate the label value into the exchange method
36 | handling the labeling task, we add it into the options object.
37 | */
38 | if (parameters[1]) {
39 | // eslint-disable-next-line no-param-reassign
40 | options.label = parameters[1];
41 | } else {
42 | utils.log.error('Provide the label name and then try again. Run \'ojet label --help\' for more info.');
43 | return Promise.reject();
44 | }
45 |
46 | switch (scope) {
47 | case scopes.component.name:
48 | case scopes.pack.name: {
49 | utils.ensureJetApp();
50 | const tooling = utils.loadTooling();
51 | return tooling.label(scope, parameter, options);
52 | }
53 | case undefined:
54 | utils.log.error(utils.toMissingInputMessage(`${task}`));
55 | return Promise.reject();
56 | default:
57 | utils.log.error(utils.toNotSupportedMessage(`${task} ${scope}`));
58 | return Promise.reject();
59 | }
60 | };
61 |
--------------------------------------------------------------------------------
/template/component/js/@component@-viewModel.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 | 'use strict';
8 | define(
9 | ['knockout', 'ojL10n!./resources/nls/@component-name@-strings', 'ojs/ojcontext', 'ojs/ojknockout'], function (ko, componentStrings, Context) {
10 |
11 | function ExampleComponentModel(context) {
12 | var self = this;
13 |
14 | //At the start of your viewModel constructor
15 | var busyContext = Context.getContext(context.element).getBusyContext();
16 | var options = {"description": "Web Component Startup - Waiting for data"};
17 | self.busyResolve = busyContext.addBusyState(options);
18 |
19 | self.composite = context.element;
20 |
21 | //Example observable
22 | self.messageText = ko.observable('Hello from @full-component-name@');
23 | self.properties = context.properties;
24 | self.res = componentStrings['@component-name@'];
25 | // Example for parsing context properties
26 | // if (context.properties.name) {
27 | // parse the context properties here
28 | // }
29 |
30 | //Once all startup and async activities have finished, relocate if there are any async activities
31 | self.busyResolve();
32 | };
33 |
34 | //Lifecycle methods - uncomment and implement if necessary
35 | //ExampleComponentModel.prototype.activated = function(context){
36 | //};
37 |
38 | //ExampleComponentModel.prototype.connected = function(context){
39 | //};
40 |
41 | //ExampleComponentModel.prototype.bindingsApplied = function(context){
42 | //};
43 |
44 | //ExampleComponentModel.prototype.disconnected = function(context){
45 | //};
46 |
47 | //ExampleComponentModel.prototype.propertyChanged = function(context){
48 | //};
49 |
50 | return ExampleComponentModel;
51 | });
52 |
--------------------------------------------------------------------------------
/lib/tasks/publish.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 config = require('../../config');
15 | const utils = require('../util/utils');
16 |
17 | /**
18 | * # Switch for 'publish' task
19 | *
20 | * @public
21 | * @param {string} task
22 | * @param {string} scope
23 | * @param {Array} parameters
24 | * @param {Object} [options]
25 | */
26 | module.exports = function (task, scope, parameters, options) {
27 | utils.validateParametersCount(parameters, 1);
28 | if (utils.isWebpackApp()) {
29 | utils.log.error('Publishing components or packs is not supported in a Webpack-managed project. Switch to a non-Webpack projects to publish components and packs.');
30 | return Promise.reject();
31 | }
32 | const parameter = parameters[0];
33 |
34 | switch (scope) {
35 | case config.tasks[task].scopes.component.name:
36 | if (!utils.hasProperty(options, 'path')) {
37 | utils.ensureParameters(parameter);
38 | }
39 | utils.ensureJetApp();
40 | return runTooling(scope, parameter, options);
41 | case config.tasks[task].scopes.pack.name: {
42 | utils.ensureParameters(parameter);
43 | utils.ensureJetApp();
44 | return runTooling(scope, parameter, options);
45 | }
46 | case undefined:
47 | if (utils.hasProperty(options, 'path')) {
48 | return runTooling(scope, parameter, options);
49 | }
50 | utils.log.error(utils.toMissingInputMessage(`${task}`));
51 | break;
52 | default:
53 | utils.log.error(utils.toNotSupportedMessage(`${config.tasks[task].name} ${scope}`));
54 | }
55 | return false;
56 | };
57 |
58 | function runTooling(scope, parameter, options) {
59 | const tooling = utils.loadTooling();
60 | return tooling.publish(scope, parameter, options);
61 | }
62 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | # ojet-cli
2 |
3 | Copyright (c) 2025 Oracle and/or its affiliates.
4 |
5 | Licensed under The Universal Permissive License (UPL), Version 1.0
6 | as shown at https://oss.oracle.com/licenses/upl/
7 |
8 | Subject to the condition set forth below, permission is hereby granted to any
9 | person obtaining a copy of this software, associated documentation and/or data
10 | (collectively the "Software"), free of charge and under any and all copyright
11 | rights in the Software, and any and all patent rights owned or freely
12 | licensable by each licensor hereunder covering either (i) the unmodified
13 | Software as contributed to or provided by such licensor, or (ii) the Larger
14 | Works (as defined below), to deal in both
15 |
16 | (a) the Software, and
17 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18 | one is included with the Software (each a "Larger Work" to which the Software
19 | is contributed by such licensors),
20 |
21 | without restriction, including without limitation the rights to copy, create
22 | derivative works of, display, perform, and distribute the Software and make,
23 | use, sell, offer for sale, import, export, have made, and have sold the
24 | Software and the Larger Work(s), and to sublicense the foregoing rights on
25 | either these or other terms.
26 |
27 | This license is subject to the following condition:
28 | The above copyright notice and either this complete permission notice or at
29 | a minimum a reference to the UPL must be included in all copies or
30 | substantial portions of the Software.
31 |
32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38 | SOFTWARE.
--------------------------------------------------------------------------------
/lib/tasks/build.serve.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 | 'use strict';
8 |
9 | /**
10 | * ## Dependencies
11 | */
12 | const app = require('../scopes/app');
13 | const config = require('../../config');
14 | const utils = require('../util/utils');
15 | const constants = require('../util/constants');
16 |
17 | /**
18 | * # Switch for 'build' and 'serve' tasks
19 | *
20 | * @public
21 | * @param {string} task
22 | * @param {string} [scope]
23 | * @param {Array} [parameters]
24 | * @param {Object} [options]
25 | */
26 | module.exports = function (task, scope, parameters, options) {
27 | if (!utils.ensureJetApp()) {
28 | return Promise.reject();
29 | }
30 | utils.validateParametersCount(parameters, 1);
31 | const parameter = parameters[0];
32 | switch (scope) {
33 | // ojet (build|serve) (component|pack)
34 | case config.tasks.build.scopes.component.name:
35 | case config.tasks.build.scopes.pack.name:
36 | if (utils.isWebpackApp()) {
37 | utils.log.error('Building components or packs is not supported in a Webpack-managed project. To build components and packs, please switch to a non-Webpack project');
38 | return Promise.reject();
39 | }
40 | return app.runTooling(task, scope, undefined, { ...options, component: parameter });
41 | // ojet (build|serve) (app|undefined)
42 | case config.tasks.build.scopes.app.name:
43 | case config.tasks.serve.scopes.app.name:
44 | case undefined:
45 | return app.runTooling(task, scope, parameter, options);
46 | default:
47 | if (constants.SUPPORTED_PLATFORMS.indexOf(scope) > -1) {
48 | // ojet (build|serve) (web|ios|android|windows)
49 | return app.runTooling(task, scope, parameter, options);
50 | }
51 | utils.log.error(`Invalid platform ${scope}`);
52 | return Promise.reject();
53 | }
54 | };
55 |
--------------------------------------------------------------------------------
/common/messages.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 | 'use strict';
8 |
9 | module.exports =
10 | {
11 | error: function _error(error, task) {
12 | return _getError(error, task);
13 | },
14 |
15 | prefixError: function _prefixError(error) {
16 | return _getPrefixError(error);
17 | },
18 |
19 | scaffoldComplete: function _scaffoldComplete() {
20 | return _getScaffoldComplete();
21 | },
22 |
23 | restoreComplete: function _restoreComplete(invokedByRestore, appDir) {
24 | return _getRestoreComplete(invokedByRestore, appDir);
25 | },
26 |
27 | appendJETPrefix: function _appendJETPrefix(message) {
28 | return _appendSuccessPrefix(message || '');
29 | }
30 | };
31 |
32 | function _getScaffoldComplete() {
33 | return _appendSuccessPrefix('Your app structure is generated. Continuing with library install.');
34 | }
35 |
36 | function _getRestoreComplete(invokedByRestore, appDir) {
37 | if (invokedByRestore) {
38 | return _appendSuccessPrefix('Your app restore finished successfully.');
39 | }
40 | return _appendSuccessPrefix(`Your app is ready! Change to your new app directory '${appDir}' and try 'ojet build' and 'ojet serve'.`);
41 | }
42 |
43 | function _getPrefixError(error) {
44 | if (error !== null && typeof error === 'object') {
45 | const newErr = Object.assign({}, error);
46 | newErr.message = _appendErrorPrefix(error.message);
47 | return newErr;
48 | }
49 |
50 | return _appendErrorPrefix(error);
51 | }
52 |
53 | function _getError(error, task) {
54 | const taskName = task ? `(during ${task}) ` : '';
55 | if (error !== null && typeof error === 'object') {
56 | const newErr = Object.assign({}, error);
57 | newErr.message = taskName + error.message;
58 | return newErr;
59 | }
60 |
61 | return taskName + error;
62 | }
63 |
64 | function _appendSuccessPrefix(message) {
65 | return `${message}`;
66 | }
67 |
68 | function _appendErrorPrefix(message) {
69 | return `${message}`;
70 | }
71 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/src/main.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 | * @license
9 | * Copyright (c) 2014, 2021, Oracle and/or its affiliates.
10 | * Licensed under The Universal Permissive License (UPL), Version 1.0
11 | * as shown at https://oss.oracle.com/licenses/upl/
12 | * @ignore
13 | */
14 | 'use strict';
15 |
16 | /**
17 | * Example of Require.js boostrap javascript
18 | */
19 |
20 |
21 | (function () {
22 | requirejs.config(
23 | {
24 | // injector:baseUrl
25 | baseUrl: '.',
26 | // endinjector
27 | paths:
28 | /* DO NOT MODIFY
29 | ** All paths are dynamicaly generated from the path_mappings.json file.
30 | ** Add any new library dependencies in path_mappings json file
31 | */
32 | // injector:mainReleasePaths
33 | {
34 | 'ojs': 'libs/oj/19.0.0/debug',
35 | 'ojL10n': 'libs/oj/19.0.0/ojL10n',
36 | 'ojtranslations': 'libs/oj/19.0.0/resources',
37 | 'knockout': 'libs/knockout/knockout-3.5.1.debug',
38 | 'jquery': 'libs/jquery/jquery-3.7.1',
39 | 'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.14.1',
40 | 'text': 'libs/require/text',
41 | 'hammerjs': 'libs/hammer/hammer-2.0.8',
42 | 'signals': 'libs/js-signals/signals',
43 | 'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.2',
44 | 'css': 'libs/require-css/css.min',
45 | 'css-builder': 'libs/require-css/css-builder',
46 | 'normalize': 'libs/require-css/normalize',
47 | '@oracle/oraclejet-preact': 'libs/oraclejet-preact/amd',
48 | 'preact': 'libs/preact/dist/preact.umd',
49 | 'preact/hooks': 'libs/preact/hooks/dist/hooks.umd',
50 | 'proj4': 'libs/proj4js/dist/proj4-src',
51 | 'touchr': 'libs/touchr/touchr'
52 | ,
53 | 'chai': 'libs/chai/chai-4.3.6'
54 | }
55 | // endinjector
56 | }
57 | );
58 | }());
59 |
60 | /**
61 | * Load the application's entry point file
62 | */
63 | require(['./index']);
64 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/js/main.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 | * @license
9 | * Copyright (c) 2014, 2020, Oracle and/or its affiliates.
10 | * Licensed under The Universal Permissive License (UPL), Version 1.0
11 | * as shown at https://oss.oracle.com/licenses/upl/
12 | * @ignore
13 | */
14 | 'use strict';
15 |
16 | /**
17 | * Example of Require.js boostrap javascript
18 | */
19 |
20 | (function () {
21 |
22 | requirejs.config(
23 | {
24 | baseUrl: 'js',
25 |
26 | paths:
27 | /* DO NOT MODIFY
28 | ** All paths are dynamicaly generated from the path_mappings.json file.
29 | ** Add any new library dependencies in path_mappings json file
30 | */
31 | // injector:mainReleasePaths
32 | {
33 | 'knockout': 'libs/knockout/knockout-3.5.1.debug',
34 | 'jquery': 'libs/jquery/jquery-3.5.1',
35 | 'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.14.1',
36 | 'hammerjs': 'libs/hammer/hammer-2.0.8',
37 | 'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.2',
38 | 'ojs': 'libs/oj/19.0.0/debug',
39 | 'ojL10n': 'libs/oj/19.0.0/ojL10n',
40 | 'ojtranslations': 'libs/oj/19.0.0/resources',
41 | 'text': 'libs/require/text',
42 | 'signals': 'libs/js-signals/signals',
43 | 'customElements': 'libs/webcomponents/custom-elements.min',
44 | 'proj4': 'libs/proj4js/dist/proj4-src',
45 | 'css': 'libs/require-css/css',
46 | 'touchr': 'libs/touchr/touchr',
47 | 'corejs' : 'libs/corejs/shim',
48 | 'chai': 'libs/chai/chai-4.3.6',
49 | 'regenerator-runtime' : 'libs/regenerator-runtime/runtime'
50 | }
51 | // endinjector
52 | }
53 | );
54 | }());
55 |
56 | require(['ojs/ojbootstrap', 'root'], function (Bootstrap, Root) {
57 | // this callback gets executed when all required modules are loaded
58 | Bootstrap.whenDocumentReady().then(function(){
59 | Root.init();
60 | });
61 | });
62 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/js/main.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 | * @license
9 | * Copyright (c) 2014, 2020, Oracle and/or its affiliates.
10 | * Licensed under The Universal Permissive License (UPL), Version 1.0
11 | * as shown at https://oss.oracle.com/licenses/upl/
12 | * @ignore
13 | */
14 | 'use strict';
15 |
16 | /**
17 | * Example of Require.js boostrap javascript
18 | */
19 |
20 | (function () {
21 |
22 | requirejs.config(
23 | {
24 | baseUrl: 'js',
25 |
26 | paths:
27 | /* DO NOT MODIFY
28 | ** All paths are dynamicaly generated from the path_mappings.json file.
29 | ** Add any new library dependencies in path_mappings json file
30 | */
31 | // injector:mainReleasePaths
32 | {
33 | 'knockout': 'libs/knockout/knockout-3.5.1.debug',
34 | 'jquery': 'libs/jquery/jquery-3.5.1',
35 | 'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.14.1',
36 | 'hammerjs': 'libs/hammer/hammer-2.0.8',
37 | 'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.2',
38 | 'ojs': 'libs/oj/19.0.0/debug',
39 | 'ojL10n': 'libs/oj/19.0.0/ojL10n',
40 | 'ojtranslations': 'libs/oj/19.0.0/resources',
41 | 'text': 'libs/require/text',
42 | 'signals': 'libs/js-signals/signals',
43 | 'customElements': 'libs/webcomponents/custom-elements.min',
44 | 'proj4': 'libs/proj4js/dist/proj4-src',
45 | 'css': 'libs/require-css/css',
46 | 'touchr': 'libs/touchr/touchr',
47 | 'corejs' : 'libs/corejs/shim',
48 | 'chai': 'libs/chai/chai-4.3.6',
49 | 'regenerator-runtime' : 'libs/regenerator-runtime/runtime'
50 | }
51 | // endinjector
52 | }
53 | );
54 | }());
55 |
56 | require(['ojs/ojbootstrap', 'root'], function (Bootstrap, Root) {
57 | // this callback gets executed when all required modules are loaded
58 | Bootstrap.whenDocumentReady().then(function(){
59 | Root.init();
60 | });
61 | });
62 |
--------------------------------------------------------------------------------
/lib/tasks/package.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 config = require('../../config');
15 | const utils = require('../util/utils');
16 | /**
17 | * # Package
18 | *
19 | * @param task
20 | * @param scope
21 | * @param parameters
22 | * @param options?
23 | */
24 | class Package {
25 | constructor(task, scope, parameters, options) {
26 | this.task = task;
27 | this.scope = scope;
28 | this.parameters = parameters;
29 | this.options = options;
30 | }
31 | package() {
32 | switch (this.scope) {
33 | case config.tasks[this.task].scopes.component.name:
34 | case config.tasks[this.task].scopes.pack.name: {
35 | utils.ensureParameters(this.parameters);
36 | utils.ensureJetApp();
37 | if (utils.isWebpackApp()) {
38 | utils.log.error('Packaging components or packs is not supported in a Webpack-based project. Switch to a non-Webpack projects to package components and packs.');
39 | return Promise.reject();
40 | }
41 | // Fix to force css build doing pack that leads to a build
42 | this.options.themes = utils.validateThemes(this.options);
43 | this.options.sassCompile = (this.options.nosass) ? false :
44 | this.options.sass || (this.options.sass === undefined);
45 | this.options.pcssCompile = (!this.options.sassCompile) ? false : this.options.pcss || true;
46 |
47 | const tooling = utils.loadTooling();
48 | return tooling.package(this.scope, this.parameters, this.options);
49 | }
50 | case undefined:
51 | utils.log.error(utils.toMissingInputMessage(`${this.task}`));
52 | return Promise.reject();
53 | default:
54 | utils.log.error(utils.toNotSupportedMessage(`${config.tasks[this.task].name} ${this.scope}`));
55 | return Promise.reject();
56 | }
57 | }
58 | }
59 | module.exports = Package;
60 |
--------------------------------------------------------------------------------
/lib/tooling/build.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 | 'use strict';
8 |
9 | /*
10 | * Options and Arguments processing before Invoking tooling APIs
11 | */
12 | const utils = require('../util/utils');
13 | const constants = require('../util/constants');
14 |
15 | module.exports = function (platform, options) {
16 | utils.validateOptions(options, 'build');
17 | const buildOptions = options || {};
18 |
19 | // Need to skip for build pack
20 | if (platform !== 'pack') {
21 | buildOptions.platform = 'web';
22 | buildOptions.theme = options.theme;
23 | buildOptions.themes = utils.validateThemes(options);
24 | buildOptions.nosass = options.nosass;
25 | buildOptions.sassCompile = (options.nosass) ? false :
26 | options.sass || (options.sass === undefined);
27 | buildOptions.pcssCompile = (!buildOptions.sassCompile) ? false : options.pcss || true;
28 | buildOptions.svg = options.svg;
29 | }
30 |
31 | // Enable ---optimize for component builds.
32 | buildOptions.buildType = options.release ? 'release' : 'dev';
33 | buildOptions.optimize = options.optimize;
34 |
35 | // pass on any user-options
36 | buildOptions.userOptions = options['user-options'];
37 |
38 | // pass on notscompile flag
39 | buildOptions.notscompile = options.notscompile;
40 |
41 | // pass on dbg flsg
42 | buildOptions.dbg = options.dbg;
43 |
44 | // pass on no-optimize-flag
45 | // eslint-disable-next-line max-len
46 | buildOptions[constants.OMIT_COMPONENT_VERSION_FLAG] = options[constants.OMIT_COMPONENT_VERSION_FLAG];
47 |
48 | // do not pass buildOptions.sass down because it will override
49 | // defaultconfig.build.sass during the options merge process
50 | delete buildOptions.sass;
51 |
52 | const tooling = utils.loadTooling();
53 | return tooling.build(buildOptions.platform, buildOptions)
54 | .then(() => {
55 | utils.log.success('Build finished.');
56 | })
57 | .catch((error) => {
58 | utils.log.error(error);
59 | return Promise.reject();
60 | });
61 | };
62 |
63 |
--------------------------------------------------------------------------------
/common/restore.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 | 'use strict';
8 |
9 | const execSync = require('child_process').execSync;
10 | const fs = require('fs-extra');
11 | const path = require('path');
12 | const commonMessages = require('./messages');
13 | const constants = require('../lib/util/constants');
14 | const utils = require('../lib/util/utils');
15 |
16 | module.exports =
17 | {
18 | writeOracleJetConfigFile: function _writeOracleJetConfigFile() {
19 | const destinationRoot = path.resolve('.');
20 | const configPath = path.resolve(destinationRoot, constants.APP_CONFIG_JSON);
21 | let configJson;
22 | if (!fs.existsSync(configPath)) {
23 | utils.log(`${commonMessages.appendJETPrefix()}No ${constants.APP_CONFIG_JSON}, writing default`);
24 | configJson = utils.readJsonAndReturnObject(path.join(
25 | __dirname,
26 | '../../template/common',
27 | constants.APP_CONFIG_JSON
28 | ));
29 | } else {
30 | utils.log(`${commonMessages.appendJETPrefix() + constants.APP_CONFIG_JSON} file exists`);
31 | configJson = utils.readJsonAndReturnObject(configPath);
32 | }
33 | fs.writeFileSync(configPath, JSON.stringify(configJson, null, 2));
34 | return Promise.resolve();
35 | },
36 |
37 | npmInstall: function _npmInstall(app, opt) {
38 | const installer = utils.getInstallerCommand(opt);
39 | const configPath = path.join(process.cwd(), constants.APP_CONFIG_JSON);
40 | let configJson;
41 |
42 | if (fs.existsSync(configPath)) {
43 | configJson = utils.readJsonAndReturnObject(configPath);
44 | }
45 |
46 | const { enableLegacyPeerDeps } = configJson || {};
47 |
48 | let command = `${installer.installer} ${installer.verbs.install}`;
49 |
50 | if (enableLegacyPeerDeps && installer.installer === 'npm') {
51 | command += ` ${installer.flags.legacy}`; // putting extra space to ensure the flag is properly appended
52 | }
53 |
54 | fs.ensureDirSync(path.join('node_modules'));
55 | execSync(command, null);
56 | return Promise.resolve();
57 | }
58 | };
59 |
60 |
--------------------------------------------------------------------------------
/template/component/ts/@component@-viewModel.ts:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | import * as ko from "knockout";
4 | import componentStrings = require("ojL10n!./resources/nls/@component-name@-strings");
5 | import Context = require("ojs/ojcontext");
6 | import Composite = require("ojs/ojcomposite");
7 | import "ojs/ojknockout";
8 |
9 | export default class ViewModel implements Composite.ViewModel {
10 | busyResolve: (() => void);
11 | composite: Element;
12 | messageText: ko.Observable;
13 | properties: Composite.PropertiesType;
14 | res: { [key: string]: string };
15 |
16 | constructor(context: Composite.ViewModelContext) {
17 | //At the start of your viewModel constructor
18 | const elementContext: Context = Context.getContext(context.element);
19 | const busyContext: Context.BusyContext = elementContext.getBusyContext();
20 | const options = { "description": "Web Component Startup - Waiting for data" };
21 | this.busyResolve = busyContext.addBusyState(options);
22 |
23 | this.composite = context.element;
24 |
25 | //Example observable
26 | this.messageText = ko.observable("Hello from @full-component-name@");
27 | this.properties = context.properties;
28 | this.res = componentStrings["@component-name@"];
29 |
30 | // Example for parsing context properties
31 | // if (context.properties.name) {
32 | // parse the context properties here
33 | // }
34 |
35 | //Once all startup and async activities have finished, relocate if there are any async activities
36 | this.busyResolve();
37 | }
38 |
39 | //Lifecycle methods - implement if necessary
40 |
41 | activated(context: Composite.ViewModelContext): Promise | void {
42 |
43 | };
44 |
45 | connected(context: Composite.ViewModelContext): void {
46 |
47 | };
48 |
49 | bindingsApplied(context: Composite.ViewModelContext): void {
50 |
51 | };
52 |
53 | propertyChanged(context: Composite.PropertyChangedContext): void {
54 |
55 | };
56 |
57 | disconnected(element: Element): void {
58 |
59 | };
60 | };
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/css/images/oracle_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
22 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/css/images/oracle_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
22 |
--------------------------------------------------------------------------------
/test/templates/webpackLegacyTest/src/styles/images/oracle_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
22 |
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-pack/component/component-viewModel.ts:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | import * as ko from "knockout";
4 | import componentStrings = require("ojL10n!./resources/nls/component-strings");
5 | import Context = require("ojs/ojcontext");
6 | import Composite = require("ojs/ojcomposite");
7 | import "ojs/ojknockout";
8 | import "css!./component-styles";
9 | import "ojcss!my-pack/resources/css/shared";
10 |
11 | export default class ViewModel implements Composite.ViewModel {
12 | busyResolve: (() => void);
13 | composite: Element;
14 | messageText: ko.Observable;
15 | properties: Composite.PropertiesType;
16 | res: { [key: string]: string };
17 |
18 | constructor(context: Composite.ViewModelContext) {
19 | //At the start of your viewModel constructor
20 | const elementContext: Context = Context.getContext(context.element);
21 | const busyContext: Context.BusyContext = elementContext.getBusyContext();
22 | const options = {"description": "Web Component Startup - Waiting for data"};
23 | this.busyResolve = busyContext.addBusyState(options);
24 |
25 | this.composite = context.element;
26 |
27 | //Example observable
28 | this.messageText = ko.observable("Hello from my-pack-component");
29 | this.properties = context.properties;
30 | this.res = componentStrings["component"];
31 |
32 | // Example for parsing context properties
33 | // if (context.properties.name) {
34 | // parse the context properties here
35 | // }
36 |
37 | //Once all startup and async activities have finished, relocate if there are any async activities
38 | this.busyResolve();
39 | }
40 |
41 | //Lifecycle methods - implement if necessary
42 |
43 | activated(context: Composite.ViewModelContext): Promise | void {
44 |
45 | };
46 |
47 | connected(context: Composite.ViewModelContext): void {
48 |
49 | };
50 |
51 | bindingsApplied(context: Composite.ViewModelContext): void {
52 |
53 | };
54 |
55 | propertyChanged(context: Composite.PropertyChangedContext): void {
56 |
57 | };
58 |
59 | disconnected(element: Element): void {
60 |
61 | };
62 | };
--------------------------------------------------------------------------------
/lib/tasks/create.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 | 'use strict';
8 |
9 | /**
10 | * ## Dependencies
11 | */
12 | const app = require('../scopes/app');
13 | const config = require('../../config');
14 | const utils = require('../util/utils');
15 |
16 | /**
17 | * # Switch for 'create' task
18 | *
19 | * @public
20 | * @param {string} scope
21 | * @param {Array} [parameters]
22 | * @param {Object} [options]
23 | */
24 | module.exports = function (scope, parameters, options) {
25 | const scopes = config.tasks.create.scopes;
26 | utils.validateParametersCount(parameters, 1);
27 | const parameter = parameters[0];
28 | switch (scope) {
29 | case scopes.theme.name: {
30 | if (!utils.ensureJetApp()) {
31 | return Promise.reject();
32 | }
33 | return app.createTheme(parameter, options);
34 | }
35 | case scopes.component.name: {
36 | if (!utils.ensureJetApp()) {
37 | return Promise.reject();
38 | }
39 | if (utils.isWebpackApp()) {
40 | utils.log.error('Creating components is not currently supported in projects using Webpack. Switch to a non-Webpack projects to create components.');
41 | return Promise.reject();
42 | }
43 | return app.createComponent(parameter, options);
44 | }
45 | case scopes.pack.name: {
46 | if (!utils.ensureJetApp()) {
47 | return Promise.reject();
48 | }
49 | if (utils.isWebpackApp()) {
50 | utils.log.error('Creating packs is not currently supported in projects using Webpack. Switch to a non-Webpack projects to create packs.');
51 | return Promise.reject();
52 | }
53 | const tooling = utils.loadTooling();
54 | return tooling.create(scope, parameter, options);
55 | }
56 | case scopes.app.name:
57 | // ojet create app TestApp: scope = app, parameters = [TestApp]
58 | return app.create(parameter, options);
59 | case undefined:
60 | // ojet create TestApp (API): scope = undefined, parameters = [TestApp]
61 | return app.create(parameter, options);
62 | default:
63 | // ojet create TestApp (CLI): scope = TestApp, parameters = []
64 | return app.create(scope, options);
65 | }
66 | };
67 |
--------------------------------------------------------------------------------
/test/templates/webMigrationTest/src/ts/jet-composites/my-pack/component/component-viewModel.ts:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | import * as ko from "knockout";
4 | import componentStrings = require("ojL10n!./resources/nls/component-strings");
5 | import Context = require("ojs/ojcontext");
6 | import Composite = require("ojs/ojcomposite");
7 | import "ojs/ojknockout";
8 | import "css!./component-styles";
9 | import "ojcss!my-pack/resources/css/shared";
10 |
11 | export default class ViewModel implements Composite.ViewModel {
12 | busyResolve: (() => void);
13 | composite: Element;
14 | messageText: ko.Observable;
15 | properties: Composite.PropertiesType;
16 | res: { [key: string]: string };
17 |
18 | constructor(context: Composite.ViewModelContext) {
19 | //At the start of your viewModel constructor
20 | const elementContext: Context = Context.getContext(context.element);
21 | const busyContext: Context.BusyContext = elementContext.getBusyContext();
22 | const options = {"description": "Web Component Startup - Waiting for data"};
23 | this.busyResolve = busyContext.addBusyState(options);
24 |
25 | this.composite = context.element;
26 |
27 | //Example observable
28 | this.messageText = ko.observable("Hello from my-pack-component");
29 | this.properties = context.properties;
30 | this.res = componentStrings["component"];
31 |
32 | // Example for parsing context properties
33 | // if (context.properties.name) {
34 | // parse the context properties here
35 | // }
36 |
37 | //Once all startup and async activities have finished, relocate if there are any async activities
38 | this.busyResolve();
39 | }
40 |
41 | //Lifecycle methods - implement if necessary
42 |
43 | activated(context: Composite.ViewModelContext): Promise | void {
44 |
45 | };
46 |
47 | connected(context: Composite.ViewModelContext): void {
48 |
49 | };
50 |
51 | bindingsApplied(context: Composite.ViewModelContext): void {
52 |
53 | };
54 |
55 | propertyChanged(context: Composite.PropertyChangedContext): void {
56 |
57 | };
58 |
59 | disconnected(element: Element): void {
60 |
61 | };
62 | };
--------------------------------------------------------------------------------
/test/templates/webTsApiTest/src/ts/jet-composites/my-component/my-component-viewModel.ts:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | import * as ko from "knockout";
4 | import componentStrings = require("ojL10n!./resources/nls/my-component-strings");
5 | import Context = require("ojs/ojcontext");
6 | import Composite = require("ojs/ojcomposite");
7 | import "ojs/ojknockout";
8 | import "css!./my-component-styles";
9 | import "ojs/ojcss!my-pack/resources/css/shared";
10 |
11 | export default class ViewModel implements Composite.ViewModel {
12 | busyResolve: (() => void);
13 | composite: Element;
14 | messageText: ko.Observable;
15 | properties: Composite.PropertiesType;
16 | res: { [key: string]: string };
17 |
18 | constructor(context: Composite.ViewModelContext) {
19 | //At the start of your viewModel constructor
20 | const elementContext: Context = Context.getContext(context.element);
21 | const busyContext: Context.BusyContext = elementContext.getBusyContext();
22 | const options = {"description": "Web Component Startup - Waiting for data"};
23 | this.busyResolve = busyContext.addBusyState(options);
24 |
25 | this.composite = context.element;
26 |
27 | //Example observable
28 | this.messageText = ko.observable("Hello from my-component");
29 | this.properties = context.properties;
30 | this.res = componentStrings["my-component"];
31 |
32 | // Example for parsing context properties
33 | // if (context.properties.name) {
34 | // parse the context properties here
35 | // }
36 |
37 | //Once all startup and async activities have finished, relocate if there are any async activities
38 | this.busyResolve();
39 | }
40 |
41 | //Lifecycle methods - implement if necessary
42 |
43 | activated(context: Composite.ViewModelContext): Promise | void {
44 |
45 | };
46 |
47 | connected(context: Composite.ViewModelContext): void {
48 |
49 | };
50 |
51 | bindingsApplied(context: Composite.ViewModelContext): void {
52 |
53 | };
54 |
55 | propertyChanged(context: Composite.PropertyChangedContext): void {
56 |
57 | };
58 |
59 | disconnected(element: Element): void {
60 |
61 | };
62 | };
--------------------------------------------------------------------------------