mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
Compare commits
38 commits
v0.55.0-de
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec78a33c7b | ||
|
|
165cfcb101 | ||
|
|
09eede5b26 | ||
|
|
7649edb383 | ||
|
|
b8fa85f6c8 | ||
|
|
ebe111d469 | ||
|
|
02a9562005 | ||
|
|
94a5762a32 | ||
|
|
c619ef9a3d | ||
|
|
bf4931bb98 | ||
|
|
516f350bda | ||
|
|
9221aa0ef8 | ||
|
|
d678c1d32d | ||
|
|
f047a08481 | ||
|
|
220c1cab84 | ||
|
|
1b175c701c | ||
|
|
574b846ad2 | ||
|
|
5486e82ffa | ||
|
|
e70b6618f4 | ||
|
|
36efbe07d9 | ||
|
|
422d19e3d6 | ||
|
|
3ebf03ad14 | ||
|
|
2baf3291e9 | ||
|
|
f42be23bf6 | ||
|
|
ecd2990fb9 | ||
|
|
d84acb4d8f | ||
|
|
abae948dc3 | ||
|
|
925720b094 | ||
|
|
e7c9226d78 | ||
|
|
d38215cf6b | ||
|
|
b62a81677f | ||
|
|
81b06fd717 | ||
|
|
d89eb54d17 | ||
|
|
b3250fa2b9 | ||
|
|
9c7b547a98 | ||
|
|
ca5dfa5092 | ||
|
|
473bc634aa | ||
|
|
cdc4da5d91 |
46 changed files with 3933 additions and 1127 deletions
|
|
@ -62,6 +62,9 @@ extends:
|
|||
- script: npm ci
|
||||
displayName: Install NPM dependencies
|
||||
|
||||
- script: npx playwright install --with-deps
|
||||
displayName: Install Playwright Dependencies
|
||||
|
||||
- script: yarn ts-node ./scripts/ci/build-monaco-editor-core-pkg nightly
|
||||
env:
|
||||
VSCODE_REF: ${{ parameters.vscodeRef }}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ extends:
|
|||
- script: npm ci
|
||||
displayName: Install NPM dependencies
|
||||
|
||||
- script: npx playwright install --with-deps
|
||||
displayName: Install Playwright Dependencies
|
||||
|
||||
- script: yarn ts-node ./scripts/ci/build-monaco-editor-core-pkg stable
|
||||
displayName: Setup, Build & Test monaco-editor-core
|
||||
|
||||
|
|
|
|||
150
.github/commands.json
vendored
Normal file
150
.github/commands.json
vendored
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
[
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "question",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "*question"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "*question",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "We closed this issue because it is a question about using Monaco Editor rather than an issue or feature request. Please search for help on [StackOverflow](https://stackoverflow.com/questions/tagged/monaco-editor), where the community has already answered many similar questions. See also our [issue reporting guidelines](https://github.com/microsoft/monaco-editor#contributing).\n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "*out-of-scope",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.\n\nThanks for your understanding, and happy coding!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "wont-fix",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "We closed this issue because we don't plan to address it.\n\nThanks for your understanding, and happy coding!"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "duplicate",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "*duplicate"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "*duplicate",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for [existing issues](https://github.com/microsoft/monaco-editor/issues).\n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "verified",
|
||||
"allowUsers": [
|
||||
"@author"
|
||||
],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "verified",
|
||||
"removeLabel": "author-verification-requested",
|
||||
"requireLabel": "author-verification-requested",
|
||||
"disallowLabel": "unreleased"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "confirm",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "confirmed",
|
||||
"removeLabel": "confirmation-pending"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "confirmationPending",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "confirmation-pending",
|
||||
"removeLabel": "confirmed"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "needsMoreInfo",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "~info-needed"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "closedWith",
|
||||
"allowUsers": [],
|
||||
"action": "close",
|
||||
"reason": "completed",
|
||||
"addLabel": "unreleased"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "spam",
|
||||
"allowUsers": [],
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"addLabel": "invalid"
|
||||
},
|
||||
{
|
||||
"__comment__": "Allows folks on the team to label issues by commenting: `\\label My-Label` ",
|
||||
"type": "comment",
|
||||
"name": "label",
|
||||
"allowUsers": []
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~verification-steps-needed",
|
||||
"action": "updateLabels",
|
||||
"addLabel": "verification-steps-needed",
|
||||
"removeLabel": "~verification-steps-needed",
|
||||
"comment": "Friendly ping! Looks like this issue requires some further steps to be verified. Please provide us with the steps necessary to verify this issue."
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~info-needed",
|
||||
"action": "updateLabels",
|
||||
"addLabel": "info-needed",
|
||||
"removeLabel": "~info-needed",
|
||||
"comment": "Thanks for creating this issue! We figured it's missing some basic information or doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~version-info-needed",
|
||||
"action": "updateLabels",
|
||||
"addLabel": "info-needed",
|
||||
"removeLabel": "~version-info-needed",
|
||||
"comment": "Thanks for creating this issue! We figured it's missing some basic information, such as a version number. Please take the time to update the issue with the Monaco Editor version you're using.\n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~confirmation-needed",
|
||||
"action": "updateLabels",
|
||||
"addLabel": "info-needed",
|
||||
"removeLabel": "~confirmation-needed",
|
||||
"comment": "Please try to reproduce this issue with the latest version of Monaco Editor. If the issue persists, please update the issue with confirmation.\n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "gifPlease",
|
||||
"allowUsers": [],
|
||||
"action": "comment",
|
||||
"addLabel": "info-needed",
|
||||
"comment": "Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, `.gif` files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.\n\nHappy coding!"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "upstream",
|
||||
"allowUsers": [],
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"addLabel": "upstream",
|
||||
"comment": "This issue is caused by an upstream dependency (VS Code editor core). The fix needs to happen in the [VS Code repository](https://github.com/microsoft/vscode). Please check if there's already an issue filed there, or create one if not.\n\nHappy Coding!"
|
||||
}
|
||||
]
|
||||
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
|
|
@ -83,14 +83,18 @@ jobs:
|
|||
- name: Run smoke test
|
||||
run: npm run smoketest
|
||||
|
||||
# - name: Install website node modules
|
||||
# working-directory: website
|
||||
# run: yarn install --frozen-lockfile
|
||||
- name: Install website node modules
|
||||
working-directory: website
|
||||
run: npm ci
|
||||
|
||||
# - name: Build website
|
||||
# working-directory: website
|
||||
# run: yarn run build
|
||||
- name: Install most recent version of monaco-editor
|
||||
working-directory: website
|
||||
run: npm install monaco-editor
|
||||
|
||||
# - name: Test website
|
||||
# working-directory: website
|
||||
# run: yarn test
|
||||
- name: Build website
|
||||
working-directory: website
|
||||
run: npm run build
|
||||
|
||||
- name: Test website
|
||||
working-directory: website
|
||||
run: npm run test
|
||||
|
|
|
|||
8
.github/workflows/website.yml
vendored
8
.github/workflows/website.yml
vendored
|
|
@ -39,8 +39,10 @@ jobs:
|
|||
- name: execute `npm ci` (1)
|
||||
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
||||
run: npm ci
|
||||
|
||||
# For TypeDoc
|
||||
- name: Build
|
||||
run: npm run build-monaco-editor
|
||||
run: npm run build
|
||||
|
||||
- name: Install website node modules
|
||||
working-directory: website
|
||||
|
|
@ -54,6 +56,10 @@ jobs:
|
|||
working-directory: website
|
||||
run: npm run build
|
||||
|
||||
- name: Test website
|
||||
working-directory: website
|
||||
run: npm run test
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Upload artifact
|
||||
|
|
|
|||
2
.nvmrc
2
.nvmrc
|
|
@ -1 +1 @@
|
|||
22.18.0
|
||||
22.21.1
|
||||
|
|
|
|||
15
CHANGELOG.md
15
CHANGELOG.md
|
|
@ -1,5 +1,20 @@
|
|||
# Monaco Editor Changelog
|
||||
|
||||
## [0.55.1]
|
||||
|
||||
- Fixes missing language exports (monaco.json/typescript/...) due to wrong "types" path - [#5123](https://github.com/microsoft/monaco-editor/issues/5123)
|
||||
|
||||
## [0.55.0]
|
||||
|
||||
### Breaking Changes
|
||||
- Moves nested namespaces (`languages.css`, `languages.html`, `languages.json`, `languages.typescript`) to top level namespaces (`css`, `html`, `json`, `typescript`) to simplify the build process and align with typescript recommendations.
|
||||
|
||||
### New Features
|
||||
- Adds native LSP support (see new `lsp` namespace).
|
||||
|
||||
### Bug Fixes
|
||||
- Updates dompurify to 3.2.7
|
||||
|
||||
## [0.54.0]
|
||||
|
||||
- Adds option `editor.mouseMiddleClickAction`
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@ You will get:
|
|||
|
||||
:warning: The monaco editor also ships an `AMD` build for backwards-compatibility reasons, but the `AMD` support is deprecated and will be removed in future versions.
|
||||
|
||||
## Localization
|
||||
|
||||
To load the editor in a specific language, make sure that the corresponding nls script file is loaded before the main monaco editor script. For example, to load the editor in German, include the following script tag:
|
||||
```html
|
||||
<script src="path/to/monaco-editor/esm/nls.messages.de.js"></script>
|
||||
```
|
||||
|
||||
Check the sources for available languages.
|
||||
|
||||
## Concepts
|
||||
|
||||
Monaco editor is best known for being the text editor that powers VS Code. However, it's a bit more nuanced. Some basic understanding about the underlying concepts is needed to use Monaco editor effectively.
|
||||
|
|
|
|||
|
|
@ -9,45 +9,22 @@ import nodeResolve from '@rollup/plugin-node-resolve';
|
|||
import { join } from 'path';
|
||||
import { defineConfig } from 'rollup';
|
||||
import { dts } from 'rollup-plugin-dts';
|
||||
|
||||
const root = join(import.meta.dirname, '../../');
|
||||
const outDir = join(import.meta.dirname, './out');
|
||||
|
||||
/**
|
||||
* @param {string} filePath
|
||||
* @param {string} newExt
|
||||
*/
|
||||
function changeExt(filePath, newExt) {
|
||||
const idx = filePath.lastIndexOf('.');
|
||||
if (idx === -1) {
|
||||
return filePath + newExt;
|
||||
} else {
|
||||
return filePath.substring(0, idx) + newExt;
|
||||
}
|
||||
}
|
||||
|
||||
const mappedPaths = {
|
||||
[join(root, 'node_modules/monaco-editor-core/esm/')]: '.',
|
||||
[join(root, 'node_modules/')]: 'external/',
|
||||
[join(root, 'src/')]: 'vs/'
|
||||
};
|
||||
import { dtsDeprecationWarning, mapModuleId } from '../shared.mjs';
|
||||
|
||||
export default defineConfig({
|
||||
input: {
|
||||
types: join(import.meta.dirname, './src/types.ts')
|
||||
},
|
||||
output: {
|
||||
dir: outDir,
|
||||
dir: join(import.meta.dirname, './out'),
|
||||
format: 'es',
|
||||
preserveModules: false,
|
||||
entryFileNames: function (chunkInfo) {
|
||||
const moduleId = chunkInfo.facadeModuleId;
|
||||
if (moduleId) {
|
||||
for (const [key, val] of Object.entries(mappedPaths)) {
|
||||
if (moduleId.startsWith(key)) {
|
||||
const relativePath = moduleId.substring(key.length);
|
||||
return changeExt(join(val, relativePath), '.d.ts');
|
||||
}
|
||||
const m = mapModuleId(moduleId, '.d.ts');
|
||||
if (m !== undefined) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
return '[name].d.ts';
|
||||
|
|
@ -61,6 +38,7 @@ export default defineConfig({
|
|||
stripInternal: true
|
||||
},
|
||||
includeExternal: ['monaco-editor-core', '@vscode/monaco-lsp-client']
|
||||
})
|
||||
}),
|
||||
dtsDeprecationWarning(),
|
||||
]
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,23 +1,13 @@
|
|||
import { readFileSync } from 'node:fs';
|
||||
import { glob } from 'node:fs/promises';
|
||||
import { basename, dirname, join, resolve } from 'node:path';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import { urlToEsmPlugin } from './plugin';
|
||||
import { getNlsEntryPoints } from '../shared.mjs';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export default defineConfig(async (args) => {
|
||||
const monacoEditorCoreDir = join(
|
||||
dirname(require.resolve('monaco-editor-core/package.json')),
|
||||
'esm'
|
||||
);
|
||||
const nlsEntries = {};
|
||||
for await (const path of glob(`${monacoEditorCoreDir}/nls.messages.*.js`)) {
|
||||
const entryName = basename(path).replace('.js', '');
|
||||
nlsEntries[entryName] = path;
|
||||
}
|
||||
|
||||
/** @type {import('vite').UserConfig} */
|
||||
return {
|
||||
base: './',
|
||||
|
|
@ -28,7 +18,7 @@ export default defineConfig(async (args) => {
|
|||
lib: {
|
||||
cssFileName: 'editor/editor.main',
|
||||
entry: {
|
||||
...nlsEntries,
|
||||
...getNlsEntryPoints(),
|
||||
'nls.messages-loader': resolve(__dirname, 'src/nls.messages-loader.js'),
|
||||
'editor/editor.main': resolve(__dirname, 'src/editor.main.ts'),
|
||||
'basic-languages/monaco.contribution': resolve(
|
||||
|
|
@ -8,11 +8,11 @@ import fs = require('fs');
|
|||
import { REPO_ROOT, readFiles, writeFiles } from '../build/utils';
|
||||
import { generateEsmMetadataJsAndDTs } from './releaseMetadata';
|
||||
import { buildESM } from './esm/build.script';
|
||||
import { removeDir } from './fs';
|
||||
import { buildAmdMinDev } from './amd/build.script';
|
||||
import { rm } from 'fs/promises';
|
||||
|
||||
async function run() {
|
||||
removeDir(`out/monaco-editor`);
|
||||
await rm(path.join(REPO_ROOT, './out/monaco-editor'), { recursive: true, force: true });
|
||||
|
||||
await buildESM();
|
||||
await buildAmdMinDev();
|
||||
|
|
|
|||
|
|
@ -9,46 +9,25 @@ import nodeResolve from '@rollup/plugin-node-resolve';
|
|||
import { join } from 'path';
|
||||
import { defineConfig } from 'rollup';
|
||||
import { dts } from "rollup-plugin-dts";
|
||||
import { dtsDeprecationWarning, mapModuleId } from '../shared.mjs';
|
||||
|
||||
const root = join(import.meta.dirname, '../../');
|
||||
const outDir = join(root, './out/monaco-editor/esm');
|
||||
|
||||
/**
|
||||
* @param {string} filePath
|
||||
* @param {string} newExt
|
||||
* @returns {string}
|
||||
*/
|
||||
function changeExt(filePath, newExt) {
|
||||
const idx = filePath.lastIndexOf('.');
|
||||
if (idx === -1) {
|
||||
return filePath + newExt;
|
||||
} else {
|
||||
return filePath.substring(0, idx) + newExt;
|
||||
}
|
||||
}
|
||||
|
||||
const mappedPaths = {
|
||||
[join(root, 'node_modules/monaco-editor-core/esm/')]: '.',
|
||||
[join(root, 'node_modules/')]: 'external/',
|
||||
[join(root, 'src/')]: 'vs/',
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
input: {
|
||||
entry: join(root, './src/editor/editor.main.ts'),
|
||||
editorApi: join(root, './src/editor/editor.api.ts'),
|
||||
},
|
||||
output: {
|
||||
dir: outDir,
|
||||
dir: join(root, './out/monaco-editor/esm'),
|
||||
format: 'es',
|
||||
preserveModules: false,
|
||||
entryFileNames: function (chunkInfo) {
|
||||
const moduleId = chunkInfo.facadeModuleId;
|
||||
if (moduleId) {
|
||||
for (const [key, val] of Object.entries(mappedPaths)) {
|
||||
if (moduleId.startsWith(key)) {
|
||||
const relativePath = moduleId.substring(key.length);
|
||||
return changeExt(join(val, relativePath), '.d.ts');
|
||||
}
|
||||
const m = mapModuleId(moduleId, '.d.ts');
|
||||
if (m !== undefined) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
return '[name].d.ts';
|
||||
|
|
@ -63,5 +42,6 @@ export default defineConfig({
|
|||
},
|
||||
includeExternal: ['monaco-editor-core', '@vscode/monaco-lsp-client']
|
||||
}),
|
||||
dtsDeprecationWarning(f => f.endsWith('editor.api.d.ts')),
|
||||
],
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,33 +13,13 @@ import del from 'rollup-plugin-delete';
|
|||
import keepCssImports from './rollup-plugin-keep-css-imports/dist/index.mjs';
|
||||
import nodeResolve from '@rollup/plugin-node-resolve';
|
||||
import { urlToEsmPlugin } from './rollup-url-to-module-plugin/index.mjs';
|
||||
import { copyFileSync, mkdirSync } from 'fs';
|
||||
import { dirname } from 'path';
|
||||
import { getNlsEntryPoints, mapModuleId } from '../shared.mjs';
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
|
||||
const root = join(import.meta.dirname, '../../');
|
||||
const outDir = join(root, './out/monaco-editor/esm');
|
||||
|
||||
/**
|
||||
* @param {string} filePath
|
||||
* @param {string} newExt
|
||||
* @returns {string}
|
||||
*/
|
||||
function changeExt(filePath, newExt) {
|
||||
const idx = filePath.lastIndexOf('.');
|
||||
if (idx === -1) {
|
||||
return filePath + newExt;
|
||||
} else {
|
||||
return filePath.substring(0, idx) + newExt;
|
||||
}
|
||||
}
|
||||
|
||||
const mappedPaths = {
|
||||
[join(root, 'node_modules/monaco-editor-core/esm/')]: '.',
|
||||
[join(root, 'node_modules/')]: 'external/',
|
||||
[join(root, 'monaco-lsp-client/')]: 'external/monaco-lsp-client/',
|
||||
[join(root, 'src/')]: 'vs/',
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
input: {
|
||||
entry: join(root, './src/editor/editor.main.ts'),
|
||||
|
|
@ -47,6 +27,7 @@ export default defineConfig({
|
|||
edcoreMain: join(root, './src/editor/edcore.main.ts'),
|
||||
editorApi: join(root, './src/editor/editor.api.ts'),
|
||||
editorWorker: join(root, './src/editor/editor.worker.ts'),
|
||||
...getNlsEntryPoints(),
|
||||
},
|
||||
|
||||
output: {
|
||||
|
|
@ -56,11 +37,9 @@ export default defineConfig({
|
|||
entryFileNames: function (chunkInfo) {
|
||||
const moduleId = chunkInfo.facadeModuleId;
|
||||
if (moduleId) {
|
||||
for (const [key, val] of Object.entries(mappedPaths)) {
|
||||
if (moduleId.startsWith(key)) {
|
||||
const relativePath = moduleId.substring(key.length);
|
||||
return changeExt(join(val, relativePath), '.js');
|
||||
}
|
||||
const r = mapModuleId(moduleId, '.js');
|
||||
if (r !== undefined) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return '[name].js';
|
||||
|
|
@ -74,11 +53,12 @@ export default defineConfig({
|
|||
|
||||
{
|
||||
name: 'copy-codicon-font',
|
||||
buildEnd() {
|
||||
const codiconSource = join(root, 'node_modules/monaco-editor-core/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf');
|
||||
const codiconDest = join(outDir, 'vs/base/browser/ui/codicons/codicon/codicon.ttf');
|
||||
mkdirSync(dirname(codiconDest), { recursive: true });
|
||||
copyFileSync(codiconSource, codiconDest);
|
||||
generateBundle() {
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: 'vs/base/browser/ui/codicons/codicon/codicon.ttf',
|
||||
source: readFileSync(join(root, 'node_modules/monaco-editor-core/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf'))
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -90,13 +70,10 @@ export default defineConfig({
|
|||
* @param {string} assetId
|
||||
*/
|
||||
outputPath: (assetId) => {
|
||||
for (const [key, val] of Object.entries(mappedPaths)) {
|
||||
if (assetId.startsWith(key)) {
|
||||
const relativePath = assetId.substring(key.length);
|
||||
return changeExt(join(outDir, val, relativePath), '.css');
|
||||
const r = mapModuleId(assetId, '.css');
|
||||
if (r !== undefined) {
|
||||
return join(outDir, r);
|
||||
}
|
||||
}
|
||||
|
||||
const relativePath = join(outDir, relative(root, assetId));
|
||||
return relativePath.replace(/(\.s[ca]ss)$/, ".min$1")
|
||||
},
|
||||
|
|
|
|||
13
build/fs.ts
13
build/fs.ts
|
|
@ -29,19 +29,6 @@ export function ensureDir(dirname: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file.
|
||||
*/
|
||||
export function copyFile(_source: string, _destination: string) {
|
||||
const source = path.join(REPO_ROOT, _source);
|
||||
const destination = path.join(REPO_ROOT, _destination);
|
||||
|
||||
ensureDir(path.dirname(destination));
|
||||
fs.writeFileSync(destination, fs.readFileSync(source));
|
||||
|
||||
console.log(`Copied ${_source} to ${_destination}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a directory and all its contents.
|
||||
*/
|
||||
|
|
|
|||
96
build/shared.mjs
Normal file
96
build/shared.mjs
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
import { dirname, join } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { readdirSync } from 'fs';
|
||||
|
||||
/**
|
||||
* @param {string} filePath
|
||||
* @param {string} newExt
|
||||
*/
|
||||
export function changeExt(filePath, newExt) {
|
||||
const idx = filePath.lastIndexOf('.');
|
||||
if (idx === -1) {
|
||||
return filePath + newExt;
|
||||
} else {
|
||||
return filePath.substring(0, idx) + newExt;
|
||||
}
|
||||
}
|
||||
|
||||
export function getNlsEntryPoints() {
|
||||
const nlsDir = dirname(fileURLToPath(import.meta.resolve('monaco-editor-core/esm/nls.messages.en.js')));
|
||||
const nlsFiles = readdirSync(nlsDir)
|
||||
.filter(file => file.startsWith('nls.messages.') && file.endsWith('.js'))
|
||||
.reduce((acc, file) => {
|
||||
// @ts-ignore
|
||||
acc[file] = join(nlsDir, file);
|
||||
return acc;
|
||||
}, {});
|
||||
return nlsFiles;
|
||||
}
|
||||
|
||||
const root = join(import.meta.dirname, '../');
|
||||
|
||||
const mappedPaths = {
|
||||
[join(root, 'node_modules/monaco-editor-core/esm/')]: '.',
|
||||
[join(root, 'node_modules/')]: 'external/',
|
||||
[join(root, 'monaco-lsp-client/')]: 'external/monaco-lsp-client/',
|
||||
[join(root, 'src/')]: 'vs/',
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} moduleId
|
||||
* @param {string} newExt (with leading .)
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
export function mapModuleId(moduleId, newExt) {
|
||||
for (const [key, val] of Object.entries(mappedPaths)) {
|
||||
if (moduleId.startsWith(key)) {
|
||||
const relativePath = moduleId.substring(key.length);
|
||||
return changeExt(join(val, relativePath), newExt);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {(moduleId: string) => boolean} [filter]
|
||||
* @return {import('rollup').Plugin}
|
||||
*/
|
||||
export function dtsDeprecationWarning(filter) {
|
||||
return {
|
||||
name: 'add-dts-deprecation-warning',
|
||||
generateBundle(options, bundle) {
|
||||
for (const fileName in bundle) {
|
||||
if (filter && !filter(fileName)) {
|
||||
continue;
|
||||
}
|
||||
const file = bundle[fileName];
|
||||
if (file.type === 'chunk' && fileName.endsWith('.d.ts')) {
|
||||
let content = file.code.toString();
|
||||
content = content + `
|
||||
declare namespace languages {
|
||||
/** @deprecated Use the new top level "css" namespace instead. */
|
||||
export const css: { deprecated: true };
|
||||
|
||||
/** @deprecated Use the new top level "html" namespace instead. */
|
||||
export const html: { deprecated: true };
|
||||
|
||||
/** @deprecated Use the new top level "json" namespace instead. */
|
||||
export const json: { deprecated: true };
|
||||
|
||||
/** @deprecated Use the new top level "typescript" namespace instead. */
|
||||
export const typescript: { deprecated: true };
|
||||
}
|
||||
`;
|
||||
file.code = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
107
monaco-lsp-client/package-lock.json
generated
107
monaco-lsp-client/package-lock.json
generated
|
|
@ -21,22 +21,6 @@
|
|||
"monaco-editor-core": "^0.54.0-dev-20250929"
|
||||
}
|
||||
},
|
||||
"../../../hediet/typed-json-rpc/json-rpc": {
|
||||
"name": "@hediet/json-rpc",
|
||||
"version": "0.5.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
},
|
||||
"../../../hediet/typed-json-rpc/json-rpc-browser": {
|
||||
"name": "@hediet/json-rpc-browser",
|
||||
"version": "0.5.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hediet/json-rpc": "^0.5.0"
|
||||
}
|
||||
},
|
||||
"../../../hediet/typed-json-rpc/json-rpc-node": {
|
||||
"name": "@hediet/json-rpc-node",
|
||||
"version": "0.5.0",
|
||||
|
|
@ -55,16 +39,6 @@
|
|||
"source-map-support": "^0.5.12"
|
||||
}
|
||||
},
|
||||
"../../../hediet/typed-json-rpc/json-rpc-websocket": {
|
||||
"name": "@hediet/json-rpc-websocket",
|
||||
"version": "0.5.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hediet/json-rpc": "^0.5.0",
|
||||
"@types/ws": "^6.0.4",
|
||||
"isomorphic-ws": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"../../hediet/typed-json-rpc/json-rpc-browser": {
|
||||
"extraneous": true
|
||||
},
|
||||
|
|
@ -170,16 +144,30 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@hediet/json-rpc": {
|
||||
"resolved": "../../../hediet/typed-json-rpc/json-rpc",
|
||||
"link": true
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@hediet/json-rpc/-/json-rpc-0.5.0.tgz",
|
||||
"integrity": "sha512-SApO7NbKJztClcznEqg46ZGQzO2v3Q3gVIuRVC9QE/m75J/5AipJdclxEXgT++7j4x4LI2JjEpf2xhi67Ngu9A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@hediet/json-rpc-browser": {
|
||||
"resolved": "../../../hediet/typed-json-rpc/json-rpc-browser",
|
||||
"link": true
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@hediet/json-rpc-browser/-/json-rpc-browser-0.5.1.tgz",
|
||||
"integrity": "sha512-iR+WrTdM7WozRJ/MElfeT8CmH2f911Y8P6xfcj5RCfywp7kjnnqKPUV/VnNnzToxRZUO8WAfJtLvmhDBsSjMtA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hediet/json-rpc": "^0.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@hediet/json-rpc-websocket": {
|
||||
"resolved": "../../../hediet/typed-json-rpc/json-rpc-websocket",
|
||||
"link": true
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@hediet/json-rpc-websocket/-/json-rpc-websocket-0.5.1.tgz",
|
||||
"integrity": "sha512-1H9UjKyR00ZjwcReQdzTxyEoZKaEubeOvxBVrwHGo4n9HeQt6SvQgtef+1AJ9MT7/sV2Qfe0VWarYivx6BWgIA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hediet/json-rpc": "^0.5.0",
|
||||
"@types/ws": "^6.0.4",
|
||||
"isomorphic-ws": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.13",
|
||||
|
|
@ -888,6 +876,24 @@
|
|||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.0.tgz",
|
||||
"integrity": "sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.4.tgz",
|
||||
"integrity": "sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/ansis": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz",
|
||||
|
|
@ -1176,6 +1182,15 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isomorphic-ws": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz",
|
||||
"integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"ws": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/jsesc": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
|
||||
|
|
@ -1547,6 +1562,12 @@
|
|||
"license": "0BSD",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unicorn-magic": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
|
||||
|
|
@ -1559,6 +1580,28 @@
|
|||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.18.3",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
|
||||
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
61
package-lock.json
generated
61
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "monaco-editor",
|
||||
"version": "0.54.0",
|
||||
"version": "0.55.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "monaco-editor",
|
||||
"version": "0.54.0",
|
||||
"version": "0.55.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
"jsdom": "^19.0.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"mocha": "^11.7.4",
|
||||
"monaco-editor-core": "^0.55.0-dev-20251008",
|
||||
"monaco-editor-core": "^0.55.0-rc",
|
||||
"parcel": "^2.7.0",
|
||||
"pin-github-action": "^1.8.0",
|
||||
"postcss-url": "^10.1.3",
|
||||
|
|
@ -4493,11 +4493,22 @@
|
|||
}
|
||||
},
|
||||
"node_modules/dompurify": {
|
||||
"version": "3.1.7",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.7.tgz",
|
||||
"integrity": "sha512-VaTstWtsneJY8xzy7DekmYWEOZcmzIe3Qb3zPd4STve1OBTa+e+WmS1ITQec1fZYXI3HCsOZZiSMpG6oxoWMWQ==",
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz",
|
||||
"integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==",
|
||||
"dev": true,
|
||||
"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/dompurify/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==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/domutils": {
|
||||
"version": "2.8.0",
|
||||
|
|
@ -6512,13 +6523,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/monaco-editor-core": {
|
||||
"version": "0.55.0-dev-20251009",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.55.0-dev-20251009.tgz",
|
||||
"integrity": "sha512-QyipMtg/vrAXaurn2BpAehWAKsMYlX1bfMxLBjGAI2DJJ/6isZ8+jpPcrOgIPa8Lu4AKrv4vQ0qYGtgSqp0R7Q==",
|
||||
"version": "0.55.0-rc",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.55.0-rc.tgz",
|
||||
"integrity": "sha512-LZAAUGilhXX+u+JNxqBABDFyvIVjW6Gmn3EkP0ztdvNxvP6+voiRm2/ZMLokSUGrdOeCZXA2nM6w1xjKkrqNjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dompurify": "3.1.7",
|
||||
"dompurify": "3.2.7",
|
||||
"marked": "14.0.0"
|
||||
}
|
||||
},
|
||||
|
|
@ -12091,10 +12102,22 @@
|
|||
}
|
||||
},
|
||||
"dompurify": {
|
||||
"version": "3.1.7",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.7.tgz",
|
||||
"integrity": "sha512-VaTstWtsneJY8xzy7DekmYWEOZcmzIe3Qb3zPd4STve1OBTa+e+WmS1ITQec1fZYXI3HCsOZZiSMpG6oxoWMWQ==",
|
||||
"dev": true
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz",
|
||||
"integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@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==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"domutils": {
|
||||
"version": "2.8.0",
|
||||
|
|
@ -13412,12 +13435,12 @@
|
|||
}
|
||||
},
|
||||
"monaco-editor-core": {
|
||||
"version": "0.55.0-dev-20251009",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.55.0-dev-20251009.tgz",
|
||||
"integrity": "sha512-QyipMtg/vrAXaurn2BpAehWAKsMYlX1bfMxLBjGAI2DJJ/6isZ8+jpPcrOgIPa8Lu4AKrv4vQ0qYGtgSqp0R7Q==",
|
||||
"version": "0.55.0-rc",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.55.0-rc.tgz",
|
||||
"integrity": "sha512-LZAAUGilhXX+u+JNxqBABDFyvIVjW6Gmn3EkP0ztdvNxvP6+voiRm2/ZMLokSUGrdOeCZXA2nM6w1xjKkrqNjQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"dompurify": "3.1.7",
|
||||
"dompurify": "3.2.7",
|
||||
"marked": "14.0.0"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
10
package.json
10
package.json
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "monaco-editor",
|
||||
"version": "0.54.0",
|
||||
"vscodeRef": "484fdf69b8509c1c9370d913b32e9f6d3a68cc99",
|
||||
"version": "0.55.1",
|
||||
"vscodeRef": "86f5a62f058e3905f74a9fa65d04b2f3b533408e",
|
||||
"private": true,
|
||||
"description": "A browser based code editor",
|
||||
"homepage": "https://github.com/microsoft/monaco-editor",
|
||||
|
|
@ -33,12 +33,12 @@
|
|||
"build-monaco-editor": "ts-node ./build/build-monaco-editor",
|
||||
"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",
|
||||
"module": "./esm/vs/editor/editor.main.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./esm/vs/editor/editor.api.d.ts",
|
||||
"types": "./esm/vs/editor/editor.main.d.ts",
|
||||
"import": "./esm/vs/editor/editor.main.js",
|
||||
"require": "./min/vs/editor/editor.main.js"
|
||||
},
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
"jsdom": "^19.0.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"mocha": "^11.7.4",
|
||||
"monaco-editor-core": "^0.55.0-dev-20251008",
|
||||
"monaco-editor-core": "^0.55.0-rc",
|
||||
"parcel": "^2.7.0",
|
||||
"pin-github-action": "^1.8.0",
|
||||
"postcss-url": "^10.1.3",
|
||||
|
|
|
|||
14
samples/browser-esm-vite-react/package-lock.json
generated
14
samples/browser-esm-vite-react/package-lock.json
generated
|
|
@ -13,7 +13,7 @@
|
|||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.4.20"
|
||||
"vite": "^5.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
|
|
@ -1761,9 +1761,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "5.4.20",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.20.tgz",
|
||||
"integrity": "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g==",
|
||||
"version": "5.4.21",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",
|
||||
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
|
|
@ -2923,9 +2923,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"vite": {
|
||||
"version": "5.4.20",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.20.tgz",
|
||||
"integrity": "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g==",
|
||||
"version": "5.4.21",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",
|
||||
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esbuild": "^0.21.3",
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@
|
|||
"@types/react-dom": "^17.0.11",
|
||||
"@vitejs/plugin-react": "^1.1.4",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.4.20"
|
||||
"vite": "^5.4.21"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
samples/browser-esm-vite/.gitignore
vendored
Normal file
2
samples/browser-esm-vite/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
dist
|
||||
src/**/*.js
|
||||
12
samples/browser-esm-vite/index.html
Normal file
12
samples/browser-esm-vite/index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>browser-esm-vite</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
13
samples/browser-esm-vite/main.ts
Normal file
13
samples/browser-esm-vite/main.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import './style.css';
|
||||
import * as monaco from '../../src/editor/editor.main';
|
||||
|
||||
monaco.languages.register({ id: 'typescript' });
|
||||
|
||||
const tm = monaco.editor.createModel(`class Test {}`, 'typescript',
|
||||
monaco.Uri.parse('file:///main.ts'));
|
||||
|
||||
const editor = monaco.editor.create(document.getElementById('root')!, {
|
||||
model: tm,
|
||||
language: 'typescript',
|
||||
theme: 'vs-dark',
|
||||
});
|
||||
1663
samples/browser-esm-vite/package-lock.json
generated
Normal file
1663
samples/browser-esm-vite/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
14
samples/browser-esm-vite/package.json
Normal file
14
samples/browser-esm-vite/package.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "browser-esm-vite",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"monaco-editor": "^0.54.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.11"
|
||||
}
|
||||
}
|
||||
8
samples/browser-esm-vite/style.css
Normal file
8
samples/browser-esm-vite/style.css
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
html,
|
||||
body,
|
||||
#root {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
11
samples/browser-esm-vite/tsconfig.json
Normal file
11
samples/browser-esm-vite/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"strict": true,
|
||||
"module": "ESNext",
|
||||
"jsx": "react-jsx",
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["./"]
|
||||
}
|
||||
19
samples/browser-esm-vite/vite.config.ts
Normal file
19
samples/browser-esm-vite/vite.config.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import { join } from 'path';
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
fs: {
|
||||
allow: ['../../', '../../../vscode']
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
alias: [{
|
||||
find: 'monaco-editor-core/esm/vs',
|
||||
replacement: join(__dirname, '../../../vscode/src/vs')
|
||||
}, {
|
||||
find: 'monaco-editor-core',
|
||||
replacement: join(__dirname, '../../../vscode/src/vs/editor/editor.main.ts')
|
||||
}],
|
||||
}
|
||||
});
|
||||
70
samples/package-lock.json
generated
70
samples/package-lock.json
generated
|
|
@ -721,6 +721,7 @@
|
|||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
|
|
@ -747,6 +748,7 @@
|
|||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"fast-uri": "^3.0.1",
|
||||
|
|
@ -962,6 +964,7 @@
|
|||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001737",
|
||||
"electron-to-chromium": "^1.5.211",
|
||||
|
|
@ -1259,35 +1262,34 @@
|
|||
}
|
||||
},
|
||||
"node_modules/compression": {
|
||||
"version": "1.7.4",
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz",
|
||||
"integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.5",
|
||||
"bytes": "3.0.0",
|
||||
"compressible": "~2.0.16",
|
||||
"bytes": "3.1.2",
|
||||
"compressible": "~2.0.18",
|
||||
"debug": "2.6.9",
|
||||
"on-headers": "~1.0.2",
|
||||
"safe-buffer": "5.1.2",
|
||||
"negotiator": "~0.6.4",
|
||||
"on-headers": "~1.1.0",
|
||||
"safe-buffer": "5.2.1",
|
||||
"vary": "~1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/compression/node_modules/bytes": {
|
||||
"version": "3.0.0",
|
||||
"node_modules/compression/node_modules/negotiator": {
|
||||
"version": "0.6.4",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz",
|
||||
"integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/compression/node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"dev": true,
|
||||
|
|
@ -2184,6 +2186,21 @@
|
|||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
|
|
@ -3160,11 +3177,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/monaco-editor": {
|
||||
"version": "0.53.0-dev-20250905",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.53.0-dev-20250905.tgz",
|
||||
"integrity": "sha512-dz8KD6kfIkQ9vQgUlUPBf24zFiDo/tPbI6HmDoBToURc3vXSlmxnR3NccA5NAaG/k3SrYZ+m4Pd+sjGtc7SV8w==",
|
||||
"version": "0.53.0",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.53.0.tgz",
|
||||
"integrity": "sha512-0WNThgC6CMWNXXBxTbaYYcunj08iB5rnx4/G56UOPeL9UVIUGGHA1GR0EWIh9Ebabj7NpCRawQ5b0hfN1jQmYQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/trusted-types": "^1.0.6"
|
||||
}
|
||||
|
|
@ -3241,9 +3259,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/node-forge": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
|
||||
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz",
|
||||
"integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==",
|
||||
"dev": true,
|
||||
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||
"engines": {
|
||||
|
|
@ -3343,7 +3361,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/on-headers": {
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz",
|
||||
"integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
|
@ -3561,6 +3581,7 @@
|
|||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.6",
|
||||
"picocolors": "^1.0.0",
|
||||
|
|
@ -3992,6 +4013,7 @@
|
|||
"version": "6.12.6",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
|
|
@ -4723,7 +4745,8 @@
|
|||
"node_modules/tslib": {
|
||||
"version": "2.4.0",
|
||||
"dev": true,
|
||||
"license": "0BSD"
|
||||
"license": "0BSD",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/tunnel": {
|
||||
"version": "0.0.6",
|
||||
|
|
@ -4765,6 +4788,7 @@
|
|||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
|
|
@ -4894,6 +4918,7 @@
|
|||
"integrity": "sha512-7b0dTKR3Ed//AD/6kkx/o7duS8H3f1a4w3BYpIriX4BzIhjkn4teo05cptsxvLesHFKK5KObnadmCHBwGc+51A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/eslint-scope": "^3.7.7",
|
||||
"@types/estree": "^1.0.8",
|
||||
|
|
@ -4941,6 +4966,7 @@
|
|||
"version": "4.10.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@discoveryjs/json-ext": "^0.5.0",
|
||||
"@webpack-cli/configtest": "^1.2.0",
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ async function buildAndTest() {
|
|||
// Run checks and compilation
|
||||
await run('npm run gulp hygiene', { cwd: vscodePath });
|
||||
await run('npm run valid-layers-check', { cwd: vscodePath });
|
||||
await run('npm run compile', { cwd: join(vscodePath, 'build') });
|
||||
await run('npm run eslint', { cwd: vscodePath });
|
||||
await run('npm run monaco-compile-check', { cwd: vscodePath });
|
||||
await run('npm run --max_old_space_size=4095 compile', { cwd: vscodePath });
|
||||
|
|
@ -89,10 +88,8 @@ async function buildAndTest() {
|
|||
// Build editor distribution
|
||||
await run('npm run gulp editor-distro', { cwd: vscodePath });
|
||||
|
||||
return; // To save CI time.
|
||||
|
||||
// Run browser tests
|
||||
await run('npm run test-browser --browser chromium', { cwd: vscodePath });
|
||||
await run('npm run test-browser -- --browser chromium', { cwd: vscodePath });
|
||||
|
||||
// TypeScript typings test
|
||||
await run('mkdir typings-test', { cwd: vscodePath });
|
||||
|
|
@ -110,6 +107,4 @@ async function buildAndTest() {
|
|||
await run('npm test', { cwd: testMonacoDir });
|
||||
}
|
||||
|
||||
//buildAndTest();
|
||||
//prepareMonacoEditorCoreRelease('0.99.0', 'main');
|
||||
prepareMonacoEditorCoreReleaseStableOrNightly();
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ export async function gitShallowClone(
|
|||
await run(`git fetch --depth 1 origin ${ref}`, options);
|
||||
await run(`git checkout ${ref}`, options);
|
||||
const commitId = await gitCommitId(targetPath);
|
||||
console.log(`Cloned ${repositoryUrl} (${commitId}) to ${targetPath}`);
|
||||
return { commitId };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import * as css from '../../language/css/monaco.contribution.js';
|
||||
import * as html from '../../language/html/monaco.contribution.js';
|
||||
import * as json from '../../language/json/monaco.contribution.js';
|
||||
import * as typescript from '../../language/typescript/monaco.contribution.js';
|
||||
import '../../basic-languages/monaco.contribution.js';
|
||||
import * as css from '../../language/css/monaco.contribution';
|
||||
import * as html from '../../language/html/monaco.contribution';
|
||||
import * as json from '../../language/json/monaco.contribution';
|
||||
import * as typescript from '../../language/typescript/monaco.contribution';
|
||||
import '../../basic-languages/monaco.contribution';
|
||||
import * as lsp from '@vscode/monaco-lsp-client';
|
||||
|
||||
export * from 'monaco-editor-core';
|
||||
export { createWebWorker, type IWebWorkerOptions } from '../../common/workers.js';
|
||||
export { createWebWorker, type IWebWorkerOptions } from '../../common/workers';
|
||||
export { css, html, json, typescript, lsp };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import * as monaco from 'monaco-editor-core/esm/vs/editor/editor.api.js';
|
||||
import * as monaco from 'monaco-editor-core/esm/vs/editor/editor.api';
|
||||
|
||||
export function getGlobalMonaco(): any {
|
||||
return monaco;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ type CompilerOptionsValue =
|
|||
| null
|
||||
| undefined;
|
||||
|
||||
interface CompilerOptions {
|
||||
export interface CompilerOptions {
|
||||
allowJs?: boolean;
|
||||
allowSyntheticDefaultImports?: boolean;
|
||||
allowUmdGlobalAccess?: boolean;
|
||||
|
|
|
|||
2496
website/package-lock.json
generated
2496
website/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -17,18 +17,18 @@
|
|||
"@vscode/web-editors": "./vscode-web-editors.tgz",
|
||||
"base64-js": "^1.5.1",
|
||||
"bootstrap": "^5.2.0",
|
||||
"bootstrap-icons": "^1.9.1",
|
||||
"bootstrap-icons": "^1.13.1",
|
||||
"classnames": "^2.2.6",
|
||||
"html-inline-css-webpack-plugin": "^1.11.1",
|
||||
"lzma": "^2.3.2",
|
||||
"messagepack": "^1.1.12",
|
||||
"mini-css-extract-plugin": "^2.6.1",
|
||||
"mobx": "^5.15.4",
|
||||
"mobx-react": "^6.2.2",
|
||||
"mobx-react": "^5.0.0",
|
||||
"monaco-editor": "^0.55.0-dev-20251008",
|
||||
"react": "^17.0.2",
|
||||
"react-bootstrap": "^2.4.0",
|
||||
"react-dom": "^17.0.2",
|
||||
"react": "^16.0.2",
|
||||
"react-bootstrap": "^2.10.10",
|
||||
"react-dom": "^16.0.2",
|
||||
"typedoc": "^0.25.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -14,13 +14,20 @@ export function getMonaco(): typeof monaco | undefined {
|
|||
return (window as any).monaco;
|
||||
}
|
||||
|
||||
export interface IMonacoSetup {
|
||||
export type IAMDMonacoSetup = {
|
||||
loaderUrl: string;
|
||||
loaderConfigPaths: Record<string, string>;
|
||||
codiconUrl: string;
|
||||
monacoTypesUrl: string | undefined;
|
||||
language?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type IESMMonacoSetup = {
|
||||
esmUrl: string;
|
||||
monacoTypesUrl: string | undefined;
|
||||
};
|
||||
|
||||
export type IMonacoSetup = IAMDMonacoSetup | IESMMonacoSetup;
|
||||
|
||||
let loading = false;
|
||||
let resolve: (value: typeof monaco) => void;
|
||||
|
|
@ -47,6 +54,10 @@ export async function loadMonaco(
|
|||
async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> {
|
||||
const global = self as any;
|
||||
|
||||
if ('esmUrl' in setup) {
|
||||
return await import(/* webpackIgnore: true */setup.esmUrl); // CodeQL [SM01507] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration. // CodeQL [SM03712] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration.
|
||||
}
|
||||
|
||||
if (!(global as any).require) {
|
||||
await loadScript(setup.loaderUrl);
|
||||
}
|
||||
|
|
@ -112,7 +123,7 @@ export const prodMonacoSetup = getMonacoSetup(
|
|||
export function getMonacoSetup(
|
||||
corePath: string,
|
||||
language?: string
|
||||
): IMonacoSetup {
|
||||
): IAMDMonacoSetup {
|
||||
const loaderConfigPaths = {
|
||||
vs: `${corePath}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ import { IMessageFromRunner, IMessageToRunner, IPreviewState } from "../shared";
|
|||
import "./style.scss";
|
||||
|
||||
window.addEventListener("message", (event) => {
|
||||
const isInSandbox = window.origin === "null";
|
||||
/*const isInSandbox = window.origin === "null";
|
||||
if (!isInSandbox) {
|
||||
// To prevent someone from using this html file to run arbitrary code in non-sandboxed context
|
||||
console.error("not in sandbox");
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
const e = event.data as IMessageToRunner | { kind: undefined };
|
||||
if (e.kind === "initialize") {
|
||||
initialize(e.state);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ monaco.editor.defineTheme("myCustomTheme", {
|
|||
rules: [
|
||||
{
|
||||
token: "comment",
|
||||
foreground: "ffa500",
|
||||
foreground: "a80085",
|
||||
fontStyle: "italic underline",
|
||||
},
|
||||
{ token: "comment.js", foreground: "008800", fontStyle: "bold" },
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
// to the system and how the compiler is told to use ES6 (target=2).
|
||||
|
||||
// validation settings
|
||||
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||
monaco.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: true,
|
||||
noSyntaxValidation: false,
|
||||
});
|
||||
|
||||
// compiler options
|
||||
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
||||
target: monaco.languages.typescript.ScriptTarget.ES2015,
|
||||
monaco.typescript.javascriptDefaults.setCompilerOptions({
|
||||
target: monaco.typescript.ScriptTarget.ES2015,
|
||||
allowNonTsExtensions: true,
|
||||
});
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ var libSource = [
|
|||
"}",
|
||||
].join("\n");
|
||||
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.
|
||||
// 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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
// configure the JSON language support with schemas and schema associations
|
||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||
monaco.json.jsonDefaults.setDiagnosticsOptions({
|
||||
validate: true,
|
||||
schemas: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export class Preview extends React.Component<{
|
|||
<iframe
|
||||
className="full-iframe"
|
||||
key={this.counter}
|
||||
sandbox="allow-scripts allow-modals"
|
||||
// sandbox="allow-scripts allow-modals"
|
||||
frameBorder={0}
|
||||
ref={this.handleIframe}
|
||||
src={`https://isolated-playground.github.io/?jsSrcBase64=${btoa(
|
||||
|
|
|
|||
|
|
@ -136,6 +136,13 @@ export function toLoaderConfig(settings: Settings): IMonacoSetup {
|
|||
break;
|
||||
}
|
||||
|
||||
if (coreUrl.endsWith('?esm')) {
|
||||
return {
|
||||
esmUrl: coreUrl,
|
||||
monacoTypesUrl: undefined,
|
||||
}
|
||||
}
|
||||
|
||||
let languagesUrl: string;
|
||||
switch (settings.languagesSource) {
|
||||
case "latest":
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"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"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$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",
|
||||
"theme": "default",
|
||||
|
|
|
|||
|
|
@ -57,10 +57,7 @@ module.exports = {
|
|||
"sass-loader",
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(jpe?g|png|gif|eot|ttf|svg|woff|woff2|md)$/i,
|
||||
loader: "file-loader",
|
||||
},
|
||||
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loader: "ts-loader",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue