Переглянути джерело

Remove duplicated files from the debugger package

Jeremy Tuloup 4 роки тому
батько
коміт
85bcc51df4

+ 0 - 19
packages/debugger/.eslintignore

@@ -1,19 +0,0 @@
-node_modules
-**/build
-**/lib
-**/node_modules
-**/mock_packages
-**/static
-**/typings
-**/schemas
-**/themes
-coverage
-*.map.js
-*.bundle.js
-
-# jetbrains IDE stuff
-.idea/
-
-# ms IDE stuff
-.history/
-.vscode/

+ 0 - 75
packages/debugger/.eslintrc.js

@@ -1,75 +0,0 @@
-module.exports = {
-  env: {
-    browser: true,
-    es6: true,
-    commonjs: true,
-    node: true,
-    'jest/globals': true
-  },
-  root: true,
-  extends: [
-    'eslint:recommended',
-    'plugin:@typescript-eslint/eslint-recommended',
-    'plugin:@typescript-eslint/recommended',
-    'prettier/@typescript-eslint',
-    'plugin:jsdoc/recommended',
-    'plugin:react/recommended',
-    'plugin:jest/recommended'
-  ],
-  parser: '@typescript-eslint/parser',
-  parserOptions: {
-    project: 'tsconfig.eslint.json'
-  },
-  plugins: ['@typescript-eslint', 'jest'],
-  rules: {
-    '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
-    '@typescript-eslint/interface-name-prefix': [
-      'error',
-      { prefixWithI: 'always' }
-    ],
-    '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
-    '@typescript-eslint/no-var-requires': 'off',
-    '@typescript-eslint/no-explicit-any': 'off',
-    '@typescript-eslint/no-empty-interface': 'off',
-    '@typescript-eslint/no-namespace': 'off',
-    '@typescript-eslint/no-use-before-define': 'off',
-    '@typescript-eslint/quotes': [
-      'error',
-      'single',
-      { avoidEscape: true, allowTemplateLiterals: false }
-    ],
-    'no-inner-declarations': 'off',
-    'no-prototype-builtins': 'off',
-    'no-control-regex': 'warn',
-    'no-undef': 'warn',
-    'no-case-declarations': 'warn',
-    'no-useless-escape': 'off',
-    'prefer-const': 'off',
-    'jest/no-jest-import': 'off',
-    'jest/no-export': 'warn',
-    'jest/no-try-expect': 'warn',
-    'jsdoc/require-jsdoc': [
-      1,
-      {
-        require: {
-          FunctionExpression: true,
-          ClassDeclaration: true,
-          MethodDefinition: true
-        }
-      }
-    ],
-    'jsdoc/require-description': 1,
-    'jsdoc/require-param-type': 'off',
-    'jsdoc/require-property-type': 'off',
-    'jsdoc/require-returns-type': 'off',
-    'jsdoc/require-returns': 'off'
-  },
-  settings: {
-    jsdoc: {
-      mode: 'typescript'
-    },
-    react: {
-      version: 'detect'
-    }
-  }
-};

+ 0 - 5
packages/debugger/.prettierignore

@@ -1,5 +0,0 @@
-node_modules
-**/node_modules
-**/lib
-**/build
-**/static

+ 0 - 3
packages/debugger/.prettierrc

@@ -1,3 +0,0 @@
-{
-  "singleQuote": true
-}

+ 0 - 19
packages/debugger/DESIGN.md

@@ -1,19 +0,0 @@
-# `@jupyterlab/debugger` user interactions and experience
-
-- The debugger UI will only ever exist as a single instance within JupyterLab:
-  - An expanded mode which is a `MainAreaWidget<Debugger>`
-    - In expanded mode, the debugger will contain a tab panel for text editors that are launched when a user steps into code that has been stopped via breakpoints.
-    - If the user adds a breakpoint and steps into code from the sidebar, then it should automatically switch to expanded mode to accommodate displaying code files.
-    - Code files in the debugger will _always_ be read-only. They should support adding breakpoints.
-  - A condensed mode which is a condensed sidebar view of the debugger within the `right` or `left` areas of the JupyterLab shell
-- The debugger will support debugging and inspecting environment for three types of activities in JupyterLab:
-  1. Notebooks
-  1. Code consoles
-  1. Text editors that are backed by a kernel
-- A `JupyterFrontendPlugin` will exist to track each of the activities and each time the `currentChanged` signal fires on one of the trackers, the debugger UI will reflect the state of that activity, _e.g._:
-  - If a user has a single open notebook and opens the debugger, it will open either "docked" in the sidebar or in the main area depending on the last known position of the debugger.
-  - If the user then opens a new notebook or switches to a code console, then the debugger will update to show the state of the newly focused kernel.
-- The debugger should be state-less insofar as it can arbitrarily switch to displaying the breakpoints and variables of a new kernel based on a user switching from one notebook to another, _etc._:
-  - The debugger should automatically start a debugging session with the kernel transparently without end-user intervention.
-  - Any UI information that cannot be retrieved from the kernel needs to be stored in a different channel (for example, inside a `StateDB`) or discarded. In particular, if the kernel cannot return a list of breakpoints that have been set, then it becomes the debugger UI's responsibility to rehydrate and dehydrate these as needed.
-  - When the application is `restored` or when a debugger UI is instantiated, it should appear docked or expanded (this can perhaps be `type Debugger.Mode = 'condensed' | 'expanded'`) based on its last known state from a previous session.

