Skip to content
This repository was archived by the owner on Oct 17, 2020. It is now read-only.

Commit c688cb7

Browse files
authored
Merge pull request #542 from izaera/issue-520
feat: Prepare a new snapshot version to integrate in Portal's build
2 parents f853c40 + 3eff085 commit c688cb7

File tree

144 files changed

+1133
-1050
lines changed

Some content is hidden

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

144 files changed

+1133
-1050
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = {
1818
root: true,
1919
rules: {
2020
'@typescript-eslint/await-thenable': 'error',
21+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
2122
'@typescript-eslint/no-explicit-any': [
2223
'error',
2324
{

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/*
22
packages/*/generators
33
packages/*/lib
4-
packages/*/node_modules
4+
packages/*/node_modules
5+
tsconfig.tsbuildinfo

jest.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = {
1212
],
1313
testPathIgnorePatterns: ['/node_modules/', '/__fixtures__/'],
1414
transform: {
15-
"\\.js$": "ts-jest",
16-
"\\.ts$": "ts-jest"
17-
}
15+
'\\.ts$': 'ts-jest',
16+
},
1817
};

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@
1313
"packages/*"
1414
],
1515
"scripts": {
16-
"build": "node scripts/build.js",
16+
"build": "tsc --build packages/*/tsconfig.json && yarn workspaces run copyfiles",
1717
"check-deps": "node scripts/check-deps.js",
18-
"ci": "yarn check-deps && yarn format:check && yarn lint && yarn build && yarn test",
18+
"ci": "yarn clean && yarn check-deps && yarn format:check && yarn lint && yarn build && yarn test",
19+
"clean": "yarn workspaces run clean",
1920
"format": "prettier --write \".*.ts\" \"packages/**/*.ts\"",
2021
"format:check": "prettier --list-different \".*.ts\" \"packages/**/*.ts\"",
2122
"level-deps": "node scripts/level-deps.js",
2223
"lint": "eslint .",
2324
"lint:fix": "eslint --fix .",
2425
"qa": "node scripts/qa/index.js",
2526
"test": "jest --runInBand",
26-
"watch": "node scripts/watch"
27+
"watch": "node scripts/watch.js"
2728
},
2829
"devDependencies": {
2930
"@types/jest": "^24.0.18",

packages/generator-liferay-js/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "generator-liferay-js",
33
"version": "3.0.0",
44
"description": "Yeoman generators for Liferay DXP and Portal CE JavaScript projects.",
5+
"license": "LGPL-3.0",
56
"main": "generators/app/index.js",
67
"files": [
78
"generators"
@@ -12,11 +13,13 @@
1213
"liferay-js"
1314
],
1415
"scripts": {
15-
"copyfiles": "node ../../scripts/copyfiles.js",
1616
"build": "tsc && yarn copyfiles",
17+
"clean": "node ../../scripts/clean.js",
18+
"copyfiles": "node ../../scripts/copyfiles.js",
1719
"prepublish": "yarn build"
1820
},
1921
"devDependencies": {
22+
"@types/yeoman-generator": "^3.1.4",
2023
"mem-fs": "^1.1.3",
2124
"mem-fs-editor": "^6.0.0",
2225
"rimraf": "^3.0.0"

packages/generator-liferay-js/src/adapt/index.js renamed to packages/generator-liferay-js/src/adapt/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55

66
import {
7-
info,
87
error,
8+
info,
99
print,
1010
success,
1111
title,
@@ -109,6 +109,9 @@ if (argv.which) {
109109
* Generator to add deploy support to projects.
110110
*/
111111
export default class extends Generator {
112+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
113+
answers: any;
114+
112115
/**
113116
* Standard Yeoman constructor
114117
*/
@@ -182,7 +185,8 @@ export default class extends Generator {
182185
]);
183186

184187
// Set project's package manager internally using a hack
185-
project._pkgManager = answers.pkgManager;
188+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
189+
(project as any)._pkgManager = answers.pkgManager;
186190
}
187191

188192
Object.assign(
@@ -352,6 +356,10 @@ export default class extends Generator {
352356

353357
pkgJson.addPortletProperty('com.liferay.portlet.instanceable', true);
354358
}
359+
360+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
361+
private _options: any;
362+
private _pkgManager: string;
355363
}
356364

357365
module.exports = exports['default'];

packages/generator-liferay-js/src/app/index.js renamed to packages/generator-liferay-js/src/app/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* © 2017 Liferay, Inc. <https://liferay.com>
3-
*
2+
* SPDX-FileCopyrightText: © 2017 Liferay, Inc. <https://liferay.com>
43
* SPDX-License-Identifier: LGPL-3.0-or-later
54
*/
65

@@ -44,7 +43,10 @@ export default class extends Generator {
4443
]);
4544

4645
this.destinationRoot(path.resolve(answers.folder));
47-
this.composeWith(require.resolve(`../target-${answers.target}`));
46+
this.composeWith(
47+
require.resolve(`../target-${answers.target}`),
48+
undefined
49+
);
4850
}
4951

5052
/**
@@ -55,7 +57,7 @@ export default class extends Generator {
5557
_findTargets() {
5658
const tds = fs
5759
.readdirSync(path.join(__dirname, '..'))
58-
.filter(file => file.indexOf('target-') == 0)
60+
.filter(file => file.indexOf('target-') === 0)
5961
.map(target => target.replace('target-', ''))
6062
.map(target => ({
6163
...getTargetDescription(target),
@@ -91,6 +93,7 @@ export default class extends Generator {
9193
_getTargetCategories(tds) {
9294
const map = tds.reduce((map, td) => {
9395
map[td.category] = true;
96+
9497
return map;
9598
}, {});
9699

packages/generator-liferay-js/src/config.js renamed to packages/generator-liferay-js/src/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import os from 'os';
77
import path from 'path';
88
import readJsonSync from 'read-json-sync';
99

10-
let cfg = {};
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
let cfg: any = {};
1112

1213
Object.assign(
1314
cfg,
@@ -101,6 +102,7 @@ function safeReadJsonSync(path) {
101102
if (err.code !== 'ENOENT') {
102103
throw err;
103104
}
105+
104106
return {};
105107
}
106108
}

packages/generator-liferay-js/src/facet-configuration/index.js renamed to packages/generator-liferay-js/src/facet-configuration/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import {DEFAULT_CONFIGURATION} from './constants';
1616
* Generator to add configuration support to projects.
1717
*/
1818
export default class extends Generator {
19+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20+
answers: any;
21+
1922
/**
2023
* Standard Yeoman initialization function
2124
*/

0 commit comments

Comments
 (0)