Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Issue 284 - Add source map to NPM and PyPi packages #285

Merged
merged 6 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"defaultSeverity": "error",
"extends": "./../tslint.json",

"jsRules": {
"no-console": false
},
"rules": {
"no-console": false
},
"rulesDirectory": []
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solving small issues with tslint rules in toolchain subfolders. Not related to main issue.. want to be able to use console.log in toolchain!

37 changes: 19 additions & 18 deletions .config/webpack/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = (preprocessor = {}, mode = 'development') => {
return {
entry: {
bundle: './src/dash-table/index.ts',
demo: ['./demo/index.js', './demo/index.html'],
demo: ['./demo/index.js', './demo/index.html']
},
mode: mode,
output: {
Expand All @@ -21,18 +21,19 @@ module.exports = (preprocessor = {}, mode = 'development') => {
library: dashLibraryName,
libraryTarget: 'umd'
},
devtool: 'source-map',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All is tslint fixes except for this. This setting is slower but more accurate than other mappings. See here: https://webpack.js.org/configuration/devtool/

externals: {
react: {
commonjs: "react",
commonjs2: "react",
amd: "React",
root: "React"
commonjs: 'react',
commonjs2: 'react',
amd: 'React',
root: 'React'
},
"react-dom": {
commonjs: "react-dom",
commonjs2: "react-dom",
amd: "ReactDOM",
root: "ReactDOM"
'react-dom': {
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'ReactDOM',
root: 'ReactDOM'
},
'plotly.js': 'Plotly'
},
Expand All @@ -58,25 +59,25 @@ module.exports = (preprocessor = {}, mode = 'development') => {
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
],
]
},
{
test: /\.less$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'less-loader' }
],
},
],
]
}
]
},
resolve: {
alias: {
'cypress': path.resolve('./tests/cypress/src'),
cypress: path.resolve('./tests/cypress/src'),
'dash-table': path.resolve('./src/dash-table'),
'demo': path.resolve('./demo'),
'core': path.resolve('./src/core'),
'tests': path.resolve('./tests')
demo: path.resolve('./demo'),
core: path.resolve('./src/core'),
tests: path.resolve('./tests')
},
extensions: ['.js', '.ts', '.tsx']
}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.1.9] - 2018-12-06
### Added
- Source map [#284](https://github.com/plotly/dash-table/issues/284)
Related Dash issue [#480](https://github.com/plotly/dash/issues/480)

## [3.1.8] - 2018-12-04
### Added
- Virtualization [#234](https://github.com/plotly/dash-table/issues/234)
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include dash_table/bundle.js
include dash_table/bundle.js.map
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyPi addition

include dash_table/metadata.json
include dash_table/package-info.json
include README.md
Expand Down
7 changes: 7 additions & 0 deletions dash_table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
'https://unpkg.com/dash-table@{}/dash_table/bundle.js'
).format(__version__),
'namespace': package_name
},
{
'relative_package_path': 'bundle.js.map',
'external_url': (
'https://unpkg.com/dash-table@{}/dash_table/bundle.js.map'
).format(__version__),
'namespace': package_name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Dash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

}
]

Expand Down
7 changes: 4 additions & 3 deletions dash_table/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dash_table/bundle.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions dash_table/demo.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dash_table/demo.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dash_table/package-info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.1.8",
"version": "3.1.9",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump version

"description": "Dash table",
"main": "dash_table/bundle.js",
"scripts": {
Expand Down Expand Up @@ -50,7 +50,7 @@
"@types/react": "^16.7.13",
"@types/react-select": "^1.3.4",
"babel-loader": "^8.0.4",
"core-js": "^2.5.7",
"core-js": "^2.6.0",
"css-loader": "^1.0.1",
"cypress": "^3.1.3",
"file-loader": "^2.0.0",
Expand All @@ -76,7 +76,7 @@
"webpack-preprocessor": "^0.1.12"
},
"files": [
"/dash_table/bundle*.js"
"/dash_table/bundle*{.js,.map}"
],
"peerDependencies": {
"react": ">=0.14",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.1.8",
"version": "3.1.9",
"description": "Dash table",
"main": "dash_table/bundle.js",
"scripts": {
Expand Down Expand Up @@ -76,7 +76,7 @@
"webpack-preprocessor": "^0.1.12"
},
"files": [
"/dash_table/bundle*.js"
"/dash_table/bundle*{.js,.map}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pickup both js and map files for the NPM package

],
"peerDependencies": {
"react": ">=0.14",
Expand Down