Skip to content

Commit a69bc92

Browse files
committed
fix #1367
1 parent d72a132 commit a69bc92

File tree

6 files changed

+13
-147
lines changed

6 files changed

+13
-147
lines changed

Dockerfile

Lines changed: 0 additions & 60 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ cd ..
268268
npm run build-prod
269269
```
270270

271-
After downloading the whole internet it starts building it. Basically there should be no errors during the build, but I can't guarantee that the dependencies won't break. (There's a docker build on the way which might make building it more robust. See https://github.com/krausest/js-framework-benchmark/wiki/%5BUnder-construction%5D-Build-all-frameworks-with-docker)
271+
After downloading the whole internet it starts building it. Basically there should be no errors during the build, but I can't guarantee that the dependencies won't break.
272272

273273
You can now run the benchmark for all frameworks by invoking:
274274

package.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,9 @@
1919
"install-server": "cd server && npm ci",
2020
"install-webdriver-ts-results": "cd webdriver-ts-results && npm ci",
2121
"install-local": "npm run install-webdriver-ts && npm run install-webdriver-ts-results && npm run install-server",
22-
"docker-build-image": "docker build -t js-framework-benchmark-ubuntu -f Dockerfile .",
23-
"docker-start": "cross-env-shell docker run --rm -d -p 8080:8080 --name js-framework-benchmark --ipc=host -v /dev/shm:/dev/shm --volume ${INIT_CWD}:/src --volume js-framework-benchmark:/build js-framework-benchmark-ubuntu",
24-
"docker-stop": "docker stop js-framework-benchmark",
25-
"docker-sync": "docker exec -it js-framework-benchmark rsync -avC --exclude /index.html --exclude /framework/**/dist --exclude /webdriver-ts*/dist --exclude /webdriver-ts*/traces --exclude node_modules --exclude /webdriver-ts/results*/ /src/ /build/",
26-
"docker-sync-package-lock-back": "docker exec -it js-framework-benchmark bash sync-package-lock.sh",
27-
"docker-build-frameworks": "npm run docker-sync && docker exec -it js-framework-benchmark npm install && docker exec -it js-framework-benchmark node rebuild-all.js --ci --docker --",
28-
"docker-build-frameworks-non-ci": "npm run docker-sync && docker exec -it js-framework-benchmark npm install && docker exec -it js-framework-benchmark node rebuild-all.js --docker --",
2922
"rebuild": "node rebuild-single.js --",
3023
"rebuild-ci": "node rebuild-single.js -- --ci",
31-
"docker-rebuild": "node rebuild-single.js -- --docker",
32-
"docker-rebuild-ci": "node rebuild-single.js -- --ci --docker",
33-
"docker-shell": "docker exec -it js-framework-benchmark /bin/bash",
34-
"zip": "npm run docker-sync && docker exec -it js-framework-benchmark node cli zip && docker cp js-framework-benchmark:/build/build.zip .",
24+
"zip": "node cli.js zip",
3525
"format": "prettier . \"!(broken-frameworks|frameworks)/**/*\" -w",
3626
"lint": "eslint . --ignore-pattern \"/broken-frameworks/\" --ignore-pattern \"/frameworks/\""
3727
},

rebuild-all.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@ import { takeWhile } from "./utils/common/index.js";
66
import { getFrameworks } from "./utils/frameworks/index.js";
77

88
const args = yargs(process.argv.slice(2))
9-
.usage("$0 [--ci --docker keyed/framework1 ... non-keyed/frameworkN]")
9+
.usage("$0 [--ci keyed/framework1 ... non-keyed/frameworkN]")
1010
.help()
1111
.boolean("ci")
1212
.default("ci", false)
1313
.describe("ci", "Use npm ci or npm install?")
14-
.boolean("docker")
15-
.default("docker", false)
16-
.describe(
17-
"docker",
18-
"Copy package-lock back for docker build or build locally?",
19-
).argv;
14+
.argv;
2015

2116
/*
2217
This script rebuilds all frameworks from scratch,
@@ -33,12 +28,6 @@ npm run rebuild-frameworks --restartWith keyed/react
3328
*/
3429
const useCi = args.ci;
3530

36-
/**
37-
* Copy package-lock back for docker build or build locally?
38-
* @type {boolean}
39-
*/
40-
const useDocker = args.docker;
41-
4231
const restartBuildingWith = args._.find((arg) => !arg.startsWith("--"));
4332
const restartWithFramework = restartBuildingWith || "";
4433

@@ -47,8 +36,6 @@ console.log(
4736
args,
4837
"ci",
4938
useCi,
50-
"docker",
51-
useDocker,
5239
"restartWith",
5340
restartWithFramework,
5441
);
@@ -134,12 +121,6 @@ function buildFramework(framework) {
134121

135122
const buildCmd = "npm run build-prod";
136123
runCommand(buildCmd, frameworkPath);
137-
138-
if (useDocker) {
139-
const packageLockPath = path.join(frameworkPath, "package-lock.json");
140-
const destinationPath = path.join("/src", packageLockPath);
141-
fs.copyFileSync(packageLockPath, destinationPath);
142-
}
143124
}
144125

145126
function buildFrameworks() {

rebuild-build-single.js

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,18 @@ import path from "node:path";
44
import yargs from "yargs";
55

66
const args = yargs(process.argv.slice(2))
7-
.usage("$0 [--ci --docker keyed/framework1 ... non-keyed/frameworkN]")
7+
.usage("$0 [--ci keyed/framework1 ... non-keyed/frameworkN]")
88
.boolean("ci")
99
.default("ci", false)
1010
.describe("ci", "Use npm ci or npm install ?")
11-
.boolean("docker")
12-
.default("docker", false)
13-
.describe(
14-
"docker",
15-
"Copy package-lock back for docker build or build locally?"
16-
).argv;
11+
.argv;
1712

1813
/**
1914
* Use npm ci or npm install?
2015
* @type {boolean}
2116
*/
2217
const useCi = args.ci;
2318

24-
/**
25-
* Copy package-lock back for docker build or build locally?
26-
* @type {boolean}
27-
*/
28-
const useDocker = args.docker;
29-
3019
/**
3120
* @type {string}
3221
*/
@@ -37,8 +26,6 @@ console.log(
3726
args,
3827
"useCi",
3928
useCi,
40-
"useDocker",
41-
useDocker,
4229
"frameworks",
4330
frameworks
4431
);
@@ -54,7 +41,7 @@ const filesToDelete = [
5441
].filter(Boolean);
5542

5643
/*
57-
rebuild-single.js [--ci] [--docker] [keyed/framework1 ... non-keyed/frameworkN]
44+
rebuild-single.js [--ci] [keyed/framework1 ... non-keyed/frameworkN]
5845
5946
This script rebuilds a single framework
6047
By default it rebuilds from scratch, deletes all package.json and package-lock.json files
@@ -110,18 +97,6 @@ function rebuildFramework(framework) {
11097
const [keyed, name] = components;
11198
const frameworkPath = path.join("frameworks", keyed, name);
11299

113-
if (useDocker) {
114-
if (fs.existsSync(frameworkPath)) {
115-
console.log("deleting folder ", frameworkPath);
116-
fs.rmSync(frameworkPath, { recursive: true });
117-
}
118-
119-
const rsyncCmd = `rsync -avC --exclude elm-stuff --exclude dist --exclude output ${
120-
useCi ? "" : "--exclude package-lock.json"
121-
} --exclude tmp --exclude node_modules --exclude bower_components /src/frameworks/${keyed}/${name} /build/frameworks/${keyed}/`;
122-
runCommand(rsyncCmd);
123-
}
124-
125100
deleteFrameworkFiles(frameworkPath, filesToDelete);
126101

127102
const installCmd = `npm ${useCi ? "ci" : "install"}`;
@@ -130,17 +105,12 @@ function rebuildFramework(framework) {
130105
const buildCmd = "npm run build-prod";
131106
runCommand(buildCmd, frameworkPath);
132107

133-
if (useDocker) {
134-
const packageJSONPath = path.join(frameworkPath, "package-lock.json");
135-
const destinationPath = path.join("/src", packageJSONPath);
136-
fs.copyFileSync(packageJSONPath, destinationPath);
137-
}
138108
}
139109

140110
function rebuildFrameworks() {
141111
if (!frameworks.length) {
142112
console.log(
143-
"ERROR: Missing arguments. Command: docker-rebuild keyed/framework1 non-keyed/framework2 ..."
113+
"ERROR: Missing arguments. Command: rebuild keyed/framework1 non-keyed/framework2 ..."
144114
);
145115
process.exit(1);
146116
}

rebuild-single.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,18 @@ import { execSync } from "node:child_process";
22
import yargs from "yargs";
33

44
const args = yargs(process.argv.slice(2))
5-
.usage("$0 [--ci --docker keyed/framework1 ... non-keyed/frameworkN]")
5+
.usage("$0 [--ci keyed/framework1 ... non-keyed/frameworkN]")
66
.boolean("ci")
77
.default("ci", false)
88
.describe("ci", "Use npm ci or npm install ?")
9-
.boolean("docker")
10-
.default("docker", false)
11-
.describe(
12-
"docker",
13-
"Copy package-lock back for docker build or build locally?"
14-
).argv;
9+
.argv;
1510

1611
/**
1712
* Use npm ci or npm install ?
1813
* @type {boolean}
1914
*/
2015
const useCi = args.ci;
2116

22-
/**
23-
* Copy package-lock back for docker build or build locally?
24-
* @type {boolean}
25-
*/
26-
const useDocker = args.docker;
27-
2817
/**
2918
* @type {string}
3019
*/
@@ -40,14 +29,12 @@ console.log(
4029
args,
4130
"ci",
4231
useCi,
43-
"docker",
44-
useDocker,
4532
"frameworks",
4633
frameworks
4734
);
4835

4936
/*
50-
rebuild-single.js [--ci] [--docker] [keyed/framework1 ... non-keyed/frameworkN]
37+
rebuild-single.js [--ci] [keyed/framework1 ... non-keyed/frameworkN]
5138
5239
This script rebuilds a single framework
5340
By default it rebuilds from scratch, deletes all package.json and package-lock.json files
@@ -72,14 +59,12 @@ function runCommand(command, cwd = undefined) {
7259
try {
7360
if (frameworks.length == 0) {
7461
console.log(
75-
"ERROR: Missing arguments. Command: docker-rebuild keyed/framework1 non-keyed/framework2 ..."
62+
"ERROR: Missing arguments. Command: rebuild-single keyed/framework1 non-keyed/framework2 ..."
7663
);
7764
process.exit(1);
7865
}
7966

80-
const buildCmd = useDocker
81-
? `docker exec -it js-framework-benchmark cp /src/rebuild-build-single.js /build/ && docker exec -it js-framework-benchmark node rebuild-build-single.js ${frameworksNames}`
82-
: `node rebuild-build-single.js ${frameworksNames}`;
67+
const buildCmd = `node rebuild-build-single.js ${frameworksNames}`;
8368
runCommand(buildCmd);
8469

8570
const checkCmd = `node rebuild-check-single.js ${frameworksNames}`;

0 commit comments

Comments
 (0)