Skip to content

Commit dc16ea5

Browse files
JanWielemakerJan Wielemaker
authored and
Jan Wielemaker
committed
CLEANUP: Modernise yarn dependency setup.
1 parent 4ef94cd commit dc16ea5

15 files changed

+47
-84
lines changed

.bowerrc

-2
This file was deleted.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
bower_components
2+
node_modules
33
swish-bower-components.zip
44
.bower-senitel
55
passwd

.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# install modules here
2+
--modules-folder web/node_modules

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $(YARN_ARCHIVE)::
6060

6161
upload::
6262
rm -f $(YARN_ARCHIVE)
63-
zip -r $(YARN_ARCHIVE) web/bower_components
63+
zip -r $(YARN_ARCHIVE) web/node_modules
6464
rsync $(YARN_ARCHIVE) ops:/home/swipl/web/download/swish/$(YARN_ARCHIVE)
6565

6666

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ As installing node and yarn is not a pleasure on all operating systems,
7878
you can also download the dependencies as a single zip file from
7979
http://www.swi-prolog.org/download/swish/swish-bower-components.zip.
8080
Unpack the zip file, maintaining the directory structure, from the swish
81-
root directory to create the directory web/bower_components. If you have
81+
root directory to create the directory web/node_modules. If you have
8282
`make` installed you can install the above `.zip` file using
8383

8484
make yarn-zip

lib/page.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
resource_prefix('form/').
332332
resource_prefix('icons/').
333333
resource_prefix('js/').
334-
resource_prefix('bower_components/').
334+
resource_prefix('node_modules/').
335335

336336
%% swish_page(+Options)//
337337
%
@@ -781,7 +781,7 @@
781781
alt(css, 'swish.css', swish_web('css/swish.css')).
782782
alt(rjs, 'js/require.js', swish_web('js/require.js')) :-
783783
\+ debugging(nominified).
784-
alt(rjs, 'bower_components/requirejs/require.js', -).
784+
alt(rjs, 'node_modules/requirejs/require.js', -).
785785

786786

