Skip to content

Commit

Permalink
Build & slew of minor improvements (plotly#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre-Rivet committed May 21, 2019
1 parent ed1d400 commit 19c0f50
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 11,470 deletions.
12 changes: 0 additions & 12 deletions packages/dash-html-components/.npmignore

This file was deleted.

7 changes: 4 additions & 3 deletions packages/dash-html-components/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include dash_html_components/dash_html_components.min.js
include dash_html_components/dash_html_components.dev.js
include dash_html_components/bundle.js.map
include dash_html_components/dash_html_components.min.js.map
include dash_html_components/metadata.json
include dash_html_components/package-info.json
include LICENSE
include README.md
include LICENSE.txt
include package.json
19 changes: 17 additions & 2 deletions packages/dash-html-components/dash_html_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

from __future__ import print_function as _

import json
import os as _os
import sys as _sys
import dash as _dash

from .version import __version__
_basepath = _os.path.dirname(__file__)
_filepath = _os.path.abspath(_os.path.join(_basepath, 'package-info.json'))
with open(_filepath) as f:
package = json.load(f)

package_name = package['name'].replace(' ', '_').replace('-', '_')
__version__ = package['version']

# Module imports trigger a dash.development import, need to check this first
if not hasattr(_dash, 'development'):
Expand Down Expand Up @@ -37,12 +44,20 @@
_js_dist = [
{
"relative_package_path": '{}.min.js'.format(__name__),
"dev_package_path": '{}.dev.js'.format(__name__),
"external_url": (
"https://unpkg.com/dash-html-components@{}"
"/dash_html_components/dash_html_components.min.js"
).format(__version__),
"namespace": "dash_html_components"
},
{
'relative_package_path': '{}.min.js.map'.format(__name__),
'external_url': (
'https://unpkg.com/dash-html-components@{}'
'/dash_html_components/dash_html_components.min.js.map'
).format(__version__),
'namespace': 'dash_html_components',
'dynamic': True
}
]

Expand Down
5,716 changes: 0 additions & 5,716 deletions packages/dash-html-components/dash_html_components/dash_html_components.dev.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"publish-all": "node scripts/publish.js",
"lint": "eslint src scripts",
"build:js": "webpack --mode production",
"build:js-dev": "webpack --mode development",
"build:py": "dash-generate-components ./src/components dash_html_components",
"build:r": "dash-generate-components ./src/components dash_html_components --r-prefix 'html'",
"build": "npm run build:js && npm run build:js-dev && npm run build:py",
"build:py_and_r": "dash-generate-components ./src/components dash_html_components -p package-info.json --r-prefix 'html'",
"build": "npm run build:js && npm run build:py_and_r",
"build:watch": "watch 'npm run build' src",
"test:import": "python -m unittest tests.test_dash_import",
"test:py": "python -m unittest tests.test_dash_html_components tests.test_integration",
Expand Down Expand Up @@ -58,6 +56,9 @@
"request": "^2.72.0",
"string": "^3.3.1"
},
"files": [
"/dash_html_components/*{.js,.map}"
],
"peerDependencies": {
"react": "^15.4.0 || ^16.0.0",
"react-dom": "^15.4.0 || ^16.0.0"
Expand Down

This file was deleted.

Binary file not shown.
5,716 changes: 0 additions & 5,716 deletions packages/dash-html-components/inst/deps/dash_html_components.dev.js

This file was deleted.

9 changes: 5 additions & 4 deletions packages/dash-html-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"publish-all": "node scripts/publish.js",
"lint": "eslint src scripts",
"build:js": "webpack --mode production",
"build:js-dev": "webpack --mode development",
"build:py": "dash-generate-components ./src/components dash_html_components",
"build:r": "dash-generate-components ./src/components dash_html_components --r-prefix 'html'",
"build": "npm run build:js && npm run build:js-dev && npm run build:py",
"build:py_and_r": "dash-generate-components ./src/components dash_html_components -p package-info.json --r-prefix 'html'",
"build": "npm run build:js && npm run build:py_and_r",
"build:watch": "watch 'npm run build' src",
"test:import": "python -m unittest tests.test_dash_import",
"test:py": "python -m unittest tests.test_dash_html_components tests.test_integration",
Expand Down Expand Up @@ -58,6 +56,9 @@
"request": "^2.72.0",
"string": "^3.3.1"
},
"files": [
"/dash_html_components/*{.js,.map}"
],
"peerDependencies": {
"react": "^15.4.0 || ^16.0.0",
"react-dom": "^15.4.0 || ^16.0.0"
Expand Down
17 changes: 10 additions & 7 deletions packages/dash-html-components/setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import io
import json
from setuptools import setup

main_ns = {}
exec(open('dash_html_components/version.py').read(), main_ns)
with open('package.json') as f:
package = json.load(f)

package_name = str(package["name"].replace(" ", "_").replace("-", "_"))

setup(
name='dash_html_components',
version=main_ns['__version__'],
author='Chris Parmer',
version=package["version"],
author=package['author'],
author_email='chris@plot.ly',
packages=['dash_html_components'],
packages=[package_name],
url='https://github.com/plotly/dash-html-components',
include_package_data=True,
license='MIT',
description='Dash UI HTML component suite',
license=package['license'],
description=package['description'] if 'description' in package else package_name,
long_description=io.open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
install_requires=[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ def test_imports(self):
s[0].upper() + s[1:] for s in
f.read().split('\n')
]
elements += ['MapEl', 'ObjectEl', 'version']
elements += ['MapEl', 'ObjectEl']
for s in ['Map', 'Object']:
elements.remove(s)

print(dir(dash_html_components))

self.assertEqual(
set([d for d in dir(dash_html_components) if d[0] != '_']),
set([d for d in dir(dash_html_components) if d[0] != '_' and d[0] == d[0].capitalize()]),
set(elements)
)

Expand Down
4 changes: 1 addition & 3 deletions packages/dash-html-components/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ module.exports = (env, argv) => {

const entry = overrides.entry || {main: './src/index.js'};

const devtool = overrides.devtool || (
mode === 'development' ? "eval-source-map" : 'none'
);
const devtool = overrides.devtool || 'source-map';

const externals = ('externals' in overrides) ? overrides.externals : ({
react: 'React',
Expand Down

0 comments on commit 19c0f50

Please # to comment.