@worktile/planet 12.1.1 → 14.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/application/planet-application-loader.d.ts +73 -0
  3. package/application/planet-application-loader.d.ts.map +1 -0
  4. package/application/planet-application-ref.d.ts +36 -0
  5. package/application/planet-application-ref.d.ts.map +1 -0
  6. package/application/planet-application.service.d.ts +22 -0
  7. package/application/planet-application.service.d.ts.map +1 -0
  8. package/{packages/planet/src/application/portal-application.ts → application/portal-application.d.ts} +5 -18
  9. package/application/portal-application.d.ts.map +1 -0
  10. package/assets-loader.d.ts +36 -0
  11. package/assets-loader.d.ts.map +1 -0
  12. package/component/planet-component-loader.d.ts +31 -0
  13. package/component/planet-component-loader.d.ts.map +1 -0
  14. package/component/planet-component-ref.d.ts +8 -0
  15. package/component/planet-component-ref.d.ts.map +1 -0
  16. package/{packages/planet/src/component/plant-component.config.ts → component/plant-component.config.d.ts} +4 -4
  17. package/component/plant-component.config.d.ts.map +1 -0
  18. package/debug.d.ts +22 -0
  19. package/debug.d.ts.map +1 -0
  20. package/empty/empty.component.d.ts +6 -0
  21. package/empty/empty.component.d.ts.map +1 -0
  22. package/esm2020/application/planet-application-loader.mjs +454 -0
  23. package/esm2020/application/planet-application-ref.mjs +94 -0
  24. package/esm2020/application/planet-application.service.mjs +85 -0
  25. package/esm2020/application/portal-application.mjs +16 -0
  26. package/esm2020/assets-loader.mjs +216 -0
  27. package/esm2020/component/planet-component-loader.mjs +153 -0
  28. package/esm2020/component/planet-component-ref.mjs +3 -0
  29. package/esm2020/component/plant-component.config.mjs +7 -0
  30. package/esm2020/debug.mjs +33 -0
  31. package/esm2020/empty/empty.component.mjs +15 -0
  32. package/esm2020/global-event-dispatcher.mjs +70 -0
  33. package/esm2020/global-planet.mjs +53 -0
  34. package/esm2020/helpers.mjs +119 -0
  35. package/esm2020/module.mjs +31 -0
  36. package/esm2020/planet.class.mjs +9 -0
  37. package/esm2020/planet.mjs +91 -0
  38. package/esm2020/public-api.mjs +18 -0
  39. package/esm2020/sandbox/constants.mjs +7 -0
  40. package/esm2020/sandbox/exec.mjs +15 -0
  41. package/esm2020/sandbox/index.mjs +20 -0
  42. package/esm2020/sandbox/proxy/patches/document.mjs +12 -0
  43. package/esm2020/sandbox/proxy/patches/eventListener.mjs +41 -0
  44. package/esm2020/sandbox/proxy/patches/index.mjs +11 -0
  45. package/esm2020/sandbox/proxy/patches/storage.mjs +40 -0
  46. package/esm2020/sandbox/proxy/patches/timer.mjs +43 -0
  47. package/esm2020/sandbox/proxy/proxies/common.mjs +132 -0
  48. package/esm2020/sandbox/proxy/proxies/document.mjs +126 -0
  49. package/esm2020/sandbox/proxy/proxies/window.mjs +158 -0
  50. package/esm2020/sandbox/proxy/proxy-sandbox.mjs +49 -0
  51. package/esm2020/sandbox/proxy/types.mjs +2 -0
  52. package/esm2020/sandbox/sandbox.mjs +7 -0
  53. package/esm2020/sandbox/snapshot/snapshot-sandbox.mjs +12 -0
  54. package/esm2020/sandbox/types.mjs +2 -0
  55. package/esm2020/worktile-planet.mjs +5 -0
  56. package/fesm2015/worktile-planet.mjs +2049 -0
  57. package/fesm2015/worktile-planet.mjs.map +1 -0
  58. package/fesm2020/worktile-planet.mjs +2046 -0
  59. package/fesm2020/worktile-planet.mjs.map +1 -0
  60. package/global-event-dispatcher.d.ts +23 -0
  61. package/global-event-dispatcher.d.ts.map +1 -0
  62. package/global-planet.d.ts +23 -0
  63. package/global-planet.d.ts.map +1 -0
  64. package/helpers.d.ts +39 -0
  65. package/helpers.d.ts.map +1 -0
  66. package/index.d.ts +6 -0
  67. package/module.d.ts +12 -0
  68. package/module.d.ts.map +1 -0
  69. package/package.json +27 -120
  70. package/{packages/planet/src/planet.class.ts → planet.class.d.ts} +5 -26
  71. package/planet.class.d.ts.map +1 -0
  72. package/planet.d.ts +28 -0
  73. package/planet.d.ts.map +1 -0
  74. package/{packages/planet/src/public-api.ts → public-api.d.ts} +1 -4
  75. package/public-api.d.ts.map +1 -0
  76. package/sandbox/constants.d.ts +7 -0
  77. package/sandbox/constants.d.ts.map +1 -0
  78. package/sandbox/exec.d.ts +3 -0
  79. package/sandbox/exec.d.ts.map +1 -0
  80. package/sandbox/index.d.ts +7 -0
  81. package/sandbox/index.d.ts.map +1 -0
  82. package/sandbox/proxy/patches/document.d.ts +3 -0
  83. package/sandbox/proxy/patches/document.d.ts.map +1 -0
  84. package/sandbox/proxy/patches/eventListener.d.ts +3 -0
  85. package/sandbox/proxy/patches/eventListener.d.ts.map +1 -0
  86. package/sandbox/proxy/patches/index.d.ts +3 -0
  87. package/sandbox/proxy/patches/index.d.ts.map +1 -0
  88. package/sandbox/proxy/patches/storage.d.ts +15 -0
  89. package/sandbox/proxy/patches/storage.d.ts.map +1 -0
  90. package/sandbox/proxy/patches/timer.d.ts +3 -0
  91. package/sandbox/proxy/patches/timer.d.ts.map +1 -0
  92. package/sandbox/proxy/proxies/common.d.ts +13 -0
  93. package/sandbox/proxy/proxies/common.d.ts.map +1 -0
  94. package/sandbox/proxy/proxies/document.d.ts +14 -0
  95. package/sandbox/proxy/proxies/document.d.ts.map +1 -0
  96. package/sandbox/proxy/proxies/window.d.ts +13 -0
  97. package/sandbox/proxy/proxies/window.d.ts.map +1 -0
  98. package/sandbox/proxy/proxy-sandbox.d.ts +16 -0
  99. package/sandbox/proxy/proxy-sandbox.d.ts.map +1 -0
  100. package/{packages/planet/src/sandbox/proxy/types.ts → sandbox/proxy/types.d.ts} +2 -8
  101. package/sandbox/proxy/types.d.ts.map +1 -0
  102. package/sandbox/sandbox.d.ts +12 -0
  103. package/sandbox/sandbox.d.ts.map +1 -0
  104. package/sandbox/snapshot/snapshot-sandbox.d.ts +9 -0
  105. package/sandbox/snapshot/snapshot-sandbox.d.ts.map +1 -0
  106. package/sandbox/types.d.ts +2 -0
  107. package/sandbox/types.d.ts.map +1 -0
  108. package/worktile-planet.d.ts.map +1 -0
  109. package/.all-contributorsrc +0 -84
  110. package/.circleci/config.yml +0 -17
  111. package/.coveralls.yml +0 -1
  112. package/.docgeni/public/assets/favicon.ico +0 -0
  113. package/.docgeni/public/index.html +0 -13
  114. package/.docgenirc.js +0 -35
  115. package/.dockerignore +0 -1
  116. package/.editorconfig +0 -22
  117. package/.github/FUNDING.yml +0 -12
  118. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  119. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  120. package/.prettierignore +0 -7
  121. package/.prettierrc +0 -28
  122. package/.travis.yml +0 -26
  123. package/.wpmrc.js +0 -11
  124. package/CODE_OF_CONDUCT.md +0 -76
  125. package/Dockerfile +0 -11
  126. package/README.zh-CN.md +0 -307
  127. package/SECURITY.md +0 -21
  128. package/angular.json +0 -373
  129. package/commitlint.config.js +0 -6
  130. package/docs/api/defineApplication.md +0 -46
  131. package/docs/api/globalEventDispatcher.md +0 -51
  132. package/docs/api/index.md +0 -5
  133. package/docs/api/planet.md +0 -117
  134. package/docs/guides/getting-started.md +0 -174
  135. package/docs/guides/index.md +0 -5
  136. package/docs/guides/intro.md +0 -216
  137. package/examples/app1/browserslist +0 -11
  138. package/examples/app1/extra-webpack.config.js +0 -33
  139. package/examples/app1/karma.conf.js +0 -31
  140. package/examples/app1/postcss.config.js +0 -1
  141. package/examples/app1/src/app/app.module.ts +0 -44
  142. package/examples/app1/src/app/app.routing.ts +0 -49
  143. package/examples/app1/src/app/counter.service.ts +0 -16
  144. package/examples/app1/src/app/dashboard/dashboard.component.html +0 -51
  145. package/examples/app1/src/app/dashboard/dashboard.component.ts +0 -70
  146. package/examples/app1/src/app/detail/detail.component.html +0 -8
  147. package/examples/app1/src/app/detail/detail.component.ts +0 -18
  148. package/examples/app1/src/app/overlay.ts +0 -26
  149. package/examples/app1/src/app/projects/dialog/projects-dialog.component.html +0 -10
  150. package/examples/app1/src/app/projects/dialog/projects-dialog.component.ts +0 -41
  151. package/examples/app1/src/app/projects/projects.component.ts +0 -33
  152. package/examples/app1/src/app/root/root.component.css +0 -3
  153. package/examples/app1/src/app/root/root.component.html +0 -16
  154. package/examples/app1/src/app/root/root.component.ts +0 -35
  155. package/examples/app1/src/app/services/initialized-data.resolver.ts +0 -15
  156. package/examples/app1/src/app/shared.module.ts +0 -57
  157. package/examples/app1/src/app/user/detail/user-detail.component.html +0 -5
  158. package/examples/app1/src/app/user/detail/user-detail.component.ts +0 -20
  159. package/examples/app1/src/app/user/user-list.component.html +0 -7
  160. package/examples/app1/src/app/user/user-list.component.ts +0 -20
  161. package/examples/app1/src/app/user/user.module.ts +0 -31
  162. package/examples/app1/src/assets/.gitkeep +0 -0
  163. package/examples/app1/src/assets/github.png +0 -0
  164. package/examples/app1/src/assets/main.css +0 -3
  165. package/examples/app1/src/environments/environment.prod.ts +0 -3
  166. package/examples/app1/src/environments/environment.ts +0 -16
  167. package/examples/app1/src/favicon.ico +0 -0
  168. package/examples/app1/src/index.html +0 -14
  169. package/examples/app1/src/main.ts +0 -35
  170. package/examples/app1/src/polyfills.ts +0 -84
  171. package/examples/app1/src/styles.scss +0 -35
  172. package/examples/app1/src/test.ts +0 -14
  173. package/examples/app1/temp.js +0 -221
  174. package/examples/app1/tsconfig.app.json +0 -10
  175. package/examples/app1/tsconfig.spec.json +0 -18
  176. package/examples/app1/tslint.json +0 -17
  177. package/examples/app1/webpack.config.js +0 -127
  178. package/examples/app2/browserslist +0 -11
  179. package/examples/app2/extra-webpack.config.js +0 -32
  180. package/examples/app2/karma.conf.js +0 -31
  181. package/examples/app2/src/app/app.module.ts +0 -90
  182. package/examples/app2/src/app/dashboard/dashboard.component.html +0 -21
  183. package/examples/app2/src/app/dashboard/dashboard.component.ts +0 -27
  184. package/examples/app2/src/app/overlay.ts +0 -26
  185. package/examples/app2/src/app/projects/detail/detail.component.html +0 -16
  186. package/examples/app2/src/app/projects/detail/detail.component.ts +0 -21
  187. package/examples/app2/src/app/projects/project-list.component.html +0 -29
  188. package/examples/app2/src/app/projects/project-list.component.ts +0 -58
  189. package/examples/app2/src/app/projects/project.resolver.ts +0 -15
  190. package/examples/app2/src/app/projects/projects.service.ts +0 -28
  191. package/examples/app2/src/app/projects/tasks/tasks.component.html +0 -10
  192. package/examples/app2/src/app/projects/tasks/tasks.component.ts +0 -16
  193. package/examples/app2/src/app/projects/view/view.component.html +0 -1
  194. package/examples/app2/src/app/projects/view/view.component.ts +0 -20
  195. package/examples/app2/src/app/root/root.component.html +0 -14
  196. package/examples/app2/src/app/root/root.component.scss +0 -12
  197. package/examples/app2/src/app/root/root.component.ts +0 -28
  198. package/examples/app2/src/app/shared.module.ts +0 -59
  199. package/examples/app2/src/assets/.gitkeep +0 -0
  200. package/examples/app2/src/environments/environment.prod.ts +0 -3
  201. package/examples/app2/src/environments/environment.ts +0 -16
  202. package/examples/app2/src/favicon.ico +0 -0
  203. package/examples/app2/src/index.html +0 -14
  204. package/examples/app2/src/main.ts +0 -36
  205. package/examples/app2/src/polyfills.ts +0 -84
  206. package/examples/app2/src/styles.scss +0 -28
  207. package/examples/app2/src/test.ts +0 -14
  208. package/examples/app2/tsconfig.app.json +0 -10
  209. package/examples/app2/tsconfig.spec.json +0 -18
  210. package/examples/app2/tslint.json +0 -7
  211. package/examples/app2/webpack.config.js +0 -92
  212. package/examples/common/app-root-context.ts +0 -10
  213. package/examples/common/cache.ts +0 -82
  214. package/examples/common/index.ts +0 -13
  215. package/examples/common/module.ts +0 -10
  216. package/examples/common/overlay-container.service.ts +0 -28
  217. package/examples/common/section-card/section-card.component.html +0 -5
  218. package/examples/common/section-card/section-card.component.scss +0 -15
  219. package/examples/common/section-card/section-card.component.ts +0 -11
  220. package/examples/common/utils.ts +0 -0
  221. package/examples/portal/src/app/a-detail/a-detail.component.html +0 -8
  222. package/examples/portal/src/app/a-detail/a-detail.component.ts +0 -18
  223. package/examples/portal/src/app/about/about.component.html +0 -27
  224. package/examples/portal/src/app/about/about.component.scss +0 -0
  225. package/examples/portal/src/app/about/about.component.spec.ts +0 -26
  226. package/examples/portal/src/app/about/about.component.ts +0 -26
  227. package/examples/portal/src/app/app-routing.module.ts +0 -57
  228. package/examples/portal/src/app/app.component.html +0 -73
  229. package/examples/portal/src/app/app.component.scss +0 -58
  230. package/examples/portal/src/app/app.component.spec.ts +0 -33
  231. package/examples/portal/src/app/app.component.ts +0 -111
  232. package/examples/portal/src/app/app.module.ts +0 -64
  233. package/examples/portal/src/app/custom-settings.service.ts +0 -44
  234. package/examples/portal/src/app/overlay.ts +0 -26
  235. package/examples/portal/src/app/settings/settings.component.html +0 -31
  236. package/examples/portal/src/app/settings/settings.component.scss +0 -3
  237. package/examples/portal/src/app/settings/settings.component.ts +0 -43
  238. package/examples/portal/src/assets/.gitkeep +0 -0
  239. package/examples/portal/src/assets/apps.json +0 -29
  240. package/examples/portal/src/assets/icons/sprite.defs.svg +0 -1
  241. package/examples/portal/src/assets/images/logo.svg +0 -16
  242. package/examples/portal/src/assets/ngx-planet-micro-front-end.gif +0 -0
  243. package/examples/portal/src/browserslist +0 -11
  244. package/examples/portal/src/environments/environment.prod.ts +0 -3
  245. package/examples/portal/src/environments/environment.ts +0 -16
  246. package/examples/portal/src/extra-webpack.config.js +0 -32
  247. package/examples/portal/src/favicon.ico +0 -0
  248. package/examples/portal/src/index.html +0 -14
  249. package/examples/portal/src/karma.conf.js +0 -31
  250. package/examples/portal/src/main.ts +0 -18
  251. package/examples/portal/src/polyfills.ts +0 -84
  252. package/examples/portal/src/reboot.scss +0 -14
  253. package/examples/portal/src/styles.scss +0 -14
  254. package/examples/portal/src/test.ts +0 -14
  255. package/examples/portal/src/tsconfig.app.json +0 -10
  256. package/examples/portal/src/tsconfig.spec.json +0 -9
  257. package/examples/portal/src/tslint.json +0 -7
  258. package/extra-webpack.config.js +0 -5
  259. package/nginx.conf +0 -17
  260. package/packages/planet/karma.conf.js +0 -37
  261. package/packages/planet/ng-package.json +0 -7
  262. package/packages/planet/package.json +0 -10
  263. package/packages/planet/src/application/planet-application-loader.spec.ts +0 -1102
  264. package/packages/planet/src/application/planet-application-loader.ts +0 -549
  265. package/packages/planet/src/application/planet-application-ref.spec.ts +0 -233
  266. package/packages/planet/src/application/planet-application-ref.ts +0 -131
  267. package/packages/planet/src/application/planet-application.service.spec.ts +0 -145
  268. package/packages/planet/src/application/planet-application.service.ts +0 -88
  269. package/packages/planet/src/application/portal-application.spec.ts +0 -53
  270. package/packages/planet/src/assets-loader.spec.ts +0 -689
  271. package/packages/planet/src/assets-loader.ts +0 -247
  272. package/packages/planet/src/component/planet-component-loader.spec.ts +0 -187
  273. package/packages/planet/src/component/planet-component-loader.ts +0 -173
  274. package/packages/planet/src/component/planet-component-ref.ts +0 -8
  275. package/packages/planet/src/debug.spec.ts +0 -58
  276. package/packages/planet/src/debug.ts +0 -66
  277. package/packages/planet/src/empty/empty.component.spec.ts +0 -34
  278. package/packages/planet/src/empty/empty.component.ts +0 -7
  279. package/packages/planet/src/global-event-dispatcher.spec.ts +0 -81
  280. package/packages/planet/src/global-event-dispatcher.ts +0 -82
  281. package/packages/planet/src/global-planet.spec.ts +0 -39
  282. package/packages/planet/src/global-planet.ts +0 -73
  283. package/packages/planet/src/helpers.spec.ts +0 -242
  284. package/packages/planet/src/helpers.ts +0 -125
  285. package/packages/planet/src/module.spec.ts +0 -79
  286. package/packages/planet/src/module.ts +0 -25
  287. package/packages/planet/src/planet.spec.ts +0 -226
  288. package/packages/planet/src/planet.ts +0 -113
  289. package/packages/planet/src/sandbox/constants.ts +0 -6
  290. package/packages/planet/src/sandbox/exec.ts +0 -22
  291. package/packages/planet/src/sandbox/index.ts +0 -24
  292. package/packages/planet/src/sandbox/proxy/patches/document.ts +0 -13
  293. package/packages/planet/src/sandbox/proxy/patches/eventListener.ts +0 -49
  294. package/packages/planet/src/sandbox/proxy/patches/index.ts +0 -13
  295. package/packages/planet/src/sandbox/proxy/patches/storage.ts +0 -53
  296. package/packages/planet/src/sandbox/proxy/patches/timer.ts +0 -50
  297. package/packages/planet/src/sandbox/proxy/proxies/common.ts +0 -137
  298. package/packages/planet/src/sandbox/proxy/proxies/document.ts +0 -140
  299. package/packages/planet/src/sandbox/proxy/proxies/window.ts +0 -176
  300. package/packages/planet/src/sandbox/proxy/proxy-sandbox.ts +0 -59
  301. package/packages/planet/src/sandbox/sandbox.ts +0 -20
  302. package/packages/planet/src/sandbox/snapshot/snapshot-sandbox.ts +0 -12
  303. package/packages/planet/src/sandbox/types.ts +0 -1
  304. package/packages/planet/src/test.ts +0 -16
  305. package/packages/planet/src/testing/app1.module.ts +0 -34
  306. package/packages/planet/src/testing/app2.module.ts +0 -24
  307. package/packages/planet/src/testing/applications.ts +0 -58
  308. package/packages/planet/src/testing/index.ts +0 -2
  309. package/packages/planet/src/testing/utils.ts +0 -31
  310. package/packages/planet/tsconfig.lib.json +0 -27
  311. package/packages/planet/tsconfig.lib.prod.json +0 -9
  312. package/packages/planet/tsconfig.spec.json +0 -17
  313. package/packages/planet/tslint.json +0 -7
  314. package/postcss.config.js +0 -3
  315. package/proxy.conf.js +0 -15
  316. package/tsconfig.json +0 -23
  317. package/tslint.json +0 -80
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>Docgeni</title>
6
- <base href="/" />
7
- <meta name="viewport" content="width=device-width, initial-scale=1" />
8
- <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
9
- </head>
10
- <body>
11
- <dg-root></dg-root>
12
- </body>
13
- </html>
package/.docgenirc.js DELETED
@@ -1,35 +0,0 @@
1
- /**
2
- * @type {import('@docgeni/core').DocgeniConfig}
3
- */
4
- module.exports = {
5
- mode: 'full',
6
- title: 'Planet',
7
- description: '微前端解决方案',
8
- docsDir: 'docs',
9
- defaultLocale: 'zh-cn',
10
- repoUrl: 'https://github.com/worktile/ngx-planet',
11
- logoUrl: 'https://cdn.worktile.com/open-sources/ngx-tethys/logos/tethys.png',
12
- navs: [
13
- null,
14
- {
15
- title: '示例',
16
- path: 'http://planet.ngnice.com',
17
- isExternal: true
18
- },
19
- {
20
- title: 'GitHub',
21
- path: 'https://github.com/worktile/ngx-planet',
22
- isExternal: true
23
- },
24
- {
25
- title: '更新日志',
26
- path: 'https://github.com/worktile/ngx-planet/blob/master/CHANGELOG.md',
27
- isExternal: true,
28
- locales: {
29
- 'en-us': {
30
- title: 'Changelog'
31
- }
32
- }
33
- }
34
- ]
35
- };
package/.dockerignore DELETED
@@ -1 +0,0 @@
1
- node_modules
package/.editorconfig DELETED
@@ -1,22 +0,0 @@
1
- # Editor configuration, see https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.js]
12
- indent_size = 4
13
-
14
- [*.ts]
15
- indent_size = 4
16
-
17
- [*.scss]
18
- indent_size = 4
19
-
20
- [*.md]
21
- max_line_length = off
22
- trim_trailing_whitespace = false
@@ -1,12 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
- patreon: # Replace with a single Patreon username
5
- open_collective: # Replace with a single Open Collective username
6
- ko_fi: # Replace with a single Ko-fi username
7
- tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
- community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
- liberapay: # Replace with a single Liberapay username
10
- issuehunt: # Replace with a single IssueHunt username
11
- otechie: # Replace with a single Otechie username
12
- custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -1,38 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Describe the bug**
11
- A clear and concise description of what the bug is.
12
-
13
- **To Reproduce**
14
- Steps to reproduce the behavior:
15
- 1. Go to '...'
16
- 2. Click on '....'
17
- 3. Scroll down to '....'
18
- 4. See error
19
-
20
- **Expected behavior**
21
- A clear and concise description of what you expected to happen.
22
-
23
- **Screenshots**
24
- If applicable, add screenshots to help explain your problem.
25
-
26
- **Desktop (please complete the following information):**
27
- - OS: [e.g. iOS]
28
- - Browser [e.g. chrome, safari]
29
- - Version [e.g. 22]
30
-
31
- **Smartphone (please complete the following information):**
32
- - Device: [e.g. iPhone6]
33
- - OS: [e.g. iOS8.1]
34
- - Browser [e.g. stock browser, safari]
35
- - Version [e.g. 22]
36
-
37
- **Additional context**
38
- Add any other context about the problem here.
@@ -1,20 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Is your feature request related to a problem? Please describe.**
11
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
-
13
- **Describe the solution you'd like**
14
- A clear and concise description of what you want to happen.
15
-
16
- **Describe alternatives you've considered**
17
- A clear and concise description of any alternative solutions or features you've considered.
18
-
19
- **Additional context**
20
- Add any other context or screenshots about the feature request here.
package/.prettierignore DELETED
@@ -1,7 +0,0 @@
1
- package.json
2
- package-lock.json
3
- coverage/
4
- **/*.md
5
- **/*.svg
6
- dist/
7
- docs/
package/.prettierrc DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "eslintIntegration": true,
3
- "stylelintIntegration": true,
4
- "tabWidth": 4,
5
- "singleQuote": true,
6
- "semi": true,
7
- "printWidth": 120,
8
- "overrides": [
9
- {
10
- "files": "*.json",
11
- "options": {
12
- "tabWidth": 2
13
- }
14
- },
15
- {
16
- "files": "*.html",
17
- "options": {
18
- "tabWidth": 2
19
- }
20
- },
21
- {
22
- "files": ".prettierrc",
23
- "options": {
24
- "parser": "json"
25
- }
26
- }
27
- ]
28
- }
package/.travis.yml DELETED
@@ -1,26 +0,0 @@
1
- dist: trusty
2
- sudo: false
3
-
4
- language: node_js
5
- node_js:
6
- - 10.16.0
7
-
8
- addons:
9
- apt:
10
- sources:
11
- - google-chrome
12
- packages:
13
- - google-chrome-stable
14
-
15
- cache:
16
- directories:
17
- - ./node_modules
18
-
19
- install:
20
- - npm install
21
-
22
- script:
23
- - npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
24
-
25
- after_success:
26
- - npm run report-coverage
package/.wpmrc.js DELETED
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- allowBranch: ['master', 'v0.*'],
3
- bumpFiles: ['package.json', 'package-lock.json', 'packages/planet/package.json'],
4
- tagPrefix: '',
5
- commitAll: true,
6
- header: 'Changelog\nAll notable changes to ngx-planet will be documented in this file.\n',
7
- hooks: {
8
- prepublish: 'npm run build',
9
- postreleaseBranch: 'git add .'
10
- }
11
- };
@@ -1,76 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, sex characteristics, gender identity and expression,
9
- level of experience, education, socio-economic status, nationality, personal
10
- appearance, race, religion, or sexual identity and orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at why520crazy@163.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
-
73
- [homepage]: https://www.contributor-covenant.org
74
-
75
- For answers to common questions about this code of conduct, see
76
- https://www.contributor-covenant.org/faq
package/Dockerfile DELETED
@@ -1,11 +0,0 @@
1
- FROM nginx:mainline-alpine
2
- RUN rm /etc/nginx/conf.d/*
3
-
4
- ADD nginx.conf /etc/nginx/conf.d/
5
- RUN mkdir -p /etc/nginx/html/static/app1
6
- RUN mkdir -p /etc/nginx/html/static/app2
7
- RUN mkdir -p /etc/nginx/html/static/portal
8
-
9
- COPY dist/app1 /etc/nginx/html/static/app1/
10
- COPY dist/app2 /etc/nginx/html/static/app2/
11
- COPY dist/portal /etc/nginx/html/static/portal/
package/README.zh-CN.md DELETED
@@ -1,307 +0,0 @@
1
- # ngx-planet
2
-
3
- [![CircleCI](https://circleci.com/gh/worktile/ngx-planet.svg?style=shield)](https://circleci.com/gh/worktile/ngx-planet)
4
- [![Coverage Status][coveralls-image]][coveralls-url]
5
- [![npm (scoped)](https://img.shields.io/npm/v/@worktile/planet?style=flat)](https://www.npmjs.com/package/@worktile/planet)
6
- [![npm](https://img.shields.io/npm/dm/@worktile/planet)](https://www.npmjs.com/package/@worktile/planet)
7
- ![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/@worktile/planet) [![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
8
-
9
- [coveralls-image]: https://coveralls.io/repos/github/worktile/ngx-planet/badge.svg?branch=master
10
- [coveralls-url]: https://coveralls.io/github/worktile/ngx-planet
11
-
12
- 一个强大、可靠、完善、完全可用于生产环境的 Angular 微前端库。
13
- Angular 的 API 风格,目前只支持 Angular 框架,不支持其他 MV* 前端框架。
14
-
15
- 中文文档 | [English README](https://github.com/worktile/ngx-planet/blob/master/README.md)
16
-
17
- ## 功能
18
-
19
- - 支持同时渲染多个子应用
20
- - 支持并存(coexist)和默认(default)两种模式, 默认模式切换其他子应用销毁当前子应用,并存模式不会销毁,而是隐藏
21
- - 支持子应用的预加载
22
- - 支持样式隔离
23
- - 内置多个应用之间的通信
24
- - 支持跨应用组件的渲染
25
- - 完善的示例,包含路由配置、懒加载等所有功能
26
-
27
- ## 其他方案
28
-
29
- - [single-spa](https://github.com/CanopyTax/single-spa): A javascript front-end framework supports any frameworks.
30
- - [mooa](https://github.com/phodal/mooa): A independent-deployment micro-frontend Framework for Angular from single-spa, `planet` 和 `mooa` 非常相似, 但是 `planet` 更加强大、可靠,同时完全用于了生产环境,比如:https://pingcode.com
31
-
32
- ## 安装
33
-
34
- ```bash
35
- $ npm i @worktile/planet --save
36
- // 或者
37
- $ yarn add @worktile/planet
38
- ```
39
-
40
- ## Dependencies
41
-
42
- - `@angular/cdk`, 确保安装了 Angular 官方的 CDK `npm i @angular/cdk --save` 或者 `yarn add @angular/cdk`
43
-
44
-
45
- ## 示例
46
-
47
- [Try out our live demo](http://planet.ngnice.com)
48
-
49
- ![ngx-planet-micro-front-end.gif](https://cdn.pingcode.com/open-sources/ngx-planet/ngx-planet-micro-front-end.gif)
50
-
51
- ## 使用说明
52
-
53
- ### 1. 在主应用的`AppModule`中引入`NgxPlanetModule`
54
-
55
- ```
56
- import { NgxPlanetModule } from '@worktile/planet';
57
-
58
- @NgModule({
59
- imports: [
60
- CommonModule,
61
- NgxPlanetModule
62
- ]
63
- })
64
- class AppModule {}
65
- ```
66
-
67
- ### 2. 通过`Planet`服务在主应用中注册子应用
68
-
69
- ```
70
- @Component({
71
- selector: 'app-portal-root',
72
- template: `
73
- <nav>
74
- <a [routerLink]="['/app1']" routerLinkActive="active">应用1</a>
75
- <a [routerLink]="['/app2']" routerLinkActive="active">应用2</a>
76
- </nav>
77
- <router-outlet></router-outlet>
78
- <div id="app-host-container"></div>
79
- <div *ngIf="!loadingDone">加载中...</div>
80
- `
81
- })
82
- export class AppComponent implements OnInit {
83
- title = 'ngx-planet';
84
-
85
- get loadingDone() {
86
- return this.planet.loadingDone;
87
- }
88
-
89
- constructor(
90
- private planet: Planet
91
- ) {}
92
-
93
- ngOnInit() {
94
- this.planet.setOptions({
95
- switchMode: SwitchModes.coexist,
96
- errorHandler: error => {
97
- console.error(`Failed to load resource, error:`, error);
98
- }
99
- });
100
-
101
- this.planet.registerApps([
102
- {
103
- name: 'app1',
104
- hostParent: '#app-host-container',
105
- hostClass: 'thy-layout',
106
- routerPathPrefix: '/app1',
107
- resourcePathPrefix: '/static/app1',
108
- preload: true,
109
- scripts: [
110
- 'main.js'
111
- ],
112
- styles: [
113
- 'styles.css'
114
- ]
115
- },
116
- {
117
- name: 'app2',
118
- hostParent: '#app-host-container',
119
- hostClass: 'thy-layout',
120
- routerPathPrefix: '/app2',
121
- preload: true,
122
- scripts: [
123
- '/static/app2/main.js'
124
- ],
125
- styles: [
126
- '/static/app2/styles.css'
127
- ]
128
- }
129
- ]);
130
-
131
- // start monitor route changes
132
- // get apps to active by current path
133
- // load static resources which contains javascript and css
134
- // bootstrap angular sub app module and show it
135
- this.planet.start();
136
- }
137
- }
138
- ```
139
-
140
- ### 3. 子应用通过`defineApplication`定义如何启动子应用的`AppModule`, 同时可以设置`PlanetPortalApplication`服务为主应用的全局服务。
141
-
142
- ```
143
- defineApplication('app1', (portalApp: PlanetPortalApplication) => {
144
- return platformBrowserDynamic([
145
- {
146
- provide: PlanetPortalApplication,
147
- useValue: portalApp
148
- }
149
- ])
150
- .bootstrapModule(AppModule)
151
- .then(appModule => {
152
- return appModule;
153
- })
154
- .catch(error => {
155
- console.error(error);
156
- return null;
157
- });
158
- });
159
- ```
160
-
161
- ## 文档
162
-
163
- ### 子应用
164
-
165
- | Name | Type | Description | 中文描述 |
166
- | ------------------ | --------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
167
- | name | string | Application's name | 子应用的名字 |
168
- | routerPathPrefix | string | Application route path prefix | 子应用路由路径前缀,根据这个匹配应用 |
169
- | selector | string | selector of app root component | 子应用的启动组件选择器,因为子应用是主应用动态加载的,所以主应用需要先创建这个选择器节点,再启动 AppModule |
170
- | scripts | string[] | javascript static resource paths | JS 静态资源文件访问地址 |
171
- | styles | string[] | style static resource paths | 样式静态资源文件访问地址 |
172
- | resourcePathPrefix | string | path prefix of scripts and styles | 脚本和样式文件路径前缀,多个脚本可以避免重复写同样的前缀 |
173
- | hostParent | string or HTMLElement | parent element for render | 应用渲染的容器元素, 指定子应用显示在哪个元素内部 |
174
- | hostClass | string | added class for host which is selector | 宿主元素的 Class,也就是在子应用启动组件上追加的样式 |
175
- | switchMode | default or coexist | it will be destroyed when set to default, it only hide app when set to coexist | 切换子应用的模式,默认切换会销毁,设置 coexist 后只会隐藏 |
176
- | preload | boolean | start preload or not | 是否启用预加载,启动后刷新页面等当前页面的应用渲染完毕后预加载子应用 |
177
- | loadSerial | boolean | serial load scripts | 是否串行加载脚本静态资源 |
178
- | manifest | string | manifest json file path | manifest.json 文件路径地址,当设置了路径后会先加载这个文件,然后根据 scripts 和 styles 文件名去找到匹配的文件,因为生产环境的静态资文件是 hash 之后的命名,需要动态获取 |
179
-
180
- ### `GlobalEventDispatcher` 实现应用之间的通信
181
-
182
- ```
183
- import { GlobalEventDispatcher } from "@worktile/planet";
184
-
185
- // app1 root module
186
- export class AppModule {
187
- constructor(private globalEventDispatcher: GlobalEventDispatcher) {
188
- this.globalEventDispatcher.register('open-a-detail').subscribe(event => {
189
- // dialog.open(App1DetailComponent);
190
- });
191
- }
192
- }
193
-
194
- // in other apps
195
- export class OneComponent {
196
- constructor(private globalEventDispatcher: GlobalEventDispatcher) {
197
- }
198
-
199
- openDetail() {
200
- this.globalEventDispatcher.dispatch('open-a-detail', payload);
201
- }
202
- }
203
- ```
204
-
205
- ### 跨应用组件渲染
206
-
207
- ```
208
- import { PlanetComponentLoader } from "@worktile/planet";
209
-
210
- // in app1
211
- export class AppModule {
212
- constructor(private planetComponentLoader: PlanetComponentLoader) {
213
- this.planetComponentLoader.register([{ name: 'app1-project-list', component: App1ProjectListComponent }]);
214
- }
215
- }
216
-
217
- // in other apps
218
- export class OneComponent {
219
- constructor(private planetComponentLoader: PlanetComponentLoader) {
220
- }
221
-
222
- openDetail() {
223
- this.planetComponentLoader.load('app1', 'app1-project-list', {
224
- container: this.containerElementRef,
225
- initialState: {}
226
- });
227
- }
228
- }
229
-
230
- ```
231
-
232
- ## FAQ
233
-
234
- ### 无限循环加载主应用的js
235
- 因为主应用和子应用都是通过Webpack打包的,打包的版本依赖会有冲突,需要通过`@angular-builders/custom-webpack`插件设置扩展的`Webpack`配置`runtimeChunk`, 期望 Webpack 5 对于微前端支持的更好。
236
- ```
237
- // extra-webpack.config.js
238
- {
239
- optimization: {
240
- runtimeChunk: false
241
- }
242
- };
243
- ```
244
-
245
- ### 报错 `Cannot read property 'call' of undefined at __webpack_require__ (bootstrap:79)`
246
- 和上面的原因类似,我们需要设置 `vendorChunk` 为 `false`,需要同时设置 `angular.json`中的`build`和`serve`, `serve` 按理说是应该继承 build 的配置的,好像在 Angular 8 中有缺陷,不起作用。
247
-
248
- ```
249
- ...
250
- "build": {
251
- "builder": "@angular-builders/custom-webpack:browser",
252
- "options": {
253
- "customWebpackConfig": {
254
- "path": "./examples/app2/extra-webpack.config.js",
255
- "mergeStrategies": {
256
- "module.rules": "prepend"
257
- },
258
- "replaceDuplicatePlugins": true
259
- },
260
- ...
261
- "vendorChunk": false,
262
- ...
263
- },
264
- },
265
- "serve": {
266
- "builder": "@angular-builders/custom-webpack:dev-server",
267
- "options": {
268
- ...
269
- "vendorChunk": false
270
- ...
271
- }
272
- }
273
- ...
274
- ```
275
-
276
- ### 报错 `An accessor cannot be declared in an ambient context.`
277
- 这好像是 TypeScript 某个版本的缺陷,详细情况可以查看 see [an-accessor-cannot-be-declared](https://stackoverflow.com/questions/61248058/error-ngx-daterangepicker-material-an-accessor-cannot-be-declared-in-an-ambient
278
- )
279
- 临时解决通过设置 `skipLibCheck` 为 true,将来升级到高级版本的 TypeScript 可能就自动修复了。
280
- ```
281
- "compilerOptions": {
282
- "skipLibCheck": true
283
- }
284
- ```
285
- ### 使用路由延迟加载生产环境报错 `Cannot read property 'call' of undefined``
286
-
287
- 在 Webpack 4 中,多个应用的运行时在同一个页面下会有冲突,因为它们使用了相同的全局变量加载 chunk,为了修复这个问题,你需要通过`output.jsonpFunction`配置项提供一个自定义的名字,详细信息参考:[Automatic unique naming](https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-unique-naming).
288
-
289
- 你需要给每一个子应用的 `extra-webpack.config.js` 文件中配置一个唯一的名字
290
- ```
291
- output: { jsonpFunction: "app1" }
292
- ```
293
-
294
- ## 开发
295
-
296
- ```
297
- npm run start // open http://localhost:3000
298
-
299
- or
300
-
301
- npm run serve:portal // 3000
302
- npm run serve:app1 // 3001
303
- npm run serve:app2 // 3002
304
-
305
- // test
306
- npm run test
307
- ```
package/SECURITY.md DELETED
@@ -1,21 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- Use this section to tell people about which versions of your project are
6
- currently being supported with security updates.
7
-
8
- | Version | Supported |
9
- | ------- | ------------------ |
10
- | 5.1.x | :white_check_mark: |
11
- | 5.0.x | :x: |
12
- | 4.0.x | :white_check_mark: |
13
- | < 4.0 | :x: |
14
-
15
- ## Reporting a Vulnerability
16
-
17
- Use this section to tell people how to report a vulnerability.
18
-
19
- Tell them where to go, how often they can expect to get an update on a
20
- reported vulnerability, what to expect if the vulnerability is accepted or
21
- declined, etc.