diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..79b9535b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/node_modules/
+/release/
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..d97f6026
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,4 @@
+// Place your settings in this file to overwrite default and user settings.
+{
+ "files.trimTrailingWhitespace": true
+}
\ No newline at end of file
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 00000000..c03a33a5
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Microsoft Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index dfce96f9..ea36c58a 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,123 @@
-# monaco-editor
-A browser based code editor
+# Monaco Editor
+
+The Monaco Editor is the code editor that powers [VS Code](https://github.com/Microsoft/vscode), a good page describing the code editor's features is [here](https://code.visualstudio.com/docs/editor/editingevolved).
+
+![image](https://cloud.githubusercontent.com/assets/5047891/15751937/4267b918-28ec-11e6-9fbd-d6cd2973c770.png)
+
+## Issues
+
+This repository contains only the scripts to glue things together, please create issues against the actual repositories where the source code lives:
+ * monaco-editor-core: [Issues](https://github.com/Microsoft/vscode) -- [npm module](https://www.npmjs.com/package/monaco-editor-core) (Issues with the editor itself)
+ * monaco-typescript: [Issues](https://github.com/Microsoft/monaco-typescript) -- [npm module](https://www.npmjs.com/package/monaco-typescript) (Issues with JavaScript or TypeScript language support)
+ * monaco-languages: [Issues](https://github.com/Microsoft/monaco-languages) -- [npm module](https://www.npmjs.com/package/monaco-languages) (Issues with bat, coffee script, cpp, csharp, fsharp, go, ini, jade, lua, objective-c, powershell, python, r, ruby, sql, swift, vb or xml)
+
+## Known issues
+In IE, the editor must be completely surrounded in the body element, otherwise the hit testing we do for mouse operations does not work. You can inspect this using F12 and clicking on the body element and confirm that visually it surrounds the editor.
+
+## Installing
+
+```
+npm install monaco-editor
+```
+
+You will get:
+* inside `dev`: bundled, not minified
+* inside `min`: bundled, and minified
+* inside `min-maps`: source maps for `min`
+* `monaco.d.ts`: this specifies the API of the editor (this is what is actually versioned, everything else is considered private and might break with any release).
+
+It is recommended to develop against the `dev` version, and in production to use the `min` version.
+
+## Integrate
+
+Here is the most basic HTML page that embeds the editor. More samples are available at [monaco-editor-samples](https://github.com/Microsoft/monaco-editor-samples).
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Integrate cross domain
+
+If you are hosting your `.js` on a different domain (e.g. on a CDN) than the HTML, you should know that the Monaco Editor creates web workers for smart language features. Cross-domain web workers are not allowed, but here is how you can proxy their loading and get them to work:
+
+```html
+
+
+
+
+
+```
+
+## FAQ
+
+* Q: What is the relationship between VS Code and the Monaco Editor?
+* A: The Monaco Editor is generated straight from VS Code's sources with some shims around services the code needs to make it run in a web browser outside of its home.
+
+
+* Q: What is the relationship between VS Code's version and the Monaco Editor's version?
+* A: None. The Monaco Editor is a library and it reflects directly the source code.
+
+
+* Q: I've written an extension for VS Code, will it work on the Monaco Editor in a browser?
+* A: No.
+
+
+* Q: Why all these web workers and why should I care?
+* A: Language services create web workers to compute heavy stuff outside the UI thread. They cost hardly anything in terms of resource overhead and you shouldn't worry too much about them, as long as you get them to work (see above the cross-domain case).
+
+
+* Q: What is this `loader.js`? Can I use `require.js`?
+* A: It is an AMD loader that we use in VS Code. Yes.
+
+## License
+[MIT](https://github.com/Microsoft/monaco-editor/blob/master/LICENSE.md)
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 00000000..ea704f0f
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,129 @@
+
+var gulp = require('gulp');
+var metadata = require('./metadata');
+var es = require('event-stream');
+var path = require('path');
+var fs = require('fs');
+var rimraf = require('rimraf');
+
+gulp.task('clean-release', function(cb) { rimraf('release', { maxBusyTries: 1 }, cb); });
+gulp.task('release', ['clean-release'], function() {
+ return es.merge(
+
+ // dev folder
+ releaseOne('dev'),
+
+ // min folder
+ releaseOne('min'),
+
+ // package.json
+ gulp.src('package.json')
+ .pipe(es.through(function(data) {
+ var json = JSON.parse(data.contents.toString());
+ json.private = false;
+ data.contents = new Buffer(JSON.stringify(json, null, ' '));
+ this.emit('data', data);
+ }))
+ .pipe(gulp.dest('release')),
+
+ // min-maps folder
+ gulp.src('node_modules/monaco-editor-core/min-maps/**/*').pipe(gulp.dest('release/min-maps')),
+
+ // other files
+ gulp.src([
+ 'node_modules/monaco-editor-core/LICENSE',
+ 'node_modules/monaco-editor-core/monaco.d.ts',
+ 'node_modules/monaco-editor-core/ThirdPartyNotices.txt',
+ 'README.md'
+ ]).pipe(gulp.dest('release'))
+ )
+});
+
+function releaseOne(type) {
+ return es.merge(
+ gulp.src('node_modules/monaco-editor-core/' + type + '/**/*')
+ .pipe(addPluginContribs())
+ .pipe(gulp.dest('release/' + type)),
+ pluginStreams('release/' + type + '/')
+ )
+}
+
+function mergePluginsContribsIntoCore(coreStream) {
+ return (
+ coreStream
+ .pipe(addPluginContribs())
+ );
+}
+
+function pluginStreams(destinationPath) {
+ return es.merge(
+ metadata.METADATA.PLUGINS.map(function(plugin) {
+ return pluginStream(plugin, destinationPath);
+ })
+ );
+}
+
+function pluginStream(plugin, destinationPath) {
+ var contribPath = path.join(plugin.path, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
+ return (
+ gulp.src([
+ plugin.path + '/**/*',
+ '!' + contribPath
+ ])
+ .pipe(gulp.dest(destinationPath + plugin.modulePrefix))
+ );
+}
+
+/**
+ * Edit editor.main.js:
+ * - rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
+ * - append contribs from plugins
+ * - append new AMD module 'vs/editor/editor.main' that stiches things together
+ */
+function addPluginContribs() {
+ return es.through(function(data) {
+ if (!/editor\.main\.js$/.test(data.path)) {
+ this.emit('data', data);
+ return;
+ }
+ var contents = data.contents.toString();
+
+ // Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
+ contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"');
+
+ var extraContent = [];
+ var allPluginsModuleIds = [];
+
+ metadata.METADATA.PLUGINS.forEach(function(plugin) {
+ allPluginsModuleIds.push(plugin.contrib);
+ var contribPath = path.join(__dirname, plugin.path, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
+ var contribContents = fs.readFileSync(contribPath).toString();
+
+ var contribDefineIndex = contribContents.indexOf('define("' + plugin.contrib);
+ if (contribDefineIndex === -1) {
+ console.error('(1) CANNOT DETERMINE AMD define location for contribution', plugin);
+ process.exit(-1);
+ }
+
+ var depsEndIndex = contribContents.indexOf(']', contribDefineIndex);
+ if (contribDefineIndex === -1) {
+ console.error('(2) CANNOT DETERMINE AMD define location for contribution', plugin);
+ process.exit(-1);
+ }
+
+ contribContents = contribContents.substring(0, depsEndIndex) + ',"vs/editor/edcore.main"' + contribContents.substring(depsEndIndex);
+
+ extraContent.push(contribContents);
+ });
+
+ extraContent.push(`define("vs/editor/editor.main", ["vs/editor/edcore.main","${allPluginsModuleIds.join('","')}"], function() {});`);
+ var insertIndex = contents.lastIndexOf('//# sourceMappingURL=');
+ if (insertIndex === -1) {
+ insertIndex = contents.length;
+ }
+ contents = contents.substring(0, insertIndex) + '\n' + extraContent.join('\n') + '\n' + contents.substring(insertIndex);
+
+ data.contents = new Buffer(contents);
+ this.emit('data', data);
+ });
+}
diff --git a/metadata.js b/metadata.js
new file mode 100644
index 00000000..7b0cb5ab
--- /dev/null
+++ b/metadata.js
@@ -0,0 +1,30 @@
+(function() {
+
+ var METADATA = {
+ CORE: {
+ path: 'node_modules/monaco-editor-core/min/vs',
+ srcPath: '/vscode/out/vs'
+ // srcPath: '/vscode/out-monaco-editor-core/min/vs'
+ },
+ PLUGINS: [{
+ name: 'monaco-typescript',
+ contrib: 'vs/language/typescript/src/monaco.contribution',
+ modulePrefix: 'vs/language/typescript',
+ path: 'node_modules/monaco-typescript/release',
+ srcPath: '/monaco-typescript/out'
+ }, {
+ name: 'monaco-languages',
+ contrib: 'vs/basic-languages/src/monaco.contribution',
+ modulePrefix: 'vs/basic-languages',
+ path: 'node_modules/monaco-languages/release',
+ srcPath: '/monaco-languages/out'
+ }]
+ }
+
+ if (typeof exports !== 'undefined') {
+ exports.METADATA = METADATA
+ } else {
+ self.METADATA = METADATA;
+ }
+
+})();
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..bf9d806c
--- /dev/null
+++ b/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "monaco-editor",
+ "private": true,
+ "version": "0.2.4",
+ "description": "A browser based code editor",
+ "author": "Microsoft Corporation",
+ "license": "MIT",
+ "scripts": {
+ "simpleserver": "node_modules/.bin/http-server -c-1 ../",
+ "release": "node_modules/.bin/gulp release"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Microsoft/monaco-editor"
+ },
+ "devDependencies": {
+ "event-stream": "^3.3.2",
+ "gulp": "^3.9.1",
+ "http-server": "^0.9.0",
+ "monaco-editor-core": "0.3.1",
+ "monaco-languages": "0.1.1",
+ "monaco-typescript": "0.1.1",
+ "rimraf": "^2.5.2"
+ }
+}
diff --git a/test/index-release.html b/test/index-release.html
new file mode 100644
index 00000000..53e6b990
--- /dev/null
+++ b/test/index-release.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+