Skip to content

Commit 883a582

Browse files
committed
fixup: experiment - swap argument order for npm 11?
1 parent 29e5c07 commit 883a582

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

dist/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3730,11 +3730,11 @@ function getViewArguments(packageName, options, retryWithTag = false) {
37303730
function getPublishArguments(packageSpec, options) {
37313731
const { tag, access: access$1, dryRun, provenance } = options;
37323732
const publishArguments = [];
3733-
if (packageSpec.length > 0) publishArguments.push(packageSpec);
37343733
if (!tag.isDefault) publishArguments.push("--tag", tag.value);
37353734
if (!access$1.isDefault && access$1.value) publishArguments.push("--access", access$1.value);
37363735
if (!provenance.isDefault && provenance.value) publishArguments.push("--provenance");
37373736
if (!dryRun.isDefault && dryRun.value) publishArguments.push("--dry-run");
3737+
if (packageSpec.length > 0) publishArguments.push(packageSpec);
37383738
return publishArguments;
37393739
}
37403740

dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compare-and-publish/__tests__/get-arguments.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ describe("get command arguments", () => {
3737
} as NormalizedOptions);
3838

3939
expect(result).toEqual([
40-
"./cool-package",
4140
"--tag",
4241
"next",
4342
"--access",
4443
"restricted",
4544
"--provenance",
4645
"--dry-run",
46+
"./cool-package",
4747
]);
4848
});
4949

@@ -68,7 +68,7 @@ describe("get command arguments", () => {
6868
strategy: { value: "upgrade", isDefault: true },
6969
} as NormalizedOptions);
7070

71-
expect(result).toEqual(["./cool-package", "--tag", "next"]);
71+
expect(result).toEqual(["--tag", "next", "./cool-package"]);
7272
});
7373
});
7474
});

src/compare-and-publish/get-arguments.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ export function getPublishArguments(
3737
const { tag, access, dryRun, provenance } = options;
3838
const publishArguments = [];
3939

40-
if (packageSpec.length > 0) {
41-
publishArguments.push(packageSpec);
42-
}
43-
4440
if (!tag.isDefault) {
4541
publishArguments.push("--tag", tag.value);
4642
}
@@ -57,5 +53,9 @@ export function getPublishArguments(
5753
publishArguments.push("--dry-run");
5854
}
5955

56+
if (packageSpec.length > 0) {
57+
publishArguments.push(packageSpec);
58+
}
59+
6060
return publishArguments;
6161
}

0 commit comments

Comments
 (0)