Skip to content

Commit

Permalink
Static copy Argus dist to extension target.
Browse files Browse the repository at this point in the history
Spoiler alert, this still doesn't work though. Something is loading a
local resource at under node_modules but this should only happen for the
codicons stylesheet which is in the panoptes/node_modules dir. Very puzzled.
  • Loading branch information
gavinleroy committed Feb 25, 2024
1 parent 06cc866 commit 96fb3b0
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 9 deletions.
16 changes: 11 additions & 5 deletions ide/packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
"url": "https://github.com/cognitive-engineering-lab/argus",
"type": "git"
},
"categories": ["Programming Languages"],
"activationEvents": ["onLanguage:rust"],
"categories": [
"Programming Languages"
],
"activationEvents": [
"onLanguage:rust"
],
"contributes": {
"commands": [
{
Expand All @@ -25,7 +29,9 @@
}
]
},
"files": ["dist"],
"files": [
"dist"
],
"main": "./dist/argus.js",
"exports": {
".": {
Expand All @@ -49,7 +55,6 @@
"build": "depot build",
"vscode:prepublish": "depot build"
},
"dependencies": {},
"devDependencies": {
"@argus/common": "workspace:*",
"@argus/panoptes": "workspace:*",
Expand All @@ -69,6 +74,7 @@
"react-dom": "^18.0.0",
"toml": "^3.0.0",
"typescript": "^5.1.3",
"vite": "^4.4.9"
"vite": "^4.4.9",
"vite-plugin-static-copy": "^1.0.1"
}
}
3 changes: 1 addition & 2 deletions ide/packages/extension/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ export class View {
) {
const panoptesDir = vscode.Uri.joinPath(
this.extensionUri,
"node_modules",
"@argus",
"dist",
"panoptes"
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import fs from "fs";
import { builtinModules } from "module";
import { resolve } from "path";
import path from "path";
import toml from "toml";
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";

const manifest = JSON.parse(fs.readFileSync("package.json", "utf-8"));
const rustToolchain = toml.parse(
fs.readFileSync("../../../rust-toolchain.toml", "utf-8")
);
export default defineConfig(({ mode }) => ({
plugins: [
viteStaticCopy({
targets: [
{
src: path.resolve(__dirname, "./node_modules/@argus") + "/[!.]*",
dest: "./",
},
],
}),
],
build: {
target: "node16",
lib: {
Expand Down
93 changes: 91 additions & 2 deletions ide/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 96fb3b0

Please sign in to comment.