diff --git a/biome.json b/biome.json index 4dee737..b90f65d 100644 --- a/biome.json +++ b/biome.json @@ -12,7 +12,8 @@ "noDoubleEquals": "off" }, "style": { - "noNonNullAssertion": "off" + "noNonNullAssertion": "off", + "useNodejsImportProtocol": "off" }, "a11y": { "useValidAnchor": "off" diff --git a/package.json b/package.json index 51235d1..2e7073a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-update-cli", - "version": "1.44.5", + "version": "1.44.6", "description": "command line tool for react-native-update (remote updates for react native)", "main": "index.js", "bin": { diff --git a/src/api.ts b/src/api.ts index 454ae29..9c9a5d9 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,7 +1,7 @@ import fetch from 'node-fetch'; -import fs from 'node:fs'; -import util from 'node:util'; -import path from 'node:path'; +import fs from 'fs'; +import util from 'util'; +import path from 'path'; import ProgressBar from 'progress'; import packageJson from '../package.json'; import tcpp from 'tcp-ping'; diff --git a/src/app.ts b/src/app.ts index fb6fb5b..09f82fd 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,5 +1,5 @@ import { question } from './utils'; -import fs from 'node:fs'; +import fs from 'fs'; import Table from 'tty-table'; import { post, get, doDelete } from './api'; @@ -8,7 +8,6 @@ import { t } from './utils/i18n'; const validPlatforms = ['ios', 'android', 'harmony']; - export function checkPlatform(platform: Platform) { if (!validPlatforms.includes(platform)) { throw new Error(t('unsupportedPlatform', { platform })); @@ -79,7 +78,13 @@ export const commands = { options: { platform }, }); }, - deleteApp: async ({ args, options }: { args: string[]; options: { platform: Platform } }) => { + deleteApp: async ({ + args, + options, + }: { + args: string[]; + options: { platform: Platform }; + }) => { const { platform } = options; const id = args[0] || chooseApp(platform); if (!id) { @@ -92,7 +97,13 @@ export const commands = { const { platform } = options; listApp(platform); }, - selectApp: async ({ args, options }: { args: string[]; options: { platform: Platform } }) => { + selectApp: async ({ + args, + options, + }: { + args: string[]; + options: { platform: Platform }; + }) => { const platform = checkPlatform( options.platform || (await question(t('platformQuestion'))), ); @@ -100,7 +111,9 @@ export const commands = { ? Number.parseInt(args[0]) : (await chooseApp(platform)).id; - let updateInfo: Partial> = {}; + let updateInfo: Partial< + Record + > = {}; if (fs.existsSync('update.json')) { try { updateInfo = JSON.parse(fs.readFileSync('update.json', 'utf8')); diff --git a/src/bundle.ts b/src/bundle.ts index 5a58b1c..116909a 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -1,4 +1,4 @@ -import path from 'node:path'; +import path from 'path'; import { translateOptions } from './utils'; import * as fs from 'fs-extra'; import { ZipFile as YazlZipFile } from 'yazl'; @@ -9,10 +9,10 @@ import { } from 'yauzl'; import { question, checkPlugins } from './utils'; import { checkPlatform } from './app'; -import { spawn, spawnSync } from 'node:child_process'; +import { spawn, spawnSync } from 'child_process'; import semverSatisfies from 'semver/functions/satisfies'; const g2js = require('gradle-to-js/lib/parser'); -import os from 'node:os'; +import os from 'os'; const properties = require('properties'); import { depVersions } from './utils/dep-versions'; import { t } from './utils/i18n'; @@ -901,7 +901,7 @@ function diffArgsCheck(args: string[], options: any, diffFn: string) { } export const commands = { - bundle: async function ({ options }) { + bundle: async ({ options }) => { const platform = checkPlatform( options.platform || (await question(t('platformPrompt'))), ); @@ -970,7 +970,7 @@ export const commands = { metaInfo, }, }); - + if (isSentry) { await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput); await uploadSourcemapForSentry( @@ -990,7 +990,11 @@ export const commands = { }, }); if (isSentry) { - await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput); + await copyDebugidForSentry( + bundleName, + intermediaDir, + sourcemapOutput, + ); await uploadSourcemapForSentry( bundleName, intermediaDir, diff --git a/src/user.ts b/src/user.ts index e877080..c96de73 100644 --- a/src/user.ts +++ b/src/user.ts @@ -1,6 +1,6 @@ import { question } from './utils'; import { post, get, replaceSession, saveSession, closeSession } from './api'; -import crypto from 'node:crypto'; +import crypto from 'crypto'; import { t } from './utils/i18n'; function md5(str: string) { diff --git a/src/utils/add-gitignore.ts b/src/utils/add-gitignore.ts index 8e26e76..8bf85b5 100644 --- a/src/utils/add-gitignore.ts +++ b/src/utils/add-gitignore.ts @@ -1,5 +1,5 @@ -import fs from 'node:fs'; -// import path from 'node:path'; +import fs from 'fs'; +// import path from 'path'; import { credentialFile, tempDir } from './constants'; import { t } from './i18n'; diff --git a/src/utils/check-lockfile.ts b/src/utils/check-lockfile.ts index c0bc0ad..29df8d2 100644 --- a/src/utils/check-lockfile.ts +++ b/src/utils/check-lockfile.ts @@ -1,5 +1,5 @@ -import fs from 'node:fs'; -import path from 'node:path'; +import fs from 'fs'; +import path from 'path'; import { t } from './i18n'; const lockFiles = [ diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 0c4398a..7d36ac7 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,4 +1,4 @@ -import path from 'node:path'; +import path from 'path'; const scriptName = path.basename(process.argv[1]) as 'cresc' | 'pushy'; export const IS_CRESC = scriptName === 'cresc'; diff --git a/src/utils/git.ts b/src/utils/git.ts index a03a5ea..a708e0a 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -1,6 +1,6 @@ import git from 'isomorphic-git'; -import fs from 'node:fs'; -import path from 'node:path'; +import fs from 'fs'; +import path from 'path'; export interface CommitInfo { hash: string; diff --git a/src/utils/index.ts b/src/utils/index.ts index f8c7cb4..5aeae34 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,6 @@ import fs from 'fs-extra'; -import os from 'node:os'; -import path from 'node:path'; +import os from 'os'; +import path from 'path'; import pkg from '../../package.json'; import AppInfoParser from './app-info-parser'; import semverSatisfies from 'semver/functions/satisfies'; diff --git a/src/utils/latest-version/cli.ts b/src/utils/latest-version/cli.ts index fd4c532..4b0d037 100644 --- a/src/utils/latest-version/cli.ts +++ b/src/utils/latest-version/cli.ts @@ -12,8 +12,8 @@ import { underline, yellow, } from '@colors/colors/safe'; -import { existsSync, readFileSync } from 'node:fs'; -import { dirname } from 'node:path'; +import { existsSync, readFileSync } from 'fs'; +import { dirname } from 'path'; import latestVersion, { type Package, type PackageJson, diff --git a/src/utils/latest-version/index.ts b/src/utils/latest-version/index.ts index 6052ca4..332d0cb 100644 --- a/src/utils/latest-version/index.ts +++ b/src/utils/latest-version/index.ts @@ -1,14 +1,14 @@ -import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'; import type { RequestOptions as HttpRequestOptions, Agent, IncomingMessage, -} from 'node:http'; -import type { RequestOptions as HttpsRequestOptions } from 'node:https'; -import { join, dirname, resolve as pathResolve, parse } from 'node:path'; +} from 'http'; +import type { RequestOptions as HttpsRequestOptions } from 'https'; +import { join, dirname, resolve as pathResolve, parse } from 'path'; import { npm, yarn } from 'global-dirs'; -import { homedir } from 'node:os'; -import { URL } from 'node:url'; +import { homedir } from 'os'; +import { URL } from 'url'; import getRegistryUrl from 'registry-auth-token/registry-url'; import registryAuthToken from 'registry-auth-token';