+ 0 - 29
packages/debugger/LICENSE

@@ -1,29 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2019, Project Jupyter Contributors
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holder nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 0 - 288
packages/debugger/README.md

@@ -1,288 +0,0 @@
-# @jupyterlab/debugger
-
-![Github Actions Status](https://github.com/jupyterlab/debugger/workflows/Tests/badge.svg)
-[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab/debugger/stable?urlpath=/lab/tree/examples/index.ipynb)
-[![npm](https://img.shields.io/npm/v/@jupyterlab/debugger.svg)](https://www.npmjs.com/package/@jupyterlab/debugger)
-
-A JupyterLab debugger UI extension. This extension is under active development.
-
-![screencast](./screencast.gif)
-
-## Prerequisites
-
-- JupyterLab 2.0+
-- xeus-python 0.8.0+
-- notebook 6+
-
-## Installation
-
-A kernel with support for debugging is required to be able to use the debugger.
-
-It is generally recommended to create a new `conda` environment to install the dependencies:
-
-```bash
-conda create -n jupyterlab-debugger -c conda-forge xeus-python=0.8.0 notebook=6 jupyterlab=2 ptvsd nodejs
-conda activate jupyterlab-debugger
-```
-
-Then, run the following command to install the extension:
-
-```bash
-jupyter labextension install @jupyterlab/debugger
-```
-
-## Usage
-
-For now `xeus-python` is the only Jupyter kernel that supports debugging. `xeus-python` can be selected from the JupyterLab launcher:
-
-![xpython-launcher](https://user-images.githubusercontent.com/591645/75235047-f8080f00-57bb-11ea-80c1-d422b9ff4ad4.png)
-
-Alternatively, it is also possible to switch to the `xpython` kernel using the kernel selection dialog:
-
-![xpython-dialog](https://user-images.githubusercontent.com/591645/80113902-2bc8a080-8583-11ea-8a8c-c7c0932107ae.gif)
-
-Enable the debugger, set breakpoints and step into the code:
-
-![xpython-step](https://user-images.githubusercontent.com/591645/80114105-70ecd280-8583-11ea-82b1-ca2e84a4ae0f.gif)
-
-## Development
-
-```bash
-# Create a new conda environment
-conda create -n jupyterlab-debugger -c conda-forge nodejs xeus-python=0.8.0 ptvsd jupyterlab=2
-
-# Activate the conda environment
-conda activate jupyterlab-debugger
-
-# Install dependencies
-jlpm
-
-# Build TypeScript source
-jlpm build
-
-# Link your development version of the extension with JupyterLab
-jupyter labextension link .
-
-# Rebuild TypeScript source after making changes
-jlpm build
-
-# Rebuild JupyterLab after making any changes
-jupyter lab build
-
-# Start JupyterLab with the kernel logs enabled and watch mode enabled
-XEUS_LOG=1 jupyter lab --no-browser --watch
-```
-
-### Tests
-
-To run the tests:
-
-```bash
-# [Optional] to enable the logs for xeus-python
-export XEUS_LOG=1
-
-jlpm run test
-```
-
-To run tests for a specific test suite name:
-
-```bash
-jlpm run test --testNamePattern=<regex>
-```
-
-To run tests for a specific test module name:
-
-```bash
-jlpm run test --testPathPattern=<regex>
-```
-
-### Inspecting debug messages
-
-The [kernelspy extension for JupyterLab](https://github.com/vidartf/jupyterlab-kernelspy) can be used to inspect the debug messages sent between the debugger UI and the kernel.
-
-To install it:
-
-```bash
-jupyter labextension install jupyterlab-kernelspy
-```
-
-### Debug Protocol Overview
-
-The following diagram illustrates the types of messages sent between the JupyterLab extension and the kernel.
-
-#### Diagram
-
-![debug-protocol](https://user-images.githubusercontent.com/591645/88048217-3cbd8980-cb53-11ea-8778-b8015014a230.png)
-
-#### References
-
-- Dump cell and state restoration: https://github.com/jupyterlab/debugger/issues/52
-- Protocol Overview: https://microsoft.github.io/debug-adapter-protocol/overview
-- Specification: https://microsoft.github.io/debug-adapter-protocol/specification
-
-### Source
-
-Generated using: https://bramp.github.io/js-sequence-diagrams/
-
-<details><summary>Diagram source</summary>
-<pre>
-user->JupyterLab: open notebook
-
-JupyterLab->JupyterLab: check 'debugger' key\nin the kernel spec
-
-JupyterLab->user: show toggle button\nif 'debugger'
-
-user->JupyterLab: enable debugging
-
-JupyterLab->kernel: debugInfo request
-
-kernel->JupyterLab: debugInfo response
-
-user->JupyterLab: start debugger
-
-JupyterLab->kernel: initialize request
-
-kernel->JupyterLab: initialize response
-
-JupyterLab->kernel: attach request
-
-kernel->JupyterLab: attach response
-
-Note right of kernel: debugger started
-
-user->JupyterLab: add breakpoints\n(click on gutters)
-
-JupyterLab->kernel: dumpCell request
-
-kernel->JupyterLab: dumpCell response
-
-JupyterLab->kernel: setBreakpoints request
-
-kernel->JupyterLab: breakpoints response
-
-JupyterLab->kernel: configurationDone request
-
-kernel->JupyterLab: configurationDone response
-
-user->JupyterLab: execute cell\n(Ctrl-Enter)
-
-JupyterLab->kernel: requestExecute
-
-kernel->kernel: execute code
-
-kernel->kernel: hit breakpoint
-
-kernel-->JupyterLab: stopped event
-
-JupyterLab->kernel: stackTrace request
-
-kernel->JupyterLab: stackTrace response
-
-JupyterLab->user: show current line
-
-JupyterLab->kernel: scopes request
-
-kernel->JupyterLab: scopes response
-
-JupyterLab->kernel: variables request
-
-kernel->JupyterLab: variables response
-
-JupyterLab->user: show variables
-
-user->JupyterLab: step in deleted cell code
-
-JupyterLab->kernel: stepIn request
-
-kernel-->JupyterLab: stopped event
-
-JupyterLab->JupyterLab: search for code matching\nsource path
-
-JupyterLab->kernel: source request
-
-kernel->JupyterLab: source response
-
-JupyterLab->user: show source for current path
-
-Note right of kernel: debug session
-
-user->JupyterLab: disable debugging
-
-JupyterLab->kernel: disconnect request
-
-Note right of kernel: debugger stopped
-
-kernel->JupyterLab: disconnect response
-
-JupyterLab->JupyterLab: clear debugger UI for\nthe notebook
-
-</pre>
-</details>
-
-### Inspecting Debug Messages in VS Code
-
-Inspecting the debug messages in VS Code can be useful to understand when debug requests are made (for example triggered by a UI action), and to compare the behavior of the JupyterLab debugger with the Python debugger in VS Code.
-
-#### Create launch.json
-
-The first step is to create a test file and a debug configuration:
-
-![image](https://user-images.githubusercontent.com/591645/67576994-eb0cdd80-f73f-11e9-991f-ebea35669664.png)
-
-```json
-{
-  "version": "0.2.0",
-  "configurations": [
-    {
-      "name": "Python: Current File",
-      "type": "python",
-      "request": "launch",
-      "program": "${file}",
-      "console": "integratedTerminal",
-      "env": { "DEBUGPY_LOG_DIR": "/path/to/logs/folder" }
-    }
-  ]
-}
-```
-
-#### Start the debugger
-
-![image](https://user-images.githubusercontent.com/591645/67576928-d3355980-f73f-11e9-84e7-6d23c2cc365c.png)
-
-#### Open the logs
-
-The content of the log file look like this:
-
-```
-...
-
-D00000.032: IDE --> {
-                "command": "initialize",
-                "arguments": {
-                    "clientID": "vscode",
-                    "clientName": "Visual Studio Code",
-                    "adapterID": "python",
-                    "pathFormat": "path",
-                    "linesStartAt1": true,
-                    "columnsStartAt1": true,
-                    "supportsVariableType": true,
-                    "supportsVariablePaging": true,
-                    "supportsRunInTerminalRequest": true,
-                    "locale": "en-us"
-                },
-                "type": "request",
-                "seq": 1
-            }
-
-...
-```
-
-With:
-
-- `IDE` = VS Code
-- `PYD` = pydev debugger
-- Messages follow the DAP: https://microsoft.github.io/debug-adapter-protocol/specification
-
-#### Overview
-
-![vscode-debug-logs](https://user-images.githubusercontent.com/591645/67577219-61a9db00-f740-11e9-8240-2332599c0058.gif)

+ 0 - 10
packages/debugger/binder/environment.yml

@@ -1,10 +0,0 @@
-name: jupyterlab-debugger
-channels:
-- conda-forge
-- conda-forge/label/prerelease-jupyterlab
-dependencies:
-- jupyterlab=2
-- nodejs
-- notebook=6
-- ptvsd
-- xeus-python=0.8.0

+ 0 - 1
packages/debugger/binder/postBuild

@@ -1 +0,0 @@
-jupyter labextension install @jupyterlab/debugger@0.3.0 --debug

Різницю між файлами не показано, бо вона завелика
+ 0 - 5
packages/debugger/examples/index.ipynb


+ 0 - 31
packages/debugger/lint-staged.config.js

@@ -1,31 +0,0 @@
-/* eslint-disable */
-
-// from: https://github.com/jupyterlab/jupyterlab/blob/master/lint-staged.config.js
-
-const escape = require('shell-quote').quote;
-const fs = require('fs');
-const isWin = process.platform === 'win32';
-
-const escapeFileNames = filenames =>
-  filenames
-    .filter(filename => fs.existsSync(filename))
-    .map(filename => `"${isWin ? filename : escape([filename])}"`)
-    .join(' ');
-
-module.exports = {
-  '**/*{.css,.json,.md}': filenames => {
-    const escapedFileNames = escapeFileNames(filenames);
-    return [
-      `prettier --write ${escapedFileNames}`,
-      `git add -f ${escapedFileNames}`
-    ];
-  },
-  '**/*{.ts,.tsx,.js,.jsx}': filenames => {
-    const escapedFileNames = escapeFileNames(filenames);
-    return [
-      `prettier --write ${escapedFileNames}`,
-      `eslint --fix ${escapedFileNames}`,
-      `git add -f ${escapedFileNames}`
-    ];
-  }
-};

+ 0 - 57
packages/debugger/schema/main.json

@@ -1,57 +0,0 @@
-{
-  "title": "Debugger",
-  "description": "Debugger settings",
-  "jupyter.lab.setting-icon": "ui-components:bug",
-  "jupyter.lab.setting-icon-label": "Debugger",
-  "jupyter.lab.shortcuts": [
-    {
-      "command": "debugger:debug-console",
-      "keys": ["Accel Shift I"],
-      "selector": ".jp-CodeConsole"
-    },
-    {
-      "command": "debugger:debug-file",
-      "keys": ["Accel Shift I"],
-      "selector": ".jp-FileEditor"
-    },
-    {
-      "command": "debugger:debug-notebook",
-      "keys": ["Accel Shift I"],
-      "selector": ".jp-Notebook"
-    }
-  ],
-  "definitions": {
-    "variableFilters": {
-      "properties": {
-        "xpython": {
-          "type": "array"
-        }
-      }
-    }
-  },
-  "properties": {
-    "variableFilters": {
-      "title": "Variable filter",
-      "description": "Variables to filter out in the tree and table viewers",
-      "$ref": "#/definitions/variableFilters",
-      "default": {
-        "xpython": [
-          "display",
-          "ptvsd",
-          "_xpython_get_connection_filename",
-          "_xpython_launch",
-          "_pydev_stop_at_break",
-          "__annotations__",
-          "__builtins__",
-          "__doc__",
-          "__loader__",
-          "__name__",
-          "__package__",
-          "__spec__"
-        ]
-      }
-    }
-  },
-  "additionalProperties": false,
-  "type": "object"
-}

BIN
packages/debugger/screencast.gif


Деякі файли не було показано, через те що забагато файлів було змінено