-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from vidartf/refactorprojects
Refactor NPM projects
- Loading branch information
Showing
60 changed files
with
2,708 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "nbdime", | ||
"version": "0.1.0", | ||
"directories": { | ||
"lib": "lib/" | ||
}, | ||
"scripts": { | ||
"build": "tsc --project src && node scripts/copy-files.js", | ||
"build:test": "webpack --config webpack.test.config.js", | ||
"clean": "rimraf build && rimraf node_modules && rimraf static/build", | ||
"postinstall": "npm dedupe", | ||
"test": "npm run test:firefox", | ||
"posttest": "node scripts/fix-coverage.js", | ||
"test:chrome": "npm run build:test && karma start --browsers=Chrome test/karma.conf.js", | ||
"test:debug": "npm run build:test && karma start --browsers=Chrome --singleRun=false --debug=true test/karma.conf.js", | ||
"test:firefox": "npm run build:test && karma start --browsers=Firefox test/karma.conf.js", | ||
"test:ie": "npm run build:test && karma start --browsers=IE test/karma.conf.js" | ||
}, | ||
"devDependencies": { | ||
"awesome-typescript-loader": "2.1.1", | ||
"concurrently": "^2.2.0", | ||
"css-loader": "^0.23.1", | ||
"expect.js": "^0.3.1", | ||
"file-loader": "^0.9.0", | ||
"fs-extra": "^0.30.0", | ||
"istanbul": "^0.4.5", | ||
"json-loader": "^0.5.4", | ||
"jupyterlab-extension-builder": "^0.6.2", | ||
"karma": "^1.2.0", | ||
"karma-chrome-launcher": "^1.0.1", | ||
"karma-coverage": "^1.1.1", | ||
"karma-firefox-launcher": "^1.0.0", | ||
"karma-ie-launcher": "^1.0.0", | ||
"karma-mocha": "^1.1.1", | ||
"karma-mocha-reporter": "^2.1.0", | ||
"karma-remap-coverage": "^0.1.1", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"mocha": "^3.0.2", | ||
"rimraf": "^2.5.2", | ||
"style-loader": "^0.13.1", | ||
"typescript": "^1.8.10", | ||
"url-loader": "^0.5.7", | ||
"webpack": "^1.13.1" | ||
}, | ||
"dependencies": { | ||
"codemirror": "^5.17.0", | ||
"json-stable-stringify": "^1.0.1", | ||
"jupyter-js-services": "^0.18.0", | ||
"jupyterlab": "^0.3.0", | ||
"phosphor": "^0.6.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
var fs = require('fs-extra'); | ||
fs.copySync('src/', 'lib/', { filter: /\.css$/ }); | ||
fs.copySync('src/', 'lib/', { filter: /\.svg$/ }); | ||
fs.copySync('src/', 'lib/', { filter: /\.png$/ }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
var istanbul = require('istanbul'); | ||
var path = require('path'); | ||
var collector = new istanbul.Collector(); | ||
var reporter = new istanbul.Reporter(); | ||
|
||
var remappedJson = require('../coverage/remapped.json'); | ||
var keys = Object.keys(remappedJson); | ||
var coverage = {}; | ||
|
||
|
||
// Filter out any path that is not local: | ||
var shortPrefix = 'src/'; | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i].replace(/\\/g, '/'); | ||
if (key.startsWith(shortPrefix)) { | ||
coverage[ key ] = remappedJson[ keys[i] ]; | ||
} else { | ||
var longPrefix = path.resolve(__dirname + '/../' + shortPrefix).replace(/\\/g, '/'); | ||
if (key.startsWith(longPrefix)) { | ||
coverage[ keys[i] ] = remappedJson[ keys[i] ]; | ||
} | ||
} | ||
} | ||
|
||
|
||
collector.add(coverage); | ||
reporter.add('html'); | ||
reporter.add('lcovonly'); | ||
reporter.reports['lcovonly'].file = 'coverage.lcov'; | ||
reporter.write(collector, true, function() {}); |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
'use strict'; | ||
|
||
|
||
|
||
/** | ||
* Make a POST request passing a JSON argument and receiving a JSON result. | ||
*/ | ||
export | ||
function requestJson(url: string, argument: any, callback: (result: any) => void, onError: (result: any) => void) { | ||
let xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function() { | ||
if (xhttp.readyState === 4) { | ||
if (xhttp.status === 200) { | ||
let result = JSON.parse(xhttp.responseText); | ||
callback(result); | ||
} else { | ||
onError(xhttp.responseText); | ||
} | ||
} | ||
}; | ||
xhttp.open('POST', url, true); | ||
xhttp.setRequestHeader('Content-type', 'application/json'); | ||
xhttp.send(JSON.stringify(argument)); | ||
} | ||
|
||
/** | ||
* Make a diff request for the given base/remote specifiers (filenames) | ||
*/ | ||
export | ||
function requestDiff( | ||
base: string, remote: string, | ||
onComplete: (result: any) => void, | ||
onFail: (result: any) => void) { | ||
requestJson('/api/diff', | ||
{base: base, remote: remote}, | ||
onComplete, | ||
onFail); | ||
} | ||
|
||
|
||
/** | ||
* Make a diff request for the given base/remote specifiers (filenames) | ||
*/ | ||
export | ||
function requestMerge( | ||
base: string, local: string, remote: string, | ||
onComplete: (result: any) => void, | ||
onFail: (result: any) => void) { | ||
requestJson('/api/merge', | ||
{base: base, local: local, remote: remote}, | ||
onComplete, | ||
onFail); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
|
||
|
||
|
||
.jp-Diff-unchanged .jp-Output *:first-child { | ||
margin-left: auto; | ||
} | ||
|
||
.jp-Diff-unchanged .jp-Output *:last-child { | ||
margin-right: auto; | ||
} | ||
|
||
.jp-Diff-unchanged .jp-Diff-unchanged { | ||
margin-left: 0; | ||
width: 100%; | ||
} | ||
|
||
.jp-Metadata-diff { | ||
margin-bottom: 20px; | ||
border: solid black thin; | ||
} | ||
|
||
.jp-Cell-diff { | ||
margin-bottom: 20px; | ||
border-top: solid #ccc 1px; | ||
} | ||
|
||
.jp-Diff-added > div:first-child { | ||
float: left; | ||
width: 25%; | ||
} | ||
|
||
.jp-Diff-deleted > div:first-child { | ||
float: right; | ||
width: 25%; | ||
} | ||
|
||
.jp-Diff-added .jp-Cellrow-metadata { | ||
display: none; | ||
} | ||
|
||
.jp-Diff-deleted .jp-Cellrow-metadata { | ||
display: none; | ||
} | ||
|
||
.jp-Diff-unchanged .jp-Cellrow-outputs { | ||
display: none; | ||
} | ||
|
||
/* | ||
.jp-Diff-added .jp-Cellrow-outputs { | ||
display: none; | ||
} | ||
.jp-Diff-deleted .jp-Cellrow-outputs { | ||
display: none; | ||
} | ||
*/ | ||
|
||
.jp-Diff-added .jp-Diff-unchanged { | ||
margin-left: 25%; | ||
width: 75%; | ||
} | ||
|
||
.jp-Diff-deleted .jp-Diff-unchanged { | ||
margin-left: 0; | ||
width: 75%; | ||
} | ||
|
||
.jp-Diff-unchanged .jp-Output-result > * { | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.jp-Cellrow-outputs .jp-Diff-twoway .jp-Diff-base { | ||
float: left; | ||
width: 47%; | ||
} | ||
|
||
.jp-Cellrow-outputs .jp-Diff-twoway .jp-Diff-remote { | ||
float: right; | ||
width: 47%; | ||
} | ||
|
||
.jp-Notebook-diff .jp-Output-result img { | ||
max-width: 100%; | ||
} | ||
|
||
.jp-Notebook-diff .CodeMirror-merge-pane-remote { | ||
position: relative; | ||
left: 6%; | ||
} | ||
|
||
.CodeMirror-merge-pane-deleted, .CodeMirror-merge-pane-added { width: 75%; } | ||
|
||
.jp-Notebook-diff .CodeMirror-merge-r-chunk { background-color: #ffecec; } | ||
.jp-Notebook-diff .CodeMirror-merge-r-chunk-start { border-top: 1px solid #f8cbcb; } | ||
.jp-Notebook-diff .CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #f8cbcb; } | ||
.jp-Notebook-diff .CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #f8cbcb; stroke-width: 1px; } | ||
.jp-Notebook-diff .CodeMirror-merge-spacer { background-color: #ffecec; } | ||
|
||
.jp-Notebook-diff .CodeMirror-merge-pane-remote .CodeMirror-merge-r-chunk { background-color: #dbffdb; } | ||
.jp-Notebook-diff .CodeMirror-merge-pane-remote .CodeMirror-merge-r-chunk-start { border-top: 1px solid #a6f3a6; } | ||
.jp-Notebook-diff .CodeMirror-merge-pane-remote .CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #a6f3a6; } | ||
.jp-Notebook-diff .CodeMirror-merge-pane-remote .CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #a6f3a6; stroke-width: 1px; } | ||
.jp-Notebook-diff .CodeMirror-merge-pane-remote .CodeMirror-merge-spacer { background-color: #dbffdb; } | ||
|
||
|
||
.jp-Diff-deleted .CodeMirror { | ||
background-color: #ffecec; | ||
} | ||
|
||
.jp-Diff-added .CodeMirror { | ||
background-color: #dbffdb; | ||
} | ||
|
||
.jp-Diff-added .CodeMirror-merge-pane-added { | ||
width: 100%; | ||
} |
Oops, something went wrong.