@worktile/planet 10.0.0 → 12.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 (256) hide show
  1. package/.all-contributorsrc +84 -0
  2. package/.circleci/config.yml +17 -0
  3. package/.coveralls.yml +1 -0
  4. package/.docgeni/public/assets/favicon.ico +0 -0
  5. package/.docgeni/public/index.html +13 -0
  6. package/.docgenirc.js +35 -0
  7. package/.dockerignore +1 -0
  8. package/.editorconfig +22 -0
  9. package/.github/FUNDING.yml +12 -0
  10. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  11. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  12. package/.prettierignore +7 -0
  13. package/.prettierrc +28 -0
  14. package/.travis.yml +26 -0
  15. package/.wpmrc.js +11 -0
  16. package/CHANGELOG.md +391 -0
  17. package/CODE_OF_CONDUCT.md +76 -0
  18. package/Dockerfile +11 -0
  19. package/LICENSE +21 -0
  20. package/README.md +348 -0
  21. package/README.zh-CN.md +307 -0
  22. package/SECURITY.md +21 -0
  23. package/angular.json +373 -0
  24. package/commitlint.config.js +6 -0
  25. package/docs/api/defineApplication.md +46 -0
  26. package/docs/api/globalEventDispatcher.md +51 -0
  27. package/docs/api/index.md +5 -0
  28. package/docs/api/planet.md +117 -0
  29. package/docs/guides/getting-started.md +174 -0
  30. package/docs/guides/index.md +5 -0
  31. package/docs/guides/intro.md +216 -0
  32. package/examples/app1/browserslist +11 -0
  33. package/examples/app1/extra-webpack.config.js +33 -0
  34. package/examples/app1/karma.conf.js +31 -0
  35. package/examples/app1/postcss.config.js +1 -0
  36. package/examples/app1/src/app/app.module.ts +44 -0
  37. package/examples/app1/src/app/app.routing.ts +49 -0
  38. package/examples/app1/src/app/counter.service.ts +16 -0
  39. package/examples/app1/src/app/dashboard/dashboard.component.html +51 -0
  40. package/examples/app1/src/app/dashboard/dashboard.component.ts +70 -0
  41. package/examples/app1/src/app/detail/detail.component.html +8 -0
  42. package/examples/app1/src/app/detail/detail.component.ts +18 -0
  43. package/examples/app1/src/app/overlay.ts +26 -0
  44. package/examples/app1/src/app/projects/dialog/projects-dialog.component.html +10 -0
  45. package/examples/app1/src/app/projects/dialog/projects-dialog.component.ts +41 -0
  46. package/examples/app1/src/app/projects/projects.component.ts +33 -0
  47. package/examples/app1/src/app/root/root.component.css +3 -0
  48. package/examples/app1/src/app/root/root.component.html +16 -0
  49. package/examples/app1/src/app/root/root.component.ts +35 -0
  50. package/examples/app1/src/app/services/initialized-data.resolver.ts +15 -0
  51. package/examples/app1/src/app/shared.module.ts +57 -0
  52. package/examples/app1/src/app/user/detail/user-detail.component.html +5 -0
  53. package/examples/app1/src/app/user/detail/user-detail.component.ts +20 -0
  54. package/examples/app1/src/app/user/user-list.component.html +7 -0
  55. package/examples/app1/src/app/user/user-list.component.ts +20 -0
  56. package/examples/app1/src/app/user/user.module.ts +31 -0
  57. package/examples/app1/src/assets/.gitkeep +0 -0
  58. package/examples/app1/src/assets/github.png +0 -0
  59. package/examples/app1/src/assets/main.css +3 -0
  60. package/examples/app1/src/environments/environment.prod.ts +3 -0
  61. package/examples/app1/src/environments/environment.ts +16 -0
  62. package/examples/app1/src/favicon.ico +0 -0
  63. package/examples/app1/src/index.html +14 -0
  64. package/examples/app1/src/main.ts +35 -0
  65. package/examples/app1/src/polyfills.ts +84 -0
  66. package/examples/app1/src/styles.scss +35 -0
  67. package/examples/app1/src/test.ts +14 -0
  68. package/examples/app1/temp.js +221 -0
  69. package/examples/app1/tsconfig.app.json +10 -0
  70. package/examples/app1/tsconfig.spec.json +18 -0
  71. package/examples/app1/tslint.json +17 -0
  72. package/examples/app1/webpack.config.js +127 -0
  73. package/examples/app2/browserslist +11 -0
  74. package/examples/app2/extra-webpack.config.js +32 -0
  75. package/examples/app2/karma.conf.js +31 -0
  76. package/examples/app2/src/app/app.module.ts +90 -0
  77. package/examples/app2/src/app/dashboard/dashboard.component.html +21 -0
  78. package/examples/app2/src/app/dashboard/dashboard.component.ts +27 -0
  79. package/examples/app2/src/app/overlay.ts +26 -0
  80. package/examples/app2/src/app/projects/detail/detail.component.html +16 -0
  81. package/examples/app2/src/app/projects/detail/detail.component.ts +21 -0
  82. package/examples/app2/src/app/projects/project-list.component.html +29 -0
  83. package/examples/app2/src/app/projects/project-list.component.ts +58 -0
  84. package/examples/app2/src/app/projects/project.resolver.ts +15 -0
  85. package/examples/app2/src/app/projects/projects.service.ts +28 -0
  86. package/examples/app2/src/app/projects/tasks/tasks.component.html +10 -0
  87. package/examples/app2/src/app/projects/tasks/tasks.component.ts +16 -0
  88. package/examples/app2/src/app/projects/view/view.component.html +1 -0
  89. package/examples/app2/src/app/projects/view/view.component.ts +20 -0
  90. package/examples/app2/src/app/root/root.component.html +14 -0
  91. package/examples/app2/src/app/root/root.component.scss +12 -0
  92. package/examples/app2/src/app/root/root.component.ts +28 -0
  93. package/examples/app2/src/app/shared.module.ts +59 -0
  94. package/examples/app2/src/assets/.gitkeep +0 -0
  95. package/examples/app2/src/environments/environment.prod.ts +3 -0
  96. package/examples/app2/src/environments/environment.ts +16 -0
  97. package/examples/app2/src/favicon.ico +0 -0
  98. package/examples/app2/src/index.html +14 -0
  99. package/examples/app2/src/main.ts +36 -0
  100. package/examples/app2/src/polyfills.ts +84 -0
  101. package/examples/app2/src/styles.scss +28 -0
  102. package/examples/app2/src/test.ts +14 -0
  103. package/examples/app2/tsconfig.app.json +10 -0
  104. package/examples/app2/tsconfig.spec.json +18 -0
  105. package/examples/app2/tslint.json +7 -0
  106. package/examples/app2/webpack.config.js +92 -0
  107. package/examples/common/app-root-context.ts +10 -0
  108. package/examples/common/cache.ts +82 -0
  109. package/examples/common/index.ts +13 -0
  110. package/examples/common/module.ts +10 -0
  111. package/examples/common/overlay-container.service.ts +28 -0
  112. package/examples/common/section-card/section-card.component.html +5 -0
  113. package/examples/common/section-card/section-card.component.scss +15 -0
  114. package/examples/common/section-card/section-card.component.ts +11 -0
  115. package/examples/common/utils.ts +0 -0
  116. package/examples/portal/src/app/a-detail/a-detail.component.html +8 -0
  117. package/examples/portal/src/app/a-detail/a-detail.component.ts +18 -0
  118. package/examples/portal/src/app/about/about.component.html +27 -0
  119. package/examples/portal/src/app/about/about.component.scss +0 -0
  120. package/examples/portal/src/app/about/about.component.spec.ts +26 -0
  121. package/examples/portal/src/app/about/about.component.ts +26 -0
  122. package/examples/portal/src/app/app-routing.module.ts +57 -0
  123. package/examples/portal/src/app/app.component.html +73 -0
  124. package/examples/portal/src/app/app.component.scss +58 -0
  125. package/examples/portal/src/app/app.component.spec.ts +33 -0
  126. package/examples/portal/src/app/app.component.ts +111 -0
  127. package/examples/portal/src/app/app.module.ts +64 -0
  128. package/examples/portal/src/app/custom-settings.service.ts +44 -0
  129. package/examples/portal/src/app/overlay.ts +26 -0
  130. package/examples/portal/src/app/settings/settings.component.html +31 -0
  131. package/examples/portal/src/app/settings/settings.component.scss +3 -0
  132. package/examples/portal/src/app/settings/settings.component.ts +43 -0
  133. package/examples/portal/src/assets/.gitkeep +0 -0
  134. package/examples/portal/src/assets/apps.json +29 -0
  135. package/examples/portal/src/assets/icons/sprite.defs.svg +1 -0
  136. package/examples/portal/src/assets/images/logo.svg +16 -0
  137. package/examples/portal/src/assets/ngx-planet-micro-front-end.gif +0 -0
  138. package/examples/portal/src/browserslist +11 -0
  139. package/examples/portal/src/environments/environment.prod.ts +3 -0
  140. package/examples/portal/src/environments/environment.ts +16 -0
  141. package/examples/portal/src/extra-webpack.config.js +32 -0
  142. package/examples/portal/src/favicon.ico +0 -0
  143. package/examples/portal/src/index.html +14 -0
  144. package/examples/portal/src/karma.conf.js +31 -0
  145. package/examples/portal/src/main.ts +18 -0
  146. package/examples/portal/src/polyfills.ts +84 -0
  147. package/examples/portal/src/reboot.scss +14 -0
  148. package/examples/portal/src/styles.scss +14 -0
  149. package/examples/portal/src/test.ts +14 -0
  150. package/examples/portal/src/tsconfig.app.json +10 -0
  151. package/examples/portal/src/tsconfig.spec.json +9 -0
  152. package/examples/portal/src/tslint.json +7 -0
  153. package/extra-webpack.config.js +5 -0
  154. package/nginx.conf +17 -0
  155. package/package.json +120 -15
  156. package/packages/planet/karma.conf.js +37 -0
  157. package/packages/planet/ng-package.json +7 -0
  158. package/packages/planet/package.json +10 -0
  159. package/packages/planet/src/application/planet-application-loader.spec.ts +1102 -0
  160. package/packages/planet/src/application/planet-application-loader.ts +549 -0
  161. package/packages/planet/src/application/planet-application-ref.spec.ts +233 -0
  162. package/packages/planet/src/application/planet-application-ref.ts +131 -0
  163. package/packages/planet/src/application/planet-application.service.spec.ts +145 -0
  164. package/packages/planet/src/application/planet-application.service.ts +88 -0
  165. package/packages/planet/src/application/portal-application.spec.ts +53 -0
  166. package/packages/planet/src/application/portal-application.ts +28 -0
  167. package/packages/planet/src/assets-loader.spec.ts +689 -0
  168. package/packages/planet/src/assets-loader.ts +247 -0
  169. package/packages/planet/src/component/planet-component-loader.spec.ts +187 -0
  170. package/packages/planet/src/component/planet-component-loader.ts +173 -0
  171. package/{component/planet-component-ref.d.ts → packages/planet/src/component/planet-component-ref.ts} +3 -2
  172. package/{component/plant-component.config.d.ts → packages/planet/src/component/plant-component.config.ts} +4 -3
  173. package/packages/planet/src/debug.spec.ts +58 -0
  174. package/packages/planet/src/debug.ts +66 -0
  175. package/packages/planet/src/empty/empty.component.spec.ts +34 -0
  176. package/packages/planet/src/empty/empty.component.ts +7 -0
  177. package/packages/planet/src/global-event-dispatcher.spec.ts +81 -0
  178. package/packages/planet/src/global-event-dispatcher.ts +82 -0
  179. package/packages/planet/src/global-planet.spec.ts +39 -0
  180. package/packages/planet/src/global-planet.ts +73 -0
  181. package/packages/planet/src/helpers.spec.ts +242 -0
  182. package/packages/planet/src/helpers.ts +125 -0
  183. package/packages/planet/src/module.spec.ts +79 -0
  184. package/packages/planet/src/module.ts +25 -0
  185. package/packages/planet/src/planet.class.ts +59 -0
  186. package/packages/planet/src/planet.spec.ts +226 -0
  187. package/packages/planet/src/planet.ts +113 -0
  188. package/{public-api.d.ts → packages/planet/src/public-api.ts} +4 -0
  189. package/packages/planet/src/sandbox/constants.ts +6 -0
  190. package/packages/planet/src/sandbox/exec.ts +22 -0
  191. package/packages/planet/src/sandbox/index.ts +24 -0
  192. package/packages/planet/src/sandbox/proxy/patches/document.ts +13 -0
  193. package/packages/planet/src/sandbox/proxy/patches/eventListener.ts +49 -0
  194. package/packages/planet/src/sandbox/proxy/patches/index.ts +13 -0
  195. package/packages/planet/src/sandbox/proxy/patches/storage.ts +53 -0
  196. package/packages/planet/src/sandbox/proxy/patches/timer.ts +50 -0
  197. package/packages/planet/src/sandbox/proxy/proxies/common.ts +137 -0
  198. package/packages/planet/src/sandbox/proxy/proxies/document.ts +140 -0
  199. package/packages/planet/src/sandbox/proxy/proxies/window.ts +176 -0
  200. package/packages/planet/src/sandbox/proxy/proxy-sandbox.ts +59 -0
  201. package/packages/planet/src/sandbox/proxy/types.ts +20 -0
  202. package/packages/planet/src/sandbox/sandbox.ts +20 -0
  203. package/packages/planet/src/sandbox/snapshot/snapshot-sandbox.ts +12 -0
  204. package/packages/planet/src/sandbox/types.ts +1 -0
  205. package/packages/planet/src/test.ts +16 -0
  206. package/packages/planet/src/testing/app1.module.ts +34 -0
  207. package/packages/planet/src/testing/app2.module.ts +24 -0
  208. package/packages/planet/src/testing/applications.ts +58 -0
  209. package/packages/planet/src/testing/index.ts +2 -0
  210. package/packages/planet/src/testing/utils.ts +31 -0
  211. package/packages/planet/tsconfig.lib.json +27 -0
  212. package/packages/planet/tsconfig.lib.prod.json +9 -0
  213. package/packages/planet/tsconfig.spec.json +17 -0
  214. package/packages/planet/tslint.json +7 -0
  215. package/postcss.config.js +3 -0
  216. package/proxy.conf.js +15 -0
  217. package/tsconfig.json +23 -0
  218. package/tslint.json +80 -0
  219. package/application/planet-application-loader.d.ts +0 -68
  220. package/application/planet-application-ref.d.ts +0 -32
  221. package/application/planet-application.service.d.ts +0 -18
  222. package/application/portal-application.d.ts +0 -14
  223. package/assets-loader.d.ts +0 -23
  224. package/bundles/worktile-planet.umd.js +0 -1670
  225. package/bundles/worktile-planet.umd.js.map +0 -1
  226. package/bundles/worktile-planet.umd.min.js +0 -16
  227. package/bundles/worktile-planet.umd.min.js.map +0 -1
  228. package/component/planet-component-loader.d.ts +0 -27
  229. package/empty/empty.component.d.ts +0 -2
  230. package/esm2015/application/planet-application-loader.js +0 -417
  231. package/esm2015/application/planet-application-ref.js +0 -86
  232. package/esm2015/application/planet-application.service.js +0 -87
  233. package/esm2015/application/portal-application.js +0 -16
  234. package/esm2015/assets-loader.js +0 -165
  235. package/esm2015/component/planet-component-loader.js +0 -157
  236. package/esm2015/component/planet-component-ref.js +0 -3
  237. package/esm2015/component/plant-component.config.js +0 -7
  238. package/esm2015/empty/empty.component.js +0 -10
  239. package/esm2015/global-event-dispatcher.js +0 -71
  240. package/esm2015/global-planet.js +0 -51
  241. package/esm2015/helpers.js +0 -116
  242. package/esm2015/module.js +0 -27
  243. package/esm2015/planet.class.js +0 -9
  244. package/esm2015/planet.js +0 -86
  245. package/esm2015/public-api.js +0 -18
  246. package/esm2015/worktile-planet.js +0 -6
  247. package/fesm2015/worktile-planet.js +0 -1257
  248. package/fesm2015/worktile-planet.js.map +0 -1
  249. package/global-event-dispatcher.d.ts +0 -19
  250. package/global-planet.d.ts +0 -22
  251. package/helpers.d.ts +0 -37
  252. package/module.d.ts +0 -5
  253. package/planet.class.d.ts +0 -34
  254. package/planet.d.ts +0 -24
  255. package/worktile-planet.d.ts +0 -5
  256. package/worktile-planet.metadata.json +0 -1
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 250 250" style="enable-background:new 0 0 250 250;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#DD0031;}
7
+ .st1{fill:#C3002F;}
8
+ .st2{fill:#FFFFFF;}
9
+ </style>
10
+ <g>
11
+ <polygon class="st0" points="125,30 125,30 125,30 31.9,63.2 46.1,186.3 125,230 125,230 125,230 203.9,186.3 218.1,63.2 "/>
12
+ <polygon class="st1" points="125,30 125,52.2 125,52.1 125,153.4 125,153.4 125,230 125,230 203.9,186.3 218.1,63.2 125,30 "/>
13
+ <path class="st2" d="M125,52.1L66.8,182.6h0h21.7h0l11.7-29.2h49.4l11.7,29.2h0h21.7h0L125,52.1L125,52.1L125,52.1L125,52.1
14
+ L125,52.1z M142,135.4H108l17-40.9L142,135.4z"/>
15
+ </g>
16
+ </svg>
@@ -0,0 +1,11 @@
1
+ # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2
+ # For additional information regarding the format and rule options, please see:
3
+ # https://github.com/browserslist/browserslist#queries
4
+ #
5
+ # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6
+
7
+ > 0.5%
8
+ last 2 versions
9
+ Firefox ESR
10
+ not dead
11
+ not IE 9-11
@@ -0,0 +1,3 @@
1
+ export const environment = {
2
+ production: true
3
+ };
@@ -0,0 +1,16 @@
1
+ // This file can be replaced during build by using the `fileReplacements` array.
2
+ // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3
+ // The list of file replacements can be found in `angular.json`.
4
+
5
+ export const environment = {
6
+ production: false
7
+ };
8
+
9
+ /*
10
+ * For easier debugging in development mode, you can import the following file
11
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
+ *
13
+ * This import should be commented out in production mode because it will have a negative impact
14
+ * on performance if an error is thrown.
15
+ */
16
+ // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
@@ -0,0 +1,32 @@
1
+ const WebpackAssetsManifest = require('webpack-assets-manifest');
2
+ const PrefixWrap = require('@worktile/planet-postcss-prefixwrap');
3
+
4
+ module.exports = {
5
+ optimization: {
6
+ runtimeChunk: false
7
+ },
8
+ plugins: [new WebpackAssetsManifest()],
9
+ module: {
10
+ rules: [
11
+ {
12
+ test: /\.scss$/,
13
+ use: [
14
+ {
15
+ loader: 'postcss-loader',
16
+ options: {
17
+ postcssOptions: {
18
+ plugins: [
19
+ PrefixWrap('.portal', {
20
+ blacklist: ['./reboot.scss'],
21
+ prefixRootTags: true
22
+ })
23
+ ]
24
+ }
25
+ }
26
+ },
27
+ 'sass-loader'
28
+ ]
29
+ }
30
+ ]
31
+ }
32
+ };
Binary file
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Ngx Planet - Micro Front-end for Angular</title>
6
+ <base href="/" />
7
+
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <link rel="icon" type="image/x-icon" href="favicon.ico" />
10
+ </head>
11
+ <body>
12
+ <app-root></app-root>
13
+ </body>
14
+ </html>
@@ -0,0 +1,31 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function(config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
17
+ },
18
+ coverageIstanbulReporter: {
19
+ dir: require('path').join(__dirname, '../coverage'),
20
+ reports: ['html', 'lcovonly', 'text-summary'],
21
+ fixWebpackSourcePaths: true
22
+ },
23
+ reporters: ['progress', 'kjhtml'],
24
+ port: 9876,
25
+ colors: true,
26
+ logLevel: config.LOG_INFO,
27
+ autoWatch: true,
28
+ browsers: ['Chrome'],
29
+ singleRun: false
30
+ });
31
+ };
@@ -0,0 +1,18 @@
1
+ import { enableProdMode } from '@angular/core';
2
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
+
4
+ import { AppModule } from './app/app.module';
5
+ import { environment } from './environments/environment';
6
+
7
+ if (environment.production) {
8
+ enableProdMode();
9
+ }
10
+
11
+ // 测试沙箱模拟主应用引入版本为3.0.0的lodash
12
+ window['lodash'] = {
13
+ version: '3.0.0'
14
+ };
15
+
16
+ platformBrowserDynamic()
17
+ .bootstrapModule(AppModule)
18
+ .catch(err => console.error(err));
@@ -0,0 +1,84 @@
1
+ /**
2
+ * This file includes polyfills needed by Angular and is loaded before the app.
3
+ * You can add your own extra polyfills to this file.
4
+ *
5
+ * This file is divided into 2 sections:
6
+ * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
+ * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
+ * file.
9
+ *
10
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
+ *
14
+ * Learn more in https://angular.io/guide/browser-support
15
+ */
16
+
17
+ /***************************************************************************************************
18
+ * BROWSER POLYFILLS
19
+ */
20
+
21
+ /** IE9, IE10, IE11, and Chrome <55 requires all of the following polyfills.
22
+ * This also includes Android Emulators with older versions of Chrome and Google Search/Googlebot
23
+ */
24
+
25
+ // import 'core-js/es6/symbol';
26
+ // import 'core-js/es6/object';
27
+ // import 'core-js/es6/function';
28
+ // import 'core-js/es6/parse-int';
29
+ // import 'core-js/es6/parse-float';
30
+ // import 'core-js/es6/number';
31
+ // import 'core-js/es6/math';
32
+ // import 'core-js/es6/string';
33
+ // import 'core-js/es6/date';
34
+ // import 'core-js/es6/array';
35
+ // import 'core-js/es6/regexp';
36
+ // import 'core-js/es6/map';
37
+ // import 'core-js/es6/weak-map';
38
+ // import 'core-js/es6/set';
39
+
40
+ /** IE10 and IE11 requires the following for NgClass support on SVG elements */
41
+ // import 'classlist.js'; // Run `npm install --save classlist.js`.
42
+
43
+ /** IE10 and IE11 requires the following for the Reflect API. */
44
+ // import 'core-js/es6/reflect';
45
+
46
+ /**
47
+ * Web Animations `@angular/platform-browser/animations`
48
+ * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
49
+ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
50
+ */
51
+ // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
52
+
53
+ /**
54
+ * By default, zone.js will patch all possible macroTask and DomEvents
55
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
56
+ * because those flags need to be set before `zone.js` being loaded, and webpack
57
+ * will put import in the top of bundle, so user need to create a separate file
58
+ * in this directory (for example: zone-flags.ts), and put the following flags
59
+ * into that file, and then add the following code before importing zone.js.
60
+ * import './zone-flags.ts';
61
+ *
62
+ * The flags allowed in zone-flags.ts are listed here.
63
+ *
64
+ * The following flags will work for all browsers.
65
+ *
66
+ * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
67
+ * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
68
+ * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
69
+ *
70
+ * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
71
+ * with the following flag, it will bypass `zone.js` patch for IE/Edge
72
+ *
73
+ * (window as any).__Zone_enable_cross_context_check = true;
74
+ *
75
+ */
76
+
77
+ /***************************************************************************************************
78
+ * Zone JS is required by default for Angular itself.
79
+ */
80
+ import 'zone.js'; // Included with Angular CLI.
81
+
82
+ /***************************************************************************************************
83
+ * APPLICATION IMPORTS
84
+ */
@@ -0,0 +1,14 @@
1
+ // @import 'ngx-tethys/styles/variables.scss';
2
+ @import 'ngx-tethys/styles/basic.scss';
3
+ @import 'ngx-tethys/styles/modules/reboot.scss';
4
+ @import 'ngx-tethys/styles/modules/cdk/index';
5
+
6
+ .portal-test {
7
+ color: #aaa;
8
+ }
9
+ body,
10
+ html {
11
+ height: 100%;
12
+ }
13
+
14
+ @import 'ngx-tethys/layout/styles/layout.scss';
@@ -0,0 +1,14 @@
1
+ $layout-content-background: #fff;
2
+ $primary: #348fe4;
3
+
4
+ $btn-border-radius: 4px;
5
+ $btn-border-radius-lg: 4px;
6
+ $btn-border-radius-sm: 4px;
7
+ $btn-border-radius-xs: 4px;
8
+
9
+ @import 'ngx-tethys/styles/variables.scss';
10
+ @import 'ngx-tethys/styles/index.scss';
11
+
12
+ @import './app/app.component.scss';
13
+
14
+ @import '../../common/section-card/section-card.component.scss';
@@ -0,0 +1,14 @@
1
+ // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+ import 'zone.js/testing';
4
+ import { getTestBed } from '@angular/core/testing';
5
+ import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
6
+
7
+ declare const require: any;
8
+
9
+ // First, initialize the Angular testing environment.
10
+ getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
11
+ // Then we find all the tests.
12
+ const context = require.context('./', true, /\.spec\.ts$/);
13
+ // And load the modules.
14
+ context.keys().map(context);
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../out-tsc/app",
5
+ "types": []
6
+ },
7
+ "files": ["main.ts", "polyfills.ts"],
8
+ "include": ["**/*.d.ts"],
9
+ "exclude": ["test.ts", "**/*.spec.ts"]
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../out-tsc/spec",
5
+ "types": ["jasmine", "node"]
6
+ },
7
+ "files": ["test.ts", "polyfills.ts"],
8
+ "include": ["**/*.spec.ts", "**/*.d.ts"]
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../tslint.json",
3
+ "rules": {
4
+ "directive-selector": [true, "attribute", "app", "camelCase"],
5
+ "component-selector": [true, "element", "app", "kebab-case"]
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ optimization: {
3
+ runtimeChunk: false
4
+ }
5
+ };
package/nginx.conf ADDED
@@ -0,0 +1,17 @@
1
+ server {
2
+ listen 8080;
3
+ proxy_redirect off;
4
+ proxy_set_header Host $host;
5
+ proxy_set_header X-Real-IP $remote_addr;
6
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
7
+ proxy_set_header X-Forwarded-Proto http;
8
+
9
+ location / {
10
+ root /etc/nginx/html/static/portal;
11
+ try_files $uri $uri/ /index.html;
12
+ }
13
+
14
+ location /static {
15
+ root /etc/nginx/html;
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,21 +1,126 @@
1
1
  {
2
2
  "name": "@worktile/planet",
3
- "version": "10.0.0",
4
- "private": false,
5
- "peerDependencies": {
6
- "@angular/common": "^9.0.0",
7
- "@angular/core": "^9.0.0",
8
- "@angular/cdk": "^9.0.0"
3
+ "version": "12.1.1",
4
+ "description": "A powerful, reliable, fully-featured and production ready Micro Frontend library for Angular.",
5
+ "keywords": [
6
+ "micro front-end",
7
+ "micro frontend",
8
+ "microfrontend",
9
+ "micro frontends",
10
+ "angular micro front-end",
11
+ "ngx micro front-end",
12
+ "ngx planet"
13
+ ],
14
+ "scripts": {
15
+ "ng": "ng",
16
+ "// start": "run app1 and app2 use webpack dev-server",
17
+ "start": "npm-run-all --parallel serve:portal serve:app1 serve:app2",
18
+ "serve:portal": "ng run portal:serve",
19
+ "serve:app1": "ng serve app1 --deploy-url=/static/app1/",
20
+ "serve:app2": "ng serve app2 --deploy-url=/static/app2/",
21
+ "dev:app1": "ng serve app1",
22
+ "build:portal": "ng build",
23
+ "build:app1": "ng build app1",
24
+ "build:app2": "ng build app2",
25
+ "// build:app1:dev": "ng build app1 --watch true --deploy-url=/static/app1/",
26
+ "// build:app2:dev": "ng build app2 --watch true --deploy-url=/static/app2/",
27
+ "build:portal:prod": "ng build --prod",
28
+ "build:app1:prod": "ng build app1 --prod --deploy-url=/static/app1/",
29
+ "build:app2:prod": "ng build app2 --prod --deploy-url=/static/app2/",
30
+ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --pkg ./packages/planet/package.json",
31
+ "build": "ng build planet",
32
+ "build:demo": "npm run build:app1 && npm run build:app2 && npm run build:portal",
33
+ "build:demo:prod": "npm run build:app1:prod && npm run build:app2:prod && npm run build:portal:prod",
34
+ "test": "ng test planet",
35
+ "lint": "ng lint planet",
36
+ "report-coverage": "cat ./coverage/lcov.info | coveralls",
37
+ "e2e": "ng e2e",
38
+ "release": "wpm release",
39
+ "// release": "standard-version",
40
+ "pub-only": "cd dist/planet && npm publish --access=public",
41
+ "pub": "wpm publish && npm run pub-only",
42
+ "contributors:init": "all-contributors init",
43
+ "contributors:add": "all-contributors add",
44
+ "contributors:generate": "all-contributors generate",
45
+ "ngcc": "ngcc",
46
+ "start:docs": "docgeni serve --port 4900",
47
+ "build:docs": "docgeni build --prod"
9
48
  },
10
- "main": "bundles/worktile-planet.umd.js",
11
- "module": "fesm2015/worktile-planet.js",
12
- "es2015": "fesm2015/worktile-planet.js",
13
- "esm2015": "esm2015/worktile-planet.js",
14
- "fesm2015": "fesm2015/worktile-planet.js",
15
- "typings": "worktile-planet.d.ts",
16
- "metadata": "worktile-planet.metadata.json",
17
- "sideEffects": false,
18
49
  "dependencies": {
19
- "tslib": "^2.0.0"
50
+ "@angular/animations": "~12.0.5",
51
+ "@angular/cdk": "^12.0.5",
52
+ "@angular/common": "~12.0.5",
53
+ "@angular/compiler": "~12.0.5",
54
+ "@angular/core": "~12.0.5",
55
+ "@angular/forms": "~12.0.5",
56
+ "@angular/platform-browser": "~12.0.5",
57
+ "@angular/platform-browser-dynamic": "~12.0.5",
58
+ "@angular/router": "~12.0.5",
59
+ "bootstrap": "4.5.0",
60
+ "date-fns": "^2.16.1",
61
+ "ngx-tethys": "12.0.0-next.0",
62
+ "rxjs": "~6.6.0",
63
+ "tslib": "^2.1.0",
64
+ "zone.js": "~0.11.4"
65
+ },
66
+ "devDependencies": {
67
+ "@angular-builders/custom-webpack": "^12.1.0",
68
+ "@angular-devkit/build-angular": "~12.0.5",
69
+ "@angular/cli": "^12.0.5",
70
+ "@angular/compiler-cli": "~12.0.5",
71
+ "@angular/language-service": "~12.0.5",
72
+ "@commitlint/cli": "^7.5.2",
73
+ "@commitlint/config-conventional": "^7.5.0",
74
+ "@types/debug": "^4.1.5",
75
+ "@types/jasmine": "~3.6.0",
76
+ "@types/jasminewd2": "~2.0.3",
77
+ "@docgeni/cli": "1.0.0-beta.7",
78
+ "@docgeni/template": "1.0.0-beta.7",
79
+ "@types/node": "^12.11.1",
80
+ "@worktile/planet-postcss-prefixwrap": "1.19.10",
81
+ "@worktile/pkg-manager": "0.0.1-beta.1",
82
+ "postcss-prefixwrap": "1.22.2",
83
+ "all-contributors-cli": "^6.6.0",
84
+ "autoprefixer": "^10.2.5",
85
+ "codelyzer": "^6.0.0",
86
+ "conventional-changelog-cli": "^2.0.12",
87
+ "coveralls": "^3.0.6",
88
+ "husky": "^2.4.1",
89
+ "jasmine-core": "~3.6.0",
90
+ "jasmine-spec-reporter": "~5.0.0",
91
+ "karma": "~6.3.2",
92
+ "karma-chrome-launcher": "~3.1.0",
93
+ "karma-coverage": "~2.0.3",
94
+ "karma-jasmine": "~4.0.0",
95
+ "karma-jasmine-html-reporter": "^1.5.0",
96
+ "ng-packagr": "^12.0.6",
97
+ "npm-run-all": "^4.1.5",
98
+ "prettier": "^1.16.4",
99
+ "pretty-quick": "^1.10.0",
100
+ "protractor": "~7.0.0",
101
+ "standard-version": "^8.0.1",
102
+ "ts-node": "~7.0.0",
103
+ "tslint": "~6.1.3",
104
+ "typescript": "~4.2.4",
105
+ "webpack-assets-manifest": "^5.0.6"
106
+ },
107
+ "husky": {
108
+ "hooks": {
109
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
110
+ "pre-commit": "pretty-quick --staged"
111
+ }
112
+ },
113
+ "standard-version": {
114
+ "bumpFiles": [
115
+ "package.json",
116
+ "package-lock.json",
117
+ "packages/planet/package.json"
118
+ ],
119
+ "header": "Changelog\nAll notable changes to ngx-planet will be documented in this file.\n",
120
+ "tagPrefix": "",
121
+ "skip": {
122
+ "tag": true,
123
+ "commit": true
124
+ }
20
125
  }
21
126
  }
@@ -0,0 +1,37 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function(config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
17
+ },
18
+ coverageReporter: {
19
+ dir: require('path').join(__dirname, '../../coverage'),
20
+ subdir: '.',
21
+ reporters: [{ type: 'html' }, { type: 'text-summary' }, { type: 'lcovonly' }]
22
+ },
23
+ reporters: ['progress', 'kjhtml'],
24
+ port: 9876,
25
+ colors: true,
26
+ logLevel: config.LOG_INFO,
27
+ autoWatch: true,
28
+ browsers: ['Chrome'],
29
+ singleRun: false,
30
+ customLaunchers: {
31
+ ChromeHeadlessCI: {
32
+ base: 'ChromeHeadless',
33
+ flags: ['--no-sandbox']
34
+ }
35
+ }
36
+ });
37
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/planet",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@worktile/planet",
3
+ "version": "12.1.1",
4
+ "private": false,
5
+ "peerDependencies": {
6
+ "@angular/common": "^12.0.0",
7
+ "@angular/core": "^12.0.0",
8
+ "@angular/cdk": "^12.0.0"
9
+ }
10
+ }