-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a couple of packages have different layouts (jquery-ui, react, xterm), but little is changed a 'bower-lite' script copies dependencies from node_modules to `static/components` to match previous installation location
- Loading branch information
Showing
11 changed files
with
98 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
""" | ||
bower-lite | ||
Since Bower's on its way out, | ||
stage frontend dependencies from node_modules into components | ||
""" | ||
import json | ||
import os | ||
import shutil | ||
from os.path import join | ||
|
||
HERE = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
components = join(HERE, "notebook", "static", "components") | ||
node_modules = join(HERE, "node_modules") | ||
|
||
if os.path.exists(components): | ||
shutil.rmtree(components) | ||
os.mkdir(components) | ||
|
||
with open(join(HERE, "package.json")) as f: | ||
package_json = json.load(f) | ||
|
||
renames = { | ||
"jquery-ui-dist": "jquery-ui", | ||
} | ||
|
||
dependencies = package_json["dependencies"] | ||
for dep in dependencies: | ||
src = join(node_modules, dep) | ||
dest_name = renames.get(dep, dep) | ||
dest = join(components, dest_name) | ||
print(f"{src} -> {dest}") | ||
shutil.copytree(src, dest) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters