semantic-release-vsce 6.0.25 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -101,6 +101,7 @@ The following environment variables are supported by this plugin:
101
101
  | `OVSX_PAT` | _Optional_. The personal access token to push to Open VSX Registry |
102
102
  | `VSCE_PAT` | _Optional_. The personal access token to publish to Visual Studio Marketplace. _Note:_ Cannot be set at the same time as `VSCE_AZURE_CREDENTIAL`. |
103
103
  | `VSCE_AZURE_CREDENTIAL` | _Optional_. When set to `true` or `1`, `vsce` will use the `--azure-credential` flag to authenticate. _Note:_ Cannot be set at the same time as `VSCE_PAT`. |
104
+ | `VSCE_PRE_RELEASE` | _Optional_. When set to `true` or `1`, `vsce` will use the `--pre-release` flag when packaging the extension to mark it as a pre-release. |
104
105
  | `VSCE_TARGET` | _Optional_. The target to use when packaging or publishing the extension (used as `vsce package --target ${VSCE_TARGET}`). When set to `universal`, behave as if `VSCE_TARGET` was not set (i.e. build the universal/generic `vsix`). See [the platform-specific example](#platform-specific-on-github-actions) |
105
106
 
106
107
  ### Configuring `vsce`
package/lib/prepare.js CHANGED
@@ -3,7 +3,11 @@
3
3
  import { readJson } from 'fs-extra/esm';
4
4
  import path from 'node:path';
5
5
  import process from 'node:process';
6
- import { isOvsxPublishEnabled, isTargetEnabled } from './utilities.js';
6
+ import {
7
+ isOvsxPublishEnabled,
8
+ isPreReleaseEnabled,
9
+ isTargetEnabled,
10
+ } from './utilities.js';
7
11
  import { createVSIX } from '@vscode/vsce';
8
12
 
9
13
  export async function prepare(version, packageVsix, logger, cwd) {
@@ -38,8 +42,13 @@ export async function prepare(version, packageVsix, logger, cwd) {
38
42
  cwd,
39
43
  version,
40
44
  packagePath,
45
+ gitTagVersion: false,
41
46
  };
42
47
 
48
+ if (isPreReleaseEnabled()) {
49
+ options.preRelease = true;
50
+ }
51
+
43
52
  if (isTargetEnabled()) {
44
53
  options.target = process.env.VSCE_TARGET;
45
54
  }
package/lib/publish.js CHANGED
@@ -6,6 +6,7 @@ import process from 'node:process';
6
6
  import {
7
7
  isAzureCredentialEnabled,
8
8
  isOvsxPublishEnabled,
9
+ isPreReleaseEnabled,
9
10
  isTargetEnabled,
10
11
  isVscePublishEnabled,
11
12
  } from './utilities.js';
@@ -41,6 +42,10 @@ export async function publish(version, packagePath, logger, cwd) {
41
42
  vsceOptions.version = version;
42
43
  vsceOptions.gitTagVersion = false;
43
44
 
45
+ if (isPreReleaseEnabled()) {
46
+ vsceOptions.preRelease = true;
47
+ }
48
+
44
49
  if (isTargetEnabled()) {
45
50
  const target = /** @type {string} */ (process.env.VSCE_TARGET);
46
51
  vsceOptions.targets = [target];
package/lib/utilities.js CHANGED
@@ -14,6 +14,10 @@ export function isAzureCredentialEnabled() {
14
14
  return environmentToBoolean('VSCE_AZURE_CREDENTIAL');
15
15
  }
16
16
 
17
+ export function isPreReleaseEnabled() {
18
+ return environmentToBoolean('VSCE_PRE_RELEASE');
19
+ }
20
+
17
21
  export function isVscePublishEnabled() {
18
22
  return !!process.env.VSCE_PAT || isAzureCredentialEnabled();
19
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-vsce",
3
- "version": "6.0.25",
3
+ "version": "6.1.0",
4
4
  "description": "semantic-release plugin to package and publish VS Code extensions",
5
5
  "license": "MIT",
6
6
  "type": "module",