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

@@ -21,97 +21,105 @@ let alfrescoLibs = glob.sync(pattern, options);
// let alfrescoLibsModules = alfrescoLibs.map(p => path.join(p, 'node_modules')); // let alfrescoLibsModules = alfrescoLibs.map(p => path.join(p, 'node_modules'));
module.exports = { module.exports = {
entry: { entry: {
'polyfills': './app/polyfills.ts', 'polyfills': './app/polyfills.ts',
'vendor': './app/vendor.ts', 'vendor': './app/vendor.ts',
'app': './app/main.ts' 'app': './app/main.ts'
}, },
resolve: { resolve: {
extensions: ['', '.ts', '.js'], extensions: ['', '.ts', '.js'],
modules: [ modules: [
helpers.root('app'), helpers.root('app'),
helpers.root('node_modules') helpers.root('node_modules')
],
root: rootPath,
fallback: rootPath
},
resolveLoader: {
alias: {
'systemjs-loader': helpers.root('config', 'loaders', 'system.js'),
'debug-loader': helpers.root('config', 'loaders', 'debug.js')
},
fallback: rootPath
},
module: {
preLoaders: [
{
test: /\.js$/,
include: [
...alfrescoLibs
], ],
root: rootPath, loader: 'source-map-loader'
fallback: rootPath }
}, ],
loaders: [
resolveLoader: { {
alias: { test: /\.ts$/,
'systemjs-loader': helpers.root('config', 'loaders', 'system.js'), loaders: ['awesome-typescript-loader', 'angular2-template-loader', 'systemjs-loader'],
'debug-loader': helpers.root('config', 'loaders', 'debug.js') exclude: ['node_modules','public']
}, },
fallback: rootPath {
}, test: /\.js$/,
include: [
module: { ...alfrescoLibs
loaders: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader'],
exclude: /node_modules/
},
{
test: /\.js$/,
include: [
...alfrescoLibs
], ],
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'
}), }),
new webpack.optimize.CommonsChunkPlugin({ new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills'] name: ['app', 'vendor', 'polyfills']
}), }),
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": {