diff --git a/.gitignore b/.gitignore index a7ff9346eee..1489d6c0a99 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ Thumbs.db # Files that can be automatically downloaded that we don't want to ship with our builds /src/extensibility/node/node_modules/request/tests/ +# Ignore modules downloaded from npm +/src/thirdparty/CodeMirror + diff --git a/.gitmodules b/.gitmodules index 99f7ae246b7..403668b6862 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "src/thirdparty/CodeMirror"] - path = src/thirdparty/CodeMirror - url = https://github.com/adobe/CodeMirror2.git [submodule "src/thirdparty/path-utils"] path = src/thirdparty/path-utils url = https://github.com/jblas/path-utils.git diff --git a/Gruntfile.js b/Gruntfile.js index 62278c7110e..7869b66b944 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -323,7 +323,7 @@ module.exports = function (grunt) { }); // task: install - grunt.registerTask('install', ['write-config', 'less', 'npm-install-extensions']); + grunt.registerTask('install', ['write-config', 'less', 'copy-browser-dependencies', 'npm-install-extensions']); // task: test grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 23f1f90405c..1e9f2ed22c3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "Brackets", - "version": "1.8.0-0", + "version": "1.9.0-0", "dependencies": { "anymatch": { "version": "1.3.0", @@ -38,9 +38,9 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, "binary-extensions": { - "version": "1.5.0", + "version": "1.7.0", "from": "binary-extensions@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.5.0.tgz" + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.7.0.tgz" }, "brace-expansion": { "version": "1.1.6", @@ -62,6 +62,11 @@ "from": "chokidar@1.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" }, + "codemirror": { + "version": "5.21.0", + "from": "codemirror@5.21.0", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.21.0.tgz" + }, "concat-map": { "version": "0.0.1", "from": "concat-map@0.0.1", @@ -98,13 +103,13 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" }, "for-in": { - "version": "0.1.5", + "version": "0.1.6", "from": "for-in@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz" + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.6.tgz" }, "for-own": { "version": "0.1.4", - "from": "for-own@>=0.1.3 <0.2.0", + "from": "for-own@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" }, "glob-base": { @@ -118,14 +123,14 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" }, "graceful-fs": { - "version": "4.1.6", + "version": "4.1.11", "from": "graceful-fs@>=4.1.2 <5.0.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" }, "inherits": { - "version": "2.0.1", + "version": "2.0.3", "from": "inherits@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" }, "is-binary-path": { "version": "1.0.1", @@ -213,9 +218,9 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz" }, "object.omit": { - "version": "2.0.0", + "version": "2.0.1", "from": "object.omit@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz" + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" }, "parse-glob": { "version": "3.0.4", @@ -223,9 +228,9 @@ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" }, "path-is-absolute": { - "version": "1.0.0", + "version": "1.0.1", "from": "path-is-absolute@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" }, "preserve": { "version": "0.2.0", @@ -243,9 +248,9 @@ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz" }, "readable-stream": { - "version": "2.1.5", + "version": "2.2.2", "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz" + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" }, "readdirp": { "version": "2.1.0", @@ -263,9 +268,9 @@ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" }, "repeat-string": { - "version": "1.5.4", + "version": "1.6.1", "from": "repeat-string@>=1.5.2 <2.0.0", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, "set-immediate-shim": { "version": "1.0.1", diff --git a/package.json b/package.json index 9e18985fdef..57f47c50164 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ "dependencies": { "anymatch": "1.3.0", "chokidar": "1.6.0", + "codemirror": "5.21.0", "lodash": "4.15.0" }, "devDependencies": { + "fs-extra": "1.0.0", "glob": "7.0.6", "grunt": "0.4.5", "jasmine-node": "1.11.0", diff --git a/src/config.json b/src/config.json index 08735af05a2..1853c9edfb6 100644 --- a/src/config.json +++ b/src/config.json @@ -38,9 +38,11 @@ "dependencies": { "anymatch": "1.3.0", "chokidar": "1.6.0", + "codemirror": "5.21.0", "lodash": "4.15.0" }, "devDependencies": { + "fs-extra": "1.0.0", "glob": "7.0.6", "grunt": "0.4.5", "jasmine-node": "1.11.0", diff --git a/src/thirdparty/CodeMirror b/src/thirdparty/CodeMirror deleted file mode 160000 index 40210a5aa08..00000000000 --- a/src/thirdparty/CodeMirror +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 40210a5aa08cbb81b3b6646da5509fb20be4a258 diff --git a/tasks/move-browser-dependencies.js b/tasks/move-browser-dependencies.js new file mode 100644 index 00000000000..d54a37b1032 --- /dev/null +++ b/tasks/move-browser-dependencies.js @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2016 - present Adobe Systems Incorporated. All rights reserved. + * + * 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. + * + */ + +/* eslint-env node */ +"use strict"; + +module.exports = function (grunt) { + + var _ = require("lodash"), + path = require("path"), + fs = require("fs-extra"); + + grunt.registerTask( + "copy-browser-dependencies", + "Moves dependencies installed through npm into src/thirdparty folder so they can be accessed from browser", + function () { + var toCopy = [ + { + from: "../node_modules/codemirror", + to: "../src/thirdparty/CodeMirror" + } + ]; + var done = this.async(); + var afterMove = _.after(toCopy.length, done); + toCopy.forEach(function (obj) { + fs.copy(path.resolve(__dirname, obj.from), path.resolve(__dirname, obj.to), function (err) { + if (err) { + grunt.log.error(err); + done(false); + return; + } + afterMove(); + }); + }); + }); + +};