├── .changeset ├── README.md └── config.json ├── .env ├── .eslintignore ├── .eslintrc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report_extension.md │ ├── bug_report_standalone.md │ └── feature_request.md └── workflows │ ├── ci.yml │ └── release.yml ├── .gitignore ├── .npmignore ├── .nvmrc ├── .prettierignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEVELOPMENT.md ├── LICENSE ├── README.md ├── assets └── preview.gif ├── babel.config.js ├── cosmos.config.json ├── cosmos.override.js ├── jest.config.js ├── package.json ├── pnpm-lock.yaml ├── scripts ├── changelog.js ├── cli.js ├── cosmos-add-badge.js └── postinstall.js ├── src ├── assets │ ├── events │ │ ├── execution.svg │ │ ├── other.svg │ │ ├── teardown.svg │ │ └── update.svg │ ├── icon-128.png │ ├── icon-16.png │ ├── icon-256.png │ ├── icon-32.png │ ├── icon-48.png │ ├── icon-512.png │ ├── icon-64.png │ ├── icon-disabled-128.png │ ├── icon-disabled-256.png │ ├── icon-disabled-32.png │ ├── icon-disabled-512.png │ ├── icon-disabled-64.png │ └── icon.svg ├── electron │ └── main.ts ├── extension │ ├── background.ts │ ├── content_script.ts │ ├── devtools.html │ ├── devtools.ts │ └── manifest.json ├── panel │ ├── App.css │ ├── App.test.tsx │ ├── App.tsx │ ├── __image_snapshots__ │ │ ├── TimelineDuration - Alive │ │ └── TimelineDuration - Network │ ├── __snapshots__ │ │ └── App.test.tsx.snap │ ├── components │ │ ├── Background.tsx │ │ ├── CodeHighlight.fixture.tsx │ │ ├── CodeHighlight.tsx │ │ ├── Collapsible.tsx │ │ ├── IndicatorArrow.tsx │ │ ├── Navigation.fixture.tsx │ │ ├── Navigation.tsx │ │ ├── Pane.test.tsx │ │ ├── Pane.tsx │ │ ├── Portal.tsx │ │ ├── Tabs.test.tsx │ │ ├── Tabs.tsx │ │ ├── Toolbar.fixture.tsx │ │ ├── Toolbar.tsx │ │ ├── __snapshots__ │ │ │ ├── Pane.test.tsx.snap │ │ │ └── Tabs.test.tsx.snap │ │ └── index.ts │ ├── context │ │ ├── Devtools.test.tsx │ │ ├── Devtools.tsx │ │ ├── Explorer │ │ │ ├── Explorer.test.tsx │ │ │ ├── ast │ │ │ │ ├── index.test.tsx │ │ │ │ ├── index.ts │ │ │ │ └── variables.ts │ │ │ └── index.tsx │ │ ├── Request.test.tsx │ │ ├── Request.tsx │ │ ├── Timeline.tsx │ │ └── index.ts │ ├── cosmos.decorator.tsx │ ├── definitions.d.ts │ ├── hooks │ │ ├── index.ts │ │ └── useOrientationWatcher.ts │ ├── pages │ │ ├── disconnected │ │ │ ├── Disconnected.fixture.tsx │ │ │ ├── Disconnected.test.tsx │ │ │ ├── Disconnected.tsx │ │ │ ├── __snapshots__ │ │ │ │ └── Disconnected.test.tsx.snap │ │ │ └── index.ts │ │ ├── error │ │ │ ├── ErrorBoundary.fixture.tsx │ │ │ ├── ErrorBoundary.tsx │ │ │ └── index.ts │ │ ├── events │ │ │ ├── Timeline.fixture.tsx │ │ │ ├── Timeline.tsx │ │ │ ├── components │ │ │ │ ├── Settings.fixture.tsx │ │ │ │ ├── Settings.test.tsx │ │ │ │ ├── Settings.tsx │ │ │ │ ├── Tick.fixture.tsx │ │ │ │ ├── Tick.tsx │ │ │ │ ├── TimelineDuration.fixture.tsx │ │ │ │ ├── TimelineDuration.tsx │ │ │ │ ├── TimelineEvent.fixture.tsx │ │ │ │ ├── TimelineEvent.tsx │ │ │ │ ├── TimelinePane │ │ │ │ │ ├── TimelinePane.fixture.tsx │ │ │ │ │ ├── TimelinePane.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── TimelineRow.fixture.tsx │ │ │ │ ├── TimelineRow.test.tsx │ │ │ │ ├── TimelineRow.tsx │ │ │ │ ├── TimelineSourceIcon.fixture.tsx │ │ │ │ ├── TimelineSourceIcon.tsx │ │ │ │ ├── TimelineTooltip.fixture.tsx │ │ │ │ ├── TimelineTooltip.tsx │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── explorer │ │ │ ├── Explorer.fixture.tsx │ │ │ ├── Explorer.tsx │ │ │ ├── components │ │ │ │ ├── Arguments.fixture.tsx │ │ │ │ ├── Arguments.tsx │ │ │ │ ├── Icons.tsx │ │ │ │ ├── ListItem.tsx │ │ │ │ ├── NodeInfoPane.fixture.tsx │ │ │ │ ├── NodeInfoPane.tsx │ │ │ │ ├── Tree.tsx │ │ │ │ └── index.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ └── useFlash.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── mismatch │ │ │ ├── Mismatch.fixture.tsx │ │ │ ├── Mismatch.tsx │ │ │ └── index.ts │ │ └── request │ │ │ ├── Request.fixture.tsx │ │ │ ├── Request.tsx │ │ │ ├── components │ │ │ ├── Collapsible.tsx │ │ │ ├── Fields.fixture.tsx │ │ │ ├── Fields.tsx │ │ │ ├── Query.tsx │ │ │ ├── Response.tsx │ │ │ ├── Schema.fixture.tsx │ │ │ ├── Schema.tsx │ │ │ ├── Search.fixture.tsx │ │ │ ├── Search.tsx │ │ │ ├── Settings.tsx │ │ │ ├── Stack.fixture.tsx │ │ │ ├── Stack.tsx │ │ │ ├── TopBar.tsx │ │ │ ├── Type.tsx │ │ │ └── index.ts │ │ │ └── index.ts │ ├── panel.html │ ├── panel.tsx │ ├── prism.ts │ ├── styled.d.ts │ ├── theme.ts │ ├── types │ │ ├── codemirror.d.ts │ │ └── styled-components.d.ts │ └── util │ │ ├── Connection.ts │ │ ├── EnvUtils.ts │ │ ├── ErrorOverlay.ts │ │ ├── index.ts │ │ └── openExternalUrl.ts ├── setupTests.ts ├── types │ ├── connections.ts │ └── index.ts └── util │ ├── EventTarget.ts │ ├── debug.ts │ └── index.ts ├── tsconfig.json └── webpack ├── webpack.electron.config.js └── webpack.extension.config.js /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@0.3.0/schema.json", 3 | "changelog": "../scripts/changelog.js", 4 | "commit": false, 5 | "access": "public", 6 | "baseBranch": "master" 7 | } 8 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | TZ=Europe/London 2 | COSMOS_HOST=cosmos 3 | COSMOS_PORT=5001 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.js 3 | *.yaml 4 | node_modules 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": ["@typescript-eslint"], 4 | "extends": [ 5 | "plugin:@typescript-eslint/recommended", 6 | "plugin:import/errors", 7 | "plugin:import/typescript", 8 | "prettier", 9 | "prettier/@typescript-eslint", 10 | "plugin:react/recommended" 11 | ], 12 | "rules": { 13 | "import/order": ["error", { "newlines-between": "never" }], 14 | "@typescript-eslint/no-unused-vars": ["error"], 15 | "react/function-component-definition": [ 16 | "error", 17 | { 18 | "namedComponents": "arrow-function", 19 | "unnamedComponents": "arrow-function" 20 | } 21 | ], 22 | "@typescript-eslint/explicit-function-return-type": 0, 23 | "@typescript-eslint/no-explicit-any": 0, 24 | "@typescript-eslint/no-use-before-define": 0, 25 | "@typescript-eslint/prefer-interface": 0, 26 | "@typescript-eslint/no-var-requires": 0, 27 | "import/named": 0, 28 | "react/prop-types": 0, 29 | "react/no-children-prop": 0 30 | }, 31 | "settings": { 32 | "react": { 33 | "version": "detect" 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report_extension.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report (browser extension) 3 | about: Create a bug report for the browser extension version of devtools. 4 | title: "" 5 | labels: Bug 6 | assignees: 7 | --- 8 | 9 | # About 10 | 11 | 12 | 13 | Devtools does not detect a running instance of urql. 14 | 15 | # Reproduction 16 | 17 | 18 | 19 | 1. Clone [this example](https://github.com/FormidableLabs/urql/tree/main/packages/react-urql/examples/1-getting-started) project 20 | 2. Run `pnpm install` 21 | 3. Run `pnpm start` 22 | 4. Open chrome and navigate to [http://localhost:8080](http://localhost:8080) 23 | 5. Open the urql devtools panel 24 | 25 | ## Expected result 26 | 27 | 28 | 29 | - Extension detects app 30 | 31 | ## Actual result 32 | 33 | 34 | 35 | - Extension shows message "Waiting for exchange" 36 | 37 | # Additional info 38 | 39 | | environment | version | 40 | | -------------- | --------- | 41 | | browser | Chrome 69 | 42 | | urql | 0.0.0 | 43 | | urql devtools | 0.0.0 | 44 | | @urql/devtools | 0.0.0 | 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report_standalone.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report (standalone) 3 | about: Create a bug report for the native/standalone version of devtools. 4 | title: "" 5 | labels: Bug, Electron 6 | assignees: "" 7 | --- 8 | 9 | # About 10 | 11 | 12 | 13 | Devtools is unresponsive when using on an Android device with expo. 14 | 15 | # Reproduction 16 | 17 | 18 | 19 | 1. Clone [this example](https://github.com/kadikraman/UrqlTest) react native project 20 | 2. Plug in Android phone via USB 21 | 3. Run `pnpm install` 22 | 4. Run `pnpm start` 23 | 5. Open devtools using npx `npx urql-devtools` 24 | 25 | ## Expected result 26 | 27 | 28 | 29 | - App opens on Android phone 30 | - Urql Devtools opens in standalone window 31 | - Urql devtools detects app 32 | 33 | ## Actual result 34 | 35 | 36 | 37 | - App opens on Android phone 38 | - Urql devtools opens in standalone window 39 | - Urql devtools stays on "waiting for exchange" notice 40 | 41 | # Additional info 42 | 43 | | environment | version | 44 | | -------------- | -------------- | 45 | | os | Macbuntu 20.04 | 46 | | node | 0.0.0 | 47 | | urql | 0.0.0 | 48 | | urql-devtools | 0.0.0 | 49 | | @urql/devtools | 0.0.0 | 50 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Create a feature request. 4 | title: "Add ..." 5 | labels: Feature 6 | assignees: "" 7 | --- 8 | 9 | # About 10 | 11 | 12 | 13 | When the user is on the disconnected screen, display a timer showing how long the client has been disconnected. 14 | 15 | 16 | 17 | This would help me keep track of bugs in my app. 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | 2 | name: CI 3 | 4 | on: 5 | pull_request: 6 | push: 7 | branches: master 8 | 9 | jobs: 10 | check: 11 | name: Checks 12 | runs-on: ubuntu-latest 13 | timeout-minutes: 10 14 | steps: 15 | - name: Checkout Repo 16 | uses: actions/checkout@v3 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Setup Node 21 | uses: actions/setup-node@v3 22 | with: 23 | node-version: '16' 24 | 25 | - name: Setup pnpm 26 | uses: pnpm/action-setup@v2.2.2 27 | with: 28 | version: 7 29 | run_install: false 30 | 31 | - name: Get pnpm store directory 32 | id: pnpm-store 33 | run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" 34 | 35 | - name: Use pnpm store 36 | uses: actions/cache@v3 37 | id: pnpm-cache 38 | with: 39 | path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }} 40 | key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} 41 | restore-keys: | 42 | ${{ runner.os }}-pnpm- 43 | 44 | - name: Install Dependencies 45 | run: pnpm install --frozen-lockfile 46 | 47 | - name: Install chromium 48 | run: node ./node_modules/puppeteer/install.js 49 | 50 | - name: TypeScript 51 | run: pnpm run type-check 52 | 53 | - name: Lint 54 | run: pnpm run lint 55 | 56 | ## TODO: consolidate in linting step 57 | - name: Prettier 58 | run: pnpm run lint:prettier 59 | 60 | - name: Unit Tests 61 | run: pnpm run test --coverage 62 | env: 63 | TZ: Europe/London 64 | HEADLESS: true 65 | 66 | - name: Build 67 | run: pnpm run build && pnpm run bundle 68 | 69 | - name: Lint FireFox 70 | run: pnpm run lint:firefox 71 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: master 6 | 7 | jobs: 8 | check: 9 | name: Checks 10 | runs-on: ubuntu-latest 11 | timeout-minutes: 10 12 | steps: 13 | - name: Checkout Repo 14 | uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 17 | 18 | - name: Setup Node 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: '16' 22 | 23 | - name: Setup pnpm 24 | uses: pnpm/action-setup@v2.2.2 25 | with: 26 | version: 7 27 | run_install: false 28 | 29 | - name: Get pnpm store directory 30 | id: pnpm-store 31 | run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" 32 | 33 | - name: Use pnpm store 34 | uses: actions/cache@v3 35 | id: pnpm-cache 36 | with: 37 | path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }} 38 | key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} 39 | restore-keys: | 40 | ${{ runner.os }}-pnpm- 41 | 42 | - name: Install Dependencies 43 | run: pnpm install --frozen-lockfile 44 | 45 | - name: PR or Publish 46 | id: changesets 47 | uses: changesets/action@v1.4.1 48 | env: 49 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | cosmos-export 4 | .DS_Store 5 | web-ext-artifacts 6 | __diff_output__ 7 | .idea -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.* 2 | /* 3 | !/CHANGELOG.md 4 | !/README.md 5 | !/LICENSE 6 | 7 | /dist/extension 8 | !/dist/electron 9 | 10 | /src/** 11 | !/src/{electron,panel,types,util}/**/!(*.fixture|*.test).{ts,tsx} 12 | 13 | /scripts/** 14 | !/scripts/cli.js 15 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | cosmos-export/ 3 | dist/ 4 | *.yml 5 | *.yaml 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Contributor Covenant Code of Conduct 2 | 3 | ### Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ### Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | - Using welcoming and inclusive language 18 | - Being respectful of differing viewpoints and experiences 19 | - Gracefully accepting constructive criticism 20 | - Focusing on what is best for the community 21 | - Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | - The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | - Trolling, insulting/derogatory comments, and personal or political attacks 28 | - Public or private harassment 29 | - Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | - Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ### Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ### Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ### Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at coc@formidable.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ### Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for your interest in contributing to `urql` Devtools! We want to ensure that the community has opportunities to contribute to `urql` devtools in as many ways as possible, no matter how big or small those contributions may be. 4 | 5 | ## How to contribute? 6 | 7 | Before getting started, make sure you are aware of our [Code of Conduct](./CODE_OF_CONDUCT.md) and comply within those guidelines. 8 | 9 | If you have an idea for a feature or want to fix a bug, consider opening an issue first. We're also happy to discuss and help you open a PR to get your changes in! 10 | 11 | ## How do I set up the project? 12 | 13 | Check out the [development guide](./DEVELOPMENT.md) for the technical details and how to build the project. 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018–2020 Formidable, 4 | Copyright (c) urql GraphQL Team and other contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
The official browser extension for Urql
5 | 6 |