diff --git a/.dockerignore b/.dockerignore index ee53f91e62b6..9bcce7a80897 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,10 +1,3 @@ -Dockerfile -# Docs -doc/ -# GitHub stuff -.github -.gitignore -.travis.yml -LICENSE -README.md -node_modules +** +!release-packages +!ci diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..65705d954568 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*] +indent_style = space +trim_trailing_whitespace = true +indent_size = 2 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000000..793a923d16eb --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Prettier 3.4.2 +9b0340a09276f93c054d705d1b9a5f24cc5dbc97 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..dc5caf936908 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.afdesign filter=lfs diff=lfs merge=lfs -text diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 11fee14e7271..04718d97bc09 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,7 @@ -* @code-asher @kylecarbs -Dockerfile @nhooyr +* @coder/code-server + +ci/helm-chart/ @Matthew-Beckett @alexgorbatchev + +docs/install.md @GNUxeava + +src/node/i18n/locales/zh-cn.json @zhaozhiming diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 000000000000..c43d5c65e23b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,126 @@ +name: Bug report +description: File a bug report +labels: ["bug", "triage"] +body: + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true + + - type: textarea + attributes: + label: OS/Web Information + description: | + examples: + - **Web Browser**: Chrome + - **Local OS**: macOS + - **Remote OS**: Ubuntu + - **Remote Architecture**: amd64 + - **`code-server --version`**: 4.0.1 + + Please do not just put "latest" for the version. + value: | + - Web Browser: + - Local OS: + - Remote OS: + - Remote Architecture: + - `code-server --version`: + validations: + required: true + + - type: textarea + attributes: + label: Steps to Reproduce + description: | + Please describe exactly how to reproduce the bug. For example: + 1. Open code-server in Firefox + 2. Install extension `foo.bar` from the extensions sidebar + 3. Run command `foo.bar.baz` + value: | + 1. + 2. + 3. + validations: + required: true + + - type: textarea + attributes: + label: Expected + description: What should happen? + validations: + required: true + + - type: textarea + attributes: + label: Actual + description: What actually happens? + validations: + required: true + + - type: textarea + id: logs + attributes: + label: Logs + description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `npm install -g code-server`). + render: shell + + - type: textarea + attributes: + label: Screenshot/Video + description: Please include a screenshot, gif or screen recording of your issue. + validations: + required: false + + - type: dropdown + attributes: + label: Does this bug reproduce in native VS Code? + description: If the bug reproduces in native VS Code, submit the issue upstream instead (https://github.com/microsoft/vscode). + options: + - Yes, this is also broken in native VS Code + - No, this works as expected in native VS Code + - This cannot be tested in native VS Code + - I did not test native VS Code + validations: + required: true + + - type: dropdown + attributes: + label: Does this bug reproduce in VS Code web? + description: If the bug reproduces in VS Code web, submit the issue upstream instead (https://github.com/microsoft/vscode). You can run VS Code web with `code serve-web` (this is not the same as vscode.dev). + options: + - Yes, this is also broken in VS Code web + - No, this works as expected in VS Code web + - This cannot be tested in VS Code web + - I did not test VS Code web + validations: + required: true + + - type: dropdown + attributes: + label: Does this bug reproduce in GitHub Codespaces? + description: If the bug reproduces in GitHub Codespaces, submit the issue upstream instead (https://github.com/microsoft/vscode). + options: + - Yes, this is also broken in GitHub Codespaces + - No, this works as expected in GitHub Codespaces + - This cannot be tested in GitHub Codespaces + - I did not test GitHub Codespaces + validations: + required: true + + - type: checkboxes + attributes: + label: Are you accessing code-server over a secure context? + description: code-server relies on service workers (which only work in secure contexts) for many features. Double-check that you are using a secure context like HTTPS or localhost. + options: + - label: I am using a secure context. + required: false + + - type: textarea + attributes: + label: Notes + description: Please include any addition notes that will help us resolve this issue. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 50e90f1f21fa..000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Bug Report -about: Report problems and unexpected behavior. -title: '' -labels: 'bug' -assignees: '' ---- - - - - -- `code-server` version: -- OS Version: - -## Description - - - -## Steps to Reproduce - -1. -1. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..e24498346339 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Question? + url: https://github.com/coder/code-server/discussions/new?category_id=22503114 + about: Ask the community for help on our GitHub Discussions board + - name: code-server Slack Community + about: Need immediate help or just want to talk? Hop in our Slack. Note - this Slack is not actively monitored by code-server maintainers. + url: https://cdr.co/join-community diff --git a/.github/ISSUE_TEMPLATE/doc.md b/.github/ISSUE_TEMPLATE/doc.md new file mode 100644 index 000000000000..75240e7f7631 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/doc.md @@ -0,0 +1,11 @@ +--- +name: Documentation improvement +about: Suggest a documentation improvement +labels: "docs" +--- + +## What is your suggestion? + +## How will this improve the docs? + +## Are you interested in submitting a PR for this? diff --git a/.github/ISSUE_TEMPLATE/extension_bug.md b/.github/ISSUE_TEMPLATE/extension_bug.md deleted file mode 100644 index 7c30b9479417..000000000000 --- a/.github/ISSUE_TEMPLATE/extension_bug.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Extension Bug -about: Report problems and unexpected behavior with extensions. -title: '' -labels: 'extension-specific' -assignees: '' ---- - - - -- `code-server` version: -- OS Version: -- Extension: - -## Description - - - -## Steps to Reproduce - -1. -1. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 000000000000..89837e3441e6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,13 @@ +--- +name: Feature request +about: Suggest an idea to improve code-server +labels: enhancement +--- + +## What is your suggestion? + +## Why do you want this feature? + +## Are there any workarounds to get this functionality today? + +## Are you interested in submitting a PR for this? diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index b33f67bc7ebf..000000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: Feature Request -about: Suggest an idea for this project. -title: '' -labels: 'feature' -assignees: '' ---- - - - - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 3c234cd1c76c..000000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Question -about: Ask a question. -title: '' -labels: 'question' -assignees: '' ---- - - - -## Description - - - -## Related Issues - - \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..e240a5f49c8d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ + + +Fixes # diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml new file mode 100644 index 000000000000..9f98cc2a62b1 --- /dev/null +++ b/.github/codeql-config.yml @@ -0,0 +1 @@ +name: "code-server CodeQL config" diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 000000000000..54f2ddd5674b --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,35 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + time: "06:00" + timezone: "America/Chicago" + cooldown: + default-days: 7 + labels: [] + groups: + codeql-action: + patterns: + - "github/codeql-action/*" + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "monthly" + time: "06:00" + timezone: "America/Chicago" + cooldown: + default-days: 7 + labels: [] + ignore: + # Ignore patch updates for all dependencies + - dependency-name: "*" + update-types: + - version-update:semver-patch + # Ignore major updates to Node.js types, because they need to + # correspond to the Node.js engine version + - dependency-name: "@types/node" + update-types: + - version-update:semver-major diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index e056fdf5f161..000000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,6 +0,0 @@ - - -### Describe in detail the problem you had and how this PR fixes it - -### Is there an open issue you can link to? - diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000000..945de5a3e12a --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,12 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 180 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 5 +# Label to apply when stale. +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no activity occurs in the next 5 days. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000000..cfe16dec8b91 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,319 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +# Cancel in-progress runs for pull requests when developers push +# additional changes, and serialize builds in branches. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + ci: ${{ steps.filter.outputs.ci }} + code: ${{ steps.filter.outputs.code }} + npm: ${{ steps.filter.outputs.npm }} + vscode: ${{ steps.filter.outputs.vscode }} + docs: ${{ steps.filter.outputs.docs }} + helm: ${{ steps.filter.outputs.helm }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: filter + with: + filters: | + ci: + - ".github/**" + - "ci/**" + docs: + - "docs/**" + - "README.md" + - "CHANGELOG.md" + helm: + - "ci/helm-chart/**" + code: + - "src/**" + - "test/**" + npm: + - "pnpm-lock.yaml" + - "test/pnpm-lock.yaml" + vscode: + - "lib/**" + - "patches/**" + - id: debug + run: | + echo "${{ toJSON(steps.filter )}}" + + prettier: + name: Run prettier check + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - run: pnpm exec prettier --check . + + doctoc: + name: Doctoc markdown files + runs-on: ubuntu-22.04 + needs: changes + if: needs.changes.outputs.docs == 'true' + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - run: pnpm run doctoc + + lint-helm: + name: Lint Helm chart + runs-on: ubuntu-22.04 + needs: changes + if: needs.changes.outputs.helm == 'true' + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: "v3.19.2" + - uses: bmuschko/setup-kubeconform@e5d264ec1eafe2314e750c429a9da7639dd5a003 # v1.1.0 + with: + kubeconform-version: "0.8.0" + - run: helm template ci/helm-chart | kubeconform -strict -summary - + shell: bash # Setting shell:bash makes GitHub add `-o pipefail`. + + lint-ts: + name: Lint TypeScript files + runs-on: ubuntu-22.04 + needs: changes + if: needs.changes.outputs.code == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.npm == 'true' + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - run: pnpm run lint:ts + + lint-actions: + name: Lint GitHub Actions + runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.ci == 'true' + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - name: Check workflow files + run: | + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9 + ./actionlint -color -shellcheck= -ignore "softprops/action-gh-release" + shell: bash + + test-unit: + name: Run unit tests + runs-on: ubuntu-22.04 + needs: changes + if: needs.changes.outputs.code == 'true' || needs.changes.outputs.npm == 'true' + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - run: pnpm run test:unit + + build: + name: linux-x64 + runs-on: ubuntu-22.04 + env: + DISABLE_V8_COMPILE_CACHE: 1 + VERSION: 0.0.0 + VSCODE_ARCH: x64 + VSCODE_TARGET: linux-x64 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + + steps: + - run: sudo apt update && sudo apt install -y libkrb5-dev + - uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # latest + with: + packages: quilt + version: 1.0 + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + submodules: true + - run: quilt push -a + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + + # Get Code's git hash. When this changes it means the content is + # different and we need to rebuild. + - name: Get latest lib/vscode rev + id: vscode-rev + run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT + + # We need to rebuild when we have a new version of Code, when any of the + # patches changed, or when the code-server version changes (since it gets + # embedded into the code). Use VSCODE_CACHE_VERSION to force a rebuild. + - name: Fetch prebuilt linux-x64 Code package from cache + id: cache-vscode + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: lib/vscode-reh-web-linux-x64 + key: vscode-linux-x64-package-${{ vars.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }} + - name: Build vscode + if: steps.cache-vscode.outputs.cache-hit != 'true' + run: | + cd lib/vscode/build + pnpm install --frozen-lockfile + cd .. + source ./build/azure-pipelines/linux/setup-env.sh + # Run preinstall script before root dependencies are installed + # so that v8 headers are patched correctly for native modules. + pnpm run preinstall + pnpm install --frozen-lockfile + cd ../.. + pnpm run build:vscode + + # Build the code-server wrapper. + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - run: pnpm run build + + # Push up an artifact containing the linux-x64 release. + - run: KEEP_MODULES=1 pnpm run release + - run: tar -czf package.tar.gz release + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + with: + name: linux-x64-package + path: ./package.tar.gz + + test-e2e: + name: Run e2e tests + runs-on: ubuntu-22.04 + env: + LOG_LEVEL: debug + needs: [changes, build] + if: needs.changes.outputs.code == 'true' || needs.changes.outputs.npm == 'true' || needs.changes.outputs.vscode == 'true' || needs.changes.outputs.ci == 'true' + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - name: Install Playwright OS dependencies + run: | + ./test/node_modules/.bin/playwright install-deps + ./test/node_modules/.bin/playwright install + + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 + with: + name: linux-x64-package + - run: tar -xzf package.tar.gz + + - run: CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + if: always() + with: + name: failed-test-videos + path: ./test/test-results + + test-e2e-proxy: + name: Run e2e tests behind proxy + runs-on: ubuntu-22.04 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LOG_LEVEL: debug + needs: [changes, build] + if: needs.changes.outputs.code == 'true' || needs.changes.outputs.npm == 'true' || needs.changes.outputs.vscode == 'true' || needs.changes.outputs.ci == 'true' + + steps: + - name: Cache Caddy + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + id: caddy-cache + with: + path: | + ~/.cache/caddy + key: cache-caddy-2.5.2 + - name: Install Caddy + if: steps.caddy-cache.outputs.cache-hit != 'true' + run: | + gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz" + mkdir -p ~/.cache/caddy + tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + - run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile + - name: Install Playwright OS dependencies + run: | + ./test/node_modules/.bin/playwright install-deps + ./test/node_modules/.bin/playwright install + + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 + with: + name: linux-x64-package + - run: tar -xzf package.tar.gz + + - run: ~/.cache/caddy/caddy start --config ./ci/Caddyfile + - run: CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e:proxy + - run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile + if: always() + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + if: always() + with: + name: failed-test-videos-proxy + path: ./test/test-results diff --git a/.github/workflows/installer.yaml b/.github/workflows/installer.yaml new file mode 100644 index 000000000000..1777844dd11b --- /dev/null +++ b/.github/workflows/installer.yaml @@ -0,0 +1,76 @@ +name: Installer integration + +on: + push: + branches: + - main + paths: + - "install.sh" + - ".github/workflows/installer.yaml" + pull_request: + branches: + - main + paths: + - "install.sh" + - ".github/workflows/installer.yaml" + +# Cancel in-progress runs for pull requests when developers push +# additional changes, and serialize builds in branches. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +permissions: + contents: read + +jobs: + ubuntu: + name: Test installer on Ubuntu + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + - name: Install code-server + run: ./install.sh + + - name: Test code-server was installed globally + run: code-server --help + + alpine: + name: Test installer on Alpine + runs-on: ubuntu-latest + container: "alpine:3.17" + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + - name: Install curl + run: apk add curl + + - name: Add user + run: adduser coder --disabled-password + + # Standalone should work without root. + - name: Test standalone to a non-existent prefix + run: su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist" + + # We do not actually have Alpine standalone builds so running code-server + # will not work. + - name: Test code-server was installed to prefix + run: test -f /tmp/does/not/yet/exist/bin/code-server + + macos: + name: Test installer on macOS + runs-on: macos-latest + + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + - name: Install code-server + run: ./install.sh + + - name: Test code-server was installed globally + run: code-server --help diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 000000000000..21ff9226cc0f --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,440 @@ +name: Publish code-server + +on: + # Shows the manual trigger in GitHub UI + # helpful as a back-up in case the GitHub Actions Workflow fails + workflow_dispatch: + inputs: + version: + type: string + required: true + + release: + types: [released] + +permissions: {} + +# Cancel in-progress runs for pull requests when developers push +# additional changes, and serialize builds in branches. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + # Nothing is published unless the release came from release.yaml: coder-release-publisher made + # it (only release.yaml's approve job can sign as that App, after a second person approved), it + # is published and immutable, and every file was built and attested by release.yaml from main. + verify: + runs-on: ubuntu-latest + permissions: + contents: read + attestations: read + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ inputs.version || github.ref_name }} + steps: + - name: Check the release + run: | + set -euo pipefail + fail() { echo "::error::$*"; exit 1; } + # TAG comes from the dispatch input, so only a version may reach the shell. + [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]] || fail "The version must look like v1.2.3 or v1.2.3-rc.1." + tag="v${TAG#v}" + release="$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$tag")" + author="$(jq -r .author.login <<<"$release")" + [[ "$author" == "coder-release-publisher[bot]" ]] || fail "$tag was published by $author, not by release.yaml (coder-release-publisher)." + [[ "$(jq -r .draft <<<"$release")" == "false" ]] || fail "$tag is a draft." + [[ "$(jq -r .immutable <<<"$release")" == "true" ]] || fail "$tag is not an immutable release." + + - name: Verify the files + run: | + set -euo pipefail + tag="v${TAG#v}" + gh release download "$tag" --repo "$GITHUB_REPOSITORY" --dir release-files + for f in release-files/*; do + gh attestation verify "$f" \ + --repo "$GITHUB_REPOSITORY" \ + --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release.yaml" \ + --source-ref refs/heads/main \ + --deny-self-hosted-runners + done + + npm: + runs-on: ubuntu-latest + needs: verify + environment: release + permissions: + # Required so GitHub can issue an OIDC token for trusted publishing. + id-token: write + env: + TAG: ${{ inputs.version || github.ref_name }} + NPM_ENVIRONMENT: "production" + + steps: + - name: Set version to tag without leading v + run: | + # TAG comes from the dispatch input, so only a version may reach GITHUB_ENV and the shell. + if [[ ! "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then + echo "::error::The version must look like v1.2.3 or v1.2.3-rc.1." + exit 1 + fi + echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + registry-url: "https://registry.npmjs.org" + # No dependency cache in a job that publishes: a cache saved by another run could + # change what gets published. + package-manager-cache: false + + - uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1.13 + with: + repository: "coder/code-server" + tag: ${{ env.TAG }} + fileName: "package.tar.gz" + out-file-path: "release-npm-package" + + - run: tar -xzf release-npm-package/package.tar.gz + - run: | + pushd release + npm publish --tag latest --access public + + aur: + runs-on: ubuntu-latest + needs: verify + environment: release + permissions: + contents: read + id-token: write # Cloud KMS signs the coder-automations App's JWT + timeout-minutes: 10 + env: + TAG: ${{ inputs.version || github.ref_name }} + + steps: + - name: Set version to tag without leading v + run: | + # TAG comes from the dispatch input, so only a version may reach GITHUB_ENV and the shell. + if [[ ! "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then + echo "::error::The version must look like v1.2.3 or v1.2.3-rc.1." + exit 1 + fi + echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" + + - name: Generate coder-automations app token + id: app_token + # The App's key is a non-exportable Cloud KMS key; only this workflow, in this environment, + # may sign with it. + uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 + with: + client-id: ${{ secrets.CODER_AUTOMATION_APP_ID }} + kms-key: ${{ secrets.CODER_AUTOMATION_APP_KMS_KEY }} + workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} + owner: coder + repositories: code-server-aur + permissions: | + contents: write + pull_requests: write + + # The coder-automations token can write to coder/code-server-aur only, so the update branch + # is pushed there and the PR opened from it. + - name: Checkout code-server-aur repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + repository: "coder/code-server-aur" + token: ${{ steps.app_token.outputs.token }} + ref: "master" + + - name: Configure git + run: | + git config --global user.name cdrci + git config --global user.email opensource@coder.com + + - name: Validate package + uses: heyhusen/archlinux-package-action@3f7aaada28c782497bfe02d6d6ea365b25fdea12 # v3.0.1 + with: + pkgver: ${{ env.VERSION }} + updpkgsums: true + srcinfo: true + + - name: Open PR + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + git checkout -b "update-version-$VERSION" + git add . + git commit -m "Update to $VERSION" + git push -u origin "$(git branch --show)" + gh pr create \ + --repo coder/code-server-aur \ + --title "Update to $VERSION" \ + --body "PR opened by @$GITHUB_ACTOR" \ + --assignee "$GITHUB_ACTOR" + + docker: + runs-on: ubuntu-latest + needs: verify + # Scopes the Docker Hub OIDC subject claim to + # repo:coder/code-server:environment:release. + environment: release + permissions: + # Required so GitHub can issue an OIDC token for the Docker Hub login, + # the release attestation and the coder-ghcr-dispatch token. + id-token: write + # Pushes to ghcr.io/coder/code-server-staging only; coder/ghcr-publisher + # alone can write ghcr.io/coder/code-server. + packages: write + # The release attestation coder/ghcr-publisher checks. + attestations: write + env: + GITHUB_TOKEN: ${{ github.token }} + TAG: ${{ inputs.version || github.ref_name }} + + steps: + - name: Set version to tag without leading v + run: | + # TAG comes from the dispatch input, so only a version may reach GITHUB_ENV and the shell. + if [[ ! "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then + echo "::error::The version must look like v1.2.3 or v1.2.3-rc.1." + exit 1 + fi + echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 + + # Authenticates to Docker Hub via OIDC (workload identity federation) + # instead of a stored username/password. Requires an OIDC connection + # configured for the org in Docker Home (Identity & auth > OIDC + # connections) and the `id-token: write` permission above. + - name: Login to Docker Hub with OIDC + uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 + with: + username: codercom + env: + DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} + # The Docker Hub token defaults to 5 minutes, and the multi-arch build pushes at the end, + # after about 10. + DOCKERHUB_OIDC_EXPIREIN: "3600" + - uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1.13 + with: + repository: "coder/code-server" + tag: v${{ env.VERSION }} + fileName: "*.deb" + out-file-path: "release-packages" + - uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1.13 + with: + repository: "coder/code-server" + tag: v${{ env.VERSION }} + fileName: "*.rpm" + out-file-path: "release-packages" + + # Docker Hub gets the images directly. Only coder/ghcr-publisher can write + # ghcr.io/coder/code-server, so the GHCR copy goes to code-server-staging, + # and the publisher copies each image after verifying the release + # attestation below. The digests come from bake's record of its own + # push, never from a staging tag. + - name: Build and push images + env: + GITHUB_REGISTRY: ghcr.io/coder/code-server-staging + run: ./ci/steps/docker-buildx-push.sh --metadata-file "$RUNNER_TEMP/bake-metadata.json" + + # One attestation for every image: this workflow, at this tag's commit, + # states the version and each image's public GHCR tags. The tags come + # from the same bake file with the public registry name, so they are + # exactly the tags this workflow pushed to GHCR before. + - name: Release attestation predicate + id: predicate + run: | + set -euo pipefail + commit="$(git rev-parse HEAD)" + if [[ "$commit" != "$GITHUB_SHA" ]]; then + echo "::error::checked out ${commit}, but this run is for ${GITHUB_SHA}" + exit 1 + fi + GITHUB_REGISTRY=ghcr.io/coder/code-server \ + docker buildx bake -f ci/release-image/docker-bake.hcl --print > "$RUNNER_TEMP/bake-print.json" + jq -n \ + --slurpfile meta "$RUNNER_TEMP/bake-metadata.json" \ + --slurpfile print "$RUNNER_TEMP/bake-print.json" \ + --arg v "$VERSION" \ + --arg c "$commit" ' + $print[0].target as $targets + | { + version: $v, + commit: $c, + target: "ghcr.io/coder/code-server", + images: ( + [ $meta[0] | to_entries[] + | select((.value | type) == "object" and (.value["containerimage.digest"] | type) == "string") + | { key: .value["containerimage.digest"], + value: [ $targets[.key].tags[] + | select(startswith("ghcr.io/coder/code-server:")) + | ltrimstr("ghcr.io/coder/code-server:") ] } ] + | from_entries) + }' > "$RUNNER_TEMP/predicate.json" + expected="$(jq '.group.default.targets | length' "$RUNNER_TEMP/bake-print.json")" + got="$(jq '[.images[] | select(length > 0)] | length' "$RUNNER_TEMP/predicate.json")" + if [[ "$got" != "$expected" ]]; then + echo "::error::expected ${expected} images with GHCR tags, got ${got}" + exit 1 + fi + jq -r '.images | keys[] | ltrimstr("sha256:") + " ghcr.io/coder/code-server-staging"' \ + "$RUNNER_TEMP/predicate.json" > "$RUNNER_TEMP/subjects.txt" + { + echo "predicate-path=$RUNNER_TEMP/predicate.json" + echo "subjects-path=$RUNNER_TEMP/subjects.txt" + echo "digests=$(jq -r '.images | keys | join(" ")' "$RUNNER_TEMP/predicate.json")" + } >> "$GITHUB_OUTPUT" + cat "$RUNNER_TEMP/predicate.json" + + - name: Release attestation + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 + with: + subject-checksums: ${{ steps.predicate.outputs.subjects-path }} + predicate-type: https://coder.com/attestations/code-server-release/v1 + predicate-path: ${{ steps.predicate.outputs.predicate-path }} + + # coder-ghcr-dispatch has only contents: write, on coder/ghcr-publisher + # only: enough for a repository_dispatch and nothing else. Its key is in + # Cloud KMS, signable only by this workflow in this environment. + - name: Generate coder-ghcr-dispatch token + id: dispatch_token + uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 + with: + client-id: ${{ secrets.CODER_GHCR_DISPATCH_APP_ID }} + kms-key: ${{ secrets.CODER_GHCR_DISPATCH_APP_KMS_KEY }} + workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} + owner: coder + repositories: ghcr-publisher + permissions: | + contents: write + skip-token-revoke: true + + - name: Promote to ghcr.io/coder/code-server + env: + GH_TOKEN: ${{ steps.dispatch_token.outputs.token }} + DIGESTS: ${{ steps.predicate.outputs.digests }} + PREDICATE: ${{ steps.predicate.outputs.predicate-path }} + run: | + set -euo pipefail + + # Anonymous reads: the package is public. + remote_digest() { + local repo="coder/code-server" token + token="$(curl -fsS "https://ghcr.io/token?scope=repository:${repo}:pull" | jq -r .token)" + curl -fsS -o /dev/null -D - -I \ + -H "Authorization: Bearer ${token}" \ + -H "Accept: application/vnd.oci.image.index.v1+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json" \ + "https://ghcr.io/v2/${repo}/manifests/$1" | + tr -d '\r' | awk -F': ' 'tolower($1) == "docker-content-digest" {print $2}' + } + + # The version tags, which never move. If one already exists (a + # re-run), the publisher keeps the earlier build of this release. + declare -A expected=() before=() + while read -r digest tag; do + expected["$tag"]="$digest" + if got="$(remote_digest "$tag" 2>/dev/null)" && [[ -n "$got" ]]; then + before["$tag"]="$got" + fi + done < <(jq -r --arg v "$VERSION" '.images | to_entries[] | .key as $d | .value[] | select(. == $v or startswith($v + "-")) | "\($d) \(.)"' "$PREDICATE") + + gh api repos/coder/ghcr-publisher/dispatches \ + -f event_type=promote-code-server \ + -f "client_payload[version]=${VERSION}" \ + -f "client_payload[digests]=${DIGESTS}" + gh api -X DELETE installation/token || echo "::warning::could not revoke the dispatch token; it expires within an hour" + unset GH_TOKEN + + deadline=$((SECONDS + 1800)) + while true; do + pending=() + for tag in "${!expected[@]}"; do + if ! got="$(remote_digest "$tag" 2>/dev/null)" || [[ -z "$got" ]]; then + pending+=("$tag") + continue + fi + if [[ "$got" != "${expected[$tag]}" && "$got" != "${before[$tag]:-}" ]]; then + echo "::error::ghcr.io/coder/code-server:${tag} is ${got}, expected ${expected[$tag]}" + exit 1 + fi + done + if [[ ${#pending[@]} -eq 0 ]]; then + echo "All images are promoted." + break + fi + if ((SECONDS > deadline)); then + echo "::error::Promotion did not finish in 30 minutes; still waiting for: ${pending[*]}. Check https://github.com/coder/ghcr-publisher/actions/workflows/promote-code-server.yaml" + exit 1 + fi + sleep 20 + done + + # The org doesn't let GITHUB_TOKEN open pull requests, so the branch is pushed and the PR opened + # as the coder-automations App (installed on coder/code-server; its key signs only for + # publish.yaml in the release environment). + repo: + runs-on: ubuntu-latest + environment: release + permissions: + contents: read + id-token: write # Cloud KMS signs the coder-automations App's JWT + env: + TAG: ${{ inputs.version || github.ref_name }} + needs: docker + + steps: + - name: Set version to tag without leading v + run: | + # TAG comes from the dispatch input, so only a version may reach GITHUB_ENV and the shell. + if [[ ! "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then + echo "::error::The version must look like v1.2.3 or v1.2.3-rc.1." + exit 1 + fi + echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + persist-credentials: false + + - run: ./ci/build/update-repo.sh + + # Minted after the update script so the token only exists for the push and the PR. + - name: Generate coder-automations app token + id: app_token + uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 + with: + client-id: ${{ secrets.CODER_AUTOMATION_APP_ID }} + kms-key: ${{ secrets.CODER_AUTOMATION_APP_KMS_KEY }} + workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} + owner: coder + repositories: code-server + permissions: | + contents: write + pull_requests: write + + - name: Open PR + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + gh auth setup-git + git config --global user.name cdrci + git config --global user.email opensource@coder.com + git checkout -b "helm/$VERSION" + git add . + git commit -m "Update Helm chart and changelog with $VERSION" + git push -u origin "$(git branch --show)" + gh pr create \ + --repo coder/code-server \ + --body-file .cache/checklist \ + --title "Update Helm chart and changelog with $VERSION" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000000..667f4f1bbd56 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,572 @@ +name: Release + +# Builds a release from a commit on main, waits for a second person, then tags and publishes it. +# +# prepare Works out the version and the commit to build: the merge commit of an update/ PR, +# or the commit given to a dispatch on main. +# package-* Build the packages from that commit and attest each file's provenance. Nothing here +# can create a tag or a release. +# approve Waits in the release-approval environment for a member of +# code-server-release-team other than the person who started the run. Then, as the +# coder-release-publisher App (its key is in Cloud KMS, and only this job of main's +# copy of this file may sign with it), it creates the tag and publishes the release +# with the attested files. Releases are immutable once published. +# +# Publishing the release starts publish.yaml (npm, Docker Hub, GHCR, AUR), which checks that the +# release came from here before it publishes anything. + +on: + workflow_dispatch: + inputs: + version: + description: "Version to release, e.g. 4.106.0 or 4.106.0-rc.1 (the major version is always 4)" + type: string + required: true + commit: + description: "Full SHA of the commit on main to release" + type: string + required: true + prerelease: + description: "Publish as a pre-release (npm, Docker and the AUR are not updated)" + type: boolean + default: false + pull_request_target: + types: + - closed + branches: + - main + +permissions: {} + +# Releases never cancel each other. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + prepare: + name: Prepare + runs-on: ubuntu-24.04 + if: >- + (github.event_name == 'workflow_dispatch') || + (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'update/')) + permissions: + contents: read + outputs: + version: ${{ steps.prepare.outputs.version }} + commit: ${{ steps.prepare.outputs.commit }} + prerelease: ${{ steps.prepare.outputs.prerelease }} + steps: + - name: Work out the version and the commit + id: prepare + env: + GH_TOKEN: ${{ github.token }} + EVENT: ${{ github.event_name }} + INPUT_VERSION: ${{ inputs.version }} + INPUT_COMMIT: ${{ inputs.commit }} + INPUT_PRERELEASE: ${{ inputs.prerelease }} + HEAD_REF: ${{ github.head_ref }} + MERGE_COMMIT: ${{ github.event.pull_request.merge_commit_sha }} + run: | + set -euo pipefail + fail() { echo "::error::$*"; exit 1; } + + # The tag is created by main's copy of this file only (the release-approval environment + # and Cloud KMS both require it), so a dispatch from any other ref is refused here. + [[ "$GITHUB_REF" == "refs/heads/main" ]] || fail "Run this workflow on main, not $GITHUB_REF." + + if [[ "$EVENT" == "pull_request_target" ]]; then + # The merge commit of the update/ PR, which is on main. + version="$HEAD_REF" + commit="$MERGE_COMMIT" + prerelease=false + else + version="$INPUT_VERSION" + commit="$INPUT_COMMIT" + prerelease="$INPUT_PRERELEASE" + fi + + # update/1.106.0 or v4.106.0 becomes 4.106.0: code-server keeps VS Code's minor and patch. + version=${version#update/} + version=${version#v} + version=4${version:1} + [[ "$version" =~ ^4\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]] || fail "Version must look like 4.106.0 or 4.106.0-rc.1, got '$version'." + [[ "$commit" =~ ^[0-9a-f]{40}$ ]] || fail "Commit must be a full 40-character SHA, got '$commit'." + + # The commit must be on main: main is identical to it or ahead of it. + status="$(gh api "repos/$GITHUB_REPOSITORY/compare/$commit...main" --jq .status)" + [[ "$status" == "identical" || "$status" == "ahead" ]] || fail "$commit is not on main." + + { + echo "version=$version" + echo "commit=$commit" + echo "prerelease=$prerelease" + } >> "$GITHUB_OUTPUT" + echo "Releasing v$version from $commit (pre-release: $prerelease)." + + package-linux: + name: ${{ format('linux-{0}', matrix.vscode_arch) }} + runs-on: ubuntu-22.04 + needs: prepare + permissions: + contents: read + id-token: write # To sign the provenance attestations. + attestations: write + + strategy: + matrix: + include: + - npm_arch: x64 + vscode_arch: x64 + package_arch: amd64 + - npm_arch: arm64 + vscode_arch: arm64 + package_arch: arm64 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + VERSION: ${{ needs.prepare.outputs.version }} + # Set release package name. + ARCH: ${{ matrix.package_arch }} + # Cross-compile target. + VSCODE_ARCH: ${{ matrix.vscode_arch }} + npm_config_arch: ${{ matrix.npm_arch }} + # Ensure native modules are built from source to avoid prebuilds and use + # the correct version of glibc. Although we use pnpm, this npm flag + # appears to still work for argon2, and VS Code has its own configuration + # for building from source. + npm_config_build_from_source: true + # Gulp target name. + # TODO: Pull from VSCODE_ARCH instead. + VSCODE_TARGET: ${{ format('linux-{0}', matrix.vscode_arch) }} + + steps: + - run: sudo apt update && sudo apt install -y libkrb5-dev + - uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # latest + with: + packages: quilt + version: 1.0 + - name: Install nfpm + run: | + mkdir -p ~/.local/bin + curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + # The commit prepare checked is on main, never a PR head. + ref: ${{ needs.prepare.outputs.commit }} + submodules: true + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. + allow-unsafe-pr-checkout: true + - run: quilt push -a + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + + - name: Build + run: | + cd lib/vscode/build + pnpm install --frozen-lockfile + cd .. + source ./build/azure-pipelines/linux/setup-env.sh + # Run preinstall script before root dependencies are installed + # so that v8 headers are patched correctly for native modules. + pnpm run preinstall + cd ../.. + pnpm install --frozen-lockfile + pnpm run build + pnpm run build:vscode + + # Platform-agnostic NPM package. + - run: pnpm run release + if: ${{ matrix.vscode_arch == 'x64' }} + # Into release-packages with the platform packages, so the artifact is one flat directory. + - run: mkdir -p release-packages && tar -czf release-packages/package.tar.gz release + if: ${{ matrix.vscode_arch == 'x64' }} + + # Platform-specific release. + - run: KEEP_MODULES=1 pnpm run release + - run: pnpm run package + + # The approve job and publish.yaml check every file against these. + - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: release-packages/* + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: ${{ format('release-linux-{0}', matrix.vscode_arch) }} + path: release-packages/* + if-no-files-found: error + + package-macos: + name: ${{ matrix.vscode_target }} + runs-on: ${{ matrix.os }} + needs: prepare + permissions: + contents: read + id-token: write # To sign the provenance attestations. + attestations: write + strategy: + matrix: + include: + - os: macos-15-intel + vscode_target: darwin-x64 + - os: macos-latest + vscode_target: darwin-arm64 + env: + VSCODE_TARGET: ${{ matrix.vscode_target }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ needs.prepare.outputs.version }} + # Ensure native modules are built from source to avoid prebuilds. + # Although we use pnpm, this npm flag appears to still work for argon2, + # and VS Code has its own configuration for building from source. + npm_config_build_from_source: true + + steps: + # The version of node-gyp we use depends on distutils but it was removed + # in Python 3.12. It seems to be fixed in the latest node-gyp so when we + # next update Node we can probably remove this. For now, install + # setuptools since it contains distutils. + - run: brew install python-setuptools quilt + - name: Install nfpm + run: | + mkdir -p ~/.local/bin + curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + # The commit prepare checked is on main, never a PR head. + ref: ${{ needs.prepare.outputs.commit }} + submodules: true + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. + allow-unsafe-pr-checkout: true + - run: quilt push -a + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + + - run: pnpm install --frozen-lockfile + - run: pnpm run build + - run: pnpm run build:vscode + - run: KEEP_MODULES=1 pnpm run release + - run: pnpm run test:native + + - run: pnpm run package + + # The approve job and publish.yaml check every file against these. + - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: release-packages/* + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: ${{ format('release-{0}', matrix.vscode_target) }} + path: release-packages/* + if-no-files-found: error + + package-windows: + name: win32-x64 + runs-on: windows-2022 + needs: prepare + permissions: + contents: read + id-token: write # To sign the provenance attestations. + attestations: write + + defaults: + run: + shell: bash + + env: + VSCODE_TARGET: win32-x64 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ needs.prepare.outputs.version }} + # Ensure native modules are built from source to avoid prebuilds. + # Although we use pnpm, this npm flag appears to still work for argon2, + # and VS Code has its own configuration for building from source. + npm_config_build_from_source: true + OS: windows + + steps: + # Git rewrites line endings on windows by default, which turns every + # shell script the build is made of into one bash cannot read, and + # every name in patches/series into one with a stray return. + - name: Keep line endings as they are in the repository + run: git config --global core.autocrlf false + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + # The commit prepare checked is on main, never a PR head. + ref: ${{ needs.prepare.outputs.commit }} + submodules: true + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. + allow-unsafe-pr-checkout: true + + # quilt has no windows build. The patches are ordinary -p1 diffs + # against the repository root, so git applies them in series order. + - name: Apply patches + run: | + while read -r patch; do + case "$patch" in '' | '#'*) continue ;; esac + echo "applying $patch" + git apply --whitespace=nowarn "patches/$patch" + done < patches/series + + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + test/pnpm-lock.yaml + + # pnpm hands every script it runs to cmd, which cannot run the shell + # scripts this repository is built out of. Point it at the same bash + # the steps here use rather than at a path, which moves between + # images. + - name: Let pnpm run shell scripts + run: echo "pnpm_config_script_shell=$(cygpath -w "$(command -v bash)")" >> $GITHUB_ENV + + # The build merges json by handing jq a process substitution, which + # bash presents as a file under /dev/fd. The jq on this image is a + # windows program and cannot open those, so it reads the second input + # as nothing and the merge fails. Both the product and the package + # merge go through here. + - name: Let jq read what bash hands it + run: | + mkdir -p "$RUNNER_TEMP/shim" + cat > "$RUNNER_TEMP/shim/jq" <<'SHIM' + #!/usr/bin/env bash + set -euo pipefail + args=() + for arg in "$@"; do + case $arg in + /dev/fd/* | /proc/*/fd/*) + copy=$(mktemp) + cat "$arg" > "$copy" + args+=("$copy") + ;; + *) args+=("$arg") ;; + esac + done + exec jq.exe "${args[@]}" + SHIM + chmod +x "$RUNNER_TEMP/shim/jq" + echo "$RUNNER_TEMP/shim" >> $GITHUB_PATH + + # Stamping version details into the native binaries clears any + # signature they arrived with and asks signtool whether there is one. + # That only reads and removes, so it wants no certificate and signs + # nothing. It just has to be findable, and the sdk carrying it is not + # on the path. + - name: Put signtool on the path + run: | + sdk=$(ls -d "/c/Program Files (x86)/Windows Kits/10/bin"/*/x64 | sort -V | tail -1) + test -x "$sdk/signtool.exe" + cygpath -w "$sdk" >> $GITHUB_PATH + + # build-release.sh copies the tree with rsync, which neither windows + # nor the git bash on this image has. MSYS2 is already here, just not + # on the path. + - name: Install rsync + shell: cmd + run: C:\msys64\usr\bin\pacman -Sy --noconfirm --needed rsync + + # Only rsync crosses over. Putting msys2's /usr/bin in front instead + # breaks the release step: pnpm on the path is a shell script whose + # shebang reads /usr/bin/env bash, so with msys2 first it is msys2's + # bash that runs it, and crossing into a second msys runtime does not + # carry the environment. pnpm then sees no script-shell and falls back + # to cmd, which cannot run ./ci/build/build-release.sh, and + # KEEP_MODULES is dropped on the way. A forwarder avoids the whole + # class: rsync is a native exe that loads its runtime from beside + # itself, and nothing else on the path moves. + - name: Reach rsync without moving the path + run: | + cat > "$RUNNER_TEMP/shim/rsync" <<'SHIM' + #!/usr/bin/env bash + exec /c/msys64/usr/bin/rsync.exe "$@" + SHIM + chmod +x "$RUNNER_TEMP/shim/rsync" + + - run: pnpm install --frozen-lockfile + - run: pnpm run build + - run: pnpm run build:vscode + - run: KEEP_MODULES=1 pnpm run release + + # Of the two tars on this image it is git bash's GNU one that can + # rename the tree's top directory as it archives; the windows bsdtar + # is built without substitution support. Asserted rather than + # assumed, since the two are interchangeable everywhere except here. + - name: Package + run: | + case "$(tar --version | head -1)" in + *GNU*) ;; + *) echo "expected GNU tar for --transform, got $(tar --version | head -1)" >&2; exit 1 ;; + esac + pnpm run package + + # The approve job and publish.yaml check every file against these. + - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: release-packages/* + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: release-win32-x64 + path: release-packages/* + if-no-files-found: error + + approve: + name: Approve, tag and publish the release + needs: [prepare, package-linux, package-macos, package-windows] + runs-on: ubuntu-24.04 + # A member of code-server-release-team other than the person who started the run approves + # here. Only this job of main's copy of this file, in this environment, may sign as + # coder-release-publisher, the only actor the "Release tags (App only)" ruleset lets create + # tags. + environment: release-approval + permissions: + contents: read + id-token: write # Cloud KMS signs the App's JWT. + attestations: read + env: + VERSION: ${{ needs.prepare.outputs.version }} + COMMIT: ${{ needs.prepare.outputs.commit }} + PRERELEASE: ${{ needs.prepare.outputs.prerelease }} + steps: + # For the tags, the history of main and the changelog. Nothing from the tree runs here. + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + fetch-depth: 0 + fetch-tags: true + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. This checks out + # main, not the PR head. + allow-unsafe-pr-checkout: true + + # Here and not in prepare, because the tags can change while the run waits for approval. + - name: Check the tag + id: check + run: | + set -euo pipefail + fail() { echo "::error::$*"; exit 1; } + tag="v$VERSION" + + git merge-base --is-ancestor "$COMMIT" origin/main || fail "$COMMIT is not on main." + + # A re-run finds the tag the first attempt created. + if existing="$(git rev-parse --verify --quiet "refs/tags/$tag^{commit}")"; then + [[ "$existing" == "$COMMIT" ]] || fail "Tag $tag already exists at $existing, not at $COMMIT." + echo "Tag $tag already exists at $COMMIT." + echo "create_tag=false" >> "$GITHUB_OUTPUT" + else + # Versions only go up, and a release never comes from before the last one. + latest="$(git tag --list 'v*' --sort=-version:refname | grep -E -m 1 '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)" + if [[ -n "$latest" ]]; then + printf '%s\n' "${latest#v}" "${VERSION%%-*}" | sort -V -C || fail "$tag is not newer than $latest, the latest release." + [[ "${VERSION%%-*}" != "${latest#v}" ]] || fail "$latest is already released." + git merge-base --is-ancestor "$latest" "$COMMIT" || fail "$COMMIT is older than the commit released as $latest." + fi + echo "create_tag=true" >> "$GITHUB_OUTPUT" + fi + + # The release notes are the changelog's Unreleased section at the released commit. + mkdir -p "$RUNNER_TEMP/notes" + git show "$COMMIT:CHANGELOG.md" | sed "/^## Unreleased/,/^## / ! d" | head -n -2 | tail -n +3 > "$RUNNER_TEMP/notes/release-notes.md" + + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + pattern: release-* + path: release-files + merge-multiple: true + + # Every file must have been built and attested by this workflow, from main. + - name: Verify the files + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + shopt -s nullglob + files=(release-files/*) + [[ ${#files[@]} -gt 0 ]] || { echo "::error::No release files were built."; exit 1; } + for f in "${files[@]}"; do + gh attestation verify "$f" \ + --repo "$GITHUB_REPOSITORY" \ + --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release.yaml" \ + --source-ref refs/heads/main \ + --deny-self-hosted-runners + done + sha256sum "${files[@]}" | tee "$RUNNER_TEMP/notes/SHA256SUMS" + + - name: Generate release App token + id: app_token + uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 + with: + client-id: ${{ secrets.CODER_RELEASE_PUBLISHER_APP_ID }} + kms-key: ${{ secrets.CODER_RELEASE_PUBLISHER_APP_KMS_KEY }} + workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} + owner: coder + repositories: code-server + permissions: | + contents: write + workflows: write + + # An annotated tag, through the API: nothing is pushed from this job's checkout. + - name: Create the tag + if: ${{ steps.check.outputs.create_tag == 'true' }} + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + set -euo pipefail + tag="v$VERSION" + tag_object="$(gh api "repos/$GITHUB_REPOSITORY/git/tags" \ + -f tag="$tag" -f message="Release $tag" -f object="$COMMIT" -f type=commit \ + --jq .sha)" + gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$tag" -f sha="$tag_object" >/dev/null + echo "Created tag $tag at $COMMIT." + + # gh uploads the files to a new release and publishes it in the same command. The repository + # has immutable releases, so the files and the tag are fixed from then on. Publishing a + # (non-pre-)release starts publish.yaml. + - name: Publish the release + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + set -euo pipefail + tag="v$VERSION" + if gh release view "$tag" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft 2>/dev/null | grep -qx false; then + echo "Release $tag is already published." + exit 0 + fi + # A draft for this tag is left over from an attempt that stopped before publishing. Only + # this job's own drafts are replaced; anything else needs a person to look at it. + gh api "repos/$GITHUB_REPOSITORY/releases" --paginate \ + --jq ".[] | select(.draft and .tag_name == \"$tag\") | \"\(.id) \(.author.login)\"" | + while read -r id author; do + [[ "$author" == "coder-release-publisher[bot]" ]] || { echo "::error::Draft release $id for $tag was made by $author. Delete it, then re-run."; exit 1; } + gh api -X DELETE "repos/$GITHUB_REPOSITORY/releases/$id" + echo "Deleted the unfinished draft $id for $tag." + done + args=(--repo "$GITHUB_REPOSITORY" --verify-tag --title "$tag" --notes-file "$RUNNER_TEMP/notes/release-notes.md") + if [[ "$PRERELEASE" == "true" ]]; then + args+=(--prerelease) + fi + gh release create "$tag" "${args[@]}" release-files/* + echo "Published https://github.com/$GITHUB_REPOSITORY/releases/tag/$tag" diff --git a/.github/workflows/scripts.yaml b/.github/workflows/scripts.yaml new file mode 100644 index 000000000000..180975866b12 --- /dev/null +++ b/.github/workflows/scripts.yaml @@ -0,0 +1,67 @@ +name: Script unit tests + +on: + push: + branches: + - main + paths: + - "**.sh" + - "**.bats" + pull_request: + branches: + - main + paths: + - "**.sh" + - "**.bats" + +permissions: + actions: none + checks: none + contents: read + deployments: none + issues: none + packages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none + +# Cancel in-progress runs for pull requests when developers push +# additional changes, and serialize builds in branches. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + test: + name: Run script unit tests + runs-on: ubuntu-latest + # This runs on Alpine to make sure we're testing with actual sh. + container: "alpine:3.17" + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + - name: Install test utilities + run: apk add bats checkbashisms + + - name: Check Bashisms + run: checkbashisms ./install.sh + + - name: Run script unit tests + run: ./ci/dev/test-scripts.sh + + lint: + name: Lint shell files + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + - name: Install lint utilities + run: sudo apt install shellcheck + + - name: Lint shell files + run: ./ci/dev/lint-scripts.sh diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml new file mode 100644 index 000000000000..742283504fba --- /dev/null +++ b/.github/workflows/security.yaml @@ -0,0 +1,91 @@ +name: Security + +on: + push: + branches: [main] + paths: + - "package.json" + pull_request: + paths: + - "package.json" + schedule: + # Runs every Monday morning PST + - cron: "17 15 * * 1" + +# Cancel in-progress runs for pull requests when developers push additional +# changes, and serialize builds in branches. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + audit: + name: Audit node modules + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + fetch-depth: 0 + + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 + with: + node-version-file: .node-version + + - run: pnpm audit + if: success() + + trivy-scan-repo: + name: Scan repo with Trivy + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + runs-on: ubuntu-22.04 + steps: + - name: Checkout repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + fetch-depth: 0 + + - name: Run Trivy vulnerability scanner in repo mode + uses: aquasecurity/trivy-action@8f28faec26515256b6d22074d1d2a8986f4cbd87 # latest + with: + scan-type: "fs" + scan-ref: "." + ignore-unfixed: true + format: "template" + template: "@/contrib/sarif.tpl" + output: "trivy-repo-results.sarif" + severity: "HIGH,CRITICAL" + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 + with: + sarif_file: "trivy-repo-results.sarif" + + codeql-analyze: + permissions: + actions: read # for github/codeql-action/init to get workflow details + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/autobuild to send a status report + name: Analyze with CodeQL + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 + with: + config-file: ./.github/codeql-config.yml + languages: javascript + + - name: Autobuild + uses: github/codeql-action/autobuild@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 diff --git a/.github/workflows/trivy-docker.yaml b/.github/workflows/trivy-docker.yaml new file mode 100644 index 000000000000..6895b0772187 --- /dev/null +++ b/.github/workflows/trivy-docker.yaml @@ -0,0 +1,63 @@ +name: Trivy Nightly Docker Scan + +on: + # Run scans if the workflow is modified, in order to test the + # workflow itself. This results in some spurious notifications, + # but seems okay for testing. + pull_request: + branches: + - main + paths: + - .github/workflows/trivy-docker.yaml + + # Run scans against master whenever changes are merged. + push: + branches: + - main + paths: + - .github/workflows/trivy-docker.yaml + + schedule: + - cron: "15 10 * * *" + + workflow_dispatch: + +permissions: + actions: none + checks: none + contents: read + deployments: none + issues: none + packages: none + pull-requests: none + repository-projects: none + security-events: write + statuses: none + +# Cancel in-progress runs for pull requests when developers push +# additional changes, and serialize builds in branches. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + trivy-scan-image: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + + - name: Run Trivy vulnerability scanner in image mode + uses: aquasecurity/trivy-action@8f28faec26515256b6d22074d1d2a8986f4cbd87 # latest + with: + image-ref: "docker.io/codercom/code-server:latest" + ignore-unfixed: true + format: "sarif" + output: "trivy-image-results.sarif" + severity: "HIGH,CRITICAL" + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4 + with: + sarif_file: "trivy-image-results.sarif" diff --git a/.github/workflows/update.yaml b/.github/workflows/update.yaml new file mode 100644 index 000000000000..869a40fd967f --- /dev/null +++ b/.github/workflows/update.yaml @@ -0,0 +1,97 @@ +name: Update code-server + +on: + workflow_dispatch: + inputs: + version: + type: string + required: true + schedule: + - cron: "0 16,21 * * *" + +jobs: + # The org doesn't let GITHUB_TOKEN open pull requests, so the branch is pushed and the PR opened + # as the coder-automations App. Its key signs only for this file on main, in the update + # environment (main only). + update: + runs-on: ubuntu-latest + environment: update + permissions: + contents: read + id-token: write # Cloud KMS signs the coder-automations App's JWT + env: + TAG: ${{ inputs.version }} + + steps: + - name: Fetch latest tag + if: env.TAG == '' + run: | + tag=$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/microsoft/vscode/releases/latest) + tag="${tag#https://github.com/microsoft/vscode/releases/tag/}" + echo "TAG=$tag" >> $GITHUB_ENV + + - name: Remove leading v from tag + run: | + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + submodules: true + persist-credentials: false + + - name: Check current version + id: check + run: | + commit="$(git -C lib/vscode rev-parse HEAD)" + if [[ $(git -C lib/vscode ls-remote --tags | grep "$commit") == */"$VERSION" ]] ; then + echo "$VERSION update has already been merged into $(git rev-parse --abbrev-ref HEAD)" + echo done=true >> $GITHUB_OUTPUT + elif git ls-remote --exit-code --heads origin "update/$VERSION" ; then + echo "There is already a PR for updating to $VERSION" + echo done=true >> $GITHUB_OUTPUT + else + echo "$VERSION update has not started yet" + echo done=false >> $GITHUB_OUTPUT + fi + + - uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # latest + if: steps.check.outputs.done == 'false' + with: + packages: quilt + version: 1.0 + + - run: ./ci/build/update-vscode.sh + if: steps.check.outputs.done == 'false' + + # Minted after the update script so the token only exists for the push and the PR. + - name: Generate coder-automations app token + id: app_token + if: steps.check.outputs.done == 'false' + uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 + with: + client-id: ${{ secrets.CODER_AUTOMATION_APP_ID }} + kms-key: ${{ secrets.CODER_AUTOMATION_APP_KMS_KEY }} + workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} + owner: coder + repositories: code-server + permissions: | + contents: write + pull_requests: write + + - name: Open PR + if: steps.check.outputs.done == 'false' + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + gh auth setup-git + git config --global user.name cdrci + git config --global user.email opensource@coder.com + git checkout -b "update/$VERSION" + git add . + git commit -m "Update Code to $VERSION" + git push -u origin "$(git branch --show)" + gh pr create \ + --repo coder/code-server \ + --title "Update Code to $VERSION" \ + --body-file .cache/checklist \ + --draft diff --git a/.gitignore b/.gitignore index ffaa56b42253..7fea491b82ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,24 @@ -/lib -node_modules -dist -out -.DS_Store -release -.vscode +.tsbuildinfo .cache +/out*/ +release/ +release-packages/ +release-gcp/ +release-images/ +node_modules +/plugins +/lib/coder-cloud-agent +.home +coverage +**/.DS_Store +*.bak + +# Code packages itself here. +/lib/vscode-reh-web-* + +# Failed e2e test videos are saved here +test/test-results + +# Quilt's internal data. +/.pc +/patches/*.diff~ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000000..9854a1b1dd30 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/vscode"] + path = lib/vscode + url = https://github.com/microsoft/vscode diff --git a/.node-version b/.node-version index 1047f696810d..ce62013c39ae 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -10.15.1 +24.22.1 diff --git a/.nvmrc b/.nvmrc new file mode 120000 index 000000000000..070266a2687d --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +.node-version \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000000..ce60c332da50 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +lib +release-packages +release +helm-chart +test/scripts +test/e2e/extensions/test-extension +.pc +pnpm-lock.yaml diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 000000000000..b6114bf4613b --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,6 @@ +printWidth: 120 +semi: false +trailingComma: all +arrowParens: always +singleQuote: false +useTabs: false diff --git a/.tours/contributing.tour b/.tours/contributing.tour new file mode 100644 index 000000000000..aaff2b500c99 --- /dev/null +++ b/.tours/contributing.tour @@ -0,0 +1,151 @@ +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "Contributing", + "steps": [ + { + "directory": "src", + "line": 1, + "description": "Hello world! code-server's source code lives here in `src` (see the explorer). It's broadly arranged into browser code, Node code, and code shared between both." + }, + { + "file": "src/node/entry.ts", + "line": 157, + "description": "code-server begins execution here. CLI arguments are parsed, special flags like --help are handled, then the HTTP server is started." + }, + { + "file": "src/node/cli.ts", + "line": 28, + "description": "This describes all of the code-server CLI options and how they will be parsed." + }, + { + "file": "src/node/cli.ts", + "line": 233, + "description": "Here's the actual CLI parser." + }, + { + "file": "src/node/settings.ts", + "line": 1, + "description": "code-server maintains a settings file that is read and written here." + }, + { + "file": "src/node/app.ts", + "line": 11, + "description": "The core of code-server are HTTP and web socket servers which are created here. They provide authentication, file access, an API, and serve web-based applications like VS Code." + }, + { + "file": "src/node/wsRouter.ts", + "line": 38, + "description": "This is an analog to Express's Router that handles web socket routes." + }, + { + "file": "src/node/http.ts", + "line": 1, + "description": "This file provides various HTTP utility functions." + }, + { + "file": "src/node/coder_cloud.ts", + "line": 9, + "description": "The cloud agent spawned here provides the --link functionality." + }, + { + "file": "src/node/heart.ts", + "line": 7, + "description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file](https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file)" + }, + { + "file": "src/node/socket.ts", + "line": 13, + "description": "We pass sockets to child processes, however we can't pass TLS sockets so when code-server is handling TLS (via --cert) we use this to create a proxy that can be passed to the child." + }, + { + "directory": "src/node/routes", + "line": 1, + "description": "code-server's routes live here in `src/node/routes` (see the explorer)." + }, + { + "file": "src/node/routes/index.ts", + "line": 123, + "description": "The architecture of code-server allows it to be extended with applications via plugins. Each application is registered at its own route and handles requests at and below that route. Currently we have only VS Code (although it is not yet actually split out into a plugin)." + }, + { + "file": "src/node/plugin.ts", + "line": 103, + "description": "The previously mentioned plugins are loaded here." + }, + { + "file": "src/node/routes/apps.ts", + "line": 12, + "description": "This provides a list of the applications registered with code-server." + }, + { + "file": "src/node/routes/domainProxy.ts", + "line": 18, + "description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)" + }, + { + "file": "src/node/routes/pathProxy.ts", + "line": 19, + "description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)" + }, + { + "file": "src/node/proxy.ts", + "line": 4, + "description": "Both the domain and path proxy use the single proxy instance created here." + }, + { + "file": "src/node/routes/health.ts", + "line": 5, + "description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint)" + }, + { + "file": "src/node/routes/login.ts", + "line": 46, + "description": "code-server supports a password-based login here." + }, + { + "file": "src/node/routes/static.ts", + "line": 16, + "description": "This serves static assets. Anything under the code-server directory can be fetched. Anything outside requires authentication." + }, + { + "file": "src/node/routes/update.ts", + "line": 10, + "description": "This endpoint lets you query for the latest code-server version. It's used to power the update popup you see in VS Code." + }, + { + "file": "src/node/routes/vscode.ts", + "line": 15, + "description": "This is the endpoint that serves VS Code's HTML, handles VS Code's websockets, and handles a few VS Code-specific endpoints for fetching static files." + }, + { + "file": "src/node/vscode.ts", + "line": 13, + "description": "The actual VS Code spawn and initialization is handled here. VS Code runs in a separate child process. We communicate via IPC and by passing it web sockets." + }, + { + "file": "src/browser/serviceWorker.ts", + "line": 1, + "description": "The service worker only exists to provide PWA functionality." + }, + { + "directory": "src/browser/pages", + "line": 1, + "description": "HTML, CSS, and JavaScript for each page lives in here `src/browser/pages` (see the explorer). Currently our HTML uses a simple search and replace template system with variables that {{LOOK_LIKE_THIS}}." + }, + { + "file": "src/browser/pages/vscode.html", + "line": 1, + "description": "The VS Code HTML is based off VS Code's own `workbench.html`." + }, + { + "directory": "src/browser/media", + "line": 1, + "description": "Static images and the manifest live here in `src/browser/media` (see the explorer)." + }, + { + "directory": "lib/vscode", + "line": 1, + "description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible." + } + ] +} diff --git a/.tours/start-development.tour b/.tours/start-development.tour new file mode 100644 index 000000000000..f37eed28cff0 --- /dev/null +++ b/.tours/start-development.tour @@ -0,0 +1,26 @@ +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "Start Development", + "steps": [ + { + "file": "package.json", + "line": 31, + "description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> pnpm\n\n3. Start development mode (and watch for changes):\n>> pnpm run watch" + }, + { + "file": "src/node/app.ts", + "line": 68, + "description": "## Visit the web server\n\nIf all goes well, you should see something like this in your terminal. code-server should be live in development mode.\n\n---\n```bash\n[2020-12-09T21:03:37.156Z] info code-server 3.7.4 development\n[2020-12-09T21:03:37.157Z] info Using user-data-dir ~/.local/share/code-server\n[2020-12-09T21:03:37.165Z] info Using config file ~/.config/code-server/config.yaml\n[2020-12-09T21:03:37.165Z] info HTTP server listening on http://127.0.0.1:8080 \n[2020-12-09T21:03:37.165Z] info - Authentication is enabled\n[2020-12-09T21:03:37.165Z] info - Using password from ~/.config/code-server/config.yaml\n[2020-12-09T21:03:37.165Z] info - Not serving HTTPS\n```\n\n---\n\nIf you have the default configuration, you can access it at [http://localhost:8080](http://localhost:8080)." + }, + { + "file": "src/browser/pages/login.html", + "line": 26, + "description": "## Make a change\n\nThis is the login page, let's make a change and see it update on our web server! Perhaps change the text :)\n\n```html\n
Modifying the login page 👨🏼‍💻
\n```\n\nReminder, you can likely preview at [http://localhost:8080](http://localhost:8080)" + }, + { + "file": "src/node/app.ts", + "line": 62, + "description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `pnpm run watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)" + } + ] +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 78fda08e54db..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: node_js -node_js: -- 10.15.1 -services: -- docker -matrix: - include: - - os: linux - dist: trusty - env: - - VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION" TARGET="centos" - - os: linux - dist: trusty - env: - - VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION" TARGET="alpine" - - os: osx - env: - - VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION" -before_install: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libxkbfile-dev - libsecret-1-dev; fi -- npm install -g yarn@1.12.3 -script: -- scripts/build.sh -before_deploy: -- echo "$VERSION" "$TRAVIS_COMMIT" -- git config --local user.name "$USER_NAME" -- git config --local user.email "$USER_EMAIL" -- git tag "$VERSION" "$TRAVIS_COMMIT" -- if [[ “$TRAVIS_OS_NAME” == “osx” ]]; then yarn task package $VERSION; fi -deploy: - provider: releases - file_glob: true - draft: true - tag_name: "$VERSION" - target_commitish: "$TRAVIS_COMMIT" - name: "$VERSION" - skip_cleanup: true - api_key: - secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc= - file: - - release/*.tar.gz - - release/*.zip - on: - repo: cdr/code-server - branch: master -cache: - yarn: true - timeout: 1000 - directories: - - .cache diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000000..e3cf276ab19d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,1768 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + + +## Unreleased + +## [4.146.0](https://github.com/coder/code-server/releases/tag/v4.146.0) - 2026-11-20 + +Code v1.146.0 + +### Changed + +- Update to Code 1.146.0 +- For anyone building code-server, note that we switched to pnpm to match + upstream VS Code. npm is no longer supported for building from source. +- The NPM package no longer ships with shrinkwraps, since shrinkwrap support is + removed in npm v12 and the pnpm switch makes generating the shrinkwraps + difficult. Although the shrinkwrap removal makes it easier for end users to + get updated dependencies, it also may not result in the same dependency tree + that was tested at release and can lead to unexpected behavior. To avoid this, + you can download the prebuilt source `package.tar.gz` from a GitHub release + and run `pnpm install` in the unpacked root directory to build and install the + dependencies, or build entirely from source. + +### Added + +- New flag `--wait` that waits for the opened files to be closed before + returning, so `code-server --wait` can be used as `EDITOR` or `GIT_EDITOR`. + Before, code-server's own script failed with `Unknown option --wait`, so this + only worked when the integrated terminal found the `remote-cli` script first. + +### Fixed + +- Requests against the built-in proxy will now be rewritten correctly against + the base URL on Windows. Previously it was trying to split the request on + backslashes instead of forward slashes. + +## [4.145.2](https://github.com/coder/code-server/releases/tag/v4.145.2) - 2026-11-07 + +Code v1.145.2 + +### Changed + +- Update to Code 1.145.2 + +## [4.145.0](https://github.com/coder/code-server/releases/tag/v4.145.0) - 2026-11-04 + +Code v1.145.0 + +### Security + +- Strip code-server's cookie from web socket requests going over the built-in + proxy. We were already doing this for regular proxied HTTP requests, but not + for proxied web sockets. +- Add HttpOnly to cookies to prevent them from being accessed by JavaScript + proxied over the built-in proxy. + +### Changed + +- Update to Code 1.145.0 + +### Added + +- Vietnamese locale. +- New flag `--disable-file-cache` that keeps workspace files out of the browser + cache. It stops the webview service worker from storing them in Cache Storage + and serves them from `/vscode-remote-resource` with `Cache-Control: no-store`. + Extension files will still be cached. + +## [4.144.0](https://github.com/coder/code-server/releases/tag/v4.144.0) - 2026-10-29 + +Code v1.144.0 + +### Changed + +- Update to Code 1.144.0 + +### Fixed + +- `--socket-fd` now works: the inherited socket is passed on to the process + that listens, and the address is logged as `fd:`. Previously code-server + failed with `listen EEXIST` or `Server has no address`. +- The cookie domain was not being set against the shared root host of proxy + domains when proxy domains contained template variables like `{{port}}`, + resulting in having to sign in multiple times per domain instead of only once + as originally intended. +- When doing the web socket origin check, if the host does not already contain a + port, fall back to `X-Forwarded-Port`. +- Fix default ports not matching in the web socket origin check (for example + `https://coder.com` will now match `https://coder.com:443`). + +## [4.143.1](https://github.com/coder/code-server/releases/tag/v4.143.1) - 2026-10-23 + +Code v1.143.1 + +### Changed + +- Update to Code 1.143.1 + +## [4.141.1](https://github.com/coder/code-server/releases/tag/v4.141.1) - 2026-10-23 + +### Security + +- Update bundled Node.js to 24.22.1 to fix a remote code execution bug in the + Brotli decoder (CVE-2026-111497). +- Reject compressed request bodies (`Content-Encoding: br`, `gzip`, or + `deflate`) instead of decompressing them. + +### Fixed + +- Boolean flags in the `--flag=false` form and in the config file now respect + being set to false. + +### Added + +- Turkish locale. + +### Changed + +- Expand values from path options in the config file that start with a tilde. + +## [4.141.0](https://github.com/coder/code-server/releases/tag/v4.141.0) - 2026-10-08 + +Code v1.141.0 + +### Added + +- A new `--enable-remote-storage` flag can be used to make code-server persist + workbench storage on the remote server instead of browser storage. Use this if + you want to share storage between multiple devices. + +### Fixed + +- The Typescript extension was trying to load as a browser extension even though + we build the remote server version, causing it to fail to activate. + +### Changed + +- Update to Code 1.141.0 + +## [4.140.0](https://github.com/coder/code-server/releases/tag/v4.140.0) - 2026-10-02 + +Code v1.140.0 + +### Changed + +- Update to Code 1.140.0 + +## [4.139.1](https://github.com/coder/code-server/releases/tag/v4.139.1) - 2026-09-26 + +Code v1.139.1 + +### Changed + +- Update to Code 1.139.1 + +### Fixed + +- `--idle-timeout-seconds` was only validated when passed as + `--idle-timeout-seconds=`; values of 60 or less passed as + `--idle-timeout-seconds ` were silently accepted. + +## [4.138.0](https://github.com/coder/code-server/releases/tag/v4.138.0) - 2026-09-19 + +Code v1.138.0 + +### Changed + +- Update to Code 1.138.0 + +### Fixed + +- Preserve the original path, query parameters, and fragment when rewriting + localhost URLs through the port proxy. If `VSCODE_PROXY_URI` has any query + parameters or fragments, those will be lost. + +## [4.137.0](https://github.com/coder/code-server/releases/tag/v4.137.0) - 2026-09-11 + +Code v1.137.0 + +### Changed + +- Update to Code 1.137.0 + +## [4.136.2](https://github.com/coder/code-server/releases/tag/v4.136.2) - 2026-09-08 + +Code v1.136.1 + +### Changed + +- Update to Code 1.136.1 + +### Fixed + +- 4.136.2 replaces a removed 4.136.1 release that had the data path incorrectly + being set to `~/.vscode-server-oss/data`. + +## [4.135.0](https://github.com/coder/code-server/releases/tag/v4.135.0) - 2026-08-27 + +Code v1.135.0 + +### Changed + +- Update to Code 1.135.0 + +## [4.134.0](https://github.com/coder/code-server/releases/tag/v4.134.0) - 2026-08-24 + +Code v1.134.0 + +### Added + +- New `--socket-fd` flag that can be used to listen on a file descriptor. In + particular, this allows using code-server with systemd's socket activation. +- New `--vscode-option` repeatable flag that can be used to pass through options + to VS Code. It requires `flag=value` or simply `flag` for booleans. For + example: `--vscode-option enable-sandbox --vscode-option agents=true`. The + `VSCODE_OPTIONS` environment variable may also be used. For example: + `VSCODE_OPTIONS="enable-sandbox agents=true"`. Note that code-server simply + splits this variable on spaces and is not aware of quoting. + +### Changed + +- Update to Code 1.134.0 +- Remove `--unsafe-perm` from installation scripts. This flag results in an + error when used with npm since v12 and has been a no-op since v7. If you are + installing with a version of npm older than v7 as root, installation may not + work correctly. + +## [4.133.0](https://github.com/coder/code-server/releases/tag/v4.133.0) - 2026-08-17 + +Code v1.133.0 + +### Changed + +- Update to Code 1.133.0 + +## [4.132.0](https://github.com/coder/code-server/releases/tag/v4.132.0) - 2026-08-10 + +Code v1.132.0 + +### Changed + +- Update to Code 1.132.0 + +### Fixed + +- When proxying, cookies were being decoded and re-encoded, which could cause + issues for applications that encode differently. Cookies are now passed + through unchanged (aside from stripping out code-server's session token). + +## [4.131.0](https://github.com/coder/code-server/releases/tag/v4.131.0) - 2026-07-30 + +Code v1.131.0 + +### Changed + +- Update to Code 1.131.0 + +## [4.130.0](https://github.com/coder/code-server/releases/tag/v4.130.0) - 2026-07-24 + +Code v1.130.0 + +### Changed + +- Update to Code 1.130.0 + +## [4.129.0](https://github.com/coder/code-server/releases/tag/v4.129.0) - 2026-07-17 + +Code v1.129.0 + +### Changed + +- Update to Code 1.129.0 + +## [4.128.0](https://github.com/coder/code-server/releases/tag/v4.128.0) - 2026-07-11 + +Code v1.128.0 + +### Changed + +- Update to Code 1.128.0 + +## [4.127.0](https://github.com/coder/code-server/releases/tag/v4.127.0) - 2026-07-02 + +Code v1.127.0 + +### Changed + +- Update to Code 1.127.0 + +## [4.126.0](https://github.com/coder/code-server/releases/tag/v4.126.0) - 2026-06-24 + +Code v1.126.0 + +### Changed + +- Update to Code 1.126.0 + +## [4.125.0](https://github.com/coder/code-server/releases/tag/v4.125.0) - 2026-06-18 + +Code v1.125.0 + +### Changed + +- Update to Code 1.125.0 + +## [4.124.2](https://github.com/coder/code-server/releases/tag/v4.124.2) - 2026-06-16 + +Code v1.124.2 + +### Security + +- Strip code-server's session token from the cookie before proxying to a local + port. Previously, when you used built-in password authentication, the cookie + would be sent to the local proxied port, which meant if the service was + malicious and not already running as your code-server user it could use the + cookie to log into code-server and execute commands as your code-server user. + +### Changed + +- Update to Code 1.124.2 + +## [4.123.0](https://github.com/coder/code-server/releases/tag/v4.123.0) - 2026-06-03 + +Code v1.123.0 + +### Changed + +- Update to Code 1.123.0 +- Microsoft dropped support for armhf remotes so there will no longer be any + builds for armhf. + +## [4.122.1](https://github.com/coder/code-server/releases/tag/v4.122.1) - 2026-06-02 + +Code v1.122.1 + +### Changed + +- Update to Code 1.122.1 + +## [4.122.0](https://github.com/coder/code-server/releases/tag/v4.122.0) - 2026-05-29 + +Code v1.122.0 + +### Changed + +- Update to Code 1.122.0 + +### Fixed + +- `--app-name` will now affect window titles within the editor (it is now used + as the value for `${appName}` in the title template) as well as some other + places like the help > about dialog. + +### Added + +- App name can now be set with the `CODE_SERVER_APP_NAME` environment variable. + +## [4.121.0](https://github.com/coder/code-server/releases/tag/v4.121.0) - 2026-05-20 + +Code v1.121.0 + +### Changed + +- Update to Code 1.121.0 + +## [4.118.0](https://github.com/coder/code-server/releases/tag/v4.118.0) - 2026-05-06 + +Code v1.118.0 + +### Changed + +- Update to Code 1.118.0 + +## [4.117.0](https://github.com/coder/code-server/releases/tag/v4.117.0) - 2026-04-22 + +Code v1.117.0 + +### Changed + +- Update to Code 1.117.0 + +## [4.116.0](https://github.com/coder/code-server/releases/tag/v4.116.0) - 2026-04-16 + +Code v1.116.0 + +### Changed + +- Update to Code 1.116.0 + +## [4.115.0](https://github.com/coder/code-server/releases/tag/v4.115.0) - 2026-04-08 + +Code v1.115.0 + +### Changed + +- Update to Code 1.115.0 + +## [4.114.1](https://github.com/coder/code-server/releases/tag/v4.114.1) - 2026-04-06 + +Code v1.114.0 + +### Changed + +- Ensure native modules are built from source so they use the correct version of + glibc. This should bring down the requirement from 2.34 back down to 2.28. + +## [4.114.0](https://github.com/coder/code-server/releases/tag/v4.114.0) - 2026-04-04 + +Code v1.114.0 + +### Changed + +- Update to Code 1.114.0. + +## [4.113.1](https://github.com/coder/code-server/releases/tag/v4.113.1) - 2026-04-03 + +Code v1.113.0 + +This is a re-release of v4.113.0 but with the correct Node binaries for arm64 +and armv7l. Previously they were packaging the amd64 Node binary due to a +mistake while refactoring CI to use more of the upstream build scripts. + +## [4.113.0](https://github.com/coder/code-server/releases/tag/v4.113.0) - 2026-04-02 + +Code v1.113.0 + +### Changed + +- Update to Code 1.113.0 + +## [4.112.0](https://github.com/coder/code-server/releases/tag/v4.112.0) - 2026-03-19 + +Code v1.112.0 + +### Changed + +- Update to Code 1.112.0 + +## [4.111.0](https://github.com/coder/code-server/releases/tag/v4.111.0) - 2026-03-11 + +Code v1.111.0 + +### Changed + +- Update to Code 1.111.0 +- `--app-name` now affects the error page title. + +## [4.110.1](https://github.com/coder/code-server/releases/tag/v4.110.1) - 2026-03-10 + +Code v1.110.1 + +### Changed + +- Update to Code 1.110.1 + +## [4.110.0](https://github.com/coder/code-server/releases/tag/v4.110.0) - 2026-03-09 + +Code v1.110.0 + +### Changed + +- Update to Code 1.110.0 + +## [4.109.5](https://github.com/coder/code-server/releases/tag/v4.109.5) - 2026-03-02 + +Code v1.109.5 + +### Changed + +- Update to Code 1.109.5 + +## [4.109.2](https://github.com/coder/code-server/releases/tag/v4.109.2) - 2026-02-12 + +Code v1.109.2 + +### Changed + +- Update to Code 1.109.2 + +## [4.109.0](https://github.com/coder/code-server/releases/tag/v4.109.0) - 2026-02-12 + +Code v1.109.0 + +### Changed + +- Update to Code 1.109.0 + +## [4.108.2](https://github.com/coder/code-server/releases/tag/v4.108.2) - 2026-01-26 + +Code v1.108.2 + +### Changed + +- Update to Code 1.108.2 + +## [4.108.1](https://github.com/coder/code-server/releases/tag/v4.108.1) - 2026-01-16 + +Code v1.108.1 + +### Changed + +- Update to Code 1.108.1 + +## [4.108.0](https://github.com/coder/code-server/releases/tag/v4.108.0) - 2026-01-12 + +Code v1.108.0 + +### Changed + +- Update to Code 1.108.0 + +## [4.107.1](https://github.com/coder/code-server/releases/tag/v4.107.1) - 2026-01-09 + +Code v1.107.1 + +### Changed + +- Update to Code 1.107.1 + +## [4.107.0](https://github.com/coder/code-server/releases/tag/v4.107.0) - 2026-12-17 + +Code v1.107.0 + +### Changed + +- Update to Code 1.107.0 + +### Added + +- New `--cookie-suffix` flag that can be used to add a suffix to the cookie when + using the built-in password authentication. You can use this to avoid + collisions with other instances of code-server. +- Support a new property `authorizationHeaderToken` on the extension gallery + configuration. This will be added to marketplace requests as a bearer token + using the `Authorization` header. + +## [4.106.3](https://github.com/coder/code-server/releases/tag/v4.106.3) - 2025-12-01 + +Code v1.106.3 + +### Changed + +- Update to Code 1.106.3 + +## [4.106.2](https://github.com/coder/code-server/releases/tag/v4.106.2) - 2025-11-19 + +Code v1.106.2 + +### Changed + +- Update to Code 1.106.2 + +## [4.106.0](https://github.com/coder/code-server/releases/tag/v4.106.0) - 2025-11-19 + +Code v1.106.0 + +### Changed + +- Update to Code 1.106.0 + +## [4.105.1](https://github.com/coder/code-server/releases/tag/v4.105.1) - 2025-10-20 + +Code v1.105.1 + +### Changed + +- Update to Code 1.105.1 + +## [4.105.0](https://github.com/coder/code-server/releases/tag/v4.105.0) - 2025-10-17 + +Code v1.105.0 + +### Changed + +- Update to Code 1.105.0 + +## [4.104.3](https://github.com/coder/code-server/releases/tag/v4.104.3) - 2025-10-07 + +Code v1.104.3 + +### Changed + +- Update to Code 1.104.3. + +## [4.104.2](https://github.com/coder/code-server/releases/tag/v4.104.2) - 2025-09-26 + +Code v1.104.2 + +### Changed + +- Update to Code 1.104.2. + +## [4.104.1](https://github.com/coder/code-server/releases/tag/v4.104.1) - 2025-09-19 + +Code v1.104.1 + +### Changed + +- Update to Code 1.104.1. + +## [4.104.0](https://github.com/coder/code-server/releases/tag/v4.104.0) - 2025-09-15 + +Code v1.104.0 + +### Fixed + +- Fix "extension not found" errors from Open VSX when trying to install the + latest version of an extension. + +### Changed + +- Update to Code 1.104.0. + +## [4.103.2](https://github.com/coder/code-server/releases/tag/v4.103.2) - 2025-08-25 + +Code v1.103.2 + +### Changed + +- Update to Code 1.103.2. + +## [4.103.1](https://github.com/coder/code-server/releases/tag/v4.103.1) - 2025-08-15 + +Code v1.103.1 + +### Changed + +- Update to Code 1.103.1. + +## [4.103.0](https://github.com/coder/code-server/releases/tag/v4.103.0) - 2025-08-12 + +Code v1.103.0 + +### Changed + +- Update to Code 1.103.0. + +## [4.102.2](https://github.com/coder/code-server/releases/tag/v4.102.2) - 2025-07-24 + +Code v1.102.2 + +### Changed + +- Update to Code 1.102.2. + +## [4.102.1](https://github.com/coder/code-server/releases/tag/v4.102.1) - 2025-07-17 + +Code v1.102.1 + +### Changed + +- Update to Code 1.102.1. + +## [4.102.0](https://github.com/coder/code-server/releases/tag/v4.102.0) - 2025-07-16 + +Code v1.102.0 + +### Changed + +- Update to Code 1.102.0. + +### Added + +- Custom strings can be configured using the `--i18n` flag set to a JSON + file. This can be used for either translation (and can be used alongside + `--locale`) or for customizing the strings. See + [./src/node/i18n/locales/en.json](./src/node/i18n/locales/en.json) for the + available keys. + +## [4.101.2](https://github.com/coder/code-server/releases/tag/v4.101.2) - 2025-06-25 + +Code v1.101.2 + +### Changed + +- Update to Code 1.101.2. + +### Fixed + +- Fix web views not loading due to 401 when requesting the service worker. + +## [4.101.1](https://github.com/coder/code-server/releases/tag/v4.101.1) - 2025-06-20 + +Code v1.101.1 + +### Changed + +- Update to Code 1.101.1. + +## [4.101.0](https://github.com/coder/code-server/releases/tag/v4.101.0) - 2025-06-20 + +Code v1.101.0 + +### Changed + +- Update to Code 1.101.0. + +## [4.100.3](https://github.com/coder/code-server/releases/tag/v4.100.3) - 2025-06-03 + +Code v1.100.3 + +### Changed + +- Update to Code 1.100.3. + +## [4.100.2](https://github.com/coder/code-server/releases/tag/v4.100.2) - 2025-05-15 + +Code v1.100.2 + +### Changed + +- Update to Code 1.100.2. + +## [4.100.1](https://github.com/coder/code-server/releases/tag/v4.100.1) - 2025-05-13 + +Code v1.100.1 + +### Changed + +- Update to Code 1.100.1. + +## [4.100.0](https://github.com/coder/code-server/releases/tag/v4.100.0) - 2025-05-12 + +Code v1.100.0 + +### Added + +- Trusted domains for links can now be set at run-time by configuring + `linkProtectionTrustedDomains` in the `lib/vscode/product.json` file or via + the `--link-protection-trusted-domains` flag. + +### Changed + +- Update to Code 1.100.0. +- Disable extension signature verification, which previously was skipped by + default (the package used for verification is not available to OSS builds of + VS Code) but now reportedly throws hard errors making it impossible to install + extensions. + +### Fixed + +- Flags with repeatable options now work via the config file. + +## [4.99.4](https://github.com/coder/code-server/releases/tag/v4.99.4) - 2025-05-02 + +Code v1.99.3 + +### Security + +- Validate that ports in the path proxy are numbers, to prevent proxying to + arbitrary domains. + +## [4.99.3](https://github.com/coder/code-server/releases/tag/v4.99.3) - 2025-04-17 + +Code v1.99.3 + +### Added + +- Added `--skip-auth-preflight` flag to let preflight requests through the + proxy. + +### Changed + +- Update to Code 1.99.3. + +## [4.99.2](https://github.com/coder/code-server/releases/tag/v4.99.2) - 2025-04-10 + +Code v1.99.2 + +### Changed + +- Update to Code 1.99.2. + +## [4.99.1](https://github.com/coder/code-server/releases/tag/v4.99.1) - 2025-04-08 + +Code v1.99.1 + +### Changed + +- Update to Code 1.99.1. + +## [4.99.0](https://github.com/coder/code-server/releases/tag/v4.99.0) - 2025-04-07 + +Code v1.99.0 + +### Changed + +- Update to Code 1.99.0. + +## [4.98.0](https://github.com/coder/code-server/releases/tag/v4.98.0) - 2025-03-07 + +Code v1.98.0 + +### Changed + +- Update to Code 1.98.0. + +## [4.97.2](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-02-18 + +Code v1.97.2 + +### Added + +- Added back macOS amd64 builds. + +### Changed + +- Update to Code 1.97.2. +- Softened dark mode login page colors. + +## [4.96.4](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-01-20 + +Code v1.96.4 + +### Changed + +- Update to Code 1.96.4. + +## [4.96.2](https://github.com/coder/code-server/releases/tag/v4.96.2) - 2024-12-20 + +Code v1.96.2 + +### Changed + +- Update to Code 1.96.2. + +## [4.96.1](https://github.com/coder/code-server/releases/tag/v4.96.1) - 2024-12-18 + +Code v1.96.1 + +### Added + +- Dark color scheme for login and error pages. + +### Changed + +- Update to Code 1.96.1. + +## [4.95.3](https://github.com/coder/code-server/releases/tag/v4.95.3) - 2024-11-18 + +Code v1.95.3 + +### Changed + +- Update to Code 1.95.3. + +## [4.95.2](https://github.com/coder/code-server/releases/tag/v4.95.2) - 2024-11-12 + +Code v1.95.2 + +### Changed + +- Update to Code 1.95.2. + +## [4.95.1](https://github.com/coder/code-server/releases/tag/v4.95.1) - 2024-11-06 + +Code v1.95.1 + +### Changed + +- Update to Code 1.95.1. + +## [4.93.1](https://github.com/coder/code-server/releases/tag/v4.93.1) - 2024-09-23 + +Code v1.93.1 + +### Changed + +- Updated to Code 1.93.1. + +### Added + +- Added `--abs-proxy-base-path` flag for when code-server is not at the root. + +## [4.92.2](https://github.com/coder/code-server/releases/tag/v4.92.2) - 2024-08-19 + +Code v1.92.2 + +### Breaking changes + +- Dropped a patch that changed the compile target from es2022 to es2020 because + it no longer works with the way VS Code uses static properties. This may break + older browsers, so those browsers will either have to be updated or use an + older version of code-server. + +### Changed + +- Updated to Code 1.92.2. + +## [4.91.0](https://github.com/coder/code-server/releases/tag/v4.91.0) - 2024-07-10 + +Code v1.91.0 + +### Changed + +- Updated to Code 1.91.0. + +## [4.90.3](https://github.com/coder/code-server/releases/tag/v4.90.3) - 2024-06-21 + +Code v1.90.2 + +### Changed + +- Updated to Code 1.90.2. + +### Fixed + +- When the log gets rotated it will no longer incorrectly be moved to a new + directory created in the current working directory named with a date. + Instead, the file itself is prepended with the date and kept in the same + directory, as originally intended. + +## [4.90.2](https://github.com/coder/code-server/releases/tag/v4.90.2) - 2024-06-14 + +Code v1.90.1 + +### Changed + +- Updated to Code 1.90.1. + +## [4.90.1](https://github.com/coder/code-server/releases/tag/v4.90.1) - 2024-06-12 + +Code v1.90.0 + +### Fixed + +- Cache a call to get CPU information used in telemetry that could result in a + lack responsiveness if it was particularly slow. + +## [4.90.0](https://github.com/coder/code-server/releases/tag/v4.90.0) - 2024-06-11 + +Code v1.90.0 + +### Changed + +- Updated to Code 1.90.0. +- Updated Node to 20.11.1. + +### Added + +- Send contents to the clipboard in the integrated terminal by piping to + `code-server --stdin-to-clipboard` or `code-server -c`. + + You may want to make this an alias: + + ``` + alias xclip="code-server --stdin-to-clipboard" + echo -n "hello world" | xclip + ``` + +## [4.89.1](https://github.com/coder/code-server/releases/tag/v4.89.1) - 2024-04-14 + +Code v1.89.1 + +### Changed + +- Updated to Code 1.89.1. + +## [4.89.0](https://github.com/coder/code-server/releases/tag/v4.89.0) - 2024-04-08 + +Code v1.89.0 + +### Changed + +- Updated to Code 1.89.0. + +## [4.23.1](https://github.com/coder/code-server/releases/tag/v4.23.1) - 2024-04-15 + +Code v1.88.1 + +### Changed + +- Updated to Code 1.88.1. + +## [4.23.0](https://github.com/coder/code-server/releases/tag/v4.23.0) - 2024-04-08 + +Code v1.88.0 + +### Changed + +- Updated to Code 1.88.0. +- Updated Node to 18.18.2. + +### Fixed + +- Fix masking the exit code when failing to install extensions on the command + line outside the integrated terminal. Installing extensions inside the + integrated terminal still masks the exit code and is an upstream bug. + +## [4.22.1](https://github.com/coder/code-server/releases/tag/v4.22.1) - 2024-03-14 + +Code v1.87.2 + +### Changed + +- Updated to Code 1.87.2. +- Enable keep-alive for proxy agent. + +## [4.22.0](https://github.com/coder/code-server/releases/tag/v4.22.0) - 2024-03-03 + +Code v1.87.0 + +### Changed + +- Updated to Code 1.87.0. + +## [4.21.2](https://github.com/coder/code-server/releases/tag/v4.21.2) - 2024-02-28 + +Code v1.86.2 + +### Changed + +- Updated to Code 1.86.2. + +## [4.21.1](https://github.com/coder/code-server/releases/tag/v4.21.1) - 2024-02-09 + +Code v1.86.1 + +### Changed + +- Updated to Code 1.86.1. +- Updated to Node 18.17.1. + +### Added + +- Docker images for Fedora and openSUSE. + +## [4.21.0](https://github.com/coder/code-server/releases/tag/v4.21.0) - 2024-02-05 + +Code v1.86.0 + +### Changed + +- Updated to Code 1.86.0. + +## [4.20.1](https://github.com/coder/code-server/releases/tag/v4.20.1) - 2024-01-22 + +Code v1.85.2 + +### Changed + +- Updated to Code 1.85.2. + +### Fixed + +- Query variables are no longer double-encoded when going over the path proxy. + +## [4.20.0](https://github.com/coder/code-server/releases/tag/v4.20.0) - 2023-12-21 + +Code v1.85.1 + +### Added + +- New flag `--disable-file-uploads` to disable uploading files to the remote by + drag and drop and to disable opening local files via the "show local" button + in the file open prompt. Note that you can still open local files by drag and + dropping the file onto the editor pane. +- Added `wget` to the release image. + +### Changed + +- Updated to Code 1.85.1. +- The `--disable-file-downloads` flag will now disable the "show local" button + in the file save prompt as well. +- Debian release image updated to use Bookworm. + +## [4.19.1](https://github.com/coder/code-server/releases/tag/v4.19.1) - 2023-11-29 + +Code v1.84.2 + +### Fixed + +- Fixed an issue where parts of the editor would not load (like the file + explorer, source control, etc) when using a workspace file. + +## [4.19.0](https://github.com/coder/code-server/releases/tag/v4.19.0) - 2023-11-18 + +Code v1.84.2 + +### Changed + +- Updated to Code 1.84.2. + +## [4.18.0](https://github.com/coder/code-server/releases/tag/v4.18.0) - 2023-10-20 + +Code v1.83.1 + +### Changed + +- Updated to Code 1.83.1. + +## [4.17.1](https://github.com/coder/code-server/releases/tag/v4.17.1) - 2023-09-29 + +Code v1.82.2 + +### Fixed + +- Make secret storage persistent. For example, logging in with GitHub should + persist between browser refreshes and code-server restarts. +- Issues with argon2 on arm builds should be fixed now. + +## [4.17.0](https://github.com/coder/code-server/releases/tag/v4.17.0) - 2023-09-22 + +Code v1.82.2 + +### Added + +- Japanese locale. +- `CODE_SERVER_HOST` environment variable. + +### Changed + +- Update to Code 1.82.2. This includes an update to Node 18, which also means + that the minimum glibc is now 2.28. If you need to maintain a lower glibc then + you can take a version of Node 18 that is compiled with a lower glibc and use + that to build code-server (or at a minimum rebuild the native modules). +- Display paths to config files in full rather than abbreviated. If you have + trouble with the password not working please update and make sure the + displayed config paths are what you expect. + +### Fixed + +- Fix some dependency issues for the standalone arm64 and armv7l releases. If + you had issues with missing or failing modules please try these new builds. + +## [4.16.1](https://github.com/coder/code-server/releases/tag/v4.16.1) - 2023-07-31 + +Code v1.80.2 + +### Changed + +- Updated to Code 1.80.2. + +## [4.16.0](https://github.com/coder/code-server/releases/tag/v4.16.0) - 2023-07-28 + +Code v1.80.1 + +### Added + +- `--disable-proxy` flag. This disables the domain and path proxies but it does + not disable the ports panel in Code. That can be disabled by using + `remote.autoForwardPorts=false` in your settings. + +## [4.15.0](https://github.com/coder/code-server/releases/tag/v4.15.0) - 2023-07-21 + +Code v1.80.1 + +### Changed + +- Updated to Code 1.80.1. + +### Added + +- `--trusted-origin` flag for specifying origins that you trust but do not + control (for example a reverse proxy). + +Code v1.79.2 + +## [4.14.1](https://github.com/coder/code-server/releases/tag/v4.14.1) - 2023-06-26 + +Code v1.79.2 + +### Security + +- Remove extra write permissions on the Node binary bundled with the linux-amd64 + tarball. If you extract the tar without a umask this could mean the Node + binary would be unexpectedly writable. + +### Fixed + +- Inability to launch multiple instances of code-server for different users. + +### Added + +- `--session-socket` CLI flag to configure the location of the session socket. + By default it will be placed in `/code-server-ipc.sock`. + +## [4.14.0](https://github.com/coder/code-server/releases/tag/v4.14.0) - 2023-06-16 + +Code v1.79.2 + +### Added + +- `--domain-proxy` now supports `{{port}}` and `{{host}}` template variables. + +### Changed + +- Updated to Code 1.79.2 +- Files opened from an external terminal will now open in the most closely + related window rather than in the last opened window. + +## [4.13.0](https://github.com/coder/code-server/releases/tag/v4.13.0) - 2023-05-19 + +Code v1.78.2 + +### Changed + +- Updated to Code 1.78.2. + +### Fixed + +- Proxying files that contain non-ASCII characters. +- Origin check when X-Forwarded-Host contains comma-separated hosts. + +## [4.12.0](https://github.com/coder/code-server/releases/tag/v4.12.0) - 2023-04-21 + +Code v1.77.3 + +### Changed + +- Updated to Code 1.77.3 +- Ports panel will use domain-based proxy (instead of the default path-based + proxy) when set via --proxy-domain. +- Apply --app-name to the PWA title. + +### Added + +- Thai translation for login page. +- Debug logs around the origin security check. If you are getting forbidden + errors on web sockets please run code-server with `--log debug` to see why the + requests are being blocked. + +## [4.11.0](https://github.com/coder/code-server/releases/tag/v4.11.0) - 2023-03-16 + +Code v1.76.1 + +### Changed + +- Updated to Code 1.76.1 + +## [4.10.1](https://github.com/coder/code-server/releases/tag/v4.10.1) - 2023-03-04 + +Code v1.75.1 + +### Security + +Added an origin check to web sockets to prevent cross-site hijacking attacks on +users using older or niche browser that do not support SameSite cookies and +attacks across sub-domains that share the same root domain. + +The check requires the host header to be set so if you use a reverse proxy +ensure it forwards that information otherwise web sockets will be blocked. + +## [4.10.0](https://github.com/coder/code-server/releases/tag/v4.10.0) - 2023-02-15 + +Code v1.75.1 + +### Changed + +- Updated to Code 1.75.1 + +### Removed + +- Removed `--link` (was deprecated over thirteen months ago in 4.0.1). + +## [4.9.1](https://github.com/coder/code-server/releases/tag/v4.9.1) - 2022-12-15 + +Code v1.73.1 + +### Changed + +- Updated a couple steps in the build and release process to ensure we're using + `npm` and `yarn` consistently depending on the step. + +### Fixed + +- Fixed an issue with code-server version not displaying in the Help > About window. +- Fixed terminal not loading on macOS clients. + +## [4.9.0](https://github.com/coder/code-server/releases/tag/v4.9.0) - 2022-12-06 + +Code v1.73.1 + +### Changed + +- Upgraded to Code 1.73.1 + +### Added + +- `/security.txt` added as a route with info on our security policy information thanks to @ghuntley + +### Fixed + +- Installing on majaro images should now work thanks to @MrPeacockNLB for + adding the `--noconfirm` flag in `install.sh` + +### Known Issues + +- `--cert` on Ubuntu 22.04: OpenSSL v3 is used which breaks `pem` meaning the + `--cert` feature will not work. [Reference](https://github.com/adobe/fetch/pull/318#issuecomment-1306070259) + +## [4.8.3](https://github.com/coder/code-server/releases/tag/v4.8.3) - 2022-11-07 + +Code v1.72.1 + +### Added + +- install script now supports arch-like (i.e. manjaro, endeavourous, etc.) + architectures + +### Changed + +- Updated text in the Getting Started page. + +## [4.8.2](https://github.com/coder/code-server/releases/tag/v4.8.2) - 2022-11-02 + +Code v1.72.1 + +### Added + +- New text in the Getting Started page with info about + `coder/coder`. This is enabled by default but can be disabled by passing the CLI + flag `--disable-getting-started-override` or setting + `CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or + `CS_DISABLE_GETTING_STARTED_OVERRIDE=true`. + +## [4.8.1](https://github.com/coder/code-server/releases/tag/v4.8.1) - 2022-10-28 + +Code v1.72.1 + +### Fixed + +- Fixed CSP error introduced in 4.8.0 that caused issues with webviews and most + extensions. + +## [4.8.0](https://github.com/coder/code-server/releases/tag/v4.8.0) - 2022-10-24 + +Code v1.72.1 + +### Added + +- Support for the Ports panel which leverages code-server's built-in proxy. It + also uses `VSCODE_PROXY_URI` where `{{port}}` is replace when forwarding a port. + Example: `VSCODE_PROXY_URI=https://{{port}}.kyle.dev` would forward an + application running on localhost:3000 to https://3000.kyle.dev +- Support for `--disable-workspace-trust` CLI flag +- Support for `--goto` flag to open file @ line:column +- Added Ubuntu-based images for Docker releases. If you run into issues with + `PATH` being overwritten in Docker please try the Ubuntu image as this is a + problem in the Debian base image. + +### Changed + +- Updated Code to 1.72.1 + +### Fixed + +- Enabled `BROWSER` environment variable +- Patched `asExternalUri` to work so now extensions run inside code-server can use it + +## [4.7.1](https://github.com/coder/code-server/releases/tag/v4.7.1) - 2022-09-30 + +Code v1.71.2 + +### Changed + +- Updated Code to 1.71.2 + +### Fixed + +- Fixed install script not upgrading code-server when already installed on RPM-based machines +- Fixed install script failing to gain root permissions on FreeBSD + +## [4.7.0](https://github.com/coder/code-server/releases/tag/v4.7.0) - 2022-09-09 + +Code v1.71.0 + +### Changed + +- Updated Code to 1.71.0 + +### Removed + +- Dropped heartbeat patch because it was implemented upstream + +### Fixed + +- Add flags --unsafe-perm --legacy-peer-deps in `npm-postinstall.sh` which ensures installing with npm works correctly + +## [4.6.1](https://github.com/coder/code-server/releases/tag/v4.6.1) - 2022-09-31 + +Code v1.70.2 + +### Changed + +- Updated Code to 1.70.2 +- Updated `argon2` to 0.29.0 which should fix issues on FreeBSD +- Updated docs to suggest using `npm` instead of `yarn` + +### Removed + +- Dropped database migration patch affected to 4.0.2 versions and earlier. + +### Fixed + +- Fixed preservation of `process.execArgv` which means you can pass `--prof` to profile code-server + +## [4.6.0](https://github.com/coder/code-server/releases/tag/v4.6.0) - 2022-08-17 + +Code v1.70.1 + +### Changed + +- Updated Code to 1.70.1. + +### Added + +- Added a heartbeat to sockets. This should prevent them from getting closed by + reverse proxy timeouts when idle like NGINX's default 60-second timeout. + +### Fixed + +- Fixed logout option appearing even when authentication is disabled. + +## [4.5.2](https://github.com/coder/code-server/releases/tag/v4.5.2) - 2022-08-15 + +Code v1.68.1 + +### Security + +- Fixed the proxy route not performing authentication. For example if you were + to run a development HTTP server using `python -m http.server 8000` then it + would be accessible at `my.domain/proxy/8000/` without any authentication. + + If all of the following apply to you please update as soon as possible: + - You run code-server with the built-in password authentication. + - You run unprotected HTTP services on ports accessible by code-server. + +### Changed + +- Invoking `code-server` in the integrated terminal will now use the script that + comes with upstream Code. This means flags like `--wait` will be + automatically supported now. However the upstream script only has the ability + to interact with the running code-server and cannot spawn new instances. If + you need to spawn a new code-server from the integrated terminal please + specify the full path to code-server's usual script (for example + `/usr/bin/code-server`). + +### Fixed + +- Invoking `code-server` in the integrated terminal will now work instead of + erroring about not finding Node. + +## [4.5.1](https://github.com/coder/code-server/releases/tag/v4.5.1) - 2022-07-18 + +Code v1.68.1 + +### Changed + +- We now use `release/v<0.0.0>` for the release branch name so it doesn't + conflict with the tag name +- Added `.prettierignore` to ignore formatting files in `lib/vscode` + +### Added + +- Allow more comprehensive affinity config in Helm chart +- Added custom message in Homebrew PR to make sure code-server maintainers are + tagged +- Allow setting `priorityClassName` via Helm chart +- Added troubleshooting docs to `CONTRIBUTING.md` + +### Fixed + +- Removed default memory limit which was set via `NODE_OPTIONS` +- Changed output in pipe to make it easier to debug code-server when doing live + edits +- Fixed display-language patch to use correct path which broke in 4.5.0 +- Fixed multiple code-server windows opening when using the code-server CLI in + the Integrated Terminal +- Fixed Integrated Terminal not working when web base was not the root path + +### Security + +- Updated `glob-parent` version in dependencies + +## [4.5.0](https://github.com/coder/code-server/releases/tag/v4.5.0) - 2022-06-29 + +Code v1.68.1 + +### Changed + +- Updated codecov to use codecov uploader +- Moved integration tests to Jest +- Fixed docker release to only download .deb +- Upgraded to Code 1.68.1 +- Install `nfpm` from GitHub +- Upgraded to TypeScript 4.6 + +### Added + +- Added tests for `open`, `isWsl`, `handlePasswordValidation` +- Provided alternate image registry to dockerhub +- Allowed users to have scripts run on container with `ENTRYPOINTD` environment + variable + +### Fixed + +- Fixed open CLI command to work on macOS + +## [4.4.0](https://github.com/coder/code-server/releases/tag/v4.4.0) - 2022-05-06 + +Code v1.66.2 + +### Changed + +- Refactored methods in `Heart` class and made `Heart.beat()` async to make + testing easier. +- Upgraded to Code 1.66.2. + +### Added + +- Added back telemetry patch which was removed in the Code reachitecture. +- Added support to use `true` for `CS_DISABLE_FILE_DOWNLOADS` environment + variable. This means you can disable file downloads by setting + `CS_DISABLE_FILE_DOWNLOADS` to `true` or `1`. +- Added tests for `Heart` class. + +### Fixed + +- Fixed installation issue in AUR after LICENSE rename. +- Fixed issue with listening on IPv6 addresses. +- Fixed issue with Docker publish action not being able to find artifacts. Now + it downloads the release assets from the release. + +## [4.3.0](https://github.com/coder/code-server/releases/tag/v4.3.0) - 2022-04-14 + +Code v1.65.2 + +### Changed + +- Excluded .deb files from release Docker image which drops the compressed and + uncompressed size by 58% and 34%. +- Upgraded to Code 1.65.2. + +### Added + +- Added a new CLI flag called `--disable-file-downloads` which allows you to + disable the "Download..." option that shows in the UI when right-clicking on a + file. This can also set by running `CS_DISABLE_FILE_DOWNLOADS=1`. +- Aligned the dependencies for binary and npm release artifacts. + +### Fixed + +- Fixed the code-server version from not displaying in the Help > About dialog. +- Fixed issues with the TypeScript and JavaScript Language Features Extension + failing to activate. +- Fixed missing files in ipynb extension. +- Fixed the homebrew release workflow. +- Fixed the Docker release workflow from not always publishing version tags. + +## [4.2.0](https://github.com/coder/code-server/releases/tag/v4.2.0) - 2022-03-22 + +Code v1.64.2 + +### Added + +- Added tests for `handleArgsSocketCatchError`, `setDefaults` and + `optionDescriptions`. + +### Changed + +- We switched from using the fork `coder/vscode` to a submodule of + `microsoft/vscode` + patches managed by `quilt` for how Code sits inside the + code-server codebase. +- Upgraded to Code 1.64.2. + +### Fixed + +- Update popup notification through `--disable-update-check` is now fixed. +- Fixed PWA icons not loading on iPad +- Fixed the homebrew release process. Our `cdrci` bot should now automatically + update the version as part of the release pipeline. +- Fixed titleBar color setting being ignored in PWA. + +### Security + +- Updated to `minimist-list`. +- Updated `cloud-agent` to `v0.2.4` which uses `nhooyr.io/webscoket` `v1.8.7`. + +## [4.1.0](https://github.com/coder/code-server/releases/tag/v4.1.0) - 2022-03-03 + +Code v1.63.0 + +### Added + +- Support for injecting GitHub token into Code so extensions can make use of it. + This can be done with the `GITHUB_TOKEN` environment variable or `github-auth` + in the config file. +- New flag `--socket-mode` allows setting the mode (file permissions) of the + socket created when using `--socket`. +- The version of Code bundled with code-server now appears when using the + `--version` flag. For example: `4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7dd with Code 1.63.0`. + If you have been parsing this flag for the version you might want to use + `--version --json` instead as doing that will be more stable. + +### Changed + +- The workspace or folder passed on the CLI will now use the same redirect + method that the last opened workspace or folder uses. This means if you use + something like `code-server /path/to/dir` you will now get a query parameter + added (like so: `my-domain.tld?folder=/path/to/dir`), making it easier to edit + by hand and making it consistent with the last opened and menu open behaviors. +- The folder/workspace query parameter no longer has encoded slashes, making + them more readable and editable by hand. This was only affecting the last + opened behavior, not opens from the menu. + +### Fixed + +- Fix web sockets not connecting when using `--cert`. +- Prevent workspace state collisions when opening a workspace that shares the + same file path with another workspace on a different machine that shares the + same domain. This was causing files opened in one workspace to be "re-"opened + in the other workspace when the other workspace is opened. +- Pin the Express version which should make installing from npm work again. +- Propagate signals to code-server in the Docker image which means it should + stop more quickly and gracefully. +- Fix missing argon binaries in the standalone releases on arm machines. + +## [4.0.2](https://github.com/coder/code-server/releases/tag/v4.0.2) - 2022-01-27 + +Code v1.63.0 + +### Fixed + +- Unset the `BROWSER` environment variable. This fixes applications that hard + exit when trying to spawn the helper script `BROWSER` points to because the + file is missing. While we do include the script now we are leaving the + variable omitted because the script does not work yet. + +## [4.0.1](https://github.com/coder/code-server/releases/tag/v4.0.1) - 2022-01-04 + +Code v1.63.0 + +code-server has been rebased on upstream's newly open-sourced server +implementation (#4414). + +### Changed + +- Web socket compression has been made the default (when supported). This means + the `--enable` flag will no longer take `permessage-deflate` as an option. +- The static endpoint can no longer reach outside code-server. However the + vscode-remote-resource endpoint still can. +- OpenVSX has been made the default marketplace. +- The last opened folder/workspace is no longer stored separately in the + settings file (we rely on the already-existing query object instead). +- The marketplace override environment variables `SERVICE_URL` and `ITEM_URL` + have been replaced with a single `EXTENSIONS_GALLERY` variable that + corresponds to `extensionsGallery` in Code's `product.json`. + +### Added + +- `VSCODE_PROXY_URI` env var for use in the terminal and extensions. + +### Removed + +- Extra extension directories have been removed. The `--extra-extensions-dir` + and `--extra-builtin-extensions-dir` flags will no longer be accepted. +- The `--install-source` flag has been removed. + +### Deprecated + +- `--link` is now deprecated (#4562). + +### Security + +- We fixed a XSS vulnerability by escaping HTML from messages in the error page (#4430). + +## [3.12.0](https://github.com/coder/code-server/releases/tag/v3.12.0) - 2021-09-15 + +Code v1.60.0 + +### Changed + +- Upgrade Code to 1.60.0. + +### Fixed + +- Fix logout when using a base path (#3608). + +## [3.11.1](https://github.com/coder/code-server/releases/tag/v3.11.1) - 2021-08-06 + +Undocumented (see releases page). + +## [3.11.0](https://github.com/coder/code-server/releases/tag/v3.11.0) - 2021-06-14 + +Undocumented (see releases page). + +## [3.10.2](https://github.com/coder/code-server/releases/tag/v3.10.2) - 2021-05-21 + +Code v1.56.1 + +### Added + +- Support `extraInitContainers` in helm chart values (#3393). + +### Changed + +- Change `extraContainers` to support templating in helm chart (#3393). + +### Fixed + +- Fix "Open Folder" on welcome page (#3437). + +## [3.10.1](https://github.com/coder/code-server/releases/tag/v3.10.1) - 2021-05-17 + +Code v1.56.1 + +### Fixed + +- Check the logged user instead of $USER (#3330). +- Fix broken node_modules.asar symlink in npm package (#3355). +- Update cloud agent to fix version issue (#3342). + +### Changed + +- Use xdgBasedir.runtime instead of tmp (#3304). + +## [3.10.0](https://github.com/coder/code-server/releases/tag/v3.10.0) - 2021-05-10 + +Code v1.56.0 + +### Changed + +- Update to Code 1.56.0 (#3269). +- Minor connections refactor (#3178). Improves connection stability. +- Use ptyHostService (#3308). This brings us closer to upstream Code. + +### Added + +- Add flag for toggling permessage-deflate (#3286). The default is off so + compression will no longer be used by default. Use the --enable flag to + toggle it back on. + +### Fixed + +- Make rate limiter not count against successful logins (#3141). +- Refactor logout (#3277). This fixes logging out in some scenarios. +- Make sure directories exist (#3309). This fixes some errors on startup. + +### Security + +- Update dependencies with CVEs (#3223). + +## Previous versions + +This was added with `3.10.0`, which means any previous versions are not +documented in the changelog. + +To see those, please visit the [Releases page](https://github.com/coder/code-server/releases). diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0610301a3fb3..000000000000 --- a/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM node:10.15.1 - -# Install VS Code's deps. These are the only two it seems we need. -RUN apt-get update && apt-get install -y \ - libxkbfile-dev \ - libsecret-1-dev - -# Ensure latest yarn. -RUN npm install -g yarn@1.13 - -WORKDIR /src -COPY . . - -# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules -# directly which should be fast as it is slow because it populates its own cache every time. -RUN yarn && NODE_ENV=production yarn task build:server:binary - -# We deploy with ubuntu so that devs have a familiar environment. -FROM ubuntu:18.04 - -RUN apt-get update && apt-get install -y \ - openssl \ - net-tools \ - git \ - locales \ - sudo \ - dumb-init \ - vim \ - curl \ - wget - -RUN locale-gen en_US.UTF-8 -# We unfortunately cannot use update-locale because docker will not use the env variables -# configured in /etc/default/locale so we need to set it manually. -ENV LC_ALL=en_US.UTF-8 - -RUN adduser --gecos '' --disabled-password coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd - -USER coder -# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root. -RUN mkdir -p /home/coder/project - -WORKDIR /home/coder/project - -# This assures we have a volume mounted even if the user forgot to do bind mount. -# So that they do not lose their data if they delete the container. -VOLUME [ "/home/coder/project" ] - -COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server -EXPOSE 8443 - -ENTRYPOINT ["dumb-init", "code-server"] diff --git a/README.md b/README.md deleted file mode 100644 index c4ce894a9bae..000000000000 --- a/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# code-server - -[!["Open Issues"](https://img.shields.io/github/issues-raw/cdr/code-server.svg)](https://github.com/cdr/code-server/issues) -[!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest) -[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cdr/code-server/blob/master/LICENSE) -[![Discord](https://img.shields.io/discord/463752820026376202.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zxSwN8Z) - -`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a remote server, accessible through the browser. - -Try it out: -```bash -docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth -``` - -- Code on your Chromebook, tablet, and laptop with a consistent dev environment. - - If you have a Windows or Mac workstation, more easily develop for Linux. -- Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. -- Preserve battery life when you're on the go. - - All intensive computation runs on your server. - - You're no longer running excess instances of Chrome. - -![Screenshot](/doc/assets/ide.png) - -## Getting Started - -### Run over SSH - -Use [sshcode](https://github.com/codercom/sshcode) for a simple setup. - -### Docker - -See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile). - -### Binaries - -1. [Download a binary](https://github.com/cdr/code-server/releases) (Linux and OS X supported. Windows coming soon) -2. Start the binary with the project directory as the first argument - - ``` - code-server - ``` - > You will be prompted to enter the password shown in the CLI - `code-server` should now be running at https://localhost:8443. - - > code-server uses a self-signed SSL certificate that may prompt your browser to ask you some additional questions before you proceed. Please [read here](doc/self-hosted/index.md) for more information. - -For detailed instructions and troubleshooting, see the [self-hosted quick start guide](doc/self-hosted/index.md). - -Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md), [AWS](doc/admin/install/aws.md), and [DigitalOcean](doc/admin/install/digitalocean.md). - -How to [secure your setup](/doc/security/ssl.md). - -## Development - -### Known Issues - -- Creating custom VS Code extensions and debugging them doesn't work. - -### Future -- **Stay up to date!** Get notified about new releases of code-server. - ![Screenshot](/doc/assets/release.gif) -- Windows support. -- Electron and Chrome OS applications to bridge the gap between local<->remote. -- Run VS Code unit tests against our builds to ensure features work as expected. - -### Extensions - -At the moment we can't use the official VSCode Marketplace. We've created a custom extension marketplace focused around open-sourced extensions. However, if you have access to the `.vsix` file, you can manually install the extension. - -## Telemetry - -Use the `--disable-telemetry` flag or set `DISABLE_TELEMETRY=true` to disable tracking ENTIRELY. - -We use data collected to improve code-server. - -## Contributing - -Development guides are coming soon. - -## License - -[MIT](LICENSE) - -## Enterprise - -Visit [our enterprise page](https://coder.com/enterprise) for more information about our enterprise offering. - -## Commercialization - -If you would like to commercialize code-server, please contact contact@coder.com. diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt new file mode 100644 index 000000000000..fd6f420e235e --- /dev/null +++ b/ThirdPartyNotices.txt @@ -0,0 +1,22 @@ +code-server + +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +1. Microsoft/vscode version 1.47.0 (https://github.com/Microsoft/vscode) + +%% Microsoft/vscode NOTICES AND INFORMATION BEGIN HERE +========================================= +MIT License + + +Copyright (c) 2015 - present Microsoft Corporation + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/build/platform.ts b/build/platform.ts deleted file mode 100644 index 55f8b755263b..000000000000 --- a/build/platform.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Script that detects platform name and arch. - * Cannot use os.platform() as that won't detect libc version - */ -import * as cp from "child_process"; -import * as fs from "fs"; -import * as os from "os"; - -enum Lib { - GLIBC, - MUSL, -} - -const CLIB: Lib | undefined = ((): Lib | undefined => { - if (os.platform() !== "linux") { - return; - } - const glibc = cp.spawnSync("getconf", ["GNU_LIBC_VERSION"]); - if (glibc.status === 0) { - return Lib.GLIBC; - } - - const ldd = cp.spawnSync("ldd", ["--version"]); - if (ldd.stdout && ldd.stdout.indexOf("musl") !== -1) { - return Lib.MUSL; - } - - const muslFile = fs.readdirSync("/lib").find((value) => value.startsWith("libc.musl")); - if (muslFile) { - return Lib.MUSL; - } - - return Lib.GLIBC; -})(); - -export const platform = (): NodeJS.Platform | "musl" => { - if (CLIB === Lib.MUSL) { - return "musl"; - } - - return os.platform(); -}; diff --git a/build/tasks.ts b/build/tasks.ts deleted file mode 100644 index 45d171cf1aa8..000000000000 --- a/build/tasks.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { register, run } from "@coder/runner"; -import * as fs from "fs"; -import * as fse from "fs-extra"; -import * as os from "os"; -import { platform } from "./platform"; -import * as path from "path"; -import * as zlib from "zlib"; -import * as https from "https"; -import * as tar from "tar"; - -const isWin = os.platform() === "win32"; -const libPath = path.join(__dirname, "../lib"); -const vscodePath = path.join(libPath, "vscode"); -const defaultExtensionsPath = path.join(libPath, "extensions"); -const pkgsPath = path.join(__dirname, "../packages"); -const vscodeVersion = process.env.VSCODE_VERSION || "1.33.1"; -const vsSourceUrl = `https://codesrv-ci.cdr.sh/vstar-${vscodeVersion}.tar.gz`; - -const buildServerBinary = register("build:server:binary", async (runner) => { - await ensureInstalled(); - await Promise.all([ - buildBootstrapFork(), - buildWeb(), - buildServerBundle(), - buildAppBrowser(), - ]); - - await buildServerBinaryPackage(); -}); - -const buildServerBinaryPackage = register("build:server:binary:package", async (runner) => { - const cliPath = path.join(pkgsPath, "server"); - runner.cwd = cliPath; - if (!fs.existsSync(path.join(cliPath, "out"))) { - throw new Error("Cannot build binary without server bundle built"); - } - await buildServerBinaryCopy(); - const resp = await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:binary"]); - if (resp.exitCode !== 0) { - throw new Error(`Failed to package binary: ${resp.stderr}`); - } -}); - -const buildServerBinaryCopy = register("build:server:binary:copy", async (runner) => { - const cliPath = path.join(pkgsPath, "server"); - const cliBuildPath = path.join(cliPath, "build"); - fse.removeSync(cliBuildPath); - fse.mkdirpSync(path.join(cliBuildPath, "extensions")); - const bootstrapForkPath = path.join(pkgsPath, "vscode", "out", "bootstrap-fork.js"); - const webOutputPath = path.join(pkgsPath, "web", "out"); - const browserAppOutputPath = path.join(pkgsPath, "app", "browser", "out"); - let ripgrepPath = path.join(pkgsPath, "..", "lib", "vscode", "node_modules", "vscode-ripgrep", "bin", "rg"); - if (isWin) { - ripgrepPath += ".exe"; - } - - if (!fs.existsSync(webOutputPath)) { - throw new Error("Web bundle must be built"); - } - if (!fs.existsSync(defaultExtensionsPath)) { - throw new Error("Default extensions must be built"); - } - if (!fs.existsSync(bootstrapForkPath)) { - throw new Error("Bootstrap fork must exist"); - } - if (!fs.existsSync(ripgrepPath)) { - throw new Error("Ripgrep must exist"); - } - fse.copySync(defaultExtensionsPath, path.join(cliBuildPath, "extensions")); - fs.writeFileSync(path.join(cliBuildPath, "bootstrap-fork.js.gz"), zlib.gzipSync(fs.readFileSync(bootstrapForkPath))); - const cpDir = (dir: string, rootPath: string, subdir?: "login"): void => { - const stat = fs.statSync(dir); - if (stat.isDirectory()) { - const paths = fs.readdirSync(dir); - paths.forEach((p) => cpDir(path.join(dir, p), rootPath, subdir)); - } else if (stat.isFile()) { - const newPath = path.join(cliBuildPath, "web", subdir || "", path.relative(rootPath, dir)); - fse.mkdirpSync(path.dirname(newPath)); - fs.writeFileSync(newPath + ".gz", zlib.gzipSync(fs.readFileSync(dir))); - } else { - // Nothing - } - }; - cpDir(webOutputPath, webOutputPath); - cpDir(browserAppOutputPath, browserAppOutputPath, "login"); - fse.mkdirpSync(path.join(cliBuildPath, "dependencies")); - fse.copySync(ripgrepPath, path.join(cliBuildPath, "dependencies", "rg")); -}); - -const buildServerBundle = register("build:server:bundle", async (runner) => { - const cliPath = path.join(pkgsPath, "server"); - runner.cwd = cliPath; - await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]); -}); - -const buildBootstrapFork = register("build:bootstrap-fork", async (runner) => { - await ensureInstalled(); - await ensurePatched(); - - const vscodePkgPath = path.join(pkgsPath, "vscode"); - runner.cwd = vscodePkgPath; - await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:bootstrap-fork"]); -}); - -const buildAppBrowser = register("build:app:browser", async (runner) => { - await ensureInstalled(); - - const appPath = path.join(pkgsPath, "app/browser"); - runner.cwd = appPath; - fse.removeSync(path.join(appPath, "out")); - await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]); -}); - -const buildWeb = register("build:web", async (runner) => { - await ensureInstalled(); - await ensurePatched(); - - const webPath = path.join(pkgsPath, "web"); - runner.cwd = webPath; - fse.removeSync(path.join(webPath, "out")); - await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]); -}); - -const ensureInstalled = register("vscode:install", async (runner) => { - runner.cwd = libPath; - - if (fs.existsSync(vscodePath) && fs.existsSync(defaultExtensionsPath)) { - const pkgVersion = JSON.parse(fs.readFileSync(path.join(vscodePath, "package.json")).toString("utf8")).version; - if (pkgVersion === vscodeVersion) { - runner.cwd = vscodePath; - - const reset = await runner.execute("git", ["reset", "--hard"]); - if (reset.exitCode !== 0) { - throw new Error(`Failed to clean git repository: ${reset.stderr}`); - } - - return; - } - } - - fse.removeSync(libPath); - fse.mkdirpSync(libPath); - - await new Promise((resolve, reject): void => { - https.get(vsSourceUrl, (res) => { - if (res.statusCode !== 200) { - return reject(res.statusMessage); - } - - res.pipe(tar.x({ - C: libPath, - }).on("finish", () => { - resolve(); - }).on("error", (err: Error) => { - reject(err); - })); - }).on("error", (err) => { - reject(err); - }); - }); -}); - -const ensurePatched = register("vscode:patch", async (runner) => { - if (!fs.existsSync(vscodePath)) { - throw new Error("vscode must be cloned to patch"); - } - await ensureInstalled(); - - runner.cwd = vscodePath; - const patchPath = path.join(__dirname, "../scripts/vscode.patch"); - const apply = await runner.execute("git", ["apply", "--unidiff-zero", patchPath]); - if (apply.exitCode !== 0) { - throw new Error(`Failed to apply patches: ${apply.stderr}`); - } -}); - -register("package", async (runner, releaseTag) => { - if (!releaseTag) { - throw new Error("Please specify the release tag."); - } - - const releasePath = path.resolve(__dirname, "../release"); - - const archiveName = `code-server${releaseTag}-${platform()}-${os.arch()}`; - const archiveDir = path.join(releasePath, archiveName); - fse.removeSync(archiveDir); - fse.mkdirpSync(archiveDir); - - const binaryPath = path.join(__dirname, `../packages/server/cli-${platform()}-${os.arch()}`); - const binaryDestination = path.join(archiveDir, "code-server"); - fse.copySync(binaryPath, binaryDestination); - fs.chmodSync(binaryDestination, "755"); - ["README.md", "LICENSE"].forEach((fileName) => { - fse.copySync(path.resolve(__dirname, `../${fileName}`), path.join(archiveDir, fileName)); - }); - - runner.cwd = releasePath; - await (os.platform() === "linux" - ? runner.execute("tar", ["-cvzf", `${archiveName}.tar.gz`, `${archiveName}`]) - : runner.execute("zip", ["-r", `${archiveName}.zip`, `${archiveName}`])); -}); - -run(); diff --git a/ci/Caddyfile b/ci/Caddyfile new file mode 100644 index 000000000000..52e4da6da281 --- /dev/null +++ b/ci/Caddyfile @@ -0,0 +1,15 @@ +{ + admin localhost:4444 +} +:8000 { + @portLocalhost path_regexp port ^/([0-9]+)\/ide + handle @portLocalhost { + uri strip_prefix {re.port.1}/ide + reverse_proxy localhost:{re.port.1} + } + + handle { + respond "Bad hostname" 400 + } + +} diff --git a/ci/build/build-code-server.sh b/ci/build/build-code-server.sh new file mode 100755 index 000000000000..df86f2d97a18 --- /dev/null +++ b/ci/build/build-code-server.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Builds code-server into out and the frontend into dist. + +main() { + cd "$(dirname "${0}")/../.." + + tsc + + # If out/node/entry.js does not already have the shebang, + # we make sure to add it and make it executable. + if ! grep -q -m1 "^#!/usr/bin/env node" out/node/entry.js; then + sed -i.bak "1s;^;#!/usr/bin/env node\n;" out/node/entry.js && rm out/node/entry.js.bak + chmod +x out/node/entry.js + fi +} + +main "$@" diff --git a/ci/build/build-lib.sh b/ci/build/build-lib.sh new file mode 100755 index 000000000000..520276c1bfc3 --- /dev/null +++ b/ci/build/build-lib.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# This is a library which contains functions used inside ci/build +# +# We separated it into it's own file so that we could easily unit test +# these functions and helpers. + +# On some CPU architectures (notably node/uname "armv7l", default on Raspberry Pis), +# different package managers have different labels for the same CPU (deb=armhf, rpm=armhfp). +# This function returns the overriden arch on platforms +# with alternate labels, or the same arch otherwise. +get_nfpm_arch() { + local PKG_FORMAT="${1:-}" + local ARCH="${2:-}" + + case "$ARCH" in + armv7l) + if [ "$PKG_FORMAT" = "deb" ]; then + echo armhf + elif [ "$PKG_FORMAT" = "rpm" ]; then + echo armhfp + fi + ;; + *) + echo "$ARCH" + ;; + esac +} diff --git a/ci/build/build-packages.sh b/ci/build/build-packages.sh new file mode 100755 index 000000000000..dfd29dba20d3 --- /dev/null +++ b/ci/build/build-packages.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Given a release found in $RELEASE_PATH, generate a deb, rpm, and tarball each +# named after $ARCH (derived from uname -m but can be overridden for +# cross-compilation) and $OS (derived from uname and cannot be overridden) and +# place them in ./release-packages and ./release-gcp. + +main() { + cd "$(dirname "${0}")/../.." + source ./ci/lib.sh + source ./ci/build/build-lib.sh + + VERSION=$(jq -r .version "$RELEASE_PATH/package.json") + export VERSION # for nfpm to use + + mkdir -p release-packages + + release_archive + + if [[ $OS == "linux" ]]; then + release_nfpm + fi +} + +release_archive() { + local release_name="code-server-$VERSION-$OS-$ARCH" + if [[ $OS == "linux" || $OS == "windows" ]]; then + tar -czf "release-packages/$release_name.tar.gz" --owner=0 --group=0 --transform "s/^$RELEASE_PATH/$release_name/" "$RELEASE_PATH" + else + tar -czf "release-packages/$release_name.tar.gz" -s "/^$RELEASE_PATH/$release_name/" "$RELEASE_PATH" + fi + + echo "done (release-packages/$release_name)" + + release_gcp +} + +release_gcp() { + mkdir -p "release-gcp/$VERSION" + cp "release-packages/$release_name.tar.gz" "./release-gcp/$VERSION/$OS-$ARCH.tar.gz" + mkdir -p "release-gcp/latest" + cp "./release-packages/$release_name.tar.gz" "./release-gcp/latest/$OS-$ARCH.tar.gz" +} + +# Generates deb and rpm packages. +release_nfpm() { + local nfpm_config + + export NFPM_ARCH + + NFPM_ARCH="$(get_nfpm_arch deb "$ARCH")" + nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)" + echo "Building deb" + echo "$nfpm_config" | head --lines=4 + nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_${NFPM_ARCH}.deb" + + NFPM_ARCH="$(get_nfpm_arch rpm "$ARCH")" + nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)" + echo "Building rpm" + echo "$nfpm_config" | head --lines=4 + nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server-$VERSION-$NFPM_ARCH.rpm" +} + +main "$@" diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh new file mode 100755 index 000000000000..c19ef8eddef2 --- /dev/null +++ b/ci/build/build-release.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ ${RUNNER_DEBUG-} = 1 ]]; then + set -x +fi + +# Once both code-server and VS Code have been built, use this script to copy +# them into a single directory (./release) and prepare the package.json and +# product.json. This results in a generic package with only built code and no +# dependencies that we can publish to NPM and GitHub. + +# MINIFY controls whether minified VS Code is bundled. It must match the value +# used when VS Code was built. +MINIFY="${MINIFY-true}" + +# Set KEEP_MODULES=1 to copy dependencies, delete anything not specific to the +# platform (like the remote-cli scripts for other platforms), and include a +# launcher script plus a Node binary. Note these modules will be for the +# platform that built them, making the result no longer generic. +KEEP_MODULES="${KEEP_MODULES-0}" + +main() { + cd "$(dirname "${0}")/../.." + + source ./ci/lib.sh + + VSCODE_SRC_PATH="lib/vscode" + VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode" + + mkdir -p "$RELEASE_PATH" + + bundle_code_server + bundle_vscode + + rsync ./docs/README.md "$RELEASE_PATH" + rsync LICENSE "$RELEASE_PATH" + rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH" + + if [ "$KEEP_MODULES" = 1 ]; then + # Copy the code-server launcher. + mkdir -p "$RELEASE_PATH/bin" + rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server" + chmod 755 "$RELEASE_PATH/bin/code-server" + + # Windows cannot run the shell launcher, so it gets one of its own. + if [ "$OS" = windows ]; then + rsync ./ci/build/code-server.cmd "$RELEASE_PATH/bin/code-server.cmd" + fi + + # Delete the extra bin scripts. + rm "$RELEASE_PATH/lib/vscode/bin/remote-cli/code-darwin.sh" + rm "$RELEASE_PATH/lib/vscode/bin/remote-cli/code-linux.sh" + rm "$RELEASE_PATH/lib/vscode/bin/helpers/browser-darwin.sh" + rm "$RELEASE_PATH/lib/vscode/bin/helpers/browser-linux.sh" + if [ "$OS" != windows ] ; then + rm "$RELEASE_PATH/lib/vscode/bin/remote-cli/code.cmd" + rm "$RELEASE_PATH/lib/vscode/bin/helpers/browser.cmd" + fi + fi +} + +bundle_code_server() { + rsync out "$RELEASE_PATH" + + # For source maps and images. + mkdir -p "$RELEASE_PATH/src/browser" + rsync src/browser/media/ "$RELEASE_PATH/src/browser/media" + mkdir -p "$RELEASE_PATH/src/browser/pages" + rsync src/browser/pages/*.html "$RELEASE_PATH/src/browser/pages" + rsync src/browser/pages/*.css "$RELEASE_PATH/src/browser/pages" + rsync src/browser/robots.txt "$RELEASE_PATH/src/browser" + + cp package.json "$RELEASE_PATH/package.json" + cp pnpm-lock.yaml "$RELEASE_PATH/pnpm-lock.yaml" + cp pnpm-workspace.yaml "$RELEASE_PATH/pnpm-workspace.yaml" + + if [ "$KEEP_MODULES" = 1 ]; then + local rsync_opts=(-a) + if [[ ${RUNNER_DEBUG-} = 1 ]]; then + rsync_opts+=(-vh) + fi + # If we build from source, exclude the prebuilds. + if [[ ${npm_config_build_from_source-} = true ]]; then + rsync_opts+=(--exclude /argon2/prebuilds) + fi + rsync "${rsync_opts[@]}" node_modules/ "$RELEASE_PATH/node_modules" + # Remove dev dependencies. pnpm's prune must be told to ignore scripts or + # it will try to run the post-install. + pushd "$RELEASE_PATH" + pnpm prune --production --ignore-scripts + popd + fi + + # - Add the commit and version. + # - Strip unnecessary properties. This needs to happen after the prune, since + # pnpm appears to have odd behavior with devDependencies missing (for + # example it was not removing the Typescript dev dependency). + # - Add a post-install for use as an npm or generic package to install VS + # Code's modules. + jq --slurp '(.[0] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <( + cat << EOF + { + "version": "$(jq -r .codeServerVersion "./lib/vscode-reh-web-$VSCODE_TARGET/product.json")", + "commit": "$(git rev-parse HEAD)", + "scripts": { + "postinstall": "sh ./postinstall.sh" + } + } +EOF + ) > "$RELEASE_PATH/package.json" + + rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh" +} + +bundle_vscode() { + mkdir -p "$VSCODE_OUT_PATH" + + local rsync_opts=(-a) + if [[ ${RUNNER_DEBUG-} = 1 ]]; then + rsync_opts+=(-vh) + fi + + # Some extensions have a .gitignore which excludes their built source from the + # npm package so exclude any .gitignore files. + rsync_opts+=(--exclude .gitignore) + + # Exclude Node since we want to place it in a directory above. + rsync_opts+=(--exclude /node) + rsync_opts+=(--exclude /node.exe) + + # Exclude Node modules. Note that these will already only include production + # dependencies, so if we do keep them there is no need to do any + # post-processing to remove dev dependencies. + if [[ $KEEP_MODULES = 0 ]]; then + rsync_opts+=(--exclude node_modules) + fi + + rsync "${rsync_opts[@]}" "./lib/vscode-reh-web-$VSCODE_TARGET/" "$VSCODE_OUT_PATH" + + # Copy the Node binary. + if [[ $KEEP_MODULES = 1 ]]; then + if [ "$OS" = windows ]; then + cp "./lib/vscode-reh-web-$VSCODE_TARGET/node.exe" "$RELEASE_PATH/lib" + else + cp "./lib/vscode-reh-web-$VSCODE_TARGET/node" "$RELEASE_PATH/lib" + fi + fi + + # - Include the dependencies so unsupported platforms can use this package + # without having to build code-server (they only have to install + # dependencies) by downloading from either from NPM or from GitHub. + # - Override the name to prevent vulnerability scanners from misidentifying + # this package as VS Code (see #7071). + jq --slurp '.[1].dependencies = .[0].dependencies | .[1] | .name = "code-oss"' \ + "$VSCODE_SRC_PATH/remote/package.json" \ + "$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged" + mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json" + cp "$VSCODE_SRC_PATH/remote/pnpm-lock.yaml" "$VSCODE_OUT_PATH/pnpm-lock.yaml" + cp "$VSCODE_SRC_PATH/remote/pnpm-workspace.yaml" "$VSCODE_OUT_PATH/pnpm-workspace.yaml" + + # Include global extension dependencies as well. + jq 'del(.devDependencies)' "$VSCODE_SRC_PATH/extensions/package.json" > "$VSCODE_OUT_PATH/extensions/package.json" + rsync "$VSCODE_SRC_PATH/extensions/pnpm-lock.yaml" "$VSCODE_OUT_PATH/extensions/pnpm-lock.yaml" + rsync "$VSCODE_SRC_PATH/extensions/pnpm-workspace.yaml" "$VSCODE_OUT_PATH/extensions/pnpm-workspace.yaml" +} + +main "$@" diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh new file mode 100755 index 000000000000..e1152087755f --- /dev/null +++ b/ci/build/build-vscode.sh @@ -0,0 +1,170 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Builds vscode into lib/vscode/out-vscode. + +# MINIFY controls whether a minified version of vscode is built. +MINIFY=${MINIFY-true} + +fix-bin-script() { + local script="lib/vscode-reh-web-$VSCODE_TARGET/bin/$1" + sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$script" + sed -i.bak "s/@@COMMIT@@/$BUILD_SOURCEVERSION/g" "$script" + sed -i.bak "s/@@APPNAME@@/code-server/g" "$script" + + # Fix Node path on Darwin and Linux. + # We do not want expansion here; this text should make it to the file as-is. + # shellcheck disable=SC2016 + sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$script" + sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$script" + # We do not want expansion here; this text should make it to the file as-is. + # shellcheck disable=SC2016 + sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$script" + + # Fix Node path on Windows. + sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$script" + sed -i.bak 's/%ROOT_DIR%\\out/%VSROOT_DIR%\\out/g' "$script" + sed -i.bak 's/%ROOT_DIR%\\node.exe/%ROOT_DIR%\\lib\\node.exe/g' "$script" + + chmod +x "$script" + rm "$script.bak" +} + +copy-bin-script() { + cp "lib/vscode/resources/server/bin/$1" "lib/vscode-reh-web-$VSCODE_TARGET/bin/$1" + fix-bin-script "$1" +} + +main() { + cd "$(dirname "${0}")/../.." + + source ./ci/lib.sh + + # Set the commit Code will embed into the product.json. We need to do this + # since Code tries to get the commit from the `.git` directory which will fail + # as it is a submodule. + # + # Also, we use code-server's commit rather than VS Code's otherwise it would + # not update when only our patch files change, and that will cause caching + # issues where the browser keeps using outdated code. + export BUILD_SOURCEVERSION + BUILD_SOURCEVERSION=$(git rev-parse HEAD) + + pushd lib/vscode + + if [[ ! ${VERSION-} ]]; then + echo "VERSION not set. Please set before running this script:" + echo "VERSION='0.0.0' pnpm run build:vscode" + exit 1 + fi + + # Modify the product.json: + # - Add the date + # - Set the code-server name. + # - Add our links + # - Enable telemetry (this just makes telemetry available; telemetry can still + # be disabled by flag or setting) + # - Configure trusted extensions (since some, like github.copilot-chat, never + # ask to be trusted and this is the only way to get auth working). + # - Make Typescript server plugins run in the workspace. We build the remote + # server version, so there is no browser distribution, and this key is not + # added automatically. + # + # This needs to be done before building as Code will read this file and embed + # it into the client-side code. + git checkout product.json # Reset in case the script exited early. + cp product.json product.original.json # Since jq has no inline edit. + jq --slurp '.[0] * .[1]' product.original.json <( + cat << EOF + { + "enableTelemetry": true, + "quality": "stable", + "codeServerVersion": "$VERSION", + "nameShort": "code-server", + "nameLong": "code-server", + "applicationName": "code-server", + "dataFolderName": ".code-server", + "win32MutexName": "codeserver", + "licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE", + "win32DirName": "code-server", + "win32NameVersion": "code-server", + "win32AppUserModelId": "coder.code-server", + "win32ShellNameShort": "c&ode-server", + "darwinBundleIdentifier": "com.coder.code.server", + "linuxIconName": "com.coder.code.server", + "reportIssueUrl": "https://github.com/coder/code-server/issues/new", + "documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode", + "keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143", + "keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144", + "keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145", + "introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146", + "tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118", + "newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter", + "linkProtectionTrustedDomains": [ + "https://open-vsx.org" + ], + "trustedExtensionAuthAccess": [ + "vscode.git", "vscode.github", + "github.vscode-pull-request-github", + "github.copilot", "github.copilot-chat" + ], + "aiConfig": { + "ariaKey": "code-server" + }, + "extensionPointExtensionKind": { + "typescriptServerPlugins": ["workspace"] + } + } +EOF + ) > product.json + + + VSCODE_QUALITY=stable pnpm run gulp compile-copilot-extension-full-build + + pnpm run gulp core-ci + pnpm run gulp "vscode-reh-web-$VSCODE_TARGET${MINIFY:+-min}-ci" + + # Reset so if you develop after building you will not be stuck with the wrong + # commit (the dev client will use `oss-dev` but the dev server will still use + # product.json which will have `stable-$commit`). + git checkout product.json + + popd + + pushd "lib/vscode-reh-web-$VSCODE_TARGET" + # Make sure Code took the version we set in the environment variable. Not + # having a version will break display languages. + if ! jq -e .commit product.json; then + echo "'commit' is missing from product.json" + exit 1 + fi + popd + + # Set vars and fix paths. + case $OS in + windows) + fix-bin-script remote-cli/code-server.cmd + fix-bin-script helpers/browser.cmd + ;; + *) + fix-bin-script remote-cli/code-server + fix-bin-script helpers/browser.sh + ;; + esac + + # Include bin scripts for other platforms so we can use the right one in the + # NPM post-install. + + # These provide a `code-server` command in the integrated terminal to open + # files in the current instance. + copy-bin-script remote-cli/code-darwin.sh + copy-bin-script remote-cli/code-linux.sh + copy-bin-script remote-cli/code.cmd + + # These provide a way for terminal applications to open browser windows. + copy-bin-script helpers/browser-darwin.sh + copy-bin-script helpers/browser-linux.sh + copy-bin-script helpers/browser.cmd +} + +main "$@" diff --git a/ci/build/clean.sh b/ci/build/clean.sh new file mode 100755 index 000000000000..9d90836a36f6 --- /dev/null +++ b/ci/build/clean.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "${0}")/../.." + source ./ci/lib.sh + + git clean -Xffd +} + +main "$@" diff --git a/ci/build/code-server-nfpm.sh b/ci/build/code-server-nfpm.sh new file mode 100755 index 000000000000..e12f493ba92c --- /dev/null +++ b/ci/build/code-server-nfpm.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +exec /usr/lib/code-server/bin/code-server "$@" diff --git a/ci/build/code-server-user.service b/ci/build/code-server-user.service new file mode 100644 index 000000000000..a2f48e938e55 --- /dev/null +++ b/ci/build/code-server-user.service @@ -0,0 +1,11 @@ +[Unit] +Description=code-server +After=network.target + +[Service] +Type=exec +ExecStart=/usr/bin/code-server +Restart=always + +[Install] +WantedBy=default.target diff --git a/ci/build/code-server.cmd b/ci/build/code-server.cmd new file mode 100644 index 000000000000..1b6a5b2ac1e5 --- /dev/null +++ b/ci/build/code-server.cmd @@ -0,0 +1,8 @@ +@echo off + +rem This script is intended to be bundled into the standalone releases. +rem Runs code-server with the bundled node binary. + +setlocal +set "ROOT=%~dp0.." +"%ROOT%\lib\node.exe" "%ROOT%" %* diff --git a/ci/build/code-server.sh b/ci/build/code-server.sh new file mode 100755 index 000000000000..801835ea843b --- /dev/null +++ b/ci/build/code-server.sh @@ -0,0 +1,28 @@ +#!/bin/sh +set -eu + +# This script is intended to be bundled into the standalone releases. +# Runs code-server with the bundled node binary. + +_realpath() { + # See https://github.com/coder/code-server/issues/1537 on why no realpath or readlink -f. + + script="$1" + cd "$(dirname "$script")" + + while [ -L "$(basename "$script")" ]; do + script="$(readlink "$(basename "$script")")" + cd "$(dirname "$script")" + done + + echo "$PWD/$(basename "$script")" +} + +root() { + script="$(_realpath "$0")" + bin_dir="$(dirname "$script")" + dirname "$bin_dir" +} + +ROOT="$(root)" +exec "$ROOT/lib/node" "$ROOT" "$@" diff --git a/ci/build/code-server@.service b/ci/build/code-server@.service new file mode 100644 index 000000000000..bfb62d78dea0 --- /dev/null +++ b/ci/build/code-server@.service @@ -0,0 +1,12 @@ +[Unit] +Description=code-server +After=network.target + +[Service] +Type=exec +ExecStart=/usr/bin/code-server +Restart=always +User=%i + +[Install] +WantedBy=default.target diff --git a/ci/build/nfpm.yaml b/ci/build/nfpm.yaml new file mode 100644 index 000000000000..9c672de0325e --- /dev/null +++ b/ci/build/nfpm.yaml @@ -0,0 +1,25 @@ +name: "code-server" +arch: "${NFPM_ARCH}" +platform: "linux" +version: "v${VERSION}" +section: "devel" +priority: "optional" +maintainer: "Asher " +description: | + Run VS Code in the browser. +vendor: "Coder" +homepage: "https://github.com/coder/code-server" +license: "MIT" + +contents: + - src: ./ci/build/code-server-nfpm.sh + dst: /usr/bin/code-server + + - src: ./ci/build/code-server@.service + dst: /usr/lib/systemd/system/code-server@.service + + - src: ./ci/build/code-server-user.service + dst: /usr/lib/systemd/user/code-server.service + + - src: ./release/* + dst: /usr/lib/code-server diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh new file mode 100755 index 000000000000..93d6b23b41f5 --- /dev/null +++ b/ci/build/npm-postinstall.sh @@ -0,0 +1,134 @@ +#!/usr/bin/env sh +set -eu + +# Copied from ../lib.sh except we do not rename Darwin and we do not need to +# detect Alpine. +os() { + osname=$(uname | tr '[:upper:]' '[:lower:]') + case $osname in + cygwin* | mingw*) osname="windows" ;; + esac + echo "$osname" +} + +# Create a symlink at $2 pointing to $1 on any platform. Anything that +# currently exists at $2 will be deleted. +symlink() { + source="$1" + dest="$2" + rm -rf "$dest" + case $OS in + windows) cmd //c mklink //J "$dest" "$source" ;; + *) ln -s "$source" "$dest" ;; + esac +} + +# Make a symlink at bin/$1/$3 pointing to the platform-specific version of the +# script in $2. The extension of the link will be .cmd for Windows otherwise it +# will be whatever is in $4 (or no extension if $4 is not set). +symlink_bin_script() { + oldpwd="$(pwd)" + cd "bin/$1" + source="$2" + dest="$3" + ext="${4-}" + case $OS in + windows) symlink "$source.cmd" "$dest.cmd" ;; + darwin | macos) symlink "$source-darwin.sh" "$dest$ext" ;; + *) symlink "$source-linux.sh" "$dest$ext" ;; + esac + cd "$oldpwd" +} + +command_exists() { + if [ ! "$1" ]; then return 1; fi + command -v "$@" > /dev/null +} + +is_root() { + if command_exists id && [ "$(id -u)" = 0 ]; then + return 0 + fi + return 1 +} + +OS="$(os)" + +main() { + # Grabs the major version of node from $npm_config_user_agent which looks like + # yarn/1.21.1 npm/? node/v14.2.0 darwin x64 + major_node_version=$(echo "$npm_config_user_agent" | sed -n 's/.*node\/v\([^.]*\).*/\1/p') + + if [ -n "${FORCE_NODE_VERSION:-}" ]; then + echo "WARNING: Overriding required Node.js version to v$FORCE_NODE_VERSION" + echo "This could lead to broken functionality, and is unsupported." + echo "USE AT YOUR OWN RISK!" + fi + + if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-24}" ]; then + echo "ERROR: code-server currently requires node v24." + if [ -n "${FORCE_NODE_VERSION:-}" ]; then + echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION." + fi + echo "We have detected that you are on node v$major_node_version" + echo "You can override this version check by setting \$FORCE_NODE_VERSION," + echo "but configurations that do not use the same node version are unsupported." + exit 1 + fi + + + if ! vscode_install; then + echo "You may not have the required dependencies to build the native modules." + echo "Please see https://github.com/coder/code-server/blob/main/docs/npm.md" + exit 1 + fi + + if [ -n "${FORCE_NODE_VERSION:-}" ]; then + echo "WARNING: The required Node.js version was overriden to v$FORCE_NODE_VERSION" + echo "This could lead to broken functionality, and is unsupported." + echo "USE AT YOUR OWN RISK!" + fi +} + +install_with_package_manager() { + echo "User agent: ${npm_config_user_agent-none}" + # For development we enforce pnpm, but for installing the package as an + # end-user we want to keep using whatever package manager is in use. + case "${npm_config_user_agent-}" in + npm*) + if ! npm install --omit=dev; then + return 1 + fi + ;; + yarn*) + if ! yarn --production --no-default-rc; then + return 1 + fi + ;; + *) + echo "Unsupported package manager is being used to install code-server" + exit 1 + ;; + esac + return 0 +} + +vscode_install() { + echo 'Installing Code dependencies...' + cd lib/vscode + if ! install_with_package_manager; then + return 1 + fi + + symlink_bin_script remote-cli code code-server + symlink_bin_script helpers browser browser .sh + + cd extensions + if ! install_with_package_manager; then + return 1 + fi + + return 0 +} + +main "$@" diff --git a/ci/build/update-repo.sh b/ci/build/update-repo.sh new file mode 100755 index 000000000000..0f1924fa91a4 --- /dev/null +++ b/ci/build/update-repo.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +# Given versions $1 and $2 figure out the first component that is different +# (major, minor, patch). +function find_version_diff() { + # shellcheck disable=SC2206 + local a=( ${1//./ } ) + # shellcheck disable=SC2206 + local b=( ${2//./ } ) + + if [[ ${a[0]} != "${b[0]}" ]] ; then + echo major + elif [[ ${a[1]} != "${b[1]}" ]] ; then + echo minor + else + echo patch + fi +} + +# Bump $1 by the bump type (major, minor, patch) in $2. +function bump_version() { + # shellcheck disable=SC2206 + local a=( ${1//./ } ) + case $2 in + major) + ((a[0]++)) + a[1]=0 + a[2]=0 + ;; + minor) + ((a[1]++)) + a[2]=0 + ;; + *) + ((a[2]++)) + ;; + esac + echo "${a[0]}.${a[1]}.${a[2]}" +} + +function update_helm() { + local chart_version + chart_version=$(yq .version ci/helm-chart/Chart.yaml) + local app_version + app_version=$(yq .appVersion ci/helm-chart/Chart.yaml) + local image_version + image_version=$(yq .image.tag ci/helm-chart/values.yaml) + + local bump_type + bump_type=$(find_version_diff "$app_version" "$version") + local chart_version_bump + chart_version_bump=$(bump_version "$chart_version" "$bump_type") + + # Use sed to replace because yq will reformat. + echo "Bumping version from $chart_version to $chart_version_bump..." + sed -i.bak "s/^version: $chart_version\$/version: $chart_version_bump/" ci/helm-chart/Chart.yaml + + echo "Bumping app version from $app_version to $version..." + sed -i.bak "s/^appVersion: .\+\$/appVersion: $version/" ci/helm-chart/Chart.yaml + + echo "Bumping image version from $image_version to $version..." + sed -i.bak "s/^ tag: .\+\$/ tag: '$version'/" ci/helm-chart/values.yaml +} + +function update_changelog() { + local date + date=$(printf '%(%Y-%m-%d)T\n' -1) + local link="https://github.com/coder/code-server/releases/tag/v$version" + sed -i.bak "s|## Unreleased|## Unreleased\n\n## [$version]($link) - $date|" CHANGELOG.md +} + +function main() { + cd "$(dirname "${0}")/../.." + + source ./ci/lib.sh + + local version=${VERSION:-$(git describe --tags)} + version="${version#v}" + + declare -a steps + + steps+=( + "Update Helm chart" "update_helm" + "Update changelog" "update_changelog" + ) + + # Even if a step failed, still output the last checkmark. + run-steps "${steps[@]}" || true + + # This step is always manual. + echo "- [ ] https://github.com/coder/code-server-aur/pulls" >> .cache/checklist +} + +main "$@" diff --git a/ci/build/update-vscode.sh b/ci/build/update-vscode.sh new file mode 100755 index 000000000000..cef74d800a51 --- /dev/null +++ b/ci/build/update-vscode.sh @@ -0,0 +1,184 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +function unapply_patches() { + local -i exit_code=0 + quiet quilt pop -af 2>&1 || exit_code=$? + case $exit_code in + # Sucessfully unapplied. + 0) ;; + # No more patches to unapply. + 2) ;; + # Some error. + *) return $exit_code ;; + esac +} + +function apply_patches() { + local -i exit_code=0 + quiet quilt push -a 2>&1 || exit_code=$? + case $exit_code in + # Sucessfully applied. + 0) ;; + # No more patches to apply. + 2) ;; + # Some error. + *) return $exit_code ;; + esac +} + +function update_vscode() { + pushd lib/vscode + if ! git checkout 2>&1 "$target_vscode_version" ; then + echo "$target_vscode_version does not exist locally, fetching..." + git fetch --all --prune --tags + echo "Checking out $target_vscode_version again..." + git checkout "$target_vscode_version" + fi + popd +} + +function refresh_patches() { + local -i exit_code=0 + while quiet quilt push 2>&1 ; ! (( exit_code=$? )) ; do + quilt refresh 2>&1 + done + case $exit_code in + # No more patches to apply. + 2) ;; + # Some error. + *) return $exit_code ;; + esac +} + +function update_node() { + local node_version + node_version=$(cat .node-version) + local target_node_version + target_node_version=$(jq --raw-output .nativeBuild.target lib/vscode/remote/package.json) + if [[ $node_version == "$target_node_version" ]] ; then + echo "Already set to $target_node_version" + else + echo "Updating from $node_version to $target_node_version..." + echo "$target_node_version" > .node-version + fi +} + +function update_package_manager() { + local manager_version + manager_version=$(jq --raw-output .packageManager package.json) + local target_manager_version + target_manager_version=$(jq --raw-output .packageManager lib/vscode/remote/package.json) + if [[ $manager_version == "$target_manager_version" ]] ; then + echo "Already set to $target_manager_version" + else + echo "Updating from $manager_version to $target_manager_version..." + sed -i.bak "s#$manager_version#$target_manager_version#" package.json + fi +} + +function get-webview-script-hash() { + local html + html=$(<"$1") + local start_tag='" + html=${html##*"$start_tag"} + html=${html%%"$end_tag"*} + echo -n "$html" | openssl sha256 -binary | openssl base64 +} + +function delete_csp() { + quilt delete csp-hashes.diff || true +} + +function update_csp() { + apply_patches + + local files=( + ./lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html + ./lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html + ) + + quilt new csp-hashes.diff + + local file + for file in "${files[@]}" ; do + quilt add "$file" + + local hash + hash=$(get-webview-script-hash "$file") + echo "Calculated hash as $hash" + # Use octothorpe as a delimiter since the hash may contain a slash. + sed -i.bak "s#'sha256-[^']\+'#'sha256-$hash'#" "$file" + # For the web worker extension host iframe, there is a matching sha in the + # web server. + if [[ $file == */webWorkerExtensionHostIframe.html ]] ; then + quilt add ./lib/vscode/src/vs/server/node/webClientServer.ts + sed -i.bak \ + "s#webWorkerExtensionHostIframeScriptSHA = 'sha256-[^']\+'#webWorkerExtensionHostIframeScriptSHA = 'sha256-$hash'#" \ + ./lib/vscode/src/vs/server/node/webClientServer.ts + fi + done + + quilt refresh +} + +function add_changelog() { + local file=CHANGELOG.md + if grep --quiet "Code $target_vscode_version" "$file" ; then + echo "Changelog for $target_vscode_version already exists" + else + # TODO: This is not exactly robust. In particular, it needs to handle if + # there is already a "changed" section. + sed -i.bak "s/## Unreleased/## Unreleased\n\nCode v$target_vscode_version\n\n### Changed\n\n- Update to Code $target_vscode_version/" "$file" + fi +} + +function main() { + cd "$(dirname "${0}")/../.." + + source ./ci/lib.sh + + declare -a steps + + # Hashes are always regenerated to avoid having to resolve conflicts.. + steps+=("Revert CSP hashes" "delete_csp") + + # If version is not set, assume we are already at the target version and the + # user is just trying to resolve conflics. + local target_vscode_version + if [[ ${VERSION-} ]] ; then + # Removing patches only needs to be done locally; in CI we start from a + # fresh clone each time. + if [[ ! ${CI-} ]] ; then + steps+=("Unapplying patches" "unapply_patches") + fi + target_vscode_version="${VERSION#v}" + steps+=( + "Update Code to $target_vscode_version" "update_vscode" + "Refresh Code patches" "refresh_patches" + ) + else + target_vscode_version="$(git -C lib/vscode describe --tags --exact-match)" + echo "Detected Code version $target_vscode_version" + fi + + steps+=( + "Update Node version" "update_node" + "Update package manager version" "update_package_manager" + "Regenerate CSP hashes" "update_csp" + "Add changelog note" "add_changelog" + ) + + # Even if a step failed, still output the last checkmark. + run-steps "${steps[@]}" || true + + # This step is always manual. + echo "- [ ] Verify changelog" >> .cache/checklist +} + +main "$@" diff --git a/ci/dev/doctoc.sh b/ci/dev/doctoc.sh new file mode 100755 index 000000000000..f562de7f38e3 --- /dev/null +++ b/ci/dev/doctoc.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + + doctoc --title '# FAQ' docs/FAQ.md > /dev/null + doctoc --title '# Setup Guide' docs/guide.md > /dev/null + doctoc --title '# Install' docs/install.md > /dev/null + doctoc --title '# npm Install Requirements' docs/npm.md > /dev/null + doctoc --title '# Contributing' docs/CONTRIBUTING.md > /dev/null + doctoc --title '# Maintaining' docs/MAINTAINING.md > /dev/null + doctoc --title '# Contributor Covenant Code of Conduct' docs/CODE_OF_CONDUCT.md > /dev/null + doctoc --title '# iPad' docs/ipad.md > /dev/null + doctoc --title '# Termux' docs/termux.md > /dev/null + + if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then + echo "Files need generation or are formatted incorrectly:" + git -c color.ui=always status | grep --color=no '\[31m' + echo "Please run the following locally:" + echo " pnpm run doctoc" + exit 1 + fi +} + +main "$@" diff --git a/ci/dev/gen_icons.sh b/ci/dev/gen_icons.sh new file mode 100755 index 000000000000..39d509bc4f4b --- /dev/null +++ b/ci/dev/gen_icons.sh @@ -0,0 +1,50 @@ +#!/bin/sh +set -eu + +# Generate icons from a single favicon.svg. favicon.svg should have no fill +# colors set. +main() { + cd src/browser/media + + # We need .ico for backwards compatibility. The other two are the only icon + # sizes required by Chrome and we use them for stuff like apple-touch-icon as + # well. https://web.dev/add-manifest/ + # + # This should be enough and we can always add more if there are problems. + # + # -quiet to avoid https://github.com/ImageMagick/ImageMagick/issues/884 + # -background defaults to white but we want it transparent. + # -density somehow makes the image both sharper and smaller in file size. + # + # https://imagemagick.org/script/command-line-options.php#background + convert -quiet -background transparent \ + -resize 256x256 -density 256x256 \ + favicon.svg favicon.ico + + # Generate PWA icons. There should be enough padding to support masking. + convert -quiet -border 60x60 -bordercolor white -background white \ + -resize 192x192 -density 192x192 \ + favicon.svg pwa-icon-maskable-192.png + convert -quiet -border 160x160 -bordercolor white -background white \ + -resize 512x512 -density 512x512 \ + favicon.svg pwa-icon-maskable-512.png + + # Generate non-maskable PWA icons. + magick pwa-icon-maskable-192.png \ + \( +clone -threshold 101% -fill white -draw "roundRectangle 0,0 %[fx:int(w)],%[fx:int(h)] 50,50" \) \ + -channel-fx "| gray=>alpha" \ + pwa-icon-192.png + magick pwa-icon-maskable-512.png \ + \( +clone -threshold 101% -fill white -draw "roundRectangle 0,0 %[fx:int(w)],%[fx:int(h)] 100,100" \) \ + -channel-fx "| gray=>alpha" \ + pwa-icon-512.png + + # The following adds dark mode support for the favicon as + # favicon-dark-support.svg There is no similar capability for pwas or .ico so + # we can only add support to the svg. + favicon_dark_style="" + cp favicon.svg favicon-dark-support.svg + sed "s% favicon-dark-support.svg +} + +main "$@" diff --git a/ci/dev/lint-scripts.sh b/ci/dev/lint-scripts.sh new file mode 100755 index 000000000000..742030affc62 --- /dev/null +++ b/ci/dev/lint-scripts.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode') +} + +main "$@" diff --git a/ci/dev/postinstall.sh b/ci/dev/postinstall.sh new file mode 100755 index 000000000000..8e4268f46acb --- /dev/null +++ b/ci/dev/postinstall.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Install dependencies in $1. +install-deps() { + local args=(install) + if [[ ${CI-} ]]; then + args+=(--frozen-lockfile) + fi + # If there is no package.json then pnpm will look upward and end up installing + # from the root resulting in an infinite loop (this can happen if you have not + # checked out the submodule yet for example). + if [[ ! -f "$1/package.json" ]]; then + echo "$1/package.json is missing; did you run git submodule update --init?" + exit 1 + fi + pushd "$1" + echo "Running 'pnpm ${args[*]}' in $PWD" + pnpm "${args[@]}" + popd +} + +main() { + cd "$(dirname "$0")/../.." + source ./ci/lib.sh + + install-deps test + install-deps test/e2e/extensions/test-extension + # We don't need these when running the integration tests + # so you can pass SKIP_SUBMODULE_DEPS + if [[ ! ${SKIP_SUBMODULE_DEPS-} ]]; then + install-deps lib/vscode + fi +} + +main "$@" diff --git a/ci/dev/preinstall.js b/ci/dev/preinstall.js new file mode 100644 index 000000000000..0e2f82ff1c9e --- /dev/null +++ b/ci/dev/preinstall.js @@ -0,0 +1,3 @@ +if (!/^pnpm\/(\d+)\.(\d+)\.(\d+)/.exec(process.env.npm_config_user_agent)) { + throw new Error("`yarn` and `npm` are no longer supported; please use `pnpm install` instead") +} diff --git a/ci/dev/test-e2e.sh b/ci/dev/test-e2e.sh new file mode 100755 index 000000000000..bae905373d9a --- /dev/null +++ b/ci/dev/test-e2e.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -euo pipefail + +help() { + echo >&2 " You can build with 'pnpm run watch' or you can build a release" + echo >&2 " For example: 'pnpm run build && pnpm run build:vscode && KEEP_MODULES=1 pnpm run release'" + echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e'" + echo >&2 " You can manually run that release with 'node ./release'" +} + +main() { + cd "$(dirname "$0")/../.." + + source ./ci/lib.sh + + pushd test/e2e/extensions/test-extension + echo "Building test extension" + pnpm run build + popd + + local dir="$PWD" + if [[ ! ${CODE_SERVER_TEST_ENTRY-} ]]; then + echo "Set CODE_SERVER_TEST_ENTRY to test another build of code-server" + else + pushd "$CODE_SERVER_TEST_ENTRY" + dir="$PWD" + popd + fi + + echo "Testing build in '$dir'" + + # Simple sanity checks to see that we've built. There could still be things + # wrong (native modules version issues, incomplete build, etc). + if [[ ! -d $dir/out ]]; then + echo >&2 "No code-server build detected" + help + exit 1 + fi + + if [[ ! -d $dir/lib/vscode/out ]]; then + echo >&2 "No VS Code build detected" + help + exit 1 + fi + + cd test + ./node_modules/.bin/playwright test "$@" +} + +main "$@" diff --git a/ci/dev/test-integration.sh b/ci/dev/test-integration.sh new file mode 100755 index 000000000000..ed47f9322ea1 --- /dev/null +++ b/ci/dev/test-integration.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -euo pipefail + +help() { + echo >&2 " You can build the release with 'KEEP_MODULES=1 pnpm run release'" + echo >&2 " Or you can pass in a custom path." + echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' pnpm run test:integration" +} + +# Make sure a code-server release works. You can pass in the path otherwise it +# will look for $RELEASE_PATH in the current directory. +# +# This is to make sure we don't have Node version errors or any other +# compilation-related errors. +main() { + cd "$(dirname "$0")/../.." + + source ./ci/lib.sh + + local path="$RELEASE_PATH/bin/code-server" + if [[ ! ${CODE_SERVER_PATH-} ]]; then + echo "Set CODE_SERVER_PATH to test another build of code-server" + else + path="$CODE_SERVER_PATH" + fi + + echo "Running tests with code-server binary: '$path'" + + if [[ ! -f $path ]]; then + echo >&2 "No code-server build detected" + echo >&2 "Looked in $path" + help + exit 1 + fi + + CODE_SERVER_PATH="$path" ./test/node_modules/.bin/jest "$@" \ + --coverage=false \ + --testRegex "./test/integration" \ + --testPathIgnorePatterns "./test/integration/fixtures" +} + +main "$@" diff --git a/ci/dev/test-native.sh b/ci/dev/test-native.sh new file mode 100755 index 000000000000..01b9695bc2e4 --- /dev/null +++ b/ci/dev/test-native.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -euo pipefail + +help() { + echo >&2 " You can build the release with 'KEEP_MODULES=1 pnpm run release'" + echo >&2 " Or you can pass in a custom path." + echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' pnpm run test:integration" +} + +# Make sure a code-server release works. You can pass in the path otherwise it +# will look for $RELEASE_PATH in the current directory. +# +# This is to make sure we don't have Node version errors or any other +# compilation-related errors. +main() { + cd "$(dirname "$0")/../.." + + source ./ci/lib.sh + + local path="$RELEASE_PATH/bin/code-server" + if [[ ! ${CODE_SERVER_PATH-} ]]; then + echo "Set CODE_SERVER_PATH to test another build of code-server" + else + path="$CODE_SERVER_PATH" + fi + + echo "Running tests with code-server binary: '$path'" + + if [[ ! -f $path ]]; then + echo >&2 "No code-server build detected" + echo >&2 "Looked in $path" + help + exit 1 + fi + + CODE_SERVER_PATH="$path" ./test/node_modules/.bin/jest "$@" \ + --coverage=false \ + --testRegex "./test/integration/help.test.ts" +} + +main "$@" diff --git a/ci/dev/test-scripts.sh b/ci/dev/test-scripts.sh new file mode 100755 index 000000000000..ebe1efa8ed22 --- /dev/null +++ b/ci/dev/test-scripts.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + bats ./test/scripts +} + +main "$@" diff --git a/ci/dev/test-unit.sh b/ci/dev/test-unit.sh new file mode 100755 index 000000000000..15fd2030ea59 --- /dev/null +++ b/ci/dev/test-unit.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + + source ./ci/lib.sh + + # We must keep jest in a sub-directory. See ../../test/package.json for more + # information. We must also run it from the root otherwise coverage will not + # include our source files. + ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" +} + +main "$@" diff --git a/ci/dev/watch.ts b/ci/dev/watch.ts new file mode 100644 index 000000000000..0bacfcd83cd8 --- /dev/null +++ b/ci/dev/watch.ts @@ -0,0 +1,143 @@ +import { spawn, ChildProcess } from "child_process" +import * as path from "path" +import { onLine, OnLineCallback } from "../../src/node/util" + +interface DevelopmentCompilers { + [key: string]: ChildProcess | undefined + vscode: ChildProcess + vscodeWebExtensions: ChildProcess + codeServer: ChildProcess + plugins: ChildProcess | undefined +} + +class Watcher { + private rootPath = path.resolve(process.cwd()) + private readonly paths = { + /** Path to uncompiled VS Code source. */ + vscodeDir: path.join(this.rootPath, "lib/vscode"), + pluginDir: process.env.PLUGIN_DIR, + } + + //#region Web Server + + /** Development web server. */ + private webServer: ChildProcess | undefined + + private reloadWebServer = (): void => { + if (this.webServer) { + this.webServer.kill() + } + + // Pass CLI args, save for `node` and the initial script name. + const args = process.argv.slice(2) + this.webServer = spawn("node", [path.join(this.rootPath, "out/node/entry.js"), ...args]) + onLine(this.webServer, (line) => console.log("[code-server]", line)) + const { pid } = this.webServer + + this.webServer.on("exit", () => console.log("[code-server]", `Web process ${pid} exited`)) + + console.log("\n[code-server]", `Spawned web server process ${pid}`) + } + + //#endregion + + //#region Compilers + + private readonly compilers: DevelopmentCompilers = { + codeServer: spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath }), + vscode: spawn("pnpm", ["run", "watch"], { cwd: this.paths.vscodeDir }), + vscodeWebExtensions: spawn("pnpm", ["run", "watch-web"], { cwd: this.paths.vscodeDir }), + plugins: this.paths.pluginDir + ? spawn("pnpm", ["run", "build", "--watch"], { cwd: this.paths.pluginDir }) + : undefined, + } + + public async initialize(): Promise { + for (const event of ["SIGINT", "SIGTERM"]) { + process.on(event, () => this.dispose(0)) + } + + for (const [processName, devProcess] of Object.entries(this.compilers)) { + if (!devProcess) continue + + devProcess.on("exit", (code) => { + console.log(`[${processName}]`, "Terminated unexpectedly") + this.dispose(code) + }) + + if (devProcess.stderr) { + devProcess.stderr.on("data", (d: string | Uint8Array) => process.stderr.write(d)) + } + } + + onLine(this.compilers.vscode, this.parseVSCodeLine) + onLine(this.compilers.codeServer, this.parseCodeServerLine) + + if (this.compilers.plugins) { + onLine(this.compilers.plugins, this.parsePluginLine) + } + } + + //#endregion + + //#region Line Parsers + + private parseVSCodeLine: OnLineCallback = (strippedLine, originalLine) => { + if (!strippedLine.length) return + + console.log("[Code OSS]", originalLine) + + if (strippedLine.includes("Finished compilation with")) { + console.log("[Code OSS] ✨ Finished compiling! ✨", "(Refresh your web browser ♻️)") + this.reloadWebServer() + } + } + + private parseCodeServerLine: OnLineCallback = (strippedLine, originalLine) => { + if (!strippedLine.length) return + + console.log("[Compiler][code-server]", originalLine) + + if (strippedLine.includes("Watching for file changes")) { + console.log("[Compiler][code-server]", "Finished compiling!", "(Refresh your web browser ♻️)") + this.reloadWebServer() + } + } + + private parsePluginLine: OnLineCallback = (strippedLine, originalLine) => { + if (!strippedLine.length) return + + console.log("[Compiler][Plugin]", originalLine) + + if (strippedLine.includes("Watching for file changes...")) { + this.reloadWebServer() + } + } + + //#endregion + + //#region Utilities + + private dispose(code: number | null): void { + for (const [processName, devProcess] of Object.entries(this.compilers)) { + console.log(`[${processName}]`, "Killing...\n") + devProcess?.removeAllListeners() + devProcess?.kill() + } + process.exit(typeof code === "number" ? code : 0) + } + + //#endregion +} + +async function main(): Promise { + try { + const watcher = new Watcher() + await watcher.initialize() + } catch (error: any) { + console.error(error.message) + process.exit(1) + } +} + +main() diff --git a/ci/helm-chart/.helmignore b/ci/helm-chart/.helmignore new file mode 100644 index 000000000000..0e8a0eb36f4c --- /dev/null +++ b/ci/helm-chart/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ci/helm-chart/Chart.yaml b/ci/helm-chart/Chart.yaml new file mode 100644 index 000000000000..b7e0561c58f0 --- /dev/null +++ b/ci/helm-chart/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: code-server +description: A Helm chart for coder/code-server + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 3.60.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 4.146.0 diff --git a/ci/helm-chart/templates/NOTES.txt b/ci/helm-chart/templates/NOTES.txt new file mode 100644 index 000000000000..45c9aed3881d --- /dev/null +++ b/ci/helm-chart/templates/NOTES.txt @@ -0,0 +1,24 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "code-server.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "code-server.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "code-server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward --namespace {{ .Release.Namespace }} service/{{ include "code-server.fullname" . }} 8080:http +{{- end }} + +Administrator credentials: + + Password: echo $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "code-server.fullname" . }} -o jsonpath="{.data.password}" | base64 --decode) diff --git a/ci/helm-chart/templates/_helpers.tpl b/ci/helm-chart/templates/_helpers.tpl new file mode 100644 index 000000000000..bb36e8c21972 --- /dev/null +++ b/ci/helm-chart/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "code-server.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "code-server.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "code-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "code-server.labels" -}} +helm.sh/chart: {{ include "code-server.chart" . }} +{{ include "code-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "code-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "code-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "code-server.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "code-server.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/ci/helm-chart/templates/deployment.yaml b/ci/helm-chart/templates/deployment.yaml new file mode 100644 index 000000000000..18bece028fc6 --- /dev/null +++ b/ci/helm-chart/templates/deployment.yaml @@ -0,0 +1,194 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "code-server.fullname" . }} + labels: + {{- include "code-server.labels" . | nindent 4 }} + {{- if .Values.annotations }} + annotations: {{- toYaml .Values.annotations | nindent 4 }} + {{- end }} +spec: + {{- if ne .Values.replicaCount nil }} + replicas: {{ .Values.replicaCount }} + {{- end }} + strategy: + type: Recreate + selector: + matchLabels: + {{- include "code-server.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "code-server.selectorLabels" . | nindent 8 }} + {{- if .Values.podAnnotations }} + annotations: {{- toYaml .Values.podAnnotations | nindent 8 }} + {{- end }} + spec: + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} + {{- if .Values.hostnameOverride }} + hostname: {{ .Values.hostnameOverride }} + {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + {{- end }} + {{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) .Values.extraInitContainers }} + initContainers: + {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} + - name: init-chmod-data + image: busybox:latest + imagePullPolicy: IfNotPresent + command: + - sh + - -c + - | + chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} /home/coder + securityContext: + runAsUser: {{ .Values.volumePermissions.securityContext.runAsUser }} + volumeMounts: + - name: data + mountPath: /home/coder + {{- end }} +{{- if .Values.extraInitContainers }} +{{ tpl .Values.extraInitContainers . | indent 6}} +{{- end }} + {{- end }} + containers: +{{- if .Values.extraContainers }} +{{ tpl .Values.extraContainers . | indent 8}} +{{- end }} + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.securityContext.enabled }} + securityContext: + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} + {{- if .Values.lifecycle.enabled }} + lifecycle: + {{- if .Values.lifecycle.postStart }} + postStart: + {{ toYaml .Values.lifecycle.postStart | nindent 14 }} + {{- end }} + {{- if .Values.lifecycle.preStop }} + preStop: + {{ toYaml .Values.lifecycle.preStop | nindent 14 }} + {{- end }} + {{- end }} + env: + {{- if .Values.extraVars }} +{{ toYaml .Values.extraVars | indent 10 }} + {{- end }} + - name: PASSWORD + valueFrom: + secretKeyRef: + {{- if .Values.existingSecret }} + name: {{ .Values.existingSecret }} + {{- else }} + name: {{ template "code-server.fullname" . }} + {{- end }} + key: password + {{- if .Values.extraArgs }} + args: +{{ toYaml .Values.extraArgs | indent 10 }} + {{- end }} + volumeMounts: + - name: data + mountPath: /home/coder + {{- range .Values.extraConfigmapMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} + {{- range .Values.extraSecretMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} + {{- range .Values.extraVolumeMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + {{- range .Values.extraPorts }} + - name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol }} + {{- end }} + {{- if ne .Values.livenessProbe.enabled false }} + livenessProbe: + httpGet: + path: /healthz + port: http + {{- end }} + {{- if ne .Values.readinessProbe.enabled false }} + readinessProbe: + httpGet: + path: /healthz + port: http + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- tpl . $ | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ template "code-server.serviceAccountName" . }} + volumes: + - name: data + {{- if .Values.persistence.enabled }} + {{- if not .Values.persistence.hostPath }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (include "code-server.fullname" .) }} + {{- else }} + hostPath: + path: {{ .Values.persistence.hostPath }} + type: Directory + {{- end -}} + {{- else }} + emptyDir: {} + {{- end -}} + {{- range .Values.extraSecretMounts }} + - name: {{ .name }} + secret: + secretName: {{ .secretName }} + defaultMode: {{ .defaultMode }} + {{- end }} + {{- range .Values.extraConfigmapMounts }} + - name: {{ .name }} + configMap: + name: {{ .configMap }} + defaultMode: {{ .defaultMode }} + {{- end }} + {{- range .Values.extraVolumeMounts }} + - name: {{ .name }} + {{- if .existingClaim }} + persistentVolumeClaim: + claimName: {{ .existingClaim }} + {{- else if .hostPath }} + hostPath: + path: {{ .hostPath }} + type: Directory + {{- else }} + emptyDir: + {{- toYaml .emptyDir | nindent 10 }} + {{- end }} + {{- end }} diff --git a/ci/helm-chart/templates/ingress.yaml b/ci/helm-chart/templates/ingress.yaml new file mode 100644 index 000000000000..1da432074b29 --- /dev/null +++ b/ci/helm-chart/templates/ingress.yaml @@ -0,0 +1,63 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "code-server.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "code-server.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}} + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + pathType: Prefix + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- end }} + {{- end }} + {{- else -}} + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/ci/helm-chart/templates/pvc.yaml b/ci/helm-chart/templates/pvc.yaml new file mode 100644 index 000000000000..206b834e930d --- /dev/null +++ b/ci/helm-chart/templates/pvc.yaml @@ -0,0 +1,26 @@ +{{- if and (and .Values.persistence.enabled (not .Values.persistence.existingClaim)) (not .Values.persistence.hostPath) }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "code-server.fullname" . }} + namespace: {{ .Release.Namespace }} +{{- with .Values.persistence.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} + labels: + {{- include "code-server.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/ci/helm-chart/templates/secrets.yaml b/ci/helm-chart/templates/secrets.yaml new file mode 100644 index 000000000000..93e75800dffd --- /dev/null +++ b/ci/helm-chart/templates/secrets.yaml @@ -0,0 +1,17 @@ +{{- if not .Values.existingSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "code-server.fullname" . }} + annotations: + "helm.sh/hook": "pre-install" + labels: + {{- include "code-server.labels" . | nindent 4 }} +type: Opaque +data: + {{- if .Values.password }} + password: "{{ .Values.password | b64enc }}" + {{- else }} + password: "{{ randAlphaNum 24 | b64enc }}" + {{- end }} +{{- end }} diff --git a/ci/helm-chart/templates/service.yaml b/ci/helm-chart/templates/service.yaml new file mode 100644 index 000000000000..27c4cc49e299 --- /dev/null +++ b/ci/helm-chart/templates/service.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "code-server.fullname" . }} + labels: + {{- include "code-server.labels" . | nindent 4 }} + annotations: + {{- with .Values.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + {{- range .Values.extraPorts }} + - port: {{ .port }} + targetPort: {{ .port }} + protocol: {{ .protocol }} + name: {{ .name }} + {{- end }} + selector: + app.kubernetes.io/name: {{ include "code-server.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/ci/helm-chart/templates/serviceaccount.yaml b/ci/helm-chart/templates/serviceaccount.yaml new file mode 100644 index 000000000000..2fa308fec172 --- /dev/null +++ b/ci/helm-chart/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if or .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + {{- include "code-server.labels" . | nindent 4 }} + name: {{ template "code-server.serviceAccountName" . }} +{{- end -}} diff --git a/ci/helm-chart/templates/tests/test-connection.yaml b/ci/helm-chart/templates/tests/test-connection.yaml new file mode 100644 index 000000000000..dd81f8904e06 --- /dev/null +++ b/ci/helm-chart/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "code-server.fullname" . }}-test-connection" + labels: + {{- include "code-server.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "code-server.fullname" . }}:{{ .Values.service.port }}/healthz'] + restartPolicy: Never diff --git a/ci/helm-chart/values.yaml b/ci/helm-chart/values.yaml new file mode 100644 index 000000000000..cb776c167f30 --- /dev/null +++ b/ci/helm-chart/values.yaml @@ -0,0 +1,238 @@ +# Default values for code-server. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: codercom/code-server + tag: '4.146.0' + pullPolicy: Always + +# Specifies one or more secrets to be used when pulling images from a +# private container repository +# https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry +imagePullSecrets: [] +# - name: registry-creds + +nameOverride: "" +fullnameOverride: "" +hostnameOverride: "" + +# The existing secret to use for code-server authentication in the frontend. the password is stored in the secret under the key `password` +# existingSecret: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +# Specifies annotations for deployment +annotations: {} + +# code-server.labels -- The Deployment labels. See: +# https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +labels: {} + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +priorityClassName: "" + +service: + type: ClusterIP + port: 8080 + loadBalancerClass: null + annotations: {} + +ingress: + enabled: false + #annotations: + # kubernetes.io/tls-acme: "true" + #hosts: + # - host: code-server.example.loc + # paths: + # - / + ingressClassName: "" + #tls: + # - secretName: code-server + # hosts: + # - code-server.example.loc + +# Optional additional arguments +extraArgs: [] + # These are the arguments normally passed to code-server; run + # code-server --help for a list of available options. + # + # Each argument and parameter must have its own entry; if you use + # --param value on the command line, then enter it here as: + # + # - --param + # - value + # + # If you receive an error like "Unknown option --param value", it may be + # because both the parameter and value are specified as a single argument, + # rather than two separate arguments (e.g. "- --param value" on a line). + +# Optional additional environment variables +extraVars: [] +# - name: DISABLE_TELEMETRY +# value: "true" +# if dind is desired: +# - name: DOCKER_HOST +# value: "tcp://localhost:2376" + +## +## Init containers parameters: +## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup +## +volumePermissions: + enabled: true + securityContext: + runAsUser: 0 + +## Pod Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +## +securityContext: + enabled: true + fsGroup: 1000 + runAsUser: 1000 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 1000Mi + +livenessProbe: + enabled: true + +readinessProbe: + enabled: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +## Persist data to a persistent volume +persistence: + enabled: true + ## code-server data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 10Gi + annotations: {} + # existingClaim: "" + # hostPath: /data + +lifecycle: + enabled: false + # postStart: + # exec: + # command: + # - /bin/bash + # - -c + # - curl -s -L SOME_SCRIPT | bash + + # for dind, the following may be helpful + # postStart: + # exec: + # command: + # - /bin/sh + # - -c + # - | + # sudo apt-get update \ + # && sudo apt-get install -y docker.io + +## Enable an Specify container in extraContainers. +## This is meant to allow adding code-server dependencies, like docker-dind. +extraContainers: | +# If docker-dind is used, DOCKER_HOST env is mandatory to set in "extraVars" +# - name: docker-dind +# image: docker:28.3.2-dind +# imagePullPolicy: IfNotPresent +# resources: +# requests: +# cpu: 1 +# ephemeral-storage: "50Gi" +# memory: 10Gi +# securityContext: +# privileged: true +# procMount: Default +# env: +# - name: DOCKER_TLS_CERTDIR +# value: "" # disable TLS setup +# command: +# - dockerd +# - --host=unix:///var/run/docker.sock +# - --host=tcp://0.0.0.0:2376 + + +extraInitContainers: | +# - name: customization +# image: {{ .Values.image.repository }}:{{ .Values.image.tag }} +# imagePullPolicy: IfNotPresent +# env: +# - name: SERVICE_URL +# value: https://open-vsx.org/vscode/gallery +# - name: ITEM_URL +# value: https://open-vsx.org/vscode/item +# command: +# - sh +# - -c +# - | +# code-server --install-extension ms-python.python +# code-server --install-extension golang.Go +# volumeMounts: +# - name: data +# mountPath: /home/coder + +## Additional code-server secret mounts +extraSecretMounts: [] + # - name: secret-files + # mountPath: /etc/secrets + # subPath: private.key # (optional) + # secretName: code-server-secret-files + # readOnly: true + +## Additional code-server volume mounts +extraVolumeMounts: [] + # - name: extra-volume + # mountPath: /mnt/volume + # readOnly: true + # existingClaim: volume-claim + # hostPath: "" + # emptyDir: {} + +extraConfigmapMounts: [] + # - name: certs-configmap + # mountPath: /etc/code-server/ssl/ + # subPath: certificates.crt # (optional) + # configMap: certs-configmap + # readOnly: true + +extraPorts: [] + # - name: minecraft + # port: 25565 + # protocol: tcp diff --git a/ci/lib.sh b/ci/lib.sh new file mode 100755 index 000000000000..bd9c5c9c0c53 --- /dev/null +++ b/ci/lib.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash +set -euo pipefail + +pushd() { + builtin pushd "$@" > /dev/null +} + +popd() { + builtin popd > /dev/null +} + +vscode_version() { + jq -r .version lib/vscode/package.json +} + +os() { + osname=$(uname | tr '[:upper:]' '[:lower:]') + case $osname in + linux) + # Alpine's ldd doesn't have a version flag but if you use an invalid flag + # (like --version) it outputs the version to stderr and exits with 1. + # TODO: Better to check /etc/os-release; see ../install.sh. + ldd_output=$(ldd --version 2>&1 || true) + if echo "$ldd_output" | grep -iq musl; then + osname="alpine" + fi + ;; + darwin) osname="macos" ;; + cygwin* | mingw*) osname="windows" ;; + esac + echo "$osname" +} + +arch() { + cpu="$(uname -m)" + case "$cpu" in + aarch64) cpu=arm64 ;; + x86_64) cpu=amd64 ;; + esac + echo "$cpu" +} + +rsync() { + command rsync -a --del "$@" +} + +if [[ ! ${ARCH-} ]]; then + ARCH=$(arch) + export ARCH +fi + +# Windows predefines OS as Windows_NT for every process, so on a windows shell +# the check below would always find a value and never call os(). That is not a +# name this build knows, so it does not count as one the caller chose. +if [[ ! ${OS-} || ${OS-} == "Windows_NT" ]]; then + OS=$(os) + export OS +fi + +# RELEASE_PATH is the destination directory for the release from the root. +# Defaults to release +if [[ ! ${RELEASE_PATH-} ]]; then + RELEASE_PATH="release" + export RELEASE_PATH +fi + +nodeOS() { + osname=$OS + case $osname in + macos) osname=darwin ;; + windows) osname=win32 ;; + esac + echo "$osname" +} + +nodeArch() { + cpu=$ARCH + case $cpu in + amd64) cpu=x64 ;; + esac + echo "$cpu" +} + +run-steps() { + local -i failed=0 + mkdir -p .cache + rm -f .cache/checklist + while (( $# )) ; do + local name=$1 ; shift + local fn=$1 ; shift + echo "$name..." + # Only run if an earlier step has not failed. + # For all failed steps, write out an empty checkbox. + if [[ $failed == 0 ]] ; then + if $fn | indent ; then + echo "- [X] $name" >> .cache/checklist + else + ((failed++)) + echo "- [ ] $name" >> .cache/checklist + echo "Failed" | indent + fi + else + echo "- [ ] $name" >> .cache/checklist + echo "Skipped" | indent + fi + done + if [[ $failed != 0 ]] ; then + return 1 + fi +} + +quiet() { + "$@" >/dev/null +} + +indent() { + local count=2 + local space + space=$(printf "%${count}s") + sed "s/^/$space| /g" +} + +# See gulpfile.reh.ts for available targets. +if [[ ! ${VSCODE_TARGET-} ]]; then + VSCODE_TARGET="$(nodeOS)-$(nodeArch)" + export VSCODE_TARGET +fi diff --git a/ci/release-image/Dockerfile b/ci/release-image/Dockerfile new file mode 100644 index 000000000000..b691b0c2b876 --- /dev/null +++ b/ci/release-image/Dockerfile @@ -0,0 +1,62 @@ +# syntax=docker/dockerfile:experimental + +ARG BASE=debian:13 +FROM scratch AS packages +COPY release-packages/code-server*.deb /tmp/ + +FROM $BASE + +RUN apt-get update \ + && apt-get install -y -o Acquire::Retries=0 --only-upgrade '?source-package(^apt$)' \ + && apt-get install -y \ + curl \ + dumb-init \ + git \ + git-lfs \ + htop \ + locales \ + lsb-release \ + man-db \ + nano \ + openssh-client \ + procps \ + sudo \ + vim-tiny \ + wget \ + zsh \ + && git lfs install \ + && rm -rf /var/lib/apt/lists/* + +# https://wiki.debian.org/Locale#Manually +RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \ + && locale-gen +ENV LANG=en_US.UTF-8 + +RUN if grep -q 1000 /etc/passwd; then \ + userdel -r "$(id -un 1000)"; \ + fi \ + && adduser --gecos '' --disabled-password coder \ + && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd + +RUN ARCH="$(dpkg --print-architecture)" \ + && curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \ + && chown root:root /usr/local/bin/fixuid \ + && chmod 4755 /usr/local/bin/fixuid \ + && mkdir -p /etc/fixuid \ + && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml + +COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh +RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb + +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +ENV ENTRYPOINTD=${HOME}/entrypoint.d + +EXPOSE 8080 +# This way, if someone sets $DOCKER_USER, docker-exec will still work as +# the uid will remain the same. note: only relevant if -u isn't passed to +# docker-run. +USER 1000 +ENV USER=coder +WORKDIR /home/coder +ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."] diff --git a/ci/release-image/Dockerfile.fedora b/ci/release-image/Dockerfile.fedora new file mode 100644 index 000000000000..ec618530cb78 --- /dev/null +++ b/ci/release-image/Dockerfile.fedora @@ -0,0 +1,51 @@ +# syntax=docker/dockerfile:experimental + +ARG BASE=fedora:39 +FROM scratch AS packages +COPY release-packages/code-server*.rpm /tmp/ + +FROM $BASE + +RUN dnf update -y \ + && dnf install -y \ + curl \ + git \ + git-lfs \ + htop \ + nano \ + openssh-clients \ + procps \ + wget \ + zsh \ + dumb-init \ + glibc-langpack-en \ + && rm -rf /var/cache/dnf +RUN git lfs install + +ENV LANG=en_US.UTF-8 +RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf + +RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd + +RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \ + && curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \ + && chown root:root /usr/local/bin/fixuid \ + && chmod 4755 /usr/local/bin/fixuid \ + && mkdir -p /etc/fixuid \ + && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml + +COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh +RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm + +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +ENV ENTRYPOINTD=${HOME}/entrypoint.d + +EXPOSE 8080 +# This way, if someone sets $DOCKER_USER, docker-exec will still work as +# the uid will remain the same. note: only relevant if -u isn't passed to +# docker-run. +USER 1000 +ENV USER=coder +WORKDIR /home/coder +ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."] diff --git a/ci/release-image/Dockerfile.opensuse b/ci/release-image/Dockerfile.opensuse new file mode 100644 index 000000000000..f445d45c27b1 --- /dev/null +++ b/ci/release-image/Dockerfile.opensuse @@ -0,0 +1,51 @@ +# syntax=docker/dockerfile:experimental + +ARG BASE=opensuse/tumbleweed +FROM scratch AS packages +COPY release-packages/code-server*.rpm /tmp/ + +FROM $BASE + +RUN zypper dup -y \ + && zypper in -y \ + curl \ + git \ + git-lfs \ + htop \ + nano \ + openssh-clients \ + procps \ + wget \ + zsh \ + sudo \ + catatonit \ + && rm -rf /var/cache/zypp /var/cache/zypper +RUN git lfs install + +ENV LANG=en_US.UTF-8 +RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf + +RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd + +RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \ + && curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \ + && chown root:root /usr/local/bin/fixuid \ + && chmod 4755 /usr/local/bin/fixuid \ + && mkdir -p /etc/fixuid \ + && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml + +COPY ci/release-image/entrypoint-catatonit.sh /usr/bin/entrypoint-catatonit.sh +RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm + +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +ENV ENTRYPOINTD=${HOME}/entrypoint.d + +EXPOSE 8080 +# This way, if someone sets $DOCKER_USER, docker-exec will still work as +# the uid will remain the same. note: only relevant if -u isn't passed to +# docker-run. +USER 1000 +ENV USER=coder +WORKDIR /home/coder +ENTRYPOINT ["/usr/bin/entrypoint-catatonit.sh", "--bind-addr", "0.0.0.0:8080", "."] diff --git a/ci/release-image/docker-bake.hcl b/ci/release-image/docker-bake.hcl new file mode 100644 index 000000000000..ecb0c313daed --- /dev/null +++ b/ci/release-image/docker-bake.hcl @@ -0,0 +1,130 @@ +# Use this file from the top of the repo, with `-f ci/release-image/docker-bake.hcl` + +# Uses env var VERSION if set; +# normally, this is set by ci/lib.sh +variable "VERSION" { + default = "latest" +} + +variable "DOCKER_REGISTRY" { + default = "docker.io/codercom/code-server" +} + +variable "GITHUB_REGISTRY" { + default = "ghcr.io/coder/code-server" +} + +group "default" { + targets = [ + "code-server-debian-13", + "code-server-debian-12", + "code-server-ubuntu-focal", + "code-server-ubuntu-noble", + "code-server-ubuntu-resolute", + "code-server-fedora-39", + "code-server-opensuse-tumbleweed", + ] +} + +function "prepend_hyphen_if_not_null" { + params = [tag] + result = notequal("","${tag}") ? "-${tag}" : "${tag}" +} + +# use empty tag (tag="") to generate default tags +function "gen_tags" { + params = [registry, tag] + result = notequal("","${registry}") ? [ + notequal("", "${tag}") ? "${registry}:${tag}" : "${registry}:latest", + notequal("latest",VERSION) ? "${registry}:${VERSION}${prepend_hyphen_if_not_null(tag)}" : "", + ] : [] +} + +# helper function to generate tags for docker registry and github registry. +# set (DOCKER|GITHUB)_REGISTRY="" to disable corresponding registry +function "gen_tags_for_docker_and_ghcr" { + params = [tag] + result = concat( + gen_tags("${DOCKER_REGISTRY}", "${tag}"), + gen_tags("${GITHUB_REGISTRY}", "${tag}"), + ) +} + +target "code-server-debian-13" { + dockerfile = "ci/release-image/Dockerfile" + tags = concat( + gen_tags_for_docker_and_ghcr(""), + gen_tags_for_docker_and_ghcr("debian"), + gen_tags_for_docker_and_ghcr("trixie"), + ) + platforms = ["linux/amd64", "linux/arm64"] +} + +target "code-server-debian-12" { + dockerfile = "ci/release-image/Dockerfile" + tags = concat( + gen_tags_for_docker_and_ghcr("bookworm"), + ) + args = { + BASE = "debian:12" + } + platforms = ["linux/amd64", "linux/arm64"] +} + +target "code-server-ubuntu-focal" { + dockerfile = "ci/release-image/Dockerfile" + tags = concat( + gen_tags_for_docker_and_ghcr("focal"), + ) + args = { + BASE = "ubuntu:focal" + } + platforms = ["linux/amd64", "linux/arm64"] +} + +target "code-server-ubuntu-noble" { + dockerfile = "ci/release-image/Dockerfile" + tags = concat( + gen_tags_for_docker_and_ghcr("noble"), + gen_tags_for_docker_and_ghcr("ubuntu"), + ) + args = { + BASE = "ubuntu:noble" + } + platforms = ["linux/amd64", "linux/arm64"] +} + +target "code-server-ubuntu-resolute" { + dockerfile = "ci/release-image/Dockerfile" + tags = concat( + gen_tags_for_docker_and_ghcr("resolute"), + ) + args = { + BASE = "ubuntu:resolute" + } + platforms = ["linux/amd64", "linux/arm64"] +} + +target "code-server-fedora-39" { + dockerfile = "ci/release-image/Dockerfile.fedora" + tags = concat( + gen_tags_for_docker_and_ghcr("fedora"), + gen_tags_for_docker_and_ghcr("39"), + ) + args = { + BASE = "fedora:39" + } + platforms = ["linux/amd64", "linux/arm64"] +} + +target "code-server-opensuse-tumbleweed" { + dockerfile = "ci/release-image/Dockerfile.opensuse" + tags = concat( + gen_tags_for_docker_and_ghcr("opensuse"), + gen_tags_for_docker_and_ghcr("tumbleweed"), + ) + args = { + BASE = "opensuse/tumbleweed" + } + platforms = ["linux/amd64", "linux/arm64"] +} diff --git a/ci/release-image/entrypoint-catatonit.sh b/ci/release-image/entrypoint-catatonit.sh new file mode 100755 index 000000000000..d22acc6d237b --- /dev/null +++ b/ci/release-image/entrypoint-catatonit.sh @@ -0,0 +1,27 @@ +#!/bin/sh +set -eu + +# We do this first to ensure sudo works below when renaming the user. +# Otherwise the current container UID may not exist in the passwd database. +eval "$(fixuid -q)" + +if [ "${DOCKER_USER-}" ]; then + USER="$DOCKER_USER" + if [ "$DOCKER_USER" != "$(whoami)" ]; then + echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null + # Unfortunately we cannot change $HOME as we cannot move any bind mounts + # nor can we bind mount $HOME into a new home as that requires a privileged container. + sudo usermod --login "$DOCKER_USER" coder + sudo groupmod -n "$DOCKER_USER" coder + + sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd + fi +fi + +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +if [ -d "${ENTRYPOINTD}" ]; then + find "${ENTRYPOINTD}" -type f -executable -print -exec {} \; +fi + +exec catatonit -- /usr/bin/code-server "$@" diff --git a/ci/release-image/entrypoint.sh b/ci/release-image/entrypoint.sh new file mode 100755 index 000000000000..efe2f39d9bd9 --- /dev/null +++ b/ci/release-image/entrypoint.sh @@ -0,0 +1,27 @@ +#!/bin/sh +set -eu + +# We do this first to ensure sudo works below when renaming the user. +# Otherwise the current container UID may not exist in the passwd database. +eval "$(fixuid -q)" + +if [ "${DOCKER_USER-}" ]; then + USER="$DOCKER_USER" + if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then + echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null + # Unfortunately we cannot change $HOME as we cannot move any bind mounts + # nor can we bind mount $HOME into a new home as that requires a privileged container. + sudo usermod --login "$DOCKER_USER" coder + sudo groupmod -n "$DOCKER_USER" coder + + sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd + fi +fi + +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +if [ -d "${ENTRYPOINTD}" ]; then + find "${ENTRYPOINTD}" -type f -executable -print -exec {} \; +fi + +exec dumb-init /usr/bin/code-server "$@" diff --git a/ci/steps/docker-buildx-push.sh b/ci/steps/docker-buildx-push.sh new file mode 100755 index 000000000000..c7cb5705aa04 --- /dev/null +++ b/ci/steps/docker-buildx-push.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + # NOTE@jsjoeio - this script assumes VERSION exists as an + # environment variable. + + # NOTE@jsjoeio - this script assumes that you've downloaded + # the release-packages artifact to ./release-packages before + # running this docker buildx step + docker buildx bake -f ci/release-image/docker-bake.hcl --push "$@" +} + +main "$@" diff --git a/ci/steps/steps-lib.sh b/ci/steps/steps-lib.sh new file mode 100755 index 000000000000..e71378e27f6c --- /dev/null +++ b/ci/steps/steps-lib.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# This is a library which contains functions used inside ci/steps +# +# We separated it into it's own file so that we could easily unit test +# these functions and helpers + +# Checks whether and environment variable is set. +# Source: https://stackoverflow.com/a/62210688/3015595 +is_env_var_set() { + local name="${1:-}" + if test -n "${!name:-}"; then + return 0 + else + return 1 + fi +} + +# Checks whether a directory exists. +directory_exists() { + local dir="${1:-}" + if [[ -d "${dir:-}" ]]; then + return 0 + else + return 1 + fi +} + +# Checks whether a file exists. +file_exists() { + local file="${1:-}" + if test -f "${file:-}"; then + return 0 + else + return 1 + fi +} + +# Checks whether a file is executable. +is_executable() { + local file="${1:-}" + if [ -f "${file}" ] && [ -r "${file}" ] && [ -x "${file}" ]; then + return 0 + else + return 1 + fi +} diff --git a/deployment/aws/deployment.yaml b/deployment/aws/deployment.yaml deleted file mode 100644 index 6f265634ddcb..000000000000 --- a/deployment/aws/deployment.yaml +++ /dev/null @@ -1,74 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: code-server ---- -apiVersion: v1 -kind: Service -metadata: - name: code-server - namespace: code-server -spec: - ports: - - port: 8443 - name: https - protocol: TCP - selector: - app: code-server - type: ClusterIP ---- -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: gp2 - annotations: - storageclass.kubernetes.io/is-default-class: "true" -provisioner: kubernetes.io/aws-ebs -parameters: - type: gp2 - fsType: ext4 ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: code-store - namespace: code-server -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 60Gi ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: code-server - name: code-server - namespace: code-server -spec: - selector: - matchLabels: - app: code-server - replicas: 1 - template: - metadata: - labels: - app: code-server - spec: - containers: - - image: codercom/code-server - imagePullPolicy: Always - name: code-servery - ports: - - containerPort: 8443 - name: https - volumeMounts: - - name: code-server-storage - mountPath: /go/src - volumes: - - name: code-server-storage - persistentVolumeClaim: - claimName: code-store - diff --git a/deployment/deployment.yaml b/deployment/deployment.yaml deleted file mode 100644 index a032d5234054..000000000000 --- a/deployment/deployment.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: code-server ---- -apiVersion: v1 -kind: Service -metadata: - name: code-server - namespace: code-server -spec: - ports: - - port: 8443 - name: https - protocol: TCP - selector: - app: code-server - type: ClusterIP ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: code-server - name: code-server - namespace: code-server -spec: - selector: - matchLabels: - app: code-server - replicas: 1 - template: - metadata: - labels: - app: code-server - spec: - containers: - - image: codercom/code-server - imagePullPolicy: Always - name: code-server - ports: - - containerPort: 8443 - name: https diff --git a/doc/admin/install/aws.md b/doc/admin/install/aws.md deleted file mode 100644 index d1c93fb0c2eb..000000000000 --- a/doc/admin/install/aws.md +++ /dev/null @@ -1,69 +0,0 @@ -# Deploy on AWS - -This tutorial shows you how to deploy `code-server` on an EC2 AWS instance. - -If you're just starting out, we recommend [installing code-server locally](../../self-hosted/index.md). It takes only a few minutes and lets you try out all of the features. You can also try out the IDE on a container hosted [by Coder](http://coder.com/signup) - ---- - -## Deploy to EC2 - -### Use the AWS wizard - -- Click **Launch Instance** from your [EC2 dashboard](https://console.aws.amazon.com/ec2/v2/home). -- Select the Ubuntu Server 16.04 LTS (HVM), SSD Volume Type (`ami-0f9cf087c1f27d9b1)` at this time of writing) -- Select an appropriate instance size (we recommend t2.medium/large, depending on team size and number of repositories/languages enabled), then **Next: Configure Instance Details** -- Select **Next: ...** until you get to the **Configure Security Group** page, then add the default **HTTP** rule (port range "80", source "0.0.0.0/0, ::/0") - > Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance. We recommend setting [security group rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html?icmpid=docs_ec2_console) to allow access from known IP addresses only. -- Click **Launch** -- You will be prompted to create a key pair - > A key pair consists of a public key that AWS stores, and a private key file that you store. Together, they allow you to connect to your instance securely. For Windows AMIs, the private key file is required to obtain the password used to log into your instance. For Linux AMIs, the private key file allows you to securely SSH into your instance. -- From the dropdown choose "create a new pair", give the key pair a name -- Click **Download Key Pair** - > This is necessary before you proceed. A `.pem` file will be downloaded. make sure you store is in a safe location because it can't be retrieved once we move on. -- Finally, click **Launch Instances** ---- -### SSH Into EC2 Instance -- First head to your [EC2 dashboard](https://console.aws.amazon.com/ec2/v2/home) and choose instances from the left panel -- In the description of your EC2 instance copy the public DNS (iPv4) address using the copy to clipboard button -- Open a terminal on your computer and use the following command to SSH into your EC2 instance - ``` - ssh -i "path/to/your/keypair.pem" ubuntu@(paste the public DNS here) - ``` - >example: `ssh -i "/Users/John/Downloads/TestInstance.pem" ubuntu@ec2-3-45-678-910.compute-1.amazonaws.co` -- You should see a prompt for your EC2 instance like so -- At this point it is time to download the `code-server` binary. We will of course want the linux version. -- Find the latest Linux release from this URL: - ``` - https://github.com/cdr/code-server/releases/latest - ``` -- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page): - ``` - wget https://github.com/cdr/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz - ``` -- Extract the downloaded tar.gz file with this command, for example: - ``` - tar -xvzf code-server-{version}-linux-x64.tar.gz - ``` -- Navigate to extracted directory with this command: - ``` - cd code-server-{version}-linux-x64 - ``` -- If you run into any permission errors, make the binary executable by running: - ``` - chmod +x code-server - ``` - > To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md) -- Finally, run - ``` - sudo ./code-server -p 80 - ``` -- When you visit the public IP for your AWS instance, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"** -- Then click **"proceed anyway"** - - > For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed - - > The `-p 80` flag is necessary in order to make the IDE accessible from the public IP of your instance (also available from the description in the instances page. - - --- -> NOTE: If you get stuck or need help, [file an issue](https://github.com/cdr/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide). diff --git a/doc/admin/install/digitalocean.md b/doc/admin/install/digitalocean.md deleted file mode 100644 index 9bc08da2186c..000000000000 --- a/doc/admin/install/digitalocean.md +++ /dev/null @@ -1,49 +0,0 @@ -# Deploy on DigitalOcean - -This tutorial shows you how to deploy `code-server` to a single node running on DigitalOcean. - -If you're just starting out, we recommend [installing code-server locally](../../self-hosted/index.md). It takes only a few minutes and lets you try out all of the features. You can also try out the IDE on a container hosted [by Coder](http://coder.com/signup) - ---- - -## Use the "Create Droplets" wizard - -[Open your DigitalOcean dashboard](https://cloud.digitalocean.com/droplets/new) to create a new droplet - -- **Choose an image -** Select the **Distributions** tab and then choose Ubuntu -- **Choose a size -** We recommend at least 4GB RAM and 2 CPU, more depending on team size and number of repositories/languages enabled. -- Launch your instance -- Open a terminal on your computer and SSH into your instance - > example: ssh root@203.0.113.0 -- Once in the SSH session, visit code-server [releases page](https://github.com/cdr/code-server/releases/) and copy the link to the download for the latest linux release -- Find the latest Linux release from this URL: - ``` - https://github.com/cdr/code-server/releases/latest - ``` -- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page): - ``` - wget https://github.com/cdr/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz - ``` -- Extract the downloaded tar.gz file with this command, for example: - ``` - tar -xvzf code-server-{version}-linux-x64.tar.gz - ``` -- Navigate to extracted directory with this command: - ``` - cd code-server-{version}-linux-x64 - ``` -- If you run into any permission errors when attempting to run the binary: - ``` - chmod +x code-server - ``` - > To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md) -- Finally start the code-server - ``` - sudo ./code-server -p 80 - ``` - > For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed -- When you visit the public IP for your Digital Ocean instance, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"** -- Then click **"proceed anyway"** - ---- -> NOTE: If you get stuck or need help, [file an issue](https://github.com/cdr/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide). diff --git a/doc/admin/install/google_cloud.md b/doc/admin/install/google_cloud.md deleted file mode 100644 index 5f6c98fac3d4..000000000000 --- a/doc/admin/install/google_cloud.md +++ /dev/null @@ -1,71 +0,0 @@ -# Deploy on Google Cloud - -This tutorial shows you how to deploy `code-server` to a single node running on Google Cloud. - -If you're just starting out, we recommend [installing code-server locally](../../self-hosted/index.md). It takes only a few minutes and lets you try out all of the features. You can also try out the IDE on a container hosted [by Coder](http://coder.com/signup) - ---- - -## Deploy to Google Cloud VM -> Pre-requisite: Please [set up Google Cloud SDK](https://cloud.google.com/sdk/docs/) on your local machine - -- [Open your Google Cloud console](https://console.cloud.google.com/compute/instances) to create a new VM instance and click **Create Instance** -- Choose an appropriate machine type (we recommend 2 vCPU and 7.5 GB RAM, more depending on team size and number of repositories/languages enabled) -- Choose Ubuntu 16.04 LTS as your boot disk -- Check the boxes for **Allow HTTP traffic** and **Allow HTTPS traffic** in the **Firewall** section -- Create your VM, and **take note** of its public IP address. -- Copy the link to download the latest Linux binary from our [releases page](https://github.com/cdr/code-server/releases) - ---- - -## Final Steps - -- SSH into your Google Cloud VM -``` -gcloud compute ssh --zone [region] [instance name] -``` - -- Find the latest Linux release from this URL: -``` -https://github.com/cdr/code-server/releases/latest -``` - -- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page): -``` -wget https://github.com/cdr/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz -``` - -- Extract the downloaded tar.gz file with this command, for example: -``` -tar -xvzf code-server-{version}-linux-x64.tar.gz -``` - -- Navigate to extracted directory with this command: -``` -cd code-server-{version}-linux-x64 -``` - -- Make the binary executable if you run into any errors regarding permission: -``` -chmod +x code-server -``` - -> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md) - -- Start the code-server -``` -sudo ./code-server -p 80 -``` - -> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed - -- Access code-server from the public IP of your Google Cloud instance we noted earlier in your browser. -> example: 32.32.32.234 - -- You will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"** - -- Then click **"proceed anyway"** - ---- - -> NOTE: If you get stuck or need help, [file an issue](https://github.com/cdr/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide). diff --git a/doc/assets/aws_ubuntu.png b/doc/assets/aws_ubuntu.png deleted file mode 100644 index 2a7e76c84d71..000000000000 Binary files a/doc/assets/aws_ubuntu.png and /dev/null differ diff --git a/doc/assets/chrome_confirm.png b/doc/assets/chrome_confirm.png deleted file mode 100644 index 037029e1e58f..000000000000 Binary files a/doc/assets/chrome_confirm.png and /dev/null differ diff --git a/doc/assets/chrome_warning.png b/doc/assets/chrome_warning.png deleted file mode 100644 index 46f526db8ebe..000000000000 Binary files a/doc/assets/chrome_warning.png and /dev/null differ diff --git a/doc/assets/cli.png b/doc/assets/cli.png deleted file mode 100644 index 19f058b9323e..000000000000 Binary files a/doc/assets/cli.png and /dev/null differ diff --git a/doc/assets/cros.png b/doc/assets/cros.png deleted file mode 100644 index 64d94c23098d..000000000000 Binary files a/doc/assets/cros.png and /dev/null differ diff --git a/doc/assets/ide.png b/doc/assets/ide.png deleted file mode 100644 index a0d0d25a8b52..000000000000 Binary files a/doc/assets/ide.png and /dev/null differ diff --git a/doc/assets/logo-horizontal.png b/doc/assets/logo-horizontal.png deleted file mode 100644 index 8012bcd854fa..000000000000 Binary files a/doc/assets/logo-horizontal.png and /dev/null differ diff --git a/doc/assets/release.gif b/doc/assets/release.gif deleted file mode 100644 index b8ad499732b0..000000000000 Binary files a/doc/assets/release.gif and /dev/null differ diff --git a/doc/assets/server-password-modal.png b/doc/assets/server-password-modal.png deleted file mode 100644 index 9d31182d1042..000000000000 Binary files a/doc/assets/server-password-modal.png and /dev/null differ diff --git a/doc/security/ssl.md b/doc/security/ssl.md deleted file mode 100644 index c5a86da78379..000000000000 --- a/doc/security/ssl.md +++ /dev/null @@ -1,53 +0,0 @@ -# Generate a self-signed certificate 🔒 - -code-server has the ability to secure your connection between client and server using SSL/TSL certificates. By default, the server will start with an unencrypted connection. We recommend Self-signed TLS/SSL certificates for personal use of code-server or within an organization. - -This guide will show you how to create a self-signed certificate and start code-server using your certificate/key. - -## TLS / HTTPS - -You can specify any location that you want to save the certificate and key. In this example, we will navigate to the root directory, create a folder called `certs` and cd into it. - -```shell -mkdir ~/certs && cd ~/certs -``` - -If you don't already have a TLS certificate and key, you can generate them with the command below. They will be placed in `~/certs` - -```shell -openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ~/certs/MyKey.key -out ~/certs/MyCertificate.crt -``` - -You will be prompted to add some identifying information about your organization -```shell -You are about to be asked to enter information that will be incorporated -into your certificate request. -What you are about to enter is what is called a Distinguished Name or a DN. -There are quite a few fields but you can leave some blank -For some fields there will be a default value, -If you enter '.', the field will be left blank. ------ -Country Name (2 letter code) [AU]:US -State or Province Name (full name) [Some-State]:TX -Locality Name (eg, city) []:Austin -Organization Name (eg, company) [Coder Technologies]:Coder -Organizational Unit Name (eg, section) []:Docs -Common Name (e.g. server FQDN or YOUR name) []:hostname.example.com -Email Address []:admin@example.com -``` ->If you already have a TLS certificate and key, you can simply reference them in the `--cert` and `--cert-key` flags when launching code-server - - -## Starting code-server with certificate and key - -1. At the end of the path to your binary, add the following flags followed by the path to your certificate and key like so. Then press enter to run code-server. - ```shell - ./code-server --cert=~/certs/MyCertificate.crt --cert-key=~/certs/MyKey.key - ``` -2. After that you will be running a secure code-server. - -> You will know your connection is secure if the lines `WARN No certificate specified. This could be insecure. WARN Documentation on securing your setup: https://coder.com/docs` no longer appear. - -## Other options - -For larger organizations you may wish to rely on a Certificate Authority as opposed to a self-signed certificate. For more information on generating free and open certificates for your site, please check out EFF's [certbot](https://certbot.eff.org/). Certbot is a cli to generate certificates using [LetsEncrypt](https://letsencrypt.org/). diff --git a/doc/self-hosted/cros-install.md b/doc/self-hosted/cros-install.md deleted file mode 100644 index 44460189892b..000000000000 --- a/doc/self-hosted/cros-install.md +++ /dev/null @@ -1,53 +0,0 @@ -# Installng code-server in your ChromiumOS/ChromeOS/CloudReady machine - -This guide will show you how to install code-server into your CrOS machine. - -## Using Crostini - -One of the easier ways to run code-server is via [Crostini](https://www.aboutchromebooks.com/tag/project-crostini/), the Linux apps support feature in CrOS. Make sure you have enough RAM, HDD space and your CPU has VT-x/ AMD-V support. If your chromebook has this, then you are qualified to use Crostini. - -If you are running R69, you might want to enable this on [Chrome Flags](chrome://flags/#enable-experimental-crostini-ui). If you run R72, however, this is already enabled for you. - -After checking your prerequisites, follow the steps in [the self-host install guide](index.md) on installing code-server. Once done, make sure code-server works by running it. After running it, simply go to `penguin.linux.test:8443` to access code-server. Now you should be greeted with this screen. If you did, congratulations, you have installed code-server in your Chromebook! - -![code-server on Chromebook](../assets/cros.png) - -Alternatively, if you ran code-server in another container and you need the IP for that specific container, simply go to Termina's shell via `crosh` and type `vsh termina`. - -```bash -Loading extra module: /usr/share/crosh/dev.d/50-crosh.sh -Welcome to crosh, the Chrome OS developer shell. - -If you got here by mistake, don't panic! Just close this tab and carry on. - -Type 'help' for a list of commands. - -If you want to customize the look/behavior, you can use the options page. -Load it by using the Ctrl+Shift+P keyboard shortcut. - -crosh> vsh termina -(termina) chronos@localhost ~ $ -``` -While in termina, run `lxc list`. It should output the list of running containers. - -```bash -(termina) chronos@localhost ~ $ lxc list -+---------+---------+-----------------------+------+------------+-----------+ -| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | -+---------+---------+-----------------------+------+------------+-----------+ -| penguin | RUNNING | 100.115.92.199 (eth0) | | PERSISTENT | 0 | -+---------+---------+-----------------------+------+------------+-----------+ -(termina) chronos@localhost ~ $ -``` - -For this example, we show the default `penguin` container, which is exposed on `eth0` at 100.115.92.199. Simply enter the IP of the container where the code-server runs to Chrome. - -## Using Crouton - -[Crouton](https://github.com/dnschneid/crouton) is one of the old ways to get a running full Linux via `chroot` on a Chromebook. To use crouton, enable developer mode and go to `crosh`. This time, run `shell`, which should drop you to `bash`. - -Make sure you downloaded `crouton`, if so, go ahead and run it under `~/Downloads`. After installing your chroot container via crouton, go ahead and enter `enter-chroot` to enter your container. - -Follow the instructions set in [the self-host install guide](index.md) to install code-server. After that is done, run `code-server` and verify it works by going to `localhost:8443`. - -> At this point in writing, `localhost` seems to work in this method. However, the author is not sure if it applies still to newer Chromebooks. diff --git a/doc/self-hosted/index.md b/doc/self-hosted/index.md deleted file mode 100644 index 45dab39fe022..000000000000 --- a/doc/self-hosted/index.md +++ /dev/null @@ -1,123 +0,0 @@ -# Getting Started - -[code-server](https://coder.com) is used by developers at Azure, Google, Reddit, and more to give them access to VS Code in the browser. - -## Quickstart Guide - -> NOTE: If you get stuck or need help, [file an issue](https://github.com/cdr/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide). - -This document pertains to Coder specific implementations of VS Code. For documentation on how to use VS Code itself, please refer to the official [documentation for VS Code](https://code.visualstudio.com/docs) - -It takes just a few minutes to get your own self-hosted server running. If you've got a machine running macOS, Windows, or Linux, you're ready to start the binary which listens on port `8443` by default. - - - - -1. Visit [the releases](https://github.com/cdr/code-server/releases) page and download the latest cli for your operating system -2. Double click the executable to run in the current directory -3. Copy the password that appears in the cli -4. In your browser navigate to `localhost:8443` -5. Paste the password from the cli into the login window -> NOTE: Be careful with your password as sharing it will grant those users access to your server's file system - -### Things To Know -- When you visit the IP for your code-server, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"** -- Then click **"proceed anyway"** - -## Usage -
code-server --help
- -code-server can be ran with a number of arguments to customize your working directory, host, port, and SSL certificate. - -``` -Usage: code-server [options] - -Run VS Code on a remote server. - -Options: - -V, --version output the version number - --cert - --cert-key - -e, --extensions-dir Set the root path for extensions. - -d --user-data-dir Specifies the directory that user data is kept in, useful when running as root. - --data-dir DEPRECATED: Use '--user-data-dir' instead. Customize where user-data is stored. - -h, --host Customize the hostname. (default: "0.0.0.0") - -o, --open Open in the browser on startup. - -p, --port Port to bind on. (default: 8443) - -N, --no-auth Start without requiring authentication. - -H, --allow-http Allow http connections. - -P, --password Specify a password for authentication. - --disable-telemetry Disables ALL telemetry. - --help output usage information - ``` - - ### Data Directory - Use `code-server -d (path/to/directory)` or `code-server --data-dir=(path/to/directory)`, excluding the parentheses to specify the root folder that VS Code will start in. - - ### Host - By default, code-server will use `0.0.0.0` as its address. This can be changed by using `code-server -h` or `code-server --host=` followed by the address you want to use. - > Example: `code-server -h 127.0.0.1` - - ### Open - You can have the server automatically open the VS Code in your browser on startup by using the `code-server -o` or `code-server --open` flags - - ### Port - By default, code-server will use `8443` as its port. This can be changed by using `code-server -p` or `code-server --port=` followed by the port you want to use. - > Example: `code-server -p 9000` - - ### Telemetry - Disable all telemetry with `code-server --disable-telemetry`. - - ### Cert and Cert Key - To encrypt the traffic between the browser and server use `code-server --cert=` followed by the path to your `.cer` file. Additionally, you can use certificate keys with `code-server --cert-key` followed by the path to your `.key` file. -> Example (certificate and key): `code-server --cert /etc/letsencrypt/live/example.com/fullchain.cer --cert-key /etc/letsencrypt/live/example.com/fullchain.key` -> Example (if you are using Letsencrypt or similar): `code-server --cert /etc/letsencrypt/live/example.com/fullchain.pem --cert-key /etc/letsencrypt/live/example.com/privkey.key` - -> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md) - - ### Nginx Reverse Proxy - Nginx is for reverse proxy. Below is a virtual host example that works with code-server. Please also pass --allow-http. You can also use certbot by EFF to get a ssl certificates for free. - ``` - server { - listen 80; - listen [::]:80; - server_name code.example.com code.example.org; - location / { - proxy_pass http://localhost:8443/; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection upgrade; - proxy_set_header Accept-Encoding gzip; - } - } - ``` - - ### Apache Reverse Proxy - Example of https virtualhost configuration for Apache as a reverse proxy. Please also pass --allow-http on code-server startup to allow the proxy to connect. - ``` - - ServerName code.example.com - - RewriteEngine On - RewriteCond %{HTTP:Upgrade} =websocket [NC] - RewriteRule /(.*) ws://localhost:8443/$1 [P,L] - RewriteCond %{HTTP:Upgrade} !=websocket [NC] - RewriteRule /(.*) http://localhost:8443/$1 [P,L] - - ProxyRequests off - - RequestHeader set X-Forwarded-Proto https - RequestHeader set X-Forwarded-Port 443 - - ProxyPass / http://localhost:8443/ nocanon - ProxyPassReverse / http://localhost:8443/ - - - ``` - *Important:* For more details about Apache reverse proxy configuration checkout the [documentation](https://httpd.apache.org/docs/current/mod/mod_proxy.html) - especially the [Securing your Server](https://httpd.apache.org/docs/current/mod/mod_proxy.html#access) section - - ### Help - Use `code-server --help` to view the usage for the CLI. This is also shown at the beginning of this section. diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..168eac481bb7 --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,92 @@ + + + +# Contributor Covenant Code of Conduct + +- [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct) + - [Our Pledge](#our-pledge) + - [Our Standards](#our-standards) + - [Our Responsibilities](#our-responsibilities) + - [Scope](#scope) + - [Enforcement](#enforcement) + - [Attribution](#attribution) + + + + +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at opensource@coder.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000000..b0a467f9be2a --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,288 @@ + + + +# Contributing + +- [Requirements](#requirements) + - [Linux-specific requirements](#linux-specific-requirements) +- [Development workflow](#development-workflow) + - [Version updates to Code](#version-updates-to-code) + - [Patching Code](#patching-code) + - [Build](#build) + - [Troubleshooting](#troubleshooting) + - [I see "Forbidden access" when I load code-server in the browser](#i-see-forbidden-access-when-i-load-code-server-in-the-browser) + - ["Can only have one anonymous define call per script"](#can-only-have-one-anonymous-define-call-per-script) + - [Help](#help) +- [Test](#test) + - [Unit tests](#unit-tests) + - [Script tests](#script-tests) + - [Integration tests](#integration-tests) + - [End-to-end tests](#end-to-end-tests) +- [Structure](#structure) + - [Modifications to Code](#modifications-to-code) + - [Currently Known Issues](#currently-known-issues) + + + + +## Requirements + +The prerequisites for contributing to code-server are almost the same as those +for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites). +Here is what is needed: + +- `node` v24.x +- `git` v2.x or greater +- [`git-lfs`](https://git-lfs.github.com) +- [`pnpm`](https://pnpm.io) + - Used to install dependencies and run scripts +- [`nfpm`](https://nfpm.goreleaser.com/) + - Used to build `.deb` and `.rpm` packages +- [`jq`](https://stedolan.github.io/jq/) + - Used to build code-server releases +- [`gnupg`](https://gnupg.org/index.html) + - All commits must be signed and verified; see GitHub's [Managing commit + signature + verification](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification) + or follow [this tutorial](https://joeprevite.com/verify-commits-on-github) +- `quilt` + - Used to manage patches to Code +- `rsync` and `unzip` + - Used for code-server releases +- `bats` + - Used to run script unit tests + +### Linux-specific requirements + +If you're developing code-server on Linux, make sure you have installed or +install the following dependencies: + +```shell +sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3 +``` + +These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) +for more information. + +## Development workflow + +1. `git clone https://github.com/coder/code-server.git` - Clone `code-server` +2. `git submodule update --init` - Clone `vscode` submodule +3. `quilt push -a` - Apply patches to the `vscode` submodule. +4. `pnpm install` - Install dependencies +5. `pnpm run watch` - Launch code-server localhost:8080. code-server will be live + reloaded when changes are made; the browser needs to be refreshed manually. + +When pulling down changes that include modifications to the patches you will +need to apply them with `quilt`. If you pull down changes that update the +`vscode` submodule you will need to run `git submodule update --init` and +re-apply the patches. + +When you make a change that affects people deploying the marketplace please +update the changelog as part of your PR. + +Note that building code-server takes a very, very long time, and loading it in +the browser in development mode also takes a very, very long time. + +Display language (Spanish, etc) support only works in a full build; it will not +work in development mode. + +Generally we prefer that PRs be squashed into `main` but you can rebase or merge +if it is important to keep the individual commits (make sure to clean up the +commits first if you are doing this). + +### Version updates to Code + +PRs will be automatically created with updates to VS Code. If a patch cannot be +automatically resolved, it will be necessary to clone the branch, resolve the +conflicts manually, and finish the update. To do this: + +1. Apply as many patches as possible `quilt push -a`. +2. Once you hit a conflict, force apply with `quilt push -f`, manually add back + the rejected code, then run `quilt refresh`. +3. Once all patches have been resolved, run `./ci/build/update.sh` to finish the + update process. +4. Commit all changes, push them up to the branch, and update the checklist in + the PR description. + +Once the PR is ready, manually verify that the unreleased changelog section +contains all the changes going into this version before merging. + +### Patching Code + +1. You can go through the patch stack with `quilt push` and `quilt pop`. +2. Create a new patch (`quilt new {name}.diff`) or use an existing patch. +3. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file + **must** be added before you make changes to it. +4. Make your changes. Patches do not need to be independent of each other but + each patch must result in a working code-server without any broken in-between + states otherwise they are difficult to test and modify. +5. Add your changes to the patch (`quilt refresh`) +6. Add a comment in the patch about the reason for the patch and how to + reproduce the behavior it fixes or adds. Every patch should have an e2e test + as well. + +### Build + +You can build a full production release as follows: + +```shell +git submodule update --init +quilt push -a +pnpm install +pnpm run build +VERSION=0.0.0 pnpm run build:vscode +KEEP_MODULES=1 pnpm run release +``` + +You can omit `KEEP_MODULES` if you intend to use this in a platform-agnostic way +(like for publishing to NPM), but since the VS Code build process does +post-processing deletion of the modules, it is recommended to keep the modules +when possible, since if you install them later you will have more than is +required. `KEEP_MODULES` will also bundle Node and the code-server entry script. + +Run your build: + +```shell +./release/bin/code-server +``` + +Or if you omitted `KEEP_MODULES`: + +```shell +cd release +pnpm install --prod +node . +``` + +Then, to package the release: + +```shell +pnpm run package +``` + +> On Linux, the currently running distro will become the minimum supported +> version. In our GitHub Actions CI, we use CentOS 8 for maximum compatibility. +> If you need your builds to support older distros, run the build commands +> inside a Docker container with all the build requirements installed. + +### Troubleshooting + +#### I see "Forbidden access" when I load code-server in the browser + +This means your patches didn't apply correctly. We have a patch to remove the +auth from vanilla Code because we use our own. + +Try popping off the patches with `quilt pop -a` and reapplying with `quilt push +-a`. + +#### "Can only have one anonymous define call per script" + +Code might be trying to use a dev or prod HTML in the wrong context. You can try +re-running code-server and setting `VSCODE_DEV=1`. + +### Help + +If you get stuck or need help, you can always start a new GitHub Discussion +[here](https://github.com/coder/code-server/discussions). One of the maintainers +will respond and help you out. + +## Test + +There are four kinds of tests in code-server: + +1. Unit tests +2. Script tests +3. Integration tests +4. End-to-end tests + +### Unit tests + +Our unit tests are written in TypeScript and run using +[Jest](https://jestjs.io/), the testing framework]. + +These live under [test/unit](../test/unit). + +We use unit tests for functions and things that can be tested in isolation. The +file structure is modeled closely after `/src` so it's easy for people to know +where test files should live. + +### Script tests + +Our script tests are written in bash and run using [bats](https://github.com/bats-core/bats-core). + +These tests live under `test/scripts`. + +We use these to test anything related to our scripts (most of which live under +`ci`). + +### Integration tests + +These are a work in progress. We build code-server and run tests with `pnpm run +test:integration`, which ensures that code-server builds work on their +respective platforms. + +Our integration tests look at components that rely on one another. For example, +testing the CLI requires us to build and package code-server. + +### End-to-end tests + +The end-to-end (e2e) tests are written in TypeScript and run using +[Playwright](https://playwright.dev/). + +These live under [test/e2e](../test/e2e). + +Before the e2e tests run, we run `globalSetup`, which eliminates the need to log +in before each test by preserving the authentication state. + +Take a look at `codeServer.test.ts` to see how you would use it (see +`test.use`). + +We also have a model where you can create helpers to use within tests. See +[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example. + +## Structure + +code-server essentially serves as an HTTP API for logging in and starting a +remote Code process. + +The CLI code is in [src/node](../src/node) and the HTTP routes are implemented +in [src/node/routes](../src/node/routes). + +Most of the meaty parts are in the Code portion of the codebase under +[lib/vscode](../lib/vscode), which we describe next. + +### Modifications to Code + +Our modifications to Code can be found in the [patches](../patches) directory. +We pull in Code as a submodule pointing to an upstream release branch. + +In v1 of code-server, we had Code as a submodule and used a single massive patch +that split the codebase into a front-end and a server. The front-end consisted +of the UI code, while the server ran the extensions and exposed an API to the +front-end for file access and all UI needs. + +Over time, Microsoft added support to Code to run it on the web. They had made +the front-end open source, but not the server. As such, code-server v2 (and +later) uses the Code front-end and implements the server. We did this by using a +Git subtree to fork and modify Code. + +Microsoft eventually made the server open source and we were able to reduce our +changes significantly. Some time later we moved back to a submodule and patches +(managed by `quilt` this time instead of the mega-patch). + +As the web portion of Code continues to mature, we'll be able to shrink and +possibly eliminate our patches. In the meantime, upgrading the Code version +requires us to ensure that our changes are still applied correctly and work as +intended. In the future, we'd like to run Code unit tests against our builds to +ensure that features work as expected. + +> We have [extension docs](../ci/README.md) on the CI and build system. + +If the functionality you're working on does NOT depend on code from Code, please +move it out and into code-server. + +### Currently Known Issues + +- Creating custom Code extensions and debugging them doesn't work +- Extension profiling and tips are currently disabled diff --git a/docs/FAQ.md b/docs/FAQ.md new file mode 100644 index 000000000000..c492c73b2c59 --- /dev/null +++ b/docs/FAQ.md @@ -0,0 +1,601 @@ + + + +# FAQ + +- [Questions?](#questions) +- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet) +- [Can I use code-server on the iPad?](#can-i-use-code-server-on-the-ipad) +- [How does the config file work?](#how-does-the-config-file-work) +- [How do I make my keyboard shortcuts work?](#how-do-i-make-my-keyboard-shortcuts-work) +- [Why can't code-server use Microsoft's extension marketplace?](#why-cant-code-server-use-microsofts-extension-marketplace) +- [How can I request an extension that's missing from the marketplace?](#how-can-i-request-an-extension-thats-missing-from-the-marketplace) +- [How do I install an extension?](#how-do-i-install-an-extension) +- [How do I install an extension manually?](#how-do-i-install-an-extension-manually) +- [How do I use my own extensions marketplace?](#how-do-i-use-my-own-extensions-marketplace) +- [Where are extensions stored?](#where-are-extensions-stored) +- [Where is VS Code configuration stored?](#where-is-vs-code-configuration-stored) +- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration) +- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open) +- [Can I open a file at a specific line from a URL?](#can-i-open-a-file-at-a-specific-line-from-a-url) +- [How do I access my Documents/Downloads/Desktop folders in code-server on macOS?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-macos) +- [How do I direct server-side requests through a proxy?](#how-do-i-direct-server-side-requests-through-a-proxy) +- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server) +- [What is the healthz endpoint?](#what-is-the-healthz-endpoint) +- [What is the heartbeat file?](#what-is-the-heartbeat-file) +- [How do I change the reconnection grace time?](#how-do-i-change-the-reconnection-grace-time) +- [How do I change the password?](#how-do-i-change-the-password) +- [Can I store my password hashed?](#can-i-store-my-password-hashed) +- [Is multi-tenancy possible?](#is-multi-tenancy-possible) +- [Can I use Docker in a code-server container?](#can-i-use-docker-in-a-code-server-container) +- [How do I disable telemetry?](#how-do-i-disable-telemetry) +- [What's the difference between code-server and Coder?](#whats-the-difference-between-code-server-and-coder) +- [What's the difference between code-server and Theia?](#whats-the-difference-between-code-server-and-theia) +- [What's the difference between code-server and OpenVSCode-Server?](#whats-the-difference-between-code-server-and-openvscode-server) +- [What's the difference between code-server and GitHub Codespaces?](#whats-the-difference-between-code-server-and-github-codespaces) +- [What's the difference between code-server and VS Code web?](#whats-the-difference-between-code-server-and-vs-code-web) +- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation) +- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server) +- [How do I change the port?](#how-do-i-change-the-port) +- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started) +- [How do I disable the proxy?](#how-do-i-disable-the-proxy) +- [How do I disable file download?](#how-do-i-disable-file-download) +- [Why do web views not work?](#why-do-web-views-not-work) +- [Can I run code-server with systemd socket activation?](#can-i-run-code-server-with-systemd-socket-activation) + + + + +## Questions? + +Please file all questions and support requests at +. + +## How should I expose code-server to the internet? + +Please see [our instructions on exposing code-server safely to the +internet](./guide.md). + +## Can I use code-server on the iPad? + +See [iPad](./ipad.md) for information on using code-server on the iPad. + +## How does the config file work? + +When `code-server` starts up, it creates a default config file in `~/.config/code-server/config.yaml`: + +```yaml +bind-addr: 127.0.0.1:8080 +auth: password +password: mew...22 # Randomly generated for each config.yaml +cert: false +``` + +The default config defines the following behavior: + +- Listen on the loopback IP port 8080 +- Enable password authorization +- Do not use TLS + +Each key in the file maps directly to a `code-server` flag (run `code-server --help` to see a listing of all the flags). Any flags passed to `code-server` +will take priority over the config file. + +You can change the config file's location using the `--config` flag or +`$CODE_SERVER_CONFIG` environment variable. + +The default location respects `$XDG_CONFIG_HOME`. + +## How do I make my keyboard shortcuts work? + +Many shortcuts will not work by default, since they'll be "caught" by the browser. + +If you use Chrome, you can work around this by installing the progressive web +app (PWA): + +1. Start the editor +2. Click the **plus** icon in the URL toolbar to install the PWA + +If you use Firefox, you can use the appropriate extension to install PWA. + +1. Go to the installation [website](https://addons.mozilla.org/en-US/firefox/addon/pwas-for-firefox/) of the add-on +2. Add the add-on to Firefox +3. Follow the os-specific instructions on how to install the runtime counterpart + +For other browsers, you'll have to remap keybindings for shortcuts to work. + +## Why can't code-server use Microsoft's extension marketplace? + +Though code-server takes the open-source core of VS Code and allows you to run +it in the browser, it is not entirely equivalent to Microsoft's VS Code. + +One major difference is in regards to extensions and the marketplace. The core +of VS code is open source, while the marketplace and many published Microsoft +extensions are not. Furthermore, Microsoft prohibits the use of any +non-Microsoft VS Code from accessing their marketplace. Per the [Terms of +Service](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf): + +> Marketplace Offerings are intended for use only with Visual Studio Products +> and Services, and you may only install and use Marketplace Offerings with +> Visual Studio Products and Services. + +Because of this, we can't offer any extensions on Microsoft's marketplace. +Instead, we use the [Open-VSX extension gallery](https://open-vsx.org), which is also used by various other forks. +It isn't perfect, but its getting better by the day with more and more extensions. + +We also offer our own marketplace for open source extensions, but plan to +deprecate it at a future date and completely migrate to Open-VSX. + +These are the closed-source extensions that are presently unavailable: + +1. [Live Share](https://visualstudio.microsoft.com/services/live-share). We may + implement something similar (see + [#33](https://github.com/coder/code-server/issues/33)) +1. [Remote Extensions (SSH, Containers, + WSL)](https://github.com/microsoft/vscode-remote-release). We may implement + these again at some point, see + ([#1315](https://github.com/coder/code-server/issues/1315)). + +For more about the closed source portions of VS Code, see [vscodium/vscodium](https://github.com/VSCodium/vscodium#why-does-this-exist). + +## How can I request an extension that's missing from the marketplace? + +To add an extension to Open-VSX, please see [open-vsx/publish-extensions](https://github.com/open-vsx/publish-extensions). +We no longer plan to add new extensions to our legacy extension gallery. + +## How do I install an extension? + +You can install extensions from the marketplace using the extensions sidebar in +code-server or from the command line: + +```console +code-server --install-extension +# example: code-server --install-extension wesbos.theme-cobalt2 + +# From the Coder extension marketplace +code-server --install-extension ms-python.python + +# From a downloaded VSIX on the file system +code-server --install-extension downloaded-ms-python.python.vsix +``` + +## How do I install an extension manually? + +If there's an extension unavailable in the marketplace or an extension that +doesn't work, you can download the VSIX from its GitHub releases or build it +yourself. + +Once you have downloaded the VSIX to the remote machine, you can either: + +- Run the **Extensions: Install from VSIX** command in the Command Palette. +- Run `code-server --install-extension ` in the terminal + +You can also download extensions using the command line. For instance, +downloading from OpenVSX can be done like this: + +```shell +code-server --install-extension +``` + +## How do I use my own extensions marketplace? + +If you own a marketplace that implements the VS Code Extension Gallery API, you +can point code-server to it by setting `$EXTENSIONS_GALLERY`. +This corresponds directly with the `extensionsGallery` entry in in VS Code's `product.json`. + +For example: + +```bash +export EXTENSIONS_GALLERY='{"serviceUrl": "https://my-extensions/api"}' +``` + +Though you can technically use Microsoft's marketplace in this manner, we +strongly discourage you from doing so since this is [against their Terms of Use](#why-cant-code-server-use-microsofts-extension-marketplace). + +For further information, see [this +discussion](https://github.com/microsoft/vscode/issues/31168#issue-244533026) +regarding the use of the Microsoft URLs in forks, as well as [VSCodium's +docs](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions--marketplace). + +## Where are extensions stored? + +Extensions are stored in `~/.local/share/code-server/extensions` by default. + +On Linux and macOS if you set the `XDG_DATA_HOME` environment variable, the +extensions directory will be `$XDG_DATA_HOME/code-server/extensions`. In +general, we try to follow the XDG directory spec. + +## Where is VS Code configuration stored? + +VS Code configuration such as settings and keybindings are stored in +`~/.local/share/code-server` by default. + +On Linux and macOS if you set the `XDG_DATA_HOME` environment variable, the data +directory will be `$XDG_DATA_HOME/code-server`. In general, we try to follow the +XDG directory spec. + +## How can I reuse my VS Code configuration? + +You can use the [Settings +Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) +extension for this purpose. + +Alternatively, you can also pass `--user-data-dir ~/.vscode` or copy `~/.vscode` +into `~/.local/share/code-server` to reuse your existing VS Code extensions and +configuration. + +## How does code-server decide what workspace or folder to open? + +code-server tries the following in this order: + +1. The `workspace` query parameter +2. The `folder` query parameter +3. The workspace or directory passed via the command line +4. The last opened workspace or directory + +## Can I open a file at a specific line from a URL? + +Yes. In addition to `workspace` and `folder`, code-server supports VS Code's +`payload` query parameter, which can open a specific file — optionally at a +line and column — once the workbench loads. + +`payload` is a URL-encoded JSON array of `[key, value]` string pairs. The +`openFile` key takes a `vscode-remote:///` URI, where +`` is the host you use to reach code-server. Add +`["gotoLineMode","true"]` to have a trailing `:line[:column]` suffix on the +path interpreted as a cursor position: + +```text +https://code.example.com/?folder=/home/coder/project&payload=[["gotoLineMode","true"],["openFile","vscode-remote://code.example.com/home/coder/project/src/app.py:10:5"]] +``` + +(with the `payload` value URL-encoded). Notes: + +- Paths must be absolute; there is no form relative to `folder`. +- This is upstream VS Code web behavior (the same mechanism vscode.dev uses), + so it works without any code-server-specific configuration. + +For example, to generate links from a shell: + +```sh +#!/bin/sh +# usage: code-link [line[:column]] +HOST=code.example.com +payload="[[\"gotoLineMode\",\"true\"],[\"openFile\",\"vscode-remote://$HOST$1${2:+:$2}\"]]" +printf 'https://%s/?folder=%s&payload=%s\n' "$HOST" "$(dirname "$1")" \ + "$(printf '%s' "$payload" | jq -sRr @uri)" +``` + +## How do I access my Documents/Downloads/Desktop folders in code-server on macOS? + +Newer versions of macOS require permission through a non-UNIX mechanism for +code-server to access the Desktop, Documents, Pictures, Downloads, and other folders. + +You may have to give Node.js full disk access, since it doesn't implement any of the macOS permission request features natively: + +1. Find where Node.js is installed on your machine + + ```console + $ which node + /usr/local/bin/node + ``` + +2. Grant Node.js full disk access. Open **System Preferences** > **Security & + Privacy** > **Privacy** > **Full Disk Access**. Then, click the 🔒 to unlock, + click **+**, and select the Node.js binary you located in the previous step. + +See [#2794](https://github.com/coder/code-server/issues/2794) for additional context. + +## How do I direct server-side requests through a proxy? + +> code-server proxies only server-side requests. + +To direct server-side requests through a proxy, code-server supports the +following environment variables: + +- `$HTTP_PROXY` +- `$HTTPS_PROXY` +- `$NO_PROXY` + +```sh +export HTTP_PROXY=https://134.8.5.4 +export HTTPS_PROXY=https://134.8.5.4 +# Now all of code-server's server side requests will go through +# https://134.8.5.4 first. +code-server +``` + +- See + [proxy-from-env](https://www.npmjs.com/package/proxy-from-env#environment-variables) + for a detailed reference on these environment variables and their syntax (note + that code-server only uses the `http` and `https` protocols). +- See [proxy-agent](https://www.npmjs.com/package/proxy-agent) for information + on on the supported proxy protocols. + +## How do I debug issues with code-server? + +First, run code-server with the `debug` logging (or `trace` to be really +thorough) by setting the `--log` flag or the `LOG_LEVEL` environment variable. +`-vvv` and `--verbose` are aliases for `--log trace`. + +First, run code-server with `debug` logging (or `trace` logging for more +thorough messages) by setting the `--log` flag or the `LOG_LEVEL` environment +variable. + +```text +code-server --log debug +``` + +> Note that the `-vvv` and `--verbose` flags are aliases for `--log trace`. + +Next, replicate the issue you're having so that you can collect logging +information from the following places: + +1. The most recent files from `~/.local/share/code-server/coder-logs` +2. The browser console +3. The browser network tab + +Additionally, collecting core dumps (you may need to enable them first) if +code-server crashes can be helpful. + +## What is the healthz endpoint? + +You can use the `/healthz` endpoint exposed by code-server to check whether +code-server is running without triggering a heartbeat. The response includes a +status (e.g., `alive` or `expired`) and a timestamp for the last heartbeat +(the default is `0`). + +```json +{ + "status": "alive", + "lastHeartbeat": 1599166210566 +} +``` + +This endpoint doesn't require authentication. + +## What is the heartbeat file? + +As long as there is an active browser connection, code-server touches +`~/.local/share/code-server/heartbeat` once a minute. + +If you want to shutdown code-server if there hasn't been an active connection +after a predetermined amount of time, you can use the --idle-timeout-seconds flag +or set an `CODE_SERVER_IDLE_TIMEOUT_SECONDS` environment variable. + +## How do I change the reconnection grace time? + +Pass `--reconnection-grace-time ` to `code-server`, set +`CODE_SERVER_RECONNECTION_GRACE_TIME=`, or add +`reconnection-grace-time: ` to +`~/.config/code-server/config.yaml`. + +The default is `10800` (3 hours). If a client stays disconnected longer than +this, it must reload the window. + +## How do I change the password? + +Edit the `password` field in the code-server config file at +`~/.config/code-server/config.yaml`, then restart code-server: + +```bash +sudo systemctl restart code-server@$USER +``` + +## Can I store my password hashed? + +Yes, you can do so by setting the value of `hashed-password` instead of `password`. Generate the hash with: + +```shell +echo -n "thisismypassword" | npx argon2-cli -e +$argon2i$v=19$m=4096,t=3,p=1$wst5qhbgk2lu1ih4dmuxvg$ls1alrvdiwtvzhwnzcm1dugg+5dto3dt1d5v9xtlws4 +``` + +Replace `thisismypassword` with your actual password and **remember to put it +inside quotes**! For example: + +```yaml +auth: password +hashed-password: "$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4" +``` + +The `hashed-password` field takes precedence over `password`. + +If you're using Docker Compose file, in order to make this work, you need to change all the single $ to $$. For example: + +```yaml +- HASHED_PASSWORD=$$argon2i$$v=19$$m=4096,t=3,p=1$$wST5QhBgk2lu1ih4DMuxvg$$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4 +``` + +## Is multi-tenancy possible? + +If you want to run multiple code-servers on shared infrastructure, we recommend +using virtual machines (provide one VM per user). This will easily allow users +to run a Docker daemon. If you want to use Kubernetes, you'll want to +use [kubevirt](https://kubevirt.io) or +[sysbox](https://github.com/nestybox/sysbox) to give each user a VM-like +experience instead of just a container. + +## Can I use Docker in a code-server container? + +If you'd like to access Docker inside of code-server, mount the Docker socket in +from `/var/run/docker.sock`. Then, install the Docker CLI in the code-server +container, and you should be able to access the daemon. + +You can even make volume mounts work. Let's say you want to run a container and +mount into `/home/coder/myproject` from inside the `code-server` container. You +need to make sure the Docker daemon's `/home/coder/myproject` is the same as the +one mounted inside the `code-server` container, and the mount will work. + +If you want Docker enabled when deploying on Kubernetes, look at the `values.yaml` +file for the 3 fields: `extraVars`, `lifecycle.postStart`, and `extraContainers`. + +## How do I disable telemetry? + +Use the `--disable-telemetry` flag to disable telemetry. + +> We use the data collected only to improve code-server. + +## What's the difference between code-server and Coder? + +code-server and Coder are both applications that can be installed on any +machine. The main difference is who they serve. Out of the box, code-server is +simply VS Code in the browser while Coder is a tool for provisioning remote +development environments via Terraform. + +code-server was built for individuals while Coder was built for teams. In Coder, you create Workspaces which can have applications like code-server. If you're looking for a team solution, you should reach for [Coder](https://github.com/coder/coder). + +## What's the difference between code-server and Theia? + +At a high level, code-server is a patched fork of VS Code that runs in the +browser whereas Theia takes some parts of VS Code but is an entirely different +editor. + +[Theia](https://github.com/eclipse-theia/theia) is a browser IDE loosely based +on VS Code. It uses the same text editor library +([Monaco](https://github.com/Microsoft/monaco-editor)) and extension API, but +everything else is different. Theia also uses [Open VSX](https://open-vsx.org) +for extensions. + +Theia doesn't allow you to reuse your existing VS Code config. + +## What's the difference between code-server and OpenVSCode-Server? + +code-server and OpenVSCode-Server both allow you to access VS Code via a +browser. OpenVSCode-Server is a direct fork of VS Code with changes comitted +directly while code-server pulls VS Code in via a submodule and makes changes +via patch files. + +However, OpenVSCode-Server is scoped at only making VS Code available as-is in +the web browser. code-server contains additional changes to make the self-hosted +experience better (see the next section for details). + +## What's the difference between code-server and GitHub Codespaces? + +Both code-server and GitHub Codespaces allow you to access VS Code via a +browser. GitHub Codespaces, however, is a closed-source, paid service offered by +GitHub and Microsoft. + +On the other hand, code-server is self-hosted, free, open-source, and can be run +on any machine with few limitations. + +Specific changes include: + +- Password authentication +- The ability to host at sub-paths +- Self-contained web views that do not call out to Microsoft's servers +- The ability to use your own marketplace and collect your own telemetry +- Built-in proxy for accessing ports on the remote machine integrated into + VS Code's ports panel +- Settings are stored on disk like desktop VS Code, instead of in browser + storage (note that state is still stored in browser storage). +- Wrapper process that spawns VS Code on-demand and has a separate CLI +- Notification when updates are available +- [Some other things](https://github.com/coder/code-server/tree/main/patches) + +Some of these changes appear very unlikely to ever be adopted by Microsoft. +Some may make their way upstream, further closing the gap, but at the moment it +looks like there will always be some subtle differences. + +## What's the difference between code-server and VS Code web? + +VS Code web (which can be ran using `code serve-web`) has the same differences +as the Codespaces section above. VS Code web can be a better choice if you need +access to the official Microsoft marketplace. + +## Does code-server have any security login validation? + +code-server supports setting a single password and limits logins to two per +minute plus an additional twelve per hour. + +## Are there community projects involving code-server? + +Visit the [awesome-code-server](https://github.com/coder/awesome-code-server) +repository to view community projects and guides with code-server! Feel free to +add your own! + +## How do I change the port? + +There are two ways to change the port on which code-server runs: + +1. with an environment variable e.g. `PORT=3000 code-server` +2. using the flag `--bind-addr` e.g. `code-server --bind-addr localhost:3000` + +## How do I hide the coder/coder promotion in Help: Getting Started? + +You can pass the flag `--disable-getting-started-override` to `code-server` or +you can set the environment variable `CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or +`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`. + +## How do I disable the proxy? + +You can pass the flag `--disable-proxy` to `code-server` or +you can set the environment variable `CS_DISABLE_PROXY=1` or +`CS_DISABLE_PROXY=true`. + +Note, this option currently only disables the proxy routes to forwarded ports, including +the domain and path proxy routes over HTTP and WebSocket; however, it does not +disable the automatic port forwarding in the VS Code workbench itself. In other words, +user will still see the Ports tab and notifications, but will not be able to actually +use access the ports. It is recommended to set `remote.autoForwardPorts` to `false` +when using the option. + +## How do I disable file download? + +You can pass the flag `--disable-file-downloads` to `code-server` + +## Why do web views not work? + +Web views rely on service workers, and service workers are only available in a +secure context, so most likely the answer is that you are using an insecure +context (for example an IP address). + +If this happens, in the browser log you will see something like: + +> Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope with script: An SSL certificate error occurred when fetching the script.. + +To fix this, you must either: + +- Access over localhost/127.0.0.1 which is always considered secure. +- Use a domain with a real certificate (for example with Let's Encrypt). +- Use a trusted self-signed certificate with [mkcert](https://mkcert.dev) (or + create and trust a certificate manually). +- Disable security if your browser allows it. For example, in Chromium see + `chrome://flags/#unsafely-treat-insecure-origin-as-secure` + +## Can I run code-server with systemd socket activation? + +Yes. Pass the inherited socket to code-server with `--socket-fd`. systemd +passes the first listening socket as file descriptor `3`. + +Create a socket unit, `~/.config/systemd/user/code-server.socket`: + +```ini +[Socket] +ListenStream=8080 + +[Install] +WantedBy=sockets.target +``` + +And a matching service unit, `~/.config/systemd/user/code-server.service`: + +```ini +[Service] +ExecStart=/usr/bin/code-server --socket-fd 3 +``` + +Then enable and start the socket: + +```bash +systemctl --user enable --now code-server.socket +``` + +code-server will start on the first connection and listen on the socket +systemd created. `--socket-fd` takes precedence over `--socket` and +`--bind-addr`/`--port`/`--host`, and `--socket-mode` is ignored because +systemd owns the socket's permissions. + +Socket activation only changes how code-server binds; your usual +authentication still applies (it keeps prompting for the configured password +unless you set `--auth none`), so keep authentication enabled when exposing the +server. diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md new file mode 100644 index 000000000000..b9c604a51ec9 --- /dev/null +++ b/docs/MAINTAINING.md @@ -0,0 +1,128 @@ + + + +# Maintaining + +- [Releasing](#releasing) + - [Release Candidates](#release-candidates) + - [AUR](#aur) + - [Docker](#docker) + - [nixpkgs](#nixpkgs) + - [npm](#npm) +- [Testing](#testing) +- [Documentation](#documentation) + - [Troubleshooting](#troubleshooting) + + + + +We keep code-server up to date with VS Code releases (there are usually two or +three a month) but we are not generally actively developing code-server aside +from fixing regressions. + +Most of the work is keeping on top of issues and discussions. + +## Releasing + +A release takes two people: one starts it, and a member of +`code-server-release-team` other than that person approves it. Nobody pushes a +tag or edits a draft release: the release workflow creates the tag and publishes +the release itself, once it is approved, and releases cannot be changed after +that. + +1. Check that the changelog lists all the important changes. The release notes + are the changelog's `Unreleased` section at the released commit, so get them + right in a PR before releasing. +2. Make sure the changelog entry lists the current version of VS Code. +3. Start the release, either way: + - Merge the `update/` PR. Merging it starts the Release + workflow on the merge commit. + - Or go to GitHub Actions > Release > Run workflow on `main`, with the version + and the full SHA of the commit on `main` to release. For the version we + match VS Code's minor and patch version. The patch number may become + temporarily out of sync if we need to put out a patch, but if we make our + own minor change then we will not release it until the next minor VS Code + release. +4. CI builds the NPM package and the platform-specific packages from that + commit, and attests each file's provenance. +5. A member of `code-server-release-team` other than the person who started the + release reviews the run and approves the `release-approval` deployment. +6. The workflow then tags the commit and publishes the release with the built + files. Publishing starts the publish workflow (npm, Docker Hub, GHCR and the + AUR PR). It checks that the release came from the release workflow, and every + file's attestation, before it publishes anything. +7. Update the changelog with the release date and bump the Helm chart version + once the Docker images have published. +8. Merge the PR submitted to coder/code-server-aur repo. + +#### Release Candidates + +We prefer to do release candidates so the community can test things before a +full-blown release. To do this follow the same steps as above but: + +1. Run the Release workflow by hand with a `-rc.` suffix on the version + and "pre-release" checked. CI will not publish pre-releases to npm, Docker or + the AUR. +2. Do not update the chart version or merge in the changelog until the final + release. + +#### AUR + +We publish to AUR as a package +[here](https://aur.archlinux.org/packages/code-server/). This process is manual +and can be done by following the steps in [this +repo](https://github.com/coder/code-server-aur). + +#### Docker + +We publish code-server as a Docker image +[here](https://hub.docker.com/r/codercom/code-server), tagging it both with the +version and latest. + +This is currently automated with the release process. + +#### nixpkgs + +We publish code-server in nixpkgs but it must be updated manually. + +#### npm + +We publish code-server as a npm package +[here](https://www.npmjs.com/package/code-server/v/latest). + +This is currently automated with the release process. + +## Testing + +Our testing structure is laid out under our [Contributing +docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test). + +If you're ever looking to add more tests, here are a few ways to get started: + +- run `pnpm run test:unit` and look at the coverage chart. You'll see all the + uncovered lines. This is a good place to start. +- look at `test/scripts` to see which scripts are tested. We can always use more + tests there. +- look at `test/e2e`. We can always use more end-to-end tests. + +Otherwise, talk to a current maintainer and ask which part of the codebase is +lacking most when it comes to tests. + +## Documentation + +### Troubleshooting + +Our docs are hosted on [Vercel](https://vercel.com/). Vercel only shows logs in +realtime, which means you need to have the logs open in one tab and reproduce +your error in another tab. Since our logs are private to Coder the organization, +you can only follow these steps if you're a Coder employee. Ask a maintainer for +help if you need it. + +Taking a real scenario, let's say you wanted to troubleshoot [this docs +change](https://github.com/coder/code-server/pull/4042). Here is how you would +do it: + +1. Go to https://vercel.com/codercom/codercom +2. Click "View Function Logs" +3. In a separate tab, open the preview link from github-actions-bot +4. Now look at the function logs and see if there are errors in the logs diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000000..d5259849451c --- /dev/null +++ b/docs/README.md @@ -0,0 +1,80 @@ +# code-server + +[!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/coder/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://coder.com/community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) [![Discord](https://img.shields.io/discord/747933592273027093)](https://discord.com/invite/coder) [![See latest](https://img.shields.io/static/v1?label=Docs&message=see%20latest&color=blue)](https://coder.com/docs/code-server/latest) + +Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and +access it in the browser. + +![Screenshot](./assets/screenshot-1.png) +![Screenshot](./assets/screenshot-2.png) + +## Highlights + +- Code on any device with a consistent development environment +- Use cloud servers to speed up tests, compilations, downloads, and more +- Preserve battery life when you're on the go; all intensive tasks run on your + server + +## Requirements + +See [requirements](https://coder.com/docs/code-server/latest/requirements) for minimum specs, as well as instructions +on how to set up a Google VM on which you can install code-server. + +**TL;DR:** Linux machine with WebSockets enabled, 1 GB RAM, and 2 vCPUs + +## Getting started + +There are four ways to get started: + +1. Using the [install + script](https://github.com/coder/code-server/blob/main/install.sh), which + automates most of the process. The script uses the system package manager if + possible. +2. Manually [installing + code-server](https://coder.com/docs/code-server/latest/install) +3. Deploy code-server to your team with [coder/coder](https://cdr.co/coder-github) +4. Using the [code-server feature for + devcontainers](https://github.com/coder/devcontainer-features/blob/main/src/code-server/README.md), + if you already use devcontainers in your project. + +If you use the install script, you can preview what occurs during the install +process: + +```bash +curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run +``` + +To install, run: + +```bash +curl -fsSL https://code-server.dev/install.sh | sh +``` + +When done, the install script prints out instructions for running and starting +code-server. + +> **Note** +> To manage code-server for a team on your infrastructure, see: [coder/coder](https://cdr.co/coder-github) + +We also have an in-depth [setup and +configuration](https://coder.com/docs/code-server/latest/guide) guide. + +## Questions? + +See answers to [frequently asked +questions](https://coder.com/docs/code-server/latest/FAQ). + +## Want to help? + +See [Contributing](https://coder.com/docs/code-server/latest/CONTRIBUTING) for +details. + +## Hiring + +Interested in [working at Coder](https://coder.com/careers)? Check out [our open +positions](https://coder.com/careers#openings)! + +## For Teams + +We develop [coder/coder](https://cdr.co/coder-github) to help teams to +adopt remote development. diff --git a/docs/SECURITY.md b/docs/SECURITY.md new file mode 100644 index 000000000000..04377d41a645 --- /dev/null +++ b/docs/SECURITY.md @@ -0,0 +1,33 @@ +# Security Policy + +Coder and the code-server team want to keep the code-server project secure and safe for end-users. + +## Tools + +We use the following tools to help us stay on top of vulnerability mitigation. + +- [dependabot](https://dependabot.com/) + - Submits pull requests to upgrade dependencies. We use dependabot's version + upgrades as well as security updates. +- code-scanning + - [CodeQL](https://securitylab.github.com/tools/codeql/) + - Semantic code analysis engine that runs on a regular schedule (see + `codeql-analysis.yml`) + - [trivy](https://github.com/aquasecurity/trivy) + - Comprehensive vulnerability scanner that runs on PRs into the default + branch and scans both our container image and repository code (see + `trivy-scan-repo` and `trivy-scan-image` jobs in `build.yaml`) +- `pnpm audit` + - Audits NPM dependencies. + +## Supported Versions + +Coder sponsors the development and maintenance of the code-server project. We will fix security issues within 90 days of receiving a report and publish the fix in a subsequent release. The code-server project does not provide backports or patch releases for security issues at this time. + +| Version | Supported | +| ------------------------------------------------------- | ------------------ | +| [Latest](https://github.com/coder/code-server/releases) | :white_check_mark: | + +## Reporting a Vulnerability + +To report a vulnerability, please send an email to security[@]coder.com, and our security team will respond to you. diff --git a/docs/android.md b/docs/android.md new file mode 100644 index 000000000000..4541bc7b5fee --- /dev/null +++ b/docs/android.md @@ -0,0 +1,31 @@ +# Running code-server using UserLAnd + +1. Install UserLAnd from [Google Play](https://play.google.com/store/apps/details?id=tech.ula&hl=en_US&gl=US) +2. Install an Ubuntu VM +3. Start app +4. Install Node.js and `curl` using `sudo apt install nodejs npm curl -y` +5. Install `nvm`: + +```shell +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash +``` + +6. Exit the terminal using `exit` and then reopen the terminal +7. Install and use Node.js 24: + +```shell +nvm install 24 +nvm use 24 +``` + +8. Install code-server globally on device with: `npm install --global code-server` +9. Run code-server with `code-server` +10. Access on localhost:8080 in your browser + +# Running code-server using Nix-on-Droid + +1. Install Nix-on-Droid from [F-Droid](https://f-droid.org/packages/com.termux.nix/) +2. Start app +3. Spawn a shell with code-server by running `nix-shell -p code-server` +4. Run code-server with `code-server` +5. Access on localhost:8080 in your browser diff --git a/docs/assets/images/icons/collab.svg b/docs/assets/images/icons/collab.svg new file mode 100644 index 000000000000..239666a993bf --- /dev/null +++ b/docs/assets/images/icons/collab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/images/icons/contributing.svg b/docs/assets/images/icons/contributing.svg new file mode 100644 index 000000000000..c814591e1c7f --- /dev/null +++ b/docs/assets/images/icons/contributing.svg @@ -0,0 +1 @@ + diff --git a/docs/assets/images/icons/faq.svg b/docs/assets/images/icons/faq.svg new file mode 100644 index 000000000000..a3e196d298a9 --- /dev/null +++ b/docs/assets/images/icons/faq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/images/icons/home.svg b/docs/assets/images/icons/home.svg new file mode 100644 index 000000000000..0f7bee254cd3 --- /dev/null +++ b/docs/assets/images/icons/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/images/icons/requirements.svg b/docs/assets/images/icons/requirements.svg new file mode 100644 index 000000000000..c3888f90274f --- /dev/null +++ b/docs/assets/images/icons/requirements.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/images/icons/upgrade.svg b/docs/assets/images/icons/upgrade.svg new file mode 100644 index 000000000000..28c35752f201 --- /dev/null +++ b/docs/assets/images/icons/upgrade.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/images/icons/usage.svg b/docs/assets/images/icons/usage.svg new file mode 100644 index 000000000000..f38aa04813e3 --- /dev/null +++ b/docs/assets/images/icons/usage.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/docs/assets/images/icons/wrench.svg b/docs/assets/images/icons/wrench.svg new file mode 100644 index 000000000000..acca9b7614a1 --- /dev/null +++ b/docs/assets/images/icons/wrench.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/screenshot-1.png b/docs/assets/screenshot-1.png new file mode 100644 index 000000000000..cacbc21bd771 Binary files /dev/null and b/docs/assets/screenshot-1.png differ diff --git a/docs/assets/screenshot-2.png b/docs/assets/screenshot-2.png new file mode 100644 index 000000000000..5861fac0b905 Binary files /dev/null and b/docs/assets/screenshot-2.png differ diff --git a/docs/coder.md b/docs/coder.md new file mode 100644 index 000000000000..eff3423b5b7a --- /dev/null +++ b/docs/coder.md @@ -0,0 +1,48 @@ +# Coder + +To install and run code-server in a Coder workspace, we suggest using the `install.sh` +script in your template like so: + +```terraform +resource "coder_agent" "dev" { + arch = "amd64" + os = "linux" + startup_script = < + + +# Setup Guide + +- [Expose code-server](#expose-code-server) + - [Port forwarding via SSH](#port-forwarding-via-ssh) + - [Using Let's Encrypt with Caddy](#using-lets-encrypt-with-caddy) + - [Using Let's Encrypt with NGINX](#using-lets-encrypt-with-nginx) + - [Using a self-signed certificate](#using-a-self-signed-certificate) + - [TLS 1.3 and Safari](#tls-13-and-safari) + - [Cloudflare Rocket Loader](#cloudflare-rocket-loader) +- [External authentication](#external-authentication) +- [HTTPS and self-signed certificates](#https-and-self-signed-certificates) +- [Accessing web services](#accessing-web-services) + - [Using a subdomain](#using-a-subdomain) + - [Using a subpath](#using-a-subpath) + - [Using your own proxy](#using-your-own-proxy) + - [Stripping `/proxy/` from the request path](#stripping-proxyport-from-the-request-path) + - [Proxying to create a React app](#proxying-to-create-a-react-app) + - [Proxying to a Vue app](#proxying-to-a-vue-app) + - [Proxying to an Angular app](#proxying-to-an-angular-app) + - [Proxying to a Svelte app](#proxying-to-a-svelte-app) + - [Prefixing `/absproxy/` with a path](#prefixing-absproxyport-with-a-path) + - [Preflight requests](#preflight-requests) +- [Internationalization and customization](#internationalization-and-customization) + - [Available keys and placeholders](#available-keys-and-placeholders) + - [Legacy flag](#legacy-flag) + + + + +This article will walk you through exposing code-server securely once you've +completed the [installation process](install.md). + +## Expose code-server + +**Never** expose code-server directly to the internet without some form of +authentication and encryption, otherwise someone can take over your machine via +the terminal. + +By default, code-server uses password authentication. As such, you must copy the +password from code-server's config file to log in. To avoid exposing itself +unnecessarily, code-server listens on `localhost`; this practice is fine for +testing, but it doesn't work if you want to access code-server from a different +machine. + +> **Rate limits:** code-server rate limits password authentication attempts to +> two per minute plus an additional twelve per hour. + +There are several approaches to operating and exposing code-server securely: + +- Port forwarding via SSH +- Using Let's Encrypt with Caddy +- Using Let's Encrypt with NGINX +- Using a self-signed certificate + +### Port forwarding via SSH + +We highly recommend using [port forwarding via +SSH](https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding) to access +code-server. If you have an SSH server on your remote machine, this approach +doesn't require any additional setup at all. + +The downside to SSH forwarding, however, is that you can't access code-server +when using machines without SSH clients (such as iPads). If this applies to you, +we recommend using another method, such as [Let's Encrypt](#let-encrypt) instead. + +> To work properly, your environment should have WebSockets enabled, which +> code-server uses to communicate between the browser and server. + +1. SSH into your instance and edit the code-server config file to disable + password authentication: + + ```console + # Replaces "auth: password" with "auth: none" in the code-server config. + sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml + ``` + +2. Restart code-server: + + ```console + sudo systemctl restart code-server@$USER + ``` + +3. Forward local port `8080` to `127.0.0.1:8080` on the remote instance by running the following command on your local machine: + + ```console + # -N disables executing a remote shell + ssh -N -L 8080:127.0.0.1:8080 [user]@ + ``` + +4. At this point, you can access code-server by pointing your web browser to `http://127.0.0.1:8080`. + +5. If you'd like to make the port forwarding via SSH persistent, we recommend + using [mutagen](https://mutagen.io/documentation/introduction/installation) + to do so. Once you've installed mutagen, you can port forward as follows: + + ```shell + # This is the same as the above SSH command, but it runs in the background + # continuously. Be sure to add `mutagen daemon start` to your ~/.bashrc to + # start the mutagen daemon when you open a shell. + mutagen forward create --name=code-server tcp:127.0.0.1:8080 < instance-ip > :tcp:127.0.0.1:8080 + ``` + +6. Optional, but highly recommended: add the following to `~/.ssh/config` so + that you can detect bricked SSH connections: + + ```bash + Host * + ServerAliveInterval 5 + ExitOnForwardFailure yes + ``` + +> You can [forward your +> SSH](https://developer.github.com/v3/guides/using-ssh-agent-forwarding/) and +> [GPG agent](https://wiki.gnupg.org/AgentForwarding) to the instance to +> securely access GitHub and sign commits without having to copy your keys. + +### Using Let's Encrypt with Caddy + +Using [Let's Encrypt](https://letsencrypt.org) is an option if you want to +access code-server on an iPad or do not want to use SSH port forwarding. + +1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic. + +2. You'll need a domain name (if you don't have one, you can purchase one from + [Google Domains](https://domains.google.com) or the domain service of your + choice). Once you have a domain name, add an A record to your domain that contains your + instance's IP address. + +3. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian): + + ```console + sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https + curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg + curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list + sudo apt update + sudo apt install caddy + ``` + +4. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this: + + ```text + mydomain.com { + reverse_proxy 127.0.0.1:8080 + } + ``` + + If you want to serve code-server from a sub-path, you can do so as follows: + + ```text + mydomain.com/code/* { + uri strip_prefix /code + reverse_proxy 127.0.0.1:8080 + } + ``` + + Remember to replace `mydomain.com` with your domain name! + +5. Reload Caddy: + + ```console + sudo systemctl reload caddy + ``` + +At this point, you should be able to access code-server via +`https://mydomain.com`. + +### Using Let's Encrypt with NGINX + +1. This option requires that the remote machine be exposed to the internet. Make + sure that your instance allows HTTP/HTTPS traffic. + +2. You'll need a domain name (if you don't have one, you can purchase one from + [Google Domains](https://domains.google.com) or the domain service of your + choice). Once you have a domain name, add an A record to your domain that contains your + instance's IP address. + +3. Install NGINX: + + ```bash + sudo apt update + sudo apt install -y nginx certbot python3-certbot-nginx + ``` + +4. Update `/etc/nginx/sites-available/code-server` using sudo with the following + configuration: + + ```text + server { + listen 80; + listen [::]:80; + server_name mydomain.com; + + location / { + proxy_pass http://localhost:8080/; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + proxy_set_header Accept-Encoding gzip; + } + } + ``` + + Be sure to replace `mydomain.com` with your domain name! + +5. Enable the config: + ```console + sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server + sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com + ``` + Be sure to replace `me@example.com` with your actual email. + +At this point, you should be able to access code-server via +`https://mydomain.com`. + +### Using a self-signed certificate + +> Self signed certificates do not work with iPad; see [./ipad.md](./ipad.md) for +> more information. + +Before proceeding, we recommend familiarizing yourself with the [risks of +self-signing a certificate for +SSL](https://security.stackexchange.com/questions/8110). + +We recommend self-signed certificates as a last resort, since self-signed +certificates do not work with iPads and may cause unexpected issues with +code-server. You should only proceed with this option if: + +- You do not want to buy a domain or you cannot expose the remote machine to + the internet +- You do not want to use port forwarding via SSH + +To use a self-signed certificate: + +1. This option requires that the remote machine be exposed to the internet. Make + sure that your instance allows HTTP/HTTPS traffic. + +1. SSH into your instance and edit your code-server config file to use a + randomly generated self-signed certificate: + + ```console + # Replaces "cert: false" with "cert: true" in the code-server config. + sed -i.bak 's/cert: false/cert: true/' ~/.config/code-server/config.yaml + # Replaces "bind-addr: 127.0.0.1:8080" with "bind-addr: 0.0.0.0:443" in the code-server config. + sed -i.bak 's/bind-addr: 127.0.0.1:8080/bind-addr: 0.0.0.0:443/' ~/.config/code-server/config.yaml + # Allows code-server to listen on port 443. + sudo setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node + ``` + +1. Restart code-server: + + ```console + sudo systemctl restart code-server@$USER + ``` + +At this point, you should be able to access code-server via +`https://`. + +If you'd like to avoid the warnings displayed by code-server when using a +self-signed certificate, you can use [mkcert](https://mkcert.dev) to create a +self-signed certificate that's trusted by your operating system, then pass the +certificate to code-server via the `cert` and `cert-key` config fields. + +### TLS 1.3 and Safari + +If you will be using Safari and your configuration does not allow anything less +than TLS 1.3 you will need to add support for TLS 1.2 since Safari does not +support TLS 1.3 for web sockets at the time of writing. If this is the case you +should see OSSStatus: 9836 in the browser console. + +### Cloudflare Rocket Loader + +If you serve code-server through Cloudflare, disable Rocket Loader for that +hostname. Rocket Loader rewrites inline ` - - - \ No newline at end of file diff --git a/packages/app/chrome/webpack.config.js b/packages/app/chrome/webpack.config.js deleted file mode 100644 index 6bfae8d07a89..000000000000 --- a/packages/app/chrome/webpack.config.js +++ /dev/null @@ -1,37 +0,0 @@ -const path = require("path"); -const webpack = require("webpack"); -const merge = require("webpack-merge"); -const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin; -const HtmlWebpackPlugin = require("html-webpack-plugin"); -const prod = process.env.NODE_ENV === "production"; - -module.exports = [ - merge(require(path.join(__dirname, "../../../scripts", "webpack.general.config.js"))(), { - devtool: "none", - mode: "development", - target: "web", - output: { - path: path.join(__dirname, "out"), - filename: "background.js", - }, - entry: [ - "./packages/app/chrome/src/background.ts" - ], - plugins: [ - ] - }), - merge(require(path.join(__dirname, "../../../scripts", "webpack.general.config.js"))(), { - devtool: "none", - mode: "development", - target: "web", - output: { - path: path.join(__dirname, "out"), - filename: "content.js", - }, - entry: [ - "./packages/app/chrome/src/content.ts" - ], - plugins: [ - ] - }), -]; diff --git a/packages/app/chrome/yarn.lock b/packages/app/chrome/yarn.lock deleted file mode 100644 index 61eebde608e2..000000000000 --- a/packages/app/chrome/yarn.lock +++ /dev/null @@ -1,22 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/chrome@^0.0.79": - version "0.0.79" - resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.79.tgz#1c83b35bd9b21b6204fb56e4816a1ea65dc013e5" - integrity sha512-4+Xducpig6lpwVX65Hk8KSZwRoURHXMDbd38SDNcV8TBaw4xyJki39fjB1io2h7ip+BsyFvgTm9OxR5qneLPiA== - dependencies: - "@types/filesystem" "*" - -"@types/filesystem@*": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.29.tgz#ee3748eb5be140dcf980c3bd35f11aec5f7a3748" - integrity sha512-85/1KfRedmfPGsbK8YzeaQUyV1FQAvMPMTuWFQ5EkLd2w7szhNO96bk3Rh/SKmOfd9co2rCLf0Voy4o7ECBOvw== - dependencies: - "@types/filewriter" "*" - -"@types/filewriter@*": - version "0.0.28" - resolved "https://registry.yarnpkg.com/@types/filewriter/-/filewriter-0.0.28.tgz#c054e8af4d9dd75db4e63abc76f885168714d4b3" - integrity sha1-wFTor02d11205jq8dviFFocU1LM= diff --git a/packages/app/common/package.json b/packages/app/common/package.json deleted file mode 100644 index 1864e02bf456..000000000000 --- a/packages/app/common/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@coder/app-common", - "main": "src/app.ts", - "dependencies": { - "material-components-web": "^0.44.0", - "react": "^16.8.1", - "react-dom": "^16.8.1" - }, - "devDependencies": { - "@types/react": "^16.8.2", - "@types/react-dom": "^16.8.0" - } -} diff --git a/packages/app/common/src/app.scss b/packages/app/common/src/app.scss deleted file mode 100644 index 99195139d034..000000000000 --- a/packages/app/common/src/app.scss +++ /dev/null @@ -1,279 +0,0 @@ -@font-face { - font-family: 'aktiv-grotesk'; - font-weight: 400; - // src: url("fonts/AktivGroteskRegular.ttf"); /* IE9 Compat Modes */ - src: url("fonts/AktivGroteskRegular.woff2") format("woff2"), url("fonts/AktivGroteskRegular.woff") format("woff"); /* Pretty Modern Browsers */ -} - -@font-face { - font-family: 'aktiv-grotesk'; - font-weight: 500; - src: url("fonts/AktivGroteskMedium.woff2") format("woff2"), url("fonts/AktivGroteskMedium.woff") format("woff"); /* Pretty Modern Browsers */ - // src: url("fonts/AktivGroteskMedium.ttf"); -} - -@font-face { - font-family: 'aktiv-grotesk'; - font-weight: 700; - src: url("fonts/AktivGroteskBold.woff2") format("woff2"), url("fonts/AktivGroteskBold.woff") format("woff"); /* Pretty Modern Browsers */ - // src: url("fonts/AktivGroteskBold.ttf") format("ttf"); /* IE9 Compat Modes */ -} - -body, button, input { - font-family: 'aktiv-grotesk',sans-serif !important; -} - -body { - margin: 0; - background-color: #F6F8FB; - --mdc-theme-primary: #2A2E37; -} - -webview { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - width: 100%; - height: 100%; - opacity: 0; - pointer-events: none; - transition: 150ms opacity ease; - - &.active { - opacity: 1; - pointer-events: all; - } -} - -.logo-fill { - fill: #2A2E37; -} - -.main { - & > .header { - width: 100%; - height: 71px; - border-bottom: 1px solid rgba(117, 122, 131, 0.1); - display: flex; - margin-bottom: 60px; - - .logo { - max-height: fit-content; - width: 145px; - } - - .shrinker { - max-width: 1145px; - width: 100%; - margin: 0 auto; - display: flex; - } - } - - .content { - max-width: 960px; - width: 100%; - padding-bottom: 100px; - margin: 0 auto; - } -} - -.servers { - color: #2B343B; - - & > .header { - display: flex; - flex-direction: row; - align-items: center; - padding-bottom: 21px; - - h3 { - font-size: 24px; - font-weight: 500; - letter-spacing: 0.35px; - line-height: 33px; - margin: 0; - margin-left: 30px; - } - - .add-server { - margin-left: auto; - border-radius: 24px; - font-weight: bold; - font-size: 14px; - letter-spacing: 1.25px; - } - - .refresh { - margin-left: 16px; - margin-right: 15px; - cursor: pointer; - - svg { - @keyframes rotate { - 100% { transform: rotate(360deg); } - } - - &.refreshing { - animation: rotate 1s linear infinite; - } - } - } - } - - & > .grid { - display: grid; - grid-template-columns: 1fr 1.6fr 1.3fr 1.1fr 0.6fr 0.4fr; - box-shadow: 0 18px 80px 10px rgba(69, 65, 78, 0.08); - border-radius: 0 0 5px 5px; - - .mdc-linear-progress { - grid-column-start: 1; - grid-column-end: 7; - // height: 0; - position: relative; - --mdc-theme-primary: rgb(107, 109, 102); - height: 5px; - - &:after { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - background-color: #2A2E37; - transition: 500ms opacity ease; - content: " "; - } - - &.loading { - &:after { - opacity: 0; - } - - } - } - - .title, .value { - padding-top: 14px; - padding-bottom: 14px; - } - - .title { - background-color: var(--mdc-theme-primary); - font-size: 10px; - color: #9D9FA4; - font-weight: bold; - letter-spacing: 2px; - line-height: 12px; - text-transform: uppercase; - // padding-top: 15px; - // padding-bottom: 10px; - - &:first-child { - padding-left: 30px; - border-radius: 10px 0 0 0; - } - - &:nth-child(6) { - padding-right: 30px; - border-radius: 0 10px 0 0; - } - - &.servername { - color: white; - } - } - - .value { - border-top: 1px solid #EBEBF2; - font-size: 14px; - letter-spacing: 0.2px; - display: flex; - align-items: center; - color: #717680; - background-color: white; - - &.dark { - background-color: #F6F8FB; - } - - &.servername { - .logo { - height: 25px; - } - } - - &.strong { - font-weight: 600; - color: #2B343B; - font-size: 14px; - letter-spacing: 0.6px; - } - - &.status { - padding-left: 36px; - - span { - margin-left: 7px; - line-height: 0px; - } - } - - &.buttons { - button { - margin-left: auto; - border-radius: 24px; - border: 1px solid #CFD1D7; - font-size: 14px; - font-weight: bold; - letter-spacing: 1.25px; - line-height: 16px; - padding-left: 18px; - padding-right: 18px; - } - } - - &.icons { - padding-left: 16px; - } - - &:last-child { - border-bottom-right-radius: 5px; - } - - &:nth-last-child(6) { - border-bottom-left-radius: 5px; - } - } - } -} - -.flex-row { - display: flex; - flex-direction: row; -} - -.floater { - box-shadow: 0 8px 80px 10px rgba(69, 65, 78, 0.08); - border-radius: 10px; - padding: 3em; - min-width: 300px; - width: 100%; - - & > h1 { - font-size: 3.5em; - margin-top: 0px; - - // margin-bottom: 0px; - - } -} - -.mdc-ripple-upgraded--unbounded { - padding: 2px; - padding-top: 5px; - cursor: pointer; -} \ No newline at end of file diff --git a/packages/app/common/src/app.tsx b/packages/app/common/src/app.tsx deleted file mode 100644 index 65d457f8ec8b..000000000000 --- a/packages/app/common/src/app.tsx +++ /dev/null @@ -1,33 +0,0 @@ -//@ts-ignore -import { MDCTextField } from "@material/textfield"; -import { TcpHost } from "./connection"; -import { StorageProvider } from "./storage"; -import "material-components-web/dist/material-components-web.css"; -import "./app.scss"; -import "./tooltip.scss"; - -import * as React from "react"; -import { render } from "react-dom"; -import { Main } from "./containers"; - -export * from "./connection"; -export interface App { - readonly tcp: TcpHost; - readonly storage: StorageProvider; - readonly node: HTMLElement; -} - -export interface RegisteredServer { - readonly host: "coder" | "self"; - readonly hostname: string; - readonly name: string; -} - -export const create = async (app: App): Promise => { - let servers = await app.storage.get("servers"); - if (!servers) { - servers = []; - } - - render(
, app.node); -}; diff --git a/packages/app/common/src/connection.ts b/packages/app/common/src/connection.ts deleted file mode 100644 index f4c1e022b783..000000000000 --- a/packages/app/common/src/connection.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Event } from "@coder/events"; -import { TunnelCloseEvent } from "@coder/tunnel/src/client"; - -export interface TcpHost { - listen(host: string, port: number): Promise; -} - -export interface TcpServer { - readonly onConnection: Event; - close(): Promise; -} - -export interface TcpConnection { - readonly onData: Event; - send(data: ArrayBuffer): Promise; - close(): Promise; -} diff --git a/packages/app/common/src/containers.tsx b/packages/app/common/src/containers.tsx deleted file mode 100644 index 38deccd35e80..000000000000 --- a/packages/app/common/src/containers.tsx +++ /dev/null @@ -1,573 +0,0 @@ -//@ts-ignore -import { MDCRipple } from "@material/ripple"; -//@ts-ignore -import { MDCTextField } from "@material/textfield"; -//@ts-ignore -import { MDCLinearProgress } from "@material/linear-progress"; -import * as React from "react"; -import * as ReactDOM from "react-dom"; -import { RegisteredServer } from "./app"; - -// tslint:disable-next-line:no-any -declare var WebSettings: any; - -interface AuthedUser { - readonly username: string; -} - -export class Main extends React.Component { - private webview: HTMLWebViewElement | undefined; - - public constructor(props: void) { - super(props); - this.state = { - view: "servers", - loading: false, - }; - } - - public componentDidMount(): void { - window.addEventListener("message", (event) => { - if (event.data === "back") { - if (this.webview) { - this.webview.classList.remove("active"); - } - } - if (event.data === "loaded") { - if (this.webview) { - // this.setState({ loading: false }); - // this.webview.classList.add("active"); - } - } - }); - - if (this.webview) { - this.webview.addEventListener("error", (event) => { - console.error(event); - }); - this.webview.addEventListener("loadstart", (event) => { - this.setState({ loading: true }); - }); - this.webview.addEventListener("loadstop", (event) => { - this.setState({ loading: false }); - this.webview!.classList.add("active"); - // tslint:disable-next-line:no-any - const cw = (this.webview as any).contentWindow as Window; - cw.postMessage("app", "*"); - }); - } - } - - public render(): JSX.Element { - return ( -
-
-
- -
-
-
- {((): JSX.Element => { - switch (this.state.view) { - case "servers": - return ( - { - if (this.webview) { - this.webview.setAttribute("src", server.hostname); - } - }} - onAddServer={() => this.setState({ view: "add-server" })} - loading={this.state.loading} - /> - ); - case "add-server": - return ( -
Add server
- ); - } - })()} -
- this.webview = wv}> -
- ); - } -} - -export class AddServer extends React.Component { - public render(): JSX.Element { - return ( -
-

Add Server

-

Something about what you can do once you add your own server. A link to setup guides for this would be great as well.

- -

-
- ); - } -} - -export class Servers extends React.Component<{ - readonly user?: AuthedUser; - readonly servers: ReadonlyArray; - readonly onSelect: (server: RegisteredServer) => void; - readonly onAddServer: () => void; - readonly loading: boolean; -}, { - readonly refreshing: boolean; -}> { - // tslint:disable-next-line:no-any - public constructor(props: any) { - super(props); - this.state = { - refreshing: false, - }; - } - - public render(): JSX.Element { - return ( -
-
-

Servers

- - -
- this.doRefresh()} className={this.state.refreshing ? "refreshing" : ""} width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink"> - - - - - - - - - - -
-
-
-
-
- Status -
-
- Server Name -
-
- Hostname -
-
- Details -
-
- {/* Used for continue/launch buttons */} -
-
- {/* Used for logout and delete buttons */} -
- -
{ - if (d) new MDCLinearProgress(d)}}> -
-
-
- -
-
- -
-
- - {this.props.servers.map((server, i) => { - return ( - this.props.onSelect(server)} /> - ); - })} -
-
- ); - } - - private doRefresh(): void { - if (this.state.refreshing) { - return; - } - - this.setState({ - refreshing: true, - }, () => { - setTimeout(() => { - this.setState({ - refreshing: false, - }); - }, 1500); - }); - } -} - -interface ServerProps { - readonly user?: AuthedUser; - readonly server: RegisteredServer; - readonly onSelect: () => void; -} - -export class Server extends React.Component { - // tslint:disable-next-line:no-any - public constructor(props: ServerProps) { - super(props); - this.state = { - status: props.server.host === "coder" ? "Online" : "Checking", - version: "", - }; - } - - public componentWillMount(): void { - if (this.props.server.host !== "self") { - return; - } - - const xhr = new XMLHttpRequest(); - xhr.open("GET", this.props.server.hostname); - xhr.addEventListener("error", (err) => { - this.setState({ - status: "Offline", - }); - }); - xhr.addEventListener("loadend", () => { - if (xhr.status === 200) { - this.setState({ - status: "Online", - version: process.env.VERSION, - }); - } else { - this.setState({ - status: "Offline", - }); - } - }); - xhr.send(); - } - - public render(): JSX.Element { - return ( - <> -
- {((): JSX.Element => { - switch (this.state.status) { - case "Offline": - return ( - - - - - - - - ); - case "Online": - return ( - - - - - - - - - ); - case "Checking": - return ( - - - - - - - ); - default: - throw new Error("unsupported status"); - } - })()} - - {this.state.status} - -
-
- {this.props.server.host === "coder" ? ( - - ) : this.props.server.name} -
-
- {this.props.server.hostname} -
-
- {this.props.server.host === "coder" && this.props.user ? `Logged in as ${this.props.user.username}` : this.state.version} -
-
- -
-
- -
- {this.props.server.host === "coder" ? ( - - - - - - - - - ) : ( - - - - - - - - - - )} -
-
-
- - ); - } - - private get extraClasses(): string { - return this.props.server.host === "coder" ? "dark" : ""; - } -} - -export class Input extends React.Component<{ - readonly label: string; - readonly id: string; - readonly type?: string; -}> { - private wrapper: HTMLDivElement | undefined; - - public componentDidMount(): void { - if (this.wrapper) { - const textInput = new MDCTextField(this.wrapper); - } - } - - public render(): JSX.Element { - return ( -
this.wrapper = i}> - -
-
-
- -
-
-
-
- ); - } -} - -export class Button extends React.Component<{ - readonly type: "outlined" | "unelevated"; - readonly className?: string; - readonly onClick?: () => void; -}> { - private button: HTMLButtonElement | undefined; - - public componentDidMount(): void { - if (this.button) { - const b = new MDCRipple(this.button); - } - } - - public render(): JSX.Element { - return ( - - ); - } -} - -export class Tooltip extends React.Component<{ - readonly message: string; -}> { - public componentDidMount(): void { - Object.keys(this.refs).forEach((ref) => { - const el = this.refs[ref]; - if (el) { - const element = ReactDOM.findDOMNode(el); - if (element) { - const te = document.createElement("div"); - te.className = "md-tooltip-content"; - te.innerHTML = this.props.message; - element.appendChild(te); - (element as HTMLElement).classList.add("md-tooltip"); - } - } - }); - } - - public render(): JSX.Element { - return ( - <> - {React.Children.map(this.props.children, (element, idx) => { - return React.cloneElement(element as any, { ref: idx }); - })} - - ); - } -} - -export class Ripple extends React.Component<{ - readonly className?: string; -}> { - public componentDidMount(): void { - Object.keys(this.refs).forEach((ref) => { - const el = this.refs[ref]; - if (el) { - const element = ReactDOM.findDOMNode(el); - if (element) { - (element as HTMLElement).classList.add("mdc-ripple-surface"); - (element as HTMLElement).setAttribute("data-mdc-ripple-is-unbounded", ""); - const r = new MDCRipple(element); - } - } - }); - } - - public render(): JSX.Element { - return ( - <> - {React.Children.map(this.props.children, (element, idx) => { - return React.cloneElement(element as any, { ref: idx }); - })} - - ); - } -} - -export class Logo extends React.Component { - public render(): JSX.Element { - return ( - - - - - - - - - - - - - - - - - - ); - } -} - -// const $ = (tagName: K, className?: string, content?: string): HTMLElementTagNameMap[K] => { -// const el = document.createElement(tagName); -// if (className) { -// el.className = className; -// } -// if (content) { -// el.innerText = content; -// } - -// return el; -// }; - -// const createInput = (id: string, labelName: string, type: string = "text"): HTMLDivElement => { -// //
-// // -// // -// //
-// //
-// //
-// // -// //
-// //
-// //
- -// const wrapper = $("div", "mdc-text-field mdc-text-field--outlined"); -// const input = $("input", "mdc-text-field__input"); -// input.type = type; -// input.id = id; -// wrapper.appendChild(input); -// const notchedOutline = $("div", "mdc-notched-outline"); -// notchedOutline.appendChild($("div", "mdc-notched-outline__leading")); -// const notch = $("div", "mdc-notched-outline__notch"); -// const label = $("label", "mdc-floating-label", labelName); -// label.setAttribute("for", id); -// notch.appendChild(label); -// notchedOutline.appendChild(notch); -// wrapper.appendChild(notchedOutline); -// wrapper.appendChild($("div", "mdc-notched-outline__trailing")); - -// const field = new MDCTextField(wrapper); - -// return wrapper; -// }; - -// export const createCoderLogin = (parentNode: HTMLElement): void => { -// parentNode.appendChild($("h1", "header", "Login with Coder")); -// parentNode.appendChild(createInput("username", "Username")); -// parentNode.appendChild($("br")); -// parentNode.appendChild($("br")); -// parentNode.appendChild(createInput("password", "Password", "password")); -// }; diff --git a/packages/app/common/src/fonts/AktivGroteskBold.eot b/packages/app/common/src/fonts/AktivGroteskBold.eot deleted file mode 100644 index 4af6ee989795..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskBold.eot and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskBold.ttf b/packages/app/common/src/fonts/AktivGroteskBold.ttf deleted file mode 100644 index ef0b1dd2bf3c..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskBold.ttf and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskBold.woff b/packages/app/common/src/fonts/AktivGroteskBold.woff deleted file mode 100644 index 143aa7cef00a..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskBold.woff and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskBold.woff2 b/packages/app/common/src/fonts/AktivGroteskBold.woff2 deleted file mode 100644 index 2ad9acc8fe2d..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskBold.woff2 and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskMedium.eot b/packages/app/common/src/fonts/AktivGroteskMedium.eot deleted file mode 100644 index c1756e13d235..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskMedium.eot and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskMedium.ttf b/packages/app/common/src/fonts/AktivGroteskMedium.ttf deleted file mode 100644 index 3475b42d4b71..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskMedium.ttf and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskMedium.woff b/packages/app/common/src/fonts/AktivGroteskMedium.woff deleted file mode 100644 index 1fb3471f9623..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskMedium.woff and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskMedium.woff2 b/packages/app/common/src/fonts/AktivGroteskMedium.woff2 deleted file mode 100644 index 7896573d04c7..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskMedium.woff2 and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskRegular.eot b/packages/app/common/src/fonts/AktivGroteskRegular.eot deleted file mode 100644 index cd34e88c1cdb..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskRegular.eot and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskRegular.ttf b/packages/app/common/src/fonts/AktivGroteskRegular.ttf deleted file mode 100644 index a30d2ec3e6f5..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskRegular.ttf and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskRegular.woff b/packages/app/common/src/fonts/AktivGroteskRegular.woff deleted file mode 100644 index 3149aae5aca3..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskRegular.woff and /dev/null differ diff --git a/packages/app/common/src/fonts/AktivGroteskRegular.woff2 b/packages/app/common/src/fonts/AktivGroteskRegular.woff2 deleted file mode 100644 index 351e9ad1c55b..000000000000 Binary files a/packages/app/common/src/fonts/AktivGroteskRegular.woff2 and /dev/null differ diff --git a/packages/app/common/src/storage.ts b/packages/app/common/src/storage.ts deleted file mode 100644 index b5f8221be0c8..000000000000 --- a/packages/app/common/src/storage.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export interface StorageProvider { - set(key: string, value: T): Promise; - get(key: string): Promise; -} diff --git a/packages/app/common/src/tooltip.scss b/packages/app/common/src/tooltip.scss deleted file mode 100644 index 6a4a93c93fd6..000000000000 --- a/packages/app/common/src/tooltip.scss +++ /dev/null @@ -1,24 +0,0 @@ -.md-tooltip { - position: relative; -} - -.md-tooltip-content { - position: absolute; - bottom: -35px; - left: 50%; - padding: 7px; - transform: translateX(-50%) scale(0); - transition: transform 0.15s cubic-bezier(0, 0, 0.2, 1); - transform-origin: top; - background: rgba(67, 67, 67, 0.97); - color: white; - letter-spacing: 0.3px; - border-radius: 3px; - font-size: 12px; - font-weight: 500; - z-index: 2; -} - -.md-tooltip:hover .md-tooltip-content { - transform: translateX(-50%) scale(1); -} diff --git a/packages/app/common/yarn.lock b/packages/app/common/yarn.lock deleted file mode 100644 index fed23b625e6b..000000000000 --- a/packages/app/common/yarn.lock +++ /dev/null @@ -1,601 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@material/animation@^0.41.0": - version "0.41.0" - resolved "https://registry.yarnpkg.com/@material/animation/-/animation-0.41.0.tgz#315b45b32e1aeebee8a4cf555b8ad52076d09ddd" - integrity sha512-yYAwJbX3Q2AFd4dr6IYOsWLQy2HN8zWOFVl9AbUXunjzTfJCa/ecfXCriaT6qkmoNoHeTdJHRrsQJZC5GsPvzA== - -"@material/auto-init@^0.41.0": - version "0.41.0" - resolved "https://registry.yarnpkg.com/@material/auto-init/-/auto-init-0.41.0.tgz#8a59bb0b83e0f51ead9508074f9a29b2b6a20eec" - integrity sha512-jp6L8MpYu7DudgDfA8iTyD9BwQrYPEDsIJGbqzN9vcCBl5FoBatkB8pcFXKr+1mRBk7T1Qmf6+H5nDtxyXjHEQ== - -"@material/base@^0.41.0": - version "0.41.0" - resolved "https://registry.yarnpkg.com/@material/base/-/base-0.41.0.tgz#badadce711b4c25b1eb889a5e7581e32cd07c421" - integrity sha512-tEyzwBRu3d1H120SfKsDVYZHcqT5lKohh/7cWKR93aAaPDkSvjpKJIjyu2yuSkjpDduVZGzVocYbOvhUKhhzXQ== - -"@material/button@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/button/-/button-0.44.0.tgz#f01dcbea88bdc314e7640b76e5558101c8b4d69d" - integrity sha512-T8u8s8rlB49D9/5Nh5b0XsKRgSq3X0yWGo71MgaTnCnwxt8oZ6PxW/cH6Nn3Xp0NCr3mlSVQs08BviUfAmtlsg== - dependencies: - "@material/elevation" "^0.44.0" - "@material/feature-targeting" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/card@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/card/-/card-0.44.0.tgz#e62050e3e77f525173a015119200055cd7b71bf0" - integrity sha512-fUixXuh133bVp5c1gPIHreL5jwMJEeVIQf0E4xdxhkA+i4ku8fIAvIW62EuCmfJsXicv4q8NG3Ip6pCY+NW3ZA== - dependencies: - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - -"@material/checkbox@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/checkbox/-/checkbox-0.44.0.tgz#5d0eee1db006db9f0fb700bf1c20408292305cf7" - integrity sha512-IzucxG+NuPNyByGmHg/cuYJ5ooMKouuj994PZXZyqb7owfrjjtXm7wjav66cvCowbVbcoa1owQMGBi18C9f4TQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/selection-control" "^0.44.0" - "@material/theme" "^0.43.0" - -"@material/chips@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/chips/-/chips-0.44.0.tgz#bf553a5bf5db7320978402ac92069c9688b84d5a" - integrity sha512-+qrme6sGwYmX/ixHAo3Z1M7lorsxRyKexn1l+BSBX5PBc2f4w5Ml1eYYYcyVGfLX9LXmefRk0G6dUXXPyCE00g== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/checkbox" "^0.44.0" - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/dialog@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/dialog/-/dialog-0.44.0.tgz#388f93f9f225824c75cbe9da8c464a52d79972e8" - integrity sha512-V6ButfknOMKOscL0Y39yLjamxvrIuyugobjf5s44ZeJc+9jUSkC7M3zP+T7rh358NcX+JSPP8iCGmUn/+LXpMQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/dom" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - focus-trap "^4.0.2" - -"@material/dom@^0.41.0": - version "0.41.0" - resolved "https://registry.yarnpkg.com/@material/dom/-/dom-0.41.0.tgz#6756865f97bad4c91ee75e69d769d7cdc25398ae" - integrity sha512-wOJrMwjPddYXpQFZAIaCLWI3TO/6KU1lxESTBzunni8A4FHQVWhokml5Xt85GqZwmPFeIF2s+D0wfbWyrGBuKQ== - -"@material/drawer@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/drawer/-/drawer-0.44.0.tgz#74b3ddfb741bffc72331c7a73cf62716fd3f0ab3" - integrity sha512-AYwFe0jgqqSmJd1bny8JJTA2SScF86Wfbk99lXXEwd/acS8IbnnuH6zfAg6MyJX12FDb8dE8Z/Ok1IwLiVa9sQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/list" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - focus-trap "^4.0.2" - -"@material/elevation@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/elevation/-/elevation-0.44.0.tgz#ca16a67188ce9810dc2fa3d7a39073e72df4b754" - integrity sha512-edNou34yFCSMb6XXe/6Y7AEh8DigWAhBUyIeMiMBD4k1km2xYCJbcnl8FBPJFteOrca97KoJComRlJPB6EurRQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/theme" "^0.43.0" - -"@material/fab@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/fab/-/fab-0.44.0.tgz#0bcbbdfb6f24c53d59e08c9c0d400d2616dea184" - integrity sha512-1CEP4NlXDYioJ/YpSjh/MlIygtoC7CaHqIbucxX1O5WRPmS7K1uPt+o7netbLErAmcJdV/JrI/tqh9kKuX2x/Q== - dependencies: - "@material/animation" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/feature-targeting@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/feature-targeting/-/feature-targeting-0.44.0.tgz#52cc73f0c8a83159de0357aebe74f15f9856fb4c" - integrity sha512-ShuC2TOLfjFpYUCQFtvkqDJhM6HTaucSx5HkRbOvOG+VlpzDx6pAqRUmdVaq2p7tHoQf2vwPMlSVm3gOjWt4VQ== - -"@material/floating-label@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/floating-label/-/floating-label-0.44.0.tgz#8694cd49f6905641b67a9e7a112b820d028f09c7" - integrity sha512-k4npGNxyMtnjgJZNjU5VvqqaUqlbzlbVAhepT8PxYTpj+4Skg6PjHwieTCDCgsbqHvFcQX+WfUrSZXY7wFV7cw== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/rtl" "^0.42.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/form-field@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/form-field/-/form-field-0.44.0.tgz#b7518e885c0e953a2a5fe0140af927c30e066f4e" - integrity sha512-SK+V34dzoBCQ/CHn5nBp8BAh21Vj9p1pcok+/WpYBTeg4EphTYP2nUQLMNEN92l6zjgAYf+g9Ocj3t26HNHWqA== - dependencies: - "@material/base" "^0.41.0" - "@material/rtl" "^0.42.0" - "@material/selection-control" "^0.44.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/grid-list@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/grid-list/-/grid-list-0.44.0.tgz#bd31d992ab1a910731e4a47c11fe91d44e3bc02b" - integrity sha512-NxLL0A48K1O14ZZymFIyf6HDbF33+NgXYXqP2yosTC3Jw4iwmUcJTpFTmSw1U/m1xT4zEpeKEGJ4vjVUWpS9Mg== - dependencies: - "@material/base" "^0.41.0" - "@material/rtl" "^0.42.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/icon-button@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/icon-button/-/icon-button-0.44.0.tgz#febbcfd27d91eca8096ae042b9c07ed0f65345e9" - integrity sha512-n6L7RaRyEci6eGsuBTSEG+t9ATHAHaMlf9zuTWorEnIXY4DAmGO7ggBjw4+1XIOjhpLeIjyJdcvUK6Yz/UVM6Q== - dependencies: - "@material/base" "^0.41.0" - "@material/ripple" "^0.44.0" - "@material/theme" "^0.43.0" - -"@material/icon-toggle@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/icon-toggle/-/icon-toggle-0.44.0.tgz#b9de32f194b5aa9721ca799d59be0f477a5c5305" - integrity sha512-8T1b4iK61/q/3U0iIjEDJ9do5viCQ45IbrQqa8EYCZ1KDU/Q8z5N+bvOzQK8XnTL51BdDRMgP9lfQZh6nszmkA== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/ripple" "^0.44.0" - "@material/theme" "^0.43.0" - -"@material/image-list@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/image-list/-/image-list-0.44.0.tgz#a27996962044ac8c9ce6cb509f63746f08ed2e98" - integrity sha512-kI9aKJdc1Bd02l8nRTGG1wy/lNkECScfnBmCiLQ3XjAFtRYd2eWO0Z/AVvUG3egsIZnZBxqFGGsf5Htm9E/HiQ== - dependencies: - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/layout-grid@^0.41.0": - version "0.41.0" - resolved "https://registry.yarnpkg.com/@material/layout-grid/-/layout-grid-0.41.0.tgz#2e7d3be76313e0684d573b10c2c6a88b3230d251" - integrity sha512-Sa5RNoTGgfIojqJ9E94p7/k11V6q/tGk7HwKi4AQNAPjxield0zcl3G/SbsSb8YSHoK+D+7OXDN+n11x6EqF7g== - -"@material/line-ripple@^0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@material/line-ripple/-/line-ripple-0.43.0.tgz#6cb530bab53f055f3583646a21ad20c1703f3a83" - integrity sha512-sXZYW4Em5uLEnAuVsQCO+sVHsTg7J2TOTJ0+akwZFMmd2tmNicjarQdlGIE9iU7Wjm51NOoLAu6Mz+8kLg90bQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/theme" "^0.43.0" - -"@material/linear-progress@^0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@material/linear-progress/-/linear-progress-0.43.0.tgz#4821424aa24c78de256e74a91d5be3df55c534d9" - integrity sha512-bqkDcob+xp1mFkyBsOkoaLgrtapmz7jznGoI3nmkqyk75EB2XQcn1H8Vr6cnp/jkF4nbKu0GdVJO3VXUFmGmrQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/theme" "^0.43.0" - -"@material/list@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/list/-/list-0.44.0.tgz#cf1910e15b66759334b8618d1110fbcc72c3d326" - integrity sha512-35gkN1+XZaau9d9ngyN2x14bzkj/ajZCDm7mbWibDQy272A16j6KuFLQFA8RUQV04OgL4YPVxY87dpCn/p+uTg== - dependencies: - "@material/base" "^0.41.0" - "@material/dom" "^0.41.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/menu-surface@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/menu-surface/-/menu-surface-0.44.0.tgz#902c081df42859b925a5b4502791b3febf48f1ae" - integrity sha512-s49kvIlQ4H5wvMD4yeHMMqnamPod06IUagMK6Ry0oTpUANSnyeNXxa3HkScl7DMJiS8IJeV21fSLAzlZYP2PDQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - -"@material/menu@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/menu/-/menu-0.44.0.tgz#776ec8a04406266a0a0a13eb140b1fd691e442cb" - integrity sha512-92XvAcv9rBW1jQ3UvwJ8zk9hbSRe/FqSuFdZ9fNPE348dCY2pbcdQfnUJTe3ycAN/I1c5frkrhx8F0II+nfbNQ== - dependencies: - "@material/base" "^0.41.0" - "@material/list" "^0.44.0" - "@material/menu-surface" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - -"@material/notched-outline@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/notched-outline/-/notched-outline-0.44.0.tgz#d5a2e1d649921575a7cd2e88ee4581e4a1809573" - integrity sha512-c3nqOqUQAmW3h4zBbZVbMRdf4nNTYm0tVwXIAwmcCs5nvAthEHnzHwwFddNP7/9Wju6LZ0uqWn6xlyKly0uipw== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/floating-label" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - -"@material/radio@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/radio/-/radio-0.44.0.tgz#f4cacdfabc7d765aa000cb34c5a37966f6d4fd6d" - integrity sha512-ar7uhlfHuSwM9JUUjpv7pLDLE0p436cCMxNTpmMjWabfvo3pMWlExvk72Oj81tBgfxY/uASLB3oj4neudXu9JQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/ripple" "^0.44.0" - "@material/selection-control" "^0.44.0" - "@material/theme" "^0.43.0" - -"@material/ripple@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/ripple/-/ripple-0.44.0.tgz#98920ff8ec4bf5714c97df3d190f02f8a5b476cc" - integrity sha512-MlaW4nUDgzS0JOBfsUawXyTOilr0jn+xvTVn6PEaGh2rmhNA54AhixXvdsVUWE9lfmHAsZV0AJHz2z7nunNhbQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/feature-targeting" "^0.44.0" - "@material/theme" "^0.43.0" - -"@material/rtl@^0.42.0": - version "0.42.0" - resolved "https://registry.yarnpkg.com/@material/rtl/-/rtl-0.42.0.tgz#1836e78186c2d8b996f6fbf97adab203535335bc" - integrity sha512-VrnrKJzhmspsN8WXHuxxBZ69yM5IwhCUqWr1t1eNfw3ZEvEj7i1g3P31HGowKThIN1dc1Wh4LE14rCISWCtv5w== - -"@material/select@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/select/-/select-0.44.0.tgz#8041b4fe6247d013b0f12685fbdf50aa9ff57b35" - integrity sha512-tw3/QIBLuRCT+5IXx4IPiJk7FzeGeR65JEizdRUItH8yzoIiQLs/b2i3KtHM2YBXHgeUcEBF2AOqPX2opdYhug== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/floating-label" "^0.44.0" - "@material/line-ripple" "^0.43.0" - "@material/menu" "^0.44.0" - "@material/menu-surface" "^0.44.0" - "@material/notched-outline" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/selection-control@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/selection-control/-/selection-control-0.44.0.tgz#63d5c65a47a9f54f5a0316b5ecdb5e5f35108609" - integrity sha512-HgCAPnMVMEj4X4ILkFSifqtZ3Tcc5HkU+Lfk9g0807sCaN/qBKWkYKLH2WJUbW8uk+MXK7DgP1khtS5zzanJWA== - dependencies: - "@material/ripple" "^0.44.0" - -"@material/shape@^0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@material/shape/-/shape-0.43.0.tgz#b877acfd8be8abc9ddcf6601eb60dd0588292415" - integrity sha512-KGnoQV4G2OQbMe5Lr5Xbk8XNlO93Qi/juxXtd2wrAfiaPmktD8ug0CwdVDOPBOmj9a0gX3Ofi9XWcoU+tLEVjg== - -"@material/slider@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/slider/-/slider-0.44.0.tgz#2055df894eb725e541cde50a544719c07934755b" - integrity sha512-Lnn2fdUesXX4O0UpJzveEuOj+og+dXCwhal73u3l3NXEdc/eRgYxwWdF3ww4MmCZ786EwUmjb4vIc9olN4DO3A== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/rtl" "^0.42.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/snackbar@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/snackbar/-/snackbar-0.44.0.tgz#d98672b849f5f295e4fac2d474a9c80f11945518" - integrity sha512-KhCrmJm8Zu/ZZPuRCGfMKsZ0vudINlNgTjlOau0kQ/UgR1xBUvLOE8NjyXZr0RQz5obyW7xpyIWIpscn0IUeyw== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/button" "^0.44.0" - "@material/dom" "^0.41.0" - "@material/icon-button" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/switch@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/switch/-/switch-0.44.0.tgz#f2cbb447437b12eb3bc7f0ec8318dbd3b4f0afce" - integrity sha512-EadCg6lHUF260R2Q/l++vXIITqacvbXlobSoewA5ib6y9BU2g7l13wL1W8xAVJNUMgFa/PyN+EKT3oCql7jZLg== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/selection-control" "^0.44.0" - "@material/theme" "^0.43.0" - -"@material/tab-bar@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/tab-bar/-/tab-bar-0.44.0.tgz#b17d791bd557b1d84892fef1a1d8b8d6fef7c6d6" - integrity sha512-kCrt05d61YXyY43SNc0dPGuqysbcLr/KRDBvzpXgE4gv2jCCVhhjAH10KPlx8pthp/UtvrYJHb34acAKEGzdHA== - dependencies: - "@material/base" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/tab" "^0.44.0" - "@material/tab-scroller" "^0.44.0" - -"@material/tab-indicator@^0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@material/tab-indicator/-/tab-indicator-0.43.0.tgz#37fd05513ba55ae218d9068c986c2676096fd6eb" - integrity sha512-RMNMQpWYghWpM6d0ayfuHEPzTiebKG0bMthViiD6tly8PubmOT8mShNhPm8ihybhDPUOLSz+7V4QNE5wikLEYg== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/theme" "^0.43.0" - -"@material/tab-scroller@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/tab-scroller/-/tab-scroller-0.44.0.tgz#82d092ed45d2ee9d82038bed318e6ff6bdc36dad" - integrity sha512-Ufd3NWBN11kY2oA7bGmTYWGP1uz2mq0tfDM0JOiqoLMgD7y3Z18kmxnpq2qkg1vi4kvix28hBYGGMfLlq9rGDA== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/tab" "^0.44.0" - -"@material/tab@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/tab/-/tab-0.44.0.tgz#254b92cff99015f0bd59a86d08d3f1c4744d0742" - integrity sha512-czrbGjtKkmUS3iYBX523xT5GOkjP0h+0x9fTnw+heFNpw5dCn6cZvlj3D9ayZU+ZH93x68TFhFVBuLU5f0EBXw== - dependencies: - "@material/base" "^0.41.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/tab-indicator" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/textfield@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/textfield/-/textfield-0.44.0.tgz#277b33948ddff33f7f643323895e5a683f013601" - integrity sha512-IMBwMcE82eVU+Wifpu0t84tozvBPLCeqQELDtZNYujKg3RxaultzJLwIyGKPMZ9R4yPEpV2vgXPGKE+2/AWt0g== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/floating-label" "^0.44.0" - "@material/line-ripple" "^0.43.0" - "@material/notched-outline" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/theme@^0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@material/theme/-/theme-0.43.0.tgz#6d9fa113c82e841817882172c152d60d2d203ca6" - integrity sha512-/zndZL6EihI18v2mYd4O8xvOBAAXmLeHyHVK28LozSAaJ9okQgD25wq5Ktk95oMTmPIC+rH66KcK6371ivNk8g== - -"@material/toolbar@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/toolbar/-/toolbar-0.44.0.tgz#6689aecdeccc78b7a890a3abbe8b68a2c6339307" - integrity sha512-YgLlOFQ5VzFLQBpXYSMviEbYox0fia+sasHuYPUhTAtas1ExVt9EEiIolDSVvhv2PruTReKKefxSbXAqGlOHog== - dependencies: - "@material/base" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/top-app-bar@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/top-app-bar/-/top-app-bar-0.44.0.tgz#2495c7f9567568fb961ccced24f479c4806a72af" - integrity sha512-tf0yXQJARYs8UPaH8oo3LnsSHEiur7Zm8Fc3hv3F0gNRRaZYBjwsMQMVbZZaWoQCWskMALyntBg+Fo18zdgDxw== - dependencies: - "@material/animation" "^0.41.0" - "@material/base" "^0.41.0" - "@material/elevation" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/shape" "^0.43.0" - "@material/theme" "^0.43.0" - "@material/typography" "^0.44.0" - -"@material/typography@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@material/typography/-/typography-0.44.0.tgz#cf61dce2ee89bfa084d86e1b0f270a585bf9dfaf" - integrity sha512-m4SjA9OjZRDKowN3cPzEa8e2GlTlEn3ZmW/Fy9eRNSp83iY+8a0xl6kCaF80v5qAVwVcpfEFyEHWxMJtkBw2uA== - -"@types/prop-types@*": - version "15.5.8" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.8.tgz#8ae4e0ea205fe95c3901a5a1df7f66495e3a56ce" - integrity sha512-3AQoUxQcQtLHsK25wtTWIoIpgYjH3vSDroZOUr7PpCHw/jLY1RB9z9E8dBT/OSmwStVgkRNvdh+ZHNiomRieaw== - -"@types/react-dom@^16.8.0": - version "16.8.0" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.0.tgz#c565f43f9d2ec911f9e0b8f3b74e25e67879aa3f" - integrity sha512-Jp4ufcEEjVJEB0OHq2MCZcE1u3KYUKO6WnSuiU/tZeYeiZxUoQavfa/TZeiIT+1XoN6l0lQVNM30VINZFDeolQ== - dependencies: - "@types/react" "*" - -"@types/react@*", "@types/react@^16.8.2": - version "16.8.2" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.2.tgz#3b7a7f7ea89d1c7d68b00849fb5de839011c077b" - integrity sha512-6mcKsqlqkN9xADrwiUz2gm9Wg4iGnlVGciwBRYFQSMWG6MQjhOZ/AVnxn+6v8nslFgfYTV8fNdE6XwKu6va5PA== - dependencies: - "@types/prop-types" "*" - csstype "^2.2.0" - -csstype@^2.2.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.2.tgz#3043d5e065454579afc7478a18de41909c8a2f01" - integrity sha512-Rl7PvTae0pflc1YtxtKbiSqq20Ts6vpIYOD5WBafl4y123DyHUeLrRdQP66sQW8/6gmX8jrYJLXwNeMqYVJcow== - -focus-trap@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-4.0.2.tgz#4ee2b96547c9ea0e4252a2d4b2cca68944194663" - integrity sha512-HtLjfAK7Hp2qbBtLS6wEznID1mPT+48ZnP2nkHzgjpL4kroYHg0CdqJ5cTXk+UO5znAxF5fRUkhdyfgrhh8Lzw== - dependencies: - tabbable "^3.1.2" - xtend "^4.0.1" - -"js-tokens@^3.0.0 || ^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -loose-envify@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -material-components-web@^0.44.0: - version "0.44.0" - resolved "https://registry.yarnpkg.com/material-components-web/-/material-components-web-0.44.0.tgz#ff782e8d7bdd8212d3c6022a731258d0d42da531" - integrity sha512-BSRLf58SMVhAvlDhJDlcgYuvzeMwbMHKTJ7oIB8LaM24ZpXBxP9XCYJpKheMtiVLrgllCGDlJ/47OIDReHQXdQ== - dependencies: - "@material/animation" "^0.41.0" - "@material/auto-init" "^0.41.0" - "@material/base" "^0.41.0" - "@material/button" "^0.44.0" - "@material/card" "^0.44.0" - "@material/checkbox" "^0.44.0" - "@material/chips" "^0.44.0" - "@material/dialog" "^0.44.0" - "@material/dom" "^0.41.0" - "@material/drawer" "^0.44.0" - "@material/elevation" "^0.44.0" - "@material/fab" "^0.44.0" - "@material/feature-targeting" "^0.44.0" - "@material/floating-label" "^0.44.0" - "@material/form-field" "^0.44.0" - "@material/grid-list" "^0.44.0" - "@material/icon-button" "^0.44.0" - "@material/icon-toggle" "^0.44.0" - "@material/image-list" "^0.44.0" - "@material/layout-grid" "^0.41.0" - "@material/line-ripple" "^0.43.0" - "@material/linear-progress" "^0.43.0" - "@material/list" "^0.44.0" - "@material/menu" "^0.44.0" - "@material/menu-surface" "^0.44.0" - "@material/notched-outline" "^0.44.0" - "@material/radio" "^0.44.0" - "@material/ripple" "^0.44.0" - "@material/rtl" "^0.42.0" - "@material/select" "^0.44.0" - "@material/selection-control" "^0.44.0" - "@material/shape" "^0.43.0" - "@material/slider" "^0.44.0" - "@material/snackbar" "^0.44.0" - "@material/switch" "^0.44.0" - "@material/tab" "^0.44.0" - "@material/tab-bar" "^0.44.0" - "@material/tab-indicator" "^0.43.0" - "@material/tab-scroller" "^0.44.0" - "@material/textfield" "^0.44.0" - "@material/theme" "^0.43.0" - "@material/toolbar" "^0.44.0" - "@material/top-app-bar" "^0.44.0" - "@material/typography" "^0.44.0" - -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -prop-types@^15.6.2: - version "15.7.1" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.1.tgz#2fa61e0a699d428b40320127733ee2931f05d9d1" - integrity sha512-f8Lku2z9kERjOCcnDOPm68EBJAO2K00Q5mSgPAUE/gJuBgsYLbVy6owSrtcHj90zt8PvW+z0qaIIgsIhHOa1Qw== - dependencies: - object-assign "^4.1.1" - react-is "^16.8.1" - -react-dom@^16.8.1: - version "16.8.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.1.tgz#ec860f98853d09d39bafd3a6f1e12389d283dbb4" - integrity sha512-N74IZUrPt6UiDjXaO7UbDDFXeUXnVhZzeRLy/6iqqN1ipfjrhR60Bp5NuBK+rv3GMdqdIuwIl22u1SYwf330bg== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.13.1" - -react-is@^16.8.1: - version "16.8.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.1.tgz#a80141e246eb894824fb4f2901c0c50ef31d4cdb" - integrity sha512-ioMCzVDWvCvKD8eeT+iukyWrBGrA3DiFYkXfBsVYIRdaREZuBjENG+KjrikavCLasozqRWTwFUagU/O4vPpRMA== - -react@^16.8.1: - version "16.8.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.8.1.tgz#ae11831f6cb2a05d58603a976afc8a558e852c4a" - integrity sha512-wLw5CFGPdo7p/AgteFz7GblI2JPOos0+biSoxf1FPsGxWQZdN/pj6oToJs1crn61DL3Ln7mN86uZ4j74p31ELQ== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.13.1" - -scheduler@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.1.tgz#1a217df1bfaabaf4f1b92a9127d5d732d85a9591" - integrity sha512-VJKOkiKIN2/6NOoexuypwSrybx13MY7NSy9RNt8wPvZDMRT1CW6qlpF5jXRToXNHz3uWzbm2elNpZfXfGPqP9A== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - -tabbable@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-3.1.2.tgz#f2d16cccd01f400e38635c7181adfe0ad965a4a2" - integrity sha512-wjB6puVXTYO0BSFtCmWQubA/KIn7Xvajw0x0l6eJUudMG/EAiJvIUnyNX6xO4NpGrJ16lbD0eUseB9WxW0vlpQ== - -xtend@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= diff --git a/packages/disposable/package.json b/packages/disposable/package.json deleted file mode 100644 index 87b23eb672e9..000000000000 --- a/packages/disposable/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@coder/disposable", - "main": "src/index.ts" -} diff --git a/packages/disposable/src/disposable.ts b/packages/disposable/src/disposable.ts deleted file mode 100644 index 4fc3d52d6bc4..000000000000 --- a/packages/disposable/src/disposable.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IDisposable { - dispose(): void; -} diff --git a/packages/disposable/src/index.ts b/packages/disposable/src/index.ts deleted file mode 100644 index 8991adf47b9f..000000000000 --- a/packages/disposable/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./disposable"; diff --git a/packages/disposable/yarn.lock b/packages/disposable/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/disposable/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/dns/.gcloudignore b/packages/dns/.gcloudignore deleted file mode 100644 index b1a2026b199d..000000000000 --- a/packages/dns/.gcloudignore +++ /dev/null @@ -1,18 +0,0 @@ -# This file specifies files that are *not* uploaded to Google Cloud Platform -# using gcloud. It follows the same syntax as .gitignore, with the addition of -# "#!include" directives (which insert the entries of the given .gitignore-style -# file at that point). -# -# For more information, run: -# $ gcloud topic gcloudignore -# -.gcloudignore -# If you would like to upload your .git directory, .gitignore file or files -# from your .gitignore file, remove the corresponding line -# below: -.git -.gitignore -src - -# Node.js dependencies: -node_modules/ \ No newline at end of file diff --git a/packages/dns/Dockerfile b/packages/dns/Dockerfile deleted file mode 100644 index 376d334afd3a..000000000000 --- a/packages/dns/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM node - -COPY out/main.js /main.js -COPY package.json /package.json -RUN yarn -ENV NODE_ENV production - -CMD ["node", "/main.js"] \ No newline at end of file diff --git a/packages/dns/app.yaml b/packages/dns/app.yaml deleted file mode 100644 index 6b329a92484c..000000000000 --- a/packages/dns/app.yaml +++ /dev/null @@ -1,5 +0,0 @@ -runtime: nodejs10 -service: cdrdns -network: - forwarded_ports: - - 53/udp \ No newline at end of file diff --git a/packages/dns/package.json b/packages/dns/package.json deleted file mode 100644 index a3817a77b7cc..000000000000 --- a/packages/dns/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@coder/dns", - "main": "out/main.js", - "scripts": { - "build": "../../node_modules/.bin/webpack --config ./webpack.config.js" - }, - "dependencies": { - "node-named": "^0.0.1" - }, - "devDependencies": { - "ip-address": "^5.8.9", - "@types/ip-address": "^5.8.2" - } -} diff --git a/packages/dns/src/dns.ts b/packages/dns/src/dns.ts deleted file mode 100644 index 06d3da77cf4a..000000000000 --- a/packages/dns/src/dns.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { field, logger } from "@coder/logger"; -import * as http from "http"; -//@ts-ignore -import * as named from "node-named"; -import * as ip from "ip-address"; -import { words, wordKeys } from "./words"; - -import * as dgram from "dgram"; - -const oldCreate = dgram.createSocket; - -// tslint:disable-next-line:no-any -(dgram).createSocket = (_: any, callback: any): dgram.Socket => { - return oldCreate("udp4", callback); -}; - -interface DnsQuery { - name(): string; - // tslint:disable-next-line:no-any - addAnswer(domain: string, target: any, ttl: number): void; -} - -const dnsServer: { - listen(port: number, host: string, callback: () => void): void; - on(event: "query", callback: (query: DnsQuery) => void): void; - send(query: DnsQuery): void; -} = named.createServer(); - -const isDev = process.env.NODE_ENV !== "production"; -const dnsPort = isDev ? 9999 : 53; -dnsServer.listen(dnsPort, "0.0.0.0", () => { - logger.info("DNS server started", field("port", dnsPort)); -}); - -dnsServer.on("query", (query) => { - const domain = query.name(); - const reqParts = domain.split("."); - if (reqParts.length < 2) { - dnsServer.send(query); - logger.info("Invalid request", field("request", domain)); - - return; - } - const allWords = reqParts.shift()!; - if (allWords.length > 16) { - dnsServer.send(query); - logger.info("Invalid request", field("request", domain)); - - return; - } - const wordParts = allWords.split(/(?=[A-Z])/); - const ipParts: string[] = []; - // Should be left with HowAreYouNow - for (let i = 0; i < wordParts.length; i++) { - const part = wordParts[i]; - if (part.length > 4) { - dnsServer.send(query); - logger.info("Words too long", field("request", domain)); - - return; - } - const ipPart = words[part.toLowerCase()]; - if (typeof ipPart === "undefined") { - dnsServer.send(query); - logger.info("Word not found in index", field("part", part), field("request", domain)); - - return; - } - ipParts.push(ipPart.toString()); - } - - const address = new ip.Address4(ipParts.join(".")); - - if (address.isValid()) { - logger.info("Responded with valid address query", field("address", address.address), field("request", domain)); - query.addAnswer(domain, new named.ARecord(address.address), 99999); - } else { - logger.warn("Received invalid request", field("request", domain)); - } - - dnsServer.send(query); -}); - -const httpServer = http.createServer((request, response) => { - const remoteAddr = request.connection.remoteAddress; - if (!remoteAddr) { - response.writeHead(422); - response.end(); - - return; - } - const hostHeader = request.headers.host; - if (!hostHeader) { - response.writeHead(422); - response.end(); - - return; - } - const host = remoteAddr.split(".").map(p => wordKeys[Number.parseInt(p, 10)]).map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(""); - logger.info("Resolved host", field("remote-addr", remoteAddr), field("host", host)); - response.writeHead(200); - response.write(`${host}.${hostHeader}`); - response.end(); -}); - -const httpPort = isDev ? 3000 : 80; -httpServer.listen(httpPort, "0.0.0.0", () => { - logger.info("HTTP server started", field("port", httpPort)); -}); diff --git a/packages/dns/src/words.ts b/packages/dns/src/words.ts deleted file mode 100644 index a29a4933e31d..000000000000 --- a/packages/dns/src/words.ts +++ /dev/null @@ -1,260 +0,0 @@ -export const words: { readonly [key: string]: number } = { - term: 0, - salt: 1, - barn: 2, - corn: 3, - went: 4, - feel: 5, - rest: 6, - will: 7, - pale: 8, - cave: 9, - dirt: 10, - time: 11, - in: 12, - pie: 13, - star: 14, - iron: 15, - door: 16, - tone: 17, - want: 18, - task: 19, - zoo: 20, - nor: 21, - fall: 22, - tell: 23, - noon: 24, - new: 25, - per: 26, - end: 27, - arm: 28, - been: 29, - wolf: 30, - port: 31, - beat: 32, - pour: 33, - far: 34, - may: 35, - tie: 36, - moon: 37, - duck: 38, - us: 39, - led: 40, - met: 41, - bank: 42, - day: 43, - due: 44, - both: 45, - pet: 46, - gate: 47, - pain: 48, - rock: 49, - fill: 50, - open: 51, - thus: 52, - mark: 53, - our: 54, - loud: 55, - wife: 56, - say: 57, - flag: 58, - as: 59, - ride: 60, - once: 61, - sun: 62, - duty: 63, - pure: 64, - made: 65, - gulf: 66, - pig: 67, - fish: 68, - name: 69, - army: 70, - have: 71, - ill: 72, - meal: 73, - ago: 74, - late: 75, - view: 76, - atom: 77, - pen: 78, - mud: 79, - tail: 80, - sink: 81, - cow: 82, - rear: 83, - fur: 84, - go: 85, - suit: 86, - come: 87, - fear: 88, - also: 89, - sail: 90, - row: 91, - lay: 92, - noun: 93, - hat: 94, - am: 95, - mail: 96, - keep: 97, - drop: 98, - than: 99, - weak: 100, - by: 101, - who: 102, - fire: 103, - good: 104, - sick: 105, - care: 106, - pink: 107, - lady: 108, - war: 109, - sets: 110, - swam: 111, - well: 112, - shoe: 113, - bent: 114, - fuel: 115, - wet: 116, - fog: 117, - land: 118, - lead: 119, - tax: 120, - deal: 121, - verb: 122, - take: 123, - save: 124, - gift: 125, - had: 126, - gold: 127, - slow: 128, - drew: 129, - lamp: 130, - roof: 131, - hung: 132, - wild: 133, - able: 134, - girl: 135, - warn: 136, - were: 137, - know: 138, - camp: 139, - milk: 140, - neck: 141, - aid: 142, - fair: 143, - bell: 144, - dig: 145, - hope: 146, - wood: 147, - away: 148, - cook: 149, - just: 150, - form: 151, - food: 152, - hall: 153, - mind: 154, - for: 155, - card: 156, - half: 157, - sat: 158, - now: 159, - team: 160, - rush: 161, - face: 162, - wire: 163, - such: 164, - tool: 165, - make: 166, - fat: 167, - hold: 168, - inch: 169, - bill: 170, - mean: 171, - tide: 172, - burn: 173, - talk: 174, - tape: 175, - hard: 176, - mine: 177, - on: 178, - year: 179, - rich: 180, - sum: 181, - yes: 182, - baby: 183, - wide: 184, - how: 185, - clay: 186, - car: 187, - here: 188, - cent: 189, - bowl: 190, - post: 191, - said: 192, - see: 193, - raw: 194, - foot: 195, - life: 196, - bar: 197, - from: 198, - path: 199, - meat: 200, - show: 201, - sent: 202, - wait: 203, - mice: 204, - ten: 205, - pot: 206, - nice: 207, - idea: 208, - or: 209, - onto: 210, - rose: 211, - your: 212, - this: 213, - cat: 214, - bet: 215, - took: 216, - hang: 217, - very: 218, - bend: 219, - mix: 220, - base: 221, - jack: 222, - her: 223, - leg: 224, - own: 225, - book: 226, - love: 227, - dawn: 228, - deer: 229, - hit: 230, - rain: 231, - gas: 232, - eat: 233, - tube: 234, - case: 235, - pipe: 236, - get: 237, - joy: 238, - ever: 239, - nest: 240, - home: 241, - egg: 242, - pack: 243, - hand: 244, - cold: 245, - hot: 246, - frog: 247, - peep: 248, - seed: 249, - rawr: 250, - top: 251, - meow: 252, - bark: 253, - eel: 254, - swap: 255, -}; - -export const wordKeys = Object.keys(words); diff --git a/packages/dns/webpack.config.js b/packages/dns/webpack.config.js deleted file mode 100644 index 1d69f59b34fc..000000000000 --- a/packages/dns/webpack.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const path = require("path"); -const merge = require("webpack-merge"); - -const root = path.resolve(__dirname, "../.."); - -module.exports = merge( - require(path.join(root, "scripts/webpack.node.config.js"))({ - dirname: __dirname, - name: "dns", - }), { - externals: { - "node-named": "commonjs node-named", - }, - entry: [ - "./packages/dns/src/dns.ts" - ], - }, -); diff --git a/packages/dns/yarn.lock b/packages/dns/yarn.lock deleted file mode 100644 index c4abe2a76620..000000000000 --- a/packages/dns/yarn.lock +++ /dev/null @@ -1,88 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/ip-address@^5.8.2": - version "5.8.2" - resolved "https://registry.yarnpkg.com/@types/ip-address/-/ip-address-5.8.2.tgz#5e413c477f78b3a264745eac937538a6e6e0c1f6" - integrity sha512-LFlDGRjJDnahfPyNCZGXvlaevSmZTi/zDxjTdXeTs8TQ9pQkNZKbCWaJXW29a3bGPRsASqeO+jGgZlaTUi9jTw== - dependencies: - "@types/jsbn" "*" - -"@types/jsbn@*": - version "1.2.29" - resolved "https://registry.yarnpkg.com/@types/jsbn/-/jsbn-1.2.29.tgz#28229bc0262c704a1506c3ed69a7d7e115bd7832" - integrity sha512-2dVz9LTEGWVj9Ov9zaDnpvqHFV+W4bXtU0EUEGAzWfdRNO3dlUuosdHpENI6/oQW+Kejn0hAjk6P/czs9h/hvg== - -bunyan@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/bunyan/-/bunyan-0.7.0.tgz#921065e70c936fe302a740e2c5605775beea2f42" - integrity sha1-khBl5wyTb+MCp0DixWBXdb7qL0I= - -"coffee-script@>= 1.1.1": - version "1.12.7" - resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.12.7.tgz#c05dae0cb79591d05b3070a8433a98c9a89ccc53" - integrity sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw== - -ip-address@^5.8.9: - version "5.8.9" - resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-5.8.9.tgz#6379277c23fc5adb20511e4d23ec2c1bde105dfd" - integrity sha512-7ay355oMN34iXhET1BmCJVsHjOTSItEEIIpOs38qUC23AIhOy+xIPnkrTuEFjeLMrTJ7m8KMXWgWfy/2Vn9sDw== - dependencies: - jsbn "1.1.0" - lodash.find "^4.6.0" - lodash.max "^4.0.1" - lodash.merge "^4.6.0" - lodash.padstart "^4.6.1" - lodash.repeat "^4.1.0" - sprintf-js "1.1.0" - -ipaddr.js@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-0.1.1.tgz#28c6a7c116a021c555544f906ab1ad540b1d635a" - integrity sha1-KManwRagIcVVVE+QarGtVAsdY1o= - dependencies: - coffee-script ">= 1.1.1" - -jsbn@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" - integrity sha1-sBMHyym2GKHtJux56RH4A8TaAEA= - -lodash.find@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1" - integrity sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E= - -lodash.max@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.max/-/lodash.max-4.0.1.tgz#8735566c618b35a9f760520b487ae79658af136a" - integrity sha1-hzVWbGGLNan3YFILSHrnllivE2o= - -lodash.merge@^4.6.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" - integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ== - -lodash.padstart@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" - integrity sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs= - -lodash.repeat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lodash.repeat/-/lodash.repeat-4.1.0.tgz#fc7de8131d8c8ac07e4b49f74ffe829d1f2bec44" - integrity sha1-/H3oEx2MisB+S0n3T/6CnR8r7EQ= - -node-named@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/node-named/-/node-named-0.0.1.tgz#3607b434cf237ab99440f5ff6d19c05e3a93e217" - integrity sha1-Nge0NM8jermUQPX/bRnAXjqT4hc= - dependencies: - bunyan "0.7.0" - ipaddr.js "0.1.1" - -sprintf-js@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.0.tgz#cffcaf702daf65ea39bb4e0fa2b299cec1a1be46" - integrity sha1-z/yvcC2vZeo5u04PorKZzsGhvkY= diff --git a/packages/events/package.json b/packages/events/package.json deleted file mode 100644 index 2c5404406545..000000000000 --- a/packages/events/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@coder/events", - "main": "./src/index.ts" -} diff --git a/packages/events/src/events.ts b/packages/events/src/events.ts deleted file mode 100644 index 0befa8f6bd55..000000000000 --- a/packages/events/src/events.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { IDisposable } from "@coder/disposable"; - -export interface Event { - (listener: (value: T) => void): IDisposable; - (id: number | string, listener: (value: T) => void): IDisposable; -} - -/** - * Emitter typecasts for a single event type. You can optionally use IDs, but - * using undefined with IDs will not work. If you emit without an ID, *all* - * listeners regardless of their ID (or lack thereof) will receive the event. - * Similarly, if you listen without an ID you will get *all* events for any or - * no ID. - */ -export class Emitter { - private listeners = void>>[]; - private readonly idListeners = new Map void>>(); - - public get event(): Event { - return (id: number | string | ((value: T) => void), cb?: (value: T) => void): IDisposable => { - if (typeof id !== "function") { - if (this.idListeners.has(id)) { - this.idListeners.get(id)!.push(cb!); - } else { - this.idListeners.set(id, [cb!]); - } - - return { - dispose: (): void => { - if (this.idListeners.has(id)) { - const cbs = this.idListeners.get(id)!; - const i = cbs.indexOf(cb!); - if (i !== -1) { - cbs.splice(i, 1); - } - } - }, - }; - } - - cb = id; - this.listeners.push(cb); - - return { - dispose: (): void => { - const i = this.listeners.indexOf(cb!); - if (i !== -1) { - this.listeners.splice(i, 1); - } - }, - }; - }; - } - - /** - * Emit an event with a value. - */ - public emit(value: T): void; - public emit(id: number | string, value: T): void; - public emit(id: number | string | T, value?: T): void { - if ((typeof id === "number" || typeof id === "string") && typeof value !== "undefined") { - if (this.idListeners.has(id)) { - this.idListeners.get(id)!.forEach((cb) => cb(value!)); - } - this.listeners.forEach((cb) => cb(value!)); - } else { - this.idListeners.forEach((cbs) => cbs.forEach((cb) => cb((id as T)!))); - this.listeners.forEach((cb) => cb((id as T)!)); - } - } - - /** - * Dispose the current events. - */ - public dispose(): void; - public dispose(id: number | string): void; - public dispose(id?: number | string): void { - if (typeof id !== "undefined") { - this.idListeners.delete(id); - } else { - this.listeners = []; - this.idListeners.clear(); - } - } - - public get counts(): { [key: string]: number } { - const counts = <{ [key: string]: number }>{}; - if (this.listeners.length > 0) { - counts["n/a"] = this.listeners.length; - } - this.idListeners.forEach((cbs, id) => { - if (cbs.length > 0) { - counts[`${id}`] = cbs.length; - } - }); - - return counts; - } -} diff --git a/packages/events/src/index.ts b/packages/events/src/index.ts deleted file mode 100644 index 1784004f0158..000000000000 --- a/packages/events/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./events"; diff --git a/packages/events/test/events.test.ts b/packages/events/test/events.test.ts deleted file mode 100644 index 1c92327a0fd3..000000000000 --- a/packages/events/test/events.test.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { Emitter } from "../src/events"; - -describe("Event", () => { - const emitter = new Emitter(); - - it("should listen to global event", () => { - const fn = jest.fn(); - const d = emitter.event(fn); - emitter.emit(10); - expect(fn).toHaveBeenCalledWith(10); - d.dispose(); - }); - - it("should listen to id event", () => { - const fn = jest.fn(); - const d = emitter.event(0, fn); - emitter.emit(0, 5); - expect(fn).toHaveBeenCalledWith(5); - d.dispose(); - }); - - it("should listen to string id event", () => { - const fn = jest.fn(); - const d = emitter.event("string", fn); - emitter.emit("string", 55); - expect(fn).toHaveBeenCalledWith(55); - d.dispose(); - }); - - it("should not listen wrong id event", () => { - const fn = jest.fn(); - const d = emitter.event(1, fn); - emitter.emit(0, 5); - emitter.emit(1, 6); - expect(fn).toHaveBeenCalledWith(6); - expect(fn).toHaveBeenCalledTimes(1); - d.dispose(); - }); - - it("should listen to id event globally", () => { - const fn = jest.fn(); - const d = emitter.event(fn); - emitter.emit(1, 11); - expect(fn).toHaveBeenCalledWith(11); - d.dispose(); - }); - - it("should listen to global event", () => { - const fn = jest.fn(); - const d = emitter.event(3, fn); - emitter.emit(14); - expect(fn).toHaveBeenCalledWith(14); - d.dispose(); - }); - - it("should listen to id event multiple times", () => { - const fn = jest.fn(); - const disposers = [ - emitter.event(934, fn), - emitter.event(934, fn), - emitter.event(934, fn), - emitter.event(934, fn), - ]; - emitter.emit(934, 324); - expect(fn).toHaveBeenCalledTimes(4); - expect(fn).toHaveBeenCalledWith(324); - disposers.forEach((d) => d.dispose()); - }); - - it("should dispose individually", () => { - const fn = jest.fn(); - const d = emitter.event(fn); - - const fn2 = jest.fn(); - const d2 = emitter.event(1, fn2); - - d.dispose(); - - emitter.emit(12); - emitter.emit(1, 12); - - expect(fn).not.toBeCalled(); - expect(fn2).toBeCalledTimes(2); - - d2.dispose(); - - emitter.emit(12); - emitter.emit(1, 12); - - expect(fn).not.toBeCalled(); - expect(fn2).toBeCalledTimes(2); - }); - - it("should dispose by id", () => { - const fn = jest.fn(); - emitter.event(fn); - - const fn2 = jest.fn(); - emitter.event(1, fn2); - - emitter.dispose(1); - - emitter.emit(12); - emitter.emit(1, 12); - - expect(fn).toBeCalledTimes(2); - expect(fn2).not.toBeCalled(); - }); - - it("should dispose all", () => { - const fn = jest.fn(); - emitter.event(fn); - emitter.event(1, fn); - - emitter.dispose(); - - emitter.emit(12); - emitter.emit(1, 12); - - expect(fn).not.toBeCalled(); - }); -}); diff --git a/packages/events/yarn.lock b/packages/events/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/events/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/ide-api/README.md b/packages/ide-api/README.md deleted file mode 100644 index 3e26f7a6efc4..000000000000 --- a/packages/ide-api/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# ide-api - -Provides window listeners for interfacing with the IDE. - -Created for content-scripts. \ No newline at end of file diff --git a/packages/ide-api/api.d.ts b/packages/ide-api/api.d.ts deleted file mode 100644 index c395ac281bbc..000000000000 --- a/packages/ide-api/api.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -// tslint:disable no-any - -import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal"; - -export interface EvalHelper { } -interface ActiveEvalEmitter { - removeAllListeners(event?: string): void; - emit(event: string, ...args: any[]): void; - on(event: string, cb: (...args: any[]) => void): void; -} -interface IDisposable { - dispose(): void; -} -interface Disposer extends IDisposable { - onDidDispose: (cb: () => void) => void; -} -interface Event { - (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable; -} -interface IAction extends IDisposable { - id: string; - label: string; - tooltip: string; - class: string | undefined; - enabled: boolean; - checked: boolean; - radio: boolean; - run(event?: any): Promise; -} -interface IStatusbarEntry { - readonly text: string; - readonly tooltip?: string; - readonly color?: string; - readonly command?: string; - readonly arguments?: any[]; - readonly showBeak?: boolean; -} -interface IStatusbarService { - addEntry(entry: IStatusbarEntry, alignment: ide.StatusbarAlignment, priority?: number): IDisposable; - setStatusMessage(message: string, autoDisposeAfter?: number, delayBy?: number): IDisposable; -} -type NotificationMessage = string | Error; -interface INotificationProperties { - sticky?: boolean; - silent?: boolean; -} -interface INotification extends INotificationProperties { - severity: ide.Severity; - message: NotificationMessage; - source?: string; - actions?: INotificationActions; -} -interface INotificationActions { - primary?: IAction[]; - secondary?: IAction[]; -} - -interface INotificationProgress { - infinite(): void; - total(value: number): void; - worked(value: number): void; - done(): void; -} - -interface INotificationHandle { - readonly onDidClose: Event; - readonly progress: INotificationProgress; - updateSeverity(severity: ide.Severity): void; - updateMessage(message: NotificationMessage): void; - updateActions(actions?: INotificationActions): void; - close(): void; -} - -interface IPromptChoice { - label: string; - isSecondary?: boolean; - keepOpen?: boolean; - run: () => void; -} - -interface IPromptOptions extends INotificationProperties { - onCancel?: () => void; -} - -interface INotificationService { - notify(notification: INotification): INotificationHandle; - info(message: NotificationMessage | NotificationMessage[]): void; - warn(message: NotificationMessage | NotificationMessage[]): void; - error(message: NotificationMessage | NotificationMessage[]): void; - prompt(severity: ide.Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle; -} - -interface IBaseCommandAction { - id: string; - title: string; - category?: string; -} - -interface ICommandAction extends IBaseCommandAction { - // iconLocation?: { dark: URI; light?: URI; }; - // precondition?: ContextKeyExpr; - // toggled?: ContextKeyExpr; -} - -interface ISerializableCommandAction extends IBaseCommandAction { - // iconLocation?: { dark: UriComponents; light?: UriComponents; }; -} - -interface IMenuItem { - command: ICommandAction; - alt?: ICommandAction; - // when?: ContextKeyExpr; - group?: "navigation" | string; - order?: number; -} - -interface IMenuRegistry { - appendMenuItem(menu: ide.MenuId, item: IMenuItem): IDisposable; -} - -export interface ICommandHandler { - (accessor: any, ...args: any[]): void; -} - -export interface ICommand { - id: string; - handler: ICommandHandler; - description?: ICommandHandlerDescription | null; -} - -export interface ICommandHandlerDescription { - description: string; - args: { name: string; description?: string; }[]; - returns?: string; -} - -interface ICommandRegistry { - registerCommand(command: ICommand): IDisposable; -} - -interface IStorageService { - save(): Promise; -} - -declare namespace ide { - export const client: {}; - - export const workbench: { - readonly statusbarService: IStatusbarService; - readonly notificationService: INotificationService; - readonly storageService: IStorageService; - readonly menuRegistry: IMenuRegistry; - readonly commandRegistry: ICommandRegistry; - readonly terminalService: ITerminalService; - - onFileCreate(cb: (path: string) => void): void; - onFileMove(cb: (path: string, target: string) => void): void; - onFileDelete(cb: (path: string) => void): void; - onFileSaved(cb: (path: string) => void): void; - onFileCopy(cb: (path: string, target: string) => void): void; - - onModelAdded(cb: (path: string, languageId: string) => void): void; - onModelRemoved(cb: (path: string, languageId: string) => void): void; - onModelLanguageChange(cb: (path: string, languageId: string, oldLanguageId: string) => void): void; - - onTerminalAdded(cb: () => void): void; - onTerminalRemoved(cb: () => void): void; - }; - - export enum Severity { - Ignore = 0, - Info = 1, - Warning = 2, - Error = 3, - } - - export enum StatusbarAlignment { - LEFT = 0, - RIGHT = 1, - } - - export enum MenuId { - CommandPalette, - DebugBreakpointsContext, - DebugCallStackContext, - DebugConsoleContext, - DebugVariablesContext, - DebugWatchContext, - EditorContext, - EditorTitle, - EditorTitleContext, - EmptyEditorGroupContext, - ExplorerContext, - MenubarAppearanceMenu, - MenubarDebugMenu, - MenubarEditMenu, - MenubarFileMenu, - MenubarGoMenu, - MenubarHelpMenu, - MenubarLayoutMenu, - MenubarNewBreakpointMenu, - MenubarPreferencesMenu, - MenubarRecentMenu, - MenubarSelectionMenu, - MenubarSwitchEditorMenu, - MenubarSwitchGroupMenu, - MenubarTerminalMenu, - MenubarViewMenu, - OpenEditorsContext, - ProblemsPanelContext, - SCMChangeContext, - SCMResourceContext, - SCMResourceGroupContext, - SCMSourceControl, - SCMTitle, - SearchContext, - TouchBarContext, - ViewItemContext, - ViewTitle, - } -} - -declare global { - interface Window { - ide?: typeof ide; - - addEventListener(event: "ide-ready", callback: (ide: CustomEvent & { readonly ide: typeof ide }) => void): void; - } -} diff --git a/packages/ide-api/package.json b/packages/ide-api/package.json deleted file mode 100644 index 71a1a67746cd..000000000000 --- a/packages/ide-api/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@coder/ide-api", - "version": "1.0.4", - "typings": "api.d.ts", - "author": "Coder", - "license": "MIT", - "description": "API for interfacing with the API created for content-scripts" -} \ No newline at end of file diff --git a/packages/ide-api/yarn.lock b/packages/ide-api/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/ide-api/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/ide/package.json b/packages/ide/package.json deleted file mode 100644 index ac53ecb0a003..000000000000 --- a/packages/ide/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@coder/ide", - "description": "Browser-based IDE client abstraction.", - "main": "src/index.ts" -} diff --git a/packages/ide/src/client.ts b/packages/ide/src/client.ts deleted file mode 100644 index 63f91bdeba7a..000000000000 --- a/packages/ide/src/client.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { field, logger, time, Time } from "@coder/logger"; -import { SharedProcessData } from "@coder/protocol"; -import { retry } from "./retry"; -import { upload } from "./upload"; -import { client } from "./fill/client"; -import { clipboard } from "./fill/clipboard"; -import { INotificationService, IProgressService } from "./fill/notification"; -import "./fill/os"; // Ensure it fills before anything else waiting on initData. - -/** - * A general abstraction of an IDE client. - * - * Everything the client provides is asynchronous so you can wait on what - * you need from it without blocking anything else. - * - * It also provides task management to help asynchronously load and time code. - */ -export abstract class IdeClient { - public readonly retry = retry; - public readonly clipboard = clipboard; - public readonly upload = upload; - - private start: Time | undefined; - private readonly tasks = []; - private finishedTaskCount = 0; - private readonly loadTime: Time; - - public readonly initData = client.initData; - public readonly sharedProcessData: Promise; - public readonly onSharedProcessActive = client.onSharedProcessActive; - - public constructor() { - logger.info("Loading IDE"); - this.loadTime = time(2500); - - let appWindow: Window | undefined; - - window.addEventListener("beforeunload", (e) => { - e.preventDefault(); // FireFox - e.returnValue = ""; // Chrome - }); - - window.addEventListener("message", (event) => { - if (event.data === "app") { - appWindow = event.source as Window; - } - }); - - this.sharedProcessData = new Promise((resolve): void => { - let d = client.onSharedProcessActive((data) => { - d.dispose(); - d = client.onSharedProcessActive(() => { - d.dispose(); - this.retry.notificationService.error( - new Error("Disconnected from shared process. Searching, installing, enabling, and disabling extensions will not work until the page is refreshed."), - ); - }); - resolve(data); - }); - }); - - window.addEventListener("contextmenu", (event) => { - event.preventDefault(); - }); - - // Prevent Firefox from trying to reconnect when the page unloads. - window.addEventListener("unload", () => { - this.retry.block(); - logger.info("Unloaded"); - }); - - this.initialize().then(() => { - logger.info("Load completed", field("duration", this.loadTime)); - if (appWindow) { - appWindow.postMessage("loaded", "*"); - } - }).catch((error) => { - logger.error(error.message); - logger.warn("Load completed with errors", field("duration", this.loadTime)); - }); - } - - public async task(description: string, duration: number, task: () => Promise): Promise; - public async task(description: string, duration: number, task: (v: V) => Promise, t: Promise): Promise; - public async task(description: string, duration: number, task: (v1: V1, v2: V2) => Promise, t1: Promise, t2: Promise): Promise; - public async task(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3) => Promise, t1: Promise, t2: Promise, t3: Promise): Promise; - public async task(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3, v4: V4) => Promise, t1: Promise, t2: Promise, t3: Promise, t4: Promise): Promise; - public async task(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5) => Promise, t1: Promise, t2: Promise, t3: Promise, t4: Promise, t5: Promise): Promise; - public async task(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6) => Promise, t1: Promise, t2: Promise, t3: Promise, t4: Promise, t5: Promise, t6: Promise): Promise; - /** - * Wrap a task in some logging, timing, and progress updates. Can optionally - * wait on other tasks which won't count towards this task's time. - */ - public async task( - description: string, duration: number = 100, task: (...args: any[]) => Promise, ...after: Array> // tslint:disable-line no-any - ): Promise { - this.tasks.push(description); - if (!this.start) { - this.start = time(1000); - } - - let start: Time | undefined; - try { - const waitFor = await (after && after.length > 0 ? Promise.all(after) : Promise.resolve([])); - start = time(duration); - logger.info(description); - const value = await task(...waitFor); - logger.info(`Finished "${description}"`, field("duration", start)); - const index = this.tasks.indexOf(description); - if (index !== -1) { - this.tasks.splice(index, 1); - } - ++this.finishedTaskCount; - if (this.tasks.length === 0) { - logger.info("Finished all queued tasks", field("duration", this.start), field("count", this.finishedTaskCount)); - this.start = undefined; - } - - return value; - } catch (error) { - logger.error(`Failed "${description}"`, field("duration", typeof start !== "undefined" ? start : "not started"), field("error", error)); - throw error; - } - } - - public set notificationService(service: INotificationService) { - this.retry.notificationService = service; - this.upload.notificationService = service; - } - - public set progressService(service: IProgressService) { - this.upload.progressService = service; - } - - /** - * Initialize the IDE. - */ - protected abstract initialize(): Promise; -} diff --git a/packages/ide/src/fill/child_process.ts b/packages/ide/src/fill/child_process.ts deleted file mode 100644 index afcfe7a0b54a..000000000000 --- a/packages/ide/src/fill/child_process.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Module } from "@coder/protocol"; -import { client } from "./client"; - -export = client.modules[Module.ChildProcess]; diff --git a/packages/ide/src/fill/client.ts b/packages/ide/src/fill/client.ts deleted file mode 100644 index d179d0e69872..000000000000 --- a/packages/ide/src/fill/client.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { Emitter } from "@coder/events"; -import { field, logger } from "@coder/logger"; -import { Client, ReadWriteConnection } from "@coder/protocol"; -import { retry } from "../retry"; - -/** - * A connection based on a web socket. Automatically reconnects and buffers - * messages during connection. - */ -class WebsocketConnection implements ReadWriteConnection { - private activeSocket: WebSocket | undefined; - private readonly messageBuffer = []; - private readonly socketTimeoutDelay = 60 * 1000; - private readonly retry = retry.register("Socket", () => this.connect()); - private isUp: boolean = false; - private closed: boolean = false; - - private readonly messageEmitter = new Emitter(); - private readonly closeEmitter = new Emitter(); - private readonly upEmitter = new Emitter(); - private readonly downEmitter = new Emitter(); - - public readonly onUp = this.upEmitter.event; - public readonly onClose = this.closeEmitter.event; - public readonly onDown = this.downEmitter.event; - public readonly onMessage = this.messageEmitter.event; - - public constructor() { - this.retry.block(); - this.retry.run(); - } - - /** - * Send data across the socket. If closed, will error. If connecting, will - * queue. - */ - public send(data: Buffer | Uint8Array): void { - if (this.closed) { - throw new Error("web socket is closed"); - } - if (!this.activeSocket || this.activeSocket.readyState !== this.activeSocket.OPEN) { - this.messageBuffer.push(data); - } else { - this.activeSocket.send(data); - } - } - - /** - * Close socket connection. - */ - public close(): void { - this.closed = true; - this.dispose(); - this.closeEmitter.emit(); - } - - /** - * Connect to the server. - */ - private async connect(): Promise { - const socket = await this.openSocket(); - - socket.addEventListener("message", (event: MessageEvent) => { - this.messageEmitter.emit(event.data); - }); - - socket.addEventListener("close", (event) => { - if (this.isUp) { - this.isUp = false; - try { - this.downEmitter.emit(undefined); - } catch (error) { - // Don't let errors here prevent restarting. - logger.error(error.message); - } - } - logger.warn( - "Web socket closed", - field("code", event.code), - field("reason", event.reason), - field("wasClean", event.wasClean), - ); - if (!this.closed) { - this.retry.block(); - this.retry.run(); - } - }); - - // Send any messages that were queued while we were waiting to connect. - while (this.messageBuffer.length > 0) { - socket.send(this.messageBuffer.shift()!); - } - - if (!this.isUp) { - this.isUp = true; - this.upEmitter.emit(undefined); - } - } - - /** - * Open a web socket, disposing the previous connection if any. - */ - private async openSocket(): Promise { - this.dispose(); - const wsProto = location.protocol === "https:" ? "wss" : "ws"; - const socket = new WebSocket( - `${wsProto}://${location.host}${location.pathname}`, - ); - socket.binaryType = "arraybuffer"; - this.activeSocket = socket; - - const socketWaitTimeout = window.setTimeout(() => { - socket.close(); - }, this.socketTimeoutDelay); - - await new Promise((resolve, reject): void => { - const doReject = (): void => { - clearTimeout(socketWaitTimeout); - socket.removeEventListener("error", doReject); - socket.removeEventListener("close", doReject); - reject(); - }; - socket.addEventListener("error", doReject); - socket.addEventListener("close", doReject); - - socket.addEventListener("open", () => { - clearTimeout(socketWaitTimeout); - socket.removeEventListener("error", doReject); - socket.removeEventListener("close", doReject); - resolve(); - }); - }); - - return socket; - } - - /** - * Dispose the current connection. - */ - private dispose(): void { - if (this.activeSocket) { - this.activeSocket.close(); - } - } -} - -// Global instance so all fills can use the same client. -export const client = new Client(new WebsocketConnection()); diff --git a/packages/ide/src/fill/clipboard.ts b/packages/ide/src/fill/clipboard.ts deleted file mode 100644 index 502d1b90ee2c..000000000000 --- a/packages/ide/src/fill/clipboard.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { Emitter } from "@coder/events"; - -/** - * Wrapper around the native clipboard with some fallbacks. - */ -export class Clipboard { - private readonly enableEmitter = new Emitter(); - public readonly onPermissionChange = this.enableEmitter.event; - private _isEnabled: boolean = false; - - /** - * Ask for permission to use the clipboard. - */ - public initialize(): void { - // tslint:disable no-any - const navigatorClip = (navigator as any).clipboard; - const navigatorPerms = (navigator as any).permissions; - // tslint:enable no-any - if (navigatorClip && navigatorPerms) { - navigatorPerms.query({ - name: "clipboard-read", - }).then((permissionStatus: { - onchange: () => void, - state: "denied" | "granted" | "prompt", - }) => { - const updateStatus = (): void => { - this._isEnabled = permissionStatus.state !== "denied"; - this.enableEmitter.emit(this.isEnabled); - }; - updateStatus(); - permissionStatus.onchange = (): void => { - updateStatus(); - }; - }); - } - } - - /** - * Paste currently copied text. - */ - public async paste(): Promise { - if (this.isEnabled) { - try { - const element = document.activeElement as HTMLInputElement | HTMLTextAreaElement; - const start = element.selectionStart || 0; - const end = element.selectionEnd; - const allText = element.value; - const newText = allText.substring(0, start) - + (await this.readText()) - + allText.substring(end || start); - element.value = newText; - - return true; - } catch (ex) { - // Will try execCommand below. - } - } - - return document.execCommand("paste"); - } - - /** - * Return true if the native clipboard is supported. - */ - public get isSupported(): boolean { - // tslint:disable no-any - return typeof navigator !== "undefined" - && typeof (navigator as any).clipboard !== "undefined" - && typeof (navigator as any).clipboard.readText !== "undefined"; - // tslint:enable no-any - } - - /** - * Read text from the clipboard. - */ - public readText(): Promise { - return this.instance ? this.instance.readText() : Promise.resolve(""); - } - - /** - * Write text to the clipboard. - */ - public writeText(value: string): Promise { - return this.instance - ? this.instance.writeText(value) - : this.writeTextFallback(value); - } - - /** - * Return true if the clipboard is currently enabled. - */ - public get isEnabled(): boolean { - return !!this._isEnabled; - } - - /** - * Return clipboard instance if there is one. - */ - private get instance(): ({ - readText(): Promise; - writeText(value: string): Promise; - }) | undefined { - // tslint:disable-next-line no-any - return this.isSupported ? (navigator as any).clipboard : undefined; - } - - /** - * Fallback for writing text to the clipboard. - * Taken from https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f - */ - private writeTextFallback(value: string): Promise { - // Note the current focus and selection. - const active = document.activeElement as HTMLElement; - const selection = document.getSelection(); - const selected = selection && selection.rangeCount > 0 - ? selection.getRangeAt(0) - : false; - - // Insert a hidden textarea to put the text to copy in. - const el = document.createElement("textarea"); - el.value = value; - el.setAttribute("readonly", ""); - el.style.position = "absolute"; - el.style.left = "-9999px"; - document.body.appendChild(el); - - // Select the textarea and execute a copy (this will only work as part of a - // user interaction). - el.select(); - document.execCommand("copy"); - - // Remove the textarea and put focus and selection back to where it was - // previously. - document.body.removeChild(el); - active.focus(); - if (selected && selection) { - selection.removeAllRanges(); - selection.addRange(selected); - } - - return Promise.resolve(); - } -} - -// Global clipboard instance since it's used in the Electron fill. -export const clipboard = new Clipboard(); diff --git a/packages/ide/src/fill/dialog.scss b/packages/ide/src/fill/dialog.scss deleted file mode 100644 index ca5dc53b5e89..000000000000 --- a/packages/ide/src/fill/dialog.scss +++ /dev/null @@ -1,83 +0,0 @@ -.msgbox { - padding-top: 25px; - padding-left: 40px; - padding-right: 40px; - padding-bottom: 25px; - background: #242424; - -webkit-box-shadow: 0px 0px 10px -3px rgba(0,0,0,0.75); - -moz-box-shadow: 0px 0px 10px -3px rgba(0,0,0,0.75); - box-shadow: 0px 0px 10px -3px rgba(0,0,0,0.75); - border-radius: 3px; -} - -.msgbox.input { - max-width: 500px; - width: 100%; -} - -.msgbox > .input { - background: #141414; - border: none; - box-sizing: border-box; - padding: 10px; - width: 100%; -} - -.msgbox > .msg { - font-size: 16px; - font-weight: bold; -} - -.msgbox > .detail { - font-size: 14px; - margin: 5px 0; -} - -.msgbox > .errors { - margin-top: 20px; -} - -.msgbox > .errors { - color: #f44747; -} - -.msgbox > .button-wrapper { - display: flex; - flex-direction: row; - justify-content: space-between; - margin-top: 20px; -} - -.msgbox > .button-wrapper > button { - flex: 1; - border-radius: 2px; - padding: 10px; - color: white; - background: #3d3d3d; - border: 0px; - cursor: pointer; - opacity: 0.8; -} - -.msgbox > .button-wrapper > button:hover { - opacity: 1; -} - -.msgbox > .button-wrapper > button:not(:last-child) { - margin-right: 8px; -} - -.msgbox-overlay { - align-items: center; - background: rgba(0, 0, 0, 0.4); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - opacity: 0; - position: absolute; - right: 0; - top: 0; - transition: 300ms opacity ease; - z-index: 15; -} diff --git a/packages/ide/src/fill/dialog.ts b/packages/ide/src/fill/dialog.ts deleted file mode 100644 index acee2bdca587..000000000000 --- a/packages/ide/src/fill/dialog.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { Emitter } from "@coder/events"; - -import "./dialog.scss"; - -export interface IDialogOptions { - message?: string; - detail?: string; - buttons?: string[]; - input?: { - value: string; - selection?: { - start: number; - end: number; - }; - }; -} - -export interface IDialogAction { - buttonIndex?: number; - key?: IKey; -} - -export enum IKey { - Enter = "Enter", - Escape = "Escape", -} - -export class Dialog { - private readonly overlay: HTMLElement; - private cachedActiveElement: HTMLElement | undefined; - private input: HTMLInputElement | undefined; - private errors: HTMLElement; - private buttons: HTMLElement[] | undefined; - private readonly msgBox: HTMLElement; - - private actionEmitter = new Emitter(); - public onAction = this.actionEmitter.event; - - public constructor(private readonly options: IDialogOptions) { - this.msgBox = document.createElement("div"); - this.msgBox.classList.add("msgbox"); - - if (this.options.message) { - const messageDiv = document.createElement("div"); - messageDiv.classList.add("msg"); - messageDiv.innerText = this.options.message; - this.msgBox.appendChild(messageDiv); - } - - if (this.options.detail) { - const detailDiv = document.createElement("div"); - detailDiv.classList.add("detail"); - detailDiv.innerText = this.options.detail; - this.msgBox.appendChild(detailDiv); - } - - if (this.options.input) { - this.msgBox.classList.add("input"); - this.input = document.createElement("input"); - this.input.classList.add("input"); - this.input.value = this.options.input.value; - this.input.addEventListener("keydown", (event) => { - if (event.key === IKey.Enter) { - event.preventDefault(); - this.actionEmitter.emit({ - buttonIndex: undefined, - key: IKey.Enter, - }); - } - }); - this.msgBox.appendChild(this.input); - } - - this.errors = document.createElement("div"); - this.errors.classList.add("errors"); - - if (this.options.buttons && this.options.buttons.length > 0) { - this.buttons = this.options.buttons.map((buttonText, buttonIndex) => { - const button = document.createElement("button"); - // TODO: support mnemonics. - button.innerText = buttonText.replace("&&", ""); - button.addEventListener("click", () => { - this.actionEmitter.emit({ - buttonIndex, - key: undefined, - }); - }); - - return button; - }); - - const buttonWrapper = document.createElement("div"); - buttonWrapper.classList.add("button-wrapper"); - this.buttons.forEach((b) => buttonWrapper.appendChild(b)); - this.msgBox.appendChild(buttonWrapper); - } - - this.overlay = document.createElement("div"); - this.overlay.className = "msgbox-overlay"; - this.overlay.appendChild(this.msgBox); - - setTimeout(() => { - this.overlay.style.opacity = "1"; - }); - } - - /** - * Input value if this dialog has an input. - */ - public get inputValue(): string | undefined { - return this.input ? this.input.value : undefined; - } - - /** - * Display or remove an error. - */ - public set error(error: string | undefined) { - while (this.errors.lastChild) { - this.errors.removeChild(this.errors.lastChild); - } - if (error) { - const errorDiv = document.createElement("error"); - errorDiv.innerText = error; - this.errors.appendChild(errorDiv); - this.msgBox.appendChild(this.errors); - } - } - - /** - * Show the dialog. - */ - public show(): void { - if (!this.cachedActiveElement) { - this.cachedActiveElement = document.activeElement as HTMLElement; - (document.querySelector(".monaco-workbench") || document.body).appendChild(this.overlay); - document.addEventListener("keydown", this.onKeydown); - if (this.input) { - this.input.focus(); - if (this.options.input && this.options.input.selection) { - this.input.setSelectionRange( - this.options.input.selection.start, - this.options.input.selection.end, - ); - } - } else if (this.buttons) { - this.buttons[0].focus(); - } - } - } - - /** - * Remove the dialog and clean up. - */ - public hide(): void { - if (this.cachedActiveElement) { - this.overlay.remove(); - document.removeEventListener("keydown", this.onKeydown); - this.cachedActiveElement.focus(); - this.cachedActiveElement = undefined; - } - } - - /** - * Capture escape. - */ - private onKeydown = (event: KeyboardEvent): void => { - if (event.key === "Escape") { - event.preventDefault(); - event.stopPropagation(); - this.actionEmitter.emit({ - buttonIndex: undefined, - key: IKey.Escape, - }); - } - } -} diff --git a/packages/ide/src/fill/electron.ts b/packages/ide/src/fill/electron.ts deleted file mode 100644 index dc74d2448d56..000000000000 --- a/packages/ide/src/fill/electron.ts +++ /dev/null @@ -1,490 +0,0 @@ -/// -import { EventEmitter } from "events"; -import * as fs from "fs"; -import * as trash from "trash"; -import { logger, field } from "@coder/logger"; -import { IKey, Dialog as DialogBox } from "./dialog"; -import { clipboard } from "./clipboard"; - -// tslint:disable-next-line no-any -(global as any).getOpenUrls = (): string[] => { - return []; -}; - -// This is required to make the fill load in Node without erroring. -if (typeof document === "undefined") { - // tslint:disable-next-line no-any - (global as any).document = {} as any; -} - -const oldCreateElement = document.createElement; -const newCreateElement = (tagName: K): HTMLElementTagNameMap[K] => { - const createElement = (tagName: K): HTMLElementTagNameMap[K] => { - // tslint:disable-next-line:no-any - return oldCreateElement.call(document, tagName as any); - }; - // tslint:disable-next-line:no-any - const getPropertyDescriptor = (object: any, id: string): PropertyDescriptor | undefined => { - let op = Object.getPrototypeOf(object); - while (!Object.getOwnPropertyDescriptor(op, id)) { - op = Object.getPrototypeOf(op); - } - - return Object.getOwnPropertyDescriptor(op, id); - }; - - if (tagName === "img") { - const img = createElement("img"); - const oldSrc = getPropertyDescriptor(img, "src"); - if (!oldSrc) { - throw new Error("Failed to find src property"); - } - Object.defineProperty(img, "src", { - get: (): string => { - return oldSrc!.get!.call(img); - }, - set: (value: string): void => { - if (value) { - const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource"; - value = value.replace(/file:\/\//g, resourceBaseUrl); - } - oldSrc!.set!.call(img, value); - }, - }); - - return img; - } - - if (tagName === "style") { - const style = createElement("style"); - const oldInnerHtml = getPropertyDescriptor(style, "innerHTML"); - if (!oldInnerHtml) { - throw new Error("Failed to find innerHTML property"); - } - Object.defineProperty(style, "innerHTML", { - get: (): string => { - return oldInnerHtml!.get!.call(style); - }, - set: (value: string): void => { - if (value) { - const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource"; - value = value.replace(/file:\/\//g, resourceBaseUrl); - } - oldInnerHtml!.set!.call(style, value); - }, - }); - let overridden = false; - const oldSheet = getPropertyDescriptor(style, "sheet"); - Object.defineProperty(style, "sheet", { - // tslint:disable-next-line:no-any - get: (): any => { - const sheet = oldSheet!.get!.call(style); - if (sheet && !overridden) { - const oldInsertRule = sheet.insertRule; - sheet.insertRule = (rule: string, index?: number): void => { - const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource"; - rule = rule.replace(/file:\/\//g, resourceBaseUrl); - oldInsertRule.call(sheet, rule, index); - }; - overridden = true; - } - - return sheet; - }, - }); - - return style; - } - - if (tagName === "webview") { - const view = createElement("iframe") as HTMLIFrameElement; - view.style.border = "0px"; - const frameID = Math.random().toString(); - view.addEventListener("error", (event) => { - logger.error("iframe error", field("event", event)); - }); - window.addEventListener("message", (event) => { - if (!event.data || !event.data.id) { - return; - } - if (event.data.id !== frameID) { - return; - } - const e = new CustomEvent("ipc-message"); - (e as any).channel = event.data.channel; // tslint:disable-line no-any - (e as any).args = event.data.data; // tslint:disable-line no-any - view.dispatchEvent(e); - }); - view.sandbox.add("allow-same-origin", "allow-scripts", "allow-popups", "allow-forms"); - Object.defineProperty(view, "preload", { - set: (url: string): void => { - view.onload = (): void => { - if (view.contentDocument) { - view.contentDocument.body.id = frameID; - view.contentDocument.body.parentElement!.style.overflow = "hidden"; - const script = createElement("script"); - script.src = url; - script.addEventListener("load", () => { - view.contentDocument!.dispatchEvent(new Event("DOMContentLoaded", { - bubbles: true, - cancelable: true, - })); - // const e = new CustomEvent("ipc-message"); - // (e as any).channel = "webview-ready"; // tslint:disable-line no-any - // (e as any).args = [frameID]; // tslint:disable-line no-any - // view.dispatchEvent(e); - }); - view.contentDocument.head.appendChild(script); - } - - }; - }, - }); - view.src = require("!!file-loader?name=[path][name].[ext]!./webview.html"); - Object.defineProperty(view, "src", { - set: (): void => { /* Nope. */ }, - }); - (view as any).getWebContents = (): void => undefined; // tslint:disable-line no-any - (view as any).send = (channel: string, ...args: any[]): void => { // tslint:disable-line no-any - if (args[0] && typeof args[0] === "object" && args[0].contents) { - // TODO - const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource"; - args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"${resourceBaseUrl}${m1}"`); - args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"${resourceBaseUrl}${m1}"`); - args[0].contents = (args[0].contents as string).replace(/style-src vscode-core-resource:/g, "style-src 'self'"); - } - if (view.contentWindow) { - view.contentWindow.postMessage({ - channel, - data: args, - id: frameID, - }, "*"); - } - }; - - return view; - } - - return createElement(tagName); -}; - -document.createElement = newCreateElement; - -class Clipboard { - private readonly buffers = new Map(); - - public has(format: string): boolean { - return this.buffers.has(format); - } - - public readFindText(): string { - return ""; - } - - public writeFindText(_text: string): void { - // Nothing. - } - - public writeText(value: string): Promise { - return clipboard.writeText(value); - } - - public readText(): Promise { - return clipboard.readText(); - } - - public writeBuffer(format: string, buffer: Buffer): void { - this.buffers.set(format, buffer); - } - - public readBuffer(format: string): Buffer | undefined { - return this.buffers.get(format); - } -} - -class Shell { - public async moveItemToTrash(path: string): Promise { - await trash(path); - } -} - -class App extends EventEmitter { - public isAccessibilitySupportEnabled(): boolean { - return false; - } - - public setAsDefaultProtocolClient(): void { - throw new Error("not implemented"); - } -} - -class Dialog { - public showSaveDialog(_: void, options: Electron.SaveDialogOptions, callback: (filename: string | undefined) => void): void { - const defaultPath = options.defaultPath || "/untitled"; - const fileIndex = defaultPath.lastIndexOf("/"); - const extensionIndex = defaultPath.lastIndexOf("."); - const saveDialogOptions = { - buttons: ["Cancel", "Save"], - detail: "Enter a path for this file", - input: { - value: defaultPath, - selection: { - start: fileIndex === -1 ? 0 : fileIndex + 1, - end: extensionIndex === -1 ? defaultPath.length : extensionIndex, - }, - }, - message: "Save file", - }; - - const dialog = new DialogBox(saveDialogOptions); - dialog.onAction((action) => { - if (action.key !== IKey.Enter && action.buttonIndex !== 1) { - dialog.hide(); - - return callback(undefined); - } - - const inputValue = dialog.inputValue || ""; - const filePath = inputValue.replace(/\/+$/, ""); - const split = filePath.split("/"); - const fileName = split.pop(); - const parentName = split.pop() || "/"; - if (fileName === "") { - dialog.error = "You must enter a file name."; - - return; - } - - fs.stat(filePath, (error, stats) => { - if (error && error.code === "ENOENT") { - dialog.hide(); - callback(filePath); - } else if (error) { - dialog.error = error.message; - } else if (stats.isDirectory()) { - dialog.error = `A directory named "${fileName}" already exists.`; - } else { - dialog.error = undefined; - - const confirmDialog = new DialogBox({ - message: `A file named "${fileName}" already exists. Do you want to replace it?`, - detail: `The file already exists in "${parentName}". Replacing it will overwrite its contents.`, - buttons: ["Cancel", "Replace"], - }); - - confirmDialog.onAction((action) => { - if (action.buttonIndex === 1) { - confirmDialog.hide(); - - return callback(filePath); - } - - confirmDialog.hide(); - dialog.show(); - }); - - dialog.hide(); - confirmDialog.show(); - } - }); - }); - dialog.show(); - } - - public showOpenDialog(): void { - throw new Error("not implemented"); - } - - public showMessageBox(_: void, options: Electron.MessageBoxOptions, callback: (button: number | undefined, checked: boolean) => void): void { - const dialog = new DialogBox(options); - dialog.onAction((action) => { - dialog.hide(); - callback(action.buttonIndex, false); - }); - dialog.show(); - } -} - -class WebFrame { - public getZoomFactor(): number { - return 1; - } - - public getZoomLevel(): number { - return 1; - } - - public setZoomLevel(): void { - // Nothing. - } -} - -class Screen { - public getAllDisplays(): [] { - return []; - } -} - -class WebRequest extends EventEmitter { - public onBeforeRequest(): void { - throw new Error("not implemented"); - } - - public onBeforeSendHeaders(): void { - throw new Error("not implemented"); - } - - public onHeadersReceived(): void { - throw new Error("not implemented"); - } -} - -class Session extends EventEmitter { - public webRequest = new WebRequest(); - - public resolveProxy(url: string, callback: (proxy: string) => void): void { - // TODO: not sure what this actually does. - callback(url); - } -} - -class WebContents extends EventEmitter { - public session = new Session(); -} - -class BrowserWindow extends EventEmitter { - public webContents = new WebContents(); - private representedFilename: string = ""; - - public static getFocusedWindow(): undefined { - return undefined; - } - - public focus(): void { - window.focus(); - } - - public show(): void { - window.focus(); - } - - public reload(): void { - location.reload(); - } - - public isMaximized(): boolean { - return false; - } - - public setFullScreen(fullscreen: boolean): void { - if (fullscreen) { - document.documentElement.requestFullscreen().catch((error) => { - logger.error(error.message); - }); - } else { - document.exitFullscreen().catch((error) => { - logger.error(error.message); - }); - } - } - - public isFullScreen(): boolean { - // TypeScript doesn't recognize this property. - // tslint:disable no-any - if (typeof (window as any)["fullScreen"] !== "undefined") { - return (window as any)["fullScreen"]; - } - // tslint:enable no-any - - try { - return window.matchMedia("(display-mode: fullscreen)").matches; - } catch (error) { - logger.error(error.message); - - return false; - } - } - - public isFocused(): boolean { - return document.hasFocus(); - } - - public setMenuBarVisibility(): void { - throw new Error("not implemented"); - } - - public setAutoHideMenuBar(): void { - throw new Error("not implemented"); - } - - public setRepresentedFilename(filename: string): void { - this.representedFilename = filename; - } - - public getRepresentedFilename(): string { - return this.representedFilename; - } - - public setTitle(value: string): void { - document.title = value; - } -} - -/** - * We won't be able to do a 1 to 1 fill because things like moveItemToTrash for - * example returns a boolean while we need a promise. - */ -class ElectronFill { - public readonly shell = new Shell(); - public readonly clipboard = new Clipboard(); - public readonly app = new App(); - public readonly dialog = new Dialog(); - public readonly webFrame = new WebFrame(); - public readonly screen = new Screen(); - - private readonly rendererToMainEmitter = new EventEmitter(); - private readonly mainToRendererEmitter = new EventEmitter(); - - public get BrowserWindow(): typeof BrowserWindow { - return BrowserWindow; - } - - // tslint:disable no-any - public get ipcRenderer(): object { - return { - send: (str: string, ...args: any[]): void => { - this.rendererToMainEmitter.emit(str, { - sender: module.exports.ipcMain, - }, ...args); - }, - on: (str: string, listener: (...args: any[]) => void): void => { - this.mainToRendererEmitter.on(str, listener); - }, - once: (str: string, listener: (...args: any[]) => void): void => { - this.mainToRendererEmitter.once(str, listener); - }, - removeListener: (str: string, listener: (...args: any[]) => void): void => { - this.mainToRendererEmitter.removeListener(str, listener); - }, - }; - } - - public get ipcMain(): object { - return { - send: (str: string, ...args: any[]): void => { - this.mainToRendererEmitter.emit(str, { - sender: module.exports.ipcRenderer, - }, ...args); - }, - on: (str: string, listener: (...args: any[]) => void): void => { - this.rendererToMainEmitter.on(str, listener); - }, - once: (str: string, listener: (...args: any[]) => void): void => { - this.rendererToMainEmitter.once(str, listener); - }, - }; - } - // tslint:enable no-any -} - -module.exports = new ElectronFill(); diff --git a/packages/ide/src/fill/empty.ts b/packages/ide/src/fill/empty.ts deleted file mode 100644 index 8717dbf7acc0..000000000000 --- a/packages/ide/src/fill/empty.ts +++ /dev/null @@ -1 +0,0 @@ -export = {}; diff --git a/packages/ide/src/fill/fs.ts b/packages/ide/src/fill/fs.ts deleted file mode 100644 index 930979632a94..000000000000 --- a/packages/ide/src/fill/fs.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Module } from "@coder/protocol"; -import { client } from "./client"; - -export = client.modules[Module.Fs]; diff --git a/packages/ide/src/fill/net.ts b/packages/ide/src/fill/net.ts deleted file mode 100644 index 4eb9a4b0c82f..000000000000 --- a/packages/ide/src/fill/net.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Module } from "@coder/protocol"; -import { client } from "./client"; - -export = client.modules[Module.Net]; diff --git a/packages/ide/src/fill/notification.ts b/packages/ide/src/fill/notification.ts deleted file mode 100644 index f1c156c9f778..000000000000 --- a/packages/ide/src/fill/notification.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { logger, field } from "@coder/logger"; - -export interface INotificationHandle { - close(): void; - updateMessage(message: string): void; - updateButtons(buttons: INotificationButton[]): void; -} - -export enum Severity { - Ignore = 0, - Info = 1, - Warning = 2, - Error = 3, -} - -export interface INotificationButton { - label: string; - run(): void; -} - -/** - * Optional notification service. - */ -export interface INotificationService { - error(error: Error): void; - prompt(severity: Severity, message: string, buttons: INotificationButton[], onCancel: () => void): INotificationHandle; -} - -export interface IProgress { - /** - * Report progress, which should be the completed percentage from 0 to 100. - */ - report(progress: number): void; -} - -export interface IProgressService { - /** - * Start a new progress bar that resolves & disappears when the task finishes. - */ - start(title: string, task: (progress: IProgress) => Promise, onCancel: () => void): Promise; -} - -/** - * Console-based notification service. - */ -export class NotificationService implements INotificationService { - public error(error: Error): void { - logger.error(error.message, field("error", error)); - } - - public prompt(severity: Severity, message: string, _buttons: INotificationButton[], _onCancel: () => void): INotificationHandle { - switch (severity) { - case Severity.Info: logger.info(message); break; - case Severity.Warning: logger.warn(message); break; - case Severity.Error: logger.error(message); break; - } - - return { - close: (): void => undefined, - updateMessage: (): void => undefined, - updateButtons: (): void => undefined, - }; - } -} - -/** - * Console-based progress service. - */ -export class ProgressService implements IProgressService { - public start(title: string, task: (progress: IProgress) => Promise): Promise { - logger.info(title); - - return task({ - report: (progress): void => { - logger.info(`${title} progress: ${progress}`); - }, - }); - } -} diff --git a/packages/ide/src/fill/os.ts b/packages/ide/src/fill/os.ts deleted file mode 100644 index f9c8008c675a..000000000000 --- a/packages/ide/src/fill/os.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { OperatingSystem, InitData } from "@coder/protocol"; -import { client } from "./client"; - -class OS { - private _homedir: string | undefined; - private _tmpdir: string | undefined; - private _platform: NodeJS.Platform | undefined; - - public constructor() { - client.initData.then((d) => this.initialize(d)); - } - - public homedir(): string { - if (typeof this._homedir === "undefined") { - throw new Error("trying to access homedir before it has been set"); - } - - return this._homedir; - } - - public tmpdir(): string { - if (typeof this._tmpdir === "undefined") { - throw new Error("trying to access tmpdir before it has been set"); - } - - return this._tmpdir; - } - - public initialize(data: InitData): void { - this._homedir = data.homeDirectory; - this._tmpdir = data.tmpDirectory; - switch (data.os) { - case OperatingSystem.Windows: this._platform = "win32"; break; - case OperatingSystem.Mac: this._platform = "darwin"; break; - default: this._platform = "linux"; break; - } - process.platform = this._platform; - } - - public release(): string { - return "Unknown"; - } - - public platform(): NodeJS.Platform { - if (typeof this._platform === "undefined") { - throw new Error("trying to access platform before it has been set"); - } - - return this._platform; - } -} - -export = new OS(); diff --git a/packages/ide/src/fill/path.js b/packages/ide/src/fill/path.js deleted file mode 100644 index 1fcfd11a261c..000000000000 --- a/packages/ide/src/fill/path.js +++ /dev/null @@ -1,518 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var os = require('os'); -var util = require('util'); -var isWindows = os.platform() === "win32"; - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - - -if (isWindows) { - // Regex to split a windows path into three parts: [*, device, slash, - // tail] windows-only - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - - // Regex to split the tail part of the above into [*, dir, basename, ext] - var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; - - // Function to split a filename into [root, dir, basename, ext] - // windows version - var splitPath = function(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; - }; - - var normalizeUNCRoot = function(device) { - return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); - }; - - // path.resolve([from ...], to) - // windows version - exports.resolve = function() { - var resolvedDevice = '', - resolvedTail = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1; i--) { - var path; - if (i >= 0) { - path = arguments[i]; - } else if (!resolvedDevice) { - path = process.cwd(); - } else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive. We're sure the device is not - // an unc path at this points, because unc paths are always absolute. - path = process.env['=' + resolvedDevice]; - // Verify that a drive-local cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (!path || path.substr(0, 3).toLowerCase() !== - resolvedDevice.toLowerCase() + '\\') { - path = resolvedDevice + '\\'; - } - } - - // Skip empty and invalid entries - if (!util.isString(path)) { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = device && device.charAt(1) !== ':', - isAbsolute = exports.isAbsolute(path), - tail = result[3]; - - if (device && - resolvedDevice && - device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - - if (!resolvedDevice) { - resolvedDevice = device; - } - if (!resolvedAbsolute) { - resolvedTail = tail + '\\' + resolvedTail; - resolvedAbsolute = isAbsolute; - } - - if (resolvedDevice && resolvedAbsolute) { - break; - } - } - - // Convert slashes to backslashes when `resolvedDevice` points to an UNC - // root. Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - resolvedDevice = normalizeUNCRoot(resolvedDevice); - } - - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - - // Normalize the tail path - - function f(p) { - return !!p; - } - - resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f), - !resolvedAbsolute).join('\\'); - - return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || - '.'; - }; - - // windows version - exports.normalize = function(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = device && device.charAt(1) !== ':', - isAbsolute = exports.isAbsolute(path), - tail = result[3], - trailingSlash = /[\\\/]$/.test(tail); - - // If device is a drive letter, we'll normalize to lower case. - if (device && device.charAt(1) === ':') { - device = device[0].toLowerCase() + device.substr(1); - } - - // Normalize the tail path - tail = normalizeArray(tail.split(/[\\\/]+/).filter(function(p) { - return !!p; - }), !isAbsolute).join('\\'); - - if (!tail && !isAbsolute) { - tail = '.'; - } - if (tail && trailingSlash) { - tail += '\\'; - } - - // Convert slashes to backslashes when `device` points to an UNC root. - // Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - device = normalizeUNCRoot(device); - } - - return device + (isAbsolute ? '\\' : '') + tail; - }; - - // windows version - exports.isAbsolute = function(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = !!device && device.charAt(1) !== ':'; - // UNC paths are always absolute - return !!result[2] || isUnc; - }; - - // windows version - exports.join = function() { - function f(p) { - if (!util.isString(p)) { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - } - - var paths = Array.prototype.filter.call(arguments, f); - var joined = paths.join('\\'); - - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\') - if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { - joined = joined.replace(/^[\\\/]{2,}/, '\\'); - } - - return exports.normalize(joined); - }; - - // path.relative(from, to) - // it will solve the relative path from 'from' to 'to', for instance: - // from = 'C:\\orandea\\test\\aaa' - // to = 'C:\\orandea\\impl\\bbb' - // The output of the function should be: '..\\..\\impl\\bbb' - // windows version - exports.relative = function(from, to) { - from = exports.resolve(from); - to = exports.resolve(to); - - // windows is not case sensitive - var lowerFrom = from.toLowerCase(); - var lowerTo = to.toLowerCase(); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end + 1); - } - - var toParts = trim(to.split('\\')); - - var lowerFromParts = trim(lowerFrom.split('\\')); - var lowerToParts = trim(lowerTo.split('\\')); - - var length = Math.min(lowerFromParts.length, lowerToParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (lowerFromParts[i] !== lowerToParts[i]) { - samePartsLength = i; - break; - } - } - - if (samePartsLength == 0) { - return to; - } - - var outputParts = []; - for (var i = samePartsLength; i < lowerFromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('\\'); - }; - - exports.sep = '\\'; - exports.delimiter = ';'; - -} else /* posix */ { - - // Split a filename into [root, dir, basename, ext], unix version - // 'root' is just a slash, or nothing. - var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; - var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); - }; - - // path.resolve([from ...], to) - // posix version - exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (!util.isString(path)) { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(resolvedPath.split('/').filter(function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; - }; - - // path.normalize(path) - // posix version - exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = path[path.length - 1] === '/', - segments = path.split('/'), - nonEmptySegments = []; - - // Normalize the path - for (var i = 0; i < segments.length; i++) { - if (segments[i]) { - nonEmptySegments.push(segments[i]); - } - } - path = normalizeArray(nonEmptySegments, !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; - }; - - // posix version - exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; - }; - - // posix version - exports.join = function() { - var path = ''; - for (var i = 0; i < arguments.length; i++) { - var segment = arguments[i]; - if (!util.isString(segment)) { - throw new TypeError('Arguments to path.join must be strings'); - } - if (segment) { - if (!path) { - path += segment; - } else { - path += '/' + segment; - } - } - } - return exports.normalize(path); - }; - - - // path.relative(from, to) - // posix version - exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); - }; - - exports.sep = '/'; - exports.delimiter = ':'; -} - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - - -exports.exists = util.deprecate(function(path, callback) { - require('fs').exists(path, callback); -}, 'path.exists is now called `fs.exists`.'); - - -exports.existsSync = util.deprecate(function(path) { - return require('fs').existsSync(path); -}, 'path.existsSync is now called `fs.existsSync`.'); - - -if (isWindows) { - exports._makeLong = function(path) { - // Note: this will *probably* throw somewhere. - if (!util.isString(path)) - return path; - - if (!path) { - return ''; - } - - var resolvedPath = exports.resolve(path); - - if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { - // path is local filesystem path, which needs to be converted - // to long UNC path. - return '\\\\?\\' + resolvedPath; - } else if (/^\\\\[^?.]/.test(resolvedPath)) { - // path is network UNC path, which needs to be converted - // to long UNC path. - return '\\\\?\\UNC\\' + resolvedPath.substring(2); - } - - return path; - }; -} else { - exports._makeLong = function(path) { - return path; - }; -} - -exports.posix = exports; \ No newline at end of file diff --git a/packages/ide/src/fill/trash.ts b/packages/ide/src/fill/trash.ts deleted file mode 100644 index 249dab5d41ae..000000000000 --- a/packages/ide/src/fill/trash.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Module } from "@coder/protocol"; -import { client } from "./client"; - -export = client.modules[Module.Trash].trash; diff --git a/packages/ide/src/fill/util.ts b/packages/ide/src/fill/util.ts deleted file mode 100644 index f0342290a22b..000000000000 --- a/packages/ide/src/fill/util.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "../../../../node_modules/util"; -import { implementation } from "../../../../node_modules/util.promisify"; - -export const promisify = implementation; diff --git a/packages/ide/src/fill/webview.html b/packages/ide/src/fill/webview.html deleted file mode 100644 index d2a85bdd195c..000000000000 --- a/packages/ide/src/fill/webview.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - Virtual Document - - - - diff --git a/packages/ide/src/index.ts b/packages/ide/src/index.ts deleted file mode 100644 index 5c75fbb15a1f..000000000000 --- a/packages/ide/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./client"; -export * from "./fill/clipboard"; -export * from "./fill/notification"; -export * from "./retry"; -export * from "./upload"; diff --git a/packages/ide/src/retry.ts b/packages/ide/src/retry.ts deleted file mode 100644 index aefa7977514e..000000000000 --- a/packages/ide/src/retry.ts +++ /dev/null @@ -1,353 +0,0 @@ -import { logger, field } from "@coder/logger"; -import { NotificationService, INotificationHandle, INotificationService, Severity } from "./fill/notification"; - -// tslint:disable no-any can have different return values - -interface IRetryItem { - /** - * How many times this item has been retried. - */ - count?: number; - - /** - * In seconds. - */ - delay?: number; - - /** - * In milliseconds. - */ - end?: number; - - /** - * Function to run when retrying. - */ - fn(): any; - - /** - * Timer for running this item. - */ - timeout?: number | NodeJS.Timer; - - /** - * Whether the item is retrying or waiting to retry. - */ - running?: boolean; -} - -/** - * An retry-able instance. - */ -export interface RetryInstance { - /** - * Run this retry. - */ - run(error?: Error): void; - - /** - * Block on this instance. - */ - block(): void; -} - -/** - * A retry-able instance that doesn't use a promise so it must be manually - * ran again on failure and recovered on success. - */ -export interface ManualRetryInstance extends RetryInstance { - /** - * Mark this item as recovered. - */ - recover(): void; -} - -/** - * Retry services. Handles multiple services so when a connection drops the - * user doesn't get a separate notification for each service. - * - * Attempts to restart services silently up to a maximum number of tries, then - * starts waiting for a delay that grows exponentially with each attempt with a - * cap on the delay. Once the delay is long enough, it will show a notification - * to the user explaining what is happening with an option to immediately retry. - */ -export class Retry { - private readonly items = new Map(); - - // Times are in seconds. - private readonly retryMinDelay = 1; - private readonly retryMaxDelay = 3; - private readonly maxImmediateRetries = 5; - private readonly retryExponent = 1.5; - private blocked: string | boolean | undefined; - - private notificationHandle: INotificationHandle | undefined; - private readonly updateDelay = 1; - private updateTimeout: number | NodeJS.Timer | undefined; - private readonly notificationThreshold = 3; - - // Time in milliseconds to wait before restarting a service. (See usage below - // for reasoning.) - private readonly waitDelay = 50; - - public constructor(private _notificationService: INotificationService) {} - - public set notificationService(service: INotificationService) { - this._notificationService = service; - } - - public get notificationService(): INotificationService { - return this._notificationService; - } - - /** - * Register a function to retry that starts/connects to a service. - * - * The service is automatically retried or recovered when the promise resolves - * or rejects. If the service dies after starting, it must be manually - * retried. - */ - public register(name: string, fn: () => Promise): RetryInstance; - /** - * Register a function to retry that starts/connects to a service. - * - * Must manually retry if it fails to start again or dies after restarting and - * manually recover if it succeeds in starting again. - */ - public register(name: string, fn: () => any): ManualRetryInstance; - /** - * Register a function to retry that starts/connects to a service. - */ - public register(name: string, fn: () => any): RetryInstance | ManualRetryInstance { - if (this.items.has(name)) { - throw new Error(`"${name}" is already registered`); - } - this.items.set(name, { fn }); - - return { - block: (): void => this.block(name), - run: (error?: Error): void => this.run(name, error), - recover: (): void => this.recover(name), - }; - } - - /** - * Un-register a function to retry. - */ - public unregister(name: string): void { - if (!this.items.has(name)) { - throw new Error(`"${name}" is not registered`); - } - this.items.delete(name); - } - - /** - * Block retries when we know they will fail (for example when the socket is - * down ). If a name is passed, that service will still be allowed to retry - * (unless we have already blocked). - * - * Blocking without a name will override a block with a name. - */ - public block(name?: string): void { - if (!this.blocked || !name) { - this.blocked = name || true; - this.items.forEach((item) => { - this.stopItem(item); - }); - } - } - - /** - * Unblock retries and run any that are pending. - */ - private unblock(): void { - this.blocked = false; - this.items.forEach((item, name) => { - if (item.running) { - this.runItem(name, item); - } - }); - } - - /** - * Retry a service. - */ - private run(name: string, error?: Error): void { - if (!this.items.has(name)) { - throw new Error(`"${name}" is not registered`); - } - - const item = this.items.get(name)!; - if (item.running) { - throw new Error(`"${name}" is already retrying`); - } - - item.running = true; - // This timeout is for the case when the connection drops; this allows time - // for the socket service to come in and block everything because some other - // services might make it here first and try to restart, which will fail. - setTimeout(() => { - if (this.blocked && this.blocked !== name) { - return; - } - - if (!item.count || item.count < this.maxImmediateRetries) { - return this.runItem(name, item, error); - } - - if (!item.delay) { - item.delay = this.retryMinDelay; - } else { - item.delay = Math.ceil(item.delay * this.retryExponent); - if (item.delay > this.retryMaxDelay) { - item.delay = this.retryMaxDelay; - } - } - - logger.info(`Retrying ${name.toLowerCase()} in ${item.delay}s`, error && field("error", error.message)); - const itemDelayMs = item.delay * 1000; - item.end = Date.now() + itemDelayMs; - item.timeout = setTimeout(() => this.runItem(name, item, error), itemDelayMs); - - this.updateNotification(); - }, this.waitDelay); - } - - /** - * Reset a service after a successfully recovering. - */ - private recover(name: string): void { - if (!this.items.has(name)) { - throw new Error(`"${name}" is not registered`); - } - - const item = this.items.get(name)!; - if (typeof item.timeout === "undefined" && !item.running && typeof item.count !== "undefined") { - logger.info(`Connected to ${name.toLowerCase()}`); - item.delay = undefined; - item.count = undefined; - } - } - - /** - * Run an item. - */ - private runItem(name: string, item: IRetryItem, error?: Error): void { - if (!item.count) { - item.count = 1; - } else { - ++item.count; - } - - const retryCountText = item.count <= this.maxImmediateRetries - ? `[${item.count}/${this.maxImmediateRetries}]` - : `[${item.count}]`; - logger.info(`Starting ${name.toLowerCase()} ${retryCountText}...`, error && field("error", error.message)); - - const endItem = (): void => { - this.stopItem(item); - item.running = false; - }; - - try { - const maybePromise = item.fn(); - if (maybePromise instanceof Promise) { - maybePromise.then(() => { - endItem(); - this.recover(name); - if (this.blocked === name) { - this.unblock(); - } - }).catch((error) => { - endItem(); - this.run(name, error); - }); - } else { - endItem(); - } - } catch (error) { - // Prevent an exception from causing the item to never run again. - endItem(); - throw error; - } - } - - /** - * Update, close, or show the notification. - */ - private updateNotification(): void { - // tslint:disable-next-line no-any because NodeJS.Timer is valid. - clearTimeout(this.updateTimeout as any); - - const now = Date.now(); - const items = Array.from(this.items.entries()).filter(([_, item]) => { - return typeof item.end !== "undefined" - && item.end > now - && item.delay && item.delay >= this.notificationThreshold; - }).sort((a, b) => { - return a[1] < b[1] ? -1 : 1; - }); - - if (items.length === 0) { - if (this.notificationHandle) { - this.notificationHandle.close(); - this.notificationHandle = undefined; - } - - return; - } - - const join = (arr: string[]): string => { - const last = arr.pop()!; // Assume length > 0. - - return arr.length > 0 ? `${arr.join(", ")} and ${last}` : last; - }; - - const servicesStr = join(items.map(([name, _]) => name.toLowerCase())); - const message = `Lost connection to ${servicesStr}. Retrying in ${ - join(items.map(([_, item]) => `${Math.ceil((item.end! - now) / 1000)}s`)) - }.`; - - const buttons = [{ - label: `Retry ${items.length > 1 ? "Services" : items[0][0]} Now`, - run: (): void => { - logger.info(`Forcing ${servicesStr} to restart now`); - items.forEach(([name, item]) => { - this.runItem(name, item); - }); - this.updateNotification(); - }, - }]; - - if (!this.notificationHandle) { - this.notificationHandle = this.notificationService.prompt( - Severity.Info, - message, - buttons, - () => { - this.notificationHandle = undefined; - // tslint:disable-next-line no-any because NodeJS.Timer is valid. - clearTimeout(this.updateTimeout as any); - }, - ); - } else { - this.notificationHandle.updateMessage(message); - this.notificationHandle.updateButtons(buttons); - } - - this.updateTimeout = setTimeout(() => this.updateNotification(), this.updateDelay * 1000); - } - - /** - * Stop an item's timer. - */ - private stopItem(item: IRetryItem): void { - // tslint:disable-next-line no-any because NodeJS.Timer is valid. - clearTimeout(item.timeout as any); - item.timeout = undefined; - item.end = undefined; - } -} - -// Global instance so we can block other retries when retrying the main -// connection. -export const retry = new Retry(new NotificationService()); diff --git a/packages/ide/src/upload.ts b/packages/ide/src/upload.ts deleted file mode 100644 index abb70fdc3145..000000000000 --- a/packages/ide/src/upload.ts +++ /dev/null @@ -1,358 +0,0 @@ -import { exec } from "child_process"; -import { appendFile } from "fs"; -import { promisify } from "util"; -import { logger } from "@coder/logger"; -import { escapePath } from "@coder/protocol"; -import { NotificationService, INotificationService, ProgressService, IProgressService, IProgress, Severity } from "./fill/notification"; - -export interface IURI { - readonly path: string; - readonly fsPath: string; - readonly scheme: string; -} - -/** - * Represents an uploadable directory, so we can query for existing files once. - */ -interface IUploadableDirectory { - existingFiles: string[]; - filesToUpload: Map; - preparePromise?: Promise; -} - -/** - * There doesn't seem to be a provided type for entries, so here is an - * incomplete version. - */ -interface IEntry { - name: string; - isFile: boolean; - file: (cb: (file: File) => void) => void; - createReader: () => ({ - readEntries: (cb: (entries: Array) => void) => void; - }); -} - -/** - * Handles file uploads. - */ -export class Upload { - private readonly maxParallelUploads = 100; - private readonly readSize = 32000; // ~32kb max while reading in the file. - private readonly packetSize = 32000; // ~32kb max when writing. - private readonly logger = logger.named("Upload"); - private readonly currentlyUploadingFiles = new Map(); - private readonly queueByDirectory = new Map(); - private progress: IProgress | undefined; - private uploadPromise: Promise | undefined; - private resolveUploadPromise: (() => void) | undefined; - private finished = 0; - private uploadedFilePaths = []; - private total = 0; - - public constructor( - private _notificationService: INotificationService, - private _progressService: IProgressService, - ) {} - - public set notificationService(service: INotificationService) { - this._notificationService = service; - } - - public get notificationService(): INotificationService { - return this._notificationService; - } - - public set progressService(service: IProgressService) { - this._progressService = service; - } - - public get progressService(): IProgressService { - return this._progressService; - } - - /** - * Upload dropped files. This will try to upload everything it can. Errors - * will show via notifications. If an upload operation is ongoing, the files - * will be added to that operation. - */ - public async uploadDropped(event: DragEvent, uploadDir: IURI): Promise { - this.addDirectory(uploadDir.path); - await this.queueFiles(event, uploadDir); - this.logger.debug( // -1 so we don't include the uploadDir itself. - `Uploading ${this.queueByDirectory.size - 1} directories and ${this.total} files`, - ); - await this.prepareDirectories(); - if (!this.uploadPromise) { - this.uploadPromise = this.progressService.start("Uploading files...", (progress) => { - return new Promise((resolve): void => { - this.progress = progress; - this.resolveUploadPromise = (): void => { - const uploaded = this.uploadedFilePaths; - this.uploadPromise = undefined; - this.resolveUploadPromise = undefined; - this.uploadedFilePaths = []; - this.finished = 0; - this.total = 0; - resolve(uploaded); - }; - }); - }, () => { - this.cancel(); - }); - } - this.uploadFiles(); - - return this.uploadPromise; - } - - /** - * Cancel all file uploads. - */ - public async cancel(): Promise { - this.currentlyUploadingFiles.clear(); - this.queueByDirectory.clear(); - } - - /** - * Create directories and get existing files. - * On failure, show the error and remove the failed directory from the queue. - */ - private async prepareDirectories(): Promise { - await Promise.all(Array.from(this.queueByDirectory).map(([path, dir]) => { - if (!dir.preparePromise) { - dir.preparePromise = this.prepareDirectory(path, dir); - } - - return dir.preparePromise; - })); - } - - /** - * Create a directory and get existing files. - * On failure, show the error and remove the directory from the queue. - */ - private async prepareDirectory(path: string, dir: IUploadableDirectory): Promise { - await Promise.all([ - promisify(exec)(`mkdir -p ${escapePath(path)}`).catch((error) => { - const message = error.message.toLowerCase(); - if (message.includes("file exists")) { - throw new Error(`Unable to create directory at ${path} because a file exists there`); - } - throw new Error(error.message || `Unable to upload ${path}`); - }), - // Only get files, so we don't show an override option that will just - // fail anyway. - promisify(exec)(`find ${escapePath(path)} -maxdepth 1 -not -type d`).then((stdio) => { - dir.existingFiles = stdio.stdout.split("\n"); - }), - ]).catch((error) => { - this.queueByDirectory.delete(path); - this.notificationService.error(error); - }); - } - - /** - * Upload as many files as possible. When finished, resolve the upload promise. - */ - private uploadFiles(): void { - const finishFileUpload = (path: string): void => { - ++this.finished; - this.currentlyUploadingFiles.delete(path); - this.progress!.report(Math.floor((this.finished / this.total) * 100)); - this.uploadFiles(); - }; - while (this.queueByDirectory.size > 0 && this.currentlyUploadingFiles.size < this.maxParallelUploads) { - const [dirPath, dir] = this.queueByDirectory.entries().next().value; - if (dir.filesToUpload.size === 0) { - this.queueByDirectory.delete(dirPath); - continue; - } - const [filePath, item] = dir.filesToUpload.entries().next().value; - this.currentlyUploadingFiles.set(filePath, item); - dir.filesToUpload.delete(filePath); - this.uploadFile(filePath, item, dir.existingFiles).then(() => { - finishFileUpload(filePath); - }).catch((error) => { - this.notificationService.error(error); - finishFileUpload(filePath); - }); - } - if (this.queueByDirectory.size === 0 && this.currentlyUploadingFiles.size === 0) { - this.resolveUploadPromise!(); - } - } - - /** - * Upload a file. - */ - private async uploadFile(path: string, file: File, existingFiles: string[]): Promise { - if (existingFiles.includes(path)) { - const shouldOverwrite = await new Promise((resolve): void => { - this.notificationService.prompt( - Severity.Error, - `${path} already exists. Overwrite?`, - [{ - label: "Yes", - run: (): void => resolve(true), - }, { - label: "No", - run: (): void => resolve(false), - }], - () => resolve(false), - ); - }); - if (!shouldOverwrite) { - return; - } - } - await new Promise(async (resolve, reject): Promise => { - let readOffset = 0; - const reader = new FileReader(); - const seek = (): void => { - const slice = file.slice(readOffset, readOffset + this.readSize); - readOffset += this.readSize; - reader.readAsArrayBuffer(slice); - }; - - const rm = async (): Promise => { - await promisify(exec)(`rm -f ${escapePath(path)}`); - }; - - await rm(); - - const load = async (): Promise => { - const buffer = new Uint8Array(reader.result as ArrayBuffer); - let bufferOffset = 0; - - while (bufferOffset <= buffer.length) { - // Got canceled while sending data. - if (!this.currentlyUploadingFiles.has(path)) { - await rm(); - - return resolve(); - } - const data = buffer.slice(bufferOffset, bufferOffset + this.packetSize); - - try { - await promisify(appendFile)(path, data); - } catch (error) { - await rm(); - - const message = error.message.toLowerCase(); - if (message.includes("no space")) { - return reject(new Error("You are out of disk space")); - } else if (message.includes("is a directory")) { - return reject(new Error(`Unable to upload ${path} because there is a directory there`)); - } - - return reject(new Error(error.message || `Unable to upload ${path}`)); - } - - bufferOffset += this.packetSize; - } - - if (readOffset >= file.size) { - this.uploadedFilePaths.push(path); - - return resolve(); - } - - seek(); - }; - - reader.addEventListener("load", load); - - seek(); - }); - } - - /** - * Queue files from a drop event. We have to get the files first; we can't do - * it in tandem with uploading or the entries will disappear. - */ - private async queueFiles(event: DragEvent, uploadDir: IURI): Promise { - if (!event.dataTransfer || !event.dataTransfer.items) { - return; - } - const promises: Array> = []; - for (let i = 0; i < event.dataTransfer.items.length; i++) { - const item = event.dataTransfer.items[i]; - if (typeof item.webkitGetAsEntry === "function") { - promises.push(this.traverseItem(item.webkitGetAsEntry(), uploadDir.fsPath).catch(this.notificationService.error)); - } else { - const file = item.getAsFile(); - if (file) { - this.addFile(uploadDir.fsPath, uploadDir.fsPath + "/" + file.name, file); - } - } - } - await Promise.all(promises); - } - - /** - * Traverses an entry and add files to the queue. - */ - private async traverseItem(entry: IEntry, parentPath: string): Promise { - if (entry.isFile) { - return new Promise((resolve): void => { - entry.file((file) => { - this.addFile( - parentPath, - parentPath + "/" + file.name, - file, - ); - resolve(); - }); - }); - } - - parentPath += "/" + entry.name; - this.addDirectory(parentPath); - - await new Promise((resolve): void => { - const promises: Array> = []; - const dirReader = entry.createReader(); - // According to the spec, readEntries() must be called until it calls - // the callback with an empty array. - const readEntries = (): void => { - dirReader.readEntries((entries) => { - if (entries.length === 0) { - Promise.all(promises).then(resolve).catch((error) => { - this.notificationService.error(error); - resolve(); - }); - } else { - promises.push(...entries.map((child) => this.traverseItem(child, parentPath))); - readEntries(); - } - }); - }; - readEntries(); - }); - } - - /** - * Add a file to the queue. - */ - private addFile(parentPath: string, path: string, file: File): void { - ++this.total; - this.addDirectory(parentPath); - this.queueByDirectory.get(parentPath)!.filesToUpload.set(path, file); - } - - /** - * Add a directory to the queue. - */ - private addDirectory(path: string): void { - if (!this.queueByDirectory.has(path)) { - this.queueByDirectory.set(path, { - existingFiles: [], - filesToUpload: new Map(), - }); - } - } -} - -// Global instance. -export const upload = new Upload(new NotificationService(), new ProgressService()); diff --git a/packages/ide/yarn.lock b/packages/ide/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/ide/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/logger/.npmignore b/packages/logger/.npmignore deleted file mode 100644 index d248c0bf6920..000000000000 --- a/packages/logger/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -src -tsconfig.build.json -webpack.config.js -yarn.lock \ No newline at end of file diff --git a/packages/logger/README.md b/packages/logger/README.md deleted file mode 100644 index c449d6cbff23..000000000000 --- a/packages/logger/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Logger - -Beautiful logging inspired by https://github.com/uber-go/zap. - -- Built for node and the browser -- Zero dependencies -- Uses groups in the browser to reduce clutter - -## Example Usage - -```javascript -import { field, logger } from "@coder/logger"; - -logger.info("Loading container", - field("container_id", container.id_str), - field("organization_id", organization.id_str)); -``` - -## Formatting - -By default the logger uses a different formatter depending on whether it detects -it is running in the browser or not. A custom formatter can be set: - -```javascript -import { logger, Formatter } from "@coder/logger"; - -class MyFormatter extends Formatter { - // implementation ... -} - -logger.formatter = new MyFormatter(); -``` diff --git a/packages/logger/package.json b/packages/logger/package.json deleted file mode 100644 index 955c45016691..000000000000 --- a/packages/logger/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "@coder/logger", - "description": "Beautiful logging inspired by https://github.com/uber-go/zap.", - "scripts": { - "build": "tsc -p tsconfig.build.json && cp ./out/packages/logger/src/* ./out && rm -rf out/packages && ../../node_modules/.bin/webpack --config ./webpack.config.js", - "postinstall": "if [ ! -d out ];then npm run build; fi" - }, - "version": "1.1.3", - "main": "out/main.js", - "types": "out/index.d.ts", - "author": "Coder", - "license": "MIT", - "dependencies": { - "@google-cloud/logging": "^4.5.2" - } -} diff --git a/packages/logger/src/extender.test.ts b/packages/logger/src/extender.test.ts deleted file mode 100644 index cae17196feac..000000000000 --- a/packages/logger/src/extender.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { field, logger } from "./logger"; -import { createStackdriverExtender } from "./extender"; - -describe("Extender", () => { - it("should add stackdriver extender", () => { - logger.extend(createStackdriverExtender("coder-dev-1", "logging-package-tests")); - }); - - it("should log", async () => { - logger.debug("Bananas!", field("frog", { hi: "wow" })); - }); -}); diff --git a/packages/logger/src/extender.ts b/packages/logger/src/extender.ts deleted file mode 100644 index b46c735d5858..000000000000 --- a/packages/logger/src/extender.ts +++ /dev/null @@ -1,63 +0,0 @@ -import * as gcl from "@google-cloud/logging"; -import { Extender, logger, field } from "./logger"; - -export const createStackdriverExtender = (projectId: string, logId: string): Extender => { - enum GcpLogSeverity { - DEFAULT = 0, - DEBUG = 100, - INFO = 200, - NOTICE = 300, - WARNING = 400, - ERROR = 500, - CRITICAL = 600, - ALERT = 700, - EMERGENCY = 800, - } - - const logging = new gcl.Logging({ - autoRetry: true, - projectId, - }); - - const log = logging.log(logId); - const convertSeverity = (severity: "trace" | "info" | "warn" | "debug" | "error"): GcpLogSeverity => { - switch (severity) { - case "trace": - case "debug": - return GcpLogSeverity.DEBUG; - case "info": - return GcpLogSeverity.INFO; - case "error": - return GcpLogSeverity.ERROR; - case "warn": - return GcpLogSeverity.WARNING; - } - }; - - return (options): void => { - const severity = convertSeverity(options.type); - // tslint:disable-next-line:no-any - const metadata = {} as any; - if (options.fields) { - options.fields.forEach((f) => { - if (!f) { - return; - } - metadata[f.identifier] = f.value; - }); - } - - const entry = log.entry({ - // tslint:disable-next-line:no-any - severity: severity as any, - }, { - ...metadata, - message: options.message, - }); - - log.write(entry).catch((ex) => { - logger.named("GCP").error("Failed to log", field("error", ex)); - }); - }; - -}; diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts deleted file mode 100644 index 41c7bf273ebb..000000000000 --- a/packages/logger/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./logger"; diff --git a/packages/logger/src/logger.test.ts b/packages/logger/src/logger.test.ts deleted file mode 100644 index b34cad668e1a..000000000000 --- a/packages/logger/src/logger.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { field, logger, BrowserFormatter, Time } from "./logger"; - -describe("Logger", () => { - it("should use server formatter", () => { - logger.info("test", field("key", "value"), field("time", new Time(100, Date.now()))); - logger.named("name").debug("test name"); - logger.named("another name").warn("another test name"); - }); - - it("should use browser formatter", () => { - logger.formatter = new BrowserFormatter(); - logger.info("test", field("key", "value"), field("time", new Time(100, Date.now()))); - logger.named("name").debug("test name"); - logger.named("another name").warn("another test name"); - }); -}); diff --git a/packages/logger/src/logger.ts b/packages/logger/src/logger.ts deleted file mode 100644 index 70e15affd192..000000000000 --- a/packages/logger/src/logger.ts +++ /dev/null @@ -1,464 +0,0 @@ -/** - * Log level. - */ -export enum Level { - Trace, - Debug, - Info, - Warning, - Error, -} - -/** - * A field to log. - */ -export class Field { - public constructor( - public readonly identifier: string, - public readonly value: T, - ) { } - - /** - * Convert field to JSON. - */ - public toJSON(): object { - return { - identifier: this.identifier, - value: this.value, - }; - } -} - -/** - * Represents the time something takes. - */ -export class Time { - public constructor( - public readonly expected: number, - public readonly ms: number, - ) { } -} - -// `undefined` is allowed to make it easy to conditionally display a field. -// For example: `error && field("error", error)` -// tslint:disable-next-line no-any -export type FieldArray = Array | undefined>; - -// Functions can be used to remove the need to perform operations when the -// logging level won't output the result anyway. -export type LogCallback = () => [string, ...FieldArray]; - -/** - * Creates a time field - */ -export const time = (expected: number): Time => { - return new Time(expected, Date.now()); -}; - -export const field = (name: string, value: T): Field => { - return new Field(name, value); -}; - -export type Extender = (msg: { - message: string, - level: Level, - type: "trace" | "info" | "warn" | "debug" | "error", - fields?: FieldArray, - section?: string, -}) => void; - -/** - * This formats & builds text for logging. - * It should only be used to build one log item at a time since it stores the - * currently built items and appends to that. - */ -export abstract class Formatter { - protected format = ""; - protected args = []; - - /** - * Add a tag. - */ - public abstract tag(name: string, color: string): void; - - /** - * Add string or arbitrary variable. - */ - public abstract push(arg: string, color?: string, weight?: string): void; - public abstract push(arg: any): void; // tslint:disable-line no-any - - // tslint:disable-next-line no-any - public abstract fields(fields: Array>): void; - - /** - * Flush out the built arguments. - */ - public flush(): any[] { // tslint:disable-line no-any - const args = [this.format, ...this.args]; - this.format = ""; - this.args = []; - - return args; - } - - /** - * Get the format string for the value type. - */ - protected getType(arg: any): string { // tslint:disable-line no-any - switch (typeof arg) { - case "object": - return "%o"; - case "number": - return "%d"; - default: - return "%s"; - } - } -} - -/** - * Browser formatter. - */ -export class BrowserFormatter extends Formatter { - public tag(name: string, color: string): void { - this.format += `%c ${name} `; - this.args.push( - `border: 1px solid #222; background-color: ${color}; padding-top: 1px;` - + " padding-bottom: 1px; font-size: 12px; font-weight: bold; color: white;" - + (name.length === 4 ? "padding-left: 3px; padding-right: 4px;" : ""), - ); - // A space to separate the tag from the title. - this.push(" "); - } - - public push(arg: any, color: string = "inherit", weight: string = "normal"): void { // tslint:disable-line no-any - if (color || weight) { - this.format += "%c"; - this.args.push( - (color ? `color: ${color};` : "") + - (weight ? `font-weight: ${weight};` : ""), - ); - } - this.format += this.getType(arg); - this.args.push(arg); - } - - // tslint:disable-next-line no-any - public fields(fields: Array>): void { - // tslint:disable-next-line no-console - console.groupCollapsed(...this.flush()); - fields.forEach((field) => { - this.push(field.identifier, "#3794ff", "bold"); - if (typeof field.value !== "undefined" && field.value.constructor && field.value.constructor.name) { - this.push(` (${field.value.constructor.name})`); - } - this.push(": "); - this.push(field.value); - // tslint:disable-next-line no-console - console.log(...this.flush()); - }); - // tslint:disable-next-line no-console - console.groupEnd(); - } -} - -/** - * Server (Node) formatter. - */ -export class ServerFormatter extends Formatter { - public tag(name: string, color: string): void { - const [r, g, b] = this.hexToRgb(color); - while (name.length < 5) { - name += " "; - } - this.format += "\u001B[1m"; - this.format += `\u001B[38;2;${r};${g};${b}m${name} \u001B[0m`; - } - - public push(arg: any, color?: string, weight?: string): void { // tslint:disable-line no-any - if (weight === "bold") { - this.format += "\u001B[1m"; - } - if (color) { - const [r, g, b] = this.hexToRgb(color); - this.format += `\u001B[38;2;${r};${g};${b}m`; - } - this.format += this.getType(arg); - if (weight || color) { - this.format += "\u001B[0m"; - } - this.args.push(arg); - } - - // tslint:disable-next-line no-any - public fields(fields: Array>): void { - // tslint:disable-next-line no-any - const obj: { [key: string]: any} = {}; - this.format += "\u001B[38;2;140;140;140m"; - fields.forEach((field) => { - obj[field.identifier] = field.value; - }); - this.args.push(JSON.stringify(obj)); - console.log(...this.flush()); // tslint:disable-line no-console - } - - /** - * Convert fully-formed hex to rgb. - */ - private hexToRgb(hex: string): [number, number, number] { - const integer = parseInt(hex.substr(1), 16); - - return [ - (integer >> 16) & 0xFF, - (integer >> 8) & 0xFF, - integer & 0xFF, - ]; - } -} - -/** - * Class for logging. - */ -export class Logger { - public level = Level.Info; - - private readonly nameColor?: string; - private muted: boolean = false; - - public constructor( - private _formatter: Formatter, - private readonly name?: string, - private readonly defaultFields?: FieldArray, - private readonly extenders: Extender[] = [], - ) { - if (name) { - this.nameColor = this.hashStringToColor(name); - } - const envLevel = typeof global !== "undefined" && typeof global.process !== "undefined" ? global.process.env.LOG_LEVEL : process.env.LOG_LEVEL; - if (envLevel) { - switch (envLevel) { - case "trace": this.level = Level.Trace; break; - case "debug": this.level = Level.Debug; break; - case "info": this.level = Level.Info; break; - case "warn": this.level = Level.Warning; break; - case "error": this.level = Level.Error; break; - } - } - } - - public set formatter(formatter: Formatter) { - this._formatter = formatter; - } - - /** - * Supresses all output - */ - public mute(): void { - this.muted = true; - } - - public extend(extender: Extender): void { - this.extenders.push(extender); - } - - /** - * Outputs information. - */ - public info(fn: LogCallback): void; - public info(message: string, ...fields: FieldArray): void; - public info(message: LogCallback | string, ...fields: FieldArray): void { - this.handle({ - type: "info", - message, - fields, - tagColor: "#008FBF", - level: Level.Info, - }); - } - - /** - * Outputs a warning. - */ - public warn(fn: LogCallback): void; - public warn(message: string, ...fields: FieldArray): void; - public warn(message: LogCallback | string, ...fields: FieldArray): void { - this.handle({ - type: "warn", - message, - fields, - tagColor: "#FF9D00", - level: Level.Warning, - }); - } - - /** - * Outputs a trace message. - */ - public trace(fn: LogCallback): void; - public trace(message: string, ...fields: FieldArray): void; - public trace(message: LogCallback | string, ...fields: FieldArray): void { - this.handle({ - type: "trace", - message, - fields, - tagColor: "#888888", - level: Level.Trace, - }); - } - - /** - * Outputs a debug message. - */ - public debug(fn: LogCallback): void; - public debug(message: string, ...fields: FieldArray): void; - public debug(message: LogCallback | string, ...fields: FieldArray): void { - this.handle({ - type: "debug", - message, - fields, - tagColor: "#84009E", - level: Level.Debug, - }); - } - - /** - * Outputs an error. - */ - public error(fn: LogCallback): void; - public error(message: string, ...fields: FieldArray): void; - public error(message: LogCallback | string, ...fields: FieldArray): void { - this.handle({ - type: "error", - message, - fields, - tagColor: "#B00000", - level: Level.Error, - }); - } - - /** - * Returns a sub-logger with a name. - * Each name is deterministically generated a color. - */ - public named(name: string, ...fields: FieldArray): Logger { - const l = new Logger(this._formatter, name, fields, this.extenders); - if (this.muted) { - l.mute(); - } - - return l; - } - - /** - * Outputs a message. - */ - private handle(options: { - type: "trace" | "info" | "warn" | "debug" | "error"; - message: string | LogCallback; - fields?: FieldArray; - level: Level; - tagColor: string; - }): void { - if (this.level > options.level || this.muted) { - return; - } - - let passedFields = options.fields || []; - if (typeof options.message === "function") { - const values = options.message(); - options.message = values.shift() as string; - passedFields = values as FieldArray; - } - - const fields = (this.defaultFields - ? passedFields.filter((f) => !!f).concat(this.defaultFields) - : passedFields.filter((f) => !!f)) as Array>; // tslint:disable-line no-any - - const now = Date.now(); - let times: Array> = []; - const hasFields = fields && fields.length > 0; - if (hasFields) { - times = fields.filter((f) => f.value instanceof Time); - } - - this._formatter.tag(options.type.toUpperCase(), options.tagColor); - if (this.name && this.nameColor) { - this._formatter.tag(this.name.toUpperCase(), this.nameColor); - } - this._formatter.push(options.message); - if (times.length > 0) { - times.forEach((time) => { - const diff = now - time.value.ms; - const expPer = diff / time.value.expected; - const min = 125 * (1 - expPer); - const max = 125 + min; - const green = expPer < 1 ? max : min; - const red = expPer >= 1 ? max : min; - this._formatter.push(` ${time.identifier}=`, "#3794ff"); - this._formatter.push(`${diff}ms`, this.rgbToHex(red > 0 ? red : 0, green > 0 ? green : 0, 0)); - }); - } - - // tslint:disable no-console - if (hasFields) { - this._formatter.fields(fields); - } else { - console.log(...this._formatter.flush()); - } - // tslint:enable no-console - - this.extenders.forEach((extender) => { - extender({ - section: this.name, - fields: options.fields, - level: options.level, - message: options.message as string, - type: options.type, - }); - }); - } - - /** - * Hashes a string. - */ - private djb2(str: string): number { - let hash = 5381; - for (let i = 0; i < str.length; i++) { - hash = ((hash << 5) + hash) + str.charCodeAt(i); /* hash * 33 + c */ - } - - return hash; - } - - /** - * Convert rgb to hex. - */ - private rgbToHex(r: number, g: number, b: number): string { - const integer = ((Math.round(r) & 0xFF) << 16) - + ((Math.round(g) & 0xFF) << 8) - + (Math.round(b) & 0xFF); - - const str = integer.toString(16); - - return "#" + "000000".substring(str.length) + str; - } - - /** - * Generates a deterministic color from a string using hashing. - */ - private hashStringToColor(str: string): string { - const hash = this.djb2(str); - - return this.rgbToHex( - (hash & 0xFF0000) >> 16, - (hash & 0x00FF00) >> 8, - hash & 0x0000FF, - ); - } -} - -export const logger = new Logger( - typeof process === "undefined" || typeof process.stdout === "undefined" - ? new BrowserFormatter() - : new ServerFormatter(), -); diff --git a/packages/logger/tsconfig.build.json b/packages/logger/tsconfig.build.json deleted file mode 100644 index 04a1c4cb324d..000000000000 --- a/packages/logger/tsconfig.build.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "declarationDir": "out", - "declaration": true, - "emitDeclarationOnly": true - } -} \ No newline at end of file diff --git a/packages/logger/webpack.config.js b/packages/logger/webpack.config.js deleted file mode 100644 index 815dec737cc1..000000000000 --- a/packages/logger/webpack.config.js +++ /dev/null @@ -1,34 +0,0 @@ -const path = require("path"); -const merge = require("webpack-merge"); - -module.exports = [ - merge(require(path.join(__dirname, "../../scripts", "webpack.general.config.js"))(), { - devtool: "none", - mode: "production", - target: "node", - output: { - path: path.join(__dirname, "out"), - filename: "main.js", - libraryTarget: "commonjs", - }, - entry: [ - "./packages/logger/src/index.ts" - ], - }), - merge(require(path.join(__dirname, "../../scripts", "webpack.general.config.js"))(), { - devtool: "none", - mode: "production", - target: "node", - output: { - path: path.join(__dirname, "out"), - filename: "extender.js", - libraryTarget: "commonjs", - }, - externals: { - "@google-cloud/logging": "commonjs @google-cloud/logging", - }, - entry: [ - "./packages/logger/src/extender.ts" - ], - }), -]; diff --git a/packages/logger/yarn.lock b/packages/logger/yarn.lock deleted file mode 100644 index 7d1cf408b0ac..000000000000 --- a/packages/logger/yarn.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@google-cloud/common-grpc@^0.10.0": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@google-cloud/common-grpc/-/common-grpc-0.10.1.tgz#ac50bc4b50cb50ba4c7ec335074b631900301fee" - integrity sha512-oV5mKRqPAqamPcjj8S61UKyB5cz2ugA0/9MPXUfu0CoYaG6AnhnrbPhHDOW6fQ4eci27ER5iakR00htvM9C+Xg== - dependencies: - "@google-cloud/common" "^0.31.0" - "@google-cloud/projectify" "^0.3.0" - "@google-cloud/promisify" "^0.4.0" - "@grpc/proto-loader" "^0.4.0" - duplexify "^4.0.0" - extend "^3.0.2" - grpc "^1.15.1" - is "^3.2.1" - retry-request "^4.0.0" - through2 "^3.0.0" - -"@google-cloud/common@^0.31.0": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@google-cloud/common/-/common-0.31.1.tgz#ab8da218b0a435c396807d1fb6fe7a7854ce9a1f" - integrity sha512-MgaF8VmDaoyIqzZUXIbcohTb5sQn+PYlYmcpb0/E8psUpVe+kaBwLq/Z8pcFtACCr6PNT36n+a6s1kG35bAuCA== - dependencies: - "@google-cloud/projectify" "^0.3.2" - "@google-cloud/promisify" "^0.4.0" - "@types/duplexify" "^3.5.0" - "@types/request" "^2.47.0" - arrify "^1.0.1" - duplexify "^3.6.0" - ent "^2.2.0" - extend "^3.0.1" - google-auth-library "^3.0.0" - pify "^4.0.0" - retry-request "^4.0.0" - -"@google-cloud/logging@^4.5.2": - version "4.5.2" - resolved "https://registry.yarnpkg.com/@google-cloud/logging/-/logging-4.5.2.tgz#1248d7ff3f8cd2c879527aed457ee7ddce92d815" - integrity sha512-jW5XtSMf//e9JCXMkKAUuzY4hoAL6s7Cwv1gPfZMnIuMuTeD44UMyI1uTa2/yGVnvWWuawrDgdcLf5ugk7/G3w== - dependencies: - "@google-cloud/common-grpc" "^0.10.0" - "@google-cloud/paginator" "^0.2.0" - "@google-cloud/projectify" "^0.3.0" - "@google-cloud/promisify" "^0.4.0" - "@opencensus/propagation-stackdriver" "0.0.11" - arrify "^2.0.0" - eventid "^0.1.2" - extend "^3.0.2" - gcp-metadata "^1.0.0" - google-auth-library "^3.0.0" - google-gax "^0.25.0" - is "^3.2.1" - lodash.merge "^4.6.1" - on-finished "^2.3.0" - pify "^4.0.1" - protobufjs "^6.8.8" - pumpify "^1.5.1" - snakecase-keys "^2.0.0" - stream-events "^1.0.4" - through2 "^3.0.0" - type-fest "^0.3.1" - -"@google-cloud/paginator@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@google-cloud/paginator/-/paginator-0.2.0.tgz#eab2e6aa4b81df7418f6c51e2071f64dab2c2fa5" - integrity sha512-2ZSARojHDhkLvQ+CS32K+iUhBsWg3AEw+uxtqblA7xoCABDyhpj99FPp35xy6A+XlzMhOSrHHaxFE+t6ZTQq0w== - dependencies: - arrify "^1.0.1" - extend "^3.0.1" - split-array-stream "^2.0.0" - stream-events "^1.0.4" - -"@google-cloud/projectify@^0.3.0", "@google-cloud/projectify@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@google-cloud/projectify/-/projectify-0.3.3.tgz#bde9103d50b20a3ea3337df8c6783a766e70d41d" - integrity sha512-7522YHQ4IhaafgSunsFF15nG0TGVmxgXidy9cITMe+256RgqfcrfWphiMufW+Ou4kqagW/u3yxwbzVEW3dk2Uw== - -"@google-cloud/promisify@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@google-cloud/promisify/-/promisify-0.4.0.tgz#4fbfcf4d85bb6a2e4ccf05aa63d2b10d6c9aad9b" - integrity sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q== - -"@grpc/grpc-js@^0.3.0": - version "0.3.6" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-0.3.6.tgz#d9b52043907170d38e06711d9477fde29ab46fa8" - integrity sha512-SmLNuPGlUur64bNS9aHZguqWDVQ8+Df1CGn+xsh7l6T2wiP5ArOMlywZ3TZo6z/rwKtGQgUJY9ZrPYUmHEXd/Q== - dependencies: - semver "^5.5.0" - -"@grpc/proto-loader@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.4.0.tgz#a823a51eb2fde58369bef1deb5445fd808d70901" - integrity sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw== - dependencies: - lodash.camelcase "^4.3.0" - protobufjs "^6.8.6" - -"@opencensus/core@^0.0.11": - version "0.0.11" - resolved "https://registry.yarnpkg.com/@opencensus/core/-/core-0.0.11.tgz#484f1486a4babb91428531e4e852ff50b5a68673" - integrity sha512-UuRmn7TbaIEkT4jhIjjlnvI7U1B3xjUbLqPr7fRrOYiTfCdaGFRmVYC4Jj7Fj5K/JQ66lR35KiRCOThWaBQ2pA== - dependencies: - continuation-local-storage "^3.2.1" - log-driver "^1.2.7" - semver "^6.0.0" - shimmer "^1.2.0" - uuid "^3.2.1" - -"@opencensus/propagation-stackdriver@0.0.11": - version "0.0.11" - resolved "https://registry.yarnpkg.com/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.11.tgz#302f595926f0082406a40ea51f27580c5c2bd645" - integrity sha512-Ra0bODDCTPnodi4eZ+jEFfHD6XNPiAx9tCrU7sh7c52fJat85o2xhwLwxnfDDF68ZBw5C9JNOQfCmBUTbOXrjg== - dependencies: - "@opencensus/core" "^0.0.11" - hex2dec "^1.0.1" - uuid "^3.2.1" - -"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" - integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= - -"@protobufjs/base64@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" - integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== - -"@protobufjs/codegen@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" - integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== - -"@protobufjs/eventemitter@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" - integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= - -"@protobufjs/fetch@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" - integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= - dependencies: - "@protobufjs/aspromise" "^1.1.1" - "@protobufjs/inquire" "^1.1.0" - -"@protobufjs/float@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" - integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= - -"@protobufjs/inquire@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" - integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= - -"@protobufjs/path@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" - integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= - -"@protobufjs/pool@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" - integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= - -"@protobufjs/utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" - integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= - -"@types/caseless@*": - version "0.12.2" - resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" - integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== - -"@types/duplexify@^3.5.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@types/duplexify/-/duplexify-3.6.0.tgz#dfc82b64bd3a2168f5bd26444af165bf0237dcd8" - integrity sha512-5zOA53RUlzN74bvrSGwjudssD9F3a797sDZQkiYpUOxW+WHaXTCPz4/d5Dgi6FKnOqZ2CpaTo0DhgIfsXAOE/A== - dependencies: - "@types/node" "*" - -"@types/form-data@*": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e" - integrity sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ== - dependencies: - "@types/node" "*" - -"@types/long@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" - integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q== - -"@types/node@*": - version "11.13.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.4.tgz#f83ec3c3e05b174b7241fadeb6688267fe5b22ca" - integrity sha512-+rabAZZ3Yn7tF/XPGHupKIL5EcAbrLxnTr/hgQICxbeuAfWtT0UZSfULE+ndusckBItcv4o6ZeOJplQikVcLvQ== - -"@types/node@^10.1.0": - version "10.14.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.4.tgz#1c586b991457cbb58fef51bc4e0cfcfa347714b5" - integrity sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg== - -"@types/request@^2.47.0": - version "2.48.1" - resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.1.tgz#e402d691aa6670fbbff1957b15f1270230ab42fa" - integrity sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg== - dependencies: - "@types/caseless" "*" - "@types/form-data" "*" - "@types/node" "*" - "@types/tough-cookie" "*" - -"@types/tough-cookie@*": - version "2.3.5" - resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.5.tgz#9da44ed75571999b65c37b60c9b2b88db54c585d" - integrity sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -arrify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -async-listener@^0.6.0: - version "0.6.10" - resolved "https://registry.yarnpkg.com/async-listener/-/async-listener-0.6.10.tgz#a7c97abe570ba602d782273c0de60a51e3e17cbc" - integrity sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw== - dependencies: - semver "^5.3.0" - shimmer "^1.1.0" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base64-js@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== - -bignumber.js@^7.0.0: - version "7.2.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" - integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -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 sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -continuation-local-storage@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz#11f613f74e914fe9b34c92ad2d28fe6ae1db7ffb" - integrity sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA== - dependencies: - async-listener "^0.6.0" - emitter-listener "^1.1.1" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -d64@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d64/-/d64-1.0.0.tgz#4002a87e850cbfc9f9d9706b60fca613a3336e90" - integrity sha1-QAKofoUMv8n52XBrYPymE6MzbpA= - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -duplexify@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.0.0.tgz#9eddda497bf43dddd2d143d31f7a4e68ad1e53a9" - integrity sha512-yY3mlX6uXXe53lt9TnyIIlPZD9WfBEl+OU/8YLiU+p0xxaNRMjLE+rIEURR5/F1H41z9iMHcmVRxRS89tKCUcQ== - dependencies: - end-of-stream "^1.4.1" - inherits "^2.0.3" - readable-stream "^3.1.1" - stream-shift "^1.0.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" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -emitter-listener@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8" - integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ== - dependencies: - shimmer "^1.2.0" - -end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== - dependencies: - once "^1.4.0" - -ent@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - -es6-promise@^4.0.3: - version "4.2.6" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f" - integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -eventid@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/eventid/-/eventid-0.1.2.tgz#0b232d3e244ea5b1d528984140ea69ac7ec89215" - integrity sha1-CyMtPiROpbHVKJhBQOpprH7IkhU= - dependencies: - d64 "^1.0.0" - uuid "^3.0.1" - -extend@^3.0.1, extend@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -fast-text-encoding@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz#3e5ce8293409cfaa7177a71b9ca84e1b1e6f25ef" - integrity sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ== - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -gaxios@^1.0.2, gaxios@^1.0.4, gaxios@^1.2.1: - version "1.8.3" - resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-1.8.3.tgz#7dd79860880d22f854d814b3870332be8b16de56" - integrity sha512-6Lc1P0NjbPNQ2FGgTRurz32P6FktNJbwLqXvrUNhfwzKb9iizcWuAJiHoSG2W186K9ZL0X6ST5xD9gJWhHI1sg== - dependencies: - abort-controller "^3.0.0" - extend "^3.0.2" - https-proxy-agent "^2.2.1" - node-fetch "^2.3.0" - -gcp-metadata@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-1.0.0.tgz#5212440229fa099fc2f7c2a5cdcb95575e9b2ca6" - integrity sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ== - dependencies: - gaxios "^1.0.2" - json-bigint "^0.3.0" - -glob@^7.0.5, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -google-auth-library@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-3.1.2.tgz#ff2f88cd5cd2118a57bd3d5ad3c093c8837fc350" - integrity sha512-cDQMzTotwyWMrg5jRO7q0A4TL/3GWBgO7I7q5xGKNiiFf9SmGY/OJ1YsLMgI2MVHHsEGyrqYnbnmV1AE+Z6DnQ== - dependencies: - base64-js "^1.3.0" - fast-text-encoding "^1.0.0" - gaxios "^1.2.1" - gcp-metadata "^1.0.0" - gtoken "^2.3.2" - https-proxy-agent "^2.2.1" - jws "^3.1.5" - lru-cache "^5.0.0" - semver "^5.5.0" - -google-gax@^0.25.0: - version "0.25.6" - resolved "https://registry.yarnpkg.com/google-gax/-/google-gax-0.25.6.tgz#5ea5c743933ba957da63951bc828aef91fb69340" - integrity sha512-+CVtOSLQt42mwVvJJirhBiAvWsp8zKeb9zW5Wy3wyvb3VG9OugHzZpwvYO9D4yNPPspe7L9CpIs80I5nUJlS8w== - dependencies: - "@grpc/grpc-js" "^0.3.0" - "@grpc/proto-loader" "^0.4.0" - duplexify "^3.6.0" - google-auth-library "^3.0.0" - google-proto-files "^0.20.0" - grpc "^1.16.0" - grpc-gcp "^0.1.1" - is-stream-ended "^0.1.4" - lodash.at "^4.6.0" - lodash.has "^4.5.2" - protobufjs "^6.8.8" - retry-request "^4.0.0" - semver "^6.0.0" - walkdir "^0.3.2" - -google-p12-pem@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-1.0.4.tgz#b77fb833a2eb9f7f3c689e2e54f095276f777605" - integrity sha512-SwLAUJqUfTB2iS+wFfSS/G9p7bt4eWcc2LyfvmUXe7cWp6p3mpxDo6LLI29MXdU6wvPcQ/up298X7GMC5ylAlA== - dependencies: - node-forge "^0.8.0" - pify "^4.0.0" - -google-proto-files@^0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/google-proto-files/-/google-proto-files-0.20.0.tgz#dfcd1635a0c3f00f49ca057462cf369108ff4b5e" - integrity sha512-ORU+XhOeDv/UPtnCYLkO1ItmfhRCRPR3ZoeVQ7GfVzEs7PVitPIhsYlY5ZzG8XXnsdmtK27ENurfQ1jhAWpZHg== - dependencies: - "@google-cloud/promisify" "^0.4.0" - protobufjs "^6.8.0" - walkdir "^0.3.0" - -grpc-gcp@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/grpc-gcp/-/grpc-gcp-0.1.1.tgz#a11be8a7e7a6edf5f636b44a6a24fb4cc028f71f" - integrity sha512-MAt0Ae9QuL2Lbbt2d+kDta5AxqRD1JVXtBcJuQKp9GeFL5TxPw/hxIyDNyivPjKEXjbG3cBGwSE3CXq6a3KHEQ== - dependencies: - grpc "^1.16.0" - protobufjs "^6.8.8" - -grpc@^1.15.1, grpc@^1.16.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/grpc/-/grpc-1.19.0.tgz#129fb30923ea2fa7a9b2623f9e7930eda91a242f" - integrity sha512-xX+jZ1M3YXjngsRj/gTxB4EwM0WoWUr54DmyNq9xTeg1oSuVaTPD/PK9wnZKOJWTt1pkeFspXqwJPhddZNxHOA== - dependencies: - lodash.camelcase "^4.3.0" - lodash.clone "^4.5.0" - nan "^2.0.0" - node-pre-gyp "^0.12.0" - protobufjs "^5.0.3" - -gtoken@^2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-2.3.3.tgz#8a7fe155c5ce0c4b71c886cfb282a9060d94a641" - integrity sha512-EaB49bu/TCoNeQjhCYKI/CurooBKkGxIqFHsWABW0b25fobBYVTMe84A8EBVVZhl8emiUdNypil9huMOTmyAnw== - dependencies: - gaxios "^1.0.4" - google-p12-pem "^1.0.0" - jws "^3.1.5" - mime "^2.2.0" - pify "^4.0.0" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - -hex2dec@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/hex2dec/-/hex2dec-1.1.2.tgz#8e1ce4bef36a74f7d5723c3fb3090c2860077338" - integrity sha512-Yu+q/XWr2fFQ11tHxPq4p4EiNkb2y+lAacJNhAdRXVfRIcDH6gi7htWFnnlIzvqHMHoWeIsfXlNAjZInpAOJDA== - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-stream-ended@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-stream-ended/-/is-stream-ended-0.1.4.tgz#f50224e95e06bce0e356d440a4827cd35b267eda" - integrity sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw== - -is@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/is/-/is-3.3.0.tgz#61cff6dd3c4193db94a3d62582072b44e5645d79" - integrity sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -json-bigint@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-0.3.0.tgz#0ccd912c4b8270d05f056fbd13814b53d3825b1e" - integrity sha1-DM2RLEuCcNBfBW+9E4FLU9OCWx4= - dependencies: - bignumber.js "^7.0.0" - -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.1.5: - 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" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lodash.at@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.at/-/lodash.at-4.6.0.tgz#93cdce664f0a1994ea33dd7cd40e23afd11b0ff8" - integrity sha1-k83OZk8KGZTqM9181A4jr9EbD/g= - -lodash.camelcase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= - -lodash.clone@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" - integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= - -lodash.has@^4.5.2: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.has/-/lodash.has-4.5.2.tgz#d19f4dc1095058cccbe2b0cdf4ee0fe4aa37c862" - integrity sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI= - -lodash.merge@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" - integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ== - -log-driver@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== - -long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -lru-cache@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -map-obj@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-3.0.0.tgz#4221cc62360f88c0735f9e7c0813bd889657f490" - integrity sha512-Ot+2wruG8WqTbJngDxz0Ifm03y2pO4iL+brq/l+yEkGjUza03BnMQqX2XT//Jls8MOOl2VTHviAoLX+/nq/HXw== - -mime@^2.2.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78" - integrity sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -nan@^2.0.0: - version "2.13.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" - integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== - -needle@^2.2.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.0.tgz#ce3fea21197267bacb310705a7bbe24f2a3a3492" - integrity sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg== - dependencies: - debug "^4.1.0" - iconv-lite "^0.4.4" - sax "^1.2.4" - -node-fetch@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" - integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== - -node-forge@^0.8.0: - version "0.8.2" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.8.2.tgz#b4bcc59fb12ce77a8825fc6a783dfe3182499c5a" - integrity sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg== - -node-pre-gyp@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" - integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - -npm-bundled@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" - integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== - -npm-packlist@^1.1.6: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -on-finished@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -pify@^4.0.0, pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== - -protobufjs@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -protobufjs@^6.8.0, protobufjs@^6.8.6, protobufjs@^6.8.8: - version "6.8.8" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" - integrity sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.0" - "@types/node" "^10.1.0" - long "^4.0.0" - -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -"readable-stream@2 || 3", readable-stream@^3.1.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.3.0.tgz#cb8011aad002eb717bf040291feba8569c986fb9" - integrity sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^2.0.0, readable-stream@^2.0.6, readable-stream@~2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -retry-request@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/retry-request/-/retry-request-4.0.0.tgz#5c366166279b3e10e9d7aa13274467a05cb69290" - integrity sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w== - dependencies: - through2 "^2.0.0" - -rimraf@^2.6.1: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -semver@^5.3.0, semver@^5.5.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -semver@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" - integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -shimmer@^1.1.0, shimmer@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" - integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -snakecase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/snakecase-keys/-/snakecase-keys-2.1.0.tgz#619833e8ff730a74eb0348eaa2f871f97bc92297" - integrity sha512-oQSiCIgNCwixBf8Kxgv0SPo67zQSutIEymAk/dkgcdZEOMPvGMGPua/WwYGPG4LLHArGGews3CB3zEEfqlMk2g== - dependencies: - map-obj "~3.0.0" - to-snake-case "~1.0.0" - -split-array-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/split-array-stream/-/split-array-stream-2.0.0.tgz#85a4f8bfe14421d7bca7f33a6d176d0c076a53b1" - integrity sha512-hmMswlVY91WvGMxs0k8MRgq8zb2mSen4FmDNc5AFiTWtrBpdZN6nwD6kROVe4vNL+ywrvbCKsWVCnEd4riELIg== - dependencies: - is-stream-ended "^0.1.4" - -stream-events@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.5.tgz#bbc898ec4df33a4902d892333d47da9bf1c406d5" - integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg== - dependencies: - stubs "^3.0.0" - -stream-shift@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" - integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== - dependencies: - safe-buffer "~5.1.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -stubs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" - integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls= - -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -through2@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through2@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.1.tgz#39276e713c3302edf9e388dd9c812dd3b825bd5a" - integrity sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== - dependencies: - readable-stream "2 || 3" - -to-no-case@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-no-case/-/to-no-case-1.0.2.tgz#c722907164ef6b178132c8e69930212d1b4aa16a" - integrity sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo= - -to-snake-case@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-snake-case/-/to-snake-case-1.0.0.tgz#ce746913897946019a87e62edfaeaea4c608ab8c" - integrity sha1-znRpE4l5RgGah+Yu366upMYIq4w= - dependencies: - to-space-case "^1.0.0" - -to-space-case@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-space-case/-/to-space-case-1.0.0.tgz#b052daafb1b2b29dc770cea0163e5ec0ebc9fc17" - integrity sha1-sFLar7Gysp3HcM6gFj5ewOvJ/Bc= - dependencies: - to-no-case "^1.0.0" - -type-fest@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" - integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@^3.0.1, uuid@^3.2.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -walkdir@^0.3.0, walkdir@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.3.2.tgz#ac8437a288c295656848ebc19981ebc677a5f590" - integrity sha512-0Twghia4Z5wDGDYWURlhZmI47GvERMCsXIu0QZWVVZyW9ZjpbbZvD9Zy9M6cWiQQRRbAcYajIyKNavaZZDt1Uw== - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/packages/package.json b/packages/package.json deleted file mode 100644 index 95e552cbfa3b..000000000000 --- a/packages/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "scripts": { - "postinstall": "../node_modules/.bin/ts-node ../scripts/install-packages.ts", - "test": "jest" - }, - "devDependencies": { - "@types/jest": "^23.3.12", - "jest": "^23.6.0", - "ts-jest": "^23.10.5" - }, - "dependencies": { - "xmlhttprequest": "1.8.0" - }, - "jest": { - "globals": { - "ts-jest": { - "diagnostics": false - } - }, - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], - "setupFiles": [ - "/../scripts/test-setup.js" - ], - "moduleNameMapper": { - "^.+\\.(s?css|png|svg)$": "/../scripts/dummy.js", - "@coder/ide/src/fill/evaluation": "/ide/src/fill/evaluation", - "@coder/ide/src/fill/client": "/ide/src/fill/client", - "@coder/(.*)/test": "/$1/test", - "@coder/(.*)": "/$1/src", - "vs/(.*)": "/../lib/vscode/src/vs/$1", - "vszip": "/../lib/vscode/src/vs/base/node/zip.ts" - }, - "transform": { - "^.+\\.tsx?$": "ts-jest" - }, - "testPathIgnorePatterns": [ - "/node_modules/", - "/logger/" - ], - "testRegex": ".*\\.test\\.tsx?" - } -} diff --git a/packages/protocol/README.md b/packages/protocol/README.md deleted file mode 100644 index a837f0ace807..000000000000 --- a/packages/protocol/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Protocol - -This module provides a way for the browser to run Node modules like `fs`, `net`, -etc. - -## Internals - -### Server-side proxies -The server-side proxies are regular classes that call native Node functions. The -only thing special about them is that they must return promises and they must -return serializable values. - -The only exception to the promise rule are event-related methods such as -`onEvent` and `onDone` (these are synchronous). The server will simply -immediately bind and push all events it can to the client. It doesn't wait for -the client to start listening. This prevents issues with the server not -receiving the client's request to start listening in time. - -However, there is a way to specify events that should not bind immediately and -should wait for the client to request it, because some events (like `data` on a -stream) cannot be bound immediately (because doing so changes how the stream -behaves). - -### Client-side proxies -Client-side proxies are `Proxy` instances. They simply make remote calls for any -method you call on it. The only exception is for events. Each client proxy has a -local emitter which it uses in place of a remote call (this allows the call to -be completed synchronously on the client). Then when an event is received from -the server, it gets emitted on that local emitter. - -When an event is listened to, the proxy also notifies the server so it can start -listening in case it isn't already (see the `data` example above). This only -works for events that only fire after they are bound. - -### Client-side fills -The client-side fills implement the Node API and make calls to the server-side -proxies using the client-side proxies. - -When a proxy returns a proxy (for example `fs.createWriteStream`), that proxy is -a promise (since communicating with the server is asynchronous). We have to -return the fill from `fs.createWriteStream` synchronously, so that means the -fill has to contain a proxy promise. To eliminate the need for calling `then` -and to keep the code looking clean every time you use the proxy, the proxy is -itself wrapped in another proxy which just calls the method after a `then`. This -works since all the methods return promises (aside from the event methods, but -those are not used by the fills directly—they are only used internally to -forward events to the fill if it is an event emitter). diff --git a/packages/protocol/package.json b/packages/protocol/package.json deleted file mode 100644 index 2f2a63b5e8d6..000000000000 --- a/packages/protocol/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@coder/protocol", - "main": "src/index.ts", - "dependencies": { - "express": "^4.16.4", - "google-protobuf": "^3.6.1", - "trash": "^4.3.0", - "ws": "^6.1.2" - }, - "devDependencies": { - "@types/google-protobuf": "^3.2.7", - "@types/rimraf": "^2.0.2", - "@types/text-encoding": "^0.0.35", - "rimraf": "^2.6.3", - "text-encoding": "^0.7.0", - "ts-protoc-gen": "^0.8.0" - } -} diff --git a/packages/protocol/scripts/generate_proto.sh b/packages/protocol/scripts/generate_proto.sh deleted file mode 100755 index fa014b0f6957..000000000000 --- a/packages/protocol/scripts/generate_proto.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -protoc --plugin="protoc-gen-ts=./node_modules/.bin/protoc-gen-ts" --js_out="import_style=commonjs,binary:./src/proto" --ts_out="./src/proto" ./src/proto/*.proto --proto_path="./src/proto" \ No newline at end of file diff --git a/packages/protocol/src/browser/client.ts b/packages/protocol/src/browser/client.ts deleted file mode 100644 index 77bba1b69f21..000000000000 --- a/packages/protocol/src/browser/client.ts +++ /dev/null @@ -1,542 +0,0 @@ -import { PathLike } from "fs"; -import { ExecException, ExecOptions } from "child_process"; -import { promisify } from "util"; -import { Emitter } from "@coder/events"; -import { logger, field } from "@coder/logger"; -import { ReadWriteConnection, InitData, SharedProcessData } from "../common/connection"; -import { ClientServerProxy, Module, ServerProxy } from "../common/proxy"; -import { argumentToProto, protoToArgument, moduleToProto, protoToModule, protoToOperatingSystem } from "../common/util"; -import { Argument, Ping, ServerMessage, ClientMessage, Method, Event, Callback } from "../proto"; -import { FsModule, ChildProcessModule, NetModule, NodePtyModule, SpdlogModule, TrashModule } from "./modules"; - -// tslint:disable no-any - -interface ProxyData { - promise: Promise; - instance: any; - callbacks: Map void>; -} - -/** - * Client accepts a connection to communicate with the server. - */ -export class Client { - private messageId = 0; - private callbackId = 0; - private readonly proxies = new Map(); - private readonly successEmitter = new Emitter(); - private readonly failEmitter = new Emitter(); - private readonly eventEmitter = new Emitter<{ event: string; args: any[]; }>(); - - private _initData: InitData | undefined; - private readonly initDataEmitter = new Emitter(); - private readonly initDataPromise: Promise; - - private readonly sharedProcessActiveEmitter = new Emitter(); - public readonly onSharedProcessActive = this.sharedProcessActiveEmitter.event; - - private disconnected: boolean = false; - - // The socket timeout is 60s, so we need to send a ping periodically to - // prevent it from closing. - private pingTimeout: NodeJS.Timer | number | undefined; - private readonly pingTimeoutDelay = 30000; - - private readonly responseTimeout = 10000; - - public readonly modules: { - [Module.ChildProcess]: ChildProcessModule, - [Module.Fs]: FsModule, - [Module.Net]: NetModule, - [Module.NodePty]: NodePtyModule, - [Module.Spdlog]: SpdlogModule, - [Module.Trash]: TrashModule, - }; - - /** - * @param connection Established connection to the server - */ - public constructor(private readonly connection: ReadWriteConnection) { - connection.onMessage(async (data) => { - let message: ServerMessage | undefined; - try { - message = ServerMessage.deserializeBinary(data); - await this.handleMessage(message); - } catch (error) { - logger.error( - "Failed to handle server message", - field("id", message && this.getMessageId(message)), - field("length", data.byteLength), - field("error", error.message), - ); - } - }); - - this.createProxy(Module.ChildProcess); - this.createProxy(Module.Fs); - this.createProxy(Module.Net); - this.createProxy(Module.NodePty); - this.createProxy(Module.Spdlog); - this.createProxy(Module.Trash); - - this.modules = { - [Module.ChildProcess]: new ChildProcessModule(this.getProxy(Module.ChildProcess).instance), - [Module.Fs]: new FsModule(this.getProxy(Module.Fs).instance), - [Module.Net]: new NetModule(this.getProxy(Module.Net).instance), - [Module.NodePty]: new NodePtyModule(this.getProxy(Module.NodePty).instance), - [Module.Spdlog]: new SpdlogModule(this.getProxy(Module.Spdlog).instance), - [Module.Trash]: new TrashModule(this.getProxy(Module.Trash).instance), - }; - - // Methods that don't follow the standard callback pattern (an error - // followed by a single result) need to provide a custom promisify function. - Object.defineProperty(this.modules[Module.Fs].exists, promisify.custom, { - value: (path: PathLike): Promise => { - return new Promise((resolve): void => this.modules[Module.Fs].exists(path, resolve)); - }, - }); - - Object.defineProperty(this.modules[Module.ChildProcess].exec, promisify.custom, { - value: ( - command: string, - options?: { encoding?: string | null } & ExecOptions | null, - ): Promise<{ stdout: string | Buffer, stderr: string | Buffer }> => { - return new Promise((resolve, reject): void => { - this.modules[Module.ChildProcess].exec(command, options, (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => { - if (error) { - reject(error); - } else { - resolve({ stdout, stderr }); - } - }); - }); - }, - }); - - /** - * If the connection is interrupted, the calls will neither succeed nor fail - * nor exit so we need to send a failure on all of them as well as trigger - * events so things like child processes can clean up and possibly restart. - */ - const handleDisconnect = (): void => { - this.disconnected = true; - logger.trace(() => [ - "disconnected from server", - field("proxies", this.proxies.size), - field("callbacks", Array.from(this.proxies.values()).reduce((count, p) => count + p.callbacks.size, 0)), - field("success listeners", this.successEmitter.counts), - field("fail listeners", this.failEmitter.counts), - field("event listeners", this.eventEmitter.counts), - ]); - - const message = new Method.Fail(); - const error = new Error("disconnected"); - message.setResponse(argumentToProto(error)); - this.failEmitter.emit(message); - - this.eventEmitter.emit({ event: "disconnected", args: [error] }); - this.eventEmitter.emit({ event: "done", args: [] }); - }; - - connection.onDown(() => handleDisconnect()); - connection.onClose(() => { - clearTimeout(this.pingTimeout as any); - this.pingTimeout = undefined; - handleDisconnect(); - this.proxies.clear(); - this.successEmitter.dispose(); - this.failEmitter.dispose(); - this.eventEmitter.dispose(); - this.initDataEmitter.dispose(); - this.sharedProcessActiveEmitter.dispose(); - }); - connection.onUp(() => this.disconnected = false); - - this.initDataPromise = new Promise((resolve): void => { - this.initDataEmitter.event(resolve); - }); - - this.startPinging(); - } - - /** - * Close the connection. - */ - public dispose(): void { - this.connection.close(); - } - - public get initData(): Promise { - return this.initDataPromise; - } - - /** - * Make a remote call for a proxy's method using proto. - */ - private remoteCall(proxyId: number | Module, method: string, args: any[]): Promise { - if (typeof proxyId === "number" && (this.disconnected || !this.proxies.has(proxyId))) { - // Can assume killing or closing works because a disconnected proxy is - // disposed on the server's side, and a non-existent proxy has already - // been disposed. - switch (method) { - case "close": - case "kill": - return Promise.resolve(); - } - - return Promise.reject( - new Error(`Unable to call "${method}" on proxy ${proxyId}: disconnected`), - ); - } - - const message = new Method(); - const id = this.messageId++; - let proxyMessage: Method.Named | Method.Numbered; - if (typeof proxyId === "string") { - proxyMessage = new Method.Named(); - proxyMessage.setModule(moduleToProto(proxyId)); - message.setNamedProxy(proxyMessage); - } else { - proxyMessage = new Method.Numbered(); - proxyMessage.setProxyId(proxyId); - message.setNumberedProxy(proxyMessage); - } - proxyMessage.setId(id); - proxyMessage.setMethod(method); - - const storeCallback = (cb: (...args: any[]) => void): number => { - const callbackId = this.callbackId++; - logger.trace(() => [ - "storing callback", - field("proxyId", proxyId), - field("callbackId", callbackId), - ]); - - this.getProxy(proxyId).callbacks.set(callbackId, cb); - - return callbackId; - }; - - logger.trace(() => [ - "sending", - field("id", id), - field("proxyId", proxyId), - field("method", method), - ]); - - proxyMessage.setArgsList(args.map((a) => argumentToProto( - a, - storeCallback, - (p) => p.proxyId, - ))); - - const clientMessage = new ClientMessage(); - clientMessage.setMethod(message); - this.connection.send(clientMessage.serializeBinary()); - - // The server will send back a fail or success message when the method - // has completed, so we listen for that based on the message's unique ID. - const promise = new Promise((resolve, reject): void => { - const dispose = (): void => { - d1.dispose(); - d2.dispose(); - clearTimeout(timeout as any); - }; - - const timeout = setTimeout(() => { - dispose(); - reject(new Error("timed out")); - }, this.responseTimeout); - - const d1 = this.successEmitter.event(id, (message) => { - dispose(); - resolve(this.protoToArgument(message.getResponse(), promise)); - }); - - const d2 = this.failEmitter.event(id, (message) => { - dispose(); - reject(protoToArgument(message.getResponse())); - }); - }); - - return promise; - } - - /** - * Handle all messages from the server. - */ - private async handleMessage(message: ServerMessage): Promise { - switch (message.getMsgCase()) { - case ServerMessage.MsgCase.INIT: - const init = message.getInit()!; - this._initData = { - dataDirectory: init.getDataDirectory(), - homeDirectory: init.getHomeDirectory(), - tmpDirectory: init.getTmpDirectory(), - workingDirectory: init.getWorkingDirectory(), - os: protoToOperatingSystem(init.getOperatingSystem()), - shell: init.getShell(), - extensionsDirectory: init.getExtensionsDirectory(), - builtInExtensionsDirectory: init.getBuiltinExtensionsDir(), - }; - this.initDataEmitter.emit(this._initData); - break; - case ServerMessage.MsgCase.SUCCESS: - this.emitSuccess(message.getSuccess()!); - break; - case ServerMessage.MsgCase.FAIL: - this.emitFail(message.getFail()!); - break; - case ServerMessage.MsgCase.EVENT: - await this.emitEvent(message.getEvent()!); - break; - case ServerMessage.MsgCase.CALLBACK: - await this.runCallback(message.getCallback()!); - break; - case ServerMessage.MsgCase.SHARED_PROCESS_ACTIVE: - const sharedProcessActiveMessage = message.getSharedProcessActive()!; - this.sharedProcessActiveEmitter.emit({ - socketPath: sharedProcessActiveMessage.getSocketPath(), - logPath: sharedProcessActiveMessage.getLogPath(), - }); - break; - case ServerMessage.MsgCase.PONG: - // Nothing to do since pings are on a timer rather than waiting for the - // next pong in case a message from either the client or server is dropped - // which would break the ping cycle. - break; - default: - throw new Error("unknown message type"); - } - } - - /** - * Convert message to a success event. - */ - private emitSuccess(message: Method.Success): void { - logger.trace(() => [ - "received resolve", - field("id", message.getId()), - ]); - - this.successEmitter.emit(message.getId(), message); - } - - /** - * Convert message to a fail event. - */ - private emitFail(message: Method.Fail): void { - logger.trace(() => [ - "received reject", - field("id", message.getId()), - ]); - - this.failEmitter.emit(message.getId(), message); - } - - /** - * Emit an event received from the server. We could send requests for "on" to - * the server and serialize functions using IDs, but doing it that way makes - * it possible to miss events depending on whether the server receives the - * request before it emits. Instead, emit all events from the server so all - * events are always caught on the client. - */ - private async emitEvent(message: Event): Promise { - const eventMessage = message.getNamedEvent()! || message.getNumberedEvent()!; - const proxyId = message.getNamedEvent() - ? protoToModule(message.getNamedEvent()!.getModule()) - : message.getNumberedEvent()!.getProxyId(); - const event = eventMessage.getEvent(); - await this.ensureResolved(proxyId); - logger.trace(() => [ - "received event", - field("proxyId", proxyId), - field("event", event), - ]); - - const args = eventMessage.getArgsList().map((a) => this.protoToArgument(a)); - this.eventEmitter.emit(proxyId, { event, args }); - } - - /** - * Run a callback as requested by the server. Since we don't know when - * callbacks get garbage collected we dispose them only when the proxy - * disposes. That means they should only be used if they run for the lifetime - * of the proxy (like child_process.exec), otherwise we'll leak. They should - * also only be used when passed together with the method. If they are sent - * afterward, they may never be called due to timing issues. - */ - private async runCallback(message: Callback): Promise { - const callbackMessage = message.getNamedCallback()! || message.getNumberedCallback()!; - const proxyId = message.getNamedCallback() - ? protoToModule(message.getNamedCallback()!.getModule()) - : message.getNumberedCallback()!.getProxyId(); - const callbackId = callbackMessage.getCallbackId(); - await this.ensureResolved(proxyId); - logger.trace(() => [ - "running callback", - field("proxyId", proxyId), - field("callbackId", callbackId), - ]); - const args = callbackMessage.getArgsList().map((a) => this.protoToArgument(a)); - this.getProxy(proxyId).callbacks.get(callbackId)!(...args); - } - - /** - * Start the ping loop. Does nothing if already pinging. - */ - private readonly startPinging = (): void => { - if (typeof this.pingTimeout !== "undefined") { - return; - } - - const schedulePing = (): void => { - this.pingTimeout = setTimeout(() => { - const clientMsg = new ClientMessage(); - clientMsg.setPing(new Ping()); - this.connection.send(clientMsg.serializeBinary()); - schedulePing(); - }, this.pingTimeoutDelay); - }; - - schedulePing(); - } - - /** - * Return the message's ID if it has one or a string identifier. For logging - * errors with an ID to make the error more useful. - */ - private getMessageId(message: ServerMessage): number | string | undefined { - if (message.hasInit()) { - return "init"; - } else if (message.hasSuccess()) { - return message.getSuccess()!.getId(); - } else if (message.hasFail()) { - return message.getFail()!.getId(); - } else if (message.hasEvent()) { - const eventMessage = message.getEvent()!.getNamedEvent()! - || message.getEvent()!.getNumberedEvent()!; - - return `event: ${eventMessage.getEvent()}`; - } else if (message.hasCallback()) { - const callbackMessage = message.getCallback()!.getNamedCallback()! - || message.getCallback()!.getNumberedCallback()!; - - return `callback: ${callbackMessage.getCallbackId()}`; - } else if (message.hasSharedProcessActive()) { - return "shared"; - } else if (message.hasPong()) { - return "pong"; - } - } - - /** - * Return a proxy that makes remote calls. - */ - private createProxy(proxyId: number | Module, promise: Promise = Promise.resolve()): T { - logger.trace(() => [ - "creating proxy", - field("proxyId", proxyId), - ]); - - const instance = new Proxy({ - proxyId, - onDone: (cb: (...args: any[]) => void): void => { - this.eventEmitter.event(proxyId, (event) => { - if (event.event === "done") { - cb(...event.args); - } - }); - }, - onEvent: (cb: (event: string, ...args: any[]) => void): void => { - this.eventEmitter.event(proxyId, (event) => { - cb(event.event, ...event.args); - }); - }, - } as ClientServerProxy, { - get: (target: any, name: string): any => { - // When resolving a promise with a proxy, it will check for "then". - if (name === "then") { - return; - } - - if (typeof target[name] === "undefined") { - target[name] = (...args: any[]): Promise | ServerProxy => { - return this.remoteCall(proxyId, name, args); - }; - } - - return target[name]; - }, - }); - - this.proxies.set(proxyId, { - promise, - instance, - callbacks: new Map(), - }); - - instance.onDone(() => { - const log = (): void => { - logger.trace(() => [ - typeof proxyId === "number" ? "disposed proxy" : "disposed proxy callbacks", - field("proxyId", proxyId), - field("disconnected", this.disconnected), - field("callbacks", Array.from(this.proxies.values()).reduce((count, proxy) => count + proxy.callbacks.size, 0)), - field("success listeners", this.successEmitter.counts), - field("fail listeners", this.failEmitter.counts), - field("event listeners", this.eventEmitter.counts), - ]); - }; - - // Uniquely identified items (top-level module proxies) can continue to - // be used so we don't need to delete them. - if (typeof proxyId === "number") { - const dispose = (): void => { - this.proxies.delete(proxyId); - this.eventEmitter.dispose(proxyId); - log(); - }; - if (!this.disconnected) { - instance.dispose().then(dispose).catch(dispose); - } else { - dispose(); - } - } else { - // The callbacks will still be unusable though. - this.getProxy(proxyId).callbacks.clear(); - log(); - } - }); - - return instance; - } - - /** - * We aren't guaranteed the promise will call all the `then` callbacks - * synchronously once it resolves, so the event message can come in and fire - * before a caller has been able to attach an event. Waiting for the promise - * ensures it runs after everything else. - */ - private async ensureResolved(proxyId: number | Module): Promise { - await this.getProxy(proxyId).promise; - } - - /** - * Same as protoToArgument except provides createProxy. - */ - private protoToArgument(value?: Argument, promise?: Promise): any { - return protoToArgument(value, undefined, (id) => this.createProxy(id, promise)); - } - - /** - * Get a proxy. Error if it doesn't exist. - */ - private getProxy(proxyId: number | Module): ProxyData { - if (!this.proxies.has(proxyId)) { - throw new Error(`proxy ${proxyId} disposed too early`); - } - - return this.proxies.get(proxyId)!; - } -} diff --git a/packages/protocol/src/browser/modules/child_process.ts b/packages/protocol/src/browser/modules/child_process.ts deleted file mode 100644 index 720b9656cf8f..000000000000 --- a/packages/protocol/src/browser/modules/child_process.ts +++ /dev/null @@ -1,151 +0,0 @@ -import * as cp from "child_process"; -import * as net from "net"; -import * as stream from "stream"; -import { callbackify } from "util"; -import { ClientProxy, ClientServerProxy } from "../../common/proxy"; -import { ChildProcessModuleProxy, ChildProcessProxy } from "../../node/modules/child_process"; -import { ClientWritableProxy, ClientReadableProxy, Readable, Writable } from "./stream"; - -// tslint:disable completed-docs - -export interface ClientChildProcessProxy extends ChildProcessProxy, ClientServerProxy {} - -export interface ClientChildProcessProxies { - childProcess: ClientChildProcessProxy; - stdin?: ClientWritableProxy | null; - stdout?: ClientReadableProxy | null; - stderr?: ClientReadableProxy | null; -} - -export class ChildProcess extends ClientProxy implements cp.ChildProcess { - public readonly stdin: stream.Writable; - public readonly stdout: stream.Readable; - public readonly stderr: stream.Readable; - public readonly stdio: [stream.Writable, stream.Readable, stream.Readable]; - - private _connected: boolean = false; - private _killed: boolean = false; - private _pid = -1; - - public constructor(proxyPromises: Promise) { - super(proxyPromises.then((p) => p.childProcess)); - this.stdin = new Writable(proxyPromises.then((p) => p.stdin!)); - this.stdout = new Readable(proxyPromises.then((p) => p.stdout!)); - this.stderr = new Readable(proxyPromises.then((p) => p.stderr!)); - this.stdio = [this.stdin, this.stdout, this.stderr]; - - this.catch(this.proxy.getPid().then((pid) => { - this._pid = pid; - this._connected = true; - })); - this.on("disconnect", () => this._connected = false); - this.on("exit", () => { - this._connected = false; - this._killed = true; - }); - } - - public get pid(): number { - return this._pid; - } - - public get connected(): boolean { - return this._connected; - } - - public get killed(): boolean { - return this._killed; - } - - public kill(): void { - this._killed = true; - this.catch(this.proxy.kill()); - } - - public disconnect(): void { - this.catch(this.proxy.disconnect()); - } - - public ref(): void { - this.catch(this.proxy.ref()); - } - - public unref(): void { - this.catch(this.proxy.unref()); - } - - public send( - message: any, // tslint:disable-line no-any - sendHandle?: net.Socket | net.Server | ((error: Error) => void), - options?: cp.MessageOptions | ((error: Error) => void), - callback?: (error: Error) => void): boolean { - if (typeof sendHandle === "function") { - callback = sendHandle; - sendHandle = undefined; - } else if (typeof options === "function") { - callback = options; - options = undefined; - } - if (sendHandle || options) { - throw new Error("sendHandle and options are not supported"); - } - - callbackify(this.proxy.send)(message, (error) => { - if (callback) { - callback(error); - } - }); - - return true; // Always true since we can't get this synchronously. - } - - /** - * Exit and close the process when disconnected. - */ - protected handleDisconnect(): void { - this.emit("exit", 1); - this.emit("close"); - } -} - -interface ClientChildProcessModuleProxy extends ChildProcessModuleProxy, ClientServerProxy { - exec(command: string, options?: { encoding?: string | null } & cp.ExecOptions | null, callback?: ((error: cp.ExecException | null, stdin: string | Buffer, stdout: string | Buffer) => void)): Promise; - fork(modulePath: string, args?: string[], options?: cp.ForkOptions): Promise; - spawn(command: string, args?: string[], options?: cp.SpawnOptions): Promise; -} - -export class ChildProcessModule { - public constructor(private readonly proxy: ClientChildProcessModuleProxy) {} - - public exec = ( - command: string, - options?: { encoding?: string | null } & cp.ExecOptions | null - | ((error: cp.ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void), - callback?: ((error: cp.ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void), - ): cp.ChildProcess => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - - return new ChildProcess(this.proxy.exec(command, options, callback)); - } - - public fork = (modulePath: string, args?: string[] | cp.ForkOptions, options?: cp.ForkOptions): cp.ChildProcess => { - if (!Array.isArray(args)) { - options = args; - args = undefined; - } - - return new ChildProcess(this.proxy.fork(modulePath, args, options)); - } - - public spawn = (command: string, args?: string[] | cp.SpawnOptions, options?: cp.SpawnOptions): cp.ChildProcess => { - if (!Array.isArray(args)) { - options = args; - args = undefined; - } - - return new ChildProcess(this.proxy.spawn(command, args, options)); - } -} diff --git a/packages/protocol/src/browser/modules/fs.ts b/packages/protocol/src/browser/modules/fs.ts deleted file mode 100644 index b8f95461716f..000000000000 --- a/packages/protocol/src/browser/modules/fs.ts +++ /dev/null @@ -1,380 +0,0 @@ -import * as fs from "fs"; -import { callbackify } from "util"; -import { Batch, ClientProxy, ClientServerProxy } from "../../common/proxy"; -import { IEncodingOptions, IEncodingOptionsCallback } from "../../common/util"; -import { FsModuleProxy, ReadStreamProxy, Stats as IStats, WatcherProxy, WriteStreamProxy } from "../../node/modules/fs"; -import { Readable, Writable } from "./stream"; - -// tslint:disable completed-docs no-any - -class StatBatch extends Batch { - public constructor(private readonly proxy: FsModuleProxy) { - super(); - } - - protected remoteCall(batch: { path: fs.PathLike }[]): Promise<(IStats | Error)[]> { - return this.proxy.statBatch(batch); - } -} - -class LstatBatch extends Batch { - public constructor(private readonly proxy: FsModuleProxy) { - super(); - } - - protected remoteCall(batch: { path: fs.PathLike }[]): Promise<(IStats | Error)[]> { - return this.proxy.lstatBatch(batch); - } -} - -class ReaddirBatch extends Batch { - public constructor(private readonly proxy: FsModuleProxy) { - super(); - } - - protected remoteCall(queue: { path: fs.PathLike, options: IEncodingOptions }[]): Promise<(Buffer[] | fs.Dirent[] | string[] | Error)[]> { - return this.proxy.readdirBatch(queue); - } -} - -interface ClientWatcherProxy extends WatcherProxy, ClientServerProxy {} - -class Watcher extends ClientProxy implements fs.FSWatcher { - public close(): void { - this.catch(this.proxy.close()); - } - - protected handleDisconnect(): void { - this.emit("close"); - } -} - -interface ClientReadStreamProxy extends ReadStreamProxy, ClientServerProxy {} - -class ReadStream extends Readable implements fs.ReadStream { - public get bytesRead(): number { - throw new Error("not implemented"); - } - - public get path(): string | Buffer { - throw new Error("not implemented"); - } - - public close(): void { - this.catch(this.proxy.close()); - } -} - -interface ClientWriteStreamProxy extends WriteStreamProxy, ClientServerProxy {} - -class WriteStream extends Writable implements fs.WriteStream { - public get bytesWritten(): number { - throw new Error("not implemented"); - } - - public get path(): string | Buffer { - throw new Error("not implemented"); - } - - public close(): void { - this.catch(this.proxy.close()); - } -} - -interface ClientFsModuleProxy extends FsModuleProxy, ClientServerProxy { - createReadStream(path: fs.PathLike, options?: any): Promise; - createWriteStream(path: fs.PathLike, options?: any): Promise; - watch(filename: fs.PathLike, options?: IEncodingOptions): Promise; -} - -export class FsModule { - private readonly statBatch: StatBatch; - private readonly lstatBatch: LstatBatch; - private readonly readdirBatch: ReaddirBatch; - - public constructor(private readonly proxy: ClientFsModuleProxy) { - this.statBatch = new StatBatch(this.proxy); - this.lstatBatch = new LstatBatch(this.proxy); - this.readdirBatch = new ReaddirBatch(this.proxy); - } - - public access = (path: fs.PathLike, mode: number | undefined | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof mode === "function") { - callback = mode; - mode = undefined; - } - callbackify(this.proxy.access)(path, mode, callback!); - } - - public appendFile = (path: fs.PathLike | number, data: any, options?: fs.WriteFileOptions | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.proxy.appendFile)(path, data, options, callback!); - } - - public chmod = (path: fs.PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.chmod)(path, mode, callback!); - } - - public chown = (path: fs.PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.chown)(path, uid, gid, callback!); - } - - public close = (fd: number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.close)(fd, callback!); - } - - public copyFile = (src: fs.PathLike, dest: fs.PathLike, flags: number | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof flags === "function") { - callback = flags; - } - callbackify(this.proxy.copyFile)( - src, dest, typeof flags !== "function" ? flags : undefined, callback!, - ); - } - - public createReadStream = (path: fs.PathLike, options?: any): fs.ReadStream => { - return new ReadStream(this.proxy.createReadStream(path, options)); - } - - public createWriteStream = (path: fs.PathLike, options?: any): fs.WriteStream => { - return new WriteStream(this.proxy.createWriteStream(path, options)); - } - - public exists = (path: fs.PathLike, callback: (exists: boolean) => void): void => { - this.proxy.exists(path).then((exists) => callback(exists)).catch(() => callback(false)); - } - - public fchmod = (fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.fchmod)(fd, mode, callback!); - } - - public fchown = (fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.fchown)(fd, uid, gid, callback!); - } - - public fdatasync = (fd: number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.fdatasync)(fd, callback!); - } - - public fstat = (fd: number, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void => { - callbackify(this.proxy.fstat)(fd, (error, stats) => { - callback(error, stats && new Stats(stats)); - }); - } - - public fsync = (fd: number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.fsync)(fd, callback!); - } - - public ftruncate = (fd: number, len: number | undefined | null | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof len === "function") { - callback = len; - len = undefined; - } - callbackify(this.proxy.ftruncate)(fd, len, callback!); - } - - public futimes = (fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.futimes)(fd, atime, mtime, callback!); - } - - public lchmod = (path: fs.PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.lchmod)(path, mode, callback!); - } - - public lchown = (path: fs.PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.lchown)(path, uid, gid, callback!); - } - - public link = (existingPath: fs.PathLike, newPath: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.link)(existingPath, newPath, callback!); - } - - public lstat = (path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void => { - callbackify(this.lstatBatch.add)({ path }, (error, stats) => { - callback(error, stats && new Stats(stats)); - }); - } - - public mkdir = (path: fs.PathLike, mode: number | string | fs.MakeDirectoryOptions | undefined | null | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof mode === "function") { - callback = mode; - mode = undefined; - } - callbackify(this.proxy.mkdir)(path, mode, callback!); - } - - public mkdtemp = (prefix: string, options: IEncodingOptionsCallback, callback?: (err: NodeJS.ErrnoException, folder: string | Buffer) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.proxy.mkdtemp)(prefix, options, callback!); - } - - public open = (path: fs.PathLike, flags: string | number, mode: string | number | undefined | null | ((err: NodeJS.ErrnoException, fd: number) => void), callback?: (err: NodeJS.ErrnoException, fd: number) => void): void => { - if (typeof mode === "function") { - callback = mode; - mode = undefined; - } - callbackify(this.proxy.open)(path, flags, mode, callback!); - } - - public read = (fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void => { - this.proxy.read(fd, length, position).then((response) => { - buffer.set(response.buffer, offset); - callback(undefined!, response.bytesRead, response.buffer); - }).catch((error) => { - callback(error, undefined!, undefined!); - }); - } - - public readFile = (path: fs.PathLike | number, options: IEncodingOptionsCallback, callback?: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.proxy.readFile)(path, options, callback!); - } - - public readdir = (path: fs.PathLike, options: IEncodingOptionsCallback, callback?: (err: NodeJS.ErrnoException, files: Buffer[] | fs.Dirent[] | string[]) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.readdirBatch.add)({ path, options }, callback!); - } - - public readlink = (path: fs.PathLike, options: IEncodingOptionsCallback, callback?: (err: NodeJS.ErrnoException, linkString: string | Buffer) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.proxy.readlink)(path, options, callback!); - } - - public realpath = (path: fs.PathLike, options: IEncodingOptionsCallback, callback?: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.proxy.realpath)(path, options, callback!); - } - - public rename = (oldPath: fs.PathLike, newPath: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.rename)(oldPath, newPath, callback!); - } - - public rmdir = (path: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.rmdir)(path, callback!); - } - - public stat = (path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void => { - callbackify(this.statBatch.add)({ path }, (error, stats) => { - callback(error, stats && new Stats(stats)); - }); - } - - public symlink = (target: fs.PathLike, path: fs.PathLike, type: fs.symlink.Type | undefined | null | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof type === "function") { - callback = type; - type = undefined; - } - callbackify(this.proxy.symlink)(target, path, type, callback!); - } - - public truncate = (path: fs.PathLike, len: number | undefined | null | ((err: NodeJS.ErrnoException) => void), callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof len === "function") { - callback = len; - len = undefined; - } - callbackify(this.proxy.truncate)(path, len, callback!); - } - - public unlink = (path: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.unlink)(path, callback!); - } - - public utimes = (path: fs.PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void => { - callbackify(this.proxy.utimes)(path, atime, mtime, callback!); - } - - public write = (fd: number, buffer: Buffer, offset: number | undefined | ((err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void), length: number | undefined | ((err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void), position: number | undefined | ((err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void), callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void => { - if (typeof offset === "function") { - callback = offset; - offset = undefined; - } - if (typeof length === "function") { - callback = length; - length = undefined; - } - if (typeof position === "function") { - callback = position; - position = undefined; - } - this.proxy.write(fd, buffer, offset, length, position).then((r) => { - callback!(undefined!, r.bytesWritten, r.buffer); - }).catch((error) => { - callback!(error, undefined!, undefined!); - }); - } - - public writeFile = (path: fs.PathLike | number, data: any, options: IEncodingOptionsCallback, callback?: (err: NodeJS.ErrnoException) => void): void => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - callbackify(this.proxy.writeFile)(path, data, options, callback!); - } - - public watch = (filename: fs.PathLike, options?: IEncodingOptions | ((event: string, filename: string | Buffer) => void), listener?: ((event: string, filename: string | Buffer) => void)): fs.FSWatcher => { - if (typeof options === "function") { - listener = options; - options = undefined; - } - - const watcher = new Watcher(this.proxy.watch(filename, options)); - if (listener) { - watcher.on("change", listener); - } - - return watcher; - } -} - -class Stats implements fs.Stats { - public constructor(private readonly stats: IStats) {} - - public get dev(): number { return this.stats.dev; } - public get ino(): number { return this.stats.ino; } - public get mode(): number { return this.stats.mode; } - public get nlink(): number { return this.stats.nlink; } - public get uid(): number { return this.stats.uid; } - public get gid(): number { return this.stats.gid; } - public get rdev(): number { return this.stats.rdev; } - public get size(): number { return this.stats.size; } - public get blksize(): number { return this.stats.blksize; } - public get blocks(): number { return this.stats.blocks; } - public get atime(): Date { return this.stats.atime; } - public get mtime(): Date { return this.stats.mtime; } - public get ctime(): Date { return this.stats.ctime; } - public get birthtime(): Date { return this.stats.birthtime; } - public get atimeMs(): number { return this.stats.atimeMs; } - public get mtimeMs(): number { return this.stats.mtimeMs; } - public get ctimeMs(): number { return this.stats.ctimeMs; } - public get birthtimeMs(): number { return this.stats.birthtimeMs; } - public isFile(): boolean { return this.stats._isFile; } - public isDirectory(): boolean { return this.stats._isDirectory; } - public isBlockDevice(): boolean { return this.stats._isBlockDevice; } - public isCharacterDevice(): boolean { return this.stats._isCharacterDevice; } - public isSymbolicLink(): boolean { return this.stats._isSymbolicLink; } - public isFIFO(): boolean { return this.stats._isFIFO; } - public isSocket(): boolean { return this.stats._isSocket; } - - public toObject(): object { - return JSON.parse(JSON.stringify(this)); - } -} diff --git a/packages/protocol/src/browser/modules/index.ts b/packages/protocol/src/browser/modules/index.ts deleted file mode 100644 index 590d037dcee2..000000000000 --- a/packages/protocol/src/browser/modules/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./child_process"; -export * from "./fs"; -export * from "./net"; -export * from "./node-pty"; -export * from "./spdlog"; -export * from "./trash"; diff --git a/packages/protocol/src/browser/modules/net.ts b/packages/protocol/src/browser/modules/net.ts deleted file mode 100644 index 732711b6095b..000000000000 --- a/packages/protocol/src/browser/modules/net.ts +++ /dev/null @@ -1,296 +0,0 @@ -import * as net from "net"; -import { callbackify } from "util"; -import { ClientProxy, ClientServerProxy } from "../../common/proxy"; -import { NetModuleProxy, NetServerProxy, NetSocketProxy } from "../../node/modules/net"; -import { Duplex } from "./stream"; - -// tslint:disable completed-docs - -interface ClientNetSocketProxy extends NetSocketProxy, ClientServerProxy {} - -export class Socket extends Duplex implements net.Socket { - private _connecting: boolean = false; - private _destroyed: boolean = false; - - public constructor(proxyPromise: Promise | ClientNetSocketProxy, connecting?: boolean) { - super(proxyPromise); - if (connecting) { - this._connecting = connecting; - } - this.on("close", () => { - this._destroyed = true; - this._connecting = false; - }); - this.on("connect", () => this._connecting = false); - } - - public connect(options: number | string | net.SocketConnectOpts, host?: string | Function, callback?: Function): this { - if (typeof host === "function") { - callback = host; - host = undefined; - } - this._connecting = true; - if (callback) { - this.on("connect", callback as () => void); - } - - return this.catch(this.proxy.connect(options, host)); - } - - // tslint:disable-next-line no-any - public end(data?: any, encoding?: string | Function, callback?: Function): void { - if (typeof encoding === "function") { - callback = encoding; - encoding = undefined; - } - - callbackify(this.proxy.end)(data, encoding, () => { - if (callback) { - callback(); - } - }); - } - - // tslint:disable-next-line no-any - public write(data: any, encoding?: string | Function, fd?: string | Function): boolean { - let callback: undefined | Function; - if (typeof encoding === "function") { - callback = encoding; - encoding = undefined; - } - if (typeof fd === "function") { - callback = fd; - fd = undefined; - } - if (typeof fd !== "undefined") { - throw new Error("fd argument not supported"); - } - - callbackify(this.proxy.write)(data, encoding, () => { - if (callback) { - callback(); - } - }); - - return true; // Always true since we can't get this synchronously. - } - - public get connecting(): boolean { - return this._connecting; - } - - public get destroyed(): boolean { - return this._destroyed; - } - - public get bufferSize(): number { - throw new Error("not implemented"); - } - - public get bytesRead(): number { - throw new Error("not implemented"); - } - - public get bytesWritten(): number { - throw new Error("not implemented"); - } - - public get localAddress(): string { - throw new Error("not implemented"); - } - - public get localPort(): number { - throw new Error("not implemented"); - } - - public address(): net.AddressInfo | string { - throw new Error("not implemented"); - } - - public setTimeout(): this { - throw new Error("not implemented"); - } - - public setNoDelay(): this { - throw new Error("not implemented"); - } - - public setKeepAlive(): this { - throw new Error("not implemented"); - } - - public unref(): void { - this.catch(this.proxy.unref()); - } - - public ref(): void { - this.catch(this.proxy.ref()); - } -} - -interface ClientNetServerProxy extends NetServerProxy, ClientServerProxy { - onConnection(cb: (proxy: ClientNetSocketProxy) => void): Promise; -} - -export class Server extends ClientProxy implements net.Server { - private socketId = 0; - private readonly sockets = new Map(); - private _listening: boolean = false; - - public constructor(proxyPromise: Promise | ClientNetServerProxy) { - super(proxyPromise); - - this.catch(this.proxy.onConnection((socketProxy) => { - const socket = new Socket(socketProxy); - const socketId = this.socketId++; - this.sockets.set(socketId, socket); - socket.on("error", () => this.sockets.delete(socketId)); - socket.on("close", () => this.sockets.delete(socketId)); - this.emit("connection", socket); - })); - - this.on("listening", () => this._listening = true); - this.on("error", () => this._listening = false); - this.on("close", () => this._listening = false); - } - - public listen(handle?: net.ListenOptions | number | string, hostname?: string | number | Function, backlog?: number | Function, callback?: Function): this { - if (typeof hostname === "function") { - callback = hostname; - hostname = undefined; - } - if (typeof backlog === "function") { - callback = backlog; - backlog = undefined; - } - if (callback) { - this.on("listening", callback as () => void); - } - - return this.catch(this.proxy.listen(handle, hostname, backlog)); - } - - public get connections(): number { - return this.sockets.size; - } - - public get listening(): boolean { - return this._listening; - } - - public get maxConnections(): number { - throw new Error("not implemented"); - } - - public address(): net.AddressInfo | string { - throw new Error("not implemented"); - } - - public close(callback?: () => void): this { - this._listening = false; - if (callback) { - this.on("close", callback); - } - - return this.catch(this.proxy.close()); - } - - public ref(): this { - return this.catch(this.proxy.ref()); - } - - public unref(): this { - return this.catch(this.proxy.unref()); - } - - public getConnections(cb: (error: Error | null, count: number) => void): void { - cb(null, this.sockets.size); - } - - protected handleDisconnect(): void { - this.emit("close"); - } -} - -type NodeNet = typeof net; - -interface ClientNetModuleProxy extends NetModuleProxy, ClientServerProxy { - createSocket(options?: net.SocketConstructorOpts): Promise; - createConnection(target: string | number | net.NetConnectOpts, host?: string): Promise; - createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }): Promise; -} - -export class NetModule implements NodeNet { - public readonly Socket: typeof net.Socket; - public readonly Server: typeof net.Server; - - public constructor(private readonly proxy: ClientNetModuleProxy) { - // @ts-ignore this is because Socket is missing things from the Stream - // namespace but I'm unsure how best to provide them (finished, - // finished.__promisify__, pipeline, and some others) or if it even matters. - this.Socket = class extends Socket { - public constructor(options?: net.SocketConstructorOpts) { - super(proxy.createSocket(options)); - } - }; - - this.Server = class extends Server { - public constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean } | ((socket: Socket) => void), listener?: (socket: Socket) => void) { - super(proxy.createServer(typeof options !== "function" ? options : undefined)); - if (typeof options === "function") { - listener = options; - } - if (listener) { - this.on("connection", listener); - } - } - }; - } - - public createConnection = (target: string | number | net.NetConnectOpts, host?: string | Function, callback?: Function): net.Socket => { - if (typeof host === "function") { - callback = host; - host = undefined; - } - - const socket = new Socket(this.proxy.createConnection(target, host), true); - if (callback) { - socket.on("connect", callback as () => void); - } - - return socket; - } - - public createServer = ( - options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean } | ((socket: net.Socket) => void), - callback?: (socket: net.Socket) => void, - ): net.Server => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - - const server = new Server(this.proxy.createServer(options)); - if (callback) { - server.on("connection", callback); - } - - return server; - } - - public connect = (): net.Socket => { - throw new Error("not implemented"); - } - - public isIP = (_input: string): number => { - throw new Error("not implemented"); - } - - public isIPv4 = (_input: string): boolean => { - throw new Error("not implemented"); - } - - public isIPv6 = (_input: string): boolean => { - throw new Error("not implemented"); - } -} diff --git a/packages/protocol/src/browser/modules/node-pty.ts b/packages/protocol/src/browser/modules/node-pty.ts deleted file mode 100644 index 2f173705a4b9..000000000000 --- a/packages/protocol/src/browser/modules/node-pty.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as pty from "node-pty"; -import { ClientProxy, ClientServerProxy } from "../../common/proxy"; -import { NodePtyModuleProxy, NodePtyProcessProxy } from "../../node/modules/node-pty"; - -// tslint:disable completed-docs - -interface ClientNodePtyProcessProxy extends NodePtyProcessProxy, ClientServerProxy {} - -export class NodePtyProcess extends ClientProxy implements pty.IPty { - private _pid = -1; - private _process = ""; - private lastCols: number | undefined; - private lastRows: number | undefined; - - public constructor( - private readonly moduleProxy: ClientNodePtyModuleProxy, - private readonly file: string, - private readonly args: string[] | string, - private readonly options: pty.IPtyForkOptions, - ) { - super(moduleProxy.spawn(file, args, options)); - this.on("process", (process) => this._process = process); - } - - protected initialize(proxyPromise: Promise): ClientNodePtyProcessProxy { - const proxy = super.initialize(proxyPromise); - this.catch(this.proxy.getPid().then((p) => this._pid = p)); - this.catch(this.proxy.getProcess().then((p) => this._process = p)); - - return proxy; - } - - public get pid(): number { - return this._pid; - } - - public get process(): string { - return this._process; - } - - public resize(columns: number, rows: number): void { - this.lastCols = columns; - this.lastRows = rows; - - this.catch(this.proxy.resize(columns, rows)); - } - - public write(data: string): void { - this.catch(this.proxy.write(data)); - } - - public kill(signal?: string): void { - this.catch(this.proxy.kill(signal)); - } - - protected handleDisconnect(): void { - this._process += " (disconnected)"; - this.emit("data", "\r\n\nLost connection...\r\n\n"); - this.initialize(this.moduleProxy.spawn(this.file, this.args, { - ...this.options, - cols: this.lastCols || this.options.cols, - rows: this.lastRows || this.options.rows, - })); - } -} - -type NodePty = typeof pty; - -interface ClientNodePtyModuleProxy extends NodePtyModuleProxy, ClientServerProxy { - spawn(file: string, args: string[] | string, options: pty.IPtyForkOptions): Promise; -} - -export class NodePtyModule implements NodePty { - public constructor(private readonly proxy: ClientNodePtyModuleProxy) {} - - public spawn = (file: string, args: string[] | string, options: pty.IPtyForkOptions): pty.IPty => { - return new NodePtyProcess(this.proxy, file, args, options); - } -} diff --git a/packages/protocol/src/browser/modules/spdlog.ts b/packages/protocol/src/browser/modules/spdlog.ts deleted file mode 100644 index 058630e2d7c1..000000000000 --- a/packages/protocol/src/browser/modules/spdlog.ts +++ /dev/null @@ -1,62 +0,0 @@ -import * as spdlog from "spdlog"; -import { ClientProxy, ClientServerProxy } from "../../common/proxy"; -import { RotatingLoggerProxy, SpdlogModuleProxy } from "../../node/modules/spdlog"; - -// tslint:disable completed-docs - -interface ClientRotatingLoggerProxy extends RotatingLoggerProxy, ClientServerProxy {} - -class RotatingLogger extends ClientProxy implements spdlog.RotatingLogger { - public constructor( - private readonly moduleProxy: ClientSpdlogModuleProxy, - private readonly name: string, - private readonly filename: string, - private readonly filesize: number, - private readonly filecount: number, - ) { - super(moduleProxy.createLogger(name, filename, filesize, filecount)); - } - - public trace (message: string): void { this.catch(this.proxy.trace(message)); } - public debug (message: string): void { this.catch(this.proxy.debug(message)); } - public info (message: string): void { this.catch(this.proxy.info(message)); } - public warn (message: string): void { this.catch(this.proxy.warn(message)); } - public error (message: string): void { this.catch(this.proxy.error(message)); } - public critical (message: string): void { this.catch(this.proxy.critical(message)); } - public setLevel (level: number): void { this.catch(this.proxy.setLevel(level)); } - public clearFormatters (): void { this.catch(this.proxy.clearFormatters()); } - public flush (): void { this.catch(this.proxy.flush()); } - public drop (): void { this.catch(this.proxy.drop()); } - - protected handleDisconnect(): void { - this.initialize(this.moduleProxy.createLogger(this.name, this.filename, this.filesize, this.filecount)); - } -} - -interface ClientSpdlogModuleProxy extends SpdlogModuleProxy, ClientServerProxy { - createLogger(name: string, filePath: string, fileSize: number, fileCount: number): Promise; -} - -export class SpdlogModule { - public readonly RotatingLogger: typeof spdlog.RotatingLogger; - - public constructor(private readonly proxy: ClientSpdlogModuleProxy) { - this.RotatingLogger = class extends RotatingLogger { - public constructor(name: string, filename: string, filesize: number, filecount: number) { - super(proxy, name, filename, filesize, filecount); - } - }; - } - - public setAsyncMode = (bufferSize: number, flushInterval: number): Promise => { - return this.proxy.setAsyncMode(bufferSize, flushInterval); - } - - public createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): RotatingLogger { - return new RotatingLogger(this.proxy, name, filename, filesize, filecount); - } - - public createRotatingLoggerAsync(name: string, filename: string, filesize: number, filecount: number): Promise { - return Promise.resolve(this.createRotatingLogger(name, filename, filesize, filecount)); - } -} diff --git a/packages/protocol/src/browser/modules/stream.ts b/packages/protocol/src/browser/modules/stream.ts deleted file mode 100644 index 856e27896a85..000000000000 --- a/packages/protocol/src/browser/modules/stream.ts +++ /dev/null @@ -1,257 +0,0 @@ -import * as stream from "stream"; -import { callbackify } from "util"; -import { ClientProxy, ClientServerProxy } from "../../common/proxy"; -import { isPromise } from "../../common/util"; -import { DuplexProxy, ReadableProxy, WritableProxy } from "../../node/modules/stream"; - -// tslint:disable completed-docs no-any - -export interface ClientWritableProxy extends WritableProxy, ClientServerProxy {} - -export class Writable extends ClientProxy implements stream.Writable { - public get writable(): boolean { - throw new Error("not implemented"); - } - - public get writableHighWaterMark(): number { - throw new Error("not implemented"); - } - - public get writableLength(): number { - throw new Error("not implemented"); - } - - public _write(): void { - throw new Error("not implemented"); - } - - public _destroy(): void { - throw new Error("not implemented"); - } - - public _final(): void { - throw new Error("not implemented"); - } - - public pipe(): T { - throw new Error("not implemented"); - } - - public cork(): void { - throw new Error("not implemented"); - } - - public uncork(): void { - throw new Error("not implemented"); - } - - public destroy(): void { - this.catch(this.proxy.destroy()); - } - - public setDefaultEncoding(encoding: string): this { - return this.catch(this.proxy.setDefaultEncoding(encoding)); - } - - public write(chunk: any, encoding?: string | ((error?: Error | null) => void), callback?: (error?: Error | null) => void): boolean { - if (typeof encoding === "function") { - callback = encoding; - encoding = undefined; - } - callbackify(this.proxy.write)(chunk, encoding, (error) => { - if (callback) { - callback(error); - } - }); - - return true; // Always true since we can't get this synchronously. - } - - public end(data?: any | (() => void), encoding?: string | (() => void), callback?: (() => void)): void { - if (typeof data === "function") { - callback = data; - data = undefined; - } - if (typeof encoding === "function") { - callback = encoding; - encoding = undefined; - } - callbackify(this.proxy.end)(data, encoding, () => { - if (callback) { - callback(); - } - }); - } - - protected handleDisconnect(): void { - this.emit("close"); - this.emit("finish"); - } -} - -export interface ClientReadableProxy extends ReadableProxy, ClientServerProxy {} - -export class Readable extends ClientProxy implements stream.Readable { - public get readable(): boolean { - throw new Error("not implemented"); - } - - public get readableHighWaterMark(): number { - throw new Error("not implemented"); - } - - public get readableLength(): number { - throw new Error("not implemented"); - } - - public _read(): void { - throw new Error("not implemented"); - } - - public read(): void { - throw new Error("not implemented"); - } - - public _destroy(): void { - throw new Error("not implemented"); - } - - public unpipe(): this { - throw new Error("not implemented"); - } - - public pause(): this { - throw new Error("not implemented"); - } - - public resume(): this { - throw new Error("not implemented"); - } - - public isPaused(): boolean { - throw new Error("not implemented"); - } - - public wrap(): this { - throw new Error("not implemented"); - } - - public push(): boolean { - throw new Error("not implemented"); - } - - public unshift(): void { - throw new Error("not implemented"); - } - - public pipe

(destination: P, options?: { end?: boolean }): P { - const writableProxy = (destination as any as Writable).proxyPromise; - if (!writableProxy) { - throw new Error("can only pipe stream proxies"); - } - this.catch( - isPromise(writableProxy) - ? writableProxy.then((p) => this.proxy.pipe(p, options)) - : this.proxy.pipe(writableProxy, options), - ); - - return destination; - } - - public [Symbol.asyncIterator](): AsyncIterableIterator { - throw new Error("not implemented"); - } - - public destroy(): void { - this.catch(this.proxy.destroy()); - } - - public setEncoding(encoding: string): this { - return this.catch(this.proxy.setEncoding(encoding)); - } - - protected handleDisconnect(): void { - this.emit("close"); - this.emit("end"); - } -} - -export interface ClientDuplexProxy extends DuplexProxy, ClientServerProxy {} - -export class Duplex extends Writable implements stream.Duplex, stream.Readable { - private readonly _readable: Readable; - - public constructor(proxyPromise: Promise | T) { - super(proxyPromise); - this._readable = new Readable(proxyPromise, false); - } - - public get readable(): boolean { - return this._readable.readable; - } - - public get readableHighWaterMark(): number { - return this._readable.readableHighWaterMark; - } - - public get readableLength(): number { - return this._readable.readableLength; - } - - public _read(): void { - this._readable._read(); - } - - public read(): void { - this._readable.read(); - } - - public unpipe(): this { - this._readable.unpipe(); - - return this; - } - - public pause(): this { - this._readable.unpipe(); - - return this; - } - - public resume(): this { - this._readable.resume(); - - return this; - } - - public isPaused(): boolean { - return this._readable.isPaused(); - } - - public wrap(): this { - this._readable.wrap(); - - return this; - } - - public push(): boolean { - return this._readable.push(); - } - - public unshift(): void { - this._readable.unshift(); - } - - public [Symbol.asyncIterator](): AsyncIterableIterator { - return this._readable[Symbol.asyncIterator](); - } - - public setEncoding(encoding: string): this { - return this.catch(this.proxy.setEncoding(encoding)); - } - - protected handleDisconnect(): void { - super.handleDisconnect(); - this.emit("end"); - } -} diff --git a/packages/protocol/src/browser/modules/trash.ts b/packages/protocol/src/browser/modules/trash.ts deleted file mode 100644 index 3a11f4d54b81..000000000000 --- a/packages/protocol/src/browser/modules/trash.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as trash from "trash"; -import { ClientServerProxy } from "../../common/proxy"; -import { TrashModuleProxy } from "../../node/modules/trash"; - -// tslint:disable completed-docs - -interface ClientTrashModuleProxy extends TrashModuleProxy, ClientServerProxy {} - -export class TrashModule { - public constructor(private readonly proxy: ClientTrashModuleProxy) {} - - public trash = (path: string, options?: trash.Options): Promise => { - return this.proxy.trash(path, options); - } -} diff --git a/packages/protocol/src/common/connection.ts b/packages/protocol/src/common/connection.ts deleted file mode 100644 index f4f60deddce7..000000000000 --- a/packages/protocol/src/common/connection.ts +++ /dev/null @@ -1,33 +0,0 @@ -export interface SendableConnection { - send(data: Buffer | Uint8Array): void; -} - -export interface ReadWriteConnection extends SendableConnection { - onMessage(cb: (data: Uint8Array | Buffer) => void): void; - onClose(cb: () => void): void; - onDown(cb: () => void): void; - onUp(cb: () => void): void; - close(): void; -} - -export enum OperatingSystem { - Windows, - Linux, - Mac, -} - -export interface InitData { - readonly os: OperatingSystem; - readonly dataDirectory: string; - readonly workingDirectory: string; - readonly homeDirectory: string; - readonly tmpDirectory: string; - readonly shell: string; - readonly extensionsDirectory: string; - readonly builtInExtensionsDirectory: string; -} - -export interface SharedProcessData { - readonly socketPath: string; - readonly logPath: string; -} diff --git a/packages/protocol/src/common/proxy.ts b/packages/protocol/src/common/proxy.ts deleted file mode 100644 index 6ee895dae7ca..000000000000 --- a/packages/protocol/src/common/proxy.ts +++ /dev/null @@ -1,325 +0,0 @@ -import { EventEmitter } from "events"; -import { isPromise, EventCallback } from "./util"; - -// tslint:disable no-any - -/** - * Allow using a proxy like it's returned synchronously. This only works because - * all proxy methods must return promises. - */ -const unpromisify = (proxyPromise: Promise): T => { - return new Proxy({}, { - get: (target: any, name: string): any => { - if (typeof target[name] === "undefined") { - target[name] = async (...args: any[]): Promise => { - const proxy = await proxyPromise; - - return proxy ? (proxy as any)[name](...args) : undefined; - }; - } - - return target[name]; - }, - }); -}; - -/** - * Client-side emitter that just forwards server proxy events to its own - * emitter. It also turns a promisified server proxy into a non-promisified - * proxy so we don't need a bunch of `then` calls everywhere. - */ -export abstract class ClientProxy extends EventEmitter { - private _proxy: T; - - /** - * You can specify not to bind events in order to avoid emitting twice for - * duplex streams. - */ - public constructor( - private _proxyPromise: Promise | T, - private readonly bindEvents: boolean = true, - ) { - super(); - this._proxy = this.initialize(this._proxyPromise); - if (this.bindEvents) { - this.on("disconnected", (error) => { - try { - this.emit("error", error); - } catch (error) { - // If nothing is listening, EventEmitter will throw an error. - } - this.handleDisconnect(); - }); - } - } - - /** - * Remove an event listener. - */ - public off(event: string, cb: (...args: any[]) => void): this { - // Fill it here because the fill we're using to provide EventEmitter for the - // browser doesn't appear to include `off`. - this.removeListener(event, cb); - - return this; - } - - /** - * Bind the event locally and ensure the event is bound on the server. - */ - public addListener(event: string, listener: (...args: any[]) => void): this { - this.catch(this.proxy.bindDelayedEvent(event)); - - return super.on(event, listener); - } - - /** - * Alias for `addListener`. - */ - public on(event: string, listener: (...args: any[]) => void): this { - return this.addListener(event, listener); - } - - /** - * Original promise for the server proxy. Can be used to be passed as an - * argument. - */ - public get proxyPromise(): Promise | T { - return this._proxyPromise; - } - - /** - * Server proxy. - */ - protected get proxy(): T { - return this._proxy; - } - - /** - * Initialize the proxy by unpromisifying if necessary and binding to its - * events. - */ - protected initialize(proxyPromise: Promise | T): T { - this._proxyPromise = proxyPromise; - this._proxy = isPromise(this._proxyPromise) - ? unpromisify(this._proxyPromise) - : this._proxyPromise; - if (this.bindEvents) { - this.proxy.onEvent((event, ...args): void => { - this.emit(event, ...args); - }); - } - - return this._proxy; - } - - /** - * Perform necessary cleanup on disconnect (or reconnect). - */ - protected abstract handleDisconnect(): void; - - /** - * Emit an error event if the promise errors. - */ - protected catch(promise?: Promise): this { - if (promise) { - promise.catch((e) => this.emit("error", e)); - } - - return this; - } -} - -export interface ServerProxyOptions { - /** - * The events to bind immediately. - */ - bindEvents: string[]; - /** - * Events that signal the proxy is done. - */ - doneEvents: string[]; - /** - * Events that should only be bound when asked - */ - delayedEvents?: string[]; - /** - * Whatever is emitting events (stream, child process, etc). - */ - instance: T; -} - -/** - * The actual proxy instance on the server. Every method must only accept - * serializable arguments and must return promises with serializable values. - * - * If a proxy itself has proxies on creation (like how ChildProcess has stdin), - * then it should return all of those at once, otherwise you will miss events - * from those child proxies and fail to dispose them properly. - * - * Events listeners are added client-side (since all events automatically - * forward to the client), so onDone and onEvent do not need to be asynchronous. - */ -export abstract class ServerProxy { - public readonly instance: T; - - private readonly callbacks = []; - - public constructor(private readonly options: ServerProxyOptions) { - this.instance = options.instance; - } - - /** - * Dispose the proxy. - */ - public async dispose(): Promise { - this.instance.removeAllListeners(); - } - - /** - * This is used instead of an event to force it to be implemented since there - * would be no guarantee the implementation would remember to emit the event. - */ - public onDone(cb: () => void): void { - this.options.doneEvents.forEach((event) => { - this.instance.on(event, cb); - }); - } - - /** - * Bind an event that will not fire without first binding it and shouldn't be - * bound immediately. - - * For example, binding to `data` switches a stream to flowing mode, so we - * don't want to do it until we're asked. Otherwise something like `pipe` - * won't work because potentially some or all of the data will already have - * been flushed out. - */ - public async bindDelayedEvent(event: string): Promise { - if (this.options.delayedEvents - && this.options.delayedEvents.includes(event) - && !this.options.bindEvents.includes(event)) { - this.options.bindEvents.push(event); - this.callbacks.forEach((cb) => { - this.instance.on(event, (...args: any[]) => cb(event, ...args)); - }); - } - } - - /** - * Listen to all possible events. On the client, this is to reduce boilerplate - * that would just be a bunch of error-prone forwarding of each individual - * event from the proxy to its own emitter. - * - * It also fixes a timing issue because we just always send all events from - * the server, so we never miss any due to listening too late. - * - * This cannot be async because then we can bind to the events too late. - */ - public onEvent(cb: EventCallback): void { - this.callbacks.push(cb); - this.options.bindEvents.forEach((event) => { - this.instance.on(event, (...args: any[]) => cb(event, ...args)); - }); - } -} - -/** - * A server-side proxy stored on the client. The proxy ID only exists on the - * client-side version of the server proxy. The event listeners are handled by - * the client and the remaining methods are proxied to the server. - */ -export interface ClientServerProxy extends ServerProxy { - proxyId: number | Module; -} - -/** - * Supported top-level module proxies. - */ -export enum Module { - Fs = "fs", - ChildProcess = "child_process", - Net = "net", - Spdlog = "spdlog", - NodePty = "node-pty", - Trash = "trash", -} - -interface BatchItem { - args: A; - resolve: (t: T) => void; - reject: (e: Error) => void; -} - -/** - * Batch remote calls. - */ -export abstract class Batch { - private idleTimeout: number | NodeJS.Timer | undefined; - private maxTimeout: number | NodeJS.Timer | undefined; - private batch = []>[]; - - public constructor( - /** - * Flush after reaching this amount of time. - */ - private readonly maxTime: number = 1000, - /** - * Flush after reaching this count. - */ - private readonly maxCount: number = 100, - /** - * Flush after not receiving more requests for this amount of time. - * This is pretty low by default so essentially we just end up batching - * requests that are all made at the same time. - */ - private readonly idleTime: number = 1, - ) {} - - public add = (args: A): Promise => { - return new Promise((resolve, reject): void => { - this.batch.push({ - args, - resolve, - reject, - }); - if (this.batch.length >= this.maxCount) { - this.flush(); - } else { - clearTimeout(this.idleTimeout as any); - this.idleTimeout = setTimeout(this.flush, this.idleTime); - if (typeof this.maxTimeout === "undefined") { - this.maxTimeout = setTimeout(this.flush, this.maxTime); - } - } - }); - } - - /** - * Perform remote call for a batch. - */ - protected abstract remoteCall(batch: A[]): Promise<(T | Error)[]>; - - /** - * Flush out the current batch. - */ - private readonly flush = (): void => { - clearTimeout(this.idleTimeout as any); - clearTimeout(this.maxTimeout as any); - this.maxTimeout = undefined; - - const batch = this.batch; - this.batch = []; - - this.remoteCall(batch.map((q) => q.args)).then((results) => { - batch.forEach((item, i) => { - const result = results[i]; - if (result && result instanceof Error) { - item.reject(result); - } else { - item.resolve(result); - } - }); - }).catch((error) => batch.forEach((item) => item.reject(error))); - } -} diff --git a/packages/protocol/src/common/util.ts b/packages/protocol/src/common/util.ts deleted file mode 100644 index b21941c349cb..000000000000 --- a/packages/protocol/src/common/util.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { Argument, Module as ProtoModule, WorkingInit } from "../proto"; -import { OperatingSystem } from "../common/connection"; -import { ClientServerProxy, Module, ServerProxy } from "./proxy"; - -// tslint:disable no-any - -/** - * Return true if we're in a browser environment (including web workers). - */ -export const isBrowserEnvironment = (): boolean => { - return typeof process === "undefined" || typeof process.stdout === "undefined"; -}; - -/** - * Escape a path. This prevents any issues with file names that have quotes, - * spaces, braces, etc. - */ -export const escapePath = (path: string): string => { - return `'${path.replace(/'/g, "'\\''")}'`; -}; - -export type EventCallback = (event: string, ...args: any[]) => void; - -export type IEncodingOptions = { - encoding?: BufferEncoding | null; - flag?: string; - mode?: string; - persistent?: boolean; - recursive?: boolean; -} | BufferEncoding | undefined | null; - -export type IEncodingOptionsCallback = IEncodingOptions | ((err: NodeJS.ErrnoException, ...args: any[]) => void); - -/** - * Convert an argument to proto. - * If sending a function is possible, provide `storeFunction`. - * If sending a proxy is possible, provide `storeProxy`. - */ -export const argumentToProto =

( - value: any, - storeFunction?: (fn: () => void) => number, - storeProxy?: (proxy: P) => number | Module, -): Argument => { - const convert = (currentValue: any): Argument => { - const message = new Argument(); - - if (isProxy

(currentValue)) { - if (!storeProxy) { - throw new Error("no way to serialize proxy"); - } - const arg = new Argument.ProxyValue(); - const id = storeProxy(currentValue); - if (typeof id === "string") { - throw new Error("unable to serialize module proxy"); - } - arg.setId(id); - message.setProxy(arg); - } else if (currentValue instanceof Error - || (currentValue && typeof currentValue.message !== "undefined" - && typeof currentValue.stack !== "undefined")) { - const arg = new Argument.ErrorValue(); - arg.setMessage(currentValue.message); - arg.setStack(currentValue.stack); - arg.setCode(currentValue.code); - message.setError(arg); - } else if (currentValue instanceof Uint8Array || currentValue instanceof Buffer) { - const arg = new Argument.BufferValue(); - arg.setData(currentValue); - message.setBuffer(arg); - } else if (Array.isArray(currentValue)) { - const arg = new Argument.ArrayValue(); - arg.setDataList(currentValue.map(convert)); - message.setArray(arg); - } else if (currentValue instanceof Date - || (currentValue && typeof currentValue.getTime === "function")) { - const arg = new Argument.DateValue(); - arg.setDate(currentValue.toString()); - message.setDate(arg); - } else if (currentValue !== null && typeof currentValue === "object") { - const arg = new Argument.ObjectValue(); - const map = arg.getDataMap(); - Object.keys(currentValue).forEach((key) => { - map.set(key, convert(currentValue[key])); - }); - message.setObject(arg); - } else if (currentValue === null) { - message.setNull(new Argument.NullValue()); - } else { - switch (typeof currentValue) { - case "undefined": - message.setUndefined(new Argument.UndefinedValue()); - break; - case "function": - if (!storeFunction) { - throw new Error("no way to serialize function"); - } - const arg = new Argument.FunctionValue(); - arg.setId(storeFunction(currentValue)); - message.setFunction(arg); - break; - case "number": - message.setNumber(currentValue); - break; - case "string": - message.setString(currentValue); - break; - case "boolean": - message.setBoolean(currentValue); - break; - default: - throw new Error(`cannot convert ${typeof currentValue} to proto`); - } - } - - return message; - }; - - return convert(value); -}; - -/** - * Convert proto to an argument. - * If running a remote callback is supported, provide `runCallback`. - * If using a remote proxy is supported, provide `createProxy`. - */ -export const protoToArgument = ( - message?: Argument, - runCallback?: (id: number, args: any[]) => void, - createProxy?: (id: number) => ServerProxy, -): any => { - const convert = (currentMessage: Argument): any => { - switch (currentMessage.getMsgCase()) { - case Argument.MsgCase.ERROR: - const errorMessage = currentMessage.getError()!; - const error = new Error(errorMessage.getMessage()); - (error as NodeJS.ErrnoException).code = errorMessage.getCode(); - (error as any).originalStack = errorMessage.getStack(); - - return error; - case Argument.MsgCase.BUFFER: - return Buffer.from(currentMessage.getBuffer()!.getData() as Uint8Array); - case Argument.MsgCase.ARRAY: - return currentMessage.getArray()!.getDataList().map((a) => convert(a)); - case Argument.MsgCase.PROXY: - if (!createProxy) { - throw new Error("no way to create proxy"); - } - - return createProxy(currentMessage.getProxy()!.getId()); - case Argument.MsgCase.DATE: - return new Date(currentMessage.getDate()!.getDate()); - case Argument.MsgCase.OBJECT: - const obj: { [Key: string]: any } = {}; - currentMessage.getObject()!.getDataMap().forEach((argument, key) => { - obj[key] = convert(argument); - }); - - return obj; - case Argument.MsgCase.UNDEFINED: - return undefined; - case Argument.MsgCase.NULL: - return null; - case Argument.MsgCase.FUNCTION: - if (!runCallback) { - throw new Error("no way to run remote callback"); - } - - return (...args: any[]): void => { - return runCallback(currentMessage.getFunction()!.getId(), args); - }; - case Argument.MsgCase.NUMBER: - return currentMessage.getNumber(); - case Argument.MsgCase.STRING: - return currentMessage.getString(); - case Argument.MsgCase.BOOLEAN: - return currentMessage.getBoolean(); - default: - throw new Error("cannot convert unexpected proto to argument"); - } - }; - - return message && convert(message); -}; - -export const protoToModule = (protoModule: ProtoModule): Module => { - switch (protoModule) { - case ProtoModule.CHILDPROCESS: return Module.ChildProcess; - case ProtoModule.FS: return Module.Fs; - case ProtoModule.NET: return Module.Net; - case ProtoModule.NODEPTY: return Module.NodePty; - case ProtoModule.SPDLOG: return Module.Spdlog; - case ProtoModule.TRASH: return Module.Trash; - default: throw new Error(`invalid module ${protoModule}`); - } -}; - -export const moduleToProto = (moduleName: Module): ProtoModule => { - switch (moduleName) { - case Module.ChildProcess: return ProtoModule.CHILDPROCESS; - case Module.Fs: return ProtoModule.FS; - case Module.Net: return ProtoModule.NET; - case Module.NodePty: return ProtoModule.NODEPTY; - case Module.Spdlog: return ProtoModule.SPDLOG; - case Module.Trash: return ProtoModule.TRASH; - default: throw new Error(`invalid module "${moduleName}"`); - } -}; - -export const protoToOperatingSystem = (protoOp: WorkingInit.OperatingSystem): OperatingSystem => { - switch (protoOp) { - case WorkingInit.OperatingSystem.WINDOWS: return OperatingSystem.Windows; - case WorkingInit.OperatingSystem.LINUX: return OperatingSystem.Linux; - case WorkingInit.OperatingSystem.MAC: return OperatingSystem.Mac; - default: throw new Error(`unsupported operating system ${protoOp}`); - } -}; - -export const platformToProto = (platform: NodeJS.Platform): WorkingInit.OperatingSystem => { - switch (platform) { - case "win32": return WorkingInit.OperatingSystem.WINDOWS; - case "linux": return WorkingInit.OperatingSystem.LINUX; - case "darwin": return WorkingInit.OperatingSystem.MAC; - default: throw new Error(`unrecognized platform "${platform}"`); - } -}; - -export const isProxy =

(value: any): value is P => { - return value && typeof value === "object" && typeof value.onEvent === "function"; -}; - -export const isPromise = (value: any): value is Promise => { - return typeof value.then === "function" && typeof value.catch === "function"; -}; - -/** - * When spawning VS Code tries to preserve the environment but since it's in - * the browser, it doesn't work. - */ -export const withEnv = (options?: T): T | undefined => { - return options && options.env ? { - ...options, - env: { - ...process.env, ...options.env, - }, - } : options; -}; diff --git a/packages/protocol/src/index.ts b/packages/protocol/src/index.ts deleted file mode 100644 index b118df39fe5f..000000000000 --- a/packages/protocol/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./browser/client"; -export * from "./common/connection"; -export * from "./common/proxy"; -export * from "./common/util"; diff --git a/packages/protocol/src/node/modules/child_process.ts b/packages/protocol/src/node/modules/child_process.ts deleted file mode 100644 index 5df9a527493d..000000000000 --- a/packages/protocol/src/node/modules/child_process.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as cp from "child_process"; -import { ServerProxy } from "../../common/proxy"; -import { withEnv } from "../../common/util"; -import { WritableProxy, ReadableProxy } from "./stream"; - -// tslint:disable completed-docs - -export type ForkProvider = (modulePath: string, args?: string[], options?: cp.ForkOptions) => cp.ChildProcess; - -export class ChildProcessProxy extends ServerProxy { - public constructor(instance: cp.ChildProcess) { - super({ - bindEvents: ["close", "disconnect", "error", "exit", "message"], - doneEvents: ["close"], - instance, - }); - } - - public async kill(signal?: string): Promise { - this.instance.kill(signal); - } - - public async disconnect(): Promise { - this.instance.disconnect(); - } - - public async ref(): Promise { - this.instance.ref(); - } - - public async unref(): Promise { - this.instance.unref(); - } - - // tslint:disable-next-line no-any - public async send(message: any): Promise { - return new Promise((resolve, reject): void => { - this.instance.send(message, (error) => { - if (error) { - reject(error); - } else { - resolve(); - } - }); - }); - } - - public async getPid(): Promise { - return this.instance.pid; - } - - public async dispose(): Promise { - this.instance.kill(); - setTimeout(() => this.instance.kill("SIGKILL"), 5000); // Double tap. - await super.dispose(); - } -} - -export interface ChildProcessProxies { - childProcess: ChildProcessProxy; - stdin?: WritableProxy | null; - stdout?: ReadableProxy | null; - stderr?: ReadableProxy | null; -} - -export class ChildProcessModuleProxy { - public constructor(private readonly forkProvider?: ForkProvider) {} - - public async exec( - command: string, - options?: { encoding?: string | null } & cp.ExecOptions | null, - callback?: ((error: cp.ExecException | null, stdin: string | Buffer, stdout: string | Buffer) => void), - ): Promise { - return this.returnProxies(cp.exec(command, options && withEnv(options), callback)); - } - - public async fork(modulePath: string, args?: string[], options?: cp.ForkOptions): Promise { - return this.returnProxies((this.forkProvider || cp.fork)(modulePath, args, withEnv(options))); - } - - public async spawn(command: string, args?: string[], options?: cp.SpawnOptions): Promise { - return this.returnProxies(cp.spawn(command, args, withEnv(options))); - } - - private returnProxies(process: cp.ChildProcess): ChildProcessProxies { - return { - childProcess: new ChildProcessProxy(process), - stdin: process.stdin && new WritableProxy(process.stdin), - // Child processes streams appear to immediately flow so we need to bind - // to the data event right away. - stdout: process.stdout && new ReadableProxy(process.stdout, ["data"]), - stderr: process.stderr && new ReadableProxy(process.stderr, ["data"]), - }; - } -} diff --git a/packages/protocol/src/node/modules/fs.ts b/packages/protocol/src/node/modules/fs.ts deleted file mode 100644 index f93452be847d..000000000000 --- a/packages/protocol/src/node/modules/fs.ts +++ /dev/null @@ -1,272 +0,0 @@ -import * as fs from "fs"; -import { promisify } from "util"; -import { ServerProxy } from "../../common/proxy"; -import { IEncodingOptions } from "../../common/util"; -import { ReadableProxy, WritableProxy } from "./stream"; - -// tslint:disable completed-docs no-any - -/** - * A serializable version of fs.Stats. - */ -export interface Stats { - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atimeMs: number; - mtimeMs: number; - ctimeMs: number; - birthtimeMs: number; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - _isFile: boolean; - _isDirectory: boolean; - _isBlockDevice: boolean; - _isCharacterDevice: boolean; - _isSymbolicLink: boolean; - _isFIFO: boolean; - _isSocket: boolean; -} - -export class ReadStreamProxy extends ReadableProxy { - public constructor(stream: fs.ReadStream) { - super(stream, ["open"]); - } - - public async close(): Promise { - this.instance.close(); - } - - public async dispose(): Promise { - this.instance.close(); - await super.dispose(); - } -} - -export class WriteStreamProxy extends WritableProxy { - public constructor(stream: fs.WriteStream) { - super(stream, ["open"]); - } - - public async close(): Promise { - this.instance.close(); - } - - public async dispose(): Promise { - this.instance.close(); - await super.dispose(); - } -} - -export class WatcherProxy extends ServerProxy { - public constructor(watcher: fs.FSWatcher) { - super({ - bindEvents: ["change", "close", "error"], - doneEvents: ["close", "error"], - instance: watcher, - }); - } - - public async close(): Promise { - this.instance.close(); - } - - public async dispose(): Promise { - this.instance.close(); - await super.dispose(); - } -} - -export class FsModuleProxy { - public access(path: fs.PathLike, mode?: number): Promise { - return promisify(fs.access)(path, mode); - } - - public appendFile(file: fs.PathLike | number, data: any, options?: fs.WriteFileOptions): Promise { - return promisify(fs.appendFile)(file, data, options); - } - - public chmod(path: fs.PathLike, mode: string | number): Promise { - return promisify(fs.chmod)(path, mode); - } - - public chown(path: fs.PathLike, uid: number, gid: number): Promise { - return promisify(fs.chown)(path, uid, gid); - } - - public close(fd: number): Promise { - return promisify(fs.close)(fd); - } - - public copyFile(src: fs.PathLike, dest: fs.PathLike, flags?: number): Promise { - return promisify(fs.copyFile)(src, dest, flags); - } - - public async createReadStream(path: fs.PathLike, options?: any): Promise { - return new ReadStreamProxy(fs.createReadStream(path, options)); - } - - public async createWriteStream(path: fs.PathLike, options?: any): Promise { - return new WriteStreamProxy(fs.createWriteStream(path, options)); - } - - public exists(path: fs.PathLike): Promise { - return promisify(fs.exists)(path); // tslint:disable-line deprecation - } - - public fchmod(fd: number, mode: string | number): Promise { - return promisify(fs.fchmod)(fd, mode); - } - - public fchown(fd: number, uid: number, gid: number): Promise { - return promisify(fs.fchown)(fd, uid, gid); - } - - public fdatasync(fd: number): Promise { - return promisify(fs.fdatasync)(fd); - } - - public async fstat(fd: number): Promise { - return this.makeStatsSerializable(await promisify(fs.fstat)(fd)); - } - - public fsync(fd: number): Promise { - return promisify(fs.fsync)(fd); - } - - public ftruncate(fd: number, len?: number | null): Promise { - return promisify(fs.ftruncate)(fd, len); - } - - public futimes(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise { - return promisify(fs.futimes)(fd, atime, mtime); - } - - public lchmod(path: fs.PathLike, mode: string | number): Promise { - return promisify(fs.lchmod)(path, mode); - } - - public lchown(path: fs.PathLike, uid: number, gid: number): Promise { - return promisify(fs.lchown)(path, uid, gid); - } - - public link(existingPath: fs.PathLike, newPath: fs.PathLike): Promise { - return promisify(fs.link)(existingPath, newPath); - } - - public async lstat(path: fs.PathLike): Promise { - return this.makeStatsSerializable(await promisify(fs.lstat)(path)); - } - - public async lstatBatch(args: { path: fs.PathLike }[]): Promise<(Stats | Error)[]> { - return Promise.all(args.map((a) => this.lstat(a.path).catch((e) => e))); - } - - public mkdir(path: fs.PathLike, mode: number | string | fs.MakeDirectoryOptions | undefined | null): Promise { - return promisify(fs.mkdir)(path, mode); - } - - public mkdtemp(prefix: string, options: IEncodingOptions): Promise { - return promisify(fs.mkdtemp)(prefix, options); - } - - public open(path: fs.PathLike, flags: string | number, mode: string | number | undefined | null): Promise { - return promisify(fs.open)(path, flags, mode); - } - - public read(fd: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: Buffer }> { - const buffer = Buffer.alloc(length); - - return promisify(fs.read)(fd, buffer, 0, length, position); - } - - public readFile(path: fs.PathLike | number, options: IEncodingOptions): Promise { - return promisify(fs.readFile)(path, options); - } - - public readdir(path: fs.PathLike, options: IEncodingOptions): Promise { - return promisify(fs.readdir)(path, options); - } - - public readdirBatch(args: { path: fs.PathLike, options: IEncodingOptions }[]): Promise<(Buffer[] | fs.Dirent[] | string[] | Error)[]> { - return Promise.all(args.map((a) => this.readdir(a.path, a.options).catch((e) => e))); - } - - public readlink(path: fs.PathLike, options: IEncodingOptions): Promise { - return promisify(fs.readlink)(path, options); - } - - public realpath(path: fs.PathLike, options: IEncodingOptions): Promise { - return promisify(fs.realpath)(path, options); - } - - public rename(oldPath: fs.PathLike, newPath: fs.PathLike): Promise { - return promisify(fs.rename)(oldPath, newPath); - } - - public rmdir(path: fs.PathLike): Promise { - return promisify(fs.rmdir)(path); - } - - public async stat(path: fs.PathLike): Promise { - return this.makeStatsSerializable(await promisify(fs.stat)(path)); - } - - public async statBatch(args: { path: fs.PathLike }[]): Promise<(Stats | Error)[]> { - return Promise.all(args.map((a) => this.stat(a.path).catch((e) => e))); - } - - public symlink(target: fs.PathLike, path: fs.PathLike, type?: fs.symlink.Type | null): Promise { - return promisify(fs.symlink)(target, path, type); - } - - public truncate(path: fs.PathLike, len?: number | null): Promise { - return promisify(fs.truncate)(path, len); - } - - public unlink(path: fs.PathLike): Promise { - return promisify(fs.unlink)(path); - } - - public utimes(path: fs.PathLike, atime: string | number | Date, mtime: string | number | Date): Promise { - return promisify(fs.utimes)(path, atime, mtime); - } - - public async write(fd: number, buffer: Buffer, offset?: number, length?: number, position?: number): Promise<{ bytesWritten: number, buffer: Buffer }> { - return promisify(fs.write)(fd, buffer, offset, length, position); - } - - public writeFile (path: fs.PathLike | number, data: any, options: IEncodingOptions): Promise { - return promisify(fs.writeFile)(path, data, options); - } - - public async watch(filename: fs.PathLike, options?: IEncodingOptions): Promise { - return new WatcherProxy(fs.watch(filename, options)); - } - - private makeStatsSerializable(stats: fs.Stats): Stats { - return { - ...stats, - /** - * We need to check if functions exist because nexe's implemented FS - * lib doesnt implement fs.stats properly. - */ - _isBlockDevice: stats.isBlockDevice ? stats.isBlockDevice() : false, - _isCharacterDevice: stats.isCharacterDevice ? stats.isCharacterDevice() : false, - _isDirectory: stats.isDirectory(), - _isFIFO: stats.isFIFO ? stats.isFIFO() : false, - _isFile: stats.isFile(), - _isSocket: stats.isSocket ? stats.isSocket() : false, - _isSymbolicLink: stats.isSymbolicLink ? stats.isSymbolicLink() : false, - }; - } -} diff --git a/packages/protocol/src/node/modules/index.ts b/packages/protocol/src/node/modules/index.ts deleted file mode 100644 index 590d037dcee2..000000000000 --- a/packages/protocol/src/node/modules/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./child_process"; -export * from "./fs"; -export * from "./net"; -export * from "./node-pty"; -export * from "./spdlog"; -export * from "./trash"; diff --git a/packages/protocol/src/node/modules/net.ts b/packages/protocol/src/node/modules/net.ts deleted file mode 100644 index 28ffa52edb55..000000000000 --- a/packages/protocol/src/node/modules/net.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as net from "net"; -import { ServerProxy } from "../../common/proxy"; -import { DuplexProxy } from "./stream"; - -// tslint:disable completed-docs no-any - -export class NetSocketProxy extends DuplexProxy { - public constructor(socket: net.Socket) { - super(socket, ["connect", "lookup", "timeout"]); - } - - public async connect(options: number | string | net.SocketConnectOpts, host?: string): Promise { - this.instance.connect(options as any, host as any); - } - - public async unref(): Promise { - this.instance.unref(); - } - - public async ref(): Promise { - this.instance.ref(); - } - - public async dispose(): Promise { - this.instance.end(); - this.instance.destroy(); - this.instance.unref(); - await super.dispose(); - } -} - -export class NetServerProxy extends ServerProxy { - public constructor(instance: net.Server) { - super({ - bindEvents: ["close", "error", "listening"], - doneEvents: ["close"], - instance, - }); - } - - public async listen(handle?: net.ListenOptions | number | string, hostname?: string | number, backlog?: number): Promise { - this.instance.listen(handle, hostname as any, backlog as any); - } - - public async ref(): Promise { - this.instance.ref(); - } - - public async unref(): Promise { - this.instance.unref(); - } - - public async close(): Promise { - this.instance.close(); - } - - public async onConnection(cb: (proxy: NetSocketProxy) => void): Promise { - this.instance.on("connection", (socket) => cb(new NetSocketProxy(socket))); - } - - public async dispose(): Promise { - this.instance.close(); - this.instance.removeAllListeners(); - } -} - -export class NetModuleProxy { - public async createSocket(options?: net.SocketConstructorOpts): Promise { - return new NetSocketProxy(new net.Socket(options)); - } - - public async createConnection(target: string | number | net.NetConnectOpts, host?: string): Promise { - return new NetSocketProxy(net.createConnection(target as any, host)); - } - - public async createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }): Promise { - return new NetServerProxy(net.createServer(options)); - } -} diff --git a/packages/protocol/src/node/modules/node-pty.ts b/packages/protocol/src/node/modules/node-pty.ts deleted file mode 100644 index c6786d416682..000000000000 --- a/packages/protocol/src/node/modules/node-pty.ts +++ /dev/null @@ -1,71 +0,0 @@ -/// -import { EventEmitter } from "events"; -import * as pty from "node-pty"; -import { ServerProxy } from "../../common/proxy"; -import { withEnv } from "../../common/util"; - -// tslint:disable completed-docs - -/** - * Server-side IPty proxy. - */ -export class NodePtyProcessProxy extends ServerProxy { - public constructor(private readonly process: pty.IPty) { - super({ - bindEvents: ["process", "data", "exit"], - doneEvents: ["exit"], - instance: new EventEmitter(), - }); - - this.process.on("data", (data) => this.instance.emit("data", data)); - this.process.on("exit", (exitCode, signal) => this.instance.emit("exit", exitCode, signal)); - - let name = process.process; - setTimeout(() => { // Need to wait for the caller to listen to the event. - this.instance.emit("process", name); - }, 1); - const timer = setInterval(() => { - if (process.process !== name) { - name = process.process; - this.instance.emit("process", name); - } - }, 200); - - this.process.on("exit", () => clearInterval(timer)); - } - - public async getPid(): Promise { - return this.process.pid; - } - - public async getProcess(): Promise { - return this.process.process; - } - - public async kill(signal?: string): Promise { - this.process.kill(signal); - } - - public async resize(columns: number, rows: number): Promise { - this.process.resize(columns, rows); - } - - public async write(data: string): Promise { - this.process.write(data); - } - - public async dispose(): Promise { - this.process.kill(); - setTimeout(() => this.process.kill("SIGKILL"), 5000); // Double tap. - await super.dispose(); - } -} - -/** - * Server-side node-pty proxy. - */ -export class NodePtyModuleProxy { - public async spawn(file: string, args: string[] | string, options: pty.IPtyForkOptions): Promise { - return new NodePtyProcessProxy(require("node-pty").spawn(file, args, withEnv(options))); - } -} diff --git a/packages/protocol/src/node/modules/spdlog.ts b/packages/protocol/src/node/modules/spdlog.ts deleted file mode 100644 index 9023f0ae67b9..000000000000 --- a/packages/protocol/src/node/modules/spdlog.ts +++ /dev/null @@ -1,43 +0,0 @@ -/// -import { EventEmitter } from "events"; -import * as spdlog from "spdlog"; -import { ServerProxy } from "../../common/proxy"; - -// tslint:disable completed-docs - -export class RotatingLoggerProxy extends ServerProxy { - public constructor(private readonly logger: spdlog.RotatingLogger) { - super({ - bindEvents: [], - doneEvents: ["dispose"], - instance: new EventEmitter(), - }); - } - - public async trace (message: string): Promise { this.logger.trace(message); } - public async debug (message: string): Promise { this.logger.debug(message); } - public async info (message: string): Promise { this.logger.info(message); } - public async warn (message: string): Promise { this.logger.warn(message); } - public async error (message: string): Promise { this.logger.error(message); } - public async critical (message: string): Promise { this.logger.critical(message); } - public async setLevel (level: number): Promise { this.logger.setLevel(level); } - public async clearFormatters (): Promise { this.logger.clearFormatters(); } - public async flush (): Promise { this.logger.flush(); } - public async drop (): Promise { this.logger.drop(); } - - public async dispose(): Promise { - await this.flush(); - this.instance.emit("dispose"); - await super.dispose(); - } -} - -export class SpdlogModuleProxy { - public async createLogger(name: string, filePath: string, fileSize: number, fileCount: number): Promise { - return new RotatingLoggerProxy(new (require("spdlog") as typeof import("spdlog")).RotatingLogger(name, filePath, fileSize, fileCount)); - } - - public async setAsyncMode(bufferSize: number, flushInterval: number): Promise { - require("spdlog").setAsyncMode(bufferSize, flushInterval); - } -} diff --git a/packages/protocol/src/node/modules/stream.ts b/packages/protocol/src/node/modules/stream.ts deleted file mode 100644 index e64ec38dfbbb..000000000000 --- a/packages/protocol/src/node/modules/stream.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { EventEmitter } from "events"; -import * as stream from "stream"; -import { ServerProxy } from "../../common/proxy"; - -// tslint:disable completed-docs no-any - -export class WritableProxy extends ServerProxy { - public constructor(instance: T, bindEvents: string[] = [], delayedEvents?: string[]) { - super({ - bindEvents: ["close", "drain", "error", "finish"].concat(bindEvents), - doneEvents: ["close"], - delayedEvents, - instance, - }); - } - - public async destroy(): Promise { - this.instance.destroy(); - } - - public async end(data?: any, encoding?: string): Promise { - return new Promise((resolve): void => { - this.instance.end(data, encoding, () => { - resolve(); - }); - }); - } - - public async setDefaultEncoding(encoding: string): Promise { - this.instance.setDefaultEncoding(encoding); - } - - public async write(data: any, encoding?: string): Promise { - return new Promise((resolve, reject): void => { - this.instance.write(data, encoding, (error) => { - if (error) { - reject(error); - } else { - resolve(); - } - }); - }); - } - - public async dispose(): Promise { - this.instance.end(); - await super.dispose(); - } -} - -/** - * This noise is because we can't do multiple extends and we also can't seem to - * do `extends WritableProxy implement ReadableProxy` (for `DuplexProxy`). - */ -export interface IReadableProxy extends ServerProxy { - pipe

(destination: P, options?: { end?: boolean; }): Promise; - setEncoding(encoding: string): Promise; -} - -export class ReadableProxy extends ServerProxy implements IReadableProxy { - public constructor(instance: T, bindEvents: string[] = []) { - super({ - bindEvents: ["close", "end", "error"].concat(bindEvents), - doneEvents: ["close"], - delayedEvents: ["data"], - instance, - }); - } - - public async pipe

(destination: P, options?: { end?: boolean; }): Promise { - this.instance.pipe(destination.instance, options); - // `pipe` switches the stream to flowing mode and makes data start emitting. - await this.bindDelayedEvent("data"); - } - - public async destroy(): Promise { - this.instance.destroy(); - } - - public async setEncoding(encoding: string): Promise { - this.instance.setEncoding(encoding); - } - - public async dispose(): Promise { - this.instance.destroy(); - await super.dispose(); - } -} - -export class DuplexProxy extends WritableProxy implements IReadableProxy { - public constructor(stream: T, bindEvents: string[] = []) { - super(stream, ["end"].concat(bindEvents), ["data"]); - } - - public async pipe

(destination: P, options?: { end?: boolean; }): Promise { - this.instance.pipe(destination.instance, options); - // `pipe` switches the stream to flowing mode and makes data start emitting. - await this.bindDelayedEvent("data"); - } - - public async setEncoding(encoding: string): Promise { - this.instance.setEncoding(encoding); - } - - public async dispose(): Promise { - this.instance.destroy(); - await super.dispose(); - } -} diff --git a/packages/protocol/src/node/modules/trash.ts b/packages/protocol/src/node/modules/trash.ts deleted file mode 100644 index 53a585b13501..000000000000 --- a/packages/protocol/src/node/modules/trash.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as trash from "trash"; - -// tslint:disable completed-docs - -export class TrashModuleProxy { - public async trash(path: string, options?: trash.Options): Promise { - return trash(path, options); - } -} diff --git a/packages/protocol/src/node/server.ts b/packages/protocol/src/node/server.ts deleted file mode 100644 index be4abbf847d5..000000000000 --- a/packages/protocol/src/node/server.ts +++ /dev/null @@ -1,360 +0,0 @@ -import { mkdirp } from "fs-extra"; -import * as os from "os"; -import { field, logger} from "@coder/logger"; -import { ReadWriteConnection } from "../common/connection"; -import { Module, ServerProxy } from "../common/proxy"; -import { isPromise, isProxy, moduleToProto, protoToArgument, platformToProto, protoToModule, argumentToProto } from "../common/util"; -import { Argument, Callback, ClientMessage, Event, Method, Pong, ServerMessage, WorkingInit } from "../proto"; -import { ChildProcessModuleProxy, ForkProvider, FsModuleProxy, NetModuleProxy, NodePtyModuleProxy, SpdlogModuleProxy, TrashModuleProxy } from "./modules"; - -// tslint:disable no-any - -export interface ServerOptions { - readonly workingDirectory: string; - readonly dataDirectory: string; - readonly cacheDirectory: string; - readonly builtInExtensionsDirectory: string; - readonly extensionsDirectory: string; - readonly fork?: ForkProvider; -} - -interface ProxyData { - disposeTimeout?: number | NodeJS.Timer; - instance: any; -} - -/** - * Handle messages from the client. - */ -export class Server { - private proxyId = 0; - private readonly proxies = new Map(); - private disconnected: boolean = false; - private readonly responseTimeout = 10000; - - public constructor( - private readonly connection: ReadWriteConnection, - private readonly options?: ServerOptions, - ) { - connection.onMessage(async (data) => { - try { - await this.handleMessage(ClientMessage.deserializeBinary(data)); - } catch (ex) { - logger.error( - "Failed to handle client message", - field("length", data.byteLength), - field("exception", { - message: ex.message, - stack: ex.stack, - }), - ); - } - }); - - connection.onClose(() => { - this.disconnected = true; - - logger.trace(() => [ - "disconnected from client", - field("proxies", this.proxies.size), - ]); - - this.proxies.forEach((proxy, proxyId) => { - if (isProxy(proxy.instance)) { - proxy.instance.dispose().catch((error) => { - logger.error(error.message); - }); - } - this.removeProxy(proxyId); - }); - }); - - this.storeProxy(new ChildProcessModuleProxy(this.options ? this.options.fork : undefined), Module.ChildProcess); - this.storeProxy(new FsModuleProxy(), Module.Fs); - this.storeProxy(new NetModuleProxy(), Module.Net); - this.storeProxy(new NodePtyModuleProxy(), Module.NodePty); - this.storeProxy(new SpdlogModuleProxy(), Module.Spdlog); - this.storeProxy(new TrashModuleProxy(), Module.Trash); - - if (!this.options) { - logger.warn("No server options provided. InitMessage will not be sent."); - - return; - } - - Promise.all([ - mkdirp(this.options.cacheDirectory), - mkdirp(this.options.dataDirectory), - mkdirp(this.options.workingDirectory), - ]).catch((error) => { - logger.error(error.message, field("error", error)); - }); - - const initMsg = new WorkingInit(); - initMsg.setDataDirectory(this.options.dataDirectory); - initMsg.setWorkingDirectory(this.options.workingDirectory); - initMsg.setBuiltinExtensionsDir(this.options.builtInExtensionsDirectory); - initMsg.setExtensionsDirectory(this.options.extensionsDirectory); - initMsg.setHomeDirectory(os.homedir()); - initMsg.setTmpDirectory(os.tmpdir()); - initMsg.setOperatingSystem(platformToProto(os.platform())); - initMsg.setShell(os.userInfo().shell || global.process.env.SHELL || ""); - const srvMsg = new ServerMessage(); - srvMsg.setInit(initMsg); - connection.send(srvMsg.serializeBinary()); - } - - /** - * Handle all messages from the client. - */ - private async handleMessage(message: ClientMessage): Promise { - switch (message.getMsgCase()) { - case ClientMessage.MsgCase.METHOD: - await this.runMethod(message.getMethod()!); - break; - case ClientMessage.MsgCase.PING: - logger.trace("ping"); - const srvMsg = new ServerMessage(); - srvMsg.setPong(new Pong()); - this.connection.send(srvMsg.serializeBinary()); - break; - default: - throw new Error("unknown message type"); - } - } - - /** - * Run a method on a proxy. - */ - private async runMethod(message: Method): Promise { - const proxyMessage = message.getNamedProxy()! || message.getNumberedProxy()!; - const id = proxyMessage.getId(); - const proxyId = message.hasNamedProxy() - ? protoToModule(message.getNamedProxy()!.getModule()) - : message.getNumberedProxy()!.getProxyId(); - const method = proxyMessage.getMethod(); - const args = proxyMessage.getArgsList().map((a) => protoToArgument( - a, - (id, args) => this.sendCallback(proxyId, id, args), - (id) => this.getProxy(id).instance, - )); - - logger.trace(() => [ - "received", - field("id", id), - field("proxyId", proxyId), - field("method", method), - ]); - - let response: any; - try { - const proxy = this.getProxy(proxyId); - if (typeof proxy.instance[method] !== "function") { - throw new Error(`"${method}" is not a function on proxy ${proxyId}`); - } - - response = proxy.instance[method](...args); - - // We wait for the client to call "dispose" instead of doing it onDone to - // ensure all the messages it sent get processed before we get rid of it. - if (method === "dispose") { - this.removeProxy(proxyId); - } - - // Proxies must always return promises. - if (!isPromise(response)) { - throw new Error(`"${method}" must return a promise`); - } - } catch (error) { - logger.error( - error.message, - field("type", typeof response), - field("proxyId", proxyId), - ); - this.sendException(id, error); - } - - try { - this.sendResponse(id, await response); - } catch (error) { - this.sendException(id, error); - } - } - - /** - * Send a callback to the client. - */ - private sendCallback(proxyId: number | Module, callbackId: number, args: any[]): void { - logger.trace(() => [ - "sending callback", - field("proxyId", proxyId), - field("callbackId", callbackId), - ]); - - const message = new Callback(); - let callbackMessage: Callback.Named | Callback.Numbered; - if (typeof proxyId === "string") { - callbackMessage = new Callback.Named(); - callbackMessage.setModule(moduleToProto(proxyId)); - message.setNamedCallback(callbackMessage); - } else { - callbackMessage = new Callback.Numbered(); - callbackMessage.setProxyId(proxyId); - message.setNumberedCallback(callbackMessage); - } - callbackMessage.setCallbackId(callbackId); - callbackMessage.setArgsList(args.map((a) => this.argumentToProto(a))); - - const serverMessage = new ServerMessage(); - serverMessage.setCallback(message); - this.connection.send(serverMessage.serializeBinary()); - } - - /** - * Store a numbered proxy and bind events to send them back to the client. - */ - private storeProxy(instance: ServerProxy): number; - /** - * Store a unique proxy and bind events to send them back to the client. - */ - private storeProxy(instance: any, moduleProxyId: Module): Module; - /** - * Store a proxy and bind events to send them back to the client. - */ - private storeProxy(instance: ServerProxy | any, moduleProxyId?: Module): number | Module { - // In case we disposed while waiting for a function to return. - if (this.disconnected) { - if (isProxy(instance)) { - instance.dispose().catch((error) => { - logger.error(error.message); - }); - } - - throw new Error("disposed"); - } - - const proxyId = moduleProxyId || this.proxyId++; - logger.trace(() => [ - "storing proxy", - field("proxyId", proxyId), - ]); - - this.proxies.set(proxyId, { instance }); - - if (isProxy(instance)) { - instance.onEvent((event, ...args) => this.sendEvent(proxyId, event, ...args)); - instance.onDone(() => { - // It might have finished because we disposed it due to a disconnect. - if (!this.disconnected) { - this.sendEvent(proxyId, "done"); - this.getProxy(proxyId).disposeTimeout = setTimeout(() => { - instance.dispose().catch((error) => { - logger.error(error.message); - }); - this.removeProxy(proxyId); - }, this.responseTimeout); - } - }); - } - - return proxyId; - } - - /** - * Send an event to the client. - */ - private sendEvent(proxyId: number | Module, event: string, ...args: any[]): void { - logger.trace(() => [ - "sending event", - field("proxyId", proxyId), - field("event", event), - ]); - - const message = new Event(); - let eventMessage: Event.Named | Event.Numbered; - if (typeof proxyId === "string") { - eventMessage = new Event.Named(); - eventMessage.setModule(moduleToProto(proxyId)); - message.setNamedEvent(eventMessage); - } else { - eventMessage = new Event.Numbered(); - eventMessage.setProxyId(proxyId); - message.setNumberedEvent(eventMessage); - } - eventMessage.setEvent(event); - eventMessage.setArgsList(args.map((a) => this.argumentToProto(a))); - - const serverMessage = new ServerMessage(); - serverMessage.setEvent(message); - this.connection.send(serverMessage.serializeBinary()); - } - - /** - * Send a response back to the client. - */ - private sendResponse(id: number, response: any): void { - logger.trace(() => [ - "sending resolve", - field("id", id), - ]); - - const successMessage = new Method.Success(); - successMessage.setId(id); - successMessage.setResponse(this.argumentToProto(response)); - - const serverMessage = new ServerMessage(); - serverMessage.setSuccess(successMessage); - this.connection.send(serverMessage.serializeBinary()); - } - - /** - * Send an exception back to the client. - */ - private sendException(id: number, error: Error): void { - logger.trace(() => [ - "sending reject", - field("id", id) , - field("message", error.message), - ]); - - const failedMessage = new Method.Fail(); - failedMessage.setId(id); - failedMessage.setResponse(argumentToProto(error)); - - const serverMessage = new ServerMessage(); - serverMessage.setFail(failedMessage); - this.connection.send(serverMessage.serializeBinary()); - } - - /** - * Call after disposing a proxy. - */ - private removeProxy(proxyId: number | Module): void { - clearTimeout(this.getProxy(proxyId).disposeTimeout as any); - this.proxies.delete(proxyId); - - logger.trace(() => [ - "disposed and removed proxy", - field("proxyId", proxyId), - field("proxies", this.proxies.size), - ]); - } - - /** - * Same as argumentToProto but provides storeProxy. - */ - private argumentToProto(value: any): Argument { - return argumentToProto(value, undefined, (p) => this.storeProxy(p)); - } - - /** - * Get a proxy. Error if it doesn't exist. - */ - private getProxy(proxyId: number | Module): ProxyData { - if (!this.proxies.has(proxyId)) { - throw new Error(`proxy ${proxyId} disposed too early`); - } - - return this.proxies.get(proxyId)!; - } -} diff --git a/packages/protocol/src/proto/client.proto b/packages/protocol/src/proto/client.proto deleted file mode 100644 index 4681ecf6f49b..000000000000 --- a/packages/protocol/src/proto/client.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto3"; -import "node.proto"; -import "vscode.proto"; - -// Messages that the client can send to the server. -message ClientMessage { - oneof msg { - // node.proto - Method method = 20; - Ping ping = 21; - } -} - -// Messages that the server can send to the client. -message ServerMessage { - oneof msg { - // node.proto - Method.Fail fail = 13; - Method.Success success = 14; - Event event = 19; - Callback callback = 22; - Pong pong = 18; - - WorkingInit init = 16; - - // vscode.proto - SharedProcessActive shared_process_active = 17; - } -} - -message WorkingInit { - string home_directory = 1; - string tmp_directory = 2; - string data_directory = 3; - string working_directory = 4; - enum OperatingSystem { - Windows = 0; - Linux = 1; - Mac = 2; - } - OperatingSystem operating_system = 5; - string shell = 6; - string builtin_extensions_dir = 7; - string extensions_directory = 8; -} diff --git a/packages/protocol/src/proto/client_pb.d.ts b/packages/protocol/src/proto/client_pb.d.ts deleted file mode 100644 index 9c4c1dd591a6..000000000000 --- a/packages/protocol/src/proto/client_pb.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -// package: -// file: client.proto - -import * as jspb from "google-protobuf"; -import * as node_pb from "./node_pb"; -import * as vscode_pb from "./vscode_pb"; - -export class ClientMessage extends jspb.Message { - hasMethod(): boolean; - clearMethod(): void; - getMethod(): node_pb.Method | undefined; - setMethod(value?: node_pb.Method): void; - - hasPing(): boolean; - clearPing(): void; - getPing(): node_pb.Ping | undefined; - setPing(value?: node_pb.Ping): void; - - getMsgCase(): ClientMessage.MsgCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ClientMessage.AsObject; - static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ClientMessage; - static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; -} - -export namespace ClientMessage { - export type AsObject = { - method?: node_pb.Method.AsObject, - ping?: node_pb.Ping.AsObject, - } - - export enum MsgCase { - MSG_NOT_SET = 0, - METHOD = 20, - PING = 21, - } -} - -export class ServerMessage extends jspb.Message { - hasFail(): boolean; - clearFail(): void; - getFail(): node_pb.Method.Fail | undefined; - setFail(value?: node_pb.Method.Fail): void; - - hasSuccess(): boolean; - clearSuccess(): void; - getSuccess(): node_pb.Method.Success | undefined; - setSuccess(value?: node_pb.Method.Success): void; - - hasEvent(): boolean; - clearEvent(): void; - getEvent(): node_pb.Event | undefined; - setEvent(value?: node_pb.Event): void; - - hasCallback(): boolean; - clearCallback(): void; - getCallback(): node_pb.Callback | undefined; - setCallback(value?: node_pb.Callback): void; - - hasPong(): boolean; - clearPong(): void; - getPong(): node_pb.Pong | undefined; - setPong(value?: node_pb.Pong): void; - - hasInit(): boolean; - clearInit(): void; - getInit(): WorkingInit | undefined; - setInit(value?: WorkingInit): void; - - hasSharedProcessActive(): boolean; - clearSharedProcessActive(): void; - getSharedProcessActive(): vscode_pb.SharedProcessActive | undefined; - setSharedProcessActive(value?: vscode_pb.SharedProcessActive): void; - - getMsgCase(): ServerMessage.MsgCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ServerMessage.AsObject; - static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ServerMessage; - static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; -} - -export namespace ServerMessage { - export type AsObject = { - fail?: node_pb.Method.Fail.AsObject, - success?: node_pb.Method.Success.AsObject, - event?: node_pb.Event.AsObject, - callback?: node_pb.Callback.AsObject, - pong?: node_pb.Pong.AsObject, - init?: WorkingInit.AsObject, - sharedProcessActive?: vscode_pb.SharedProcessActive.AsObject, - } - - export enum MsgCase { - MSG_NOT_SET = 0, - FAIL = 13, - SUCCESS = 14, - EVENT = 19, - CALLBACK = 22, - PONG = 18, - INIT = 16, - SHARED_PROCESS_ACTIVE = 17, - } -} - -export class WorkingInit extends jspb.Message { - getHomeDirectory(): string; - setHomeDirectory(value: string): void; - - getTmpDirectory(): string; - setTmpDirectory(value: string): void; - - getDataDirectory(): string; - setDataDirectory(value: string): void; - - getWorkingDirectory(): string; - setWorkingDirectory(value: string): void; - - getOperatingSystem(): WorkingInit.OperatingSystem; - setOperatingSystem(value: WorkingInit.OperatingSystem): void; - - getShell(): string; - setShell(value: string): void; - - getBuiltinExtensionsDir(): string; - setBuiltinExtensionsDir(value: string): void; - - getExtensionsDirectory(): string; - setExtensionsDirectory(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WorkingInit.AsObject; - static toObject(includeInstance: boolean, msg: WorkingInit): WorkingInit.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WorkingInit, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WorkingInit; - static deserializeBinaryFromReader(message: WorkingInit, reader: jspb.BinaryReader): WorkingInit; -} - -export namespace WorkingInit { - export type AsObject = { - homeDirectory: string, - tmpDirectory: string, - dataDirectory: string, - workingDirectory: string, - operatingSystem: WorkingInit.OperatingSystem, - shell: string, - builtinExtensionsDir: string, - extensionsDirectory: string, - } - - export enum OperatingSystem { - WINDOWS = 0, - LINUX = 1, - MAC = 2, - } -} - diff --git a/packages/protocol/src/proto/client_pb.js b/packages/protocol/src/proto/client_pb.js deleted file mode 100644 index 20bf41eacd06..000000000000 --- a/packages/protocol/src/proto/client_pb.js +++ /dev/null @@ -1,1084 +0,0 @@ -/** - * @fileoverview - * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var node_pb = require('./node_pb.js'); -goog.object.extend(proto, node_pb); -var vscode_pb = require('./vscode_pb.js'); -goog.object.extend(proto, vscode_pb); -goog.exportSymbol('proto.ClientMessage', null, global); -goog.exportSymbol('proto.ServerMessage', null, global); -goog.exportSymbol('proto.WorkingInit', null, global); -goog.exportSymbol('proto.WorkingInit.OperatingSystem', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.ClientMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ClientMessage.oneofGroups_); -}; -goog.inherits(proto.ClientMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.ClientMessage.displayName = 'proto.ClientMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.ServerMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ServerMessage.oneofGroups_); -}; -goog.inherits(proto.ServerMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.ServerMessage.displayName = 'proto.ServerMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.WorkingInit = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.WorkingInit, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.WorkingInit.displayName = 'proto.WorkingInit'; -} - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.ClientMessage.oneofGroups_ = [[20,21]]; - -/** - * @enum {number} - */ -proto.ClientMessage.MsgCase = { - MSG_NOT_SET: 0, - METHOD: 20, - PING: 21 -}; - -/** - * @return {proto.ClientMessage.MsgCase} - */ -proto.ClientMessage.prototype.getMsgCase = function() { - return /** @type {proto.ClientMessage.MsgCase} */(jspb.Message.computeOneofCase(this, proto.ClientMessage.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.ClientMessage.prototype.toObject = function(opt_includeInstance) { - return proto.ClientMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.ClientMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.ClientMessage.toObject = function(includeInstance, msg) { - var obj = { - method: (f = msg.getMethod()) && node_pb.Method.toObject(includeInstance, f), - ping: (f = msg.getPing()) && node_pb.Ping.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.ClientMessage} - */ -proto.ClientMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.ClientMessage; - return proto.ClientMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.ClientMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.ClientMessage} - */ -proto.ClientMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 20: - var value = new node_pb.Method; - reader.readMessage(value,node_pb.Method.deserializeBinaryFromReader); - msg.setMethod(value); - break; - case 21: - var value = new node_pb.Ping; - reader.readMessage(value,node_pb.Ping.deserializeBinaryFromReader); - msg.setPing(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.ClientMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.ClientMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.ClientMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.ClientMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMethod(); - if (f != null) { - writer.writeMessage( - 20, - f, - node_pb.Method.serializeBinaryToWriter - ); - } - f = message.getPing(); - if (f != null) { - writer.writeMessage( - 21, - f, - node_pb.Ping.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Method method = 20; - * @return {?proto.Method} - */ -proto.ClientMessage.prototype.getMethod = function() { - return /** @type{?proto.Method} */ ( - jspb.Message.getWrapperField(this, node_pb.Method, 20)); -}; - - -/** @param {?proto.Method|undefined} value */ -proto.ClientMessage.prototype.setMethod = function(value) { - jspb.Message.setOneofWrapperField(this, 20, proto.ClientMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ClientMessage.prototype.clearMethod = function() { - this.setMethod(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ClientMessage.prototype.hasMethod = function() { - return jspb.Message.getField(this, 20) != null; -}; - - -/** - * optional Ping ping = 21; - * @return {?proto.Ping} - */ -proto.ClientMessage.prototype.getPing = function() { - return /** @type{?proto.Ping} */ ( - jspb.Message.getWrapperField(this, node_pb.Ping, 21)); -}; - - -/** @param {?proto.Ping|undefined} value */ -proto.ClientMessage.prototype.setPing = function(value) { - jspb.Message.setOneofWrapperField(this, 21, proto.ClientMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ClientMessage.prototype.clearPing = function() { - this.setPing(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ClientMessage.prototype.hasPing = function() { - return jspb.Message.getField(this, 21) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.ServerMessage.oneofGroups_ = [[13,14,19,22,18,16,17]]; - -/** - * @enum {number} - */ -proto.ServerMessage.MsgCase = { - MSG_NOT_SET: 0, - FAIL: 13, - SUCCESS: 14, - EVENT: 19, - CALLBACK: 22, - PONG: 18, - INIT: 16, - SHARED_PROCESS_ACTIVE: 17 -}; - -/** - * @return {proto.ServerMessage.MsgCase} - */ -proto.ServerMessage.prototype.getMsgCase = function() { - return /** @type {proto.ServerMessage.MsgCase} */(jspb.Message.computeOneofCase(this, proto.ServerMessage.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.ServerMessage.prototype.toObject = function(opt_includeInstance) { - return proto.ServerMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.ServerMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.ServerMessage.toObject = function(includeInstance, msg) { - var obj = { - fail: (f = msg.getFail()) && node_pb.Method.Fail.toObject(includeInstance, f), - success: (f = msg.getSuccess()) && node_pb.Method.Success.toObject(includeInstance, f), - event: (f = msg.getEvent()) && node_pb.Event.toObject(includeInstance, f), - callback: (f = msg.getCallback()) && node_pb.Callback.toObject(includeInstance, f), - pong: (f = msg.getPong()) && node_pb.Pong.toObject(includeInstance, f), - init: (f = msg.getInit()) && proto.WorkingInit.toObject(includeInstance, f), - sharedProcessActive: (f = msg.getSharedProcessActive()) && vscode_pb.SharedProcessActive.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.ServerMessage} - */ -proto.ServerMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.ServerMessage; - return proto.ServerMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.ServerMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.ServerMessage} - */ -proto.ServerMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 13: - var value = new node_pb.Method.Fail; - reader.readMessage(value,node_pb.Method.Fail.deserializeBinaryFromReader); - msg.setFail(value); - break; - case 14: - var value = new node_pb.Method.Success; - reader.readMessage(value,node_pb.Method.Success.deserializeBinaryFromReader); - msg.setSuccess(value); - break; - case 19: - var value = new node_pb.Event; - reader.readMessage(value,node_pb.Event.deserializeBinaryFromReader); - msg.setEvent(value); - break; - case 22: - var value = new node_pb.Callback; - reader.readMessage(value,node_pb.Callback.deserializeBinaryFromReader); - msg.setCallback(value); - break; - case 18: - var value = new node_pb.Pong; - reader.readMessage(value,node_pb.Pong.deserializeBinaryFromReader); - msg.setPong(value); - break; - case 16: - var value = new proto.WorkingInit; - reader.readMessage(value,proto.WorkingInit.deserializeBinaryFromReader); - msg.setInit(value); - break; - case 17: - var value = new vscode_pb.SharedProcessActive; - reader.readMessage(value,vscode_pb.SharedProcessActive.deserializeBinaryFromReader); - msg.setSharedProcessActive(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.ServerMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.ServerMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.ServerMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.ServerMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getFail(); - if (f != null) { - writer.writeMessage( - 13, - f, - node_pb.Method.Fail.serializeBinaryToWriter - ); - } - f = message.getSuccess(); - if (f != null) { - writer.writeMessage( - 14, - f, - node_pb.Method.Success.serializeBinaryToWriter - ); - } - f = message.getEvent(); - if (f != null) { - writer.writeMessage( - 19, - f, - node_pb.Event.serializeBinaryToWriter - ); - } - f = message.getCallback(); - if (f != null) { - writer.writeMessage( - 22, - f, - node_pb.Callback.serializeBinaryToWriter - ); - } - f = message.getPong(); - if (f != null) { - writer.writeMessage( - 18, - f, - node_pb.Pong.serializeBinaryToWriter - ); - } - f = message.getInit(); - if (f != null) { - writer.writeMessage( - 16, - f, - proto.WorkingInit.serializeBinaryToWriter - ); - } - f = message.getSharedProcessActive(); - if (f != null) { - writer.writeMessage( - 17, - f, - vscode_pb.SharedProcessActive.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Method.Fail fail = 13; - * @return {?proto.Method.Fail} - */ -proto.ServerMessage.prototype.getFail = function() { - return /** @type{?proto.Method.Fail} */ ( - jspb.Message.getWrapperField(this, node_pb.Method.Fail, 13)); -}; - - -/** @param {?proto.Method.Fail|undefined} value */ -proto.ServerMessage.prototype.setFail = function(value) { - jspb.Message.setOneofWrapperField(this, 13, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearFail = function() { - this.setFail(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasFail = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional Method.Success success = 14; - * @return {?proto.Method.Success} - */ -proto.ServerMessage.prototype.getSuccess = function() { - return /** @type{?proto.Method.Success} */ ( - jspb.Message.getWrapperField(this, node_pb.Method.Success, 14)); -}; - - -/** @param {?proto.Method.Success|undefined} value */ -proto.ServerMessage.prototype.setSuccess = function(value) { - jspb.Message.setOneofWrapperField(this, 14, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearSuccess = function() { - this.setSuccess(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasSuccess = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * optional Event event = 19; - * @return {?proto.Event} - */ -proto.ServerMessage.prototype.getEvent = function() { - return /** @type{?proto.Event} */ ( - jspb.Message.getWrapperField(this, node_pb.Event, 19)); -}; - - -/** @param {?proto.Event|undefined} value */ -proto.ServerMessage.prototype.setEvent = function(value) { - jspb.Message.setOneofWrapperField(this, 19, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearEvent = function() { - this.setEvent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasEvent = function() { - return jspb.Message.getField(this, 19) != null; -}; - - -/** - * optional Callback callback = 22; - * @return {?proto.Callback} - */ -proto.ServerMessage.prototype.getCallback = function() { - return /** @type{?proto.Callback} */ ( - jspb.Message.getWrapperField(this, node_pb.Callback, 22)); -}; - - -/** @param {?proto.Callback|undefined} value */ -proto.ServerMessage.prototype.setCallback = function(value) { - jspb.Message.setOneofWrapperField(this, 22, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearCallback = function() { - this.setCallback(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasCallback = function() { - return jspb.Message.getField(this, 22) != null; -}; - - -/** - * optional Pong pong = 18; - * @return {?proto.Pong} - */ -proto.ServerMessage.prototype.getPong = function() { - return /** @type{?proto.Pong} */ ( - jspb.Message.getWrapperField(this, node_pb.Pong, 18)); -}; - - -/** @param {?proto.Pong|undefined} value */ -proto.ServerMessage.prototype.setPong = function(value) { - jspb.Message.setOneofWrapperField(this, 18, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearPong = function() { - this.setPong(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasPong = function() { - return jspb.Message.getField(this, 18) != null; -}; - - -/** - * optional WorkingInit init = 16; - * @return {?proto.WorkingInit} - */ -proto.ServerMessage.prototype.getInit = function() { - return /** @type{?proto.WorkingInit} */ ( - jspb.Message.getWrapperField(this, proto.WorkingInit, 16)); -}; - - -/** @param {?proto.WorkingInit|undefined} value */ -proto.ServerMessage.prototype.setInit = function(value) { - jspb.Message.setOneofWrapperField(this, 16, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearInit = function() { - this.setInit(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasInit = function() { - return jspb.Message.getField(this, 16) != null; -}; - - -/** - * optional SharedProcessActive shared_process_active = 17; - * @return {?proto.SharedProcessActive} - */ -proto.ServerMessage.prototype.getSharedProcessActive = function() { - return /** @type{?proto.SharedProcessActive} */ ( - jspb.Message.getWrapperField(this, vscode_pb.SharedProcessActive, 17)); -}; - - -/** @param {?proto.SharedProcessActive|undefined} value */ -proto.ServerMessage.prototype.setSharedProcessActive = function(value) { - jspb.Message.setOneofWrapperField(this, 17, proto.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.ServerMessage.prototype.clearSharedProcessActive = function() { - this.setSharedProcessActive(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.ServerMessage.prototype.hasSharedProcessActive = function() { - return jspb.Message.getField(this, 17) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.WorkingInit.prototype.toObject = function(opt_includeInstance) { - return proto.WorkingInit.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.WorkingInit} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.WorkingInit.toObject = function(includeInstance, msg) { - var obj = { - homeDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""), - tmpDirectory: jspb.Message.getFieldWithDefault(msg, 2, ""), - dataDirectory: jspb.Message.getFieldWithDefault(msg, 3, ""), - workingDirectory: jspb.Message.getFieldWithDefault(msg, 4, ""), - operatingSystem: jspb.Message.getFieldWithDefault(msg, 5, 0), - shell: jspb.Message.getFieldWithDefault(msg, 6, ""), - builtinExtensionsDir: jspb.Message.getFieldWithDefault(msg, 7, ""), - extensionsDirectory: jspb.Message.getFieldWithDefault(msg, 8, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.WorkingInit} - */ -proto.WorkingInit.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.WorkingInit; - return proto.WorkingInit.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.WorkingInit} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.WorkingInit} - */ -proto.WorkingInit.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setHomeDirectory(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setTmpDirectory(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDataDirectory(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setWorkingDirectory(value); - break; - case 5: - var value = /** @type {!proto.WorkingInit.OperatingSystem} */ (reader.readEnum()); - msg.setOperatingSystem(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setShell(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setBuiltinExtensionsDir(value); - break; - case 8: - var value = /** @type {string} */ (reader.readString()); - msg.setExtensionsDirectory(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.WorkingInit.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.WorkingInit.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.WorkingInit} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.WorkingInit.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getHomeDirectory(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getTmpDirectory(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDataDirectory(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getWorkingDirectory(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getOperatingSystem(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } - f = message.getShell(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getBuiltinExtensionsDir(); - if (f.length > 0) { - writer.writeString( - 7, - f - ); - } - f = message.getExtensionsDirectory(); - if (f.length > 0) { - writer.writeString( - 8, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.WorkingInit.OperatingSystem = { - WINDOWS: 0, - LINUX: 1, - MAC: 2 -}; - -/** - * optional string home_directory = 1; - * @return {string} - */ -proto.WorkingInit.prototype.getHomeDirectory = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setHomeDirectory = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string tmp_directory = 2; - * @return {string} - */ -proto.WorkingInit.prototype.getTmpDirectory = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setTmpDirectory = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string data_directory = 3; - * @return {string} - */ -proto.WorkingInit.prototype.getDataDirectory = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setDataDirectory = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string working_directory = 4; - * @return {string} - */ -proto.WorkingInit.prototype.getWorkingDirectory = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setWorkingDirectory = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional OperatingSystem operating_system = 5; - * @return {!proto.WorkingInit.OperatingSystem} - */ -proto.WorkingInit.prototype.getOperatingSystem = function() { - return /** @type {!proto.WorkingInit.OperatingSystem} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** @param {!proto.WorkingInit.OperatingSystem} value */ -proto.WorkingInit.prototype.setOperatingSystem = function(value) { - jspb.Message.setProto3EnumField(this, 5, value); -}; - - -/** - * optional string shell = 6; - * @return {string} - */ -proto.WorkingInit.prototype.getShell = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setShell = function(value) { - jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional string builtin_extensions_dir = 7; - * @return {string} - */ -proto.WorkingInit.prototype.getBuiltinExtensionsDir = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setBuiltinExtensionsDir = function(value) { - jspb.Message.setProto3StringField(this, 7, value); -}; - - -/** - * optional string extensions_directory = 8; - * @return {string} - */ -proto.WorkingInit.prototype.getExtensionsDirectory = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); -}; - - -/** @param {string} value */ -proto.WorkingInit.prototype.setExtensionsDirectory = function(value) { - jspb.Message.setProto3StringField(this, 8, value); -}; - - -goog.object.extend(exports, proto); diff --git a/packages/protocol/src/proto/index.ts b/packages/protocol/src/proto/index.ts deleted file mode 100644 index c46ab604de82..000000000000 --- a/packages/protocol/src/proto/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./client_pb"; -export * from "./node_pb"; -export * from "./vscode_pb"; diff --git a/packages/protocol/src/proto/node.proto b/packages/protocol/src/proto/node.proto deleted file mode 100644 index 2ad9b33d27fd..000000000000 --- a/packages/protocol/src/proto/node.proto +++ /dev/null @@ -1,143 +0,0 @@ -syntax = "proto3"; - -enum Module { - ChildProcess = 0; - Fs = 1; - Net = 2; - NodePty = 3; - Spdlog = 4; - Trash = 5; -} - -message Argument { - message ErrorValue { - string message = 1; - string stack = 2; - string code = 3; - } - - message BufferValue { - bytes data = 1; - } - - message ObjectValue { - map data = 1; - } - - message ArrayValue { - repeated Argument data = 1; - } - - message ProxyValue { - uint64 id = 1; - } - - message FunctionValue { - uint64 id = 1; - } - - message NullValue {} - - message UndefinedValue {} - - message DateValue { - string date = 1; - } - - oneof msg { - ErrorValue error = 1; - BufferValue buffer = 2; - ObjectValue object = 3; - ArrayValue array = 4; - ProxyValue proxy = 5; - FunctionValue function = 6; - NullValue null = 7; - UndefinedValue undefined = 8; - double number = 9; - string string = 10; - bool boolean = 11; - DateValue date = 12; - } -} - -// Call a remote method. -message Method { - // A proxy identified by a unique name like "fs". - message Named { - uint64 id = 1; - Module module = 2; - string method = 3; - repeated Argument args = 4; - } - - // A general proxy identified by an ID like WriteStream. - message Numbered { - uint64 id = 1; - uint64 proxy_id = 2; - string method = 3; - repeated Argument args = 4; - } - - // Remote method failed. - message Fail { - uint64 id = 1; - Argument response = 2; - } - - // Remote method succeeded. - message Success { - uint64 id = 1; - Argument response = 2; - } - - oneof msg { - Method.Named named_proxy = 1; - Method.Numbered numbered_proxy = 2; - } -} - -message Callback { - // A remote callback for uniquely named proxy. - message Named { - Module module = 1; - uint64 callback_id = 2; - repeated Argument args = 3; - } - - // A remote callback for a numbered proxy. - message Numbered { - uint64 proxy_id = 1; - uint64 callback_id = 2; - repeated Argument args = 3; - } - - oneof msg { - Callback.Named named_callback = 1; - Callback.Numbered numbered_callback = 2; - } -} - -message Event { - // Emit an event on a uniquely named proxy. - message Named { - Module module = 1; - string event = 2; - repeated Argument args = 3; - } - - // Emit an event on a numbered proxy. - message Numbered { - uint64 proxy_id = 1; - string event = 2; - repeated Argument args = 3; - } - - oneof msg { - Event.Named named_event = 1; - Event.Numbered numbered_event = 2; - } -} - -message Ping {} - -message Pong {} diff --git a/packages/protocol/src/proto/node_pb.d.ts b/packages/protocol/src/proto/node_pb.d.ts deleted file mode 100644 index 28bd568ec113..000000000000 --- a/packages/protocol/src/proto/node_pb.d.ts +++ /dev/null @@ -1,679 +0,0 @@ -// package: -// file: node.proto - -import * as jspb from "google-protobuf"; - -export class Argument extends jspb.Message { - hasError(): boolean; - clearError(): void; - getError(): Argument.ErrorValue | undefined; - setError(value?: Argument.ErrorValue): void; - - hasBuffer(): boolean; - clearBuffer(): void; - getBuffer(): Argument.BufferValue | undefined; - setBuffer(value?: Argument.BufferValue): void; - - hasObject(): boolean; - clearObject(): void; - getObject(): Argument.ObjectValue | undefined; - setObject(value?: Argument.ObjectValue): void; - - hasArray(): boolean; - clearArray(): void; - getArray(): Argument.ArrayValue | undefined; - setArray(value?: Argument.ArrayValue): void; - - hasProxy(): boolean; - clearProxy(): void; - getProxy(): Argument.ProxyValue | undefined; - setProxy(value?: Argument.ProxyValue): void; - - hasFunction(): boolean; - clearFunction(): void; - getFunction(): Argument.FunctionValue | undefined; - setFunction(value?: Argument.FunctionValue): void; - - hasNull(): boolean; - clearNull(): void; - getNull(): Argument.NullValue | undefined; - setNull(value?: Argument.NullValue): void; - - hasUndefined(): boolean; - clearUndefined(): void; - getUndefined(): Argument.UndefinedValue | undefined; - setUndefined(value?: Argument.UndefinedValue): void; - - hasNumber(): boolean; - clearNumber(): void; - getNumber(): number; - setNumber(value: number): void; - - hasString(): boolean; - clearString(): void; - getString(): string; - setString(value: string): void; - - hasBoolean(): boolean; - clearBoolean(): void; - getBoolean(): boolean; - setBoolean(value: boolean): void; - - hasDate(): boolean; - clearDate(): void; - getDate(): Argument.DateValue | undefined; - setDate(value?: Argument.DateValue): void; - - getMsgCase(): Argument.MsgCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Argument.AsObject; - static toObject(includeInstance: boolean, msg: Argument): Argument.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Argument, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Argument; - static deserializeBinaryFromReader(message: Argument, reader: jspb.BinaryReader): Argument; -} - -export namespace Argument { - export type AsObject = { - error?: Argument.ErrorValue.AsObject, - buffer?: Argument.BufferValue.AsObject, - object?: Argument.ObjectValue.AsObject, - array?: Argument.ArrayValue.AsObject, - proxy?: Argument.ProxyValue.AsObject, - pb_function?: Argument.FunctionValue.AsObject, - pb_null?: Argument.NullValue.AsObject, - undefined?: Argument.UndefinedValue.AsObject, - number: number, - string: string, - pb_boolean: boolean, - date?: Argument.DateValue.AsObject, - } - - export class ErrorValue extends jspb.Message { - getMessage(): string; - setMessage(value: string): void; - - getStack(): string; - setStack(value: string): void; - - getCode(): string; - setCode(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ErrorValue.AsObject; - static toObject(includeInstance: boolean, msg: ErrorValue): ErrorValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ErrorValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ErrorValue; - static deserializeBinaryFromReader(message: ErrorValue, reader: jspb.BinaryReader): ErrorValue; - } - - export namespace ErrorValue { - export type AsObject = { - message: string, - stack: string, - code: string, - } - } - - export class BufferValue extends jspb.Message { - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BufferValue.AsObject; - static toObject(includeInstance: boolean, msg: BufferValue): BufferValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BufferValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BufferValue; - static deserializeBinaryFromReader(message: BufferValue, reader: jspb.BinaryReader): BufferValue; - } - - export namespace BufferValue { - export type AsObject = { - data: Uint8Array | string, - } - } - - export class ObjectValue extends jspb.Message { - getDataMap(): jspb.Map; - clearDataMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ObjectValue.AsObject; - static toObject(includeInstance: boolean, msg: ObjectValue): ObjectValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ObjectValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ObjectValue; - static deserializeBinaryFromReader(message: ObjectValue, reader: jspb.BinaryReader): ObjectValue; - } - - export namespace ObjectValue { - export type AsObject = { - dataMap: Array<[string, Argument.AsObject]>, - } - } - - export class ArrayValue extends jspb.Message { - clearDataList(): void; - getDataList(): Array; - setDataList(value: Array): void; - addData(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ArrayValue.AsObject; - static toObject(includeInstance: boolean, msg: ArrayValue): ArrayValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ArrayValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ArrayValue; - static deserializeBinaryFromReader(message: ArrayValue, reader: jspb.BinaryReader): ArrayValue; - } - - export namespace ArrayValue { - export type AsObject = { - dataList: Array, - } - } - - export class ProxyValue extends jspb.Message { - getId(): number; - setId(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ProxyValue.AsObject; - static toObject(includeInstance: boolean, msg: ProxyValue): ProxyValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ProxyValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ProxyValue; - static deserializeBinaryFromReader(message: ProxyValue, reader: jspb.BinaryReader): ProxyValue; - } - - export namespace ProxyValue { - export type AsObject = { - id: number, - } - } - - export class FunctionValue extends jspb.Message { - getId(): number; - setId(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): FunctionValue.AsObject; - static toObject(includeInstance: boolean, msg: FunctionValue): FunctionValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: FunctionValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): FunctionValue; - static deserializeBinaryFromReader(message: FunctionValue, reader: jspb.BinaryReader): FunctionValue; - } - - export namespace FunctionValue { - export type AsObject = { - id: number, - } - } - - export class NullValue extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NullValue.AsObject; - static toObject(includeInstance: boolean, msg: NullValue): NullValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NullValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NullValue; - static deserializeBinaryFromReader(message: NullValue, reader: jspb.BinaryReader): NullValue; - } - - export namespace NullValue { - export type AsObject = { - } - } - - export class UndefinedValue extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UndefinedValue.AsObject; - static toObject(includeInstance: boolean, msg: UndefinedValue): UndefinedValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UndefinedValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UndefinedValue; - static deserializeBinaryFromReader(message: UndefinedValue, reader: jspb.BinaryReader): UndefinedValue; - } - - export namespace UndefinedValue { - export type AsObject = { - } - } - - export class DateValue extends jspb.Message { - getDate(): string; - setDate(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DateValue.AsObject; - static toObject(includeInstance: boolean, msg: DateValue): DateValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DateValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DateValue; - static deserializeBinaryFromReader(message: DateValue, reader: jspb.BinaryReader): DateValue; - } - - export namespace DateValue { - export type AsObject = { - date: string, - } - } - - export enum MsgCase { - MSG_NOT_SET = 0, - ERROR = 1, - BUFFER = 2, - OBJECT = 3, - ARRAY = 4, - PROXY = 5, - FUNCTION = 6, - NULL = 7, - UNDEFINED = 8, - NUMBER = 9, - STRING = 10, - BOOLEAN = 11, - DATE = 12, - } -} - -export class Method extends jspb.Message { - hasNamedProxy(): boolean; - clearNamedProxy(): void; - getNamedProxy(): Method.Named | undefined; - setNamedProxy(value?: Method.Named): void; - - hasNumberedProxy(): boolean; - clearNumberedProxy(): void; - getNumberedProxy(): Method.Numbered | undefined; - setNumberedProxy(value?: Method.Numbered): void; - - getMsgCase(): Method.MsgCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Method.AsObject; - static toObject(includeInstance: boolean, msg: Method): Method.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Method, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Method; - static deserializeBinaryFromReader(message: Method, reader: jspb.BinaryReader): Method; -} - -export namespace Method { - export type AsObject = { - namedProxy?: Method.Named.AsObject, - numberedProxy?: Method.Numbered.AsObject, - } - - export class Named extends jspb.Message { - getId(): number; - setId(value: number): void; - - getModule(): Module; - setModule(value: Module): void; - - getMethod(): string; - setMethod(value: string): void; - - clearArgsList(): void; - getArgsList(): Array; - setArgsList(value: Array): void; - addArgs(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Named.AsObject; - static toObject(includeInstance: boolean, msg: Named): Named.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Named, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Named; - static deserializeBinaryFromReader(message: Named, reader: jspb.BinaryReader): Named; - } - - export namespace Named { - export type AsObject = { - id: number, - module: Module, - method: string, - argsList: Array, - } - } - - export class Numbered extends jspb.Message { - getId(): number; - setId(value: number): void; - - getProxyId(): number; - setProxyId(value: number): void; - - getMethod(): string; - setMethod(value: string): void; - - clearArgsList(): void; - getArgsList(): Array; - setArgsList(value: Array): void; - addArgs(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Numbered.AsObject; - static toObject(includeInstance: boolean, msg: Numbered): Numbered.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Numbered, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Numbered; - static deserializeBinaryFromReader(message: Numbered, reader: jspb.BinaryReader): Numbered; - } - - export namespace Numbered { - export type AsObject = { - id: number, - proxyId: number, - method: string, - argsList: Array, - } - } - - export class Fail extends jspb.Message { - getId(): number; - setId(value: number): void; - - hasResponse(): boolean; - clearResponse(): void; - getResponse(): Argument | undefined; - setResponse(value?: Argument): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Fail.AsObject; - static toObject(includeInstance: boolean, msg: Fail): Fail.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Fail, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Fail; - static deserializeBinaryFromReader(message: Fail, reader: jspb.BinaryReader): Fail; - } - - export namespace Fail { - export type AsObject = { - id: number, - response?: Argument.AsObject, - } - } - - export class Success extends jspb.Message { - getId(): number; - setId(value: number): void; - - hasResponse(): boolean; - clearResponse(): void; - getResponse(): Argument | undefined; - setResponse(value?: Argument): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Success.AsObject; - static toObject(includeInstance: boolean, msg: Success): Success.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Success, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Success; - static deserializeBinaryFromReader(message: Success, reader: jspb.BinaryReader): Success; - } - - export namespace Success { - export type AsObject = { - id: number, - response?: Argument.AsObject, - } - } - - export enum MsgCase { - MSG_NOT_SET = 0, - NAMED_PROXY = 1, - NUMBERED_PROXY = 2, - } -} - -export class Callback extends jspb.Message { - hasNamedCallback(): boolean; - clearNamedCallback(): void; - getNamedCallback(): Callback.Named | undefined; - setNamedCallback(value?: Callback.Named): void; - - hasNumberedCallback(): boolean; - clearNumberedCallback(): void; - getNumberedCallback(): Callback.Numbered | undefined; - setNumberedCallback(value?: Callback.Numbered): void; - - getMsgCase(): Callback.MsgCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Callback.AsObject; - static toObject(includeInstance: boolean, msg: Callback): Callback.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Callback, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Callback; - static deserializeBinaryFromReader(message: Callback, reader: jspb.BinaryReader): Callback; -} - -export namespace Callback { - export type AsObject = { - namedCallback?: Callback.Named.AsObject, - numberedCallback?: Callback.Numbered.AsObject, - } - - export class Named extends jspb.Message { - getModule(): Module; - setModule(value: Module): void; - - getCallbackId(): number; - setCallbackId(value: number): void; - - clearArgsList(): void; - getArgsList(): Array; - setArgsList(value: Array): void; - addArgs(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Named.AsObject; - static toObject(includeInstance: boolean, msg: Named): Named.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Named, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Named; - static deserializeBinaryFromReader(message: Named, reader: jspb.BinaryReader): Named; - } - - export namespace Named { - export type AsObject = { - module: Module, - callbackId: number, - argsList: Array, - } - } - - export class Numbered extends jspb.Message { - getProxyId(): number; - setProxyId(value: number): void; - - getCallbackId(): number; - setCallbackId(value: number): void; - - clearArgsList(): void; - getArgsList(): Array; - setArgsList(value: Array): void; - addArgs(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Numbered.AsObject; - static toObject(includeInstance: boolean, msg: Numbered): Numbered.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Numbered, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Numbered; - static deserializeBinaryFromReader(message: Numbered, reader: jspb.BinaryReader): Numbered; - } - - export namespace Numbered { - export type AsObject = { - proxyId: number, - callbackId: number, - argsList: Array, - } - } - - export enum MsgCase { - MSG_NOT_SET = 0, - NAMED_CALLBACK = 1, - NUMBERED_CALLBACK = 2, - } -} - -export class Event extends jspb.Message { - hasNamedEvent(): boolean; - clearNamedEvent(): void; - getNamedEvent(): Event.Named | undefined; - setNamedEvent(value?: Event.Named): void; - - hasNumberedEvent(): boolean; - clearNumberedEvent(): void; - getNumberedEvent(): Event.Numbered | undefined; - setNumberedEvent(value?: Event.Numbered): void; - - getMsgCase(): Event.MsgCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Event.AsObject; - static toObject(includeInstance: boolean, msg: Event): Event.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Event, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Event; - static deserializeBinaryFromReader(message: Event, reader: jspb.BinaryReader): Event; -} - -export namespace Event { - export type AsObject = { - namedEvent?: Event.Named.AsObject, - numberedEvent?: Event.Numbered.AsObject, - } - - export class Named extends jspb.Message { - getModule(): Module; - setModule(value: Module): void; - - getEvent(): string; - setEvent(value: string): void; - - clearArgsList(): void; - getArgsList(): Array; - setArgsList(value: Array): void; - addArgs(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Named.AsObject; - static toObject(includeInstance: boolean, msg: Named): Named.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Named, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Named; - static deserializeBinaryFromReader(message: Named, reader: jspb.BinaryReader): Named; - } - - export namespace Named { - export type AsObject = { - module: Module, - event: string, - argsList: Array, - } - } - - export class Numbered extends jspb.Message { - getProxyId(): number; - setProxyId(value: number): void; - - getEvent(): string; - setEvent(value: string): void; - - clearArgsList(): void; - getArgsList(): Array; - setArgsList(value: Array): void; - addArgs(value?: Argument, index?: number): Argument; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Numbered.AsObject; - static toObject(includeInstance: boolean, msg: Numbered): Numbered.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Numbered, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Numbered; - static deserializeBinaryFromReader(message: Numbered, reader: jspb.BinaryReader): Numbered; - } - - export namespace Numbered { - export type AsObject = { - proxyId: number, - event: string, - argsList: Array, - } - } - - export enum MsgCase { - MSG_NOT_SET = 0, - NAMED_EVENT = 1, - NUMBERED_EVENT = 2, - } -} - -export class Ping extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Ping.AsObject; - static toObject(includeInstance: boolean, msg: Ping): Ping.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Ping, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Ping; - static deserializeBinaryFromReader(message: Ping, reader: jspb.BinaryReader): Ping; -} - -export namespace Ping { - export type AsObject = { - } -} - -export class Pong extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Pong.AsObject; - static toObject(includeInstance: boolean, msg: Pong): Pong.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Pong, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Pong; - static deserializeBinaryFromReader(message: Pong, reader: jspb.BinaryReader): Pong; -} - -export namespace Pong { - export type AsObject = { - } -} - -export enum Module { - CHILDPROCESS = 0, - FS = 1, - NET = 2, - NODEPTY = 3, - SPDLOG = 4, - TRASH = 5, -} - diff --git a/packages/protocol/src/proto/node_pb.js b/packages/protocol/src/proto/node_pb.js deleted file mode 100644 index c3eed692b13c..000000000000 --- a/packages/protocol/src/proto/node_pb.js +++ /dev/null @@ -1,4907 +0,0 @@ -/** - * @fileoverview - * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.Argument', null, global); -goog.exportSymbol('proto.Argument.ArrayValue', null, global); -goog.exportSymbol('proto.Argument.BufferValue', null, global); -goog.exportSymbol('proto.Argument.DateValue', null, global); -goog.exportSymbol('proto.Argument.ErrorValue', null, global); -goog.exportSymbol('proto.Argument.FunctionValue', null, global); -goog.exportSymbol('proto.Argument.NullValue', null, global); -goog.exportSymbol('proto.Argument.ObjectValue', null, global); -goog.exportSymbol('proto.Argument.ProxyValue', null, global); -goog.exportSymbol('proto.Argument.UndefinedValue', null, global); -goog.exportSymbol('proto.Callback', null, global); -goog.exportSymbol('proto.Callback.Named', null, global); -goog.exportSymbol('proto.Callback.Numbered', null, global); -goog.exportSymbol('proto.Event', null, global); -goog.exportSymbol('proto.Event.Named', null, global); -goog.exportSymbol('proto.Event.Numbered', null, global); -goog.exportSymbol('proto.Method', null, global); -goog.exportSymbol('proto.Method.Fail', null, global); -goog.exportSymbol('proto.Method.Named', null, global); -goog.exportSymbol('proto.Method.Numbered', null, global); -goog.exportSymbol('proto.Method.Success', null, global); -goog.exportSymbol('proto.Module', null, global); -goog.exportSymbol('proto.Ping', null, global); -goog.exportSymbol('proto.Pong', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Argument.oneofGroups_); -}; -goog.inherits(proto.Argument, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.displayName = 'proto.Argument'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ErrorValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.ErrorValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ErrorValue.displayName = 'proto.Argument.ErrorValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.BufferValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.BufferValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.BufferValue.displayName = 'proto.Argument.BufferValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ObjectValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.ObjectValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ObjectValue.displayName = 'proto.Argument.ObjectValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ArrayValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Argument.ArrayValue.repeatedFields_, null); -}; -goog.inherits(proto.Argument.ArrayValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ArrayValue.displayName = 'proto.Argument.ArrayValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ProxyValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.ProxyValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ProxyValue.displayName = 'proto.Argument.ProxyValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.FunctionValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.FunctionValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.FunctionValue.displayName = 'proto.Argument.FunctionValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.NullValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.NullValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.NullValue.displayName = 'proto.Argument.NullValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.UndefinedValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.UndefinedValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.UndefinedValue.displayName = 'proto.Argument.UndefinedValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.DateValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.DateValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.DateValue.displayName = 'proto.Argument.DateValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Method.oneofGroups_); -}; -goog.inherits(proto.Method, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.displayName = 'proto.Method'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Named = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Method.Named.repeatedFields_, null); -}; -goog.inherits(proto.Method.Named, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Named.displayName = 'proto.Method.Named'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Numbered = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Method.Numbered.repeatedFields_, null); -}; -goog.inherits(proto.Method.Numbered, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Numbered.displayName = 'proto.Method.Numbered'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Fail = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Method.Fail, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Fail.displayName = 'proto.Method.Fail'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Success = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Method.Success, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Success.displayName = 'proto.Method.Success'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Callback = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Callback.oneofGroups_); -}; -goog.inherits(proto.Callback, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Callback.displayName = 'proto.Callback'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Callback.Named = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Callback.Named.repeatedFields_, null); -}; -goog.inherits(proto.Callback.Named, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Callback.Named.displayName = 'proto.Callback.Named'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Callback.Numbered = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Callback.Numbered.repeatedFields_, null); -}; -goog.inherits(proto.Callback.Numbered, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Callback.Numbered.displayName = 'proto.Callback.Numbered'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Event = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Event.oneofGroups_); -}; -goog.inherits(proto.Event, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Event.displayName = 'proto.Event'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Event.Named = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Event.Named.repeatedFields_, null); -}; -goog.inherits(proto.Event.Named, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Event.Named.displayName = 'proto.Event.Named'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Event.Numbered = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Event.Numbered.repeatedFields_, null); -}; -goog.inherits(proto.Event.Numbered, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Event.Numbered.displayName = 'proto.Event.Numbered'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Ping = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Ping, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Ping.displayName = 'proto.Ping'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Pong = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Pong, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Pong.displayName = 'proto.Pong'; -} - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.Argument.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10,11,12]]; - -/** - * @enum {number} - */ -proto.Argument.MsgCase = { - MSG_NOT_SET: 0, - ERROR: 1, - BUFFER: 2, - OBJECT: 3, - ARRAY: 4, - PROXY: 5, - FUNCTION: 6, - NULL: 7, - UNDEFINED: 8, - NUMBER: 9, - STRING: 10, - BOOLEAN: 11, - DATE: 12 -}; - -/** - * @return {proto.Argument.MsgCase} - */ -proto.Argument.prototype.getMsgCase = function() { - return /** @type {proto.Argument.MsgCase} */(jspb.Message.computeOneofCase(this, proto.Argument.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.toObject = function(includeInstance, msg) { - var obj = { - error: (f = msg.getError()) && proto.Argument.ErrorValue.toObject(includeInstance, f), - buffer: (f = msg.getBuffer()) && proto.Argument.BufferValue.toObject(includeInstance, f), - object: (f = msg.getObject()) && proto.Argument.ObjectValue.toObject(includeInstance, f), - array: (f = msg.getArray()) && proto.Argument.ArrayValue.toObject(includeInstance, f), - proxy: (f = msg.getProxy()) && proto.Argument.ProxyValue.toObject(includeInstance, f), - pb_function: (f = msg.getFunction()) && proto.Argument.FunctionValue.toObject(includeInstance, f), - pb_null: (f = msg.getNull()) && proto.Argument.NullValue.toObject(includeInstance, f), - undefined: (f = msg.getUndefined()) && proto.Argument.UndefinedValue.toObject(includeInstance, f), - number: +jspb.Message.getFieldWithDefault(msg, 9, 0.0), - string: jspb.Message.getFieldWithDefault(msg, 10, ""), - pb_boolean: jspb.Message.getFieldWithDefault(msg, 11, false), - date: (f = msg.getDate()) && proto.Argument.DateValue.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument} - */ -proto.Argument.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument; - return proto.Argument.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument} - */ -proto.Argument.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.Argument.ErrorValue; - reader.readMessage(value,proto.Argument.ErrorValue.deserializeBinaryFromReader); - msg.setError(value); - break; - case 2: - var value = new proto.Argument.BufferValue; - reader.readMessage(value,proto.Argument.BufferValue.deserializeBinaryFromReader); - msg.setBuffer(value); - break; - case 3: - var value = new proto.Argument.ObjectValue; - reader.readMessage(value,proto.Argument.ObjectValue.deserializeBinaryFromReader); - msg.setObject(value); - break; - case 4: - var value = new proto.Argument.ArrayValue; - reader.readMessage(value,proto.Argument.ArrayValue.deserializeBinaryFromReader); - msg.setArray(value); - break; - case 5: - var value = new proto.Argument.ProxyValue; - reader.readMessage(value,proto.Argument.ProxyValue.deserializeBinaryFromReader); - msg.setProxy(value); - break; - case 6: - var value = new proto.Argument.FunctionValue; - reader.readMessage(value,proto.Argument.FunctionValue.deserializeBinaryFromReader); - msg.setFunction(value); - break; - case 7: - var value = new proto.Argument.NullValue; - reader.readMessage(value,proto.Argument.NullValue.deserializeBinaryFromReader); - msg.setNull(value); - break; - case 8: - var value = new proto.Argument.UndefinedValue; - reader.readMessage(value,proto.Argument.UndefinedValue.deserializeBinaryFromReader); - msg.setUndefined(value); - break; - case 9: - var value = /** @type {number} */ (reader.readDouble()); - msg.setNumber(value); - break; - case 10: - var value = /** @type {string} */ (reader.readString()); - msg.setString(value); - break; - case 11: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setBoolean(value); - break; - case 12: - var value = new proto.Argument.DateValue; - reader.readMessage(value,proto.Argument.DateValue.deserializeBinaryFromReader); - msg.setDate(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getError(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.Argument.ErrorValue.serializeBinaryToWriter - ); - } - f = message.getBuffer(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.Argument.BufferValue.serializeBinaryToWriter - ); - } - f = message.getObject(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.Argument.ObjectValue.serializeBinaryToWriter - ); - } - f = message.getArray(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.Argument.ArrayValue.serializeBinaryToWriter - ); - } - f = message.getProxy(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.Argument.ProxyValue.serializeBinaryToWriter - ); - } - f = message.getFunction(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.Argument.FunctionValue.serializeBinaryToWriter - ); - } - f = message.getNull(); - if (f != null) { - writer.writeMessage( - 7, - f, - proto.Argument.NullValue.serializeBinaryToWriter - ); - } - f = message.getUndefined(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.Argument.UndefinedValue.serializeBinaryToWriter - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 9)); - if (f != null) { - writer.writeDouble( - 9, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 10)); - if (f != null) { - writer.writeString( - 10, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 11)); - if (f != null) { - writer.writeBool( - 11, - f - ); - } - f = message.getDate(); - if (f != null) { - writer.writeMessage( - 12, - f, - proto.Argument.DateValue.serializeBinaryToWriter - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.ErrorValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.ErrorValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.ErrorValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ErrorValue.toObject = function(includeInstance, msg) { - var obj = { - message: jspb.Message.getFieldWithDefault(msg, 1, ""), - stack: jspb.Message.getFieldWithDefault(msg, 2, ""), - code: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.ErrorValue} - */ -proto.Argument.ErrorValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.ErrorValue; - return proto.Argument.ErrorValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.ErrorValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.ErrorValue} - */ -proto.Argument.ErrorValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setStack(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setCode(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.ErrorValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.ErrorValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.ErrorValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ErrorValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getStack(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getCode(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string message = 1; - * @return {string} - */ -proto.Argument.ErrorValue.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.Argument.ErrorValue.prototype.setMessage = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string stack = 2; - * @return {string} - */ -proto.Argument.ErrorValue.prototype.getStack = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.Argument.ErrorValue.prototype.setStack = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string code = 3; - * @return {string} - */ -proto.Argument.ErrorValue.prototype.getCode = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.Argument.ErrorValue.prototype.setCode = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.BufferValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.BufferValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.BufferValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.BufferValue.toObject = function(includeInstance, msg) { - var obj = { - data: msg.getData_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.BufferValue} - */ -proto.Argument.BufferValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.BufferValue; - return proto.Argument.BufferValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.BufferValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.BufferValue} - */ -proto.Argument.BufferValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.BufferValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.BufferValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.BufferValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.BufferValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes data = 1; - * @return {!(string|Uint8Array)} - */ -proto.Argument.BufferValue.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes data = 1; - * This is a type-conversion wrapper around `getData()` - * @return {string} - */ -proto.Argument.BufferValue.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - - -/** - * optional bytes data = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} - */ -proto.Argument.BufferValue.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.Argument.BufferValue.prototype.setData = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.ObjectValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.ObjectValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.ObjectValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ObjectValue.toObject = function(includeInstance, msg) { - var obj = { - dataMap: (f = msg.getDataMap()) ? f.toObject(includeInstance, proto.Argument.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.ObjectValue} - */ -proto.Argument.ObjectValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.ObjectValue; - return proto.Argument.ObjectValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.ObjectValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.ObjectValue} - */ -proto.Argument.ObjectValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getDataMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.Argument.deserializeBinaryFromReader, ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.ObjectValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.ObjectValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.ObjectValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ObjectValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDataMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.Argument.serializeBinaryToWriter); - } -}; - - -/** - * map data = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.Argument.ObjectValue.prototype.getDataMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - proto.Argument)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.Argument.ObjectValue.prototype.clearDataMap = function() { - this.getDataMap().clear(); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Argument.ArrayValue.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.ArrayValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.ArrayValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.ArrayValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ArrayValue.toObject = function(includeInstance, msg) { - var obj = { - dataList: jspb.Message.toObjectList(msg.getDataList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.ArrayValue} - */ -proto.Argument.ArrayValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.ArrayValue; - return proto.Argument.ArrayValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.ArrayValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.ArrayValue} - */ -proto.Argument.ArrayValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addData(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.ArrayValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.ArrayValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.ArrayValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ArrayValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDataList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Argument data = 1; - * @return {!Array} - */ -proto.Argument.ArrayValue.prototype.getDataList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 1)); -}; - - -/** @param {!Array} value */ -proto.Argument.ArrayValue.prototype.setDataList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Argument.ArrayValue.prototype.addData = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Argument.ArrayValue.prototype.clearDataList = function() { - this.setDataList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.ProxyValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.ProxyValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.ProxyValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ProxyValue.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.ProxyValue} - */ -proto.Argument.ProxyValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.ProxyValue; - return proto.Argument.ProxyValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.ProxyValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.ProxyValue} - */ -proto.Argument.ProxyValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.ProxyValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.ProxyValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.ProxyValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.ProxyValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.Argument.ProxyValue.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Argument.ProxyValue.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.FunctionValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.FunctionValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.FunctionValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.FunctionValue.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.FunctionValue} - */ -proto.Argument.FunctionValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.FunctionValue; - return proto.Argument.FunctionValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.FunctionValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.FunctionValue} - */ -proto.Argument.FunctionValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.FunctionValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.FunctionValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.FunctionValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.FunctionValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.Argument.FunctionValue.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Argument.FunctionValue.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.NullValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.NullValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.NullValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.NullValue.toObject = function(includeInstance, msg) { - var obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.NullValue} - */ -proto.Argument.NullValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.NullValue; - return proto.Argument.NullValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.NullValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.NullValue} - */ -proto.Argument.NullValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.NullValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.NullValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.NullValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.NullValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.UndefinedValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.UndefinedValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.UndefinedValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.UndefinedValue.toObject = function(includeInstance, msg) { - var obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.UndefinedValue} - */ -proto.Argument.UndefinedValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.UndefinedValue; - return proto.Argument.UndefinedValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.UndefinedValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.UndefinedValue} - */ -proto.Argument.UndefinedValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.UndefinedValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.UndefinedValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.UndefinedValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.UndefinedValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Argument.DateValue.prototype.toObject = function(opt_includeInstance) { - return proto.Argument.DateValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Argument.DateValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.DateValue.toObject = function(includeInstance, msg) { - var obj = { - date: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Argument.DateValue} - */ -proto.Argument.DateValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Argument.DateValue; - return proto.Argument.DateValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Argument.DateValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Argument.DateValue} - */ -proto.Argument.DateValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDate(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Argument.DateValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Argument.DateValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Argument.DateValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Argument.DateValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDate(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string date = 1; - * @return {string} - */ -proto.Argument.DateValue.prototype.getDate = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.Argument.DateValue.prototype.setDate = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional ErrorValue error = 1; - * @return {?proto.Argument.ErrorValue} - */ -proto.Argument.prototype.getError = function() { - return /** @type{?proto.Argument.ErrorValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.ErrorValue, 1)); -}; - - -/** @param {?proto.Argument.ErrorValue|undefined} value */ -proto.Argument.prototype.setError = function(value) { - jspb.Message.setOneofWrapperField(this, 1, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearError = function() { - this.setError(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasError = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional BufferValue buffer = 2; - * @return {?proto.Argument.BufferValue} - */ -proto.Argument.prototype.getBuffer = function() { - return /** @type{?proto.Argument.BufferValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.BufferValue, 2)); -}; - - -/** @param {?proto.Argument.BufferValue|undefined} value */ -proto.Argument.prototype.setBuffer = function(value) { - jspb.Message.setOneofWrapperField(this, 2, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearBuffer = function() { - this.setBuffer(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasBuffer = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional ObjectValue object = 3; - * @return {?proto.Argument.ObjectValue} - */ -proto.Argument.prototype.getObject = function() { - return /** @type{?proto.Argument.ObjectValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.ObjectValue, 3)); -}; - - -/** @param {?proto.Argument.ObjectValue|undefined} value */ -proto.Argument.prototype.setObject = function(value) { - jspb.Message.setOneofWrapperField(this, 3, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearObject = function() { - this.setObject(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasObject = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional ArrayValue array = 4; - * @return {?proto.Argument.ArrayValue} - */ -proto.Argument.prototype.getArray = function() { - return /** @type{?proto.Argument.ArrayValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.ArrayValue, 4)); -}; - - -/** @param {?proto.Argument.ArrayValue|undefined} value */ -proto.Argument.prototype.setArray = function(value) { - jspb.Message.setOneofWrapperField(this, 4, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearArray = function() { - this.setArray(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasArray = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional ProxyValue proxy = 5; - * @return {?proto.Argument.ProxyValue} - */ -proto.Argument.prototype.getProxy = function() { - return /** @type{?proto.Argument.ProxyValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.ProxyValue, 5)); -}; - - -/** @param {?proto.Argument.ProxyValue|undefined} value */ -proto.Argument.prototype.setProxy = function(value) { - jspb.Message.setOneofWrapperField(this, 5, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearProxy = function() { - this.setProxy(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasProxy = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional FunctionValue function = 6; - * @return {?proto.Argument.FunctionValue} - */ -proto.Argument.prototype.getFunction = function() { - return /** @type{?proto.Argument.FunctionValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.FunctionValue, 6)); -}; - - -/** @param {?proto.Argument.FunctionValue|undefined} value */ -proto.Argument.prototype.setFunction = function(value) { - jspb.Message.setOneofWrapperField(this, 6, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearFunction = function() { - this.setFunction(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasFunction = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional NullValue null = 7; - * @return {?proto.Argument.NullValue} - */ -proto.Argument.prototype.getNull = function() { - return /** @type{?proto.Argument.NullValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.NullValue, 7)); -}; - - -/** @param {?proto.Argument.NullValue|undefined} value */ -proto.Argument.prototype.setNull = function(value) { - jspb.Message.setOneofWrapperField(this, 7, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearNull = function() { - this.setNull(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasNull = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional UndefinedValue undefined = 8; - * @return {?proto.Argument.UndefinedValue} - */ -proto.Argument.prototype.getUndefined = function() { - return /** @type{?proto.Argument.UndefinedValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.UndefinedValue, 8)); -}; - - -/** @param {?proto.Argument.UndefinedValue|undefined} value */ -proto.Argument.prototype.setUndefined = function(value) { - jspb.Message.setOneofWrapperField(this, 8, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearUndefined = function() { - this.setUndefined(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasUndefined = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional double number = 9; - * @return {number} - */ -proto.Argument.prototype.getNumber = function() { - return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 9, 0.0)); -}; - - -/** @param {number} value */ -proto.Argument.prototype.setNumber = function(value) { - jspb.Message.setOneofField(this, 9, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.Argument.prototype.clearNumber = function() { - jspb.Message.setOneofField(this, 9, proto.Argument.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasNumber = function() { - return jspb.Message.getField(this, 9) != null; -}; - - -/** - * optional string string = 10; - * @return {string} - */ -proto.Argument.prototype.getString = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); -}; - - -/** @param {string} value */ -proto.Argument.prototype.setString = function(value) { - jspb.Message.setOneofField(this, 10, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.Argument.prototype.clearString = function() { - jspb.Message.setOneofField(this, 10, proto.Argument.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasString = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional bool boolean = 11; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. - * @return {boolean} - */ -proto.Argument.prototype.getBoolean = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 11, false)); -}; - - -/** @param {boolean} value */ -proto.Argument.prototype.setBoolean = function(value) { - jspb.Message.setOneofField(this, 11, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.Argument.prototype.clearBoolean = function() { - jspb.Message.setOneofField(this, 11, proto.Argument.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasBoolean = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional DateValue date = 12; - * @return {?proto.Argument.DateValue} - */ -proto.Argument.prototype.getDate = function() { - return /** @type{?proto.Argument.DateValue} */ ( - jspb.Message.getWrapperField(this, proto.Argument.DateValue, 12)); -}; - - -/** @param {?proto.Argument.DateValue|undefined} value */ -proto.Argument.prototype.setDate = function(value) { - jspb.Message.setOneofWrapperField(this, 12, proto.Argument.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Argument.prototype.clearDate = function() { - this.setDate(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Argument.prototype.hasDate = function() { - return jspb.Message.getField(this, 12) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.Method.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.Method.MsgCase = { - MSG_NOT_SET: 0, - NAMED_PROXY: 1, - NUMBERED_PROXY: 2 -}; - -/** - * @return {proto.Method.MsgCase} - */ -proto.Method.prototype.getMsgCase = function() { - return /** @type {proto.Method.MsgCase} */(jspb.Message.computeOneofCase(this, proto.Method.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Method.prototype.toObject = function(opt_includeInstance) { - return proto.Method.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Method} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.toObject = function(includeInstance, msg) { - var obj = { - namedProxy: (f = msg.getNamedProxy()) && proto.Method.Named.toObject(includeInstance, f), - numberedProxy: (f = msg.getNumberedProxy()) && proto.Method.Numbered.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Method} - */ -proto.Method.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Method; - return proto.Method.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Method} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Method} - */ -proto.Method.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.Method.Named; - reader.readMessage(value,proto.Method.Named.deserializeBinaryFromReader); - msg.setNamedProxy(value); - break; - case 2: - var value = new proto.Method.Numbered; - reader.readMessage(value,proto.Method.Numbered.deserializeBinaryFromReader); - msg.setNumberedProxy(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Method.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Method.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Method} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNamedProxy(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.Method.Named.serializeBinaryToWriter - ); - } - f = message.getNumberedProxy(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.Method.Numbered.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Method.Named.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Method.Named.prototype.toObject = function(opt_includeInstance) { - return proto.Method.Named.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Method.Named} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Named.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0), - module: jspb.Message.getFieldWithDefault(msg, 2, 0), - method: jspb.Message.getFieldWithDefault(msg, 3, ""), - argsList: jspb.Message.toObjectList(msg.getArgsList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Method.Named} - */ -proto.Method.Named.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Method.Named; - return proto.Method.Named.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Method.Named} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Method.Named} - */ -proto.Method.Named.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - case 2: - var value = /** @type {!proto.Module} */ (reader.readEnum()); - msg.setModule(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMethod(value); - break; - case 4: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addArgs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Method.Named.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Method.Named.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Method.Named} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Named.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getModule(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getMethod(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.Method.Named.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Method.Named.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional Module module = 2; - * @return {!proto.Module} - */ -proto.Method.Named.prototype.getModule = function() { - return /** @type {!proto.Module} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {!proto.Module} value */ -proto.Method.Named.prototype.setModule = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional string method = 3; - * @return {string} - */ -proto.Method.Named.prototype.getMethod = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.Method.Named.prototype.setMethod = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * repeated Argument args = 4; - * @return {!Array} - */ -proto.Method.Named.prototype.getArgsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 4)); -}; - - -/** @param {!Array} value */ -proto.Method.Named.prototype.setArgsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Method.Named.prototype.addArgs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Method.Named.prototype.clearArgsList = function() { - this.setArgsList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Method.Numbered.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Method.Numbered.prototype.toObject = function(opt_includeInstance) { - return proto.Method.Numbered.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Method.Numbered} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Numbered.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0), - proxyId: jspb.Message.getFieldWithDefault(msg, 2, 0), - method: jspb.Message.getFieldWithDefault(msg, 3, ""), - argsList: jspb.Message.toObjectList(msg.getArgsList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Method.Numbered} - */ -proto.Method.Numbered.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Method.Numbered; - return proto.Method.Numbered.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Method.Numbered} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Method.Numbered} - */ -proto.Method.Numbered.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setProxyId(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMethod(value); - break; - case 4: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addArgs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Method.Numbered.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Method.Numbered.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Method.Numbered} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Numbered.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getProxyId(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getMethod(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.Method.Numbered.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Method.Numbered.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional uint64 proxy_id = 2; - * @return {number} - */ -proto.Method.Numbered.prototype.getProxyId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {number} value */ -proto.Method.Numbered.prototype.setProxyId = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional string method = 3; - * @return {string} - */ -proto.Method.Numbered.prototype.getMethod = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.Method.Numbered.prototype.setMethod = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * repeated Argument args = 4; - * @return {!Array} - */ -proto.Method.Numbered.prototype.getArgsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 4)); -}; - - -/** @param {!Array} value */ -proto.Method.Numbered.prototype.setArgsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Method.Numbered.prototype.addArgs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Method.Numbered.prototype.clearArgsList = function() { - this.setArgsList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Method.Fail.prototype.toObject = function(opt_includeInstance) { - return proto.Method.Fail.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Method.Fail} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Fail.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0), - response: (f = msg.getResponse()) && proto.Argument.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Method.Fail} - */ -proto.Method.Fail.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Method.Fail; - return proto.Method.Fail.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Method.Fail} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Method.Fail} - */ -proto.Method.Fail.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - case 2: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.setResponse(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Method.Fail.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Method.Fail.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Method.Fail} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Fail.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getResponse(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.Method.Fail.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Method.Fail.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional Argument response = 2; - * @return {?proto.Argument} - */ -proto.Method.Fail.prototype.getResponse = function() { - return /** @type{?proto.Argument} */ ( - jspb.Message.getWrapperField(this, proto.Argument, 2)); -}; - - -/** @param {?proto.Argument|undefined} value */ -proto.Method.Fail.prototype.setResponse = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Method.Fail.prototype.clearResponse = function() { - this.setResponse(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Method.Fail.prototype.hasResponse = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Method.Success.prototype.toObject = function(opt_includeInstance) { - return proto.Method.Success.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Method.Success} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Success.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0), - response: (f = msg.getResponse()) && proto.Argument.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Method.Success} - */ -proto.Method.Success.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Method.Success; - return proto.Method.Success.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Method.Success} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Method.Success} - */ -proto.Method.Success.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - case 2: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.setResponse(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Method.Success.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Method.Success.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Method.Success} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Method.Success.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getResponse(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.Method.Success.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Method.Success.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional Argument response = 2; - * @return {?proto.Argument} - */ -proto.Method.Success.prototype.getResponse = function() { - return /** @type{?proto.Argument} */ ( - jspb.Message.getWrapperField(this, proto.Argument, 2)); -}; - - -/** @param {?proto.Argument|undefined} value */ -proto.Method.Success.prototype.setResponse = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Method.Success.prototype.clearResponse = function() { - this.setResponse(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Method.Success.prototype.hasResponse = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional Named named_proxy = 1; - * @return {?proto.Method.Named} - */ -proto.Method.prototype.getNamedProxy = function() { - return /** @type{?proto.Method.Named} */ ( - jspb.Message.getWrapperField(this, proto.Method.Named, 1)); -}; - - -/** @param {?proto.Method.Named|undefined} value */ -proto.Method.prototype.setNamedProxy = function(value) { - jspb.Message.setOneofWrapperField(this, 1, proto.Method.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Method.prototype.clearNamedProxy = function() { - this.setNamedProxy(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Method.prototype.hasNamedProxy = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional Numbered numbered_proxy = 2; - * @return {?proto.Method.Numbered} - */ -proto.Method.prototype.getNumberedProxy = function() { - return /** @type{?proto.Method.Numbered} */ ( - jspb.Message.getWrapperField(this, proto.Method.Numbered, 2)); -}; - - -/** @param {?proto.Method.Numbered|undefined} value */ -proto.Method.prototype.setNumberedProxy = function(value) { - jspb.Message.setOneofWrapperField(this, 2, proto.Method.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Method.prototype.clearNumberedProxy = function() { - this.setNumberedProxy(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Method.prototype.hasNumberedProxy = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.Callback.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.Callback.MsgCase = { - MSG_NOT_SET: 0, - NAMED_CALLBACK: 1, - NUMBERED_CALLBACK: 2 -}; - -/** - * @return {proto.Callback.MsgCase} - */ -proto.Callback.prototype.getMsgCase = function() { - return /** @type {proto.Callback.MsgCase} */(jspb.Message.computeOneofCase(this, proto.Callback.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Callback.prototype.toObject = function(opt_includeInstance) { - return proto.Callback.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Callback} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Callback.toObject = function(includeInstance, msg) { - var obj = { - namedCallback: (f = msg.getNamedCallback()) && proto.Callback.Named.toObject(includeInstance, f), - numberedCallback: (f = msg.getNumberedCallback()) && proto.Callback.Numbered.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Callback} - */ -proto.Callback.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Callback; - return proto.Callback.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Callback} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Callback} - */ -proto.Callback.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.Callback.Named; - reader.readMessage(value,proto.Callback.Named.deserializeBinaryFromReader); - msg.setNamedCallback(value); - break; - case 2: - var value = new proto.Callback.Numbered; - reader.readMessage(value,proto.Callback.Numbered.deserializeBinaryFromReader); - msg.setNumberedCallback(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Callback.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Callback.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Callback} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Callback.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNamedCallback(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.Callback.Named.serializeBinaryToWriter - ); - } - f = message.getNumberedCallback(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.Callback.Numbered.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Callback.Named.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Callback.Named.prototype.toObject = function(opt_includeInstance) { - return proto.Callback.Named.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Callback.Named} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Callback.Named.toObject = function(includeInstance, msg) { - var obj = { - module: jspb.Message.getFieldWithDefault(msg, 1, 0), - callbackId: jspb.Message.getFieldWithDefault(msg, 2, 0), - argsList: jspb.Message.toObjectList(msg.getArgsList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Callback.Named} - */ -proto.Callback.Named.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Callback.Named; - return proto.Callback.Named.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Callback.Named} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Callback.Named} - */ -proto.Callback.Named.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.Module} */ (reader.readEnum()); - msg.setModule(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setCallbackId(value); - break; - case 3: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addArgs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Callback.Named.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Callback.Named.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Callback.Named} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Callback.Named.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getModule(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getCallbackId(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Module module = 1; - * @return {!proto.Module} - */ -proto.Callback.Named.prototype.getModule = function() { - return /** @type {!proto.Module} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {!proto.Module} value */ -proto.Callback.Named.prototype.setModule = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional uint64 callback_id = 2; - * @return {number} - */ -proto.Callback.Named.prototype.getCallbackId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {number} value */ -proto.Callback.Named.prototype.setCallbackId = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * repeated Argument args = 3; - * @return {!Array} - */ -proto.Callback.Named.prototype.getArgsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); -}; - - -/** @param {!Array} value */ -proto.Callback.Named.prototype.setArgsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Callback.Named.prototype.addArgs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Callback.Named.prototype.clearArgsList = function() { - this.setArgsList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Callback.Numbered.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Callback.Numbered.prototype.toObject = function(opt_includeInstance) { - return proto.Callback.Numbered.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Callback.Numbered} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Callback.Numbered.toObject = function(includeInstance, msg) { - var obj = { - proxyId: jspb.Message.getFieldWithDefault(msg, 1, 0), - callbackId: jspb.Message.getFieldWithDefault(msg, 2, 0), - argsList: jspb.Message.toObjectList(msg.getArgsList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Callback.Numbered} - */ -proto.Callback.Numbered.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Callback.Numbered; - return proto.Callback.Numbered.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Callback.Numbered} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Callback.Numbered} - */ -proto.Callback.Numbered.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setProxyId(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setCallbackId(value); - break; - case 3: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addArgs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Callback.Numbered.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Callback.Numbered.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Callback.Numbered} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Callback.Numbered.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProxyId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getCallbackId(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 proxy_id = 1; - * @return {number} - */ -proto.Callback.Numbered.prototype.getProxyId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Callback.Numbered.prototype.setProxyId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional uint64 callback_id = 2; - * @return {number} - */ -proto.Callback.Numbered.prototype.getCallbackId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {number} value */ -proto.Callback.Numbered.prototype.setCallbackId = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * repeated Argument args = 3; - * @return {!Array} - */ -proto.Callback.Numbered.prototype.getArgsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); -}; - - -/** @param {!Array} value */ -proto.Callback.Numbered.prototype.setArgsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Callback.Numbered.prototype.addArgs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Callback.Numbered.prototype.clearArgsList = function() { - this.setArgsList([]); -}; - - -/** - * optional Named named_callback = 1; - * @return {?proto.Callback.Named} - */ -proto.Callback.prototype.getNamedCallback = function() { - return /** @type{?proto.Callback.Named} */ ( - jspb.Message.getWrapperField(this, proto.Callback.Named, 1)); -}; - - -/** @param {?proto.Callback.Named|undefined} value */ -proto.Callback.prototype.setNamedCallback = function(value) { - jspb.Message.setOneofWrapperField(this, 1, proto.Callback.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Callback.prototype.clearNamedCallback = function() { - this.setNamedCallback(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Callback.prototype.hasNamedCallback = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional Numbered numbered_callback = 2; - * @return {?proto.Callback.Numbered} - */ -proto.Callback.prototype.getNumberedCallback = function() { - return /** @type{?proto.Callback.Numbered} */ ( - jspb.Message.getWrapperField(this, proto.Callback.Numbered, 2)); -}; - - -/** @param {?proto.Callback.Numbered|undefined} value */ -proto.Callback.prototype.setNumberedCallback = function(value) { - jspb.Message.setOneofWrapperField(this, 2, proto.Callback.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Callback.prototype.clearNumberedCallback = function() { - this.setNumberedCallback(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Callback.prototype.hasNumberedCallback = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.Event.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.Event.MsgCase = { - MSG_NOT_SET: 0, - NAMED_EVENT: 1, - NUMBERED_EVENT: 2 -}; - -/** - * @return {proto.Event.MsgCase} - */ -proto.Event.prototype.getMsgCase = function() { - return /** @type {proto.Event.MsgCase} */(jspb.Message.computeOneofCase(this, proto.Event.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Event.prototype.toObject = function(opt_includeInstance) { - return proto.Event.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Event} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Event.toObject = function(includeInstance, msg) { - var obj = { - namedEvent: (f = msg.getNamedEvent()) && proto.Event.Named.toObject(includeInstance, f), - numberedEvent: (f = msg.getNumberedEvent()) && proto.Event.Numbered.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Event} - */ -proto.Event.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Event; - return proto.Event.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Event} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Event} - */ -proto.Event.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.Event.Named; - reader.readMessage(value,proto.Event.Named.deserializeBinaryFromReader); - msg.setNamedEvent(value); - break; - case 2: - var value = new proto.Event.Numbered; - reader.readMessage(value,proto.Event.Numbered.deserializeBinaryFromReader); - msg.setNumberedEvent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Event.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Event.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Event} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Event.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNamedEvent(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.Event.Named.serializeBinaryToWriter - ); - } - f = message.getNumberedEvent(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.Event.Numbered.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Event.Named.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Event.Named.prototype.toObject = function(opt_includeInstance) { - return proto.Event.Named.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Event.Named} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Event.Named.toObject = function(includeInstance, msg) { - var obj = { - module: jspb.Message.getFieldWithDefault(msg, 1, 0), - event: jspb.Message.getFieldWithDefault(msg, 2, ""), - argsList: jspb.Message.toObjectList(msg.getArgsList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Event.Named} - */ -proto.Event.Named.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Event.Named; - return proto.Event.Named.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Event.Named} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Event.Named} - */ -proto.Event.Named.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.Module} */ (reader.readEnum()); - msg.setModule(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setEvent(value); - break; - case 3: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addArgs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Event.Named.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Event.Named.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Event.Named} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Event.Named.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getModule(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getEvent(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Module module = 1; - * @return {!proto.Module} - */ -proto.Event.Named.prototype.getModule = function() { - return /** @type {!proto.Module} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {!proto.Module} value */ -proto.Event.Named.prototype.setModule = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string event = 2; - * @return {string} - */ -proto.Event.Named.prototype.getEvent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.Event.Named.prototype.setEvent = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated Argument args = 3; - * @return {!Array} - */ -proto.Event.Named.prototype.getArgsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); -}; - - -/** @param {!Array} value */ -proto.Event.Named.prototype.setArgsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Event.Named.prototype.addArgs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Event.Named.prototype.clearArgsList = function() { - this.setArgsList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.Event.Numbered.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Event.Numbered.prototype.toObject = function(opt_includeInstance) { - return proto.Event.Numbered.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Event.Numbered} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Event.Numbered.toObject = function(includeInstance, msg) { - var obj = { - proxyId: jspb.Message.getFieldWithDefault(msg, 1, 0), - event: jspb.Message.getFieldWithDefault(msg, 2, ""), - argsList: jspb.Message.toObjectList(msg.getArgsList(), - proto.Argument.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Event.Numbered} - */ -proto.Event.Numbered.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Event.Numbered; - return proto.Event.Numbered.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Event.Numbered} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Event.Numbered} - */ -proto.Event.Numbered.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setProxyId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setEvent(value); - break; - case 3: - var value = new proto.Argument; - reader.readMessage(value,proto.Argument.deserializeBinaryFromReader); - msg.addArgs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Event.Numbered.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Event.Numbered.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Event.Numbered} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Event.Numbered.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProxyId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getEvent(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.Argument.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 proxy_id = 1; - * @return {number} - */ -proto.Event.Numbered.prototype.getProxyId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.Event.Numbered.prototype.setProxyId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string event = 2; - * @return {string} - */ -proto.Event.Numbered.prototype.getEvent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.Event.Numbered.prototype.setEvent = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated Argument args = 3; - * @return {!Array} - */ -proto.Event.Numbered.prototype.getArgsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); -}; - - -/** @param {!Array} value */ -proto.Event.Numbered.prototype.setArgsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.Argument=} opt_value - * @param {number=} opt_index - * @return {!proto.Argument} - */ -proto.Event.Numbered.prototype.addArgs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.Argument, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.Event.Numbered.prototype.clearArgsList = function() { - this.setArgsList([]); -}; - - -/** - * optional Named named_event = 1; - * @return {?proto.Event.Named} - */ -proto.Event.prototype.getNamedEvent = function() { - return /** @type{?proto.Event.Named} */ ( - jspb.Message.getWrapperField(this, proto.Event.Named, 1)); -}; - - -/** @param {?proto.Event.Named|undefined} value */ -proto.Event.prototype.setNamedEvent = function(value) { - jspb.Message.setOneofWrapperField(this, 1, proto.Event.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Event.prototype.clearNamedEvent = function() { - this.setNamedEvent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Event.prototype.hasNamedEvent = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional Numbered numbered_event = 2; - * @return {?proto.Event.Numbered} - */ -proto.Event.prototype.getNumberedEvent = function() { - return /** @type{?proto.Event.Numbered} */ ( - jspb.Message.getWrapperField(this, proto.Event.Numbered, 2)); -}; - - -/** @param {?proto.Event.Numbered|undefined} value */ -proto.Event.prototype.setNumberedEvent = function(value) { - jspb.Message.setOneofWrapperField(this, 2, proto.Event.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.Event.prototype.clearNumberedEvent = function() { - this.setNumberedEvent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.Event.prototype.hasNumberedEvent = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Ping.prototype.toObject = function(opt_includeInstance) { - return proto.Ping.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Ping} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Ping.toObject = function(includeInstance, msg) { - var obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Ping} - */ -proto.Ping.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Ping; - return proto.Ping.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Ping} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Ping} - */ -proto.Ping.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Ping.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Ping.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Ping} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Ping.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.Pong.prototype.toObject = function(opt_includeInstance) { - return proto.Pong.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Pong} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Pong.toObject = function(includeInstance, msg) { - var obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Pong} - */ -proto.Pong.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.Pong; - return proto.Pong.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Pong} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Pong} - */ -proto.Pong.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.Pong.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.Pong.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Pong} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.Pong.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - -/** - * @enum {number} - */ -proto.Module = { - CHILDPROCESS: 0, - FS: 1, - NET: 2, - NODEPTY: 3, - SPDLOG: 4, - TRASH: 5 -}; - -goog.object.extend(exports, proto); diff --git a/packages/protocol/src/proto/vscode.proto b/packages/protocol/src/proto/vscode.proto deleted file mode 100644 index 3e62b65f2eac..000000000000 --- a/packages/protocol/src/proto/vscode.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -// Sent when a shared process becomes active -message SharedProcessActive { - string socket_path = 1; - string log_path = 2; -} diff --git a/packages/protocol/src/proto/vscode_pb.d.ts b/packages/protocol/src/proto/vscode_pb.d.ts deleted file mode 100644 index f2a4ff4e973d..000000000000 --- a/packages/protocol/src/proto/vscode_pb.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// package: -// file: vscode.proto - -import * as jspb from "google-protobuf"; - -export class SharedProcessActive extends jspb.Message { - getSocketPath(): string; - setSocketPath(value: string): void; - - getLogPath(): string; - setLogPath(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SharedProcessActive.AsObject; - static toObject(includeInstance: boolean, msg: SharedProcessActive): SharedProcessActive.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SharedProcessActive, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SharedProcessActive; - static deserializeBinaryFromReader(message: SharedProcessActive, reader: jspb.BinaryReader): SharedProcessActive; -} - -export namespace SharedProcessActive { - export type AsObject = { - socketPath: string, - logPath: string, - } -} - diff --git a/packages/protocol/src/proto/vscode_pb.js b/packages/protocol/src/proto/vscode_pb.js deleted file mode 100644 index e03af0fe850b..000000000000 --- a/packages/protocol/src/proto/vscode_pb.js +++ /dev/null @@ -1,188 +0,0 @@ -/** - * @fileoverview - * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.SharedProcessActive', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.SharedProcessActive = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.SharedProcessActive, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.SharedProcessActive.displayName = 'proto.SharedProcessActive'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.SharedProcessActive.prototype.toObject = function(opt_includeInstance) { - return proto.SharedProcessActive.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.SharedProcessActive} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.SharedProcessActive.toObject = function(includeInstance, msg) { - var obj = { - socketPath: jspb.Message.getFieldWithDefault(msg, 1, ""), - logPath: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.SharedProcessActive} - */ -proto.SharedProcessActive.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.SharedProcessActive; - return proto.SharedProcessActive.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.SharedProcessActive} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.SharedProcessActive} - */ -proto.SharedProcessActive.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setSocketPath(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLogPath(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.SharedProcessActive.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.SharedProcessActive.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.SharedProcessActive} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.SharedProcessActive.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSocketPath(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getLogPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string socket_path = 1; - * @return {string} - */ -proto.SharedProcessActive.prototype.getSocketPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.SharedProcessActive.prototype.setSocketPath = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string log_path = 2; - * @return {string} - */ -proto.SharedProcessActive.prototype.getLogPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.SharedProcessActive.prototype.setLogPath = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -goog.object.extend(exports, proto); diff --git a/packages/protocol/test/child_process.test.ts b/packages/protocol/test/child_process.test.ts deleted file mode 100644 index 782e92d3ce13..000000000000 --- a/packages/protocol/test/child_process.test.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { ChildProcess } from "child_process"; -import * as path from "path"; -import { Readable } from "stream"; -import * as util from "util"; -import { createClient } from "@coder/protocol/test"; -import { Module } from "../src/common/proxy"; - -describe("child_process", () => { - const client = createClient(); - const cp = client.modules[Module.ChildProcess]; - - const getStdout = async (proc: ChildProcess): Promise => { - return new Promise((r): Readable => proc.stdout!.once("data", r)) - .then((s) => s.toString()); - }; - - describe("exec", () => { - it("should get exec stdout", async () => { - await expect(util.promisify(cp.exec)("echo test", { encoding: "utf8" })) - .resolves.toEqual({ - stdout: "test\n", - stderr: "", - }); - }); - }); - - describe("spawn", () => { - it("should get spawn stdout", async () => { - const proc = cp.spawn("echo", ["test"]); - await expect(Promise.all([ - getStdout(proc), - new Promise((r): ChildProcess => proc.on("exit", r)), - ]).then((values) => values[0])).resolves.toEqual("test\n"); - }); - - it("should cat", async () => { - const proc = cp.spawn("cat", []); - expect(proc.pid).toBe(-1); - proc.stdin!.write("banana"); - await expect(getStdout(proc)).resolves.toBe("banana"); - - proc.stdin!.end(); - proc.kill(); - - expect(proc.pid).toBeGreaterThan(-1); - await new Promise((r): ChildProcess => proc.on("exit", r)); - }); - - it("should print env", async () => { - const proc = cp.spawn("env", [], { - env: { hi: "donkey" }, - }); - - await expect(getStdout(proc)).resolves.toContain("hi=donkey\n"); - }); - - it("should eval", async () => { - const proc = cp.spawn("node", ["-e", "console.log('foo')"]); - await expect(getStdout(proc)).resolves.toContain("foo"); - }); - }); - - describe("fork", () => { - it("should echo messages", async () => { - const proc = cp.fork(path.join(__dirname, "forker.js")); - - proc.send({ bananas: true }); - - await expect(new Promise((r): ChildProcess => proc.on("message", r))) - .resolves.toMatchObject({ - bananas: true, - }); - - proc.kill(); - - await new Promise((r): ChildProcess => proc.on("exit", r)); - }); - }); - - it("should dispose", (done) => { - setTimeout(() => { - client.dispose(); - done(); - }, 100); - }); - - it("should disconnect", async () => { - const client = createClient(); - const cp = client.modules[Module.ChildProcess]; - const proc = cp.fork(path.join(__dirname, "forker.js")); - const fn = jest.fn(); - proc.on("error", fn); - - proc.send({ bananas: true }); - await expect(new Promise((r): ChildProcess => proc.on("message", r))) - .resolves.toMatchObject({ - bananas: true, - }); - - client.dispose(); - expect(fn).toHaveBeenCalledWith(new Error("disconnected")); - }); -}); diff --git a/packages/protocol/test/forker.js b/packages/protocol/test/forker.js deleted file mode 100644 index f676683edb1a..000000000000 --- a/packages/protocol/test/forker.js +++ /dev/null @@ -1,3 +0,0 @@ -process.on("message", (data) => { - process.send(data); -}); diff --git a/packages/protocol/test/fs.test.ts b/packages/protocol/test/fs.test.ts deleted file mode 100644 index c8db7498045a..000000000000 --- a/packages/protocol/test/fs.test.ts +++ /dev/null @@ -1,630 +0,0 @@ -import * as nativeFs from "fs"; -import * as path from "path"; -import * as util from "util"; -import { Module } from "../src/common/proxy"; -import { createClient, Helper } from "./helpers"; - -// tslint:disable deprecation to use fs.exists - -describe("fs", () => { - const client = createClient(); - // tslint:disable-next-line no-any - const fs = client.modules[Module.Fs] as any as typeof import("fs"); - const helper = new Helper("fs"); - - beforeAll(async () => { - await helper.prepare(); - }); - - describe("access", () => { - it("should access existing file", async () => { - await expect(util.promisify(fs.access)(__filename)) - .resolves.toBeUndefined(); - }); - - it("should fail to access nonexistent file", async () => { - await expect(util.promisify(fs.access)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("append", () => { - it("should append to existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.appendFile)(file, "howdy")) - .resolves.toBeUndefined(); - expect(await util.promisify(nativeFs.readFile)(file, "utf8")) - .toEqual("howdy"); - }); - - it("should create then append to nonexistent file", async () => { - const file = helper.tmpFile(); - await expect(util.promisify(fs.appendFile)(file, "howdy")) - .resolves.toBeUndefined(); - expect(await util.promisify(nativeFs.readFile)(file, "utf8")) - .toEqual("howdy"); - }); - - it("should fail to append to file in nonexistent directory", async () => { - const file = path.join(helper.tmpFile(), "nope"); - await expect(util.promisify(fs.appendFile)(file, "howdy")) - .rejects.toThrow("ENOENT"); - expect(await util.promisify(nativeFs.exists)(file)) - .toEqual(false); - }); - }); - - describe("chmod", () => { - it("should chmod existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.chmod)(file, "755")) - .resolves.toBeUndefined(); - }); - - it("should fail to chmod nonexistent file", async () => { - await expect(util.promisify(fs.chmod)(helper.tmpFile(), "755")) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("chown", () => { - it("should chown existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(nativeFs.chown)(file, 1000, 1000)) - .resolves.toBeUndefined(); - }); - - it("should fail to chown nonexistent file", async () => { - await expect(util.promisify(fs.chown)(helper.tmpFile(), 1000, 1000)) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("close", () => { - it("should close opened file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "r"); - await expect(util.promisify(fs.close)(fd)) - .resolves.toBeUndefined(); - }); - - it("should fail to close non-opened file", async () => { - await expect(util.promisify(fs.close)(99999999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("copyFile", () => { - it("should copy existing file", async () => { - const source = await helper.createTmpFile(); - const destination = helper.tmpFile(); - await expect(util.promisify(fs.copyFile)(source, destination)) - .resolves.toBeUndefined(); - await expect(util.promisify(fs.exists)(destination)) - .resolves.toBe(true); - }); - - it("should fail to copy nonexistent file", async () => { - await expect(util.promisify(fs.copyFile)(helper.tmpFile(), helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("createWriteStream", () => { - it("should write to file", async () => { - const file = helper.tmpFile(); - const content = "howdy\nhow\nr\nu"; - const stream = fs.createWriteStream(file); - stream.on("open", (fd) => { - expect(fd).toBeDefined(); - stream.write(content); - stream.close(); - stream.end(); - }); - - await Promise.all([ - new Promise((resolve): nativeFs.WriteStream => stream.on("close", resolve)), - new Promise((resolve): nativeFs.WriteStream => stream.on("finish", resolve)), - ]); - - await expect(util.promisify(nativeFs.readFile)(file, "utf8")).resolves.toBe(content); - }); - }); - - describe("createReadStream", () => { - it("should read a file", async () => { - const file = helper.tmpFile(); - const content = "foobar"; - await util.promisify(nativeFs.writeFile)(file, content); - - const reader = fs.createReadStream(file); - - await expect(new Promise((resolve, reject): void => { - let data = ""; - reader.once("error", reject); - reader.once("end", () => resolve(data)); - reader.on("data", (d) => data += d.toString()); - })).resolves.toBe(content); - }); - - it("should pipe to a writable stream", async () => { - const source = helper.tmpFile(); - const content = "foo"; - await util.promisify(nativeFs.writeFile)(source, content); - - const destination = helper.tmpFile(); - const reader = fs.createReadStream(source); - const writer = fs.createWriteStream(destination); - - await new Promise((resolve, reject): void => { - reader.once("error", reject); - writer.once("error", reject); - writer.once("close", resolve); - reader.pipe(writer); - }); - - await expect(util.promisify(nativeFs.readFile)(destination, "utf8")).resolves.toBe(content); - }); - }); - - describe("exists", () => { - it("should output file exists", async () => { - await expect(util.promisify(fs.exists)(__filename)) - .resolves.toBe(true); - }); - - it("should output file does not exist", async () => { - await expect(util.promisify(fs.exists)(helper.tmpFile())) - .resolves.toBe(false); - }); - }); - - describe("fchmod", () => { - it("should fchmod existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "r"); - await expect(util.promisify(fs.fchmod)(fd, "755")) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to fchmod nonexistent file", async () => { - await expect(util.promisify(fs.fchmod)(2242342, "755")) - .rejects.toThrow("EBADF"); - }); - }); - - describe("fchown", () => { - it("should fchown existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "r"); - await expect(util.promisify(fs.fchown)(fd, 1000, 1000)) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to fchown nonexistent file", async () => { - await expect(util.promisify(fs.fchown)(99999, 1000, 1000)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("fdatasync", () => { - it("should fdatasync existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "r"); - await expect(util.promisify(fs.fdatasync)(fd)) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to fdatasync nonexistent file", async () => { - await expect(util.promisify(fs.fdatasync)(99999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("fstat", () => { - it("should fstat existing file", async () => { - const fd = await util.promisify(nativeFs.open)(__filename, "r"); - const stat = await util.promisify(nativeFs.fstat)(fd); - await expect(util.promisify(fs.fstat)(fd)) - .resolves.toMatchObject({ - size: stat.size, - }); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to fstat", async () => { - await expect(util.promisify(fs.fstat)(9999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("fsync", () => { - it("should fsync existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "r"); - await expect(util.promisify(fs.fsync)(fd)) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to fsync nonexistent file", async () => { - await expect(util.promisify(fs.fsync)(99999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("ftruncate", () => { - it("should ftruncate existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "w"); - await expect(util.promisify(fs.ftruncate)(fd, 1)) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to ftruncate nonexistent file", async () => { - await expect(util.promisify(fs.ftruncate)(99999, 9999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("futimes", () => { - it("should futimes existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "w"); - await expect(util.promisify(fs.futimes)(fd, 1000, 1000)) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should futimes existing file with date", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "w"); - await expect(util.promisify(fs.futimes)(fd, new Date(), new Date())) - .resolves.toBeUndefined(); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to futimes nonexistent file", async () => { - await expect(util.promisify(fs.futimes)(99999, 9999, 9999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("lchmod", () => { - it("should lchmod existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.lchmod)(file, "755")) - .resolves.toBeUndefined(); - }); - - // TODO: Doesn't fail on my system? - it("should fail to lchmod nonexistent file", async () => { - await expect(util.promisify(fs.lchmod)(helper.tmpFile(), "755")) - .resolves.toBeUndefined(); - }); - }); - - describe("lchown", () => { - it("should lchown existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.lchown)(file, 1000, 1000)) - .resolves.toBeUndefined(); - }); - - it("should fail to lchown nonexistent file", async () => { - await expect(util.promisify(fs.lchown)(helper.tmpFile(), 1000, 1000)) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("link", () => { - it("should link existing file", async () => { - const source = await helper.createTmpFile(); - const destination = helper.tmpFile(); - await expect(util.promisify(fs.link)(source, destination)) - .resolves.toBeUndefined(); - await expect(util.promisify(fs.exists)(destination)) - .resolves.toBe(true); - }); - - it("should fail to link nonexistent file", async () => { - await expect(util.promisify(fs.link)(helper.tmpFile(), helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("lstat", () => { - it("should lstat existing file", async () => { - const stat = await util.promisify(nativeFs.lstat)(__filename); - await expect(util.promisify(fs.lstat)(__filename)) - .resolves.toMatchObject({ - size: stat.size, - }); - }); - - it("should fail to lstat non-existent file", async () => { - await expect(util.promisify(fs.lstat)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("mkdir", () => { - let target: string; - it("should create nonexistent directory", async () => { - target = helper.tmpFile(); - await expect(util.promisify(fs.mkdir)(target)) - .resolves.toBeUndefined(); - }); - - it("should fail to create existing directory", async () => { - await expect(util.promisify(fs.mkdir)(target)) - .rejects.toThrow("EEXIST"); - }); - }); - - describe("mkdtemp", () => { - it("should create temp dir", async () => { - await expect(util.promisify(fs.mkdtemp)(helper.coderDir + "/")) - .resolves.toMatch(/^\/tmp\/coder\/fs\/[a-zA-Z0-9]{6}/); - }); - }); - - describe("open", () => { - it("should open existing file", async () => { - const fd = await util.promisify(fs.open)(__filename, "r"); - expect(fd).not.toBeNaN(); - await expect(util.promisify(fs.close)(fd)) - .resolves.toBeUndefined(); - }); - - it("should fail to open nonexistent file", async () => { - await expect(util.promisify(fs.open)(helper.tmpFile(), "r")) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("read", () => { - it("should read existing file", async () => { - const fd = await util.promisify(nativeFs.open)(__filename, "r"); - const stat = await util.promisify(nativeFs.fstat)(fd); - const buffer = Buffer.alloc(stat.size); - let bytesRead = 0; - let chunkSize = 2048; - while (bytesRead < stat.size) { - if ((bytesRead + chunkSize) > stat.size) { - chunkSize = stat.size - bytesRead; - } - - await util.promisify(fs.read)(fd, buffer, bytesRead, chunkSize, bytesRead); - bytesRead += chunkSize; - } - - const content = await util.promisify(nativeFs.readFile)(__filename, "utf8"); - expect(buffer.toString()).toEqual(content); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to read nonexistent file", async () => { - await expect(util.promisify(fs.read)(99999, Buffer.alloc(10), 9999, 999, 999)) - .rejects.toThrow("EBADF"); - }); - }); - - describe("readFile", () => { - it("should read existing file", async () => { - const content = await util.promisify(nativeFs.readFile)(__filename, "utf8"); - await expect(util.promisify(fs.readFile)(__filename, "utf8")) - .resolves.toEqual(content); - }); - - it("should fail to read nonexistent file", async () => { - await expect(util.promisify(fs.readFile)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("readdir", () => { - it("should read existing directory", async () => { - const paths = await util.promisify(nativeFs.readdir)(helper.coderDir); - await expect(util.promisify(fs.readdir)(helper.coderDir)) - .resolves.toEqual(paths); - }); - - it("should fail to read nonexistent directory", async () => { - await expect(util.promisify(fs.readdir)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("readlink", () => { - it("should read existing link", async () => { - const source = await helper.createTmpFile(); - const destination = helper.tmpFile(); - await util.promisify(nativeFs.symlink)(source, destination); - await expect(util.promisify(fs.readlink)(destination)) - .resolves.toBe(source); - }); - - it("should fail to read nonexistent link", async () => { - await expect(util.promisify(fs.readlink)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("realpath", () => { - it("should read real path of existing file", async () => { - const source = await helper.createTmpFile(); - const destination = helper.tmpFile(); - nativeFs.symlinkSync(source, destination); - await expect(util.promisify(fs.realpath)(destination)) - .resolves.toBe(source); - }); - - it("should fail to read real path of nonexistent file", async () => { - await expect(util.promisify(fs.realpath)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("rename", () => { - it("should rename existing file", async () => { - const source = await helper.createTmpFile(); - const destination = helper.tmpFile(); - await expect(util.promisify(fs.rename)(source, destination)) - .resolves.toBeUndefined(); - await expect(util.promisify(nativeFs.exists)(source)) - .resolves.toBe(false); - await expect(util.promisify(nativeFs.exists)(destination)) - .resolves.toBe(true); - }); - - it("should fail to rename nonexistent file", async () => { - await expect(util.promisify(fs.rename)(helper.tmpFile(), helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("rmdir", () => { - it("should rmdir existing directory", async () => { - const dir = helper.tmpFile(); - await util.promisify(nativeFs.mkdir)(dir); - await expect(util.promisify(fs.rmdir)(dir)) - .resolves.toBeUndefined(); - await expect(util.promisify(nativeFs.exists)(dir)) - .resolves.toBe(false); - }); - - it("should fail to rmdir nonexistent directory", async () => { - await expect(util.promisify(fs.rmdir)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("stat", () => { - it("should stat existing file", async () => { - const nativeStat = await util.promisify(nativeFs.stat)(__filename); - const stat = await util.promisify(fs.stat)(__filename); - expect(stat).toMatchObject({ - size: nativeStat.size, - }); - expect(typeof stat.mtime.getTime()).toBe("number"); - expect(stat.isFile()).toBe(true); - }); - - it("should stat existing folder", async () => { - const dir = helper.tmpFile(); - await util.promisify(nativeFs.mkdir)(dir); - const nativeStat = await util.promisify(nativeFs.stat)(dir); - const stat = await util.promisify(fs.stat)(dir); - expect(stat).toMatchObject({ - size: nativeStat.size, - }); - expect(stat.isDirectory()).toBe(true); - }); - - it("should fail to stat nonexistent file", async () => { - const error = await util.promisify(fs.stat)(helper.tmpFile()).catch((e) => e); - expect(error.message).toContain("ENOENT"); - expect(error.code).toBe("ENOENT"); - }); - }); - - describe("symlink", () => { - it("should symlink existing file", async () => { - const source = await helper.createTmpFile(); - const destination = helper.tmpFile(); - await expect(util.promisify(fs.symlink)(source, destination)) - .resolves.toBeUndefined(); - await expect(util.promisify(nativeFs.exists)(source)) - .resolves.toBe(true); - }); - - // TODO: Seems to be happy to do this on my system? - it("should fail to symlink nonexistent file", async () => { - await expect(util.promisify(fs.symlink)(helper.tmpFile(), helper.tmpFile())) - .resolves.toBeUndefined(); - }); - }); - - describe("truncate", () => { - it("should truncate existing file", async () => { - const file = helper.tmpFile(); - await util.promisify(nativeFs.writeFile)(file, "hiiiiii"); - await expect(util.promisify(fs.truncate)(file, 2)) - .resolves.toBeUndefined(); - await expect(util.promisify(nativeFs.readFile)(file, "utf8")) - .resolves.toBe("hi"); - }); - - it("should fail to truncate nonexistent file", async () => { - await expect(util.promisify(fs.truncate)(helper.tmpFile(), 0)) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("unlink", () => { - it("should unlink existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.unlink)(file)) - .resolves.toBeUndefined(); - await expect(util.promisify(nativeFs.exists)(file)) - .resolves.toBe(false); - }); - - it("should fail to unlink nonexistent file", async () => { - await expect(util.promisify(fs.unlink)(helper.tmpFile())) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("utimes", () => { - it("should update times on existing file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.utimes)(file, 100, 100)) - .resolves.toBeUndefined(); - }); - - it("should fail to update times on nonexistent file", async () => { - await expect(util.promisify(fs.utimes)(helper.tmpFile(), 100, 100)) - .rejects.toThrow("ENOENT"); - }); - }); - - describe("write", () => { - it("should write to existing file", async () => { - const file = await helper.createTmpFile(); - const fd = await util.promisify(nativeFs.open)(file, "w"); - await expect(util.promisify(fs.write)(fd, Buffer.from("hi"))) - .resolves.toBe(2); - await expect(util.promisify(nativeFs.readFile)(file, "utf8")) - .resolves.toBe("hi"); - await util.promisify(nativeFs.close)(fd); - }); - - it("should fail to write to nonexistent file", async () => { - await expect(util.promisify(fs.write)(100000, Buffer.from("wowow"))) - .rejects.toThrow("EBADF"); - }); - }); - - describe("writeFile", () => { - it("should write file", async () => { - const file = await helper.createTmpFile(); - await expect(util.promisify(fs.writeFile)(file, "howdy")) - .resolves.toBeUndefined(); - await expect(util.promisify(nativeFs.readFile)(file, "utf8")) - .resolves.toBe("howdy"); - }); - }); - - it("should dispose", (done) => { - setTimeout(() => { - client.dispose(); - done(); - }, 100); - }); -}); diff --git a/packages/protocol/test/helpers.ts b/packages/protocol/test/helpers.ts deleted file mode 100644 index f187dc6e0845..000000000000 --- a/packages/protocol/test/helpers.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as fs from "fs"; -import * as os from "os"; -import * as path from "path"; -import * as rimraf from "rimraf"; -import * as util from "util"; -import { IDisposable } from "@coder/disposable"; -import { Emitter } from "@coder/events"; -import { Client } from "../src/browser/client"; -import { Server, ServerOptions } from "../src/node/server"; - -// So we only make the directory once when running multiple tests. -let mkdirPromise: Promise | undefined; - -export class Helper { - private i = 0; - public coderDir: string; - private baseDir = path.join(os.tmpdir(), "coder"); - - public constructor(directoryName: string) { - if (!directoryName.trim()) { - throw new Error("no directory name"); - } - - this.coderDir = path.join(this.baseDir, directoryName); - } - - public tmpFile(): string { - return path.join(this.coderDir, `${this.i++}`); - } - - public async createTmpFile(): Promise { - const tf = this.tmpFile(); - await util.promisify(fs.writeFile)(tf, ""); - - return tf; - } - - public async prepare(): Promise { - if (!mkdirPromise) { - mkdirPromise = util.promisify(fs.mkdir)(this.baseDir).catch((error) => { - if (error.code !== "EEXIST" && error.code !== "EISDIR") { - throw error; - } - }); - } - await mkdirPromise; - await util.promisify(rimraf)(this.coderDir); - await util.promisify(fs.mkdir)(this.coderDir); - } -} - -export const createClient = (serverOptions?: ServerOptions): Client => { - const s2c = new Emitter(); - const c2s = new Emitter(); - const closeCallbacks = void>>[]; - - // tslint:disable-next-line no-unused-expression - new Server({ - close: (): void => closeCallbacks.forEach((cb) => cb()), - onDown: (_cb: () => void): void => undefined, - onUp: (_cb: () => void): void => undefined, - onClose: (cb: () => void): number => closeCallbacks.push(cb), - onMessage: (cb): IDisposable => c2s.event((d) => cb(d)), - send: (data): NodeJS.Timer => setTimeout(() => s2c.emit(data), 0), - }, serverOptions); - - const client = new Client({ - close: (): void => closeCallbacks.forEach((cb) => cb()), - onDown: (_cb: () => void): void => undefined, - onUp: (_cb: () => void): void => undefined, - onClose: (cb: () => void): number => closeCallbacks.push(cb), - onMessage: (cb): IDisposable => s2c.event((d) => cb(d)), - send: (data): NodeJS.Timer => setTimeout(() => c2s.emit(data), 0), - }); - - return client; -}; diff --git a/packages/protocol/test/index.ts b/packages/protocol/test/index.ts deleted file mode 100644 index d4e09d7b4341..000000000000 --- a/packages/protocol/test/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./helpers"; diff --git a/packages/protocol/test/net.test.ts b/packages/protocol/test/net.test.ts deleted file mode 100644 index 856e23130954..000000000000 --- a/packages/protocol/test/net.test.ts +++ /dev/null @@ -1,162 +0,0 @@ -import * as nativeNet from "net"; -import { Module } from "../src/common/proxy"; -import { createClient, Helper } from "./helpers"; - -describe("net", () => { - const client = createClient(); - const net = client.modules[Module.Net]; - const helper = new Helper("net"); - - beforeAll(async () => { - await helper.prepare(); - }); - - describe("Socket", () => { - const socketPath = helper.tmpFile(); - let server: nativeNet.Server; - - beforeAll(async () => { - await new Promise((r): void => { - server = nativeNet.createServer().listen(socketPath, r); - }); - }); - - afterAll(() => { - server.close(); - }); - - it("should fail to connect", async () => { - const socket = new net.Socket(); - - const fn = jest.fn(); - socket.on("error", fn); - - socket.connect("/tmp/t/e/s/t/d/o/e/s/n/o/t/e/x/i/s/t"); - - await new Promise((r): nativeNet.Socket => socket.on("close", r)); - - expect(fn).toHaveBeenCalledTimes(1); - }); - - it("should remove event listener", async () => { - const socket = new net.Socket(); - - const fn1 = jest.fn(); - const fn2 = jest.fn(); - - socket.on("error", fn1); - socket.on("error", fn2); - socket.off("error", fn1); - - socket.connect("/tmp/t/e/s/t/d/o/e/s/n/o/t/e/x/i/s/t"); - - await new Promise((r): nativeNet.Socket => socket.on("close", r)); - expect(fn1).toHaveBeenCalledTimes(0); - expect(fn2).toHaveBeenCalledTimes(1); - }); - - it("should connect", async () => { - await new Promise((resolve): void => { - const socket = net.createConnection(socketPath, () => { - socket.end(); - socket.addListener("close", () => { - resolve(); - }); - }); - }); - - await new Promise((resolve): void => { - const socket = new net.Socket(); - socket.connect(socketPath, () => { - socket.end(); - socket.addListener("close", () => { - resolve(); - }); - }); - }); - }); - - it("should get data", (done) => { - server.once("connection", (socket: nativeNet.Socket) => { - socket.write("hi how r u"); - }); - - const socket = net.createConnection(socketPath); - - socket.addListener("data", (data) => { - expect(data.toString()).toEqual("hi how r u"); - socket.end(); - socket.addListener("close", () => { - done(); - }); - }); - }); - - it("should send data", (done) => { - const clientSocket = net.createConnection(socketPath); - clientSocket.write(Buffer.from("bananas")); - server.once("connection", (socket: nativeNet.Socket) => { - socket.addListener("data", (data) => { - expect(data.toString()).toEqual("bananas"); - socket.end(); - clientSocket.addListener("end", () => { - done(); - }); - }); - }); - }); - }); - - describe("Server", () => { - it("should listen", (done) => { - const s = net.createServer(); - s.on("listening", () => s.close()); - s.on("close", () => done()); - s.listen(helper.tmpFile()); - }); - - it("should get connection", async () => { - let constructorListener: (() => void) | undefined; - const s = net.createServer(() => { - if (constructorListener) { - constructorListener(); - } - }); - - const socketPath = helper.tmpFile(); - s.listen(socketPath); - - await new Promise((resolve): void => { - s.on("listening", resolve); - }); - - const makeConnection = async (): Promise => { - net.createConnection(socketPath); - await Promise.all([ - new Promise((resolve): void => { - constructorListener = resolve; - }), - new Promise((resolve): void => { - s.once("connection", (socket) => { - socket.destroy(); - resolve(); - }); - }), - ]); - }; - - await makeConnection(); - await makeConnection(); - - s.close(); - await new Promise((r): nativeNet.Server => s.on("close", r)); - }); - }); - - it("should dispose", (done) => { - setTimeout(() => { - client.dispose(); - done(); - }, 100); - }); -}); diff --git a/packages/protocol/test/node-pty.test.ts b/packages/protocol/test/node-pty.test.ts deleted file mode 100644 index 62159b986e01..000000000000 --- a/packages/protocol/test/node-pty.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { IPty } from "node-pty"; -import { Module } from "../src/common/proxy"; -import { createClient } from "./helpers"; - -describe("node-pty", () => { - const client = createClient(); - const pty = client.modules[Module.NodePty]; - - /** - * Returns a function that when called returns a promise that resolves with - * the next chunk of data from the process. - */ - const promisifyData = (proc: IPty): (() => Promise) => { - // Use a persistent callback instead of creating it in the promise since - // otherwise we could lose data that comes in while no promise is listening. - let onData: (() => void) | undefined; - let buffer: string | undefined; - proc.on("data", (data) => { - // Remove everything that isn't a letter, number, or $ to avoid issues - // with ANSI escape codes printing inside the test output. - buffer = (buffer || "") + data.toString().replace(/[^a-zA-Z0-9$]/g, ""); - if (onData) { - onData(); - } - }); - - return (): Promise => new Promise((resolve): void => { - onData = (): void => { - if (typeof buffer !== "undefined") { - const data = buffer; - buffer = undefined; - onData = undefined; - resolve(data); - } - }; - onData(); - }); - }; - - it("should create shell", async () => { - // Setting the config file to something that shouldn't exist so the test - // isn't affected by custom configuration. - const proc = pty.spawn("/bin/bash", ["--rcfile", "/tmp/test/nope/should/not/exist"], { - cols: 100, - rows: 10, - }); - - const getData = promisifyData(proc); - - // Wait for [hostname@user]$ - let data = ""; - while (!data.includes("$")) { - data = await getData(); - } - - proc.kill(); - - await new Promise((resolve): void => { - proc.on("exit", resolve); - }); - }); - - it("should resize", async () => { - // Requires the `tput lines` cmd to be available. - // Setting the config file to something that shouldn't exist so the test - // isn't affected by custom configuration. - const proc = pty.spawn("/bin/bash", ["--rcfile", "/tmp/test/nope/should/not/exist"], { - cols: 10, - rows: 912, - }); - - const getData = promisifyData(proc); - - proc.write("tput lines\n"); - - let data = ""; - while (!data.includes("912")) { - data = await getData(); - } - proc.resize(10, 219); - proc.write("tput lines\n"); - - while (!data.includes("219")) { - data = await getData(); - } - - proc.kill(); - await new Promise((resolve): void => { - proc.on("exit", resolve); - }); - }); - - it("should dispose", (done) => { - setTimeout(() => { - client.dispose(); - done(); - }, 100); - }); -}); diff --git a/packages/protocol/test/server.test.ts b/packages/protocol/test/server.test.ts deleted file mode 100644 index 4749e0948b68..000000000000 --- a/packages/protocol/test/server.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { createClient } from "./helpers"; - -describe("Server", () => { - const dataDirectory = "/tmp/example"; - const workingDirectory = "/working/dir"; - const builtInExtensionsDirectory = "/tmp/example"; - const cacheDirectory = "/tmp/cache"; - const client = createClient({ - builtInExtensionsDirectory, - cacheDirectory, - dataDirectory, - workingDirectory, - }); - - it("should get init msg", async () => { - const data = await client.initData; - expect(data.dataDirectory).toEqual(dataDirectory); - expect(data.workingDirectory).toEqual(workingDirectory); - expect(data.builtInExtensionsDirectory).toEqual(builtInExtensionsDirectory); - }); -}); diff --git a/packages/protocol/test/spdlog.test.ts b/packages/protocol/test/spdlog.test.ts deleted file mode 100644 index fedf816178e6..000000000000 --- a/packages/protocol/test/spdlog.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as fs from "fs"; -import * as util from "util"; -import { Module } from "../src/common/proxy"; -import { createClient, Helper } from "./helpers"; - -describe("spdlog", () => { - const client = createClient(); - const spdlog = client.modules[Module.Spdlog]; - const helper = new Helper("spdlog"); - - beforeAll(async () => { - await helper.prepare(); - }); - - it("should log to a file", async () => { - const file = await helper.createTmpFile(); - const logger = new spdlog.RotatingLogger("test logger", file, 10000, 10); - logger.trace("trace"); - logger.debug("debug"); - logger.info("info"); - logger.warn("warn"); - logger.error("error"); - logger.critical("critical"); - logger.flush(); - await new Promise((resolve): number | NodeJS.Timer => setTimeout(resolve, 1000)); - expect(await util.promisify(fs.readFile)(file, "utf8")) - .toContain("critical"); - }); - - it("should dispose", (done) => { - setTimeout(() => { - client.dispose(); - done(); - }, 100); - }); -}); diff --git a/packages/protocol/test/trash.test.ts b/packages/protocol/test/trash.test.ts deleted file mode 100644 index 91b114617652..000000000000 --- a/packages/protocol/test/trash.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as fs from "fs"; -import * as util from "util"; -import { Module } from "../src/common/proxy"; -import { createClient, Helper } from "./helpers"; - -// tslint:disable deprecation to use fs.exists - -describe("trash", () => { - const client = createClient(); - const trash = client.modules[Module.Trash]; - const helper = new Helper("trash"); - - beforeAll(async () => { - await helper.prepare(); - }); - - it("should trash a file", async () => { - const file = await helper.createTmpFile(); - await trash.trash(file); - expect(await util.promisify(fs.exists)(file)).toBeFalsy(); - }); - - it("should dispose", (done) => { - setTimeout(() => { - client.dispose(); - done(); - }, 100); - }); -}); diff --git a/packages/protocol/test/util.test.ts b/packages/protocol/test/util.test.ts deleted file mode 100644 index 2f9514a09b08..000000000000 --- a/packages/protocol/test/util.test.ts +++ /dev/null @@ -1,101 +0,0 @@ -import * as fs from "fs"; -import * as util from "util"; -import { argumentToProto, protoToArgument } from "../src/common/util"; - -describe("Convert", () => { - it("should convert nothing", () => { - expect(protoToArgument()).toBeUndefined(); - }); - - it("should convert null", () => { - expect(protoToArgument(argumentToProto(null))).toBeNull(); - }); - - it("should convert undefined", () => { - expect(protoToArgument(argumentToProto(undefined))).toBeUndefined(); - }); - - it("should convert string", () => { - expect(protoToArgument(argumentToProto("test"))).toBe("test"); - }); - - it("should convert number", () => { - expect(protoToArgument(argumentToProto(10))).toBe(10); - }); - - it("should convert boolean", () => { - expect(protoToArgument(argumentToProto(true))).toBe(true); - expect(protoToArgument(argumentToProto(false))).toBe(false); - }); - - it("should convert error", () => { - const error = new Error("message"); - const convertedError = protoToArgument(argumentToProto(error)); - - expect(convertedError instanceof Error).toBeTruthy(); - expect(convertedError.message).toBe("message"); - }); - - it("should convert buffer", async () => { - const buffer = await util.promisify(fs.readFile)(__filename); - expect(buffer instanceof Buffer).toBeTruthy(); - - const convertedBuffer = protoToArgument(argumentToProto(buffer)); - expect(convertedBuffer instanceof Buffer).toBeTruthy(); - expect(convertedBuffer.toString()).toBe(buffer.toString()); - }); - - it("should convert proxy", () => { - let i = 0; - const proto = argumentToProto( - { onEvent: (): void => undefined }, - undefined, - () => i++, - ); - - const proxy = protoToArgument(proto, undefined, (id) => { - return { - id: `created: ${id}`, - dispose: (): Promise => Promise.resolve(), - onDone: (): Promise => Promise.resolve(), - onEvent: (): Promise => Promise.resolve(), - }; - }); - - expect(proxy.id).toBe("created: 0"); - }); - - it("should convert function", () => { - const fn = jest.fn(); - // tslint:disable-next-line no-any - const map = new Map void>(); - let i = 0; - const proto = argumentToProto( - fn, - (f) => { - map.set(i++, f); - - return i - 1; - }, - ); - - const remoteFn = protoToArgument(proto, (id, args) => { - map.get(id)!(...args); - }); - - remoteFn("a", "b", 1); - - expect(fn).toHaveBeenCalledWith("a", "b", 1); - }); - - it("should convert array", () => { - const array = ["a", "b", 1, [1, "a"], null, undefined]; - expect(protoToArgument(argumentToProto(array))).toEqual(array); - }); - - it("should convert object", () => { - const obj = { a: "test" }; - // const obj = { "a": 1, "b": [1, "a"], test: null, test2: undefined }; - expect(protoToArgument(argumentToProto(obj))).toEqual(obj); - }); -}); diff --git a/packages/protocol/yarn.lock b/packages/protocol/yarn.lock deleted file mode 100644 index b1c6879db743..000000000000 --- a/packages/protocol/yarn.lock +++ /dev/null @@ -1,831 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@sindresorhus/df@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@sindresorhus/df/-/df-1.0.1.tgz#c69b66f52f6fcdd287c807df210305dbaf78500d" - integrity sha1-xptm9S9vzdKHyAffIQMF2694UA0= - -"@sindresorhus/df@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/df/-/df-2.1.0.tgz#d208cf27e06f0bb476d14d7deccd7d726e9aa389" - integrity sha1-0gjPJ+BvC7R20U197M19cm6ao4k= - dependencies: - execa "^0.2.2" - -"@types/events@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" - integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== - -"@types/glob@*": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" - integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== - dependencies: - "@types/events" "*" - "@types/minimatch" "*" - "@types/node" "*" - -"@types/google-protobuf@^3.2.7": - version "3.2.7" - resolved "https://registry.yarnpkg.com/@types/google-protobuf/-/google-protobuf-3.2.7.tgz#9576ed5dd62cdb1c9f952522028a03b7cb2b69b5" - integrity sha512-Pb9wl5qDEwfnJeeu6Zpn5Y+waLrKETStqLZXHMGCTbkNuBBudPy4qOGN6veamyeoUBwTm2knOVeP/FlHHhhmzA== - -"@types/minimatch@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== - -"@types/node@*": - version "11.11.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.3.tgz#7c6b0f8eaf16ae530795de2ad1b85d34bf2f5c58" - integrity sha512-wp6IOGu1lxsfnrD+5mX6qwSwWuqsdkKKxTN4aQc4wByHAKZJf9/D4KXPQ1POUjEbnCP5LMggB0OEFNY9OTsMqg== - -"@types/rimraf@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e" - integrity sha512-Hm/bnWq0TCy7jmjeN5bKYij9vw5GrDFWME4IuxV08278NtU/VdGbzsBohcCUJ7+QMqmUq5hpRKB39HeQWJjztQ== - dependencies: - "@types/glob" "*" - "@types/node" "*" - -"@types/text-encoding@^0.0.35": - version "0.0.35" - resolved "https://registry.yarnpkg.com/@types/text-encoding/-/text-encoding-0.0.35.tgz#6f14474e0b232bc70c59677aadc65dcc5a99c3a9" - integrity sha512-jfo/A88XIiAweUa8np+1mPbm3h2w0s425YrI8t3wk5QxhH6UI7w517MboNVnGDeMSuoFwA8Rwmklno+FicvV4g== - -accepts@~1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -body-parser@1.18.3: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -content-disposition@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - -cross-spawn-async@^2.1.1: - version "2.2.5" - resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" - integrity sha1-hF/wwINKPe2dFg2sptOQkGuyiMw= - dependencies: - lru-cache "^4.0.0" - which "^1.2.8" - -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -dir-glob@^2.0.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" - integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== - dependencies: - path-type "^3.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-applescript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-applescript/-/escape-string-applescript-2.0.0.tgz#760bca838668e408fe5ee52ce42caf7cb46c5273" - integrity sha1-dgvKg4Zo5Aj+XuUs5CyvfLRsUnM= - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -execa@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" - integrity sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw== - dependencies: - cross-spawn "^6.0.0" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.2.2.tgz#e2ead472c2c31aad6f73f1ac956eef45e12320cb" - integrity sha1-4urUcsLDGq1vc/GslW7vReEjIMs= - dependencies: - cross-spawn-async "^2.1.1" - npm-run-path "^1.0.0" - object-assign "^4.0.1" - path-key "^1.0.0" - strip-eof "^1.0.0" - -express@^4.16.4: - version "4.16.4" - resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" - integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== - dependencies: - accepts "~1.3.5" - array-flatten "1.1.1" - body-parser "1.18.3" - content-disposition "0.5.2" - content-type "~1.0.4" - cookie "0.3.1" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.1.1" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.2" - path-to-regexp "0.1.7" - proxy-addr "~2.0.4" - qs "6.5.2" - range-parser "~1.2.0" - safe-buffer "5.1.2" - send "0.16.2" - serve-static "1.13.2" - setprototypeof "1.1.0" - statuses "~1.4.0" - type-is "~1.6.16" - utils-merge "1.0.1" - vary "~1.1.2" - -finalhandler@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" - integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.4.0" - unpipe "~1.0.0" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -glob@^7.1.2, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globby@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" - integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA= - dependencies: - array-union "^1.0.1" - dir-glob "^2.0.0" - glob "^7.1.2" - ignore "^3.3.5" - pify "^3.0.0" - slash "^1.0.0" - -google-protobuf@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.6.1.tgz#7ef58e2bea137a93cdaf5cfd5afa5f6abdd92025" - integrity sha512-SJYemeX5GjDLPnadcmCNQePQHCS4Hl5fOcI/JawqDIYFhCmrtYAjcx/oTQx/Wi8UuCuZQhfvftbmPePPAYHFtA== - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^3.3.5: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ipaddr.js@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" - integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - -lru-cache@^4.0.0: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@~2.1.18: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -mime@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -mount-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mount-point/-/mount-point-3.0.0.tgz#665cb9edebe80d110e658db56c31d0aef51a8f97" - integrity sha1-Zly57evoDREOZY21bDHQrvUaj5c= - dependencies: - "@sindresorhus/df" "^1.0.1" - pify "^2.3.0" - pinkie-promise "^2.0.1" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -npm-run-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" - integrity sha1-9cMr9ZX+ga6Sfa7FLoL4sACsPI8= - dependencies: - path-key "^1.0.0" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-map@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" - integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" - integrity sha1-XVPVeAGWRsDWiADbThRua9wqx68= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -pify@^2.2.0, pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pinkie-promise@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -proxy-addr@~2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" - integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.8.0" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rimraf@^2.2.8, rimraf@^2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -run-applescript@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-3.2.0.tgz#73fb34ce85d3de8076d511ea767c30d4fdfc918b" - integrity sha512-Ep0RsvAjnRcBX1p5vogbaBdAGu/8j/ewpvGqnQYunnLd9SM0vWcPJewPKNnWFggf0hF0pwIgwV5XK7qQ7UZ8Qg== - dependencies: - execa "^0.10.0" - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^5.5.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -send@0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.4.0" - -serve-static@1.13.2: - version "1.13.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" - integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.2" - send "0.16.2" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -text-encoding@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.7.0.tgz#f895e836e45990624086601798ea98e8f36ee643" - integrity sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA== - -trash@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/trash/-/trash-4.3.0.tgz#6ebeecdea4d666b06e389b47d135ea88e1de5075" - integrity sha512-f36TKwIaBiXm63xSrn8OTNghg5CYHBsFVJvcObMo76LRpgariuRi2CqXQHw1VzfeximD0igdGaonOG6N760BtQ== - dependencies: - escape-string-applescript "^2.0.0" - fs-extra "^0.30.0" - globby "^7.1.1" - p-map "^1.2.0" - p-try "^1.0.0" - pify "^3.0.0" - run-applescript "^3.0.0" - uuid "^3.1.0" - xdg-trashdir "^2.1.1" - -ts-protoc-gen@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/ts-protoc-gen/-/ts-protoc-gen-0.8.0.tgz#2a9a31ee8a4d4760c484f1d0c7199633afaa5e3e" - integrity sha512-LUFM4Jy3qMSVyRf5ql973cJjltS98MiCz8kPf1Rc9AC9BeLu0WJfoHLf0Tvx2cGH0jSK9BpA0o1tHQQfjeO47Q== - dependencies: - google-protobuf "^3.6.1" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - integrity sha1-nHC/2Babwdy/SGBODwS4tJzenp8= - dependencies: - os-homedir "^1.0.0" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@^3.1.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -which@^1.2.8, which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.2.tgz#3cc7462e98792f0ac679424148903ded3b9c3ad8" - integrity sha512-rfUqzvz0WxmSXtJpPMX2EeASXabOrSMk1ruMOV3JBTBjo4ac2lDjGGsbQSyxj8Odhw5fBib8ZKEjDNvgouNKYw== - dependencies: - async-limiter "~1.0.0" - -xdg-basedir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" - integrity sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I= - dependencies: - os-homedir "^1.0.0" - -xdg-trashdir@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/xdg-trashdir/-/xdg-trashdir-2.1.1.tgz#59a60aaf8e6f9240c1daed9a0944b2f514c27d8e" - integrity sha512-KcVhPaOu2ZurYNHSRTf1+ZHORkTZGCQ+u0JHN17QixRISJq4pXOnjt/lQcehvtHL5QAKhSzKgyjrcNnPdkPBHA== - dependencies: - "@sindresorhus/df" "^2.1.0" - mount-point "^3.0.0" - pify "^2.2.0" - user-home "^2.0.0" - xdg-basedir "^2.0.0" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= diff --git a/packages/requirefs/package.json b/packages/requirefs/package.json deleted file mode 100644 index bd5eddeca522..000000000000 --- a/packages/requirefs/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "requirefs", - "description": "", - "main": "src/index.ts", - "scripts": { - "benchmark": "ts-node ./test/*.bench.ts" - }, - "dependencies": { - "jszip": "2.6.0", - "path": "0.12.7", - "resolve": "1.8.1" - }, - "devDependencies": { - "@types/benchmark": "^1.0.31", - "@types/jszip": "3.1.4", - "@types/resolve": "0.0.8", - "benchmark": "^2.1.4", - "text-encoding": "0.6.4" - } -} diff --git a/packages/requirefs/src/index.ts b/packages/requirefs/src/index.ts deleted file mode 100644 index d8cae7b26ccf..000000000000 --- a/packages/requirefs/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requirefs"; diff --git a/packages/requirefs/src/requirefs.ts b/packages/requirefs/src/requirefs.ts deleted file mode 100644 index 31a343bd5ab2..000000000000 --- a/packages/requirefs/src/requirefs.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as JSZip from "jszip"; -import * as path from "path"; -import * as resolve from "resolve"; -import { Tar } from "./tarReader"; -const textDecoder = new (typeof TextDecoder === "undefined" ? require("text-encoding").TextDecoder : TextDecoder)(); - -export interface IFileReader { - exists(path: string): boolean; - read(path: string): Uint8Array; -} - -/** - * RequireFS allows users to require from a file system. - */ -export class RequireFS { - private readonly reader: IFileReader; - private readonly customModules: Map; - private readonly requireCache: Map; - private baseDir: string | undefined; - - public constructor(reader: IFileReader) { - this.reader = reader; - this.customModules = new Map(); - this.requireCache = new Map(); - } - - /** - * Add a base-directory to nest from. - */ - public basedir(path: string): void { - this.baseDir = path; - } - - /** - * Provide custom modules to the require instance. - */ - // tslint:disable-next-line:no-any - public provide(module: string, value: any): void { - if (this.customModules.has(module)) { - throw new Error("custom module has already been registered with this name"); - } - - this.customModules.set(module, value); - } - - public readFile(target: string, type?: "string"): string; - public readFile(target: string, type?: "buffer"): Buffer; - - /** - * Read a file and returns its contents. - */ - public readFile(target: string, type?: "string" | "buffer"): string | Buffer { - target = path.normalize(target); - const read = this.reader.read(target); - - return type === "string" ? textDecoder.decode(read) : Buffer.from(read); - } - - /** - * Require a path from a file system. - */ - // tslint:disable-next-line:no-any - public require(target: string): any { - target = path.normalize(target); - - return this.doRequire([target], `./${path.basename(target)}`); - } - - /** - * Do require for a caller. Needed for resolving relative paths. - */ - private doRequire(callers: string[], resolvePath: string): object { - if (this.customModules.has(resolvePath)) { - return this.customModules.get(resolvePath)!.exports; - } - - const caller = callers[callers.length - 1]; - const reader = this.reader; - - const newRelative = this.realizePath(caller, resolvePath); - if (this.requireCache.has(newRelative)) { - return this.requireCache.get(newRelative)!.exports; - } - - const module = { - exports: {}, - }; - this.requireCache.set(newRelative, module); - - const content = textDecoder.decode(reader.read(newRelative)); - if (newRelative.endsWith(".json")) { - module.exports = JSON.parse(content); - } else { - eval("'use strict'; " + content); - } - - return module.exports; - } - - /** - * Attempts to find a module from a path - */ - private realizePath(caller: string, fullRelative: string): string { - const stripPrefix = (path: string): string => { - if (path.startsWith("/")) { - path = path.substr(1); - } - if (path.endsWith("/")) { - path = path.substr(0, path.length - 1); - } - - return path; - }; - const callerDirname = path.dirname(caller); - const resolvedPath = resolve.sync(fullRelative, { - basedir: this.baseDir ? callerDirname.startsWith(this.baseDir) ? callerDirname : path.join(this.baseDir, callerDirname) : callerDirname, - extensions: [".js"], - readFileSync: (file: string): string => { - return this.readFile(stripPrefix(file)); - }, - isFile: (file: string): boolean => { - return this.reader.exists(stripPrefix(file)); - }, - }); - - return stripPrefix(resolvedPath); - } -} - -export const fromTar = (content: Uint8Array): RequireFS => { - const tar = Tar.fromUint8Array(content); - - return new RequireFS({ - exists: (path: string): boolean => { - return tar.files.has(path); - }, - read: (path: string): Uint8Array => { - const file = tar.files.get(path); - if (!file) { - throw new Error(`file "${path}" not found`); - } - - return file.read(); - }, - }); -}; - -export const fromZip = (content: Uint8Array): RequireFS => { - const zip = new JSZip(content); - - return new RequireFS({ - exists: (fsPath: string): boolean => { - const file = zip.file(fsPath); - - return typeof file !== "undefined" && file !== null; - }, - read: (fsPath: string): Uint8Array => { - const file = zip.file(fsPath); - if (!file) { - throw new Error(`file "${fsPath}" not found`); - } - - // TODO: Should refactor to allow a promise. - // tslint:disable-next-line no-any - return zip.file(fsPath).async("uint8array") as any; - }, - }); -}; diff --git a/packages/requirefs/src/tarReader.ts b/packages/requirefs/src/tarReader.ts deleted file mode 100644 index 4e403e56fcd4..000000000000 --- a/packages/requirefs/src/tarReader.ts +++ /dev/null @@ -1,279 +0,0 @@ -import * as path from "path"; -const textDecoder = new (typeof TextDecoder === "undefined" ? require("text-encoding").TextDecoder : TextDecoder)(); - -/** - * Tar represents a tar archive. - */ -export class Tar { - /** - * Return a tar object from a Uint8Array. - */ - public static fromUint8Array(array: Uint8Array): Tar { - const reader = new Reader(array); - - const tar = new Tar(); - - while (true) { - try { - const file = TarFile.fromReader(reader); - if (file) { - tar._files.set(path.normalize(file.name), file); - } - } catch (e) { - if (e.message === "EOF") { - break; - } - throw e; - } - } - - reader.unclamp(); - - return tar; - } - - private readonly _files: Map; - - private constructor() { - this._files = new Map(); - } - - public get files(): ReadonlyMap { - return this._files; - } -} - -/** - * Represents a tar files location within a reader - */ -export class TarFile { - /** - * Locate a tar file from a reader. - */ - public static fromReader(reader: Reader): TarFile | undefined { - const firstByte = reader.peek(1)[0]; - // If the first byte is nil, we know it isn't a filename - if (firstByte === 0x00) { - // The tar header is 512 bytes large. Its safe to skip here - // because we know this block is not a header - reader.skip(512); - - return undefined; - } - - let name = reader.readString(100); - - reader.skip(8); // 100->108 mode - reader.skip(8); // 108->116 uid - reader.skip(8); // 116->124 gid - - const rawSize = reader.read(12); // 124->136 size - - reader.skip(12); // 136->148 mtime - - if (reader.jump(345).readByte()) { - name = reader.jump(345).readString(155) + "/" + name; - } - - const nums: number[] = []; - rawSize.forEach((a) => nums.push(a)); - - const parseSize = (): number => { - let offset = 0; - // While 48 (ASCII value of 0), the byte is nil and considered padding. - while (offset < rawSize.length && nums[offset] === 48) { - offset++; - } - const clamp = (index: number, len: number, defaultValue: number): number => { - if (typeof index !== "number") { - return defaultValue; - } - // Coerce index to an integer. - index = ~~index; - if (index >= len) { - return len; - } - if (index >= 0) { - return index; - } - index += len; - if (index >= 0) { - return index; - } - - return 0; - }; - - // Checks for the index of the POSIX file-size terminating char. - // Falls back to GNU's tar format. If neither characters are found - // the index will default to the end of the file size buffer. - let i = nums.indexOf(32, offset); - if (i === -1) { - i = nums.indexOf(0, offset); - if (i === -1) { - i = rawSize.length - 1; - } - } - - const end = clamp(i, rawSize.length, rawSize.length - 1); - if (end === offset) { - return 0; - } - - return parseInt(textDecoder.decode(rawSize.slice(offset, end)), 8); - }; - - const size = parseSize(); - - const overflow = ((): number => { - let newSize = size; - newSize &= 511; - - return newSize && 512 - newSize; - })(); - - reader.jump(512); - const offset = reader.offset; - reader.skip(overflow + size); - reader.clamp(); - - const tarFile = new TarFile(reader, { - offset, - name, - size, - }); - - return tarFile; - } - - public constructor( - private readonly reader: Reader, - private readonly data: { - name: string; - size: number; - offset: number; - }, - ) { } - - public get name(): string { - return this.data.name; - } - - public get size(): number { - return this.data.size; - } - - /** - * Check if the file type is a file. - */ - public isFile(): boolean { - throw new Error("not implemented"); - } - - /** - * Read the file as a string. - */ - public readAsString(): string { - return textDecoder.decode(this.read()); - } - - /** - * Read the file as Uint8Array. - */ - public read(): Uint8Array { - return this.reader.jump(this.data.offset).read(this.data.size); - } -} - -/** - * Reads within a Uint8Array. - */ -export class Reader { - private array: Uint8Array; - private _offset: number; - private lastClamp: number; - - public constructor(array: Uint8Array) { - this.array = array; - this._offset = 0; - this.lastClamp = 0; - } - - public get offset(): number { - return this._offset; - } - - /** - * Skip the specified amount of bytes. - */ - public skip(amount: number): boolean { - if (this._offset + amount > this.array.length) { - throw new Error("EOF"); - } - this._offset += amount; - - return true; - } - - /** - * Clamp the reader at a position. - */ - public clamp(): void { - this.lastClamp = this._offset; - } - - /** - * Unclamp the reader. - */ - public unclamp(): void { - this.lastClamp = 0; - } - - /** - * Jump to a specific offset. - */ - public jump(offset: number): Reader { - this._offset = offset + this.lastClamp; - - return this; - } - - /** - * Peek the amount of bytes. - */ - public peek(amount: number): Uint8Array { - return this.array.slice(this.offset, this.offset + amount); - } - - /** - * Read a string. - */ - public readString(amount: number): string { - // Replacing the 0s removes all nil bytes from the str - return textDecoder.decode(this.read(amount)).replace(/\0/g, ""); - } - - /** - * Read a byte in the array. - */ - public readByte(): number { - const data = this.array[this._offset]; - this._offset++; - - return data; - } - - /** - * Read the amount of bytes. - */ - public read(amount: number): Uint8Array { - if (this._offset > this.array.length) { - throw new Error("EOF"); - } - - const data = this.array.slice(this._offset, this._offset + amount); - this._offset += amount; - - return data; - } -} diff --git a/packages/requirefs/test/.gitignore b/packages/requirefs/test/.gitignore deleted file mode 100644 index 7872892500b0..000000000000 --- a/packages/requirefs/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -!lib/node_modules -*.tar -*.zip diff --git a/packages/requirefs/test/lib/chained-1.js b/packages/requirefs/test/lib/chained-1.js deleted file mode 100644 index 751e598bb047..000000000000 --- a/packages/requirefs/test/lib/chained-1.js +++ /dev/null @@ -1 +0,0 @@ -exports = require("./chained-2"); \ No newline at end of file diff --git a/packages/requirefs/test/lib/chained-2.js b/packages/requirefs/test/lib/chained-2.js deleted file mode 100644 index 4b16fde496db..000000000000 --- a/packages/requirefs/test/lib/chained-2.js +++ /dev/null @@ -1 +0,0 @@ -exports = require("./chained-3"); \ No newline at end of file diff --git a/packages/requirefs/test/lib/chained-3.js b/packages/requirefs/test/lib/chained-3.js deleted file mode 100644 index 378c7cc337f9..000000000000 --- a/packages/requirefs/test/lib/chained-3.js +++ /dev/null @@ -1 +0,0 @@ -exports.text = "moo"; \ No newline at end of file diff --git a/packages/requirefs/test/lib/customModule.js b/packages/requirefs/test/lib/customModule.js deleted file mode 100644 index 0f71af9d3b7a..000000000000 --- a/packages/requirefs/test/lib/customModule.js +++ /dev/null @@ -1 +0,0 @@ -exports = require("donkey"); \ No newline at end of file diff --git a/packages/requirefs/test/lib/individual.js b/packages/requirefs/test/lib/individual.js deleted file mode 100644 index adde3b0f33a3..000000000000 --- a/packages/requirefs/test/lib/individual.js +++ /dev/null @@ -1 +0,0 @@ -exports.frog = "hi"; diff --git a/packages/requirefs/test/lib/nodeResolve.js b/packages/requirefs/test/lib/nodeResolve.js deleted file mode 100644 index d47fd080a784..000000000000 --- a/packages/requirefs/test/lib/nodeResolve.js +++ /dev/null @@ -1,3 +0,0 @@ -const frogger = require("frogger"); - -exports = frogger; \ No newline at end of file diff --git a/packages/requirefs/test/lib/node_modules/frogger/index.js b/packages/requirefs/test/lib/node_modules/frogger/index.js deleted file mode 100644 index dde6e307779d..000000000000 --- a/packages/requirefs/test/lib/node_modules/frogger/index.js +++ /dev/null @@ -1 +0,0 @@ -exports.banana = "potato"; \ No newline at end of file diff --git a/packages/requirefs/test/lib/scope.js b/packages/requirefs/test/lib/scope.js deleted file mode 100644 index e8fa065adb79..000000000000 --- a/packages/requirefs/test/lib/scope.js +++ /dev/null @@ -1 +0,0 @@ -exports = coder.test; \ No newline at end of file diff --git a/packages/requirefs/test/lib/subfolder.js b/packages/requirefs/test/lib/subfolder.js deleted file mode 100644 index 9106d5c638e2..000000000000 --- a/packages/requirefs/test/lib/subfolder.js +++ /dev/null @@ -1 +0,0 @@ -exports.orangeColor = require("./subfolder/oranges").orange; \ No newline at end of file diff --git a/packages/requirefs/test/lib/subfolder/goingUp.js b/packages/requirefs/test/lib/subfolder/goingUp.js deleted file mode 100644 index a98ea42834fb..000000000000 --- a/packages/requirefs/test/lib/subfolder/goingUp.js +++ /dev/null @@ -1 +0,0 @@ -exports = require("../individual"); \ No newline at end of file diff --git a/packages/requirefs/test/lib/subfolder/oranges.js b/packages/requirefs/test/lib/subfolder/oranges.js deleted file mode 100644 index ee32e8f2e190..000000000000 --- a/packages/requirefs/test/lib/subfolder/oranges.js +++ /dev/null @@ -1 +0,0 @@ -exports.orange = "blue"; \ No newline at end of file diff --git a/packages/requirefs/test/requirefs.bench.ts b/packages/requirefs/test/requirefs.bench.ts deleted file mode 100644 index 410d19821f30..000000000000 --- a/packages/requirefs/test/requirefs.bench.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as benchmark from "benchmark"; -import { performance } from "perf_hooks"; -import { TestCaseArray, isMac } from "./requirefs.util"; - -const files = [ - "./individual.js", "./chained-1", "./subfolder", - "./subfolder/goingUp", "./nodeResolve", -]; -const toBench = new TestCaseArray(); - -// Limits the amount of time taken for each test, -// but increases uncertainty. -benchmark.options.maxTime = 0.5; - -let suite = new benchmark.Suite(); -let _start = 0; -const addMany = (names: string[]): benchmark.Suite => { - for (let name of names) { - for (let file of files) { - suite = suite.add(`${name} -> ${file}`, async () => { - let rfs = await toBench.byName(name).rfs; - rfs.require(file); - }); - } - } - _start = performance.now(); - return suite; -} -// Returns mean time per operation, in microseconds (10^-6s). -const mean = (c: any): number => { - return Number((c.stats.mean * 10e+5).toFixed(5)); -}; - -// Swap out the tar command for gtar, when on MacOS. -let testNames = ["zip", "bsdtar", isMac ? "gtar" : "tar"]; -addMany(testNames).on("cycle", (event: benchmark.Event) => { - console.log(String(event.target) + ` (~${mean(event.target)} μs/op)`); -}).on("complete", () => { - const slowest = suite.filter("slowest").shift(); - const fastest = suite.filter("fastest").shift(); - console.log(`===\nFastest is ${fastest.name} with ~${mean(fastest)} μs/op`); - if (slowest.name !== fastest.name) { - console.log(`Slowest is ${slowest.name} with ~${mean(slowest)} μs/op`); - } - const d = ((performance.now() - _start)/1000).toFixed(2); - console.log(`Benchmark took ${d} s`); -}) -.run({ "async": true }); diff --git a/packages/requirefs/test/requirefs.test.ts b/packages/requirefs/test/requirefs.test.ts deleted file mode 100644 index 4446ec915c61..000000000000 --- a/packages/requirefs/test/requirefs.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { RequireFS } from "../src/requirefs"; -import { TestCaseArray, isMac } from "./requirefs.util"; - -const toTest = new TestCaseArray(); - -describe("requirefs", () => { - for (let i = 0; i < toTest.length(); i++) { - const testCase = toTest.byID(i); - if (!isMac && testCase.name === "gtar") { - break; - } - if (isMac && testCase.name === "tar") { - break; - } - - describe(testCase.name, () => { - let rfs: RequireFS; - beforeAll(async () => { - rfs = await testCase.rfs; - }); - - it("should parse individual module", () => { - expect(rfs.require("./individual.js").frog).toEqual("hi"); - }); - - it("should parse chained modules", () => { - expect(rfs.require("./chained-1").text).toEqual("moo"); - }); - - it("should parse through subfolders", () => { - expect(rfs.require("./subfolder").orangeColor).toEqual("blue"); - }); - - it("should be able to move up directories", () => { - expect(rfs.require("./subfolder/goingUp").frog).toEqual("hi"); - }); - - it("should resolve node_modules", () => { - expect(rfs.require("./nodeResolve").banana).toEqual("potato"); - }); - - it("should access global scope", () => { - // tslint:disable-next-line no-any for testing - (window as any).coder = { - test: "hi", - }; - expect(rfs.require("./scope")).toEqual("hi"); - }); - - it("should find custom module", () => { - rfs.provide("donkey", "ok"); - expect(rfs.require("./customModule")).toEqual("ok"); - }); - }); - } -}); diff --git a/packages/requirefs/test/requirefs.util.ts b/packages/requirefs/test/requirefs.util.ts deleted file mode 100644 index 91708dc83257..000000000000 --- a/packages/requirefs/test/requirefs.util.ts +++ /dev/null @@ -1,112 +0,0 @@ -import * as cp from "child_process"; -import * as path from "path"; -import * as fs from "fs"; -import * as os from "os"; -import { fromTar, RequireFS, fromZip } from "../src/requirefs"; - -export const isMac = os.platform() === "darwin"; - -/** - * Encapsulates a RequireFS Promise and the - * name of the test case it will be used in. - */ -interface TestCase { - rfs: Promise; - name: string; -} - -/** - * TestCaseArray allows tests and benchmarks to share - * test cases while limiting redundancy. - */ -export class TestCaseArray { - private cases: Array = []; - - constructor(cases?: Array) { - if (!cases) { - this.cases = TestCaseArray.defaults(); - return - } - this.cases = cases; - } - - /** - * Returns default test cases. MacOS users need to have `gtar` binary - * in order to run GNU-tar tests and benchmarks. - */ - public static defaults(): Array { - let cases: Array = [ - TestCaseArray.newCase("cd lib && zip -r ../lib.zip ./*", "lib.zip", async (c) => fromZip(c), "zip"), - TestCaseArray.newCase("cd lib && bsdtar cvf ../lib.tar ./*", "lib.tar", async (c) => fromTar(c), "bsdtar"), - ]; - if (isMac) { - const gtarInstalled: boolean = cp.execSync("which tar").length > 0; - if (gtarInstalled) { - cases.push(TestCaseArray.newCase("cd lib && gtar cvf ../lib.tar ./*", "lib.tar", async (c) => fromTar(c), "gtar")); - } else { - throw new Error("failed to setup gtar test case, gtar binary is necessary to test GNU-tar on MacOS"); - } - } else { - cases.push(TestCaseArray.newCase("cd lib && tar cvf ../lib.tar ./*", "lib.tar", async (c) => fromTar(c), "tar")); - } - return cases; - }; - - /** - * Returns a test case prepared with the provided RequireFS Promise. - * @param command Command to run immediately. For setup. - * @param targetFile File to be read and handled by prepare function. - * @param prepare Run on target file contents before test. - * @param name Test case name. - */ - public static newCase(command: string, targetFile: string, prepare: (content: Uint8Array) => Promise, name: string): TestCase { - cp.execSync(command, { cwd: __dirname }); - const content = fs.readFileSync(path.join(__dirname, targetFile)); - return { - name, - rfs: prepare(content), - }; - } - - /** - * Returns updated TestCaseArray instance, with a new test case. - * @see TestCaseArray.newCase - */ - public add(command: string, targetFile: string, prepare: (content: Uint8Array) => Promise, name: string): TestCaseArray { - this.cases.push(TestCaseArray.newCase(command, targetFile, prepare, name)); - return this; - }; - - /** - * Gets a test case by index. - * @param id Test case index. - */ - public byID(id: number): TestCase { - if (!this.cases[id]) { - if (id < 0 || id >= this.cases.length) { - throw new Error(`test case index "${id}" out of bounds`); - } - throw new Error(`test case at index "${id}" not found`); - } - return this.cases[id]; - } - - /** - * Gets a test case by name. - * @param name Test case name. - */ - public byName(name: string): TestCase { - let c = this.cases.find((c) => c.name === name); - if (!c) { - throw new Error(`test case "${name}" not found`); - } - return c; - } - - /** - * Gets the number of test cases. - */ - public length(): number { - return this.cases.length; - } -} diff --git a/packages/requirefs/yarn.lock b/packages/requirefs/yarn.lock deleted file mode 100644 index da48eeab29d8..000000000000 --- a/packages/requirefs/yarn.lock +++ /dev/null @@ -1,99 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/benchmark@^1.0.31": - version "1.0.31" - resolved "https://registry.yarnpkg.com/@types/benchmark/-/benchmark-1.0.31.tgz#2dd3514e93396f362ba5551a7c9ff0da405c1d38" - integrity sha512-F6fVNOkGEkSdo/19yWYOwVKGvzbTeWkR/XQYBKtGBQ9oGRjBN9f/L4aJI4sDcVPJO58Y1CJZN8va9V2BhrZapA== - -"@types/jszip@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/jszip/-/jszip-3.1.4.tgz#9b81e3901a6988e9459ac27abf483e6b892251af" - integrity sha512-UaVbz4buRlBEolZYrxqkrGDOypugYlbqGNrUFB4qBaexrLypTH0jyvaF5jolNy5D+5C4kKV1WJ3Yx9cn/JH8oA== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "10.11.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.3.tgz#c055536ac8a5e871701aa01914be5731539d01ee" - integrity sha512-3AvcEJAh9EMatxs+OxAlvAEs7OTy6AG94mcH1iqyVDwVVndekLxzwkWQ/Z4SDbY6GO2oyUXyWW8tQ4rENSSQVQ== - -"@types/resolve@0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" - integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== - dependencies: - "@types/node" "*" - -benchmark@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629" - integrity sha1-CfPeMckWQl1JjMLuVloOvzwqVik= - dependencies: - lodash "^4.17.4" - platform "^1.3.3" - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -jszip@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-2.6.0.tgz#7fb3e9c2f11c8a9840612db5dabbc8cf3a7534b7" - integrity sha1-f7PpwvEciphAYS212rvIzzp1NLc= - dependencies: - pako "~1.0.0" - -lodash@^4.17.4: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -pako@~1.0.0: - version "1.0.6" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" - integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== - -path-parse@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path@0.12.7: - version "0.12.7" - resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f" - integrity sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8= - dependencies: - process "^0.11.1" - util "^0.10.3" - -platform@^1.3.3: - version "1.3.5" - resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" - integrity sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q== - -process@^0.11.1: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -resolve@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== - dependencies: - path-parse "^1.0.5" - -text-encoding@0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" - integrity sha1-45mpgiV6J22uQou5KEXLcb3CbRk= - -util@^0.10.3: - version "0.10.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" - integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== - dependencies: - inherits "2.0.3" diff --git a/packages/runner/package.json b/packages/runner/package.json deleted file mode 100644 index 3ff580b40e98..000000000000 --- a/packages/runner/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@coder/runner", - "main": "src/index.ts" -} \ No newline at end of file diff --git a/packages/runner/src/index.ts b/packages/runner/src/index.ts deleted file mode 100644 index bd2b893ccbf8..000000000000 --- a/packages/runner/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./runner"; diff --git a/packages/runner/src/runner.ts b/packages/runner/src/runner.ts deleted file mode 100644 index e926b94632a6..000000000000 --- a/packages/runner/src/runner.ts +++ /dev/null @@ -1,142 +0,0 @@ -import * as cp from "child_process"; -import {field, Logger, logger, time} from "@coder/logger"; - -export interface CommandResult { - readonly exitCode: number; - readonly stdout: string; - readonly stderr: string; -} - -const execute = (command: string, args: string[] = [], options: cp.SpawnOptions, logger: Logger): Promise => { - let resolve: (result: CommandResult) => void; - const prom = new Promise((res): void => { - resolve = res; - }); - - const stdout: string[] = []; - const stderr: string[] = []; - const complete = (exitCode: number): void => { - resolve({ - stderr: stderr.join(""), - stdout: stdout.join(""), - exitCode, - }); - }; - logger.info(`Executing '${command} ${JSON.stringify(args)}'`, field("options", options)); - const proc = cp.spawn(command, args.length > 0 ? args : [], options); - proc.on("close", (code) => { - complete(code); - }); - proc.on("exit", (code) => { - complete(code!); - }); - proc.stdout.on("data", (d) => { - stdout.push(d.toString()); - logger.debug("stdio", field("stdout", d.toString())); - }); - proc.stderr.on("data", (d) => { - stderr.push(d.toString()); - logger.debug("stdio", field("stderr", d.toString())); - }); - - return prom; -}; - -// tslint:disable-next-line no-any -export type TaskFunction = (runner: Runner, ...args: any[]) => void | Promise; - -export interface Runner { - cwd: string; - - execute(command: string, args?: string[], env?: object): Promise; -} - -export interface Task { - readonly name: string; - readonly func: TaskFunction; -} - -const tasks = new Map(); -const activated = new Map>(); - -export const register = (name: string, func: TaskFunction): () => void | Promise => { - if (tasks.has(name)) { - throw new Error(`Task "${name}" already registered`); - } - - tasks.set(name, { - name, - func, - }); - - return (): void | Promise => { - return run(name); - }; -}; - -export const run = (name: string = process.argv[2]): void | Promise => { - const task = tasks.get(name); - if (!task) { - logger.error("Task not found.", field("name", name), field("available", Array.from(tasks.keys()))); - - return process.exit(1); - } - if (activated.has(name)) { - return activated.get(name); - } - let cwd: string = process.cwd(); - const log = logger.named(name); - const timer = time(Number.MAX_SAFE_INTEGER); - let outputTimer: NodeJS.Timer | undefined; - log.info("Starting..."); - const prom = task.func({ - set cwd(path: string) { - cwd = path; - }, - execute(command: string, args: string[] = [], env?: object): Promise { - const prom = execute(command, args, { - cwd, - env: env as NodeJS.ProcessEnv, - }, log); - - return prom.then((result: CommandResult) => { - if (result.exitCode != 0) { - log.error("failed", - field("exitCode", result.exitCode), - field("stdout", result.stdout), - field("stderr", result.stderr) - ); - } - - return result; - }); - }, - }, ...process.argv.slice(3)); - - if (prom) { - activated.set(name, prom); - - const doOutput = (): void => { - outputTimer = setTimeout(() => { - log.info("Still running..."); - doOutput(); - }, 60 * 1000 * 5); - }; - doOutput(); - - prom.then(() => { - if (outputTimer) { - clearTimeout(outputTimer); - } - log.info("Completed!", field("time", timer)); - }).catch((ex) => { - activated.delete(name); - log.error(`Failed: ${ex.message}`); - log.error(`Stack: ${ex.stack}`); - - return process.exit(1); - }); - } - - return prom; -}; diff --git a/packages/runner/yarn.lock b/packages/runner/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/runner/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/server/.gitignore b/packages/server/.gitignore deleted file mode 100644 index 97b40dd74519..000000000000 --- a/packages/server/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -out -cli* -!cli.ts -build -resources - -# This file is generated when the binary is created. -# We want to use the parent tsconfig so we can ignore it. -tsconfig.json diff --git a/packages/server/README.md b/packages/server/README.md deleted file mode 100644 index 708280d6d8de..000000000000 --- a/packages/server/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# server - -## Endpoints - -### `/tunnel/` - -Tunnels a TCP connection over WebSockets. Implemented for proxying connections from a remote machine locally. - -### `/ports` - -Watches for open ports. Implemented for tunneling ports on the remote server. - -### `/resource/` - -Reads files on GET. -Writes files on POST. \ No newline at end of file diff --git a/packages/server/package.json b/packages/server/package.json deleted file mode 100644 index 88e71d9d021f..000000000000 --- a/packages/server/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "server", - "main": "./out/cli.js", - "bin": "./out/cli.js", - "files": [], - "scripts": { - "start": "node --max-old-space-size=32384 --require ts-node/register --require tsconfig-paths/register src/cli.ts", - "build": "rm -rf ./out && ../../node_modules/.bin/cross-env CLI=true UV_THREADPOOL_SIZE=100 node --max-old-space-size=32384 ../../node_modules/webpack/bin/webpack.js --config ./webpack.config.js", - "build:binary": "ts-node scripts/nbin.ts" - }, - "dependencies": { - "@coder/nbin": "^1.1.2", - "commander": "^2.19.0", - "express": "^4.16.4", - "express-static-gzip": "^1.1.3", - "httpolyglot": "^0.1.2", - "mime-types": "^2.1.21", - "node-netstat": "^1.6.0", - "pem": "^1.14.1", - "promise.prototype.finally": "^3.1.0", - "safe-compare": "^1.1.4", - "ws": "^6.1.2", - "xhr2": "^0.1.4" - }, - "devDependencies": { - "@types/commander": "^2.12.2", - "@types/express": "^4.16.0", - "@types/fs-extra": "^5.0.4", - "@types/mime-types": "^2.1.0", - "@types/opn": "^5.1.0", - "@types/pem": "^1.9.4", - "@types/safe-compare": "^1.1.0", - "@types/ws": "^6.0.1", - "fs-extra": "^7.0.1", - "opn": "^5.4.0", - "string-replace-webpack-plugin": "^0.1.3", - "ts-node": "^7.0.1", - "tsconfig-paths": "^3.7.0", - "typescript": "^3.2.2" - } -} diff --git a/packages/server/scripts/nbin.ts b/packages/server/scripts/nbin.ts deleted file mode 100644 index bbc76ba13e6a..000000000000 --- a/packages/server/scripts/nbin.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Binary } from "@coder/nbin"; -import * as fs from "fs"; -import * as os from "os"; -import * as path from "path"; -import { platform } from "../../../build/platform"; - -const target = `${platform()}-${os.arch()}`; -const rootDir = path.join(__dirname, ".."); -const bin = new Binary({ - mainFile: path.join(rootDir, "out", "cli.js"), - target: platform() === "darwin" ? "darwin" : platform() === "musl" ? "alpine" : "linux", -}); -bin.writeFiles(path.join(rootDir, "build", "**")); -bin.writeFiles(path.join(rootDir, "out", "**")); -[ - // Native modules. These are marked as externals in the webpack config. - "spdlog", - "node-pty", - - // These are spdlog's dependencies. - "mkdirp", "bindings", -].forEach((name) => { - bin.writeModule(path.join(__dirname, "../../../node_modules", name)); -}); -bin.build().then((binaryData) => { - const outputPath = path.join(__dirname, "..", `cli-${target}`); - fs.writeFileSync(outputPath, binaryData); - fs.chmodSync(outputPath, "755"); -}).catch((ex) => { - // tslint:disable-next-line:no-console - console.error(ex); - process.exit(1); -}); diff --git a/packages/server/src/cli.ts b/packages/server/src/cli.ts deleted file mode 100644 index 41ca803c0e2d..000000000000 --- a/packages/server/src/cli.ts +++ /dev/null @@ -1,330 +0,0 @@ -import { field, logger } from "@coder/logger"; -import { ServerMessage, SharedProcessActive } from "@coder/protocol/src/proto"; -import { withEnv } from "@coder/protocol"; -import { ChildProcess, fork, ForkOptions } from "child_process"; -import { randomFillSync } from "crypto"; -import * as fs from "fs"; -import * as fse from "fs-extra"; -import * as os from "os"; -import * as path from "path"; -import * as WebSocket from "ws"; -import { buildDir, cacheHome, dataHome, isCli, serveStatic } from "./constants"; -import { createApp } from "./server"; -import { forkModule, requireModule } from "./vscode/bootstrapFork"; -import { SharedProcess, SharedProcessState } from "./vscode/sharedProcess"; -import opn = require("opn"); - -import * as commander from "commander"; - -commander.version(process.env.VERSION || "development") - .name("code-server") - .description("Run VS Code on a remote server.") - .option("--cert ") - .option("--cert-key ") - .option("-e, --extensions-dir

", "Set the root path for extensions.") - .option("-d --user-data-dir ", " Specifies the directory that user data is kept in, useful when running as root.") - .option("--data-dir ", "DEPRECATED: Use '--user-data-dir' instead. Customize where user-data is stored.") - .option("-h, --host ", "Customize the hostname.", "0.0.0.0") - .option("-o, --open", "Open in the browser on startup.", false) - .option("-p, --port ", "Port to bind on.", parseInt(process.env.PORT!, 10) || 8443) - .option("-N, --no-auth", "Start without requiring authentication.", false) - .option("-H, --allow-http", "Allow http connections.", false) - .option("-P, --password ", "DEPRECATED: Use the PASSWORD environment variable instead. Specify a password for authentication.") - .option("--disable-telemetry", "Disables ALL telemetry.", false) - .option("--socket ", "Listen on a UNIX socket. Host and port will be ignored when set.") - .option("--install-extension ", "Install an extension by its ID.") - .option("--bootstrap-fork ", "Used for development. Never set.") - .option("--extra-args ", "Used for development. Never set.") - .arguments("Specify working directory.") - .parse(process.argv); - -Error.stackTraceLimit = Infinity; -if (isCli) { - require("nbin").shimNativeFs(buildDir); - require("nbin").shimNativeFs("/node_modules"); -} -// Makes strings or numbers bold in stdout -const bold = (text: string | number): string | number => { - return `\u001B[1m${text}\u001B[0m`; -}; - -(async (): Promise => { - const args = commander.args; - const options = commander.opts() as { - noAuth: boolean; - readonly allowHttp: boolean; - readonly host: string; - readonly port: number; - readonly disableTelemetry: boolean; - - readonly userDataDir?: string; - readonly extensionsDir?: string; - - readonly dataDir?: string; - readonly password?: string; - readonly open?: boolean; - readonly cert?: string; - readonly certKey?: string; - readonly socket?: string; - - readonly installExtension?: string; - - readonly bootstrapFork?: string; - readonly extraArgs?: string; - }; - - if (options.disableTelemetry) { - process.env.DISABLE_TELEMETRY = "true"; - } - - // Commander has an exception for `--no` prefixes. Here we'll adjust that. - // tslint:disable-next-line:no-any - const noAuthValue = (commander as any).auth; - options.noAuth = !noAuthValue; - - const dataDir = path.resolve(options.userDataDir || options.dataDir || path.join(dataHome, "code-server")); - const extensionsDir = options.extensionsDir ? path.resolve(options.extensionsDir) : path.resolve(dataDir, "extensions"); - const workingDir = path.resolve(args[0] || process.cwd()); - const dependenciesDir = path.join(os.tmpdir(), "code-server/dependencies"); - - if (!fs.existsSync(dataDir)) { - const oldDataDir = path.resolve(path.join(os.homedir(), ".code-server")); - if (fs.existsSync(oldDataDir)) { - await fse.move(oldDataDir, dataDir); - logger.info(`Moved data directory from ${oldDataDir} to ${dataDir}`); - } - } - - await Promise.all([ - fse.mkdirp(cacheHome), - fse.mkdirp(dataDir), - fse.mkdirp(extensionsDir), - fse.mkdirp(workingDir), - fse.mkdirp(dependenciesDir), - ]); - - const unpackExecutable = (binaryName: string): void => { - const memFile = path.join(isCli ? buildDir! : path.join(__dirname, ".."), "build/dependencies", binaryName); - const diskFile = path.join(dependenciesDir, binaryName); - if (!fse.existsSync(diskFile)) { - fse.writeFileSync(diskFile, fse.readFileSync(memFile)); - } - fse.chmodSync(diskFile, "755"); - }; - - unpackExecutable("rg"); - // tslint:disable-next-line no-any - (global).RIPGREP_LOCATION = path.join(dependenciesDir, "rg"); - - const builtInExtensionsDir = path.resolve(buildDir || path.join(__dirname, ".."), "build/extensions"); - if (options.bootstrapFork) { - const modulePath = options.bootstrapFork; - if (!modulePath) { - logger.error("No module path specified to fork!"); - process.exit(1); - } - - process.argv = [ - process.argv[0], - process.argv[1], - ...(options.extraArgs ? JSON.parse(options.extraArgs) : []), - ]; - - return requireModule(modulePath, builtInExtensionsDir); - } - - const logDir = path.join(cacheHome, "code-server/logs", new Date().toISOString().replace(/[-:.TZ]/g, "")); - process.env.VSCODE_LOGS = logDir; - - const certPath = options.cert ? path.resolve(options.cert) : undefined; - const certKeyPath = options.certKey ? path.resolve(options.certKey) : undefined; - - if (certPath && !certKeyPath) { - logger.error("'--cert-key' flag is required when specifying a certificate!"); - process.exit(1); - } - - if (!certPath && certKeyPath) { - logger.error("'--cert' flag is required when specifying certificate key!"); - process.exit(1); - } - - let certData: Buffer | undefined; - let certKeyData: Buffer | undefined; - - if (typeof certPath !== "undefined" && typeof certKeyPath !== "undefined") { - try { - certData = fs.readFileSync(certPath); - } catch (ex) { - logger.error(`Failed to read certificate: ${ex.message}`); - process.exit(1); - } - - try { - certKeyData = fs.readFileSync(certKeyPath); - } catch (ex) { - logger.error(`Failed to read certificate key: ${ex.message}`); - process.exit(1); - } - } - - logger.info(`\u001B[1mcode-server ${process.env.VERSION ? `v${process.env.VERSION}` : "development"}`); - - if (options.dataDir) { - logger.warn('"--data-dir" is deprecated. Use "--user-data-dir" instead.'); - } - - if (options.installExtension) { - const fork = forkModule("vs/code/node/cli", [ - "--user-data-dir", dataDir, - "--builtin-extensions-dir", builtInExtensionsDir, - "--extensions-dir", extensionsDir, - "--install-extension", options.installExtension, - ], withEnv({ env: { VSCODE_ALLOW_IO: "true" } }), dataDir); - - fork.stdout.on("data", (d: Buffer) => d.toString().split("\n").forEach((l) => logger.info(l))); - fork.stderr.on("data", (d: Buffer) => d.toString().split("\n").forEach((l) => logger.error(l))); - fork.on("exit", () => process.exit()); - - return; - } - - // TODO: fill in appropriate doc url - logger.info("Additional documentation: http://github.com/cdr/code-server"); - logger.info("Initializing", field("data-dir", dataDir), field("extensions-dir", extensionsDir), field("working-dir", workingDir), field("log-dir", logDir)); - const sharedProcess = new SharedProcess(dataDir, extensionsDir, builtInExtensionsDir); - const sendSharedProcessReady = (socket: WebSocket): void => { - const active = new SharedProcessActive(); - active.setSocketPath(sharedProcess.socketPath); - active.setLogPath(logDir); - const serverMessage = new ServerMessage(); - serverMessage.setSharedProcessActive(active); - socket.send(serverMessage.serializeBinary()); - }; - sharedProcess.onState((event) => { - if (event.state === SharedProcessState.Ready) { - app.wss.clients.forEach((c) => sendSharedProcessReady(c)); - } - }); - - if (options.password) { - logger.warn('"--password" is deprecated. Use the PASSWORD environment variable instead.'); - } - - let password = options.password || process.env.PASSWORD; - const usingCustomPassword = !!password; - if (!password) { - // Generate a random password with a length of 24. - const buffer = Buffer.alloc(12); - randomFillSync(buffer); - password = buffer.toString("hex"); - } - - const hasCustomHttps = certData && certKeyData; - const app = await createApp({ - allowHttp: options.allowHttp, - bypassAuth: options.noAuth, - registerMiddleware: (app): void => { - // If we're not running from the binary and we aren't serving the static - // pre-built version, use webpack to serve the web files. - if (!isCli && !serveStatic) { - const webpackConfig = require(path.resolve(__dirname, "..", "..", "web", "webpack.config.js")); - const compiler = require("webpack")(webpackConfig); - app.use(require("webpack-dev-middleware")(compiler, { - logger: { - trace: (m: string): void => logger.trace("webpack", field("message", m)), - debug: (m: string): void => logger.debug("webpack", field("message", m)), - info: (m: string): void => logger.info("webpack", field("message", m)), - warn: (m: string): void => logger.warn("webpack", field("message", m)), - error: (m: string): void => logger.error("webpack", field("message", m)), - }, - publicPath: webpackConfig.output.publicPath, - stats: webpackConfig.stats, - })); - app.use(require("webpack-hot-middleware")(compiler)); - } - }, - serverOptions: { - extensionsDirectory: extensionsDir, - builtInExtensionsDirectory: builtInExtensionsDir, - dataDirectory: dataDir, - workingDirectory: workingDir, - cacheDirectory: cacheHome, - fork: (modulePath: string, args?: string[], options?: ForkOptions): ChildProcess => { - if (options && options.env && options.env.AMD_ENTRYPOINT) { - return forkModule(options.env.AMD_ENTRYPOINT, args, options, dataDir); - } - - return fork(modulePath, args, options); - }, - }, - password, - httpsOptions: hasCustomHttps ? { - key: certKeyData, - cert: certData, - } : undefined, - }); - - logger.info("Starting webserver...", field("host", options.host), field("port", options.port)); - if (options.socket) { - app.server.listen(options.socket); - } else { - app.server.listen(options.port, options.host); - } - let clientId = 1; - app.wss.on("connection", (ws, req) => { - const id = clientId++; - - if (sharedProcess.state === SharedProcessState.Ready) { - sendSharedProcessReady(ws); - } - - logger.info(`WebSocket opened \u001B[0m${req.url}`, field("client", id), field("ip", req.socket.remoteAddress)); - - ws.on("close", (code) => { - logger.info(`WebSocket closed \u001B[0m${req.url}`, field("client", id), field("code", code)); - }); - }); - app.wss.on("error", (err: NodeJS.ErrnoException) => { - if (err.code === "EADDRINUSE") { - if (options.socket) { - logger.error(`Socket ${bold(options.socket)} is in use. Please specify a different socket.`); - } else { - logger.error(`Port ${bold(options.port)} is in use. Please free up port ${options.port} or specify a different port with the -p flag`); - } - process.exit(1); - } - }); - if (!options.certKey && !options.cert) { - logger.warn("No certificate specified. \u001B[1mThis could be insecure."); - // TODO: fill in appropriate doc url - logger.warn("Documentation on securing your setup: https://github.com/cdr/code-server/blob/master/doc/security/ssl.md"); - } - - if (!options.noAuth && !usingCustomPassword) { - logger.info(" "); - logger.info(`Password:\u001B[1m ${password}`); - } else { - logger.warn("Launched without authentication."); - } - if (options.disableTelemetry) { - logger.info("Telemetry is disabled"); - } - - const protocol = options.allowHttp ? "http" : "https"; - const url = `${protocol}://localhost:${options.port}/`; - logger.info(" "); - logger.info("Started (click the link below to open):"); - logger.info(url); - logger.info(" "); - - if (options.open) { - try { - await opn(url); - } catch (e) { - logger.warn("Url couldn't be opened automatically.", field("url", url), field("exception", e)); - } - } -})().catch((ex) => { - logger.error(ex); -}); diff --git a/packages/server/src/constants.ts b/packages/server/src/constants.ts deleted file mode 100644 index da7618010563..000000000000 --- a/packages/server/src/constants.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as path from "path"; -import * as os from "os"; - -export const isCli = typeof process.env.CLI !== "undefined" && process.env.CLI !== "false"; -export const serveStatic = typeof process.env.SERVE_STATIC !== "undefined" && process.env.SERVE_STATIC !== "false"; -export const buildDir = process.env.BUILD_DIR ? path.resolve(process.env.BUILD_DIR) : ""; -const xdgResolve = (primary: string | undefined, fallback: string): string => { - return primary ? path.resolve(primary) : path.resolve(process.env.HOME || os.homedir(), fallback); -}; -export const dataHome = xdgResolve(process.env.XDG_DATA_HOME, ".local/share"); -export const cacheHome = xdgResolve(process.env.XDG_CACHE_HOME, ".cache"); diff --git a/packages/server/src/ipc.ts b/packages/server/src/ipc.ts deleted file mode 100644 index b5732a9c55fa..000000000000 --- a/packages/server/src/ipc.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { EventEmitter } from "events"; -import { ChildProcess } from "child_process"; - -export interface IpcMessage { - readonly event: string; - readonly args: any[]; // tslint:disable-line no-any -} - -export class StdioIpcHandler extends EventEmitter { - private isListening: boolean = false; - - public constructor( - private readonly childProcess?: ChildProcess, - ) { - super(); - } - - // tslint:disable-next-line no-any - public on(event: string, cb: (...args: any[]) => void): this { - this.listen(); - - return super.on(event, cb); - } - - // tslint:disable-next-line no-any - public once(event: string, cb: (...args: any[]) => void): this { - this.listen(); - - return super.once(event, cb); - } - - // tslint:disable-next-line no-any - public addListener(event: string, cb: (...args: any[]) => void): this { - this.listen(); - - return super.addListener(event, cb); - } - - // tslint:disable-next-line no-any - public send(event: string, ...args: any[]): void { - const msg: IpcMessage = { - event, - args, - }; - const d = JSON.stringify(msg); - if (this.childProcess) { - this.childProcess.stdin.write(d + "\n"); - } else { - process.stdout.write(d); - } - } - - private listen(): void { - if (this.isListening) { - return; - } - // tslint:disable-next-line no-any - const onData = (data: any): void => { - try { - const d = JSON.parse(data.toString()) as IpcMessage; - this.emit(d.event, ...d.args); - } catch (ex) { - if (!this.childProcess) { - process.stderr.write(`Failed to parse incoming data: ${ex.message}`); - } - } - }; - if (this.childProcess) { - this.childProcess.stdout.resume(); - this.childProcess.stdout.on("data", onData); - } else { - process.stdin.resume(); - process.stdin.on("data", onData); - } - } -} diff --git a/packages/server/src/portScanner.ts b/packages/server/src/portScanner.ts deleted file mode 100644 index da0be62911cf..000000000000 --- a/packages/server/src/portScanner.ts +++ /dev/null @@ -1,113 +0,0 @@ -//@ts-ignore -import * as netstat from "node-netstat"; -import { Event, Emitter } from "@coder/events"; -import { logger } from "@coder/logger"; - -export interface PortScanner { - readonly ports: ReadonlyArray; - - readonly onAdded: Event>; - readonly onRemoved: Event>; - - dispose(): void; -} - -/** - * Creates a disposable port scanner. - * Will scan local ports and emit events when ports are added or removed. - * Currently only scans TCP ports. - */ -export const createPortScanner = (scanInterval: number = 5000): PortScanner => { - const ports = new Map(); - - const addEmitter = new Emitter(); - const removeEmitter = new Emitter(); - - const scan = (onCompleted: (err?: Error) => void): void => { - const scanTime = Date.now(); - const added: number[] = []; - netstat({ - done: (err: Error): void => { - const removed: number[] = []; - ports.forEach((value, key) => { - if (value !== scanTime) { - // Remove port - removed.push(key); - ports.delete(key); - } - }); - if (removed.length > 0) { - removeEmitter.emit(removed); - } - - if (added.length > 0) { - addEmitter.emit(added); - } - - onCompleted(err); - }, - filter: { - state: "LISTEN", - }, - }, (data: { - readonly protocol: string; - readonly local: { - readonly port: number; - readonly address: string; - }; - }) => { - // https://en.wikipedia.org/wiki/Registered_port - if (data.local.port <= 1023 || data.local.port >= 49151) { - return; - } - // Only forward TCP ports - if (!data.protocol.startsWith("tcp")) { - return; - } - - if (!ports.has(data.local.port)) { - added.push(data.local.port); - } - ports.set(data.local.port, scanTime); - }); - }; - - let lastTimeout: NodeJS.Timer | undefined; - let disposed: boolean = false; - - const doInterval = (): void => { - logger.trace("scanning ports"); - scan((error) => { - if (error) { - if ((error as NodeJS.ErrnoException).code === "ENOENT") { - logger.warn("Port scanning will not be available because netstat is not installed"); - } else { - logger.warn(`Port scanning will not be available: ${error.message}`); - } - disposed = true; - } else if (!disposed) { - lastTimeout = setTimeout(doInterval, scanInterval); - } - }); - }; - - doInterval(); - - return { - get ports(): number[] { - return Array.from(ports.keys()); - }, - get onAdded(): Event { - return addEmitter.event; - }, - get onRemoved(): Event { - return removeEmitter.event; - }, - dispose(): void { - if (typeof lastTimeout !== "undefined") { - clearTimeout(lastTimeout); - } - disposed = true; - }, - }; -}; diff --git a/packages/server/src/server.ts b/packages/server/src/server.ts deleted file mode 100644 index b7d9a12cdbee..000000000000 --- a/packages/server/src/server.ts +++ /dev/null @@ -1,335 +0,0 @@ -import { field, logger } from "@coder/logger"; -import { ReadWriteConnection } from "@coder/protocol"; -import { Server, ServerOptions } from "@coder/protocol/src/node/server"; -import { TunnelCloseCode } from "@coder/tunnel/src/common"; -import { handle as handleTunnel } from "@coder/tunnel/src/server"; -import * as express from "express"; -//@ts-ignore -import * as expressStaticGzip from "express-static-gzip"; -import * as fs from "fs"; -import { mkdirp } from "fs-extra"; -import * as http from "http"; -//@ts-ignore -import * as httpolyglot from "httpolyglot"; -import * as https from "https"; -import * as mime from "mime-types"; -import * as net from "net"; -import * as os from "os"; -import * as path from "path"; -import * as pem from "pem"; -import * as util from "util"; -import * as url from "url"; -import * as ws from "ws"; -import { buildDir } from "./constants"; -import { createPortScanner } from "./portScanner"; -import safeCompare = require("safe-compare"); - -interface CreateAppOptions { - registerMiddleware?: (app: express.Application) => void; - serverOptions?: ServerOptions; - password?: string; - httpsOptions?: https.ServerOptions; - allowHttp?: boolean; - bypassAuth?: boolean; -} - -export const createApp = async (options: CreateAppOptions): Promise<{ - readonly express: express.Application; - readonly server: http.Server; - readonly wss: ws.Server; -}> => { - const parseCookies = (req: http.IncomingMessage): { [key: string]: string } => { - const cookies: { [key: string]: string } = {}; - const rc = req.headers.cookie; - if (rc) { - rc.split(";").forEach((cook) => { - const parts = cook.split("="); - cookies[parts.shift()!.trim()] = decodeURI(parts.join("=")); - }); - } - - return cookies; - }; - - const ensureAuthed = (req: http.IncomingMessage, res: express.Response): boolean => { - if (!isAuthed(req)) { - res.status(401); - res.end(); - - return false; - } - - return true; - }; - - const isAuthed = (req: http.IncomingMessage): boolean => { - try { - if (!options.password || options.bypassAuth) { - return true; - } - - // Try/catch placed here just in case - const cookies = parseCookies(req); - if (cookies.password && safeCompare(cookies.password, options.password)) { - return true; - } - } catch (ex) { - logger.error("Failed to parse cookies", field("error", ex)); - } - - return false; - }; - - const isEncrypted = (socket: net.Socket): boolean => { - if (options.bypassAuth) { - return true; - } - - // tslint:disable-next-line:no-any - return (socket as any).encrypted; - }; - - const app = express(); - if (options.registerMiddleware) { - options.registerMiddleware(app); - } - - interface CertificateInfo { - readonly key: string; - // tslint:disable-next-line:no-any - readonly cert: any; - } - - const certs = await new Promise(async (resolve, reject): Promise => { - const selfSignedKeyPath = path.join(options.serverOptions!.dataDirectory, "self-signed.key"); - const selfSignedCertPath = path.join(options.serverOptions!.dataDirectory, "self-signed.cert"); - - if (!fs.existsSync(selfSignedKeyPath) || !fs.existsSync(selfSignedCertPath)) { - try { - const certs = await new Promise((res, rej): void => { - pem.createCertificate({ - selfSigned: true, - }, (err, result) => { - if (err) { - rej(err); - - return; - } - - res(result); - }); - }); - - fs.writeFileSync(selfSignedKeyPath, certs.serviceKey); - fs.writeFileSync(selfSignedCertPath, certs.certificate); - } catch (ex) { - return reject(ex); - } - } - - resolve({ - cert: fs.readFileSync(selfSignedCertPath).toString(), - key: fs.readFileSync(selfSignedKeyPath).toString(), - }); - }); - - const server = httpolyglot.createServer(options.allowHttp ? {} : options.httpsOptions || certs, app) as http.Server; - const wss = new ws.Server({ server }); - - wss.shouldHandle = (req): boolean => { - return isAuthed(req); - }; - - const portScanner = createPortScanner(); - wss.on("connection", async (ws, req) => { - if (req.url && req.url.startsWith("/tunnel")) { - try { - const rawPort = req.url.split("/").pop(); - const port = Number.parseInt(rawPort!, 10); - - await handleTunnel(ws, port); - } catch (ex) { - ws.close(TunnelCloseCode.Error, ex.toString()); - } - - return; - } - - if (req.url && req.url.startsWith("/ports")) { - const onAdded = portScanner.onAdded((added) => ws.send(JSON.stringify({ added }))); - const onRemoved = portScanner.onRemoved((removed) => ws.send(JSON.stringify({ removed }))); - ws.on("close", () => { - onAdded.dispose(); - onRemoved.dispose(); - }); - - return ws.send(JSON.stringify({ ports: portScanner.ports })); - } - - const connection: ReadWriteConnection = { - onMessage: (cb): void => { - ws.addEventListener("message", (event) => cb(event.data)); - }, - close: (): void => ws.close(), - send: (data): void => { - if (ws.readyState !== ws.OPEN) { - return; - } - try { - ws.send(data); - } catch (error) { - logger.error(error.message); - } - }, - onUp: (): void => undefined, // This can't come back up. - onDown: (cb): void => ws.addEventListener("close", () => cb()), - onClose: (cb): void => ws.addEventListener("close", () => cb()), - }; - - // tslint:disable-next-line no-unused-expression - new Server(connection, options.serverOptions); - }); - - const redirect = ( - req: express.Request, res: express.Response, - to: string = "", from: string = "", - code: number = 302, protocol: string = req.protocol, - ): void => { - const currentUrl = `${protocol}://${req.headers.host}${req.originalUrl}`; - const newUrl = url.parse(currentUrl); - if (from && newUrl.pathname) { - newUrl.pathname = newUrl.pathname.replace(new RegExp(`\/${from}\/?$`), "/"); - } - if (to) { - newUrl.pathname = (newUrl.pathname || "").replace(/\/$/, "") + `/${to}`; - } - newUrl.path = undefined; // Path is not necessary for format(). - const newUrlString = url.format(newUrl); - logger.trace(`Redirecting from ${currentUrl} to ${newUrlString}`); - - return res.redirect(code, newUrlString); - }; - - const baseDir = buildDir || path.join(__dirname, ".."); - const staticGzip = expressStaticGzip(path.join(baseDir, "build/web")); - - app.use((req, res, next) => { - logger.trace(`\u001B[1m${req.method} ${res.statusCode} \u001B[0m${req.originalUrl}`, field("host", req.hostname), field("ip", req.ip)); - - // Force HTTPS unless allowing HTTP. - if (!isEncrypted(req.socket) && !options.allowHttp) { - return redirect(req, res, "", "", 301, "https"); - } - - next(); - }); - - // @ts-ignore - app.use((err, _req, _res, next) => { - logger.error(err.message); - next(); - }); - - // If not authenticated, redirect to the login page. - app.get("/", (req, res, next) => { - if (!isAuthed(req)) { - return redirect(req, res, "login"); - } - next(); - }); - - // If already authenticated, redirect back to the root. - app.get("/login", (req, res, next) => { - if (isAuthed(req)) { - return redirect(req, res, "", "login"); - } - next(); - }); - - // For getting general server data. - app.get("/ping", (_req, res) => { - res.json({ - hostname: os.hostname(), - }); - }); - - // For getting a resource on disk. - app.get("/resource/:url(*)", async (req, res) => { - if (!ensureAuthed(req, res)) { - return; - } - - try { - const fullPath = `/${req.params.url}`; - // const relative = path.relative(options!.dataDirectory, fullPath); - // if (relative.startsWith("..")) { - // return res.status(403).end(); - // } - const exists = fs.existsSync(fullPath); - if (!exists) { - return res.status(404).end(); - } - const stat = await util.promisify(fs.stat)(fullPath); - if (!stat.isFile()) { - res.write("Resource must be a file."); - res.status(422); - - return res.end(); - } - let mimeType = mime.lookup(fullPath); - if (mimeType === false) { - mimeType = "application/octet-stream"; - } - const content = await util.promisify(fs.readFile)(fullPath); - - res.writeHead(200, { - "Content-Type": mimeType, - "Content-Length": content.byteLength, - }); - res.write(content); - res.end(); - } catch (ex) { - res.write(ex.toString()); - res.status(500); - res.end(); - } - }); - - // For writing a resource to disk. - app.post("/resource/:url(*)", async (req, res) => { - if (!ensureAuthed(req, res)) { - return; - } - - try { - const fullPath = `/${req.params.url}`; - - const data: string[] = []; - req.setEncoding("utf8"); - req.on("data", (chunk) => { - data.push(chunk); - }); - req.on("end", async () => { - const body = data.join(""); - await mkdirp(path.dirname(fullPath)); - fs.writeFileSync(fullPath, body); - logger.info("Wrote resource", field("path", fullPath), field("content-length", body.length)); - res.status(200); - res.end(); - }); - } catch (ex) { - res.write(ex.toString()); - res.status(500); - res.end(); - } - }); - - // Everything else just pulls from the static build directory. - app.use(staticGzip); - - return { - express: app, - server, - wss, - }; -}; diff --git a/packages/server/src/vscode/bootstrapFork.ts b/packages/server/src/vscode/bootstrapFork.ts deleted file mode 100644 index 1e66b64fefcf..000000000000 --- a/packages/server/src/vscode/bootstrapFork.ts +++ /dev/null @@ -1,123 +0,0 @@ -import * as cp from "child_process"; -import * as fs from "fs"; -import * as os from "os"; -import * as path from "path"; -import * as vm from "vm"; -import { logger } from "@coder/logger"; -import { buildDir, isCli } from "../constants"; - -let ipcMsgBuffer: Buffer[] | undefined = []; -let ipcMsgListener = process.send ? (d: Buffer): number => ipcMsgBuffer!.push(d) : undefined; -if (ipcMsgListener) { - process.on("message", ipcMsgListener); -} - -declare var __non_webpack_require__: typeof require; - -/** - * Requires a module from the filesystem. - * - * Will load from the CLI if file is included inside of the default extensions dir - */ -// tslint:disable-next-line:no-any -const requireFilesystemModule = (id: string, builtInExtensionsDir: string): any => { - const mod = require("module") as typeof import("module"); - const customMod = new mod.Module(id); - customMod.filename = id; - // tslint:disable-next-line:no-any - customMod.paths = (mod)._nodeModulePaths(path.dirname(id)); - - if (id.startsWith(builtInExtensionsDir)) { - customMod.loaded = true; - const fileName = id.endsWith(".js") ? id : `${id}.js`; - const req = vm.runInThisContext(mod.wrap(fs.readFileSync(fileName).toString()), { - displayErrors: true, - filename: fileName, - }); - req(customMod.exports, customMod.require.bind(customMod), customMod, fileName, path.dirname(id)); - - return customMod.exports; - } - - return customMod.require(id); -}; - -export const requireModule = (modulePath: string, builtInExtensionsDir: string): void => { - process.env.AMD_ENTRYPOINT = modulePath; - const xml = require("xhr2"); - xml.XMLHttpRequest.prototype._restrictedHeaders["user-agent"] = false; - // tslint:disable-next-line no-any this makes installing extensions work. - (global as any).XMLHttpRequest = xml.XMLHttpRequest; - - const promiseFinally = require("promise.prototype.finally") as { shim: () => void }; - promiseFinally.shim(); - /** - * Used for loading extensions. Using __non_webpack_require__ didn't work - * as it was not resolving to the FS. - */ - // tslint:disable-next-line:no-any - (global as any).nativeNodeRequire = (id: string): any => { - return requireFilesystemModule(id, builtInExtensionsDir); - }; - - if (isCli) { - process.env.NBIN_BYPASS = "true"; - } - - const baseDir = path.join(buildDir, "build"); - if (isCli) { - __non_webpack_require__(path.join(baseDir, "bootstrap-fork.js.gz")); - } else { - // We need to check `isCli` here to confuse webpack. - require(path.join(__dirname, isCli ? "" : "../../../vscode/out/bootstrap-fork.js")); - } -}; - -/** - * Uses the internal bootstrap-fork.js to load a module - * @example - * const cp = forkModule("vs/code/electron-browser/sharedProcess/sharedProcessMain"); - * cp.stdout.on("data", (data) => console.log(data.toString("utf8"))); - * cp.stderr.on("data", (data) => console.log(data.toString("utf8"))); - * @param modulePath Path of the VS Code module to load. - */ -export const forkModule = (modulePath: string, args?: string[], options?: cp.ForkOptions, dataDir?: string): cp.ChildProcess => { - const forkOptions: cp.ForkOptions = { - stdio: [null, null, null, "ipc"], - }; - if (options && options.env) { - // This prevents vscode from trying to load original-fs from electron. - delete options.env.ELECTRON_RUN_AS_NODE; - forkOptions.env = options.env; - } - - const forkArgs = ["--bootstrap-fork", modulePath]; - if (args) { - forkArgs.push("--extra-args", JSON.stringify(args)); - } - if (dataDir) { - forkArgs.push("--user-data-dir", dataDir); - } - - const nodeArgs = []; - if (isCli) { - nodeArgs.push(path.join(buildDir, "out", "cli.js")); - } else { - nodeArgs.push( - "--require", "ts-node/register", - "--require", "tsconfig-paths/register", - process.argv[1], - ); - } - - const proc = cp.spawn(process.execPath, [...nodeArgs, ...forkArgs], forkOptions); - if (args && args[0] === "--type=watcherService" && os.platform() === "linux") { - cp.exec(`renice -n 19 -p ${proc.pid}`, (error) => { - if (error) { - logger.warn(error.message); - } - }); - } - - return proc; -}; diff --git a/packages/server/src/vscode/sharedProcess.ts b/packages/server/src/vscode/sharedProcess.ts deleted file mode 100644 index 1348f1d85e72..000000000000 --- a/packages/server/src/vscode/sharedProcess.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { ChildProcess } from "child_process"; -import * as os from "os"; -import * as path from "path"; -import { forkModule } from "./bootstrapFork"; -import { StdioIpcHandler } from "../ipc"; -import { ParsedArgs } from "vs/platform/environment/common/environment"; -import { Emitter } from "@coder/events/src"; -import { retry } from "@coder/ide/src/retry"; -import { logger, field, Level } from "@coder/logger"; -import { withEnv } from "@coder/protocol"; - -export enum SharedProcessState { - Stopped, - Starting, - Ready, -} - -export type SharedProcessEvent = { - readonly state: SharedProcessState.Ready | SharedProcessState.Starting; -} | { - readonly state: SharedProcessState.Stopped; - readonly error: string; -}; - -export class SharedProcess { - public readonly socketPath: string = os.platform() === "win32" - ? path.join("\\\\?\\pipe", os.tmpdir(), `.code-server${Math.random().toString()}`) - : path.join(os.tmpdir(), `.code-server${Math.random().toString()}`); - private _state: SharedProcessState = SharedProcessState.Stopped; - private activeProcess: ChildProcess | undefined; - private ipcHandler: StdioIpcHandler | undefined; - private readonly onStateEmitter = new Emitter(); - public readonly onState = this.onStateEmitter.event; - private readonly logger = logger.named("shared"); - private readonly retry = retry.register("Shared process", () => this.connect()); - private disposed: boolean = false; - - public constructor( - private readonly userDataDir: string, - private readonly extensionsDir: string, - private readonly builtInExtensionsDir: string, - ) { - this.retry.run(); - } - - public get state(): SharedProcessState { - return this._state; - } - - /** - * Signal the shared process to terminate. - */ - public dispose(): void { - this.disposed = true; - if (this.ipcHandler) { - this.ipcHandler.send("handshake:goodbye"); - } - this.ipcHandler = undefined; - } - - /** - * Start and connect to the shared process. - */ - private async connect(): Promise { - this.setState({ state: SharedProcessState.Starting }); - const activeProcess = await this.restart(); - - activeProcess.on("exit", (exitCode) => { - const error = new Error(`Exited with ${exitCode}`); - this.setState({ - error: error.message, - state: SharedProcessState.Stopped, - }); - if (!this.disposed) { - this.retry.run(error); - } - }); - - this.setState({ state: SharedProcessState.Ready }); - } - - /** - * Restart the shared process. Kill existing process if running. Resolve when - * the shared process is ready and reject when it errors or dies before being - * ready. - */ - private async restart(): Promise { - if (this.activeProcess && !this.activeProcess.killed) { - this.activeProcess.kill(); - } - - const activeProcess = forkModule( - "vs/code/electron-browser/sharedProcess/sharedProcessMain", [], - withEnv({ env: { VSCODE_ALLOW_IO: "true" } }), this.userDataDir, - ); - this.activeProcess = activeProcess; - - await new Promise((resolve, reject): void => { - const doReject = (error: Error | number | null): void => { - if (error === null) { - error = new Error("Exited unexpectedly"); - } else if (typeof error === "number") { - error = new Error(`Exited with ${error}`); - } - activeProcess.removeAllListeners(); - this.setState({ - error: error.message, - state: SharedProcessState.Stopped, - }); - reject(error); - }; - - activeProcess.on("error", doReject); - activeProcess.on("exit", doReject); - - activeProcess.stdout.on("data", (data) => { - logger.trace("stdout", field("data", data.toString())); - }); - - activeProcess.stderr.on("data", (data) => { - // Warn instead of error to prevent panic. It's unlikely stderr here is - // about anything critical to the functioning of the editor. - logger.warn("stderr", field("data", data.toString())); - }); - - this.ipcHandler = new StdioIpcHandler(activeProcess); - this.ipcHandler.once("handshake:hello", () => { - const data: { - sharedIPCHandle: string; - args: Partial; - logLevel: Level; - } = { - args: { - "builtin-extensions-dir": this.builtInExtensionsDir, - "user-data-dir": this.userDataDir, - "extensions-dir": this.extensionsDir, - }, - logLevel: this.logger.level, - sharedIPCHandle: this.socketPath, - }; - this.ipcHandler!.send("handshake:hey there", "", data); - }); - this.ipcHandler.once("handshake:im ready", () => { - activeProcess.removeListener("error", doReject); - activeProcess.removeListener("exit", doReject); - resolve(); - }); - }); - - return activeProcess; - } - - /** - * Set the internal shared process state and emit the state event. - */ - private setState(event: SharedProcessEvent): void { - this._state = event.state; - this.onStateEmitter.emit(event); - } -} diff --git a/packages/server/webpack.config.js b/packages/server/webpack.config.js deleted file mode 100644 index bd2768e51c56..000000000000 --- a/packages/server/webpack.config.js +++ /dev/null @@ -1,35 +0,0 @@ -const path = require("path"); -const webpack = require("webpack"); -const merge = require("webpack-merge"); - -const root = path.resolve(__dirname, "../.."); - -module.exports = merge( - require(path.join(root, "scripts/webpack.node.config.js"))({ - dirname: __dirname, - }), { - output: { - filename: "cli.js", - libraryTarget: "commonjs", - }, - node: { - console: false, - global: false, - process: false, - Buffer: false, - __filename: false, - __dirname: false, - setImmediate: false - }, - externals: { - "nbin": "commonjs nbin", - }, - entry: "./packages/server/src/cli.ts", - plugins: [ - new webpack.DefinePlugin({ - "process.env.BUILD_DIR": `"${__dirname.replace(/\\/g, "\\\\")}"`, - "process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`, - }), - ], - }, -); diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock deleted file mode 100644 index b97e1daaed03..000000000000 --- a/packages/server/yarn.lock +++ /dev/null @@ -1,1108 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@coder/logger@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@coder/logger/-/logger-1.0.3.tgz#e0e1ae5496fde5a3c6ef3d748fdfb26a55add8b8" - integrity sha512-1o5qDZX2VZUNnzgz5KfAdMnaqaX6FNeTs0dUdg73MRHfQW94tFTIryFC1xTTCuzxGDjVHOHkaUAI4uHA2bheOA== - -"@coder/nbin@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@coder/nbin/-/nbin-1.1.2.tgz#3af9e4368f37532da446c7c291d476bb52de995d" - integrity sha512-MkwKpmu1SU9wkBwQ+bZVU2nPzENWUa3Isut9osVq3LG+udovsk+k5c5rjfJ1q8cf4km5snjOSYiulug3n9sdgw== - dependencies: - "@coder/logger" "^1.0.3" - fs-extra "^7.0.1" - glob "^7.1.3" - node-fetch "^2.3.0" - ora "^3.2.0" - -"@types/body-parser@*": - version "1.17.0" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.0.tgz#9f5c9d9bd04bb54be32d5eb9fc0d8c974e6cf58c" - integrity sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/commander@^2.12.2": - version "2.12.2" - resolved "https://registry.yarnpkg.com/@types/commander/-/commander-2.12.2.tgz#183041a23842d4281478fa5d23c5ca78e6fd08ae" - integrity sha512-0QEFiR8ljcHp9bAbWxecjVRuAMr16ivPiGOw6KFQBVrVd0RQIcM3xKdRisH2EDWgVWujiYtHwhSkSUoAAGzH7Q== - dependencies: - commander "*" - -"@types/connect@*": - version "3.4.32" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.32.tgz#aa0e9616b9435ccad02bc52b5b454ffc2c70ba28" - integrity sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg== - dependencies: - "@types/node" "*" - -"@types/events@*": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" - integrity sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA== - -"@types/express-serve-static-core@*": - version "4.16.0" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz#fdfe777594ddc1fe8eb8eccce52e261b496e43e7" - integrity sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w== - dependencies: - "@types/events" "*" - "@types/node" "*" - "@types/range-parser" "*" - -"@types/express@^4.16.0": - version "4.16.0" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.16.0.tgz#6d8bc42ccaa6f35cf29a2b7c3333cb47b5a32a19" - integrity sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "*" - "@types/serve-static" "*" - -"@types/fs-extra@^5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599" - integrity sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g== - dependencies: - "@types/node" "*" - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - -"@types/mime-types@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.0.tgz#9ca52cda363f699c69466c2a6ccdaad913ea7a73" - integrity sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM= - -"@types/mime@*": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.0.tgz#5a7306e367c539b9f6543499de8dd519fac37a8b" - integrity sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA== - -"@types/node@*": - version "10.12.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" - integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== - -"@types/opn@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/opn/-/opn-5.1.0.tgz#bff7bc371677f4bdbb37884400e03fd81f743927" - integrity sha512-TNPrB7Y1xl06zDI0aGyqkgxjhIev3oJ+cdqlZ52MTAHauWpEL/gIUdHebIfRHFZk9IqSBpE2ci1DT48iZH81yg== - dependencies: - "@types/node" "*" - -"@types/pem@^1.9.4": - version "1.9.4" - resolved "https://registry.yarnpkg.com/@types/pem/-/pem-1.9.4.tgz#9ef9302dc5f0352503e193003b208cddef4ffa45" - integrity sha512-cLRUgpedqF4lnQxDsjbRCgHRPHaJvnsHC+LEBTKnChddoPYJYQMq/LjSsEDwvRteeJV8MGt7Ea9jYCBVufrcNg== - dependencies: - "@types/node" "*" - -"@types/range-parser@*": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" - integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== - -"@types/safe-compare@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@types/safe-compare/-/safe-compare-1.1.0.tgz#47ed9b9ca51a3a791b431cd59b28f47fa9bf1224" - integrity sha512-1ri+LJhh0gRxIa37IpGytdaW7yDEHeJniBSMD1BmitS07R1j63brcYCzry+l0WJvGdEKQNQ7DYXO2epgborWPw== - -"@types/serve-static@*": - version "1.13.2" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.2.tgz#f5ac4d7a6420a99a6a45af4719f4dcd8cd907a48" - integrity sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q== - dependencies: - "@types/express-serve-static-core" "*" - "@types/mime" "*" - -"@types/ws@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-6.0.1.tgz#ca7a3f3756aa12f62a0a62145ed14c6db25d5a28" - integrity sha512-EzH8k1gyZ4xih/MaZTXwT2xOkPiIMSrhQ9b8wrlX88L0T02eYsddatQlwVFlEPyEqV0ChpdpNnE51QPH6NVT4Q== - dependencies: - "@types/events" "*" - "@types/node" "*" - -accepts@~1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= - -ansi-regex@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" - integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -async@~0.2.10: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - integrity sha1-trvgsGdLnXGXCMo43owjfLUmw9E= - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -big.js@^3.1.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" - integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== - -body-parser@1.18.3: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer-from@^1.0.0, buffer-from@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -chalk@^2.0.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -charenc@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-spinners@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.0.0.tgz#4b078756fc17a8f72043fdc9f1f14bf4fa87e2df" - integrity sha512-yiEBmhaKPPeBj7wWm4GEdtPZK940p9pl3EANIrnJ3JnvWyrPjcFcsEq6qRUuQ7fzB0+Y82ld3p6B34xo95foWw== - -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -commander@*, commander@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -content-disposition@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - -crypt@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= - -css-loader@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.9.1.tgz#2e1aa00ce7e30ef2c6a7a4b300a080a7c979e0dc" - integrity sha1-LhqgDOfjDvLGp6SzAKCAp8l54Nw= - dependencies: - csso "1.3.x" - loader-utils "~0.2.2" - source-map "~0.1.38" - -csso@1.3.x: - version "1.3.12" - resolved "https://registry.yarnpkg.com/csso/-/csso-1.3.12.tgz#fc628694a2d38938aaac4996753218fd311cdb9e" - integrity sha1-/GKGlKLTiTiqrEmWdTIY/TEc254= - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -deepmerge@^2.0.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" - integrity sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA== - -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" - -define-properties@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -diff@^3.1.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -es-abstract@^1.9.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" - has "^1.0.3" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-keys "^1.0.12" - -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es6-promisify@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-6.0.1.tgz#6edaa45f3bd570ffe08febce66f7116be4b1cdb6" - integrity sha512-J3ZkwbEnnO+fGAKrjVpeUAnZshAdfZvbhQpqfIH9kSAspReRC4nJnu8ewm55b4y9ElyeuhCTzJD0XiH8Tsbhlw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -express-static-gzip@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/express-static-gzip/-/express-static-gzip-1.1.3.tgz#345ea02637d9d5865777d6fb57ccc0884abcda65" - integrity sha512-k8Q4Dx4PDpzEb8kth4uiPWrBeJWJYSgnWMzNdjQUOsEyXfYKbsyZDkU/uXYKcorRwOie5Vzp4RMEVrJLMfB6rA== - dependencies: - serve-static "^1.12.3" - -express@^4.16.4: - version "4.16.4" - resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" - integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== - dependencies: - accepts "~1.3.5" - array-flatten "1.1.1" - body-parser "1.18.3" - content-disposition "0.5.2" - content-type "~1.0.4" - cookie "0.3.1" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.1.1" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.2" - path-to-regexp "0.1.7" - proxy-addr "~2.0.4" - qs "6.5.2" - range-parser "~1.2.0" - safe-buffer "5.1.2" - send "0.16.2" - serve-static "1.13.2" - setprototypeof "1.1.0" - statuses "~1.4.0" - type-is "~1.6.16" - utils-merge "1.0.1" - vary "~1.1.2" - -file-loader@^0.8.1: - version "0.8.5" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.8.5.tgz#9275d031fe780f27d47f5f4af02bd43713cc151b" - integrity sha1-knXQMf54DyfUf19K8CvUNxPMFRs= - dependencies: - loader-utils "~0.2.5" - -finalhandler@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" - integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.4.0" - unpipe "~1.0.0" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= - -has@^1.0.1, has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -httpolyglot@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/httpolyglot/-/httpolyglot-0.1.2.tgz#e4d347fe8984a62f467d4060df527f1851f6997b" - integrity sha1-5NNH/omEpi9GfUBg31J/GFH2mXs= - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ipaddr.js@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" - integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= - -is-buffer@~1.1.1: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= - dependencies: - has "^1.0.1" - -is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== - dependencies: - has-symbols "^1.0.0" - -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -json5@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -loader-utils@^0.2.5, loader-utils@~0.2.2, loader-utils@~0.2.3, loader-utils@~0.2.5: - version "0.2.17" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" - integrity sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g= - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - object-assign "^4.0.1" - -log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -make-error@^1.1.1: - version "1.3.5" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" - integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== - -md5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" - integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk= - dependencies: - charenc "~0.0.1" - crypt "~0.0.1" - is-buffer "~1.1.1" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@^2.1.21, mime-types@~2.1.18: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -mime@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= - -node-fetch@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" - integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== - -node-netstat@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/node-netstat/-/node-netstat-1.6.0.tgz#38c36b5f966b00ffaa2ed6f6321e6ad4487d8c89" - integrity sha512-KPDopkvPllhcILoHMWYUxvOO5c+VcPB38LxlOFPiZhZ/hJTMH/GXGCs6nvxu4d6unwsbEfgzJ4pPye3CFv9yTg== - dependencies: - is-wsl "^1.1.0" - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-keys@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" - integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -opn@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035" - integrity sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw== - dependencies: - is-wsl "^1.1.0" - -ora@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-3.2.0.tgz#67e98a7e11f7f0ac95deaaaf11bb04de3d09e481" - integrity sha512-XHMZA5WieCbtg+tu0uPF8CjvwQdNzKCX6BVh3N6GFsEXH40mTk5dsw/ya1lBTUGJslcEFJFQ8cBhOgkkZXQtMA== - dependencies: - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-spinners "^2.0.0" - log-symbols "^2.2.0" - strip-ansi "^5.0.0" - wcwidth "^1.0.1" - -os-tmpdir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -pem@^1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/pem/-/pem-1.14.1.tgz#8ff3c5884bfcba7bbdfea5b67a7fa24b4ca3bb86" - integrity sha512-WY3IzMoh+Gwp4xJTT2MqIOaVzNqU7jHqj7k0pOnLIkNSnOpjhy3PHr9mXGi+C5tRC2z1EX5lvzEbd9BtHumHLQ== - dependencies: - es6-promisify "^6.0.0" - md5 "^2.2.1" - os-tmpdir "^1.0.1" - which "^1.3.1" - -promise.prototype.finally@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/promise.prototype.finally/-/promise.prototype.finally-3.1.0.tgz#66f161b1643636e50e7cf201dc1b84a857f3864e" - integrity sha512-7p/K2f6dI+dM8yjRQEGrTQs5hTQixUAdOGpMEA3+pVxpX5oHKRSKAXyLw9Q9HUWDTdwtoo39dSHGQtN90HcEwQ== - dependencies: - define-properties "^1.1.2" - es-abstract "^1.9.0" - function-bind "^1.1.1" - -proxy-addr@~2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" - integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.8.0" - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-compare@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/safe-compare/-/safe-compare-1.1.4.tgz#5e0128538a82820e2e9250cd78e45da6786ba593" - integrity sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ== - dependencies: - buffer-alloc "^1.2.0" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -send@0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.4.0" - -serve-static@1.13.2, serve-static@^1.12.3: - version "1.13.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" - integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.2" - send "0.16.2" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -source-map-support@^0.5.6: - version "0.5.10" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" - integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@~0.1.38: - version "0.1.43" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" - integrity sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y= - dependencies: - amdefine ">=0.0.4" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== - -string-replace-webpack-plugin@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.1.3.tgz#73c657e759d66cfe80ae1e0cf091aa256d0e715c" - integrity sha1-c8ZX51nWbP6Arh4M8JGqJW0OcVw= - dependencies: - async "~0.2.10" - loader-utils "~0.2.3" - optionalDependencies: - css-loader "^0.9.1" - file-loader "^0.8.1" - style-loader "^0.8.3" - -strip-ansi@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" - integrity sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow== - dependencies: - ansi-regex "^4.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -style-loader@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.8.3.tgz#f4f92eb7db63768748f15065cd6700f5a1c85357" - integrity sha1-9Pkut9tjdodI8VBlzWcA9aHIU1c= - dependencies: - loader-utils "^0.2.5" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -ts-node@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" - integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== - dependencies: - arrify "^1.0.0" - buffer-from "^1.1.0" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.5.6" - yn "^2.0.0" - -tsconfig-paths@^3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.7.0.tgz#02ae978db447b22e09dafcd4198be95c4885ceb2" - integrity sha512-7iE+Q/2E1lgvxD+c0Ot+GFFmgmfIjt/zCayyruXkXQ84BLT85gHXy0WSoQSiuFX9+d+keE/jiON7notV74ZY+A== - dependencies: - "@types/json5" "^0.0.29" - deepmerge "^2.0.1" - json5 "^1.0.1" - minimist "^1.2.0" - strip-bom "^3.0.0" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -typescript@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" - integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg== - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= - dependencies: - defaults "^1.0.3" - -which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.2.tgz#3cc7462e98792f0ac679424148903ded3b9c3ad8" - integrity sha512-rfUqzvz0WxmSXtJpPMX2EeASXabOrSMk1ruMOV3JBTBjo4ac2lDjGGsbQSyxj8Odhw5fBib8ZKEjDNvgouNKYw== - dependencies: - async-limiter "~1.0.0" - -xhr2@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" - integrity sha1-f4dliEdxbbUCYyOBL4GMras4el8= - -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" - integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= diff --git a/packages/tsconfig.json b/packages/tsconfig.json deleted file mode 100644 index 6c3477462092..000000000000 --- a/packages/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../tsconfig.json" -} diff --git a/packages/tunnel/package.json b/packages/tunnel/package.json deleted file mode 100644 index da3dc84f9788..000000000000 --- a/packages/tunnel/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@coder/tunnel", - "main": "src/tunnel.ts" -} \ No newline at end of file diff --git a/packages/tunnel/src/client.ts b/packages/tunnel/src/client.ts deleted file mode 100644 index 5941096abd35..000000000000 --- a/packages/tunnel/src/client.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Event, Emitter } from "@coder/events"; -import { TunnelCloseCode } from "./common"; - -export interface TunnelCloseEvent { - readonly code: TunnelCloseCode; - readonly reason: string; -} - -export interface ClientConnection { - readonly onData: Event; - readonly onClose: Event; - send(data: ArrayBuffer): void; -} - -export const forward = (connectionUrl: string): Promise => { - return new Promise((resolve, reject): void => { - const socket = new WebSocket(connectionUrl); - const closeEmitter = new Emitter(); - const dataEmitter = new Emitter(); - const connection: ClientConnection = { - get onClose(): Event { - return closeEmitter.event; - }, - get onData(): Event { - return dataEmitter.event; - }, - send(data: ArrayBuffer): void { - socket.send(data); - }, - }; - socket.binaryType = "arraybuffer"; - socket.addEventListener("message", (event) => { - dataEmitter.emit(event.data); - }); - socket.addEventListener("error", (event) => { - reject("uncertain"); - }); - socket.addEventListener("open", () => { - resolve(connection); - }); - socket.addEventListener("close", (event) => { - closeEmitter.emit({ - code: event.code, - reason: event.reason, - }); - }); - }); -}; diff --git a/packages/tunnel/src/common.ts b/packages/tunnel/src/common.ts deleted file mode 100644 index 9fa33a768c6f..000000000000 --- a/packages/tunnel/src/common.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum TunnelCloseCode { - Normal = 1000, - Error = 4000, - ConnectionRefused = 4001, -} diff --git a/packages/tunnel/src/server.ts b/packages/tunnel/src/server.ts deleted file mode 100644 index 5fcabe7b58d5..000000000000 --- a/packages/tunnel/src/server.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as net from "net"; -import { TunnelCloseCode } from "./common"; - -export interface WS { - addEventListener(event: "message", cb: (event: { - // tslint:disable-next-line:no-any - readonly data: any; - }) => void): void; - addEventListener(event: "close", cb: () => void): void; - binaryType: string; - close(code: number, reason?: string): void; - // tslint:disable-next-line:no-any - send(data: any): void; -} - -export const handle = async (socket: WS, port: number): Promise => { - const hosts = [ - "127.0.0.1", - "::", // localhost - ]; - - let localSocket: net.Socket | undefined; - for (let i = 0; i < hosts.length; i++) { - if (localSocket) { - break; - } - localSocket = await new Promise((resolve, reject): void => { - const socket = net.connect({ - host: hosts[i], - port, - }, () => { - // Connected - resolve(socket); - }); - socket.on("error", (err: Error & { readonly code: string }) => { - if (err.code === "ECONNREFUSED") { - resolve(undefined); - } - }); - }); - } - if (!localSocket) { - socket.close(TunnelCloseCode.ConnectionRefused); - - return; - } - socket.binaryType = "arraybuffer"; - socket.addEventListener("message", (event) => localSocket!.write(Buffer.from(event.data))); - socket.addEventListener("close", () => localSocket!.end()); - localSocket.on("data", (data) => socket.send(data)); - localSocket.on("error", (err) => socket.close(TunnelCloseCode.Error, err.toString())); - localSocket.on("close", () => socket.close(TunnelCloseCode.Normal)); -}; diff --git a/packages/tunnel/yarn.lock b/packages/tunnel/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/tunnel/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/vscode/.gitignore b/packages/vscode/.gitignore deleted file mode 100644 index 8af4e3b6bd40..000000000000 --- a/packages/vscode/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -test/.test* \ No newline at end of file diff --git a/packages/vscode/package.json b/packages/vscode/package.json deleted file mode 100644 index 777dcdf6ac9c..000000000000 --- a/packages/vscode/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@coder/vscode", - "description": "VS Code implementation of the browser-based IDE client.", - "main": "src/index.ts", - "scripts": { - "build:bootstrap-fork": "../../node_modules/.bin/cross-env UV_THREADPOOL_SIZE=100 node --max-old-space-size=32384 ../../node_modules/webpack/bin/webpack.js --config ./webpack.bootstrap.config.js" - }, - "dependencies": { - "iconv-lite": "^0.4.24", - "onigasm": "^2.2.1", - "string-replace-loader": "^2.1.1", - "tar-stream": "^2.0.1" - }, - "devDependencies": { - "@types/tar-stream": "^1.6.0", - "vscode-textmate": "^4.0.1" - } -} diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts deleted file mode 100644 index 277f89bbd2da..000000000000 --- a/packages/vscode/src/client.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { IdeClient } from "@coder/ide"; -import { client as ideClientInstance } from "@coder/ide/src/fill/client"; -import Severity from "vs/base/common/severity"; -import { INotificationService } from "vs/platform/notification/common/notification"; -import { IStatusbarService, StatusbarAlignment } from "vs/platform/statusbar/common/statusbar"; -import * as paths from "./fill/paths"; -import product from "./fill/product"; -import "./vscode.scss"; -import { MenuId, MenuRegistry } from "vs/platform/actions/common/actions"; -import { CommandsRegistry } from "vs/platform/commands/common/commands"; -import { IFileService, FileOperation } from "vs/platform/files/common/files"; -import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles"; -import { IModelService } from "vs/editor/common/services/modelService"; -import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal"; -import { IStorageService } from "vs/platform/storage/common/storage"; -// NOTE: shouldn't import anything from VS Code here or anything that will -// depend on a synchronous fill like `os`. - -class VSClient extends IdeClient { - protected initialize(): Promise { - return this.task("Start workbench", 1000, async (data, sharedData) => { - paths._paths.initialize(data, sharedData); - product.initialize(data); - process.env.SHELL = data.shell; - // At this point everything should be filled, including `os`. `os` also - // relies on `initData` but it listens first so it initialize before this - // callback, meaning we are safe to include everything from VS Code now. - const { workbench } = require("./workbench") as typeof import("./workbench"); - await workbench.initialize(); - - // tslint:disable-next-line:no-any - const getService = (id: any): T => workbench.serviceCollection.get(id) as T; - window.ide = { - client: ideClientInstance, - workbench: { - commandRegistry: CommandsRegistry, - // tslint:disable-next-line:no-any - menuRegistry: MenuRegistry as any, - // tslint:disable-next-line:no-any - statusbarService: getService(IStatusbarService) as any, - notificationService: getService(INotificationService), - terminalService: getService(ITerminalService), - storageService: { - save: (): Promise => { - // tslint:disable-next-line:no-any - const storageService = getService(IStorageService) as any; - - return storageService.close(); - }, - }, - - onFileCreate: (cb): void => { - getService(IFileService).onAfterOperation((e) => { - if (e.operation === FileOperation.CREATE) { - cb(e.resource.path); - } - }); - }, - onFileMove: (cb): void => { - getService(IFileService).onAfterOperation((e) => { - if (e.operation === FileOperation.MOVE) { - cb(e.resource.path, e.target ? e.target.resource.path : undefined!); - } - }); - }, - onFileDelete: (cb): void => { - getService(IFileService).onAfterOperation((e) => { - if (e.operation === FileOperation.DELETE) { - cb(e.resource.path); - } - }); - }, - onFileSaved: (cb): void => { - getService(ITextFileService).models.onModelSaved((e) => { - cb(e.resource.path); - }); - }, - onFileCopy: (cb): void => { - getService(IFileService).onAfterOperation((e) => { - if (e.operation === FileOperation.COPY) { - cb(e.resource.path, e.target ? e.target.resource.path : undefined!); - } - }); - }, - - onModelAdded: (cb): void => { - getService(IModelService).onModelAdded((e) => { - cb(e.uri.path, e.getLanguageIdentifier().language); - }); - }, - onModelRemoved: (cb): void => { - getService(IModelService).onModelRemoved((e) => { - cb(e.uri.path, e.getLanguageIdentifier().language); - }); - }, - onModelLanguageChange: (cb): void => { - getService(IModelService).onModelModeChanged((e) => { - cb(e.model.uri.path, e.model.getLanguageIdentifier().language, e.oldModeId); - }); - }, - - onTerminalAdded: (cb): void => { - getService(ITerminalService).onInstanceCreated(() => cb()); - }, - onTerminalRemoved: (cb): void => { - getService(ITerminalService).onInstanceDisposed(() => cb()); - }, - }, - - // @ts-ignore - // tslint:disable-next-line:no-any - MenuId: MenuId as any, - // tslint:disable-next-line:no-any - Severity: Severity as any, - // @ts-ignore - // tslint:disable-next-line:no-any - StatusbarAlignment: StatusbarAlignment as any, - }; - - const event = new CustomEvent("ide-ready"); - // tslint:disable-next-line:no-any - (event).ide = window.ide; - window.dispatchEvent(event); - }, this.initData, this.sharedProcessData); - } -} - -export const client = new VSClient(); diff --git a/packages/vscode/src/dialog.scss b/packages/vscode/src/dialog.scss deleted file mode 100644 index b1ffb8462d48..000000000000 --- a/packages/vscode/src/dialog.scss +++ /dev/null @@ -1,160 +0,0 @@ -.dialog { - --primary: #2A2E37; - --border: black; - --faded: #a0a1a5; - --disabled: #888; - --header-background: #161616; - --header-foreground: white; - --list-active-selection-background: rgb(0, 120, 160); - --list-active-selection-foreground: white; - --list-hover-background: rgb(36, 39, 46); - font-family: inherit; - box-shadow: 0 18px 80px 10px rgba(0, 0, 0, 0.1); - background-color: var(--primary); - display: flex; - flex-direction: column; - user-select: none; - overflow: hidden; - border-radius: 5px; - - .monaco-tl-twistie { - display: none; - } - - .title { - background-color: var(--header-background); - color: var(--header-foreground); - padding: 1px; - font-size: 11px; - font-weight: normal; - text-transform: uppercase; - white-space: nowrap; - padding: 5px 10px; - } - - .nav { - display: flex; - flex-direction: row; - padding: 4px; - border-bottom: 1px solid var(--border); - } - - .path { - display: flex; - flex-direction: row; - - .path-part { - padding: 5px; - border-radius: 3px; - font-size: 1.02em; - cursor: pointer; - - &:not(:first-child) { - margin-left: 5px; - } - - &.active { - font-weight: bold; - color: var(--list-active-selection-foreground); - } - } - } - - .dialog-grid { - display: grid; - grid-template-columns: 2fr 0.2fr 0.8fr; - } - - .headings { - padding: 8px; - font-size: 12px; - } - - .file-area { - flex: 1; - display: flex; - flex-direction: column; - overflow: hidden; - - .dialog-entry { - cursor: pointer; - font-size: 1.02em; - padding: 0px 8px; - - .dialog-entry-info { - display: flex; - flex-direction: row; - } - - .dialog-entry-icon { - width: 16px; - height: 19px; - margin-right: 5px; - } - - .dialog-entry-size { - text-align: right; - } - - .dialog-entry-mtime { - padding-left: 8px; - } - - &:hover { - background-color: var(--list-hover-background); - } - - &.active { - background-color: var(--list-active-selection-background); - color: var(--list-active-selection-foreground); - } - - &.disabled, &.disabled:hover { - background-color: var(--primary); - color: var(--disabled); - cursor: initial; - } - } - } - - .buttons { - display: flex; - flex-direction: row; - padding: 10px; - position: relative; - background: var(--primary); - border-top: 1px solid var(--border); - - button:first-child { - margin-left: auto; - margin-right: 10px; - } - - button { - background: transparent; - outline: none; - border: 0; - color: var(--faded); - padding: 10px; - padding-left: 18px; - padding-right: 18px; - transition: 150ms background ease, 150ms color ease; - cursor: pointer; - border-radius: 5px; - - &:hover { - background: var(--titlebar); - color: white; - } - } - - button[disabled], button[disabled]:hover { - color: var(--disabled); - cursor: initial; - } - } -} - -.monaco-shell .monaco-tree.focused.no-focused-item:focus:before, .monaco-shell .monaco-list:not(.element-focused):focus:before { - display: none; -} diff --git a/packages/vscode/src/dialog.ts b/packages/vscode/src/dialog.ts deleted file mode 100644 index 4ec06306e18d..000000000000 --- a/packages/vscode/src/dialog.ts +++ /dev/null @@ -1,513 +0,0 @@ -import * as fs from "fs"; -import * as path from "path"; -import * as util from "util"; -import { Emitter, Event } from "@coder/events"; -import { $, addClass, append } from "vs/base/browser/dom"; -import { HighlightedLabel } from "vs/base/browser/ui/highlightedlabel/highlightedLabel"; -import { ObjectTree } from "vs/base/browser/ui/tree/objectTree"; -import { ITreeElement, ITreeNode, ITreeRenderer, TreeFilterResult, TreeVisibility } from "vs/base/browser/ui/tree/tree"; -import { KeyCode } from "vs/base/common/keyCodes"; -import { URI } from "vs/base/common/uri"; -import { getIconClasses } from "vs/editor/common/services/getIconClasses"; -import { IModelService } from "vs/editor/common/services/modelService"; -import { IModeService } from "vs/editor/common/services/modeService"; -import { FileKind } from "vs/platform/files/common/files"; -import { IThemeService } from "vs/platform/theme/common/themeService"; -import { workbench } from "./workbench"; -import "./dialog.scss"; - -/** - * Describes the type of dialog to show. - */ -export enum DialogType { - NewFolder, - Save, - Open, -} - -export interface CommonDialogOptions { - readonly title?: string; - readonly defaultPath?: string; - readonly buttonLabel?: string; -} - -export interface OpenDialogOptions extends CommonDialogOptions { - readonly properties: { - readonly openFile: true; - readonly openDirectory?: boolean; - readonly showHiddenFiles?: boolean; - } | { - readonly openDirectory: true; - readonly showHiddenFiles?: boolean; - readonly openFile?: boolean; - }; -} - -export interface SaveDialogOptions extends CommonDialogOptions { - readonly type: DialogType.Save; - readonly nameFieldLabel?: string; -} - -export type DialogOptions = OpenDialogOptions | SaveDialogOptions; - -export const showOpenDialog = (options: OpenDialogOptions): Promise => { - return new Promise((resolve, reject): void => { - const dialog = new Dialog(DialogType.Open, options); - dialog.onSelect((e) => { - dialog.dispose(); - resolve(e); - }); - dialog.onError((e) => { - dialog.dispose(); - reject(e); - }); - }); - -}; - -interface DialogEntry { - readonly fullPath: string; - readonly name: string; - readonly isDirectory: boolean; - readonly size: number; - readonly lastModified: string; - readonly isDisabled?: boolean; -} - -/** - * Open and save dialogs. - */ -class Dialog { - private _path: string | undefined; - - private static readonly UpperDirId = ".."; - - private readonly filesNode: HTMLElement; - private readonly pathNode: HTMLElement; - - private readonly entryList: ObjectTree; - private readonly background: HTMLElement; - private readonly root: HTMLElement; - - private readonly selectEmitter: Emitter; - private readonly errorEmitter: Emitter; - - public constructor( - private readonly type: DialogType, - private readonly options: DialogOptions, - ) { - this.selectEmitter = new Emitter(); - this.errorEmitter = new Emitter(); - - this.background = document.createElement("div"); - this.background.style.position = "absolute"; - this.background.style.top = "0"; - this.background.style.left = "0"; - this.background.style.bottom = "0"; - this.background.style.right = "0"; - this.background.style.zIndex = "5"; - this.background.style.display = "flex"; - this.background.style.alignItems = "center"; - this.background.style.justifyContent = "center"; - this.background.style.background = "rgba(0, 0, 0, 0.25)"; - - this.root = document.createElement("div"); - this.root.style.width = "850px"; - this.root.style.height = "600px"; - this.background.appendChild(this.root); - (document.querySelector(".monaco-workbench") || document.body).appendChild(this.background); - this.root.classList.add("dialog"); - - const setProperty = (vari: string, id: string): void => { - const getColor = (id: string): string | undefined => { - const ts = workbench.serviceCollection.get(IThemeService) as IThemeService; - const c = ts.getTheme().getColor(id); - if (!c) { - return; - } - - return c.toString(); - }; - const c = getColor(id); - if (c) { - this.root.style.setProperty(vari, c); - } - }; - setProperty("--primary", "sideBar.background"); - setProperty("--list-active-selection-background", "list.activeSelectionBackground"); - setProperty("--list-active-selection-foreground", "list.activeSelectionForeground"); - setProperty("--list-hover-background", "list.hoverBackground"); - setProperty("--header-background", "sideBarSectionHeader.background"); - setProperty("--header-foreground", "sideBarSectionHeader.foreground"); - setProperty("--border", "panel.border"); - - this.background.addEventListener("contextmenu", (event) => { - event.preventDefault(); - }); - - const titleNode = document.createElement("div"); - titleNode.classList.add("title"); - let title: string | undefined; - switch (this.type) { - // case DialogType.NewFolder: - // title = "New Folder"; - // break; - case DialogType.Open: - title = "Open File"; - break; - case DialogType.Save: - title = "Save File"; - break; - default: - throw new Error("Uncased type"); - } - titleNode.innerText = options.title || title; - this.root.appendChild(titleNode); - - const navItems = document.createElement("div"); - navItems.classList.add("nav"); - - this.pathNode = document.createElement("div"); - this.pathNode.classList.add("path"); - navItems.appendChild(this.pathNode); - this.root.appendChild(navItems); - - const headingsNode = document.createElement("div"); - headingsNode.className = "headings dialog-grid"; - ["Name", "Size", "Last Modified"].forEach(e => { - const header = document.createElement("div"); - header.innerText = e; - headingsNode.appendChild(header); - }); - this.root.appendChild(headingsNode); - - const fileAreaNode = document.createElement("div"); - fileAreaNode.classList.add("file-area"); - fileAreaNode.classList.add("show-file-icons"); - - this.filesNode = document.createElement("div"); - this.filesNode.className = "files-list"; - this.entryList = new ObjectTree(this.filesNode, { - getHeight: (_entry: DialogEntry): number => { - return 20; - }, - getTemplateId: (_entry: DialogEntry): string => { - return "dialog-entry"; - }, - }, [new DialogEntryRenderer()], { - openController: { - shouldOpen: (_event): boolean => { - return true; - }, - }, - keyboardNavigationLabelProvider: { - getKeyboardNavigationLabel: (element): string => { - return element.name; - }, - mightProducePrintableCharacter: (event): boolean => { - if (event.ctrlKey || event.metaKey) { - // ignore ctrl/cmd-combination but not shift/alt-combinatios - return false; - } - // weak check for certain ranges. this is properly implemented in a subclass - // with access to the KeyboardMapperFactory. - if ((event.keyCode >= KeyCode.KEY_A && event.keyCode <= KeyCode.KEY_Z) - || (event.keyCode >= KeyCode.KEY_0 && event.keyCode <= KeyCode.KEY_9) - || event.keyCode === KeyCode.US_DOT || event.keyCode === KeyCode.US_SLASH || event.keyCode === KeyCode.US_MINUS) { - return true; - } - - return false; - }, - }, - automaticKeyboardNavigation: true, - enableKeyboardNavigation: true, - multipleSelectionSupport: false, - openOnSingleClick: false, - filter: { - filter: (): TreeFilterResult => { - // tslint:disable-next-line:no-any - (this.entryList)._options.simpleKeyboardNavigation = true; - // tslint:disable-next-line:no-any - const pat = (this.entryList).typeFilterController.filter._pattern; - - return { - data: pat, - visibility: TreeVisibility.Visible, - }; - }, - }, - filterOnType: true, - }); - // tslint:disable-next-line:no-any - (this.entryList).focusNavigationFilter = (node: ITreeNode): boolean => { - if (node.filterData) { - return node.element.name.toLowerCase().startsWith(node.filterData.toLowerCase()!); - } - - return false; - }; - this.entryList.onDidOpen((event) => { - const element = event.elements[0]!; - if (!element) { - const fv = this.filterValue; - - if (fv === Dialog.UpperDirId) { - this.path = path.dirname(this._path!); - } - - if (fv.startsWith("/")) { - fs.stat(fv, (err, stats) => { - if (err) { - return; - } - - if (stats.isDirectory()) { - this.path = fv; - } - }); - } - - return; - } - - // If it's a directory, we want to navigate to it. If it's a file, then we - // only want to open it if opening files is supported. - if (element.isDirectory) { - this.path = element.fullPath; - } else if ((this.options as OpenDialogOptions).properties.openFile) { - this.selectEmitter.emit(element.fullPath); - } - }); - fileAreaNode.appendChild(this.entryList.getHTMLElement()); - this.root.appendChild(fileAreaNode); - - const buttonsNode = document.createElement("div"); - buttonsNode.className = "buttons"; - const cancelBtn = document.createElement("button"); - cancelBtn.innerText = "Cancel"; - cancelBtn.addEventListener("click", () => { - this.errorEmitter.emit(new Error("Cancelled")); - }); - buttonsNode.appendChild(cancelBtn); - const confirmBtn = document.createElement("button"); - const openDirectory = (this.options as OpenDialogOptions).properties.openDirectory; - confirmBtn.innerText = this.options.buttonLabel || "Confirm"; - confirmBtn.addEventListener("click", () => { - if (this._path && openDirectory) { - this.selectEmitter.emit(this._path); - } - }); - // Disable if we can't open directories, otherwise you can open a directory - // as a file which won't work. This is because our button currently just - // always opens whatever directory is opened and will not open selected - // files. (A single click on a file is used to open it instead.) - if (!openDirectory) { - confirmBtn.disabled = true; - } - buttonsNode.appendChild(confirmBtn); - this.root.appendChild(buttonsNode); - this.entryList.layout(); - - this.path = options.defaultPath || "/"; - } - - public get onSelect(): Event { - return this.selectEmitter.event; - } - - public get onError(): Event { - return this.errorEmitter.event; - } - - /** - * Remove the dialog. - */ - public dispose(): void { - this.selectEmitter.dispose(); - this.errorEmitter.dispose(); - this.entryList.dispose(); - this.background.remove(); - } - - /** - * Build and insert the path shown at the top of the dialog. - */ - private buildPath(): void { - while (this.pathNode.lastChild) { - this.pathNode.removeChild(this.pathNode.lastChild); - } - - if (!this._path) { - throw new Error("cannot build path node without valid path"); - } - - const pathParts = ["", ...this._path.split("/").filter((p) => p.length > 0)]; - - for (let i = 0; i < pathParts.length; i++) { - const pathPartNode = document.createElement("div"); - pathPartNode.classList.add("path-part"); - pathPartNode.innerText = pathParts[i].length > 0 ? pathParts[i] : "/"; - - if (i === pathParts.length - 1) { - pathPartNode.classList.add("active"); - } - - pathPartNode.addEventListener("click", () => { - this.path = "/" + pathParts.slice(0, i + 1).join("/"); - }); - - this.pathNode.appendChild(pathPartNode); - } - } - - private set path(directory: string) { - this.list(directory).then((value) => { - this._path = directory; - this.buildPath(); - - while (this.filesNode.lastChild) { - this.filesNode.removeChild(this.filesNode.lastChild); - } - - const items = value.filter((v) => { - if (v.name.startsWith(".")) { - const props = (this.options as OpenDialogOptions).properties; - if (props && props.showHiddenFiles) { - return true; - } - - return false; - } - - return true; - }); - - this.entryList.setChildren(null, items.map((i: DialogEntry): ITreeElement => ({ element: i }))); - this.entryList.domFocus(); - this.entryList.setFocus([null]); - // Clears the input on refresh - // tslint:disable-next-line:no-any - (this.entryList).typeFilterController.onInput(""); - }).catch((ex) => { - this.errorEmitter.emit(ex); - }); - } - - private get filterValue(): string { - // tslint:disable-next-line:no-any - return (this.entryList).typeFilterController.filter._pattern; - } - - /** - * List the files and return dialog entries. - */ - private async list(directory: string): Promise> { - const paths = (await util.promisify(fs.readdir)(directory)).sort(); - const stats = await Promise.all(paths.map(p => util.promisify(fs.lstat)(path.join(directory, p)))); - - return stats.map((stat, index): DialogEntry => ({ - fullPath: path.join(directory, paths[index]), - name: paths[index], - isDirectory: stat.isDirectory(), - lastModified: stat.mtime.toDateString(), - size: stat.size, - // If we can't open files, show them as disabled. - isDisabled: !stat.isDirectory() - && !(this.options as OpenDialogOptions).properties.openFile, - })); - } -} - -interface DialogEntryData { - icon: HTMLElement; - size: HTMLElement; - lastModified: HTMLElement; - label: HighlightedLabel; -} - -/** - * Rendering for the different parts of a dialog entry. - */ -class DialogEntryRenderer implements ITreeRenderer { - public get templateId(): string { - return "dialog-entry"; - } - - /** - * Append and return containers for each part of the dialog entry. - */ - public renderTemplate(container: HTMLElement): DialogEntryData { - addClass(container, "dialog-entry"); - addClass(container, "dialog-grid"); - - const wrapper = append(container, $(".dialog-entry-info")); - const icon: HTMLElement = append(wrapper, $("div")); - const name = append(wrapper, $(".dialog-entry-name")); - const label = new HighlightedLabel(name, false); - append(container, wrapper); - const size = append(container, $(".dialog-entry-size")); - const mtime = append(container, $(".dialog-entry-mtime")); - - return { - icon, - size, - lastModified: mtime, - label, - }; - } - - /** - * Render a dialog entry. - */ - public renderElement(node: ITreeNode, _index: number, templateData: DialogEntryData): void { - templateData.icon.className = "dialog-entry-icon monaco-icon-label"; - const classes = getIconClasses( - workbench.serviceCollection.get(IModelService) as IModelService, - workbench.serviceCollection.get(IModeService) as IModeService, - URI.file(node.element.name), - node.element.isDirectory ? FileKind.FOLDER : FileKind.FILE, - ); - templateData.icon.hidden = classes.length === 0; - classes.forEach((c) => { - try { - templateData.icon.classList.add(c); - } catch (ex) { - // Nothin needed. Sometimes bad classes are given - } - }); - templateData.label.set(node.element.name, typeof node.filterData === "string" && node.element.name.toLowerCase().startsWith(node.filterData.toLowerCase()) ? [{ - start: 0, - end: node.filterData.length, - }] : []); - templateData.size.innerText = !node.element.isDirectory ? this.humanReadableSize(node.element.size) : ""; - templateData.lastModified.innerText = node.element.lastModified; - - // We know this exists because we created the template. - const entryContainer = templateData.label.element.parentElement!.parentElement!.parentElement!; - if (node.element.isDisabled) { - entryContainer.classList.add("disabled"); - } else { - entryContainer.classList.remove("disabled"); - } - } - - /** - * Does nothing (not implemented). - */ - public disposeTemplate(_templateData: DialogEntryData): void { - // throw new Error("Method not implemented."); - } - - /** - * Given a positive size in bytes, return a string that is more readable for - * humans. - */ - private humanReadableSize(bytes: number): string { - const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; - const i = Math.min(Math.floor(Math.log(bytes) / Math.log(1000)), units.length - 1); - - return (bytes / Math.pow(1000, i)).toFixed(2) - + " " + units[i]; - } -} diff --git a/packages/vscode/src/fill/amd.ts b/packages/vscode/src/fill/amd.ts deleted file mode 100644 index 8d322bc1d4ab..000000000000 --- a/packages/vscode/src/fill/amd.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { URI } from "vs/base/common/uri"; - -export const getPathFromAmdModule = (_: typeof require, relativePath: string): string => { - if (process.mainModule && process.mainModule.filename) { - const index = process.mainModule.filename.lastIndexOf("/"); - - return process.mainModule.filename.slice(0, index); - } - - return relativePath ? URI.file(relativePath).fsPath : ""; -}; diff --git a/packages/vscode/src/fill/applicationInsights.ts b/packages/vscode/src/fill/applicationInsights.ts deleted file mode 100644 index bb94c7378079..000000000000 --- a/packages/vscode/src/fill/applicationInsights.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Used by node - */ -import * as https from "https"; -import * as os from "os"; - -export const defaultClient = "filler"; - -export class TelemetryClient { - public channel = { - setUseDiskRetryCaching: (): void => undefined, - }; - - public constructor() { - // - } - - public trackEvent(options: { - name: string; - properties: object; - measurements: object; - }): void { - if (!options.properties) { - options.properties = {}; - } - if (!options.measurements) { - options.measurements = {}; - } - - try { - const cpus = os.cpus(); - // tslint:disable-next-line:no-any - (options.measurements as any).cpu = { - model: cpus[0].model, - cores: cpus.length, - }; - } catch (ex) { - // Nothin - } - - try { - // tslint:disable-next-line:no-any - (options.measurements as any).memory = { - virtual_free: os.freemem(), - virtual_used: os.totalmem(), - }; - } catch (ex) { - // - } - - try { - // tslint:disable:no-any - (options.properties as any)["common.shell"] = os.userInfo().shell; - (options.properties as any)["common.release"] = os.release(); - (options.properties as any)["common.arch"] = os.arch(); - // tslint:enable:no-any - } catch (ex) { - // - } - - try { - // tslint:disable-next-line:no-any - (options.properties as any)["common.machineId"] = machineIdSync(); - } catch (ex) { - // - } - - try { - const request = https.request({ - host: "v1.telemetry.coder.com", - port: 443, - path: "/track", - method: "POST", - headers: { - "Content-Type": "application/json", - }, - }); - request.on("error", () => { - // Do nothing, we don"t really care - }); - request.write(JSON.stringify(options)); - request.end(); - } catch (ex) { - // Suppress all errs - } - } - - public flush(options: { - readonly callback: () => void; - }): void { - options.callback(); - } -} - -// Taken from https://github.com/automation-stack/node-machine-id -import { exec, execSync } from "child_process"; -import { createHash } from "crypto"; - -const isWindowsProcessMixedOrNativeArchitecture = (): "" | "mixed" | "native" => { - // detect if the node binary is the same arch as the Windows OS. - // or if this is 32 bit node on 64 bit windows. - if (process.platform !== "win32") { - return ""; - } - if (process.arch === "ia32" && process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")) { - return "mixed"; - } - - return "native"; -}; - -let { platform } = process, - win32RegBinPath = { - native: "%windir%\\System32", - mixed: "%windir%\\sysnative\\cmd.exe /c %windir%\\System32", - "": "", - }, - guid = { - darwin: "ioreg -rd1 -c IOPlatformExpertDevice", - win32: `${win32RegBinPath[isWindowsProcessMixedOrNativeArchitecture()]}\\REG ` + - "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography " + - "/v MachineGuid", - linux: "( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :", - freebsd: "kenv -q smbios.system.uuid || sysctl -n kern.hostuuid", - // tslint:disable-next-line:no-any - } as any; - -const hash = (guid: string): string => { - return createHash("sha256").update(guid).digest("hex"); -}; - -const expose = (result: string): string => { - switch (platform) { - case "darwin": - return result - .split("IOPlatformUUID")[1] - .split("\n")[0].replace(/\=|\s+|\"/ig, "") - .toLowerCase(); - case "win32": - return result - .toString() - .split("REG_SZ")[1] - .replace(/\r+|\n+|\s+/ig, "") - .toLowerCase(); - case "linux": - return result - .toString() - .replace(/\r+|\n+|\s+/ig, "") - .toLowerCase(); - case "freebsd": - return result - .toString() - .replace(/\r+|\n+|\s+/ig, "") - .toLowerCase(); - default: - throw new Error(`Unsupported platform: ${process.platform}`); - } -}; - -let cachedMachineId: string | undefined; - -const machineIdSync = (): string => { - if (cachedMachineId) { - return cachedMachineId; - } - let id: string = expose(execSync(guid[platform]).toString()); - cachedMachineId = hash(id); - - return cachedMachineId; -}; diff --git a/packages/vscode/src/fill/codeEditor.ts b/packages/vscode/src/fill/codeEditor.ts deleted file mode 100644 index e1134724ef34..000000000000 --- a/packages/vscode/src/fill/codeEditor.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { join } from "path"; -import * as editor from "vs/editor/browser/services/codeEditorServiceImpl"; -import { IDecorationRenderOptions } from "vs/editor/common/editorCommon"; - -/** - * This converts icon paths for decorations to the correct URL. - */ -abstract class CodeEditorServiceImpl extends editor.CodeEditorServiceImpl { - public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void { - super.registerDecorationType(key, options ? { - ...options, - gutterIconPath: options.gutterIconPath && options.gutterIconPath.scheme === "file" ? { - ...options.gutterIconPath, - scheme: location.protocol.replace(":", ""), - authority: location.host, - path: join("/resource", options.gutterIconPath.path), - } :options.gutterIconPath, - } : {}, parentTypeKey); - } -} - -const target = editor as typeof editor; -target.CodeEditorServiceImpl = CodeEditorServiceImpl; diff --git a/packages/vscode/src/fill/css.js b/packages/vscode/src/fill/css.js deleted file mode 100644 index 9519b515a971..000000000000 --- a/packages/vscode/src/fill/css.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = function(source) { - if (this.resourcePath.endsWith(".ts")) { - this.resourcePath = this.resourcePath.replace(".ts", ".css"); - } - return `module.exports = require("${this.resourcePath.replace(/\\/g, "\\\\")}");`; -}; diff --git a/packages/vscode/src/fill/dom.ts b/packages/vscode/src/fill/dom.ts deleted file mode 100644 index c68d7320e309..000000000000 --- a/packages/vscode/src/fill/dom.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as dom from "vs/base/browser/dom"; -import { IDisposable } from "vs/base/common/lifecycle"; - -// Firefox has no implementation of toElement. -if (!("toElement" in MouseEvent.prototype)) { - Object.defineProperty(MouseEvent.prototype, "toElement", { - get: function (): EventTarget | null { - // @ts-ignore - const event = this as MouseEvent; - switch (event.type) { - case "mouseup": - case "focusin": - case "mousenter": - case "mouseover": - case "dragenter": - return event.target; - default: - return event.relatedTarget; - } - }, - }); -} - -const _addDisposableListener = dom.addDisposableListener; -// tslint:disable-next-line no-any -const addDisposableListener = (node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable => { - return _addDisposableListener(node, type === "mousewheel" ? "wheel" : type, handler, useCapture); -}; - -const target = dom as typeof dom; -target.addDisposableListener = addDisposableListener; diff --git a/packages/vscode/src/fill/environmentService.ts b/packages/vscode/src/fill/environmentService.ts deleted file mode 100644 index 67cf95d2e1a1..000000000000 --- a/packages/vscode/src/fill/environmentService.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as paths from "./paths"; -import * as environment from "vs/platform/environment/node/environmentService"; - -/** - * Customize paths using data received from the initialization message. - */ -export class EnvironmentService extends environment.EnvironmentService { - public get sharedIPCHandle(): string { - return paths.getSocketPath() || super.sharedIPCHandle; - } - - public get extensionsPath(): string { - return paths.getExtensionsDirectory(); - } -} - -const target = environment as typeof environment; -target.EnvironmentService = EnvironmentService; diff --git a/packages/vscode/src/fill/graceful-fs.ts b/packages/vscode/src/fill/graceful-fs.ts deleted file mode 100644 index b4ddba2759ea..000000000000 --- a/packages/vscode/src/fill/graceful-fs.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const gracefulify = (): void => undefined; - -export * from "fs"; diff --git a/packages/vscode/src/fill/iconv-lite.ts b/packages/vscode/src/fill/iconv-lite.ts deleted file mode 100644 index ac1fcc2264ef..000000000000 --- a/packages/vscode/src/fill/iconv-lite.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as iconv from "../../node_modules/iconv-lite"; -import { Transform, TransformCallback } from "stream"; - -class IconvLiteDecoderStream extends Transform { - // tslint:disable-next-line no-any - private conv: any; - private encoding: string; - - public constructor(options: { encoding: string }) { - super(options); - // tslint:disable-next-line no-any - this.conv = (iconv as any).getDecoder(options.encoding, undefined); - this.encoding = options.encoding; - } - - // tslint:disable-next-line no-any - public _transform(chunk: any, _encoding: string, done: TransformCallback): void { - if (!Buffer.isBuffer(chunk)) { - return done(new Error("Iconv decoding stream needs buffers as its input.")); - } - try { - const res = this.conv.write(chunk); - if (res && res.length) { - this.push(res, this.encoding); - } - done(); - } catch (error) { - done(error); - } - } - - public _flush(done: TransformCallback): void { - try { - const res = this.conv.end(); - if (res && res.length) { - this.push(res, this.encoding); - } - done(); - } catch (error) { - done(error); - } - } - - // tslint:disable-next-line no-any - public collect(cb: (error: Error | null, response?: any) => void): this { - let res = ""; - this.on("error", cb); - this.on("data", (chunk) => res += chunk); - this.on("end", () => { - cb(null, res); - }); - - return this; - } -} - -const decodeStream = (encoding: string): NodeJS.ReadWriteStream => { - return new IconvLiteDecoderStream({ encoding }); -}; - -const target = iconv as typeof iconv; -target.decodeStream = decodeStream; - -export = target; diff --git a/packages/vscode/src/fill/labels.ts b/packages/vscode/src/fill/labels.ts deleted file mode 100644 index ee8cc16d4b79..000000000000 --- a/packages/vscode/src/fill/labels.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as labels from "vs/base/common/labels"; - -// Disable all mnemonics for now until we implement it. -const target = labels as typeof labels; -target.mnemonicMenuLabel = (label: string, forceDisable?: boolean): string => { - return label.replace(/\(&&\w\)|&&/g, ""); -}; -target.mnemonicButtonLabel = (label: string): string => { - return label.replace(/\(&&\w\)|&&/g, ""); -}; -target.unmnemonicLabel = (label: string): string => { return label; }; diff --git a/packages/vscode/src/fill/menuRegistry.ts b/packages/vscode/src/fill/menuRegistry.ts deleted file mode 100644 index c095f63daee9..000000000000 --- a/packages/vscode/src/fill/menuRegistry.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { IDisposable } from "vs/base/common/lifecycle"; -import * as actions from "vs/platform/actions/common/actions"; -import { CloseWorkspaceAction } from "vs/workbench/browser/actions/workspaceActions"; -import { OpenProcessExplorer } from "vs/workbench/contrib/issue/electron-browser/issueActions"; -import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions"; -import { OpenPrivacyStatementUrlAction, OpenRequestFeatureUrlAction, OpenTwitterUrlAction } from "vs/workbench/electron-browser/actions/helpActions"; -import { CloseCurrentWindowAction, NewWindowAction, ShowAboutDialogAction } from "vs/workbench/electron-browser/actions/windowActions"; -import { REVEAL_IN_OS_COMMAND_ID } from "vs/workbench/contrib/files/browser/fileCommands"; - -const toSkip = [ - ToggleDevToolsAction.ID, - OpenTwitterUrlAction.ID, - OpenPrivacyStatementUrlAction.ID, - ShowAboutDialogAction.ID, - OpenProcessExplorer.ID, - OpenRequestFeatureUrlAction.ID, - NewWindowAction.ID, - CloseCurrentWindowAction.ID, - CloseWorkspaceAction.ID, - REVEAL_IN_OS_COMMAND_ID, - - // Unfortunately referenced as a string - "update.showCurrentReleaseNotes", - "workbench.action.openIssueReporter", -]; - -// Intercept appending menu items so we can skip items that won't work. -const originalAppend = actions.MenuRegistry.appendMenuItem.bind(actions.MenuRegistry); -actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => { - if (actions.isIMenuItem(item)) { - if (toSkip.indexOf(item.command.id) !== -1) { - // Skip instantiation - return { - dispose: (): void => undefined, - }; - } - } - - return originalAppend(id, item); -}; diff --git a/packages/vscode/src/fill/mouseEvent.ts b/packages/vscode/src/fill/mouseEvent.ts deleted file mode 100644 index 08ca66663b97..000000000000 --- a/packages/vscode/src/fill/mouseEvent.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as mouse from "vs/base/browser/mouseEvent"; - -/** - * Fix the wheel event for Firefox. - */ -class StandardWheelEvent extends mouse.StandardWheelEvent { - public constructor(event: mouse.IMouseWheelEvent | null) { - super( - event, - (-(event as any as MouseWheelEvent).deltaX || 0) / 3, // tslint:disable-line no-any - (-(event as any as MouseWheelEvent).deltaY || 0) / 3, // tslint:disable-line no-any - ); - } -} - -const target = mouse as typeof mouse; -target.StandardWheelEvent = StandardWheelEvent; diff --git a/packages/vscode/src/fill/native-keymap.ts b/packages/vscode/src/fill/native-keymap.ts deleted file mode 100644 index f3749ceabc2d..000000000000 --- a/packages/vscode/src/fill/native-keymap.ts +++ /dev/null @@ -1,11 +0,0 @@ -class NativeKeymap { - public getCurrentKeyboardLayout(): null { - return null; - } - - public getKeyMap(): undefined[] { - return []; - } -} - -export = new NativeKeymap(); diff --git a/packages/vscode/src/fill/native-watchdog.ts b/packages/vscode/src/fill/native-watchdog.ts deleted file mode 100644 index cf8d8346b186..000000000000 --- a/packages/vscode/src/fill/native-watchdog.ts +++ /dev/null @@ -1,7 +0,0 @@ -class Watchdog { - public start(): void { - // No action required. - } -} - -export = new Watchdog(); diff --git a/packages/vscode/src/fill/node-pty.ts b/packages/vscode/src/fill/node-pty.ts deleted file mode 100644 index 41c703fe7cdd..000000000000 --- a/packages/vscode/src/fill/node-pty.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Module } from "@coder/protocol"; -import { client } from "@coder/ide/src/fill/client"; - -export = client.modules[Module.NodePty]; diff --git a/packages/vscode/src/fill/package.ts b/packages/vscode/src/fill/package.ts deleted file mode 100644 index 8d6ff3f8eb2b..000000000000 --- a/packages/vscode/src/fill/package.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as packageJson from "../../../../lib/vscode/package.json"; -export default { name: "vscode", version: packageJson.version }; diff --git a/packages/vscode/src/fill/paste.ts b/packages/vscode/src/fill/paste.ts deleted file mode 100644 index 72db94bae627..000000000000 --- a/packages/vscode/src/fill/paste.ts +++ /dev/null @@ -1,80 +0,0 @@ -import * as nls from "vs/nls"; -import { Action } from "vs/base/common/actions"; -import { TERMINAL_COMMAND_ID } from "vs/workbench/contrib/terminal/common/terminalCommands"; -import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal"; -import * as actions from "vs/workbench/contrib/terminal/browser/terminalActions"; -import * as instance from "vs/workbench/contrib/terminal/browser/terminalInstance"; -import { client } from "../client"; - -const getLabel = (key: string, enabled: boolean): string => { - return enabled - ? nls.localize(key, "Paste") - : nls.localize(`${key}WithKeybind`, "Paste (must use keybind)"); -}; - -export class PasteAction extends Action { - private static readonly KEY = "paste"; - - public constructor() { - super( - "editor.action.clipboardPasteAction", - getLabel(PasteAction.KEY, client.clipboard.isEnabled), - undefined, - client.clipboard.isEnabled, - async (): Promise => client.clipboard.paste(), - ); - - client.clipboard.onPermissionChange((enabled) => { - this.label = getLabel(PasteAction.KEY, enabled); - this.enabled = enabled; - }); - } -} - -class TerminalPasteAction extends Action { - private static readonly KEY = "workbench.action.terminal.paste"; - - public static readonly ID = TERMINAL_COMMAND_ID.PASTE; - public static readonly LABEL = nls.localize("workbench.action.terminal.paste", "Paste into Active Terminal"); - public static readonly SHORT_LABEL = getLabel(TerminalPasteAction.KEY, client.clipboard.isEnabled); - - public constructor( - id: string, label: string, - @ITerminalService private terminalService: ITerminalService, - ) { - super(id, label); - client.clipboard.onPermissionChange((enabled) => { - this._setLabel(getLabel(TerminalPasteAction.KEY, enabled)); - }); - this._setLabel(getLabel(TerminalPasteAction.KEY, client.clipboard.isEnabled)); - } - - public run(): Promise { - const instance = this.terminalService.getActiveOrCreateInstance(); - if (instance) { - // tslint:disable-next-line no-any it will return a promise (see below) - return (instance as any).paste(); - } - - return Promise.resolve(); - } -} - -class TerminalInstance extends instance.TerminalInstance { - public async paste(): Promise { - this.focus(); - if (client.clipboard.isEnabled) { - const text = await client.clipboard.readText(); - this.sendText(text, false); - } else { - document.execCommand("paste"); - } - } -} - -const actionsTarget = actions as typeof actions; -// @ts-ignore TODO: don't ignore it. -actionsTarget.TerminalPasteAction = TerminalPasteAction; - -const instanceTarget = instance as typeof instance; -instanceTarget.TerminalInstance = TerminalInstance; diff --git a/packages/vscode/src/fill/paths.ts b/packages/vscode/src/fill/paths.ts deleted file mode 100644 index ed284fb3de6e..000000000000 --- a/packages/vscode/src/fill/paths.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { InitData, SharedProcessData } from "@coder/protocol"; - -class Paths { - private _appData: string | undefined; - private _defaultUserData: string | undefined; - private _socketPath: string | undefined; - private _extensionsDirectory: string | undefined; - private _builtInExtensionsDirectory: string | undefined; - private _workingDirectory: string | undefined; - - public get appData(): string { - if (typeof this._appData === "undefined") { - throw new Error("trying to access appData before it has been set"); - } - - return this._appData; - } - - public get defaultUserData(): string { - if (typeof this._defaultUserData === "undefined") { - throw new Error("trying to access defaultUserData before it has been set"); - } - - return this._defaultUserData; - } - - public get socketPath(): string { - if (typeof this._socketPath === "undefined") { - throw new Error("trying to access socketPath before it has been set"); - } - - return this._socketPath; - } - - public get extensionsDirectory(): string { - if (!this._extensionsDirectory) { - throw new Error("trying to access extensions directory before it has been set"); - } - - return this._extensionsDirectory; - } - - public get builtInExtensionsDirectory(): string { - if (!this._builtInExtensionsDirectory) { - throw new Error("trying to access builtin extensions directory before it has been set"); - } - - return this._builtInExtensionsDirectory; - } - - public get workingDirectory(): string { - if (!this._workingDirectory) { - throw new Error("trying to access working directory before it has been set"); - } - - return this._workingDirectory; - } - - public initialize(data: InitData, sharedData: SharedProcessData): void { - process.env.VSCODE_LOGS = sharedData.logPath; - this._appData = data.dataDirectory; - this._defaultUserData = data.dataDirectory; - this._socketPath = sharedData.socketPath; - this._extensionsDirectory = data.extensionsDirectory; - this._builtInExtensionsDirectory = data.builtInExtensionsDirectory; - this._workingDirectory = data.workingDirectory; - } -} - -export const _paths = new Paths(); -export const getAppDataPath = (): string => _paths.appData; -export const getDefaultUserDataPath = (): string => _paths.defaultUserData; -export const getWorkingDirectory = (): string => _paths.workingDirectory; -export const getExtensionsDirectory = (): string => _paths.extensionsDirectory; -export const getBuiltInExtensionsDirectory = (): string => _paths.builtInExtensionsDirectory; -export const getSocketPath = (): string => _paths.socketPath; diff --git a/packages/vscode/src/fill/platform.ts b/packages/vscode/src/fill/platform.ts deleted file mode 100644 index efe98c757626..000000000000 --- a/packages/vscode/src/fill/platform.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as os from "os"; -import * as platform from "vs/base/common/platform"; -import * as browser from "vs/base/browser/browser"; - -// tslint:disable no-any to override const - -// Use en instead of en-US since that's vscode default and it uses -// that to determine whether to output aliases which will be redundant. -if (platform.locale === "en-US") { - (platform as any).locale = "en"; -} -if (platform.language === "en-US") { - (platform as any).language = "en"; -} - -// Use the server's platform instead of the client's. For example, this affects -// how VS Code handles paths (and more) because different platforms give -// different results. We'll have to counter for things that shouldn't change, -// like keybindings. -(platform as any).isLinux = os.platform() === "linux"; -(platform as any).isWindows = os.platform() === "win32"; -(platform as any).isMacintosh = os.platform() === "darwin"; -(platform as any).platform = os.platform() === "linux" ? platform.Platform.Linux : os.platform() === "win32" ? platform.Platform.Windows : platform.Platform.Mac; - -// This is used for keybindings, and in one place to choose between \r\n and \n -// (which we change to use platform.isWindows instead). -(platform as any).OS = (browser.isMacintosh ? platform.OperatingSystem.Macintosh : (browser.isWindows ? platform.OperatingSystem.Windows : platform.OperatingSystem.Linux)); diff --git a/packages/vscode/src/fill/product.ts b/packages/vscode/src/fill/product.ts deleted file mode 100644 index e58f8dc50b0a..000000000000 --- a/packages/vscode/src/fill/product.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { InitData } from "@coder/protocol"; -import { IProductConfiguration } from "vs/platform/product/node/product"; - -class Product implements IProductConfiguration { - public nameShort = "code-server"; - public nameLong = "code-server"; - public documentationUrl = "https://code.visualstudio.com/docs"; - public keyboardShortcutsUrlMac = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf"; - public keyboardShortcutsUrlLinux = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf"; - public keyboardShortcutsUrlWin = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf"; - public introductoryVideosUrl = "https://code.visualstudio.com/docs/getstarted/introvideos"; - public tipsAndTricksUrl = "https://code.visualstudio.com/docs/getstarted/tips-and-tricks"; - public twitterUrl = "https://twitter.com/code"; - public licenseUrl = "https://github.com/cdr/code-server/blob/master/LICENSE"; - public aiConfig = process.env.DISABLE_TELEMETRY ? undefined! : { - // Only needed so vscode can see that content exists for this value. - // We override the application insights module. - asimovKey: "content", - }; - public enableTelemetry = process.env.DISABLE_TELEMETRY ? false : true; - - private _dataFolderName: string | undefined; - public get dataFolderName(): string { - if (!this._dataFolderName) { - throw new Error("trying to access data folder name before it has been set"); - } - - return this._dataFolderName; - } - - public extensionsGallery = { - serviceUrl: global && global.process && global.process.env.SERVICE_URL - || process.env.SERVICE_URL - || "https://v1.extapi.coder.com", - // tslint:disable-next-line:no-any - } as any; - - public extensionExecutionEnvironments = { - "wayou.vscode-todo-highlight": "worker", - "vscodevim.vim": "worker", - "coenraads.bracket-pair-colorizer": "worker", - }; - - public fetchUrl = ""; - - public initialize(_data: InitData): void { - // Nothing at the moment; dataFolderName isn't used since we override the - // extension path. - } -} - -export default new Product(); diff --git a/packages/vscode/src/fill/ripgrep.ts b/packages/vscode/src/fill/ripgrep.ts deleted file mode 100644 index 0e023e747052..000000000000 --- a/packages/vscode/src/fill/ripgrep.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as path from "path"; - -// tslint:disable-next-line:no-any -module.exports.rgPath = (global).RIPGREP_LOCATION || path.join(__dirname, "../bin/rg"); diff --git a/packages/vscode/src/fill/spdlog.ts b/packages/vscode/src/fill/spdlog.ts deleted file mode 100644 index 3b98204ded81..000000000000 --- a/packages/vscode/src/fill/spdlog.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Module } from "@coder/protocol"; -import { client } from "@coder/ide/src/fill/client"; - -export = client.modules[Module.Spdlog]; diff --git a/packages/vscode/src/fill/stdioElectron.ts b/packages/vscode/src/fill/stdioElectron.ts deleted file mode 100644 index f9944539321f..000000000000 --- a/packages/vscode/src/fill/stdioElectron.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { StdioIpcHandler } from "@coder/server/src/ipc"; -import { IpcRenderer } from "electron"; - -// TODO: Commenting out for now since the electron fill includes the client code -// and tries to connect to the web socket. The fill also likely wouldn't work -// since it assumes it is running on the client. Could we proxy all methods to -// the client? It might not matter since we intercept everything before sending -// to the shared process. -// export * from "@coder/ide/src/fill/electron"; - -class StdioIpcRenderer extends StdioIpcHandler implements IpcRenderer { - // tslint:disable-next-line no-any - public sendTo(_windowId: number, _channel: string, ..._args: any[]): void { - throw new Error("Method not implemented."); - } - - // tslint:disable-next-line no-any - public sendToHost(_channel: string, ..._args: any[]): void { - throw new Error("Method not implemented."); - } - - public eventNames(): string[] { - return super.eventNames() as string[]; - } -} - -export const ipcRenderer = new StdioIpcRenderer(); diff --git a/packages/vscode/src/fill/storageDatabase.ts b/packages/vscode/src/fill/storageDatabase.ts deleted file mode 100644 index 94343e1859da..000000000000 --- a/packages/vscode/src/fill/storageDatabase.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { readFile, writeFile } from "fs"; -import { mkdirp } from "fs-extra"; -import * as path from "path"; -import { promisify } from "util"; -import { IDisposable } from "@coder/disposable"; -import { logger, field } from "@coder/logger"; -import { Event } from "vs/base/common/event"; -import * as workspaceStorage from "vs/base/node/storage"; -import * as globalStorage from "vs/platform/storage/node/storageIpc"; -import { IStorageService, WillSaveStateReason } from "vs/platform/storage/common/storage"; -import * as paths from "./paths"; -import { workbench } from "../workbench"; - -// tslint:disable completed-docs - -class StorageDatabase implements workspaceStorage.IStorageDatabase { - public readonly onDidChangeItemsExternal = Event.None; - private readonly items = new Map(); - private fetched: boolean = false; - private readonly path: string; - - public constructor(path: string) { - this.path = path.replace(/\.vscdb$/, ".json"); - logger.debug("Setting up storage", field("path", this.path)); - window.addEventListener("unload", () => { - if (!navigator.sendBeacon) { - throw new Error("cannot save state"); - } - - this.triggerFlush(WillSaveStateReason.SHUTDOWN); - const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource"; - navigator.sendBeacon(`${resourceBaseUrl}/${this.path}`, this.content); - }); - } - - public async getItems(): Promise> { - if (this.fetched) { - return this.items; - } - try { - const contents = await promisify(readFile)(this.path, "utf8"); - const json = JSON.parse(contents); - Object.keys(json).forEach((key) => { - this.items.set(key, json[key]); - }); - } catch (error) { - if (error.code !== "ENOENT") { - throw error; - } - } - - this.fetched = true; - - return this.items; - } - - public updateItems(request: workspaceStorage.IUpdateRequest): Promise { - if (request.insert) { - request.insert.forEach((value, key) => { - if (key === "colorThemeData") { - localStorage.setItem("colorThemeData", value); - } - - this.items.set(key, value); - }); - } - - if (request.delete) { - request.delete.forEach(key => this.items.delete(key)); - } - - return this.save(); - } - - public close(): Promise { - return Promise.resolve(); - } - - public checkIntegrity(): Promise { - return Promise.resolve("ok"); - } - - private async save(): Promise { - await mkdirp(path.dirname(this.path)); - - return promisify(writeFile)(this.path, this.content); - } - - private triggerFlush(reason: WillSaveStateReason = WillSaveStateReason.NONE): boolean { - // tslint:disable-next-line:no-any - const storageService = workbench.serviceCollection.get(IStorageService) as any; - if (reason === WillSaveStateReason.SHUTDOWN && storageService.close) { - storageService.close(); - - return true; - } - if (storageService._onWillSaveState) { - storageService._onWillSaveState.fire({ reason }); - - return true; - } - - return false; - } - - private get content(): string { - const json: { [key: string]: string } = {}; - this.items.forEach((value, key) => { - json[key] = value; - }); - - return JSON.stringify(json); - } -} - -class GlobalStorageDatabase extends StorageDatabase implements IDisposable { - public constructor() { - super(path.join(paths.getAppDataPath(), "globalStorage", "state.vscdb")); - } - - public dispose(): void { - // Nothing to do. - } -} - -const workspaceTarget = workspaceStorage as typeof workspaceStorage; -// @ts-ignore TODO: don't ignore it. -workspaceTarget.SQLiteStorageDatabase = StorageDatabase; - -const globalTarget = globalStorage as typeof globalStorage; -// @ts-ignore TODO: don't ignore it. -globalTarget.GlobalStorageDatabaseChannelClient = GlobalStorageDatabase; diff --git a/packages/vscode/src/fill/vscodeTextmate.ts b/packages/vscode/src/fill/vscodeTextmate.ts deleted file mode 100644 index 47b3cae6f0a7..000000000000 --- a/packages/vscode/src/fill/vscodeTextmate.ts +++ /dev/null @@ -1,54 +0,0 @@ -import * as vscodeTextmate from "../../../../lib/vscode/node_modules/vscode-textmate"; - -const target = vscodeTextmate as typeof vscodeTextmate; - -const ctx = (require as any).context("../../../../lib/extensions", true, /.*\.tmLanguage.json$/); -// Maps grammar scope to loaded grammar -const scopeToGrammar = {} as any; - -ctx.keys().forEach((key: string) => { - const value = ctx(key); - if (value.scopeName) { - scopeToGrammar[value.scopeName] = value; - } -}); - -target.Registry = class Registry extends vscodeTextmate.Registry { - public constructor(opts: vscodeTextmate.RegistryOptions) { - super({ - ...opts, - getOnigLib: (): Promise => { - return new Promise((res, rej) => { - const onigasm = require("onigasm"); - const wasmUrl = require("!!file-loader!onigasm/lib/onigasm.wasm"); - - return fetch(wasmUrl).then(resp => resp.arrayBuffer()).then(buffer => { - return onigasm.loadWASM(buffer); - }).then(() => { - res({ - createOnigScanner: function (patterns) { return new onigasm.OnigScanner(patterns); }, - createOnigString: function (s) { return new onigasm.OnigString(s); }, - }); - }).catch(reason => rej(reason)); - }); - }, - loadGrammar: async (scopeName: string) => { - if (scopeToGrammar[scopeName]) { - return scopeToGrammar[scopeName]; - } - - return opts.loadGrammar(scopeName); - }, - }); - } -}; - -enum StandardTokenType { - Other = 0, - Comment = 1, - String = 2, - RegEx = 4, -} - -// tslint:disable-next-line no-any to override const -(target as any).StandardTokenType = StandardTokenType; diff --git a/packages/vscode/src/fill/windowsService.ts b/packages/vscode/src/fill/windowsService.ts deleted file mode 100644 index d89c8420dc6d..000000000000 --- a/packages/vscode/src/fill/windowsService.ts +++ /dev/null @@ -1,360 +0,0 @@ -import * as electron from "electron"; -import { Emitter } from "@coder/events"; -import { logger } from "@coder/logger"; -import { IWindowsService, INativeOpenDialogOptions, MessageBoxOptions, SaveDialogOptions, OpenDialogOptions, IMessageBoxResult, IDevToolsOptions, IEnterWorkspaceResult, CrashReporterStartOptions, INewWindowOptions, IOpenFileRequest, IAddFoldersRequest, IURIToOpen, IOpenSettings } from "vs/platform/windows/common/windows"; -import { ParsedArgs } from "vs/platform/environment/common/environment"; -import { IWorkspaceIdentifier, IWorkspaceFolderCreationData, ISingleFolderWorkspaceIdentifier } from "vs/platform/workspaces/common/workspaces"; -import { URI } from "vs/base/common/uri"; -import { IRecentlyOpened, IRecent } from "vs/platform/history/common/history"; -import { ISerializableCommandAction } from "vs/platform/actions/common/actions"; -import { client } from "../client"; -import { showOpenDialog } from "../dialog"; -import { workbench } from "../workbench"; - -// tslint:disable completed-docs - -// VS Code overrides window.open to call openExternal, but we then call -// window.open which results in an infinite loop. Store the function but also -// make it unable to be set (doesn't work otherwise). -const windowOpen = window.open; -Object.defineProperty(window, "open", { - set: (): void => { /* Not allowed. */ }, - get: (): Function => windowOpen, -}); - -/** - * Instead of going to the shared process, we'll directly run these methods on - * the client. This setup means we can only control the current window. - */ -export class WindowsService implements IWindowsService { - // tslint:disable-next-line no-any - public _serviceBrand: any; - - private readonly openEmitter = new Emitter(); - private readonly focusEmitter = new Emitter(); - private readonly blurEmitter = new Emitter(); - private readonly maximizeEmitter = new Emitter(); - private readonly unmaximizeEmitter = new Emitter(); - private readonly recentlyOpenedChangeEmitter = new Emitter(); - - public readonly onWindowOpen = this.openEmitter.event; - public readonly onWindowFocus = this.focusEmitter.event; - public readonly onWindowBlur = this.blurEmitter.event; - public readonly onWindowMaximize = this.maximizeEmitter.event; - public readonly onWindowUnmaximize = this.unmaximizeEmitter.event; - public readonly onRecentlyOpenedChange = this.recentlyOpenedChangeEmitter.event; - - private readonly window = new electron.BrowserWindow(); - - // Dialogs - public async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise { - showOpenDialog({ - ...(options.dialogOptions || {}), - properties: { - openFile: true, - openDirectory: true, - }, - }).then((path) => { - // tslint:disable-next-line:no-any - (electron.ipcMain).send("vscode:openFiles", { - filesToOpen: [{ - fileUri: URI.file(path), - }], - } as IOpenFileRequest); - }).catch((ex) => { - logger.error(ex.message); - }); - } - - public async pickFileAndOpen(options: INativeOpenDialogOptions): Promise { - showOpenDialog({ - ...(options.dialogOptions || {}), - properties: { - openFile: true, - }, - }).then((path) => { - // tslint:disable-next-line:no-any - (electron.ipcMain).send("vscode:openFiles", { - filesToOpen: [{ - fileUri: URI.file(path), - }], - } as IOpenFileRequest); - }).catch((ex) => { - logger.error(ex.message); - }); - } - - public async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise { - if (!options.dialogOptions) { - options.dialogOptions = {}; - } - if (!options.dialogOptions.title) { - options.dialogOptions.title = "Open Folder"; - } - showOpenDialog({ - ...(options.dialogOptions || {}), - properties: { - openDirectory: true, - }, - }).then((path) => { - workbench.workspace = URI.file(path); - }).catch((ex) => { - logger.error(ex.message); - }); - } - - public async pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise { - showOpenDialog({ - ...(options.dialogOptions || {}), - properties: { - openDirectory: true, - }, - }).then((path) => { - // tslint:disable-next-line:no-any - (electron.ipcMain).send("vscode:addFolders", { - foldersToAdd: [URI.file(path)], - } as IAddFoldersRequest); - }).catch((ex) => { - logger.error(ex.message); - }); - } - - public showMessageBox(windowId: number, options: MessageBoxOptions): Promise { - return new Promise((resolve): void => { - electron.dialog.showMessageBox(this.getWindowById(windowId), options, (response, checkboxChecked) => { - resolve({ - button: response, - checkboxChecked, - }); - }); - }); - } - - public showSaveDialog(windowId: number, options: SaveDialogOptions): Promise { - return new Promise((resolve): void => { - electron.dialog.showSaveDialog(this.getWindowById(windowId), options, (filename, _bookmark) => { - resolve(filename); - }); - }); - } - - public async showOpenDialog(_windowId: number, options: OpenDialogOptions): Promise { - return [await showOpenDialog({ - ...(options || {}), - properties: { - openDirectory: options && options.properties && options.properties.includes("openDirectory") || false, - openFile: options && options.properties && options.properties.includes("openFile") || false, - }, - })]; - } - - public reloadWindow(windowId: number, _args?: ParsedArgs): Promise { - return Promise.resolve(this.getWindowById(windowId).reload()); - } - - public openDevTools(_windowId: number, _options?: IDevToolsOptions): Promise { - throw new Error("not implemented"); - } - - public toggleDevTools(_windowId: number): Promise { - throw new Error("Toggling developer tools from JavaScript is not supported."); - } - - public closeWorkspace(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public enterWorkspace(_windowId: number, uri: URI): Promise { - if (uri.path.endsWith(".json")) { - workbench.workspace = { - id: "Untitled", - configPath: uri, - }; - } else { - workbench.workspace = uri; - } - - return undefined!; - } - - public createAndEnterWorkspace(_windowId: number, _folders?: IWorkspaceFolderCreationData[], _path?: string): Promise { - throw new Error("not implemented"); - } - - public saveAndEnterWorkspace(_windowId: number, _path: string): Promise { - throw new Error("not implemented"); - } - - public toggleFullScreen(windowId: number): Promise { - const win = this.getWindowById(windowId); - - return Promise.resolve(win.setFullScreen(!win.isFullScreen())); - } - - public setRepresentedFilename(windowId: number, fileName: string): Promise { - return Promise.resolve(this.getWindowById(windowId).setRepresentedFilename(fileName)); - } - - public addRecentlyOpened(_files: IRecent[]): Promise { - throw new Error("not implemented"); - } - - public removeFromRecentlyOpened(_paths: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI | string)[]): Promise { - throw new Error("not implemented"); - } - - public clearRecentlyOpened(): Promise { - throw new Error("not implemented"); - } - - public getRecentlyOpened(_windowId: number): Promise { - // TODO: properly implement. - return Promise.resolve({ - workspaces: [], - files: [], - }); - } - - public focusWindow(windowId: number): Promise { - return Promise.resolve(this.getWindowById(windowId).focus()); - } - - public closeWindow(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public isFocused(windowId: number): Promise { - return Promise.resolve(this.getWindowById(windowId).isFocused()); - } - - public isMaximized(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public maximizeWindow(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public unmaximizeWindow(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public minimizeWindow(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public onWindowTitleDoubleClick(_windowId: number): Promise { - throw new Error("not implemented"); - } - - public setDocumentEdited(_windowId: number, _flag: boolean): Promise { - throw new Error("not implemented"); - } - - public quit(): Promise { - throw new Error("not implemented"); - } - - public relaunch(_options: { addArgs?: string[], removeArgs?: string[] }): Promise { - throw new Error("not implemented"); - } - - // macOS Native Tabs - public newWindowTab(): Promise { - throw new Error("not implemented"); - } - - public showPreviousWindowTab(): Promise { - throw new Error("not implemented"); - } - - public showNextWindowTab(): Promise { - throw new Error("not implemented"); - } - - public moveWindowTabToNewWindow(): Promise { - throw new Error("not implemented"); - } - - public mergeAllWindowTabs(): Promise { - throw new Error("not implemented"); - } - - public toggleWindowTabsBar(): Promise { - throw new Error("not implemented"); - } - - // macOS TouchBar - public updateTouchBar(_windowId: number, _items: ISerializableCommandAction[][]): Promise { - throw new Error("not implemented"); - } - - // Shared process - public async whenSharedProcessReady(): Promise { - await client.sharedProcessData; - } - - public toggleSharedProcess(): Promise { - throw new Error("not implemented"); - } - - // Global methods - public openWindow(_windowId: number, _uris: IURIToOpen[], _options?: IOpenSettings): Promise { - throw new Error("not implemented"); - } - - public openNewWindow(_options?: INewWindowOptions): Promise { - throw new Error("not implemented"); - } - - public showWindow(windowId: number): Promise { - return Promise.resolve(this.getWindowById(windowId).show()); - } - - public getWindows(): Promise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]> { - throw new Error("not implemented"); - } - - public getWindowCount(): Promise { - return Promise.resolve(1); - } - - public log(_severity: string, ..._messages: string[]): Promise { - throw new Error("not implemented"); - } - - public async showItemInFolder(uri: URI): Promise { - workbench.workspace = uri; - } - - public getActiveWindowId(): Promise { - return Promise.resolve(1); - } - - public async openExternal(_url: string): Promise { - return typeof window.open(_url, "_blank") !== "undefined"; - } - - public startCrashReporter(_config: CrashReporterStartOptions): Promise { - throw new Error("not implemented"); - } - - public openAboutDialog(): Promise { - throw new Error("not implemented"); - } - - public resolveProxy(windowId: number, url: string): Promise { - return new Promise((resolve): void => { - this.getWindowById(windowId).webContents.session.resolveProxy(url, (proxy) => { - resolve(proxy); - }); - }); - } - - /** - * Get window by ID. For now this is always the current window. - */ - private getWindowById(_windowId: number): electron.BrowserWindow { - return this.window; - } -} diff --git a/packages/vscode/src/fill/workbenchRegistry.ts b/packages/vscode/src/fill/workbenchRegistry.ts deleted file mode 100644 index 69f8e5f28496..000000000000 --- a/packages/vscode/src/fill/workbenchRegistry.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { logger } from "@coder/logger"; -import { IDisposable } from "vs/base/common/lifecycle"; -import { Registry } from "vs/platform/registry/common/platform"; -import { IWorkbenchActionRegistry, Extensions } from "vs/workbench/common/actions"; -import { SyncActionDescriptor } from "vs/platform/actions/common/actions"; -import { ContextKeyExpr } from "vs/platform/contextkey/common/contextkey"; -import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions"; -import { TerminalPasteAction } from "vs/workbench/contrib/terminal/browser/terminalActions"; -import { KEYBINDING_CONTEXT_TERMINAL_FOCUS } from "vs/workbench/contrib/terminal/common/terminal"; -import { KeyCode, KeyMod } from "vs/base/common/keyCodes"; -import { workbench } from "../workbench"; - -// Intercept adding workbench actions so we can skip actions that won't work or -// modify actions that need different conditions, keybindings, etc. -const registry = Registry.as(Extensions.WorkbenchActions); -const originalRegister = registry.registerWorkbenchAction.bind(registry); -registry.registerWorkbenchAction = (descriptor: SyncActionDescriptor, alias: string, category?: string, when?: ContextKeyExpr): IDisposable => { - switch (descriptor.id) { - case ToggleDevToolsAction.ID: // There appears to be no way to toggle this programmatically. - logger.debug(`Skipping unsupported workbench action ${descriptor.id}`); - - return { - dispose: (): void => undefined, - }; - - case TerminalPasteAction.ID: // Modify the Windows keybinding and add our context key. - // tslint:disable-next-line no-any override private - (descriptor as any)._keybindings = { - primary: KeyMod.CtrlCmd | KeyCode.KEY_V, - linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_V }, - win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V }, - mac: { primary: 0 }, - }; - // tslint:disable-next-line no-any override private - (descriptor as any)._keybindingContext = ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_FOCUS, workbench.clipboardContextKey); - } - - return originalRegister(descriptor, alias, category, when); -}; diff --git a/packages/vscode/src/fill/workspacesService.ts b/packages/vscode/src/fill/workspacesService.ts deleted file mode 100644 index 3456aab546c4..000000000000 --- a/packages/vscode/src/fill/workspacesService.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { URI } from "vs/base/common/uri"; -import { IEnvironmentService } from "vs/platform/environment/common/environment"; -import { ILogService } from "vs/platform/log/common/log"; -import { IWorkspaceFolderCreationData, IWorkspaceIdentifier, IWorkspacesService } from "vs/platform/workspaces/common/workspaces"; -import { WorkspacesMainService } from "vs/platform/workspaces/electron-main/workspacesMainService"; -import * as workspacesIpc from "vs/platform/workspaces/node/workspacesIpc"; -import { workbench } from "../workbench"; - -/** - * Instead of going to the shared process, we'll directly run these methods on - * the client. This setup means we can only control the current window. - */ -class WorkspacesService implements IWorkspacesService { - // tslint:disable-next-line:no-any - public _serviceBrand: any; - - public createUntitledWorkspace(folders?: IWorkspaceFolderCreationData[] | undefined): Promise { - const mainService = new WorkspacesMainService( - workbench.serviceCollection.get(IEnvironmentService) as IEnvironmentService, - workbench.serviceCollection.get(ILogService) as ILogService, - ); - - // lib/vscode/src/vs/platform/workspaces/node/workspacesIpc.ts - const rawFolders: IWorkspaceFolderCreationData[] = folders!; - if (Array.isArray(rawFolders)) { - folders = rawFolders.map(rawFolder => { - return { - uri: URI.revive(rawFolder.uri), // convert raw URI back to real URI - name: rawFolder.name!, - } as IWorkspaceFolderCreationData; - }); - } - - return mainService.createUntitledWorkspace(folders); - } -} - -const target = workspacesIpc as typeof workspacesIpc; -// @ts-ignore TODO: don't ignore it. -target.WorkspacesChannelClient = WorkspacesService; diff --git a/packages/vscode/src/fill/zip.ts b/packages/vscode/src/fill/zip.ts deleted file mode 100644 index b7aafb20ecc5..000000000000 --- a/packages/vscode/src/fill/zip.ts +++ /dev/null @@ -1,219 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as nls from "vs/nls"; -import * as vszip from "vszip"; -import * as fs from "fs"; -import * as path from "path"; -import * as tarStream from "tar-stream"; -import { promisify } from "util"; -import { CancellationToken } from "vs/base/common/cancellation"; -import { mkdirp } from "vs/base/node/pfs"; - -export interface IExtractOptions { - overwrite?: boolean; - - /** - * Source path within the TAR/ZIP archive. Only the files - * contained in this path will be extracted. - */ - sourcePath?: string; -} - -export interface IFile { - path: string; - contents?: Buffer | string; - localPath?: string; -} - -/** - * Override the standard VS Code behavior for zipping - * extensions to use the TAR format instead of ZIP. - */ -export const zip = (tarPath: string, files: IFile[]): Promise => { - return new Promise((c, e): void => { - const pack = tarStream.pack(); - const chunks: Buffer[] = []; - const ended = new Promise((res): void => { - pack.on("end", () => { - res(Buffer.concat(chunks)); - }); - }); - pack.on("data", (chunk) => { - chunks.push(chunk as Buffer); - }); - for (let i = 0; i < files.length; i++) { - const file = files[i]; - pack.entry({ - name: file.path, - }, file.contents); - } - pack.finalize(); - - ended.then((buffer) => { - return promisify(fs.writeFile)(tarPath, buffer); - }).then(() => { - c(tarPath); - }).catch((ex) => { - e(ex); - }); - }); -}; - -/** - * Override the standard VS Code behavior for extracting - * archives, to first attempt to process the archive as a TAR - * and then fallback on the original implementation, for processing - * ZIPs. - */ -export const extract = (archivePath: string, extractPath: string, options: IExtractOptions = {}, token: CancellationToken): Promise => { - return new Promise((c, e): void => { - extractTar(archivePath, extractPath, options, token).then(c).catch((ex) => { - if (!ex.toString().includes("Invalid tar header")) { - e(ex); - - return; - } - vszip.extract(archivePath, extractPath, options, token).then(c).catch(e); - }); - }); -}; - -/** - * Override the standard VS Code behavior for buffering - * archives, to first process the Buffer as a TAR and then - * fallback on the original implementation, for processing ZIPs. - */ -export const buffer = (targetPath: string, filePath: string): Promise => { - return new Promise((c, e): void => { - let done: boolean = false; - extractAssets(targetPath, new RegExp(filePath), (assetPath: string, data: Buffer) => { - if (path.normalize(assetPath) === path.normalize(filePath)) { - done = true; - c(data); - } - }).then(() => { - if (!done) { - e("couldn't find asset " + filePath); - } - }).catch((ex) => { - if (!ex.toString().includes("Invalid tar header")) { - e(ex); - - return; - } - vszip.buffer(targetPath, filePath).then(c).catch(e); - }); - }); -}; - -/** - * Override the standard VS Code behavior for extracting assets - * from archive Buffers to use the TAR format instead of ZIP. - */ -export const extractAssets = (tarPath: string, match: RegExp, callback: (path: string, data: Buffer) => void): Promise => { - return new Promise(async (c, e): Promise => { - try { - const buffer = await promisify(fs.readFile)(tarPath); - const extractor = tarStream.extract(); - extractor.once("error", e); - extractor.on("entry", (header, stream, next) => { - const name = header.name; - if (match.test(name)) { - extractData(stream).then((data) => { - callback(name, data); - next(); - }).catch(e); - stream.resume(); - } else { - stream.on("end", () => { - next(); - }); - stream.resume(); - } - }); - extractor.on("finish", () => { - c(); - }); - extractor.write(buffer); - extractor.end(); - } catch (ex) { - e(ex); - } - }); -}; - -const extractData = (stream: NodeJS.ReadableStream): Promise => { - return new Promise((c, e): void => { - const fileData: Buffer[] = []; - stream.on("data", (data) => fileData.push(data)); - stream.on("end", () => { - const fd = Buffer.concat(fileData); - c(fd); - }); - stream.on("error", e); - }); -}; - -const extractTar = (tarPath: string, targetPath: string, options: IExtractOptions = {}, token: CancellationToken): Promise => { - return new Promise(async (c, e): Promise => { - try { - const sourcePathRegex = new RegExp(options.sourcePath ? `^${options.sourcePath}` : ""); - const buffer = await promisify(fs.readFile)(tarPath); - const extractor = tarStream.extract(); - extractor.once("error", e); - extractor.on("entry", (header, stream, next) => { - const rawName = path.normalize(header.name); - - const nextEntry = (): void => { - stream.resume(); - next(); - }; - - if (token.isCancellationRequested) { - return nextEntry(); - } - - if (!sourcePathRegex.test(rawName)) { - return nextEntry(); - } - - const fileName = rawName.replace(sourcePathRegex, ""); - const targetFileName = path.join(targetPath, fileName); - if (/\/$/.test(fileName)) { - stream.resume(); - mkdirp(targetFileName).then(() => { - next(); - }, e); - - return; - } - - const dirName = path.dirname(fileName); - const targetDirName = path.join(targetPath, dirName); - if (targetDirName.indexOf(targetPath) !== 0) { - e(nls.localize("invalid file", "Error extracting {0}. Invalid file.", fileName)); - - return nextEntry(); - } - - return mkdirp(targetDirName, undefined, token).then(() => { - const fstream = fs.createWriteStream(targetFileName, { mode: header.mode }); - fstream.once("close", () => { - next(); - }); - fstream.once("error", e); - stream.pipe(fstream); - stream.resume(); - }); - }); - extractor.once("finish", c); - extractor.write(buffer); - extractor.end(); - } catch (ex) { - e(ex); - } - }); -}; diff --git a/packages/vscode/src/index.ts b/packages/vscode/src/index.ts deleted file mode 100644 index 5ec76921e18e..000000000000 --- a/packages/vscode/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client"; diff --git a/packages/vscode/src/vscode-coder.svg b/packages/vscode/src/vscode-coder.svg deleted file mode 100644 index d938d39ee2a4..000000000000 --- a/packages/vscode/src/vscode-coder.svg +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/vscode/src/vscode.scss b/packages/vscode/src/vscode.scss deleted file mode 100644 index 9b40371a9884..000000000000 --- a/packages/vscode/src/vscode.scss +++ /dev/null @@ -1,59 +0,0 @@ -// These use -webkit-margin-before/after which don't work. -.monaco-workbench > .part > .title > .title-label h2, -.monaco-panel-view .panel > .panel-header h3.title { - margin-top: 0; - margin-bottom: 0; -} - -.monaco-icon-label > .monaco-icon-label-description-container { - margin-right: auto; -} - -.monaco-icon-label > .decorations-wrapper { - display: flex; - flex-direction: row; - padding-right: 12px; -} - -.monaco-icon-label::after { - margin-left: initial; -} - -// We don't have rating data. -.extension-ratings { - display: none !important; -} - -// Using @supports to keep the Firefox fixes completely separate from vscode's -// CSS that is tailored for Chrome. -@supports (-moz-appearance:none) { - // Fix buttons getting cut off on notifications. - .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container .monaco-button.monaco-text-button { - max-width: 100%; - width: auto; - } - - .monaco-shell .screen-reader-detected-explanation .buttons a, - .monaco-workbench > .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink, - .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container .monaco-button { - max-width: -moz-fit-content; - } - - .monaco-workbench > .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit, - .explorer-viewlet .panel-header .count, - .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .version, - .debug-viewlet .debug-call-stack .stack-frame .label { - min-width: -moz-fit-content; - } -} - -.window-appicon { - background-image: url(./vscode-coder.svg) !important; - background-size: 56px !important; - width: 56px !important; - margin-right: 4px; -} - -.window-controls-container { - display: none !important; -} \ No newline at end of file diff --git a/packages/vscode/src/workbench.ts b/packages/vscode/src/workbench.ts deleted file mode 100644 index c2499e87a1f6..000000000000 --- a/packages/vscode/src/workbench.ts +++ /dev/null @@ -1,240 +0,0 @@ -import * as os from "os"; -import { IProgress, INotificationHandle } from "@coder/ide"; -import { logger } from "@coder/logger"; -import { client } from "./client"; - -import "./fill/platform"; -import "./fill/dom"; -import "./fill/codeEditor"; -import "./fill/environmentService"; -import "./fill/labels"; -import "./fill/menuRegistry"; -import "./fill/mouseEvent"; -import "./fill/storageDatabase"; -import "./fill/vscodeTextmate"; -import "./fill/windowsService"; -import "./fill/workbenchRegistry"; -import "./fill/workspacesService"; -import * as paths from "./fill/paths"; -import { PasteAction } from "./fill/paste"; - -import { ExplorerItem, ExplorerModel } from "vs/workbench/contrib/files/common/explorerModel"; -import { IEditorGroup } from "vs/workbench/services/editor/common/editorGroupsService"; -import { IEditorService, IResourceEditor } from "vs/workbench/services/editor/common/editorService"; -import { INotificationService } from "vs/platform/notification/common/notification"; -import { IProgressService2, ProgressLocation } from "vs/platform/progress/common/progress"; -import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from "vs/platform/workspaces/common/workspaces"; -import { IWindowsService, IWindowConfiguration } from "vs/platform/windows/common/windows"; -import { LogLevel } from "vs/platform/log/common/log"; -import { RawContextKey, IContextKeyService } from "vs/platform/contextkey/common/contextkey"; -import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection"; -import { URI } from "vs/base/common/uri"; - -/** - * Initializes VS Code and provides a way to call into general client - * functionality. - */ -export class Workbench { - public readonly retry = client.retry; - - private readonly windowId = parseInt(new Date().toISOString().replace(/[-:.TZ]/g, ""), 10); - private _serviceCollection: ServiceCollection | undefined; - private _clipboardContextKey: RawContextKey | undefined; - - /** - * Handle a drop event on the file explorer. - */ - public async handleExternalDrop(target: ExplorerItem | ExplorerModel, originalEvent: DragEvent): Promise { - await client.upload.uploadDropped( - originalEvent, - (target instanceof ExplorerItem ? target : target.roots[0]).resource, - ); - } - - /** - * Handle a drop event on the editor. - */ - public handleDrop(event: DragEvent, resolveTargetGroup: () => IEditorGroup, afterDrop: (targetGroup: IEditorGroup) => void, targetIndex?: number): void { - client.upload.uploadDropped(event, URI.file(paths.getWorkingDirectory())).then(async (paths) => { - const uris = paths.map((p) => URI.file(p)); - if (uris.length) { - await (this.serviceCollection.get(IWindowsService) as IWindowsService).addRecentlyOpened(uris); - } - - const editors: IResourceEditor[] = uris.map(uri => ({ - resource: uri, - options: { - pinned: true, - index: targetIndex, - }, - })); - - const targetGroup = resolveTargetGroup(); - await (this.serviceCollection.get(IEditorService) as IEditorService).openEditors(editors, targetGroup); - afterDrop(targetGroup); - }).catch((error) => { - logger.error(error.message); - }); - } - - /** - * Use to toggle the paste option inside editors based on the native clipboard. - */ - public get clipboardContextKey(): RawContextKey { - if (!this._clipboardContextKey) { - throw new Error("Trying to access clipboard context key before it has been set"); - } - - return this._clipboardContextKey; - } - - public get clipboardText(): Promise { - return client.clipboard.readText(); - } - - /** - * Create a paste action for use in text inputs. - */ - public get pasteAction(): PasteAction { - return new PasteAction(); - } - - public set workspace(ws: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined) { - if (typeof ws === "undefined") { - window.localStorage.removeItem("workspace"); - } else { - window.localStorage.setItem("workspace", JSON.stringify(ws)); - } - - location.reload(); - } - - public get workspace(): undefined | IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier { - const ws = window.localStorage.getItem("workspace"); - try { - return JSON.parse(ws!); - } catch (ex) { - return undefined; - } - } - - public get serviceCollection(): ServiceCollection { - if (!this._serviceCollection) { - throw new Error("Trying to access service collection before it has been set"); - } - - return this._serviceCollection; - } - - public set serviceCollection(collection: ServiceCollection) { - this._serviceCollection = collection; - - const contextKeys = this.serviceCollection.get(IContextKeyService) as IContextKeyService; - const bounded = this.clipboardContextKey.bindTo(contextKeys); - client.clipboard.onPermissionChange((enabled) => { - bounded.set(enabled); - }); - client.clipboard.initialize(); - - client.progressService = { - start: (title: string, task: (progress: IProgress) => Promise, onCancel: () => void): Promise => { - let lastProgress = 0; - - return (this.serviceCollection.get(IProgressService2) as IProgressService2).withProgress({ - location: ProgressLocation.Notification, - title, - cancellable: true, - }, (progress) => { - return task({ - report: (p): void => { - progress.report({ increment: p - lastProgress }); - lastProgress = p; - }, - }); - }, () => { - onCancel(); - }); - }, - }; - - client.notificationService = { - error: (error: Error): void => (this.serviceCollection.get(INotificationService) as INotificationService).error(error), - prompt: (severity, message, buttons, onCancel): INotificationHandle => { - const handle = (this.serviceCollection.get(INotificationService) as INotificationService).prompt( - severity, message, buttons, { onCancel }, - ); - - return { - close: (): void => handle.close(), - updateMessage: (message): void => handle.updateMessage(message), - updateButtons: (buttons): void => handle.updateActions({ - primary: buttons.map((button) => ({ - id: "", - label: button.label, - tooltip: "", - class: undefined, - enabled: true, - checked: false, - radio: false, - dispose: (): void => undefined, - run: (): Promise => Promise.resolve(button.run()), - })), - }), - }; - }, - }; - } - - /** - * Start VS Code. - */ - public async initialize(): Promise { - this._clipboardContextKey = new RawContextKey("nativeClipboard", client.clipboard.isEnabled); - - const workspace = this.workspace || URI.file(paths.getWorkingDirectory()); - // If we try to import this above, workbench will be undefined due to - // circular imports. - require("vs/workbench/workbench.main"); - const { main } = require("vs/workbench/electron-browser/main"); - const config: IWindowConfiguration = { - machineId: "1", - windowId: this.windowId, - logLevel: LogLevel.Info, - mainPid: 1, - appRoot: paths.getDefaultUserDataPath(), - execPath: os.tmpdir(), - userEnv: {}, - nodeCachedDataDir: os.tmpdir(), - perfEntries: [], - _: [], - }; - if ((workspace as IWorkspaceIdentifier).configPath) { - // tslint:disable-next-line:no-any - let wid: IWorkspaceIdentifier = (Object).assign({}, workspace); - if (!URI.isUri(wid.configPath)) { - // Ensure that the configPath is a valid URI. - wid.configPath = URI.file(wid.configPath); - } - config.workspace = wid; - } else { - config.folderUri = workspace as URI; - } - try { - await main(config); - } catch (ex) { - if (ex.toString().indexOf("UriError") !== -1 || ex.toString().indexOf("backupPath") !== -1) { - /** - * Resolves the error of the workspace identifier being invalid. - */ - // tslint:disable-next-line:no-console - console.error(ex); - this.workspace = undefined; - location.reload(); - - return; - } - } - } -} - -export const workbench = new Workbench(); diff --git a/packages/vscode/test/test-extension.tar b/packages/vscode/test/test-extension.tar deleted file mode 100644 index bd1f69c39ee4..000000000000 Binary files a/packages/vscode/test/test-extension.tar and /dev/null differ diff --git a/packages/vscode/test/test-extension.vsix b/packages/vscode/test/test-extension.vsix deleted file mode 100644 index 3c133799fed9..000000000000 Binary files a/packages/vscode/test/test-extension.vsix and /dev/null differ diff --git a/packages/vscode/test/zip.test.ts b/packages/vscode/test/zip.test.ts deleted file mode 100644 index e7685dc40a5a..000000000000 --- a/packages/vscode/test/zip.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import * as zip from "../src/fill/zip"; -import * as path from "path"; -import * as fs from "fs"; -import * as cp from "child_process"; -import { CancellationToken } from "vs/base/common/cancellation"; - -// tslint:disable-next-line:no-any -jest.mock("vs/nls", () => ({ "localize": (...args: any): string => `${JSON.stringify(args)}` })); - -describe("zip", () => { - const tarPath = path.resolve(__dirname, "./test-extension.tar"); - const vsixPath = path.resolve(__dirname, "./test-extension.vsix"); - const extractPath = path.resolve(__dirname, "./.test-extension"); - - beforeEach(() => { - if (!fs.existsSync(extractPath) || path.dirname(extractPath) !== __dirname) { - return; - } - cp.execSync(`rm -rf '${extractPath}'`); - }); - - const resolveExtract = async (archivePath: string): Promise => { - expect(fs.existsSync(archivePath)).toEqual(true); - await expect(zip.extract( - archivePath, - extractPath, - { sourcePath: "extension", overwrite: true }, - CancellationToken.None, - )).resolves.toBe(undefined); - expect(fs.existsSync(extractPath)).toEqual(true); - }; - - // tslint:disable-next-line:no-any - const extract = (archivePath: string): () => any => { - // tslint:disable-next-line:no-any - return async (): Promise => { - await resolveExtract(archivePath); - expect(fs.existsSync(path.resolve(extractPath, ".vsixmanifest"))).toEqual(true); - expect(fs.existsSync(path.resolve(extractPath, "package.json"))).toEqual(true); - }; - }; - it("should extract from tarred VSIX", extract(tarPath), 2000); - it("should extract from zipped VSIX", extract(vsixPath), 2000); - - // tslint:disable-next-line:no-any - const buffer = (archivePath: string): () => any => { - // tslint:disable-next-line:no-any - return async (): Promise => { - await resolveExtract(archivePath); - const manifestPath = path.resolve(extractPath, ".vsixmanifest"); - expect(fs.existsSync(manifestPath)).toEqual(true); - const manifestBuf = fs.readFileSync(manifestPath); - expect(manifestBuf.length).toBeGreaterThan(0); - await expect(zip.buffer(archivePath, "extension.vsixmanifest")).resolves.toEqual(manifestBuf); - }; - }; - it("should buffer tarred VSIX", buffer(tarPath), 2000); - it("should buffer zipped VSIX", buffer(vsixPath), 2000); -}); diff --git a/packages/vscode/webpack.bootstrap.config.js b/packages/vscode/webpack.bootstrap.config.js deleted file mode 100644 index c3d667fae8a1..000000000000 --- a/packages/vscode/webpack.bootstrap.config.js +++ /dev/null @@ -1,78 +0,0 @@ -const path = require("path"); -const merge = require("webpack-merge"); - -const root = path.resolve(__dirname, "../.."); -const fills = path.join(root, "packages/ide/src/fill"); -const vsFills = path.join(root, "packages/vscode/src/fill"); - -module.exports = merge( - require(path.join(root, "scripts/webpack.node.config.js"))({ - dirname: __dirname, - typescriptCompilerOptions: { - target: "es6", - }, - }), { - entry: path.join(root, "lib/vscode/src/bootstrap-fork.js"), - mode: "development", - output: { - chunkFilename: "[name].bundle.js", - publicPath: "/", - filename: "bootstrap-fork.js", - libraryTarget: "commonjs", - globalObject: "this", - }, - // Due to the dynamic `require.context` we add to `loader.js` Webpack tries - // to include way too much. We can modify what Webpack imports in this case - // (I believe), but for now ignore some things. - module: { - rules: [{ - test: /\.(txt|d\.ts|perf\.data\.js|jxs|scpt|exe|sh|less|html|s?css|qwoff|md|svg|png|ttf|woff|eot|woff2)$/, - use: [{ - loader: "ignore-loader", - }], - }, { - test: /test|tsconfig/, - use: [{ - loader: "ignore-loader", - }], - }, { - // The only thing we need in electron-browser is the shared process (including contrib). - test: /((\\|\/)vs(\\|\/)code(\\|\/)electron-main(\\|\/))|((\\|\/)test(\\|\/))|(OSSREADME\.json$)|\/browser\/|\/electron-browser\/(?!sharedProcess\/).+\//, - use: [{ - loader: "ignore-loader", - }], - }], - noParse: /(\\|\/)test(\\|\/)|\.test\.jsx?|\.test\.tsx?|tsconfig.+\.json$/, - }, - resolve: { - alias: { - "gc-signals": path.join(fills, "empty.ts"), - "node-pty": path.resolve(fills, "empty.ts"), - "windows-mutex": path.resolve(fills, "empty.ts"), - "windows-process-tree": path.resolve(fills, "empty.ts"), - "vscode-windows-registry": path.resolve(fills, "empty.ts"), - "vscode-windows-ca-certs": path.resolve(fills, "empty.ts"), - "vscode-sqlite3": path.resolve(fills, "empty.ts"), - "vs/base/browser/browser": path.resolve(fills, "empty.ts"), - - "applicationinsights": path.join(vsFills, "applicationInsights.ts"), - "electron": path.join(vsFills, "stdioElectron.ts"), - "vscode-ripgrep": path.join(vsFills, "ripgrep.ts"), - "native-keymap": path.join(vsFills, "native-keymap.ts"), - "native-watchdog": path.join(vsFills, "native-watchdog.ts"), - "vs/base/common/amd": path.resolve(vsFills, "amd.ts"), - "vs/base/node/paths": path.join(vsFills, "paths.ts"), - "vs/platform/product/node/package": path.resolve(vsFills, "package.ts"), - "vs/platform/product/node/product": path.resolve(vsFills, "product.ts"), - "vs/base/node/zip": path.resolve(vsFills, "zip.ts"), - "vszip": path.resolve(root, "lib/vscode/src/vs/base/node/zip.ts"), - "vs": path.resolve(root, "lib/vscode/src/vs"), - }, - }, - resolveLoader: { - alias: { - "vs/css": path.resolve(vsFills, "css.js"), - }, - }, - } -); diff --git a/packages/vscode/yarn.lock b/packages/vscode/yarn.lock deleted file mode 100644 index 635b9297b5c4..000000000000 --- a/packages/vscode/yarn.lock +++ /dev/null @@ -1,233 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@*": - version "11.9.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.6.tgz#c632bbcc780a1349673a6e2e9b9dfa8c369d3c74" - integrity sha512-4hS2K4gwo9/aXIcoYxCtHpdgd8XUeDmo1siRCAH3RziXB65JlPqUFMtfy9VPj+og7dp3w1TFjGwYga4e0m9GwA== - -"@types/tar-stream@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@types/tar-stream/-/tar-stream-1.6.0.tgz#e19893886625c4ec1c7c30a353b8dc10e205c742" - integrity sha512-XG7FGVmxUvC5NW4h63K3PbB0xdC21xZBfoqmEz7YP2DdiTeYKmYAg8quSHMndNP3iXfs7C73rg4Q0W1dOPHBXQ== - dependencies: - "@types/node" "*" - -ajv-keywords@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" - integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= - -ajv@^6.1.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.7.0.tgz#e3ce7bb372d6577bb1839f1dfdfcbf5ad2948d96" - integrity sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -bl@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-3.0.0.tgz#3611ec00579fd18561754360b21e9f784500ff88" - integrity sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A== - dependencies: - readable-stream "^3.0.1" - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - -end-of-stream@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== - dependencies: - once "^1.4.0" - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -inherits@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -loader-utils@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== - dependencies: - big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" - -lru-cache@^4.1.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -nan@^2.10.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" - integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== - -once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onigasm@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/onigasm/-/onigasm-2.2.1.tgz#d56da809d63d3bb25510e8b8e447ffe98e56bebb" - integrity sha512-pa361CpVfsWOk0MQ1jLuJ1GvEJMHEHgZmaBpOIfBbvbp2crkDHacXB6mA4vgEfO7fL0OEMUSuZjX0Q9yTx6jTg== - dependencies: - lru-cache "^4.1.1" - -oniguruma@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/oniguruma/-/oniguruma-7.0.2.tgz#a5c922cf7066da1dbcc60f6385a90437a83f8d0b" - integrity sha512-zCsdNxTrrB4yVPMxhcIODGv1p4NVBu9WvsWnIGhMpu5djO4MQWXrC7YKjtza+OyoRqqgy27CqYWa1h5e2DDbig== - dependencies: - nan "^2.10.0" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -readable-stream@^3.0.1, readable-stream@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.2.0.tgz#de17f229864c120a9f56945756e4f32c4045245d" - integrity sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -safe-buffer@~5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -schema-utils@^0.4.5: - version "0.4.7" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187" - integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ== - dependencies: - ajv "^6.1.0" - ajv-keywords "^3.1.0" - -string-replace-loader@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.1.1.tgz#b72e7b57b6ef04efe615aff0ad989b5c14ca63d1" - integrity sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ== - dependencies: - loader-utils "^1.1.0" - schema-utils "^0.4.5" - -string_decoder@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== - dependencies: - safe-buffer "~5.1.0" - -tar-stream@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.0.1.tgz#42fbe41cd1cc5e6657c813e7d98e7afca2858a8c" - integrity sha512-I6OJF7wE62BC6zNPdHDtseK0D0187PBjbKSLYY4ffvVkBM6tyBn2O9plDvVM2229/mozfEL/X3++qSvYYQE2xw== - dependencies: - bl "^3.0.0" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -vscode-textmate@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-4.0.1.tgz#6c36f28e9059ce12bc34907f7a33ea43166b26a8" - integrity sha512-gHTXTj04TUgbjB8y7pkVwxOiuCuD6aU5gnFzIByQuqdgFpe/bJaaEIS4geGjbjWbd1XJh6zG1EthLfpNaXEqUw== - dependencies: - oniguruma "^7.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= diff --git a/packages/web/.gitignore b/packages/web/.gitignore deleted file mode 100644 index c585e19389d1..000000000000 --- a/packages/web/.gitignore +++ /dev/null @@ -1 +0,0 @@ -out \ No newline at end of file diff --git a/packages/web/assets/logo.png b/packages/web/assets/logo.png deleted file mode 100644 index c0f9acf03f1a..000000000000 Binary files a/packages/web/assets/logo.png and /dev/null differ diff --git a/packages/web/package.json b/packages/web/package.json deleted file mode 100644 index e823d817930f..000000000000 --- a/packages/web/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "@coder/web", - "scripts": { - "build": "../../node_modules/.bin/cross-env UV_THREADPOOL_SIZE=100 node --max-old-space-size=32384 ../../node_modules/webpack/bin/webpack.js --config ./webpack.config.js" - } -} diff --git a/packages/web/src/index.html b/packages/web/src/index.html deleted file mode 100644 index 4e8473b56c80..000000000000 --- a/packages/web/src/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - code-server - - - - - - diff --git a/packages/web/src/index.scss b/packages/web/src/index.scss deleted file mode 100644 index 87924a468072..000000000000 --- a/packages/web/src/index.scss +++ /dev/null @@ -1,152 +0,0 @@ -html, body { - height: 100%; - margin: 0; - width: 100%; -} - -#overlay { - background: rgba(0, 0, 0, 0.2); - bottom: 0; - left: 0; - position: absolute; - right: 0; - top: 0; -} - -#overlay { - align-items: center; - background-color: #252526; - bottom: 0; - display: flex; - flex-direction: column; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - justify-content: center; - left: 0; - opacity: 1; - position: absolute; - right: 0; - top: 0; - transition: 150ms opacity ease; - z-index: 2; -} - -#overlay > .message { - color: white; - margin-top: 10px; - opacity: 0.5; -} - -#overlay.error > .message { - color: white; - opacity: 0.3; -} - -#overlay > .activitybar { - background-color: rgb(44, 44, 44); - bottom: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 50px; -} - -#overlay > .activitybar svg { - fill: white; - margin-left: 2px; - margin-top: 2px; - opacity: 0.3; -} - -#overlay.error > #status { - opacity: 0; -} - -#overlay>.statusbar { - background-color: rgb(0, 122, 204); - bottom: 0; - cursor: default; - height: 22px; - left: 0; - position: absolute; - right: 0; -} - -#logo { - transform-style: preserve-3d; -} - -#logo > svg { - fill: rgb(0, 122, 204); - opacity: 1; - width: 100px; -} - -#status { - background: rgba(255, 255, 255, 0.1); - border-radius: 5px; - box-shadow: 0px 2px 10px -2px rgba(0, 0, 0, 0.75); - color: white; - font-size: 0.9em; - margin-top: 15px; - min-width: 100px; - position: relative; - transition: 300ms opacity ease; -} - -#progress { - background: rgba(0, 0, 0, 0.2); - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; - bottom: 0; - height: 3px; - left: 0; - overflow: hidden; - position: absolute; - right: 0; -} - -@-moz-keyframes statusProgress { - 0% { - background-position: 0% 50% - } - - 50% { - background-position: 100% 50% - } - - 100% { - background-position: 0% 50% - } -} - -@keyframes statusProgress { - 0% { - background-position: 0% 50% - } - - 50% { - background-position: 100% 50% - } - - 100% { - background-position: 0% 50% - } -} - -#fill { - animation: statusProgress 2s ease infinite; - background-size: 400% 400%; - background: linear-gradient(270deg, #007acc, #0016cc); - height: 100%; - transition: 500ms width ease; - width: 0%; -} - -.reload-button { - background-color: #007acc; - border-radius: 2px; - cursor: pointer; - margin-top: 10px; - padding: 6px 10px; -} diff --git a/packages/web/src/index.ts b/packages/web/src/index.ts deleted file mode 100644 index 6dea31658952..000000000000 --- a/packages/web/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "./index.scss"; -import "@coder/vscode"; diff --git a/packages/web/webpack.config.js b/packages/web/webpack.config.js deleted file mode 100644 index 7d312035a87d..000000000000 --- a/packages/web/webpack.config.js +++ /dev/null @@ -1,85 +0,0 @@ -const path = require("path"); -const merge = require("webpack-merge"); - -const root = path.resolve(__dirname, "../.."); -const fills = path.join(root, "packages/ide/src/fill"); -const vsFills = path.join(root, "packages/vscode/src/fill"); - -module.exports = merge( - require(path.join(root, "scripts/webpack.client.config.js"))({ - dirname: __dirname, - entry: path.join(root, "packages/web/src/index.ts"), - name: "ide", - template: path.join(root, "packages/web/src/index.html"), - typescriptCompilerOptions: { - "target": "es5", - "lib": ["dom", "esnext"], - }, - }, -), { - node: { - module: "empty", - crypto: "empty", - tls: "empty", - }, - resolve: { - alias: { - "gc-signals": path.join(fills, "empty.ts"), - "selenium-webdriver": path.join(fills, "empty.ts"), - "vscode": path.join(fills, "empty.ts"), - "vscode-fsevents": path.join(fills, "empty.ts"), - "vscode-windows-registry": path.resolve(fills, "empty.ts"), - "vsda": path.join(fills, "empty.ts"), - "windows-foreground-love": path.join(fills, "empty.ts"), - "windows-mutex": path.join(fills, "empty.ts"), - "windows-process-tree": path.join(fills, "empty.ts"), - "vscode-sqlite3": path.join(fills, "empty.ts"), - "tls": path.join(fills, "empty.ts"), - "native-is-elevated": path.join(fills, "empty.ts"), - "dns": path.join(fills, "empty.ts"), - "console": path.join(fills, "empty.ts"), - "readline": path.join(fills, "empty.ts"), - "oniguruma": path.join(fills, "empty.ts"), - - // Webpack includes path-browserify but not the latest version, so - // path.posix and path.parse are undefined (among other things possibly). - // Also if we don't provide the full path, the code in vscode will import - // from vscode's node_modules which is the wrong version. - "path": path.join(fills, "path.js"), - "crypto": "crypto-browserify", - "http": "http-browserify", - - "child_process": path.join(fills, "child_process.ts"), - "os": path.join(fills, "os.ts"), - "fs": path.join(fills, "fs.ts"), - "net": path.join(fills, "net.ts"), - "util": path.join(fills, "util.ts"), - "trash": path.join(fills, "trash.ts"), - "electron": path.join(fills, "electron.ts"), - - "native-keymap": path.join(vsFills, "native-keymap.ts"), - "node-pty": path.join(vsFills, "node-pty.ts"), - "graceful-fs": path.join(vsFills, "graceful-fs.ts"), - "spdlog": path.join(vsFills, "spdlog.ts"), - "native-watchdog": path.join(vsFills, "native-watchdog.ts"), - "iconv-lite": path.join(vsFills, "iconv-lite.ts"), - - // This seems to be in the wrong place? - "vs/workbench/contrib/codeEditor/electron-browser/media/WordWrap_16x.svg": "vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/WordWrap_16x.svg", - - "vs/platform/windows/electron-browser/windowsService": path.join(vsFills, "windowsService.ts"), - "vs/base/node/paths": path.join(vsFills, "paths.ts"), - "vs/base/common/amd": path.join(vsFills, "amd.ts"), - "vs/platform/product/node/package": path.resolve(vsFills, "package.ts"), - "vs/platform/product/node/product": path.resolve(vsFills, "product.ts"), - "vs/base/node/zip": path.resolve(vsFills, "zip.ts"), - "vszip": path.resolve(root, "lib/vscode/src/vs/base/node/zip.ts"), - "vs": path.join(root, "lib", "vscode", "src", "vs"), - }, - }, - resolveLoader: { - alias: { - "vs/css": path.join(vsFills, "css.js"), - }, - }, -}); diff --git a/packages/web/yarn.lock b/packages/web/yarn.lock deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/packages/web/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/yarn.lock b/packages/yarn.lock deleted file mode 100644 index 1e60eae3b37f..000000000000 --- a/packages/yarn.lock +++ /dev/null @@ -1,3692 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@^7.0.0-beta.35": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - -"@types/jest@^23.3.12": - version "23.3.12" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.12.tgz#7e0ced251fa94c3bc2d1023d4b84b2992fa06376" - integrity sha512-/kQvbVzdEpOq4tEWT79yAHSM4nH4xMlhJv2GrLVQt4Qmo8yYsPdioBM1QpN/2GX1wkfMnyXvdoftvLUr0LBj7Q== - -abab@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" - integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -acorn-globals@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" - integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw== - dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" - -acorn-walk@^6.0.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" - integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== - -acorn@^5.5.3: - version "5.7.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== - -acorn@^6.0.1: - version "6.0.5" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.5.tgz#81730c0815f3f3b34d8efa95cb7430965f4d887a" - integrity sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg== - -ajv@^6.5.5: - version "6.6.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" - integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-escapes@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -append-transform@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" - integrity sha1-126/jKlNJ24keja61EpLdKthGZE= - dependencies: - default-require-extensions "^1.0.0" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -async@^2.1.4, async@^2.5.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== - dependencies: - lodash "^4.17.10" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-core@^6.0.0, babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-generator@^6.18.0, babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-jest@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" - integrity sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew== - dependencies: - babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^23.2.0" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-istanbul@^4.1.6: - version "4.1.6" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" - integrity sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ== - dependencies: - babel-plugin-syntax-object-rest-spread "^6.13.0" - find-up "^2.1.0" - istanbul-lib-instrument "^1.10.1" - test-exclude "^4.2.1" - -babel-plugin-jest-hoist@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" - integrity sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc= - -babel-plugin-syntax-object-rest-spread@^6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= - -babel-preset-jest@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" - integrity sha1-jsegOhOPABoaj7HoETZSvxpV2kY= - dependencies: - babel-plugin-jest-hoist "^23.2.0" - babel-plugin-syntax-object-rest-spread "^6.13.0" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -browser-process-hrtime@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" - integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== - -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" - integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= - dependencies: - node-int64 "^0.4.0" - -buffer-from@1.x, buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -capture-exit@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" - integrity sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28= - dependencies: - rsvp "^3.3.3" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== - -ci-info@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" - integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== - dependencies: - delayed-stream "~1.0.0" - -commander@~2.17.1: - version "2.17.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== - -component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -convert-source-map@^1.4.0, convert-source-map@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.1.tgz#87416ae817de957a3f249b3b5ca475d4aaed6042" - integrity sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg== - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": - version "0.3.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" - integrity sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog== - -cssstyle@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" - integrity sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog== - dependencies: - cssom "0.3.x" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -data-urls@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== - dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" - -debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -default-require-extensions@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" - integrity sha1-836hXT4T/9m0N9M+GnW1+5eHTLg= - dependencies: - strip-bom "^2.0.0" - -define-properties@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= - dependencies: - repeating "^2.0.0" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -detect-newline@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= - -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== - dependencies: - webidl-conversions "^4.0.2" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -error-ex@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.5.1: - version "1.13.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" - has "^1.0.3" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-keys "^1.0.12" - -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escodegen@^1.9.1: - version "1.11.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" - integrity sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= - -exec-sh@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" - integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== - dependencies: - merge "^1.2.0" - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -expect@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-23.6.0.tgz#1e0c8d3ba9a581c87bd71fb9bc8862d443425f98" - integrity sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w== - dependencies: - ansi-styles "^3.2.0" - jest-diff "^23.6.0" - jest-get-type "^22.1.0" - jest-matcher-utils "^23.6.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -fb-watchman@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" - integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= - dependencies: - bser "^2.0.0" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fileset@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" - integrity sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA= - dependencies: - glob "^7.0.3" - minimatch "^3.0.3" - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= - -handlebars@^4.0.3: - version "4.0.12" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" - integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== - dependencies: - async "^2.5.0" - optimist "^0.6.1" - source-map "^0.6.1" - optionalDependencies: - uglify-js "^3.1.4" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.1, has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== - -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== - dependencies: - whatwg-encoding "^1.0.1" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -iconv-lite@0.4.24, iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - -import-local@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" - integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== - dependencies: - pkg-dir "^2.0.0" - resolve-cwd "^2.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -invariant@^2.2.2, invariant@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -ip-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-3.0.0.tgz#0a934694b4066558c46294244a23cc33116bf732" - integrity sha512-T8wDtjy+Qf2TAPDQmBp0eGKJ8GavlWlUnamr3wRn6vvdZlKVuJXXMlSncYFRYgVHOM3If5NR1H4+OvVQU9Idvg== - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= - dependencies: - builtin-modules "^1.0.0" - -is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== - -is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== - dependencies: - ci-info "^1.5.0" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-generator-fn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" - integrity sha1-lp1J4bszKfa7fwkIm+JleLLd1Go= - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= - dependencies: - has "^1.0.1" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== - dependencies: - has-symbols "^1.0.0" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -istanbul-api@^1.3.1: - version "1.3.7" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.7.tgz#a86c770d2b03e11e3f778cd7aedd82d2722092aa" - integrity sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA== - dependencies: - async "^2.1.4" - fileset "^2.0.2" - istanbul-lib-coverage "^1.2.1" - istanbul-lib-hook "^1.2.2" - istanbul-lib-instrument "^1.10.2" - istanbul-lib-report "^1.1.5" - istanbul-lib-source-maps "^1.2.6" - istanbul-reports "^1.5.1" - js-yaml "^3.7.0" - mkdirp "^0.5.1" - once "^1.4.0" - -istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" - integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== - -istanbul-lib-hook@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" - integrity sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw== - dependencies: - append-transform "^0.4.0" - -istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" - integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== - dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.18.0" - istanbul-lib-coverage "^1.2.1" - semver "^5.3.0" - -istanbul-lib-report@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" - integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== - dependencies: - istanbul-lib-coverage "^1.2.1" - mkdirp "^0.5.1" - path-parse "^1.0.5" - supports-color "^3.1.2" - -istanbul-lib-source-maps@^1.2.4, istanbul-lib-source-maps@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" - integrity sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg== - dependencies: - debug "^3.1.0" - istanbul-lib-coverage "^1.2.1" - mkdirp "^0.5.1" - rimraf "^2.6.1" - source-map "^0.5.3" - -istanbul-reports@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" - integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== - dependencies: - handlebars "^4.0.3" - -jest-changed-files@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" - integrity sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA== - dependencies: - throat "^4.0.0" - -jest-cli@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.6.0.tgz#61ab917744338f443ef2baa282ddffdd658a5da4" - integrity sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ== - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.1" - exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.1.11" - import-local "^1.0.0" - is-ci "^1.0.10" - istanbul-api "^1.3.1" - istanbul-lib-coverage "^1.2.0" - istanbul-lib-instrument "^1.10.1" - istanbul-lib-source-maps "^1.2.4" - jest-changed-files "^23.4.2" - jest-config "^23.6.0" - jest-environment-jsdom "^23.4.0" - jest-get-type "^22.1.0" - jest-haste-map "^23.6.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - jest-resolve-dependencies "^23.6.0" - jest-runner "^23.6.0" - jest-runtime "^23.6.0" - jest-snapshot "^23.6.0" - jest-util "^23.4.0" - jest-validate "^23.6.0" - jest-watcher "^23.4.0" - jest-worker "^23.2.0" - micromatch "^2.3.11" - node-notifier "^5.2.1" - prompts "^0.1.9" - realpath-native "^1.0.0" - rimraf "^2.5.4" - slash "^1.0.0" - string-length "^2.0.0" - strip-ansi "^4.0.0" - which "^1.2.12" - yargs "^11.0.0" - -jest-config@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.6.0.tgz#f82546a90ade2d8c7026fbf6ac5207fc22f8eb1d" - integrity sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ== - dependencies: - babel-core "^6.0.0" - babel-jest "^23.6.0" - chalk "^2.0.1" - glob "^7.1.1" - jest-environment-jsdom "^23.4.0" - jest-environment-node "^23.4.0" - jest-get-type "^22.1.0" - jest-jasmine2 "^23.6.0" - jest-regex-util "^23.3.0" - jest-resolve "^23.6.0" - jest-util "^23.4.0" - jest-validate "^23.6.0" - micromatch "^2.3.11" - pretty-format "^23.6.0" - -jest-diff@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.6.0.tgz#1500f3f16e850bb3d71233408089be099f610c7d" - integrity sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g== - dependencies: - chalk "^2.0.1" - diff "^3.2.0" - jest-get-type "^22.1.0" - pretty-format "^23.6.0" - -jest-docblock@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" - integrity sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c= - dependencies: - detect-newline "^2.1.0" - -jest-each@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.6.0.tgz#ba0c3a82a8054387016139c733a05242d3d71575" - integrity sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg== - dependencies: - chalk "^2.0.1" - pretty-format "^23.6.0" - -jest-environment-jsdom@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" - integrity sha1-BWp5UrP+pROsYqFAosNox52eYCM= - dependencies: - jest-mock "^23.2.0" - jest-util "^23.4.0" - jsdom "^11.5.1" - -jest-environment-node@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" - integrity sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA= - dependencies: - jest-mock "^23.2.0" - jest-util "^23.4.0" - -jest-get-type@^22.1.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" - integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== - -jest-haste-map@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.6.0.tgz#2e3eb997814ca696d62afdb3f2529f5bbc935e16" - integrity sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg== - dependencies: - fb-watchman "^2.0.0" - graceful-fs "^4.1.11" - invariant "^2.2.4" - jest-docblock "^23.2.0" - jest-serializer "^23.0.1" - jest-worker "^23.2.0" - micromatch "^2.3.11" - sane "^2.0.0" - -jest-jasmine2@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz#840e937f848a6c8638df24360ab869cc718592e0" - integrity sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ== - dependencies: - babel-traverse "^6.0.0" - chalk "^2.0.1" - co "^4.6.0" - expect "^23.6.0" - is-generator-fn "^1.0.0" - jest-diff "^23.6.0" - jest-each "^23.6.0" - jest-matcher-utils "^23.6.0" - jest-message-util "^23.4.0" - jest-snapshot "^23.6.0" - jest-util "^23.4.0" - pretty-format "^23.6.0" - -jest-leak-detector@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz#e4230fd42cf381a1a1971237ad56897de7e171de" - integrity sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg== - dependencies: - pretty-format "^23.6.0" - -jest-matcher-utils@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz#726bcea0c5294261a7417afb6da3186b4b8cac80" - integrity sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog== - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - pretty-format "^23.6.0" - -jest-message-util@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" - integrity sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8= - dependencies: - "@babel/code-frame" "^7.0.0-beta.35" - chalk "^2.0.1" - micromatch "^2.3.11" - slash "^1.0.0" - stack-utils "^1.0.1" - -jest-mock@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" - integrity sha1-rRxg8p6HGdR8JuETgJi20YsmETQ= - -jest-regex-util@^23.3.0: - version "23.3.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" - integrity sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U= - -jest-resolve-dependencies@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz#b4526af24c8540d9a3fab102c15081cf509b723d" - integrity sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA== - dependencies: - jest-regex-util "^23.3.0" - jest-snapshot "^23.6.0" - -jest-resolve@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.6.0.tgz#cf1d1a24ce7ee7b23d661c33ba2150f3aebfa0ae" - integrity sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA== - dependencies: - browser-resolve "^1.11.3" - chalk "^2.0.1" - realpath-native "^1.0.0" - -jest-runner@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.6.0.tgz#3894bd219ffc3f3cb94dc48a4170a2e6f23a5a38" - integrity sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA== - dependencies: - exit "^0.1.2" - graceful-fs "^4.1.11" - jest-config "^23.6.0" - jest-docblock "^23.2.0" - jest-haste-map "^23.6.0" - jest-jasmine2 "^23.6.0" - jest-leak-detector "^23.6.0" - jest-message-util "^23.4.0" - jest-runtime "^23.6.0" - jest-util "^23.4.0" - jest-worker "^23.2.0" - source-map-support "^0.5.6" - throat "^4.0.0" - -jest-runtime@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.6.0.tgz#059e58c8ab445917cd0e0d84ac2ba68de8f23082" - integrity sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw== - dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^4.1.6" - chalk "^2.0.1" - convert-source-map "^1.4.0" - exit "^0.1.2" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.11" - jest-config "^23.6.0" - jest-haste-map "^23.6.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - jest-resolve "^23.6.0" - jest-snapshot "^23.6.0" - jest-util "^23.4.0" - jest-validate "^23.6.0" - micromatch "^2.3.11" - realpath-native "^1.0.0" - slash "^1.0.0" - strip-bom "3.0.0" - write-file-atomic "^2.1.0" - yargs "^11.0.0" - -jest-serializer@^23.0.1: - version "23.0.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" - integrity sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU= - -jest-snapshot@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.6.0.tgz#f9c2625d1b18acda01ec2d2b826c0ce58a5aa17a" - integrity sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg== - dependencies: - babel-types "^6.0.0" - chalk "^2.0.1" - jest-diff "^23.6.0" - jest-matcher-utils "^23.6.0" - jest-message-util "^23.4.0" - jest-resolve "^23.6.0" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - pretty-format "^23.6.0" - semver "^5.5.0" - -jest-util@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" - integrity sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE= - dependencies: - callsites "^2.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.11" - is-ci "^1.0.10" - jest-message-util "^23.4.0" - mkdirp "^0.5.1" - slash "^1.0.0" - source-map "^0.6.0" - -jest-validate@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" - integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - leven "^2.1.0" - pretty-format "^23.6.0" - -jest-watcher@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" - integrity sha1-0uKM50+NrWxq/JIrksq+9u0FyRw= - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.1" - string-length "^2.0.0" - -jest-worker@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" - integrity sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk= - dependencies: - merge-stream "^1.0.1" - -jest@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-23.6.0.tgz#ad5835e923ebf6e19e7a1d7529a432edfee7813d" - integrity sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw== - dependencies: - import-local "^1.0.0" - jest-cli "^23.6.0" - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@^3.7.0: - version "3.12.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" - integrity sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -jsdom@^11.5.1: - version "11.12.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" - integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== - dependencies: - abab "^2.0.0" - acorn "^5.5.3" - acorn-globals "^4.1.0" - array-equal "^1.0.0" - cssom ">= 0.3.2 < 0.4.0" - cssstyle "^1.0.0" - data-urls "^1.0.0" - domexception "^1.0.1" - escodegen "^1.9.1" - html-encoding-sniffer "^1.0.2" - left-pad "^1.3.0" - nwsapi "^2.0.7" - parse5 "4.0.0" - pn "^1.1.0" - request "^2.87.0" - request-promise-native "^1.0.5" - sax "^1.2.4" - symbol-tree "^3.2.2" - tough-cookie "^2.3.4" - w3c-hr-time "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.3" - whatwg-mimetype "^2.1.0" - whatwg-url "^6.4.1" - ws "^5.2.0" - xml-name-validator "^3.0.0" - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@2.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== - dependencies: - minimist "^1.2.0" - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -kleur@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.2.tgz#b704f4944d95e255d038f0cb05fb8a602c55a300" - integrity sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ== - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -left-pad@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" - integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== - -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= - -lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -make-error@1.x: - version "1.3.5" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" - integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== - -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= - dependencies: - tmpl "1.0.x" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= - -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= - dependencies: - mimic-fn "^1.0.0" - -merge-stream@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= - dependencies: - readable-stream "^2.0.1" - -merge@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" - integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== - -micromatch@^2.3.11: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -minimatch@^3.0.3, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.1.1, minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -nan@^2.9.2: - version "2.12.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" - integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -node-notifier@^5.2.1: - version "5.3.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.3.0.tgz#c77a4a7b84038733d5fb351aafd8a268bfe19a01" - integrity sha512-AhENzCSGZnZJgBARsUjnQ7DnZbzyP+HxlVXuD0xqAnvL8q+OqtSX7lGg9e8nHzwXkMMXNdVeqq4E2M3EUAqX6Q== - dependencies: - growly "^1.3.0" - semver "^5.5.0" - shellwords "^0.1.1" - which "^1.3.0" - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.1, normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== - -npm-packlist@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" - integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -nwsapi@^2.0.7: - version "2.0.9" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" - integrity sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ== - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-keys@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" - integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.getownpropertydescriptors@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" - integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.1" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -once@^1.3.0, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optionator@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - -parse5@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" - integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-parse@^1.0.5, path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -pretty-format@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" - integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" - -private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== - -prompts@^0.1.9: - version "0.1.14" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" - integrity sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w== - dependencies: - kleur "^2.0.1" - sisteransi "^0.1.1" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -psl@^1.1.24, psl@^1.1.28: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -readable-stream@^2.0.1, readable-stream@^2.0.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -realpath-native@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.2.tgz#cd51ce089b513b45cf9b1516c82989b51ccc6560" - integrity sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g== - dependencies: - util.promisify "^1.0.0" - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -request-promise-core@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" - integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= - dependencies: - lodash "^4.13.1" - -request-promise-native@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" - integrity sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU= - dependencies: - request-promise-core "1.1.1" - stealthy-require "^1.1.0" - tough-cookie ">=2.3.3" - -request@^2.87.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -resolve-cwd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" - integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= - dependencies: - resolve-from "^3.0.0" - -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@1.x: - version "1.9.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" - integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ== - dependencies: - path-parse "^1.0.6" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rimraf@^2.5.4, rimraf@^2.6.1: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -rsvp@^3.3.3: - version "3.6.2" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" - integrity sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw== - -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sane@^2.0.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" - integrity sha1-tNwYYcIbQn6SlQej51HiosuKs/o= - dependencies: - anymatch "^2.0.0" - capture-exit "^1.2.0" - exec-sh "^0.2.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - watch "~0.18.0" - optionalDependencies: - fsevents "^1.2.3" - -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5, semver@^5.5.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -set-blocking@^2.0.0, set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -sisteransi@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" - integrity sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g== - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - -source-map-support@^0.5.6: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" - integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.0.tgz#1d4963a2fbffe58050aa9084ca20be81741c07de" - integrity sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stack-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" - integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -stealthy-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - -string-length@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" - integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= - dependencies: - astral-regex "^1.0.0" - strip-ansi "^4.0.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-bom@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^3.1.2: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -symbol-tree@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" - integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= - -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -test-exclude@^4.2.1: - version "4.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" - integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - -throat@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" - integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= - -tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tough-cookie@>=2.3.3: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.0.tgz#d2bceddebde633153ff20a52fa844a0dc71dacef" - integrity sha512-LHMvg+RBP/mAVNqVbOX8t+iJ+tqhBA/t49DuI7+IDAWHrASnesqSu1vWbKB7UrE2yk+HMFUBMadRGMkB4VCfog== - dependencies: - ip-regex "^3.0.0" - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@^2.3.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= - dependencies: - punycode "^2.1.0" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -ts-jest@^23.10.5: - version "23.10.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.10.5.tgz#cdb550df4466a30489bf70ba867615799f388dd5" - integrity sha512-MRCs9qnGoyKgFc8adDEntAOP64fWK1vZKnOYU1o2HxaqjdJvGqmkLCPCnVq1/If4zkUmEjKPnCiUisTrlX2p2A== - dependencies: - bs-logger "0.x" - buffer-from "1.x" - fast-json-stable-stringify "2.x" - json5 "2.x" - make-error "1.x" - mkdirp "0.x" - resolve "1.x" - semver "^5.5" - yargs-parser "10.x" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -uglify-js@^3.1.4: - version "3.4.9" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" - integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== - dependencies: - commander "~2.17.1" - source-map "~0.6.1" - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util.promisify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - -uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -w3c-hr-time@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" - integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= - dependencies: - browser-process-hrtime "^0.1.2" - -walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= - dependencies: - makeerror "1.0.x" - -watch@~0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" - integrity sha1-KAlUdsbffJDJYxOJkMClQj60uYY= - dependencies: - exec-sh "^0.2.0" - minimist "^1.2.0" - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^6.4.1: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -whatwg-url@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" - integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@^1.2.12, which@^1.2.9, which@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" - integrity sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - -ws@^5.2.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= - -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - -yargs-parser@10.x: - version "10.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" - integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== - dependencies: - camelcase "^4.1.0" - -yargs-parser@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= - dependencies: - camelcase "^4.1.0" - -yargs@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^9.0.2" diff --git a/patches/app-name.diff b/patches/app-name.diff new file mode 100644 index 000000000000..2d6d6a0e28b3 --- /dev/null +++ b/patches/app-name.diff @@ -0,0 +1,46 @@ +Apply --app-name to VS Code web page titles + +VS Code's `${appName}` title variable comes from `productService.nameLong` in the +web client. code-server already injects per-request product configuration into +VS Code's web bootstrap, so set `nameShort`/`nameLong` from the existing +`--app-name` CLI arg there. + +This keeps the patch minimal and makes browser tab titles honor `--app-name` +without changing unrelated product metadata. + +Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +=================================================================== +--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts ++++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +@@ -40,6 +40,7 @@ export const serverOptions: OptionDescri + 'disable-getting-started-override': { type: 'boolean' }, + 'locale': { type: 'string' }, + 'link-protection-trusted-domains': { type: 'string[]' }, ++ 'app-name': { type: 'string' }, + + /* ----- server setup ----- */ + +@@ -140,6 +141,7 @@ export interface ServerParsedArgs { + 'disable-getting-started-override'?: boolean, + 'locale'?: string + 'link-protection-trusted-domains'?: string[], ++ 'app-name'?: string, + + /* ----- server setup ----- */ + +Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts +=================================================================== +--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts ++++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts +@@ -407,8 +407,11 @@ export class WebClientServer { + linkProtectionTrustedDomains.push(...this._productService.linkProtectionTrustedDomains); + } + ++ const appName = this._environmentService.args['app-name']; + const productConfiguration: Partial> = { + codeServerVersion: this._productService.codeServerVersion, ++ nameShort: appName, ++ nameLong: appName, + rootEndpoint: rootBase, + updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined, + logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined, diff --git a/patches/base-path.diff b/patches/base-path.diff new file mode 100644 index 000000000000..681407d6b40a --- /dev/null +++ b/patches/base-path.diff @@ -0,0 +1,308 @@ +Add base path support + +Some users will host code-server behind a path-rewriting reverse proxy, for +example domain.tld/my/base/path. This patch adds support for that since Code +assumes everything is on / by default. + +To test this serve code-server behind a reverse proxy with a path like /code. + +Index: code-server/lib/vscode/src/vs/base/common/network.ts +=================================================================== +--- code-server.orig/lib/vscode/src/vs/base/common/network.ts ++++ code-server/lib/vscode/src/vs/base/common/network.ts +@@ -263,7 +263,9 @@ class RemoteAuthoritiesImpl { + return URI.from({ + scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource, + authority: `${host}:${port}`, +- path: this._remoteResourcesPath, ++ path: platform.isWeb ++ ? (window.location.pathname + "/" + this._remoteResourcesPath).replace(/\/\/+/g, "/") ++ : this._remoteResourcesPath, + query + }); + } +Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html +=================================================================== +--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html ++++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html +@@ -11,8 +11,8 @@ + + + +- +- ++ ++ + + + +@@ -29,9 +29,9 @@ + + + +- +- +- ++ ++ ++ + + + + + +