From 997bd18cd8a22201da109814f1a599fcbd044f0e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 16 Dec 2019 10:18:26 +0100 Subject: [PATCH] Replace yarn by npm Signed-off-by: Stefan Weil --- .gitignore | 1 - INSTALL.md | 13 ++----------- Makefile | 30 +++++++++++++++--------------- bower.json | 30 ------------------------------ package.json | 27 +++++++++++---------------- 5 files changed, 28 insertions(+), 73 deletions(-) delete mode 100644 bower.json diff --git a/.gitignore b/.gitignore index bbd2a8f..a095645 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ /dist/log /dist/ocr-gt-tools.yml /dist/vendor -/bower_components /node_modules npm-debug.log diff --git a/INSTALL.md b/INSTALL.md index 9b7bc2d..6f9034c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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: ``` @@ -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/). diff --git a/Makefile b/Makefile index 22008c7..58727f4 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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 @@ -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: diff --git a/bower.json b/bower.json deleted file mode 100644 index c2c399b..0000000 --- a/bower.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "ocr-gt-tools", - "description": "", - "main": "js/ocr-gt-tools.js", - "moduleType": [], - "authors": [ - "bfallert", - "kba" - ], - "license": "GPLv2+", - "homepage": "https://github.com/UB-Mannheim/ocr-gt-tools", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "bootstrap": "^3.3.6", - "font-awesome": "Font-Awesome#^4.6.1", - "jquery": "^2.2.3", - "reset-css": "^2.0.2011012603", - "handlebars": "^4.0.5", - "clipboard": "^1.5.10", - "notie": "^3.2.0", - "async": "^1.5.2" - } -} diff --git a/package.json b/package.json index 80fce10..1969363 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" }