Merge pull request #72 from capaj/prettier

pull/2748/head
Alexandru Dima 5 years ago committed by GitHub
commit 256e10bb54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,7 @@
{
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "none",
"semi": true,
"useTabs": true
}

@ -1,4 +1,3 @@
# Monaco Editor Samples # Monaco Editor Samples
Standalone HTML samples showing how to integrate the Monaco Editor. Standalone HTML samples showing how to integrate the Monaco Editor.
@ -19,19 +18,21 @@ Go to <a href="http://localhost:8888">localhost:8888</a> and explore the samples
Please file issues concering `monaco-editor-samples` in the [`monaco-editor` repository](https://github.com/Microsoft/monaco-editor/issues). Please file issues concering `monaco-editor-samples` in the [`monaco-editor` repository](https://github.com/Microsoft/monaco-editor/issues).
## Loading variations ## Loading variations
* `browser-amd-editor`: running in a browser using `AMD` lazy loading.
* `browser-script-editor`: running in a browser using `AMD` synchronous loading via `<script>` tags. - `browser-amd-editor`: running in a browser using `AMD` lazy loading.
* `browser-esm-webpack`: running in a browser using webpack. - `browser-script-editor`: running in a browser using `AMD` synchronous loading via `<script>` tags.
* `browser-esm-webpack-small`: running in a browser using webpack (only a subset of the editor). - `browser-esm-webpack`: running in a browser using webpack.
* `electron-amd`: running in electron. - `browser-esm-webpack-small`: running in a browser using webpack (only a subset of the editor).
* `nwjs-amd` and `nwjs-amd-v2`: running in nwjs. it is reported that v2 works and the initial version does not. - `electron-amd`: running in electron.
- `nwjs-amd` and `nwjs-amd-v2`: running in nwjs. it is reported that v2 works and the initial version does not.
## Other examples & techniques ## Other examples & techniques
* `browser-amd-diff-editor`: running the diff editor in a browser.
* `browser-amd-iframe`: running in an `<iframe>`. - `browser-amd-diff-editor`: running the diff editor in a browser.
* `browser-amd-localized`: running with the `German` locale. - `browser-amd-iframe`: running in an `<iframe>`.
* `browser-amd-monarch`: running with a custom language grammar written with Monarch. - `browser-amd-localized`: running with the `German` locale.
* `browser-amd-shared-model`: using the same text model in two editors. - `browser-amd-monarch`: running with a custom language grammar written with Monarch.
- `browser-amd-shared-model`: using the same text model in two editors.
## License ## License

@ -1,59 +1,73 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Diff Editor Sample</h2>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid grey"
></div>
<h2>Monaco Diff Editor Sample</h2> <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> <script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> require(['vs/editor/editor.main'], function () {
<script> var diffEditor = monaco.editor.createDiffEditor(
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); document.getElementById('container')
);
require(['vs/editor/editor.main'], function() { Promise.all([xhr('original.txt'), xhr('modified.txt')]).then(function (
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container')); r
) {
var originalTxt = r[0].responseText;
var modifiedTxt = r[1].responseText;
Promise.all([xhr('original.txt'), xhr('modified.txt')]).then(function(r) { diffEditor.setModel({
var originalTxt = r[0].responseText; original: monaco.editor.createModel(originalTxt, 'javascript'),
var modifiedTxt = r[1].responseText; modified: monaco.editor.createModel(modifiedTxt, 'javascript')
});
});
});
</script>
<script>
function xhr(url) {
var req = null;
return new Promise(
function (c, e) {
req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (req._canceled) {
return;
}
diffEditor.setModel({ if (req.readyState === 4) {
original: monaco.editor.createModel(originalTxt, 'javascript'), if (
modified: monaco.editor.createModel(modifiedTxt, 'javascript'), (req.status >= 200 && req.status < 300) ||
}) req.status === 1223
}); ) {
}); c(req);
</script> } else {
<script> e(req);
function xhr(url) { }
var req = null; req.onreadystatechange = function () {};
return new Promise(function(c,e) { }
req = new XMLHttpRequest(); };
req.onreadystatechange = function () {
if (req._canceled) { return; }
if (req.readyState === 4) { req.open('GET', url, true);
if ((req.status >= 200 && req.status < 300) || req.status === 1223) { req.responseType = '';
c(req);
} else {
e(req);
}
req.onreadystatechange = function () { };
}
};
req.open("GET", url, true );
req.responseType = "";
req.send(null); req.send(null);
}, function () { },
req._canceled = true; function () {
req.abort(); req._canceled = true;
}); req.abort();
} }
</script> );
</body> }
</script>
</body>
</html> </html>

@ -1,30 +1,35 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>browser-amd-editor</title> <title>browser-amd-editor</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Sample</h2>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid grey"
></div>
<h2>Monaco Editor Sample</h2> <!-- OR ANY OTHER AMD LOADER HERE INSTEAD OF loader.js -->
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
<!-- OR ANY OTHER AMD LOADER HERE INSTEAD OF loader.js --> require(['vs/editor/editor.main'], function () {
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> var editor = monaco.editor.create(
<script> document.getElementById('container'),
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); {
value: [
require(['vs/editor/editor.main'], function() { 'function x() {',
var editor = monaco.editor.create(document.getElementById('container'), { '\tconsole.log("Hello world!");',
value: [ '}'
'function x() {', ].join('\n'),
'\tconsole.log("Hello world!");', language: 'javascript'
'}' }
].join('\n'), );
language: 'javascript' });
}); </script>
}); </body>
</script>
</body>
</html> </html>

@ -1,79 +1,70 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>Editor in tiny iframe</title>
<head> <style>
<title>Editor in tiny iframe</title> #myIframe1 {
border: 1px solid blue;
width: 0;
height: 0;
}
#myIframe2 {
border: 1px solid red;
display: none;
}
#myIframe3 {
border: 1px solid green;
visibility: hidden;
}
#programmaticIframe {
border: 1px solid yellow;
}
</style>
</head>
<style> <body>
#myIframe1 { <h2>Monaco Editor inside iframes sample</h2>
border: 1px solid blue;
width: 0;
height: 0;
}
#myIframe2 {
border: 1px solid red;
display: none;
}
#myIframe3 {
border: 1px solid green;
visibility: hidden;
}
#programmaticIframe {
border: 1px solid yellow;
}
</style>
</head>
<body> <br />
<br />
0x0:
<br />
<iframe id="myIframe1" src="inner.html"></iframe>
display:none:
<br />
<iframe id="myIframe2" src="inner.html"></iframe>
visibility:hidden:
<br />
<iframe id="myIframe3" src="inner.html"></iframe>
taken off-dom while loading:
<br />
<h2>Monaco Editor inside iframes sample</h2> <script>
var myIframe1 = document.getElementById('myIframe1');
var myIframe2 = document.getElementById('myIframe2');
var myIframe3 = document.getElementById('myIframe3');
var programmaticIframe = document.createElement('iframe');
programmaticIframe.id = 'programmaticIframe';
programmaticIframe.src = 'inner.html';
// trigger its loading & take it off dom
document.body.appendChild(programmaticIframe);
<br/> setTimeout(function () {
<br/> 0x0: document.body.removeChild(programmaticIframe);
<br/> }, 10);
<iframe id="myIframe1" src="inner.html"></iframe>
display:none:
<br/>
<iframe id="myIframe2" src="inner.html"></iframe>
visibility:hidden:
<br/>
<iframe id="myIframe3" src="inner.html"></iframe>
taken off-dom while loading:
<br/>
<script> setTimeout(function () {
document.body.appendChild(programmaticIframe);
[myIframe1, myIframe2, myIframe3, programmaticIframe].forEach(reveal);
}, 3000);
var myIframe1 = document.getElementById('myIframe1'); function reveal(iframe) {
var myIframe2 = document.getElementById('myIframe2'); iframe.style.width = '400px';
var myIframe3 = document.getElementById('myIframe3'); iframe.style.height = '100px';
var programmaticIframe = document.createElement('iframe'); iframe.style.display = 'block';
programmaticIframe.id = 'programmaticIframe'; iframe.style.visibility = 'visible';
programmaticIframe.src = "inner.html"; }
// trigger its loading & take it off dom </script>
document.body.appendChild(programmaticIframe); </body>
setTimeout(function() {
document.body.removeChild(programmaticIframe);
}, 10);
setTimeout(function() {
document.body.appendChild(programmaticIframe);
[
myIframe1,
myIframe2,
myIframe3,
programmaticIframe
].forEach(reveal);
}, 3000);
function reveal(iframe) {
iframe.style.width = '400px';
iframe.style.height = '100px';
iframe.style.display = 'block';
iframe.style.visibility = 'visible';
}
</script>
</body>
</html> </html>

