Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 5d6c726

Browse files
authored
Remove concurrency option from install, as it is not supported with npm workspaces
1 parent 42b68fb commit 5d6c726

File tree

3 files changed

+11
-30
lines changed

3 files changed

+11
-30
lines changed

src/install/development.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ type CloneRepository = "nodecg-io" | "nodecg-io-docs";
1313
const nodecgIOCloneURL = "https://github.com/codeoverflow-org/nodecg-io.git";
1414
const nodecgIODocsCloneURL = "https://github.com/codeoverflow-org/nodecg-io-docs.git";
1515

16-
export async function createDevInstall(
17-
requested: DevelopmentInstallation,
18-
nodecgIODir: string,
19-
concurrency: number,
20-
): Promise<void> {
16+
export async function createDevInstall(requested: DevelopmentInstallation, nodecgIODir: string): Promise<void> {
2117
const wasRepoUpdated = await getGitRepo(nodecgIODir, "nodecg-io");
2218
await manageDocs(nodecgIODir, requested.cloneDocs);
2319

@@ -29,7 +25,7 @@ export async function createDevInstall(
2925
}
3026

3127
await installNPMDependencies(nodecgIODir);
32-
await buildTypeScript(nodecgIODir, concurrency);
28+
await buildTypeScript(nodecgIODir);
3329

3430
await writeInstallInfo(nodecgIODir, requested); // save updated install which says that nodecg-io is now installed
3531
}
@@ -180,8 +176,8 @@ async function installNPMDependencies(nodecgIODir: string) {
180176
logger.info("Installed npm dependencies.");
181177
}
182178

183-
async function buildTypeScript(nodecgIODir: string, concurrency: number) {
179+
async function buildTypeScript(nodecgIODir: string) {
184180
logger.info("Compiling nodecg-io...");
185-
await runNpmBuild(nodecgIODir, "--", "--concurrency", concurrency.toString());
181+
await runNpmBuild(nodecgIODir);
186182
logger.success("Compiled nodecg-io.");
187183
}

src/install/index.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,17 @@ import { findNodeCGDirectory, getNodeCGIODirectory } from "../utils/nodecgInstal
1414
export const installModule: CommandModule<unknown, { concurrency: number }> = {
1515
command: "install",
1616
describe: "installs nodecg-io to your local nodecg installation",
17-
18-
builder: (yargs) =>
19-
yargs
20-
.option("concurrency", {
21-
alias: "j",
22-
type: "number",
23-
description: "The maximum count of concurrent running jobs when building a development install",
24-
default: os.cpus().length,
25-
})
26-
.check((argv) => {
27-
if (argv.concurrency < 1) throw new Error("Concurrency must be greater than zero.");
28-
return true;
29-
}),
30-
31-
handler: async (argv) => {
17+
handler: async () => {
3218
try {
33-
await install(argv.concurrency);
19+
await install();
3420
} catch (err) {
3521
logger.error(`Error while installing nodecg-io: ${err}`);
3622
process.exit(1);
3723
}
3824
},
3925
};
4026

41-
async function install(concurrency: number): Promise<void> {
27+
async function install(): Promise<void> {
4228
await requireNpmV7();
4329

4430
logger.info("Installing nodecg-io...");
@@ -60,7 +46,7 @@ async function install(concurrency: number): Promise<void> {
6046

6147
// Get packages
6248
if (requestedInstall.dev) {
63-
await createDevInstall(requestedInstall, nodecgIODir, concurrency);
49+
await createDevInstall(requestedInstall, nodecgIODir);
6450
} else {
6551
await createProductionInstall(
6652
requestedInstall,

test/install/development.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ afterEach(() => {
3636

3737
describe("createDevInstall", () => {
3838
test("should not do anything if HEAD commit hash didn't change", async () => {
39-
await dev.createDevInstall(validDevInstall, fsRoot, 0);
39+
await dev.createDevInstall(validDevInstall, fsRoot);
4040
expect(execSpy).toHaveBeenCalledTimes(0);
4141
});
4242

4343
test("should execute install and build", async () => {
4444
fetchSpy.mockResolvedValueOnce(altFetchResult);
45-
await dev.createDevInstall(validDevInstall, fsRoot, 0);
45+
await dev.createDevInstall(validDevInstall, fsRoot);
4646
expect(execSpy).toHaveBeenCalledTimes(2);
4747
});
4848

4949
test("should not clone docs if not wanted in installation info", async () => {
5050
// cloneDocs is false in validDevInstall, don't need to change it
51-
await dev.createDevInstall(validDevInstall, nodecgIODir, 0);
51+
await dev.createDevInstall(validDevInstall, nodecgIODir);
5252
expect(cloneSpy).toHaveBeenCalledTimes(1);
5353
});
5454

@@ -59,7 +59,6 @@ describe("createDevInstall", () => {
5959
cloneDocs: true,
6060
},
6161
nodecgIODir,
62-
0,
6362
);
6463
expect(cloneSpy).toHaveBeenCalledTimes(2);
6564
});

0 commit comments

Comments
 (0)