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"
},
"style": {
"noNonNullAssertion": "off"
"noNonNullAssertion": "off",
"useNodejsImportProtocol": "off"
},
"a11y": {
"useValidAnchor": "off"

View File

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

View File

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

View File

@@ -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<Record<Platform, { appId: number; appKey: string }>> = {};
let updateInfo: Partial<
Record<Platform, { appId: number; appKey: string }>
> = {};
if (fs.existsSync('update.json')) {
try {
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 * 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'))),
);
@@ -990,7 +990,11 @@ export const commands = {
},
});
if (isSentry) {
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
await copyDebugidForSentry(
bundleName,
intermediaDir,
sourcemapOutput,
);
await uploadSourcemapForSentry(
bundleName,
intermediaDir,

View File

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

View File

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

View File

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

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';
export const IS_CRESC = scriptName === 'cresc';

View File

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

View File

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

View File

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

View File

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