#586 fix npm scripts for demo app and demo projects

- pre-build TypeScript code before running watchers
- don’t clean (rimraf) destination folders on watcher (done on
pre-build, fixes many browser load errors)
- simplified ‘tslint’ tasks for demo projects
- running ’tsc’ and ‘tsc -w’ from local node_modules (don’t expect
global typescript compiler)
This commit is contained in:
Denys Vuika 2016-08-23 14:10:42 +01:00
parent 92fe0f5307
commit 3dc95dc4ed
11 changed files with 57 additions and 80 deletions

View File

@ -6,7 +6,8 @@
"scripts": { "scripts": {
"postinstall": "typings install", "postinstall": "typings install",
"clean": "rimraf node_modules typings", "clean": "rimraf node_modules typings",
"start": "npm run tslint && concurrently \"npm run tsc:w\" \"license-check\" \"npm run serve\" ", "build": "npm run tslint && npm run tsc && npm run licensecheck",
"start": "npm run build && concurrently \"npm run tsc:w\" \"npm run serve\" ",
"aws": "node app.js", "aws": "node app.js",
"tsc": "tsc", "tsc": "tsc",
"tsc:w": "tsc -w", "tsc:w": "tsc -w",

View File

@ -1,23 +0,0 @@
var browserSync = require("browser-sync").create();
var historyApiFallback = require('connect-history-api-fallback');
browserSync.init({
server: {
baseDir: './',
middleware: [ historyApiFallback() ]
},
files: [
'index.html',
'dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-core/dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-datatable/dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-documentlist/dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-login/dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-search/dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-upload/dist/**/*.{html,htm,css,js}',
'node_modules/ng2-alfresco-viewer/dist/**/*.{html,htm,css,js}'],
reloadDelay: 1000
});

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "npm install && npm run typings && concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "node browser-sync-config.js", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && npm run tsc:w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/**/*.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"keywords": [ "keywords": [
"ng2", "ng2",
@ -44,13 +44,12 @@
"material-design-lite": "^1.1.3" "material-design-lite": "^1.1.3"
}, },
"devDependencies": { "devDependencies": {
"browser-sync": "^2.10.0",
"connect-history-api-fallback": "^1.2.0",
"concurrently": "^2.0.0", "concurrently": "^2.0.0",
"rimraf": "2.5.2", "rimraf": "2.5.2",
"tslint": "^3.8.1", "tslint": "^3.8.1",
"typescript": "^1.8.10", "typescript": "^1.8.10",
"typings": "^1.0.4" "typings": "^1.0.4",
"wsrv": "0.1.3"
}, },
"publishConfig": { "publishConfig": {
"registry": "http://devproducts.alfresco.me:4873/" "registry": "http://devproducts.alfresco.me:4873/"

View File

@ -14,12 +14,12 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"typings": "typings install", "typings": "typings install",
"start": "rimraf dist && npm install && npm run server", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {

View File

@ -14,12 +14,12 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"typings": "typings install", "typings": "typings install",
"start": "rimraf dist && npm install && npm run server", "build": "npm run tslint && rimraf dist && npm run tsc",
"server": "wsrv -o", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"build": "npm run tslint && rimraf dist && tsc", "server": "wsrv -o -l -s",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o -s -l", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && npm run tsc:w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o -s -l", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && tsc -w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"contributors": [ "contributors": [

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o -s -l", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && npm run tsc:w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"contributors": [ "contributors": [

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o -l -s", "server": "wsrv -o -l -s",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && npm run tsc:w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"contributors": [ "contributors": [

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o -s -l", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && npm run tsc:w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {

View File

@ -8,13 +8,13 @@
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"postinstall": "npm run typings && npm run build", "postinstall": "npm run typings && npm run build",
"start": "concurrently \"npm run build:w\" \"npm run server\" ", "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
"server": "wsrv -o -s -l", "server": "wsrv -o -s -l",
"build": "npm run tslint && rimraf dist && tsc", "build": "npm run tslint && rimraf dist && npm run tsc",
"build:w": "npm run tslint && rimraf dist && tsc -w", "build:w": "npm run tslint && rimraf dist && npm run tsc:w",
"tslint": "npm run tslint-src && npm run tslint-root", "tsc": "tsc",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tsc:w": "tsc -w",
"tslint-root": "tslint -c tslint.json *.ts" "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {