Skip to content

Commit 14059c0

Browse files
committed
Release 16.1.0
1 parent c6d1838 commit 14059c0

File tree

18 files changed

+148
-65
lines changed

18 files changed

+148
-65
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @oracle/ojet-cli 16.0.0
1+
# @oracle/ojet-cli 16.1.0
22

33
## About the module
44
This module contains a command line interface for Oracle JET web application development.
@@ -59,7 +59,7 @@ Or view help on adding a plugin:
5959
ojet help add plugin
6060
```
6161

62-
For more information on the Oracle JET CLI, refer to the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1600&id=homepage).
62+
For more information on the Oracle JET CLI, refer to the [Oracle JET Developers Guide](http://www.oracle.com/pls/topic/lookup?ctx=jet1610&id=homepage).
6363

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

RELEASENOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Release Notes for ojet-cli ##
22

3+
### 16.1.0
4+
5+
* Update version of Express to 4.19.2
6+
37
### 16.0.0
48

59
* Update jest version to 29

generators/app/templates/common/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"version": "1.0.0",
44
"description": "An Oracle JavaScript Extension Toolkit(JET) web app",
55
"dependencies": {
6-
"@oracle/oraclejet": "~16.0.0",
7-
"@oracle/oraclejet-core-pack": "~16.0.0"
6+
"@oracle/oraclejet": "~16.1.0",
7+
"@oracle/oraclejet-core-pack": "~16.1.0"
88
},
99
"devDependencies": {
1010
"extract-zip": "^1.7.0",
1111
"fs-extra": "^8.1.0",
1212
"glob": "7.2.0",
1313
"underscore": "^1.10.2",
14-
"@oracle/ojet-cli": "~16.0.0"
14+
"@oracle/ojet-cli": "~16.1.0"
1515
},
1616
"engines": {
1717
"node": ">=12.21.0"

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oracle/ojet-cli",
3-
"version": "16.0.0",
3+
"version": "16.1.0",
44
"description": "Oracle JET Command Line Interface",
55
"license": "UPL-1.0",
66
"homepage": "http://www.oracle.com/jet",
@@ -14,8 +14,8 @@
1414
"glob": "7.2.0",
1515
"inquirer": "~8.2.2",
1616
"minimist": "~1.2.0",
17-
"@oracle/oraclejet-tooling": "~16.0.0",
18-
"@oracle/oraclejet-templates": "~16.0.0"
17+
"@oracle/oraclejet-tooling": "~16.1.0",
18+
"@oracle/oraclejet-templates": "~16.1.0"
1919
},
2020
"engines": {
2121
"node": ">=12.21.0"

template/common/oraclejetconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"defaultTheme": "redwood",
2121
"typescriptLibraries": "typescript@5.3.2 yargs-parser@~13.1.2",
2222
"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",
23-
"mochaTestingLibraries": "karma mocha sinon chai 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",
24-
"jestTestingLibraries": "jest@29.6.2 @testing-library/preact@3.2.3 @types/jest@29.5.3 jest-environment-jsdom@29.6.2 @oracle/oraclejet-jest-preset@~16.0.0"
23+
"mochaTestingLibraries": "karma mocha sinon chai@4.4.1 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",
24+
"jestTestingLibraries": "jest@29.6.2 @testing-library/preact@3.2.3 @types/jest@29.5.3 jest-environment-jsdom@29.6.2 @oracle/oraclejet-jest-preset@~16.1.0"
2525
}

template/component/js/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@component-name@",
33
"version": "1.0.0",
4-
"jetVersion": "^16.0.0",
4+
"jetVersion": "^16.1.0",
55
"displayName": "A user friendly, translatable name of the component.",
66
"description": "A translatable high-level description for the component.",
77
"properties": {

template/component/ts/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@component-name@",
33
"version": "1.0.0",
4-
"jetVersion": "^16.0.0",
4+
"jetVersion": "^16.1.0",
55
"displayName": "A user friendly, translatable name of the component.",
66
"description": "A translatable high-level description for the component.",
77
"properties": {

template/resource-component/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@component-name@",
33
"type": "resource",
44
"version": "1.0.0",
5-
"jetVersion": "^16.0.0",
5+
"jetVersion": "^16.1.0",
66
"displayName": "A user friendly, translatable name of the component.",
77
"description": "A translatable high-level description for the component.",
88
"publicModules": [

test/componentTest.js

Lines changed: 112 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,40 @@ describe('Component & Jet Pack Tests', () => {
496496
assert.ok(componentJson.properties, "Properties not found in component.json");
497497
});
498498
}
499+
it(`should be built in ${appName}/web/js/jet-composites/${component}`, () => {
500+
const appDir = util.getAppDir(appName);
501+
const builtComponentPath = path.join(appDir, 'web', 'js', 'jet-composites', component, DEFAULT_COMPONENT_VERSION);
502+
const exists = fs.pathExistsSync(builtComponentPath);
503+
assert.ok(exists, builtComponentPath);
504+
});
505+
it(`should be built in ${appName}/web/js/jet-composites/${component} when unversioned is set to true in oraclejetconfig file`, async() => {
506+
const appDir = util.getAppDir(appName);
507+
const { pathToApp } = util.getAppPathData(appName);
508+
const builtUnversionedComponentPath = path.join(pathToApp, 'web', 'js', 'jet-composites', component);
509+
let oracleJetConfigJson = fs.readJSONSync(path.join(pathToApp, 'oraclejetconfig.json'));
510+
// Modify the oraclejetconfig json:
511+
oracleJetConfigJson.unversioned = true;
512+
// Re-write the json:
513+
fs.writeJSONSync(path.join(pathToApp, 'oraclejetconfig.json'), oracleJetConfigJson, { deference: true });
514+
await util.execCmd(`${util.OJET_APP_COMMAND} build component ${component}`, {
515+
cwd: appDir
516+
}, true, true);
517+
assert.ok(fs.existsSync(builtUnversionedComponentPath), `${component} has a versioned path in the staging folder`);
518+
});
519+
it(`should be built in ${appName}/web/js/jet-composites/${component}/${DEFAULT_PACK_VERSION} when unversioned is set to false in oraclejetconfig file`, async() => {
520+
const appDir = util.getAppDir(appName);
521+
const { pathToApp } = util.getAppPathData(appName);
522+
const builtVersionedComponentPath = path.join(appDir, 'web', 'js', 'jet-composites', component, DEFAULT_PACK_VERSION);
523+
let oracleJetConfigJson = fs.readJSONSync(path.join(pathToApp, 'oraclejetconfig.json'));
524+
// Modify the oraclejetconfig json:
525+
oracleJetConfigJson.unversioned = false;
526+
// Re-write the json:
527+
fs.writeJSONSync(path.join(pathToApp, 'oraclejetconfig.json'), oracleJetConfigJson, { deference: true });
528+
await util.execCmd(`${util.OJET_APP_COMMAND} build component ${component}`, {
529+
cwd: appDir
530+
}, true, true);
531+
assert.ok(fs.existsSync(builtVersionedComponentPath), `${component} has an unversioned path in the staging folder`);
532+
});
499533
})
500534
}
501535

@@ -897,7 +931,7 @@ describe('Component & Jet Pack Tests', () => {
897931
});
898932
}
899933

900-
function omitComponentVerstionTest({
934+
function omitComponentVersionTest({
901935
appName
902936
}) {
903937
describe(`Build ${appName} with --${util.OMIT_COMPONENT_VERSION_FLAG}`, () => {
@@ -1325,7 +1359,7 @@ describe('Component & Jet Pack Tests', () => {
13251359
});
13261360
describe(`ojet build --${util.OMIT_COMPONENT_VERSION_FLAG}`, () => {
13271361
util.runComponentTestInAllTestApps({
1328-
test: omitComponentVerstionTest
1362+
test: omitComponentVersionTest
13291363
});
13301364
});
13311365
describe('ojet build (component exists in both exchange and src folders)', () => {
@@ -1557,18 +1591,33 @@ describe('Component & Jet Pack Tests', () => {
15571591
}
15581592
});
15591593
if (scriptsFolder === 'ts') {
1560-
it('should add a top-level content of type module in component.json', () => {
1561-
const pathToComponentJson = util.getAppDir(path.join(
1594+
it('should add a top-level content of type module in component.json and create folder common with the module in src folder', () => {
1595+
const pathToSrcFolder = path.join(
15621596
util.getAppDir(appName),
15631597
'src',
15641598
scriptsFolder,
15651599
'jet-composites',
1566-
pack,
1567-
'component.json'
1568-
));
1600+
pack
1601+
);
1602+
const pathToComponentJson = path.join(pathToSrcFolder, 'component.json');
1603+
const pathToModule = path.join(pathToSrcFolder, 'common', 'someFunction');
1604+
if (!fs.existsSync(pathToModule)) {
1605+
fs.mkdirSync(
1606+
pathToModule,
1607+
{
1608+
recursive: true
1609+
}
1610+
)
1611+
}
1612+
fs.writeFileSync(path.join(pathToModule, 'index.ts'), '// Test file.');
15691613
let componentJson = fs.readJSONSync(pathToComponentJson);
15701614
let hasContentModule = false;
1571-
componentJson.contents.push({'name': 'common/someFunction', 'type': 'module', 'directImport': true });
1615+
componentJson.contents.push({
1616+
'name': 'someFunction',
1617+
'main': 'common/someFunction',
1618+
'type': 'module',
1619+
'directImport': true
1620+
});
15721621
const errorMessage = 'pack does not have contents attribute with type module in component.json';
15731622
fs.writeJSONSync(pathToComponentJson, componentJson);
15741623
fs.readJSONSync(pathToComponentJson).contents.forEach(
@@ -1578,7 +1627,9 @@ describe('Component & Jet Pack Tests', () => {
15781627
return;
15791628
}
15801629
});
1630+
const moduleExists = fs.existsSync(path.join(pathToModule, 'index.ts'));
15811631
assert.equal(hasContentModule, true, errorMessage);
1632+
assert.ok(moduleExists, pathToModule);
15821633
});
15831634
it(`should have ${appName}/src/${scriptsFolder}/${pack}/component.json`, () => {
15841635
const pathToComponentJson = util.getAppDir(path.join(
@@ -2829,6 +2880,34 @@ describe('Component & Jet Pack Tests', () => {
28292880
})
28302881
}
28312882
}
2883+
it(`should be built in ${appName}/web/js/jet-composites/${pack} when unversioned is set to true in oraclejetconfig file`, async() => {
2884+
const appDir = util.getAppDir(appName);
2885+
const { pathToApp } = util.getAppPathData(appName, scriptsFolder);
2886+
const builtUnversionedPackPath = path.join(pathToApp, 'web', 'js', 'jet-composites', pack);
2887+
let oracleJetConfigJson = fs.readJSONSync(path.join(pathToApp, 'oraclejetconfig.json'));
2888+
// Modify the oraclejetconfig json:
2889+
oracleJetConfigJson.unversioned = true;
2890+
// Re-write the json:
2891+
fs.writeJSONSync(path.join(pathToApp, 'oraclejetconfig.json'), oracleJetConfigJson, { deference: true });
2892+
await util.execCmd(`${util.OJET_APP_COMMAND} build component ${pack}`, {
2893+
cwd: appDir
2894+
}, true, true);
2895+
assert.ok(fs.existsSync(builtUnversionedPackPath), `${pack} has a versioned path in the staging folder`);
2896+
});
2897+
it(`should be built in ${appName}/web/js/jet-composites/${pack}/${DEFAULT_PACK_VERSION} when unversioned is set to false in oraclejetconfig file`, async() => {
2898+
const appDir = util.getAppDir(appName);
2899+
const { pathToApp } = util.getAppPathData(appName, scriptsFolder);
2900+
const builtVersionedPackPath = path.join(pathToApp, 'web', 'js', 'jet-composites', pack, DEFAULT_PACK_VERSION);
2901+
let oracleJetConfigJson = fs.readJSONSync(path.join(pathToApp, 'oraclejetconfig.json'));
2902+
// Modify the oraclejetconfig json:
2903+
oracleJetConfigJson.unversioned = false;
2904+
// Re-write the json:
2905+
fs.writeJSONSync(path.join(pathToApp, 'oraclejetconfig.json'), oracleJetConfigJson, { deference: true });
2906+
await util.execCmd(`${util.OJET_APP_COMMAND} build component ${pack}`, {
2907+
cwd: appDir
2908+
}, true, true);
2909+
assert.ok(fs.existsSync(builtVersionedPackPath), `${pack} has an unversioned path in the staging folder`);
2910+
});
28322911
})
28332912
}
28342913

@@ -3370,31 +3449,31 @@ function doNotOverWriteOjCPathMappingTest({
33703449
});
33713450
});
33723451

3373-
describe('ojet build, do not overwrite path-mapping for oj-c', () => {
3374-
util.runComponentTestInAllTestApps({
3375-
test: doNotOverWriteOjCPathMappingTest
3376-
});
3377-
});
3378-
3379-
describe('ojet build --release, do not overwrite path-mapping for oj-c', () => {
3380-
util.runComponentTestInAllTestApps({
3381-
test: doNotOverWriteOjCPathMappingTest,
3382-
buildType: 'release'
3383-
})
3384-
})
3385-
3386-
describe('ojet build, do not overwrite path-mapping for oj-c', () => {
3387-
util.runComponentTestInAllTestApps({
3388-
test: doNotOverWriteOjCPathMappingTest
3389-
});
3390-
});
3391-
3392-
describe('ojet build --release, do not overwrite path-mapping for oj-c', () => {
3393-
util.runComponentTestInAllTestApps({
3394-
test: doNotOverWriteOjCPathMappingTest,
3395-
buildType: 'release'
3396-
});
3397-
});
3452+
// describe('ojet build, do not overwrite path-mapping for oj-c', () => {
3453+
// util.runComponentTestInAllTestApps({
3454+
// test: doNotOverWriteOjCPathMappingTest
3455+
// });
3456+
// });
3457+
3458+
// describe('ojet build --release, do not overwrite path-mapping for oj-c', () => {
3459+
// util.runComponentTestInAllTestApps({
3460+
// test: doNotOverWriteOjCPathMappingTest,
3461+
// buildType: 'release'
3462+
// })
3463+
// })
3464+
3465+
// describe('ojet build, do not overwrite path-mapping for oj-c', () => {
3466+
// util.runComponentTestInAllTestApps({
3467+
// test: doNotOverWriteOjCPathMappingTest
3468+
// });
3469+
// });
3470+
3471+
// describe('ojet build --release, do not overwrite path-mapping for oj-c', () => {
3472+
// util.runComponentTestInAllTestApps({
3473+
// test: doNotOverWriteOjCPathMappingTest,
3474+
// buildType: 'release'
3475+
// });
3476+
// });
33983477

33993478
describe('ojet build, map local reference pack in main.js test', () => {
34003479
util.runComponentTestInAllTestApps({

test/templates/webTsApiTest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "An Oracle JavaScript Extension Toolkit(JET) web app",
55
"dependencies": {
6-
"@oracle/oraclejet": "https://artifacthub-phx.oci.oraclecorp.com/ojet-dev-local/oracle-oraclejet-16.0.0.tgz"
6+
"@oracle/oraclejet": "https://artifacthub-phx.oci.oraclecorp.com/ojet-dev-local/oracle-oraclejet-16.1.0.tgz"
77
},
88
"devDependencies": {
99
"@oracle/ojet-cli":"file:../../ojet-cli",

0 commit comments

Comments
 (0)