diff --git a/.env.arm.mac b/.env.arm.mac deleted file mode 100644 index 060e3f2..0000000 --- a/.env.arm.mac +++ /dev/null @@ -1,2 +0,0 @@ -PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true -PUPPETEER_EXEC_PATH=/opt/homebrew/bin/chromium diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d646c2..697555f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,9 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache deps - uses: actions/cache@v1 + - uses: actions/cache@v3 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -26,7 +25,7 @@ jobs: env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true run: | - yarn + yarn --ignore-platform --ignore-engines --frozen-lockfile --prefer-offline - name: Retrieve vscode icons uses: actions/checkout@v3 @@ -36,7 +35,7 @@ jobs: - name: Build run: | - make build + NODE_OPTIONS=--openssl-legacy-provider make build - name: Archive production artifacts uses: actions/upload-artifact@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cde00c9..5f47751 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ on: - 'server/**' # Runs everyday to detect GitHub update in time schedule: - - cron: '0 0 * * *' + - cron: '30 16 * * *' jobs: build: @@ -50,7 +50,7 @@ jobs: env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true run: | - yarn + yarn --ignore-platform --ignore-engines --frozen-lockfile --prefer-offline - name: E2E Test uses: mujo-code/puppeteer-headful@master @@ -89,7 +89,7 @@ jobs: env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true run: | - yarn + yarn --ignore-platform --ignore-engines --frozen-lockfile --prefer-offline - name: Unit Test run: | diff --git a/README.md b/README.md index 8aac0b0..0a731d4 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ Gitako is **FREE**. If you like it, please [Feature discussions](https://github.com/EnixCoda/Gitako/discussions) and [bug reports](https://github.com/EnixCoda/Gitako/issues/) are also welcome! +Check out [contributing.md](./contributing.md) if you want to contribute to Gitako directly. + ### About #### Source of the name and logo? diff --git a/Safari/Gitako/Gitako.xcodeproj/project.pbxproj b/Safari/Gitako/Gitako.xcodeproj/project.pbxproj index 7aba918..7962c54 100644 --- a/Safari/Gitako/Gitako.xcodeproj/project.pbxproj +++ b/Safari/Gitako/Gitako.xcodeproj/project.pbxproj @@ -579,7 +579,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 3.10.0; + MARKETING_VERSION = 3.12.0; PRODUCT_BUNDLE_IDENTIFIER = enixcoda.Gitako.Extension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -604,7 +604,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 3.10.0; + MARKETING_VERSION = 3.12.0; PRODUCT_BUNDLE_IDENTIFIER = enixcoda.Gitako.Extension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -631,7 +631,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 3.10.0; + MARKETING_VERSION = 3.12.0; PRODUCT_BUNDLE_IDENTIFIER = enixcoda.Gitako; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "Developer Sign for Distribution"; @@ -657,7 +657,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 3.10.0; + MARKETING_VERSION = 3.12.0; PRODUCT_BUNDLE_IDENTIFIER = enixcoda.Gitako; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "Developer Sign for Distribution"; diff --git a/__tests__/cases/non-parallel/empty-project.ts b/__tests__/cases/non-parallel/empty-project.ts new file mode 100644 index 0000000..c06f748 --- /dev/null +++ b/__tests__/cases/non-parallel/empty-project.ts @@ -0,0 +1,15 @@ +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' +import { getTextContent, sleep } from '../../utils' + +describe(`in Gitako project page`, () => { + beforeAll(() => page.goto(testURL`https://github.com/GitakoExtension/test-empty`)) + + it('should render error message', async () => { + await sleep(5000) + + expect(await getTextContent(selectors.gitako.errorMessage)).toBe( + 'This project seems to be empty.', + ) + }) +}) diff --git a/__tests__/cases/non-parallel/pjax.commits-page.ts b/__tests__/cases/non-parallel/pjax.commits-page.ts index a37310a..d910a03 100644 --- a/__tests__/cases/non-parallel/pjax.commits-page.ts +++ b/__tests__/cases/non-parallel/pjax.commits-page.ts @@ -1,25 +1,25 @@ +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' import { expectToFind, expectToNotFind, sleep, waitForRedirect } from '../../utils' jest.retryTimes(3) describe(`in Gitako project page`, () => { - beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/commits/develop')) + beforeAll(() => page.goto(testURL`https://github.com/EnixCoda/Gitako/commits/develop`)) it('should not break go back in history', async () => { for (let i = 0; i < 3; i++) { - const commitLinks = await page.$$( - `main .TimelineItem-body ol li > div:nth-child(1) a[href*="/commit/"]`, - ) + const commitLinks = await page.$$(selectors.github.commitLinks) if (commitLinks.length < 2) throw new Error(`No enough commits`) commitLinks[i].click() await waitForRedirect() - await expectToFind('div.commit') + await expectToFind(selectors.github.commitSummary) await sleep(1000) page.goBack() await sleep(1000) // The selector for file content - await expectToNotFind('div.commit') + await expectToNotFind(selectors.github.commitSummary) } }) }) diff --git a/__tests__/cases/non-parallel/pjax.files-page.ts b/__tests__/cases/non-parallel/pjax.files-page.ts index fd0915c..97da75f 100644 --- a/__tests__/cases/non-parallel/pjax.files-page.ts +++ b/__tests__/cases/non-parallel/pjax.files-page.ts @@ -1,26 +1,28 @@ +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' import { expectToFind, expectToNotFind, sleep, waitForRedirect } from '../../utils' jest.retryTimes(3) describe(`in Gitako project page`, () => { - beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src')) + beforeAll(() => page.goto(testURL`https://github.com/EnixCoda/Gitako/tree/develop/src`)) it('should not break go back in history', async () => { for (let i = 0; i < 3; i++) { - const commitLinks = await page.$$( - `.js-details-container div[role="row"] div[role="rowheader"] a[title*="."]`, - ) - if (commitLinks.length < 2) throw new Error(`No enough files`) + const fileItems = await page.$$(selectors.github.fileListItemFileLinks) + if (fileItems.length < 2) throw new Error(`No enough files`) + await waitForRedirect(async () => { - await commitLinks[i].click() + await fileItems[i].click() }) - await expectToFind('table.js-file-line-container') + await expectToFind(selectors.github.fileContent) await sleep(1000) page.goBack() await sleep(1000) // The selector for file content - await expectToNotFind('table.js-file-line-container') + + await expectToNotFind(selectors.github.fileContent) } }) }) diff --git a/__tests__/cases/non-parallel/pjax.general.ts b/__tests__/cases/non-parallel/pjax.general.ts index a30f51a..46f51bd 100644 --- a/__tests__/cases/non-parallel/pjax.general.ts +++ b/__tests__/cases/non-parallel/pjax.general.ts @@ -1,8 +1,10 @@ +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' import { collapseFloatModeSidebar, expandFloatModeSidebar, + getTextContent, patientClick, - selectFileTreeItem, sleep, waitForRedirect, } from '../../utils' @@ -10,20 +12,20 @@ import { jest.retryTimes(3) describe(`in Gitako project page`, () => { - beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src')) + beforeAll(() => page.goto(testURL`https://github.com/EnixCoda/Gitako/tree/develop/src`)) it('should work with PJAX', async () => { await sleep(3000) await expandFloatModeSidebar() - await patientClick(selectFileTreeItem('src/analytics.ts')) + await patientClick(selectors.gitako.fileItemOf('src/analytics.ts')) await waitForRedirect() await collapseFloatModeSidebar() - await page.click('a[data-selected-links^="repo_issues "]') + await page.click(selectors.github.navBarItemIssues) await waitForRedirect() - await page.click('a[data-selected-links^="repo_pulls "]') + await page.click(selectors.github.navBarItemPulls) await waitForRedirect() page.goBack() @@ -32,10 +34,6 @@ describe(`in Gitako project page`, () => { page.goBack() await sleep(1000) - expect( - await page.evaluate( - () => document.querySelector('.final-path')?.textContent === 'analytics.ts', - ), - ).toBe(true) + expect(await getTextContent(selectors.github.breadcrumbFileName)).toBe('/analytics.ts') }) }) diff --git a/__tests__/cases/non-parallel/pjax.internal.ts b/__tests__/cases/non-parallel/pjax.internal.ts index d291540..7c327d3 100644 --- a/__tests__/cases/non-parallel/pjax.internal.ts +++ b/__tests__/cases/non-parallel/pjax.internal.ts @@ -1,9 +1,10 @@ +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' import { expandFloatModeSidebar, expectToFind, expectToNotFind, patientClick, - selectFileTreeItem, sleep, waitForRedirect, } from '../../utils' @@ -11,17 +12,16 @@ import { jest.retryTimes(3) describe(`in Gitako project page`, () => { - beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/test/multiple-changes')) + beforeAll(() => page.goto(testURL`https://github.com/EnixCoda/Gitako/tree/test/multiple-changes`)) it('should work with PJAX', async () => { await sleep(3000) await expandFloatModeSidebar() - await patientClick(selectFileTreeItem('.babelrc')) + await patientClick(selectors.gitako.fileItemOf('.babelrc')) await waitForRedirect() - // The selector for file content - await expectToFind('table.js-file-line-container') + await expectToFind(selectors.github.fileContent) await waitForRedirect(async () => { await sleep(1000) // This prevents failing in some cases due to some mystery scheduling issue of puppeteer or jest @@ -29,6 +29,6 @@ describe(`in Gitako project page`, () => { }) // The selector for file content - await expectToNotFind('table.js-file-line-container') + await expectToNotFind(selectors.github.fileContent) }) }) diff --git a/__tests__/cases/non-parallel/project-page.gitako.ts b/__tests__/cases/non-parallel/project-page.gitako.ts index 109b2a4..dd1e13e 100644 --- a/__tests__/cases/non-parallel/project-page.gitako.ts +++ b/__tests__/cases/non-parallel/project-page.gitako.ts @@ -1,39 +1,37 @@ -import { - expandFloatModeSidebar, - expectToFind, - expectToNotFind, - scroll, - selectFileTreeItem, -} from '../../utils' +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' +import { expandFloatModeSidebar, expectToFind, expectToNotFind, scroll } from '../../utils' jest.retryTimes(3) describe(`in Gitako project page`, () => { beforeAll(() => - page.goto('https://github.com/EnixCoda/Gitako/tree/test/200-changed-files-200-lines-each'), + page.goto( + testURL`https://github.com/EnixCoda/Gitako/tree/test/200-changed-files-200-lines-each`, + ), ) it('should render Gitako', async () => { - await expectToFind('.gitako-side-bar .gitako-side-bar-body-wrapper') + await expectToFind(selectors.gitako.bodyWrapper) }) it('should render file list', async () => { - await expectToFind('.gitako-side-bar .files .node-item') + await expectToFind(selectors.gitako.fileItem) }) it('should render while scroll', async () => { await expandFloatModeSidebar() - const filesEle = await page.waitForSelector('.gitako-side-bar .files') + const filesEle = await page.waitForSelector(selectors.gitako.files) // node of tsconfig.json should NOT be rendered before scroll down - await expectToNotFind(selectFileTreeItem('tsconfig.json')) + await expectToNotFind(selectors.gitako.fileItemOf('tsconfig.json')) const box = await filesEle?.boundingBox() if (box) { await page.mouse.move(box.x + 40, box.y + 40) await scroll({ totalDistance: 10000, stepDistance: 100 }) // node of tsconfig.json should be rendered now - await expectToFind(selectFileTreeItem('tsconfig.json')) + await expectToFind(selectors.gitako.fileItemOf('tsconfig.json')) } }) }) diff --git a/__tests__/cases/parallel/baseline.ts b/__tests__/cases/parallel/baseline.ts index a8e7a74..850a087 100644 --- a/__tests__/cases/parallel/baseline.ts +++ b/__tests__/cases/parallel/baseline.ts @@ -2,10 +2,11 @@ * Confirm basic behaviors of puppeteer assertions */ +import { testURL } from '../../testURL' import { expectToFind, expectToNotFind } from '../../utils' describe(`in random page`, () => { - beforeAll(() => page.goto('https://google.com')) + beforeAll(() => page.goto(testURL`https://google.com`)) it('wait for hidden non-exist element should resolve null', async () => { expect( diff --git a/__tests__/cases/parallel/expand-to-target.ts b/__tests__/cases/parallel/expand-to-target.ts index 9f5895e..f0f01f6 100644 --- a/__tests__/cases/parallel/expand-to-target.ts +++ b/__tests__/cases/parallel/expand-to-target.ts @@ -1,20 +1,20 @@ -import { expectToFind, selectFileTreeItem, sleep, waitForRedirect } from '../../utils' +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' +import { expectToFind, sleep, waitForRedirect } from '../../utils' describe(`in Gitako project page`, () => { - beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src')) + beforeAll(() => page.goto(testURL`https://github.com/EnixCoda/Gitako/tree/develop/src`)) it('expand to target on load and after redirect', async () => { await sleep(3000) // Expect Gitako sidebar to have expanded src to see contents - await expectToFind(selectFileTreeItem('src/components')) + await expectToFind(selectors.gitako.fileItemOf('src/components')) - await page.click( - `.js-details-container div[role="row"] div[role="rowheader"] [title="components"]`, - ) + await page.click(selectors.github.fileListItemLinkOf('components')) await waitForRedirect() // Expect Gitako sidebar to have expanded components and see contents - await expectToFind(selectFileTreeItem('src/components/Gitako.tsx')) + await expectToFind(selectors.gitako.fileItemOf('src/components/Gitako.tsx')) }) }) diff --git a/__tests__/cases/parallel/homepage.not-render.ts b/__tests__/cases/parallel/homepage.not-render.ts index 8d67007..64c531e 100644 --- a/__tests__/cases/parallel/homepage.not-render.ts +++ b/__tests__/cases/parallel/homepage.not-render.ts @@ -1,7 +1,8 @@ +import { testURL } from '../../testURL' import { expectToNotFind } from '../../utils' describe(`in GitHub homepage`, () => { - beforeAll(() => page.goto('https://github.com')) + beforeAll(() => page.goto(testURL`https://github.com`)) it('should not render Gitako', async () => { await expectToNotFind('.gitako-side-bar .gitako-side-bar-body-wrapper') diff --git a/__tests__/cases/parallel/pull-request-page.gitako.ts b/__tests__/cases/parallel/pull-request-page.gitako.ts index a502711..d09424b 100644 --- a/__tests__/cases/parallel/pull-request-page.gitako.ts +++ b/__tests__/cases/parallel/pull-request-page.gitako.ts @@ -1,13 +1,15 @@ +import { selectors } from '../../selectors' +import { testURL } from '../../testURL' import { expectToFind } from '../../utils' describe(`in Gitako project page`, () => { - beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/pull/71')) + beforeAll(() => page.goto(testURL`https://github.com/EnixCoda/Gitako/pull/71`)) it('should render Gitako', async () => { - await expectToFind('.gitako-side-bar .gitako-side-bar-body-wrapper') + await expectToFind(selectors.gitako.bodyWrapper) }) it('should render file list', async () => { - await expectToFind('.gitako-side-bar .files .node-item') + await expectToFind(selectors.gitako.fileItem) }) }) diff --git a/__tests__/jest.non-parallel.config.js b/__tests__/jest.non-parallel.config.js index c874fea..599e24b 100644 --- a/__tests__/jest.non-parallel.config.js +++ b/__tests__/jest.non-parallel.config.js @@ -1,7 +1,11 @@ const baseConfig = require('./jest.config') +/** + * @type {import('@jest/types').Config.InitialOptions} + */ module.exports = { ...baseConfig, maxWorkers: 1, testMatch: [...baseConfig.testMatch, '**/__tests__/cases/non-parallel/*.ts?(x)'], + setupFilesAfterEnv: ['/setup.ts'], } diff --git a/__tests__/selectors.ts b/__tests__/selectors.ts new file mode 100644 index 0000000..8a8d025 --- /dev/null +++ b/__tests__/selectors.ts @@ -0,0 +1,21 @@ +export const selectors = { + github: { + breadcrumbFileName: `[data-testid="breadcrumbs-filename"]`, + fileContent: 'textarea[aria-label="file content"]', + commitLinks: `li[data-testid="commit-row-item"] [data-testid="listview-item-title-container"] a[href*="/commit/"]`, + // assume title contains `.` is file item + fileListItemFileLinks: `table[aria-labelledby="folders-and-files"] tr.react-directory-row td.react-directory-row-name-cell-large-screen .react-directory-filename-column .react-directory-truncate a[aria-label$="(File)"]`, + fileListItemLinkOf: (name: string) => + `table[aria-labelledby="folders-and-files"] tr.react-directory-row td.react-directory-row-name-cell-large-screen .react-directory-filename-column .react-directory-truncate a[title="${name}"]`, + commitSummary: 'div.commit', + navBarItemIssues: 'a[data-selected-links^="repo_issues "]', + navBarItemPulls: 'a[data-selected-links^="repo_pulls "]', + }, + gitako: { + fileItem: '.gitako-side-bar .files .node-item', + fileItemOf: (path: string) => `.gitako-side-bar .files .node-item[title="${path}"]`, + errorMessage: '#gitako-logo-mount-point .error-message', + files: '.gitako-side-bar .files', + bodyWrapper: '.gitako-side-bar .gitako-side-bar-body-wrapper', + }, +} diff --git a/__tests__/setup.ts b/__tests__/setup.ts new file mode 100644 index 0000000..05366db --- /dev/null +++ b/__tests__/setup.ts @@ -0,0 +1 @@ +jest.retryTimes(3) diff --git a/__tests__/testURL.ts b/__tests__/testURL.ts new file mode 100644 index 0000000..be247f0 --- /dev/null +++ b/__tests__/testURL.ts @@ -0,0 +1,11 @@ +// string template function, take input URL string and add a search param +// example: url`http://g.com` => `http://g.com?k1="json-value"` +export function testURL(strings: TemplateStringsArray, ...values: unknown[]) { + const raw = strings.reduce((acc, str, i) => acc + str + (values[i] ?? ''), '') + const GITAKO_ACCESS_TOKEN = process.env.GITAKO_ACCESS_TOKEN + if (!GITAKO_ACCESS_TOKEN) return raw + + const url = new URL(raw, 'http://localhost') + url.searchParams.set('gitako-config-accessToken', JSON.stringify(GITAKO_ACCESS_TOKEN)) + return url.href +} diff --git a/__tests__/utils.ts b/__tests__/utils.ts index 0e8dc1e..8ec9157 100644 --- a/__tests__/utils.ts +++ b/__tests__/utils.ts @@ -87,11 +87,11 @@ export async function waitForRedirect(action?: () => void | Promise) { fired = true return action() }) - return Promise.race([waitForLegacyPJAXRedirect($action), waitForTurboRedirect($action)]) -} - -export function selectFileTreeItem(path: string): string { - return `.gitako-side-bar .files a[title="${path}"]` + return Promise.race([ + waitForLegacyPJAXRedirect($action), + waitForTurboRedirect($action), + sleep(3 * 1000), + ]) } export async function patientClick(selector: string) { @@ -119,3 +119,7 @@ export async function collapseFloatModeSidebar() { }) await sleep(500) } + +export function getTextContent(query: string) { + return page.evaluate(query => document.querySelector(query)?.textContent, query) +} diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..7b234c2 --- /dev/null +++ b/contributing.md @@ -0,0 +1,44 @@ +# Contributing + +Thank you if you are trying to contribute! + +Note: if you were using Windows, you may need to find alternatives for `make` commands. Or use WSL. I've not tested development on Windows and do not guarantee if it would work. + +## Set up development env + +1. Clone the repo +1. Run `make pull-icons` to install dependencies +1. Run `yarn` to install dependencies +1. Run `yarn dev` to start the development server, you'll see a `dist` folder appear in the root of this project +1. Open the extensions page in Chrome, enable developer mode, and load the extension from the `dist` folder +1. Navigate to repository of your choice and you should see the extension appear + +When you modify source code, you need to do either of below to apply your changes: + +- (recommended) use [the Extension Reloader extension](https://chrome.google.com/webstore/detail/fimgfedafeadlieiabdeeaodndnlbhid). It could reload all extensions then refresh the page (you need to enable it in its settings). +- manually reload the extension in the `chrome://extensions` and then refresh your repository page + +## Develop with more browsers + +Gitako supports more browsers, in order to develop for them, please do the followings. + +### Edge: + +- Similar to above steps for Chrome + +### Firefox: + +- run `yarn dev-firefox` +- a new instance of Firefox will open with Gitako automatically installed +- navigate to a GitHub repo and you should see the extension appear +- when you modify source, refresh the tab + +### Safari (macOS only): + +- run `yarn dev-safari` +- Open `Safari/Gitako/Gitako.xcodeproj` in Xcode +- Click the "Run" button +- Enable developer mode in Safari's preferences +- Enable Gitako in Safari's preferences +- Open a Safari tab and visit a GitHub repo, then activate Gitako via Gitako icon next to the address bar +- when you modify source, click the "Run" button in Xcode and refresh the tab diff --git a/jest-puppeteer.config.js b/jest-puppeteer.config.js index 163ce8a..e4b9bdb 100644 --- a/jest-puppeteer.config.js +++ b/jest-puppeteer.config.js @@ -1,8 +1,6 @@ const path = require('path') if (process.arch === 'arm64' && process.platform === 'darwin') { - require('dotenv').config({ - path: '.env.arm.mac', - }) + require('dotenv').config() } const CRX_PATH = path.resolve(__dirname, 'dist') diff --git a/package.json b/package.json index ccea425..2654bda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gitako", - "version": "3.10.0", + "version": "3.12.0", "description": "File tree for GitHub, and more than that.", "repository": "https://github.com/EnixCoda/Gitako", "author": "EnixCoda", @@ -9,13 +9,13 @@ "homepage": "https://github.com/EnixCoda/Gitako", "scripts": { "prepare": "husky install", - "dev": "VERSION=dev-v$(node scripts/get-version.js) webpack --watch", + "dev": "NODE_OPTIONS=--openssl-legacy-provider VERSION=dev-v$(node scripts/get-version.js) webpack --watch", "dev-safari": "TARGET=safari yarn run dev", - "debug-firefox": "web-ext run --source-dir=dist --firefox-profile=firefox-profile --profile-create-if-missing --keep-profile-changes --start-url https://github.com/EnixCoda/Gitako", - "analyze-bundle": "ANALYZE= NODE_ENV=production webpack", + "dev-firefox": "web-ext run --source-dir=dist --firefox-profile=firefox-profile --profile-create-if-missing --keep-profile-changes --start-url https://github.com/EnixCoda/Gitako", + "analyze-bundle": "NODE_OPTIONS=--openssl-legacy-provider ANALYZE= NODE_ENV=production webpack", "postinstall": "node scripts/fix-deps", "postversion": "sh scripts/post-version.sh", - "build": "VERSION=v$(node scripts/get-version.js) NODE_ENV=production webpack", + "build": "NODE_OPTIONS=--openssl-legacy-provider VERSION=v$(node scripts/get-version.js) NODE_ENV=production webpack", "roll": "make release", "test": "yarn run test:parallel && yarn run test:non-parallel", "test:unit": "NODE_ENV=test jest --config jest.config.js", @@ -46,6 +46,7 @@ "react-use": "^17.3.2", "react-window": "^1.8.7", "styled-components": "^5.3.5", + "superstruct": "^1.0.3", "webext-domain-permission-toggle": "^3.0.0", "webext-dynamic-content-scripts": "^9.0.0", "webextension-polyfill": "^0.10.0" @@ -84,7 +85,7 @@ "json-loader": "^0.5.7", "lint-staged": "^13.0.3", "mini-css-extract-plugin": "^0.9.0", - "prettier": "^2.7.1", + "prettier": "^2.8.3", "puppeteer": "^10.1.0", "raw-loader": "^4.0.0", "sass": "^1.26.2", @@ -114,6 +115,7 @@ ] }, "resolutions": { + "fsevents": "^2.3.3", "@types/react": "^18.0.9", "@types/react-dom": "^18.0.3" } diff --git a/src/components/FileExplorer/hooks/useNodeRenderers.tsx b/src/components/FileExplorer/hooks/useNodeRenderers.tsx index 58552e4..a65aefd 100644 --- a/src/components/FileExplorer/hooks/useNodeRenderers.tsx +++ b/src/components/FileExplorer/hooks/useNodeRenderers.tsx @@ -266,7 +266,7 @@ export function useRenderGoToButton(searched: boolean, goTo: (path: string[]) => ? function renderGoToButton(node: TreeNode): React.ReactNode { return (