Compare commits

..

2 commits

Author SHA1 Message Date
Henning Dieterichs
e70b6618f4
fixes website & adds editor.api.d.ts (#5104) 2025-11-07 17:47:33 +00:00
Henning Dieterichs
36efbe07d9
Fixes typedoc & updates pipelines to test website (#5102)
* Fixes typedoc & updates pipelines to test website

* Fixes typedoc

* Fixes samples
2025-11-07 16:57:18 +00:00
11 changed files with 53 additions and 41 deletions

View file

@ -83,14 +83,18 @@ jobs:
- name: Run smoke test - name: Run smoke test
run: npm run smoketest run: npm run smoketest
# - name: Install website node modules - name: Install website node modules
# working-directory: website working-directory: website
# run: yarn install --frozen-lockfile run: npm ci
# - name: Build website - name: Install most recent version of monaco-editor
# working-directory: website working-directory: website
# run: yarn run build run: npm install monaco-editor
# - name: Test website - name: Build website
# working-directory: website working-directory: website
# run: yarn test run: npm run build
- name: Test website
working-directory: website
run: npm run test

View file

@ -40,6 +40,10 @@ jobs:
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: npm ci run: npm ci
# For TypeDoc
- name: Build
run: npm run build
- name: Install website node modules - name: Install website node modules
working-directory: website working-directory: website
run: npm ci run: npm ci
@ -52,6 +56,10 @@ jobs:
working-directory: website working-directory: website
run: npm run build run: npm run build
- name: Test website
working-directory: website
run: npm run test
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@v5
- name: Upload artifact - name: Upload artifact

View file

@ -16,6 +16,7 @@ const root = join(import.meta.dirname, '../../');
export default defineConfig({ export default defineConfig({
input: { input: {
entry: join(root, './src/editor/editor.main.ts'), entry: join(root, './src/editor/editor.main.ts'),
editorApi: join(root, './src/editor/editor.api.ts'),
}, },
output: { output: {
dir: join(root, './out/monaco-editor/esm'), dir: join(root, './out/monaco-editor/esm'),
@ -41,6 +42,6 @@ export default defineConfig({
}, },
includeExternal: ['monaco-editor-core', '@vscode/monaco-lsp-client'] includeExternal: ['monaco-editor-core', '@vscode/monaco-lsp-client']
}), }),
dtsDeprecationWarning(), dtsDeprecationWarning(f => f.endsWith('editor.api.d.ts')),
], ],
}); });

View file

