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

Commit f7d4e35

Browse files
authored
Merge pull request #12972 from ficristo/npm-src
Move npm dependencies inside src and add CodeMirror to them
2 parents 973cf51 + 30fdf93 commit f7d4e35

File tree

12 files changed

+88
-57
lines changed

12 files changed

+88
-57
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Thumbs.db
77
/node_modules
88
/npm-debug.log
99

10+
# ignore node_modules inside src
11+
/src/node_modules
12+
1013
# ignore compiled files
1114
/dist
1215
/src/.index.html

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "src/thirdparty/CodeMirror"]
2-
path = src/thirdparty/CodeMirror
3-
url = https://github.com/adobe/CodeMirror2.git
41
[submodule "src/thirdparty/path-utils"]
52
path = src/thirdparty/path-utils
63
url = https://github.com/jblas/path-utils.git

Gruntfile.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ module.exports = function (grunt) {
6565
cwd: 'src/',
6666
src: [
6767
'nls/{,*/}*.js',
68+
'package.json',
69+
'npm-shrinkwrap.json',
6870
'xorigin.js',
6971
'dependencies.js',
7072
'thirdparty/requirejs/require.js',
@@ -278,11 +280,6 @@ module.exports = function (grunt) {
278280
vendor : [
279281
'test/polyfills.js', /* For reference to why this polyfill is needed see Issue #7951. The need for this should go away once the version of phantomjs gets upgraded to 2.0 */
280282
'src/thirdparty/jquery-2.1.3.min.js',
281-
'src/thirdparty/CodeMirror/lib/codemirror.js',
282-
'src/thirdparty/CodeMirror/lib/util/dialog.js',
283-
'src/thirdparty/CodeMirror/lib/util/searchcursor.js',
284-
'src/thirdparty/CodeMirror/addon/edit/closetag.js',
285-
'src/thirdparty/CodeMirror/addon/selection/active-line.js',
286283
'src/thirdparty/less-2.5.1.min.js'
287284
],
288285
helpers : [
@@ -298,7 +295,19 @@ module.exports = function (grunt) {
298295
'spec' : '../test/spec',
299296
'text' : 'thirdparty/text/text',
300297
'i18n' : 'thirdparty/i18n/i18n'
301-
}
298+
},
299+
map: {
300+
"*": {
301+
"thirdparty/CodeMirror2": "thirdparty/CodeMirror"
302+
}
303+
},
304+
packages: [
305+
{
306+
name: "thirdparty/CodeMirror",
307+
location: "node_modules/codemirror",
308+
main: "lib/codemirror"
309+
}
310+
]
302311
}
303312
}
304313
}
@@ -323,7 +332,7 @@ module.exports = function (grunt) {
323332
});
324333

325334
// task: install
326-
grunt.registerTask('install', ['write-config', 'less', 'npm-install-extensions']);
335+
grunt.registerTask('install', ['write-config', 'less', 'npm-install-source']);
327336

328337
// task: test
329338
grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']);

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
"branch": "",
1313
"SHA": ""
1414
},
15-
"dependencies": {
16-
"anymatch": "1.3.0",
17-
"chokidar": "1.6.0",
18-
"lodash": "4.15.0"
19-
},
2015
"devDependencies": {
2116
"glob": "7.0.6",
2217
"grunt": "0.4.5",

src/config.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
"branch": "",
3636
"SHA": ""
3737
},
38-
"dependencies": {
39-
"anymatch": "1.3.0",
40-
"chokidar": "1.6.0",
41-
"lodash": "4.15.0"
42-
},
4338
"devDependencies": {
4439
"glob": "7.0.6",
4540
"grunt": "0.4.5",

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<!-- Warn about failed cross origin requests in Chrome -->
3535
<script type="application/javascript" src="xorigin.js"></script>
3636

37-
<link rel="stylesheet" type="text/css" href="thirdparty/CodeMirror/lib/codemirror.css">
37+
<link rel="stylesheet" type="text/css" href="node_modules/codemirror/lib/codemirror.css">
3838
<!--(if target dev)><!-->
3939
<link rel="stylesheet/less" type="text/css" href="styles/brackets.less">
4040
<!--<!(endif)-->

src/main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ require.config({
3838
map: {
3939
"*": {
4040
"thirdparty/CodeMirror2": "thirdparty/CodeMirror",
41-
"thirdparty/react": "react"
41+
"thirdparty/react": "react"
4242
}
43-
}
43+
},
44+
packages: [
45+
{
46+
name: "thirdparty/CodeMirror",
47+
location: "node_modules/codemirror",
48+
main: "lib/codemirror"
49+
}
50+
]
4451
});
4552

4653
if (window.location.search.indexOf("testEnvironment") > -1) {

npm-shrinkwrap.json renamed to src/npm-shrinkwrap.json

Lines changed: 27 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "brackets-src",
3+
"dependencies": {
4+
"anymatch": "1.3.0",
5+
"chokidar": "1.6.0",
6+
"codemirror": "5.21.0",
7+
"lodash": "4.15.0"
8+
}
9+
}

src/thirdparty/CodeMirror

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)