From 7962b7678cdf0ad3f9d1a30fa7eb99c48756043a Mon Sep 17 00:00:00 2001 From: Adam Zielinski Date: Wed, 31 May 2023 10:37:43 +0200 Subject: [PATCH] Remove VS Code extension from the main repository so it can live in a dedicated space. See #473. (#476) ## What? Removes the VS Code extension from the main WordPress playground repository so it can live in a dedicated space. As outlined in #473, WordPress Playground is re-focusing on [the vision](https://github.com/WordPress/wordpress-playground/issues/472) and separating the framework from the applications. Once the code removed by this PR is committed to a separate repo, a link will be added to this PR. --- .vscode/launch.json | 9 - .vscode/tasks.json | 10 +- package-lock.json | 433 +----------------- package.json | 6 - .../docs/13-contributing/05-publishing.md | 4 - packages/vscode-extension/.babelrc | 3 - packages/vscode-extension/.eslintrc.json | 18 - packages/vscode-extension/README.md | 54 --- packages/vscode-extension/esbuild.mjs | 20 - packages/vscode-extension/jest.config.ts | 15 - packages/vscode-extension/package.json | 48 -- packages/vscode-extension/project.json | 86 ---- packages/vscode-extension/public/icon.png | Bin 12270 -> 0 bytes .../public/sidebar-button.svg | 14 - packages/vscode-extension/src/index.ts | 202 -------- packages/vscode-extension/src/state.ts | 41 -- packages/vscode-extension/src/webview.html | 60 --- packages/vscode-extension/src/webview.tsx | 228 --------- packages/vscode-extension/src/worker.ts | 19 - packages/vscode-extension/tsconfig.json | 13 - packages/vscode-extension/tsconfig.lib.json | 12 - packages/vscode-extension/tsconfig.spec.json | 20 - tsconfig.base.json | 3 - 23 files changed, 2 insertions(+), 1316 deletions(-) delete mode 100644 packages/vscode-extension/.babelrc delete mode 100644 packages/vscode-extension/.eslintrc.json delete mode 100644 packages/vscode-extension/README.md delete mode 100644 packages/vscode-extension/esbuild.mjs delete mode 100644 packages/vscode-extension/jest.config.ts delete mode 100644 packages/vscode-extension/package.json delete mode 100644 packages/vscode-extension/project.json delete mode 100644 packages/vscode-extension/public/icon.png delete mode 100644 packages/vscode-extension/public/sidebar-button.svg delete mode 100644 packages/vscode-extension/src/index.ts delete mode 100644 packages/vscode-extension/src/state.ts delete mode 100644 packages/vscode-extension/src/webview.html delete mode 100644 packages/vscode-extension/src/webview.tsx delete mode 100644 packages/vscode-extension/src/worker.ts delete mode 100644 packages/vscode-extension/tsconfig.json delete mode 100644 packages/vscode-extension/tsconfig.lib.json delete mode 100644 packages/vscode-extension/tsconfig.spec.json diff --git a/.vscode/launch.json b/.vscode/launch.json index f1c96d8757..66464397d3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,15 +4,6 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "Debug Playground for VS Code", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}/dist/packages/vscode-extension" - ], - "preLaunchTask": "build-vscode-extension" - }, { "name": "Heap Profiler", "type": "node", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d8a03d4ece..23628e220a 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,14 +1,6 @@ // BEGIN: 3f7a8b3d9b3c { "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "group": "build:vscode-extension", - "label": "build-vscode-extension", - "script": "build:vscode-extension", - "problemMatcher": "$esbuild-watch" - } - ] + "tasks": [] } // END: 3f7a8b3d9b3c \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6d8b5d1b49..273c44fd89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,6 @@ "workspaces": [ "packages/nx-extensions", "packages/wp-now", - "packages/vscode-extension", "packages/php-wasm/*", "packages/playground/*" ], @@ -73,8 +72,6 @@ "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@types/react-modal": "^3.13.1", - "@types/vscode": "1.78.0", - "@types/vscode-webview": "1.57.1", "@types/wordpress__block-editor": "11.5.0", "@types/wordpress__blocks": "12.5.0", "@typescript-eslint/eslint-plugin": "5.59.6", @@ -82,8 +79,6 @@ "@vitejs/plugin-react": "^3.1.0", "@vitest/coverage-c8": "0.31.1", "@vitest/ui": "0.31.1", - "@vscode/vsce": "2.19.0", - "@vscode/webview-ui-toolkit": "1.2.2", "@wordpress/block-editor": "11.6.0", "@wordpress/blocks": "12.6.0", "@wordpress/components": "23.6.0", @@ -6413,52 +6408,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/@microsoft/fast-element": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@microsoft/fast-element/-/fast-element-1.12.0.tgz", - "integrity": "sha512-gQutuDHPKNxUEcQ4pypZT4Wmrbapus+P9s3bR/SEOLsMbNqNoXigGImITygI5zhb+aA5rzflM6O8YWkmRbGkPA==", - "dev": true - }, - "node_modules/@microsoft/fast-foundation": { - "version": "2.49.0", - "resolved": "https://registry.npmjs.org/@microsoft/fast-foundation/-/fast-foundation-2.49.0.tgz", - "integrity": "sha512-Wk4e4QXFVtT5hPwhMfHyGY30kixM0td8aDs7bAD6NM2z2SCBNvpTTWp+FCjx0I0lpUMlMenb6wsw7pMWQreRkQ==", - "dev": true, - "dependencies": { - "@microsoft/fast-element": "^1.12.0", - "@microsoft/fast-web-utilities": "^5.4.1", - "tabbable": "^5.2.0", - "tslib": "^1.13.0" - } - }, - "node_modules/@microsoft/fast-foundation/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/@microsoft/fast-react-wrapper": { - "version": "0.1.48", - "resolved": "https://registry.npmjs.org/@microsoft/fast-react-wrapper/-/fast-react-wrapper-0.1.48.tgz", - "integrity": "sha512-9NvEjru9Kn5ZKjomAMX6v+eF0DR+eDkxKDwDfi+Wb73kTbrNzcnmlwd4diN15ygH97kldgj2+lpvI4CKLQQWLg==", - "dev": true, - "dependencies": { - "@microsoft/fast-element": "^1.9.0", - "@microsoft/fast-foundation": "^2.41.1" - }, - "peerDependencies": { - "react": ">=16.9.0" - } - }, - "node_modules/@microsoft/fast-web-utilities": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@microsoft/fast-web-utilities/-/fast-web-utilities-5.4.1.tgz", - "integrity": "sha512-ReWYncndjV3c8D8iq9tp7NcFNc1vbVHvcBFPME2nNFKNbS1XCesYZGlIlf3ot5EmuOXPlrzUHOWzQ2vFpIkqDg==", - "dev": true, - "dependencies": { - "exenv-es6": "^1.1.1" - } - }, "node_modules/@microsoft/tsdoc": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", @@ -11546,18 +11495,6 @@ "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", "dev": true }, - "node_modules/@types/vscode": { - "version": "1.78.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.78.0.tgz", - "integrity": "sha512-LJZIJpPvKJ0HVQDqfOy6W4sNKUBBwyDu1Bs8chHBZOe9MNuKTJtidgZ2bqjhmmWpUb0TIIqv47BFUcVmAsgaVA==", - "dev": true - }, - "node_modules/@types/vscode-webview": { - "version": "1.57.1", - "resolved": "https://registry.npmjs.org/@types/vscode-webview/-/vscode-webview-1.57.1.tgz", - "integrity": "sha512-ghW5SfuDmsGDS2A4xkvGsLwDRNc3Vj5rS6rPOyPm/IryZuf3wceZKxgYaUoW+k9f0f/CB7y2c1rRsdOWZWn0PQ==", - "dev": true - }, "node_modules/@types/web-bluetooth": { "version": "0.0.16", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", @@ -12097,166 +12034,6 @@ "integrity": "sha512-3lgSTWhAzzWN/EPURoY4ZDBEA80OPmnaknNujA3qnI4Iu7AONWd9xF3iE4L+4prIe8E3TUnLQ4pxoaFTEEZNwg==", "dev": true }, - "node_modules/@vscode/vsce": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.19.0.tgz", - "integrity": "sha512-dAlILxC5ggOutcvJY24jxz913wimGiUrHaPkk16Gm9/PGFbz1YezWtrXsTKUtJws4fIlpX2UIlVlVESWq8lkfQ==", - "dev": true, - "dependencies": { - "azure-devops-node-api": "^11.0.1", - "chalk": "^2.4.2", - "cheerio": "^1.0.0-rc.9", - "commander": "^6.1.0", - "glob": "^7.0.6", - "hosted-git-info": "^4.0.2", - "jsonc-parser": "^3.2.0", - "leven": "^3.1.0", - "markdown-it": "^12.3.2", - "mime": "^1.3.4", - "minimatch": "^3.0.3", - "parse-semver": "^1.1.1", - "read": "^1.0.7", - "semver": "^5.1.0", - "tmp": "^0.2.1", - "typed-rest-client": "^1.8.4", - "url-join": "^4.0.1", - "xml2js": "^0.5.0", - "yauzl": "^2.3.1", - "yazl": "^2.2.2" - }, - "bin": { - "vsce": "vsce" - }, - "engines": { - "node": ">= 14" - }, - "optionalDependencies": { - "keytar": "^7.7.0" - } - }, - "node_modules/@vscode/vsce/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@vscode/vsce/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@vscode/vsce/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@vscode/vsce/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@vscode/vsce/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@vscode/vsce/node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@vscode/vsce/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@vscode/vsce/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/@vscode/vsce/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@vscode/webview-ui-toolkit": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vscode/webview-ui-toolkit/-/webview-ui-toolkit-1.2.2.tgz", - "integrity": "sha512-xIQoF4FC3Xh6d7KNKIoIezSiFWYFuf6gQMdDyKueKBFGeKwaHWEn+dY2g3makvvEsNMEDji/woEwvg9QSbuUsw==", - "dev": true, - "dependencies": { - "@microsoft/fast-element": "^1.6.2", - "@microsoft/fast-foundation": "^2.38.0", - "@microsoft/fast-react-wrapper": "^0.1.18" - }, - "peerDependencies": { - "react": ">=16.9.0" - } - }, "node_modules/@vue/compiler-core": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.2.tgz", @@ -14507,16 +14284,6 @@ "deep-equal": "^2.0.5" } }, - "node_modules/azure-devops-node-api": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.2.0.tgz", - "integrity": "sha512-XdiGPhrpaT5J8wdERRKs5g8E0Zy1pvOYTli7z9E8nmOn3YGp4FhtjhrOyFmX/8veWCwdI69mCHKJw6l+4J/bHA==", - "dev": true, - "dependencies": { - "tunnel": "0.0.6", - "typed-rest-client": "^1.8.4" - } - }, "node_modules/babel-jest": { "version": "29.5.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", @@ -15518,15 +15285,6 @@ "ieee754": "^1.2.1" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -16664,15 +16422,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/common-ancestor-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", @@ -19835,12 +19584,6 @@ "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz", "integrity": "sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==" }, - "node_modules/exenv-es6": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exenv-es6/-/exenv-es6-1.1.1.tgz", - "integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==", - "dev": true - }, "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -20169,15 +19912,6 @@ "node": "*" } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/feed": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/feed/-/feed-4.2.2.tgz", @@ -25715,25 +25449,6 @@ "integrity": "sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==", "dev": true }, - "node_modules/keytar": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz", - "integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "node-addon-api": "^4.3.0", - "prebuild-install": "^7.0.1" - } - }, - "node_modules/keytar/node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", - "dev": true, - "optional": true - }, "node_modules/keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -26689,15 +26404,6 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "dev": true, - "dependencies": { - "uc.micro": "^1.0.1" - } - }, "node_modules/listenercount": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", @@ -27217,37 +26923,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/markdown-it/node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/marked": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", @@ -30526,24 +30201,6 @@ "protocols": "^2.0.0" } }, - "node_modules/parse-semver": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", - "integrity": "sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==", - "dev": true, - "dependencies": { - "semver": "^5.1.0" - } - }, - "node_modules/parse-semver/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/parse-url": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-8.1.0.tgz", @@ -30721,12 +30378,6 @@ "node": "*" } }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -36986,12 +36637,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/tabbable": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz", - "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==", - "dev": true - }, "node_modules/tannin": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/tannin/-/tannin-1.2.0.tgz", @@ -38139,15 +37784,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "dev": true, - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } - }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -38232,17 +37868,6 @@ "integrity": "sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==", "dev": true }, - "node_modules/typed-rest-client": { - "version": "1.8.9", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", - "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", - "dev": true, - "dependencies": { - "qs": "^6.9.1", - "tunnel": "0.0.6", - "underscore": "^1.12.1" - } - }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -38357,12 +37982,6 @@ "node": "*" } }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, "node_modules/ufo": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", @@ -38397,12 +38016,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", - "dev": true - }, "node_modules/unescape": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unescape/-/unescape-1.0.1.tgz", @@ -40482,10 +40095,6 @@ "node": ">=0.10.0" } }, - "node_modules/wordpress-playground": { - "resolved": "packages/vscode-extension", - "link": true - }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -40740,28 +40349,6 @@ "node": ">=12" } }, - "node_modules/xml2js": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", - "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", - "dev": true, - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", @@ -40838,25 +40425,6 @@ "node": ">=12" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "node_modules/yazl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", - "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3" - } - }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -41000,6 +40568,7 @@ "packages/vscode-extension": { "name": "wordpress-playground", "version": "0.1.43", + "extraneous": true, "license": "GPL-2.0-or-later", "engines": { "vscode": "^1.77.0" diff --git a/package.json b/package.json index dfbf64b7f5..823064b7f6 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "scripts": { "build": "nx run-many --all --target=build", "build:website": "nx build playground-website", - "build:vscode-extension": "nx build vscode-extension", "deploy": "gh-pages -d dist/docs/build -t true", "dev": "nx dev playground-website", "dev:interactivity": "nx dev interactive-block-playground", @@ -101,8 +100,6 @@ "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@types/react-modal": "^3.13.1", - "@types/vscode": "1.78.0", - "@types/vscode-webview": "1.57.1", "@types/wordpress__block-editor": "11.5.0", "@types/wordpress__blocks": "12.5.0", "@typescript-eslint/eslint-plugin": "5.59.6", @@ -110,8 +107,6 @@ "@vitejs/plugin-react": "^3.1.0", "@vitest/coverage-c8": "0.31.1", "@vitest/ui": "0.31.1", - "@vscode/vsce": "2.19.0", - "@vscode/webview-ui-toolkit": "1.2.2", "@wordpress/block-editor": "11.6.0", "@wordpress/blocks": "12.6.0", "@wordpress/components": "23.6.0", @@ -182,7 +177,6 @@ "workspaces": [ "packages/nx-extensions", "packages/wp-now", - "packages/vscode-extension", "packages/php-wasm/*", "packages/playground/*" ], diff --git a/packages/docs/site/docs/13-contributing/05-publishing.md b/packages/docs/site/docs/13-contributing/05-publishing.md index 8afdee01ee..c009a40083 100644 --- a/packages/docs/site/docs/13-contributing/05-publishing.md +++ b/packages/docs/site/docs/13-contributing/05-publishing.md @@ -56,10 +56,6 @@ npm run deploy You will need to have push access to the `gh-pages` branch of the repository. -## VS Code extension - -See the [VS Code extension](https://github.com/WordPress/wordpress-playground/blob/trunk/packages/vscode-extension/README.md#publishing) document. - ## playground.wordpress.net website TBD diff --git a/packages/vscode-extension/.babelrc b/packages/vscode-extension/.babelrc deleted file mode 100644 index 5f2f47b93d..0000000000 --- a/packages/vscode-extension/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": [["@nx/js/babel", { "useBuiltIns": "usage" }]] -} diff --git a/packages/vscode-extension/.eslintrc.json b/packages/vscode-extension/.eslintrc.json deleted file mode 100644 index dd6da33e2d..0000000000 --- a/packages/vscode-extension/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/packages/vscode-extension/README.md b/packages/vscode-extension/README.md deleted file mode 100644 index af99e4fda3..0000000000 --- a/packages/vscode-extension/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# WordPress Playground for VS Code - -Run WordPress development server without any dependencies. Yes, you read that right! - -This extension bundles [WordPress Playground](https://github.com/WordPress/wordpress-playground), a WebAssembly-based WordPress runtime, and starts a local WordPress development server with a click of a button. That's it! No need to install PHP, MySQL, Apache, or anything else. - -Just install this extension, open the WordPress sidebar, and click the "Start WordPress Server" button. - -## Known Issues - -- The extension has only been tested on macOS. It may not work on Windows. -- The extension currently only takes into account plugins, not themes. -- The extension currently expects that the command is run while within a file in the root directory of the plugin. A WordPress playground will still be created and mounted, but the plugin will not be functional if the command is run from an unintended directory. -- Some requests may not succeed. This is likely due to the fact that we have a minimally implemented server translation layer. - -## Development - -1. Clone the WordPress Playground repository at https://github.com/WordPress/wordpress-playground -2. Make a change in `packages/vscode-extension` -3. Go to the Debug tab is your VS Code and run the "Debug Playground for VS Code" configuration. It will build the extension and start a new VS Code window with your changes reflected. - -[vscode-webview-ui-toolkit](https://github.com/microsoft/vscode-webview-ui-toolkit/blob/main/docs/getting-started.md) is used for UI. - -## Debugging - -1. Follow the three steps above. -2. Open the "Debug Console" tab in the original VS Code window for errors and console.log() outputs. -3. Run the `Developer: Toggle Developer Tools` command in the child window to debug UI elements and WebView errors. - -## Publishing - -1. Generate a Personal Access Token on https://dev.azure.com/wordpress-playground/_usersSettings/tokens -1. Login with `vsce login WordPressPlayground` and the token you generated -1. Build and publish the extension with `vsce publish`. - -## Release Notes - -### 0.0.17 - -- Restore this README.md file. -- Add the ability to switch between WordPress and PHP versions. - -### 0.0.16 - -- Rewrite the extension to use the new WordPress Playground API. -- Add a UI sidebar. - -### 0.0.2 - -Hopefully fix the bug. - -### 0.0.1 - -Initial release of WordPress Playground for VS Code. diff --git a/packages/vscode-extension/esbuild.mjs b/packages/vscode-extension/esbuild.mjs deleted file mode 100644 index f730490c05..0000000000 --- a/packages/vscode-extension/esbuild.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import * as esbuild from 'esbuild'; - -const options = { - entryPoints: [ - 'packages/vscode-extension/src/index.ts', - 'packages/vscode-extension/src/webview.tsx', - 'packages/vscode-extension/src/worker.ts', - ], - outdir: 'dist/packages/vscode-extension', - bundle: true, - external: ['vscode'], - minify: false, - format: 'cjs', - loader: { - '.html': 'text', - }, - platform: 'node', -}; - -esbuild.build(options); diff --git a/packages/vscode-extension/jest.config.ts b/packages/vscode-extension/jest.config.ts deleted file mode 100644 index f13409b131..0000000000 --- a/packages/vscode-extension/jest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'vscode-extension-vscode-extension', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]sx?$': [ - 'ts-jest', - { tsconfig: '/tsconfig.spec.json' }, - ], - }, - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], - coverageDirectory: - '../../coverage/packages/vscode-extension/vscode-extension', -}; diff --git a/packages/vscode-extension/package.json b/packages/vscode-extension/package.json deleted file mode 100644 index 669274a603..0000000000 --- a/packages/vscode-extension/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "wordpress-playground", - "displayName": "WordPress Playground for VS Code", - "description": "Embeds a WordPress installation in your your VS Code", - "license": "GPL-2.0-or-later", - "publisher": "WordPressPlayground", - "version": "0.1.43", - "private": true, - "repository": { - "type": "git", - "url": "https://github.com/WordPress/wordpress-playground" - }, - "icon": "public/icon.png", - "engines": { - "vscode": "^1.77.0" - }, - "categories": [ - "Other" - ], - "activationEvents": [], - "main": "./index.js", - "contributes": { - "commands": [ - { - "command": "wordpress-playground.serve", - "title": "Launch WordPress Playground" - } - ], - "viewsContainers": { - "activitybar": [ - { - "id": "wordpress-playground", - "title": "WordPress Playground", - "icon": "public/sidebar-button.svg" - } - ] - }, - "views": { - "wordpress-playground": [ - { - "id": "wordpress-playground-server", - "name": "Server", - "type": "webview" - } - ] - } - } -} diff --git a/packages/vscode-extension/project.json b/packages/vscode-extension/project.json deleted file mode 100644 index f6c7bb2490..0000000000 --- a/packages/vscode-extension/project.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "vscode-extension", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "packages/vscode-extension/src", - "projectType": "library", - "targets": { - "install": { - "executor": "nx:run-commands", - "options": { - "commands": [ - "code --install-extension ./wordpress-playground-*.vsix" - ], - "cwd": "dist/packages/vscode-extension", - "parallel": false - }, - "dependsOn": ["build"] - }, - "publish": { - "executor": "nx:run-commands", - "options": { - "commands": ["vsce publish -i ./wordpress-playground-*.vsix"], - "cwd": "dist/packages/vscode-extension", - "parallel": false - }, - "dependsOn": ["build"] - }, - "build": { - "executor": "nx:noop", - "dependsOn": ["build:package"] - }, - "build:package": { - "executor": "nx:run-commands", - "options": { - "commands": ["rm ./*.vsix || true", "vsce package"], - "cwd": "dist/packages/vscode-extension", - "parallel": false - }, - "dependsOn": ["build:bundle"] - }, - "build:bundle": { - "executor": "nx:run-commands", - "options": { - "commands": [ - "node packages/vscode-extension/esbuild.mjs", - "cp -r packages/vscode-extension/public dist/packages/vscode-extension", - "cp ./LICENSE dist/packages/vscode-extension", - "cp packages/vscode-extension/package.json dist/packages/vscode-extension", - "cp packages/vscode-extension/README.md dist/packages/vscode-extension", - "cp packages/php-wasm/node/public/*.wasm dist/packages/vscode-extension" - ], - "parallel": false - } - }, - "lint": { - "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["packages/vscode-extension/**/*.ts"] - } - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "packages/vscode-extension/jest.config.ts", - "passWithNoTests": true - }, - "configurations": { - "ci": { - "ci": true, - "codeCoverage": true - } - } - }, - "typecheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - "tsc -p packages/vscode-extension/tsconfig.spec.json --noEmit", - "tsc -p packages/vscode-extension/tsconfig.lib.json --noEmit" - ] - } - } - }, - "tags": [] -} diff --git a/packages/vscode-extension/public/icon.png b/packages/vscode-extension/public/icon.png deleted file mode 100644 index e3a8c88ad728cd869cb961a9f44b185ba993dcb7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12270 zcmZ{K1yGb-`0ooMA}qKF(%mH>-LZg#v~)^$cXvw*NK1nVNT-Czhm=T(NXHV=-Efcp zJ9B65ow+cu1H13peb0H~7f+0;vMe?x2_^(V*z$7H>fkZ>-wy^V_^oJgmIEHptR$5r zA*ePH>&E0E_?ya1PF)Ftd>O#&!XfDD-|IIa$b%Dt{=R`Aq4y9(=$zB0CIX&7H+>~5 z4c-6y{_v$N75wLsyS$Rjqm74{1dpMLf>^L1d#Aj#q=xq&WWa_QX@BGX&W8tdD5z+U zlc*#^zdWFmRR1!RLN6FYKjSJ-*1CqA|J~V?nlaa*a{k15<+n@9wW(m!D$PK;zk_ay z#p$3?_ky1!Z46D}gZBMiInEZS$51ted@*1Az245=a1OWM`mjwHE*eT_#(}RWU*(87 z-@9n1nYo6>8tx69UmocR4WrtDMV&bX*1R=hgbLraiCHBX~#o@(BKb22WWJoO= zv~cyQLQS{?<P|5YrYkaR9A7S;N_6#kjY6SR>l+(U=#Sckgs-lyEKAFFJ=+)e z8RtE%vg&o%__9Y#U+A(iq&|KDgM#tG7x&Mv{l)S}w@cDf5#`s@PfkvFc=sm*#q#rW zQVP{AHjqe*3JtDS1G=X!tp*q-Fl=13W!F}FzDlDSN>Xxi5;8J!VqOw#h+$N+eDi@Mwp~4XjW@wq^Dal zaYrCb?C}$E$od`lX4lrFy|lHXl=+3YOq*xNtU^rQ%h9RZu{7=fHqxqIKlFa`mf=Y> z3VTLnN$b{jy;XaATaGegqzRhj!KJ^Zr>ByVgN3H%%a`cqC^)mbo+`?U4NXmaynJtA zPad^@TRncIpx`Bb^SMcHXjL@2@v4)%d*isVsUhd;Xy^w{?(FW%IHME|J&)M^3gUyz7Zk?+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q;uyM>UM zs|9#~xH!4EpL6m)f5EB2#U;ckAjHGR%E>9j$$8lvmHB^N;NWC#W9jq%zaaXrI6b(4 p>HoZgyN!c|o4bjF^Z$E|AXxr?zsYo&G8(uBl9y4Iu135G{a-CamI(j= diff --git a/packages/vscode-extension/public/sidebar-button.svg b/packages/vscode-extension/public/sidebar-button.svg deleted file mode 100644 index ec8d3658dc..0000000000 --- a/packages/vscode-extension/public/sidebar-button.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/vscode-extension/src/index.ts b/packages/vscode-extension/src/index.ts deleted file mode 100644 index f5a8bf9199..0000000000 --- a/packages/vscode-extension/src/index.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { Worker } from 'worker_threads'; -import * as vscode from 'vscode'; -// @ts-ignore -import webviewHtml from './webview.html'; -import { InMemoryStateManager } from './state'; - -let worker; -const stateManager = new InMemoryStateManager(); -async function startWordPressServer() { - if (!vscode.workspace.workspaceFolders) { - vscode.window.showErrorMessage( - 'Open a folder before starting WordPress Playground server' - ); - return; - } - if (stateManager.read().serverAddress) { - vscode.window.showInformationMessage( - 'WordPress is running at ' + stateManager.read().serverAddress - ); - return; - } - - try { - await stateManager.write({ state: 'starting-server' }); - worker = new Worker(__dirname + '/worker.js'); - - worker.on('message', (message) => { - switch (message.command) { - case 'server-started': - stateManager.write({ state: 'server-running' }); - vscode.env.openExternal(vscode.Uri.parse(message.url)); - stateManager.write({ - serverAddress: message.url, - wordPressVersion: message.wordPressVersion, - mode: message.mode, - phpVersion: message.phpVersion, - projectPath: message.projectPath, - }); - vscode.window.showInformationMessage( - 'WordPress is running at ' + message.url - ); - break; - } - }); - - worker.on('error', (err) => { - vscode.window.showErrorMessage( - 'WordPress Playground error: ' + err.message - ); - console.trace(err); - stateManager.write({ state: 'idle', serverAddress: undefined }); - }); - - worker.postMessage({ - command: 'start-server', - config: { - phpVersion: stateManager.read().phpVersion, - wordPressVersion: stateManager.read().wordPressVersion, - projectPath: vscode.workspace.workspaceFolders[0].uri.fsPath, - }, - }); - } catch (e) { - vscode.window.showErrorMessage( - 'WordPress Playground error: ' + e.message - ); - console.trace(e); - stateManager.write({ state: 'idle', serverAddress: undefined }); - } -} - -async function stopWordPressServer() { - if (!stateManager.read().serverAddress) { - vscode.window.showInformationMessage('WordPress server is not running'); - return; - } - - try { - stateManager.write({ state: 'stopping-server' }); - worker.terminate(); - stateManager.write({ state: 'idle', serverAddress: undefined }); - } catch (e) { - vscode.window.showErrorMessage( - 'WordPress Playground error: ' + e.message - ); - console.trace(e); - } -} - -async function activate(context) { - const provider = new PlaygroundViewProvider(context.extensionUri); - - context.subscriptions.push( - vscode.window.registerWebviewViewProvider( - PlaygroundViewProvider.viewType, - provider - ) - ); - - context.subscriptions.push( - vscode.commands.registerCommand( - 'wordpress-playground.serve', - startWordPressServer - ) - ); -} - -class PlaygroundViewProvider implements vscode.WebviewViewProvider { - public static readonly viewType = 'wordpress-playground-server'; - - constructor(private readonly _extensionUri: vscode.Uri) {} - - /** - * Revolves a webview view. - * - * `resolveWebviewView` is called when a view first becomes visible. This may happen when the view is - * first loaded or when the user hides and then shows a view again. - * - * @return Optional thenable indicating that the view has been fully resolved. - */ - public resolveWebviewView(webviewView: vscode.WebviewView) { - console.log('CREATING WEB VIEW'); - webviewView.webview.options = { - // Allow scripts in the webview - enableScripts: true, - - localResourceRoots: [this._extensionUri], - }; - - stateManager.addEventListener('change', (e) => { - webviewView.webview.postMessage({ - command: 'stateChange', - state: (e as any).state, - }); - }); - - webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); - - webviewView.webview.onDidReceiveMessage(async (message) => { - console.log('MESSAGE RECEIVED', message); - switch (message.command) { - case 'get-state': - webviewView.webview.postMessage({ - command: 'stateChange', - state: stateManager.read(), - }); - break; - case 'server-start': - startWordPressServer(); - break; - case 'server-stop': - stopWordPressServer(); - break; - case 'option-change': - await stopWordPressServer(); - if (message.option === 'phpVersion') { - stateManager.write({ - phpVersion: message.value, - }); - } else if (message.option === 'wordPressVersion') { - stateManager.write({ - wordPressVersion: message.value, - }); - } - startWordPressServer(); - break; - } - }); - } - - private _getHtmlForWebview(webview: vscode.Webview) { - // Get the local path to main script run in the webview, then convert it to a uri we can use in the webview. - const scriptUri = webview.asWebviewUri( - vscode.Uri.joinPath(this._extensionUri, 'webview.js') - ); - - // Use a nonce to only allow a specific script to be run. - const nonce = getNonce(); - - return webviewHtml - .replaceAll('${appState}', JSON.stringify(stateManager.read())) - .replaceAll('${nonce}', nonce) - .replaceAll('${scriptUri}', scriptUri); - } -} - -function getNonce() { - let text = ''; - const possible = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for (let i = 0; i < 32; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; -} - -// This method is called when your extension is deactivated -function deactivate() {} - -module.exports = { - activate, - deactivate, -}; diff --git a/packages/vscode-extension/src/state.ts b/packages/vscode-extension/src/state.ts deleted file mode 100644 index 9e17af0c7a..0000000000 --- a/packages/vscode-extension/src/state.ts +++ /dev/null @@ -1,41 +0,0 @@ -export interface InMemoryState { - serverAddress?: string; - wordPressVersion?: string; - mode?: string; - phpVersion?: string; - projectPath?: string; - state: - | 'starting-server' - | 'server-running' - | 'stopping-server' - | 'server-stopped' - | 'idle'; -} - -export class InMemoryStateManager extends EventTarget { - private state: InMemoryState = { - state: 'idle', - phpVersion: '7.4', - wordPressVersion: '6.2', - }; - - read() { - return { - ...this.state, - }; - } - - async write(newState: Partial) { - this.state = { - ...this.state, - ...newState, - }; - this.dispatchEvent(new StateChangeEvent('change', this.state)); - } -} - -export class StateChangeEvent extends Event { - constructor(name: string, public state: InMemoryState) { - super(name); - } -} diff --git a/packages/vscode-extension/src/webview.html b/packages/vscode-extension/src/webview.html deleted file mode 100644 index 27a0f2a946..0000000000 --- a/packages/vscode-extension/src/webview.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - WordPress Playground - - - -
- - - - - diff --git a/packages/vscode-extension/src/webview.tsx b/packages/vscode-extension/src/webview.tsx deleted file mode 100644 index d1614544b4..0000000000 --- a/packages/vscode-extension/src/webview.tsx +++ /dev/null @@ -1,228 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { createRoot } from 'react-dom/client'; -import { SupportedPHPVersions } from '@php-wasm/universal'; -import { InMemoryState } from './state'; -import { - VSCodeButton, - VSCodeProgressRing, - VSCodeDropdown, - VSCodeOption, -} from '@vscode/webview-ui-toolkit/react'; - -// @TODO Move to @wp-playground/wordpress package -const SupportedWordPressVersions = ['6.2', '6.1', '6.0', '5.9'] as const; - -// @ts-ignore -const vscode = acquireVsCodeApi(); - -interface WebviewProps { - initialState: InMemoryState; -} -const Webview = ({ initialState }: WebviewProps) => { - const [appState, setAppState] = useState(initialState as InMemoryState); - useEffect(() => { - window.addEventListener('message', (event) => { - const message = event.data; - - switch (message.command) { - case 'stateChange': - setAppState(message.state as InMemoryState); - break; - } - }); - - getInitialState().then((state: InMemoryState) => { - setAppState(state); - }); - }, []); - - return ( -
-

