Migration from bower to npm only

This commit is contained in:
Simon Vieille 2018-08-08 12:41:08 +02:00
parent 6c12f92fd1
commit 8caff598e8
No known key found for this signature in database
GPG Key ID: 919533E2B946EA10
12 changed files with 50 additions and 55 deletions

View File

@ -1,3 +0,0 @@
{
"directory": "web/components/"
}

2
.gitignore vendored
View File

@ -5,8 +5,8 @@
/propel.yaml /propel.yaml
/src/Gist/Model/Base/ /src/Gist/Model/Base/
/src/Gist/Model/Map/ /src/Gist/Model/Map/
/web/components/
/app/propel/ /app/propel/
/node_modules/
/app/config/config.yml /app/config/config.yml
/app/config/propel/ /app/config/propel/
/data/ /data/

View File

@ -1,5 +1,5 @@
COMPOSER ?= composer COMPOSER ?= composer
BOWER ?= bower NPM ?= npm
GIT ?= git GIT ?= git
MKDIR ?= mkdir MKDIR ?= mkdir
PHP ?= php PHP ?= php
@ -7,47 +7,40 @@ PHP ?= php
all: update all: update
composer: composer:
@echo "Installing application's dependencies" @echo "Installing PHP dependencies"
@echo "-------------------------------------" @echo "---------------------------"
@echo @echo
$(COMPOSER) install $(COMPOSER_INSTALL_FLAGS) $(COMPOSER) install $(COMPOSER_INSTALL_FLAGS)
bower: npm:
@echo "Installing application's dependencies" @echo "Installing CSS/JS dependencies"
@echo "-------------------------------------" @echo "------------------------------"
@echo @echo
$(BOWER) install $(NPM) install
optimize:
@echo "Optimizing Composer's autoloader, can take some time"
@echo "----------------------------------------------------"
@echo
$(COMPOSER) dump-autoload --optimize
update: update:
@echo "Updating application's dependencies" @echo "Updating application's dependencies"
@echo "-----------------------------------" @echo "-----------------------------------"
@echo @echo
$(GIT) pull origin master $(GIT) pull origin master
${MKDIR} -p data/git ${MKDIR} -p data/git
$(COMPOSER) update $(COMPOSER) update
$(BOWER) install $(NPM) install
run: run:
@echo "Run development server" @echo "Run development server"
@echo "----------------------" @echo "----------------------"
@echo @echo
$(PHP) -S 127.0.0.1:8080 -t web $(PHP) -S 127.0.0.1:8080 -t web
propel: propel:
@echo "Propel migration" @echo "Propel migration"
@echo "----------------" @echo "----------------"
@echo @echo
./vendor/propel/propel/bin/propel config:convert ./vendor/propel/propel/bin/propel config:convert
./vendor/propel/propel/bin/propel model:build --recursive ./vendor/propel/propel/bin/propel model:build --recursive
./vendor/propel/propel/bin/propel migration:diff --recursive ./vendor/propel/propel/bin/propel migration:diff --recursive

View File

@ -5,7 +5,7 @@ Table of Contents
* [Requirements](#requirements) * [Requirements](#requirements)
* [Git](#git) * [Git](#git)
* [Composer](#composer) * [Composer](#composer)
* [Bower](#bower) * [NPM](#npm)
* [Installation](#installation) * [Installation](#installation)
* [Upgrade](#upgrade) * [Upgrade](#upgrade)
* [Configuration](#configuration) * [Configuration](#configuration)
@ -34,7 +34,7 @@ Requirements
* GIT * GIT
* MySQL or SQLite (PostgreSQL should works) * MySQL or SQLite (PostgreSQL should works)
* Composer (php) * Composer (php)
* Bower (node) * NPM (nodejs)
### Git ### Git
@ -62,10 +62,9 @@ Else, follow the next instructions:
# For a global installation # For a global installation
$ sudo mv composer.phar /usr/local/bin/composer $ sudo mv composer.phar /usr/local/bin/composer
### Bower ### NPM
$ sudo apt-get install npm $ sudo apt-get install npm
$ sudo npm install -g bower
Installation Installation
------------ ------------
@ -162,12 +161,26 @@ Makefile
A Makefile is provided to automate some tasks. A Makefile is provided to automate some tasks.
* `make` will install application's dependencies via Composer and Bower, * `make` will install dependencies via composer and NPM
* `make optimize` will run Composer's autoloader dump script with classmap * `make composer` will install PHP dependencies via composer
* `make npm` will install CSS/JS dependencies via NPM
* `make update` will update the application * `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/ * `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 API
--- ---

View File

@ -1,22 +0,0 @@
{
"name": "gist",
"version": "0.0.3",
"authors": [
"Simon Vieille <simon@deblan.fr>"
],
"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"
}
}

9
package.json Normal file
View File

@ -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"
}
}

View File

@ -82,7 +82,7 @@
<script src="{{ web_path }}app/js/prism.js" {% if gist.cipher %}data-manual{% endif %}></script> <script src="{{ web_path }}app/js/prism.js" {% if gist.cipher %}data-manual{% endif %}></script>
{% if gist.cipher %} {% if gist.cipher %}
<script src="{{ web_path }}components/jsdiff/diff.min.js"></script> <script src="{{ web_path }}components/diff/diff.min.js"></script>
<script> <script>
var key = getKey(); var key = getKey();

1
web/components/bootstrap Symbolic link
View File

@ -0,0 +1 @@
../../node_modules/bootstrap

1
web/components/diff Symbolic link
View File

@ -0,0 +1 @@
../../node_modules/diff

View File

@ -0,0 +1 @@
../../node_modules/flag-icon-css

View File

@ -0,0 +1 @@
../../node_modules/iframe-resizer

1
web/components/jquery Symbolic link
View File

@ -0,0 +1 @@
../../node_modules/jquery