fix(editor): bump monaco-editor to 0.55.1 and adapt TypeScript intellisense integration to the updated Monaco API
This commit is contained in:
BIN
.playwright-mcp/workspace-test.png
Normal file
BIN
.playwright-mcp/workspace-test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
@@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-12-30 - 3.14.2 - fix(editor)
|
||||||
|
bump monaco-editor to 0.55.1 and adapt TypeScript intellisense integration to the updated Monaco API
|
||||||
|
|
||||||
|
- Bumped dependency monaco-editor from 0.52.2 to 0.55.1 in package.json.
|
||||||
|
- Generated MONACO_VERSION module updated to 0.55.1 and moved target to ts_web/elements/00group-editor/dees-editor-monaco/version.ts.
|
||||||
|
- Refactored TypeScript IntelliSense code to use a typed Monaco TS API (added IMonacoTypeScriptAPI, tsApi getter, and replaced direct monaco.languages.typescript.* calls).
|
||||||
|
- Added test/workspace screenshot .playwright-mcp/workspace-test.png (binary asset).
|
||||||
|
|
||||||
## 2025-12-30 - 3.14.1 - fix(build)
|
## 2025-12-30 - 3.14.1 - fix(build)
|
||||||
bump @webcontainer/api and enable skipLibCheck to avoid type-check conflicts
|
bump @webcontainer/api and enable skipLibCheck to avoid type-check conflicts
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
"ibantools": "^4.5.1",
|
"ibantools": "^4.5.1",
|
||||||
"lit": "^3.3.1",
|
"lit": "^3.3.1",
|
||||||
"lucide": "^0.562.0",
|
"lucide": "^0.562.0",
|
||||||
"monaco-editor": "0.52.2",
|
"monaco-editor": "0.55.1",
|
||||||
"pdfjs-dist": "^4.10.38",
|
"pdfjs-dist": "^4.10.38",
|
||||||
"xterm": "^5.3.0",
|
"xterm": "^5.3.0",
|
||||||
"xterm-addon-fit": "^0.8.0"
|
"xterm-addon-fit": "^0.8.0"
|
||||||
|
|||||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
@@ -75,8 +75,8 @@ importers:
|
|||||||
specifier: ^0.562.0
|
specifier: ^0.562.0
|
||||||
version: 0.562.0
|
version: 0.562.0
|
||||||
monaco-editor:
|
monaco-editor:
|
||||||
specifier: 0.52.2
|
specifier: 0.55.1
|
||||||
version: 0.52.2
|
version: 0.55.1
|
||||||
pdfjs-dist:
|
pdfjs-dist:
|
||||||
specifier: ^4.10.38
|
specifier: ^4.10.38
|
||||||
version: 4.10.38
|
version: 4.10.38
|
||||||
@@ -2152,6 +2152,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==}
|
resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
|
dompurify@3.2.7:
|
||||||
|
resolution: {integrity: sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==}
|
||||||
|
|
||||||
dunder-proto@1.0.1:
|
dunder-proto@1.0.1:
|
||||||
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -2774,6 +2777,11 @@ packages:
|
|||||||
markdown-table@3.0.4:
|
markdown-table@3.0.4:
|
||||||
resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==}
|
resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==}
|
||||||
|
|
||||||
|
marked@14.0.0:
|
||||||
|
resolution: {integrity: sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==}
|
||||||
|
engines: {node: '>= 18'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
matcher@5.0.0:
|
matcher@5.0.0:
|
||||||
resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==}
|
resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==}
|
||||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||||
@@ -2984,6 +2992,9 @@ packages:
|
|||||||
monaco-editor@0.52.2:
|
monaco-editor@0.52.2:
|
||||||
resolution: {integrity: sha512-GEQWEZmfkOGLdd3XK8ryrfWz3AIP8YymVXiPHEdewrUq7mh0qrKrfHLNCXcbB6sTnMLnOZ3ztSiKcciFUkIJwQ==}
|
resolution: {integrity: sha512-GEQWEZmfkOGLdd3XK8ryrfWz3AIP8YymVXiPHEdewrUq7mh0qrKrfHLNCXcbB6sTnMLnOZ3ztSiKcciFUkIJwQ==}
|
||||||
|
|
||||||
|
monaco-editor@0.55.1:
|
||||||
|
resolution: {integrity: sha512-jz4x+TJNFHwHtwuV9vA9rMujcZRb0CEilTEwG2rRSpe/A7Jdkuj8xPKttCgOh+v/lkHy7HsZ64oj+q3xoAFl9A==}
|
||||||
|
|
||||||
mongodb-connection-string-url@3.0.2:
|
mongodb-connection-string-url@3.0.2:
|
||||||
resolution: {integrity: sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==}
|
resolution: {integrity: sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==}
|
||||||
|
|
||||||
@@ -7173,6 +7184,10 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@leichtgewicht/ip-codec': 2.0.5
|
'@leichtgewicht/ip-codec': 2.0.5
|
||||||
|
|
||||||
|
dompurify@3.2.7:
|
||||||
|
optionalDependencies:
|
||||||
|
'@types/trusted-types': 2.0.7
|
||||||
|
|
||||||
dunder-proto@1.0.1:
|
dunder-proto@1.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
call-bind-apply-helpers: 1.0.2
|
call-bind-apply-helpers: 1.0.2
|
||||||
@@ -7892,6 +7907,8 @@ snapshots:
|
|||||||
|
|
||||||
markdown-table@3.0.4: {}
|
markdown-table@3.0.4: {}
|
||||||
|
|
||||||
|
marked@14.0.0: {}
|
||||||
|
|
||||||
matcher@5.0.0:
|
matcher@5.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
escape-string-regexp: 5.0.0
|
escape-string-regexp: 5.0.0
|
||||||
@@ -8273,6 +8290,11 @@ snapshots:
|
|||||||
|
|
||||||
monaco-editor@0.52.2: {}
|
monaco-editor@0.52.2: {}
|
||||||
|
|
||||||
|
monaco-editor@0.55.1:
|
||||||
|
dependencies:
|
||||||
|
dompurify: 3.2.7
|
||||||
|
marked: 14.0.0
|
||||||
|
|
||||||
mongodb-connection-string-url@3.0.2:
|
mongodb-connection-string-url@3.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/whatwg-url': 11.0.5
|
'@types/whatwg-url': 11.0.5
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function getMonacoVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function writeVersionModule(version) {
|
function writeVersionModule(version) {
|
||||||
const targetDir = path.join(projectRoot, 'ts_web', 'elements', 'dees-editor');
|
const targetDir = path.join(projectRoot, 'ts_web', 'elements', '00group-editor', 'dees-editor-monaco');
|
||||||
fs.mkdirSync(targetDir, { recursive: true });
|
fs.mkdirSync(targetDir, { recursive: true });
|
||||||
const targetFile = path.join(targetDir, 'version.ts');
|
const targetFile = path.join(targetDir, 'version.ts');
|
||||||
const fileContent = `// Auto-generated by scripts/update-monaco-version.cjs\nexport const MONACO_VERSION = '${version}';\n`;
|
const fileContent = `// Auto-generated by scripts/update-monaco-version.cjs\nexport const MONACO_VERSION = '${version}';\n`;
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '3.14.1',
|
version: '3.14.2',
|
||||||
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// Auto-generated by scripts/update-monaco-version.cjs
|
// Auto-generated by scripts/update-monaco-version.cjs
|
||||||
export const MONACO_VERSION = '0.52.2';
|
export const MONACO_VERSION = '0.55.1';
|
||||||
|
|||||||
@@ -1,6 +1,18 @@
|
|||||||
import type * as monaco from 'monaco-editor';
|
import type * as monaco from 'monaco-editor';
|
||||||
import type { IExecutionEnvironment } from '../../00group-runtime/index.js';
|
import type { IExecutionEnvironment } from '../../00group-runtime/index.js';
|
||||||
|
|
||||||
|
// Monaco TypeScript API types (runtime API still exists, types deprecated in 0.55+)
|
||||||
|
interface IMonacoTypeScriptAPI {
|
||||||
|
typescriptDefaults: {
|
||||||
|
setCompilerOptions(options: Record<string, unknown>): void;
|
||||||
|
setDiagnosticsOptions(options: Record<string, unknown>): void;
|
||||||
|
addExtraLib(content: string, filePath?: string): void;
|
||||||
|
};
|
||||||
|
ScriptTarget: { ES2020: number };
|
||||||
|
ModuleKind: { ESNext: number };
|
||||||
|
ModuleResolutionKind: { NodeJs: number };
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages TypeScript IntelliSense by loading type definitions
|
* Manages TypeScript IntelliSense by loading type definitions
|
||||||
* from the virtual filesystem into Monaco.
|
* from the virtual filesystem into Monaco.
|
||||||
@@ -10,6 +22,14 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
private monacoInstance: typeof monaco | null = null;
|
private monacoInstance: typeof monaco | null = null;
|
||||||
private executionEnvironment: IExecutionEnvironment | null = null;
|
private executionEnvironment: IExecutionEnvironment | null = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get TypeScript API with proper typing for Monaco 0.55+
|
||||||
|
*/
|
||||||
|
private get tsApi(): IMonacoTypeScriptAPI | null {
|
||||||
|
if (!this.monacoInstance) return null;
|
||||||
|
return (this.monacoInstance.languages as any).typescript as IMonacoTypeScriptAPI;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize with Monaco and execution environment
|
* Initialize with Monaco and execution environment
|
||||||
*/
|
*/
|
||||||
@@ -23,12 +43,13 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private configureCompilerOptions(): void {
|
private configureCompilerOptions(): void {
|
||||||
if (!this.monacoInstance) return;
|
const ts = this.tsApi;
|
||||||
|
if (!ts) return;
|
||||||
|
|
||||||
this.monacoInstance.languages.typescript.typescriptDefaults.setCompilerOptions({
|
ts.typescriptDefaults.setCompilerOptions({
|
||||||
target: this.monacoInstance.languages.typescript.ScriptTarget.ES2020,
|
target: ts.ScriptTarget.ES2020,
|
||||||
module: this.monacoInstance.languages.typescript.ModuleKind.ESNext,
|
module: ts.ModuleKind.ESNext,
|
||||||
moduleResolution: this.monacoInstance.languages.typescript.ModuleResolutionKind.NodeJs,
|
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
||||||
allowSyntheticDefaultImports: true,
|
allowSyntheticDefaultImports: true,
|
||||||
esModuleInterop: true,
|
esModuleInterop: true,
|
||||||
strict: true,
|
strict: true,
|
||||||
@@ -38,7 +59,7 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
lib: ['es2020', 'dom', 'dom.iterable'],
|
lib: ['es2020', 'dom', 'dom.iterable'],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.monacoInstance.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
ts.typescriptDefaults.setDiagnosticsOptions({
|
||||||
noSemanticValidation: false,
|
noSemanticValidation: false,
|
||||||
noSyntaxValidation: false,
|
noSyntaxValidation: false,
|
||||||
});
|
});
|
||||||
@@ -99,7 +120,8 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async tryLoadPackageTypes(packageName: string): Promise<boolean> {
|
private async tryLoadPackageTypes(packageName: string): Promise<boolean> {
|
||||||
if (!this.executionEnvironment || !this.monacoInstance) return false;
|
const ts = this.tsApi;
|
||||||
|
if (!this.executionEnvironment || !ts) return false;
|
||||||
|
|
||||||
const basePath = `/node_modules/${packageName}`;
|
const basePath = `/node_modules/${packageName}`;
|
||||||
|
|
||||||
@@ -116,7 +138,7 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
const fullTypesPath = `${basePath}/${typesPath}`;
|
const fullTypesPath = `${basePath}/${typesPath}`;
|
||||||
if (await this.executionEnvironment.exists(fullTypesPath)) {
|
if (await this.executionEnvironment.exists(fullTypesPath)) {
|
||||||
const content = await this.executionEnvironment.readFile(fullTypesPath);
|
const content = await this.executionEnvironment.readFile(fullTypesPath);
|
||||||
this.monacoInstance.languages.typescript.typescriptDefaults.addExtraLib(
|
ts.typescriptDefaults.addExtraLib(
|
||||||
content,
|
content,
|
||||||
`file://${fullTypesPath}`
|
`file://${fullTypesPath}`
|
||||||
);
|
);
|
||||||
@@ -135,7 +157,7 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
for (const dtsPath of commonPaths) {
|
for (const dtsPath of commonPaths) {
|
||||||
if (await this.executionEnvironment.exists(dtsPath)) {
|
if (await this.executionEnvironment.exists(dtsPath)) {
|
||||||
const content = await this.executionEnvironment.readFile(dtsPath);
|
const content = await this.executionEnvironment.readFile(dtsPath);
|
||||||
this.monacoInstance.languages.typescript.typescriptDefaults.addExtraLib(
|
ts.typescriptDefaults.addExtraLib(
|
||||||
content,
|
content,
|
||||||
`file://${dtsPath}`
|
`file://${dtsPath}`
|
||||||
);
|
);
|
||||||
@@ -150,7 +172,8 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async tryLoadAtTypesPackage(packageName: string): Promise<boolean> {
|
private async tryLoadAtTypesPackage(packageName: string): Promise<boolean> {
|
||||||
if (!this.executionEnvironment || !this.monacoInstance) return false;
|
const ts = this.tsApi;
|
||||||
|
if (!this.executionEnvironment || !ts) return false;
|
||||||
|
|
||||||
// Handle scoped packages: @scope/package -> @types/scope__package
|
// Handle scoped packages: @scope/package -> @types/scope__package
|
||||||
const typesPackageName = packageName.startsWith('@')
|
const typesPackageName = packageName.startsWith('@')
|
||||||
@@ -163,7 +186,7 @@ export class TypeScriptIntelliSenseManager {
|
|||||||
const indexPath = `${basePath}/index.d.ts`;
|
const indexPath = `${basePath}/index.d.ts`;
|
||||||
if (await this.executionEnvironment.exists(indexPath)) {
|
if (await this.executionEnvironment.exists(indexPath)) {
|
||||||
const content = await this.executionEnvironment.readFile(indexPath);
|
const content = await this.executionEnvironment.readFile(indexPath);
|
||||||
this.monacoInstance.languages.typescript.typescriptDefaults.addExtraLib(
|
ts.typescriptDefaults.addExtraLib(
|
||||||
content,
|
content,
|
||||||
`file://${indexPath}`
|
`file://${indexPath}`
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user