Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

CodeMirror update #12940

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast note: the script is referenced here as copy-browser-dependencies but is actually named move-browser-dependencies.


// task: test
grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']);
Expand Down
41 changes: 23 additions & 18 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/thirdparty/CodeMirror
Submodule CodeMirror deleted from 40210a
57 changes: 57 additions & 0 deletions tasks/move-browser-dependencies.js
Original file line number Diff line number Diff line change
@@ -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();
});
});
});

};