Skip to content

Commit b6f7f93

Browse files
committed
Release 14.0.0
1 parent 803f44d commit b6f7f93

Some content is hidden

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

80 files changed

+1787
-1216
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to oraclejet-tooling
22

3-
*Copyright (c) 2014, 2022 Oracle and/or its affiliates
3+
*Copyright (c) 2014, 2023 Oracle and/or its affiliates
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/*
66

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# oraclejet-tooling
22

3-
Copyright (c) 2022 Oracle and/or its affiliates.
3+
Copyright (c) 2023 Oracle and/or its affiliates.
44

55
Licensed under The Universal Permissive License (UPL), Version 1.0
66
as shown at https://oss.oracle.com/licenses/upl/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# @oracle/oraclejet-tooling 13.1.0
1+
# @oracle/oraclejet-tooling 14.0.0
22

33
## About the tooling API
44
This tooling API contains methods to build and serve Oracle JET web and hybrid mobile apps. It is intended to be used with task running tools such as grunt or gulp. The APIs can also be invoked directly.
55

66
This is an open source project maintained by Oracle Corp.
77

88
## Installation
9-
This module will be automatically installed when you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1310&id=homepage).
9+
This module will be automatically installed when you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1400&id=homepage).
1010

1111
## [Contributing](https://github.com/oracle/oraclejet-tooling/blob/master/CONTRIBUTING.md)
1212
Oracle JET is an open source project. Pull Requests are currently not being accepted. See
1313
[CONTRIBUTING](https://github.com/oracle/oraclejet-tooling/blob/master/CONTRIBUTING.md)
1414
for details.
1515

1616
## [License](https://github.com/oracle/oraclejet-tooling/blob/master/LICENSE)
17-
Copyright (c) 2022 Oracle and/or its affiliates and released under the
17+
Copyright (c) 2023 Oracle and/or its affiliates and released under the
1818
[Universal Permissive License (UPL)](https://oss.oracle.com/licenses/upl/), Version 1.0

RELEASENOTES.md

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

3-
### 13.1.0
3+
### 14.0.0
44

55
### 11.0.0
66
* oraclejet-tooling now requires node 12.21 or later

config/eslintcustom.js

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

hooks/jetAfterPrepare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

hooks/jetInjector.js

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

lib/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

lib/addjsdoc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /usr/bin/env node
2+
/**
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
4+
Licensed under The Universal Permissive License (UPL), Version 1.0
5+
as shown at https://oss.oracle.com/licenses/upl/
6+
7+
*/
8+
9+
'use strict';
10+
11+
/**
12+
* ## Dependencies
13+
*/
14+
const util = require('./util');
15+
16+
/**
17+
* # 'addJsdoc'
18+
*
19+
* @public
20+
* @param {Object} options
21+
* @returns {Promise}
22+
*/
23+
module.exports = function (options) {
24+
util.log('Installing jsdoc');
25+
const installer = util.getInstallerCommand({ options });
26+
27+
return util.spawn(installer.installer, [installer.verbs.install, 'jsdoc@3.5.5', '--save-dev=true', '--save-exact']);
28+
};

lib/addpcss.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

lib/addpwa.js

Lines changed: 76 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66
@@ -24,82 +24,79 @@ const CONSTANTS = require('./constants');
2424
*/
2525

