Skip to content

Commit 633b0f8

Browse files
authored
Merge branch 'main' into multi-project
2 parents 25c3ca3 + e3d9d30 commit 633b0f8

File tree

31 files changed

+798
-688
lines changed

31 files changed

+798
-688
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 529 additions & 514 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"@eslint/plugin-kit": "^0.3.4",
1515
"on-headers": "^1.1.0",
1616
"form-data": "^4.0.4",
17-
"tmp": "^0.2.4"
17+
"tmp": "^0.2.4",
18+
"express": "^4.22.1"
1819
}
1920
},
2021
"scripts": {

workspaces/ballerina/ballerina-extension/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,14 +1190,15 @@
11901190
"dependencies": {
11911191
"@ai-sdk/amazon-bedrock": "^3.0.25",
11921192
"@ai-sdk/anthropic": "^2.0.20",
1193+
"@iarna/toml": "^2.2.5",
11931194
"@types/lodash": "^4.14.200",
11941195
"@vscode/test-electron": "^2.5.2",
11951196
"@vscode/vsce": "^3.7.0",
11961197
"@wso2/ballerina-core": "workspace:*",
11971198
"@wso2/ballerina-visualizer": "workspace:*",
1198-
"@wso2/trace-visualizer": "workspace:*",
11991199
"@wso2/font-wso2-vscode": "workspace:*",
12001200
"@wso2/syntax-tree": "workspace:*",
1201+
"@wso2/trace-visualizer": "workspace:*",
12011202
"@wso2/wso2-platform-core": "workspace:*",
12021203
"ai": "^5.0.56",
12031204
"cors-anywhere": "^0.4.4",
@@ -1212,8 +1213,8 @@
12121213
"node-fetch": "^3.3.2",
12131214
"node-schedule": "^2.1.1",
12141215
"portfinder": "^1.0.32",
1216+
"protobufjs": "^7.2.5",
12151217
"source-map-support": "^0.5.21",
1216-
"toml": "^3.0.0",
12171218
"unzipper": "~0.12.3",
12181219
"uuid": "^11.1.0",
12191220
"vscode-debugadapter": "^1.51.0",
@@ -1228,8 +1229,7 @@
12281229
"vscode-uri": "^3.0.8",
12291230
"xml-js": "^1.6.11",
12301231
"xstate": "^4.38.3",
1231-
"zod": "^4.1.8",
1232-
"protobufjs": "^7.2.5"
1232+
"zod": "^4.1.8"
12331233
},
12341234
"devDependencies": {
12351235
"@sentry/webpack-plugin": "^1.20.1",
@@ -1245,7 +1245,7 @@
12451245
"copyfiles": "^2.4.1",
12461246
"cross-env": "^7.0.3",
12471247
"decache": "^4.6.2",
1248-
"express": "^4.18.2",
1248+
"express": "^4.22.1",
12491249
"istanbul": "^0.4.5",
12501250
"js-yaml": "^4.1.1",
12511251
"jwt-decode": "^3.1.2",

workspaces/ballerina/ballerina-extension/src/features/config-generator/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import { debug } from "../../utils/logger";
20-
import toml from "toml";
20+
import { parse } from "@iarna/toml";
2121
import { CompletionItem, CompletionItemKind, Position, TextDocument, Uri } from "vscode";
2222
import { BallerinaExtension } from "../../core";
2323
import { findPropertyValues, getConfigValue, getCurrentBallerinaProjectFromContext } from "./configGenerator";
@@ -33,7 +33,7 @@ export const typeOfComment = 'Type of';
3333
*/
3434
export function parseTomlToConfig(tomlContent: string): object {
3535
try {
36-
return toml.parse(tomlContent);
36+
return parse(tomlContent);
3737
} catch (error) {
3838
debug("Error while parsing the Config.toml file content: " + error);
3939
}

workspaces/ballerina/ballerina-extension/src/features/tracing/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import * as fs from 'fs';
1919
import * as path from 'path';
20-
import { parse } from 'toml';
20+
import { parse, stringify } from '@iarna/toml';
2121
import { OTLP_PORT } from './constants';
2222

2323
/**
@@ -145,7 +145,7 @@ function updateOrAddSection(content: string, sectionName: string, values: Record
145145
// Build the new section content
146146
let sectionLines: string[] = [sectionHeader];
147147
for (const [key, value] of Object.entries(values)) {
148-
const formattedValue = typeof value === 'string' ? `"${value}"` : String(value);
148+
const formattedValue = stringify.value(value);
149149
sectionLines.push(`${key} = ${formattedValue}`);
150150
}
151151
const sectionContent = sectionLines.join('\n');

workspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-manager.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
LoginMethod,
4242
MetadataWithAttachments,
4343
OperationType,
44+
PackageTomlValues,
4445
PostProcessRequest,
4546
PostProcessResponse,
4647
ProcessContextTypeCreationRequest,
@@ -64,7 +65,7 @@ import * as crypto from 'crypto';
6465
import * as fs from 'fs';
6566
import * as os from 'os';
6667
import path from "path";
67-
import { parse } from 'toml';
68+
import { parse } from "@iarna/toml";
6869
import { workspace } from 'vscode';
6970

7071
import { isNumber } from "lodash";
@@ -812,8 +813,8 @@ async function getCurrentProjectSource(requestType: OperationType, projectPath?:
812813
const tomlContent = await fs.promises.readFile(ballerinaTomlPath, 'utf-8');
813814
// Simple parsing to extract the package.name field
814815
try {
815-
const tomlObj = parse(tomlContent);
816-
packageName = tomlObj.package.name;
816+
const tomlObj = parse(tomlContent) as Partial<PackageTomlValues>;
817+
packageName = tomlObj?.package?.name;
817818
} catch (error) {
818819
packageName = '';
819820
}

workspaces/ballerina/ballerina-extension/src/rpc-managers/common/rpc-manager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@ export class CommonRpcManager implements CommonRPCAPI {
265265
return extension.ballerinaExtInstance.isNPSupported;
266266
}
267267

268-
async getCurrentProjectTomlValues(): Promise<PackageTomlValues> {
269-
return getProjectTomlValues(StateMachine.context().projectPath);
268+
async getCurrentProjectTomlValues(): Promise<Partial<PackageTomlValues>> {
269+
const tomlValues = await getProjectTomlValues(StateMachine.context().projectPath);
270+
return tomlValues ?? {};
270271
}
271272

272273
async getWorkspaceType(): Promise<WorkspaceTypeResponse> {

workspaces/ballerina/ballerina-extension/src/utils/bi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { applyModifications, modifyFileContent, writeBallerinaFileDidOpen } from
3838
import { ModulePart, STKindChecker } from "@wso2/syntax-tree";
3939
import { URI } from "vscode-uri";
4040
import { debug } from "./logger";
41-
import { parse } from "toml";
41+
import { parse } from "@iarna/toml";
4242
import { getProjectTomlValues } from "./config";
4343

4444
export const README_FILE = "readme.md";
@@ -363,8 +363,8 @@ function addToWorkspaceToml(workspacePath: string, packageName: string) {
363363

364364
try {
365365
const ballerinaTomlContent = fs.readFileSync(ballerinaTomlPath, 'utf8');
366-
const tomlData: WorkspaceTomlValues = parse(ballerinaTomlContent);
367-
const existingPackages: string[] = tomlData.workspace?.packages || [];
366+
const tomlData = parse(ballerinaTomlContent) as Partial<WorkspaceTomlValues>;
367+
const existingPackages: string[] = tomlData?.workspace?.packages ?? [];
368368

369369
if (existingPackages.includes(packageName)) {
370370
return; // Package already exists
@@ -388,8 +388,8 @@ export function deleteProjectFromWorkspace(workspacePath: string, packagePath: s
388388

389389
try {
390390
const ballerinaTomlContent = fs.readFileSync(ballerinaTomlPath, 'utf8');
391-
const tomlData: WorkspaceTomlValues = parse(ballerinaTomlContent);
392-
const existingPackages: string[] = tomlData.workspace?.packages || [];
391+
const tomlData = parse(ballerinaTomlContent) as Partial<WorkspaceTomlValues>;
392+
const existingPackages: string[] = tomlData?.workspace?.packages ?? [];
393393

394394
if (!existingPackages.includes(relativeProjectPath)) {
395395
return; // Package not found

workspaces/ballerina/ballerina-extension/src/utils/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { BallerinaExtension } from '../core';
2121
import { WorkspaceConfiguration, workspace, Uri, RelativePattern } from 'vscode';
2222
import * as fs from 'fs';
2323
import * as path from 'path';
24-
import { parse } from 'toml';
24+
import { parse } from '@iarna/toml';
2525

2626
export enum VERSION {
2727
BETA = 'beta',
@@ -303,25 +303,25 @@ export function getOrgPackageName(projectPath: string): { orgName: string, packa
303303
}
304304
}
305305

306-
export async function getProjectTomlValues(projectPath: string): Promise<PackageTomlValues | undefined> {
306+
export async function getProjectTomlValues(projectPath: string): Promise<Partial<PackageTomlValues> | undefined> {
307307
const ballerinaTomlPath = path.join(projectPath, 'Ballerina.toml');
308308
if (fs.existsSync(ballerinaTomlPath)) {
309309
const tomlContent = await fs.promises.readFile(ballerinaTomlPath, 'utf-8');
310310
try {
311-
return parse(tomlContent);
311+
return parse(tomlContent) as Partial<PackageTomlValues>;
312312
} catch (error) {
313313
console.error("Failed to load Ballerina.toml content for project at path: ", projectPath, error);
314314
return;
315315
}
316316
}
317317
}
318318

319-
export async function getWorkspaceTomlValues(workspacePath: string): Promise<WorkspaceTomlValues | undefined> {
319+
export async function getWorkspaceTomlValues(workspacePath: string): Promise<Partial<WorkspaceTomlValues> | undefined> {
320320
const ballerinaTomlPath = path.join(workspacePath, 'Ballerina.toml');
321321
if (fs.existsSync(ballerinaTomlPath)) {
322322
const tomlContent = await fs.promises.readFile(ballerinaTomlPath, 'utf-8');
323323
try {
324-
return parse(tomlContent);
324+
return parse(tomlContent) as Partial<WorkspaceTomlValues>;
325325
} catch (error) {
326326
console.error("Failed to load Ballerina.toml content for workspace at path: ", workspacePath, error);
327327
return;

workspaces/ballerina/ballerina-low-code-diagram/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"storybook:setup": "node tools/setup-storybook.js"
2222
},
2323
"dependencies": {
24+
"@date-io/date-fns": "^3.2.1",
2425
"@wso2/ballerina-core": "workspace:*",
2526
"@wso2/syntax-tree": "workspace:*",
26-
"@date-io/date-fns": "^3.2.1",
2727
"classnames": "^2.5.1",
2828
"clipboard-copy": "^4.0.1",
2929
"clsx": "^2.1.1",
@@ -38,14 +38,14 @@
3838
"lodash.camelcase": "^4.3.0",
3939
"lodash.clonedeep": "^4.5.0",
4040
"lodash.debounce": "^4.0.8",
41+
"monaco-editor": "0.52.2",
4142
"react": "18.2.0",
4243
"react-dom": "18.2.0",
4344
"react-intl": "^7.1.11",
4445
"react-lottie": "^1.2.10",
4546
"react-zoom-pan-pinch": "^3.7.0",
4647
"uuid": "^11.1.0",
47-
"vscode-languageserver-protocol": "^3.17.5",
48-
"monaco-editor": "0.52.2"
48+
"vscode-languageserver-protocol": "^3.17.5"
4949
},
5050
"devDependencies": {
5151
"@babel/core": "^7.27.1",
@@ -73,6 +73,7 @@
7373
"copy-webpack-plugin": "^13.0.0",
7474
"copyfiles": "^2.4.1",
7575
"css-loader": "^7.1.2",
76+
"express": "^4.22.1",
7677
"file-loader": "^6.2.0",
7778
"fork-ts-checker-webpack-plugin": "^9.1.0",
7879
"glob": "^11.1.0",
@@ -101,8 +102,7 @@
101102
"typescript": "5.8.3",
102103
"webpack": "^5.99.8",
103104
"webpack-cli": "^6.0.1",
104-
"webpack-dev-server": "^5.2.1",
105-
"express": "^4.21.2"
105+
"webpack-dev-server": "^5.2.1"
106106
},
107107
"repository": {
108108
"type": "git",

0 commit comments

Comments
 (0)