|
1 |
| -import { publish as _publish } from './publish'; |
2 |
| -import { packageCommand, listFiles as _listFiles } from './package'; |
| 1 | +import { publish as _publish, IPublishOptions as _IPublishOptions } from './publish'; |
| 2 | +import { packageCommand, listFiles as _listFiles, IPackageOptions } from './package'; |
3 | 3 |
|
4 |
| -export interface IBaseVSIXOptions { |
5 |
| - /** |
6 |
| - * The base URL for links detected in Markdown files. |
7 |
| - */ |
8 |
| - baseContentUrl?: string; |
9 |
| - |
10 |
| - /** |
11 |
| - * The base URL for images detected in Markdown files. |
12 |
| - */ |
13 |
| - baseImagesUrl?: string; |
14 |
| - |
15 |
| - /** |
16 |
| - * Github branch used to publish the package. Used to automatically infer |
17 |
| - * the base content and images URI. |
18 |
| - */ |
19 |
| - githubBranch?: string; |
20 |
| - |
21 |
| - /** |
22 |
| - * Gitlab branch used to publish the package. Used to automatically infer |
23 |
| - * the base content and images URI. |
24 |
| - */ |
25 |
| - gitlabBranch?: string; |
26 |
| - |
27 |
| - /** |
28 |
| - * Should use Yarn instead of NPM. |
29 |
| - */ |
30 |
| - useYarn?: boolean; |
31 |
| - |
32 |
| - /** |
33 |
| - * Optional target the extension should run on. |
34 |
| - * |
35 |
| - * https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions |
36 |
| - */ |
37 |
| - target?: string; |
38 |
| - |
39 |
| - /** |
40 |
| - * Mark this package as a pre-release |
41 |
| - */ |
42 |
| - preRelease?: boolean; |
43 |
| -} |
44 |
| - |
45 |
| -export interface ICreateVSIXOptions extends IBaseVSIXOptions { |
46 |
| - /** |
47 |
| - * The location of the extension in the file system. |
48 |
| - * |
49 |
| - * Defaults to `process.cwd()`. |
50 |
| - */ |
51 |
| - cwd?: string; |
52 |
| - |
53 |
| - /** |
54 |
| - * The destination of the packaged the VSIX. |
55 |
| - * |
56 |
| - * Defaults to `NAME-VERSION.vsix`. |
57 |
| - */ |
58 |
| - packagePath?: string; |
59 |
| -} |
60 |
| - |
61 |
| -export interface IPublishOptions { |
62 |
| - /** |
63 |
| - * The location of the extension in the file system. |
64 |
| - * |
65 |
| - * Defaults to `process.cwd()`. |
66 |
| - */ |
67 |
| - cwd?: string; |
68 |
| - |
69 |
| - /** |
70 |
| - * The Personal Access Token to use. |
71 |
| - * |
72 |
| - * Defaults to the stored one. |
73 |
| - */ |
74 |
| - pat?: string; |
75 |
| - |
76 |
| - /** |
77 |
| - * The base URL for links detected in Markdown files. |
78 |
| - */ |
79 |
| - baseContentUrl?: string; |
| 4 | +export type { IPackageOptions } from './package'; |
80 | 5 |
|
81 |
| - /** |
82 |
| - * The base URL for images detected in Markdown files. |
83 |
| - */ |
84 |
| - baseImagesUrl?: string; |
| 6 | +/** |
| 7 | + * @deprecated prefer IPackageOptions instead |
| 8 | + */ |
| 9 | +export type IBaseVSIXOptions = Pick< |
| 10 | + IPackageOptions, |
| 11 | + 'baseContentUrl' | 'baseImagesUrl' | 'githubBranch' | 'gitlabBranch' | 'useYarn' | 'target' | 'preRelease' |
| 12 | +>; |
85 | 13 |
|
86 |
| - /** |
87 |
| - * Should use Yarn instead of NPM. |
88 |
| - */ |
89 |
| - useYarn?: boolean; |
90 |
| -} |
| 14 | +/** |
| 15 | + * @deprecated prefer IPackageOptions instead |
| 16 | + */ |
| 17 | +export type ICreateVSIXOptions = Pick<IPackageOptions, 'cwd' | 'packagePath'> & IBaseVSIXOptions; |
91 | 18 |
|
92 | 19 | /**
|
93 | 20 | * The supported list of package managers.
|
@@ -124,19 +51,14 @@ export interface IListFilesOptions {
|
124 | 51 | ignoreFile?: string;
|
125 | 52 | }
|
126 | 53 |
|
127 |
| -export interface IPublishVSIXOptions extends IBaseVSIXOptions { |
128 |
| - /** |
129 |
| - * The Personal Access Token to use. |
130 |
| - * |
131 |
| - * Defaults to the stored one. |
132 |
| - */ |
133 |
| - pat?: string; |
134 |
| -} |
| 54 | +export type IPublishVSIXOptions = IPublishOptions & Pick<IPackageOptions, 'target'>; |
| 55 | + |
| 56 | +export type IPublishOptions = _IPublishOptions; |
135 | 57 |
|
136 | 58 | /**
|
137 | 59 | * Creates a VSIX from the extension in the current working directory.
|
138 | 60 | */
|
139 |
| -export function createVSIX(options: ICreateVSIXOptions = {}): Promise<any> { |
| 61 | +export function createVSIX(options: IPackageOptions = {}): Promise<any> { |
140 | 62 | return packageCommand(options);
|
141 | 63 | }
|
142 | 64 |
|
|
0 commit comments