diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts index 96e1da82a0..5f00c676ec 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.ts +++ b/apps/remix-ide/src/app/files/dgitProvider.ts @@ -104,7 +104,7 @@ class DGitProvider extends Plugin { if ((Registry.getInstance().get('platform').api.isDesktop())) { const status = await this.call('isogit', 'status', cmd) - + console.log('STATUS', { ...status }) return status } @@ -112,7 +112,7 @@ class DGitProvider extends Plugin { ...await this.addIsomorphicGitConfigFS(), ...cmd }) - + console.log('STATUS', JSON.stringify(status)) return status } @@ -131,7 +131,7 @@ class DGitProvider extends Plugin { } async rm(cmd: rmInputType) { - + console.log('RM', cmd) if ((Registry.getInstance().get('platform').api.isDesktop())) { await this.call('isogit', 'rm', cmd) } else { @@ -139,13 +139,12 @@ class DGitProvider extends Plugin { ...await this.addIsomorphicGitConfigFS(), ...cmd }) - this.emit('rm') - } + this.emit('rm') } async checkout(cmd: checkoutInputType): Promise { - + console.log('checkout', cmd) if ((Registry.getInstance().get('platform').api.isDesktop())) { await this.call('isogit', 'checkout', cmd) } else { diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index 716c665bcb..c5a6a1df8a 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -72,7 +72,7 @@ "isomorphic-git": "^1.24.2", "matomo-tracker": "^2.2.4", "node-pty": "^0.10.1", - "octokit": "^4.0.2", + "octokit": "^3.1.2", "semver": "^7.5.4" }, "optionalDependencies": { diff --git a/apps/remixdesktop/src/plugins/isoGitPlugin.ts b/apps/remixdesktop/src/plugins/isoGitPlugin.ts index 430928e3ff..afe26685ce 100644 --- a/apps/remixdesktop/src/plugins/isoGitPlugin.ts +++ b/apps/remixdesktop/src/plugins/isoGitPlugin.ts @@ -90,23 +90,16 @@ class IsoGitPluginClient extends ElectronBasePluginClient { console.log('LOG', cmd) const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token') console.log('LOG', token) - /* we will use isomorphic git for now - if(this.gitIsInstalled){ - const log = await gitProxy.log(this.workingDir, cmd.ref) - console.log('LOG', log) - return log - } - */ - + if (this.workingDir === '') { return [] } const log = await git.log({ ...await this.getGitConfig(), - ...cmd + ...cmd, }) - + console.log('LOG', log) return log } diff --git a/apps/remixdesktop/src/tools/git.ts b/apps/remixdesktop/src/tools/git.ts index 5e062dceac..f32a6426c9 100644 --- a/apps/remixdesktop/src/tools/git.ts +++ b/apps/remixdesktop/src/tools/git.ts @@ -10,12 +10,16 @@ const statusTransFormMatrix = (status: string) => { return [0, 2, 0] case 'A ': return [0, 2, 2] + case 'R ': + return [0, 2, 2] case 'M ': return [1, 2, 2] case 'MM': return [1, 2, 3] case ' M': - return [1, 2, 0] + return [1, 2, 1] + case 'AD': + return [0, 0, 3] case ' D': return [1, 0, 1] case 'D ': @@ -57,14 +61,22 @@ export const gitProxy = { if(!input.remote || !input.remote.name) { input.remote = { name: await gitProxy.defaultRemoteName(path), url: '' } } - const { stdout, stderr } = await execAsync(`git push ${input.force ? ' -f' : ''} ${input.remote.name} ${input.ref.name}:${input.remoteRef.name}`, { cwd: path }); + let remoteRefString = '' + if(input.remoteRef && !input.remoteRef.name) { + remoteRefString = `:${input.remoteRef.name}` + } + const { stdout, stderr } = await execAsync(`git push ${input.force ? ' -f' : ''} ${input.remote.name}${remoteRefString} ${input.ref.name}`, { cwd: path }); }, async pull(path: string, input: pullInputType) { if(!input.remote || !input.remote.name) { input.remote = { name: await gitProxy.defaultRemoteName(path), url: '' } } - const { stdout, stderr } = await execAsync(`git pull ${input.remote.name} ${input.ref.name}:${input.remoteRef.name}`, { cwd: path }); + let remoteRefString = '' + if(input.remoteRef && !input.remoteRef.name) { + remoteRefString = `:${input.remoteRef.name}` + } + const { stdout, stderr } = await execAsync(`git pull ${input.remote.name} ${input.ref.name}${remoteRefString}`, { cwd: path }); }, async fetch(path: string, input: fetchInputType) { @@ -89,6 +101,7 @@ export const gitProxy = { await execAsync(`git commit -m '${input.message}'`, { cwd: path }); const { stdout, stderr } = await execAsync(`git rev-parse HEAD`, { cwd: path }); + console.log('stdout commit:', stdout); return stdout; }, diff --git a/apps/remixdesktop/test/lib/git.ts b/apps/remixdesktop/test/lib/git.ts new file mode 100644 index 0000000000..dc99ef1aa9 --- /dev/null +++ b/apps/remixdesktop/test/lib/git.ts @@ -0,0 +1,195 @@ +import { spawn, ChildProcess } from "child_process" + +export async function getBranches(path: string): Promise { + return new Promise((resolve, reject) => { + const git = spawn('git', ['branch'], { cwd: path }) + let branches = '' + git.stdout.on('data', function (data) { + console.log('stdout git branches', data.toString()) + branches += data.toString() + }) + git.stderr.on('data', function (data) { + console.log('stderr git branches', data.toString()) + reject(data.toString()) + }) + git.on('close', function () { + resolve(branches) + }) + }) +} + +export async function getGitLog(path: string): Promise { + return new Promise((resolve, reject) => { + const git = spawn('git', ['log'], { cwd: path }) + let logs = '' + git.stdout.on('data', function (data) { + logs += data.toString() + }) + git.stderr.on('err', function (data) { + reject(data.toString()) + }) + git.on('close', function () { + resolve(logs) + }) + }) +} + +export async function cloneOnServer(repo: string, path: string) { + console.log('cloning', repo, path) + return new Promise((resolve, reject) => { + const git = spawn('rm -rf bare && git', ['clone', repo], { cwd: path, shell: true, detached: true }); + + git.stdout.on('data', function (data) { + console.log('stdout data cloning', data.toString()); + if (data.toString().includes('done')) { + resolve(git); + } + }); + + git.stderr.on('data', function (data) { + console.log('stderr data cloning', data.toString()); + if (data.toString().includes('into')) { + setTimeout(() => { + resolve(git); + }, 5000) + } + }); + + git.on('error', (error) => { + reject(`Process error: ${error.message}`); + }); + + git.on('exit', (code, signal) => { + if (code !== 0) { + reject(`Process exited with code: ${code} and signal: ${signal}`); + } + }); + }); +} + +export async function onLocalGitRepoAddFile(path: string, file: string) { + console.log('adding file', file) + return new Promise((resolve, reject) => { + const git = spawn('touch', [file], { cwd: path }); + + git.stdout.on('data', function (data) { + console.log('stdout data adding file', data.toString()); + if (data.toString().includes('done')) { + resolve(git); + } + }); + + git.stderr.on('data', function (data) { + console.error('stderr adding file', data.toString()); + reject(data.toString()); + }); + + git.on('error', (error) => { + reject(`Process error: ${error.message}`); + }); + + git.on('exit', (code, signal) => { + if (code !== 0) { + reject(`Process exited with code: ${code} and signal: ${signal}`); + } else { + resolve(git); + } + }); + }); +} + +export async function onLocalGitRepoPush(path: string, branch: string = 'master') { + console.log('pushing', path) + return new Promise((resolve, reject) => { + const git = spawn('git', ['push', 'origin', branch], { cwd: path, shell: true, detached: true }); + + git.stdout.on('data', function (data) { + console.log('stdout data pushing', data.toString()); + if (data.toString().includes('done')) { + resolve(git); + } + }); + + git.stderr.on('data', function (data) { + console.error('stderr data pushing', data.toString()); + if (data.toString().includes(branch)) { + resolve(git); + } + }); + + git.on('error', (error) => { + reject(`Process error: ${error.message}`); + }); + + git.on('exit', (code, signal) => { + if (code !== 0) { + reject(`Process exited with code: ${code} and signal: ${signal}`); + } else { + resolve(git); + } + }); + }); +} + + +export async function createCommitOnLocalServer(path: string, message: string) { + console.log('committing', message, path) + return new Promise((resolve, reject) => { + const git = spawn('git add . && git', ['commit', '-m', message], { cwd: path, shell: true, detached: true }); + + git.stdout.on('data', function (data) { + console.log('data stdout committing', data.toString()); + if (data.toString().includes(message)) { + setTimeout(() => { + resolve(git); + }, 1000) + } + }); + + git.stderr.on('data', function (data) { + console.error('data commiting', data.toString()); + reject(data.toString()); + }); + + git.on('error', (error) => { + console.error('error', error); + reject(`Process error: ${error.message}`); + }); + + git.on('exit', (code, signal) => { + if (code !== 0) { + console.error('exit', code, signal); + reject(`Process exited with code: ${code} and signal: ${signal}`); + } else { + resolve(git); + } + }); + }); +} + + +export async function spawnGitServer(path: string): Promise { + console.log(process.cwd()) + try { + const server = spawn('yarn && sh setup.sh && npx ts-node server.ts', [`${path}`], { cwd: process.cwd() + '/../remix-ide-e2e/src/githttpbackend/', shell: true, detached: true }) + console.log('spawned', server.stdout.closed, server.stderr.closed) + return new Promise((resolve, reject) => { + server.stdout.on('data', function (data) { + console.log(data.toString()) + if ( + data.toString().includes('is listening') + || data.toString().includes('address already in use') + ) { + console.log('resolving') + resolve(server) + } + }) + server.stderr.on('err', function (data) { + console.log(data.toString()) + reject(data.toString()) + }) + }) + } catch (e) { + console.log(e) + } +} \ No newline at end of file diff --git a/apps/remixdesktop/test/tests/app/git-ui.test.ts b/apps/remixdesktop/test/tests/app/git-ui.test.ts new file mode 100644 index 0000000000..53139f4df0 --- /dev/null +++ b/apps/remixdesktop/test/tests/app/git-ui.test.ts @@ -0,0 +1,187 @@ +import { ChildProcess, spawn } from "child_process" +import kill from 'tree-kill' +import { Nightwatch, NightwatchBrowser } from "nightwatch" +import { spawnGitServer, getGitLog, cloneOnServer, onLocalGitRepoAddFile, createCommitOnLocalServer, onLocalGitRepoPush, getBranches } from "../../lib/git" +let gitserver: ChildProcess + +/* +/ uses the git-http-backend package to create a git server ( if needed kill the server: kill -9 $(sudo lsof -t -i:6868) ) +/ GROUP 1: file operations PUSH PULL COMMIT SYNC FETCH CLONE ADD +/ GROUP 2: branch operations CREATE & PUBLISH +/ GROUP 3: file operations rename delete +*/ + +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + after: function (browser: NightwatchBrowser) { + browser.perform((done) => { + console.log('kill server', gitserver.pid) + kill(gitserver.pid) + done() + }) + }, + + 'run server #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + gitserver = await spawnGitServer('/tmp/') + console.log('working directory', process.cwd()) + done() + }) + }, + + 'clone a repo #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('dgit') + .pause(5000) + .waitForElementVisible('*[data-id="cloneButton"]') + .click('*[data-id="cloneButton"]') + .pause(1000) + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('*[data-id="modalDialogCustomPromptTextClone"]', 'http://localhost:6868/bare.git') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .windowHandles(function (result) { + console.log(result.value) + browser.switchWindow(result.value[1]) + .waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') + }) + .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.md"]') + }, + 'Update settings for git #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser. + clickLaunchIcon('dgit') + .setValue('*[data-id="gitubUsername"]', 'git') + .setValue('*[data-id="githubEmail"]', 'git@example.com') + .click('*[data-id="saveGitHubCredentials"]') + .modalFooterOKClick('github-credentials-error') + + }, + + // GROUP 1 + + 'check file added #group1 #group3': function (browser: NightwatchBrowser) { + browser + .addFile('test.txt', { content: 'hello world' }, 'README.md') + .clickLaunchIcon('dgit') + .pause(1000) + .waitForElementVisible({ + selector: "//*[@data-status='new-untracked' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .waitForElementVisible('*[data-id="addToGitChangestest.txt"]') + .pause(1000) + .click('*[data-id="addToGitChangestest.txt"]') + .waitForElementVisible({ + selector: "//*[@data-status='added-staged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .setValue('*[data-id="commitMessage"]', 'testcommit') + .click('*[data-id="commitButton"]') + }, + 'look at the commit #group1': function (browser: NightwatchBrowser) { + browser + .click('*[data-id="commits-panel"]') + .waitForElementPresent({ + selector: '//*[@data-id="commit-summary-testcommit-ahead"]', + locateStrategy: 'xpath' + }) + }, + 'sync the commit #group1': function (browser: NightwatchBrowser) { + browser + .pause(1000) + .waitForElementVisible('*[data-id="sourcecontrol-panel"]') + .click('*[data-id="sourcecontrol-panel"]') + + .waitForElementVisible('*[data-id="syncButton"]') + .click('*[data-id="syncButton"]') + .pause(2000) + .waitForElementVisible('*[data-id="commitButton"]') + .click('*[data-id="commits-panel"]') + .waitForElementPresent({ + selector: '//*[@data-id="commit-summary-testcommit-"]', + locateStrategy: 'xpath' + }) + }, + 'check the log #group1': async function (browser: NightwatchBrowser) { + const logs = await getGitLog('/tmp/git/bare.git') + console.log(logs) + browser.assert.ok(logs.includes('testcommit')) + }, + 'change a file #group1': function (browser: NightwatchBrowser) { + browser. + openFile('test.txt'). + pause(1000). + setEditorValue('changes', null) + }, + 'stage changed file #group1': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('dgit') + .click('*[data-id="sourcecontrol-panel"]') + .waitForElementVisible({ + selector: "//*[@data-status='modified-unstaged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .waitForElementVisible('*[data-id="addToGitChangestest.txt"]') + .click('*[data-id="addToGitChangestest.txt"]') + .waitForElementVisible({ + selector: "//*[@data-status='modified-staged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .setValue('*[data-id="commitMessage"]', 'testcommit2') + .click('*[data-id="commitButton"]') + }, + 'push the commit #group1': function (browser: NightwatchBrowser) { + browser + .click('*[data-id="commands-panel"]') + .waitForElementVisible('*[data-id="sourcecontrol-push"]') + .click('*[data-id="sourcecontrol-push"]') + .pause(2000) + .click('*[data-id="commits-panel"]') + .waitForElementPresent({ + selector: '//*[@data-id="commit-summary-testcommit2-"]', + locateStrategy: 'xpath' + }).pause(2000) + }, + 'check the log for testcommit2 #group1': async function (browser: NightwatchBrowser) { + const logs = await getGitLog('/tmp/git/bare.git') + console.log(logs) + browser.assert.ok(logs.includes('testcommit2')) + }, + 'clone locally and add a file and push #group1': async function (browser: NightwatchBrowser) { + await cloneOnServer('http://localhost:6868/bare.git', '/tmp/') + await onLocalGitRepoAddFile('/tmp/bare/', 'test2.txt') + await createCommitOnLocalServer('/tmp/bare/', 'testlocal') + await onLocalGitRepoPush('/tmp/bare/', 'master') + }, + 'run a git fetch #group1': function (browser: NightwatchBrowser) { + browser + .pause(2000) + .click('*[data-id="commands-panel"]') + .waitForElementVisible('*[data-id="sourcecontrol-fetch-branch"]') + + .click('*[data-id="sourcecontrol-fetch-branch"]') + .pause(2000) + .click('*[data-id="commits-panel"]') + .waitForElementVisible('*[data-id="commits-panel-behind"]') + .click('*[data-id="commits-panel-behind"]') + .waitForElementPresent({ + selector: '//*[@data-id="commit-summary-testlocal-"]', + locateStrategy: 'xpath' + }) + }, + 'run pull from the header #group1': function (browser: NightwatchBrowser) { + browser. + click('*[data-id="sourcecontrol-button-pull"]') + .waitForElementNotPresent('*[data-id="commits-panel-behind"]') + }, + 'check if the file is added #group1': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest2.txt"]') + }, +} + diff --git a/apps/remixdesktop/test/tests/app/git-ui_2.test.ts b/apps/remixdesktop/test/tests/app/git-ui_2.test.ts new file mode 100644 index 0000000000..2187a844d4 --- /dev/null +++ b/apps/remixdesktop/test/tests/app/git-ui_2.test.ts @@ -0,0 +1,164 @@ +import { ChildProcess, spawn } from "child_process" +import kill from 'tree-kill' +import { Nightwatch, NightwatchBrowser } from "nightwatch" +import { spawnGitServer, getGitLog, cloneOnServer, onLocalGitRepoAddFile, createCommitOnLocalServer, onLocalGitRepoPush, getBranches } from "../../lib/git" +let gitserver: ChildProcess + +/* +/ uses the git-http-backend package to create a git server ( if needed kill the server: kill -9 $(sudo lsof -t -i:6868) ) +/ GROUP 1: file operations PUSH PULL COMMIT SYNC FETCH CLONE ADD +/ GROUP 2: branch operations CREATE & PUBLISH +/ GROUP 3: file operations rename delete +*/ + +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + after: function (browser: NightwatchBrowser) { + browser.perform((done) => { + console.log('kill server', gitserver.pid) + kill(gitserver.pid) + done() + }) + }, + + 'run server #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + gitserver = await spawnGitServer('/tmp/') + console.log('working directory', process.cwd()) + done() + }) + }, + + 'clone a repo #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('dgit') + .pause(5000) + .waitForElementVisible('*[data-id="cloneButton"]') + .click('*[data-id="cloneButton"]') + .pause(1000) + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('*[data-id="modalDialogCustomPromptTextClone"]', 'http://localhost:6868/bare.git') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .windowHandles(function (result) { + console.log(result.value) + browser.switchWindow(result.value[1]) + .waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') + }) + .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.md"]') + }, + 'Update settings for git #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser. + clickLaunchIcon('dgit') + .setValue('*[data-id="gitubUsername"]', 'git') + .setValue('*[data-id="githubEmail"]', 'git@example.com') + .click('*[data-id="saveGitHubCredentials"]') + .modalFooterOKClick('github-credentials-error') + + }, + + // GROUP 2 + 'create a branch #group2': function (browser: NightwatchBrowser) { + browser + .click('*[data-id="branches-panel"]') + .waitForElementVisible('*[data-id="newbranchname"]') + .setValue('*[data-id="newbranchname"]', 'testbranch') + .click('*[data-id="sourcecontrol-create-branch"]') + .waitForElementVisible('*[data-id="branches-current-branch-testbranch"]') + .pause(1000) + }, + 'check if the branch is in the filePanel #group2': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .click('[data-id="workspaceGitBranchesDropdown"]') + .expect.element('[data-id="workspaceGit-testbranch"]').text.to.contain('✓ ') + }, + 'publish the branch #group2': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('dgit') + .waitForElementVisible('*[data-id="sourcecontrol-panel"]') + .click('*[data-id="sourcecontrol-panel"]') + .pause(1000) + .click('*[data-id="publishBranchButton"]') + .pause(2000) + .waitForElementNotVisible('*[data-id="publishBranchButton"]') + }, + 'check if the branch is published #group2': async function (browser: NightwatchBrowser) { + const branches = await getBranches('/tmp/git/bare.git') + browser.assert.ok(branches.includes('testbranch')) + }, + 'add file to new branch #group2': function (browser: NightwatchBrowser) { + browser + .pause(1000) + .addFile('test.txt', { content: 'hello world' }, 'README.md') + .clickLaunchIcon('dgit') + .pause(2000) + .waitForElementVisible({ + selector: "//*[@data-status='new-untracked' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .waitForElementVisible('*[data-id="addToGitChangestest.txt"]') + .pause(1000) + .click('*[data-id="addToGitChangestest.txt"]') + .waitForElementVisible({ + selector: "//*[@data-status='added-staged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .setValue('*[data-id="commitMessage"]', 'testcommit') + .click('*[data-id="commitButton"]') + .pause(1000) + }, + 'check if the commit is ahead in the branches list #group2': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="branches-panel"]') + .click('*[data-id="branches-panel"]') + .waitForElementVisible('*[data-id="branches-current-branch-testbranch"]') + .click({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='branches-current-branch-testbranch']", + locateStrategy: 'xpath', + suppressNotFoundErrors: true + }) + .click({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='commits-panel-ahead']", + locateStrategy: 'xpath', + suppressNotFoundErrors: true + }) + .click({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='branchdifference-commits-testbranch-ahead']//*[@data-id='commit-summary-testcommit-ahead']", + locateStrategy: 'xpath', + }) + .click({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='branchdifference-commits-testbranch-ahead']//*[@data-id='commit-change-added-test.txt']", + locateStrategy: 'xpath', + }) + .click({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='local-branch-commits-testbranch']//*[@data-id='commit-summary-testcommit-ahead']", + locateStrategy: 'xpath', + }) + .waitForElementVisible({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='local-branch-commits-testbranch']//*[@data-id='commit-change-added-test.txt']", + locateStrategy: 'xpath', + }) + }, + 'switch back to master #group2': function (browser: NightwatchBrowser) { + browser + .click({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='branches-toggle-branch-master']", + locateStrategy: 'xpath', + }) + .waitForElementVisible({ + selector: "//*[@data-id='branches-panel-content']//*[@data-id='branches-toggle-current-branch-master']", + locateStrategy: 'xpath', + }) + }, + 'check if test file is gone #group2': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.txt"]') + } +} + diff --git a/apps/remixdesktop/test/tests/app/git-ui_3.test.ts b/apps/remixdesktop/test/tests/app/git-ui_3.test.ts new file mode 100644 index 0000000000..e65b9ef3cf --- /dev/null +++ b/apps/remixdesktop/test/tests/app/git-ui_3.test.ts @@ -0,0 +1,132 @@ +import { ChildProcess, spawn } from "child_process" +import kill from 'tree-kill' +import { Nightwatch, NightwatchBrowser } from "nightwatch" +import { spawnGitServer, getGitLog, cloneOnServer, onLocalGitRepoAddFile, createCommitOnLocalServer, onLocalGitRepoPush, getBranches } from "../../lib/git" +let gitserver: ChildProcess + +/* +/ uses the git-http-backend package to create a git server ( if needed kill the server: kill -9 $(sudo lsof -t -i:6868) ) +/ GROUP 1: file operations PUSH PULL COMMIT SYNC FETCH CLONE ADD +/ GROUP 2: branch operations CREATE & PUBLISH +/ GROUP 3: file operations rename delete +*/ + +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + after: function (browser: NightwatchBrowser) { + browser.perform((done) => { + console.log('kill server', gitserver.pid) + kill(gitserver.pid) + done() + }) + }, + + 'run server #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + gitserver = await spawnGitServer('/tmp/') + console.log('working directory', process.cwd()) + done() + }) + }, + + 'clone a repo #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('dgit') + .pause(5000) + .waitForElementVisible('*[data-id="cloneButton"]') + .click('*[data-id="cloneButton"]') + .pause(1000) + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('*[data-id="modalDialogCustomPromptTextClone"]', 'http://localhost:6868/bare.git') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .windowHandles(function (result) { + console.log(result.value) + browser.switchWindow(result.value[1]) + .waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') + }) + .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.md"]') + }, + 'Update settings for git #group1 #group2 #group3': function (browser: NightwatchBrowser) { + browser. + clickLaunchIcon('dgit') + .setValue('*[data-id="gitubUsername"]', 'git') + .setValue('*[data-id="githubEmail"]', 'git@example.com') + .click('*[data-id="saveGitHubCredentials"]') + .modalFooterOKClick('github-credentials-error') + + }, + + 'check file added #group1 #group3': function (browser: NightwatchBrowser) { + browser + .addFile('test.txt', { content: 'hello world' }, 'README.md') + .clickLaunchIcon('dgit') + .pause(1000) + .waitForElementVisible({ + selector: "//*[@data-status='new-untracked' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .waitForElementVisible('*[data-id="addToGitChangestest.txt"]') + .pause(1000) + .click('*[data-id="addToGitChangestest.txt"]') + .waitForElementVisible({ + selector: "//*[@data-status='added-staged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .setValue('*[data-id="commitMessage"]', 'testcommit') + .click('*[data-id="commitButton"]') + }, + + // group 3 + 'rename a file #group3': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.txt"]') + .click('*[data-id="treeViewLitreeViewItemtest.txt"]') + .renamePath('test.txt', 'test_rename', 'test_rename.txt') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest_rename.txt"]') + .pause(1000) + }, + 'stage renamed file #group3': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('dgit') + .waitForElementVisible({ + selector: "//*[@data-status='deleted-unstaged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .waitForElementVisible('*[data-id="addToGitChangestest.txt"]') + .waitForElementVisible({ + selector: "//*[@data-status='new-untracked' and @data-file='/test_rename.txt']", + locateStrategy: 'xpath' + }) + .click('*[data-id="sourcecontrol-add-all"]') + .waitForElementVisible({ + selector: "//*[@data-status='added-staged' and @data-file='/test_rename.txt']", + locateStrategy: 'xpath' + }) + }, + 'undo the rename #group3': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="unStageStagedtest_rename.txt"]') + .click('*[data-id="unStageStagedtest_rename.txt"]') + .pause(1000) + .click('*[data-id="unDoStagedtest.txt"]') + .pause(1000) + .waitForElementNotPresent({ + selector: "//*[@data-file='/test.txt']", + locateStrategy: 'xpath' + }) + }, + 'check if file is returned #group3': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.txt"]') + }, + + + } + diff --git a/apps/remixdesktop/test/types/index.d.ts b/apps/remixdesktop/test/types/index.d.ts index 7208a7c50d..faf3a89d54 100644 --- a/apps/remixdesktop/test/types/index.d.ts +++ b/apps/remixdesktop/test/types/index.d.ts @@ -11,7 +11,7 @@ declare module 'nightwatch' { scrollInto(target: string): NightwatchBrowser testContracts(fileName: string, contractCode: NightwatchContractContent, compiledContractNames: string[]): NightwatchBrowser setEditorValue(value: string, callback?: () => void): NightwatchBrowser - addFile(name: string, content: NightwatchContractContent): NightwatchBrowser + addFile(name: string, content: NightwatchContractContent, readMeFile?: string): NightwatchBrowser verifyContracts(compiledContractNames: string[], opts?: {wait: number; version?: string; runs?: string}): NightwatchBrowser selectAccount(account?: string): NightwatchBrowser clickFunction(fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser diff --git a/apps/remixdesktop/tsconfig.json b/apps/remixdesktop/tsconfig.json index 871cb5452b..6f33703305 100644 --- a/apps/remixdesktop/tsconfig.json +++ b/apps/remixdesktop/tsconfig.json @@ -1,12 +1,13 @@ { "compilerOptions": { - "jsx": "react-jsx", - "target": "ES6", + "target": "es6", "allowJs": true, - "module": "commonjs", + "module": "CommonJS", "skipLibCheck": true, "esModuleInterop": true, "noImplicitAny": false, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, "sourceMap": true, "baseUrl": ".", "outDir": "./build", diff --git a/apps/remixdesktop/yarn.lock b/apps/remixdesktop/yarn.lock index e1aad0bdd0..b96b5cae81 100644 --- a/apps/remixdesktop/yarn.lock +++ b/apps/remixdesktop/yarn.lock @@ -582,221 +582,247 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@octokit/app@^15.0.0": - version "15.1.0" - resolved "https://registry.yarnpkg.com/@octokit/app/-/app-15.1.0.tgz#b330d8826be088ec8d1d43a59dc27ef57d1232b2" - integrity sha512-TkBr7QgOmE6ORxvIAhDbZsqPkF7RSqTY4pLTtUQCvr6dTXqvi2fFo46q3h1lxlk/sGMQjqyZ0kEahkD/NyzOHg== - dependencies: - "@octokit/auth-app" "^7.0.0" - "@octokit/auth-unauthenticated" "^6.0.0" - "@octokit/core" "^6.1.2" - "@octokit/oauth-app" "^7.0.0" - "@octokit/plugin-paginate-rest" "^11.0.0" - "@octokit/types" "^13.0.0" - "@octokit/webhooks" "^13.0.0" - -"@octokit/auth-app@^7.0.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@octokit/auth-app/-/auth-app-7.1.0.tgz#55a3d3b3b3607b9d375abbe946163dca3a25c2c9" - integrity sha512-cazGaJPSgeZ8NkVYeM/C5l/6IQ5vZnsI8p1aMucadCkt/bndI+q+VqwrlnWbASRmenjOkf1t1RpCKrif53U8gw== - dependencies: - "@octokit/auth-oauth-app" "^8.1.0" - "@octokit/auth-oauth-user" "^5.1.0" - "@octokit/request" "^9.1.1" - "@octokit/request-error" "^6.1.1" - "@octokit/types" "^13.4.1" +"@octokit/app@^14.0.2": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@octokit/app/-/app-14.1.0.tgz#2d491dc70746773b83f61edf5c56817dd7d3854b" + integrity sha512-g3uEsGOQCBl1+W1rgfwoRFUIR6PtvB2T1E4RpygeUU5LrLvlOqcxrt5lfykIeRpUPpupreGJUYl70fqMDXdTpw== + dependencies: + "@octokit/auth-app" "^6.0.0" + "@octokit/auth-unauthenticated" "^5.0.0" + "@octokit/core" "^5.0.0" + "@octokit/oauth-app" "^6.0.0" + "@octokit/plugin-paginate-rest" "^9.0.0" + "@octokit/types" "^12.0.0" + "@octokit/webhooks" "^12.0.4" + +"@octokit/auth-app@^6.0.0": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@octokit/auth-app/-/auth-app-6.1.1.tgz#758a5d2e0324c750f7463b10398fd99c52b2eb89" + integrity sha512-VrTtzRpyuT5nYGUWeGWQqH//hqEZDV+/yb6+w5wmWpmmUA1Tx950XsAc2mBBfvusfcdF2E7w8jZ1r1WwvfZ9pA== + dependencies: + "@octokit/auth-oauth-app" "^7.1.0" + "@octokit/auth-oauth-user" "^4.1.0" + "@octokit/request" "^8.3.1" + "@octokit/request-error" "^5.1.0" + "@octokit/types" "^13.1.0" + deprecation "^2.3.1" lru-cache "^10.0.0" - universal-github-app-jwt "^2.2.0" - universal-user-agent "^7.0.0" + universal-github-app-jwt "^1.1.2" + universal-user-agent "^6.0.0" -"@octokit/auth-oauth-app@^8.0.0", "@octokit/auth-oauth-app@^8.1.0": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@octokit/auth-oauth-app/-/auth-oauth-app-8.1.1.tgz#6204affa6e86f535016799cadf2af9befe5e893c" - integrity sha512-5UtmxXAvU2wfcHIPPDWzVSAWXVJzG3NWsxb7zCFplCWEmMCArSZV0UQu5jw5goLQXbFyOr5onzEH37UJB3zQQg== +"@octokit/auth-oauth-app@^7.0.0", "@octokit/auth-oauth-app@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-oauth-app/-/auth-oauth-app-7.1.0.tgz#d0f74e19ebd5a4829cb780c107cedd6c894f20fc" + integrity sha512-w+SyJN/b0l/HEb4EOPRudo7uUOSW51jcK1jwLa+4r7PA8FPFpoxEnHBHMITqCsc/3Vo2qqFjgQfz/xUUvsSQnA== dependencies: - "@octokit/auth-oauth-device" "^7.0.0" - "@octokit/auth-oauth-user" "^5.0.1" - "@octokit/request" "^9.0.0" + "@octokit/auth-oauth-device" "^6.1.0" + "@octokit/auth-oauth-user" "^4.1.0" + "@octokit/request" "^8.3.1" "@octokit/types" "^13.0.0" - universal-user-agent "^7.0.0" + "@types/btoa-lite" "^1.0.0" + btoa-lite "^1.0.0" + universal-user-agent "^6.0.0" -"@octokit/auth-oauth-device@^7.0.0", "@octokit/auth-oauth-device@^7.0.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@octokit/auth-oauth-device/-/auth-oauth-device-7.1.1.tgz#7b4f8f97cbcadbe9894d48cde4406dbdef39875a" - integrity sha512-HWl8lYueHonuyjrKKIup/1tiy0xcmQCdq5ikvMO1YwkNNkxb6DXfrPjrMYItNLyCP/o2H87WuijuE+SlBTT8eg== +"@octokit/auth-oauth-device@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-oauth-device/-/auth-oauth-device-6.1.0.tgz#f868213a3db05fe27e68d1fc607502a322379dd9" + integrity sha512-FNQ7cb8kASufd6Ej4gnJ3f1QB5vJitkoV1O0/g6e6lUsQ7+VsSNRHRmFScN2tV4IgKA12frrr/cegUs0t+0/Lw== dependencies: - "@octokit/oauth-methods" "^5.0.0" - "@octokit/request" "^9.0.0" + "@octokit/oauth-methods" "^4.1.0" + "@octokit/request" "^8.3.1" "@octokit/types" "^13.0.0" - universal-user-agent "^7.0.0" + universal-user-agent "^6.0.0" -"@octokit/auth-oauth-user@^5.0.1", "@octokit/auth-oauth-user@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@octokit/auth-oauth-user/-/auth-oauth-user-5.1.1.tgz#4f1570c6ee15bb9ddc3dcca83308dcaa159e3848" - integrity sha512-rRkMz0ErOppdvEfnemHJXgZ9vTPhBuC6yASeFaB7I2yLMd7QpjfrL1mnvRPlyKo+M6eeLxrKanXJ9Qte29SRsw== +"@octokit/auth-oauth-user@^4.0.0", "@octokit/auth-oauth-user@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-oauth-user/-/auth-oauth-user-4.1.0.tgz#32e5529f8bd961af9839a1f8c6ab0c8ad2184eee" + integrity sha512-FrEp8mtFuS/BrJyjpur+4GARteUCrPeR/tZJzD8YourzoVhRics7u7we/aDcKv+yywRNwNi/P4fRi631rG/OyQ== dependencies: - "@octokit/auth-oauth-device" "^7.0.1" - "@octokit/oauth-methods" "^5.0.0" - "@octokit/request" "^9.0.1" + "@octokit/auth-oauth-device" "^6.1.0" + "@octokit/oauth-methods" "^4.1.0" + "@octokit/request" "^8.3.1" "@octokit/types" "^13.0.0" - universal-user-agent "^7.0.0" + btoa-lite "^1.0.0" + universal-user-agent "^6.0.0" -"@octokit/auth-token@^5.0.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-5.1.1.tgz#3bbfe905111332a17f72d80bd0b51a3e2fa2cf07" - integrity sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA== +"@octokit/auth-token@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-4.0.0.tgz#40d203ea827b9f17f42a29c6afb93b7745ef80c7" + integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA== -"@octokit/auth-unauthenticated@^6.0.0", "@octokit/auth-unauthenticated@^6.0.0-beta.1": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@octokit/auth-unauthenticated/-/auth-unauthenticated-6.1.0.tgz#de0fe923bb06ed93aea526ab99972a98c546d0bf" - integrity sha512-zPSmfrUAcspZH/lOFQnVnvjQZsIvmfApQH6GzJrkIunDooU1Su2qt2FfMTSVPRp7WLTQyC20Kd55lF+mIYaohQ== +"@octokit/auth-unauthenticated@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@octokit/auth-unauthenticated/-/auth-unauthenticated-5.0.1.tgz#d8032211728333068b2e07b53997c29e59a03507" + integrity sha512-oxeWzmBFxWd+XolxKTc4zr+h3mt+yofn4r7OfoIkR/Cj/o70eEGmPsFbueyJE2iBAGpjgTnEOKM3pnuEGVmiqg== dependencies: - "@octokit/request-error" "^6.0.1" - "@octokit/types" "^13.0.0" + "@octokit/request-error" "^5.0.0" + "@octokit/types" "^12.0.0" -"@octokit/core@^6.0.0", "@octokit/core@^6.1.2": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-6.1.2.tgz#20442d0a97c411612da206411e356014d1d1bd17" - integrity sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg== +"@octokit/core@^5.0.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.2.0.tgz#ddbeaefc6b44a39834e1bb2e58a49a117672a7ea" + integrity sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg== dependencies: - "@octokit/auth-token" "^5.0.0" - "@octokit/graphql" "^8.0.0" - "@octokit/request" "^9.0.0" - "@octokit/request-error" "^6.0.1" + "@octokit/auth-token" "^4.0.0" + "@octokit/graphql" "^7.1.0" + "@octokit/request" "^8.3.1" + "@octokit/request-error" "^5.1.0" "@octokit/types" "^13.0.0" - before-after-hook "^3.0.2" - universal-user-agent "^7.0.0" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" -"@octokit/endpoint@^10.0.0": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-10.1.1.tgz#1a9694e7aef6aa9d854dc78dd062945945869bcc" - integrity sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q== +"@octokit/endpoint@^9.0.1": + version "9.0.5" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-9.0.5.tgz#e6c0ee684e307614c02fc6ac12274c50da465c44" + integrity sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw== dependencies: - "@octokit/types" "^13.0.0" - universal-user-agent "^7.0.2" + "@octokit/types" "^13.1.0" + universal-user-agent "^6.0.0" -"@octokit/graphql@^8.0.0": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-8.1.1.tgz#3cacab5f2e55d91c733e3bf481d3a3f8a5f639c4" - integrity sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg== +"@octokit/graphql@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-7.1.0.tgz#9bc1c5de92f026648131f04101cab949eeffe4e0" + integrity sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ== dependencies: - "@octokit/request" "^9.0.0" + "@octokit/request" "^8.3.0" "@octokit/types" "^13.0.0" - universal-user-agent "^7.0.0" - -"@octokit/oauth-app@^7.0.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@octokit/oauth-app/-/oauth-app-7.1.3.tgz#a0f256dd185e7c00bfbc3e6bc3c5aad66e42c609" - integrity sha512-EHXbOpBkSGVVGF1W+NLMmsnSsJRkcrnVmDKt0TQYRBb6xWfWzoi9sBD4DIqZ8jGhOWO/V8t4fqFyJ4vDQDn9bg== - dependencies: - "@octokit/auth-oauth-app" "^8.0.0" - "@octokit/auth-oauth-user" "^5.0.1" - "@octokit/auth-unauthenticated" "^6.0.0-beta.1" - "@octokit/core" "^6.0.0" - "@octokit/oauth-authorization-url" "^7.0.0" - "@octokit/oauth-methods" "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/oauth-app@^6.0.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@octokit/oauth-app/-/oauth-app-6.1.0.tgz#22c276f6ad2364c6999837bfdd5d9c1092838726" + integrity sha512-nIn/8eUJ/BKUVzxUXd5vpzl1rwaVxMyYbQkNZjHrF7Vk/yu98/YDF/N2KeWO7uZ0g3b5EyiFXFkZI8rJ+DH1/g== + dependencies: + "@octokit/auth-oauth-app" "^7.0.0" + "@octokit/auth-oauth-user" "^4.0.0" + "@octokit/auth-unauthenticated" "^5.0.0" + "@octokit/core" "^5.0.0" + "@octokit/oauth-authorization-url" "^6.0.2" + "@octokit/oauth-methods" "^4.0.0" "@types/aws-lambda" "^8.10.83" - universal-user-agent "^7.0.0" + universal-user-agent "^6.0.0" -"@octokit/oauth-authorization-url@^7.0.0": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@octokit/oauth-authorization-url/-/oauth-authorization-url-7.1.1.tgz#0e17c2225eb66b58ec902d02b6f1315ffe9ff04b" - integrity sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA== +"@octokit/oauth-authorization-url@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@octokit/oauth-authorization-url/-/oauth-authorization-url-6.0.2.tgz#cc82ca29cc5e339c9921672f39f2b3f5c8eb6ef2" + integrity sha512-CdoJukjXXxqLNK4y/VOiVzQVjibqoj/xHgInekviUJV73y/BSIcwvJ/4aNHPBPKcPWFnd4/lO9uqRV65jXhcLA== -"@octokit/oauth-methods@^5.0.0": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@octokit/oauth-methods/-/oauth-methods-5.1.2.tgz#fd31d2a69f4c91d1abc1ed1814dda5252c697e02" - integrity sha512-C5lglRD+sBlbrhCUTxgJAFjWgJlmTx5bQ7Ch0+2uqRjYv7Cfb5xpX4WuSC9UgQna3sqRGBL9EImX9PvTpMaQ7g== +"@octokit/oauth-methods@^4.0.0", "@octokit/oauth-methods@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@octokit/oauth-methods/-/oauth-methods-4.1.0.tgz#1403ac9c4d4e277922fddc4c89fa8a782f8f791b" + integrity sha512-4tuKnCRecJ6CG6gr0XcEXdZtkTDbfbnD5oaHBmLERTjTMZNi2CbfEHZxPU41xXLDG4DfKf+sonu00zvKI9NSbw== dependencies: - "@octokit/oauth-authorization-url" "^7.0.0" - "@octokit/request" "^9.1.0" - "@octokit/request-error" "^6.1.0" + "@octokit/oauth-authorization-url" "^6.0.2" + "@octokit/request" "^8.3.1" + "@octokit/request-error" "^5.1.0" "@octokit/types" "^13.0.0" + btoa-lite "^1.0.0" + +"@octokit/openapi-types@^20.0.0": + version "20.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-20.0.0.tgz#9ec2daa0090eeb865ee147636e0c00f73790c6e5" + integrity sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA== "@octokit/openapi-types@^22.2.0": version "22.2.0" resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-22.2.0.tgz#75aa7dcd440821d99def6a60b5f014207ae4968e" integrity sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg== -"@octokit/openapi-webhooks-types@8.3.0": - version "8.3.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-webhooks-types/-/openapi-webhooks-types-8.3.0.tgz#a7a4da00c0f27f7f5708eb3fcebefa08f8d51125" - integrity sha512-vKLsoR4xQxg4Z+6rU/F65ItTUz/EXbD+j/d4mlq2GW8TsA4Tc8Kdma2JTAAJ5hrKWUQzkR/Esn2fjsqiVRYaQg== - -"@octokit/plugin-paginate-graphql@^5.0.0": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-graphql/-/plugin-paginate-graphql-5.2.2.tgz#54e2afef55bb204eb945a891b85a169b9ddad1f8" - integrity sha512-7znSVvlNAOJisCqAnjN1FtEziweOHSjPGAuc5W58NeGNAr/ZB57yCsjQbXDlWsVryA7hHQaEQPcBbJYFawlkyg== +"@octokit/plugin-paginate-graphql@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-graphql/-/plugin-paginate-graphql-4.0.1.tgz#9c0b1145b93a2b8635943f497c127969d54512fc" + integrity sha512-R8ZQNmrIKKpHWC6V2gum4x9LG2qF1RxRjo27gjQcG3j+vf2tLsEfE7I/wRWEPzYMaenr1M+qDAtNcwZve1ce1A== -"@octokit/plugin-paginate-rest@^11.0.0": - version "11.3.3" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.3.tgz#efc97ba66aae6797e2807a082f99b9cfc0e05aba" - integrity sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA== +"@octokit/plugin-paginate-rest@11.3.1": + version "11.3.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.1.tgz#fe92d04b49f134165d6fbb716e765c2f313ad364" + integrity sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g== dependencies: "@octokit/types" "^13.5.0" -"@octokit/plugin-rest-endpoint-methods@^13.0.0": - version "13.2.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.4.tgz#543add032d3fe3f5d2839bfd619cf66d85469f01" - integrity sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw== +"@octokit/plugin-paginate-rest@^9.0.0": + version "9.2.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz#2e2a2f0f52c9a4b1da1a3aa17dabe3c459b9e401" + integrity sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw== + dependencies: + "@octokit/types" "^12.6.0" + +"@octokit/plugin-rest-endpoint-methods@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.2.tgz#af8e5dd2cddfea576f92ffaf9cb84659f302a638" + integrity sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA== dependencies: "@octokit/types" "^13.5.0" -"@octokit/plugin-retry@^7.0.0": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-retry/-/plugin-retry-7.1.1.tgz#a84483e4afdd068dd71da81abe206a9e442c1288" - integrity sha512-G9Ue+x2odcb8E1XIPhaFBnTTIrrUDfXN05iFXiqhR+SeeeDMMILcAnysOsxUpEWcQp2e5Ft397FCXTcPkiPkLw== +"@octokit/plugin-retry@^6.0.0": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz#3257404f7cc418e1c1f13a7f2012c1db848b7693" + integrity sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog== dependencies: - "@octokit/request-error" "^6.0.0" - "@octokit/types" "^13.0.0" + "@octokit/request-error" "^5.0.0" + "@octokit/types" "^12.0.0" bottleneck "^2.15.3" -"@octokit/plugin-throttling@^9.0.0": - version "9.3.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-throttling/-/plugin-throttling-9.3.0.tgz#2700963c6f7e0f62de2158a6d67d1b47c19af3d4" - integrity sha512-B5YTToSRTzNSeEyssnrT7WwGhpIdbpV9NKIs3KyTWHX6PhpYn7gqF/+lL3BvsASBM3Sg5BAUYk7KZx5p/Ec77w== +"@octokit/plugin-throttling@^8.0.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-throttling/-/plugin-throttling-8.2.0.tgz#9ec3ea2e37b92fac63f06911d0c8141b46dc4941" + integrity sha512-nOpWtLayKFpgqmgD0y3GqXafMFuKcA4tRPZIfu7BArd2lEZeb1988nhWhwx4aZWmjDmUfdgVf7W+Tt4AmvRmMQ== dependencies: - "@octokit/types" "^13.0.0" + "@octokit/types" "^12.2.0" bottleneck "^2.15.3" -"@octokit/request-error@^6.0.0", "@octokit/request-error@^6.0.1", "@octokit/request-error@^6.1.0", "@octokit/request-error@^6.1.1": - version "6.1.4" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-6.1.4.tgz#ad96e29148d19edc2ba8009fc2b5a24a36c90f16" - integrity sha512-VpAhIUxwhWZQImo/dWAN/NpPqqojR6PSLgLYAituLM6U+ddx9hCioFGwBr5Mi+oi5CLeJkcAs3gJ0PYYzU6wUg== +"@octokit/request-error@^5.0.0", "@octokit/request-error@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-5.1.0.tgz#ee4138538d08c81a60be3f320cd71063064a3b30" + integrity sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q== dependencies: - "@octokit/types" "^13.0.0" + "@octokit/types" "^13.1.0" + deprecation "^2.0.0" + once "^1.4.0" -"@octokit/request@^9.0.0", "@octokit/request@^9.0.1", "@octokit/request@^9.1.0", "@octokit/request@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-9.1.1.tgz#e836eb69c0fb4b59b6437af7716ca348a1232a52" - integrity sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw== +"@octokit/request@^8.3.0", "@octokit/request@^8.3.1": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-8.4.0.tgz#7f4b7b1daa3d1f48c0977ad8fffa2c18adef8974" + integrity sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw== dependencies: - "@octokit/endpoint" "^10.0.0" - "@octokit/request-error" "^6.0.1" + "@octokit/endpoint" "^9.0.1" + "@octokit/request-error" "^5.1.0" "@octokit/types" "^13.1.0" - universal-user-agent "^7.0.2" + universal-user-agent "^6.0.0" + +"@octokit/types@^12.0.0", "@octokit/types@^12.2.0", "@octokit/types@^12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-12.6.0.tgz#8100fb9eeedfe083aae66473bd97b15b62aedcb2" + integrity sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw== + dependencies: + "@octokit/openapi-types" "^20.0.0" -"@octokit/types@^13.0.0", "@octokit/types@^13.1.0", "@octokit/types@^13.4.1", "@octokit/types@^13.5.0": +"@octokit/types@^13.0.0", "@octokit/types@^13.1.0", "@octokit/types@^13.5.0": version "13.5.0" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-13.5.0.tgz#4796e56b7b267ebc7c921dcec262b3d5bfb18883" integrity sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ== dependencies: "@octokit/openapi-types" "^22.2.0" -"@octokit/webhooks-methods@^5.0.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@octokit/webhooks-methods/-/webhooks-methods-5.1.0.tgz#13b6c08f89902c1ab0ddf31c6eeeec9c2772cfe6" - integrity sha512-yFZa3UH11VIxYnnoOYCVoJ3q4ChuSOk2IVBBQ0O3xtKX4x9bmKb/1t+Mxixv2iUhzMdOl1qeWJqEhouXXzB3rQ== - -"@octokit/webhooks@^13.0.0": - version "13.2.8" - resolved "https://registry.yarnpkg.com/@octokit/webhooks/-/webhooks-13.2.8.tgz#8d7134870c327e413809c83a11b46e1896a6f0fe" - integrity sha512-nQyf5UDEgIeZB65rXSvK9ep9PkYthbnmXu/VK9AJcMMOvH1UwzcvYNd9DN++HIr8HXwbqB1FAEv5CnNARQEsaQ== - dependencies: - "@octokit/openapi-webhooks-types" "8.3.0" - "@octokit/request-error" "^6.0.1" - "@octokit/webhooks-methods" "^5.0.0" - aggregate-error "^5.0.0" +"@octokit/webhooks-methods@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@octokit/webhooks-methods/-/webhooks-methods-4.1.0.tgz#681a6c86c9b21d4ec9e29108fb053ae7512be033" + integrity sha512-zoQyKw8h9STNPqtm28UGOYFE7O6D4Il8VJwhAtMHFt2C4L0VQT1qGKLeefUOqHNs1mNRYSadVv7x0z8U2yyeWQ== + +"@octokit/webhooks-types@7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@octokit/webhooks-types/-/webhooks-types-7.4.0.tgz#7ed15c75908683a34e0079c80f261fe568b87395" + integrity sha512-FE2V+QZ2UYlh+9wWd5BPLNXG+J/XUD/PPq0ovS+nCcGX4+3qVbi3jYOmCTW48hg9SBBLtInx9+o7fFt4H5iP0Q== + +"@octokit/webhooks@^12.0.4": + version "12.2.0" + resolved "https://registry.yarnpkg.com/@octokit/webhooks/-/webhooks-12.2.0.tgz#ea1ee2d9d9c5a4b7b53ff8bc64a9feb0dac94161" + integrity sha512-CyuLJ0/P7bKZ+kIYw+fnkeVdhUzNuDKgNSI7pU/m7Nod0T7kP+s4s2f0pNmG9HL8/RZN1S0ZWTDll3VTMrFLAw== + dependencies: + "@octokit/request-error" "^5.0.0" + "@octokit/webhooks-methods" "^4.1.0" + "@octokit/webhooks-types" "7.4.0" + aggregate-error "^3.1.0" "@openzeppelin/contracts@^4.7.3": version "4.9.6" @@ -970,6 +996,11 @@ "@types/connect" "*" "@types/node" "*" +"@types/btoa-lite@^1.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/btoa-lite/-/btoa-lite-1.0.2.tgz#82bb6aab00abf7cff3ca2825abe010c0cd536ae5" + integrity sha512-ZYbcE2x7yrvNFJiU7xJGrpF/ihpkM7zKgw8bha3LNJSesvTtUNxbpzaT7WXBIryf6jovisrxTBvymxMeLLj1Mg== + "@types/byline@^4.2.35": version "4.2.35" resolved "https://registry.npmjs.org/@types/byline/-/byline-4.2.35.tgz" @@ -1069,6 +1100,13 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== +"@types/jsonwebtoken@^9.0.0": + version "9.0.6" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-9.0.6.tgz#d1af3544d99ad992fb6681bbe60676e06b032bd3" + integrity sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw== + dependencies: + "@types/node" "*" + "@types/keyv@^3.1.4": version "3.1.4" resolved "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz" @@ -1416,14 +1454,6 @@ aggregate-error@^3.1.0: clean-stack "^2.0.0" indent-string "^4.0.0" -aggregate-error@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-5.0.0.tgz#ffe15045d7521c51c9d618e3d7f37c13f29b3fd3" - integrity sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw== - dependencies: - clean-stack "^5.2.0" - indent-string "^5.0.0" - ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" @@ -1705,10 +1735,10 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -before-after-hook@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-3.0.2.tgz#d5665a5fa8b62294a5aa0a499f933f4a1016195d" - integrity sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A== +before-after-hook@^2.2.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" + integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== bignumber.js@^9.0.0: version "9.1.2" @@ -1880,11 +1910,21 @@ bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" +btoa-lite@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + integrity sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA== + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== + buffer-equal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.1.tgz#2f7651be5b1b3f057fcd6e7ee16cf34767077d90" @@ -2135,13 +2175,6 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -clean-stack@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-5.2.0.tgz#c7a0c91939c7caace30a3bf254e8a8ac276d1189" - integrity sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ== - dependencies: - escape-string-regexp "5.0.0" - cli-boxes@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" @@ -2550,6 +2583,11 @@ depd@2.0.0: resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -2649,6 +2687,13 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ecdsa-sig-formatter@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" + integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== + dependencies: + safe-buffer "^5.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -2963,11 +3008,6 @@ escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" - integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== - eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -3975,11 +4015,6 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -indent-string@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" - integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" @@ -4424,6 +4459,22 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonwebtoken@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" + integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ== + dependencies: + jws "^3.2.2" + lodash.includes "^4.3.0" + lodash.isboolean "^3.0.3" + lodash.isinteger "^4.0.4" + lodash.isnumber "^3.0.3" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.once "^4.0.0" + ms "^2.1.1" + semver "^7.5.4" + jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" @@ -4444,6 +4495,23 @@ jszip@^3.1.0, jszip@^3.10.0: readable-stream "~2.3.6" setimmediate "^1.0.5" +jwa@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" + integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.11" + safe-buffer "^5.0.1" + +jws@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" + integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== + dependencies: + jwa "^1.4.1" + safe-buffer "^5.0.1" + keccak@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" @@ -4575,6 +4643,11 @@ lodash.escaperegexp@^4.1.2: resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" integrity sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw== +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== + lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" @@ -4585,11 +4658,36 @@ lodash.isarray@^3.0.0: resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" integrity sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ== +lodash.isboolean@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" + integrity sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg== + lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== +lodash.isinteger@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" + integrity sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA== + +lodash.isnumber@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" + integrity sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw== + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== + lodash.keys@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" @@ -4609,6 +4707,11 @@ lodash.merge@4.6.2, lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.once@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" + integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== + lodash@^4.17.15: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" @@ -4937,7 +5040,7 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3: +ms@2.1.3, ms@^2.1.1: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -5157,20 +5260,20 @@ oboe@2.1.5: dependencies: http-https "^1.0.0" -octokit@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/octokit/-/octokit-4.0.2.tgz#775d68d363cdaec69d7b73d3dc82ae909d30f59b" - integrity sha512-wbqF4uc1YbcldtiBFfkSnquHtECEIpYD78YUXI6ri1Im5OO2NLo6ZVpRdbJpdnpZ05zMrVPssNiEo6JQtea+Qg== - dependencies: - "@octokit/app" "^15.0.0" - "@octokit/core" "^6.0.0" - "@octokit/oauth-app" "^7.0.0" - "@octokit/plugin-paginate-graphql" "^5.0.0" - "@octokit/plugin-paginate-rest" "^11.0.0" - "@octokit/plugin-rest-endpoint-methods" "^13.0.0" - "@octokit/plugin-retry" "^7.0.0" - "@octokit/plugin-throttling" "^9.0.0" - "@octokit/request-error" "^6.0.0" +octokit@^3.1.2: + version "3.2.1" + resolved "https://registry.yarnpkg.com/octokit/-/octokit-3.2.1.tgz#d376ca3b12a61c58da02a93c491d2e627069b194" + integrity sha512-u+XuSejhe3NdIvty3Jod00JvTdAE/0/+XbhIDhefHbu+2OcTRHd80aCiH6TX19ZybJmwPQBKFQmHGxp0i9mJrg== + dependencies: + "@octokit/app" "^14.0.2" + "@octokit/core" "^5.0.0" + "@octokit/oauth-app" "^6.0.0" + "@octokit/plugin-paginate-graphql" "^4.0.0" + "@octokit/plugin-paginate-rest" "11.3.1" + "@octokit/plugin-rest-endpoint-methods" "13.2.2" + "@octokit/plugin-retry" "^6.0.0" + "@octokit/plugin-throttling" "^8.0.0" + "@octokit/request-error" "^5.0.0" "@octokit/types" "^13.0.0" on-finished@2.4.1: @@ -6570,15 +6673,18 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -universal-github-app-jwt@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/universal-github-app-jwt/-/universal-github-app-jwt-2.2.0.tgz#dc6c8929e76f1996a766ba2a08fb420f73365d77" - integrity sha512-G5o6f95b5BggDGuUfKDApKaCgNYy2x7OdHY0zSMF081O0EJobw+1130VONhrA7ezGSV2FNOGyM+KQpQZAr9bIQ== +universal-github-app-jwt@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/universal-github-app-jwt/-/universal-github-app-jwt-1.1.2.tgz#8c1867a394d7d9d42cda34f11d1bcb023797d8df" + integrity sha512-t1iB2FmLFE+yyJY9+3wMx0ejB+MQpEVkH0gQv7dR6FZyltyq+ZZO0uDpbopxhrZ3SLEO4dCEkIujOMldEQ2iOA== + dependencies: + "@types/jsonwebtoken" "^9.0.0" + jsonwebtoken "^9.0.2" -universal-user-agent@^7.0.0, universal-user-agent@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-7.0.2.tgz#52e7d0e9b3dc4df06cc33cb2b9fd79041a54827e" - integrity sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q== +universal-user-agent@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.1.tgz#15f20f55da3c930c57bddbf1734c6654d5fd35aa" + integrity sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ== universalify@^0.1.0: version "0.1.2" diff --git a/libs/remix-ui/git/src/components/disabled.tsx b/libs/remix-ui/git/src/components/disabled.tsx index 7825ee22df..fc22116a36 100644 --- a/libs/remix-ui/git/src/components/disabled.tsx +++ b/libs/remix-ui/git/src/components/disabled.tsx @@ -6,7 +6,7 @@ import { openCloneDialog, openFolderInSameWindow } from '../lib/pluginActions' export const Disabled = () => { const platform = useContext(platformContext) - + const openFolderElectron = async (path: string) => { await openFolderInSameWindow(path) } @@ -18,9 +18,9 @@ export const Disabled = () => { return ( (platform === appPlatformTypes.desktop) ?
-
-
{ await openFolderElectron(null) }} className='btn btn-primary w-100 my-1'>
-
{ await clone() }} className='btn btn-primary w-100'>
+
+
{ await openFolderElectron(null) }} className='btn btn-primary w-100 my-1'>
+
{ await clone() }} className='btn btn-primary w-100'>
:
diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index 36651a4da9..88c8cac595 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -21,7 +21,7 @@ export const fileStatuses = [ ["deleted,unstaged", 1, 0, 1], // deleted, unstaged ["deleted,staged", 1, 0, 0], ["unmodified", 1, 1, 3], - ["deleted,not in git", 0, 0, 3], + ["added,deleted", 0, 0, 3], ["unstaged,modified", 1, 2, 0] ]; @@ -90,7 +90,7 @@ export const getCommits = async () => { "log", { ref: "HEAD" } ); - + console.log('commits', commits) return commits; } catch (e) { return []; diff --git a/libs/remix-ui/git/src/lib/listeners.ts b/libs/remix-ui/git/src/lib/listeners.ts index 682674e6f5..392e5b211b 100644 --- a/libs/remix-ui/git/src/lib/listeners.ts +++ b/libs/remix-ui/git/src/lib/listeners.ts @@ -87,13 +87,13 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch { console.log('setWorkspace', x) - - if(platform == appPlatformTypes.desktop) { + + if (platform == appPlatformTypes.desktop) { const workingDir = await plugin.call('fs', 'getWorkingDir') gitDispatch(setCanUseApp(workingDir? true : false)) - }else{ + } else { gitDispatch(setCanUseApp(x && !x.isLocalhost && x.name)) - } + } loadFileQueue.enqueue(async () => { loadFiles() @@ -109,7 +109,6 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch { loadFileQueue.enqueue(async () => { gitlog() @@ -138,6 +137,10 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch { + console.log('commit') + loadFileQueue.enqueue(async () => { + loadFiles() + }, 10) loadFileQueue.enqueue(async () => { gitlog() }, 10) diff --git a/libs/remix-ui/git/src/state/gitreducer.tsx b/libs/remix-ui/git/src/state/gitreducer.tsx index f9654e4a96..3a488d3a12 100644 --- a/libs/remix-ui/git/src/state/gitreducer.tsx +++ b/libs/remix-ui/git/src/state/gitreducer.tsx @@ -6,209 +6,208 @@ import { Actions } from "./actions" export const gitReducer = (state: gitState = defaultGitState, action: Actions): gitState => { switch (action.type) { - case 'FILE_STATUS': - return { - ...state, - fileStatusResult: action.payload, - staged: getFilesByStatus("staged", action.payload), - modified: getFilesByStatus("modified", action.payload), - untracked: getFilesByStatus("untracked", action.payload), - deleted: getFilesByStatus("deleted", action.payload), - allchangesnotstaged: allChangedButNotStagedFiles(action.payload) - } - - case 'FILE_STATUS_MERGE': - action.payload.map((fileStatusResult: fileStatusResult) => { - const file = state.fileStatusResult.find(stateFile => { - return stateFile.filename === fileStatusResult.filename - }) - if (file) { - file.status = fileStatusResult.status - file.statusNames = fileStatusResult.statusNames - } - }) - - return { - ...state, - staged: getFilesByStatus("staged", state.fileStatusResult), - modified: getFilesByStatus("modified", state.fileStatusResult), - untracked: getFilesByStatus("untracked", state.fileStatusResult), - deleted: getFilesByStatus("deleted", state.fileStatusResult), - allchangesnotstaged: allChangedButNotStagedFiles(state.fileStatusResult) - } - - case 'SET_COMMITS': - return { - ...state, - commits: action.payload, - localCommitCount: action.payload.length - } - - case 'SET_BRANCHES': - return { - ...state, - branches: action.payload - } - - case 'SET_CURRENT_BRANCH': - return { - ...state, - currentBranch: action.payload - } - - case 'SET_CURRENT_HEAD': - return { - ...state, - currentHead: action.payload - } - - case 'SET_CAN_USE_APP': - return { - ...state, - canUseApp: action.payload - } - case 'SET_REPO_NAME': - return { - ...state, - reponame: action.payload - } - case 'SET_LOADING': - return { - ...state, - loading: action.payload - } - - case 'SET_REPOS': - return { - ...state, - repositories: action.payload - } - - case 'SET_REMOTE_BRANCHES': - return { - ...state, - remoteBranches: action.payload - } - - case 'SET_CAN_COMMIT': - return { - ...state, - canCommit: action.payload - } - - case 'SET_REMOTES': - return { - ...state, - remotes: action.payload - } - - case 'SET_UPSTREAM': - return { - ...state, - upstream: action.payload - } - - case 'SET_COMMIT_CHANGES': - - action.payload.forEach((change: commitChange) => { - state.commitChanges.find((c) => c.hashModified === change.hashModified && c.hashOriginal === change.hashOriginal && c.path === change.path) ? null : state.commitChanges.push(change) + case 'FILE_STATUS': + return { + ...state, + fileStatusResult: action.payload, + staged: getFilesByStatus("staged", action.payload), + modified: getFilesByStatus("modified", action.payload), + untracked: getFilesByStatus("untracked", action.payload), + deleted: getFilesByStatus("deleted", action.payload), + allchangesnotstaged: allChangedButNotStagedFiles(action.payload) + } + + case 'FILE_STATUS_MERGE': + action.payload.map((fileStatusResult: fileStatusResult) => { + const file = state.fileStatusResult.find(stateFile => { + return stateFile.filename === fileStatusResult.filename }) - - return { - ...state, - commitChanges: [...state.commitChanges] - } - - case 'RESET_REMOTE_BRANCH_COMMITS': - if (state.remoteBranchCommits[action.payload.branch.name]) { - delete state.remoteBranchCommits[action.payload.branch.name] - } - return { - ...state, - remoteBranchCommits: { ...state.remoteBranchCommits } - } - - case 'SET_REMOTE_BRANCH_COMMITS': - if (state.remoteBranchCommits[action.payload.branch.name]) { - state.remoteBranchCommits[action.payload.branch.name].push(...action.payload.commits) - } else { - state.remoteBranchCommits[action.payload.branch.name] = action.payload.commits - } - return { - ...state, - remoteBranchCommits: { ...state.remoteBranchCommits } - } - - case 'SET_LOCAL_BRANCH_COMMITS': - - state.localBranchCommits[action.payload.branch.name] = action.payload.commits - return { - ...state, - localBranchCommits: { ...state.localBranchCommits } - } - - case 'SET_BRANCH_DIFFERENCES': - - state.branchDifferences[`${action.payload.remote.name}/${action.payload.branch.name}`] = action.payload.branchDifference - - return { - ...state, - branchDifferences: { ...state.branchDifferences } - } - - case 'SET_GITHUB_USER': - return { - ...state, - gitHubUser: action.payload - } - - case 'SET_GITHUB_ACCESS_TOKEN': - return { - ...state, - gitHubAccessToken: action.payload - } - - case 'SET_SCOPES': - return { - ...state, - gitHubScopes: action.payload - } - - case 'SET_USER_EMAILS': - return { - ...state, - userEmails: action.payload - } - - case 'SET_DEFAULT_REMOTE': - return { - ...state, - defaultRemote: action.payload - } - - case 'SET_LOG': - if (state.log.length > 0 && state.log[[...state.log].length - 1].message === action.payload.message) { - return { - ...state, - log: [...state.log] - } - } - return { - ...state, - log: [...state.log, action.payload] - } - - case 'CLEAR_LOG': - return { - ...state, - log: [] - } - - - case 'DESKTOP_SET_WORKING_DIR': - return { - ...state, - desktopWorkingDir: action.payload - } + if (file) { + file.status = fileStatusResult.status + file.statusNames = fileStatusResult.statusNames + } + }) + + return { + ...state, + staged: getFilesByStatus("staged", state.fileStatusResult), + modified: getFilesByStatus("modified", state.fileStatusResult), + untracked: getFilesByStatus("untracked", state.fileStatusResult), + deleted: getFilesByStatus("deleted", state.fileStatusResult), + allchangesnotstaged: allChangedButNotStagedFiles(state.fileStatusResult) + } + + case 'SET_COMMITS': + return { + ...state, + commits: action.payload, + localCommitCount: action.payload.length + } + + case 'SET_BRANCHES': + return { + ...state, + branches: action.payload + } + + case 'SET_CURRENT_BRANCH': + return { + ...state, + currentBranch: action.payload + } + + case 'SET_CURRENT_HEAD': + return { + ...state, + currentHead: action.payload + } + + case 'SET_CAN_USE_APP': + return { + ...state, + canUseApp: action.payload + } + case 'SET_REPO_NAME': + return { + ...state, + reponame: action.payload + } + case 'SET_LOADING': + return { + ...state, + loading: action.payload + } + + case 'SET_REPOS': + return { + ...state, + repositories: action.payload + } + + case 'SET_REMOTE_BRANCHES': + return { + ...state, + remoteBranches: action.payload + } + + case 'SET_CAN_COMMIT': + return { + ...state, + canCommit: action.payload + } + + case 'SET_REMOTES': + return { + ...state, + remotes: action.payload + } + + case 'SET_UPSTREAM': + return { + ...state, + upstream: action.payload + } + + case 'SET_COMMIT_CHANGES': + + action.payload.forEach((change: commitChange) => { + state.commitChanges.find((c) => c.hashModified === change.hashModified && c.hashOriginal === change.hashOriginal && c.path === change.path) ? null : state.commitChanges.push(change) + }) + + return { + ...state, + commitChanges: [...state.commitChanges] + } + + case 'RESET_REMOTE_BRANCH_COMMITS': + if (state.remoteBranchCommits[action.payload.branch.name]) { + delete state.remoteBranchCommits[action.payload.branch.name] + } + return { + ...state, + remoteBranchCommits: { ...state.remoteBranchCommits } + } + + case 'SET_REMOTE_BRANCH_COMMITS': + if (state.remoteBranchCommits[action.payload.branch.name]) { + state.remoteBranchCommits[action.payload.branch.name].push(...action.payload.commits) + } else { + state.remoteBranchCommits[action.payload.branch.name] = action.payload.commits + } + return { + ...state, + remoteBranchCommits: { ...state.remoteBranchCommits } + } + + case 'SET_LOCAL_BRANCH_COMMITS': + + state.localBranchCommits[action.payload.branch.name] = action.payload.commits + return { + ...state, + localBranchCommits: { ...state.localBranchCommits } + } + + case 'SET_BRANCH_DIFFERENCES': + + state.branchDifferences[`${action.payload.remote.name}/${action.payload.branch.name}`] = action.payload.branchDifference + + return { + ...state, + branchDifferences: { ...state.branchDifferences } + } + + case 'SET_GITHUB_USER': + return { + ...state, + gitHubUser: action.payload + } + + case 'SET_GITHUB_ACCESS_TOKEN': + return { + ...state, + gitHubAccessToken: action.payload + } + + case 'SET_SCOPES': + return { + ...state, + gitHubScopes: action.payload + } + + case 'SET_USER_EMAILS': + return { + ...state, + userEmails: action.payload + } + + case 'SET_DEFAULT_REMOTE': + return { + ...state, + defaultRemote: action.payload + } + + case 'SET_LOG': + if (state.log.length > 0 && state.log[[...state.log].length - 1].message === action.payload.message) { + return { + ...state, + log: [...state.log] + } + } + return { + ...state, + log: [...state.log, action.payload] + } + + case 'CLEAR_LOG': + return { + ...state, + log: [] + } + + case 'DESKTOP_SET_WORKING_DIR': + return { + ...state, + desktopWorkingDir: action.payload + } } } \ No newline at end of file