- WordPress Playground is a tool for developing WordPress themes - and plugins locally in Visual Studio Code. -

-

- It provides a working local WordPress environment, with which - you can develop and test your WordPress plugin or theme, and - even WordPress core itself. -

-

- To get started, make sure to open a folder with either your - plugin, theme, or an entire WordPress, and then press the button - below to start the playground: -

- -
- ); -}; - -interface ServerStateProps { - appState: InMemoryState; -} -const ServerState = ({ appState }: ServerStateProps) => { - if (appState.state === 'starting-server') { - return ( - <> - - - Starting WordPress Server... - - - ); - } - - if (appState.state === 'server-running') { - return ( - <> - - - Stop WordPress Server - - -

- WordPressServer is running at{' '} - - {appState.serverAddress} - -

- [ - version, - version, - ]) - )} - selected={appState.phpVersion!} - onChange={(value) => { - vscode.postMessage({ - command: 'option-change', - option: 'phpVersion', - value, - }); - }} - /> - {!['core', 'core-develop'].includes(appState.mode) ? ( - [ - version, - version, - ]) - )} - selected={appState.wordPressVersion!} - onChange={(value) => { - vscode.postMessage({ - command: 'option-change', - option: 'wordPressVersion', - value, - }); - }} - /> - ) : null} -

