@lvce-editor/test-worker 15.3.0 → 15.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/dist/api.d.ts +13 -2
- package/dist/testWorkerMain.js +16 -4
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -162,6 +162,16 @@ export interface Dirent {
|
|
|
162
162
|
readonly type: number;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
export interface GitInitOptions {
|
|
166
|
+
readonly bare?: boolean;
|
|
167
|
+
readonly initialBranch?: string;
|
|
168
|
+
readonly uri?: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface GitPushOptions {
|
|
172
|
+
readonly setUpstream?: readonly string[];
|
|
173
|
+
}
|
|
174
|
+
|
|
165
175
|
export interface GitInvocation {
|
|
166
176
|
readonly command: readonly string[];
|
|
167
177
|
readonly cwd: string;
|
|
@@ -667,10 +677,11 @@ interface Git {
|
|
|
667
677
|
readonly checkout: (ref: string) => Promise<void>;
|
|
668
678
|
readonly clone: (repositoryUrl: string, cwd: string) => Promise<void>;
|
|
669
679
|
readonly commit: (message: string) => Promise<void>;
|
|
680
|
+
readonly config: (values: Record<string, string>) => Promise<void>;
|
|
670
681
|
readonly fetch: (remote: string) => Promise<void>;
|
|
671
|
-
readonly init: () => Promise<void>;
|
|
682
|
+
readonly init: (options?: GitInitOptions) => Promise<void>;
|
|
672
683
|
readonly pull: (remote: string, branch: string) => Promise<void>;
|
|
673
|
-
readonly push: (
|
|
684
|
+
readonly push: (remoteOrOptions?: string | GitPushOptions, branch?: string) => Promise<void>;
|
|
674
685
|
readonly setConfig: (key: string, value: string) => Promise<void>;
|
|
675
686
|
readonly shouldHaveCommit: (message: string) => Promise<void>;
|
|
676
687
|
readonly shouldHaveInvocations: (invocations: readonly GitInvocation[]) => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -3945,8 +3945,8 @@ const FindWidget = {
|
|
|
3945
3945
|
toggleUseRegularExpression: toggleUseRegularExpression$1
|
|
3946
3946
|
};
|
|
3947
3947
|
|
|
3948
|
-
const init = async () => {
|
|
3949
|
-
await invoke('ExtensionHost.executeCommand', 'git.init');
|
|
3948
|
+
const init = async (options = {}) => {
|
|
3949
|
+
await invoke('ExtensionHost.executeCommand', 'git.init', options);
|
|
3950
3950
|
};
|
|
3951
3951
|
const clone = async (repositoryUrl, cwd) => {
|
|
3952
3952
|
await invoke('ExtensionHost.executeCommand', 'git.clone', repositoryUrl, cwd);
|
|
@@ -3957,8 +3957,14 @@ const add = async pathSpec => {
|
|
|
3957
3957
|
const commit = async message => {
|
|
3958
3958
|
await invoke('ExtensionHost.executeCommand', 'git.commit', message);
|
|
3959
3959
|
};
|
|
3960
|
-
const push$1 = async (
|
|
3961
|
-
|
|
3960
|
+
const push$1 = async (remoteOrOptions, branch) => {
|
|
3961
|
+
if (typeof remoteOrOptions === 'string') {
|
|
3962
|
+
await invoke('ExtensionHost.executeCommand', 'git.push', {
|
|
3963
|
+
setUpstream: [remoteOrOptions, branch || '']
|
|
3964
|
+
});
|
|
3965
|
+
return;
|
|
3966
|
+
}
|
|
3967
|
+
await invoke('ExtensionHost.executeCommand', 'git.push', remoteOrOptions || {});
|
|
3962
3968
|
};
|
|
3963
3969
|
const pull = async (remote, branch) => {
|
|
3964
3970
|
await invoke('ExtensionHost.executeCommand', 'git.pull', remote, branch);
|
|
@@ -3981,6 +3987,11 @@ const addRemote = async (name, remoteUrl) => {
|
|
|
3981
3987
|
const setConfig = async (key, value) => {
|
|
3982
3988
|
await invoke('ExtensionHost.executeCommand', 'git.setConfig', key, value);
|
|
3983
3989
|
};
|
|
3990
|
+
const config = async values => {
|
|
3991
|
+
for (const [key, value] of Object.entries(values)) {
|
|
3992
|
+
await setConfig(key, value);
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3984
3995
|
const shouldHaveCommit = async message => {
|
|
3985
3996
|
const commits = await invoke('ExtensionHost.executeCommand', 'git.getCommits');
|
|
3986
3997
|
if (!Array.isArray(commits)) {
|
|
@@ -4007,6 +4018,7 @@ const Git = {
|
|
|
4007
4018
|
checkout,
|
|
4008
4019
|
clone,
|
|
4009
4020
|
commit,
|
|
4021
|
+
config,
|
|
4010
4022
|
fetch: fetch$1,
|
|
4011
4023
|
init,
|
|
4012
4024
|
pull,
|