1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 01:41:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

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:
sunnylqm
2025-05-14 16:08:27 +08:00
parent 59c5be2719
commit ebfb9dd4b9
13 changed files with 52 additions and 34 deletions

View File

@@ -12,7 +12,8 @@
"noDoubleEquals": "off" "noDoubleEquals": "off"
}, },
"style": { "style": {
"noNonNullAssertion": "off" "noNonNullAssertion": "off",
"useNodejsImportProtocol": "off"
}, },
"a11y": { "a11y": {
"useValidAnchor": "off" "useValidAnchor": "off"

View File

@@ -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": {

View File

@@ -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';

View File

@@ -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'));

View File

@@ -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,

View File

@@ -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) {

View File

@@ -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';

View File

@@ -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 = [

View File

@@ -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';

View File

@@ -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;

View File

@@ -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';

View File

@@ -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,

View File

@@ -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';