@eui/cli 15.4.1 → 15.4.2

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 (198) hide show
  1. package/.version.properties +1 -1
  2. package/LICENSE +296 -296
  3. package/README.md +26 -26
  4. package/bin/eui-cli.js +70 -70
  5. package/lib/build.js +153 -153
  6. package/lib/cli.js +111 -111
  7. package/lib/config.js +54 -54
  8. package/lib/generators.js +64 -64
  9. package/lib/install.js +54 -54
  10. package/lib/maven-build/build.xml +115 -115
  11. package/lib/maven-build/pom.xml +64 -64
  12. package/lib/post-build.js +33 -33
  13. package/lib/skeletons/_angular/base/.browserslistrc +16 -16
  14. package/lib/skeletons/_angular/base/.editorconfig +16 -16
  15. package/lib/skeletons/_angular/base/.euirc.json +8 -8
  16. package/lib/skeletons/_angular/base/.stylelintrc +24 -24
  17. package/lib/skeletons/_angular/base/README.md +26 -26
  18. package/lib/skeletons/_angular/base/angular.json +176 -176
  19. package/lib/skeletons/_angular/base/gitignore_TO_REPLACE +50 -50
  20. package/lib/skeletons/_angular/base/mock/app/models/user.js +8 -8
  21. package/lib/skeletons/_angular/base/mock/app/routes/index.js +5 -5
  22. package/lib/skeletons/_angular/base/mock/app/routes/user_routes.js +24 -24
  23. package/lib/skeletons/_angular/base/mock/db/db.json +12 -12
  24. package/lib/skeletons/_angular/base/mock/server.js +21 -21
  25. package/lib/skeletons/_angular/base/package.json +24 -24
  26. package/lib/skeletons/_angular/base/proxy-mock.conf.json +6 -6
  27. package/lib/skeletons/_angular/base/proxy.conf.json +6 -6
  28. package/lib/skeletons/_angular/base/src/.eslintrc.json +118 -118
  29. package/lib/skeletons/_angular/base/src/app/app-routing.module.ts +17 -17
  30. package/lib/skeletons/_angular/base/src/app/app-starter.service.ts +66 -66
  31. package/lib/skeletons/_angular/base/src/app/app.component.html +29 -29
  32. package/lib/skeletons/_angular/base/src/app/app.component.ts +51 -51
  33. package/lib/skeletons/_angular/base/src/app/app.module.ts +35 -35
  34. package/lib/skeletons/_angular/base/src/app/core/core.module.ts +87 -87
  35. package/lib/skeletons/_angular/base/src/app/core/reducers/index.ts +31 -31
  36. package/lib/skeletons/_angular/base/src/app/features/home/home-routing.module.ts +15 -15
  37. package/lib/skeletons/_angular/base/src/app/features/home/home.component.html +39 -39
  38. package/lib/skeletons/_angular/base/src/app/features/home/home.component.ts +11 -11
  39. package/lib/skeletons/_angular/base/src/app/features/home/home.module.ts +18 -18
  40. package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.html +7 -7
  41. package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.ts +7 -7
  42. package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.html +7 -7
  43. package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.ts +7 -7
  44. package/lib/skeletons/_angular/base/src/app/features/module1/module1-routing.module.ts +18 -18
  45. package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.html +7 -7
  46. package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.ts +8 -8
  47. package/lib/skeletons/_angular/base/src/app/features/module1/module1.module.ts +21 -21
  48. package/lib/skeletons/_angular/base/src/app/features/module2/module2-routing.module.ts +16 -16
  49. package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.html +7 -7
  50. package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.ts +7 -7
  51. package/lib/skeletons/_angular/base/src/app/features/module2/module2.module.ts +17 -17
  52. package/lib/skeletons/_angular/base/src/app/shared/shared.module.ts +45 -45
  53. package/lib/skeletons/_angular/base/src/app/shared/testing/router.mock.ts +18 -18
  54. package/lib/skeletons/_angular/base/src/assets/config/env-json-config-dev.json +8 -8
  55. package/lib/skeletons/_angular/base/src/assets/config/env-json-config-prod.json +8 -8
  56. package/lib/skeletons/_angular/base/src/assets/config/env-json-config.json +7 -7
  57. package/lib/skeletons/_angular/base/src/assets/i18n/en.json +6 -6
  58. package/lib/skeletons/_angular/base/src/assets/i18n/fr.json +6 -6
  59. package/lib/skeletons/_angular/base/src/config/global.ts +20 -20
  60. package/lib/skeletons/_angular/base/src/config/index.ts +8 -8
  61. package/lib/skeletons/_angular/base/src/config/modules.ts +7 -7
  62. package/lib/skeletons/_angular/base/src/dummy.spec.ts +6 -6
  63. package/lib/skeletons/_angular/base/src/environments/environment.prod.ts +11 -11
  64. package/lib/skeletons/_angular/base/src/environments/environment.ts +11 -11
  65. package/lib/skeletons/_angular/base/src/index.html +21 -21
  66. package/lib/skeletons/_angular/base/src/karma.conf.js +7 -7
  67. package/lib/skeletons/_angular/base/src/main.ts +14 -14
  68. package/lib/skeletons/_angular/base/src/polyfills.ts +89 -89
  69. package/lib/skeletons/_angular/base/src/styles.scss +1 -1
  70. package/lib/skeletons/_angular/base/src/tsconfig.app.json +18 -18
  71. package/lib/skeletons/_angular/base/src/tsconfig.spec.json +14 -14
  72. package/lib/skeletons/_angular/base/tsconfig.json +27 -27
  73. package/lib/skeletons/_angular/base-mobile/angular.json +160 -160
  74. package/lib/skeletons/_angular/base-mobile/ionic.config.json +5 -5
  75. package/lib/skeletons/_angular/base-mobile/ngsw-config.json +33 -33
  76. package/lib/skeletons/_angular/base-mobile/package.json +28 -28
  77. package/lib/skeletons/_angular/base-mobile/src/app/app-routing.module.ts +17 -17
  78. package/lib/skeletons/_angular/base-mobile/src/app/app-starter.service.ts +73 -73
  79. package/lib/skeletons/_angular/base-mobile/src/app/app.component.html +27 -27
  80. package/lib/skeletons/_angular/base-mobile/src/app/app.component.ts +55 -55
  81. package/lib/skeletons/_angular/base-mobile/src/app/app.module.ts +44 -44
  82. package/lib/skeletons/_angular/base-mobile/src/app/core/core.module.ts +89 -89
  83. package/lib/skeletons/_angular/base-mobile/src/app/core/reducers/index.ts +31 -31
  84. package/lib/skeletons/_angular/base-mobile/src/app/features/home/home-routing.module.ts +15 -15
  85. package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.component.html +14 -14
  86. package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.component.ts +11 -11
  87. package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.module.ts +18 -18
  88. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page1/page1.component.html +11 -11
  89. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page1/page1.component.ts +7 -7
  90. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page2/page2.component.html +11 -11
  91. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page2/page2.component.ts +7 -7
  92. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1-routing.module.ts +18 -18
  93. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.component.html +15 -15
  94. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.component.ts +17 -17
  95. package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.module.ts +21 -21
  96. package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2-routing.module.ts +16 -16
  97. package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.component.html +11 -11
  98. package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.component.ts +7 -7
  99. package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.module.ts +17 -17
  100. package/lib/skeletons/_angular/base-mobile/src/app/shared/shared.module.ts +16 -16
  101. package/lib/skeletons/_angular/base-mobile/src/app/shared/testing/router.mock.ts +18 -18
  102. package/lib/skeletons/_angular/base-mobile/src/index.html +27 -27
  103. package/lib/skeletons/_angular/base-mobile/src/manifest.webmanifest +51 -51
  104. package/lib/skeletons/_angular/base-mobile/src/tsconfig.app.json +19 -19
  105. package/lib/skeletons/_angular/options/ecl/angular.json +193 -193
  106. package/lib/skeletons/_angular/options/ecl/src/app/app.component.html +262 -262
  107. package/lib/skeletons/_angular/options/ecl/src/app/app.component.ts +59 -59
  108. package/lib/skeletons/_angular/options/ecl/src/app/features/home/home.component.html +70 -70
  109. package/lib/skeletons/_angular/options/ecl/src/app/features/module1/components/page1/page1.component.html +1 -1
  110. package/lib/skeletons/_angular/options/ecl/src/app/features/module1/components/page2/page2.component.html +1 -1
  111. package/lib/skeletons/_angular/options/ecl/src/app/features/module1/module1.component.html +1 -1
  112. package/lib/skeletons/_angular/options/ecl/src/app/features/module2/module2.component.html +1 -1
  113. package/lib/skeletons/_angular/options/ecl/src/app/shared/shared.module.ts +19 -19
  114. package/lib/skeletons/_angular/options/ecl/src/config/global.ts +20 -20
  115. package/lib/skeletons/_angular/options/openid-jwt/package.json +22 -22
  116. package/lib/skeletons/_angular/options/openid-jwt/src/app/core/core.module.ts +94 -94
  117. package/lib/skeletons/_angular/options/openid-jwt/src/assets/config/env-json-config-dev.json +24 -24
  118. package/lib/skeletons/_angular/options/openid-jwt/src/assets/config/env-json-config-local-mock.json +10 -10
  119. package/lib/skeletons/_angular/options/openid-jwt/src/assets/config/env-json-config-local.json +23 -23
  120. package/lib/skeletons/_angular/options/openid-jwt/src/assets/config/env-json-config-prod.json +23 -23
  121. package/lib/skeletons/_angular/options/openid-jwt/src/assets/config/env-json-config.json +10 -10
  122. package/lib/skeletons/_angular/options/openid-jwt/src/environments/environment.prod.ts +11 -11
  123. package/lib/skeletons/_angular/options/openid-jwt/src/environments/environment.ts +11 -11
  124. package/lib/skeletons/_angular/options/openid-jwt/src/index.html +21 -21
  125. package/lib/skeletons/web-maven/package.json +17 -17
  126. package/lib/skeletons/web-maven/pom.xml +55 -55
  127. package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/servlet/SpringWebApplicationInitializer.java +22 -22
  128. package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/spring/SpringRestConfiguration.java +24 -24
  129. package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/spring/rest/UserDetailsResource.java +23 -23
  130. package/lib/skeletons/web-maven/src/main/resources/ecas-config-application-name.xml +7 -7
  131. package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/dispatcher-servlet.xml +10 -10
  132. package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/web.xml +38 -38
  133. package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/weblogic.xml +15 -15
  134. package/lib/skeletons/web-maven/src/main/webapp/index.jsp +29 -29
  135. package/lib/skeletons/web-spring-boot/myapp-web/pom.xml +77 -77
  136. package/lib/skeletons/web-spring-boot/myapp-web-rest/pom.xml +84 -84
  137. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/MyappApplication.java +46 -46
  138. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/domain/Address.java +65 -65
  139. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/domain/Building.java +44 -44
  140. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/repositories/BuildingRepository.java +10 -10
  141. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/BuildingResource.java +26 -26
  142. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/SwaggerConfig.java +20 -20
  143. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/HateoasPageableHandlerMethodArgumentResolver.java +45 -45
  144. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/HypermediaSupport.java +25 -25
  145. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/PageJsonSerializer.java +17 -17
  146. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/CachingPreventionFilter.java +29 -29
  147. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/CsrfPreventionFilter.java +35 -35
  148. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/FakeAuthenticationFilter.java +372 -372
  149. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/SecurityConfig.java +47 -47
  150. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingSearchCriteria.java +25 -25
  151. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingService.java +9 -9
  152. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingServiceImpl.java +25 -25
  153. package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/resources/data.sql +10 -10
  154. package/lib/skeletons/web-spring-boot/pom.xml +30 -30
  155. package/lib/skeletons/web-symfony/myapp-web/angular.json +170 -170
  156. package/lib/skeletons/web-symfony/myapp-web/package.json +23 -23
  157. package/lib/skeletons/web-symfony/myapp-web/src/app/app-routing.module.ts +18 -18
  158. package/lib/skeletons/web-symfony/myapp-web/src/app/app.component.ts +77 -77
  159. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.html +160 -160
  160. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.ts +104 -104
  161. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/models/product.model.ts +6 -6
  162. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products-routing.module.ts +16 -16
  163. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products.module.ts +16 -16
  164. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/services/products.service.ts +29 -29
  165. package/lib/skeletons/web-symfony/myapp-web/src/environments/environment.ts +17 -17
  166. package/lib/skeletons/web-symfony/myapp-web-rest/.env +28 -28
  167. package/lib/skeletons/web-symfony/myapp-web-rest/bin/console +42 -42
  168. package/lib/skeletons/web-symfony/myapp-web-rest/composer.json +67 -67
  169. package/lib/skeletons/web-symfony/myapp-web-rest/composer.lock +3572 -3572
  170. package/lib/skeletons/web-symfony/myapp-web-rest/config/bootstrap.php +21 -21
  171. package/lib/skeletons/web-symfony/myapp-web-rest/config/bundles.php +12 -12
  172. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/cache.yaml +19 -19
  173. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/dev/routing.yaml +3 -3
  174. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine.yaml +29 -29
  175. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine_migrations.yaml +5 -5
  176. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/framework.yaml +17 -17
  177. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/prod/doctrine.yaml +32 -32
  178. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/routing.yaml +4 -4
  179. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/sensio_framework_extra.yaml +3 -3
  180. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/framework.yaml +4 -4
  181. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/routing.yaml +3 -3
  182. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/twig.yaml +4 -4
  183. package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/annotations.yaml +3 -3
  184. package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/dev/twig.yaml +3 -3
  185. package/lib/skeletons/web-symfony/myapp-web-rest/config/routes.yaml +3 -3
  186. package/lib/skeletons/web-symfony/myapp-web-rest/config/services.yaml +27 -27
  187. package/lib/skeletons/web-symfony/myapp-web-rest/public/index.php +27 -27
  188. package/lib/skeletons/web-symfony/myapp-web-rest/src/Controller/ProductController.php +196 -196
  189. package/lib/skeletons/web-symfony/myapp-web-rest/src/Entity/Product.php +99 -99
  190. package/lib/skeletons/web-symfony/myapp-web-rest/src/Kernel.php +53 -53
  191. package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101623.php +31 -31
  192. package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101638.php +35 -35
  193. package/lib/skeletons/web-symfony/myapp-web-rest/src/Repository/ProductRepository.php +51 -51
  194. package/lib/skeletons/web-symfony/myapp-web-rest/symfony.lock +274 -274
  195. package/lib/skeletons/web-symfony/myapp-web-rest/templates/base.html.twig +12 -12
  196. package/lib/skeletons/web-symfony/myapp-web-rest/templates/product/index.html.twig +20 -20
  197. package/lib/utils.js +17 -17
  198. package/package.json +3 -3
package/lib/config.js CHANGED
@@ -1,54 +1,54 @@
1
- const path = require('path');
2
-
3
- const skeletonsPath = path.join(__dirname, 'skeletons');
4
- const version = require(path.join(__dirname, '../package.json')).version;
5
-
6
- module.exports.targetPath = path.resolve(process.cwd());
7
- module.exports.skeletonsPath = skeletonsPath;
8
-
9
- module.exports.angularBasePath = path.join(skeletonsPath, '_angular/base');
10
- module.exports.angularBaseMobilePath = path.join(skeletonsPath, '_angular/base-mobile');
11
-
12
- module.exports.webMavenPath = path.join(skeletonsPath, 'web-maven');
13
- module.exports.webSpringBootPath = path.join(skeletonsPath, 'web-spring-boot');
14
-
15
- module.exports.webPhpStarterRepo = 'webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-php-starter.git'
16
- module.exports.webSymfonyPath = path.join(skeletonsPath, 'web-symfony');
17
-
18
- module.exports.optionsPath = {
19
- "openid-jwt": path.join(skeletonsPath, '_angular/options/openid-jwt'),
20
- "ecl": path.join(skeletonsPath, '_angular/options/ecl'),
21
- };
22
-
23
- module.exports.version = version;
24
-
25
-
26
- module.exports.parseInputConfig = (inputConfig) => {
27
-
28
- if (!inputConfig) {
29
- return;
30
- }
31
-
32
- const configArray = inputConfig.split(',').map(item => {
33
- const x = item.split(':');
34
-
35
- var value = x[1];
36
-
37
- // treating text to boolean values : f.e. : npmInstall=true
38
- if (value === 'true') {
39
- value = true;
40
- }
41
- if (value === 'false') {
42
- value = false;
43
- }
44
-
45
- // treating string array values : f.e. : appFeatures=feature1_feature2_feature3
46
- if (typeof value === 'string' && value.indexOf('_')) {
47
- value = value.split('_');
48
- }
49
-
50
- return { [x[0]]: value };
51
- });
52
-
53
- return Object.assign({}, ...configArray);
54
- }
1
+ const path = require('path');
2
+
3
+ const skeletonsPath = path.join(__dirname, 'skeletons');
4
+ const version = require(path.join(__dirname, '../package.json')).version;
5
+
6
+ module.exports.targetPath = path.resolve(process.cwd());
7
+ module.exports.skeletonsPath = skeletonsPath;
8
+
9
+ module.exports.angularBasePath = path.join(skeletonsPath, '_angular/base');
10
+ module.exports.angularBaseMobilePath = path.join(skeletonsPath, '_angular/base-mobile');
11
+
12
+ module.exports.webMavenPath = path.join(skeletonsPath, 'web-maven');
13
+ module.exports.webSpringBootPath = path.join(skeletonsPath, 'web-spring-boot');
14
+
15
+ module.exports.webPhpStarterRepo = 'webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-php-starter.git'
16
+ module.exports.webSymfonyPath = path.join(skeletonsPath, 'web-symfony');
17
+
18
+ module.exports.optionsPath = {
19
+ "openid-jwt": path.join(skeletonsPath, '_angular/options/openid-jwt'),
20
+ "ecl": path.join(skeletonsPath, '_angular/options/ecl'),
21
+ };
22
+
23
+ module.exports.version = version;
24
+
25
+
26
+ module.exports.parseInputConfig = (inputConfig) => {
27
+
28
+ if (!inputConfig) {
29
+ return;
30
+ }
31
+
32
+ const configArray = inputConfig.split(',').map(item => {
33
+ const x = item.split(':');
34
+
35
+ var value = x[1];
36
+
37
+ // treating text to boolean values : f.e. : npmInstall=true
38
+ if (value === 'true') {
39
+ value = true;
40
+ }
41
+ if (value === 'false') {
42
+ value = false;
43
+ }
44
+
45
+ // treating string array values : f.e. : appFeatures=feature1_feature2_feature3
46
+ if (typeof value === 'string' && value.indexOf('_')) {
47
+ value = value.split('_');
48
+ }
49
+
50
+ return { [x[0]]: value };
51
+ });
52
+
53
+ return Object.assign({}, ...configArray);
54
+ }
package/lib/generators.js CHANGED
@@ -1,64 +1,64 @@
1
- const chalk = require('chalk');
2
- const cli = require('./cli');
3
- const build = require('./build');
4
- const postBuild = require('./post-build');
5
- const install = require('./install');
6
-
7
- const appGenerate = (options) => {
8
- console.info(chalk.cyan('Configuring your project : please answer the following : \n'));
9
-
10
- var cliConfig;
11
-
12
- // Query the questions
13
- // -------------------
14
- return Promise.resolve()
15
- .then(() => {
16
- return cli.start(options);
17
- })
18
-
19
- // Storing config
20
- // --------------
21
- .then((config) => {
22
- cliConfig = config;
23
- console.log(config);
24
- })
25
-
26
- // Building the file structure
27
- // ---------------------------
28
- .then(() => {
29
- return build.start({
30
- config: cliConfig,
31
- targetPath: options.targetPath
32
- });
33
- })
34
-
35
- // Post build operations
36
- // ---------------------
37
- .then(() => {
38
- return postBuild.start({
39
- config: cliConfig,
40
- targetPath: options.targetPath
41
- });
42
- })
43
-
44
- // Install dependencies
45
- // --------------------
46
- .then(() => {
47
- return install.start({
48
- config: cliConfig,
49
- targetPath: options.targetPath,
50
- });
51
- })
52
-
53
- .catch((e) => {
54
- console.error(e);
55
- process.exitCode = 1;
56
- })
57
-
58
- .finally(() => process.exit())
59
- }
60
-
61
-
62
- module.exports = {
63
- appGenerate,
64
- };
1
+ const chalk = require('chalk');
2
+ const cli = require('./cli');
3
+ const build = require('./build');
4
+ const postBuild = require('./post-build');
5
+ const install = require('./install');
6
+
7
+ const appGenerate = (options) => {
8
+ console.info(chalk.cyan('Configuring your project : please answer the following : \n'));
9
+
10
+ var cliConfig;
11
+
12
+ // Query the questions
13
+ // -------------------
14
+ return Promise.resolve()
15
+ .then(() => {
16
+ return cli.start(options);
17
+ })
18
+
19
+ // Storing config
20
+ // --------------
21
+ .then((config) => {
22
+ cliConfig = config;
23
+ console.log(config);
24
+ })
25
+
26
+ // Building the file structure
27
+ // ---------------------------
28
+ .then(() => {
29
+ return build.start({
30
+ config: cliConfig,
31
+ targetPath: options.targetPath
32
+ });
33
+ })
34
+
35
+ // Post build operations
36
+ // ---------------------
37
+ .then(() => {
38
+ return postBuild.start({
39
+ config: cliConfig,
40
+ targetPath: options.targetPath
41
+ });
42
+ })
43
+
44
+ // Install dependencies
45
+ // --------------------
46
+ .then(() => {
47
+ return install.start({
48
+ config: cliConfig,
49
+ targetPath: options.targetPath,
50
+ });
51
+ })
52
+
53
+ .catch((e) => {
54
+ console.error(e);
55
+ process.exitCode = 1;
56
+ })
57
+
58
+ .finally(() => process.exit())
59
+ }
60
+
61
+
62
+ module.exports = {
63
+ appGenerate,
64
+ };
package/lib/install.js CHANGED
@@ -1,54 +1,54 @@
1
- const childProcess = require("child_process");
2
- const execSync = childProcess.execSync;
3
- const path = require("path");
4
- const tools = require('@eui/tools/scripts/utils/tools');
5
- const utils = require('./utils');
6
- const chalk = require('chalk');
7
-
8
-
9
- module.exports.start = (options) => {
10
-
11
- if (!options.config.npmInstall) {
12
- return;
13
- }
14
-
15
- return Promise.resolve()
16
- .then(() => {
17
- return install(options.config, options.targetPath)
18
- })
19
- .catch((e) => {
20
- throw e;
21
- })
22
- }
23
-
24
- const install = (cliConfig, targetPath) => {
25
-
26
- const wd = path.resolve(utils.getAngularPath(targetPath, cliConfig.appName, cliConfig.appType, cliConfig.artifactId));
27
-
28
- console.log('');
29
- console.log('');
30
- console.log('*****************************************************');
31
- console.log(chalk.cyan(' Installing app dependencies... PLEASE WAIT....'));
32
- console.log('*****************************************************');
33
-
34
- return Promise.resolve()
35
- .then(() => {
36
- return tools.remove(path.join(wd, 'yarn.lock'));
37
- })
38
- .then(() => {
39
- return execSync("yarn", { cwd: wd, stdio: "inherit" });
40
- })
41
- .then(() => {
42
- console.log('');
43
- console.log('');
44
- console.log('*****************************************************************');
45
- console.log(chalk.cyan(' Starting eUI app... browser will open soon on localhost:4200'));
46
- console.log('*****************************************************************');
47
-
48
- return execSync("npm start", { cwd: wd, stdio: "inherit" });
49
- })
50
- .catch((e) => {
51
- throw e;
52
- })
53
- }
54
-
1
+ const childProcess = require("child_process");
2
+ const execSync = childProcess.execSync;
3
+ const path = require("path");
4
+ const tools = require('@eui/tools/scripts/utils/tools');
5
+ const utils = require('./utils');
6
+ const chalk = require('chalk');
7
+
8
+
9
+ module.exports.start = (options) => {
10
+
11
+ if (!options.config.npmInstall) {
12
+ return;
13
+ }
14
+
15
+ return Promise.resolve()
16
+ .then(() => {
17
+ return install(options.config, options.targetPath)
18
+ })
19
+ .catch((e) => {
20
+ throw e;
21
+ })
22
+ }
23
+
24
+ const install = (cliConfig, targetPath) => {
25
+
26
+ const wd = path.resolve(utils.getAngularPath(targetPath, cliConfig.appName, cliConfig.appType, cliConfig.artifactId));
27
+
28
+ console.log('');
29
+ console.log('');
30
+ console.log('*****************************************************');
31
+ console.log(chalk.cyan(' Installing app dependencies... PLEASE WAIT....'));
32
+ console.log('*****************************************************');
33
+
34
+ return Promise.resolve()
35
+ .then(() => {
36
+ return tools.remove(path.join(wd, 'yarn.lock'));
37
+ })
38
+ .then(() => {
39
+ return execSync("yarn", { cwd: wd, stdio: "inherit" });
40
+ })
41
+ .then(() => {
42
+ console.log('');
43
+ console.log('');
44
+ console.log('*****************************************************************');
45
+ console.log(chalk.cyan(' Starting eUI app... browser will open soon on localhost:4200'));
46
+ console.log('*****************************************************************');
47
+
48
+ return execSync("npm start", { cwd: wd, stdio: "inherit" });
49
+ })
50
+ .catch((e) => {
51
+ throw e;
52
+ })
53
+ }
54
+
@@ -1,115 +1,115 @@
1
- <?xml version="1.0"?>
2
- <project name="eUI-build" basedir=".">
3
-
4
- <taskdef resource="net/sf/antcontrib/antlib.xml">
5
- <classpath>
6
- <fileset dir="lib" includes="ant-contrib-*.jar"/>
7
- </classpath>
8
- </taskdef>
9
-
10
- <scriptdef language="javascript" name="lower">
11
- <attribute name="string" />
12
- <attribute name="to" />
13
-
14
- project.setProperty( attributes.get( "to" ),
15
- attributes.get( "string" ).toLowerCase() );
16
- </scriptdef>
17
-
18
- <scriptdef language="javascript" name="ucfirst">
19
- <attribute name="string" />
20
- <attribute name="to" />
21
-
22
- var the_string = attributes.get( "string" );
23
- project.setProperty( attributes.get( "to" ),
24
- the_string.substr(0,1).toUpperCase() + the_string.substr(1) );
25
- </scriptdef>
26
-
27
- <scriptdef name="camelCaseString" language="javascript">
28
- <attribute name="text" />
29
- <attribute name="separator" />
30
- <attribute name="property" />
31
- <attribute name="first" />
32
- <![CDATA[
33
- var string = attributes.get("text");
34
- var stringArray = string.split(attributes.get("separator"));
35
- var result = "";
36
- var s;
37
-
38
- for (var i=0; i<stringArray.length;i++) {
39
- s = stringArray[i];
40
- if (i == 0) {
41
- if (attributes.get("first") == 'true') {
42
- result += s.substring(0,1).toUpperCase() + s.substr(1);
43
- } else {
44
- result += s;
45
- }
46
- } else {
47
- result += s.substring(0,1).toUpperCase() + s.substr(1);
48
- }
49
- }
50
-
51
- project.setProperty(attributes.get("property"), result);
52
- ]]>
53
- </scriptdef>
54
-
55
-
56
- <macrodef name="replaceAll" taskname="@{taskname}">
57
- <attribute name="src" />
58
- <attribute name="dest" default="" />
59
- <attribute name="replace" default="" />
60
- <attribute name="with" default="" />
61
- <sequential>
62
- <loadresource property="@{dest}">
63
- <propertyresource name="@{src}" />
64
- <filterchain>
65
- <tokenfilter>
66
- <filetokenizer/>
67
- <replacestring from="@{replace}" to="@{with}"/>
68
- </tokenfilter>
69
- </filterchain>
70
- </loadresource>
71
- </sequential>
72
- </macrodef>
73
-
74
-
75
-
76
- <!--======================================================================-->
77
- <!-- TOKEN FILTERS -->
78
- <!--======================================================================-->
79
-
80
- <!--application files replacement-->
81
- <filter token="app.name" value="${app.artifact.id}"/>
82
- <filter token="app.name.display" value="${app.artifact.id}"/>
83
- <filter token="app.group.id" value="${app.group.id}"/>
84
-
85
- <target name="generate.web-spring-boot">
86
- <echo></echo>
87
- <echo>TARGET : ${target.path}</echo>
88
- <echo></echo>
89
- <echo>app.name: ${app.name}</echo>
90
- <echo>app.artifact.id: ${app.artifact.id}</echo>
91
- <echo>app.group.id: ${app.group.id}</echo>
92
- <echo></echo>
93
-
94
- <copy todir="${target.path}" filtering="true" overwrite="true">
95
- <fileset dir="${src.path}"/>
96
- </copy>
97
-
98
- <!--REPLACE MODULE NAMES DIRECTORIES-->
99
- <move toFile="${target.path}/${app.artifact.id}-web-rest"
100
- file="${target.path}/myapp-web-rest"/>
101
- <move toFile="${target.path}/${app.artifact.id}-web"
102
- file="${target.path}/myapp-web"/>
103
-
104
- <!--RENAMING JAVA SOURCES TARGET by custom app group id provided-->
105
-
106
- <replaceAll src="app.group.id" dest="app.group.id.dir" replace="." with="/"/>
107
-
108
- <move tofile="${target.path}/${app.name}-web-rest/src/main/java/${app.group.id.dir}/${app.name}"
109
- file="${target.path}/${app.name}-web-rest/src/main/java/myapp"/>
110
- <mkdir dir="${target.path}/${app.name}-web-rest/src/test/java/${app.group.id.dir}/${app.name}"/>
111
-
112
- </target>
113
-
114
- </project>
115
-
1
+ <?xml version="1.0"?>
2
+ <project name="eUI-build" basedir=".">
3
+
4
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
5
+ <classpath>
6
+ <fileset dir="lib" includes="ant-contrib-*.jar"/>
7
+ </classpath>
8
+ </taskdef>
9
+
10
+ <scriptdef language="javascript" name="lower">
11
+ <attribute name="string" />
12
+ <attribute name="to" />
13
+
14
+ project.setProperty( attributes.get( "to" ),
15
+ attributes.get( "string" ).toLowerCase() );
16
+ </scriptdef>
17
+
18
+ <scriptdef language="javascript" name="ucfirst">
19
+ <attribute name="string" />
20
+ <attribute name="to" />
21
+
22
+ var the_string = attributes.get( "string" );
23
+ project.setProperty( attributes.get( "to" ),
24
+ the_string.substr(0,1).toUpperCase() + the_string.substr(1) );
25
+ </scriptdef>
26
+
27
+ <scriptdef name="camelCaseString" language="javascript">
28
+ <attribute name="text" />
29
+ <attribute name="separator" />
30
+ <attribute name="property" />
31
+ <attribute name="first" />
32
+ <![CDATA[
33
+ var string = attributes.get("text");
34
+ var stringArray = string.split(attributes.get("separator"));
35
+ var result = "";
36
+ var s;
37
+
38
+ for (var i=0; i<stringArray.length;i++) {
39
+ s = stringArray[i];
40
+ if (i == 0) {
41
+ if (attributes.get("first") == 'true') {
42
+ result += s.substring(0,1).toUpperCase() + s.substr(1);
43
+ } else {
44
+ result += s;
45
+ }
46
+ } else {
47
+ result += s.substring(0,1).toUpperCase() + s.substr(1);
48
+ }
49
+ }
50
+
51
+ project.setProperty(attributes.get("property"), result);
52
+ ]]>
53
+ </scriptdef>
54
+
55
+
56
+ <macrodef name="replaceAll" taskname="@{taskname}">
57
+ <attribute name="src" />
58
+ <attribute name="dest" default="" />
59
+ <attribute name="replace" default="" />
60
+ <attribute name="with" default="" />
61
+ <sequential>
62
+ <loadresource property="@{dest}">
63
+ <propertyresource name="@{src}" />
64
+ <filterchain>
65
+ <tokenfilter>
66
+ <filetokenizer/>
67
+ <replacestring from="@{replace}" to="@{with}"/>
68
+ </tokenfilter>
69
+ </filterchain>
70
+ </loadresource>
71
+ </sequential>
72
+ </macrodef>
73
+
74
+
75
+
76
+ <!--======================================================================-->
77
+ <!-- TOKEN FILTERS -->
78
+ <!--======================================================================-->
79
+
80
+ <!--application files replacement-->
81
+ <filter token="app.name" value="${app.artifact.id}"/>
82
+ <filter token="app.name.display" value="${app.artifact.id}"/>
83
+ <filter token="app.group.id" value="${app.group.id}"/>
84
+
85
+ <target name="generate.web-spring-boot">
86
+ <echo></echo>
87
+ <echo>TARGET : ${target.path}</echo>
88
+ <echo></echo>
89
+ <echo>app.name: ${app.name}</echo>
90
+ <echo>app.artifact.id: ${app.artifact.id}</echo>
91
+ <echo>app.group.id: ${app.group.id}</echo>
92
+ <echo></echo>
93
+
94
+ <copy todir="${target.path}" filtering="true" overwrite="true">
95
+ <fileset dir="${src.path}"/>
96
+ </copy>
97
+
98
+ <!--REPLACE MODULE NAMES DIRECTORIES-->
99
+ <move toFile="${target.path}/${app.artifact.id}-web-rest"
100
+ file="${target.path}/myapp-web-rest"/>
101
+ <move toFile="${target.path}/${app.artifact.id}-web"
102
+ file="${target.path}/myapp-web"/>
103
+
104
+ <!--RENAMING JAVA SOURCES TARGET by custom app group id provided-->
105
+
106
+ <replaceAll src="app.group.id" dest="app.group.id.dir" replace="." with="/"/>
107
+
108
+ <move tofile="${target.path}/${app.name}-web-rest/src/main/java/${app.group.id.dir}/${app.name}"
109
+ file="${target.path}/${app.name}-web-rest/src/main/java/myapp"/>
110
+ <mkdir dir="${target.path}/${app.name}-web-rest/src/test/java/${app.group.id.dir}/${app.name}"/>
111
+
112
+ </target>
113
+
114
+ </project>
115
+