Skip to content

Commit

Permalink
test(js-toolkit): make another attempt at getting Windows CI green
Browse files Browse the repository at this point in the history
My last attempt (parent commit) neither fixed Windows[0], nor allowed
Linux[1] to keep working. It seems that `tsc` knows nothing about globs,
so let's just call the command with the explicit, expanded list of
packages.

[0]: /~https://github.com/liferay/liferay-frontend-projects/pull/133/checks?check_run_id=1220654707
[1]: /~https://github.com/liferay/liferay-frontend-projects/pull/133/checks?check_run_id=1220537852
  • Loading branch information
wincent committed Oct 7, 2020
1 parent 2b4b6c8 commit c93aa4d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion projects/js-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "liferay-js-toolkit",
"private": true,
"scripts": {
"build": "tsc --build \"packages/*/tsconfig.json\" && node scripts/copyfiles.js --all",
"build": "node scripts/build.js && node scripts/copyfiles.js --all",
"check-deps": "node scripts/check-deps.js",
"ci": "yarn clean && yarn check-deps && yarn build && yarn test",
"clean": "node scripts/clean.js --all",
Expand Down
33 changes: 33 additions & 0 deletions projects/js-toolkit/scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: LGPL-3.0-or-later
*/

const child_process = require('child_process');
const fs = require('fs');
const path = require('path');

const packages = fs
.readdirSync(path.join(__dirname, '..', 'packages'), {withFileTypes: true})
.map((entry) => {
if (entry.isDirectory()) {
return path.join(
__dirname,
'..',
'packages',
entry.name,
'tsconfig.json'
);
}
})
.filter(Boolean);

const {status, error, signal} = child_process.spawnSync(
'tsc',
['--build', ...packages],
{stdio: 'inherit'}
);

if (status !== 0) {
process.exit(1);
}

0 comments on commit c93aa4d

Please sign in to comment.