Skip to content

Commit

Permalink
Replace yarn by npm
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Dec 16, 2019
1 parent 5e36713 commit 997bd18
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 73 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
/dist/log
/dist/ocr-gt-tools.yml
/dist/vendor
/bower_components
/node_modules
npm-debug.log
13 changes: 2 additions & 11 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,13 @@ Install the development dependencies: The `npm` package (which pulls in nodejs)
make dev-apt-get
```

Then npm to bootstrap the tools for building HTML from Pug, CSS from LESS etc.:
Then npm to bootstrap the tools for building HTML from Pug, CSS from LESS etc.
and to install the frontend assets:

```
npm install
```

And finally yarn to install the frontend assets:

```
yarn install
```

*Note:* If you are running yarn as `root`, add the `--allow-root` option: `yarn --allow-root install`.

After changing CSS/Javascript, make sure to regenerate the `dist` folder:

```
Expand All @@ -168,8 +161,6 @@ This will
* copy all CSS stylesheets to `./dist/css/` and minify them to `./dist/style.css`
* copy all JS scripts to `./dist/js/` and minify them, in the right order, to `./dist/script.js` with source map

Javascript/CSS project dependencies are managed by yarn, see `bower.json`

### Perl

For local tests in Windows I use [Strawberry Perl](http://strawberryperl.com/).
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add node_modules/.bin to $PATH so the CLI tools
# Add node_modules/.bin to $PATH so the CLI tools
# installed locally by npm can be used
export PATH := $(PWD)/node_modules/.bin:$(PATH)

Expand Down Expand Up @@ -37,25 +37,25 @@ STYLUS = stylus
# URLs of Web Fonts to embed
FONT_URLS = https://fonts.googleapis.com/css?family=EB+Garamond&subset=latin,latin-ext
# Font files (eot, ttf, woff...) to bundle
FONT_FILES = bower_components/font-awesome/fonts/fontawesome-webfont.* \
bower_components/bootstrap/fonts/glyphicons-halflings-regular.*
FONT_FILES = node_modules/font-awesome/fonts/fontawesome-webfont.* \
node_modules/bootstrap/fonts/glyphicons-halflings-regular.*
# URLs of CSS to download
CSS_URLS = https://getbootstrap.com/examples/dashboard/dashboard.css
# CSS files to bundle into one minified `dist/vendor.css`
# NOTE: Our CSS should not be bundled here
CSS_FILES = bower_components/reset-css/reset.css \
bower_components/bootstrap/dist/css/bootstrap.css \
bower_components/notie/dist/notie.css \
bower_components/font-awesome/css/font-awesome.css
CSS_FILES = node_modules/reset-css/reset.css \
node_modules/bootstrap/dist/css/bootstrap.css \
node_modules/notie/dist/notie.css \
node_modules/font-awesome/css/font-awesome.css
# JS scripts to bundle into one minified `dist/vendor.js`
# NOTE: Javascript developed by us should not be bundled here
VENDOR_JS_FILES = bower_components/jquery/dist/jquery.js \
bower_components/async/dist/async.min.js \
bower_components/bootstrap/dist/js/bootstrap.js \
bower_components/handlebars/handlebars.min.js \
bower_components/clipboard/dist/clipboard.js \
bower_components/notie/dist/notie.js
VENDOR_JS_FILES = node_modules/jquery/dist/jquery.js \
node_modules/async/dist/async.min.js \
node_modules/bootstrap/dist/js/bootstrap.js \
node_modules/handlebars/dist/handlebars.min.js \
node_modules/clipboard/dist/clipboard.js \
node_modules/notie/dist/notie.js

JS_FILES = js/*.js js/**/*.js ocr-gt-tools.js ocr-gt-tools.js
# The HTML files, described in the Pug shorthand / templating language
PUG_FILES = ocr-gt-tools.pug
Expand Down Expand Up @@ -169,7 +169,7 @@ clean-%:
clean: clean-js clean-css clean-fonts clean-html

realclean:
$(RM) bower_components node_modules
$(RM) node_modules
$(RM) dist

test:
Expand Down
30 changes: 0 additions & 30 deletions bower.json

This file was deleted.

27 changes: 11 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
"directories": {
"example": "example"
},
"dependencies": {
"@bower_components/async": "caolan/async#^1.5.2",
"@bower_components/bootstrap": "twbs/bootstrap#^3.3.6",
"@bower_components/clipboard": "zenorocha/clipboard.js#^1.5.10",
"@bower_components/font-awesome": "FortAwesome/Font-Awesome#^4.6.1",
"@bower_components/handlebars": "components/handlebars.js#^4.0.5",
"@bower_components/jquery": "jquery/jquery-dist#^2.2.3",
"@bower_components/notie": "jaredreich/notie.js#^3.2.0",
"@bower_components/reset-css": "shannonmoeller/reset-css#^2.0.2011012603"
},
"dependencies": {},
"devDependencies": {
"async": "^1.5.2",
"bootstrap": "^3.3.6",
"clipboard": "^1.5.10",
"font-awesome": "^4.6.1",
"handlebars": "^4.0.5",
"jquery": "^2.2.3",
"notie": "^3.2.0",
"reset-css": "^2.0.2011012603",
"chokidar-cli": "^1.2.0",
"clean-css": ">=4.1.11",
"jscs": "^3.0.3",
Expand All @@ -30,8 +29,7 @@
"webfont-dl": "^0.1.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "node -e \"try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'bower_components', 'junction') } catch (e) { }\""
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,8 +57,5 @@
"bugs": {
"url": "https://github.com/UB-Mannheim/ocr-gt-tools/issues"
},
"homepage": "https://github.com/UB-Mannheim/ocr-gt-tools#readme",
"engines": {
"yarn": ">= 1.0.0"
}
"homepage": "https://github.com/UB-Mannheim/ocr-gt-tools#readme"
}

0 comments on commit 997bd18

Please sign in to comment.