@ -58,12 +58,18 @@ export function mapModuleId(moduleId, newExt) {
return undefined; return undefined;
} }
/** @return {import('rollup').Plugin} */ /**
export function dtsDeprecationWarning() { * @param {(moduleId: string) => boolean} [filter]
* @return {import('rollup').Plugin}
*/
export function dtsDeprecationWarning(filter) {
return { return {
name: 'add-dts-deprecation-warning', name: 'add-dts-deprecation-warning',
generateBundle(options, bundle) { generateBundle(options, bundle) {
for (const fileName in bundle) { for (const fileName in bundle) {
if (filter && !filter(fileName)) {
continue;
}
const file = bundle[fileName]; const file = bundle[fileName];
if (file.type === 'chunk' && fileName.endsWith('.d.ts')) { if (file.type === 'chunk' && fileName.endsWith('.d.ts')) {
let content = file.code.toString(); let content = file.code.toString();

View file

@ -33,7 +33,7 @@
"build-monaco-editor": "ts-node ./build/build-monaco-editor", "build-monaco-editor": "ts-node ./build/build-monaco-editor",
"build-lsp": "cd monaco-lsp-client && npm install && npm run build" "build-lsp": "cd monaco-lsp-client && npm install && npm run build"
}, },
"typings": "./esm/vs/editor/editor.api.d.ts", "typings": "./esm/vs/editor/editor.main.d.ts",
"main": "./min/vs/editor/editor.main.js", "main": "./min/vs/editor/editor.main.js",
"module": "./esm/vs/editor/editor.main.js", "module": "./esm/vs/editor/editor.main.js",
"exports": { "exports": {

View file

@ -23,7 +23,7 @@
"mini-css-extract-plugin": "^2.6.1", "mini-css-extract-plugin": "^2.6.1",
"mobx": "^6.15.0", "mobx": "^6.15.0",
"mobx-react": "^9.2.1", "mobx-react": "^9.2.1",
"monaco-editor": "^0.55.0-dev-20251008", "monaco-editor": "^0.54.0",
"react": "^19.2.0", "react": "^19.2.0",
"react-bootstrap": "^2.10.10", "react-bootstrap": "^2.10.10",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
@ -1000,13 +1000,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/trusted-types": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
"license": "MIT",
"optional": true
},
"node_modules/@types/uglify-js": { "node_modules/@types/uglify-js": {
"version": "3.17.5", "version": "3.17.5",
"resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.17.5.tgz", "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.17.5.tgz",
@ -2393,13 +2386,10 @@
} }
}, },
"node_modules/dompurify": { "node_modules/dompurify": {
"version": "3.2.7", "version": "3.1.7",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.7.tgz",
"integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==", "integrity": "sha512-VaTstWtsneJY8xzy7DekmYWEOZcmzIe3Qb3zPd4STve1OBTa+e+WmS1ITQec1fZYXI3HCsOZZiSMpG6oxoWMWQ==",
"license": "(MPL-2.0 OR Apache-2.0)", "license": "(MPL-2.0 OR Apache-2.0)"
"optionalDependencies": {
"@types/trusted-types": "^2.0.7"
}
}, },
"node_modules/domutils": { "node_modules/domutils": {
"version": "2.8.0", "version": "2.8.0",
@ -4211,12 +4201,12 @@
} }
}, },
"node_modules/monaco-editor": { "node_modules/monaco-editor": {
"version": "0.55.0-dev-20251107", "version": "0.54.0",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.55.0-dev-20251107.tgz", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.54.0.tgz",
"integrity": "sha512-+Xu2pWe4ypNQX7/ZMFF4M7VE8FP178LLVHYu7OO3ajoC80RsoI3sCj5tPlnumOua0DzTwEyk/PMNeiSl7VyAYw==", "integrity": "sha512-hx45SEUoLatgWxHKCmlLJH81xBo0uXP4sRkESUpmDQevfi+e7K1VuiSprK6UpQ8u4zOcKNiH0pMvHvlMWA/4cw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"dompurify": "3.2.7", "dompurify": "3.1.7",
"marked": "14.0.0" "marked": "14.0.0"
} }
}, },

View file

@ -25,7 +25,7 @@
"mini-css-extract-plugin": "^2.6.1", "mini-css-extract-plugin": "^2.6.1",
"mobx": "^6.15.0", "mobx": "^6.15.0",
"mobx-react": "^9.2.1", "mobx-react": "^9.2.1",
"monaco-editor": "^0.55.0-dev-20251008", "monaco-editor": "^0.54.0",
"react": "^19.2.0", "react": "^19.2.0",
"react-bootstrap": "^2.10.10", "react-bootstrap": "^2.10.10",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",

View file

@ -4,14 +4,14 @@
// to the system and how the compiler is told to use ES6 (target=2). // to the system and how the compiler is told to use ES6 (target=2).
// validation settings // validation settings
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({ monaco.typescript.javascriptDefaults.setDiagnosticsOptions({
noSemanticValidation: true, noSemanticValidation: true,
noSyntaxValidation: false, noSyntaxValidation: false,
}); });
// compiler options // compiler options
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ monaco.typescript.javascriptDefaults.setCompilerOptions({
target: monaco.languages.typescript.ScriptTarget.ES2015, target: monaco.typescript.ScriptTarget.ES2015,
allowNonTsExtensions: true, allowNonTsExtensions: true,
}); });
@ -25,7 +25,7 @@ var libSource = [
"}", "}",
].join("\n"); ].join("\n");
var libUri = "ts:filename/facts.d.ts"; var libUri = "ts:filename/facts.d.ts";
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri); monaco.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
// When resolving definitions and references, the editor will try to use created models. // When resolving definitions and references, the editor will try to use created models.
// Creating a model for the library allows "peek definition/references" commands to work with the library. // Creating a model for the library allows "peek definition/references" commands to work with the library.
monaco.editor.createModel(libSource, "typescript", monaco.Uri.parse(libUri)); monaco.editor.createModel(libSource, "typescript", monaco.Uri.parse(libUri));

View file

@ -5,7 +5,7 @@ var modelUri = monaco.Uri.parse("a://b/foo.json"); // a made up unique URI for o
var model = monaco.editor.createModel(jsonCode, "json", modelUri); var model = monaco.editor.createModel(jsonCode, "json", modelUri);
// configure the JSON language support with schemas and schema associations // configure the JSON language support with schemas and schema associations
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({ monaco.json.jsonDefaults.setDiagnosticsOptions({
validate: true, validate: true,
schemas: [ schemas: [
{ {

View file

@ -1,8 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "CommonJS", "module": "CommonJS",
"skipLibCheck": true "skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"strict": true
}, },
"include": ["../../out/monaco-editor/esm/vs/editor/editor.api.d.ts"], // TODO: load from node_modules to be in sync with the latest stable monaco-editor
"include": ["../../out/monaco-editor/esm/vs/editor/editor.main.d.ts"],
"exclude": ["theme"] "exclude": ["theme"]
} }

View file

@ -1,6 +1,6 @@
{ {
"$schema": "https://typedoc.org/schema.json", "$schema": "https://typedoc.org/schema.json",
"entryPoints": ["../../out/monaco-editor/esm/vs/editor/editor.api.d.ts"], "entryPoints": ["../../out/monaco-editor/esm/vs/editor/editor.main.d.ts"],
"out": "dist", "out": "dist",
"theme": "default", "theme": "default",