From 8caff598e8926eade3baf41d80f73937baedb72a Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 8 Aug 2018 12:41:08 +0200 Subject: [PATCH] Migration from bower to npm only --- .bowerrc | 3 -- .gitignore | 2 +- Makefile | 35 ++++++++----------- README.md | 27 ++++++++++---- bower.json | 22 ------------ package.json | 9 +++++ .../Resources/views/View/revisions.html.twig | 2 +- web/components/bootstrap | 1 + web/components/diff | 1 + web/components/flag-icon-css | 1 + web/components/iframe-resizer | 1 + web/components/jquery | 1 + 12 files changed, 50 insertions(+), 55 deletions(-) delete mode 100644 .bowerrc delete mode 100644 bower.json create mode 100644 package.json create mode 120000 web/components/bootstrap create mode 120000 web/components/diff create mode 120000 web/components/flag-icon-css create mode 120000 web/components/iframe-resizer create mode 120000 web/components/jquery diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index 7f6b222..0000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "web/components/" -} diff --git a/.gitignore b/.gitignore index 0d685da..f5e2c76 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ /propel.yaml /src/Gist/Model/Base/ /src/Gist/Model/Map/ -/web/components/ /app/propel/ +/node_modules/ /app/config/config.yml /app/config/propel/ /data/ diff --git a/Makefile b/Makefile index 7dd29cc..9edb0c5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ COMPOSER ?= composer -BOWER ?= bower +NPM ?= npm GIT ?= git MKDIR ?= mkdir PHP ?= php @@ -7,47 +7,40 @@ PHP ?= php all: update composer: - @echo "Installing application's dependencies" - @echo "-------------------------------------" - @echo + @echo "Installing PHP dependencies" + @echo "---------------------------" + @echo $(COMPOSER) install $(COMPOSER_INSTALL_FLAGS) -bower: - @echo "Installing application's dependencies" - @echo "-------------------------------------" - @echo +npm: + @echo "Installing CSS/JS dependencies" + @echo "------------------------------" + @echo - $(BOWER) install - -optimize: - @echo "Optimizing Composer's autoloader, can take some time" - @echo "----------------------------------------------------" - @echo - - $(COMPOSER) dump-autoload --optimize + $(NPM) install update: @echo "Updating application's dependencies" @echo "-----------------------------------" - @echo + @echo $(GIT) pull origin master ${MKDIR} -p data/git $(COMPOSER) update - $(BOWER) install + $(NPM) install run: @echo "Run development server" @echo "----------------------" - @echo + @echo $(PHP) -S 127.0.0.1:8080 -t web propel: @echo "Propel migration" @echo "----------------" - @echo - + @echo + ./vendor/propel/propel/bin/propel config:convert ./vendor/propel/propel/bin/propel model:build --recursive ./vendor/propel/propel/bin/propel migration:diff --recursive diff --git a/README.md b/README.md index c10a24e..0be2cc2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Table of Contents * [Requirements](#requirements) * [Git](#git) * [Composer](#composer) - * [Bower](#bower) + * [NPM](#npm) * [Installation](#installation) * [Upgrade](#upgrade) * [Configuration](#configuration) @@ -34,7 +34,7 @@ Requirements * GIT * MySQL or SQLite (PostgreSQL should works) * Composer (php) -* Bower (node) +* NPM (nodejs) ### Git @@ -62,10 +62,9 @@ Else, follow the next instructions: # For a global installation $ sudo mv composer.phar /usr/local/bin/composer -### Bower +### NPM $ sudo apt-get install npm - $ sudo npm install -g bower Installation ------------ @@ -162,12 +161,26 @@ Makefile A Makefile is provided to automate some tasks. -* `make` will install application's dependencies via Composer and Bower, -* `make optimize` will run Composer's autoloader dump script with classmap +* `make` will install dependencies via composer and NPM +* `make composer` will install PHP dependencies via composer +* `make npm` will install CSS/JS dependencies via NPM * `make update` will update the application -* `make propel` will generate propel's files +* `make propel` will generate propel migrations (database and files) * `make run` will run development server on http://127.0.0.1:8080/ +By default, `composer`, `npm`, `git`, `mkdir` and `php` binaries must be in your `$PATH`. You can override it by using these envars: + +* `COMPOSER` +* `NPM` +* `GIT` +* `MKDIR` +* `PHP` + +For example: + + $ export COMPOSER=/path/to/composer + $ make composer + API --- diff --git a/bower.json b/bower.json deleted file mode 100644 index 464be4d..0000000 --- a/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "gist", - "version": "0.0.3", - "authors": [ - "Simon Vieille " - ], - "description": "GIST is an open-source application to share code.", - "main": "web/index.php", - "keywords": [ - "Gist", - "GIT" - ], - "license": "LGPL", - "homepage": "https://gitnet.fr/deblan/gist", - "dependencies": { - "bootstrap": "3.3.4", - "flag-icon-css": "0.7.1", - "iframe-resizer": "2.8.6", - "jsdiff": "~2.2.2", - "Prism": "~1.8.1" - } -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..fcb0414 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "bootstrap": "^3.3.4", + "diff": "^2.2.2", + "flag-icon-css": "^0.8.6", + "iframe-resizer": "^2.8.6", + "jquery": "^1.9.1" + } +} diff --git a/src/Gist/Resources/views/View/revisions.html.twig b/src/Gist/Resources/views/View/revisions.html.twig index e1d2766..3b8c2b4 100644 --- a/src/Gist/Resources/views/View/revisions.html.twig +++ b/src/Gist/Resources/views/View/revisions.html.twig @@ -82,7 +82,7 @@ {% if gist.cipher %} - +