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

Compare commits

...

3 Commits

4 changed files with 10 additions and 38 deletions

View File

@@ -1,17 +1,13 @@
{ {
"name": "react-native-update-cli", "name": "react-native-update-cli",
"version": "2.3.2", "version": "2.4.2",
"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": {
"pushy": "lib/index.js", "pushy": "lib/index.js",
"cresc": "lib/index.js" "cresc": "lib/index.js"
}, },
"files": [ "files": ["lib", "src", "cli.json"],
"lib",
"src",
"cli.json"
],
"scripts": { "scripts": {
"build": "swc src -d lib --strip-leading-paths", "build": "swc src -d lib --strip-leading-paths",
"prepublishOnly": "npm run build && chmod +x lib/index.js", "prepublishOnly": "npm run build && chmod +x lib/index.js",
@@ -21,13 +17,7 @@
"type": "git", "type": "git",
"url": "git+https://github.com/reactnativecn/react-native-update-cli.git" "url": "git+https://github.com/reactnativecn/react-native-update-cli.git"
}, },
"keywords": [ "keywords": ["react-native", "ios", "android", "harmony", "update"],
"react-native",
"ios",
"android",
"harmony",
"update"
],
"author": "reactnativecn", "author": "reactnativecn",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"bugs": { "bugs": {
@@ -81,8 +71,5 @@
"@types/yazl": "^2.4.6", "@types/yazl": "^2.4.6",
"typescript": "^5.8.3" "typescript": "^5.8.3"
}, },
"trustedDependencies": [ "trustedDependencies": ["@biomejs/biome", "@swc/core"]
"@biomejs/biome",
"@swc/core"
]
} }

View File

@@ -578,7 +578,6 @@ async function diffFromPPK(origin: string, next: string, output: string) {
} }
const copies = {}; const copies = {};
const copiesv2 = {};
const zipfile = new YazlZipFile(); const zipfile = new YazlZipFile();
@@ -640,7 +639,6 @@ async function diffFromPPK(origin: string, next: string, output: string) {
addEntry(base); addEntry(base);
} }
copies[entry.fileName] = originMap[entry.crc32]; copies[entry.fileName] = originMap[entry.crc32];
copiesv2[entry.crc32] = entry.fileName;
return; return;
} }
@@ -673,7 +671,7 @@ async function diffFromPPK(origin: string, next: string, output: string) {
//console.log({copies, deletes}); //console.log({copies, deletes});
zipfile.addBuffer( zipfile.addBuffer(
Buffer.from(JSON.stringify({ copies, copiesv2, deletes })), Buffer.from(JSON.stringify({ copies, deletes })),
'__diff.json', '__diff.json',
); );
zipfile.end(); zipfile.end();
@@ -718,7 +716,6 @@ async function diffFromPackage(
} }
const copies = {}; const copies = {};
const copiesv2 = {};
const zipfile = new YazlZipFile(); const zipfile = new YazlZipFile();
@@ -754,7 +751,6 @@ async function diffFromPackage(
// If moved from other place // If moved from other place
if (originMap[entry.crc32]) { if (originMap[entry.crc32]) {
copies[entry.fileName] = originMap[entry.crc32]; copies[entry.fileName] = originMap[entry.crc32];
copiesv2[entry.crc32] = entry.fileName;
return; return;
} }
@@ -773,10 +769,7 @@ async function diffFromPackage(
} }
}); });
zipfile.addBuffer( zipfile.addBuffer(Buffer.from(JSON.stringify({ copies })), '__diff.json');
Buffer.from(JSON.stringify({ copies, copiesv2 })),
'__diff.json',
);
zipfile.end(); zipfile.end();
await writePromise; await writePromise;
} }

View File

@@ -1,4 +1,5 @@
import { defaultEndpoints } from './constants'; import { defaultEndpoints } from './constants';
import fetch from 'node-fetch';
// const baseUrl = `http://localhost:9000`; // const baseUrl = `http://localhost:9000`;
// let baseUrl = SERVER.main[0]; // let baseUrl = SERVER.main[0];

View File

@@ -122,17 +122,6 @@ export const bindVersionToPackages = async ({
console.log(chalk.yellow(t('dryRun'))); console.log(chalk.yellow(t('dryRun')));
} }
if (rollout !== undefined) { if (rollout !== undefined) {
const rolloutConfig: Record<string, number> = {};
for (const pkg of pkgs) {
rolloutConfig[pkg.name] = rollout;
}
if (!dryRun) {
await put(`/app/${appId}/version/${versionId}`, {
config: {
rollout: rolloutConfig,
},
});
}
console.log( console.log(
`${t('rolloutConfigSet', { `${t('rolloutConfigSet', {
versions: pkgs.map((pkg: Package) => pkg.name).join(', '), versions: pkgs.map((pkg: Package) => pkg.name).join(', '),
@@ -142,8 +131,10 @@ export const bindVersionToPackages = async ({
} }
for (const pkg of pkgs) { for (const pkg of pkgs) {
if (!dryRun) { if (!dryRun) {
await put(`/app/${appId}/package/${pkg.id}`, { await post(`/app/${appId}/binding`, {
versionId, versionId,
rollout,
packageId: pkg.id,
}); });
} }
console.log( console.log(