ovsx 0.2.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,19 +1,57 @@
1
- ## Eclipse Open VSX Change Log
2
-
3
- This change log covers only the command line interface (CLI) of Open VSX.
4
-
5
- ### v0.2.0 (Jun. 2021)
6
-
7
- New features:
8
- * Added CLI parameter `--web` for web extensions ([#262](https://github.com/eclipse/openvsx/pull/262))
9
-
10
- Fixed issues:
11
- * Updated the `vsce` dependency from 1.84.0 to 1.93.0 ([#300](https://github.com/eclipse/openvsx/issues/300))
12
- * Added explicit dependency to `tmp` ([#254](https://github.com/eclipse/openvsx/issues/254))
13
- * Fixed handling of unknown commands ([#302](https://github.com/eclipse/openvsx/issues/302))
14
-
15
- -----
16
-
17
- ### v0.1.0 (Apr. 2021)
18
-
19
- First release of Open VSX with the Eclipse Foundation.
1
+ ## Eclipse Open VSX Change Log
2
+
3
+ This change log covers only the command line interface (CLI) of Open VSX.
4
+
5
+ ### v0.4.0 (Feb. 2022)
6
+
7
+ #### New Features
8
+
9
+ - Added CLI parameter `--pre-release` to support pre-releases ([#410](https://github.com/eclipse/openvsx/pull/410))
10
+
11
+ ### v0.3.0 (Jan. 2022)
12
+
13
+ #### Breaking Changes
14
+
15
+ - The minimum version of Node.js required is now `14` because of the newer `vsce`
16
+
17
+ #### Dependencies
18
+
19
+ - Upgrade `vsce` from `1.97.0` to `2.6.3` ([#403](https://github.com/eclipse/openvsx/pull/403))
20
+ - Upgrade `follow-redirects`
21
+ - Upgrade `nth-check`
22
+
23
+ ---
24
+
25
+ ### v0.2.1 (Sep. 2021)
26
+
27
+ #### New Features
28
+
29
+ - Also accept `LICENCE` files (alternative spelling to `LICENSE`) ([#307](https://github.com/eclipse/openvsx/pull/307))
30
+ - Remove `--web` option (it will now be inferred from the `package.json` file)
31
+
32
+ #### Dependencies
33
+
34
+ - Upgrade `vsce` from `1.93.0` to `1.97.0`
35
+
36
+ ---
37
+
38
+ ### v0.2.0 (Jun. 2021)
39
+
40
+ #### New Features
41
+
42
+ - Added CLI parameter `--web` for web extensions ([#262](https://github.com/eclipse/openvsx/pull/262))
43
+
44
+ #### Bug Fixes
45
+
46
+ - Fixed handling of unknown commands ([#302](https://github.com/eclipse/openvsx/issues/302))
47
+
48
+ #### Dependencies
49
+
50
+ - Updated the `vsce` dependency from 1.84.0 to 1.93.0 ([#300](https://github.com/eclipse/openvsx/issues/300))
51
+ - Added explicit dependency to `tmp` ([#254](https://github.com/eclipse/openvsx/issues/254))
52
+
53
+ ---
54
+
55
+ ### v0.1.0 (Apr. 2021)
56
+
57
+ First release of Open VSX with the Eclipse Foundation.
package/README.md CHANGED
@@ -1,48 +1,48 @@
1
- # ovsx
2
-
3
- [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/eclipse/openvsx/tree/master/cli)
4
- [![NPM version](https://img.shields.io/npm/v/ovsx)](https://www.npmjs.com/package/ovsx)
5
-
6
- Command line interface for [Eclipse Open VSX](https://open-vsx.org/). Run it via [npx](https://www.npmjs.com/package/npx) or install it with
7
- ```
8
- npm install --global ovsx
9
- ```
10
-
11
- `ovsx` uses open-vsx.org as default instance for publishing and downloading extensions. If you are using a different instance, specify it via the `--registryUrl` (or `-r`) argument or an environment variable named `OVSX_REGISTRY_URL`.
12
-
13
- ### Publish Extensions
14
-
15
- You can use `ovsx` for publishing [VS Code extensions](https://code.visualstudio.com/api) to an Open VSX instance. This is very similar to [vsce](https://github.com/microsoft/vscode-vsce), the publishing tool for the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/vscode).
16
-
17
- You must create an Open VSX [personal access token](https://open-vsx.org/user-settings/tokens) before you can use `osvx` to publish. You can either pass the token via the `--pat` (or `-p`) argument, or put it into an environment variable named `OVSX_PAT`.
18
-
19
- Variants:
20
- * `ovsx publish`
21
- packages the extension in the current working directory using `vsce` and then publishes it.
22
- * `ovsx publish --packagePath <path>`
23
- packages the extension in the given path using `vsce` and then publishes it.
24
- * `ovsx publish <file>`
25
- publishes an already packaged file.
26
-
27
- ### Create a Namespace
28
-
29
- The `publisher` field of your extension's package.json defines the namespace into which the extension will be published. Before you publish the first extension in a namespace, you must create it. This requires an access token as described above.
30
-
31
- * `ovsx create-namespace <name>`
32
- creates the specifed namespace. The name must correspond to the `publisher` of your extension.
33
-
34
- Creating a namespace does _not_ automatically give you the exclusive publishing rights. Initially, everyone will be able to publish an extension with the new namespace. If you want exclusive publishing rights, you can [claim ownership of a namespace](https://github.com/eclipse/openvsx/wiki/Namespace-Access).
35
-
36
- ### Download Extensions
37
-
38
- You can use `ovsx` for downloading extensions from an Open VSX instance. Extensions are identified with the format `namespace.extension`, and an exact version or version range can be specified with the `--versionRange` (or `-v`) argument. The namespace corresponds to the `publisher` entry of the package.json file.
39
-
40
- Variants:
41
- * `ovsx get <extension>`
42
- downloads an extension and saves it in a file as specified in its download URL (usually in the format `namespace.extension-version.vsix`) in the current working directory.
43
- * `ovsx get <extension> -o <path>`
44
- downloads an extension and saves it in the specified file or directory.
45
- * `ovsx get <extension> --metadata`
46
- downloads the JSON metadata of an extension and prints it to the standard output.
47
- * `ovsx get <extension> --metadata -o <path>`
48
- downloads the JSON metadata of an extension and saves it in the specified file or directory.
1
+ # ovsx
2
+
3
+ [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/eclipse/openvsx/tree/master/cli)
4
+ [![NPM version](https://img.shields.io/npm/v/ovsx)](https://www.npmjs.com/package/ovsx)
5
+
6
+ Command line interface for [Eclipse Open VSX](https://open-vsx.org/). Run it via [npx](https://www.npmjs.com/package/npx) or install it with
7
+ ```
8
+ npm install --global ovsx
9
+ ```
10
+
11
+ `ovsx` uses open-vsx.org as default instance for publishing and downloading extensions. If you are using a different instance, specify it via the `--registryUrl` (or `-r`) argument or an environment variable named `OVSX_REGISTRY_URL`.
12
+
13
+ ### Publish Extensions
14
+
15
+ You can use `ovsx` for publishing [VS Code extensions](https://code.visualstudio.com/api) to an Open VSX instance. This is very similar to [vsce](https://github.com/microsoft/vscode-vsce), the publishing tool for the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/vscode).
16
+
17
+ You must create an Open VSX [personal access token](https://open-vsx.org/user-settings/tokens) before you can use `osvx` to publish. You can either pass the token via the `--pat` (or `-p`) argument, or put it into an environment variable named `OVSX_PAT`.
18
+
19
+ Variants:
20
+ * `ovsx publish`
21
+ packages the extension in the current working directory using `vsce` and then publishes it.
22
+ * `ovsx publish --packagePath <path>`
23
+ packages the extension in the given path using `vsce` and then publishes it.
24
+ * `ovsx publish <file>`
25
+ publishes an already packaged file.
26
+
27
+ ### Create a Namespace
28
+
29
+ The `publisher` field of your extension's package.json defines the namespace into which the extension will be published. Before you publish the first extension in a namespace, you must create it. This requires an access token as described above.
30
+
31
+ * `ovsx create-namespace <name>`
32
+ creates the specifed namespace. The name must correspond to the `publisher` of your extension.
33
+
34
+ Creating a namespace does _not_ automatically give you the exclusive publishing rights. Initially, everyone will be able to publish an extension with the new namespace. If you want exclusive publishing rights, you can [claim ownership of a namespace](https://github.com/eclipse/openvsx/wiki/Namespace-Access).
35
+
36
+ ### Download Extensions
37
+
38
+ You can use `ovsx` for downloading extensions from an Open VSX instance. Extensions are identified with the format `namespace.extension`, and an exact version or version range can be specified with the `--versionRange` (or `-v`) argument. The namespace corresponds to the `publisher` entry of the package.json file.
39
+
40
+ Variants:
41
+ * `ovsx get <extension>`
42
+ downloads an extension and saves it in a file as specified in its download URL (usually in the format `namespace.extension-version.vsix`) in the current working directory.
43
+ * `ovsx get <extension> -o <path>`
44
+ downloads an extension and saves it in the specified file or directory.
45
+ * `ovsx get <extension> --metadata`
46
+ downloads the JSON metadata of an extension and prints it to the standard output.
47
+ * `ovsx get <extension> --metadata -o <path>`
48
+ downloads the JSON metadata of an extension and saves it in the specified file or directory.
@@ -1,13 +1,13 @@
1
- /********************************************************************************
2
- * Copyright (c) 2020 TypeFox and others
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * SPDX-License-Identifier: EPL-2.0
9
- ********************************************************************************/
10
- import { Manifest } from './util';
11
- export declare function isLicenseOk(packagePath: string, manifest?: Manifest): Promise<boolean>;
12
- export declare function checkLicense(packagePath: string): Promise<void>;
1
+ /********************************************************************************
2
+ * Copyright (c) 2020 TypeFox and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ********************************************************************************/
10
+ import { Manifest } from './util';
11
+ export declare function isLicenseOk(packagePath: string, manifest?: Manifest): Promise<boolean>;
12
+ export declare function checkLicense(packagePath: string): Promise<void>;
13
13
  //# sourceMappingURL=check-license.d.ts.map
@@ -1,112 +1,112 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2020 TypeFox and others
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * SPDX-License-Identifier: EPL-2.0
10
- ********************************************************************************/
11
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
- return new (P || (P = Promise))(function (resolve, reject) {
14
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
- step((generator = generator.apply(thisArg, _arguments || [])).next());
18
- });
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- const fs = require("fs");
22
- const isCI = require("is-ci");
23
- const util_1 = require("./util");
24
- function addLicense(packagePath, manifest) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- console.log('Extension ' + manifest.publisher + '.' + manifest.name + ' has no license. All Open VSX '
27
- + 'Registry Content Offerings must be licensed. You may choose to publish this extension under '
28
- + 'the MIT License (https://opensource.org/licenses/MIT). Please note you are responsible to '
29
- + 'ensure that you have the necessary rights to permit this extension to be made available under '
30
- + 'the MIT license and for compliance with that license.');
31
- let answer;
32
- do {
33
- console.log();
34
- answer = yield util_1.getUserChoice('Would you like to publish your extension '
35
- + manifest.publisher + '.' + manifest.name
36
- + ' under the MIT license?', ['yes', 'help', 'no'], 'no');
37
- switch (answer) {
38
- case 'yes':
39
- yield useMITLicense(manifest, packagePath);
40
- break;
41
- case 'help':
42
- console.log('If you select "yes" your extension will be published under the MIT License. '
43
- + 'You must enter the Copyright Year and Copyright Holder information. This information '
44
- + 'along with the text of the MIT License will be written to a LICENSE file and '
45
- + 'packaged with the uploaded extension.\n');
46
- console.log(MIT_LICENSE_TEXT);
47
- break;
48
- case 'no':
49
- throw new Error('This extension cannot be accepted because it has no license.');
50
- }
51
- } while (answer === 'help');
52
- });
53
- }
54
- function isLicenseOk(packagePath, manifest) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- // manifest is optional in order to use isLicenseOk function
57
- // without need to read and parse manifest by the another step
58
- manifest = manifest !== null && manifest !== void 0 ? manifest : yield util_1.readManifest(packagePath);
59
- util_1.validateManifest(manifest);
60
- if (manifest.license) {
61
- // The extension has a license identifier or a pointer to an alternative LICENSE file
62
- return true;
63
- }
64
- if (yield hasLicenseFile(packagePath)) {
65
- // The extension has a LICENSE file that can be packaged
66
- return true;
67
- }
68
- return false;
69
- });
70
- }
71
- exports.isLicenseOk = isLicenseOk;
72
- function checkLicense(packagePath) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- const manifest = yield util_1.readManifest(packagePath);
75
- if (!(yield isLicenseOk(packagePath, manifest)) && !isCI) {
76
- yield addLicense(packagePath, manifest);
77
- }
78
- });
79
- }
80
- exports.checkLicense = checkLicense;
81
- function useMITLicense(manifest, packagePath) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- console.log('Please enter a value for Copyright Year and Copyright Holder.\n'
84
- + 'Example: "Copyright 2020 John Doe"\n');
85
- const copyright = yield util_1.getUserInput('Copyright ');
86
- if (!copyright) {
87
- throw new Error('A copyright declaration is necessary for the MIT license.');
88
- }
89
- manifest.license = 'MIT';
90
- yield util_1.writeManifest(manifest, packagePath);
91
- const license = MIT_LICENSE_TEXT.replace('<YEAR> <COPYRIGHT HOLDER>', copyright);
92
- yield util_1.writeFile('LICENSE', license, packagePath);
93
- console.log('LICENSE file has been written. Please commit it to the source repository.');
94
- });
95
- }
96
- const LICENSE_FILE_NAMES = ['license.md', 'license', 'license.txt'];
97
- function hasLicenseFile(packagePath) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- const fileNames = yield util_1.promisify(fs.readdir)(packagePath !== null && packagePath !== void 0 ? packagePath : '.');
100
- for (const fileName of fileNames) {
101
- for (const licFileName of LICENSE_FILE_NAMES) {
102
- if (fileName.toLowerCase() === licFileName) {
103
- return true;
104
- }
105
- }
106
- }
107
- return false;
108
- });
109
- }
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2020 TypeFox and others
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * SPDX-License-Identifier: EPL-2.0
10
+ ********************************************************************************/
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const fs = require("fs");
22
+ const isCI = require("is-ci");
23
+ const util_1 = require("./util");
24
+ function addLicense(packagePath, manifest) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ console.log('Extension ' + manifest.publisher + '.' + manifest.name + ' has no license. All Open VSX '
27
+ + 'Registry Content Offerings must be licensed. You may choose to publish this extension under '
28
+ + 'the MIT License (https://opensource.org/licenses/MIT). Please note you are responsible to '
29
+ + 'ensure that you have the necessary rights to permit this extension to be made available under '
30
+ + 'the MIT license and for compliance with that license.');
31
+ let answer;
32
+ do {
33
+ console.log();
34
+ answer = yield util_1.getUserChoice('Would you like to publish your extension '
35
+ + manifest.publisher + '.' + manifest.name
36
+ + ' under the MIT license?', ['yes', 'help', 'no'], 'no');
37
+ switch (answer) {
38
+ case 'yes':
39
+ yield useMITLicense(manifest, packagePath);
40
+ break;
41
+ case 'help':
42
+ console.log('If you select "yes" your extension will be published under the MIT License. '
43
+ + 'You must enter the Copyright Year and Copyright Holder information. This information '
44
+ + 'along with the text of the MIT License will be written to a LICENSE file and '
45
+ + 'packaged with the uploaded extension.\n');
46
+ console.log(MIT_LICENSE_TEXT);
47
+ break;
48
+ case 'no':
49
+ throw new Error('This extension cannot be accepted because it has no license.');
50
+ }
51
+ } while (answer === 'help');
52
+ });
53
+ }
54
+ function isLicenseOk(packagePath, manifest) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ // manifest is optional in order to use isLicenseOk function
57
+ // without need to read and parse manifest by the another step
58
+ manifest = manifest !== null && manifest !== void 0 ? manifest : yield util_1.readManifest(packagePath);
59
+ util_1.validateManifest(manifest);
60
+ if (manifest.license) {
61
+ // The extension has a license identifier or a pointer to an alternative LICENSE file
62
+ return true;
63
+ }
64
+ if (yield hasLicenseFile(packagePath)) {
65
+ // The extension has a LICENSE file that can be packaged
66
+ return true;
67
+ }
68
+ return false;
69
+ });
70
+ }
71
+ exports.isLicenseOk = isLicenseOk;
72
+ function checkLicense(packagePath) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const manifest = yield util_1.readManifest(packagePath);
75
+ if (!(yield isLicenseOk(packagePath, manifest)) && !isCI) {
76
+ yield addLicense(packagePath, manifest);
77
+ }
78
+ });
79
+ }
80
+ exports.checkLicense = checkLicense;
81
+ function useMITLicense(manifest, packagePath) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ console.log('Please enter a value for Copyright Year and Copyright Holder.\n'
84
+ + 'Example: "Copyright 2020 John Doe"\n');
85
+ const copyright = yield util_1.getUserInput('Copyright ');
86
+ if (!copyright) {
87
+ throw new Error('A copyright declaration is necessary for the MIT license.');
88
+ }
89
+ manifest.license = 'MIT';
90
+ yield util_1.writeManifest(manifest, packagePath);
91
+ const license = MIT_LICENSE_TEXT.replace('<YEAR> <COPYRIGHT HOLDER>', copyright);
92
+ yield util_1.writeFile('LICENSE', license, packagePath);
93
+ console.log('LICENSE file has been written. Please commit it to the source repository.');
94
+ });
95
+ }
96
+ const LICENSE_FILE_NAMES = ['license.md', 'license', 'license.txt', 'licence.md', 'licence', 'licence.txt'];
97
+ function hasLicenseFile(packagePath) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ const fileNames = yield util_1.promisify(fs.readdir)(packagePath !== null && packagePath !== void 0 ? packagePath : '.');
100
+ for (const fileName of fileNames) {
101
+ for (const licFileName of LICENSE_FILE_NAMES) {
102
+ if (fileName.toLowerCase() === licFileName) {
103
+ return true;
104
+ }
105
+ }
106
+ }
107
+ return false;
108
+ });
109
+ }
110
110
  const MIT_LICENSE_TEXT = `Copyright <YEAR> <COPYRIGHT HOLDER>
111
111
 
112
112
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -125,5 +125,5 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
125
125
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
126
126
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
127
127
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
128
- SOFTWARE.`;
128
+ SOFTWARE.`;
129
129
  //# sourceMappingURL=check-license.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-license.js","sourceRoot":"","sources":["../src/check-license.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;;;;;;;;;;AAElF,yBAAyB;AACzB,8BAA8B;AAC9B,iCAEgB;AAEhB,SAAe,UAAU,CAAC,WAAmB,EAAE,QAAkB;;QAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,QAAQ,CAAC,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI,GAAG,gCAAgC;cAChG,8FAA8F;cAC9F,4FAA4F;cAC5F,gGAAgG;cAChG,uDAAuD,CAAC,CAAC;QAC/D,IAAI,MAA6B,CAAC;QAClC,GAAG;YACC,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,GAAG,MAAM,oBAAa,CAAC,2CAA2C;kBAClE,QAAQ,CAAC,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI;kBACxC,yBAAyB,EAC3B,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;YACjC,QAAQ,MAAM,EAAE;gBACZ,KAAK,KAAK;oBACN,MAAM,aAAa,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;oBAC3C,MAAM;gBACV,KAAK,MAAM;oBACP,OAAO,CAAC,GAAG,CAAC,8EAA8E;0BACpF,uFAAuF;0BACvF,+EAA+E;0BAC/E,yCAAyC,CAAC,CAAC;oBACjD,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;oBAC9B,MAAM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@
1
- /********************************************************************************
2
- * Copyright (c) 2020 TypeFox and others
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * SPDX-License-Identifier: EPL-2.0
9
- ********************************************************************************/
10
- import { RegistryOptions } from './registry';
11
- /**
12
- * Creates a namespace (corresponds to `publisher` in package.json).
13
- */
14
- export declare function createNamespace(options?: CreateNamespaceOptions): Promise<void>;
15
- export interface CreateNamespaceOptions extends RegistryOptions {
16
- /**
17
- * Name of the new namespace.
18
- */
19
- name?: string;
20
- }
1
+ /********************************************************************************
2
+ * Copyright (c) 2020 TypeFox and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ********************************************************************************/
10
+ import { RegistryOptions } from './registry';
11
+ /**
12
+ * Creates a namespace (corresponds to `publisher` in package.json).
13
+ */
14
+ export declare function createNamespace(options?: CreateNamespaceOptions): Promise<void>;
15
+ export interface CreateNamespaceOptions extends RegistryOptions {
16
+ /**
17
+ * Name of the new namespace.
18
+ */
19
+ name?: string;
20
+ }
21
21
  //# sourceMappingURL=create-namespace.d.ts.map
@@ -1,44 +1,44 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2020 TypeFox and others
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * SPDX-License-Identifier: EPL-2.0
10
- ********************************************************************************/
11
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
- return new (P || (P = Promise))(function (resolve, reject) {
14
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
- step((generator = generator.apply(thisArg, _arguments || [])).next());
18
- });
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- const registry_1 = require("./registry");
22
- const util_1 = require("./util");
23
- /**
24
- * Creates a namespace (corresponds to `publisher` in package.json).
25
- */
26
- function createNamespace(options = {}) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- util_1.addEnvOptions(options);
29
- if (!options.name) {
30
- throw new Error('The namespace name is mandatory.');
31
- }
32
- if (!options.pat) {
33
- throw new Error("A personal access token must be given with the option '--pat'.");
34
- }
35
- const registry = new registry_1.Registry(options);
36
- const result = yield registry.createNamespace(options.name, options.pat);
37
- if (result.error) {
38
- throw new Error(result.error);
39
- }
40
- console.log(`\ud83d\ude80 Created namespace ${options.name}`);
41
- });
42
- }
43
- exports.createNamespace = createNamespace;
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2020 TypeFox and others
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * SPDX-License-Identifier: EPL-2.0
10
+ ********************************************************************************/
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const registry_1 = require("./registry");
22
+ const util_1 = require("./util");
23
+ /**
24
+ * Creates a namespace (corresponds to `publisher` in package.json).
25
+ */
26
+ function createNamespace(options = {}) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ util_1.addEnvOptions(options);
29
+ if (!options.name) {
30
+ throw new Error('The namespace name is mandatory.');
31
+ }
32
+ if (!options.pat) {
33
+ throw new Error("A personal access token must be given with the option '--pat'.");
34
+ }
35
+ const registry = new registry_1.Registry(options);
36
+ const result = yield registry.createNamespace(options.name, options.pat);
37
+ if (result.error) {
38
+ throw new Error(result.error);
39
+ }
40
+ console.log(`\ud83d\ude80 Created namespace ${options.name}`);
41
+ });
42
+ }
43
+ exports.createNamespace = createNamespace;
44
44
  //# sourceMappingURL=create-namespace.js.map