1
0
mirror of https://gitnet.fr/deblan/gist.git synced 2021-08-14 08:30:49 +02:00

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
/src/Gist/Model/Base/
/src/Gist/Model/Map/
/web/components/
/app/propel/
/node_modules/
/app/config/config.yml
/app/config/propel/
/data/

View File

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

View File

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

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>
{% if gist.cipher %}
<script src="{{ web_path }}components/jsdiff/diff.min.js"></script>
<script src="{{ web_path }}components/diff/diff.min.js"></script>
<script>
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