Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
664db15a
Commit
664db15a
authored
Jul 18, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ide' of gitlab.com:gitlab-org/gitlab-ce into ide
parents
8cceeb8b
6a1fadae
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
18 deletions
+60
-18
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+0
-0
app/assets/javascripts/repo/monaco_loader.js
app/assets/javascripts/repo/monaco_loader.js
+13
-0
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+3
-3
app/helpers/javascript_helper.rb
app/helpers/javascript_helper.rb
+0
-6
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+0
-2
app/views/projects/blob/show.html.haml
app/views/projects/blob/show.html.haml
+3
-1
app/views/projects/tree/show.html.haml
app/views/projects/tree/show.html.haml
+5
-0
config/webpack.config.js
config/webpack.config.js
+27
-5
package.json
package.json
+2
-1
yarn.lock
yarn.lock
+7
-0
No files found.
app/assets/javascripts/repo/
repo_bundle
.js
→
app/assets/javascripts/repo/
index
.js
View file @
664db15a
File moved
app/assets/javascripts/repo/monaco_loader.js
0 → 100644
View file @
664db15a
/* eslint-disable no-underscore-dangle, camelcase */
/* global __webpack_public_path__ */
import
monacoContext
from
'
monaco-editor/dev/vs/loader
'
;
monacoContext
.
require
.
config
({
paths
:
{
vs
:
`
${
__webpack_public_path__
}
monaco-editor/vs`
,
},
});
window
.
__monaco_context__
=
monacoContext
;
export
default
monacoContext
.
require
;
app/assets/javascripts/repo/repo_editor.js
View file @
664db15a
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
;
import
Store
from
'
./repo_store
'
;
import
Helper
from
'
./repo_helper
'
;
import
Helper
from
'
./repo_helper
'
;
import
monacoLoader
from
'
./monaco_loader
'
;
export
default
class
RepoEditor
{
export
default
class
RepoEditor
{
constructor
()
{
constructor
()
{
...
@@ -19,8 +20,7 @@ export default class RepoEditor {
...
@@ -19,8 +20,7 @@ export default class RepoEditor {
}
}
initMonaco
()
{
initMonaco
()
{
window
.
require
.
config
({
paths
:
{
vs
:
'
/assets/webpack/vs
'
}
});
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
window
.
require
([
'
vs/editor/editor.main
'
],
()
=>
{
this
.
monacoEditor
=
monaco
.
editor
this
.
monacoEditor
=
monaco
.
editor
.
create
(
.
create
(
document
.
getElementById
(
'
ide
'
),
{
document
.
getElementById
(
'
ide
'
),
{
...
@@ -115,7 +115,7 @@ export default class RepoEditor {
...
@@ -115,7 +115,7 @@ export default class RepoEditor {
Helper
Helper
.
getLanguageForFile
(
.
getLanguageForFile
(
this
.
activeFile
,
this
.
activeFile
,
monaco
.
languages
.
getLanguages
()
monaco
.
languages
.
getLanguages
()
,
),
),
),
),
);
);
...
...
app/helpers/javascript_helper.rb
View file @
664db15a
...
@@ -7,10 +7,4 @@ module JavascriptHelper
...
@@ -7,10 +7,4 @@ module JavascriptHelper
def
page_specific_javascript_bundle_tag
(
bundle
)
def
page_specific_javascript_bundle_tag
(
bundle
)
webpack_bundle_tag
(
bundle
)
webpack_bundle_tag
(
bundle
)
end
end
def
repo_bundle_tags
return
unless
body_data_page
=~
/projects\:(tree|blob)\:show/
javascript_include_tag
(
'/assets/webpack/vs/loader'
)
+
webpack_bundle_tag
(
'repo'
)
end
end
end
app/views/layouts/_head.html.haml
View file @
664db15a
...
@@ -40,8 +40,6 @@
...
@@ -40,8 +40,6 @@
=
webpack_bundle_tag
"test"
if
Rails
.
env
.
test?
=
webpack_bundle_tag
"test"
if
Rails
.
env
.
test?
=
webpack_bundle_tag
'peek'
if
peek_enabled?
=
webpack_bundle_tag
'peek'
if
peek_enabled?
=
repo_bundle_tags
-
if
content_for?
(
:page_specific_javascripts
)
-
if
content_for?
(
:page_specific_javascripts
)
=
yield
:page_specific_javascripts
=
yield
:page_specific_javascripts
...
...
app/views/projects/blob/show.html.haml
View file @
664db15a
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
=
render
"projects/commits/head"
=
render
"projects/commits/head"
-
content_for
:page_specific_javascripts
do
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_bundle_tag
(
'blob'
)
=
webpack_bundle_tag
'blob'
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'repo'
=
render
'projects/last_push'
=
render
'projects/last_push'
...
...
app/views/projects/tree/show.html.haml
View file @
664db15a
...
@@ -3,6 +3,11 @@
...
@@ -3,6 +3,11 @@
-
page_title
@path
.
presence
||
_
(
"Files"
),
@ref
-
page_title
@path
.
presence
||
_
(
"Files"
),
@ref
=
content_for
:meta_tags
do
=
content_for
:meta_tags
do
=
auto_discovery_link_tag
(
:atom
,
namespace_project_commits_url
(
@project
.
namespace
,
@project
,
@ref
,
rss_url_options
),
title:
"
#{
@project
.
name
}
:
#{
@ref
}
commits"
)
=
auto_discovery_link_tag
(
:atom
,
namespace_project_commits_url
(
@project
.
namespace
,
@project
,
@ref
,
rss_url_options
),
title:
"
#{
@project
.
name
}
:
#{
@ref
}
commits"
)
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'repo'
=
render
"projects/commits/head"
=
render
"projects/commits/head"
=
render
'projects/last_push'
=
render
'projects/last_push'
...
...
config/webpack.config.js
View file @
664db15a
...
@@ -4,11 +4,11 @@ var fs = require('fs');
...
@@ -4,11 +4,11 @@ var fs = require('fs');
var
path
=
require
(
'
path
'
);
var
path
=
require
(
'
path
'
);
var
webpack
=
require
(
'
webpack
'
);
var
webpack
=
require
(
'
webpack
'
);
var
StatsPlugin
=
require
(
'
stats-webpack-plugin
'
);
var
StatsPlugin
=
require
(
'
stats-webpack-plugin
'
);
var
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
);
var
CompressionPlugin
=
require
(
'
compression-webpack-plugin
'
);
var
CompressionPlugin
=
require
(
'
compression-webpack-plugin
'
);
var
NameAllModulesPlugin
=
require
(
'
name-all-modules-plugin
'
);
var
NameAllModulesPlugin
=
require
(
'
name-all-modules-plugin
'
);
var
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
;
var
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
;
var
WatchMissingNodeModulesPlugin
=
require
(
'
react-dev-utils/WatchMissingNodeModulesPlugin
'
);
var
WatchMissingNodeModulesPlugin
=
require
(
'
react-dev-utils/WatchMissingNodeModulesPlugin
'
);
var
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
);
var
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
..
'
);
var
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
..
'
);
var
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'
production
'
;
var
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'
production
'
;
...
@@ -58,7 +58,7 @@ var config = {
...
@@ -58,7 +58,7 @@ var config = {
profile
:
'
./profile/profile_bundle.js
'
,
profile
:
'
./profile/profile_bundle.js
'
,
protected_branches
:
'
./protected_branches/protected_branches_bundle.js
'
,
protected_branches
:
'
./protected_branches/protected_branches_bundle.js
'
,
protected_tags
:
'
./protected_tags
'
,
protected_tags
:
'
./protected_tags
'
,
repo
:
'
./repo/
repo_bundle
'
,
repo
:
'
./repo/
index.js
'
,
sidebar
:
'
./sidebar/sidebar_bundle.js
'
,
sidebar
:
'
./sidebar/sidebar_bundle.js
'
,
schedule_form
:
'
./pipeline_schedules/pipeline_schedule_form_bundle.js
'
,
schedule_form
:
'
./pipeline_schedules/pipeline_schedule_form_bundle.js
'
,
schedules_index
:
'
./pipeline_schedules/pipeline_schedules_index_bundle.js
'
,
schedules_index
:
'
./pipeline_schedules/pipeline_schedules_index_bundle.js
'
,
...
@@ -110,7 +110,16 @@ var config = {
...
@@ -110,7 +110,16 @@ var config = {
test
:
/locale
\/\w
+
\/(
.*
)\.
js$/
,
test
:
/locale
\/\w
+
\/(
.*
)\.
js$/
,
loader
:
'
exports-loader?locales
'
,
loader
:
'
exports-loader?locales
'
,
},
},
]
{
test
:
/monaco-editor
\/\w
+
\/
vs
\/
loader
\.
js$/
,
use
:
[
{
loader
:
'
exports-loader
'
,
options
:
'
l.global
'
},
{
loader
:
'
imports-loader
'
,
options
:
'
l=>{},this=>l,AMDLoader=>this,module=>undefined
'
},
],
}
],
noParse
:
[
/monaco-editor
\/\w
+
\/
vs
\/
/
],
},
},
plugins
:
[
plugins
:
[
...
@@ -168,6 +177,7 @@ var config = {
...
@@ -168,6 +177,7 @@ var config = {
'
pdf_viewer
'
,
'
pdf_viewer
'
,
'
pipelines
'
,
'
pipelines
'
,
'
pipelines_details
'
,
'
pipelines_details
'
,
'
repo
'
,
'
schedule_form
'
,
'
schedule_form
'
,
'
schedules_index
'
,
'
schedules_index
'
,
'
sidebar
'
,
'
sidebar
'
,
...
@@ -193,10 +203,22 @@ var config = {
...
@@ -193,10 +203,22 @@ var config = {
names
:
[
'
main
'
,
'
locale
'
,
'
common
'
,
'
runtime
'
],
names
:
[
'
main
'
,
'
locale
'
,
'
common
'
,
'
runtime
'
],
}),
}),
// copy pre-compiled vendor libraries verbatim
new
CopyWebpackPlugin
([
new
CopyWebpackPlugin
([
{
{
from
:
`../../../node_modules/monaco-editor/
${
IS_PRODUCTION
?
'
min
'
:
'
dev
'
}
/vs`
,
from
:
path
.
join
(
ROOT_PATH
,
`node_modules/monaco-editor/
${
IS_PRODUCTION
?
'
min
'
:
'
dev
'
}
/vs`
),
to
:
'
vs
'
to
:
'
monaco-editor/vs
'
,
transform
:
function
(
content
,
path
)
{
if
(
/
\.
js$/
.
test
(
path
))
{
return
(
'
(function(){
\n
'
+
'
var define = this.define, require = this.require;
\n
'
+
content
+
'
\n
}.call(window.__monaco_context__ || (window.__monaco_context__ = {})));
'
);
}
return
content
;
}
}
}
]),
]),
],
],
...
...
package.json
View file @
664db15a
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
"
babel-preset-stage-2
"
:
"
^6.22.0
"
,
"
babel-preset-stage-2
"
:
"
^6.22.0
"
,
"
bootstrap-sass
"
:
"
^3.3.6
"
,
"
bootstrap-sass
"
:
"
^3.3.6
"
,
"
compression-webpack-plugin
"
:
"
^0.3.2
"
,
"
compression-webpack-plugin
"
:
"
^0.3.2
"
,
"
copy-webpack-plugin
"
:
"
^4.0.1
"
,
"
core-js
"
:
"
^2.4.1
"
,
"
core-js
"
:
"
^2.4.1
"
,
"
css-loader
"
:
"
^0.28.0
"
,
"
css-loader
"
:
"
^0.28.0
"
,
"
d3
"
:
"
^3.5.11
"
,
"
d3
"
:
"
^3.5.11
"
,
...
@@ -30,6 +31,7 @@
...
@@ -30,6 +31,7 @@
"
eslint-plugin-html
"
:
"
^2.0.1
"
,
"
eslint-plugin-html
"
:
"
^2.0.1
"
,
"
exports-loader
"
:
"
^0.6.4
"
,
"
exports-loader
"
:
"
^0.6.4
"
,
"
file-loader
"
:
"
^0.11.1
"
,
"
file-loader
"
:
"
^0.11.1
"
,
"
imports-loader
"
:
"
^0.7.1
"
,
"
jed
"
:
"
^1.1.1
"
,
"
jed
"
:
"
^1.1.1
"
,
"
jquery
"
:
"
^2.2.1
"
,
"
jquery
"
:
"
^2.2.1
"
,
"
jquery-ujs
"
:
"
^1.2.1
"
,
"
jquery-ujs
"
:
"
^1.2.1
"
,
...
@@ -66,7 +68,6 @@
...
@@ -66,7 +68,6 @@
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
babel-plugin-istanbul
"
:
"
^4.0.0
"
,
"
babel-plugin-istanbul
"
:
"
^4.0.0
"
,
"
copy-webpack-plugin
"
:
"
^4.0.1
"
,
"
eslint
"
:
"
^3.10.1
"
,
"
eslint
"
:
"
^3.10.1
"
,
"
eslint-config-airbnb-base
"
:
"
^10.0.1
"
,
"
eslint-config-airbnb-base
"
:
"
^10.0.1
"
,
"
eslint-import-resolver-webpack
"
:
"
^0.8.1
"
,
"
eslint-import-resolver-webpack
"
:
"
^0.8.1
"
,
...
...
yarn.lock
View file @
664db15a
...
@@ -2764,6 +2764,13 @@ immediate@~3.0.5:
...
@@ -2764,6 +2764,13 @@ immediate@~3.0.5:
version "3.0.6"
version "3.0.6"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
imports-loader@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/imports-loader/-/imports-loader-0.7.1.tgz#f204b5f34702a32c1db7d48d89d5e867a0441253"
dependencies:
loader-utils "^1.0.2"
source-map "^0.5.6"
imurmurhash@^0.1.4:
imurmurhash@^0.1.4:
version "0.1.4"
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment