mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 01:41:37 +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"
|
||||
},
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
"noNonNullAssertion": "off",
|
||||
"useNodejsImportProtocol": "off"
|
||||
},
|
||||
"a11y": {
|
||||
"useValidAnchor": "off"
|
||||
|
@@ -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": {
|
||||
|
@@ -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';
|
||||
|
23
src/app.ts
23
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<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'));
|
||||
|
@@ -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,
|
||||
|
@@ -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) {
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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 = [
|
||||
|
@@ -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';
|
||||
|
@@ -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;
|
||||
|
@@ -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';
|
||||
|
@@ -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,
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user