@ -1,39 +1,42 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css"> <style type="text/css">
html, html,
body { body {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="container" style="width:100%;height:100%"></div> <div id="container" style="width: 100%; height: 100%"></div>
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<script> <script>
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
require(['vs/editor/editor.main'], function() { require(['vs/editor/editor.main'], function () {
var editor = monaco.editor.create(document.getElementById('container'), { var editor = monaco.editor.create(
value: [ document.getElementById('container'),
'function x() {', {
'\tconsole.log("Hello world!");', value: [
'}' 'function x() {',
].join('\n'), '\tconsole.log("Hello world!");',
language: 'javascript' '}'
}); ].join('\n'),
language: 'javascript'
}
);
window.onresize = function() { window.onresize = function () {
editor.layout(); editor.layout();
}; };
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1,36 +1,41 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Localization Sample</h2>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid grey"
></div>
<h2>Monaco Editor Localization Sample</h2> <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> <script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> require.config({
<script> 'vs/nls': {
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); availableLanguages: {
'*': 'de'
}
}
});
require.config({ require(['vs/editor/editor.main'], function () {
'vs/nls' : { var editor = monaco.editor.create(
availableLanguages: { document.getElementById('container'),
'*': 'de' {
} value: [
} 'function x() {',
}); '\tconsole.log("Hello world!");',
'}'
require(['vs/editor/editor.main'], function() { ].join('\n'),
var editor = monaco.editor.create(document.getElementById('container'), { language: 'javascript'
value: [ }
'function x() {', );
'\tconsole.log("Hello world!");', });
'}' </script>
].join('\n'), </body>
language: 'javascript'
});
});
</script>
</body>
</html> </html>

@ -1,107 +1,111 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monarch Tokenizer Sample</h2>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid grey"
></div>
<h2>Monarch Tokenizer Sample</h2> <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> <script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> require(['vs/editor/editor.main'], function () {
<script> monaco.languages.register({
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); id: 'myCustomLanguage'
});
monaco.languages.setMonarchTokensProvider('myCustomLanguage', {
tokenizer: {
root: [
[/\[error.*/, 'custom-error'],
[/\[notice.*/, 'custom-notice'],
[/\[info.*/, 'custom-info'],
[/\[[a-zA-Z 0-9:]+\]/, 'custom-date']
]
}
});
require(['vs/editor/editor.main'], function() { // Define a new theme that constains only rules that match this language
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs',
inherit: false,
rules: [
{ token: 'custom-info', foreground: '808080' },
{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },
{ token: 'custom-notice', foreground: 'FFA500' },
{ token: 'custom-date', foreground: '008800' }
]
});
monaco.languages.register({ var editor = monaco.editor.create(
id: 'myCustomLanguage' document.getElementById('container'),
}); {
monaco.languages.setMonarchTokensProvider('myCustomLanguage', { theme: 'myCoolTheme',
tokenizer: { value: getCode(),
root: [ language: 'myCustomLanguage'
[/\[error.*/, "custom-error"], }
[/\[notice.*/, "custom-notice"], );
[/\[info.*/, "custom-info"], });
[/\[[a-zA-Z 0-9:]+\]/, "custom-date"],
],
}
});
// Define a new theme that constains only rules that match this language
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs',
inherit: false,
rules: [
{ token: 'custom-info', foreground: '808080' },
{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },
{ token: 'custom-notice', foreground: 'FFA500' },
{ token: 'custom-date', foreground: '008800' },
]
});
var editor = monaco.editor.create(document.getElementById('container'), { function getCode() {
theme: 'myCoolTheme', return [
value: getCode(), '[Sun Mar 7 16:02:00 2004] [notice] Apache/1.3.29 (Unix) configured -- resuming normal operations',
language: 'myCustomLanguage' '[Sun Mar 7 16:02:00 2004] [info] Server built: Feb 27 2004 13:56:37',
}); '[Sun Mar 7 16:02:00 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)',
}); '[Sun Mar 7 16:05:49 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 16:45:56 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
function getCode() { '[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
return [ '[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 16:02:00 2004] [notice] Apache/1.3.29 (Unix) configured -- resuming normal operations', '[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.',
'[Sun Mar 7 16:02:00 2004] [info] Server built: Feb 27 2004 13:56:37', "[Sun Mar 7 17:23:53 2004] statistics: Can't create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied",
'[Sun Mar 7 16:02:00 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)', '[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 16:05:49 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 16:45:56 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 18:00:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 18:10:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.', '[Sun Mar 7 18:19:01 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:23:53 2004] statistics: Can\'t create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied', '[Sun Mar 7 18:42:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 18:52:30 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 18:58:52 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 19:03:58 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:00:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 19:08:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:10:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 20:04:35 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:19:01 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 20:11:33 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:42:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 20:12:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:52:30 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 20:25:31 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:58:52 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 20:44:48 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 19:03:58 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 19:08:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome',
'[Sun Mar 7 20:04:35 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 21:20:14 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:11:33 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 21:31:12 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:12:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 21:39:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:25:31 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 21:44:10 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:44:48 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 01:35:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 01:47:06 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome', '[Mon Mar 8 01:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:20:14 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 02:12:24 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:31:12 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 02:54:54 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:39:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 03:46:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:44:10 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 03:48:18 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 01:35:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 03:52:17 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 01:47:06 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 03:55:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 01:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 04:22:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 02:12:24 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 04:24:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 02:54:54 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 04:40:32 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:46:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 04:55:40 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:48:18 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 04:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:52:17 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 05:22:57 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:55:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:22:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:24:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx',
'[Mon Mar 8 04:40:32 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx'
'[Mon Mar 8 04:55:40 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', ].join('\n');
'[Mon Mar 8 04:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', }
'[Mon Mar 8 05:22:57 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', </script>
'[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', </body>
'[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx',
'<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx',
].join('\n');;
}
</script>
</body>
</html> </html>

@ -1,28 +1,37 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Sample - Loading with requirejs</h2>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid grey"
></div>
<h2>Monaco Editor Sample - Loading with requirejs</h2> <script
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"
integrity="sha256-0SGl1PJNDyJwcV5T+weg2zpEMrh7xvlwO4oXgvZCeZk="
crossorigin="anonymous"
></script>
<script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js" integrity="sha256-0SGl1PJNDyJwcV5T+weg2zpEMrh7xvlwO4oXgvZCeZk=" crossorigin="anonymous"></script> require(['vs/editor/editor.main'], function () {
<script> var editor = monaco.editor.create(
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); document.getElementById('container'),
{
require(['vs/editor/editor.main'], function() { value: [
var editor = monaco.editor.create(document.getElementById('container'), { 'function x() {',
value: [ '\tconsole.log("Hello world!");',
'function x() {', '}'
'\tconsole.log("Hello world!");', ].join('\n'),
'}' language: 'javascript'
].join('\n'), }
language: 'javascript' );
}); });
}); </script>
</script> </body>
</body>
</html> </html>

@ -1,34 +1,42 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Shared Models Sample</h2>
<div
id="container1"
style="width: 400px; height: 200px; border: 1px solid grey"
></div>
<div
id="container2"
style="width: 400px; height: 200px; border: 1px solid grey"
></div>
<h2>Monaco Editor Shared Models Sample</h2> <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<div id="container1" style="width:400px;height:200px;border:1px solid grey"></div> <script>
<div id="container2" style="width:400px;height:200px;border:1px solid grey"></div> require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> require(['vs/editor/editor.main'], function () {
<script> var model = monaco.editor.createModel(
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
'javascript'
require(['vs/editor/editor.main'], function() { );
var model = monaco.editor.createModel([ var editor1 = monaco.editor.create(
'function x() {', document.getElementById('container1'),
'\tconsole.log("Hello world!");', {
'}' model: model
].join('\n'), }
'javascript' );
); var editor2 = monaco.editor.create(
var editor1 = monaco.editor.create(document.getElementById('container1'), { document.getElementById('container2'),
model: model {
}); model: model
var editor2 = monaco.editor.create(document.getElementById('container2'), { }
model: model );
}); });
}); </script>
</script> </body>
</body>
</html> </html>

@ -1,28 +1,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Parcel Bundler Sample</h2>
<h2>Monaco Editor Parcel Bundler Sample</h2> This sample shows how to load a small subset of the editor:
<ul>
<li>Only the core editor and the find widget</li>
<li>Only the json language coloring</li>
</ul>
This sample shows how to load a small subset of the editor: To run this sample, you need to:
<ul>
<li>Only the core editor and the find widget</li>
<li>Only the json language coloring</li>
</ul>
To run this sample, you need to: <pre>
<pre>
$/browser-esm-parcel> npm install . $/browser-esm-parcel> npm install .
$/browser-esm-parcel> npm run build $/browser-esm-parcel> npm run build
$/browser-esm-parcel> npm run simpleserver $/browser-esm-parcel> npm run simpleserver
</pre> </pre
>
Then, open <a href="http://localhost:9999/">http://localhost:9999/</a>.
</body> Then, open <a href="http://localhost:9999/">http://localhost:9999/</a>.
</body>
</html> </html>

File diff suppressed because it is too large Load Diff

@ -1,19 +1,19 @@
{ {
"name": "helloworld", "name": "helloworld",
"dependencies": {}, "dependencies": {},
"scripts": { "scripts": {
"simpleserver": "yaserver --root ./dist --port 9999", "simpleserver": "yaserver --root ./dist --port 9999",
"build": "npm run build-index && npm run build-json && npm run build-css && npm run build-html && npm run build-ts && npm run build-worker", "build": "npm run build-index && npm run build-json && npm run build-css && npm run build-html && npm run build-ts && npm run build-worker",
"build-index": "parcel build src/index.html", "build-index": "parcel build src/index.html",
"build-json": "parcel build node_modules/monaco-editor/esm/vs/language/json/json.worker.js --no-source-maps", "build-json": "parcel build node_modules/monaco-editor/esm/vs/language/json/json.worker.js --no-source-maps",
"build-css": "parcel build node_modules/monaco-editor/esm/vs/language/css/css.worker.js --no-source-maps", "build-css": "parcel build node_modules/monaco-editor/esm/vs/language/css/css.worker.js --no-source-maps",
"build-html": "parcel build node_modules/monaco-editor/esm/vs/language/html/html.worker.js --no-source-maps", "build-html": "parcel build node_modules/monaco-editor/esm/vs/language/html/html.worker.js --no-source-maps",
"build-ts": "parcel build node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js --no-source-maps", "build-ts": "parcel build node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js --no-source-maps",
"build-worker": "parcel build node_modules/monaco-editor/esm/vs/editor/editor.worker.js --no-source-maps" "build-worker": "parcel build node_modules/monaco-editor/esm/vs/editor/editor.worker.js --no-source-maps"
}, },
"devDependencies": { "devDependencies": {
"monaco-editor": "0.20.0", "monaco-editor": "0.20.0",
"yaserver": "^0.3.0", "yaserver": "^0.3.0",
"parcel": "^1.12.4" "parcel": "^1.12.4"
} }
} }

@ -1,12 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div> <div
id="container"
style="width: 800px; height: 600px; border: 1px solid #ccc"
></div>
<script src="index.js"></script> <script src="index.js"></script>
</body> </body>
</html> </html>

@ -1,4 +1,3 @@
import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js';
self.MonacoEnvironment = { self.MonacoEnvironment = {
@ -16,14 +15,10 @@ self.MonacoEnvironment = {
return './ts.worker.js'; return './ts.worker.js';
} }
return './editor.worker.js'; return './editor.worker.js';
}, }
}; };
monaco.editor.create(document.getElementById('container'), { monaco.editor.create(document.getElementById('container'), {
value: [ value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
'function x() {',
'\tconsole.log("Hello world!");',
'}'
].join('\n'),
language: 'javascript' language: 'javascript'
}); });