2626
module.exports = function () {
27-
return new Promise((resolve) => {
28-
// eslint-disable-next-line global-require
29-
const appName = path.basename(process.cwd());
30-
const appNameRegex = new RegExp('@AppName@', 'g');
31-
const pathToApp = path.join('src');
32-
const pathToIndexHtml = path.join(pathToApp, 'index.html');
33-
const pathToServiceWorkerTemplates = path.join(util.getToolingPath(),
34-
CONSTANTS.PATH_TO_PWA_TEMPLATES);
35-
// 1. read index.html
36-
const indexHtmlString = fs.readFileSync(
37-
pathToIndexHtml,
38-
{ encoding: 'utf-8' }
39-
);
40-
// 2. read sw.txt, replace app name token and resources to cache
41-
// according to the app's architecture, and then write to app as js file
42-
let swJsString;
43-
if (util.isVDOMApplication()) {
44-
swJsString = fs.readFileSync(
45-
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
46-
{ encoding: 'utf-8' });
47-
const vdomResourcesToCache = `[
48-
'index.js',
49-
'index.html',
50-
'bundle.js',
51-
'manifest.json',
52-
'components/',
53-
'libs/',
54-
'styles/'
55-
]`;
56-
const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/']";
57-
swJsString = swJsString.replace(mvvmResourcesToCache, vdomResourcesToCache);
58-
} else {
59-
swJsString = fs.readFileSync(
60-
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
61-
{ encoding: 'utf-8' });
62-
}
63-
const pathToAppSw = path.join(pathToApp, 'sw.js');
64-
if (fs.pathExistsSync(pathToAppSw)) {
65-
fs.renameSync(pathToAppSw, path.join(pathToApp, 'sw_old.js'));
66-
}
67-
fs.outputFileSync(
68-
pathToAppSw,
69-
swJsString.replace(appNameRegex, appName)
70-
);
71-
// 3. read manifest.json, replace app name token, write to app
72-
const manifestJsonString = fs.readFileSync(
73-
path.join(pathToServiceWorkerTemplates, 'manifest.json'),
74-
{ encoding: 'utf-8' }
75-
);
76-
const pathToAppManifest = path.join(pathToApp, 'manifest.json');
77-
if (fs.pathExistsSync(pathToAppManifest)) {
78-
fs.renameSync(pathToAppManifest, path.join(pathToApp, 'manifest_old.json'));
79-
}
80-
fs.outputFileSync(
81-
path.join(pathToApp, 'manifest.json'),
82-
manifestJsonString.replace(appNameRegex, appName)
83-
);
84-
// 4. copy swInit.txt and add it to end of body tag index.html, add <link>
85-
// to end of header tag in index.html and update
86-
const swInitString = fs.readFileSync(
87-
path.join(pathToServiceWorkerTemplates, 'swInit.txt'),
88-
{ encoding: 'utf-8' }
89-
);
90-
fs.outputFileSync(
91-
pathToIndexHtml,
92-
indexHtmlString.replace(
93-
new RegExp('</head>', 'g'),
94-
'<link rel="manifest" href="manifest.json">\n</head>'
95-
).replace(
96-
new RegExp('</body>', 'g'),
97-
`${swInitString.replace(appNameRegex, appName)}\n</body>`
98-
)
99-
);
100-
// Copy over swinit.js
101-
fs.copyFileSync(path.join(pathToServiceWorkerTemplates, 'swinit._js'),
102-
path.join(pathToApp, 'swinit.js'));
103-
resolve();
104-
});
27+
const appName = path.basename(process.cwd());
28+
const appNameRegex = new RegExp('@AppName@', 'g');
29+
const pathToApp = path.join('src');
30+
const pathToIndexHtml = path.join(pathToApp, 'index.html');
31+
const pathToServiceWorkerTemplates = path.join(util.getToolingPath(),
32+
CONSTANTS.PATH_TO_PWA_TEMPLATES);
33+
// 1. read index.html
34+
const indexHtmlString = fs.readFileSync(
35+
pathToIndexHtml,
36+
{ encoding: 'utf-8' }
37+
);
38+
// 2. read sw.txt, replace app name token and resources to cache
39+
// according to the app's architecture, and then write to app as js file
40+
let swJsString;
41+
if (util.isVDOMApplication()) {
42+
swJsString = fs.readFileSync(
43+
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
44+
{ encoding: 'utf-8' });
45+
const vdomResourcesToCache = `[
46+
'index.js',
47+
'index.html',
48+
'bundle.js',
49+
'manifest.json',
50+
'components/',
51+
'libs/',
52+
'styles/'
53+
]`;
54+
const mvvmResourcesToCache = "['index.html', 'manifest.json', 'js/', 'css/']";
55+
swJsString = swJsString.replace(mvvmResourcesToCache, vdomResourcesToCache);
56+
} else {
57+
swJsString = fs.readFileSync(
58+
path.join(pathToServiceWorkerTemplates, 'sw.txt'),
59+
{ encoding: 'utf-8' });
60+
}
61+
const pathToAppSw = path.join(pathToApp, 'sw.js');
62+
if (fs.pathExistsSync(pathToAppSw)) {
63+
fs.renameSync(pathToAppSw, path.join(pathToApp, 'sw_old.js'));
64+
}
65+
fs.outputFileSync(
66+
pathToAppSw,
67+
swJsString.replace(appNameRegex, appName)
68+
);
69+
// 3. read manifest.json, replace app name token, write to app
70+
const manifestJsonString = fs.readFileSync(
71+
path.join(pathToServiceWorkerTemplates, 'manifest.json'),
72+
{ encoding: 'utf-8' }
73+
);
74+
const pathToAppManifest = path.join(pathToApp, 'manifest.json');
75+
if (fs.pathExistsSync(pathToAppManifest)) {
76+
fs.renameSync(pathToAppManifest, path.join(pathToApp, 'manifest_old.json'));
77+
}
78+
fs.outputFileSync(
79+
path.join(pathToApp, 'manifest.json'),
80+
manifestJsonString.replace(appNameRegex, appName)
81+
);
82+
// 4. copy swInit.txt and add it to end of body tag index.html, add <link>
83+
// to end of header tag in index.html and update
84+
const swInitString = fs.readFileSync(
85+
path.join(pathToServiceWorkerTemplates, 'swInit.txt'),
86+
{ encoding: 'utf-8' }
87+
);
88+
fs.outputFileSync(
89+
pathToIndexHtml,
90+
indexHtmlString.replace(
91+
new RegExp('</head>', 'g'),
92+
'<link rel="manifest" href="manifest.json">\n</head>'
93+
).replace(
94+
new RegExp('</body>', 'g'),
95+
`${swInitString.replace(appNameRegex, appName)}\n</body>`
96+
)
97+
);
98+
// Copy over swinit.js
99+
fs.copyFileSync(path.join(pathToServiceWorkerTemplates, 'swinit._js'),
100+
path.join(pathToApp, 'swinit.js'));
101+
return Promise.resolve();
105102
};

lib/addsass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66

lib/addtypescript.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2022, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2023, Oracle and/or its affiliates.
44
Licensed under The Universal Permissive License (UPL), Version 1.0
55
as shown at https://oss.oracle.com/licenses/upl/
66
@@ -16,6 +16,7 @@ const util = require('./util');
1616
const fs = require('fs-extra');
1717
const path = require('path');
1818
const CONSTANTS = require('./constants');
19+
const config = require('./config');
1920

2021
/**
2122
* ## Helpers
@@ -34,8 +35,10 @@ const CONSTANTS = require('./constants');
3435
function installTypescipt(options) {
3536
util.log('Installing Typescript');
3637
const installer = util.getInstallerCommand({ options });
38+
config.loadOraclejetConfig();
39+
const typescriptLibraries = config.data.typescriptLibraries;
3740

38-
const command = `${installer.installer} ${installer.verbs.install} typescript@${CONSTANTS.TYPESCRIPT_VERSION} yargs-parser@~13.1.2 --save-dev --save-exact`;
41+
const command = `${installer.installer} ${installer.verbs.install} ${typescriptLibraries} --save-dev --save-exact`;
3942
return util.exec(command);
4043
}
4144

0 commit comments

Comments
 (0)