mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Merge pull request #490 from Alfresco/dev-wabson-480
Improve scripts and script docs (reverted from commit 0bd5603418
)
This commit is contained in:
@@ -11,12 +11,11 @@
|
||||
"version": "0.2.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"postinstall": "typings install",
|
||||
"clean": "rimraf dist node_modules typings",
|
||||
"typings": "typings install",
|
||||
"server": "http-server -c-1 -o -p 8875 .",
|
||||
"build": "npm run tslint && rimraf dist && tsc && npm run copytemplates && license-check",
|
||||
"build:w": "npm run tslint && rimraf dist && npm run watch-task",
|
||||
"build": "npm run tslint && typings install && rimraf dist && tsc && npm run copytemplates && license-check",
|
||||
"build:w": "npm run tslint && typings install && rimraf dist && npm run watch-task",
|
||||
"watch-task": "concurrently \"npm run tsc:w\" \"npm run copytemplates:w\" \"license-check\"",
|
||||
"tslint": "npm run tslint-src && npm run tslint-root",
|
||||
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts",
|
||||
|
@@ -4,11 +4,10 @@
|
||||
"version": "0.2.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"postinstall": "typings install",
|
||||
"clean": "rimraf dist node_modules typings",
|
||||
"typings": "typings install",
|
||||
"build": "npm run tslint && rimraf dist && tsc && npm run copytemplates && license-check",
|
||||
"build:w": "npm run tslint && rimraf dist && npm run watch-task",
|
||||
"build": "npm run tslint && typings install && rimraf dist && tsc && npm run copytemplates && license-check",
|
||||
"build:w": "npm run tslint && typings install && rimraf dist && npm run watch-task",
|
||||
"watch-task": "concurrently \"npm run tsc:w\" \"npm run copytemplates:w\" \"license-check\"",
|
||||
"tslint": "npm run tslint-src && npm run tslint-root",
|
||||
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts",
|
||||
|
@@ -3,64 +3,42 @@
|
||||
The Alfresco application development framework comes with a demo project that you can run to get a
|
||||
feel for what's available.
|
||||
|
||||
Start by navigating into the app development framework source folder, and then the script folder:
|
||||
* Start by navigating into the app development framework source folder, and then the script folder:
|
||||
|
||||
```ssh
|
||||
cd alfresco-ng2-components
|
||||
cd scripts
|
||||
```
|
||||
|
||||
Start using published components
|
||||
---
|
||||
|
||||
This is recommended if you are running from the `master` branch.
|
||||
|
||||
Start the demo-shell app after installing all the dependencies from npm (*Note. do it this way only the first time, and be aware, it will take some time*)
|
||||
* Start the demo and Install all the dependencies (*Note. do it this way only the first time, and be aware, it will take some time*)
|
||||
|
||||
```sh
|
||||
./start.sh -install
|
||||
```
|
||||
|
||||
Or, if you have previously run `-install` but want to update the dependencies, use `-update`
|
||||
|
||||
```sh
|
||||
./start.sh -update
|
||||
```
|
||||
|
||||
If there are no big changes in the demo-shell since you last started then you can start without `-install` and `-update` to skip fetching packages, which should be much quicker
|
||||
* Start the demo (*the standard way of starting the demo after first initialization*):
|
||||
|
||||
```sh
|
||||
./start.sh
|
||||
```
|
||||
|
||||
If you get errors when starting which do not go away with `-update` or `-install,` or if you want to test starting the demo shell from a clean environment, then use the `-cleanInstall` option
|
||||
|
||||
This will remove previous versions of all packages, before running `npm install` again
|
||||
* Start the demo, install all the dependencies, and remove the previous version of the npm packages (*Note. do this only after big changes*):
|
||||
|
||||
```sh
|
||||
./start.sh -cleanInstall
|
||||
```
|
||||
|
||||
Start using linked components
|
||||
---
|
||||
|
||||
This is recommended if you are using the `development` branch or a feature branch off `development`
|
||||
|
||||
If you want to use your local components use the following script with any of the previous options. It will npm link all the components
|
||||
in the demo shell before starting up the demo-shell.
|
||||
|
||||
For a new environment, use `-install`
|
||||
* Start the demo and update the dependencies:
|
||||
|
||||
```sh
|
||||
./start-linked.sh -install
|
||||
./start.sh -update
|
||||
```
|
||||
|
||||
When you are restarting, you can skip `-install`
|
||||
* If you want to use your local components use the following script with any of the previous option. It will npm link all the components
|
||||
in the demo shell:
|
||||
|
||||
```sh
|
||||
./start-linked.sh
|
||||
```
|
||||
|
||||
The parameters `-update` and `-cleanInstall` work as described above for `start.sh`
|
||||
|
||||
For development environment configuration please refer to [project docs](demo-shell-ng2/README.md).
|
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
components_dir="$DIR/../ng2-components"
|
||||
|
||||
for comp_dir in $( ls "$components_dir" ); do
|
||||
echo $comp_dir
|
||||
test -f "$components_dir/$comp_dir/package.json" && \
|
||||
cd "$components_dir/$comp_dir" && \
|
||||
npm run build
|
||||
done
|
||||
|
||||
cd ${DIR}
|
@@ -1,13 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
components_dir="$DIR/../ng2-components"
|
||||
|
||||
for comp_dir in $( ls "$components_dir" ); do
|
||||
test -f "$components_dir/$comp_dir/package.json" && \
|
||||
cd "$components_dir/$comp_dir" && \
|
||||
echo "====== clean component: ${$comp_dir} =====" && \
|
||||
npm run clean
|
||||
for PACKAGE in \
|
||||
ng2-activiti-form \
|
||||
ng2-activiti-processlist \
|
||||
ng2-activiti-tasklist \
|
||||
ng2-alfresco-core \
|
||||
ng2-alfresco-datatable \
|
||||
ng2-alfresco-documentlist \
|
||||
ng2-alfresco-login \
|
||||
ng2-alfresco-search \
|
||||
ng2-alfresco-upload \
|
||||
ng2-alfresco-viewer \
|
||||
ng2-alfresco-webscript
|
||||
do
|
||||
echo "====== clean component: ${PACKAGE} ====="
|
||||
cd "$DIR/../ng2-components/${PACKAGE}"
|
||||
npm run clean
|
||||
done
|
||||
|
||||
cd "$DIR/../demo-shell-ng2"
|
||||
|
@@ -1,37 +1,103 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
components_dir="$DIR/../ng2-components"
|
||||
|
||||
npm_opts="--loglevel=silent"
|
||||
npm install -g typings
|
||||
|
||||
function link_alfresco_ng2_deps() {
|
||||
cd $1
|
||||
for dep in $( list-dependencies '^ng2-(alfresco|activiti)-' ); do
|
||||
npm link --ignore-scripts $npm_opts "$dep"
|
||||
done
|
||||
}
|
||||
#LINK CORE
|
||||
echo "====== linking component: ng2-alfresco-core ====="
|
||||
cd "$DIR/../ng2-components/ng2-alfresco-core"
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
npm install $npm_opts -g typings
|
||||
npm install $npm_opts -g @wabson/list-dependencies
|
||||
#LINK FORM
|
||||
echo "====== linking component: ng2-activiti-form ====="
|
||||
cd "$DIR/../ng2-components/ng2-activiti-form"
|
||||
npm link ng2-alfresco-core
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
# First link each component into /usr/local/lib/node_modules
|
||||
for comp_dir in $( ls "$components_dir" ); do
|
||||
echo "Link $components_dir/$comp_dir"
|
||||
test -f "$components_dir/$comp_dir/package.json" && cd "$components_dir/$comp_dir" && npm link --ignore-scripts
|
||||
#LINK DATATABLE
|
||||
echo "====== linking component: ng2-alfresco-datatable ====="
|
||||
cd "$DIR/../ng2-components/ng2-alfresco-datatable"
|
||||
npm link ng2-alfresco-core
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
#LINK DOCUMENTLIST
|
||||
echo "====== linking component: ng2-alfresco-documentlist ====="
|
||||
cd "$DIR/../ng2-components/ng2-alfresco-documentlist"
|
||||
npm link ng2-alfresco-core
|
||||
npm link ng2-alfresco-datatable
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
#LINK WEBSCRIPT
|
||||
echo "====== linking component: ng2-alfresco-webscript ====="
|
||||
cd "$DIR/../ng2-components/ng2-alfresco-webscript"
|
||||
npm link ng2-alfresco-core
|
||||
npm link ng2-alfresco-datatable
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
#LINK TASKLIST
|
||||
echo "====== linking component: ng2-activiti-tasklist ====="
|
||||
cd "$DIR/../ng2-components/ng2-activiti-tasklist"
|
||||
npm link ng2-alfresco-core
|
||||
npm link ng2-alfresco-datatable
|
||||
npm link ng2-activiti-form
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
#LINK PROCESSLIST
|
||||
echo "====== linking component: ng2-activiti-processlist ====="
|
||||
cd "$DIR/../ng2-components/ng2-activiti-processlist"
|
||||
npm link ng2-alfresco-core
|
||||
npm link ng2-alfresco-datatable
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
|
||||
#LINK ALL THE OTHERS COMPONENTS
|
||||
for PACKAGE in \
|
||||
ng2-alfresco-login \
|
||||
ng2-alfresco-search \
|
||||
ng2-alfresco-upload \
|
||||
ng2-alfresco-viewer \
|
||||
ng2-alfresco-webscript
|
||||
do
|
||||
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
|
||||
echo "====== linking component: ${PACKAGE} ====="
|
||||
cd "$DESTDIR"
|
||||
npm link ng2-alfresco-core
|
||||
npm link
|
||||
npm run typings
|
||||
npm run build
|
||||
done
|
||||
|
||||
# Now link inter-dependencies between components
|
||||
for comp_dir in $( ls "$components_dir" ); do
|
||||
echo "Link dependencies of $components_dir/$comp_dir"
|
||||
test -f "$components_dir/$comp_dir/package.json" && link_alfresco_ng2_deps "$components_dir/$comp_dir"
|
||||
done
|
||||
|
||||
# Now run postinstall scripts
|
||||
for comp_dir in $( ls "$components_dir" ); do
|
||||
echo "Postinstall $components_dir/$comp_dir"
|
||||
test -f "$components_dir/$comp_dir/package.json" && cd "$components_dir/$comp_dir" && npm run postinstall
|
||||
#LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
|
||||
cd "$DIR/../demo-shell-ng2"
|
||||
for PACKAGE in \
|
||||
ng2-activiti-form \
|
||||
ng2-activiti-processlist \
|
||||
ng2-activiti-tasklist \
|
||||
ng2-alfresco-core \
|
||||
ng2-alfresco-datatable \
|
||||
ng2-alfresco-documentlist \
|
||||
ng2-alfresco-login \
|
||||
ng2-alfresco-search \
|
||||
ng2-alfresco-upload \
|
||||
ng2-alfresco-viewer \
|
||||
ng2-alfresco-webscript
|
||||
do
|
||||
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
|
||||
echo "====== demo shell linking: ${PACKAGE} ====="
|
||||
npm link ${PACKAGE}
|
||||
done
|
||||
|
||||
# LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
|
||||
link_alfresco_ng2_deps "$DIR/../demo-shell-ng2"
|
||||
|
@@ -1,14 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
components_dir="$DIR/../ng2-components"
|
||||
|
||||
"$DIR/npm-clean.sh"
|
||||
|
||||
for comp_dir in $( ls "$components_dir" ); do
|
||||
test -f "$components_dir/$comp_dir/package.json" && \
|
||||
cd "$components_dir/$comp_dir" && \
|
||||
echo "====== PUBLISHING: ${$comp_dir} =====" && \
|
||||
npm install && \
|
||||
npm publish
|
||||
for PACKAGE in \
|
||||
ng2-activiti-form \
|
||||
ng2-activiti-processlist \
|
||||
ng2-activiti-tasklist \
|
||||
ng2-alfresco-core \
|
||||
ng2-alfresco-datatable \
|
||||
ng2-alfresco-documentlist \
|
||||
ng2-alfresco-login \
|
||||
ng2-alfresco-search \
|
||||
ng2-alfresco-upload \
|
||||
ng2-alfresco-viewer \
|
||||
ng2-alfresco-webscript
|
||||
do
|
||||
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
|
||||
echo "====== PUBLISHING: ${DESTDIR} ====="
|
||||
cd ${DESTDIR}
|
||||
npm install
|
||||
npm publish
|
||||
cd ${DIR}
|
||||
done
|
||||
|
@@ -3,5 +3,19 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
"$DIR/npm-link-demo-shell.sh"
|
||||
"$DIR/npm-build-all.sh"
|
||||
"$DIR/start.sh" $@
|
||||
|
||||
cd "$DIR/../demo-shell-ng2"
|
||||
|
||||
if [[ $1 = "-install" ]]; then
|
||||
npm install
|
||||
npm run start
|
||||
elif [[ $1 = "-update " ]]; then
|
||||
npm run update
|
||||
npm run start
|
||||
elif [[ $1 = "-cleanInstall" ]]; then
|
||||
npm run clean
|
||||
npm install
|
||||
npm run start
|
||||
else
|
||||
npm run start
|
||||
fi
|
||||
|
Reference in New Issue
Block a user