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 91d9799ed3..823c525ede 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 e3a8c88ad7..0000000000 Binary files a/packages/vscode-extension/public/icon.png and /dev/null differ 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 a4ecd9ba3d..b16989d6f3 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -46,9 +46,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" ]