Skip to content

Commit

Permalink
#7322 use typings in Lab lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz committed Jun 7, 2018
1 parent e50297f commit cb2125b
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 5 deletions.
51 changes: 51 additions & 0 deletions js/lab/package-lock.json

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

1 change: 1 addition & 0 deletions js/lab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@jupyterlab/rendermime": "^0.15.2",
"@jupyterlab/rendermime-interfaces": "^1.0.4",
"@jupyterlab/services": "^1.1.2",
"@phosphor/datagrid": "^0.1.6",
"@types/node": "^8.0.56",
"rimraf": "^2.6.2",
"typescript": "~2.6.2"
Expand Down
2 changes: 2 additions & 0 deletions js/notebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
"@types/chai": "^4.1.1",
"@types/jquery": "^3.3.0",
"@types/mocha": "^2.2.46",
"@types/node": "^10.3.1",
"base64-inline-loader": "^1.1.1",
"chai": "^4.1.2",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.4",
"file-loader": "^0.10.0",
"fork-ts-checker-webpack-plugin": "^0.2.8",
Expand Down
19 changes: 19 additions & 0 deletions js/notebook/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2018 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/// <reference path='./types/index.d.ts'/>

export * from './types/index.d';
2 changes: 1 addition & 1 deletion js/notebook/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"moduleResolution": "Node",
"noEmit": true,
"lib": ["dom", "es5", "es2015"],
"types": [],
"types": ["node"],
"paths": {
"jquery": ["jquery/dist/jquery.js"]
}
Expand Down
4 changes: 2 additions & 2 deletions js/notebook/src/types/GridView.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import widgets from './widgets';
import './gridView/grid-view.scss';
export declare class GridViewModel extends widgets.VBoxModel {
export declare class GridModel extends widgets.VBoxModel {
defaults(): any;
}
export declare class GridView extends widgets.VBoxView {
render(): void;
}
declare const _default: {
GridViewModel: typeof GridViewModel;
GridViewModel: typeof GridModel;
GridView: typeof GridView;
};
export default _default;
10 changes: 10 additions & 0 deletions js/notebook/src/types/Plot.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import widgets from './widgets';
export declare class PlotModel extends widgets.DOMWidgetModel {
defaults(): any;
}
export declare class PlotView extends widgets.DOMWidgetView {}
declare const _default: {
PlotModel: typeof PlotModel;
PlotView: typeof PlotView;
};
export default _default;
3 changes: 2 additions & 1 deletion js/notebook/src/types/assets.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

/// <reference types='node'/>

declare var __webpack_public_path__: string;
declare var BEAKERX_MODULE_VERSION: string;
declare var require: Function;
declare var Jupyter: any;
declare var beakerx: any;

Expand Down
3 changes: 3 additions & 0 deletions js/notebook/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ export * from './TabView';
export * from './GridView';
export * from './CyclingDisplayBox';
export * from './EasyForm';
export * from './Plot';

export declare const version: string;
12 changes: 11 additions & 1 deletion js/notebook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var path = require('path');
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
var TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
var tsConfigPath = path.resolve(__dirname, './src/tsconfig.json');
var CopyWebpackPlugin = require('copy-webpack-plugin');

// Custom webpack loaders are generally the same for all webpack bundles, hence
// stored in a separate local variable.
Expand Down Expand Up @@ -182,7 +183,16 @@ module.exports = [
'@jupyter-widgets/jupyterlab-manager',
'@jupyterlab'
]),
plugins: plugins
plugins: plugins.concat([
new CopyWebpackPlugin([{
from: path.resolve(__dirname, './src/types'),
to: path.resolve(__dirname, '../lab/lib/types')
},
{
from: path.resolve(__dirname, './src/index.d.ts'),
to: path.resolve(__dirname, '../lab/lib/index.d.ts')
}])
])
},
{
// tree - notebook
Expand Down
65 changes: 65 additions & 0 deletions js/notebook/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@
version "2.2.48"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.48.tgz#3523b126a0b049482e1c3c11877460f76622ffab"

"@types/node@^10.3.1":
version "10.3.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.1.tgz#51092fbacaed768a122a293814474fbf6e5e8b6d"

"@types/strip-bom@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2"
Expand Down Expand Up @@ -426,6 +430,16 @@ array-find-index@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"

array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
dependencies:
array-uniq "^1.0.1"

array-uniq@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"

array-unique@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
Expand Down Expand Up @@ -1186,6 +1200,19 @@ copy-descriptor@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"

copy-webpack-plugin@^4.5.1:
version "4.5.1"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz#fc4f68f4add837cc5e13d111b20715793225d29c"
dependencies:
cacache "^10.0.4"
find-cache-dir "^1.0.0"
globby "^7.1.1"
is-glob "^4.0.0"
loader-utils "^1.1.0"
minimatch "^3.0.4"
p-limit "^1.0.0"
serialize-javascript "^1.4.0"

core-js@^2.4.0:
version "2.5.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
Expand Down Expand Up @@ -1712,6 +1739,13 @@ diffie-hellman@^5.0.0:
miller-rabin "^4.0.0"
randombytes "^2.0.0"

dir-glob@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034"
dependencies:
arrify "^1.0.1"
path-type "^3.0.0"

domain-browser@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
Expand Down Expand Up @@ -2304,6 +2338,17 @@ globals@^9.18.0:
version "9.18.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"

globby@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
dependencies:
array-union "^1.0.1"
dir-glob "^2.0.0"
glob "^7.1.2"
ignore "^3.3.5"
pify "^3.0.0"
slash "^1.0.0"

globule@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.0.tgz#1dc49c6822dd9e8a2fa00ba2a295006e8664bd09"
Expand Down Expand Up @@ -2583,6 +2628,10 @@ ignore-styles@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ignore-styles/-/ignore-styles-5.0.1.tgz#b49ef2274bdafcd8a4880a966bfe38d1a0bf4671"

ignore@^3.3.5:
version "3.3.8"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.8.tgz#3f8e9c35d38708a3a7e0e9abb6c73e7ee7707b2b"

imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
Expand Down Expand Up @@ -3805,6 +3854,12 @@ p-finally@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"

p-limit@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
dependencies:
p-try "^1.0.0"

p-limit@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c"
Expand Down Expand Up @@ -3930,6 +3985,12 @@ path-type@^2.0.0:
dependencies:
pify "^2.0.0"

path-type@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
dependencies:
pify "^3.0.0"

pathval@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
Expand Down Expand Up @@ -4816,6 +4877,10 @@ sinon@^4.2.0:
supports-color "^5.1.0"
type-detect "^4.0.5"

slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"

slide@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707"
Expand Down

0 comments on commit cb2125b

Please sign in to comment.