Bump Node.js environment to 18.x
- Bump Node.js to version 18. This change is necessary as Node.js v16 will reach end-of-life on 2023-09-11. It also ensure compatibility with dependencies requiring minimum of Node.js v18, such as `vite`, `@vitejs`plugin-legacy` and `icon-gen`. - Bump `setup-node` action to v4. - Recommend using the `nvm` tool for managing Node.js versions in the documentation. - Update documentation to point to code reference for required Node.js version. This removes duplication of information, and keeps the code as single source of truth for required Node.js version. - Refactor code to adopt the `node:` protocol for Node API imports as per Node.js 18 standards. This change addresses ambiguities and aligns with Node.js best practices (nodejs/node#38343). Currently, there is no ESLint rule to enforce this protocol, as noted in import-js/eslint-plugin-import#2717. - Replace `cross-fetch` dependency with the native Node.js fetch API introduced in Node.js 18. Adjust type casting for async iterable read streams to align with the latest Node.js APIs, based on discussions in DefinitelyTyped/DefinitelyTyped#65542.
This commit is contained in:
4
.github/actions/setup-node/action.yml
vendored
4
.github/actions/setup-node/action.yml
vendored
@@ -3,6 +3,6 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Setup node
|
name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 18.x
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ See [ci-cd.md](./ci-cd.md) for more information.
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- Install Node >16.x.
|
- Install Node.js:
|
||||||
|
- Refer to [action.yml](./../.github/actions/setup-node/action.yml) for the minimum required version compatible with the automated workflows.
|
||||||
|
- 💡 Recommended: Use [`nvm`](https://github.com/nvm-sh/nvm) CLI to install and switch between Node.js versions.
|
||||||
- Install dependencies using `npm install` (or [`npm run install-deps`](#utility-scripts) for more options).
|
- Install dependencies using `npm install` (or [`npm run install-deps`](#utility-scripts) for more options).
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
/* eslint-disable no-template-curly-in-string */
|
||||||
|
|
||||||
const { join } = require('path');
|
const { join } = require('node:path');
|
||||||
const { electronBundled, electronUnbundled } = require('./dist-dirs.json');
|
const { electronBundled, electronUnbundled } = require('./dist-dirs.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { resolve } from 'path';
|
import { resolve } from 'node:path';
|
||||||
import { mergeConfig, UserConfig } from 'vite';
|
import { mergeConfig, UserConfig } from 'vite';
|
||||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
|
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
|
||||||
import { getAliasesFromTsConfig, getClientEnvironmentVariables } from './vite-config-helper';
|
import { getAliasesFromTsConfig, getClientEnvironmentVariables } from './vite-config-helper';
|
||||||
|
|||||||
86
package-lock.json
generated
86
package-lock.json
generated
@@ -6,13 +6,12 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "privacy.sexy",
|
"name": "privacy.sexy",
|
||||||
"version": "0.12.8",
|
"version": "0.12.9",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@floating-ui/vue": "^1.0.2",
|
"@floating-ui/vue": "^1.0.2",
|
||||||
"@juggle/resize-observer": "^3.4.0",
|
"@juggle/resize-observer": "^3.4.0",
|
||||||
"ace-builds": "^1.30.0",
|
"ace-builds": "^1.30.0",
|
||||||
"cross-fetch": "^4.0.0",
|
|
||||||
"electron-log": "^5.0.1",
|
"electron-log": "^5.0.1",
|
||||||
"electron-progressbar": "^2.1.0",
|
"electron-progressbar": "^2.1.0",
|
||||||
"electron-updater": "^6.1.4",
|
"electron-updater": "^6.1.4",
|
||||||
@@ -5819,14 +5818,6 @@
|
|||||||
"buffer": "^5.1.0"
|
"buffer": "^5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-fetch": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==",
|
|
||||||
"dependencies": {
|
|
||||||
"node-fetch": "^2.6.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
@@ -12128,44 +12119,6 @@
|
|||||||
"integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
|
"integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
|
||||||
"dependencies": {
|
|
||||||
"whatwg-url": "^5.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "4.x || >=6.0.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"encoding": "^0.1.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"encoding": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/node-fetch/node_modules/tr46": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
|
||||||
},
|
|
||||||
"node_modules/node-fetch/node_modules/webidl-conversions": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
|
||||||
},
|
|
||||||
"node_modules/node-fetch/node_modules/whatwg-url": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
|
||||||
"dependencies": {
|
|
||||||
"tr46": "~0.0.3",
|
|
||||||
"webidl-conversions": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/node-releases": {
|
"node_modules/node-releases": {
|
||||||
"version": "2.0.13",
|
"version": "2.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
||||||
@@ -23815,14 +23768,6 @@
|
|||||||
"buffer": "^5.1.0"
|
"buffer": "^5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cross-fetch": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==",
|
|
||||||
"requires": {
|
|
||||||
"node-fetch": "^2.6.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"cross-spawn": {
|
"cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
@@ -28498,35 +28443,6 @@
|
|||||||
"integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
|
"integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
|
||||||
"requires": {
|
|
||||||
"whatwg-url": "^5.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tr46": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
|
||||||
},
|
|
||||||
"webidl-conversions": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
|
||||||
},
|
|
||||||
"whatwg-url": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
|
||||||
"requires": {
|
|
||||||
"tr46": "~0.0.3",
|
|
||||||
"webidl-conversions": "^3.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node-releases": {
|
"node-releases": {
|
||||||
"version": "2.0.13",
|
"version": "2.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
"@floating-ui/vue": "^1.0.2",
|
"@floating-ui/vue": "^1.0.2",
|
||||||
"@juggle/resize-observer": "^3.4.0",
|
"@juggle/resize-observer": "^3.4.0",
|
||||||
"ace-builds": "^1.30.0",
|
"ace-builds": "^1.30.0",
|
||||||
"cross-fetch": "^4.0.0",
|
|
||||||
"electron-log": "^5.0.1",
|
"electron-log": "^5.0.1",
|
||||||
"electron-progressbar": "^2.1.0",
|
"electron-progressbar": "^2.1.0",
|
||||||
"electron-updater": "^6.1.4",
|
"electron-updater": "^6.1.4",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
import { resolve, join } from 'path';
|
import { resolve, join } from 'node:path';
|
||||||
import { rm, mkdtemp, stat } from 'fs/promises';
|
import { rm, mkdtemp, stat } from 'node:fs/promises';
|
||||||
import { spawn } from 'child_process';
|
import { spawn } from 'node:child_process';
|
||||||
import { URL, fileURLToPath } from 'url';
|
import { URL, fileURLToPath } from 'node:url';
|
||||||
|
|
||||||
class Paths {
|
class Paths {
|
||||||
constructor(selfDirectory) {
|
constructor(selfDirectory) {
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ Note:
|
|||||||
Example: npm run install-deps -- --fresh --non-deterministic
|
Example: npm run install-deps -- --fresh --non-deterministic
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'node:child_process';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'node:path';
|
||||||
import { access, rm, unlink } from 'fs/promises';
|
import { access, rm, unlink } from 'node:fs/promises';
|
||||||
import { constants } from 'fs';
|
import { constants } from 'node:fs';
|
||||||
|
|
||||||
const MAX_RETRIES = 5;
|
const MAX_RETRIES = 5;
|
||||||
const RETRY_DELAY_IN_MS = 5 /* seconds */ * 1000;
|
const RETRY_DELAY_IN_MS = 5 /* seconds */ * 1000;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
* --web Path for the web application
|
* --web Path for the web application
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'node:path';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'node:fs/promises';
|
||||||
|
|
||||||
const DIST_DIRS_JSON_FILE_PATH = resolve(process.cwd(), 'dist-dirs.json'); // cannot statically import because ESLint does not support it https://github.com/eslint/eslint/discussions/15305
|
const DIST_DIRS_JSON_FILE_PATH = resolve(process.cwd(), 'dist-dirs.json'); // cannot statically import because ESLint does not support it https://github.com/eslint/eslint/discussions/15305
|
||||||
const CLI_ARGUMENTS = process.argv.slice(2);
|
const CLI_ARGUMENTS = process.argv.slice(2);
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
* --web Verify artifacts for the web application.
|
* --web Verify artifacts for the web application.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { access, readdir } from 'fs/promises';
|
import { access, readdir } from 'node:fs/promises';
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'node:child_process';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
const PROCESS_ARGUMENTS = process.argv.slice(2);
|
const PROCESS_ARGUMENTS = process.argv.slice(2);
|
||||||
const PRINT_DIST_DIR_SCRIPT_BASE_COMMAND = 'node scripts/print-dist-dir';
|
const PRINT_DIST_DIR_SCRIPT_BASE_COMMAND = 'node scripts/print-dist-dir';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/// <reference types="electron-vite/node" />
|
/// <reference types="electron-vite/node" />
|
||||||
import { join } from 'path';
|
import { join } from 'node:path';
|
||||||
import appIcon from '@/presentation/public/icon.png?asset';
|
import appIcon from '@/presentation/public/icon.png?asset';
|
||||||
|
|
||||||
export const APP_ICON_PATH = appIcon;
|
export const APP_ICON_PATH = appIcon;
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import { existsSync, createWriteStream } from 'fs';
|
import { existsSync, createWriteStream, type WriteStream } from 'node:fs';
|
||||||
import { unlink, mkdir } from 'fs/promises';
|
import { unlink, mkdir } from 'node:fs/promises';
|
||||||
import path from 'path';
|
import path from 'node:path';
|
||||||
import { app } from 'electron';
|
import { app } from 'electron';
|
||||||
import { UpdateInfo } from 'electron-updater';
|
import { UpdateInfo } from 'electron-updater';
|
||||||
import fetch from 'cross-fetch';
|
|
||||||
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
||||||
import { UpdateProgressBar } from '../UpdateProgressBar';
|
import { UpdateProgressBar } from '../UpdateProgressBar';
|
||||||
import { retryFileSystemAccess } from './RetryFileSystemAccess';
|
import { retryFileSystemAccess } from './RetryFileSystemAccess';
|
||||||
import type { WriteStream } from 'fs';
|
import type { ReadableStream } from 'node:stream/web';
|
||||||
import type { Readable } from 'stream';
|
|
||||||
|
|
||||||
const MAX_PROGRESS_LOG_ENTRIES = 10;
|
const MAX_PROGRESS_LOG_ENTRIES = 10;
|
||||||
const UNKNOWN_SIZE_LOG_INTERVAL_BYTES = 10 * 1024 * 1024; // 10 MB
|
const UNKNOWN_SIZE_LOG_INTERVAL_BYTES = 10 * 1024 * 1024; // 10 MB
|
||||||
@@ -128,13 +126,13 @@ function getContentLengthFromResponse(response: Response): ResponseContentLength
|
|||||||
|
|
||||||
async function withReadableStream(
|
async function withReadableStream(
|
||||||
response: Response,
|
response: Response,
|
||||||
handler: (readStream: Readable) => Promise<void>,
|
handler: (readStream: ReadableStream) => Promise<void>,
|
||||||
) {
|
) {
|
||||||
const reader = createReader(response);
|
const reader = createReader(response);
|
||||||
try {
|
try {
|
||||||
await handler(reader);
|
await handler(reader);
|
||||||
} finally {
|
} finally {
|
||||||
reader.destroy();
|
reader.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +150,7 @@ async function withWriteStream(
|
|||||||
|
|
||||||
async function streamWithProgress(
|
async function streamWithProgress(
|
||||||
contentLength: ResponseContentLength,
|
contentLength: ResponseContentLength,
|
||||||
readStream: Readable,
|
readStream: ReadableStream,
|
||||||
writeStream: WriteStream,
|
writeStream: WriteStream,
|
||||||
progressHandler: ProgressCallback,
|
progressHandler: ProgressCallback,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
@@ -212,12 +210,13 @@ function shouldLogProgress(
|
|||||||
return { shouldLog: false, nextLogThreshold: previousLogThreshold };
|
return { shouldLog: false, nextLogThreshold: previousLogThreshold };
|
||||||
}
|
}
|
||||||
|
|
||||||
function createReader(response: Response): Readable {
|
function createReader(response: Response): ReadableStream {
|
||||||
if (!response.body) {
|
if (!response.body) {
|
||||||
throw new Error('Response body is empty, cannot proceed with download.');
|
throw new Error('Response body is empty, cannot proceed with download.');
|
||||||
}
|
}
|
||||||
// On browser, we could use browser API response.body.getReader()
|
// TypeScript has removed the async iterator type definition for ReadableStream due to
|
||||||
// But here, we use cross-fetch that gets node-fetch on a node application
|
// limited browser support. Node.js, however, supports async iterable streams, allowing
|
||||||
// This API is node-fetch specific, see https://github.com/node-fetch/node-fetch#streams
|
// type casting to function properly in this context.
|
||||||
return response.body as unknown as Readable;
|
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/65542#discussioncomment-6071004
|
||||||
|
return response.body as ReadableStream;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createHash } from 'crypto';
|
import { createHash } from 'node:crypto';
|
||||||
import { createReadStream } from 'fs';
|
import { createReadStream } from 'node:fs';
|
||||||
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
||||||
import { retryFileSystemAccess } from './RetryFileSystemAccess';
|
import { retryFileSystemAccess } from './RetryFileSystemAccess';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { unlink, readFile } from 'fs/promises';
|
import { unlink, readFile } from 'node:fs/promises';
|
||||||
import { join } from 'path';
|
import { join } from 'node:path';
|
||||||
import { log, die, LogLevel } from '../utils/log';
|
import { log, die, LogLevel } from '../utils/log';
|
||||||
import { exists } from '../utils/io';
|
import { exists } from '../utils/io';
|
||||||
import { SupportedPlatform, CURRENT_PLATFORM } from '../utils/platform';
|
import { SupportedPlatform, CURRENT_PLATFORM } from '../utils/platform';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { join } from 'path';
|
import { join } from 'node:path';
|
||||||
import { readdir } from 'fs/promises';
|
import { readdir } from 'node:fs/promises';
|
||||||
import { die } from '../../../utils/log';
|
import { die } from '../../../utils/log';
|
||||||
import { exists } from '../../../utils/io';
|
import { exists } from '../../../utils/io';
|
||||||
import { getAppName } from '../../../utils/npm';
|
import { getAppName } from '../../../utils/npm';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { access, chmod } from 'fs/promises';
|
import { access, chmod } from 'node:fs/promises';
|
||||||
import { constants } from 'fs';
|
import { constants } from 'node:fs';
|
||||||
import { log } from '../../utils/log';
|
import { log } from '../../utils/log';
|
||||||
import { ExtractionResult } from './common/extraction-result';
|
import { ExtractionResult } from './common/extraction-result';
|
||||||
import { findByFilePattern } from './common/app-artifact-locator';
|
import { findByFilePattern } from './common/app-artifact-locator';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { mkdtemp, rm } from 'fs/promises';
|
import { mkdtemp, rm } from 'node:fs/promises';
|
||||||
import { join } from 'path';
|
import { join } from 'node:path';
|
||||||
import { tmpdir } from 'os';
|
import { tmpdir } from 'node:os';
|
||||||
import { exists } from '../../utils/io';
|
import { exists } from '../../utils/io';
|
||||||
import { log, die, LogLevel } from '../../utils/log';
|
import { log, die, LogLevel } from '../../utils/log';
|
||||||
import { runCommand } from '../../utils/run-command';
|
import { runCommand } from '../../utils/run-command';
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { spawn } from 'child_process';
|
import { spawn, type ChildProcess } from 'node:child_process';
|
||||||
import { log, LogLevel, die } from '../utils/log';
|
import { log, LogLevel, die } from '../utils/log';
|
||||||
import { captureScreen } from './system-capture/screen-capture';
|
import { captureScreen } from './system-capture/screen-capture';
|
||||||
import { captureWindowTitles } from './system-capture/window-title-capture';
|
import { captureWindowTitles } from './system-capture/window-title-capture';
|
||||||
import type { ChildProcess } from 'child_process';
|
|
||||||
|
|
||||||
const TERMINATION_GRACE_PERIOD_IN_SECONDS = 20;
|
const TERMINATION_GRACE_PERIOD_IN_SECONDS = 20;
|
||||||
const TERMINATION_CHECK_INTERVAL_IN_MS = 1000;
|
const TERMINATION_CHECK_INTERVAL_IN_MS = 1000;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { unlink } from 'fs/promises';
|
import { unlink } from 'node:fs/promises';
|
||||||
import { runCommand } from '../../utils/run-command';
|
import { runCommand } from '../../utils/run-command';
|
||||||
import { log, LogLevel } from '../../utils/log';
|
import { log, LogLevel } from '../../utils/log';
|
||||||
import { CURRENT_PLATFORM, SupportedPlatform } from '../../utils/platform';
|
import { CURRENT_PLATFORM, SupportedPlatform } from '../../utils/platform';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { join } from 'path';
|
import { join } from 'node:path';
|
||||||
import distDirs from '@/../dist-dirs.json' assert { type: 'json' };
|
import distDirs from '@/../dist-dirs.json' assert { type: 'json' };
|
||||||
|
|
||||||
export const DESKTOP_BUILD_COMMAND = [
|
export const DESKTOP_BUILD_COMMAND = [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { readdir, access } from 'fs/promises';
|
import { readdir, access } from 'node:fs/promises';
|
||||||
import { constants } from 'fs';
|
import { constants } from 'node:fs';
|
||||||
|
|
||||||
export async function exists(path: string): Promise<boolean> {
|
export async function exists(path: string): Promise<boolean> {
|
||||||
if (!path) { throw new Error('Missing path'); }
|
if (!path) { throw new Error('Missing path'); }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { join } from 'path';
|
import { join } from 'node:path';
|
||||||
import { rm, readFile } from 'fs/promises';
|
import { rm, readFile } from 'node:fs/promises';
|
||||||
import { exists, isDirMissingOrEmpty } from './io';
|
import { exists, isDirMissingOrEmpty } from './io';
|
||||||
import { runCommand } from './run-command';
|
import { runCommand } from './run-command';
|
||||||
import { LogLevel, die, log } from './log';
|
import { LogLevel, die, log } from './log';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { platform } from 'os';
|
import { platform } from 'node:os';
|
||||||
import { die } from './log';
|
import { die } from './log';
|
||||||
|
|
||||||
export enum SupportedPlatform {
|
export enum SupportedPlatform {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { exec } from 'child_process';
|
import { exec, type ExecOptions, type ExecException } from 'node:child_process';
|
||||||
import { indentText } from './text';
|
import { indentText } from './text';
|
||||||
import type { ExecOptions, ExecException } from 'child_process';
|
|
||||||
|
|
||||||
const TIMEOUT_IN_SECONDS = 180;
|
const TIMEOUT_IN_SECONDS = 180;
|
||||||
const MAX_OUTPUT_BUFFER_SIZE = 1024 * 1024; // 1 MB
|
const MAX_OUTPUT_BUFFER_SIZE = 1024 * 1024; // 1 MB
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import fetch from 'cross-fetch';
|
|
||||||
|
|
||||||
export async function fetchWithTimeout(
|
export async function fetchWithTimeout(
|
||||||
url: string,
|
url: string,
|
||||||
timeoutInMs: number,
|
timeoutInMs: number,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { readdirSync, readFileSync } from 'fs';
|
import { readdirSync, readFileSync } from 'node:fs';
|
||||||
import { resolve, join, basename } from 'path';
|
import { resolve, join, basename } from 'node:path';
|
||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { formatAssertionMessage } from '@tests/shared/FormatAssertionMessage';
|
import { formatAssertionMessage } from '@tests/shared/FormatAssertionMessage';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { resolve, dirname } from 'path';
|
import { resolve, dirname } from 'node:path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { VITE_USER_DEFINED_ENVIRONMENT_KEYS } from './src/infrastructure/EnvironmentVariables/Vite/ViteEnvironmentKeys';
|
import { VITE_USER_DEFINED_ENVIRONMENT_KEYS } from './src/infrastructure/EnvironmentVariables/Vite/ViteEnvironmentKeys';
|
||||||
import tsconfigJson from './tsconfig.json' assert { type: 'json' };
|
import tsconfigJson from './tsconfig.json' assert { type: 'json' };
|
||||||
import packageJson from './package.json' assert { type: 'json' };
|
import packageJson from './package.json' assert { type: 'json' };
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/// <reference types="vitest" />
|
/// <reference types="vitest" />
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'node:path';
|
||||||
import { defineConfig, UserConfig } from 'vite';
|
import { defineConfig, UserConfig } from 'vite';
|
||||||
import vue from '@vitejs/plugin-vue';
|
import vue from '@vitejs/plugin-vue';
|
||||||
import legacy from '@vitejs/plugin-legacy';
|
import legacy from '@vitejs/plugin-legacy';
|
||||||
|
|||||||
Reference in New Issue
Block a user