diff --git a/src/ipywidgets/.gitignore b/src/ipywidgets/.gitignore new file mode 100644 index 000000000000..9095dd4beb82 --- /dev/null +++ b/src/ipywidgets/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +out +dist +**/node_modules +.nyc_output +npm-debug.log +bin/** +obj/** +tmp/** diff --git a/src/ipywidgets/package.json b/src/ipywidgets/package.json index ede8be68bdfa..52f68567fac0 100644 --- a/src/ipywidgets/package.json +++ b/src/ipywidgets/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "build": "npm run clean && tsc", - "buildx": "npm run clean && tsc && node scripts/copyfiles.js && webpack && npm run copyFile", - "clean": "rimraf out && rimraf tsconfig.tsbuildinfo && rimraf built", + "build": "npm run clean && tsc && node scripts/copyfiles.js && webpack --mode='production' && npm run copyFile && npm run clean", + "build:dev": "npm run clean && tsc && node scripts/copyfiles.js && webpack --mode='development' && npm run copyFile && npm run clean", + "clean": "rimraf out && rimraf tsconfig.tsbuildinfo && rimraf dist", "lint": "tslint --project tsconfig.json", "copyFile": "node scripts/copyBuild.js" }, diff --git a/src/ipywidgets/scripts/copyBuild.js b/src/ipywidgets/scripts/copyBuild.js index 9c314be56d0b..11bfafee4a29 100644 --- a/src/ipywidgets/scripts/copyBuild.js +++ b/src/ipywidgets/scripts/copyBuild.js @@ -1,6 +1,9 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -var fs = require('fs'); -// TODO: To be fixed when integrating ipywidgets with extension. -// fs.copyFileSync('built/ipywidgets.js', '/Users/donjayamanne/.vscode-insiders/extensions/pythonVSCode/out/datascience-ui/native-editor/ipywidgets.js'); +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +fs.copyFileSync(path.resolve(__dirname, '..', 'dist', 'ipywidgets', 'ipywidgets.js'), path.resolve(__dirname, '..', '..', '..', 'out', 'datascience-ui', 'native-editor', 'ipywidgets.js')); diff --git a/src/ipywidgets/scripts/copyfiles.js b/src/ipywidgets/scripts/copyfiles.js index 8ddb4273e9c8..cd2553ff90f8 100644 --- a/src/ipywidgets/scripts/copyfiles.js +++ b/src/ipywidgets/scripts/copyfiles.js @@ -1,5 +1,7 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +'use strict'; var fs = require('fs'); fs.copyFileSync('src/widgets.css', 'out/widgets.css'); diff --git a/src/ipywidgets/webpack.config.js b/src/ipywidgets/webpack.config.js index f84eecdd79d6..cec5dff05855 100644 --- a/src/ipywidgets/webpack.config.js +++ b/src/ipywidgets/webpack.config.js @@ -13,7 +13,7 @@ module.exports = { entry: './out/index.js', output: { filename: 'ipywidgets.js', - path: path.resolve(__dirname, '..', '..', 'out', 'ipywidgets'), + path: path.resolve(__dirname, 'dist', 'ipywidgets'), publicPath: 'built/', library: "vscIPyWidgets", libraryTarget: "window"