@ -1,12 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<script src="./main.bundle.js"></script>
<script src="./main.bundle.js"></script> </body>
</body>
</html> </html>

@ -1,21 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Webpack Plugin Sample</h2>
<h2>Monaco Editor Webpack Plugin Sample</h2> To run this sample, you need to:
To run this sample, you need to: <pre>
<pre>
$/browser-esm-webpack> npm install . $/browser-esm-webpack> npm install .
$/browser-esm-webpack> ./node_modules/.bin/webpack $/browser-esm-webpack> ./node_modules/.bin/webpack
</pre> </pre
>
Then, <a href="./dist">open the ./dist folder</a>.
</body> Then, <a href="./dist">open the ./dist folder</a>.
</body>
</html> </html>

@ -1,4 +1,4 @@
import * as monaco from "monaco-editor/esm/vs/editor/editor.api"; import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
(function () { (function () {
// create div to avoid needing a HtmlWebpackPlugin template // create div to avoid needing a HtmlWebpackPlugin template
@ -9,12 +9,8 @@ import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
document.body.appendChild(div); document.body.appendChild(div);
})(); })();
monaco.editor.create( monaco.editor.create(document.getElementById('root'), {
document.getElementById('root'), value: `const foo = () => 0;`,
{ language: 'javascript',
value: `const foo = () => 0;`, theme: 'vs-dark'
language: 'javascript', });
theme: 'vs-dark'
}
);

@ -1,25 +1,28 @@
const path = require("path"); const path = require('path');
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = { module.exports = {
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV,
entry: "./index.js", entry: './index.js',
output: { output: {
path: path.resolve(__dirname, "dist"), path: path.resolve(__dirname, 'dist'),
filename: "[name].bundle.js", filename: '[name].bundle.js'
}, },
module: { module: {
rules: [{ rules: [
test: /\.css$/, {
use: ["style-loader", "css-loader",], test: /\.css$/,
}, { use: ['style-loader', 'css-loader']
test: /\.ttf$/, },
use: ['file-loader'] {
}], test: /\.ttf$/,
use: ['file-loader']
}
]
}, },
plugins: [ plugins: [
new MonacoWebpackPlugin({ new MonacoWebpackPlugin({
languages: ["typescript", "javascript", "css"], languages: ['typescript', 'javascript', 'css']
}) })
] ]
}; };

@ -1,14 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid #ccc"
></div>
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div> <script src="./app.bundle.js"></script>
</body>
<script src="./app.bundle.js"></script>
</body>
</html> </html>

