Skip to content

Commit 7157370

Browse files
authored
Merge pull request #34 from vidartf/update
Update cookiecutter
2 parents aa45a2d + 03887e6 commit 7157370

File tree

12 files changed

+64
-67
lines changed

12 files changed

+64
-67
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cache:
1111
- $HOME/.npm
1212
before_install:
1313
- pip install -U pip setuptools
14-
- nvm install 6
14+
- nvm install 8
1515
- pip install cookiecutter
1616
install:
1717
- pushd $(mktemp -d)

{{cookiecutter.github_project_name}}/.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cache:
2424
- $HOME/.npm
2525
before_install:
2626
- pip install -U pip setuptools
27-
- nvm install 6
27+
- nvm install 8
2828
- |
2929
if [[ $GROUP == python ]]; then
3030
pip install codecov

{{cookiecutter.github_project_name}}/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ skip_branch_with_pr: true
33

44
# environment variables
55
environment:
6-
nodejs_version: "6.9"
6+
nodejs_version: "8"
77
matrix:
88
- PYTHON: "C:\\Miniconda36-x64"
99
PYTHON_VERSION: "3.6.x"

{{cookiecutter.github_project_name}}/package.json

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"files": [
1212
"lib/**/*.js",
1313
"dist/*.js"
14-
],
14+
],
1515
"homepage": "https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}",
1616
"bugs": {
1717
"url": "https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}/issues"
@@ -26,15 +26,15 @@
2626
},
2727
"scripts": {
2828
"build": "npm run build:lib && npm run build:nbextension",
29-
"build:labextension": "cd {{ cookiecutter.python_package_name }} && rimraf labextension && mkdirp labextension && cd labextension && npm pack ../..",
29+
"build:labextension": "npm run clean:labextension && mkdirp {{ cookiecutter.python_package_name }}/labextension && cd {{ cookiecutter.python_package_name }}/labextension && npm pack ../..",
3030
"build:lib": "tsc --project src",
31-
"build:nbextension": "webpack",
32-
"build:all": "npm run build:lib && npm run build:labextension && npm run build:nbextension",
31+
"build:nbextension": "webpack -p",
32+
"build:all": "npm run build:labextension && npm run build:nbextension",
3333
"clean": "npm run clean:lib && npm run clean:nbextension",
3434
"clean:lib": "rimraf lib",
3535
"clean:labextension": "rimraf {{ cookiecutter.python_package_name }}/labextension",
3636
"clean:nbextension": "rimraf {{ cookiecutter.python_package_name }}/nbextension/static/index.js",
37-
"prepare": "npm run build:lib",
37+
"prepack": "npm run build:lib",
3838
"test": "npm run test:firefox",
3939
"test:chrome": "karma start --browsers=Chrome tests/karma.conf.js",
4040
"test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true tests/karma.conf.js",
@@ -48,30 +48,29 @@
4848
"@jupyter-widgets/base": "^1.1.10"
4949
},
5050
"devDependencies": {
51-
"@phosphor/application": "^1.5.0",
52-
"@phosphor/widgets": "^1.5.0",
51+
"@phosphor/application": "^1.6.0",
52+
"@phosphor/widgets": "^1.6.0",
5353
"@types/expect.js": "^0.3.29",
54-
"@types/mocha": "^5.2.0",
55-
"@types/node": "^10.0.9",
56-
"@types/three": "^0.91.13",
54+
"@types/mocha": "^5.2.5",
55+
"@types/node": "^10.11.6",
5756
"expect.js": "^0.3.1",
58-
"fs-extra": "^6.0.1",
59-
"karma": "^2.0.2",
57+
"fs-extra": "^7.0.0",
58+
"karma": "^3.0.0",
6059
"karma-chrome-launcher": "^2.2.0",
61-
"karma-firefox-launcher": "^1.0.1",
60+
"karma-firefox-launcher": "^1.1.0",
6261
"karma-ie-launcher": "^1.0.0",
6362
"karma-mocha": "^1.3.0",
64-
"karma-mocha-reporter": "^2.2.3",
65-
"karma-typescript": "^3.0.5",
63+
"karma-mocha-reporter": "^2.2.5",
64+
"karma-typescript": "^3.0.13",
6665
"mkdirp": "^0.5.1",
67-
"mocha": "^5.1.1",
66+
"mocha": "^5.2.0",
6867
"npm-run-all": "^4.1.3",
6968
"rimraf": "^2.6.2",
70-
"source-map-loader": "^0.2.3",
71-
"ts-loader": "^4.3.0",
72-
"typescript": "~2.8.3",
73-
"webpack": "^4.8.3",
74-
"webpack-cli": "^2.1.3"
69+
"source-map-loader": "^0.2.4",
70+
"ts-loader": "^5.2.1",
71+
"typescript": "~3.1.2",
72+
"webpack": "^4.20.2",
73+
"webpack-cli": "^3.1.2"
7574
},
7675
"jupyterlab": {
7776
"extension": "lib/plugin"

{{cookiecutter.github_project_name}}/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
name = '{{ cookiecutter.python_package_name }}'
2323

2424
# Ensure a valid python version
25-
ensure_python('>=3.3')
25+
ensure_python('>=3.4')
2626

2727
# Get our version
2828
version = get_version(pjoin(name, '_version.py'))
@@ -81,6 +81,7 @@
8181
'Programming Language :: Python :: 3.4',
8282
'Programming Language :: Python :: 3.5',
8383
'Programming Language :: Python :: 3.6',
84+
'Programming Language :: Python :: 3.7',
8485
'Framework :: Jupyter',
8586
],
8687
include_package_data = True,