Mode: {appState.mode}

-

Project path: {appState.projectPath}

- - ); - } - - return ( - - - Start WordPress Server - - - ); -}; - -interface DropdownProps { - label: string; - options: Record; - selected: string; - onChange: (value: string) => void; -} - -function Dropdown({ label, options, selected, onChange }: DropdownProps) { - const handleSelectChange = (event) => { - console.log(event.target.value); - onChange(event.target.value); - }; - - return ( -
- - - {Object.entries(options).map(([value, label]) => ( - - {label} - - ))} - -
- ); -} - -function FlexCenter({ children }) { - return ( -
- {children} -
- ); -} - -function handleStartServerClick() { - vscode.postMessage({ - command: 'server-start', - }); -} - -function handleStopServerClick() { - vscode.postMessage({ - command: 'server-stop', - }); -} - -const root = createRoot(document.querySelector('#root')!); -root.render( - -); -window.addEventListener('message', function (event) { - if (event?.data?.command === 'stateChange') { - localStorage.setItem('state', JSON.stringify(event?.data?.state)); - } -}); - -function getInitialState() { - return new Promise((resolve) => { - vscode.postMessage({ command: 'get-state' }); - function renderOnStateChange(event) { - if (event?.data?.command === 'stateChange') { - window.removeEventListener('message', renderOnStateChange); - console.log(event?.data?.state); - resolve(event?.data?.state); - } - } - window.addEventListener('message', renderOnStateChange); - }); -} diff --git a/packages/vscode-extension/src/worker.ts b/packages/vscode-extension/src/worker.ts deleted file mode 100644 index 336bc0fa4a..0000000000 --- a/packages/vscode-extension/src/worker.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { startServer } from '@wp-now/wp-now'; -import { parentPort } from 'worker_threads'; - -async function start(config: any) { - const server = await startServer(config); - parentPort!.postMessage({ - ...server.options, - command: 'server-started', - url: server.url, - }); -} - -parentPort!.on('message', (message) => { - switch (message.command) { - case 'start-server': - start(message.config); - break; - } -}); diff --git a/packages/vscode-extension/tsconfig.json b/packages/vscode-extension/tsconfig.json deleted file mode 100644 index 518abe8908..0000000000 --- a/packages/vscode-extension/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ] -} diff --git a/packages/vscode-extension/tsconfig.lib.json b/packages/vscode-extension/tsconfig.lib.json deleted file mode 100644 index 2ab9f7a812..0000000000 --- a/packages/vscode-extension/tsconfig.lib.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", - "declaration": true, - "jsx": "react", - "types": ["vscode"] - }, - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts", "src/**/*.tsx"] -} diff --git a/packages/vscode-extension/tsconfig.spec.json b/packages/vscode-extension/tsconfig.spec.json deleted file mode 100644 index 09a242da87..0000000000 --- a/packages/vscode-extension/tsconfig.spec.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx", - "src/**/*.d.ts" - ] -} diff --git a/tsconfig.base.json b/tsconfig.base.json index d319551f61..634eb790b6 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -43,9 +43,6 @@ "@wp-playground/remote": [ "packages/playground/remote/src/index.ts" ], - "@wp-playground/vscode-extension": [ - "packages/vscode-extension/src/index.ts" - ], "@wp-playground/website": [ "packages/playground/website/src/index.ts" ]