intermediate-component-sa 1.1.0 → 1.1.1

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.
Files changed (163) hide show
  1. package/app.server.js +7 -0
  2. package/client/css/main.css +1 -0
  3. package/{src/client → client}/index.html +6 -40
  4. package/client/js/app.js +1 -0
  5. package/client/js/shims.js +17 -0
  6. package/{src/client → client}/tsconfig.json +0 -0
  7. package/package.json +75 -340
  8. package/{src/server/config/app.config.ts → server/config/app.config.js} +47 -57
  9. package/server/config/jwt.config.js +4 -0
  10. package/{src/server/config/logger.config.ts → server/config/logger.config.js} +142 -161
  11. package/server/config/mssql.config.js +32 -0
  12. package/server/config/redis.config.js +8 -0
  13. package/server/config/server.config.js +12 -0
  14. package/server/config/templates.config.js +23 -0
  15. package/server/crypt.js +29 -0
  16. package/server/customRequest.js +370 -0
  17. package/server/index.js +125 -0
  18. package/server/interfaces/cleaner.interface.js +2 -0
  19. package/server/interfaces/supervisor.interface.js +2 -0
  20. package/{src/server/routes-centralized.ts → server/routes-centralized.js} +37 -36
  21. package/server/routes.js +7 -0
  22. package/server/services/index.js +8 -0
  23. package/server/services/routes.service.js +18 -0
  24. package/server/shared/file-manager.js +616 -0
  25. package/server/shared/http.shared.js +39 -0
  26. package/server/shared/promises.shared.js +14 -0
  27. package/server/shared/security.shared.js +52 -0
  28. package/{src/server → server}/ssl/star_inconcertcc_com.key +0 -0
  29. package/{src/server → server}/ssl/star_inconcertcc_com.pem +0 -0
  30. package/CHANGELOG.md +0 -11
  31. package/README.md +0 -1
  32. package/build-dev.bat +0 -2
  33. package/build-prod-aot.bat +0 -2
  34. package/build-prod-rollup-aot.bat +0 -2
  35. package/build-prod.bat +0 -2
  36. package/config.ts +0 -4
  37. package/gulpfile.ts +0 -172
  38. package/index.js +0 -12
  39. package/karma.conf.js +0 -124
  40. package/postgrator-test.json +0 -9
  41. package/postgrator.json +0 -9
  42. package/src/app.server.ts +0 -4
  43. package/src/client/app/app.component.ts +0 -37
  44. package/src/client/app/app.html +0 -6
  45. package/src/client/app/app.module.ts +0 -36
  46. package/src/client/app/app.routing.ts +0 -7
  47. package/src/client/app/hot_loader_main.ts +0 -14
  48. package/src/client/app/main-aot.ts +0 -8
  49. package/src/client/app/main.ts +0 -8
  50. package/src/client/app/rxjs-operators.ts +0 -15
  51. package/src/server/config/jwt.config.ts +0 -4
  52. package/src/server/config/mssql.config.ts +0 -30
  53. package/src/server/config/redis.config.ts +0 -10
  54. package/src/server/config/server.config.ts +0 -20
  55. package/src/server/config/templates.config.ts +0 -41
  56. package/src/server/crypt.ts +0 -37
  57. package/src/server/customRequest.ts +0 -609
  58. package/src/server/index.ts +0 -231
  59. package/src/server/interfaces/cleaner.interface.ts +0 -3
  60. package/src/server/interfaces/supervisor.interface.ts +0 -3
  61. package/src/server/routes.ts +0 -6
  62. package/src/server/services/index.ts +0 -10
  63. package/src/server/services/routes.service.ts +0 -11
  64. package/src/server/shared/file-manager.ts +0 -1007
  65. package/src/server/shared/http.shared.ts +0 -49
  66. package/src/server/shared/promises.shared.ts +0 -13
  67. package/src/server/shared/security.shared.ts +0 -90
  68. package/src/server/tsconfig.json +0 -38
  69. package/tools/build.js.prod.ts +0 -40
  70. package/tools/config/project.config.ts +0 -718
  71. package/tools/config.ts +0 -4
  72. package/tools/database/SchemaZen.exe +0 -0
  73. package/tools/database/generate-all-data-scripts.bat +0 -32
  74. package/tools/database/generate-database-scripts.bat +0 -36
  75. package/tools/debug.ts +0 -17
  76. package/tools/env/base.ts +0 -8
  77. package/tools/env/dev.ts +0 -9
  78. package/tools/env/env-config.interface.ts +0 -1
  79. package/tools/env/prod.ts +0 -10
  80. package/tools/manual_typings/project/sample.package.d.ts +0 -3
  81. package/tools/manual_typings/seed/angular2-hot-loader.d.ts +0 -9
  82. package/tools/manual_typings/seed/autoprefixer.d.ts +0 -13
  83. package/tools/manual_typings/seed/colorguard.d.ts +0 -15
  84. package/tools/manual_typings/seed/connect-livereload.d.ts +0 -5
  85. package/tools/manual_typings/seed/cssnano.d.ts +0 -18
  86. package/tools/manual_typings/seed/doiuse.d.ts +0 -16
  87. package/tools/manual_typings/seed/express-history-api-fallback.d.ts +0 -18
  88. package/tools/manual_typings/seed/istream.d.ts +0 -10
  89. package/tools/manual_typings/seed/karma.d.ts +0 -12
  90. package/tools/manual_typings/seed/merge-stream.d.ts +0 -8
  91. package/tools/manual_typings/seed/open.d.ts +0 -8
  92. package/tools/manual_typings/seed/postcss-reporter.d.ts +0 -20
  93. package/tools/manual_typings/seed/slash.d.ts +0 -5
  94. package/tools/manual_typings/seed/stylelint.d.ts +0 -16
  95. package/tools/manual_typings/seed/systemjs-builder.d.ts +0 -10
  96. package/tools/manual_typings/seed/tildify.d.ts +0 -5
  97. package/tools/manual_typings/seed/tiny-lr.d.ts +0 -10
  98. package/tools/manual_typings/seed/walk.d.ts +0 -10
  99. package/tools/scripts/install.speech-analytic.sh +0 -35
  100. package/tools/tasks/build.app.server.ts +0 -57
  101. package/tools/tasks/build.assets.dev.ts +0 -19
  102. package/tools/tasks/build.assets.prod.ts +0 -31
  103. package/tools/tasks/build.bundles.app.aot.ts +0 -31
  104. package/tools/tasks/build.bundles.app.rollup.aot.ts +0 -101
  105. package/tools/tasks/build.bundles.app.ts +0 -31
  106. package/tools/tasks/build.bundles.ts +0 -45
  107. package/tools/tasks/build.database.scripts.runner.ts +0 -137
  108. package/tools/tasks/build.database.scripts.ts +0 -27
  109. package/tools/tasks/build.flags.ts +0 -9
  110. package/tools/tasks/build.fonts.ts +0 -9
  111. package/tools/tasks/build.html_css.ts +0 -126
  112. package/tools/tasks/build.index.dev.ts +0 -68
  113. package/tools/tasks/build.index.prod.ts +0 -64
  114. package/tools/tasks/build.js.dev.ts +0 -66
  115. package/tools/tasks/build.js.prod.aot.ts +0 -44
  116. package/tools/tasks/build.js.prod.rollup.aot.ts +0 -50
  117. package/tools/tasks/build.js.prod.ts +0 -40
  118. package/tools/tasks/build.packages.prod.ts +0 -19
  119. package/tools/tasks/build.server.dev.ts +0 -59
  120. package/tools/tasks/build.server.prod.ts +0 -31
  121. package/tools/tasks/build.server.statics.ts +0 -24
  122. package/tools/tasks/build.skins.ts +0 -51
  123. package/tools/tasks/build.sme.prod.aot.ts +0 -6
  124. package/tools/tasks/build.sme.prod.rollup.aot.ts +0 -6
  125. package/tools/tasks/build.sme.prod.ts +0 -6
  126. package/tools/tasks/build.tar.prod.ts +0 -17
  127. package/tools/tasks/build.test.database.scripts.ts +0 -52
  128. package/tools/tasks/clean.dev.ts +0 -7
  129. package/tools/tasks/clean.prod.ts +0 -7
  130. package/tools/tasks/compile.ahead.prod.ts +0 -65
  131. package/tools/tasks/copy.client.js.prod.rollup.aot.ts +0 -33
  132. package/tools/tasks/copy.client.js.prod.ts +0 -18
  133. package/tools/tasks/copy.server.assets.ts +0 -38
  134. package/tools/tasks/copy.server.js.prod.ts +0 -16
  135. package/tools/tasks/css-lint.ts +0 -58
  136. package/tools/tasks/e2e.ts +0 -32
  137. package/tools/tasks/karma.run.ts +0 -18
  138. package/tools/tasks/karma.watch.ts +0 -9
  139. package/tools/tasks/minify.server.statics.ts +0 -52
  140. package/tools/tasks/server.prod.ts +0 -6
  141. package/tools/tasks/server.start.ts +0 -6
  142. package/tools/tasks/test.database.ts +0 -6
  143. package/tools/tasks/transpile.bundles.rollup.aot.ts +0 -43
  144. package/tools/tasks/tslint.ts +0 -64
  145. package/tools/tasks/watch.file.changes.dev.ts +0 -37
  146. package/tools/tasks/watch.key.press.dev.ts +0 -116
  147. package/tools/tasks/webdriver.ts +0 -6
  148. package/tools/utils/project/sample_util.ts +0 -18
  149. package/tools/utils/project.utils.ts +0 -4
  150. package/tools/utils/seed/build_optimizer.ts +0 -26
  151. package/tools/utils/seed/clean.ts +0 -35
  152. package/tools/utils/seed/code_change_tools.ts +0 -38
  153. package/tools/utils/seed/karma.start.ts +0 -10
  154. package/tools/utils/seed/server.ts +0 -43
  155. package/tools/utils/seed/sme.ts +0 -51
  156. package/tools/utils/seed/tasks_tools.ts +0 -70
  157. package/tools/utils/seed/template_locals.ts +0 -64
  158. package/tools/utils/seed/tsproject.ts +0 -25
  159. package/tools/utils/seed.utils.ts +0 -11
  160. package/tools/utils.ts +0 -5
  161. package/tsconfig.json +0 -33
  162. package/tslint.json +0 -120
  163. package/utils.ts +0 -5