787787
/*******************************

package.json

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
{
22
"dependencies": {
3-
"@bower_components/bootstrap": "twbs/bootstrap#3",
4-
"@bower_components/c3": "masayuki0812/c3#*",
5-
"@bower_components/codemirror": "components/codemirror#*",
6-
"@bower_components/d3": "mbostock-bower/d3-bower#^5.0.0",
7-
"@bower_components/jquery": "jquery/jquery-dist#>= 1.0.0",
8-
"@bower_components/jquery.splitter": "jcubic/jquery.splitter#0.15",
9-
"@bower_components/js-sha1": "emn178/js-sha1#*",
10-
"@bower_components/laconic": "joestelmach/laconic#*",
11-
"@bower_components/requirejs": "jrburke/requirejs-bower#*",
12-
"@bower_components/sparkline": "gwatts/jquery.sparkline#*",
13-
"@bower_components/svg-pan-zoom": "ariutta/svg-pan-zoom#*",
14-
"@bower_components/tagmanager": "max-favilli/tagmanager#*",
15-
"@bower_components/typeahead.js": "git://github.com/twitter/typeahead.js.git#master"
3+
"bootstrap": "twbs/bootstrap#3",
4+
"c3": "masayuki0812/c3#*",
5+
"codemirror": "components/codemirror#*",
6+
"d3": "mbostock-bower/d3-bower#^5.0.0",
7+
"jquery": "jquery/jquery-dist#>= 1.0.0",
8+
"jquery.splitter": "jcubic/jquery.splitter#0.15",
9+
"js-sha1": "emn178/js-sha1#*",
10+
"laconic": "joestelmach/laconic#*",
11+
"requirejs": "jrburke/requirejs-bower#*",
12+
"sparkline": "gwatts/jquery.sparkline#*",
13+
"svg-pan-zoom": "ariutta/svg-pan-zoom#*",
14+
"tagmanager": "max-favilli/tagmanager#*",
15+
"typeahead.js": "git://github.com/twitter/typeahead.js.git#master",
16+
"printthis": "git://github.com/jasonday/printThis.git#master"
1617
},
1718
"engines": {
1819
"yarn": ">= 1.0.0"
19-
},
20-
"scripts": {
21-
"postinstall": "node -e \"try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'web/bower_components', 'junction') } catch (e) { }\""
2220
}
2321
}

web/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
HOVER=text-hover.css text-hover.js
22
HINT=show-hint-eclipse.css templates-hint.css templates-hint.js
33
RENDER_SVGTREE=svg-tree-drawer.js
4-
SPLITTERD=bower_components/jquery.splitter/js
4+
SPLITTERD=node_modules/jquery.splitter/js
55

66
all: hover hint svgtree
77

web/css/css-inline.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
file_name_extension(_, Ext, S),
5151
image_ext(Ext),
5252
size_file(S, Size),
53-
( sub_string(S, _, _, _, '/bower_components/')
53+
( sub_string(S, _, _, _, '/node_modules/')
5454
-> true
5555
; Size < 2000
5656
), !,

web/css/editor.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@import url("../bower_components/codemirror/lib/codemirror.css");
2-
@import url("../bower_components/codemirror/addon/hint/show-hint.css");
3-
@import url("../bower_components/codemirror/addon/dialog/dialog.css");
1+
@import url("../node_modules/codemirror/lib/codemirror.css");
2+
@import url("../node_modules/codemirror/addon/hint/show-hint.css");
3+
@import url("../node_modules/codemirror/addon/dialog/dialog.css");
44
@import url("../js/codemirror/theme/prolog.css");
55
@import url("../js/codemirror/addon/hover/prolog-hover.css");
66
@import url("../js/codemirror/addon/hint/templates-hint.css");

web/css/swish.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
@import url("answer.css");
88
@import url("term.css");
99
@import url("gitty.css");
10-
@import url("../bower_components/jquery.splitter/css/jquery.splitter.css");
11-
@import url("../bower_components/bootstrap/dist/css/bootstrap.css");
12-
@import url("../bower_components/tagmanager/tagmanager.css");
13-
@import url("../bower_components/c3/c3.css");
10+
@import url("../node_modules/jquery.splitter/css/jquery.splitter.css");
11+
@import url("../node_modules/bootstrap/dist/css/bootstrap.css");
12+
@import url("../node_modules/tagmanager/tagmanager.css");
13+
@import url("../node_modules/c3/c3.css");
1414
@import url("typeaheadjs.css");
1515
@import url("diffview.css");
1616
@import url("notebook.css");

web/js/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RJS=r.js
1212
all: src min require.js
1313

1414
src::
15-
$(MAKE) -C ../bower_components/sparkline jqs
15+
$(MAKE) -C ../node_modules/sparkline jqs
1616

1717
doc:: $(CONF) $(JQ) $(JS)
1818
-jsdoc -p -c $(CONF) $(JQ) $(JS)
@@ -34,7 +34,7 @@ swish-min.js.gz: swish-min.js
3434
build.js: $(MAIN) build.js.in
3535
swipl mkjsbuild.pl $(MAIN) build.js.in
3636

37-
require.js: ../bower_components/requirejs/require.js
37+
require.js: ../node_modules/requirejs/require.js
3838
cp -p $< $@
3939

4040
clean:

web/js/swish.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ require.config({
4747
urlArgs: "ts="+new Date().getTime(), /* prevent caching during development */
4848
waitSeconds: 60, /* swish-min.js is big */
4949
paths:
50-
{ jquery: "../bower_components/jquery/dist/jquery.min",
51-
"jquery-ui": "../bower_components/jquery-ui/jquery-ui.min",
52-
laconic: "../bower_components/laconic/laconic",
53-
bootstrap: "../bower_components/bootstrap/dist/js/bootstrap.min",
54-
bloodhound: "../bower_components/typeahead.js/dist/bloodhound",
55-
typeahead: "../bower_components/typeahead.js/dist/typeahead.jquery",
56-
splitter: "../bower_components/jquery.splitter/js/jquery.splitter-0.15.0",
57-
tagmanager: "../bower_components/tagmanager/tagmanager",
58-
sha1: "../bower_components/js-sha1/src/sha1",
59-
c3: "../bower_components/c3/c3",
60-
d3: "../bower_components/d3/d3",
61-
"svg-pan-zoom": "../bower_components/svg-pan-zoom/dist/svg-pan-zoom.min",
62-
sparkline: "../bower_components/sparkline/dist/jquery.sparkline",
50+
{ jquery: "../node_modules/jquery/dist/jquery.min",
51+
"jquery-ui": "../node_modules/jquery-ui/jquery-ui.min",
52+
laconic: "../node_modules/laconic/laconic",
53+
bootstrap: "../node_modules/bootstrap/dist/js/bootstrap.min",
54+
bloodhound: "../node_modules/typeahead.js/dist/bloodhound",
55+
typeahead: "../node_modules/typeahead.js/dist/typeahead.jquery",
56+
splitter: "../node_modules/jquery.splitter/js/jquery.splitter-0.15.0",
57+
tagmanager: "../node_modules/tagmanager/tagmanager",
58+
sha1: "../node_modules/js-sha1/src/sha1",
59+
c3: "../node_modules/c3/c3",
60+
d3: "../node_modules/d3/d3",
61+
"svg-pan-zoom": "../node_modules/svg-pan-zoom/dist/svg-pan-zoom.min",
62+
sparkline: "../node_modules/sparkline/dist/jquery.sparkline",
6363

6464
/* CodeMirror extensions */
6565
"cm/mode/prolog": "codemirror/mode/prolog",
@@ -69,7 +69,7 @@ require.config({
6969
"cm/addon/hint/show-context-info": "codemirror/addon/hint/show-context-info",
7070

7171
/* Standard CodeMirror */
72-
"cm" : "../bower_components/codemirror"
72+
"cm" : "../node_modules/codemirror"
7373
},
7474
shim:
7575
{ bootstrap:

web/split.html

-35
This file was deleted.

web/swish.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<head>
88
<title>SWISH 2.0 page</title>
99
<link rel="stylesheet" href="css/swish.css">
10-
<script data-main="js/swish" src="bower_components/requirejs/require.js"></script>
10+
<script data-main="js/swish" src="node_modules/requirejs/require.js"></script>
1111
</head>
1212
<body>
1313
<header class="navbar navbar-default">

0 commit comments

Comments
 (0)