Skip to content

Commit aa6e54d

Browse files
committed
feat(service-graph): Added various new UI components and updated langium to latest version
1 parent 5b26d98 commit aa6e54d

File tree

147 files changed

+13231
-20410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+13231
-20410
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { ServiceGraph } from "@acidic/service-graph";
1+
import { ServiceGraphContainer } from "@acidic/vscode-components";
22
import React from "react";
33

44
export const App: React.FC = () => {
55
return (
66
<div className="h-full w-full p-2 pb-4">
7-
<ServiceGraph />
7+
<ServiceGraphContainer />
88
</div>
99
);
1010
};

apps/vscode-extension/client/style/global.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,31 @@ body {
1515
margin: 0;
1616
padding: 0;
1717
}
18+
19+
.background-gradient::before {
20+
background: radial-gradient(
21+
35% 40% at 44% 50%,
22+
rgba(99, 102, 241, 0.476) 0%,
23+
rgba(37, 38, 44, 0) 100%
24+
);
25+
z-index: 1;
26+
content: "";
27+
position: absolute;
28+
inset: 0px;
29+
transform: scale(1);
30+
pointer-events: none;
31+
}
32+
33+
.background-gradient::after {
34+
background: radial-gradient(
35+
30% 35% at 64% 60%,
36+
rgba(16, 185, 129, 0.376) 0%,
37+
rgba(37, 38, 44, 0) 100%
38+
);
39+
z-index: 1;
40+
content: "";
41+
position: absolute;
42+
inset: 0px;
43+
transform: scale(1);
44+
pointer-events: none;
45+
}

apps/vscode-extension/esbuild.client.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616
treeShaking: true,
1717
jsx: "automatic",
1818
logLevel: "error",
19+
outdir: "dist/apps/vscode-extension/client",
1920
define: {
2021
"import.meta.url": "importMetaUrl"
2122
},

apps/vscode-extension/esbuild.extension.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { esbuildDecorators } = require("@anatine/esbuild-decorators");
2+
const esbuildPluginPino = require("esbuild-plugin-pino");
23

34
module.exports = {
45
mainFields: ["module", "main"],
@@ -11,13 +12,15 @@ module.exports = {
1112
".node": "dataurl"
1213
},
1314
logLevel: "error",
15+
outdir: "dist/apps/vscode-extension",
1416
define: {
1517
"import.meta.url": "importMetaUrl"
1618
},
1719
inject: ["./apps/vscode-extension/esbuild.shim.js"],
1820
plugins: [
1921
esbuildDecorators({
2022
tsconfig: "apps/vscode-extension/tsconfig.extension.json"
21-
})
23+
}),
24+
esbuildPluginPino({ transports: ["pino-pretty"] })
2225
]
2326
};

apps/vscode-extension/extension/main.ts

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { createAcidicConfig } from "@acidic/config";
2+
import { CommandName, getCommandId } from "@acidic/vscode-rpc";
23
import {
3-
CommandName,
44
LOCATE_YOUR_WORKSPACE,
55
SupportTreeProvider,
66
WorkspaceConfigStore,
77
createLogger,
8-
getCommandId,
98
initServiceTree
109
} from "@acidic/vscode-state";
1110
import {
1211
findWorkspaceRootSafe,
1312
loadStormConfig
1413
} from "@storm-software/config-tools";
15-
import { getCauseFromUnknown } from "@storm-stack/errors";
14+
import { StormError } from "@storm-stack/errors";
1615
import { StormLog } from "@storm-stack/logging";
1716
import { dirname } from "path";
1817
import {
@@ -24,9 +23,8 @@ import {
2423
workspace
2524
} from "vscode";
2625
import {
26+
CancellationStrategy,
2727
LanguageClient,
28-
LanguageClientOptions,
29-
ServerOptions,
3028
TransportKind
3129
} from "vscode-languageclient/node";
3230
import { ReactPanel } from "./webview/react-panel";
@@ -70,7 +68,7 @@ export async function activate(_context: ExtensionContext) {
7068
writeStatusBarMessage("Acidic Workspace is ready");
7169
}
7270
} catch (error) {
73-
const stormError = getCauseFromUnknown(error);
71+
const stormError = StormError.create(error);
7472
window.showErrorMessage(stormError.print());
7573
}
7674
}
@@ -90,56 +88,57 @@ function writeStatusBarMessage(message: string) {
9088
}, 3000);
9189
}
9290

93-
function startLanguageClient(context: ExtensionContext): LanguageClient {
94-
const serverModule = context.asAbsolutePath("langauge-server/main.js");
95-
91+
async function startLanguageClient(
92+
context: ExtensionContext,
93+
workspaceRoot: string
94+
): Promise<LanguageClient> {
9695
// The debug options for the server
9796
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging.
9897
// By setting `process.env.DEBUG_BREAK` to a truthy value, the language server will wait until a debugger is attached.
99-
const debugOptions = {
100-
execArgv: [
101-
"--nolazy",
102-
`--inspect${process.env.DEBUG_BREAK ? "-brk" : ""}=${
103-
process.env.DEBUG_SOCKET || "6009"
104-
}`
105-
]
106-
};
107-
108-
// If the extension is launched in debug mode then the debug server options are used
109-
// Otherwise the run options are used
110-
const serverOptions: ServerOptions = {
111-
run: { module: serverModule, transport: TransportKind.ipc },
112-
debug: {
113-
module: serverModule,
114-
transport: TransportKind.ipc,
115-
options: debugOptions
116-
}
117-
};
11898

119-
const fileSystemWatcher = workspace.createFileSystemWatcher(
120-
"**/{*.acid,*.acidic}"
121-
);
99+
const fileSystemWatcher = workspace.createFileSystemWatcher("**/*.acid");
122100
context.subscriptions.push(fileSystemWatcher);
123101

124-
// Options to control the language client
125-
const clientOptions: LanguageClientOptions = {
126-
documentSelector: [{ scheme: "file", language: "acidic" }],
127-
synchronize: {
128-
// Notify the server about file changes to files contained in the workspace
129-
fileEvents: fileSystemWatcher
130-
}
131-
};
132-
133102
// Create the language client and start the client.
134103
const client = new LanguageClient(
135-
"AcidicLanguageClient",
136-
"Acidic Language Client",
137-
serverOptions,
138-
clientOptions
104+
"acidic",
105+
"Acidic Language Server",
106+
{
107+
run: {
108+
module: context.asAbsolutePath("language-server/main.js"),
109+
transport: TransportKind.ipc
110+
},
111+
debug: {
112+
module: context.asAbsolutePath("language-server/main.js"),
113+
transport: TransportKind.ipc,
114+
options: {
115+
execArgv: [
116+
"--nolazy",
117+
`--inspect${process.env.DEBUG_BREAK ? "-brk" : ""}=${
118+
process.env.DEBUG_SOCKET || "6009"
119+
}`
120+
],
121+
cwd: workspaceRoot
122+
}
123+
}
124+
},
125+
{
126+
documentSelector: [{ scheme: "file", language: "acidic" }],
127+
synchronize: {
128+
// Notify the server about file changes to files contained in the workspace
129+
fileEvents: fileSystemWatcher
130+
},
131+
connectionOptions: {
132+
cancellationStrategy: CancellationStrategy.Message,
133+
maxRestartCount: 5
134+
},
135+
progressOnInitialization: true
136+
},
137+
true
139138
);
140139

141140
// Start the client. This will also launch the server
142-
client.start();
141+
await client.start();
143142
return client;
144143
}
145144

@@ -212,11 +211,11 @@ async function loadWorkspaceRoot(workspacePath: string): Promise<boolean> {
212211
WorkspaceConfigStore.fromContext(context, logger);
213212
WorkspaceConfigStore.instance.setWorkspaceRoot(workspaceRoot);
214213

215-
// client = startLanguageClient(context);
214+
client = await startLanguageClient(context, workspaceRoot);
216215

217216
context.subscriptions.push(
218217
commands.registerCommand(
219-
getCommandId(CommandName.SET_WORKSPACE_READY),
218+
getCommandId(CommandName.ON_WORKSPACE_READY),
220219
handleWorkspaceReady
221220
)
222221
);
@@ -255,7 +254,9 @@ async function loadWorkspaceRoot(workspacePath: string): Promise<boolean> {
255254
} catch (error) {
256255
console.error(error);
257256
window.showErrorMessage(
258-
`Error occured while loading workspace from ${workspacePath}`
257+
`Error occured while loading workspace from ${workspacePath} \n${StormError.create(
258+
error
259+
)}`
259260
);
260261

261262
if (logger) {

apps/vscode-extension/package.json

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,13 @@
5555
"icon": "$(symbol-folder)"
5656
},
5757
{
58-
"command": "acidicWorkspace.refresh",
59-
"title": "Acidic Engine: Refresh Workspace",
58+
"command": "acidicWorkspace.setServices",
59+
"title": "Acidic Engine: Set Services",
60+
"icon": "$(sync)"
61+
},
62+
{
63+
"command": "acidicWorkspace.setSettings",
64+
"title": "Acidic Engine: Set Services",
6065
"icon": "$(sync)"
6166
},
6267
{
@@ -68,27 +73,27 @@
6873
}
6974
},
7075
{
71-
"command": "acidicWorkspace.setWorkspaceReady",
72-
"title": "Acidic Engine: Set Workspace Ready",
76+
"command": "acidicWorkspace.onWorkspaceReady",
77+
"title": "Acidic Engine: Workspace Ready",
7378
"icon": {
7479
"light": "assets/vscode/test-tube.svg",
7580
"dark": "assets/vscode/test-tube.svg"
7681
}
7782
},
7883
{
79-
"command": "acidicWorkspace.refreshSchemaStart",
84+
"command": "acidicWorkspace.onRefresh",
8085
"title": "Acidic Engine: Refresh Schema",
81-
"icon": "$(sync~spin)"
86+
"icon": "$(sync)"
8287
},
8388
{
84-
"command": "acidicWorkspace.refreshSchemaEnd",
89+
"command": "acidicWorkspace.onRefreshFinished",
8590
"title": "Acidic Engine: Refresh Schema End",
8691
"icon": "$(sync-ignored)"
8792
}
8893
],
8994
"editor/title": [
9095
{
91-
"command": "acidicWorkspace.refresh",
96+
"command": "acidicWorkspace.onRefresh",
9297
"group": "navigation"
9398
}
9499
],
@@ -123,20 +128,20 @@
123128
"menus": {
124129
"view/title": [
125130
{
126-
"command": "acidicWorkspace.refresh",
127-
"when": "view == acidic-workspace",
131+
"command": "acidicWorkspace.onRefresh",
132+
"when": "view == acidicWorkspace.views.services",
128133
"group": "navigation"
129134
}
130135
],
131136
"view/item/context": [
132137
{
133-
"command": "acidicWorkspace.refresh",
138+
"command": "acidicWorkspace.onRefresh",
134139
"when": "viewItem == schema_active"
135140
}
136141
],
137142
"editor/title": [
138143
{
139-
"command": "acidicWorkspace.refresh",
144+
"command": "acidicWorkspace.onRefresh",
140145
"group": "navigation"
141146
}
142147
]
@@ -205,15 +210,15 @@
205210
},
206211
{
207212
"view": "acidicWorkspace.views.welcome",
208-
"contents": "We couldn't find any projects in this workspace. \n Make sure that the proper dependencies are installed locally and refresh the workspace. \n [$(sync) Refresh Workspace](command:acidicWorkspace.refresh)\n If you're just getting started with Acidic, you can learn more by reading our [documentation](https://acidic.io/getting-started).",
213+
"contents": "We couldn't find any projects in this workspace. \n Make sure that the proper dependencies are installed locally and refresh the workspace. \n [$(sync) Refresh Workspace](command:acidicWorkspace.onRefresh)\n If you're just getting started with Acidic, you can learn more by reading our [documentation](https://acidic.io/getting-started).",
209214
"when": "hasWorkspaceRoot"
210215
}
211216
],
212217
"walkthroughs": [
213218
{
214219
"id": "acidicWorkspace",
215-
"title": "Getting Started with Nx Console",
216-
"description": "Interacting with your Nx Workspace",
220+
"title": "Getting Started with Acidic Workspace",
221+
"description": "Interacting with the Acidic Engine in Visual Studio Code",
217222
"steps": [
218223
{
219224
"id": "acidicWorkspace.generate",
@@ -273,7 +278,7 @@
273278
"@vscode/vsce": "2.21.1",
274279
"esbuild-plugin-pino": "^2.1.0",
275280
"express": "^4.18.2",
276-
"langium": "^1.3.1",
281+
"langium": "^2.1.3",
277282
"pino-pretty": "^10.3.0",
278283
"react": "18.2.0",
279284
"react-dom": "18.2.0",
Lines changed: 1 addition & 0 deletions
Loading

docs/api-reports/apps/cli/api-report.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
55
```ts
6+
67
// @public (undocumented)
78
const createCLIAcidicProgram: () => Promise<number>;
8-
export { createCLIAcidicProgram };
9-
export { createCLIAcidicProgram as createCLIAcidicProgram_alias_1 };
10-
export { createCLIAcidicProgram as createCLIAcidicProgram_alias_2 };
9+
export { createCLIAcidicProgram }
10+
export { createCLIAcidicProgram as createCLIAcidicProgram_alias_1 }
11+
export { createCLIAcidicProgram as createCLIAcidicProgram_alias_2 }
1112

1213
// (No @packageDocumentation comment for this package)
14+
1315
```

0 commit comments

Comments
 (0)