mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#455 migrate to wsrv, versions server extension
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
var browserSync = require("browser-sync").create();
|
||||
var historyApiFallback = require('connect-history-api-fallback');
|
||||
|
||||
browserSync.init({
|
||||
|
||||
server: {
|
||||
baseDir: './',
|
||||
middleware: [ historyApiFallback() ]
|
||||
},
|
||||
|
||||
files: [
|
||||
'index.html',
|
||||
'app/**/*.{html,htm,css,js}',
|
||||
'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}',
|
||||
'node_modules/ng2-alfresco-webscript/dist/**/*.{html,htm,css,js}'],
|
||||
|
||||
reloadDelay: 1000
|
||||
});
|
@@ -9,7 +9,7 @@
|
||||
"start": "npm run tslint && concurrently \"npm run tsc:w\" \"license-check\" \"npm run serve\" ",
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"serve": "node browser-sync-config.js",
|
||||
"serve": "wsrv -o -s -l -p 3000 -x ./server/versions.js",
|
||||
"typings": "typings install",
|
||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json app/{,**/}**.ts",
|
||||
"licensecheck": "license-check"
|
||||
@@ -86,13 +86,12 @@
|
||||
"ng2-alfresco-webscript": "file:../ng2-components/ng2-alfresco-webscript"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browser-sync": "2.10.0",
|
||||
"concurrently": "2.0.0",
|
||||
"connect-history-api-fallback": "1.2.0",
|
||||
"license-check": "1.1.5",
|
||||
"tslint": "3.8.1",
|
||||
"typescript": "1.8.10",
|
||||
"typings": "1.0.4"
|
||||
"typings": "1.0.4",
|
||||
"wsrv": "0.1.4"
|
||||
},
|
||||
"license-check-config": {
|
||||
"src": [
|
||||
|
39
demo-shell-ng2/server/versions.js
Normal file
39
demo-shell-ng2/server/versions.js
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
// wsrv extension that provides dynamic '/versions' route
|
||||
|
||||
exports.register = function (server, options, next) {
|
||||
|
||||
var packages = [
|
||||
'ng2-activiti-form',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-alfresco-documentlist',
|
||||
'ng2-alfresco-login',
|
||||
'ng2-alfresco-search',
|
||||
'ng2-alfresco-upload',
|
||||
'ng2-alfresco-viewer',
|
||||
'ng2-alfresco-webscript'
|
||||
];
|
||||
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/versions',
|
||||
handler: function (request, reply) {
|
||||
|
||||
var result = {};
|
||||
packages.map(function (packageName) {
|
||||
result[packageName] = require('./../node_modules/' + packageName + '/package.json').version
|
||||
});
|
||||
|
||||
reply(result);
|
||||
}
|
||||
});
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
exports.register.attributes = {
|
||||
name: 'ng2-module-versions',
|
||||
version: '1.0.0'
|
||||
};
|
13
demo-shell-ng2/wsrv-config.json
Normal file
13
demo-shell-ng2/wsrv-config.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"watch": [
|
||||
"node_modules/ng2-alfresco-core/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-datatable/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-documentlist/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-login/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-search/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-upload/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-viewer/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-webscript/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-activiti-form/dist/**/*.{html,css,js}"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user