{{cookiecutter.github_project_name}}/src/plugin.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ import {
1313
IJupyterWidgetRegistry
1414
} from '@jupyter-widgets/base';
1515

16-
import {
17-
ExampleModel, ExampleView
18-
} from './widget';
16+
import * as widgetExports from './widget';
1917

2018
import {
21-
EXTENSION_SPEC_VERSION
19+
MODULE_NAME, MODULE_VERSION
2220
} from './version';
2321

2422
const EXTENSION_ID = '{{ cookiecutter.jlab_extension_id }}';
@@ -42,11 +40,8 @@ export default examplePlugin;
4240
*/
4341
function activateWidgetExtension(app: Application<Widget>, registry: IJupyterWidgetRegistry): void {
4442
registry.registerWidget({
45-
name: '{{ cookiecutter.npm_package_name }}',
46-
version: EXTENSION_SPEC_VERSION,
47-
exports: {
48-
ExampleModel: ExampleModel,
49-
ExampleView: ExampleView
50-
}
43+
name: MODULE_NAME,
44+
version: MODULE_VERSION,
45+
exports: widgetExports,
5146
});
5247
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
22
"compilerOptions": {
33
"declaration": true,
4+
"esModuleInterop":true,
45
"lib": ["es2015", "dom"],
56
"module": "commonjs",
67
"moduleResolution": "node",
78
"noEmitOnError": true,
89
"noUnusedLocals": true,
910
"outDir": "../lib",
10-
"target": "es2015",
11-
"strict": true,
1211
"skipLibCheck": true,
13-
"types": [],
14-
"esModuleInterop":true,
15-
"sourceMap": true
12+
"sourceMap": true,
13+
"strict": true,
14+
"target": "es2015"
1615
}
1716
}
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// Copyright (c) {{ cookiecutter.author_name }}.
22
// Distributed under the terms of the Modified BSD License.
33

4+
const data = require('../package.json');
5+
46
/**
5-
* The version of the attribute spec that this package
6-
* implements. This is the value used in
7-
* _model_module_version/_view_module_version.
8-
*
9-
* Update this value when attributes are added/removed from
10-
* your models, or serialized format changes.
7+
* The current package version.
8+
*/
9+
export const MODULE_VERSION = data.version;
10+
11+
/*
12+
* The current package name.
1113
*/
12-
export
13-
const EXTENSION_SPEC_VERSION = '1.0.0';
14+
export const MODULE_NAME = data.name;

{{cookiecutter.github_project_name}}/src/widget.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@jupyter-widgets/base';
77

88
import {
9-
EXTENSION_SPEC_VERSION
9+
MODULE_NAME, MODULE_VERSION
1010
} from './version';
1111

1212

@@ -30,11 +30,11 @@ class ExampleModel extends DOMWidgetModel {
3030
}
3131

3232
static model_name = 'ExampleModel';
33-
static model_module = '{{ cookiecutter.npm_package_name }}';
34-
static model_module_version = EXTENSION_SPEC_VERSION;
35-
static view_name = 'ExampleView'; // Set to null if no view
36-
static view_module = '{{ cookiecutter.npm_package_name }}'; // Set to null if no view
37-
static view_module_version = EXTENSION_SPEC_VERSION;
33+
static model_module = MODULE_NAME;
34+
static model_module_version = MODULE_VERSION;
35+
static view_name = 'ExampleView'; // Set to null if no view
36+
static view_module = MODULE_NAME; // Set to null if no view
37+
static view_module_version = MODULE_VERSION;
3838
}
3939

4040

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
# Copyright (c) {{ cookiecutter.author_name }}.
5+
# Distributed under the terms of the Modified BSD License.
6+
7+
"""
8+
Information about the frontend package of the widgets.
9+
"""
10+
11+
module_name = "{{ cookiecutter.npm_package_name }}"
12+
module_version = "^{{ cookiecutter.npm_package_version }}"

0 commit comments

Comments
 (0)