build: refs#6706 gulp install fixed, myt updated
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2024-02-07 12:54:37 +01:00
parent 46dee65e68
commit bdfbb8f6f7
3 changed files with 38 additions and 16 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable no-console */
require('require-yaml');
const gulp = require('gulp');
const PluginError = require('plugin-error');
@ -67,19 +68,40 @@ back.description = `Starts backend and database service`;
const defaultTask = gulp.parallel(front, back);
defaultTask.description = `Starts all application services`;
function install() {
const install = require('gulp-install');
const print = require('gulp-print');
async function install() {
const spawn = require('child_process').spawn;
let npmArgs = [];
if (argv.ci) npmArgs = ['--no-audit', '--prefer-offline'];
console.log('-> Installing global packages...');
await pnpmInstall();
let packageFiles = ['front/package.json', 'print/package.json'];
return gulp.src(packageFiles)
.pipe(print(filepath => {
return `Installing packages in ${filepath}`;
}))
.pipe(install({npm: npmArgs}));
const modules = ['front', 'print'];
for (const module of modules) {
console.log(`-> Installing '${module}' packages...`);
await pnpmInstall(module);
}
async function pnpmInstall(prefix) {
let args = ['install', '--prefer-offline'];
if (prefix) args = args.concat(['--prefix', prefix]);
const options = {
stdio: [
process.stdin,
process.stdout,
process.stderr
]
};
await new Promise((resolve, reject) => {
const child = spawn('pnpm', args, options);
child.on('exit', code => {
if (code !== 0)
reject(new Error(`pnpm exit code ${code}`));
else
resolve(code);
});
});
}
}
install.description = `Installs node dependencies in all directories`;

View File

@ -55,7 +55,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/preset-env": "^7.11.0",
"@babel/register": "^7.7.7",
"@verdnatura/myt": "^1.6.5",
"@verdnatura/myt": "^1.6.6",
"angular-mocks": "^1.7.9",
"babel-jest": "^26.0.1",
"babel-loader": "^8.2.4",

View File

@ -128,8 +128,8 @@ devDependencies:
specifier: ^7.7.7
version: 7.23.7(@babel/core@7.23.9)
'@verdnatura/myt':
specifier: ^1.6.5
version: 1.6.5
specifier: ^1.6.6
version: 1.6.6
angular-mocks:
specifier: ^1.7.9
version: 1.8.3
@ -2633,8 +2633,8 @@ packages:
dev: false
optional: true
/@verdnatura/myt@1.6.5:
resolution: {integrity: sha512-0h7FvhSewd2W9EOymc59YymZJOBfCXmY5CWNFhol1yBfWSOOF9JAEE9DKRMbKaMqd/5Dy9LriS5PYOfeqm3HjA==}
/@verdnatura/myt@1.6.6:
resolution: {integrity: sha512-5KHi9w1baEQ6Oe/pAR8pl0oD5yyJJuPirE+ZhygreUGGURfig4VekjhlGE3WEbWquDiIAMi89J1VQ+1Ba0+jQw==}
hasBin: true
dependencies:
'@sqltools/formatter': 1.2.5