mirror of
				https://gitcode.com/github-mirrors/react-native-update-cli.git
				synced 2025-10-31 23:03:11 +08:00 
			
		
		
		
	Update version to 1.44.6, add Node.js import protocol setting, and clean up import statements across multiple files
This commit is contained in:
		| @@ -12,7 +12,8 @@ | |||||||
|         "noDoubleEquals": "off" |         "noDoubleEquals": "off" | ||||||
|       }, |       }, | ||||||
|       "style": { |       "style": { | ||||||
|         "noNonNullAssertion": "off" |         "noNonNullAssertion": "off", | ||||||
|  |         "useNodejsImportProtocol": "off" | ||||||
|       }, |       }, | ||||||
|       "a11y": { |       "a11y": { | ||||||
|         "useValidAnchor": "off" |         "useValidAnchor": "off" | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "react-native-update-cli", |   "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)", |   "description": "command line tool for react-native-update (remote updates for react native)", | ||||||
|   "main": "index.js", |   "main": "index.js", | ||||||
|   "bin": { |   "bin": { | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import fetch from 'node-fetch'; | import fetch from 'node-fetch'; | ||||||
| import fs from 'node:fs'; | import fs from 'fs'; | ||||||
| import util from 'node:util'; | import util from 'util'; | ||||||
| import path from 'node:path'; | import path from 'path'; | ||||||
| import ProgressBar from 'progress'; | import ProgressBar from 'progress'; | ||||||
| import packageJson from '../package.json'; | import packageJson from '../package.json'; | ||||||
| import tcpp from 'tcp-ping'; | import tcpp from 'tcp-ping'; | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								src/app.ts
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								src/app.ts
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | |||||||
| import { question } from './utils'; | import { question } from './utils'; | ||||||
| import fs from 'node:fs'; | import fs from 'fs'; | ||||||
| import Table from 'tty-table'; | import Table from 'tty-table'; | ||||||
|  |  | ||||||
| import { post, get, doDelete } from './api'; | import { post, get, doDelete } from './api'; | ||||||
| @@ -8,7 +8,6 @@ import { t } from './utils/i18n'; | |||||||
|  |  | ||||||
| const validPlatforms = ['ios', 'android', 'harmony']; | const validPlatforms = ['ios', 'android', 'harmony']; | ||||||
|  |  | ||||||
|  |  | ||||||
| export function checkPlatform(platform: Platform) { | export function checkPlatform(platform: Platform) { | ||||||
|   if (!validPlatforms.includes(platform)) { |   if (!validPlatforms.includes(platform)) { | ||||||
|     throw new Error(t('unsupportedPlatform', { platform })); |     throw new Error(t('unsupportedPlatform', { platform })); | ||||||
| @@ -79,7 +78,13 @@ export const commands = { | |||||||
|       options: { platform }, |       options: { platform }, | ||||||
|     }); |     }); | ||||||
|   }, |   }, | ||||||
|   deleteApp: async ({ args, options }: { args: string[]; options: { platform: Platform } }) => { |   deleteApp: async ({ | ||||||
|  |     args, | ||||||
|  |     options, | ||||||
|  |   }: { | ||||||
|  |     args: string[]; | ||||||
|  |     options: { platform: Platform }; | ||||||
|  |   }) => { | ||||||
|     const { platform } = options; |     const { platform } = options; | ||||||
|     const id = args[0] || chooseApp(platform); |     const id = args[0] || chooseApp(platform); | ||||||
|     if (!id) { |     if (!id) { | ||||||
| @@ -92,7 +97,13 @@ export const commands = { | |||||||
|     const { platform } = options; |     const { platform } = options; | ||||||
|     listApp(platform); |     listApp(platform); | ||||||
|   }, |   }, | ||||||
|   selectApp: async ({ args, options }: { args: string[]; options: { platform: Platform } }) => { |   selectApp: async ({ | ||||||
|  |     args, | ||||||
|  |     options, | ||||||
|  |   }: { | ||||||
|  |     args: string[]; | ||||||
|  |     options: { platform: Platform }; | ||||||
|  |   }) => { | ||||||
|     const platform = checkPlatform( |     const platform = checkPlatform( | ||||||
|       options.platform || (await question(t('platformQuestion'))), |       options.platform || (await question(t('platformQuestion'))), | ||||||
|     ); |     ); | ||||||
| @@ -100,7 +111,9 @@ export const commands = { | |||||||
|       ? Number.parseInt(args[0]) |       ? Number.parseInt(args[0]) | ||||||
|       : (await chooseApp(platform)).id; |       : (await chooseApp(platform)).id; | ||||||
|  |  | ||||||
|     let updateInfo: Partial<Record<Platform, { appId: number; appKey: string }>> = {}; |     let updateInfo: Partial< | ||||||
|  |       Record<Platform, { appId: number; appKey: string }> | ||||||
|  |     > = {}; | ||||||
|     if (fs.existsSync('update.json')) { |     if (fs.existsSync('update.json')) { | ||||||
|       try { |       try { | ||||||
|         updateInfo = JSON.parse(fs.readFileSync('update.json', 'utf8')); |         updateInfo = JSON.parse(fs.readFileSync('update.json', 'utf8')); | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| import path from 'node:path'; | import path from 'path'; | ||||||
| import { translateOptions } from './utils'; | import { translateOptions } from './utils'; | ||||||
| import * as fs from 'fs-extra'; | import * as fs from 'fs-extra'; | ||||||
| import { ZipFile as YazlZipFile } from 'yazl'; | import { ZipFile as YazlZipFile } from 'yazl'; | ||||||
| @@ -9,10 +9,10 @@ import { | |||||||
| } from 'yauzl'; | } from 'yauzl'; | ||||||
| import { question, checkPlugins } from './utils'; | import { question, checkPlugins } from './utils'; | ||||||
| import { checkPlatform } from './app'; | import { checkPlatform } from './app'; | ||||||
| import { spawn, spawnSync } from 'node:child_process'; | import { spawn, spawnSync } from 'child_process'; | ||||||
| import semverSatisfies from 'semver/functions/satisfies'; | import semverSatisfies from 'semver/functions/satisfies'; | ||||||
| const g2js = require('gradle-to-js/lib/parser'); | const g2js = require('gradle-to-js/lib/parser'); | ||||||
| import os from 'node:os'; | import os from 'os'; | ||||||
| const properties = require('properties'); | const properties = require('properties'); | ||||||
| import { depVersions } from './utils/dep-versions'; | import { depVersions } from './utils/dep-versions'; | ||||||
| import { t } from './utils/i18n'; | import { t } from './utils/i18n'; | ||||||
| @@ -901,7 +901,7 @@ function diffArgsCheck(args: string[], options: any, diffFn: string) { | |||||||
| } | } | ||||||
|  |  | ||||||
| export const commands = { | export const commands = { | ||||||
|   bundle: async function ({ options }) { |   bundle: async ({ options }) => { | ||||||
|     const platform = checkPlatform( |     const platform = checkPlatform( | ||||||
|       options.platform || (await question(t('platformPrompt'))), |       options.platform || (await question(t('platformPrompt'))), | ||||||
|     ); |     ); | ||||||
| @@ -970,7 +970,7 @@ export const commands = { | |||||||
|           metaInfo, |           metaInfo, | ||||||
|         }, |         }, | ||||||
|       }); |       }); | ||||||
|        |  | ||||||
|       if (isSentry) { |       if (isSentry) { | ||||||
|         await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput); |         await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput); | ||||||
|         await uploadSourcemapForSentry( |         await uploadSourcemapForSentry( | ||||||
| @@ -990,7 +990,11 @@ export const commands = { | |||||||
|           }, |           }, | ||||||
|         }); |         }); | ||||||
|         if (isSentry) { |         if (isSentry) { | ||||||
|           await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput); |           await copyDebugidForSentry( | ||||||
|  |             bundleName, | ||||||
|  |             intermediaDir, | ||||||
|  |             sourcemapOutput, | ||||||
|  |           ); | ||||||
|           await uploadSourcemapForSentry( |           await uploadSourcemapForSentry( | ||||||
|             bundleName, |             bundleName, | ||||||
|             intermediaDir, |             intermediaDir, | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import { question } from './utils'; | import { question } from './utils'; | ||||||
| import { post, get, replaceSession, saveSession, closeSession } from './api'; | import { post, get, replaceSession, saveSession, closeSession } from './api'; | ||||||
| import crypto from 'node:crypto'; | import crypto from 'crypto'; | ||||||
| import { t } from './utils/i18n'; | import { t } from './utils/i18n'; | ||||||
|  |  | ||||||
| function md5(str: string) { | function md5(str: string) { | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| import fs from 'node:fs'; | import fs from 'fs'; | ||||||
| // import path from 'node:path'; | // import path from 'path'; | ||||||
| import { credentialFile, tempDir } from './constants'; | import { credentialFile, tempDir } from './constants'; | ||||||
| import { t } from './i18n'; | import { t } from './i18n'; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| import fs from 'node:fs'; | import fs from 'fs'; | ||||||
| import path from 'node:path'; | import path from 'path'; | ||||||
| import { t } from './i18n'; | import { t } from './i18n'; | ||||||
|  |  | ||||||
| const lockFiles = [ | const lockFiles = [ | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| import path from 'node:path'; | import path from 'path'; | ||||||
|  |  | ||||||
| const scriptName = path.basename(process.argv[1]) as 'cresc' | 'pushy'; | const scriptName = path.basename(process.argv[1]) as 'cresc' | 'pushy'; | ||||||
| export const IS_CRESC = scriptName === 'cresc'; | export const IS_CRESC = scriptName === 'cresc'; | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import git from 'isomorphic-git'; | import git from 'isomorphic-git'; | ||||||
| import fs from 'node:fs'; | import fs from 'fs'; | ||||||
| import path from 'node:path'; | import path from 'path'; | ||||||
|  |  | ||||||
| export interface CommitInfo { | export interface CommitInfo { | ||||||
|   hash: string; |   hash: string; | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import fs from 'fs-extra'; | import fs from 'fs-extra'; | ||||||
| import os from 'node:os'; | import os from 'os'; | ||||||
| import path from 'node:path'; | import path from 'path'; | ||||||
| import pkg from '../../package.json'; | import pkg from '../../package.json'; | ||||||
| import AppInfoParser from './app-info-parser'; | import AppInfoParser from './app-info-parser'; | ||||||
| import semverSatisfies from 'semver/functions/satisfies'; | import semverSatisfies from 'semver/functions/satisfies'; | ||||||
|   | |||||||
| @@ -12,8 +12,8 @@ import { | |||||||
|   underline, |   underline, | ||||||
|   yellow, |   yellow, | ||||||
| } from '@colors/colors/safe'; | } from '@colors/colors/safe'; | ||||||
| import { existsSync, readFileSync } from 'node:fs'; | import { existsSync, readFileSync } from 'fs'; | ||||||
| import { dirname } from 'node:path'; | import { dirname } from 'path'; | ||||||
| import latestVersion, { | import latestVersion, { | ||||||
|   type Package, |   type Package, | ||||||
|   type PackageJson, |   type PackageJson, | ||||||
|   | |||||||
| @@ -1,14 +1,14 @@ | |||||||
| import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; | import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'; | ||||||
| import type { | import type { | ||||||
|   RequestOptions as HttpRequestOptions, |   RequestOptions as HttpRequestOptions, | ||||||
|   Agent, |   Agent, | ||||||
|   IncomingMessage, |   IncomingMessage, | ||||||
| } from 'node:http'; | } from 'http'; | ||||||
| import type { RequestOptions as HttpsRequestOptions } from 'node:https'; | import type { RequestOptions as HttpsRequestOptions } from 'https'; | ||||||
| import { join, dirname, resolve as pathResolve, parse } from 'node:path'; | import { join, dirname, resolve as pathResolve, parse } from 'path'; | ||||||
| import { npm, yarn } from 'global-dirs'; | import { npm, yarn } from 'global-dirs'; | ||||||
| import { homedir } from 'node:os'; | import { homedir } from 'os'; | ||||||
| import { URL } from 'node:url'; | import { URL } from 'url'; | ||||||
|  |  | ||||||
| import getRegistryUrl from 'registry-auth-token/registry-url'; | import getRegistryUrl from 'registry-auth-token/registry-url'; | ||||||
| import registryAuthToken from 'registry-auth-token'; | import registryAuthToken from 'registry-auth-token'; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 sunnylqm
					sunnylqm