@ -1,27 +1,26 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Webpack Sample</h2>
<h2>Monaco Editor Webpack Sample</h2> This sample shows how to load a small subset of the editor:
<ul>
<li>Only the core editor and the find widget</li>
<li>Only the python language coloring</li>
</ul>
This sample shows how to load a small subset of the editor: To run this sample, you need to:
<ul>
<li>Only the core editor and the find widget</li>
<li>Only the python language coloring</li>
</ul>
To run this sample, you need to: <pre>
<pre>
$/browser-esm-webpack-small> npm install . $/browser-esm-webpack-small> npm install .
$/browser-esm-webpack-small> ./node_modules/.bin/webpack $/browser-esm-webpack-small> ./node_modules/.bin/webpack
</pre> </pre
>
Then, <a href="./dist">open the ./dist folder</a>.
</body> Then, <a href="./dist">open the ./dist folder</a>.
</body>
</html> </html>

@ -1,4 +1,3 @@
// (1) Desired editor features: // (1) Desired editor features:
import 'monaco-editor/esm/vs/editor/browser/controller/coreCommands.js'; import 'monaco-editor/esm/vs/editor/browser/controller/coreCommands.js';
// import 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js'; // import 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js';
@ -90,8 +89,6 @@ import 'monaco-editor/esm/vs/basic-languages/python/python.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution'; // import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
// import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution'; // import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
self.MonacoEnvironment = { self.MonacoEnvironment = {
getWorkerUrl: function (moduleId, label) { getWorkerUrl: function (moduleId, label) {
// if (label === 'json') { // if (label === 'json') {
@ -108,7 +105,7 @@ self.MonacoEnvironment = {
// } // }
return './editor.worker.bundle.js'; return './editor.worker.bundle.js';
} }
} };
monaco.editor.create(document.getElementById('container'), { monaco.editor.create(document.getElementById('container'), {
value: [ value: [
@ -118,12 +115,12 @@ monaco.editor.create(document.getElementById('container'), {
' # Bananas the monkey can eat.', ' # Bananas the monkey can eat.',
' capacity = 10', ' capacity = 10',
' def eat(self, N):', ' def eat(self, N):',
' \'\'\'Make the monkey eat N bananas!\'\'\'', " '''Make the monkey eat N bananas!'''",
' capacity = capacity - N*banana.size', ' capacity = capacity - N*banana.size',
'', '',
' def feeding_frenzy(self):', ' def feeding_frenzy(self):',
' eat(9.25)', ' eat(9.25)',
' return "Yum yum"', ' return "Yum yum"'
].join('\n'), ].join('\n'),
language: 'python' language: 'python'
}); });

File diff suppressed because it is too large Load Diff

@ -1,16 +1,16 @@
{ {
"name": "helloworld", "name": "helloworld",
"dependencies": {}, "dependencies": {},
"scripts": { "scripts": {
"build": "webpack --progress" "build": "webpack --progress"
}, },
"devDependencies": { "devDependencies": {
"css-loader": "^4.2.0", "css-loader": "^4.2.0",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"monaco-editor": "^0.20.0", "monaco-editor": "^0.20.0",
"style-loader": "^1.2.1", "style-loader": "^1.2.1",
"terser-webpack-plugin": "^4.0.0", "terser-webpack-plugin": "^4.0.0",
"webpack": "^4.44.1", "webpack": "^4.44.1",
"webpack-cli": "^3.3.12" "webpack-cli": "^3.3.12"
} }
} }

@ -4,8 +4,8 @@ const TerserPlugin = require('terser-webpack-plugin');
module.exports = { module.exports = {
mode: 'production', mode: 'production',
entry: { entry: {
"app": './index.js', app: './index.js',
"editor.worker": 'monaco-editor/esm/vs/editor/editor.worker.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js'
// "json.worker": 'monaco-editor/esm/vs/language/json/json.worker', // "json.worker": 'monaco-editor/esm/vs/language/json/json.worker',
// "css.worker": 'monaco-editor/esm/vs/language/css/css.worker', // "css.worker": 'monaco-editor/esm/vs/language/css/css.worker',
// "html.worker": 'monaco-editor/esm/vs/language/html/html.worker', // "html.worker": 'monaco-editor/esm/vs/language/html/html.worker',
@ -17,16 +17,19 @@ module.exports = {
path: path.resolve(__dirname, 'dist') path: path.resolve(__dirname, 'dist')
}, },
module: { module: {
rules: [{ rules: [
test: /\.css$/, {
use: ['style-loader', 'css-loader'] test: /\.css$/,
}, { use: ['style-loader', 'css-loader']
test: /\.ttf$/, },
use: ['file-loader'] {
}] test: /\.ttf$/,
use: ['file-loader']
}
]
}, },
optimization: { optimization: {
minimize: true, minimize: true,
minimizer: [new TerserPlugin()], minimizer: [new TerserPlugin()]
}, }
}; };

File diff suppressed because it is too large Load Diff

@ -1,20 +1,20 @@
{ {
"name": "monaco-esm-webpack-typescript", "name": "monaco-esm-webpack-typescript",
"scripts": { "scripts": {
"start": "webpack-dev-server", "start": "webpack-dev-server",
"build": "webpack --progress" "build": "webpack --progress"
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"css-loader": "^4.2.0", "css-loader": "^4.2.0",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"html-webpack-plugin": "^4.3.0", "html-webpack-plugin": "^4.3.0",
"monaco-editor": "^0.20.0", "monaco-editor": "^0.20.0",
"style-loader": "^1.2.1", "style-loader": "^1.2.1",
"ts-loader": "^8.0.2", "ts-loader": "^8.0.2",
"typescript": "^3.9.7", "typescript": "^3.9.7",
"webpack": "^4.44.1", "webpack": "^4.44.1",
"webpack-cli": "^3.3.12", "webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0" "webpack-dev-server": "^3.11.0"
} }
} }

@ -1,5 +1,5 @@
body { body {
width: 800px; width: 800px;
height: 600px; height: 600px;
border: 1px solid #ccc; border: 1px solid #ccc;
} }

@ -1,26 +1,26 @@
import * as monaco from "monaco-editor"; import * as monaco from 'monaco-editor';
import "./index.css"; import './index.css';
// @ts-ignore // @ts-ignore
self.MonacoEnvironment = { self.MonacoEnvironment = {
getWorkerUrl: function(moduleId, label) { getWorkerUrl: function (moduleId, label) {
if (label === "json") { if (label === 'json') {
return "./json.worker.bundle.js"; return './json.worker.bundle.js';
} }
if (label === "css") { if (label === 'css') {
return "./css.worker.bundle.js"; return './css.worker.bundle.js';
} }
if (label === "html") { if (label === 'html') {
return "./html.worker.bundle.js"; return './html.worker.bundle.js';
} }
if (label === "typescript" || label === "javascript") { if (label === 'typescript' || label === 'javascript') {
return "./ts.worker.bundle.js"; return './ts.worker.bundle.js';
} }
return "./editor.worker.bundle.js"; return './editor.worker.bundle.js';
} }
}; };
monaco.editor.create(document.body, { monaco.editor.create(document.body, {
value: ["function x() {", '\tconsole.log("Hello world!");', "}"].join("\n"), value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
language: "typescript" language: 'typescript'
}); });

@ -1,16 +1,16 @@
{ {
"compilerOptions": { "compilerOptions": {
"sourceMap": true, "sourceMap": true,
"module": "commonjs", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"target": "es5", "target": "es5",
"outDir": "./dist", "outDir": "./dist",
"lib": ["dom", "es5", "es2015.collection", "es2015.promise"], "lib": ["dom", "es5", "es2015.collection", "es2015.promise"],
"types": [], "types": [],
"baseUrl": "./node_modules", "baseUrl": "./node_modules",
"jsx": "preserve", "jsx": "preserve",
"typeRoots": ["node_modules/@types"] "typeRoots": ["node_modules/@types"]
}, },
"include": ["./src/**/*"], "include": ["./src/**/*"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }

@ -1,44 +1,44 @@
const path = require("path"); const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin"); const HtmlWebPackPlugin = require('html-webpack-plugin');
module.exports = { module.exports = {
mode: "development", mode: 'development',
entry: { entry: {
app: "./src/index.ts", app: './src/index.ts',
"editor.worker": "monaco-editor/esm/vs/editor/editor.worker.js", 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
"json.worker": "monaco-editor/esm/vs/language/json/json.worker", 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker',
"css.worker": "monaco-editor/esm/vs/language/css/css.worker", 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker',
"html.worker": "monaco-editor/esm/vs/language/html/html.worker", 'html.worker': 'monaco-editor/esm/vs/language/html/html.worker',
"ts.worker": "monaco-editor/esm/vs/language/typescript/ts.worker" 'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker'
}, },
resolve: { resolve: {
extensions: [".ts", ".js"] extensions: ['.ts', '.js']
}, },
output: { output: {
globalObject: "self", globalObject: 'self',
filename: "[name].bundle.js", filename: '[name].bundle.js',
path: path.resolve(__dirname, "dist") path: path.resolve(__dirname, 'dist')
}, },
module: { module: {
rules: [ rules: [
{ {
test: /\.ts?$/, test: /\.ts?$/,
use: "ts-loader", use: 'ts-loader',
exclude: /node_modules/ exclude: /node_modules/
}, },
{ {
test: /\.css$/, test: /\.css$/,
use: ["style-loader", "css-loader"] use: ['style-loader', 'css-loader']
}, },
{ {
test: /\.ttf$/, test: /\.ttf$/,
use: ['file-loader'] use: ['file-loader']
} }
] ]
}, },
plugins: [ plugins: [
new HtmlWebPackPlugin({ new HtmlWebPackPlugin({
title: "Monaco Editor Sample" title: 'Monaco Editor Sample'
}) })
] ]
}; };

@ -1,14 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid #ccc"
></div>
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div> <script src="./app.bundle.js"></script>
</body>
<script src="./app.bundle.js"></script>
</body>
</html> </html>

@ -1,21 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Webpack Sample</h2>
<h2>Monaco Editor Webpack Sample</h2> To run this sample, you need to:
To run this sample, you need to: <pre>
<pre>
$/browser-esm-webpack> npm install . $/browser-esm-webpack> npm install .
$/browser-esm-webpack> ./node_modules/.bin/webpack $/browser-esm-webpack> ./node_modules/.bin/webpack
</pre> </pre
>
Then, <a href="./dist">open the ./dist folder</a>.
</body> Then, <a href="./dist">open the ./dist folder</a>.
</body>
</html> </html>

@ -16,13 +16,9 @@ self.MonacoEnvironment = {
} }
return './editor.worker.bundle.js'; return './editor.worker.bundle.js';
} }
} };
monaco.editor.create(document.getElementById('container'), { monaco.editor.create(document.getElementById('container'), {
value: [ value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
'function x() {',
'\tconsole.log("Hello world!");',
'}'
].join('\n'),
language: 'javascript' language: 'javascript'
}); });

File diff suppressed because it is too large Load Diff

@ -1,15 +1,15 @@
{ {
"name": "helloworld", "name": "helloworld",
"dependencies": {}, "dependencies": {},
"scripts": { "scripts": {
"build": "webpack --progress" "build": "webpack --progress"
}, },
"devDependencies": { "devDependencies": {
"css-loader": "^4.2.0", "css-loader": "^4.2.0",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"monaco-editor": "^0.20.0", "monaco-editor": "^0.20.0",
"style-loader": "^1.2.1", "style-loader": "^1.2.1",
"webpack": "^4.44.1", "webpack": "^4.44.1",
"webpack-cli": "^3.3.12" "webpack-cli": "^3.3.12"
} }
} }

@ -3,12 +3,12 @@ const path = require('path');
module.exports = { module.exports = {
mode: 'development', mode: 'development',
entry: { entry: {
"app": './index.js', app: './index.js',
"editor.worker": 'monaco-editor/esm/vs/editor/editor.worker.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
"json.worker": 'monaco-editor/esm/vs/language/json/json.worker', 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker',
"css.worker": 'monaco-editor/esm/vs/language/css/css.worker', 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker',
"html.worker": 'monaco-editor/esm/vs/language/html/html.worker', 'html.worker': 'monaco-editor/esm/vs/language/html/html.worker',
"ts.worker": 'monaco-editor/esm/vs/language/typescript/ts.worker', 'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker'
}, },
output: { output: {
globalObject: 'self', globalObject: 'self',
@ -16,12 +16,15 @@ module.exports = {
path: path.resolve(__dirname, 'dist') path: path.resolve(__dirname, 'dist')
}, },
module: { module: {
rules: [{ rules: [
test: /\.css$/, {
use: ['style-loader', 'css-loader'] test: /\.css$/,
}, { use: ['style-loader', 'css-loader']
test: /\.ttf$/, },
use: ['file-loader'] {
}] test: /\.ttf$/,
}, use: ['file-loader']
}
]
}
}; };

@ -1,30 +1,35 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" data-name="vs/editor/editor.main" href="../node_modules/monaco-editor/min/vs/editor/editor.main.css"> <link
</head> rel="stylesheet"
<body> data-name="vs/editor/editor.main"
href="../node_modules/monaco-editor/min/vs/editor/editor.main.css"
/>
</head>
<body>
<h2>Monaco Editor Sync Loading Sample</h2>
<div
id="container"
style="width: 800px; height: 600px; border: 1px solid grey"
></div>
<h2>Monaco Editor Sync Loading Sample</h2> <script>
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> var require = { paths: { vs: '../node_modules/monaco-editor/min/vs' } };
</script>
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.nls.js"></script>
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.js"></script>
<script>var require = { paths: { 'vs': '../node_modules/monaco-editor/min/vs' } };</script> <script>
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> var editor = monaco.editor.create(document.getElementById('container'), {
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.nls.js"></script> value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join(
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.js"></script> '\n'
),
<script> language: 'javascript'
var editor = monaco.editor.create(document.getElementById('container'), { });
value: [ </script>
'function x() {', </body>
'\tconsole.log("Hello world!");',
'}'
].join('\n'),
language: 'javascript'
});
</script>
</body>
</html> </html>

@ -1,104 +1,117 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" data-name="vs/editor/editor.main" href="../node_modules/monaco-editor/min/vs/editor/editor.main.css"> <link
</head> rel="stylesheet"
<body> data-name="vs/editor/editor.main"
href="../node_modules/monaco-editor/min/vs/editor/editor.main.css"
<h2>Monaco Editor Undo Redo Samples</h2> />
</head>
<div style="padding: 5pt"> <body>
<button id="undoButton" name="undo" onclick="undo();" disabled="true">Undo</button> <h2>Monaco Editor Undo Redo Samples</h2>
<button id="redoButton" name="redo" onclick="redo();" disabled="true">Redo</button>
</div> <div style="padding: 5pt">
<button id="undoButton" name="undo" onclick="undo();" disabled="true">
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> Undo
</button>
<script>var require = { paths: { 'vs': '../node_modules/monaco-editor/min/vs' } };</script> <button id="redoButton" name="redo" onclick="redo();" disabled="true">
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script> Redo
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.nls.js"></script> </button>
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.js"></script> </div>
<script> <div
const value = [ id="container"
'define([], function() {', style="width: 800px; height: 600px; border: 1px solid grey"
'\treturn ({p1, p2}) => {', ></div>
'\t\treturn Promise.resolve("Hello, World");',
'\t};', <script>
'});' var require = { paths: { vs: '../node_modules/monaco-editor/min/vs' } };
].join('\n'); </script>
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
const editor = monaco.editor.create(document.getElementById('container'), { <script src="../node_modules/monaco-editor/min/vs/editor/editor.main.nls.js"></script>
value: [ <script src="../node_modules/monaco-editor/min/vs/editor/editor.main.js"></script>
'function x() {',
'\tconsole.log("Hello world!");', <script>
'}' const value = [
].join('\n'), 'define([], function() {',
language: 'javascript' '\treturn ({p1, p2}) => {',
}); '\t\treturn Promise.resolve("Hello, World");',
'\t};',
editor.focus(); '});'
editor.setPosition({ lineNumber: 2, column: 30 }); ].join('\n');
const initialVersion = editor.getModel().getAlternativeVersionId(); const editor = monaco.editor.create(
let currentVersion = initialVersion; document.getElementById('container'),
let lastVersion = initialVersion; {
value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join(
editor.onDidChangeModelContent(e => { '\n'
const versionId = editor.getModel().getAlternativeVersionId(); ),
// undoing language: 'javascript'
if (versionId < currentVersion) {
enableRedoButton();
// no more undo possible
if (versionId === initialVersion) {
disableUndoButton();
}
} else {
// redoing
if (versionId <= lastVersion) {
// redoing the last change
if (versionId == lastVersion) {
disableRedoButton();
} }
} else { // adding new change, disable redo when adding new changes );
disableRedoButton();
if (currentVersion > lastVersion) { editor.focus();
lastVersion = currentVersion; editor.setPosition({ lineNumber: 2, column: 30 });
const initialVersion = editor.getModel().getAlternativeVersionId();
let currentVersion = initialVersion;
let lastVersion = initialVersion;
editor.onDidChangeModelContent((e) => {
const versionId = editor.getModel().getAlternativeVersionId();
// undoing
if (versionId < currentVersion) {
enableRedoButton();
// no more undo possible
if (versionId === initialVersion) {
disableUndoButton();
}
} else {
// redoing
if (versionId <= lastVersion) {
// redoing the last change
if (versionId == lastVersion) {
disableRedoButton();
}
} else {
// adding new change, disable redo when adding new changes
disableRedoButton();
if (currentVersion > lastVersion) {
lastVersion = currentVersion;
}
}
enableUndoButton();
} }
} currentVersion = versionId;
enableUndoButton(); });
}
currentVersion = versionId;
});
function undo() {
editor.trigger('aaaa', 'undo', 'aaaa');
editor.focus();
}
function redo() { function undo() {
editor.trigger('aaaa', 'redo', 'aaaa'); editor.trigger('aaaa', 'undo', 'aaaa');
editor.focus(); editor.focus();
} }
function enableUndoButton() { function redo() {
document.getElementById("undoButton").disabled = false; editor.trigger('aaaa', 'redo', 'aaaa');
} editor.focus();
}
function disableUndoButton() { function enableUndoButton() {
document.getElementById("undoButton").disabled = true; document.getElementById('undoButton').disabled = false;
} }
function enableRedoButton() { function disableUndoButton() {
document.getElementById("redoButton").disabled = false; document.getElementById('undoButton').disabled = true;
} }
function disableRedoButton() { function enableRedoButton() {
document.getElementById("redoButton").disabled = true; document.getElementById('redoButton').disabled = false;
} }
</script>
</body> function disableRedoButton() {
document.getElementById('redoButton').disabled = true;
}
</script>
</body>
</html> </html>

@ -1,46 +1,54 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<title>Monaco Editor!</title> <title>Monaco Editor!</title>
</head> </head>
<body> <body>
<h1>Monaco Editor in Electron!</h1> <h1>Monaco Editor in Electron!</h1>
<div id="container" style="width:500px;height:300px;border:1px solid #ccc"></div> <div
id="container"
style="width: 500px; height: 300px; border: 1px solid #ccc"
></div>
</body> </body>
<script> <script>
(function() { (function () {
const path = require('path'); const path = require('path');
const amdLoader = require('../node_modules/monaco-editor/min/vs/loader.js'); const amdLoader = require('../node_modules/monaco-editor/min/vs/loader.js');
const amdRequire = amdLoader.require; const amdRequire = amdLoader.require;
const amdDefine = amdLoader.require.define; const amdDefine = amdLoader.require.define;
function uriFromPath(_path) { function uriFromPath(_path) {
var pathName = path.resolve(_path).replace(/\\/g, '/'); var pathName = path.resolve(_path).replace(/\\/g, '/');
if (pathName.length > 0 && pathName.charAt(0) !== '/') { if (pathName.length > 0 && pathName.charAt(0) !== '/') {
pathName = '/' + pathName; pathName = '/' + pathName;
}
return encodeURI('file://' + pathName);
} }
return encodeURI('file://' + pathName);
}
amdRequire.config({ amdRequire.config({
baseUrl: uriFromPath(path.join(__dirname, '../node_modules/monaco-editor/min')) baseUrl: uriFromPath(
}); path.join(__dirname, '../node_modules/monaco-editor/min')
)
});
// workaround monaco-css not understanding the environment // workaround monaco-css not understanding the environment
self.module = undefined; self.module = undefined;
amdRequire(['vs/editor/editor.main'], function() { amdRequire(['vs/editor/editor.main'], function () {
var editor = monaco.editor.create(document.getElementById('container'), { var editor = monaco.editor.create(
value: [ document.getElementById('container'),
'function x() {', {
'\tconsole.log("Hello world!");', value: [
'}' 'function x() {',
].join('\n'), '\tconsole.log("Hello world!");',
language: 'javascript' '}'
].join('\n'),
language: 'javascript'
}
);
}); });
}); })();
})();
</script> </script>
</html> </html>

@ -1,18 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Electron Sample</h2>
<h2>Monaco Editor Electron Sample</h2> To run this sample, you need to
<a href="https://github.com/electron/electron/releases"
>download Electron</a
>
and then execute:
To run this sample, you need to <a href="https://github.com/electron/electron/releases">download Electron</a> and then execute: <pre>
<pre>
$/electron-amd> electron main.js $/electron-amd> electron main.js
</pre> </pre
>
</body> </body>
</html> </html>

@ -1,6 +1,6 @@
const electron = require('electron') const electron = require('electron');
const app = electron.app const app = electron.app;
const BrowserWindow = electron.BrowserWindow const BrowserWindow = electron.BrowserWindow;
let mainWindow; let mainWindow;
@ -12,23 +12,23 @@ function createWindow() {
nodeIntegration: true nodeIntegration: true
} }
}); });
mainWindow.loadURL(`file://${__dirname}/electron-index.html`) mainWindow.loadURL(`file://${__dirname}/electron-index.html`);
mainWindow.webContents.openDevTools() mainWindow.webContents.openDevTools();
mainWindow.on('closed', function () { mainWindow.on('closed', function () {
mainWindow = null mainWindow = null;
}) });
} }
app.on('ready', createWindow) app.on('ready', createWindow);
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit() app.quit();
} }
}) });
app.on('activate', function () { app.on('activate', function () {
if (mainWindow === null) { if (mainWindow === null) {
createWindow() createWindow();
} }
}) });

