This commit is contained in:
Mario Romano
2016-12-15 01:05:54 +00:00
parent e133fd6408
commit 04768f9798
34 changed files with 145 additions and 290 deletions

View File

@@ -1,22 +1,27 @@
const moduleIdRegex = /moduleId: module.id,/g; const moduleIdRegex = /moduleId: module.id,/g;
const moduleNameRegex = /moduleId: __moduleName,/g; const moduleNameRegex = /moduleId: __moduleName,/g;
const moduleIdPath = /module.id.replace/g;
module.exports = function(source) { module.exports = function(source) {
this.cacheable(); this.cacheable();
let result = source;
if (moduleIdRegex.test(source)) { if (moduleIdRegex.test(source)) {
result = source.replace(moduleIdRegex, (match) => { source = source.replace(moduleIdRegex, (match) => {
return `// ${match}`; return `// ${match}`;
}); });
} }
if (moduleNameRegex.test(source)) { if (moduleNameRegex.test(source)) {
result = source.replace(moduleNameRegex, (match) => { source = source.replace(moduleNameRegex, (match) => {
return `// ${match}`; return `// ${match}`;
}); });
} }
return result; if (moduleIdPath.test(source)) {
source = source.replace(moduleIdPath, (match) => {
return `''.replace`;
});
}
return source;
} }

View File

@@ -44,13 +44,21 @@ module.exports = {
}, },
fallback: rootPath fallback: rootPath
}, },
module: { module: {
preLoaders: [
{
test: /\.js$/,
include: [
...alfrescoLibs
],
loader: 'source-map-loader'
}
],
loaders: [ loaders: [
{ {
test: /\.ts$/, test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader'], loaders: ['awesome-typescript-loader', 'angular2-template-loader', 'systemjs-loader'],
exclude: /node_modules/ exclude: ['node_modules','public']
}, },
{ {
test: /\.js$/, test: /\.js$/,
@@ -59,43 +67,43 @@ module.exports = {
], ],
loaders: ['angular2-template-loader', 'source-map-loader', 'systemjs-loader'] loaders: ['angular2-template-loader', 'source-map-loader', 'systemjs-loader']
}, },
{ {
test: /\.html$/, test: /\.html$/,
exclude: alfrescoLibs, exclude: alfrescoLibs,
loader: 'html' loader: 'html'
}, },
{ {
test: /\.html$/, test: /\.html$/,
include: alfrescoLibs, include: alfrescoLibs,
loader: 'html', loader: 'html',
query: { query: {
interpolate: true interpolate: true
} }
}, },
{ {
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file?name=assets/[name].[hash].[ext]' loader: 'file?name=assets/[name].[hash].[ext]'
}, },
{ {
test: /\.css$/, test: /\.css$/,
exclude: [ exclude: [
helpers.root('app'), helpers.root('app'),
...alfrescoLibs ...alfrescoLibs
], ],
loader: ExtractTextPlugin.extract('style', 'css?sourceMap') loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
}, },
{ {
test: /\.css$/, test: /\.css$/,
include: [ include: [
helpers.root('app'), helpers.root('app'),
...alfrescoLibs ...alfrescoLibs
], ],
loader: 'raw' loader: 'raw'
} }
] ]
}, },
plugins: [ plugins: [
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
'dialogPolyfill': 'dialog-polyfill/dialog-polyfill' 'dialogPolyfill': 'dialog-polyfill/dialog-polyfill'
@@ -108,10 +116,10 @@ module.exports = {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: 'index.html' template: 'index.html'
}) })
], ],
node: { node: {
fs: 'empty', fs: 'empty',
module: false module: false
} }
}; };

View File

@@ -5,7 +5,8 @@ var helpers = require('./helpers');
var CopyWebpackPlugin = require('copy-webpack-plugin'); var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = webpackMerge(commonConfig, { module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-source-map',
devtool: 'cheap-module-eval-source-map',
output: { output: {
path: helpers.root('dist'), path: helpers.root('dist'),

View File

@@ -1,42 +0,0 @@
'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: packages.map(function (packageName) {
return {
name: packageName,
version: require('./../node_modules/' + packageName + '/package.json').version
}
})
};
return reply(result).type('application/json');
}
});
next();
};
exports.register.attributes = {
name: 'ng2-module-versions',
version: '1.0.0'
};

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-activiti-analytics.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"contributors": [ "contributors": [

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-activiti-diagrams.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"contributors": [ "contributors": [

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-activiti-form.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-activiti-processlist.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-activiti-tasklist.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-core.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-datatable.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-documentlist.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-login.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-search.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-tag.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-upload.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-userinfo.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -1,5 +1,6 @@
npm-debug.log npm-debug.log
.idea .idea
demo/localTestFile.pdf
coverage/ coverage/
demo/ demo/
@@ -7,18 +8,12 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore
*.tgz

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-viewer.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {

View File

@@ -7,18 +7,10 @@ node_modules
typings/ typings/
fonts/ fonts/
/.editorconfig /.editorconfig
/.travis.yml /.travis.yml
*.ts
!*.d.ts
!*.js
!*.js.map
/*.json /*.json
*.spec.js
*.tgz
/.npmignore
/karma-test-shim.js /karma-test-shim.js
/karma.conf.js /karma.conf.js
/make.js /gulpfile.ts
/package/ /.npmignore

View File

@@ -22,7 +22,7 @@
"build.umd": "gulp build.prod --color --env-config prod --build-type prod", "build.umd": "gulp build.prod --color --env-config prod --build-type prod",
"reinstall": "npm cache clean && npm install" "reinstall": "npm cache clean && npm install"
}, },
"main": "bundles/ng2-alfresco-webscript.js", "main": "./index.js",
"module": "./index.js", "module": "./index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
"repository": { "repository": {