remove manual npm link and add it in postinstall script

This commit is contained in:
Eugenio Romano
2016-05-18 14:48:13 +01:00
parent 5ec91a4c5d
commit f179f3431d
8 changed files with 372 additions and 420 deletions

View File

@@ -28,83 +28,24 @@ to clean up afterwards
docker-compose rm docker-compose rm
``` ```
### Configuring development environment ### Building and running steps:
*All scripts assume you are at the project root folder* 1. Install dependencies
**Install symlinks for Alfresco components**
**On Linux, you may need to use sudo cmd or add user write permissions to /usr/lib/node_modules**
*ng2-alfresco-core:*
```sh ```sh
npm link ../ng2-components/ng2-alfresco-core
```
*ng2-alfresco-datatable component:*
```sh
npm link ../ng2-components/ng2-alfresco-datatable
```
*ng2-alfresco-documentlist component:*
```sh
npm link ../ng2-components/ng2-alfresco-documentlist
```
*ng2-alfresco-login component:*
```sh
npm link ../ng2-components/ng2-alfresco-login
```
*ng2-alfresco-upload component:*
```sh
npm link ../ng2-components/ng2-alfresco-upload
```
*dev-platform-js-api client:*
```sh
npm link ../../dev-platform-js-api
```
Please refer to [this article](https://docs.npmjs.com/cli/link) for more details on npm link.
### Building and running
**Install dependencies:**
```sh
cd dev-platform-webcomponents/demo-shell-ng2/
npm install npm install
``` ```
**(Option 1) Fast build and watch for dev purposes:** 2. Fast build and watch for dev purposes
```sh ```sh
npm start npm start.dev
``` ```
`start` script also includes live reload and watchers for all the `.ts` files. >`start` script also includes live reload and watchers for all the `.ts` files.
TypeScript watchers are also configured for `node_modules` folder within demo shell TypeScript watchers are also configured for `node_modules` folder within demo shell
and provide live reload for all the component libraries as well. and provide live reload for all the component libraries as well.
**(Option 2) Build and watch with Gulp:**
```sh
npm run build.dev
```
*or*
```sh
gulp dev
```
###Multi-language ###Multi-language
To support a new language you need to create your language file (.json) and add it to `i18n/` folder. To support a new language you need to create your language file (.json) and add it to `i18n/` folder.

View File

@@ -4,16 +4,16 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"scripts": { "scripts": {
"build.dev": "gulp dev",
"build.prod": "gulp build",
"prestart": "npm install", "prestart": "npm install",
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ", "start.dev": "concurrently \"npm run tsc:w\" \"npm run serve\" ",
"start": "concurrently \"npm run tsc:w\" \"npm run serve\" ",
"test": "live-server --open=tests-runner.html", "test": "live-server --open=tests-runner.html",
"tsc": "tsc", "tsc": "tsc",
"tsc:w": "tsc -w -p tsconfig.dev.json", "tsc:w": "tsc -w -p tsconfig.dev.json",
"lite": "lite-server", "serve": "live-server",
"typings": "typings", "typings": "typings",
"postinstall": "typings install" "postinstall": "typings install && npm link ../ng2-components/ng2-alfresco-core && npm link ../ng2-components/ng2-alfresco-documentlist && npm link ../ng2-components/ng2-alfresco-login && npm link ../ng2-components/ng2-alfresco-upload && npm link ../ng2-components/ng2-alfresco-datatable",
"postupdate": "npm link ../ng2-components/ng2-alfresco-core && npm link ../ng2-components/ng2-alfresco-documentlist && npm link ../ng2-components/ng2-alfresco-login && npm link ../ng2-components/ng2-alfresco-upload && npm link ../ng2-components/ng2-alfresco-datatable"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -40,6 +40,7 @@
"alfresco" "alfresco"
], ],
"dependencies": { "dependencies": {
"alfresco-core-rest-api": "https://github.com/Alfresco/dev-platform-js-api",
"angular2": "2.0.0-beta.15", "angular2": "2.0.0-beta.15",
"bootstrap": "^3.3.6", "bootstrap": "^3.3.6",
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",

View File

@@ -4,7 +4,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "npm run build && typings install",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "npm run test && http-server -c-1 -o -p 8875 .",
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",

View File

@@ -4,7 +4,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "typings install && npm link ../ng2-alfresco-core && npm run build",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "npm run test && http-server -c-1 -o -p 8875 .",
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",

View File

@@ -4,7 +4,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "typings install && npm link ../ng2-alfresco-core && npm run build",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "npm run test && http-server -c-1 -o -p 8875 .",
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",

View File

@@ -4,7 +4,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "npm run build && typings install",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "npm run test && http-server -c-1 -o -p 8875 .",
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",
@@ -42,6 +42,10 @@
{ {
"name": "Mario Romano", "name": "Mario Romano",
"email": "mario.romano83@gmail.com" "email": "mario.romano83@gmail.com"
},
{
"name": "Eugenio Romano",
"email": "eugenio.romano83@gmail.com"
} }
], ],
"keywords": [ "keywords": [

View File

@@ -4,7 +4,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "npm run build && typings install",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "npm run test && http-server -c-1 -o -p 8875 .",
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",
@@ -34,6 +34,10 @@
{ {
"name": "Mario Romano", "name": "Mario Romano",
"email": "mario.romano83@gmail.com" "email": "mario.romano83@gmail.com"
},
{
"name": "Eugenio Romano",
"email": "eugenio.romano83@gmail.com"
} }
], ],
"keywords": [ "keywords": [

View File

@@ -9,7 +9,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Eugenio Romano", "author": "Eugenio Romano",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "npm run build && typings install",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "npm run test && http-server -c-1 -o -p 8875 .",
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",
@@ -25,7 +25,8 @@
"pretest": "npm run build", "pretest": "npm run build",
"test": "karma start karma.conf.js", "test": "karma start karma.conf.js",
"posttest": "node_modules/.bin/remap-istanbul -i coverage/coverage-final.json -o coverage -t html", "posttest": "node_modules/.bin/remap-istanbul -i coverage/coverage-final.json -o coverage -t html",
"coverage": "http-server -c-1 -o -p 9875 ./coverage" "coverage": "http-server -c-1 -o -p 9875 ./coverage",
"deploy": "http-server -c-1 -o -p 9875 ./demo/demo.html"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -39,6 +40,7 @@
"systemjs": "0.19.26", "systemjs": "0.19.26",
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",
"es6-module-loader": "^0.17.8", "es6-module-loader": "^0.17.8",
"pdfjs-dist": "^1.5.258",
"reflect-metadata": "0.1.2", "reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2", "rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.12", "zone.js": "^0.6.12",
@@ -49,9 +51,9 @@
"angular2": "2.0.0-beta.15" "angular2": "2.0.0-beta.15"
}, },
"devDependencies": { "devDependencies": {
"codelyzer": "0.0.19",
"copyfiles": "^0.2.1", "copyfiles": "^0.2.1",
"coveralls": "^2.11.9", "coveralls": "^2.11.9",
"codelyzer": "0.0.19",
"http-server": "0.8.5", "http-server": "0.8.5",
"jasmine-core": "2.4.1", "jasmine-core": "2.4.1",
"karma": "~0.12.0", "karma": "~0.12.0",