refactor: remove node-fetch dependency and use native fetch API (#12097)

This commit is contained in:
Denys Vuika
2026-07-27 15:17:49 +00:00
committed by GitHub
parent e1f463aa8a
commit 03e6320bd2
6 changed files with 1612 additions and 1932 deletions
+8 -3
View File
@@ -18,8 +18,9 @@
*/
import { parseArgs } from 'node:util';
import fetch from 'node-fetch';
import * as fs from 'fs';
import { Readable } from 'node:stream';
import type { ReadableStream } from 'node:stream/web';
import { logger } from './logger';
import { AlfrescoApi, AlfrescoApiConfig } from '@alfresco/js-api';
import { argv, exit } from 'node:process';
@@ -682,14 +683,18 @@ async function getFileFromRemote(url: string, name: string): Promise<void> {
.then(
(response) =>
new Promise<void>((resolve, reject) => {
if (!response.body) {
reject(new Error('Response body is empty'));
return;
}
const outputFile = fs.createWriteStream(`${name}.zip`);
response.body.pipe(outputFile);
Readable.fromWeb(response.body as ReadableStream<Uint8Array>).pipe(outputFile);
outputFile.on('finish', () => {
logger.info(`The file is finished downloading.`);
resolve();
});
outputFile.on('error', (error) => {
logger.error(`Not possible to download the project form remote`);
logger.error(`Not possible to download the project from remote: ${error.message}`);
reject(error);
});
})
@@ -35,11 +35,11 @@ export class SearchChipListComponent {
facetFiltersService = inject(SearchFacetFiltersService);
/**
* Search filter to supply the data for the chips.
* Not required from 4.5.0 and later versions @deprecated
* @deprecated Search filter to supply the data for the chips.
* Not required from 4.5.0 and later versions
*/
@Input()
searchFilter: SearchFilterComponent;
searchFilter: SearchFilterComponent | undefined;
/** Flag used to enable the display of a clear-all-filters button. */
@Input()
@@ -20,7 +20,7 @@
*/
export interface RequestLocalization {
/**
* A valid timezone id supported by @see java.time.ZoneId
* A valid timezone id supported by {@link java.time.ZoneId}
*/
timezone?: string;
/**
+24 -27
View File
@@ -40,19 +40,18 @@
],
"dependencies": {
"@angular-eslint/utils": "20.7.0",
"@angular/animations": "20.3.25",
"@angular/animations": "20.3.26",
"@angular/cdk": "20.2.14",
"@angular/common": "20.3.25",
"@angular/compiler": "20.3.25",
"@angular/core": "20.3.25",
"@angular/forms": "20.3.25",
"@angular/common": "20.3.26",
"@angular/compiler": "20.3.26",
"@angular/core": "20.3.26",
"@angular/forms": "20.3.26",
"@angular/material": "20.2.14",
"@angular/material-date-fns-adapter": "20.2.14",
"@angular/platform-browser": "20.3.25",
"@angular/platform-browser-dynamic": "20.3.25",
"@angular/router": "20.3.25",
"@angular/platform-browser": "20.3.26",
"@angular/platform-browser-dynamic": "20.3.26",
"@angular/router": "20.3.26",
"@apollo/client": "3.13.1",
"@babel/runtime": "7.26.10",
"@cspell/eslint-plugin": "10.0.0",
"@mat-datetimepicker/core": "16.0.1",
"@ngx-translate/core": "17.0.0",
@@ -69,7 +68,6 @@
"minimatch": "5.1.9",
"minimatch-browser": "1.0.0",
"ng2-charts": "4.1.1",
"node-fetch": "3.3.2",
"pdfjs-dist": "5.1.91",
"raphael": "2.3.0",
"rxjs": "7.8.2",
@@ -80,21 +78,21 @@
"devDependencies": {
"@alfresco/eslint-plugin-eslint-angular": "workspace:*",
"@angular-devkit/architect": "0.2003.16",
"@angular-devkit/build-angular": "20.3.16",
"@angular-devkit/core": "20.3.16",
"@angular-devkit/schematics": "20.3.16",
"@angular-devkit/build-angular": "20.3.32",
"@angular-devkit/core": "20.3.32",
"@angular-devkit/schematics": "20.3.32",
"@angular-eslint/eslint-plugin": "20.7.0",
"@angular-eslint/eslint-plugin-template": "20.7.0",
"@angular-eslint/template-parser": "20.7.0",
"@angular/compiler-cli": "20.3.25",
"@angular/compiler-cli": "20.3.26",
"@chromatic-com/storybook": "4.1.3",
"@nx/angular": "22.7.4",
"@nx/eslint-plugin": "22.7.4",
"@nx/jest": "22.7.4",
"@nx/js": "22.7.4",
"@nx/storybook": "22.7.4",
"@nx/workspace": "22.7.4",
"@schematics/angular": "20.3.16",
"@nx/jest": "22.7.7",
"@nx/js": "22.7.7",
"@nx/storybook": "22.7.7",
"@nx/workspace": "22.7.7",
"@schematics/angular": "20.3.32",
"@storybook/addon-themes": "10.4.0",
"@storybook/angular": "10.4.0",
"@types/ejs": "3.1.5",
@@ -103,7 +101,7 @@
"@types/jest": "29.5.14",
"@types/jsdom": "27.0.0",
"@types/minimatch": "5.1.2",
"@types/node": "25.9.1",
"@types/node": "26.1.1",
"@typescript-eslint/eslint-plugin": "8.59.4",
"@typescript-eslint/parser": "8.59.4",
"@typescript-eslint/typescript-estree": "8.59.4",
@@ -113,9 +111,9 @@
"ejs": "3.1.10",
"eslint": "8.57.1",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-ban": "1.6.0",
"eslint-plugin-ban": "2.0.0",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jsdoc": "50.3.1",
"eslint-plugin-jsdoc": "63.2.2",
"eslint-plugin-license-header": "0.8.0",
"eslint-plugin-prettier": "5.5.6",
"eslint-plugin-rxjs": "5.0.3",
@@ -134,10 +132,10 @@
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.2.0",
"lint-staged": "17.0.5",
"lint-staged": "17.2.0",
"ng-packagr": "20.3.2",
"nx": "22.7.4",
"prettier": "3.8.3",
"nx": "22.7.7",
"prettier": "3.9.6",
"react": "19.2.6",
"react-dom": "19.2.6",
"rimraf": "6.1.3",
@@ -149,8 +147,7 @@
"stylelint-config-standard-scss": "13.1.0",
"ts-node": "10.9.2",
"typescript": "5.9.3",
"undici": "8.5.0",
"webpack": "5.105.0"
"webpack": "5.109.0"
},
"license": "Apache-2.0",
"engines": {
+1575 -1897
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -17,9 +17,9 @@ overrides:
ws: '>=8.20.1'
path-to-regexp: '>=0.1.13'
postcss: '>=8.5.10'
webpack: '5.105.0'
webpack-dev-server: '>=5.2.4'
uuid: '>=11.1.1'
undici: 8.7.0
allowBuilds:
'@parcel/watcher': true