File diff suppressed because it is too large Load Diff

@ -1,12 +1,12 @@
{ {
"name": "helloworld", "name": "helloworld",
"dependencies": {}, "dependencies": {},
"scripts": { "scripts": {
"execute": "electron ." "execute": "electron ."
}, },
"main": "./main", "main": "./main",
"devDependencies": { "devDependencies": {
"electron": "^9.1.2", "electron": "^9.1.2",
"monaco-editor": "0.20.0" "monaco-editor": "0.20.0"
} }
} }

@ -1,33 +1,32 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<meta charset="UTF-8" />
<title>Monaco Editor!</title>
</head>
<head> <body>
<meta charset="UTF-8"> <h1>Monaco Editor in Electron (without nodeIntegration)!</h1>
<title>Monaco Editor!</title> Note: Since Electron without nodeIntegration is very similar to a browser,
</head> you can have a look at all the other `browser-` samples, as they should work
just fine. <br /><br />
<div
id="container"
style="width: 500px; height: 300px; border: 1px solid #ccc"
></div>
</body>
<body> <script src="./node_modules/monaco-editor/min/vs/loader.js"></script>
<h1>Monaco Editor in Electron (without nodeIntegration)!</h1> <script>
Note: Since Electron without nodeIntegration is very similar to a browser, require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
you can have a look at all the other `browser-` samples, as they should work
just fine. <br /></br />
<div id="container" style="width:500px;height:300px;border:1px solid #ccc"></div>
</body>
<script src="./node_modules/monaco-editor/min/vs/loader.js"></script> require(['vs/editor/editor.main'], function () {
<script> var editor = monaco.editor.create(document.getElementById('container'), {
require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' } }); value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join(
'\n'
require(['vs/editor/editor.main'], function () { ),
var editor = monaco.editor.create(document.getElementById('container'), { language: 'javascript'
value: [ });
'function x() {',
'\tconsole.log("Hello world!");',
'}'
].join('\n'),
language: 'javascript'
}); });
}); </script>
</script>
</html> </html>

