Skip to content

Commit

Permalink
Remove separate flipper-server lock file
Browse files Browse the repository at this point in the history
Summary: This shouldn't be needed anymore and is causing deps we need to build getting pruned.

Reviewed By: mweststrate

Differential Revision: D56521382

fbshipit-source-id: 199b8eb797ef0e4c7f93a3360e571df0c62cfb2e
  • Loading branch information
lblasa authored and facebook-github-bot committed Apr 24, 2024
1 parent fe33311 commit e115382
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4,317 deletions.
5 changes: 5 additions & 0 deletions desktop/flipper-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
"@types/ws": "^8.5.3",
"mock-fs": "^5.2.0"
},
"resolutions": {
"adbkit-logcat": "^2.0.1",
"minimist": "1.2.6",
"node-forge": "^1.0.6"
},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
Expand Down
27 changes: 2 additions & 25 deletions desktop/scripts/build-flipper-server-release.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ const argv = yargs
'Unique build identifier to be used as the version patch part for the build',
type: 'number',
},
// On intern we ship flipper-server with node_modules (no big internet behind the firewall). yarn.lock makes sure that a CI that builds flipper-server installs the same dependencies all the time.
'generate-lock': {
describe:
'Generate a new yarn.lock file for flipper-server prod build. It is used for reproducible builds of the final artifact for the intern.',
type: 'boolean',
default: false,
},
mac: {
describe: 'Build arm64 and x64 bundles for MacOS.',
type: 'boolean',
Expand Down Expand Up @@ -276,6 +269,7 @@ async function linkLocalDeps(buildFolder: string) {
const manifest = await fs.readJSON(path.resolve(serverDir, 'package.json'));

const resolutions = {
...manifest.resolutions,
'flipper-doctor': `file:${rootDir}/doctor`,
'flipper-common': `file:${rootDir}/flipper-common`,
'flipper-server-client': `file:${rootDir}/flipper-server-client`,
Expand All @@ -284,15 +278,14 @@ async function linkLocalDeps(buildFolder: string) {
};
manifest.resolutions = resolutions;

for (const depName of Object.keys(manifest.dependencies)) {
for (const depName in manifest.dependencies) {
if (depName in resolutions) {
manifest.dependencies[depName] =
resolutions[depName as keyof typeof resolutions];
}
}

delete manifest.scripts;
delete manifest.devDependencies;

await fs.writeFile(
path.join(buildFolder, 'package.json'),
Expand Down Expand Up @@ -381,13 +374,6 @@ async function yarnInstall(dir: string) {
)}`,
);

if (!argv['generate-lock']) {
await fs.copyFile(
path.resolve(rootDir, 'yarn.flipper-server.lock'),
path.resolve(dir, 'yarn.lock'),
);
}

await spawn(
'yarn',
[
Expand All @@ -401,15 +387,6 @@ async function yarnInstall(dir: string) {
shell: true,
},
);

if (argv['generate-lock']) {
await fs.copyFile(
path.resolve(dir, 'yarn.lock'),
path.resolve(rootDir, 'yarn.flipper-server.lock'),
);
}

await fs.rm(path.resolve(dir, 'yarn.lock'));
}

async function stripForwardingToolFromArchive(archive: string): Promise<void> {
Expand Down
Loading

0 comments on commit e115382

Please sign in to comment.