From 30151c56856769204a9a451c2d83b9aecce983cf Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 17 Jul 2023 19:22:38 -0600 Subject: [PATCH] release: bundle the extension, hopefully this ensures deps are included (#297) --- .github/workflows/build.yaml | 2 +- .gitignore | 3 +- .vscode/launch.json | 3 +- .vscode/tasks.json | 20 ----- .vscodeignore | 16 ++-- package.json | 12 +-- src/decomp/man-page.ts | 2 +- tsconfig.json | 3 +- yarn.lock | 143 +++++++++++++++++++++++++++++++++++ 9 files changed, 163 insertions(+), 41 deletions(-) delete mode 100644 .vscode/tasks.json diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 21da0dd..0231665 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,4 +28,4 @@ jobs: run: yarn install --immutable - name: Build Extension - run: yarn compile + run: yarn esbuild diff --git a/.gitignore b/.gitignore index 3737712..52453fe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ lsp-metadata.json .yarn/* !.yarn/patches .pnp.* -.yarnrc.yml \ No newline at end of file +.yarnrc.yml +dist/ diff --git a/.vscode/launch.json b/.vscode/launch.json index 2ff0a35..1092e61 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,8 +11,7 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": ["--extensionDevelopmentPath=${workspaceFolder}"], - "outFiles": ["${workspaceFolder}/out/**/*.js"], - "preLaunchTask": "npm: watch" + "outFiles": ["${workspaceFolder}/dist/**/*.js"] } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 078ff7e..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,20 +0,0 @@ -// See https://go.microsoft.com/fwlink/?LinkId=733558 -// for the documentation about the tasks.json format -{ - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "watch", - "problemMatcher": "$tsc-watch", - "isBackground": true, - "presentation": { - "reveal": "never" - }, - "group": { - "kind": "build", - "isDefault": true - } - } - ] -} diff --git a/.vscodeignore b/.vscodeignore index 5718127..62a3102 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -5,14 +5,10 @@ */**/.DS_Store # Whitelist -!img/** -!icons/** -!out/** -!lib/** -!snippets/** -!syntaxes/** -!package.json -!README.md +!img/ +!icons/ +!dist/ +!snippets/ +!syntaxes/ +!lib/ !LICENSE -!src/vendor/**/LICENSE -!node_modules/** diff --git a/package.json b/package.json index c731cb7..3ebc0f6 100644 --- a/package.json +++ b/package.json @@ -16,15 +16,15 @@ "type": "git", "url": "https://github.com/open-goal/opengoal-vscode" }, - "main": "./out/extension.js", + "main": "dist/main.js", "scripts": { - "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", "lint": "eslint . --ext .ts,.tsx", - "watch": "tsc -watch -p ./", "format": "npx prettier --write .", "format:check": "npx prettier --check .", - "postinstall": "patch-package" + "postinstall": "patch-package", + "vscode:prepublish": "esbuild ./src/extension.ts --bundle --outfile=dist/main.js --external:vscode --format=cjs --platform=node --minify", + "esbuild": "esbuild ./src/extension.ts --bundle --outfile=dist/main.js --external:vscode --format=cjs --platform=node --sourcemap", + "dev": "esbuild ./src/extension.ts --bundle --outfile=dist/main.js --external:vscode --format=cjs --platform=node --sourcemap --watch" }, "devDependencies": { "@types/follow-redirects": "^1.14.1", @@ -34,8 +34,10 @@ "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vscode/vsce": "^2.15.0", + "esbuild": "^0.18.13", "eslint": "^8.44.0", "patch-package": "^7.0.0", + "prettier": "3.0.0", "typescript": "^5.1.6" }, "dependencies": { diff --git a/src/decomp/man-page.ts b/src/decomp/man-page.ts index 11f79ee..f43363f 100644 --- a/src/decomp/man-page.ts +++ b/src/decomp/man-page.ts @@ -5,7 +5,7 @@ import { updateEeManPagePath, updateVuManPagePath, } from "../config/config"; -import * as instructions from "../data/decomp/instructions.json"; +import instructions from "../data/decomp/instructions.json"; export async function open_in_pdf(mnemonic: string) { const relevant_options: any[] = []; diff --git a/tsconfig.json b/tsconfig.json index 7d4eede..1990414 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,8 @@ "strict": true, "rootDir": "src", "resolveJsonModule": true, - "skipLibCheck": true + "skipLibCheck": true, + "esModuleInterop": true }, "exclude": ["node_modules", ".vscode-test"] } diff --git a/yarn.lock b/yarn.lock index e6d04e0..b39162e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,116 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@esbuild/android-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.13.tgz#70ef455455654c7800c31ae55ae295d81712238c" + integrity sha512-j7NhycJUoUAG5kAzGf4fPWfd17N6SM3o1X6MlXVqfHvs2buFraCJzos9vbeWjLxOyBKHyPOnuCuipbhvbYtTAg== + +"@esbuild/android-arm@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.13.tgz#15db83099855fc4193658a40687893ee5c95d7a9" + integrity sha512-KwqFhxRFMKZINHzCqf8eKxE0XqWlAVPRxwy6rc7CbVFxzUWB2sA/s3hbMZeemPdhN3fKBkqOaFhTbS8xJXYIWQ== + +"@esbuild/android-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.13.tgz#473d589219e1c06e305cf61ca77b8f69d9b6ffab" + integrity sha512-M2eZkRxR6WnWfVELHmv6MUoHbOqnzoTVSIxgtsyhm/NsgmL+uTmag/VVzdXvmahak1I6sOb1K/2movco5ikDJg== + +"@esbuild/darwin-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.13.tgz#0f525b2c1821a0591a06963582e5dc749ba51d45" + integrity sha512-f5goG30YgR1GU+fxtaBRdSW3SBG9pZW834Mmhxa6terzcboz7P2R0k4lDxlkP7NYRIIdBbWp+VgwQbmMH4yV7w== + +"@esbuild/darwin-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.13.tgz#81965b690bae86bf1289b2ce0732506fd41fb545" + integrity sha512-RIrxoKH5Eo+yE5BtaAIMZaiKutPhZjw+j0OCh8WdvKEKJQteacq0myZvBDLU+hOzQOZWJeDnuQ2xgSScKf1Ovw== + +"@esbuild/freebsd-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.13.tgz#895bb37fdea886db09549119158e044f146861f0" + integrity sha512-AfRPhHWmj9jGyLgW/2FkYERKmYR+IjYxf2rtSLmhOrPGFh0KCETFzSjx/JX/HJnvIqHt/DRQD/KAaVsUKoI3Xg== + +"@esbuild/freebsd-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.13.tgz#0b1dfde3ff1b18f03f71e460f91dc463e6a23903" + integrity sha512-pGzWWZJBInhIgdEwzn8VHUBang8UvFKsvjDkeJ2oyY5gZtAM6BaxK0QLCuZY+qoj/nx/lIaItH425rm/hloETA== + +"@esbuild/linux-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.13.tgz#350febed5d32d8ec1a424a4c4d7c9ba885604960" + integrity sha512-hCzZbVJEHV7QM77fHPv2qgBcWxgglGFGCxk6KfQx6PsVIdi1u09X7IvgE9QKqm38OpkzaAkPnnPqwRsltvLkIQ== + +"@esbuild/linux-arm@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.13.tgz#47639d73d894026350eaccf7c174f1d26b747d6a" + integrity sha512-4iMxLRMCxGyk7lEvkkvrxw4aJeC93YIIrfbBlUJ062kilUUnAiMb81eEkVvCVoh3ON283ans7+OQkuy1uHW+Hw== + +"@esbuild/linux-ia32@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.13.tgz#a901a16349c58bf6f873bced36bdf46a5f4dac5d" + integrity sha512-I3OKGbynl3AAIO6onXNrup/ttToE6Rv2XYfFgLK/wnr2J+1g+7k4asLrE+n7VMhaqX+BUnyWkCu27rl+62Adug== + +"@esbuild/linux-loong64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.13.tgz#faa08db402c18e351234719e00aba98867aa34ce" + integrity sha512-8pcKDApAsKc6WW51ZEVidSGwGbebYw2qKnO1VyD8xd6JN0RN6EUXfhXmDk9Vc4/U3Y4AoFTexQewQDJGsBXBpg== + +"@esbuild/linux-mips64el@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.13.tgz#2123a54b49ddc1a1dff057bba8a9a5e9f26e5009" + integrity sha512-6GU+J1PLiVqWx8yoCK4Z0GnfKyCGIH5L2KQipxOtbNPBs+qNDcMJr9euxnyJ6FkRPyMwaSkjejzPSISD9hb+gg== + +"@esbuild/linux-ppc64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.13.tgz#9a9befd275a6a3f5baeed89aaafb746df7ba735d" + integrity sha512-pfn/OGZ8tyR8YCV7MlLl5hAit2cmS+j/ZZg9DdH0uxdCoJpV7+5DbuXrR+es4ayRVKIcfS9TTMCs60vqQDmh+w== + +"@esbuild/linux-riscv64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.13.tgz#6644a5b5840fa0c3ffade6f87d943413ece520a8" + integrity sha512-aIbhU3LPg0lOSCfVeGHbmGYIqOtW6+yzO+Nfv57YblEK01oj0mFMtvDJlOaeAZ6z0FZ9D13oahi5aIl9JFphGg== + +"@esbuild/linux-s390x@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.13.tgz#c1367a0a02b37f6b0382e71d9c9d97352ca23013" + integrity sha512-Pct1QwF2sp+5LVi4Iu5Y+6JsGaV2Z2vm4O9Dd7XZ5tKYxEHjFtb140fiMcl5HM1iuv6xXO8O1Vrb1iJxHlv8UA== + +"@esbuild/linux-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.13.tgz#892674f0918ee3f5e523270cf49a69a557fb64c0" + integrity sha512-zTrIP0KzYP7O0+3ZnmzvUKgGtUvf4+piY8PIO3V8/GfmVd3ZyHJGz7Ht0np3P1wz+I8qJ4rjwJKqqEAbIEPngA== + +"@esbuild/netbsd-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.13.tgz#67954292195ecbdae33ab09a9ae6a7f566e49d04" + integrity sha512-I6zs10TZeaHDYoGxENuksxE1sxqZpCp+agYeW039yqFwh3MgVvdmXL5NMveImOC6AtpLvE4xG5ujVic4NWFIDQ== + +"@esbuild/openbsd-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.13.tgz#b3eef873dfab547fbe7bcdb3573e1c59dea676b7" + integrity sha512-W5C5nczhrt1y1xPG5bV+0M12p2vetOGlvs43LH8SopQ3z2AseIROu09VgRqydx5qFN7y9qCbpgHLx0kb0TcW7g== + +"@esbuild/sunos-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.13.tgz#b368080f42dbb5ae926d0567c02bcd68a34c5efd" + integrity sha512-X/xzuw4Hzpo/yq3YsfBbIsipNgmsm8mE/QeWbdGdTTeZ77fjxI2K0KP3AlhZ6gU3zKTw1bKoZTuKLnqcJ537qw== + +"@esbuild/win32-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.13.tgz#11dedda0e8cfb5f781411ea362b2040304be0fc3" + integrity sha512-4CGYdRQT/ILd+yLLE5i4VApMPfGE0RPc/wFQhlluDQCK09+b4JDbxzzjpgQqTPrdnP7r5KUtGVGZYclYiPuHrw== + +"@esbuild/win32-ia32@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.13.tgz#6b8aa95515c05827b7c24c9db9581943566e0dcb" + integrity sha512-D+wKZaRhQI+MUGMH+DbEr4owC2D7XnF+uyGiZk38QbgzLcofFqIOwFs7ELmIeU45CQgfHNy9Q+LKW3cE8g37Kg== + +"@esbuild/win32-x64@0.18.13": + version "0.18.13" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.13.tgz#031f69b1f4cf62a18c38d502458c0b8b02625461" + integrity sha512-iVl6lehAfJS+VmpF3exKpNQ8b0eucf5VWfzR8S7xFve64NBNz2jPUgx1X93/kfnkfgP737O+i1k54SVQS7uVZA== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.3.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -601,6 +711,34 @@ entities@~2.1.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== +esbuild@^0.18.13: + version "0.18.13" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.18.13.tgz#59160add6c3420947fe008238140ed3480baf817" + integrity sha512-vhg/WR/Oiu4oUIkVhmfcc23G6/zWuEQKFS+yiosSHe4aN6+DQRXIfeloYGibIfVhkr4wyfuVsGNLr+sQU1rWWw== + optionalDependencies: + "@esbuild/android-arm" "0.18.13" + "@esbuild/android-arm64" "0.18.13" + "@esbuild/android-x64" "0.18.13" + "@esbuild/darwin-arm64" "0.18.13" + "@esbuild/darwin-x64" "0.18.13" + "@esbuild/freebsd-arm64" "0.18.13" + "@esbuild/freebsd-x64" "0.18.13" + "@esbuild/linux-arm" "0.18.13" + "@esbuild/linux-arm64" "0.18.13" + "@esbuild/linux-ia32" "0.18.13" + "@esbuild/linux-loong64" "0.18.13" + "@esbuild/linux-mips64el" "0.18.13" + "@esbuild/linux-ppc64" "0.18.13" + "@esbuild/linux-riscv64" "0.18.13" + "@esbuild/linux-s390x" "0.18.13" + "@esbuild/linux-x64" "0.18.13" + "@esbuild/netbsd-x64" "0.18.13" + "@esbuild/openbsd-x64" "0.18.13" + "@esbuild/sunos-x64" "0.18.13" + "@esbuild/win32-arm64" "0.18.13" + "@esbuild/win32-ia32" "0.18.13" + "@esbuild/win32-x64" "0.18.13" + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1391,6 +1529,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" + integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== + promise-duplex@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/promise-duplex/-/promise-duplex-6.0.0.tgz#9d9d13383ac0f70701b9f095ffd486f106c2232e"