@ -1,18 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> </head>
<body> <body>
<h2>Monaco Editor Electron Sample</h2>
<h2>Monaco Editor Electron Sample</h2> To run this sample, you need to
<a href="https://github.com/electron/electron/releases"
>download Electron</a
>
and then execute:
To run this sample, you need to <a href="https://github.com/electron/electron/releases">download Electron</a> and then execute: <pre>
<pre>
$/electron-amd> electron main.js $/electron-amd> electron main.js
</pre> </pre
>
</body> </body>
</html> </html>

@ -1,28 +1,28 @@
const electron = require('electron') const electron = require('electron');
const app = electron.app const app = electron.app;
const BrowserWindow = electron.BrowserWindow const BrowserWindow = electron.BrowserWindow;
let mainWindow; let mainWindow;
function createWindow() { function createWindow() {
mainWindow = new BrowserWindow({ width: 800, height: 600 }) mainWindow = new BrowserWindow({ width: 800, height: 600 });
mainWindow.loadURL(`file://${__dirname}/electron-index.html`) mainWindow.loadURL(`file://${__dirname}/electron-index.html`);
mainWindow.webContents.openDevTools() mainWindow.webContents.openDevTools();
mainWindow.on('closed', function () { mainWindow.on('closed', function () {
mainWindow = null mainWindow = null;
}) });
} }
app.on('ready', createWindow) app.on('ready', createWindow);
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit() app.quit();
} }
}) });
app.on('activate', function () { app.on('activate', function () {
if (mainWindow === null) { if (mainWindow === null) {
createWindow() createWindow();
} }
}) });