@@ -1,40 +0,0 @@
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
- };
@@ -1,19 +0,0 @@
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
- };
@@ -1,59 +0,0 @@
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
- };
@@ -1,31 +0,0 @@
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
- };
@@ -1,24 +0,0 @@
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
- };
@@ -1,51 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
1
- import { createSME } from '../utils';
2
-
3
- /**
4
- * Executes the build process, builds source-map-explorer report
5
- */
6
- export = createSME('prod.aot');
@@ -1,6 +0,0 @@
1
- import { createSME } from '../utils';
2
-
3
- /**
4
- * Executes the build process, builds source-map-explorer report
5
- */
6
- export = createSME('prod.rollup.aot');
@@ -1,6 +0,0 @@
1
- import { createSME } from '../utils';
2
-
3
- /**
4
- * Executes the build process, builds source-map-explorer report
5
- */
6
- export = createSME('prod');
@@ -1,17 +0,0 @@
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
- };
@@ -1,52 +0,0 @@
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());
@@ -1,7 +0,0 @@
1
- import { DEV_CLIENT_DEST, DEV_SERVER_DEST } from '../config';
2
- import { clean } from '../utils';
3
-
4
- /**
5
- * Executes the build process, cleaning all files within the `/dist/dev` directory.
6
- */
7
- export = clean([DEV_CLIENT_DEST, DEV_SERVER_DEST]);
@@ -1,7 +0,0 @@
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]);
@@ -1,65 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,18 +0,0 @@
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
- };
@@ -1,38 +0,0 @@
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
- };
@@ -1,16 +0,0 @@
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
- };
@@ -1,58 +0,0 @@
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());
@@ -1,32 +0,0 @@
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
- };
@@ -1,18 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
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
- singleRun: false
8
- });
9
- };