intermediate-component-sa 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -20
- package/build-dev.bat +2 -0
- package/build-prod-aot.bat +2 -0
- package/build-prod-rollup-aot.bat +2 -0
- package/build-prod.bat +2 -0
- package/config.ts +4 -0
- package/gulpfile.ts +172 -0
- package/index.js +4 -2
- package/karma.conf.js +124 -0
- package/package.json +326 -5
- package/postgrator-test.json +9 -0
- package/postgrator.json +9 -0
- package/src/app.server.ts +4 -0
- package/src/client/app/app.component.ts +37 -0
- package/src/client/app/app.html +6 -0
- package/src/client/app/app.module.ts +36 -0
- package/src/client/app/app.routing.ts +7 -0
- package/src/client/app/hot_loader_main.ts +14 -0
- package/src/client/app/main-aot.ts +8 -0
- package/src/client/app/main.ts +8 -0
- package/src/client/app/rxjs-operators.ts +15 -0
- package/src/client/index.html +90 -0
- package/src/client/tsconfig.json +44 -0
- package/src/server/config/app.config.ts +57 -0
- package/src/server/config/jwt.config.ts +4 -0
- package/src/server/config/logger.config.ts +161 -0
- package/src/server/config/mssql.config.ts +30 -0
- package/src/server/config/redis.config.ts +10 -0
- package/src/server/config/server.config.ts +20 -0
- package/src/server/config/templates.config.ts +41 -0
- package/src/server/crypt.ts +37 -0
- package/src/server/customRequest.ts +609 -0
- package/src/server/index.ts +231 -0
- package/src/server/interfaces/cleaner.interface.ts +3 -0
- package/src/server/interfaces/supervisor.interface.ts +3 -0
- package/src/server/routes-centralized.ts +36 -0
- package/src/server/routes.ts +6 -0
- package/src/server/services/index.ts +10 -0
- package/src/server/services/routes.service.ts +11 -0
- package/src/server/shared/file-manager.ts +1007 -0
- package/src/server/shared/http.shared.ts +49 -0
- package/src/server/shared/promises.shared.ts +13 -0
- package/src/server/shared/security.shared.ts +90 -0
- package/src/server/ssl/star_inconcertcc_com.key +28 -0
- package/src/server/ssl/star_inconcertcc_com.pem +62 -0
- package/src/server/tsconfig.json +38 -0
- package/tools/build.js.prod.ts +40 -0
- package/tools/config/project.config.ts +718 -0
- package/tools/config.ts +4 -0
- package/tools/database/SchemaZen.exe +0 -0
- package/tools/database/generate-all-data-scripts.bat +32 -0
- package/tools/database/generate-database-scripts.bat +36 -0
- package/tools/debug.ts +17 -0
- package/tools/env/base.ts +8 -0
- package/tools/env/dev.ts +9 -0
- package/tools/env/env-config.interface.ts +1 -0
- package/tools/env/prod.ts +10 -0
- package/tools/manual_typings/project/sample.package.d.ts +3 -0
- package/tools/manual_typings/seed/angular2-hot-loader.d.ts +9 -0
- package/tools/manual_typings/seed/autoprefixer.d.ts +13 -0
- package/tools/manual_typings/seed/colorguard.d.ts +15 -0
- package/tools/manual_typings/seed/connect-livereload.d.ts +5 -0
- package/tools/manual_typings/seed/cssnano.d.ts +18 -0
- package/tools/manual_typings/seed/doiuse.d.ts +16 -0
- package/tools/manual_typings/seed/express-history-api-fallback.d.ts +18 -0
- package/tools/manual_typings/seed/istream.d.ts +10 -0
- package/tools/manual_typings/seed/karma.d.ts +12 -0
- package/tools/manual_typings/seed/merge-stream.d.ts +8 -0
- package/tools/manual_typings/seed/open.d.ts +8 -0
- package/tools/manual_typings/seed/postcss-reporter.d.ts +20 -0
- package/tools/manual_typings/seed/slash.d.ts +5 -0
- package/tools/manual_typings/seed/stylelint.d.ts +16 -0
- package/tools/manual_typings/seed/systemjs-builder.d.ts +10 -0
- package/tools/manual_typings/seed/tildify.d.ts +5 -0
- package/tools/manual_typings/seed/tiny-lr.d.ts +10 -0
- package/tools/manual_typings/seed/walk.d.ts +10 -0
- package/tools/scripts/install.speech-analytic.sh +35 -0
- package/tools/tasks/build.app.server.ts +57 -0
- package/tools/tasks/build.assets.dev.ts +19 -0
- package/tools/tasks/build.assets.prod.ts +31 -0
- package/tools/tasks/build.bundles.app.aot.ts +31 -0
- package/tools/tasks/build.bundles.app.rollup.aot.ts +101 -0
- package/tools/tasks/build.bundles.app.ts +31 -0
- package/tools/tasks/build.bundles.ts +45 -0
- package/tools/tasks/build.database.scripts.runner.ts +137 -0
- package/tools/tasks/build.database.scripts.ts +27 -0
- package/tools/tasks/build.flags.ts +9 -0
- package/tools/tasks/build.fonts.ts +9 -0
- package/tools/tasks/build.html_css.ts +126 -0
- package/tools/tasks/build.index.dev.ts +68 -0
- package/tools/tasks/build.index.prod.ts +64 -0
- package/tools/tasks/build.js.dev.ts +66 -0
- package/tools/tasks/build.js.prod.aot.ts +44 -0
- package/tools/tasks/build.js.prod.rollup.aot.ts +50 -0
- package/tools/tasks/build.js.prod.ts +40 -0
- package/tools/tasks/build.packages.prod.ts +19 -0
- package/tools/tasks/build.server.dev.ts +59 -0
- package/tools/tasks/build.server.prod.ts +31 -0
- package/tools/tasks/build.server.statics.ts +24 -0
- package/tools/tasks/build.skins.ts +51 -0
- package/tools/tasks/build.sme.prod.aot.ts +6 -0
- package/tools/tasks/build.sme.prod.rollup.aot.ts +6 -0
- package/tools/tasks/build.sme.prod.ts +6 -0
- package/tools/tasks/build.tar.prod.ts +17 -0
- package/tools/tasks/build.test.database.scripts.ts +52 -0
- package/tools/tasks/clean.dev.ts +7 -0
- package/tools/tasks/clean.prod.ts +7 -0
- package/tools/tasks/compile.ahead.prod.ts +65 -0
- package/tools/tasks/copy.client.js.prod.rollup.aot.ts +33 -0
- package/tools/tasks/copy.client.js.prod.ts +18 -0
- package/tools/tasks/copy.server.assets.ts +38 -0
- package/tools/tasks/copy.server.js.prod.ts +16 -0
- package/tools/tasks/css-lint.ts +58 -0
- package/tools/tasks/e2e.ts +32 -0
- package/tools/tasks/karma.run.ts +18 -0
- package/tools/tasks/karma.watch.ts +9 -0
- package/tools/tasks/minify.server.statics.ts +52 -0
- package/tools/tasks/server.prod.ts +6 -0
- package/tools/tasks/server.start.ts +6 -0
- package/tools/tasks/test.database.ts +6 -0
- package/tools/tasks/transpile.bundles.rollup.aot.ts +43 -0
- package/tools/tasks/tslint.ts +64 -0
- package/tools/tasks/watch.file.changes.dev.ts +37 -0
- package/tools/tasks/watch.key.press.dev.ts +116 -0
- package/tools/tasks/webdriver.ts +6 -0
- package/tools/utils/project/sample_util.ts +18 -0
- package/tools/utils/project.utils.ts +4 -0
- package/tools/utils/seed/build_optimizer.ts +26 -0
- package/tools/utils/seed/clean.ts +35 -0
- package/tools/utils/seed/code_change_tools.ts +38 -0
- package/tools/utils/seed/karma.start.ts +10 -0
- package/tools/utils/seed/server.ts +43 -0
- package/tools/utils/seed/sme.ts +51 -0
- package/tools/utils/seed/tasks_tools.ts +70 -0
- package/tools/utils/seed/template_locals.ts +64 -0
- package/tools/utils/seed/tsproject.ts +25 -0
- package/tools/utils/seed.utils.ts +11 -0
- package/tools/utils.ts +5 -0
- package/tsconfig.json +33 -0
- package/tslint.json +120 -0
- package/utils.ts +5 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
|
|
5
|
+
import { APP_CLIENT_SRC, TMP_CLIENT_DIR, TOOLS_DIR, BOOTSTRAP_MODULE_AOT, TEMPLATE_CONFIG } from '../config';
|
|
6
|
+
import { makeTsProject, TemplateLocalsBuilder } from '../utils';
|
|
7
|
+
|
|
8
|
+
const plugins = <any>gulpLoadPlugins();
|
|
9
|
+
|
|
10
|
+
const INLINE_OPTIONS = {
|
|
11
|
+
base: TMP_CLIENT_DIR,
|
|
12
|
+
useRelativePaths: true,
|
|
13
|
+
removeLineBreaks: true
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Executes the build process, transpiling the TypeScript files for the production environment.
|
|
18
|
+
*/
|
|
19
|
+
export = () => {
|
|
20
|
+
|
|
21
|
+
let tsProject = makeTsProject({}, APP_CLIENT_SRC);
|
|
22
|
+
|
|
23
|
+
let src = [
|
|
24
|
+
TOOLS_DIR + '/manual_typings/**/*.d.ts',
|
|
25
|
+
join(TMP_CLIENT_DIR, '**/*.ts'),
|
|
26
|
+
'!' + join(TMP_CLIENT_DIR, '/' + BOOTSTRAP_MODULE_AOT + '.ts'),
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
let result = gulp.src(src, { base: TMP_CLIENT_DIR })
|
|
30
|
+
.pipe(plugins.plumber())
|
|
31
|
+
.pipe(plugins.inlineNg2Template(INLINE_OPTIONS))
|
|
32
|
+
.pipe(tsProject())
|
|
33
|
+
.once('error', function () {
|
|
34
|
+
this.once('finish', () => process.exit(1));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return result.js
|
|
38
|
+
.pipe(plugins.template(new TemplateLocalsBuilder().withStringifiedSystemConfigDev().build(), TEMPLATE_CONFIG))
|
|
39
|
+
.pipe(gulp.dest(TMP_CLIENT_DIR));
|
|
40
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import { resolve } from 'path';
|
|
4
|
+
|
|
5
|
+
import { APP_SERVER_DEST } from '../config';
|
|
6
|
+
|
|
7
|
+
const plugins = <any>gulpLoadPlugins();
|
|
8
|
+
|
|
9
|
+
var jeditor = require('gulp-json-editor');
|
|
10
|
+
|
|
11
|
+
export = () => {
|
|
12
|
+
return gulp.src('package.json')
|
|
13
|
+
.pipe(jeditor(function(json: any) {
|
|
14
|
+
json.scripts = undefined;
|
|
15
|
+
json.devDependencies = undefined;
|
|
16
|
+
return json;
|
|
17
|
+
}))
|
|
18
|
+
.pipe(gulp.dest(resolve(APP_SERVER_DEST, '..')));
|
|
19
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import * as merge from 'merge-stream';
|
|
4
|
+
import * as log from 'fancy-log';
|
|
5
|
+
import { Chalk } from 'chalk';
|
|
6
|
+
import { join, resolve } from 'path';
|
|
7
|
+
|
|
8
|
+
import { APP_SERVER_SRC, APP_SERVER_DEST, TOOLS_DIR, TEMPLATE_CONFIG } from '../config';
|
|
9
|
+
import { makeTsProject, TemplateLocalsBuilder } from '../utils';
|
|
10
|
+
|
|
11
|
+
// Obtengo plugins de gulp
|
|
12
|
+
const chalk: Chalk = require('chalk');
|
|
13
|
+
const plugins = <any>gulpLoadPlugins();
|
|
14
|
+
|
|
15
|
+
// Flag de primera ejecución
|
|
16
|
+
let firstTime: boolean = true;
|
|
17
|
+
|
|
18
|
+
// Ejecuta transpile de los archivos typescript del servidor
|
|
19
|
+
export = () => {
|
|
20
|
+
// Proyecto de compilación TS
|
|
21
|
+
let tsProject: any;
|
|
22
|
+
// Archivos de typings locales
|
|
23
|
+
let typings = gulp.src([
|
|
24
|
+
TOOLS_DIR + '/manual_typings/**/*.d.ts'
|
|
25
|
+
]);
|
|
26
|
+
// Archivos a compilar
|
|
27
|
+
let projectFiles = gulp.src([
|
|
28
|
+
join(APP_SERVER_SRC, '**/*.ts'),
|
|
29
|
+
'!' + join(APP_SERVER_SRC, '**/*.spec.ts'),
|
|
30
|
+
'!' + join(APP_SERVER_SRC, '**/*.e2e-spec.ts'),
|
|
31
|
+
], { base: APP_SERVER_SRC });
|
|
32
|
+
|
|
33
|
+
// Solo uso los typings en la primer compilación
|
|
34
|
+
if (firstTime) {
|
|
35
|
+
// La primera vez ejecuto build usando los typings manuales
|
|
36
|
+
tsProject = makeTsProject({}, APP_SERVER_SRC);
|
|
37
|
+
projectFiles = merge(typings, projectFiles);
|
|
38
|
+
} else {
|
|
39
|
+
// Las siguientes los hago typeless para acelerar
|
|
40
|
+
tsProject = makeTsProject({ /* isolatedModules: true */ }, APP_SERVER_SRC);
|
|
41
|
+
projectFiles = projectFiles.pipe(plugins.cached());
|
|
42
|
+
log('Fastbuild ' + chalk.cyan('Ejecutando compilación typeless.'));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Actualizo flag
|
|
46
|
+
firstTime = false;
|
|
47
|
+
|
|
48
|
+
// Inicializo proyecto
|
|
49
|
+
let result: any = projectFiles
|
|
50
|
+
.pipe(plugins.plumber())
|
|
51
|
+
.pipe(plugins.sourcemaps.init())
|
|
52
|
+
.pipe(tsProject());
|
|
53
|
+
|
|
54
|
+
// Ejecuto la compilación y copio el resultado en carpeta destino
|
|
55
|
+
return result.js
|
|
56
|
+
.pipe(plugins.sourcemaps.write({ includeContent: false, sourceRoot: resolve('./src/server')}))
|
|
57
|
+
.pipe(plugins.template(new TemplateLocalsBuilder().withStringifiedSystemConfigDev().build(), TEMPLATE_CONFIG))
|
|
58
|
+
.pipe(gulp.dest(APP_SERVER_DEST));
|
|
59
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
|
|
5
|
+
import { TMP_SERVER_DIR, TOOLS_DIR, APP_SERVER_SRC, APP_SERVER_DEST, TEMPLATE_CONFIG } from '../config';
|
|
6
|
+
import { makeTsProject, TemplateLocalsBuilder } from '../utils';
|
|
7
|
+
|
|
8
|
+
const plugins = <any>gulpLoadPlugins();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Executes the build process, transpiling the TypeScript files for the production environment.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export = () => {
|
|
15
|
+
let tsProject = makeTsProject({}, APP_SERVER_SRC);
|
|
16
|
+
let src = [
|
|
17
|
+
TOOLS_DIR + '/manual_typings/**/*.d.ts',
|
|
18
|
+
join(TMP_SERVER_DIR, '**/*.ts')
|
|
19
|
+
];
|
|
20
|
+
let result = gulp.src(src, {base: TMP_SERVER_DIR})
|
|
21
|
+
.pipe(plugins.plumber())
|
|
22
|
+
.pipe(tsProject())
|
|
23
|
+
.once('error', function () {
|
|
24
|
+
this.once('finish', () => process.exit(1));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
return result.js
|
|
29
|
+
.pipe(plugins.template(new TemplateLocalsBuilder().withStringifiedSystemConfigDev().build(), TEMPLATE_CONFIG))
|
|
30
|
+
.pipe(gulp.dest(APP_SERVER_DEST));
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
|
|
5
|
+
import { APP_SERVER_DEST, TEMPLATE_CONFIG } from '../config';
|
|
6
|
+
import { TemplateLocalsBuilder, } from '../utils';
|
|
7
|
+
|
|
8
|
+
const plugins = <any>gulpLoadPlugins();
|
|
9
|
+
|
|
10
|
+
// Reemplaza todas las variables de template de los archivos estaticos del lado servidor
|
|
11
|
+
export = () => {
|
|
12
|
+
|
|
13
|
+
let src = [
|
|
14
|
+
join(APP_SERVER_DEST, 'static/css/*'),
|
|
15
|
+
join(APP_SERVER_DEST, 'static/html/*'),
|
|
16
|
+
join(APP_SERVER_DEST, 'static/js/*')
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
return gulp.src(src)
|
|
20
|
+
.pipe(plugins.template(new TemplateLocalsBuilder().withStringifiedSystemConfigDev().build(), TEMPLATE_CONFIG))
|
|
21
|
+
.pipe(gulp.dest(function(file) {
|
|
22
|
+
return file.base;
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as autoprefixer from 'autoprefixer';
|
|
2
|
+
import * as cssnano from 'cssnano';
|
|
3
|
+
import * as gulp from 'gulp';
|
|
4
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
5
|
+
import * as log from 'fancy-log';
|
|
6
|
+
import { Chalk } from 'chalk';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
BROWSER_LIST,
|
|
11
|
+
SKINS_SRC,
|
|
12
|
+
CSS_DEST,
|
|
13
|
+
ENV,
|
|
14
|
+
getPluginConfig,
|
|
15
|
+
} from '../config';
|
|
16
|
+
|
|
17
|
+
// Obtengo plugins de gulp
|
|
18
|
+
const plugins = <any>gulpLoadPlugins();
|
|
19
|
+
const chalk: Chalk = require('chalk');
|
|
20
|
+
|
|
21
|
+
const processors = [
|
|
22
|
+
autoprefixer({
|
|
23
|
+
browsers: BROWSER_LIST
|
|
24
|
+
})
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const reportPostCssError = (e: any) => log(chalk.red(e.message));
|
|
28
|
+
|
|
29
|
+
const isProd = ENV === 'prod';
|
|
30
|
+
|
|
31
|
+
if (isProd) {
|
|
32
|
+
processors.push(
|
|
33
|
+
cssnano({
|
|
34
|
+
discardComments: {removeAll: true},
|
|
35
|
+
discardUnused: false, // unsafe, see http://goo.gl/RtrzwF
|
|
36
|
+
zindex: false, // unsafe, see http://goo.gl/vZ4gbQ
|
|
37
|
+
reduceIdents: false // unsafe, see http://goo.gl/tNOPv0
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export = () => {
|
|
43
|
+
return gulp.src([
|
|
44
|
+
join(SKINS_SRC, '**', '*.scss'),
|
|
45
|
+
'!' + join(SKINS_SRC, '**', '_*.scss')
|
|
46
|
+
], {base: SKINS_SRC})
|
|
47
|
+
.pipe(plugins.sass(getPluginConfig('gulp-sass')).on('error', plugins.sass.logError))
|
|
48
|
+
.pipe(plugins.postcss(processors))
|
|
49
|
+
.on('error', reportPostCssError)
|
|
50
|
+
.pipe(gulp.dest(CSS_DEST));
|
|
51
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import { resolve, join } from 'path';
|
|
4
|
+
|
|
5
|
+
import { APP_NAME, APP_VERSION, DIST_DIR, DIST_PROD_DIR } from '../config';
|
|
6
|
+
|
|
7
|
+
const plugins = <any>gulpLoadPlugins();
|
|
8
|
+
|
|
9
|
+
export = () => {
|
|
10
|
+
return gulp.src(join(DIST_PROD_DIR, '**'), { base : DIST_PROD_DIR })
|
|
11
|
+
.pipe(plugins.rename(function(path: any) {
|
|
12
|
+
path.dirname = join('intermediate-component-sa', path.dirname);
|
|
13
|
+
}))
|
|
14
|
+
.pipe(plugins.tar(APP_NAME + '_' + APP_VERSION + '.tar'))
|
|
15
|
+
.pipe(plugins.gzip())
|
|
16
|
+
.pipe(gulp.dest(DIST_DIR));
|
|
17
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
3
|
+
import { resolve } from 'path';
|
|
4
|
+
import * as merge from 'merge-stream';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import { APP_NAME, APP_VERSION, DIST_DIR, APP_DATABASE_SRC } from '../config';
|
|
8
|
+
|
|
9
|
+
const plugins = <any>gulpLoadPlugins();
|
|
10
|
+
|
|
11
|
+
const scripts = {
|
|
12
|
+
database: resolve(APP_DATABASE_SRC, 'mssql', 'database.sql'),
|
|
13
|
+
procedures: resolve(APP_DATABASE_SRC, 'mssql', 'procedures', '**'),
|
|
14
|
+
tables: [
|
|
15
|
+
resolve(APP_DATABASE_SRC, 'mssql', 'tables', '**'),
|
|
16
|
+
resolve(APP_DATABASE_SRC, 'mssql', 'functions', '**'),
|
|
17
|
+
//resolve(APP_DATABASE_SRC, 'mssql', 'props.sql')
|
|
18
|
+
],
|
|
19
|
+
data: [
|
|
20
|
+
resolve(APP_DATABASE_SRC, 'mssql', 'data', '**')
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function createDataBaseScript() {
|
|
25
|
+
return gulp.src(scripts.database)
|
|
26
|
+
.pipe(plugins.count('## sql files selected for bundle'))
|
|
27
|
+
.pipe(plugins.concat(APP_NAME + '_' + APP_VERSION + '_testing_database.sql'))
|
|
28
|
+
.pipe(gulp.dest(resolve(DIST_DIR)));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function createProceduresScript() {
|
|
32
|
+
return gulp.src(scripts.procedures)
|
|
33
|
+
.pipe(plugins.count('## sql files selected for bundle'))
|
|
34
|
+
.pipe(plugins.concat(APP_NAME + '_' + APP_VERSION + '_testing_procedures.sql'))
|
|
35
|
+
.pipe(gulp.dest(resolve(DIST_DIR)));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function createTablesScript() {
|
|
39
|
+
return gulp.src(scripts.tables)
|
|
40
|
+
.pipe(plugins.count('## sql files selected for bundle'))
|
|
41
|
+
.pipe(plugins.concat(APP_NAME + '_' + APP_VERSION + '_testing_structure.sql'))
|
|
42
|
+
.pipe(gulp.dest(resolve(DIST_DIR)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function createDataScript() {
|
|
46
|
+
return gulp.src(scripts.data)
|
|
47
|
+
.pipe(plugins.count('## sql files selected for bundle'))
|
|
48
|
+
.pipe(plugins.concat(APP_NAME + '_' + APP_VERSION + '_testing_data.sql'))
|
|
49
|
+
.pipe(gulp.dest(resolve(DIST_DIR)));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export = () => merge(createDataBaseScript(), createTablesScript(), createDataScript(), createProceduresScript());
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PROD_CLIENT_DEST, PROD_SERVER_DEST, TMP_CLIENT_DIR } from '../config';
|
|
2
|
+
import { clean } from '../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Executes the build process, cleaning all files within the `/dist/dev` and `dist/tmp` directory.
|
|
6
|
+
*/
|
|
7
|
+
export = clean([PROD_CLIENT_DEST, PROD_SERVER_DEST, TMP_CLIENT_DIR]);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { main } from '@angular/compiler-cli/src/main';
|
|
3
|
+
import { readdirSync, readFileSync, writeFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { argv } from 'yargs';
|
|
6
|
+
|
|
7
|
+
import { TMP_CLIENT_DIR, PROJECT_ROOT, TOOLS_DIR, BOOTSTRAP_DIR, BOOTSTRAP_MAIN_AOT } from '../config';
|
|
8
|
+
|
|
9
|
+
const modifyFile = (path: string, mod: any = (f: string) => f) => {
|
|
10
|
+
// Leo el contenido del archivo
|
|
11
|
+
const file = readFileSync(path);
|
|
12
|
+
// Escribo el contenido modificado
|
|
13
|
+
writeFileSync(path, mod(file.toString()));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const updateCompilerOptions = (options: any, task: string) => {
|
|
17
|
+
// Actualizo propiedades del tsconfig
|
|
18
|
+
options.declaration = true;
|
|
19
|
+
options.sourceMap = false;
|
|
20
|
+
// Ajustes particulares para el caso rollup
|
|
21
|
+
if (task.indexOf('rollup') >= 0) {
|
|
22
|
+
options.module = 'es2015';
|
|
23
|
+
options.moduleResolution = 'node';
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export = (done: any) => {
|
|
28
|
+
|
|
29
|
+
// Hago ajustes en le tsconfig para compilacion AOT y rollup
|
|
30
|
+
modifyFile(join(TMP_CLIENT_DIR, 'tsconfig.json'), (content: string) => {
|
|
31
|
+
const parsed = JSON.parse(content);
|
|
32
|
+
const path = join(PROJECT_ROOT, TOOLS_DIR, 'manual_typings', 'project');
|
|
33
|
+
updateCompilerOptions(parsed.compilerOptions, argv._[0]);
|
|
34
|
+
parsed.files = parsed.files || [];
|
|
35
|
+
parsed.files = parsed.files.concat(
|
|
36
|
+
readdirSync(path)
|
|
37
|
+
.filter(f => f.endsWith('d.ts'))
|
|
38
|
+
.map(f => join(path, f))
|
|
39
|
+
);
|
|
40
|
+
parsed.files = parsed.files.filter((f: string, i: number) => parsed.files.indexOf(f) === i);
|
|
41
|
+
parsed.files.push(join(BOOTSTRAP_DIR, BOOTSTRAP_MAIN_AOT + '.ts'));
|
|
42
|
+
return JSON.stringify(parsed, null, 2);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Argumentos para la compilación
|
|
46
|
+
const args: string[] = [
|
|
47
|
+
'-p', join(TMP_CLIENT_DIR, 'tsconfig.json')
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
// Ejecuto la compilación
|
|
51
|
+
return Promise.resolve(main(args))
|
|
52
|
+
.then(result => {
|
|
53
|
+
// Verifico si la compilacion fue correcta
|
|
54
|
+
if (result > 0) {
|
|
55
|
+
console.error('Compilation failed');
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
.catch((err: any) => {
|
|
60
|
+
// Algo falló
|
|
61
|
+
console.error('Compilation failed');
|
|
62
|
+
console.error(err.stack);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
|
|
4
|
+
import { APP_CLIENT_SRC, TMP_CLIENT_DIR } from '../config';
|
|
5
|
+
|
|
6
|
+
const replace = require('gulp-replace');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Executes the build task, copying all TypeScript files over to the `dist/tmp` directory.
|
|
10
|
+
*/
|
|
11
|
+
export = () => {
|
|
12
|
+
return gulp.src([
|
|
13
|
+
join(APP_CLIENT_SRC, 'tsconfig.json'),
|
|
14
|
+
join(APP_CLIENT_SRC, '**/*.ts'),
|
|
15
|
+
join(APP_CLIENT_SRC, '**/*.js'),
|
|
16
|
+
'!' + join(APP_CLIENT_SRC, '**/*.spec.ts'),
|
|
17
|
+
'!' + join(APP_CLIENT_SRC, '**/*.e2e-spec.ts')
|
|
18
|
+
])
|
|
19
|
+
// import in dev mode: import * as moment from 'moment';
|
|
20
|
+
// import for rollup: import moment from 'moment';
|
|
21
|
+
.pipe(replace('import * as ace from \'brace\';', 'import ace from \'brace\';'))
|
|
22
|
+
.pipe(replace('import * as dragula from \'dragula\';', 'import dragula from \'dragula\';'))
|
|
23
|
+
.pipe(replace('import * as jspdf from \'jspdf\';', 'import jspdf from \'jspdf\';'))
|
|
24
|
+
.pipe(replace('import * as fullcalendar from \'fullcalendar\';', 'import fullcalendar from \'fullcalendar\';'))
|
|
25
|
+
.pipe(replace('import * as moment from \'moment\';', 'import moment from \'moment\';'))
|
|
26
|
+
.pipe(replace('import * as timezone from \'moment-timezone\';', 'import timezone from \'moment-timezone\';'))
|
|
27
|
+
.pipe(replace('import * as screenfull from \'screenfull\';', 'import screenfull from \'screenfull\';'))
|
|
28
|
+
.pipe(replace('import * as Shuffle from \'shufflejs\';', 'import Shuffle from \'shufflejs\';'))
|
|
29
|
+
.pipe(replace('import * as socketClient from \'socketClient\';', 'import socketClient from \'socketClient\';'))
|
|
30
|
+
.pipe(replace('import * as validator from \'validator\';', 'import validator from \'validator\';'))
|
|
31
|
+
//.pipe(replace('import * as XLSX from \'xlsx\';', 'import XLSX from \'xlsx\';'))
|
|
32
|
+
.pipe(gulp.dest(TMP_CLIENT_DIR));
|
|
33
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
|
|
4
|
+
import { APP_CLIENT_SRC, TMP_CLIENT_DIR } from '../config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Executes the build task, copying all TypeScript files over to the `dist/tmp` directory.
|
|
8
|
+
*/
|
|
9
|
+
export = () => {
|
|
10
|
+
return gulp.src([
|
|
11
|
+
join(APP_CLIENT_SRC, 'tsconfig.json'),
|
|
12
|
+
join(APP_CLIENT_SRC, '**/*.ts'),
|
|
13
|
+
join(APP_CLIENT_SRC, '**/*.js'),
|
|
14
|
+
'!' + join(APP_CLIENT_SRC, '**/*.spec.ts'),
|
|
15
|
+
'!' + join(APP_CLIENT_SRC, '**/*.e2e-spec.ts')
|
|
16
|
+
], { base: APP_CLIENT_SRC })
|
|
17
|
+
.pipe(gulp.dest(TMP_CLIENT_DIR));
|
|
18
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import * as log from 'fancy-log';
|
|
3
|
+
import { Chalk } from 'chalk';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
|
|
6
|
+
import { APP_SERVER_SRC, APP_SERVER_DEST } from '../config';
|
|
7
|
+
|
|
8
|
+
// Obtengo plugins de gulp
|
|
9
|
+
const chalk: Chalk = require('chalk');
|
|
10
|
+
|
|
11
|
+
// Flag de primera ejecución
|
|
12
|
+
let firstTime: boolean = true;
|
|
13
|
+
|
|
14
|
+
// Copia los archivos de la carpeta del servidor hacia el destino
|
|
15
|
+
export = () => {
|
|
16
|
+
|
|
17
|
+
// Armo la lista de carpeta origen
|
|
18
|
+
let src = gulp.src([
|
|
19
|
+
join(APP_SERVER_SRC, '**/*.*'),
|
|
20
|
+
'!' + join(APP_SERVER_SRC, '**/*.ts'),
|
|
21
|
+
'!' + join(APP_SERVER_SRC, 'static/libs/grapesjs/inconcert/**/*.js'),
|
|
22
|
+
'!' + join(APP_SERVER_SRC, 'static/libs/grapesjs/inconcert/**/*.css'),
|
|
23
|
+
'!' + join(APP_SERVER_SRC, 'static/libs/grapesjs/inconcert/**/*.scss'),
|
|
24
|
+
'!' + join(APP_SERVER_SRC, 'static/libs/grapesjs/countdown/**/*.js'),
|
|
25
|
+
'!' + join(APP_SERVER_SRC, 'static/libs/grapesjs/forms/**/*.js'),
|
|
26
|
+
...(firstTime ? [] : ['!' + join(APP_SERVER_SRC, 'template/views/**/*')]),
|
|
27
|
+
'!' + join(APP_SERVER_SRC, 'tsconfig.json')
|
|
28
|
+
], {base: APP_SERVER_SRC});
|
|
29
|
+
|
|
30
|
+
// Escribo a log
|
|
31
|
+
if (!firstTime) log('Fastbuild ' + chalk.cyan('Excluyendo carpeta de templates.'));
|
|
32
|
+
|
|
33
|
+
// Actualizo flag
|
|
34
|
+
firstTime = false;
|
|
35
|
+
|
|
36
|
+
// Copio los archivos a la carpeta destino
|
|
37
|
+
return src.pipe(gulp.dest(APP_SERVER_DEST));
|
|
38
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
|
|
4
|
+
import { APP_SERVER_SRC, TMP_SERVER_DIR } from '../config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Executes the build task, copying all TypeScript files over to the `dist/tmp` directory.
|
|
8
|
+
*/
|
|
9
|
+
export = () => {
|
|
10
|
+
return gulp.src([
|
|
11
|
+
join(APP_SERVER_SRC, '**/*.ts'),
|
|
12
|
+
'!' + join(APP_SERVER_SRC, '**/*.spec.ts'),
|
|
13
|
+
'!' + join(APP_SERVER_SRC, '**/*.e2e-spec.ts')
|
|
14
|
+
], {base: APP_SERVER_SRC})
|
|
15
|
+
.pipe(gulp.dest(TMP_SERVER_DIR));
|
|
16
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as colorguard from 'colorguard';
|
|
2
|
+
import * as doiuse from 'doiuse';
|
|
3
|
+
import * as gulp from 'gulp';
|
|
4
|
+
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
|
5
|
+
import * as merge from 'merge-stream';
|
|
6
|
+
import * as reporter from 'postcss-reporter';
|
|
7
|
+
import * as stylelint from 'stylelint';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
import { noop } from '../utils';
|
|
10
|
+
|
|
11
|
+
import { APP_ASSETS, APP_CLIENT_SRC, BROWSER_LIST, CSS_SRC, ENV, DEPENDENCIES, ENABLE_SCSS, COLOR_GUARD_WHITE_LIST, SASS_LINT_OPTIONS } from '../config';
|
|
12
|
+
|
|
13
|
+
const plugins = <any>gulpLoadPlugins();
|
|
14
|
+
|
|
15
|
+
const isProd = ENV === 'prod';
|
|
16
|
+
var stylesheetType = ENABLE_SCSS ? 'scss' : 'css';
|
|
17
|
+
|
|
18
|
+
const processors = [
|
|
19
|
+
doiuse({
|
|
20
|
+
browsers: BROWSER_LIST,
|
|
21
|
+
}),
|
|
22
|
+
colorguard({
|
|
23
|
+
whitelist: COLOR_GUARD_WHITE_LIST
|
|
24
|
+
}),
|
|
25
|
+
stylelint(),
|
|
26
|
+
reporter({clearMessages: true})
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
function lintComponentStylesheets() {
|
|
30
|
+
return gulp.src([
|
|
31
|
+
join(APP_CLIENT_SRC, '**', `*.${stylesheetType}`),
|
|
32
|
+
`!${join(APP_CLIENT_SRC, 'assets', '**', '*.scss')}`,
|
|
33
|
+
`!${join(CSS_SRC, '**', '*.css')}`
|
|
34
|
+
]).pipe(isProd ? plugins.cached('css-lint') : noop())
|
|
35
|
+
.pipe(ENABLE_SCSS ? plugins.sassLint(SASS_LINT_OPTIONS) : plugins.postcss(processors))
|
|
36
|
+
.pipe(ENABLE_SCSS ? plugins.sassLint.format() : noop())
|
|
37
|
+
.pipe(ENABLE_SCSS ? plugins.sassLint.failOnError() : noop());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function lintExternalStylesheets() {
|
|
41
|
+
return gulp.src(getExternalStylesheets().map(r => r.src))
|
|
42
|
+
.pipe(isProd ? plugins.cached('css-lint') : noop())
|
|
43
|
+
.pipe(ENABLE_SCSS ? plugins.sassLint(SASS_LINT_OPTIONS) : plugins.postcss(processors))
|
|
44
|
+
.pipe(ENABLE_SCSS ? plugins.sassLint.format() : noop())
|
|
45
|
+
.pipe(ENABLE_SCSS ? plugins.sassLint.failOnError() : noop());
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getExternalStylesheets() {
|
|
49
|
+
let stylesheets = ENABLE_SCSS ? DEPENDENCIES : APP_ASSETS;
|
|
50
|
+
return stylesheets
|
|
51
|
+
.filter(d => new RegExp(`\.${stylesheetType}$`)
|
|
52
|
+
.test(d.src) && !d.vendor);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Executes the build process, linting the component and external CSS files using `stylelint`.
|
|
57
|
+
*/
|
|
58
|
+
export = () => merge(lintComponentStylesheets(), lintExternalStylesheets());
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as gulp from 'gulp';
|
|
2
|
+
import { protractor } from 'gulp-protractor';
|
|
3
|
+
|
|
4
|
+
class Protractor {
|
|
5
|
+
server(port: number) {
|
|
6
|
+
return require('../../dist/dev/server').init(port, 'testing');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Executes the build process, running all e2e specs using `protractor`.
|
|
12
|
+
*/
|
|
13
|
+
export = (done: any) => {
|
|
14
|
+
new Protractor()
|
|
15
|
+
.server(9001)
|
|
16
|
+
.then((server: any) => {
|
|
17
|
+
gulp
|
|
18
|
+
.src([])
|
|
19
|
+
.pipe(protractor({
|
|
20
|
+
configFile: 'protractor.conf.js',
|
|
21
|
+
//args: ['--suite', 'login_only']
|
|
22
|
+
//args: ['--suite', 'login,login_logout']
|
|
23
|
+
args: ['--suite', 'user_add']
|
|
24
|
+
//args: ['--suite', 'phone_add']
|
|
25
|
+
//args: ['--suite', 'environment_add']
|
|
26
|
+
//args: ['--suite', 'login_logout_borrar']
|
|
27
|
+
//args: ['--suite', 'template_add']
|
|
28
|
+
//args: ['--suite', 'prueba']
|
|
29
|
+
})).on('error', (error: string) => { throw error; })
|
|
30
|
+
.on('end', () => { server.close(done); });
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { startKarma } from '../utils/seed/karma.start';
|
|
2
|
+
/**
|
|
3
|
+
* Executes the build process, running all unit tests using `karma`.
|
|
4
|
+
*/
|
|
5
|
+
export = (done: any) => {
|
|
6
|
+
return startKarma(done, {
|
|
7
|
+
preprocessors: {
|
|
8
|
+
'dist/**/!(*spec).js': ['coverage']
|
|
9
|
+
},
|
|
10
|
+
reporters: ['mocha', 'coverage'],
|
|
11
|
+
coverageReporter: {
|
|
12
|
+
dir: 'coverage/',
|
|
13
|
+
reporters: [
|
|
14
|
+
{ type: 'json', subdir: '.', file: 'coverage-final.json' }
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
};
|