File diff suppressed because it is too large Load Diff

@ -1,12 +1,12 @@
{ {
"name": "helloworld", "name": "helloworld",
"dependencies": {}, "dependencies": {},
"scripts": { "scripts": {
"execute": "electron ." "execute": "electron ."
}, },
"main": "./main", "main": "./main",
"devDependencies": { "devDependencies": {
"electron": "^9.1.2", "electron": "^9.1.2",
"monaco-editor": "0.20.0" "monaco-editor": "0.20.0"
} }
} }

@ -1,16 +1,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<title>Monaco Editor under nodewebkit</title> <title>Monaco Editor under nodewebkit</title>
<!--link rel="stylesheet" data-name="vs/editor/editor.main" href="/node_modules/monaco-editor/min/vs/editor/editor.main.css"--> <!--link rel="stylesheet" data-name="vs/editor/editor.main" href="/node_modules/monaco-editor/min/vs/editor/editor.main.css"-->
<!--link rel="stylesheet" type="text/css" href="/resources/css/flex-boxes.css"--> <!--link rel="stylesheet" type="text/css" href="/resources/css/flex-boxes.css"-->
<style type="text/css"> <style type="text/css">
body,#container{margin:0px;padding:0px;box-sizing:border-box;} body,
body{height:100vh;overflow:hidden;} #container {
#container{overflow:hidden;height:100vh;} margin: 0px;
.toolbox{ padding: 0px;
height:200px; box-sizing: border-box;
}
body {
height: 100vh;
overflow: hidden;
}
#container {
overflow: hidden;
height: 100vh;
}
.toolbox {
height: 200px;
} }
</style> </style>
</head> </head>
@ -25,25 +36,23 @@
</script--> </script-->
<!--script src="/node_modules/monaco-editor/min/vs/loader1.js"></script--> <!--script src="/node_modules/monaco-editor/min/vs/loader1.js"></script-->
<script> <script>
var ERequire = require("../../node_modules/monaco-editor/min/vs/loader.js"); var ERequire = require('../../node_modules/monaco-editor/min/vs/loader.js');
//__dirname == root path of you application //__dirname == root path of you application
ERequire.config({ ERequire.config({
baseUrl: "file:///"+__dirname+"/node_modules/monaco-editor/min/" baseUrl: 'file:///' + __dirname + '/node_modules/monaco-editor/min/'
}) });
// workaround monaco-css not understanding the environment // workaround monaco-css not understanding the environment
self.module = undefined; self.module = undefined;
// workaround monaco-typescript not understanding the environment // workaround monaco-typescript not understanding the environment
self.process.browser = true; self.process.browser = true;
ERequire(['vs/editor/editor.main'], function() { ERequire(['vs/editor/editor.main'], function () {
var editor = monaco.editor.create(document.getElementById('container'), { var editor = monaco.editor.create(document.getElementById('container'), {
value: [ value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join(
'function x() {', '\n'
'\tconsole.log("Hello world!");', ),
'}'
].join('\n'),
language: 'javascript', language: 'javascript',
theme: "vs-dark" theme: 'vs-dark'
}); });
}); });
</script> </script>

@ -1,12 +1,12 @@
{ {
"name": "helloworld", "name": "helloworld",
"requires": true, "requires": true,
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"monaco-editor": { "monaco-editor": {
"version": "0.19.0", "version": "0.19.0",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.19.0.tgz", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.19.0.tgz",
"integrity": "sha512-ida++HI/s9V8ma8yYS9CAS0UJEFwW1gbt9G6oviEdv/aHhFd/kV3sXrINqC63TVdKzOZdKjPRRCOPJJ80zvLbw==" "integrity": "sha512-ida++HI/s9V8ma8yYS9CAS0UJEFwW1gbt9G6oviEdv/aHhFd/kV3sXrINqC63TVdKzOZdKjPRRCOPJJ80zvLbw=="
} }
} }
} }

@ -1,7 +1,7 @@
{ {
"name": "helloworld", "name": "helloworld",
"main": "index.html", "main": "index.html",
"dependencies": { "dependencies": {
"monaco-editor": "0.19.0" "monaco-editor": "0.19.0"
} }
} }

@ -1,13 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<title>Hello World!</title> <title>Hello World!</title>
<link rel="stylesheet" data-name="vs/editor/editor.main" href="node_modules/monaco-editor/min/vs/editor/editor.main.css"> <link
rel="stylesheet"
data-name="vs/editor/editor.main"
href="node_modules/monaco-editor/min/vs/editor/editor.main.css"
/>
</head> </head>
<body> <body>
<h1>Hello World!</h1> <h1>Hello World!</h1>
<div id="container" style="width:500px;height:300px;border:1px solid #ccc"></div> <div
id="container"
style="width: 500px; height: 300px; border: 1px solid #ccc"
></div>
</body> </body>
<script> <script>
@ -34,13 +41,11 @@
// workaround monaco-typescript not understanding the environment // workaround monaco-typescript not understanding the environment
self.process.browser = true; self.process.browser = true;
amdRequire(['vs/editor/editor.main'], function() { amdRequire(['vs/editor/editor.main'], function () {
var editor = monaco.editor.create(document.getElementById('container'), { var editor = monaco.editor.create(document.getElementById('container'), {
value: [ value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join(
'function x() {', '\n'
'\tconsole.log("Hello world!");', ),
'}'
].join('\n'),
language: 'javascript' language: 'javascript'
}); });
}); });

@ -1,12 +1,12 @@
{ {
"name": "helloworld", "name": "helloworld",
"requires": true, "requires": true,
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"monaco-editor": { "monaco-editor": {
"version": "0.19.0", "version": "0.19.0",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.19.0.tgz", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.19.0.tgz",
"integrity": "sha512-ida++HI/s9V8ma8yYS9CAS0UJEFwW1gbt9G6oviEdv/aHhFd/kV3sXrINqC63TVdKzOZdKjPRRCOPJJ80zvLbw==" "integrity": "sha512-ida++HI/s9V8ma8yYS9CAS0UJEFwW1gbt9G6oviEdv/aHhFd/kV3sXrINqC63TVdKzOZdKjPRRCOPJJ80zvLbw=="
} }
} }
} }

@ -1,7 +1,7 @@
{ {
"name": "helloworld", "name": "helloworld",
"main": "index.html", "main": "index.html",
"dependencies": { "dependencies": {
"monaco-editor": "0.19.0" "monaco-editor": "0.19.0"
} }
} }

688
package-lock.json generated

@ -1,18 +1,674 @@
{ {
"name": "monaco-editor-samples", "name": "monaco-editor-samples",
"version": "0.0.1", "version": "0.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"monaco-editor": { "@babel/code-frame": {
"version": "0.19.3", "version": "7.10.4",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.19.3.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
"integrity": "sha512-2n1vJBVQF2Hhi7+r1mMeYsmlf18hjVb6E0v5SoMZyb4aeOmYPKun+CE3gYpiNA1KEvtSdaDHFBqH9d7Wd9vREg==" "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
}, "dev": true,
"yaserver": { "requires": {
"version": "0.2.0", "@babel/highlight": "^7.10.4"
"resolved": "https://registry.npmjs.org/yaserver/-/yaserver-0.2.0.tgz", }
"integrity": "sha512-onsELrl7Y42M4P3T9R0N/ZJNJRu4cGwzhDyOWIFRMJvPUIrGKInYGh+DJBefrbr1qoyDu7DSCLl9BL5hSSVfDA==" },
} "@babel/helper-validator-identifier": {
} "version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
"integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==",
"dev": true
},
"@babel/highlight": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
"integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
"dev": true
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"dev": true
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"array-differ": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz",
"integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==",
"dev": true
},
"array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
"arrify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
"integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
"dev": true
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"ci-info": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
"integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
"dev": true
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"compare-versions": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz",
"integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"cosmiconfig": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",
"integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",
"dev": true,
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.1.0",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.7.2"
}
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"requires": {
"once": "^1.4.0"
}
},
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"requires": {
"is-arrayish": "^0.2.1"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"execa": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz",
"integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.0",
"get-stream": "^5.0.0",
"human-signals": "^1.1.1",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.0",
"onetime": "^5.1.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
}
},
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"find-versions": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz",
"integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==",
"dev": true,
"requires": {
"semver-regex": "^2.0.0"
}
},
"get-stream": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
"dev": true,
"requires": {
"pump": "^3.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"human-signals": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
"integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==",
"dev": true
},
"husky": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz",
"integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"ci-info": "^2.0.0",
"compare-versions": "^3.6.0",
"cosmiconfig": "^6.0.0",
"find-versions": "^3.2.0",
"opencollective-postinstall": "^2.0.2",
"pkg-dir": "^4.2.0",
"please-upgrade-node": "^3.2.0",
"slash": "^3.0.0",
"which-pm-runs": "^1.0.0"
}
},
"ignore": {
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
"import-fresh": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
"integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
"dev": true,
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
"dev": true
},
"is-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
"dev": true
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"json-parse-even-better-errors": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz",
"integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==",
"dev": true
},
"lines-and-columns": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
"dev": true
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true
},
"mimic-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"monaco-editor": {
"version": "0.19.3",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.19.3.tgz",
"integrity": "sha512-2n1vJBVQF2Hhi7+r1mMeYsmlf18hjVb6E0v5SoMZyb4aeOmYPKun+CE3gYpiNA1KEvtSdaDHFBqH9d7Wd9vREg=="
},
"mri": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
"integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==",
"dev": true
},
"multimatch": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz",
"integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==",
"dev": true,
"requires": {
"@types/minimatch": "^3.0.3",
"array-differ": "^3.0.0",
"array-union": "^2.1.0",
"arrify": "^2.0.1",
"minimatch": "^3.0.4"
}
},
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"requires": {
"path-key": "^3.0.0"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"onetime": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
"dev": true,
"requires": {
"mimic-fn": "^2.1.0"
}
},
"opencollective-postinstall": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz",
"integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==",
"dev": true
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
},
"p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"requires": {
"callsites": "^3.0.0"
}
},
"parse-json": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
"integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
}
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
},
"pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"dev": true,
"requires": {
"find-up": "^4.0.0"
}
},
"please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
"integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
"dev": true,
"requires": {
"semver-compare": "^1.0.0"
}
},
"prettier": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz",
"integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==",
"dev": true
},
"pretty-quick": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.0.0.tgz",
"integrity": "sha512-oIXlGQUcUxt3XpoNfQECEWvH1Q9PtKfelF2pdp6UvC1CSQ5QcB7gUYKu0kuJGlm3LMBZzJaO/vbRkxA61pWlcg==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
"execa": "^4.0.0",
"find-up": "^4.1.0",
"ignore": "^5.1.4",
"mri": "^1.1.5",
"multimatch": "^4.0.0"
},
"dependencies": {
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
}
}
},
"pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
"semver-compare": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
"dev": true
},
"semver-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz",
"integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==",
"dev": true
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
"dev": true
},
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"strip-final-newline": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
},
"which-pm-runs": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
"integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=",
"dev": true
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"yaml": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz",
"integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==",
"dev": true
},
"yaserver": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/yaserver/-/yaserver-0.2.0.tgz",
"integrity": "sha512-onsELrl7Y42M4P3T9R0N/ZJNJRu4cGwzhDyOWIFRMJvPUIrGKInYGh+DJBefrbr1qoyDu7DSCLl9BL5hSSVfDA=="
}
}
} }

@ -1,15 +1,25 @@
{ {
"name": "monaco-editor-samples", "name": "monaco-editor-samples",
"version": "0.0.1", "version": "0.0.1",
"description": "Samples for using the Monaco Editor", "description": "Samples for using the Monaco Editor",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"simpleserver": "yaserver --root ./ --port 8888" "simpleserver": "yaserver --root ./ --port 8888"
}, },
"author": "Microsoft Corporation", "author": "Microsoft Corporation",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"monaco-editor": "^0.19.3", "monaco-editor": "^0.19.3",
"yaserver": "^0.2.0" "yaserver": "^0.2.0"
} },
"devDependencies": {
"husky": "^4.2.5",
"prettier": "^2.1.1",
"pretty-quick": "^3.0.0"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
} }

Loading…
Cancel
Save