@baseplate-dev/plugin-auth 0.6.8 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/auth/core/web.js +31 -2
- package/dist/better-auth/constants/packages.d.ts +1 -1
- package/dist/better-auth/constants/packages.js +1 -1
- package/dist/better-auth/core/web.js +15 -2
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +0 -1
- package/dist/local-auth/core/web.js +15 -2
- package/dist/placeholder-auth/core/web.js +13 -2
- package/dist/web/assets/_virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-ClIdhDoz.js +218 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.mjs-DMKuehfC.js +100 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib_mf_1_web__loadShare__.mjs-D-Ap1aU9.js +38 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.mjs-BwkXxd-B.js +38 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__-D-_Nu6mi.js +2 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.mjs-CCE3BH4R.js +7061 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__react__loadShare__-Bed38hA6.js +3 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__react_mf_2_dom__loadShare__-Bixm3Wfj.js +2 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__-BArWH8PX.js +2 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__.mjs-BalS-ZNe.js +13533 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__prebuild___mf_0_tanstack_mf_1_react_mf_2_router__prebuild__-C01b4AWM.js +2 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__prebuild__react__prebuild__-D4n2cb00.js +3 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-BkswA-5f.js +2 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__prebuild__react_mf_2_dom__prebuild__-CiX5bkAg.js +2 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__prebuild__zod__prebuild__-BnF6dd62.js +2 -0
- package/dist/web/assets/auth-B91ghZtH.js +1 -0
- package/dist/web/assets/common-C7yhhy8-.js +39 -0
- package/dist/web/assets/common-DiDohcsR.js +37 -0
- package/dist/web/assets/common-DpbhYjND.js +39 -0
- package/dist/web/assets/common-DsAJIAWm.js +63 -0
- package/dist/web/assets/common-ERn8TuKQ.js +37 -0
- package/dist/web/assets/common-KNIYXbku.js +18 -0
- package/dist/web/assets/dist-B0GpYPx6.js +18145 -0
- package/dist/web/assets/dist-BhvYza4J.js +69565 -0
- package/dist/web/assets/dist-CEUHjZe8.js +3017 -0
- package/dist/web/assets/get-auth-plugin-definition-Bu_lkrUz.js +14 -0
- package/dist/web/assets/hostInit-BeM6xnlw.js +72 -0
- package/dist/web/assets/index-D5GoD4M0.js +2 -0
- package/dist/web/assets/index.esm-iUXrvsTx.js +2003 -0
- package/dist/web/assets/md-BLjaL5ZD.js +439 -0
- package/dist/web/assets/model-names-BluImOzu.js +27 -0
- package/dist/web/assets/model-names-CUS5rSei.js +12 -0
- package/dist/web/assets/model-utils-BPfI0c3Y.js +1287 -0
- package/dist/web/assets/models-BTYxwDyB.js +304 -0
- package/dist/web/assets/models-BufWBHGv.js +285 -0
- package/dist/web/assets/plugin-definition-BTHzuXv5.js +78 -0
- package/dist/web/assets/plugin-definition-D5s4GTfd.js +11 -0
- package/dist/web/assets/react-B4hMnLhV.js +49 -0
- package/dist/web/assets/rolldown-runtime-_TIqcEvS.js +35 -0
- package/dist/web/assets/stringify-pretty-stable-ByfjYf8u.js +155 -0
- package/dist/web/assets/styles-BpmWykfT.js +174 -0
- package/dist/web/assets/{style-DiK_rD1L.css → styles-CAm3HyKx.css} +1 -1
- package/dist/web/assets/virtualExposes-Bru0eAhP.js +2 -0
- package/dist/web/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-DK03x1PZ.js +270 -0
- package/dist/web/assets/virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-DBiKf3iL.js +168 -0
- package/dist/web/assets/web-BUa3uD-P.js +400 -0
- package/dist/web/assets/web-BmHd5WWD.js +124 -0
- package/dist/web/assets/web-CgosRRUN.js +119 -0
- package/dist/web/assets/web-DhTqWxxL.js +46 -0
- package/dist/web/assets/web-DlJyNEbj.js +357 -0
- package/dist/web/assets/web-ffSErgfF.js +46 -0
- package/dist/web/assets/web-nADEuz1b.js +107 -0
- package/dist/web/index.html +1 -1
- package/dist/web/mf-entry-bootstrap-0.js +17 -0
- package/dist/web/remoteEntry.js +2 -0
- package/package.json +23 -20
- package/dist/auth/core/common.d.ts.map +0 -1
- package/dist/auth/core/common.js.map +0 -1
- package/dist/auth/core/components/auth-definition-editor.d.ts.map +0 -1
- package/dist/auth/core/components/auth-definition-editor.js.map +0 -1
- package/dist/auth/core/components/role-editor-form/role-dialog.d.ts.map +0 -1
- package/dist/auth/core/components/role-editor-form/role-dialog.js.map +0 -1
- package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts.map +0 -1
- package/dist/auth/core/components/role-editor-form/role-editor-form.js.map +0 -1
- package/dist/auth/core/node.d.ts.map +0 -1
- package/dist/auth/core/node.js.map +0 -1
- package/dist/auth/core/schema/migrations.d.ts.map +0 -1
- package/dist/auth/core/schema/migrations.js.map +0 -1
- package/dist/auth/core/schema/plugin-definition.d.ts.map +0 -1
- package/dist/auth/core/schema/plugin-definition.js.map +0 -1
- package/dist/auth/core/schema/roles/constants.d.ts.map +0 -1
- package/dist/auth/core/schema/roles/constants.js.map +0 -1
- package/dist/auth/core/schema/roles/index.d.ts.map +0 -1
- package/dist/auth/core/schema/roles/index.js.map +0 -1
- package/dist/auth/core/schema/roles/schema.d.ts.map +0 -1
- package/dist/auth/core/schema/roles/schema.js.map +0 -1
- package/dist/auth/core/web.d.ts.map +0 -1
- package/dist/auth/core/web.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/utils/get-auth-plugin-definition.d.ts.map +0 -1
- package/dist/auth/utils/get-auth-plugin-definition.js.map +0 -1
- package/dist/auth/utils/index.d.ts.map +0 -1
- package/dist/auth/utils/index.js.map +0 -1
- package/dist/better-auth/admin/common.d.ts.map +0 -1
- package/dist/better-auth/admin/common.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/index.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/index.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/index.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-roles-column/index.d.ts.map +0 -1
- package/dist/better-auth/admin/generators/admin-crud-roles-column/index.js.map +0 -1
- package/dist/better-auth/admin/node.d.ts.map +0 -1
- package/dist/better-auth/admin/node.js.map +0 -1
- package/dist/better-auth/admin/schema/manage-role-action.d.ts.map +0 -1
- package/dist/better-auth/admin/schema/manage-role-action.js.map +0 -1
- package/dist/better-auth/admin/schema/reset-password-action.d.ts.map +0 -1
- package/dist/better-auth/admin/schema/reset-password-action.js.map +0 -1
- package/dist/better-auth/admin/schema/roles-column.d.ts.map +0 -1
- package/dist/better-auth/admin/schema/roles-column.js.map +0 -1
- package/dist/better-auth/admin/web.d.ts.map +0 -1
- package/dist/better-auth/admin/web.js.map +0 -1
- package/dist/better-auth/constants/model-names.d.ts.map +0 -1
- package/dist/better-auth/constants/model-names.js.map +0 -1
- package/dist/better-auth/constants/packages.d.ts.map +0 -1
- package/dist/better-auth/constants/packages.js.map +0 -1
- package/dist/better-auth/core/common.d.ts.map +0 -1
- package/dist/better-auth/core/common.js.map +0 -1
- package/dist/better-auth/core/components/better-auth-definition-editor.d.ts.map +0 -1
- package/dist/better-auth/core/components/better-auth-definition-editor.js.map +0 -1
- package/dist/better-auth/core/index.d.ts.map +0 -1
- package/dist/better-auth/core/index.js.map +0 -1
- package/dist/better-auth/core/node.d.ts.map +0 -1
- package/dist/better-auth/core/node.js.map +0 -1
- package/dist/better-auth/core/schema/models.d.ts.map +0 -1
- package/dist/better-auth/core/schema/models.js.map +0 -1
- package/dist/better-auth/core/schema/plugin-definition.d.ts.map +0 -1
- package/dist/better-auth/core/schema/plugin-definition.js.map +0 -1
- package/dist/better-auth/core/schema/schema-issue-checker.d.ts.map +0 -1
- package/dist/better-auth/core/schema/schema-issue-checker.js.map +0 -1
- package/dist/better-auth/core/web.d.ts.map +0 -1
- package/dist/better-auth/core/web.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/better-auth-admin-module.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/better-auth-admin-module.generator.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/ts-import-providers.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/better-auth-email-templates.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/better-auth-email-templates.generator.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-email-templates/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/better-auth-module/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/index.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/index.js.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/seed-initial-user.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/fastify/seed-initial-user/seed-initial-user.generator.js.map +0 -1
- package/dist/better-auth/generators/index.d.ts.map +0 -1
- package/dist/better-auth/generators/index.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/index.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-hooks/index.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/index.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/better-auth-pages/index.js.map +0 -1
- package/dist/better-auth/generators/react/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/index.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/index.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/index.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/index.js.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts.map +0 -1
- package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.js.map +0 -1
- package/dist/better-auth/index.d.ts.map +0 -1
- package/dist/better-auth/index.js.map +0 -1
- package/dist/common/components/auth-config-tabs.d.ts.map +0 -1
- package/dist/common/components/auth-config-tabs.js.map +0 -1
- package/dist/local-auth/admin/common.d.ts.map +0 -1
- package/dist/local-auth/admin/common.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts.map +0 -1
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js.map +0 -1
- package/dist/local-auth/admin/node.d.ts.map +0 -1
- package/dist/local-auth/admin/node.js.map +0 -1
- package/dist/local-auth/admin/schema/manage-role-action.d.ts.map +0 -1
- package/dist/local-auth/admin/schema/manage-role-action.js.map +0 -1
- package/dist/local-auth/admin/schema/reset-password-action.d.ts.map +0 -1
- package/dist/local-auth/admin/schema/reset-password-action.js.map +0 -1
- package/dist/local-auth/admin/schema/roles-column.d.ts.map +0 -1
- package/dist/local-auth/admin/schema/roles-column.js.map +0 -1
- package/dist/local-auth/admin/web.d.ts.map +0 -1
- package/dist/local-auth/admin/web.js.map +0 -1
- package/dist/local-auth/constants/model-names.d.ts.map +0 -1
- package/dist/local-auth/constants/model-names.js.map +0 -1
- package/dist/local-auth/core/common.d.ts.map +0 -1
- package/dist/local-auth/core/common.js.map +0 -1
- package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +0 -1
- package/dist/local-auth/core/components/local-auth-definition-editor.js.map +0 -1
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js.map +0 -1
- package/dist/local-auth/core/generators/auth-apollo/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-apollo/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/index.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts.map +0 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js.map +0 -1
- package/dist/local-auth/core/generators/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/index.js.map +0 -1
- package/dist/local-auth/core/generators/react-auth/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-auth/index.js.map +0 -1
- package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-auth/react-auth.generator.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/index.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/react-session.generator.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +0 -1
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +0 -1
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/index.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/index.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts.map +0 -1
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js.map +0 -1
- package/dist/local-auth/core/index.d.ts.map +0 -1
- package/dist/local-auth/core/index.js.map +0 -1
- package/dist/local-auth/core/node.d.ts.map +0 -1
- package/dist/local-auth/core/node.js.map +0 -1
- package/dist/local-auth/core/schema/models.d.ts.map +0 -1
- package/dist/local-auth/core/schema/models.js.map +0 -1
- package/dist/local-auth/core/schema/plugin-definition.d.ts.map +0 -1
- package/dist/local-auth/core/schema/plugin-definition.js.map +0 -1
- package/dist/local-auth/core/schema/schema-issue-checker.d.ts.map +0 -1
- package/dist/local-auth/core/schema/schema-issue-checker.js.map +0 -1
- package/dist/local-auth/core/web.d.ts.map +0 -1
- package/dist/local-auth/core/web.js.map +0 -1
- package/dist/local-auth/index.d.ts.map +0 -1
- package/dist/local-auth/index.js.map +0 -1
- package/dist/placeholder-auth/constants/model-names.d.ts.map +0 -1
- package/dist/placeholder-auth/constants/model-names.js.map +0 -1
- package/dist/placeholder-auth/core/common.d.ts.map +0 -1
- package/dist/placeholder-auth/core/common.js.map +0 -1
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +0 -1
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +0 -1
- package/dist/placeholder-auth/core/generators/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/index.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js.map +0 -1
- package/dist/placeholder-auth/core/index.d.ts.map +0 -1
- package/dist/placeholder-auth/core/index.js.map +0 -1
- package/dist/placeholder-auth/core/node.d.ts.map +0 -1
- package/dist/placeholder-auth/core/node.js.map +0 -1
- package/dist/placeholder-auth/core/schema/models.d.ts.map +0 -1
- package/dist/placeholder-auth/core/schema/models.js.map +0 -1
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +0 -1
- package/dist/placeholder-auth/core/schema/plugin-definition.js.map +0 -1
- package/dist/placeholder-auth/core/web.d.ts.map +0 -1
- package/dist/placeholder-auth/core/web.js.map +0 -1
- package/dist/placeholder-auth/index.d.ts.map +0 -1
- package/dist/placeholder-auth/index.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreCommon-Chd1hkDj.js +0 -85
- package/dist/web/assets/__federation_expose_authCoreCommon-Chd1hkDj.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreWeb-B6MMIRwe.js +0 -453
- package/dist/web/assets/__federation_expose_authCoreWeb-B6MMIRwe.js.map +0 -1
- package/dist/web/assets/__federation_expose_better-authAdminCommon-BTbhl15Q.js +0 -63
- package/dist/web/assets/__federation_expose_better-authAdminCommon-BTbhl15Q.js.map +0 -1
- package/dist/web/assets/__federation_expose_better-authAdminWeb-CwKP2Fwx.js +0 -41
- package/dist/web/assets/__federation_expose_better-authAdminWeb-CwKP2Fwx.js.map +0 -1
- package/dist/web/assets/__federation_expose_better-authCoreCommon-DHvNg16x.js +0 -54
- package/dist/web/assets/__federation_expose_better-authCoreCommon-DHvNg16x.js.map +0 -1
- package/dist/web/assets/__federation_expose_better-authCoreWeb-DcL0DNwe.js +0 -157
- package/dist/web/assets/__federation_expose_better-authCoreWeb-DcL0DNwe.js.map +0 -1
- package/dist/web/assets/__federation_expose_local-authAdminCommon-BTbhl15Q.js +0 -63
- package/dist/web/assets/__federation_expose_local-authAdminCommon-BTbhl15Q.js.map +0 -1
- package/dist/web/assets/__federation_expose_local-authAdminWeb-DeDTjgfy.js +0 -41
- package/dist/web/assets/__federation_expose_local-authAdminWeb-DeDTjgfy.js.map +0 -1
- package/dist/web/assets/__federation_expose_local-authCoreCommon-CaB76kZh.js +0 -54
- package/dist/web/assets/__federation_expose_local-authCoreCommon-CaB76kZh.js.map +0 -1
- package/dist/web/assets/__federation_expose_local-authCoreWeb-J0GrCM1P.js +0 -167
- package/dist/web/assets/__federation_expose_local-authCoreWeb-J0GrCM1P.js.map +0 -1
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-DEOS_PRC.js +0 -23
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-DEOS_PRC.js.map +0 -1
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-xpLN9suD.js +0 -177
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-xpLN9suD.js.map +0 -1
- package/dist/web/assets/__federation_fn_import-DboThXN4.js +0 -421
- package/dist/web/assets/__federation_fn_import-DboThXN4.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-wm-FNH7x.js +0 -359
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-wm-FNH7x.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CDRCjvEd.js +0 -22532
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CDRCjvEd.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-Bwy1GWne.js +0 -78637
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-Bwy1GWne.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/utils-Cs-QtWzA.js +0 -1855
- package/dist/web/assets/__federation_shared_@baseplate-dev/utils-Cs-QtWzA.js.map +0 -1
- package/dist/web/assets/__federation_shared_@tanstack/react-router-_N2czGX0.js +0 -6565
- package/dist/web/assets/__federation_shared_@tanstack/react-router-_N2czGX0.js.map +0 -1
- package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js +0 -8
- package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js.map +0 -1
- package/dist/web/assets/__federation_shared_react-dom-B4vgf5Ln.js +0 -251
- package/dist/web/assets/__federation_shared_react-dom-B4vgf5Ln.js.map +0 -1
- package/dist/web/assets/__federation_shared_zod-Do7Aa1b5.js +0 -13250
- package/dist/web/assets/__federation_shared_zod-Do7Aa1b5.js.map +0 -1
- package/dist/web/assets/_commonjsHelpers-B85MJLTf.js +0 -6
- package/dist/web/assets/_commonjsHelpers-B85MJLTf.js.map +0 -1
- package/dist/web/assets/get-auth-plugin-definition-Dy9T0JTI.js +0 -13
- package/dist/web/assets/get-auth-plugin-definition-Dy9T0JTI.js.map +0 -1
- package/dist/web/assets/index-DN2TTEo8.js +0 -101
- package/dist/web/assets/index-DN2TTEo8.js.map +0 -1
- package/dist/web/assets/index-DUwCgkeV.js +0 -570
- package/dist/web/assets/index-DUwCgkeV.js.map +0 -1
- package/dist/web/assets/index-l0sNRNKZ.js.map +0 -1
- package/dist/web/assets/index.esm-BMmVLbge.js +0 -2676
- package/dist/web/assets/index.esm-BMmVLbge.js.map +0 -1
- package/dist/web/assets/isEqual-tnzoadW8.js +0 -242
- package/dist/web/assets/isEqual-tnzoadW8.js.map +0 -1
- package/dist/web/assets/jsx-runtime-XI9uIe3W.js +0 -60
- package/dist/web/assets/jsx-runtime-XI9uIe3W.js.map +0 -1
- package/dist/web/assets/mergeWith-VagwCqUi.js +0 -76
- package/dist/web/assets/mergeWith-VagwCqUi.js.map +0 -1
- package/dist/web/assets/model-names-D7UT0B8x.js +0 -10
- package/dist/web/assets/model-names-D7UT0B8x.js.map +0 -1
- package/dist/web/assets/model-names-DrcaRxt1.js +0 -25
- package/dist/web/assets/model-names-DrcaRxt1.js.map +0 -1
- package/dist/web/assets/model-utils-DVlh_mZg.js +0 -840
- package/dist/web/assets/model-utils-DVlh_mZg.js.map +0 -1
- package/dist/web/assets/plugin-definition-BA3dR1I6.js +0 -16
- package/dist/web/assets/plugin-definition-BA3dR1I6.js.map +0 -1
- package/dist/web/assets/plugin-definition-DqIciiTP.js +0 -93
- package/dist/web/assets/plugin-definition-DqIciiTP.js.map +0 -1
- package/dist/web/assets/plugin-definition-TuWj1Cbs.js +0 -315
- package/dist/web/assets/plugin-definition-TuWj1Cbs.js.map +0 -1
- package/dist/web/assets/plugin-definition-YXnH0eeN.js +0 -304
- package/dist/web/assets/plugin-definition-YXnH0eeN.js.map +0 -1
- package/dist/web/assets/react-BFk_Rnee.js +0 -47
- package/dist/web/assets/react-BFk_Rnee.js.map +0 -1
- package/dist/web/assets/registries-Tz_dluz3.js +0 -1119
- package/dist/web/assets/registries-Tz_dluz3.js.map +0 -1
- package/dist/web/assets/remoteEntry.js +0 -84
- package/dist/web/assets/remoteEntry.js.map +0 -1
- package/dist/web/assets/styles-CdKqeRZD.js +0 -69
- package/dist/web/assets/styles-CdKqeRZD.js.map +0 -1
- package/dist/web/assets/with-selector-DTXBONcE.js +0 -201
- package/dist/web/assets/with-selector-DTXBONcE.js.map +0 -1
|
@@ -0,0 +1,3017 @@
|
|
|
1
|
+
import { w as __vitePreload } from "./_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.mjs-DMKuehfC.js";
|
|
2
|
+
var BROWSER_LOG_KEY = "FEDERATION_DEBUG";
|
|
3
|
+
var NameTransformSymbol = {
|
|
4
|
+
AT: "@",
|
|
5
|
+
HYPHEN: "-",
|
|
6
|
+
SLASH: "/"
|
|
7
|
+
};
|
|
8
|
+
var NameTransformMap = {
|
|
9
|
+
[NameTransformSymbol.AT]: "scope_",
|
|
10
|
+
[NameTransformSymbol.HYPHEN]: "_",
|
|
11
|
+
[NameTransformSymbol.SLASH]: "__"
|
|
12
|
+
};
|
|
13
|
+
NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH;
|
|
14
|
+
var TreeShakingStatus = /* @__PURE__ */ function(TreeShakingStatus) {
|
|
15
|
+
/**
|
|
16
|
+
* Not handled by deploy server, needs to infer by the real runtime period.
|
|
17
|
+
*/
|
|
18
|
+
TreeShakingStatus[TreeShakingStatus["UNKNOWN"] = 1] = "UNKNOWN";
|
|
19
|
+
/**
|
|
20
|
+
* It means the shared has been calculated , runtime should take this shared as first choice.
|
|
21
|
+
*/
|
|
22
|
+
TreeShakingStatus[TreeShakingStatus["CALCULATED"] = 2] = "CALCULATED";
|
|
23
|
+
/**
|
|
24
|
+
* It means the shared has been calculated, and marked as no used
|
|
25
|
+
*/
|
|
26
|
+
TreeShakingStatus[TreeShakingStatus["NO_USE"] = 0] = "NO_USE";
|
|
27
|
+
return TreeShakingStatus;
|
|
28
|
+
}({});
|
|
29
|
+
function isBrowserEnv() {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
function isReactNativeEnv() {
|
|
33
|
+
return typeof navigator !== "undefined" && navigator?.product === "ReactNative";
|
|
34
|
+
}
|
|
35
|
+
function isBrowserDebug() {
|
|
36
|
+
try {
|
|
37
|
+
if (isBrowserEnv() && window.localStorage) return Boolean(localStorage.getItem(BROWSER_LOG_KEY));
|
|
38
|
+
} catch (error) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
function isDebugMode() {
|
|
44
|
+
if (typeof process !== "undefined" && {}["FEDERATION_DEBUG"]) return Boolean({}["FEDERATION_DEBUG"]);
|
|
45
|
+
if (typeof FEDERATION_DEBUG !== "undefined" && Boolean(FEDERATION_DEBUG)) return true;
|
|
46
|
+
return isBrowserDebug();
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../../node_modules/.pnpm/@module-federation+sdk@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/sdk/dist/utils.js
|
|
50
|
+
var LOG_CATEGORY$1 = "[ Federation Runtime ]";
|
|
51
|
+
var composeKeyWithSeparator = function(...args) {
|
|
52
|
+
if (!args.length) return "";
|
|
53
|
+
return args.reduce((sum, cur) => {
|
|
54
|
+
if (!cur) return sum;
|
|
55
|
+
if (!sum) return cur;
|
|
56
|
+
return `${sum}:${cur}`;
|
|
57
|
+
}, "");
|
|
58
|
+
};
|
|
59
|
+
var getResourceUrl = (module, sourceUrl) => {
|
|
60
|
+
if ("getPublicPath" in module) {
|
|
61
|
+
let publicPath;
|
|
62
|
+
if (!module.getPublicPath.startsWith("function")) publicPath = new Function(module.getPublicPath)();
|
|
63
|
+
else publicPath = new Function("return " + module.getPublicPath)()();
|
|
64
|
+
return `${publicPath}${sourceUrl}`;
|
|
65
|
+
} else if ("publicPath" in module) {
|
|
66
|
+
if (!isBrowserEnv() && !isReactNativeEnv() && "ssrPublicPath" in module && typeof module.ssrPublicPath === "string") return `${module.ssrPublicPath}${sourceUrl}`;
|
|
67
|
+
return `${module.publicPath}${sourceUrl}`;
|
|
68
|
+
} else {
|
|
69
|
+
console.warn("Cannot get resource URL. If in debug mode, please ignore.", module, sourceUrl);
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var warn = (msg) => {
|
|
74
|
+
console.warn(`${LOG_CATEGORY$1}: ${msg}`);
|
|
75
|
+
};
|
|
76
|
+
function safeToString(info) {
|
|
77
|
+
try {
|
|
78
|
+
return JSON.stringify(info, null, 2);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region ../../node_modules/.pnpm/@module-federation+sdk@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/sdk/dist/generateSnapshotFromManifest.js
|
|
85
|
+
var simpleJoinRemoteEntry = (rPath, rName) => {
|
|
86
|
+
if (!rPath) return rName;
|
|
87
|
+
const transformPath = (str) => {
|
|
88
|
+
if (str === ".") return "";
|
|
89
|
+
if (str.startsWith("./")) return str.replace("./", "");
|
|
90
|
+
if (str.startsWith("/")) {
|
|
91
|
+
const strWithoutSlash = str.slice(1);
|
|
92
|
+
if (strWithoutSlash.endsWith("/")) return strWithoutSlash.slice(0, -1);
|
|
93
|
+
return strWithoutSlash;
|
|
94
|
+
}
|
|
95
|
+
return str;
|
|
96
|
+
};
|
|
97
|
+
const transformedPath = transformPath(rPath);
|
|
98
|
+
if (!transformedPath) return rName;
|
|
99
|
+
if (transformedPath.endsWith("/")) return `${transformedPath}${rName}`;
|
|
100
|
+
return `${transformedPath}/${rName}`;
|
|
101
|
+
};
|
|
102
|
+
function inferAutoPublicPath(url) {
|
|
103
|
+
return url.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
104
|
+
}
|
|
105
|
+
function generateSnapshotFromManifest(manifest, options = {}) {
|
|
106
|
+
const { remotes = {}, overrides = {}, version } = options;
|
|
107
|
+
let remoteSnapshot;
|
|
108
|
+
const getPublicPath = () => {
|
|
109
|
+
if ("publicPath" in manifest.metaData) {
|
|
110
|
+
if ((manifest.metaData.publicPath === "auto" || manifest.metaData.publicPath === "") && version) return inferAutoPublicPath(version);
|
|
111
|
+
return manifest.metaData.publicPath;
|
|
112
|
+
} else return manifest.metaData.getPublicPath;
|
|
113
|
+
};
|
|
114
|
+
const overridesKeys = Object.keys(overrides);
|
|
115
|
+
let remotesInfo = {};
|
|
116
|
+
if (!Object.keys(remotes).length) remotesInfo = manifest.remotes?.reduce((res, next) => {
|
|
117
|
+
let matchedVersion;
|
|
118
|
+
const name = next.federationContainerName;
|
|
119
|
+
if (overridesKeys.includes(name)) matchedVersion = overrides[name];
|
|
120
|
+
else if ("version" in next) matchedVersion = next.version;
|
|
121
|
+
else matchedVersion = next.entry;
|
|
122
|
+
res[name] = { matchedVersion };
|
|
123
|
+
return res;
|
|
124
|
+
}, {}) || {};
|
|
125
|
+
Object.keys(remotes).forEach((key) => remotesInfo[key] = { matchedVersion: overridesKeys.includes(key) ? overrides[key] : remotes[key] });
|
|
126
|
+
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes = {
|
|
127
|
+
path: "",
|
|
128
|
+
name: "",
|
|
129
|
+
zip: "",
|
|
130
|
+
api: ""
|
|
131
|
+
}, buildInfo: { buildVersion }, globalName, ssrRemoteEntry } = manifest.metaData;
|
|
132
|
+
const { exposes } = manifest;
|
|
133
|
+
let basicRemoteSnapshot = {
|
|
134
|
+
version: version ? version : "",
|
|
135
|
+
buildVersion,
|
|
136
|
+
globalName,
|
|
137
|
+
remoteEntry: simpleJoinRemoteEntry(remoteEntryPath, remoteEntryName),
|
|
138
|
+
remoteEntryType,
|
|
139
|
+
remoteTypes: simpleJoinRemoteEntry(remoteTypes.path, remoteTypes.name),
|
|
140
|
+
remoteTypesZip: remoteTypes.zip || "",
|
|
141
|
+
remoteTypesAPI: remoteTypes.api || "",
|
|
142
|
+
remotesInfo,
|
|
143
|
+
shared: manifest?.shared.map((item) => ({
|
|
144
|
+
assets: item.assets,
|
|
145
|
+
sharedName: item.name,
|
|
146
|
+
version: item.version,
|
|
147
|
+
usedExports: item.referenceExports || []
|
|
148
|
+
})),
|
|
149
|
+
modules: exposes?.map((expose) => ({
|
|
150
|
+
moduleName: expose.name,
|
|
151
|
+
modulePath: expose.path,
|
|
152
|
+
assets: expose.assets
|
|
153
|
+
}))
|
|
154
|
+
};
|
|
155
|
+
if ("publicPath" in manifest.metaData) {
|
|
156
|
+
remoteSnapshot = {
|
|
157
|
+
...basicRemoteSnapshot,
|
|
158
|
+
publicPath: getPublicPath()
|
|
159
|
+
};
|
|
160
|
+
if (typeof manifest.metaData.ssrPublicPath === "string") remoteSnapshot.ssrPublicPath = manifest.metaData.ssrPublicPath;
|
|
161
|
+
} else remoteSnapshot = {
|
|
162
|
+
...basicRemoteSnapshot,
|
|
163
|
+
getPublicPath: getPublicPath()
|
|
164
|
+
};
|
|
165
|
+
if (ssrRemoteEntry) {
|
|
166
|
+
const fullSSRRemoteEntry = simpleJoinRemoteEntry(ssrRemoteEntry.path, ssrRemoteEntry.name);
|
|
167
|
+
remoteSnapshot.ssrRemoteEntry = fullSSRRemoteEntry;
|
|
168
|
+
remoteSnapshot.ssrRemoteEntryType = ssrRemoteEntry.type || "commonjs-module";
|
|
169
|
+
}
|
|
170
|
+
return remoteSnapshot;
|
|
171
|
+
}
|
|
172
|
+
function isManifestProvider(moduleInfo) {
|
|
173
|
+
if ("remoteEntry" in moduleInfo && moduleInfo.remoteEntry.includes(".json")) return true;
|
|
174
|
+
else return false;
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region ../../node_modules/.pnpm/@module-federation+sdk@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/sdk/dist/logger.js
|
|
178
|
+
var PREFIX = "[ Module Federation ]";
|
|
179
|
+
var DEFAULT_DELEGATE = console;
|
|
180
|
+
var LOGGER_STACK_SKIP_TOKENS = [
|
|
181
|
+
"logger.ts",
|
|
182
|
+
"logger.js",
|
|
183
|
+
"captureStackTrace",
|
|
184
|
+
"Logger.emit",
|
|
185
|
+
"Logger.log",
|
|
186
|
+
"Logger.info",
|
|
187
|
+
"Logger.warn",
|
|
188
|
+
"Logger.error",
|
|
189
|
+
"Logger.debug"
|
|
190
|
+
];
|
|
191
|
+
function captureStackTrace() {
|
|
192
|
+
try {
|
|
193
|
+
const stack = (/* @__PURE__ */ new Error()).stack;
|
|
194
|
+
if (!stack) return;
|
|
195
|
+
const [, ...rawLines] = stack.split("\n");
|
|
196
|
+
const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));
|
|
197
|
+
if (!filtered.length) return;
|
|
198
|
+
return `Stack trace:\n${filtered.slice(0, 5).join("\n")}`;
|
|
199
|
+
} catch {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
var Logger = class {
|
|
204
|
+
constructor(prefix, delegate = DEFAULT_DELEGATE) {
|
|
205
|
+
this.prefix = prefix;
|
|
206
|
+
this.delegate = delegate ?? DEFAULT_DELEGATE;
|
|
207
|
+
}
|
|
208
|
+
setPrefix(prefix) {
|
|
209
|
+
this.prefix = prefix;
|
|
210
|
+
}
|
|
211
|
+
setDelegate(delegate) {
|
|
212
|
+
this.delegate = delegate ?? DEFAULT_DELEGATE;
|
|
213
|
+
}
|
|
214
|
+
emit(method, args) {
|
|
215
|
+
const delegate = this.delegate;
|
|
216
|
+
const stackTrace = isDebugMode() ? captureStackTrace() : void 0;
|
|
217
|
+
const enrichedArgs = stackTrace ? [...args, stackTrace] : args;
|
|
218
|
+
const order = (() => {
|
|
219
|
+
switch (method) {
|
|
220
|
+
case "log": return ["log", "info"];
|
|
221
|
+
case "info": return ["info", "log"];
|
|
222
|
+
case "warn": return [
|
|
223
|
+
"warn",
|
|
224
|
+
"info",
|
|
225
|
+
"log"
|
|
226
|
+
];
|
|
227
|
+
case "error": return [
|
|
228
|
+
"error",
|
|
229
|
+
"warn",
|
|
230
|
+
"log"
|
|
231
|
+
];
|
|
232
|
+
default: return ["debug", "log"];
|
|
233
|
+
}
|
|
234
|
+
})();
|
|
235
|
+
for (const candidate of order) {
|
|
236
|
+
const handler = delegate[candidate];
|
|
237
|
+
if (typeof handler === "function") {
|
|
238
|
+
handler.call(delegate, this.prefix, ...enrichedArgs);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
for (const candidate of order) {
|
|
243
|
+
const handler = DEFAULT_DELEGATE[candidate];
|
|
244
|
+
if (typeof handler === "function") {
|
|
245
|
+
handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
log(...args) {
|
|
251
|
+
this.emit("log", args);
|
|
252
|
+
}
|
|
253
|
+
warn(...args) {
|
|
254
|
+
this.emit("warn", args);
|
|
255
|
+
}
|
|
256
|
+
error(...args) {
|
|
257
|
+
this.emit("error", args);
|
|
258
|
+
}
|
|
259
|
+
success(...args) {
|
|
260
|
+
this.emit("info", args);
|
|
261
|
+
}
|
|
262
|
+
info(...args) {
|
|
263
|
+
this.emit("info", args);
|
|
264
|
+
}
|
|
265
|
+
ready(...args) {
|
|
266
|
+
this.emit("info", args);
|
|
267
|
+
}
|
|
268
|
+
debug(...args) {
|
|
269
|
+
if (isDebugMode()) this.emit("debug", args);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
function createLogger(prefix) {
|
|
273
|
+
return new Logger(prefix);
|
|
274
|
+
}
|
|
275
|
+
function createInfrastructureLogger(prefix) {
|
|
276
|
+
const infrastructureLogger = new Logger(prefix);
|
|
277
|
+
Object.defineProperty(infrastructureLogger, "__mf_infrastructure_logger__", {
|
|
278
|
+
value: true,
|
|
279
|
+
enumerable: false,
|
|
280
|
+
configurable: false
|
|
281
|
+
});
|
|
282
|
+
return infrastructureLogger;
|
|
283
|
+
}
|
|
284
|
+
createLogger(PREFIX);
|
|
285
|
+
createInfrastructureLogger(PREFIX);
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region ../../node_modules/.pnpm/@module-federation+sdk@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/sdk/dist/dom.js
|
|
288
|
+
async function safeWrapper(callback, disableWarn) {
|
|
289
|
+
try {
|
|
290
|
+
return await callback();
|
|
291
|
+
} catch (e) {
|
|
292
|
+
!disableWarn && warn(e);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function isStaticResourcesEqual(url1, url2) {
|
|
297
|
+
const REG_EXP = /^(https?:)?\/\//i;
|
|
298
|
+
return url1.replace(REG_EXP, "").replace(/\/$/, "") === url2.replace(REG_EXP, "").replace(/\/$/, "");
|
|
299
|
+
}
|
|
300
|
+
function createScript(info) {
|
|
301
|
+
let script = null;
|
|
302
|
+
let needAttach = true;
|
|
303
|
+
let timeout = 2e4;
|
|
304
|
+
let timeoutId;
|
|
305
|
+
const scripts = document.getElementsByTagName("script");
|
|
306
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
307
|
+
const s = scripts[i];
|
|
308
|
+
const scriptSrc = s.getAttribute("src");
|
|
309
|
+
if (scriptSrc && isStaticResourcesEqual(scriptSrc, info.url)) {
|
|
310
|
+
script = s;
|
|
311
|
+
needAttach = false;
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (!script) {
|
|
316
|
+
const attrs = info.attrs;
|
|
317
|
+
script = document.createElement("script");
|
|
318
|
+
script.type = attrs?.["type"] === "module" ? "module" : "text/javascript";
|
|
319
|
+
let createScriptRes = void 0;
|
|
320
|
+
if (info.createScriptHook) {
|
|
321
|
+
createScriptRes = info.createScriptHook(info.url, info.attrs);
|
|
322
|
+
if (createScriptRes instanceof HTMLScriptElement) script = createScriptRes;
|
|
323
|
+
else if (typeof createScriptRes === "object") {
|
|
324
|
+
if ("script" in createScriptRes && createScriptRes.script) script = createScriptRes.script;
|
|
325
|
+
if ("timeout" in createScriptRes && createScriptRes.timeout) timeout = createScriptRes.timeout;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (!script.src) script.src = info.url;
|
|
329
|
+
if (attrs && !createScriptRes) Object.keys(attrs).forEach((name) => {
|
|
330
|
+
if (script) {
|
|
331
|
+
if (name === "async" || name === "defer") script[name] = attrs[name];
|
|
332
|
+
else if (!script.getAttribute(name)) script.setAttribute(name, attrs[name]);
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
let executionError = null;
|
|
337
|
+
const executionErrorHandler = typeof window !== "undefined" ? (evt) => {
|
|
338
|
+
if (evt.filename && isStaticResourcesEqual(evt.filename, info.url)) {
|
|
339
|
+
const err = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);
|
|
340
|
+
err.name = "ScriptExecutionError";
|
|
341
|
+
executionError = err;
|
|
342
|
+
}
|
|
343
|
+
} : null;
|
|
344
|
+
if (executionErrorHandler) window.addEventListener("error", executionErrorHandler);
|
|
345
|
+
const onScriptComplete = async (prev, event) => {
|
|
346
|
+
clearTimeout(timeoutId);
|
|
347
|
+
if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);
|
|
348
|
+
const onScriptCompleteCallback = () => {
|
|
349
|
+
if (event?.type === "error") {
|
|
350
|
+
const networkError = /* @__PURE__ */ new Error(event?.isTimeout ? `ScriptNetworkError: Script "${info.url}" timed out.` : `ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
|
|
351
|
+
networkError.name = "ScriptNetworkError";
|
|
352
|
+
info?.onErrorCallback && info?.onErrorCallback(networkError);
|
|
353
|
+
} else if (executionError) info?.onErrorCallback && info?.onErrorCallback(executionError);
|
|
354
|
+
else info?.cb && info?.cb();
|
|
355
|
+
};
|
|
356
|
+
if (script) {
|
|
357
|
+
script.onerror = null;
|
|
358
|
+
script.onload = null;
|
|
359
|
+
safeWrapper(() => {
|
|
360
|
+
const { needDeleteScript = true } = info;
|
|
361
|
+
if (needDeleteScript) script?.parentNode && script.parentNode.removeChild(script);
|
|
362
|
+
});
|
|
363
|
+
if (prev && typeof prev === "function") {
|
|
364
|
+
const result = prev(event);
|
|
365
|
+
if (result instanceof Promise) {
|
|
366
|
+
const res = await result;
|
|
367
|
+
onScriptCompleteCallback();
|
|
368
|
+
return res;
|
|
369
|
+
}
|
|
370
|
+
onScriptCompleteCallback();
|
|
371
|
+
return result;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
onScriptCompleteCallback();
|
|
375
|
+
};
|
|
376
|
+
script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
377
|
+
script.onload = onScriptComplete.bind(null, script.onload);
|
|
378
|
+
timeoutId = setTimeout(() => {
|
|
379
|
+
onScriptComplete(null, {
|
|
380
|
+
type: "error",
|
|
381
|
+
isTimeout: true
|
|
382
|
+
});
|
|
383
|
+
}, timeout);
|
|
384
|
+
return {
|
|
385
|
+
script,
|
|
386
|
+
needAttach
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function createLink(info) {
|
|
390
|
+
let link = null;
|
|
391
|
+
let needAttach = true;
|
|
392
|
+
const links = document.getElementsByTagName("link");
|
|
393
|
+
for (let i = 0; i < links.length; i++) {
|
|
394
|
+
const l = links[i];
|
|
395
|
+
const linkHref = l.getAttribute("href");
|
|
396
|
+
const linkRel = l.getAttribute("rel");
|
|
397
|
+
if (linkHref && isStaticResourcesEqual(linkHref, info.url) && linkRel === info.attrs["rel"]) {
|
|
398
|
+
link = l;
|
|
399
|
+
needAttach = false;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
if (!link) {
|
|
404
|
+
link = document.createElement("link");
|
|
405
|
+
link.setAttribute("href", info.url);
|
|
406
|
+
let createLinkRes = void 0;
|
|
407
|
+
const attrs = info.attrs;
|
|
408
|
+
if (info.createLinkHook) {
|
|
409
|
+
createLinkRes = info.createLinkHook(info.url, attrs);
|
|
410
|
+
if (createLinkRes instanceof HTMLLinkElement) link = createLinkRes;
|
|
411
|
+
}
|
|
412
|
+
if (attrs && !createLinkRes) Object.keys(attrs).forEach((name) => {
|
|
413
|
+
if (link && !link.getAttribute(name)) link.setAttribute(name, attrs[name]);
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
const onLinkComplete = (prev, event) => {
|
|
417
|
+
const onLinkCompleteCallback = () => {
|
|
418
|
+
if (event?.type === "error") info?.onErrorCallback && info?.onErrorCallback(event);
|
|
419
|
+
else info?.cb && info?.cb();
|
|
420
|
+
};
|
|
421
|
+
if (link) {
|
|
422
|
+
link.onerror = null;
|
|
423
|
+
link.onload = null;
|
|
424
|
+
safeWrapper(() => {
|
|
425
|
+
const { needDeleteLink = true } = info;
|
|
426
|
+
if (needDeleteLink) link?.parentNode && link.parentNode.removeChild(link);
|
|
427
|
+
});
|
|
428
|
+
if (prev) {
|
|
429
|
+
const res = prev(event);
|
|
430
|
+
onLinkCompleteCallback();
|
|
431
|
+
return res;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
onLinkCompleteCallback();
|
|
435
|
+
};
|
|
436
|
+
link.onerror = onLinkComplete.bind(null, link.onerror);
|
|
437
|
+
link.onload = onLinkComplete.bind(null, link.onload);
|
|
438
|
+
return {
|
|
439
|
+
link,
|
|
440
|
+
needAttach
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
function loadScript(url, info) {
|
|
444
|
+
const { attrs = {}, createScriptHook } = info;
|
|
445
|
+
return new Promise((resolve, reject) => {
|
|
446
|
+
const { script, needAttach } = createScript({
|
|
447
|
+
url,
|
|
448
|
+
cb: resolve,
|
|
449
|
+
onErrorCallback: reject,
|
|
450
|
+
attrs: {
|
|
451
|
+
fetchpriority: "high",
|
|
452
|
+
...attrs
|
|
453
|
+
},
|
|
454
|
+
createScriptHook,
|
|
455
|
+
needDeleteScript: true
|
|
456
|
+
});
|
|
457
|
+
needAttach && document.head.appendChild(script);
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.4.0/node_modules/@module-federation/error-codes/dist/getShortErrorMsg.mjs
|
|
462
|
+
var getDocsUrl = (errorCode) => {
|
|
463
|
+
return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
|
|
464
|
+
};
|
|
465
|
+
var getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
|
|
466
|
+
const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
|
|
467
|
+
args && msg.push(`args: ${JSON.stringify(args)}`);
|
|
468
|
+
msg.push(getDocsUrl(errorCode));
|
|
469
|
+
originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
|
|
470
|
+
return msg.join("\n");
|
|
471
|
+
};
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.4.0/node_modules/@module-federation/error-codes/dist/browser.mjs
|
|
474
|
+
function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
|
|
475
|
+
return logger(getShortErrorMsg(code, descMap, args, originalErrorMsg));
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/logger.js
|
|
479
|
+
var LOG_CATEGORY = "[ Federation Runtime ]";
|
|
480
|
+
var logger = createLogger(LOG_CATEGORY);
|
|
481
|
+
function assert(condition, msgOrCode, descMap, args, context) {
|
|
482
|
+
if (!condition) if (descMap !== void 0) error(msgOrCode, descMap, args, void 0, context);
|
|
483
|
+
else error(msgOrCode);
|
|
484
|
+
}
|
|
485
|
+
function error(msgOrCode, descMap, args, originalErrorMsg, context) {
|
|
486
|
+
if (descMap !== void 0) return logAndReport(msgOrCode, descMap, args ?? {}, (msg) => {
|
|
487
|
+
throw new Error(`${LOG_CATEGORY}: ${msg}`);
|
|
488
|
+
}, originalErrorMsg, context);
|
|
489
|
+
const msg = msgOrCode;
|
|
490
|
+
if (msg instanceof Error) {
|
|
491
|
+
if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;
|
|
492
|
+
throw msg;
|
|
493
|
+
}
|
|
494
|
+
throw new Error(`${LOG_CATEGORY}: ${msg}`);
|
|
495
|
+
}
|
|
496
|
+
function warn$1(msg) {
|
|
497
|
+
if (msg instanceof Error) {
|
|
498
|
+
if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;
|
|
499
|
+
logger.warn(msg);
|
|
500
|
+
} else logger.warn(msg);
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/tool.js
|
|
504
|
+
function addUniqueItem(arr, item) {
|
|
505
|
+
if (arr.findIndex((name) => name === item) === -1) arr.push(item);
|
|
506
|
+
return arr;
|
|
507
|
+
}
|
|
508
|
+
function getFMId(remoteInfo) {
|
|
509
|
+
if ("version" in remoteInfo && remoteInfo.version) return `${remoteInfo.name}:${remoteInfo.version}`;
|
|
510
|
+
else if ("entry" in remoteInfo && remoteInfo.entry) return `${remoteInfo.name}:${remoteInfo.entry}`;
|
|
511
|
+
else return `${remoteInfo.name}`;
|
|
512
|
+
}
|
|
513
|
+
function isRemoteInfoWithEntry(remote) {
|
|
514
|
+
return typeof remote.entry !== "undefined";
|
|
515
|
+
}
|
|
516
|
+
function isPureRemoteEntry(remote) {
|
|
517
|
+
return !remote.entry.includes(".json");
|
|
518
|
+
}
|
|
519
|
+
function isObject(val) {
|
|
520
|
+
return val && typeof val === "object";
|
|
521
|
+
}
|
|
522
|
+
var objectToString = Object.prototype.toString;
|
|
523
|
+
function isPlainObject(val) {
|
|
524
|
+
return objectToString.call(val) === "[object Object]";
|
|
525
|
+
}
|
|
526
|
+
function arrayOptions(options) {
|
|
527
|
+
return Array.isArray(options) ? options : [options];
|
|
528
|
+
}
|
|
529
|
+
function getRemoteEntryInfoFromSnapshot(snapshot) {
|
|
530
|
+
return "remoteEntry" in snapshot ? {
|
|
531
|
+
url: snapshot.remoteEntry,
|
|
532
|
+
type: snapshot.remoteEntryType,
|
|
533
|
+
globalName: snapshot.globalName
|
|
534
|
+
} : {
|
|
535
|
+
url: "",
|
|
536
|
+
type: "global",
|
|
537
|
+
globalName: ""
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
var processModuleAlias = (name, subPath) => {
|
|
541
|
+
let moduleName;
|
|
542
|
+
if (name.endsWith("/")) moduleName = name.slice(0, -1);
|
|
543
|
+
else moduleName = name;
|
|
544
|
+
if (subPath.startsWith(".")) subPath = subPath.slice(1);
|
|
545
|
+
moduleName = moduleName + subPath;
|
|
546
|
+
return moduleName;
|
|
547
|
+
};
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/global.js
|
|
550
|
+
var CurrentGlobal = typeof globalThis === "object" ? globalThis : window;
|
|
551
|
+
var nativeGlobal = (() => {
|
|
552
|
+
try {
|
|
553
|
+
return document.defaultView;
|
|
554
|
+
} catch {
|
|
555
|
+
return CurrentGlobal;
|
|
556
|
+
}
|
|
557
|
+
})();
|
|
558
|
+
var Global = nativeGlobal;
|
|
559
|
+
function definePropertyGlobalVal(target, key, val) {
|
|
560
|
+
Object.defineProperty(target, key, {
|
|
561
|
+
value: val,
|
|
562
|
+
configurable: false,
|
|
563
|
+
writable: true
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function includeOwnProperty(target, key) {
|
|
567
|
+
return Object.hasOwnProperty.call(target, key);
|
|
568
|
+
}
|
|
569
|
+
if (!includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__")) definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
570
|
+
var globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
571
|
+
function setGlobalDefaultVal(target) {
|
|
572
|
+
if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);
|
|
573
|
+
if (!includeOwnProperty(target, "__FEDERATION__")) {
|
|
574
|
+
definePropertyGlobalVal(target, "__FEDERATION__", {
|
|
575
|
+
__GLOBAL_PLUGIN__: [],
|
|
576
|
+
__INSTANCES__: [],
|
|
577
|
+
moduleInfo: {},
|
|
578
|
+
__SHARE__: {},
|
|
579
|
+
__MANIFEST_LOADING__: {},
|
|
580
|
+
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
581
|
+
});
|
|
582
|
+
definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);
|
|
583
|
+
}
|
|
584
|
+
target.__FEDERATION__.__GLOBAL_PLUGIN__ ??= [];
|
|
585
|
+
target.__FEDERATION__.__INSTANCES__ ??= [];
|
|
586
|
+
target.__FEDERATION__.moduleInfo ??= {};
|
|
587
|
+
target.__FEDERATION__.__SHARE__ ??= {};
|
|
588
|
+
target.__FEDERATION__.__MANIFEST_LOADING__ ??= {};
|
|
589
|
+
target.__FEDERATION__.__PRELOADED_MAP__ ??= /* @__PURE__ */ new Map();
|
|
590
|
+
}
|
|
591
|
+
setGlobalDefaultVal(CurrentGlobal);
|
|
592
|
+
setGlobalDefaultVal(nativeGlobal);
|
|
593
|
+
function setGlobalFederationInstance(FederationInstance) {
|
|
594
|
+
CurrentGlobal.__FEDERATION__.__INSTANCES__.push(FederationInstance);
|
|
595
|
+
}
|
|
596
|
+
function getGlobalFederationConstructor() {
|
|
597
|
+
return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
|
|
598
|
+
}
|
|
599
|
+
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
600
|
+
if (isDebug) {
|
|
601
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
602
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.4.0";
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function getInfoWithoutType(target, key) {
|
|
606
|
+
if (typeof key === "string") if (target[key]) return {
|
|
607
|
+
value: target[key],
|
|
608
|
+
key
|
|
609
|
+
};
|
|
610
|
+
else {
|
|
611
|
+
const targetKeys = Object.keys(target);
|
|
612
|
+
for (const targetKey of targetKeys) {
|
|
613
|
+
const [targetTypeOrName, _] = targetKey.split(":");
|
|
614
|
+
const nKey = `${targetTypeOrName}:${key}`;
|
|
615
|
+
const typeWithKeyRes = target[nKey];
|
|
616
|
+
if (typeWithKeyRes) return {
|
|
617
|
+
value: typeWithKeyRes,
|
|
618
|
+
key: nKey
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return {
|
|
622
|
+
value: void 0,
|
|
623
|
+
key
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
else error(`getInfoWithoutType: "key" must be a string, got ${typeof key} (${JSON.stringify(key)}).`);
|
|
627
|
+
}
|
|
628
|
+
var getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo;
|
|
629
|
+
var getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot) => {
|
|
630
|
+
const getModuleInfo = getInfoWithoutType(snapshot, getFMId(moduleInfo)).value;
|
|
631
|
+
if (getModuleInfo && !getModuleInfo.version && "version" in moduleInfo && moduleInfo["version"]) getModuleInfo.version = moduleInfo["version"];
|
|
632
|
+
if (getModuleInfo) return getModuleInfo;
|
|
633
|
+
if ("version" in moduleInfo && moduleInfo["version"]) {
|
|
634
|
+
const { version, ...resModuleInfo } = moduleInfo;
|
|
635
|
+
const moduleKeyWithoutVersion = getFMId(resModuleInfo);
|
|
636
|
+
const getModuleInfoWithoutVersion = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion).value;
|
|
637
|
+
if (getModuleInfoWithoutVersion?.version === version) return getModuleInfoWithoutVersion;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
var getGlobalSnapshotInfoByModuleInfo = (moduleInfo) => getTargetSnapshotInfoByModuleInfo(moduleInfo, nativeGlobal.__FEDERATION__.moduleInfo);
|
|
641
|
+
var setGlobalSnapshotInfoByModuleInfo = (remoteInfo, moduleDetailInfo) => {
|
|
642
|
+
const moduleKey = getFMId(remoteInfo);
|
|
643
|
+
nativeGlobal.__FEDERATION__.moduleInfo[moduleKey] = moduleDetailInfo;
|
|
644
|
+
return nativeGlobal.__FEDERATION__.moduleInfo;
|
|
645
|
+
};
|
|
646
|
+
var addGlobalSnapshot = (moduleInfos) => {
|
|
647
|
+
nativeGlobal.__FEDERATION__.moduleInfo = {
|
|
648
|
+
...nativeGlobal.__FEDERATION__.moduleInfo,
|
|
649
|
+
...moduleInfos
|
|
650
|
+
};
|
|
651
|
+
return () => {
|
|
652
|
+
const keys = Object.keys(moduleInfos);
|
|
653
|
+
for (const key of keys) delete nativeGlobal.__FEDERATION__.moduleInfo[key];
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
var getRemoteEntryExports = (name, globalName) => {
|
|
657
|
+
const remoteEntryKey = globalName || `__FEDERATION_${name}:custom__`;
|
|
658
|
+
return {
|
|
659
|
+
remoteEntryKey,
|
|
660
|
+
entryExports: CurrentGlobal[remoteEntryKey]
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
var getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__;
|
|
664
|
+
var getPreloaded = (id) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(id);
|
|
665
|
+
var setPreloaded = (id) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(id, true);
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/constants.js
|
|
668
|
+
var buildIdentifier = "[0-9A-Za-z-]+";
|
|
669
|
+
var build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`;
|
|
670
|
+
var numericIdentifier = "0|[1-9]\\d*";
|
|
671
|
+
var numericIdentifierLoose = "[0-9]+";
|
|
672
|
+
var nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
|
|
673
|
+
var preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;
|
|
674
|
+
var preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`;
|
|
675
|
+
var preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`;
|
|
676
|
+
var preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`;
|
|
677
|
+
var xRangeIdentifier = `${numericIdentifier}|x|X|\\*`;
|
|
678
|
+
var xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;
|
|
679
|
+
var hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`;
|
|
680
|
+
var loosePlain = `[v=\\s]*${`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`}${preReleaseLoose}?${build}?`;
|
|
681
|
+
var gtlt = "((?:<|>)?=?)";
|
|
682
|
+
var comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`;
|
|
683
|
+
var loneTilde = "(?:~>?)";
|
|
684
|
+
var tildeTrim = `(\\s*)${loneTilde}\\s+`;
|
|
685
|
+
var loneCaret = "(?:\\^)";
|
|
686
|
+
var caretTrim = `(\\s*)${loneCaret}\\s+`;
|
|
687
|
+
var star = "(<|>)?=?\\s*\\*";
|
|
688
|
+
var caret = `^${loneCaret}${xRangePlain}$`;
|
|
689
|
+
var fullPlain = `v?${`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`}${preRelease}?${build}?`;
|
|
690
|
+
var tilde = `^${loneTilde}${xRangePlain}$`;
|
|
691
|
+
var xRange = `^${gtlt}\\s*${xRangePlain}$`;
|
|
692
|
+
var comparator = `^${gtlt}\\s*(${fullPlain})$|^$`;
|
|
693
|
+
var gte0 = "^\\s*>=\\s*0.0.0\\s*$";
|
|
694
|
+
//#endregion
|
|
695
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/utils.js
|
|
696
|
+
function parseRegex(source) {
|
|
697
|
+
return new RegExp(source);
|
|
698
|
+
}
|
|
699
|
+
function isXVersion(version) {
|
|
700
|
+
return !version || version.toLowerCase() === "x" || version === "*";
|
|
701
|
+
}
|
|
702
|
+
function pipe(...fns) {
|
|
703
|
+
return (x) => fns.reduce((v, f) => f(v), x);
|
|
704
|
+
}
|
|
705
|
+
function extractComparator(comparatorString) {
|
|
706
|
+
return comparatorString.match(parseRegex(comparator));
|
|
707
|
+
}
|
|
708
|
+
function combineVersion(major, minor, patch, preRelease) {
|
|
709
|
+
const mainVersion = `${major}.${minor}.${patch}`;
|
|
710
|
+
if (preRelease) return `${mainVersion}-${preRelease}`;
|
|
711
|
+
return mainVersion;
|
|
712
|
+
}
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/parser.js
|
|
715
|
+
function parseHyphen(range) {
|
|
716
|
+
return range.replace(parseRegex(hyphenRange), (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease) => {
|
|
717
|
+
if (isXVersion(fromMajor)) from = "";
|
|
718
|
+
else if (isXVersion(fromMinor)) from = `>=${fromMajor}.0.0`;
|
|
719
|
+
else if (isXVersion(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0`;
|
|
720
|
+
else from = `>=${from}`;
|
|
721
|
+
if (isXVersion(toMajor)) to = "";
|
|
722
|
+
else if (isXVersion(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
723
|
+
else if (isXVersion(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
724
|
+
else if (toPreRelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`;
|
|
725
|
+
else to = `<=${to}`;
|
|
726
|
+
return `${from} ${to}`.trim();
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
function parseComparatorTrim(range) {
|
|
730
|
+
return range.replace(parseRegex(comparatorTrim), "$1$2$3");
|
|
731
|
+
}
|
|
732
|
+
function parseTildeTrim(range) {
|
|
733
|
+
return range.replace(parseRegex(tildeTrim), "$1~");
|
|
734
|
+
}
|
|
735
|
+
function parseCaretTrim(range) {
|
|
736
|
+
return range.replace(parseRegex(caretTrim), "$1^");
|
|
737
|
+
}
|
|
738
|
+
function parseCarets(range) {
|
|
739
|
+
return range.trim().split(/\s+/).map((rangeVersion) => rangeVersion.replace(parseRegex(caret), (_, major, minor, patch, preRelease) => {
|
|
740
|
+
if (isXVersion(major)) return "";
|
|
741
|
+
else if (isXVersion(minor)) return `>=${major}.0.0 <${Number(major) + 1}.0.0-0`;
|
|
742
|
+
else if (isXVersion(patch)) if (major === "0") return `>=${major}.${minor}.0 <${major}.${Number(minor) + 1}.0-0`;
|
|
743
|
+
else return `>=${major}.${minor}.0 <${Number(major) + 1}.0.0-0`;
|
|
744
|
+
else if (preRelease) if (major === "0") if (minor === "0") return `>=${major}.${minor}.${patch}-${preRelease} <${major}.${minor}.${Number(patch) + 1}-0`;
|
|
745
|
+
else return `>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
746
|
+
else return `>=${major}.${minor}.${patch}-${preRelease} <${Number(major) + 1}.0.0-0`;
|
|
747
|
+
else {
|
|
748
|
+
if (major === "0") if (minor === "0") return `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0`;
|
|
749
|
+
else return `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
750
|
+
return `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
751
|
+
}
|
|
752
|
+
})).join(" ");
|
|
753
|
+
}
|
|
754
|
+
function parseTildes(range) {
|
|
755
|
+
return range.trim().split(/\s+/).map((rangeVersion) => rangeVersion.replace(parseRegex(tilde), (_, major, minor, patch, preRelease) => {
|
|
756
|
+
if (isXVersion(major)) return "";
|
|
757
|
+
else if (isXVersion(minor)) return `>=${major}.0.0 <${Number(major) + 1}.0.0-0`;
|
|
758
|
+
else if (isXVersion(patch)) return `>=${major}.${minor}.0 <${major}.${Number(minor) + 1}.0-0`;
|
|
759
|
+
else if (preRelease) return `>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
760
|
+
return `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
761
|
+
})).join(" ");
|
|
762
|
+
}
|
|
763
|
+
function parseXRanges(range) {
|
|
764
|
+
return range.split(/\s+/).map((rangeVersion) => rangeVersion.trim().replace(parseRegex(xRange), (ret, gtlt, major, minor, patch, preRelease) => {
|
|
765
|
+
const isXMajor = isXVersion(major);
|
|
766
|
+
const isXMinor = isXMajor || isXVersion(minor);
|
|
767
|
+
const isXPatch = isXMinor || isXVersion(patch);
|
|
768
|
+
if (gtlt === "=" && isXPatch) gtlt = "";
|
|
769
|
+
preRelease = "";
|
|
770
|
+
if (isXMajor) if (gtlt === ">" || gtlt === "<") return "<0.0.0-0";
|
|
771
|
+
else return "*";
|
|
772
|
+
else if (gtlt && isXPatch) {
|
|
773
|
+
if (isXMinor) minor = 0;
|
|
774
|
+
patch = 0;
|
|
775
|
+
if (gtlt === ">") {
|
|
776
|
+
gtlt = ">=";
|
|
777
|
+
if (isXMinor) {
|
|
778
|
+
major = Number(major) + 1;
|
|
779
|
+
minor = 0;
|
|
780
|
+
patch = 0;
|
|
781
|
+
} else {
|
|
782
|
+
minor = Number(minor) + 1;
|
|
783
|
+
patch = 0;
|
|
784
|
+
}
|
|
785
|
+
} else if (gtlt === "<=") {
|
|
786
|
+
gtlt = "<";
|
|
787
|
+
if (isXMinor) major = Number(major) + 1;
|
|
788
|
+
else minor = Number(minor) + 1;
|
|
789
|
+
}
|
|
790
|
+
if (gtlt === "<") preRelease = "-0";
|
|
791
|
+
return `${gtlt + major}.${minor}.${patch}${preRelease}`;
|
|
792
|
+
} else if (isXMinor) return `>=${major}.0.0${preRelease} <${Number(major) + 1}.0.0-0`;
|
|
793
|
+
else if (isXPatch) return `>=${major}.${minor}.0${preRelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
794
|
+
return ret;
|
|
795
|
+
})).join(" ");
|
|
796
|
+
}
|
|
797
|
+
function parseStar(range) {
|
|
798
|
+
return range.trim().replace(parseRegex(star), "");
|
|
799
|
+
}
|
|
800
|
+
function parseGTE0(comparatorString) {
|
|
801
|
+
return comparatorString.trim().replace(parseRegex(gte0), "");
|
|
802
|
+
}
|
|
803
|
+
//#endregion
|
|
804
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/compare.js
|
|
805
|
+
function compareAtom(rangeAtom, versionAtom) {
|
|
806
|
+
rangeAtom = Number(rangeAtom) || rangeAtom;
|
|
807
|
+
versionAtom = Number(versionAtom) || versionAtom;
|
|
808
|
+
if (rangeAtom > versionAtom) return 1;
|
|
809
|
+
if (rangeAtom === versionAtom) return 0;
|
|
810
|
+
return -1;
|
|
811
|
+
}
|
|
812
|
+
function comparePreRelease(rangeAtom, versionAtom) {
|
|
813
|
+
const { preRelease: rangePreRelease } = rangeAtom;
|
|
814
|
+
const { preRelease: versionPreRelease } = versionAtom;
|
|
815
|
+
if (rangePreRelease === void 0 && Boolean(versionPreRelease)) return 1;
|
|
816
|
+
if (Boolean(rangePreRelease) && versionPreRelease === void 0) return -1;
|
|
817
|
+
if (rangePreRelease === void 0 && versionPreRelease === void 0) return 0;
|
|
818
|
+
for (let i = 0, n = rangePreRelease.length; i <= n; i++) {
|
|
819
|
+
const rangeElement = rangePreRelease[i];
|
|
820
|
+
const versionElement = versionPreRelease[i];
|
|
821
|
+
if (rangeElement === versionElement) continue;
|
|
822
|
+
if (rangeElement === void 0 && versionElement === void 0) return 0;
|
|
823
|
+
if (!rangeElement) return 1;
|
|
824
|
+
if (!versionElement) return -1;
|
|
825
|
+
return compareAtom(rangeElement, versionElement);
|
|
826
|
+
}
|
|
827
|
+
return 0;
|
|
828
|
+
}
|
|
829
|
+
function compareVersion(rangeAtom, versionAtom) {
|
|
830
|
+
return compareAtom(rangeAtom.major, versionAtom.major) || compareAtom(rangeAtom.minor, versionAtom.minor) || compareAtom(rangeAtom.patch, versionAtom.patch) || comparePreRelease(rangeAtom, versionAtom);
|
|
831
|
+
}
|
|
832
|
+
function eq(rangeAtom, versionAtom) {
|
|
833
|
+
return rangeAtom.version === versionAtom.version;
|
|
834
|
+
}
|
|
835
|
+
function compare(rangeAtom, versionAtom) {
|
|
836
|
+
switch (rangeAtom.operator) {
|
|
837
|
+
case "":
|
|
838
|
+
case "=": return eq(rangeAtom, versionAtom);
|
|
839
|
+
case ">": return compareVersion(rangeAtom, versionAtom) < 0;
|
|
840
|
+
case ">=": return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) < 0;
|
|
841
|
+
case "<": return compareVersion(rangeAtom, versionAtom) > 0;
|
|
842
|
+
case "<=": return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) > 0;
|
|
843
|
+
case void 0: return true;
|
|
844
|
+
default: return false;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
//#endregion
|
|
848
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/index.js
|
|
849
|
+
function parseComparatorString(range) {
|
|
850
|
+
return pipe(parseCarets, parseTildes, parseXRanges, parseStar)(range);
|
|
851
|
+
}
|
|
852
|
+
function parseRange(range) {
|
|
853
|
+
return pipe(parseHyphen, parseComparatorTrim, parseTildeTrim, parseCaretTrim)(range.trim()).split(/\s+/).join(" ");
|
|
854
|
+
}
|
|
855
|
+
function satisfy(version, range) {
|
|
856
|
+
if (!version) return false;
|
|
857
|
+
const extractedVersion = extractComparator(version);
|
|
858
|
+
if (!extractedVersion) return false;
|
|
859
|
+
const [, versionOperator, , versionMajor, versionMinor, versionPatch, versionPreRelease] = extractedVersion;
|
|
860
|
+
const versionAtom = {
|
|
861
|
+
operator: versionOperator,
|
|
862
|
+
version: combineVersion(versionMajor, versionMinor, versionPatch, versionPreRelease),
|
|
863
|
+
major: versionMajor,
|
|
864
|
+
minor: versionMinor,
|
|
865
|
+
patch: versionPatch,
|
|
866
|
+
preRelease: versionPreRelease?.split(".")
|
|
867
|
+
};
|
|
868
|
+
const orRanges = range.split("||");
|
|
869
|
+
for (const orRange of orRanges) {
|
|
870
|
+
const trimmedOrRange = orRange.trim();
|
|
871
|
+
if (!trimmedOrRange) return true;
|
|
872
|
+
if (trimmedOrRange === "*" || trimmedOrRange === "x") return true;
|
|
873
|
+
try {
|
|
874
|
+
const parsedSubRange = parseRange(trimmedOrRange);
|
|
875
|
+
if (!parsedSubRange.trim()) return true;
|
|
876
|
+
const parsedComparatorString = parsedSubRange.split(" ").map((rangeVersion) => parseComparatorString(rangeVersion)).join(" ");
|
|
877
|
+
if (!parsedComparatorString.trim()) return true;
|
|
878
|
+
const comparators = parsedComparatorString.split(/\s+/).map((comparator) => parseGTE0(comparator)).filter(Boolean);
|
|
879
|
+
if (comparators.length === 0) continue;
|
|
880
|
+
let subRangeSatisfied = true;
|
|
881
|
+
for (const comparator of comparators) {
|
|
882
|
+
const extractedComparator = extractComparator(comparator);
|
|
883
|
+
if (!extractedComparator) {
|
|
884
|
+
subRangeSatisfied = false;
|
|
885
|
+
break;
|
|
886
|
+
}
|
|
887
|
+
const [, rangeOperator, , rangeMajor, rangeMinor, rangePatch, rangePreRelease] = extractedComparator;
|
|
888
|
+
if (!compare({
|
|
889
|
+
operator: rangeOperator,
|
|
890
|
+
version: combineVersion(rangeMajor, rangeMinor, rangePatch, rangePreRelease),
|
|
891
|
+
major: rangeMajor,
|
|
892
|
+
minor: rangeMinor,
|
|
893
|
+
patch: rangePatch,
|
|
894
|
+
preRelease: rangePreRelease?.split(".")
|
|
895
|
+
}, versionAtom)) {
|
|
896
|
+
subRangeSatisfied = false;
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
if (subRangeSatisfied) return true;
|
|
901
|
+
} catch (e) {
|
|
902
|
+
console.error(`[semver] Error processing range part "${trimmedOrRange}":`, e);
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/constant.js
|
|
910
|
+
var DEFAULT_SCOPE = "default";
|
|
911
|
+
var DEFAULT_REMOTE_TYPE = "global";
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/share.js
|
|
914
|
+
function formatShare(shareArgs, from, name, shareStrategy) {
|
|
915
|
+
let get;
|
|
916
|
+
if ("get" in shareArgs) get = shareArgs.get;
|
|
917
|
+
else if ("lib" in shareArgs) get = () => Promise.resolve(shareArgs.lib);
|
|
918
|
+
else get = () => Promise.resolve(() => {
|
|
919
|
+
error(`Cannot get shared "${name}" from "${from}": neither "get" nor "lib" is provided in the share config.`);
|
|
920
|
+
});
|
|
921
|
+
if (shareArgs.shareConfig?.eager && shareArgs.treeShaking?.mode) error(`Invalid shared config for "${name}" from "${from}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`);
|
|
922
|
+
return {
|
|
923
|
+
deps: [],
|
|
924
|
+
useIn: [],
|
|
925
|
+
from,
|
|
926
|
+
loading: null,
|
|
927
|
+
...shareArgs,
|
|
928
|
+
shareConfig: {
|
|
929
|
+
requiredVersion: `^${shareArgs.version}`,
|
|
930
|
+
singleton: false,
|
|
931
|
+
eager: false,
|
|
932
|
+
strictVersion: false,
|
|
933
|
+
...shareArgs.shareConfig
|
|
934
|
+
},
|
|
935
|
+
get,
|
|
936
|
+
loaded: shareArgs?.loaded || "lib" in shareArgs ? true : void 0,
|
|
937
|
+
version: shareArgs.version ?? "0",
|
|
938
|
+
scope: Array.isArray(shareArgs.scope) ? shareArgs.scope : [shareArgs.scope ?? "default"],
|
|
939
|
+
strategy: (shareArgs.strategy ?? shareStrategy) || "version-first",
|
|
940
|
+
treeShaking: shareArgs.treeShaking ? {
|
|
941
|
+
...shareArgs.treeShaking,
|
|
942
|
+
mode: shareArgs.treeShaking.mode ?? "server-calc",
|
|
943
|
+
status: shareArgs.treeShaking.status ?? TreeShakingStatus.UNKNOWN,
|
|
944
|
+
useIn: []
|
|
945
|
+
} : void 0
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
function formatShareConfigs(prevOptions, newOptions) {
|
|
949
|
+
const shareArgs = newOptions.shared || {};
|
|
950
|
+
const from = newOptions.name;
|
|
951
|
+
const newShareInfos = Object.keys(shareArgs).reduce((res, pkgName) => {
|
|
952
|
+
const arrayShareArgs = arrayOptions(shareArgs[pkgName]);
|
|
953
|
+
res[pkgName] = res[pkgName] || [];
|
|
954
|
+
arrayShareArgs.forEach((shareConfig) => {
|
|
955
|
+
res[pkgName].push(formatShare(shareConfig, from, pkgName, newOptions.shareStrategy));
|
|
956
|
+
});
|
|
957
|
+
return res;
|
|
958
|
+
}, {});
|
|
959
|
+
const allShareInfos = { ...prevOptions.shared };
|
|
960
|
+
Object.keys(newShareInfos).forEach((shareKey) => {
|
|
961
|
+
if (!allShareInfos[shareKey]) allShareInfos[shareKey] = newShareInfos[shareKey];
|
|
962
|
+
else newShareInfos[shareKey].forEach((newUserSharedOptions) => {
|
|
963
|
+
if (!allShareInfos[shareKey].find((sharedVal) => sharedVal.version === newUserSharedOptions.version)) allShareInfos[shareKey].push(newUserSharedOptions);
|
|
964
|
+
});
|
|
965
|
+
});
|
|
966
|
+
return {
|
|
967
|
+
allShareInfos,
|
|
968
|
+
newShareInfos
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
function shouldUseTreeShaking(treeShaking, usedExports) {
|
|
972
|
+
if (!treeShaking) return false;
|
|
973
|
+
const { status, mode } = treeShaking;
|
|
974
|
+
if (status === TreeShakingStatus.NO_USE) return false;
|
|
975
|
+
if (status === TreeShakingStatus.CALCULATED) return true;
|
|
976
|
+
if (mode === "runtime-infer") {
|
|
977
|
+
if (!usedExports) return true;
|
|
978
|
+
return isMatchUsedExports(treeShaking, usedExports);
|
|
979
|
+
}
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* compare version a and b, return true if a is less than b
|
|
984
|
+
*/
|
|
985
|
+
function versionLt(a, b) {
|
|
986
|
+
const transformInvalidVersion = (version) => {
|
|
987
|
+
if (!Number.isNaN(Number(version))) {
|
|
988
|
+
const splitArr = version.split(".");
|
|
989
|
+
let validVersion = version;
|
|
990
|
+
for (let i = 0; i < 3 - splitArr.length; i++) validVersion += ".0";
|
|
991
|
+
return validVersion;
|
|
992
|
+
}
|
|
993
|
+
return version;
|
|
994
|
+
};
|
|
995
|
+
if (satisfy(transformInvalidVersion(a), `<=${transformInvalidVersion(b)}`)) return true;
|
|
996
|
+
else return false;
|
|
997
|
+
}
|
|
998
|
+
var findVersion = (shareVersionMap, cb) => {
|
|
999
|
+
const callback = cb || function(prev, cur) {
|
|
1000
|
+
return versionLt(prev, cur);
|
|
1001
|
+
};
|
|
1002
|
+
return Object.keys(shareVersionMap).reduce((prev, cur) => {
|
|
1003
|
+
if (!prev) return cur;
|
|
1004
|
+
if (callback(prev, cur)) return cur;
|
|
1005
|
+
if (prev === "0") return cur;
|
|
1006
|
+
return prev;
|
|
1007
|
+
}, 0);
|
|
1008
|
+
};
|
|
1009
|
+
var isLoaded = (shared) => {
|
|
1010
|
+
return Boolean(shared.loaded) || typeof shared.lib === "function";
|
|
1011
|
+
};
|
|
1012
|
+
var isLoading = (shared) => {
|
|
1013
|
+
return Boolean(shared.loading);
|
|
1014
|
+
};
|
|
1015
|
+
var isMatchUsedExports = (treeShaking, usedExports) => {
|
|
1016
|
+
if (!treeShaking || !usedExports) return false;
|
|
1017
|
+
const { usedExports: treeShakingUsedExports } = treeShaking;
|
|
1018
|
+
if (!treeShakingUsedExports) return false;
|
|
1019
|
+
if (usedExports.every((e) => treeShakingUsedExports.includes(e))) return true;
|
|
1020
|
+
return false;
|
|
1021
|
+
};
|
|
1022
|
+
function findSingletonVersionOrderByVersion(shareScopeMap, scope, pkgName, treeShaking) {
|
|
1023
|
+
const versions = shareScopeMap[scope][pkgName];
|
|
1024
|
+
let version = "";
|
|
1025
|
+
let useTreesShaking = shouldUseTreeShaking(treeShaking);
|
|
1026
|
+
const callback = function(prev, cur) {
|
|
1027
|
+
if (useTreesShaking) {
|
|
1028
|
+
if (!versions[prev].treeShaking) return true;
|
|
1029
|
+
if (!versions[cur].treeShaking) return false;
|
|
1030
|
+
return !isLoaded(versions[prev].treeShaking) && versionLt(prev, cur);
|
|
1031
|
+
}
|
|
1032
|
+
return !isLoaded(versions[prev]) && versionLt(prev, cur);
|
|
1033
|
+
};
|
|
1034
|
+
if (useTreesShaking) {
|
|
1035
|
+
version = findVersion(shareScopeMap[scope][pkgName], callback);
|
|
1036
|
+
if (version) return {
|
|
1037
|
+
version,
|
|
1038
|
+
useTreesShaking
|
|
1039
|
+
};
|
|
1040
|
+
useTreesShaking = false;
|
|
1041
|
+
}
|
|
1042
|
+
return {
|
|
1043
|
+
version: findVersion(shareScopeMap[scope][pkgName], callback),
|
|
1044
|
+
useTreesShaking
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
var isLoadingOrLoaded = (shared) => {
|
|
1048
|
+
return isLoaded(shared) || isLoading(shared);
|
|
1049
|
+
};
|
|
1050
|
+
function findSingletonVersionOrderByLoaded(shareScopeMap, scope, pkgName, treeShaking) {
|
|
1051
|
+
const versions = shareScopeMap[scope][pkgName];
|
|
1052
|
+
let version = "";
|
|
1053
|
+
let useTreesShaking = shouldUseTreeShaking(treeShaking);
|
|
1054
|
+
const callback = function(prev, cur) {
|
|
1055
|
+
if (useTreesShaking) {
|
|
1056
|
+
if (!versions[prev].treeShaking) return true;
|
|
1057
|
+
if (!versions[cur].treeShaking) return false;
|
|
1058
|
+
if (isLoadingOrLoaded(versions[cur].treeShaking)) if (isLoadingOrLoaded(versions[prev].treeShaking)) return Boolean(versionLt(prev, cur));
|
|
1059
|
+
else return true;
|
|
1060
|
+
if (isLoadingOrLoaded(versions[prev].treeShaking)) return false;
|
|
1061
|
+
}
|
|
1062
|
+
if (isLoadingOrLoaded(versions[cur])) if (isLoadingOrLoaded(versions[prev])) return Boolean(versionLt(prev, cur));
|
|
1063
|
+
else return true;
|
|
1064
|
+
if (isLoadingOrLoaded(versions[prev])) return false;
|
|
1065
|
+
return versionLt(prev, cur);
|
|
1066
|
+
};
|
|
1067
|
+
if (useTreesShaking) {
|
|
1068
|
+
version = findVersion(shareScopeMap[scope][pkgName], callback);
|
|
1069
|
+
if (version) return {
|
|
1070
|
+
version,
|
|
1071
|
+
useTreesShaking
|
|
1072
|
+
};
|
|
1073
|
+
useTreesShaking = false;
|
|
1074
|
+
}
|
|
1075
|
+
return {
|
|
1076
|
+
version: findVersion(shareScopeMap[scope][pkgName], callback),
|
|
1077
|
+
useTreesShaking
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
function getFindShareFunction(strategy) {
|
|
1081
|
+
if (strategy === "loaded-first") return findSingletonVersionOrderByLoaded;
|
|
1082
|
+
return findSingletonVersionOrderByVersion;
|
|
1083
|
+
}
|
|
1084
|
+
function getRegisteredShare(localShareScopeMap, pkgName, shareInfo, resolveShare) {
|
|
1085
|
+
if (!localShareScopeMap) return;
|
|
1086
|
+
const { shareConfig, scope = DEFAULT_SCOPE, strategy, treeShaking } = shareInfo;
|
|
1087
|
+
const scopes = Array.isArray(scope) ? scope : [scope];
|
|
1088
|
+
for (const sc of scopes) if (shareConfig && localShareScopeMap[sc] && localShareScopeMap[sc][pkgName]) {
|
|
1089
|
+
const { requiredVersion } = shareConfig;
|
|
1090
|
+
const { version: maxOrSingletonVersion, useTreesShaking } = getFindShareFunction(strategy)(localShareScopeMap, sc, pkgName, treeShaking);
|
|
1091
|
+
const defaultResolver = () => {
|
|
1092
|
+
const shared = localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
|
|
1093
|
+
if (shareConfig.singleton) {
|
|
1094
|
+
if (typeof requiredVersion === "string" && !satisfy(maxOrSingletonVersion, requiredVersion)) {
|
|
1095
|
+
const msg = `Version ${maxOrSingletonVersion} from ${maxOrSingletonVersion && shared.from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`;
|
|
1096
|
+
if (shareConfig.strictVersion) error(msg);
|
|
1097
|
+
else warn$1(msg);
|
|
1098
|
+
}
|
|
1099
|
+
return {
|
|
1100
|
+
shared,
|
|
1101
|
+
useTreesShaking
|
|
1102
|
+
};
|
|
1103
|
+
} else {
|
|
1104
|
+
if (requiredVersion === false || requiredVersion === "*") return {
|
|
1105
|
+
shared,
|
|
1106
|
+
useTreesShaking
|
|
1107
|
+
};
|
|
1108
|
+
if (satisfy(maxOrSingletonVersion, requiredVersion)) return {
|
|
1109
|
+
shared,
|
|
1110
|
+
useTreesShaking
|
|
1111
|
+
};
|
|
1112
|
+
const _usedTreeShaking = shouldUseTreeShaking(treeShaking);
|
|
1113
|
+
if (_usedTreeShaking) for (const [versionKey, versionValue] of Object.entries(localShareScopeMap[sc][pkgName])) {
|
|
1114
|
+
if (!shouldUseTreeShaking(versionValue.treeShaking, treeShaking?.usedExports)) continue;
|
|
1115
|
+
if (satisfy(versionKey, requiredVersion)) return {
|
|
1116
|
+
shared: versionValue,
|
|
1117
|
+
useTreesShaking: _usedTreeShaking
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
for (const [versionKey, versionValue] of Object.entries(localShareScopeMap[sc][pkgName])) if (satisfy(versionKey, requiredVersion)) return {
|
|
1121
|
+
shared: versionValue,
|
|
1122
|
+
useTreesShaking: false
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
const params = {
|
|
1127
|
+
shareScopeMap: localShareScopeMap,
|
|
1128
|
+
scope: sc,
|
|
1129
|
+
pkgName,
|
|
1130
|
+
version: maxOrSingletonVersion,
|
|
1131
|
+
GlobalFederation: Global.__FEDERATION__,
|
|
1132
|
+
shareInfo,
|
|
1133
|
+
resolver: defaultResolver
|
|
1134
|
+
};
|
|
1135
|
+
return (resolveShare.emit(params) || params).resolver();
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function getGlobalShareScope() {
|
|
1139
|
+
return Global.__FEDERATION__.__SHARE__;
|
|
1140
|
+
}
|
|
1141
|
+
function getTargetSharedOptions(options) {
|
|
1142
|
+
const { pkgName, extraOptions, shareInfos } = options;
|
|
1143
|
+
const defaultResolver = (sharedOptions) => {
|
|
1144
|
+
if (!sharedOptions) return;
|
|
1145
|
+
const shareVersionMap = {};
|
|
1146
|
+
sharedOptions.forEach((shared) => {
|
|
1147
|
+
shareVersionMap[shared.version] = shared;
|
|
1148
|
+
});
|
|
1149
|
+
const callback = function(prev, cur) {
|
|
1150
|
+
return !isLoaded(shareVersionMap[prev]) && versionLt(prev, cur);
|
|
1151
|
+
};
|
|
1152
|
+
return shareVersionMap[findVersion(shareVersionMap, callback)];
|
|
1153
|
+
};
|
|
1154
|
+
const resolver = extraOptions?.resolver ?? defaultResolver;
|
|
1155
|
+
const isPlainObject = (val) => {
|
|
1156
|
+
return val !== null && typeof val === "object" && !Array.isArray(val);
|
|
1157
|
+
};
|
|
1158
|
+
const merge = (...sources) => {
|
|
1159
|
+
const out = {};
|
|
1160
|
+
for (const src of sources) {
|
|
1161
|
+
if (!src) continue;
|
|
1162
|
+
for (const [key, value] of Object.entries(src)) {
|
|
1163
|
+
const prev = out[key];
|
|
1164
|
+
if (isPlainObject(prev) && isPlainObject(value)) out[key] = merge(prev, value);
|
|
1165
|
+
else if (value !== void 0) out[key] = value;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
return out;
|
|
1169
|
+
};
|
|
1170
|
+
return merge(resolver(shareInfos[pkgName]), extraOptions?.customShareInfo);
|
|
1171
|
+
}
|
|
1172
|
+
var addUseIn = (shared, from) => {
|
|
1173
|
+
if (!shared.useIn) shared.useIn = [];
|
|
1174
|
+
addUniqueItem(shared.useIn, from);
|
|
1175
|
+
};
|
|
1176
|
+
function directShare(shared, useTreesShaking) {
|
|
1177
|
+
if (useTreesShaking && shared.treeShaking) return shared.treeShaking;
|
|
1178
|
+
return shared;
|
|
1179
|
+
}
|
|
1180
|
+
//#endregion
|
|
1181
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/manifest.js
|
|
1182
|
+
function matchRemoteWithNameAndExpose(remotes, id) {
|
|
1183
|
+
for (const remote of remotes) {
|
|
1184
|
+
const isNameMatched = id.startsWith(remote.name);
|
|
1185
|
+
let expose = id.replace(remote.name, "");
|
|
1186
|
+
if (isNameMatched) {
|
|
1187
|
+
if (expose.startsWith("/")) {
|
|
1188
|
+
const pkgNameOrAlias = remote.name;
|
|
1189
|
+
expose = `.${expose}`;
|
|
1190
|
+
return {
|
|
1191
|
+
pkgNameOrAlias,
|
|
1192
|
+
expose,
|
|
1193
|
+
remote
|
|
1194
|
+
};
|
|
1195
|
+
} else if (expose === "") return {
|
|
1196
|
+
pkgNameOrAlias: remote.name,
|
|
1197
|
+
expose: ".",
|
|
1198
|
+
remote
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
const isAliasMatched = remote.alias && id.startsWith(remote.alias);
|
|
1202
|
+
let exposeWithAlias = remote.alias && id.replace(remote.alias, "");
|
|
1203
|
+
if (remote.alias && isAliasMatched) {
|
|
1204
|
+
if (exposeWithAlias && exposeWithAlias.startsWith("/")) {
|
|
1205
|
+
const pkgNameOrAlias = remote.alias;
|
|
1206
|
+
exposeWithAlias = `.${exposeWithAlias}`;
|
|
1207
|
+
return {
|
|
1208
|
+
pkgNameOrAlias,
|
|
1209
|
+
expose: exposeWithAlias,
|
|
1210
|
+
remote
|
|
1211
|
+
};
|
|
1212
|
+
} else if (exposeWithAlias === "") return {
|
|
1213
|
+
pkgNameOrAlias: remote.alias,
|
|
1214
|
+
expose: ".",
|
|
1215
|
+
remote
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
function matchRemote(remotes, nameOrAlias) {
|
|
1221
|
+
for (const remote of remotes) {
|
|
1222
|
+
if (nameOrAlias === remote.name) return remote;
|
|
1223
|
+
if (remote.alias && nameOrAlias === remote.alias) return remote;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.4.0/node_modules/@module-federation/error-codes/dist/error-codes.mjs
|
|
1228
|
+
var RUNTIME_001 = "RUNTIME-001";
|
|
1229
|
+
var RUNTIME_002 = "RUNTIME-002";
|
|
1230
|
+
var RUNTIME_003 = "RUNTIME-003";
|
|
1231
|
+
var RUNTIME_004 = "RUNTIME-004";
|
|
1232
|
+
var RUNTIME_005 = "RUNTIME-005";
|
|
1233
|
+
var RUNTIME_006 = "RUNTIME-006";
|
|
1234
|
+
var RUNTIME_007 = "RUNTIME-007";
|
|
1235
|
+
var RUNTIME_008 = "RUNTIME-008";
|
|
1236
|
+
var RUNTIME_009 = "RUNTIME-009";
|
|
1237
|
+
var RUNTIME_010 = "RUNTIME-010";
|
|
1238
|
+
var RUNTIME_011 = "RUNTIME-011";
|
|
1239
|
+
var RUNTIME_012 = "RUNTIME-012";
|
|
1240
|
+
var TYPE_001 = "TYPE-001";
|
|
1241
|
+
var BUILD_001 = "BUILD-001";
|
|
1242
|
+
var BUILD_002 = "BUILD-002";
|
|
1243
|
+
//#endregion
|
|
1244
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.4.0/node_modules/@module-federation/error-codes/dist/desc.mjs
|
|
1245
|
+
var runtimeDescMap = {
|
|
1246
|
+
[RUNTIME_001]: "Failed to get remoteEntry exports.",
|
|
1247
|
+
[RUNTIME_002]: "The remote entry interface does not contain \"init\"",
|
|
1248
|
+
[RUNTIME_003]: "Failed to get manifest.",
|
|
1249
|
+
[RUNTIME_004]: "Failed to locate remote.",
|
|
1250
|
+
[RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
|
|
1251
|
+
[RUNTIME_006]: "Invalid loadShareSync function call from runtime",
|
|
1252
|
+
[RUNTIME_007]: "Failed to get remote snapshot.",
|
|
1253
|
+
[RUNTIME_008]: "Failed to load script resources.",
|
|
1254
|
+
[RUNTIME_009]: "Please call createInstance first.",
|
|
1255
|
+
[RUNTIME_010]: "The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use \"createInstance\" api.",
|
|
1256
|
+
[RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
1257
|
+
[RUNTIME_012]: "The getter for the shared module is not a function. This may be caused by setting \"shared.import: false\" without the host providing the corresponding lib."
|
|
1258
|
+
};
|
|
1259
|
+
var typeDescMap = { [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." };
|
|
1260
|
+
var buildDescMap = {
|
|
1261
|
+
[BUILD_001]: "Failed to find expose module.",
|
|
1262
|
+
[BUILD_002]: "PublicPath is required in prod mode."
|
|
1263
|
+
};
|
|
1264
|
+
({
|
|
1265
|
+
...runtimeDescMap,
|
|
1266
|
+
...typeDescMap,
|
|
1267
|
+
...buildDescMap
|
|
1268
|
+
});
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/load.js
|
|
1271
|
+
var importCallback = ".then(callbacks[0]).catch(callbacks[1])";
|
|
1272
|
+
async function loadEsmEntry({ entry, remoteEntryExports }) {
|
|
1273
|
+
return new Promise((resolve, reject) => {
|
|
1274
|
+
try {
|
|
1275
|
+
if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${entry}")${importCallback}`)([resolve, reject]);
|
|
1276
|
+
else __vitePreload(() => import(
|
|
1277
|
+
/* webpackIgnore: true */
|
|
1278
|
+
/* @vite-ignore */
|
|
1279
|
+
entry
|
|
1280
|
+
).then(resolve), [], import.meta.url).catch(reject);
|
|
1281
|
+
else resolve(remoteEntryExports);
|
|
1282
|
+
} catch (e) {
|
|
1283
|
+
error(`Failed to load ESM entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
async function loadSystemJsEntry({ entry, remoteEntryExports }) {
|
|
1288
|
+
return new Promise((resolve, reject) => {
|
|
1289
|
+
try {
|
|
1290
|
+
if (!remoteEntryExports) if (typeof __system_context__ === "undefined") System.import(entry).then(resolve).catch(reject);
|
|
1291
|
+
else new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);
|
|
1292
|
+
else resolve(remoteEntryExports);
|
|
1293
|
+
} catch (e) {
|
|
1294
|
+
error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
function handleRemoteEntryLoaded(name, globalName, entry) {
|
|
1299
|
+
const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);
|
|
1300
|
+
if (!entryExports) error(RUNTIME_001, runtimeDescMap, {
|
|
1301
|
+
remoteName: name,
|
|
1302
|
+
remoteEntryUrl: entry,
|
|
1303
|
+
remoteEntryKey
|
|
1304
|
+
});
|
|
1305
|
+
return entryExports;
|
|
1306
|
+
}
|
|
1307
|
+
async function loadEntryScript({ name, globalName, entry, remoteInfo, loaderHook, getEntryUrl }) {
|
|
1308
|
+
const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);
|
|
1309
|
+
if (remoteEntryExports) return remoteEntryExports;
|
|
1310
|
+
const url = getEntryUrl ? getEntryUrl(entry) : entry;
|
|
1311
|
+
return loadScript(url, {
|
|
1312
|
+
attrs: {},
|
|
1313
|
+
createScriptHook: (url, attrs) => {
|
|
1314
|
+
const res = loaderHook.lifecycle.createScript.emit({
|
|
1315
|
+
url,
|
|
1316
|
+
attrs,
|
|
1317
|
+
remoteInfo
|
|
1318
|
+
});
|
|
1319
|
+
if (!res) return;
|
|
1320
|
+
if (res instanceof HTMLScriptElement) return res;
|
|
1321
|
+
if ("script" in res || "timeout" in res) return res;
|
|
1322
|
+
}
|
|
1323
|
+
}).then(() => {
|
|
1324
|
+
return handleRemoteEntryLoaded(name, globalName, entry);
|
|
1325
|
+
}, (loadError) => {
|
|
1326
|
+
const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
|
|
1327
|
+
error(RUNTIME_008, runtimeDescMap, {
|
|
1328
|
+
remoteName: name,
|
|
1329
|
+
resourceUrl: url
|
|
1330
|
+
}, originalMsg);
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl }) {
|
|
1334
|
+
const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
|
|
1335
|
+
switch (type) {
|
|
1336
|
+
case "esm":
|
|
1337
|
+
case "module": return loadEsmEntry({
|
|
1338
|
+
entry,
|
|
1339
|
+
remoteEntryExports
|
|
1340
|
+
});
|
|
1341
|
+
case "system": return loadSystemJsEntry({
|
|
1342
|
+
entry,
|
|
1343
|
+
remoteEntryExports
|
|
1344
|
+
});
|
|
1345
|
+
default: return loadEntryScript({
|
|
1346
|
+
entry,
|
|
1347
|
+
globalName,
|
|
1348
|
+
name,
|
|
1349
|
+
remoteInfo,
|
|
1350
|
+
loaderHook,
|
|
1351
|
+
getEntryUrl
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
function getRemoteEntryUniqueKey(remoteInfo) {
|
|
1356
|
+
const { entry, name } = remoteInfo;
|
|
1357
|
+
return composeKeyWithSeparator(name, entry);
|
|
1358
|
+
}
|
|
1359
|
+
async function getRemoteEntry(params) {
|
|
1360
|
+
const { origin, remoteEntryExports, remoteInfo, getEntryUrl, _inErrorHandling = false } = params;
|
|
1361
|
+
const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);
|
|
1362
|
+
if (remoteEntryExports) return remoteEntryExports;
|
|
1363
|
+
if (!globalLoading[uniqueKey]) {
|
|
1364
|
+
const loadEntryHook = origin.remoteHandler.hooks.lifecycle.loadEntry;
|
|
1365
|
+
const loaderHook = origin.loaderHook;
|
|
1366
|
+
globalLoading[uniqueKey] = loadEntryHook.emit({
|
|
1367
|
+
loaderHook,
|
|
1368
|
+
remoteInfo,
|
|
1369
|
+
remoteEntryExports
|
|
1370
|
+
}).then((res) => {
|
|
1371
|
+
if (res) return res;
|
|
1372
|
+
return loadEntryDom({
|
|
1373
|
+
remoteInfo,
|
|
1374
|
+
remoteEntryExports,
|
|
1375
|
+
loaderHook,
|
|
1376
|
+
getEntryUrl
|
|
1377
|
+
});
|
|
1378
|
+
}).catch(async (err) => {
|
|
1379
|
+
const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);
|
|
1380
|
+
const isScriptExecutionError = err instanceof Error && err.message.includes("ScriptExecutionError");
|
|
1381
|
+
if (err instanceof Error && err.message.includes("RUNTIME-008") && !isScriptExecutionError && !_inErrorHandling) {
|
|
1382
|
+
const wrappedGetRemoteEntry = (params) => {
|
|
1383
|
+
return getRemoteEntry({
|
|
1384
|
+
...params,
|
|
1385
|
+
_inErrorHandling: true
|
|
1386
|
+
});
|
|
1387
|
+
};
|
|
1388
|
+
const RemoteEntryExports = await origin.loaderHook.lifecycle.loadEntryError.emit({
|
|
1389
|
+
getRemoteEntry: wrappedGetRemoteEntry,
|
|
1390
|
+
origin,
|
|
1391
|
+
remoteInfo,
|
|
1392
|
+
remoteEntryExports,
|
|
1393
|
+
globalLoading,
|
|
1394
|
+
uniqueKey
|
|
1395
|
+
});
|
|
1396
|
+
if (RemoteEntryExports) return RemoteEntryExports;
|
|
1397
|
+
}
|
|
1398
|
+
throw err;
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
return globalLoading[uniqueKey];
|
|
1402
|
+
}
|
|
1403
|
+
function getRemoteInfo(remote) {
|
|
1404
|
+
return {
|
|
1405
|
+
...remote,
|
|
1406
|
+
entry: "entry" in remote ? remote.entry : "",
|
|
1407
|
+
type: remote.type || "global",
|
|
1408
|
+
entryGlobalName: remote.entryGlobalName || remote.name,
|
|
1409
|
+
shareScope: remote.shareScope || "default"
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
//#endregion
|
|
1413
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/env.js
|
|
1414
|
+
function getBuilderId$1() {
|
|
1415
|
+
return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1416
|
+
}
|
|
1417
|
+
//#endregion
|
|
1418
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/plugin.js
|
|
1419
|
+
function registerPlugins(plugins, instance) {
|
|
1420
|
+
const globalPlugins = getGlobalHostPlugins();
|
|
1421
|
+
const hookInstances = [
|
|
1422
|
+
instance.hooks,
|
|
1423
|
+
instance.remoteHandler.hooks,
|
|
1424
|
+
instance.sharedHandler.hooks,
|
|
1425
|
+
instance.snapshotHandler.hooks,
|
|
1426
|
+
instance.loaderHook,
|
|
1427
|
+
instance.bridgeHook
|
|
1428
|
+
];
|
|
1429
|
+
if (globalPlugins.length > 0) globalPlugins.forEach((plugin) => {
|
|
1430
|
+
if (plugins?.find((item) => item.name !== plugin.name)) plugins.push(plugin);
|
|
1431
|
+
});
|
|
1432
|
+
if (plugins && plugins.length > 0) plugins.forEach((plugin) => {
|
|
1433
|
+
hookInstances.forEach((hookInstance) => {
|
|
1434
|
+
hookInstance.applyPlugin(plugin, instance);
|
|
1435
|
+
});
|
|
1436
|
+
});
|
|
1437
|
+
return plugins;
|
|
1438
|
+
}
|
|
1439
|
+
//#endregion
|
|
1440
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/context.js
|
|
1441
|
+
function remoteToEntry(r) {
|
|
1442
|
+
return {
|
|
1443
|
+
name: r.name,
|
|
1444
|
+
alias: r.alias,
|
|
1445
|
+
entry: "entry" in r ? r.entry : void 0,
|
|
1446
|
+
version: "version" in r ? r.version : void 0,
|
|
1447
|
+
type: r.type,
|
|
1448
|
+
entryGlobalName: r.entryGlobalName,
|
|
1449
|
+
shareScope: r.shareScope
|
|
1450
|
+
};
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Build a partial MFContext from runtime Options.
|
|
1454
|
+
* Used to enrich diagnostic entries with host context at error sites.
|
|
1455
|
+
*/
|
|
1456
|
+
function optionsToMFContext(options) {
|
|
1457
|
+
const shared = {};
|
|
1458
|
+
for (const [pkgName, versions] of Object.entries(options.shared)) {
|
|
1459
|
+
const first = versions[0];
|
|
1460
|
+
if (first) shared[pkgName] = {
|
|
1461
|
+
version: first.version,
|
|
1462
|
+
singleton: first.shareConfig?.singleton,
|
|
1463
|
+
requiredVersion: first.shareConfig?.requiredVersion === false ? false : first.shareConfig?.requiredVersion,
|
|
1464
|
+
eager: first.eager,
|
|
1465
|
+
strictVersion: first.shareConfig?.strictVersion
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1468
|
+
return {
|
|
1469
|
+
project: {
|
|
1470
|
+
name: options.name,
|
|
1471
|
+
mfRole: options.remotes?.length > 0 ? "host" : "unknown"
|
|
1472
|
+
},
|
|
1473
|
+
mfConfig: {
|
|
1474
|
+
name: options.name,
|
|
1475
|
+
remotes: options.remotes?.map(remoteToEntry) ?? [],
|
|
1476
|
+
shared
|
|
1477
|
+
}
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
//#endregion
|
|
1481
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/preload.js
|
|
1482
|
+
function defaultPreloadArgs(preloadConfig) {
|
|
1483
|
+
return {
|
|
1484
|
+
resourceCategory: "sync",
|
|
1485
|
+
share: true,
|
|
1486
|
+
depsRemote: true,
|
|
1487
|
+
...preloadConfig
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
function formatPreloadArgs(remotes, preloadArgs) {
|
|
1491
|
+
return preloadArgs.map((args) => {
|
|
1492
|
+
const remoteInfo = matchRemote(remotes, args.nameOrAlias);
|
|
1493
|
+
assert(remoteInfo, `Unable to preload ${args.nameOrAlias} as it is not included in ${!remoteInfo && safeToString({
|
|
1494
|
+
remoteInfo,
|
|
1495
|
+
remotes
|
|
1496
|
+
})}`);
|
|
1497
|
+
return {
|
|
1498
|
+
remote: remoteInfo,
|
|
1499
|
+
preloadConfig: defaultPreloadArgs(args)
|
|
1500
|
+
};
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
function normalizePreloadExposes(exposes) {
|
|
1504
|
+
if (!exposes) return [];
|
|
1505
|
+
return exposes.map((expose) => {
|
|
1506
|
+
if (expose === ".") return expose;
|
|
1507
|
+
if (expose.startsWith("./")) return expose.replace("./", "");
|
|
1508
|
+
return expose;
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
function preloadAssets(remoteInfo, host, assets, useLinkPreload = true) {
|
|
1512
|
+
const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;
|
|
1513
|
+
if (host.options.inBrowser) {
|
|
1514
|
+
entryAssets.forEach((asset) => {
|
|
1515
|
+
const { moduleInfo } = asset;
|
|
1516
|
+
const module = host.moduleCache.get(remoteInfo.name);
|
|
1517
|
+
if (module) getRemoteEntry({
|
|
1518
|
+
origin: host,
|
|
1519
|
+
remoteInfo: moduleInfo,
|
|
1520
|
+
remoteEntryExports: module.remoteEntryExports
|
|
1521
|
+
});
|
|
1522
|
+
else getRemoteEntry({
|
|
1523
|
+
origin: host,
|
|
1524
|
+
remoteInfo: moduleInfo,
|
|
1525
|
+
remoteEntryExports: void 0
|
|
1526
|
+
});
|
|
1527
|
+
});
|
|
1528
|
+
if (useLinkPreload) {
|
|
1529
|
+
const defaultAttrs = {
|
|
1530
|
+
rel: "preload",
|
|
1531
|
+
as: "style"
|
|
1532
|
+
};
|
|
1533
|
+
cssAssets.forEach((cssUrl) => {
|
|
1534
|
+
const { link: cssEl, needAttach } = createLink({
|
|
1535
|
+
url: cssUrl,
|
|
1536
|
+
cb: () => {},
|
|
1537
|
+
attrs: defaultAttrs,
|
|
1538
|
+
createLinkHook: (url, attrs) => {
|
|
1539
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
1540
|
+
url,
|
|
1541
|
+
attrs,
|
|
1542
|
+
remoteInfo
|
|
1543
|
+
});
|
|
1544
|
+
if (res instanceof HTMLLinkElement) return res;
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
needAttach && document.head.appendChild(cssEl);
|
|
1548
|
+
});
|
|
1549
|
+
} else {
|
|
1550
|
+
const defaultAttrs = {
|
|
1551
|
+
rel: "stylesheet",
|
|
1552
|
+
type: "text/css"
|
|
1553
|
+
};
|
|
1554
|
+
cssAssets.forEach((cssUrl) => {
|
|
1555
|
+
const { link: cssEl, needAttach } = createLink({
|
|
1556
|
+
url: cssUrl,
|
|
1557
|
+
cb: () => {},
|
|
1558
|
+
attrs: defaultAttrs,
|
|
1559
|
+
createLinkHook: (url, attrs) => {
|
|
1560
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
1561
|
+
url,
|
|
1562
|
+
attrs,
|
|
1563
|
+
remoteInfo
|
|
1564
|
+
});
|
|
1565
|
+
if (res instanceof HTMLLinkElement) return res;
|
|
1566
|
+
},
|
|
1567
|
+
needDeleteLink: false
|
|
1568
|
+
});
|
|
1569
|
+
needAttach && document.head.appendChild(cssEl);
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
if (useLinkPreload) {
|
|
1573
|
+
const defaultAttrs = {
|
|
1574
|
+
rel: "preload",
|
|
1575
|
+
as: "script"
|
|
1576
|
+
};
|
|
1577
|
+
jsAssetsWithoutEntry.forEach((jsUrl) => {
|
|
1578
|
+
const { link: linkEl, needAttach } = createLink({
|
|
1579
|
+
url: jsUrl,
|
|
1580
|
+
cb: () => {},
|
|
1581
|
+
attrs: defaultAttrs,
|
|
1582
|
+
createLinkHook: (url, attrs) => {
|
|
1583
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
1584
|
+
url,
|
|
1585
|
+
attrs,
|
|
1586
|
+
remoteInfo
|
|
1587
|
+
});
|
|
1588
|
+
if (res instanceof HTMLLinkElement) return res;
|
|
1589
|
+
}
|
|
1590
|
+
});
|
|
1591
|
+
needAttach && document.head.appendChild(linkEl);
|
|
1592
|
+
});
|
|
1593
|
+
} else {
|
|
1594
|
+
const defaultAttrs = {
|
|
1595
|
+
fetchpriority: "high",
|
|
1596
|
+
type: remoteInfo?.type === "module" ? "module" : "text/javascript"
|
|
1597
|
+
};
|
|
1598
|
+
jsAssetsWithoutEntry.forEach((jsUrl) => {
|
|
1599
|
+
const { script: scriptEl, needAttach } = createScript({
|
|
1600
|
+
url: jsUrl,
|
|
1601
|
+
cb: () => {},
|
|
1602
|
+
attrs: defaultAttrs,
|
|
1603
|
+
createScriptHook: (url, attrs) => {
|
|
1604
|
+
const res = host.loaderHook.lifecycle.createScript.emit({
|
|
1605
|
+
url,
|
|
1606
|
+
attrs,
|
|
1607
|
+
remoteInfo
|
|
1608
|
+
});
|
|
1609
|
+
if (res instanceof HTMLScriptElement) return res;
|
|
1610
|
+
},
|
|
1611
|
+
needDeleteScript: true
|
|
1612
|
+
});
|
|
1613
|
+
needAttach && document.head.appendChild(scriptEl);
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
//#endregion
|
|
1619
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/module/index.js
|
|
1620
|
+
function createRemoteEntryInitOptions(remoteInfo, hostShareScopeMap, rawInitScope) {
|
|
1621
|
+
const localShareScopeMap = hostShareScopeMap;
|
|
1622
|
+
const shareScopeKeys = Array.isArray(remoteInfo.shareScope) ? remoteInfo.shareScope : [remoteInfo.shareScope];
|
|
1623
|
+
if (!shareScopeKeys.length) shareScopeKeys.push("default");
|
|
1624
|
+
shareScopeKeys.forEach((shareScopeKey) => {
|
|
1625
|
+
if (!localShareScopeMap[shareScopeKey]) localShareScopeMap[shareScopeKey] = {};
|
|
1626
|
+
});
|
|
1627
|
+
const remoteEntryInitOptions = {
|
|
1628
|
+
version: remoteInfo.version || "",
|
|
1629
|
+
shareScopeKeys: Array.isArray(remoteInfo.shareScope) ? shareScopeKeys : remoteInfo.shareScope || "default"
|
|
1630
|
+
};
|
|
1631
|
+
Object.defineProperty(remoteEntryInitOptions, "shareScopeMap", {
|
|
1632
|
+
value: localShareScopeMap,
|
|
1633
|
+
enumerable: false
|
|
1634
|
+
});
|
|
1635
|
+
return {
|
|
1636
|
+
remoteEntryInitOptions,
|
|
1637
|
+
shareScope: localShareScopeMap[shareScopeKeys[0]],
|
|
1638
|
+
initScope: rawInitScope ?? []
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
var Module$1 = class {
|
|
1642
|
+
constructor({ remoteInfo, host }) {
|
|
1643
|
+
this.inited = false;
|
|
1644
|
+
this.initing = false;
|
|
1645
|
+
this.lib = void 0;
|
|
1646
|
+
this.remoteInfo = remoteInfo;
|
|
1647
|
+
this.host = host;
|
|
1648
|
+
}
|
|
1649
|
+
async getEntry() {
|
|
1650
|
+
if (this.remoteEntryExports) return this.remoteEntryExports;
|
|
1651
|
+
const remoteEntryExports = await getRemoteEntry({
|
|
1652
|
+
origin: this.host,
|
|
1653
|
+
remoteInfo: this.remoteInfo,
|
|
1654
|
+
remoteEntryExports: this.remoteEntryExports
|
|
1655
|
+
});
|
|
1656
|
+
assert(remoteEntryExports, `remoteEntryExports is undefined \n ${safeToString(this.remoteInfo)}`);
|
|
1657
|
+
this.remoteEntryExports = remoteEntryExports;
|
|
1658
|
+
return this.remoteEntryExports;
|
|
1659
|
+
}
|
|
1660
|
+
async init(id, remoteSnapshot, rawInitScope) {
|
|
1661
|
+
const remoteEntryExports = await this.getEntry();
|
|
1662
|
+
if (this.inited) return remoteEntryExports;
|
|
1663
|
+
if (this.initPromise) {
|
|
1664
|
+
await this.initPromise;
|
|
1665
|
+
return remoteEntryExports;
|
|
1666
|
+
}
|
|
1667
|
+
this.initing = true;
|
|
1668
|
+
this.initPromise = (async () => {
|
|
1669
|
+
const { remoteEntryInitOptions, shareScope, initScope } = createRemoteEntryInitOptions(this.remoteInfo, this.host.shareScopeMap, rawInitScope);
|
|
1670
|
+
const initContainerOptions = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1671
|
+
shareScope,
|
|
1672
|
+
remoteEntryInitOptions,
|
|
1673
|
+
initScope,
|
|
1674
|
+
remoteInfo: this.remoteInfo,
|
|
1675
|
+
origin: this.host
|
|
1676
|
+
});
|
|
1677
|
+
if (typeof remoteEntryExports?.init === "undefined") error(RUNTIME_002, runtimeDescMap, {
|
|
1678
|
+
hostName: this.host.name,
|
|
1679
|
+
remoteName: this.remoteInfo.name,
|
|
1680
|
+
remoteEntryUrl: this.remoteInfo.entry,
|
|
1681
|
+
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1682
|
+
}, void 0, optionsToMFContext(this.host.options));
|
|
1683
|
+
await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
|
|
1684
|
+
await this.host.hooks.lifecycle.initContainer.emit({
|
|
1685
|
+
...initContainerOptions,
|
|
1686
|
+
id,
|
|
1687
|
+
remoteSnapshot,
|
|
1688
|
+
remoteEntryExports
|
|
1689
|
+
});
|
|
1690
|
+
this.inited = true;
|
|
1691
|
+
})();
|
|
1692
|
+
try {
|
|
1693
|
+
await this.initPromise;
|
|
1694
|
+
} finally {
|
|
1695
|
+
this.initing = false;
|
|
1696
|
+
this.initPromise = void 0;
|
|
1697
|
+
}
|
|
1698
|
+
return remoteEntryExports;
|
|
1699
|
+
}
|
|
1700
|
+
async get(id, expose, options, remoteSnapshot) {
|
|
1701
|
+
const { loadFactory = true } = options || { loadFactory: true };
|
|
1702
|
+
const remoteEntryExports = await this.init(id, remoteSnapshot);
|
|
1703
|
+
this.lib = remoteEntryExports;
|
|
1704
|
+
let moduleFactory;
|
|
1705
|
+
moduleFactory = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1706
|
+
remoteEntryExports,
|
|
1707
|
+
expose,
|
|
1708
|
+
moduleInfo: this.remoteInfo
|
|
1709
|
+
});
|
|
1710
|
+
if (!moduleFactory) moduleFactory = await remoteEntryExports.get(expose);
|
|
1711
|
+
assert(moduleFactory, `${getFMId(this.remoteInfo)} remote don't export ${expose}.`);
|
|
1712
|
+
const symbolName = processModuleAlias(this.remoteInfo.name, expose);
|
|
1713
|
+
const wrapModuleFactory = this.wraperFactory(moduleFactory, symbolName);
|
|
1714
|
+
if (!loadFactory) return wrapModuleFactory;
|
|
1715
|
+
return await wrapModuleFactory();
|
|
1716
|
+
}
|
|
1717
|
+
wraperFactory(moduleFactory, id) {
|
|
1718
|
+
function defineModuleId(res, id) {
|
|
1719
|
+
if (res && typeof res === "object" && Object.isExtensible(res) && !Object.getOwnPropertyDescriptor(res, Symbol.for("mf_module_id"))) Object.defineProperty(res, Symbol.for("mf_module_id"), {
|
|
1720
|
+
value: id,
|
|
1721
|
+
enumerable: false
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
if (moduleFactory instanceof Promise) return async () => {
|
|
1725
|
+
const res = await moduleFactory();
|
|
1726
|
+
defineModuleId(res, id);
|
|
1727
|
+
return res;
|
|
1728
|
+
};
|
|
1729
|
+
else return () => {
|
|
1730
|
+
const res = moduleFactory();
|
|
1731
|
+
defineModuleId(res, id);
|
|
1732
|
+
return res;
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
//#endregion
|
|
1737
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/syncHook.js
|
|
1738
|
+
var SyncHook = class {
|
|
1739
|
+
constructor(type) {
|
|
1740
|
+
this.type = "";
|
|
1741
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
1742
|
+
if (type) this.type = type;
|
|
1743
|
+
}
|
|
1744
|
+
on(fn) {
|
|
1745
|
+
if (typeof fn === "function") this.listeners.add(fn);
|
|
1746
|
+
}
|
|
1747
|
+
once(fn) {
|
|
1748
|
+
const self = this;
|
|
1749
|
+
this.on(function wrapper(...args) {
|
|
1750
|
+
self.remove(wrapper);
|
|
1751
|
+
return fn.apply(null, args);
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
emit(...data) {
|
|
1755
|
+
let result;
|
|
1756
|
+
if (this.listeners.size > 0) this.listeners.forEach((fn) => {
|
|
1757
|
+
result = fn(...data);
|
|
1758
|
+
});
|
|
1759
|
+
return result;
|
|
1760
|
+
}
|
|
1761
|
+
remove(fn) {
|
|
1762
|
+
this.listeners.delete(fn);
|
|
1763
|
+
}
|
|
1764
|
+
removeAll() {
|
|
1765
|
+
this.listeners.clear();
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/asyncHook.js
|
|
1770
|
+
var AsyncHook = class extends SyncHook {
|
|
1771
|
+
emit(...data) {
|
|
1772
|
+
let result;
|
|
1773
|
+
const ls = Array.from(this.listeners);
|
|
1774
|
+
if (ls.length > 0) {
|
|
1775
|
+
let i = 0;
|
|
1776
|
+
const call = (prev) => {
|
|
1777
|
+
if (prev === false) return false;
|
|
1778
|
+
else if (i < ls.length) return Promise.resolve(ls[i++].apply(null, data)).then(call);
|
|
1779
|
+
else return prev;
|
|
1780
|
+
};
|
|
1781
|
+
result = call();
|
|
1782
|
+
}
|
|
1783
|
+
return Promise.resolve(result);
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
//#endregion
|
|
1787
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/syncWaterfallHook.js
|
|
1788
|
+
function checkReturnData(originalData, returnedData) {
|
|
1789
|
+
if (!isObject(returnedData)) return false;
|
|
1790
|
+
if (originalData !== returnedData) {
|
|
1791
|
+
for (const key in originalData) if (!(key in returnedData)) return false;
|
|
1792
|
+
}
|
|
1793
|
+
return true;
|
|
1794
|
+
}
|
|
1795
|
+
var SyncWaterfallHook = class extends SyncHook {
|
|
1796
|
+
constructor(type) {
|
|
1797
|
+
super();
|
|
1798
|
+
this.onerror = error;
|
|
1799
|
+
this.type = type;
|
|
1800
|
+
}
|
|
1801
|
+
emit(data) {
|
|
1802
|
+
if (!isObject(data)) error(`The data for the "${this.type}" hook should be an object.`);
|
|
1803
|
+
for (const fn of this.listeners) try {
|
|
1804
|
+
const tempData = fn(data);
|
|
1805
|
+
if (checkReturnData(data, tempData)) data = tempData;
|
|
1806
|
+
else {
|
|
1807
|
+
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
1808
|
+
break;
|
|
1809
|
+
}
|
|
1810
|
+
} catch (e) {
|
|
1811
|
+
warn$1(e);
|
|
1812
|
+
this.onerror(e);
|
|
1813
|
+
}
|
|
1814
|
+
return data;
|
|
1815
|
+
}
|
|
1816
|
+
};
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/asyncWaterfallHooks.js
|
|
1819
|
+
var AsyncWaterfallHook = class extends SyncHook {
|
|
1820
|
+
constructor(type) {
|
|
1821
|
+
super();
|
|
1822
|
+
this.onerror = error;
|
|
1823
|
+
this.type = type;
|
|
1824
|
+
}
|
|
1825
|
+
emit(data) {
|
|
1826
|
+
if (!isObject(data)) error(`The response data for the "${this.type}" hook must be an object.`);
|
|
1827
|
+
const ls = Array.from(this.listeners);
|
|
1828
|
+
if (ls.length > 0) {
|
|
1829
|
+
let i = 0;
|
|
1830
|
+
const processError = (e) => {
|
|
1831
|
+
warn$1(e);
|
|
1832
|
+
this.onerror(e);
|
|
1833
|
+
return data;
|
|
1834
|
+
};
|
|
1835
|
+
const call = (prevData) => {
|
|
1836
|
+
if (checkReturnData(data, prevData)) {
|
|
1837
|
+
data = prevData;
|
|
1838
|
+
if (i < ls.length) try {
|
|
1839
|
+
return Promise.resolve(ls[i++](data)).then(call, processError);
|
|
1840
|
+
} catch (e) {
|
|
1841
|
+
return processError(e);
|
|
1842
|
+
}
|
|
1843
|
+
} else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
|
|
1844
|
+
return data;
|
|
1845
|
+
};
|
|
1846
|
+
return Promise.resolve(call(data));
|
|
1847
|
+
}
|
|
1848
|
+
return Promise.resolve(data);
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
//#endregion
|
|
1852
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/pluginSystem.js
|
|
1853
|
+
var PluginSystem = class {
|
|
1854
|
+
constructor(lifecycle) {
|
|
1855
|
+
this.registerPlugins = {};
|
|
1856
|
+
this.lifecycle = lifecycle;
|
|
1857
|
+
this.lifecycleKeys = Object.keys(lifecycle);
|
|
1858
|
+
}
|
|
1859
|
+
applyPlugin(plugin, instance) {
|
|
1860
|
+
assert(isPlainObject(plugin), "Plugin configuration is invalid.");
|
|
1861
|
+
const pluginName = plugin.name;
|
|
1862
|
+
assert(pluginName, "A name must be provided by the plugin.");
|
|
1863
|
+
if (!this.registerPlugins[pluginName]) {
|
|
1864
|
+
this.registerPlugins[pluginName] = plugin;
|
|
1865
|
+
plugin.apply?.(instance);
|
|
1866
|
+
Object.keys(this.lifecycle).forEach((key) => {
|
|
1867
|
+
const pluginLife = plugin[key];
|
|
1868
|
+
if (pluginLife) this.lifecycle[key].on(pluginLife);
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
removePlugin(pluginName) {
|
|
1873
|
+
assert(pluginName, "A name is required.");
|
|
1874
|
+
const plugin = this.registerPlugins[pluginName];
|
|
1875
|
+
assert(plugin, `The plugin "${pluginName}" is not registered.`);
|
|
1876
|
+
Object.keys(plugin).forEach((key) => {
|
|
1877
|
+
if (key !== "name") this.lifecycle[key].remove(plugin[key]);
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
//#endregion
|
|
1882
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.js
|
|
1883
|
+
function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
1884
|
+
const remoteEntryInfo = getRemoteEntryInfoFromSnapshot(remoteSnapshot);
|
|
1885
|
+
if (!remoteEntryInfo.url) error(RUNTIME_011, runtimeDescMap, { remoteName: remoteInfo.name });
|
|
1886
|
+
let entryUrl = getResourceUrl(remoteSnapshot, remoteEntryInfo.url);
|
|
1887
|
+
remoteInfo.type = remoteEntryInfo.type;
|
|
1888
|
+
remoteInfo.entryGlobalName = remoteEntryInfo.globalName;
|
|
1889
|
+
remoteInfo.entry = entryUrl;
|
|
1890
|
+
remoteInfo.version = remoteSnapshot.version;
|
|
1891
|
+
remoteInfo.buildVersion = remoteSnapshot.buildVersion;
|
|
1892
|
+
}
|
|
1893
|
+
function snapshotPlugin() {
|
|
1894
|
+
return {
|
|
1895
|
+
name: "snapshot-plugin",
|
|
1896
|
+
async afterResolve(args) {
|
|
1897
|
+
const { remote, pkgNameOrAlias, expose, origin, remoteInfo, id } = args;
|
|
1898
|
+
if (!isRemoteInfoWithEntry(remote) || !isPureRemoteEntry(remote)) {
|
|
1899
|
+
const { remoteSnapshot, globalSnapshot } = await origin.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1900
|
+
moduleInfo: remote,
|
|
1901
|
+
id
|
|
1902
|
+
});
|
|
1903
|
+
assignRemoteInfo(remoteInfo, remoteSnapshot);
|
|
1904
|
+
const preloadOptions = {
|
|
1905
|
+
remote,
|
|
1906
|
+
preloadConfig: {
|
|
1907
|
+
nameOrAlias: pkgNameOrAlias,
|
|
1908
|
+
exposes: [expose],
|
|
1909
|
+
resourceCategory: "sync",
|
|
1910
|
+
share: false,
|
|
1911
|
+
depsRemote: false
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
const assets = await origin.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1915
|
+
origin,
|
|
1916
|
+
preloadOptions,
|
|
1917
|
+
remoteInfo,
|
|
1918
|
+
remote,
|
|
1919
|
+
remoteSnapshot,
|
|
1920
|
+
globalSnapshot
|
|
1921
|
+
});
|
|
1922
|
+
if (assets) preloadAssets(remoteInfo, origin, assets, false);
|
|
1923
|
+
return {
|
|
1924
|
+
...args,
|
|
1925
|
+
remoteSnapshot
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
return args;
|
|
1929
|
+
}
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
//#endregion
|
|
1933
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/plugins/generate-preload-assets.js
|
|
1934
|
+
function splitId(id) {
|
|
1935
|
+
const splitInfo = id.split(":");
|
|
1936
|
+
if (splitInfo.length === 1) return {
|
|
1937
|
+
name: splitInfo[0],
|
|
1938
|
+
version: void 0
|
|
1939
|
+
};
|
|
1940
|
+
else if (splitInfo.length === 2) return {
|
|
1941
|
+
name: splitInfo[0],
|
|
1942
|
+
version: splitInfo[1]
|
|
1943
|
+
};
|
|
1944
|
+
else return {
|
|
1945
|
+
name: splitInfo[1],
|
|
1946
|
+
version: splitInfo[2]
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
function traverseModuleInfo(globalSnapshot, remoteInfo, traverse, isRoot, memo = {}, remoteSnapshot) {
|
|
1950
|
+
const { value: snapshotValue } = getInfoWithoutType(globalSnapshot, getFMId(remoteInfo));
|
|
1951
|
+
const effectiveRemoteSnapshot = remoteSnapshot || snapshotValue;
|
|
1952
|
+
if (effectiveRemoteSnapshot && !isManifestProvider(effectiveRemoteSnapshot)) {
|
|
1953
|
+
traverse(effectiveRemoteSnapshot, remoteInfo, isRoot);
|
|
1954
|
+
if (effectiveRemoteSnapshot.remotesInfo) {
|
|
1955
|
+
const remoteKeys = Object.keys(effectiveRemoteSnapshot.remotesInfo);
|
|
1956
|
+
for (const key of remoteKeys) {
|
|
1957
|
+
if (memo[key]) continue;
|
|
1958
|
+
memo[key] = true;
|
|
1959
|
+
const subRemoteInfo = splitId(key);
|
|
1960
|
+
const remoteValue = effectiveRemoteSnapshot.remotesInfo[key];
|
|
1961
|
+
traverseModuleInfo(globalSnapshot, {
|
|
1962
|
+
name: subRemoteInfo.name,
|
|
1963
|
+
version: remoteValue.matchedVersion
|
|
1964
|
+
}, traverse, false, memo, void 0);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
var isExisted = (type, url) => {
|
|
1970
|
+
return document.querySelector(`${type}[${type === "link" ? "href" : "src"}="${url}"]`);
|
|
1971
|
+
};
|
|
1972
|
+
function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, remoteSnapshot) {
|
|
1973
|
+
const cssAssets = [];
|
|
1974
|
+
const jsAssets = [];
|
|
1975
|
+
const entryAssets = [];
|
|
1976
|
+
const loadedSharedJsAssets = /* @__PURE__ */ new Set();
|
|
1977
|
+
const loadedSharedCssAssets = /* @__PURE__ */ new Set();
|
|
1978
|
+
const { options } = origin;
|
|
1979
|
+
const { preloadConfig: rootPreloadConfig } = preloadOptions;
|
|
1980
|
+
const { depsRemote } = rootPreloadConfig;
|
|
1981
|
+
traverseModuleInfo(globalSnapshot, remote, (moduleInfoSnapshot, remoteInfo, isRoot) => {
|
|
1982
|
+
let preloadConfig;
|
|
1983
|
+
if (isRoot) preloadConfig = rootPreloadConfig;
|
|
1984
|
+
else if (Array.isArray(depsRemote)) {
|
|
1985
|
+
const findPreloadConfig = depsRemote.find((remoteConfig) => {
|
|
1986
|
+
if (remoteConfig.nameOrAlias === remoteInfo.name || remoteConfig.nameOrAlias === remoteInfo.alias) return true;
|
|
1987
|
+
return false;
|
|
1988
|
+
});
|
|
1989
|
+
if (!findPreloadConfig) return;
|
|
1990
|
+
preloadConfig = defaultPreloadArgs(findPreloadConfig);
|
|
1991
|
+
} else if (depsRemote === true) preloadConfig = rootPreloadConfig;
|
|
1992
|
+
else return;
|
|
1993
|
+
const remoteEntryUrl = getResourceUrl(moduleInfoSnapshot, getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);
|
|
1994
|
+
if (remoteEntryUrl) entryAssets.push({
|
|
1995
|
+
name: remoteInfo.name,
|
|
1996
|
+
moduleInfo: {
|
|
1997
|
+
name: remoteInfo.name,
|
|
1998
|
+
entry: remoteEntryUrl,
|
|
1999
|
+
type: "remoteEntryType" in moduleInfoSnapshot ? moduleInfoSnapshot.remoteEntryType : "global",
|
|
2000
|
+
entryGlobalName: "globalName" in moduleInfoSnapshot ? moduleInfoSnapshot.globalName : remoteInfo.name,
|
|
2001
|
+
shareScope: "",
|
|
2002
|
+
version: "version" in moduleInfoSnapshot ? moduleInfoSnapshot.version : void 0
|
|
2003
|
+
},
|
|
2004
|
+
url: remoteEntryUrl
|
|
2005
|
+
});
|
|
2006
|
+
let moduleAssetsInfo = "modules" in moduleInfoSnapshot ? moduleInfoSnapshot.modules : [];
|
|
2007
|
+
const normalizedPreloadExposes = normalizePreloadExposes(preloadConfig.exposes);
|
|
2008
|
+
if (normalizedPreloadExposes.length && "modules" in moduleInfoSnapshot) moduleAssetsInfo = moduleInfoSnapshot?.modules?.reduce((assets, moduleAssetInfo) => {
|
|
2009
|
+
if (normalizedPreloadExposes?.indexOf(moduleAssetInfo.moduleName) !== -1) assets.push(moduleAssetInfo);
|
|
2010
|
+
return assets;
|
|
2011
|
+
}, []);
|
|
2012
|
+
function handleAssets(assets) {
|
|
2013
|
+
const assetsRes = assets.map((asset) => getResourceUrl(moduleInfoSnapshot, asset));
|
|
2014
|
+
if (preloadConfig.filter) return assetsRes.filter(preloadConfig.filter);
|
|
2015
|
+
return assetsRes;
|
|
2016
|
+
}
|
|
2017
|
+
if (moduleAssetsInfo) {
|
|
2018
|
+
const assetsLength = moduleAssetsInfo.length;
|
|
2019
|
+
for (let index = 0; index < assetsLength; index++) {
|
|
2020
|
+
const assetsInfo = moduleAssetsInfo[index];
|
|
2021
|
+
const exposeFullPath = `${remoteInfo.name}/${assetsInfo.moduleName}`;
|
|
2022
|
+
origin.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
2023
|
+
id: assetsInfo.moduleName === "." ? remoteInfo.name : exposeFullPath,
|
|
2024
|
+
name: remoteInfo.name,
|
|
2025
|
+
remoteSnapshot: moduleInfoSnapshot,
|
|
2026
|
+
preloadConfig,
|
|
2027
|
+
remote: remoteInfo,
|
|
2028
|
+
origin
|
|
2029
|
+
});
|
|
2030
|
+
if (getPreloaded(exposeFullPath)) continue;
|
|
2031
|
+
if (preloadConfig.resourceCategory === "all") {
|
|
2032
|
+
cssAssets.push(...handleAssets(assetsInfo.assets.css.async));
|
|
2033
|
+
cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));
|
|
2034
|
+
jsAssets.push(...handleAssets(assetsInfo.assets.js.async));
|
|
2035
|
+
jsAssets.push(...handleAssets(assetsInfo.assets.js.sync));
|
|
2036
|
+
} else if (preloadConfig.resourceCategory === "sync") {
|
|
2037
|
+
cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));
|
|
2038
|
+
jsAssets.push(...handleAssets(assetsInfo.assets.js.sync));
|
|
2039
|
+
}
|
|
2040
|
+
setPreloaded(exposeFullPath);
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
}, true, {}, remoteSnapshot);
|
|
2044
|
+
if (remoteSnapshot.shared && remoteSnapshot.shared.length > 0) {
|
|
2045
|
+
const collectSharedAssets = (shareInfo, snapshotShared) => {
|
|
2046
|
+
const { shared: registeredShared } = getRegisteredShare(origin.shareScopeMap, snapshotShared.sharedName, shareInfo, origin.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
2047
|
+
if (registeredShared && typeof registeredShared.lib === "function") {
|
|
2048
|
+
snapshotShared.assets.js.sync.forEach((asset) => {
|
|
2049
|
+
loadedSharedJsAssets.add(asset);
|
|
2050
|
+
});
|
|
2051
|
+
snapshotShared.assets.css.sync.forEach((asset) => {
|
|
2052
|
+
loadedSharedCssAssets.add(asset);
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
remoteSnapshot.shared.forEach((shared) => {
|
|
2057
|
+
const shareInfos = options.shared?.[shared.sharedName];
|
|
2058
|
+
if (!shareInfos) return;
|
|
2059
|
+
const sharedOptions = shared.version ? shareInfos.find((s) => s.version === shared.version) : shareInfos;
|
|
2060
|
+
if (!sharedOptions) return;
|
|
2061
|
+
arrayOptions(sharedOptions).forEach((s) => {
|
|
2062
|
+
collectSharedAssets(s, shared);
|
|
2063
|
+
});
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
const needPreloadJsAssets = jsAssets.filter((asset) => !loadedSharedJsAssets.has(asset) && !isExisted("script", asset));
|
|
2067
|
+
return {
|
|
2068
|
+
cssAssets: cssAssets.filter((asset) => !loadedSharedCssAssets.has(asset) && !isExisted("link", asset)),
|
|
2069
|
+
jsAssetsWithoutEntry: needPreloadJsAssets,
|
|
2070
|
+
entryAssets: entryAssets.filter((entry) => !isExisted("script", entry.url))
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
var generatePreloadAssetsPlugin = function() {
|
|
2074
|
+
return {
|
|
2075
|
+
name: "generate-preload-assets-plugin",
|
|
2076
|
+
async generatePreloadAssets(args) {
|
|
2077
|
+
const { origin, preloadOptions, remoteInfo, remote, globalSnapshot, remoteSnapshot } = args;
|
|
2078
|
+
if (isRemoteInfoWithEntry(remote) && isPureRemoteEntry(remote)) return {
|
|
2079
|
+
cssAssets: [],
|
|
2080
|
+
jsAssetsWithoutEntry: [],
|
|
2081
|
+
entryAssets: [{
|
|
2082
|
+
name: remote.name,
|
|
2083
|
+
url: remote.entry,
|
|
2084
|
+
moduleInfo: {
|
|
2085
|
+
name: remoteInfo.name,
|
|
2086
|
+
entry: remote.entry,
|
|
2087
|
+
type: remoteInfo.type || "global",
|
|
2088
|
+
entryGlobalName: "",
|
|
2089
|
+
shareScope: ""
|
|
2090
|
+
}
|
|
2091
|
+
}]
|
|
2092
|
+
};
|
|
2093
|
+
assignRemoteInfo(remoteInfo, remoteSnapshot);
|
|
2094
|
+
return generatePreloadAssets(origin, preloadOptions, remoteInfo, globalSnapshot, remoteSnapshot);
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
2098
|
+
//#endregion
|
|
2099
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/SnapshotHandler.js
|
|
2100
|
+
function getGlobalRemoteInfo(moduleInfo, origin) {
|
|
2101
|
+
const hostGlobalSnapshot = getGlobalSnapshotInfoByModuleInfo({
|
|
2102
|
+
name: origin.name,
|
|
2103
|
+
version: origin.options.version
|
|
2104
|
+
});
|
|
2105
|
+
const globalRemoteInfo = hostGlobalSnapshot && "remotesInfo" in hostGlobalSnapshot && hostGlobalSnapshot.remotesInfo && getInfoWithoutType(hostGlobalSnapshot.remotesInfo, moduleInfo.name).value;
|
|
2106
|
+
if (globalRemoteInfo && globalRemoteInfo.matchedVersion) return {
|
|
2107
|
+
hostGlobalSnapshot,
|
|
2108
|
+
globalSnapshot: getGlobalSnapshot(),
|
|
2109
|
+
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
2110
|
+
name: moduleInfo.name,
|
|
2111
|
+
version: globalRemoteInfo.matchedVersion
|
|
2112
|
+
})
|
|
2113
|
+
};
|
|
2114
|
+
return {
|
|
2115
|
+
hostGlobalSnapshot: void 0,
|
|
2116
|
+
globalSnapshot: getGlobalSnapshot(),
|
|
2117
|
+
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
2118
|
+
name: moduleInfo.name,
|
|
2119
|
+
version: "version" in moduleInfo ? moduleInfo.version : void 0
|
|
2120
|
+
})
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
var SnapshotHandler = class {
|
|
2124
|
+
constructor(HostInstance) {
|
|
2125
|
+
this.loadingHostSnapshot = null;
|
|
2126
|
+
this.manifestCache = /* @__PURE__ */ new Map();
|
|
2127
|
+
this.hooks = new PluginSystem({
|
|
2128
|
+
beforeLoadRemoteSnapshot: new AsyncHook("beforeLoadRemoteSnapshot"),
|
|
2129
|
+
loadSnapshot: new AsyncWaterfallHook("loadGlobalSnapshot"),
|
|
2130
|
+
loadRemoteSnapshot: new AsyncWaterfallHook("loadRemoteSnapshot"),
|
|
2131
|
+
afterLoadSnapshot: new AsyncWaterfallHook("afterLoadSnapshot")
|
|
2132
|
+
});
|
|
2133
|
+
this.manifestLoading = Global.__FEDERATION__.__MANIFEST_LOADING__;
|
|
2134
|
+
this.HostInstance = HostInstance;
|
|
2135
|
+
this.loaderHook = HostInstance.loaderHook;
|
|
2136
|
+
}
|
|
2137
|
+
async loadRemoteSnapshotInfo({ moduleInfo, id, expose }) {
|
|
2138
|
+
const { options } = this.HostInstance;
|
|
2139
|
+
await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
|
|
2140
|
+
options,
|
|
2141
|
+
moduleInfo
|
|
2142
|
+
});
|
|
2143
|
+
let hostSnapshot = getGlobalSnapshotInfoByModuleInfo({
|
|
2144
|
+
name: this.HostInstance.options.name,
|
|
2145
|
+
version: this.HostInstance.options.version
|
|
2146
|
+
});
|
|
2147
|
+
if (!hostSnapshot) {
|
|
2148
|
+
hostSnapshot = {
|
|
2149
|
+
version: this.HostInstance.options.version || "",
|
|
2150
|
+
remoteEntry: "",
|
|
2151
|
+
remotesInfo: {}
|
|
2152
|
+
};
|
|
2153
|
+
addGlobalSnapshot({ [this.HostInstance.options.name]: hostSnapshot });
|
|
2154
|
+
}
|
|
2155
|
+
if (hostSnapshot && "remotesInfo" in hostSnapshot && !getInfoWithoutType(hostSnapshot.remotesInfo, moduleInfo.name).value) {
|
|
2156
|
+
if ("version" in moduleInfo || "entry" in moduleInfo) hostSnapshot.remotesInfo = {
|
|
2157
|
+
...hostSnapshot?.remotesInfo,
|
|
2158
|
+
[moduleInfo.name]: { matchedVersion: "version" in moduleInfo ? moduleInfo.version : moduleInfo.entry }
|
|
2159
|
+
};
|
|
2160
|
+
}
|
|
2161
|
+
const { hostGlobalSnapshot, remoteSnapshot, globalSnapshot } = this.getGlobalRemoteInfo(moduleInfo);
|
|
2162
|
+
const { remoteSnapshot: globalRemoteSnapshot, globalSnapshot: globalSnapshotRes } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
2163
|
+
options,
|
|
2164
|
+
moduleInfo,
|
|
2165
|
+
hostGlobalSnapshot,
|
|
2166
|
+
remoteSnapshot,
|
|
2167
|
+
globalSnapshot
|
|
2168
|
+
});
|
|
2169
|
+
let mSnapshot;
|
|
2170
|
+
let gSnapshot;
|
|
2171
|
+
if (globalRemoteSnapshot) if (isManifestProvider(globalRemoteSnapshot)) {
|
|
2172
|
+
const remoteEntry = globalRemoteSnapshot.remoteEntry;
|
|
2173
|
+
const moduleSnapshot = await this.getManifestJson(remoteEntry, moduleInfo, {});
|
|
2174
|
+
const globalSnapshotRes = setGlobalSnapshotInfoByModuleInfo({
|
|
2175
|
+
...moduleInfo,
|
|
2176
|
+
entry: remoteEntry
|
|
2177
|
+
}, moduleSnapshot);
|
|
2178
|
+
mSnapshot = moduleSnapshot;
|
|
2179
|
+
gSnapshot = globalSnapshotRes;
|
|
2180
|
+
} else {
|
|
2181
|
+
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2182
|
+
options: this.HostInstance.options,
|
|
2183
|
+
moduleInfo,
|
|
2184
|
+
remoteSnapshot: globalRemoteSnapshot,
|
|
2185
|
+
from: "global"
|
|
2186
|
+
});
|
|
2187
|
+
mSnapshot = remoteSnapshotRes;
|
|
2188
|
+
gSnapshot = globalSnapshotRes;
|
|
2189
|
+
}
|
|
2190
|
+
else if (isRemoteInfoWithEntry(moduleInfo)) {
|
|
2191
|
+
const moduleSnapshot = await this.getManifestJson(moduleInfo.entry, moduleInfo, {});
|
|
2192
|
+
const globalSnapshotRes = setGlobalSnapshotInfoByModuleInfo(moduleInfo, moduleSnapshot);
|
|
2193
|
+
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2194
|
+
options: this.HostInstance.options,
|
|
2195
|
+
moduleInfo,
|
|
2196
|
+
remoteSnapshot: moduleSnapshot,
|
|
2197
|
+
from: "global"
|
|
2198
|
+
});
|
|
2199
|
+
mSnapshot = remoteSnapshotRes;
|
|
2200
|
+
gSnapshot = globalSnapshotRes;
|
|
2201
|
+
} else error(RUNTIME_007, runtimeDescMap, {
|
|
2202
|
+
remoteName: moduleInfo.name,
|
|
2203
|
+
remoteVersion: moduleInfo.version,
|
|
2204
|
+
hostName: this.HostInstance.options.name,
|
|
2205
|
+
globalSnapshot: JSON.stringify(globalSnapshotRes)
|
|
2206
|
+
}, void 0, optionsToMFContext(this.HostInstance.options));
|
|
2207
|
+
await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
2208
|
+
id,
|
|
2209
|
+
host: this.HostInstance,
|
|
2210
|
+
options,
|
|
2211
|
+
moduleInfo,
|
|
2212
|
+
remoteSnapshot: mSnapshot
|
|
2213
|
+
});
|
|
2214
|
+
return {
|
|
2215
|
+
remoteSnapshot: mSnapshot,
|
|
2216
|
+
globalSnapshot: gSnapshot
|
|
2217
|
+
};
|
|
2218
|
+
}
|
|
2219
|
+
getGlobalRemoteInfo(moduleInfo) {
|
|
2220
|
+
return getGlobalRemoteInfo(moduleInfo, this.HostInstance);
|
|
2221
|
+
}
|
|
2222
|
+
async getManifestJson(manifestUrl, moduleInfo, extraOptions) {
|
|
2223
|
+
const getManifest = async () => {
|
|
2224
|
+
let manifestJson = this.manifestCache.get(manifestUrl);
|
|
2225
|
+
if (manifestJson) return manifestJson;
|
|
2226
|
+
try {
|
|
2227
|
+
let res = await this.loaderHook.lifecycle.fetch.emit(manifestUrl, {}, getRemoteInfo(moduleInfo));
|
|
2228
|
+
if (!res || !(res instanceof Response)) res = await fetch(manifestUrl, {});
|
|
2229
|
+
manifestJson = await res.json();
|
|
2230
|
+
} catch (err) {
|
|
2231
|
+
manifestJson = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2232
|
+
id: manifestUrl,
|
|
2233
|
+
error: err,
|
|
2234
|
+
from: "runtime",
|
|
2235
|
+
lifecycle: "afterResolve",
|
|
2236
|
+
origin: this.HostInstance
|
|
2237
|
+
});
|
|
2238
|
+
if (!manifestJson) {
|
|
2239
|
+
delete this.manifestLoading[manifestUrl];
|
|
2240
|
+
error(RUNTIME_003, runtimeDescMap, {
|
|
2241
|
+
manifestUrl,
|
|
2242
|
+
moduleName: moduleInfo.name,
|
|
2243
|
+
hostName: this.HostInstance.options.name
|
|
2244
|
+
}, `${err}`, optionsToMFContext(this.HostInstance.options));
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
assert(manifestJson.metaData && manifestJson.exposes && manifestJson.shared, `"${manifestUrl}" is not a valid federation manifest for remote "${moduleInfo.name}". Missing required fields: ${[
|
|
2248
|
+
!manifestJson.metaData && "metaData",
|
|
2249
|
+
!manifestJson.exposes && "exposes",
|
|
2250
|
+
!manifestJson.shared && "shared"
|
|
2251
|
+
].filter(Boolean).join(", ")}.`);
|
|
2252
|
+
this.manifestCache.set(manifestUrl, manifestJson);
|
|
2253
|
+
return manifestJson;
|
|
2254
|
+
};
|
|
2255
|
+
const asyncLoadProcess = async () => {
|
|
2256
|
+
const manifestJson = await getManifest();
|
|
2257
|
+
const remoteSnapshot = generateSnapshotFromManifest(manifestJson, { version: manifestUrl });
|
|
2258
|
+
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2259
|
+
options: this.HostInstance.options,
|
|
2260
|
+
moduleInfo,
|
|
2261
|
+
manifestJson,
|
|
2262
|
+
remoteSnapshot,
|
|
2263
|
+
manifestUrl,
|
|
2264
|
+
from: "manifest"
|
|
2265
|
+
});
|
|
2266
|
+
return remoteSnapshotRes;
|
|
2267
|
+
};
|
|
2268
|
+
if (!this.manifestLoading[manifestUrl]) this.manifestLoading[manifestUrl] = asyncLoadProcess().then((res) => res);
|
|
2269
|
+
return this.manifestLoading[manifestUrl];
|
|
2270
|
+
}
|
|
2271
|
+
};
|
|
2272
|
+
//#endregion
|
|
2273
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/shared/index.js
|
|
2274
|
+
var SharedHandler = class {
|
|
2275
|
+
constructor(host) {
|
|
2276
|
+
this.hooks = new PluginSystem({
|
|
2277
|
+
beforeRegisterShare: new SyncWaterfallHook("beforeRegisterShare"),
|
|
2278
|
+
afterResolve: new AsyncWaterfallHook("afterResolve"),
|
|
2279
|
+
beforeLoadShare: new AsyncWaterfallHook("beforeLoadShare"),
|
|
2280
|
+
loadShare: new AsyncHook(),
|
|
2281
|
+
resolveShare: new SyncWaterfallHook("resolveShare"),
|
|
2282
|
+
initContainerShareScopeMap: new SyncWaterfallHook("initContainerShareScopeMap")
|
|
2283
|
+
});
|
|
2284
|
+
this.host = host;
|
|
2285
|
+
this.shareScopeMap = {};
|
|
2286
|
+
this.initTokens = {};
|
|
2287
|
+
this._setGlobalShareScopeMap(host.options);
|
|
2288
|
+
}
|
|
2289
|
+
registerShared(globalOptions, userOptions) {
|
|
2290
|
+
const { newShareInfos, allShareInfos } = formatShareConfigs(globalOptions, userOptions);
|
|
2291
|
+
Object.keys(newShareInfos).forEach((sharedKey) => {
|
|
2292
|
+
newShareInfos[sharedKey].forEach((sharedVal) => {
|
|
2293
|
+
sharedVal.scope.forEach((sc) => {
|
|
2294
|
+
this.hooks.lifecycle.beforeRegisterShare.emit({
|
|
2295
|
+
origin: this.host,
|
|
2296
|
+
pkgName: sharedKey,
|
|
2297
|
+
shared: sharedVal
|
|
2298
|
+
});
|
|
2299
|
+
if (!this.shareScopeMap[sc]?.[sharedKey]) this.setShared({
|
|
2300
|
+
pkgName: sharedKey,
|
|
2301
|
+
lib: sharedVal.lib,
|
|
2302
|
+
get: sharedVal.get,
|
|
2303
|
+
loaded: sharedVal.loaded || Boolean(sharedVal.lib),
|
|
2304
|
+
shared: sharedVal,
|
|
2305
|
+
from: userOptions.name
|
|
2306
|
+
});
|
|
2307
|
+
});
|
|
2308
|
+
});
|
|
2309
|
+
});
|
|
2310
|
+
return {
|
|
2311
|
+
newShareInfos,
|
|
2312
|
+
allShareInfos
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
async loadShare(pkgName, extraOptions) {
|
|
2316
|
+
const { host } = this;
|
|
2317
|
+
const shareOptions = getTargetSharedOptions({
|
|
2318
|
+
pkgName,
|
|
2319
|
+
extraOptions,
|
|
2320
|
+
shareInfos: host.options.shared
|
|
2321
|
+
});
|
|
2322
|
+
if (shareOptions?.scope) await Promise.all(shareOptions.scope.map(async (shareScope) => {
|
|
2323
|
+
await Promise.all(this.initializeSharing(shareScope, { strategy: shareOptions.strategy }));
|
|
2324
|
+
}));
|
|
2325
|
+
const { shareInfo: shareOptionsRes } = await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
2326
|
+
pkgName,
|
|
2327
|
+
shareInfo: shareOptions,
|
|
2328
|
+
shared: host.options.shared,
|
|
2329
|
+
origin: host
|
|
2330
|
+
});
|
|
2331
|
+
assert(shareOptionsRes, `Cannot find shared "${pkgName}" in host "${host.options.name}". Ensure the shared config for "${pkgName}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
|
|
2332
|
+
const { shared: registeredShared, useTreesShaking } = getRegisteredShare(this.shareScopeMap, pkgName, shareOptionsRes, this.hooks.lifecycle.resolveShare) || {};
|
|
2333
|
+
if (registeredShared) {
|
|
2334
|
+
const targetShared = directShare(registeredShared, useTreesShaking);
|
|
2335
|
+
if (targetShared.lib) {
|
|
2336
|
+
addUseIn(targetShared, host.options.name);
|
|
2337
|
+
return targetShared.lib;
|
|
2338
|
+
} else if (targetShared.loading && !targetShared.loaded) {
|
|
2339
|
+
const factory = await targetShared.loading;
|
|
2340
|
+
targetShared.loaded = true;
|
|
2341
|
+
if (!targetShared.lib) targetShared.lib = factory;
|
|
2342
|
+
addUseIn(targetShared, host.options.name);
|
|
2343
|
+
return factory;
|
|
2344
|
+
} else {
|
|
2345
|
+
const asyncLoadProcess = async () => {
|
|
2346
|
+
const factory = await targetShared.get();
|
|
2347
|
+
addUseIn(targetShared, host.options.name);
|
|
2348
|
+
targetShared.loaded = true;
|
|
2349
|
+
targetShared.lib = factory;
|
|
2350
|
+
return factory;
|
|
2351
|
+
};
|
|
2352
|
+
const loading = asyncLoadProcess();
|
|
2353
|
+
this.setShared({
|
|
2354
|
+
pkgName,
|
|
2355
|
+
loaded: false,
|
|
2356
|
+
shared: registeredShared,
|
|
2357
|
+
from: host.options.name,
|
|
2358
|
+
lib: null,
|
|
2359
|
+
loading,
|
|
2360
|
+
treeShaking: useTreesShaking ? targetShared : void 0
|
|
2361
|
+
});
|
|
2362
|
+
return loading;
|
|
2363
|
+
}
|
|
2364
|
+
} else {
|
|
2365
|
+
if (extraOptions?.customShareInfo) return false;
|
|
2366
|
+
const _useTreeShaking = shouldUseTreeShaking(shareOptionsRes.treeShaking);
|
|
2367
|
+
const targetShared = directShare(shareOptionsRes, _useTreeShaking);
|
|
2368
|
+
const asyncLoadProcess = async () => {
|
|
2369
|
+
const factory = await targetShared.get();
|
|
2370
|
+
targetShared.lib = factory;
|
|
2371
|
+
targetShared.loaded = true;
|
|
2372
|
+
addUseIn(targetShared, host.options.name);
|
|
2373
|
+
const { shared: gShared, useTreesShaking: gUseTreeShaking } = getRegisteredShare(this.shareScopeMap, pkgName, shareOptionsRes, this.hooks.lifecycle.resolveShare) || {};
|
|
2374
|
+
if (gShared) {
|
|
2375
|
+
const targetGShared = directShare(gShared, gUseTreeShaking);
|
|
2376
|
+
targetGShared.lib = factory;
|
|
2377
|
+
targetGShared.loaded = true;
|
|
2378
|
+
gShared.from = shareOptionsRes.from;
|
|
2379
|
+
}
|
|
2380
|
+
return factory;
|
|
2381
|
+
};
|
|
2382
|
+
const loading = asyncLoadProcess();
|
|
2383
|
+
this.setShared({
|
|
2384
|
+
pkgName,
|
|
2385
|
+
loaded: false,
|
|
2386
|
+
shared: shareOptionsRes,
|
|
2387
|
+
from: host.options.name,
|
|
2388
|
+
lib: null,
|
|
2389
|
+
loading,
|
|
2390
|
+
treeShaking: _useTreeShaking ? targetShared : void 0
|
|
2391
|
+
});
|
|
2392
|
+
return loading;
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
/**
|
|
2396
|
+
* This function initializes the sharing sequence (executed only once per share scope).
|
|
2397
|
+
* It accepts one argument, the name of the share scope.
|
|
2398
|
+
* If the share scope does not exist, it creates one.
|
|
2399
|
+
*/
|
|
2400
|
+
initializeSharing(shareScopeName = DEFAULT_SCOPE, extraOptions) {
|
|
2401
|
+
const { host } = this;
|
|
2402
|
+
const from = extraOptions?.from;
|
|
2403
|
+
const strategy = extraOptions?.strategy;
|
|
2404
|
+
let initScope = extraOptions?.initScope;
|
|
2405
|
+
const promises = [];
|
|
2406
|
+
if (from !== "build") {
|
|
2407
|
+
const { initTokens } = this;
|
|
2408
|
+
if (!initScope) initScope = [];
|
|
2409
|
+
let initToken = initTokens[shareScopeName];
|
|
2410
|
+
if (!initToken) initToken = initTokens[shareScopeName] = { from: this.host.name };
|
|
2411
|
+
if (initScope.indexOf(initToken) >= 0) return promises;
|
|
2412
|
+
initScope.push(initToken);
|
|
2413
|
+
}
|
|
2414
|
+
const shareScope = this.shareScopeMap;
|
|
2415
|
+
const hostName = host.options.name;
|
|
2416
|
+
if (!shareScope[shareScopeName]) shareScope[shareScopeName] = {};
|
|
2417
|
+
const scope = shareScope[shareScopeName];
|
|
2418
|
+
const register = (name, shared) => {
|
|
2419
|
+
const { version, eager } = shared;
|
|
2420
|
+
scope[name] = scope[name] || {};
|
|
2421
|
+
const versions = scope[name];
|
|
2422
|
+
const activeVersion = versions[version] && directShare(versions[version]);
|
|
2423
|
+
const activeVersionEager = Boolean(activeVersion && ("eager" in activeVersion && activeVersion.eager || "shareConfig" in activeVersion && activeVersion.shareConfig?.eager));
|
|
2424
|
+
if (!activeVersion || activeVersion.strategy !== "loaded-first" && !activeVersion.loaded && (Boolean(!eager) !== !activeVersionEager ? eager : hostName > versions[version].from)) versions[version] = shared;
|
|
2425
|
+
};
|
|
2426
|
+
const initRemoteModule = async (key) => {
|
|
2427
|
+
const { module } = await host.remoteHandler.getRemoteModuleAndOptions({ id: key });
|
|
2428
|
+
let remoteEntryExports = void 0;
|
|
2429
|
+
try {
|
|
2430
|
+
remoteEntryExports = await module.getEntry();
|
|
2431
|
+
} catch (error) {
|
|
2432
|
+
remoteEntryExports = await host.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2433
|
+
id: key,
|
|
2434
|
+
error,
|
|
2435
|
+
from: "runtime",
|
|
2436
|
+
lifecycle: "beforeLoadShare",
|
|
2437
|
+
origin: host
|
|
2438
|
+
});
|
|
2439
|
+
if (!remoteEntryExports) return;
|
|
2440
|
+
} finally {
|
|
2441
|
+
if (remoteEntryExports?.init && !module.initing) {
|
|
2442
|
+
module.remoteEntryExports = remoteEntryExports;
|
|
2443
|
+
await module.init(void 0, void 0, initScope);
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
Object.keys(host.options.shared).forEach((shareName) => {
|
|
2448
|
+
host.options.shared[shareName].forEach((shared) => {
|
|
2449
|
+
if (shared.scope.includes(shareScopeName)) register(shareName, shared);
|
|
2450
|
+
});
|
|
2451
|
+
});
|
|
2452
|
+
if (host.options.shareStrategy === "version-first" || strategy === "version-first") host.options.remotes.forEach((remote) => {
|
|
2453
|
+
if (remote.shareScope === shareScopeName) promises.push(initRemoteModule(remote.name));
|
|
2454
|
+
});
|
|
2455
|
+
return promises;
|
|
2456
|
+
}
|
|
2457
|
+
loadShareSync(pkgName, extraOptions) {
|
|
2458
|
+
const { host } = this;
|
|
2459
|
+
const shareOptions = getTargetSharedOptions({
|
|
2460
|
+
pkgName,
|
|
2461
|
+
extraOptions,
|
|
2462
|
+
shareInfos: host.options.shared
|
|
2463
|
+
});
|
|
2464
|
+
if (shareOptions?.scope) shareOptions.scope.forEach((shareScope) => {
|
|
2465
|
+
this.initializeSharing(shareScope, { strategy: shareOptions.strategy });
|
|
2466
|
+
});
|
|
2467
|
+
const { shared: registeredShared, useTreesShaking } = getRegisteredShare(this.shareScopeMap, pkgName, shareOptions, this.hooks.lifecycle.resolveShare) || {};
|
|
2468
|
+
if (registeredShared) {
|
|
2469
|
+
if (typeof registeredShared.lib === "function") {
|
|
2470
|
+
addUseIn(registeredShared, host.options.name);
|
|
2471
|
+
if (!registeredShared.loaded) {
|
|
2472
|
+
registeredShared.loaded = true;
|
|
2473
|
+
if (registeredShared.from === host.options.name) shareOptions.loaded = true;
|
|
2474
|
+
}
|
|
2475
|
+
return registeredShared.lib;
|
|
2476
|
+
}
|
|
2477
|
+
if (typeof registeredShared.get === "function") {
|
|
2478
|
+
const module = registeredShared.get();
|
|
2479
|
+
if (!(module instanceof Promise)) {
|
|
2480
|
+
addUseIn(registeredShared, host.options.name);
|
|
2481
|
+
this.setShared({
|
|
2482
|
+
pkgName,
|
|
2483
|
+
loaded: true,
|
|
2484
|
+
from: host.options.name,
|
|
2485
|
+
lib: module,
|
|
2486
|
+
shared: registeredShared
|
|
2487
|
+
});
|
|
2488
|
+
return module;
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
if (shareOptions.lib) {
|
|
2493
|
+
if (!shareOptions.loaded) shareOptions.loaded = true;
|
|
2494
|
+
return shareOptions.lib;
|
|
2495
|
+
}
|
|
2496
|
+
if (shareOptions.get) {
|
|
2497
|
+
const module = shareOptions.get();
|
|
2498
|
+
if (module instanceof Promise) error(extraOptions?.from === "build" ? RUNTIME_005 : RUNTIME_006, runtimeDescMap, {
|
|
2499
|
+
hostName: host.options.name,
|
|
2500
|
+
sharedPkgName: pkgName
|
|
2501
|
+
}, void 0, optionsToMFContext(host.options));
|
|
2502
|
+
shareOptions.lib = module;
|
|
2503
|
+
this.setShared({
|
|
2504
|
+
pkgName,
|
|
2505
|
+
loaded: true,
|
|
2506
|
+
from: host.options.name,
|
|
2507
|
+
lib: shareOptions.lib,
|
|
2508
|
+
shared: shareOptions
|
|
2509
|
+
});
|
|
2510
|
+
return shareOptions.lib;
|
|
2511
|
+
}
|
|
2512
|
+
error(RUNTIME_006, runtimeDescMap, {
|
|
2513
|
+
hostName: host.options.name,
|
|
2514
|
+
sharedPkgName: pkgName
|
|
2515
|
+
}, void 0, optionsToMFContext(host.options));
|
|
2516
|
+
}
|
|
2517
|
+
initShareScopeMap(scopeName, shareScope, extraOptions = {}) {
|
|
2518
|
+
const { host } = this;
|
|
2519
|
+
this.shareScopeMap[scopeName] = shareScope;
|
|
2520
|
+
this.hooks.lifecycle.initContainerShareScopeMap.emit({
|
|
2521
|
+
shareScope,
|
|
2522
|
+
options: host.options,
|
|
2523
|
+
origin: host,
|
|
2524
|
+
scopeName,
|
|
2525
|
+
hostShareScopeMap: extraOptions.hostShareScopeMap
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2528
|
+
setShared({ pkgName, shared, from, lib, loading, loaded, get, treeShaking }) {
|
|
2529
|
+
const { version, scope = "default", ...shareInfo } = shared;
|
|
2530
|
+
const scopes = Array.isArray(scope) ? scope : [scope];
|
|
2531
|
+
const mergeAttrs = (shared) => {
|
|
2532
|
+
const merge = (s, key, val) => {
|
|
2533
|
+
if (val && !s[key]) s[key] = val;
|
|
2534
|
+
};
|
|
2535
|
+
const targetShared = treeShaking ? shared.treeShaking : shared;
|
|
2536
|
+
merge(targetShared, "loaded", loaded);
|
|
2537
|
+
merge(targetShared, "loading", loading);
|
|
2538
|
+
merge(targetShared, "get", get);
|
|
2539
|
+
};
|
|
2540
|
+
scopes.forEach((sc) => {
|
|
2541
|
+
if (!this.shareScopeMap[sc]) this.shareScopeMap[sc] = {};
|
|
2542
|
+
if (!this.shareScopeMap[sc][pkgName]) this.shareScopeMap[sc][pkgName] = {};
|
|
2543
|
+
if (!this.shareScopeMap[sc][pkgName][version]) this.shareScopeMap[sc][pkgName][version] = {
|
|
2544
|
+
version,
|
|
2545
|
+
scope: [sc],
|
|
2546
|
+
...shareInfo,
|
|
2547
|
+
lib
|
|
2548
|
+
};
|
|
2549
|
+
const registeredShared = this.shareScopeMap[sc][pkgName][version];
|
|
2550
|
+
mergeAttrs(registeredShared);
|
|
2551
|
+
if (from && registeredShared.from !== from) registeredShared.from = from;
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2554
|
+
_setGlobalShareScopeMap(hostOptions) {
|
|
2555
|
+
const globalShareScopeMap = getGlobalShareScope();
|
|
2556
|
+
const identifier = hostOptions.id || hostOptions.name;
|
|
2557
|
+
if (identifier && !globalShareScopeMap[identifier]) globalShareScopeMap[identifier] = this.shareScopeMap;
|
|
2558
|
+
}
|
|
2559
|
+
};
|
|
2560
|
+
//#endregion
|
|
2561
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/remote/index.js
|
|
2562
|
+
var RemoteHandler = class {
|
|
2563
|
+
constructor(host) {
|
|
2564
|
+
this.hooks = new PluginSystem({
|
|
2565
|
+
beforeRegisterRemote: new SyncWaterfallHook("beforeRegisterRemote"),
|
|
2566
|
+
registerRemote: new SyncWaterfallHook("registerRemote"),
|
|
2567
|
+
beforeRequest: new AsyncWaterfallHook("beforeRequest"),
|
|
2568
|
+
onLoad: new AsyncHook("onLoad"),
|
|
2569
|
+
handlePreloadModule: new SyncHook("handlePreloadModule"),
|
|
2570
|
+
errorLoadRemote: new AsyncHook("errorLoadRemote"),
|
|
2571
|
+
beforePreloadRemote: new AsyncHook("beforePreloadRemote"),
|
|
2572
|
+
generatePreloadAssets: new AsyncHook("generatePreloadAssets"),
|
|
2573
|
+
afterPreloadRemote: new AsyncHook(),
|
|
2574
|
+
loadEntry: new AsyncHook()
|
|
2575
|
+
});
|
|
2576
|
+
this.host = host;
|
|
2577
|
+
this.idToRemoteMap = {};
|
|
2578
|
+
}
|
|
2579
|
+
formatAndRegisterRemote(globalOptions, userOptions) {
|
|
2580
|
+
return (userOptions.remotes || []).reduce((res, remote) => {
|
|
2581
|
+
this.registerRemote(remote, res, { force: false });
|
|
2582
|
+
return res;
|
|
2583
|
+
}, globalOptions.remotes);
|
|
2584
|
+
}
|
|
2585
|
+
setIdToRemoteMap(id, remoteMatchInfo) {
|
|
2586
|
+
const { remote, expose } = remoteMatchInfo;
|
|
2587
|
+
const { name, alias } = remote;
|
|
2588
|
+
this.idToRemoteMap[id] = {
|
|
2589
|
+
name: remote.name,
|
|
2590
|
+
expose
|
|
2591
|
+
};
|
|
2592
|
+
if (alias && id.startsWith(name)) {
|
|
2593
|
+
const idWithAlias = id.replace(name, alias);
|
|
2594
|
+
this.idToRemoteMap[idWithAlias] = {
|
|
2595
|
+
name: remote.name,
|
|
2596
|
+
expose
|
|
2597
|
+
};
|
|
2598
|
+
return;
|
|
2599
|
+
}
|
|
2600
|
+
if (alias && id.startsWith(alias)) {
|
|
2601
|
+
const idWithName = id.replace(alias, name);
|
|
2602
|
+
this.idToRemoteMap[idWithName] = {
|
|
2603
|
+
name: remote.name,
|
|
2604
|
+
expose
|
|
2605
|
+
};
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
async loadRemote(id, options) {
|
|
2609
|
+
const { host } = this;
|
|
2610
|
+
try {
|
|
2611
|
+
const { loadFactory = true } = options || { loadFactory: true };
|
|
2612
|
+
const { module, moduleOptions, remoteMatchInfo } = await this.getRemoteModuleAndOptions({ id });
|
|
2613
|
+
const { pkgNameOrAlias, remote, expose, id: idRes, remoteSnapshot } = remoteMatchInfo;
|
|
2614
|
+
const moduleOrFactory = await module.get(idRes, expose, options, remoteSnapshot);
|
|
2615
|
+
const moduleWrapper = await this.hooks.lifecycle.onLoad.emit({
|
|
2616
|
+
id: idRes,
|
|
2617
|
+
pkgNameOrAlias,
|
|
2618
|
+
expose,
|
|
2619
|
+
exposeModule: loadFactory ? moduleOrFactory : void 0,
|
|
2620
|
+
exposeModuleFactory: loadFactory ? void 0 : moduleOrFactory,
|
|
2621
|
+
remote,
|
|
2622
|
+
options: moduleOptions,
|
|
2623
|
+
moduleInstance: module,
|
|
2624
|
+
origin: host
|
|
2625
|
+
});
|
|
2626
|
+
this.setIdToRemoteMap(id, remoteMatchInfo);
|
|
2627
|
+
if (typeof moduleWrapper === "function") return moduleWrapper;
|
|
2628
|
+
return moduleOrFactory;
|
|
2629
|
+
} catch (error) {
|
|
2630
|
+
const { from = "runtime" } = options || { from: "runtime" };
|
|
2631
|
+
const failOver = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2632
|
+
id,
|
|
2633
|
+
error,
|
|
2634
|
+
from,
|
|
2635
|
+
lifecycle: "onLoad",
|
|
2636
|
+
origin: host
|
|
2637
|
+
});
|
|
2638
|
+
if (!failOver) throw error;
|
|
2639
|
+
return failOver;
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
async preloadRemote(preloadOptions) {
|
|
2643
|
+
const { host } = this;
|
|
2644
|
+
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
2645
|
+
preloadOps: preloadOptions,
|
|
2646
|
+
options: host.options,
|
|
2647
|
+
origin: host
|
|
2648
|
+
});
|
|
2649
|
+
const preloadOps = formatPreloadArgs(host.options.remotes, preloadOptions);
|
|
2650
|
+
await Promise.all(preloadOps.map(async (ops) => {
|
|
2651
|
+
const { remote } = ops;
|
|
2652
|
+
const remoteInfo = getRemoteInfo(remote);
|
|
2653
|
+
const { globalSnapshot, remoteSnapshot } = await host.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: remote });
|
|
2654
|
+
const assets = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2655
|
+
origin: host,
|
|
2656
|
+
preloadOptions: ops,
|
|
2657
|
+
remote,
|
|
2658
|
+
remoteInfo,
|
|
2659
|
+
globalSnapshot,
|
|
2660
|
+
remoteSnapshot
|
|
2661
|
+
});
|
|
2662
|
+
if (!assets) return;
|
|
2663
|
+
preloadAssets(remoteInfo, host, assets);
|
|
2664
|
+
}));
|
|
2665
|
+
}
|
|
2666
|
+
registerRemotes(remotes, options) {
|
|
2667
|
+
const { host } = this;
|
|
2668
|
+
remotes.forEach((remote) => {
|
|
2669
|
+
this.registerRemote(remote, host.options.remotes, { force: options?.force });
|
|
2670
|
+
});
|
|
2671
|
+
}
|
|
2672
|
+
async getRemoteModuleAndOptions(options) {
|
|
2673
|
+
const { host } = this;
|
|
2674
|
+
const { id } = options;
|
|
2675
|
+
let loadRemoteArgs;
|
|
2676
|
+
try {
|
|
2677
|
+
loadRemoteArgs = await this.hooks.lifecycle.beforeRequest.emit({
|
|
2678
|
+
id,
|
|
2679
|
+
options: host.options,
|
|
2680
|
+
origin: host
|
|
2681
|
+
});
|
|
2682
|
+
} catch (error) {
|
|
2683
|
+
loadRemoteArgs = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2684
|
+
id,
|
|
2685
|
+
options: host.options,
|
|
2686
|
+
origin: host,
|
|
2687
|
+
from: "runtime",
|
|
2688
|
+
error,
|
|
2689
|
+
lifecycle: "beforeRequest"
|
|
2690
|
+
});
|
|
2691
|
+
if (!loadRemoteArgs) throw error;
|
|
2692
|
+
}
|
|
2693
|
+
const { id: idRes } = loadRemoteArgs;
|
|
2694
|
+
const remoteSplitInfo = matchRemoteWithNameAndExpose(host.options.remotes, idRes);
|
|
2695
|
+
if (!remoteSplitInfo) error(RUNTIME_004, runtimeDescMap, {
|
|
2696
|
+
hostName: host.options.name,
|
|
2697
|
+
requestId: idRes
|
|
2698
|
+
}, void 0, optionsToMFContext(host.options));
|
|
2699
|
+
const { remote: rawRemote } = remoteSplitInfo;
|
|
2700
|
+
const remoteInfo = getRemoteInfo(rawRemote);
|
|
2701
|
+
const matchInfo = await host.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
2702
|
+
id: idRes,
|
|
2703
|
+
...remoteSplitInfo,
|
|
2704
|
+
options: host.options,
|
|
2705
|
+
origin: host,
|
|
2706
|
+
remoteInfo
|
|
2707
|
+
});
|
|
2708
|
+
const { remote, expose } = matchInfo;
|
|
2709
|
+
assert(remote && expose, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${idRes}.`);
|
|
2710
|
+
let module = host.moduleCache.get(remote.name);
|
|
2711
|
+
const moduleOptions = {
|
|
2712
|
+
host,
|
|
2713
|
+
remoteInfo
|
|
2714
|
+
};
|
|
2715
|
+
if (!module) {
|
|
2716
|
+
module = new Module$1(moduleOptions);
|
|
2717
|
+
host.moduleCache.set(remote.name, module);
|
|
2718
|
+
}
|
|
2719
|
+
return {
|
|
2720
|
+
module,
|
|
2721
|
+
moduleOptions,
|
|
2722
|
+
remoteMatchInfo: matchInfo
|
|
2723
|
+
};
|
|
2724
|
+
}
|
|
2725
|
+
registerRemote(remote, targetRemotes, options) {
|
|
2726
|
+
const { host } = this;
|
|
2727
|
+
const normalizeRemote = () => {
|
|
2728
|
+
if (remote.alias) {
|
|
2729
|
+
const findEqual = targetRemotes.find((item) => remote.alias && (item.name.startsWith(remote.alias) || item.alias?.startsWith(remote.alias)));
|
|
2730
|
+
assert(!findEqual, `The alias ${remote.alias} of remote ${remote.name} is not allowed to be the prefix of ${findEqual && findEqual.name} name or alias`);
|
|
2731
|
+
}
|
|
2732
|
+
if ("entry" in remote) {
|
|
2733
|
+
if (typeof window !== "undefined" && !remote.entry.startsWith("http")) remote.entry = new URL(remote.entry, window.location.origin).href;
|
|
2734
|
+
}
|
|
2735
|
+
if (!remote.shareScope) remote.shareScope = DEFAULT_SCOPE;
|
|
2736
|
+
if (!remote.type) remote.type = DEFAULT_REMOTE_TYPE;
|
|
2737
|
+
};
|
|
2738
|
+
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2739
|
+
remote,
|
|
2740
|
+
origin: host
|
|
2741
|
+
});
|
|
2742
|
+
const registeredRemote = targetRemotes.find((item) => item.name === remote.name);
|
|
2743
|
+
if (!registeredRemote) {
|
|
2744
|
+
normalizeRemote();
|
|
2745
|
+
targetRemotes.push(remote);
|
|
2746
|
+
this.hooks.lifecycle.registerRemote.emit({
|
|
2747
|
+
remote,
|
|
2748
|
+
origin: host
|
|
2749
|
+
});
|
|
2750
|
+
} else {
|
|
2751
|
+
const messages = [`The remote "${remote.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
|
|
2752
|
+
if (options?.force) {
|
|
2753
|
+
this.removeRemote(registeredRemote);
|
|
2754
|
+
normalizeRemote();
|
|
2755
|
+
targetRemotes.push(remote);
|
|
2756
|
+
this.hooks.lifecycle.registerRemote.emit({
|
|
2757
|
+
remote,
|
|
2758
|
+
origin: host
|
|
2759
|
+
});
|
|
2760
|
+
warn(messages.join(" "));
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
removeRemote(remote) {
|
|
2765
|
+
try {
|
|
2766
|
+
const { host } = this;
|
|
2767
|
+
const { name } = remote;
|
|
2768
|
+
const remoteIndex = host.options.remotes.findIndex((item) => item.name === name);
|
|
2769
|
+
if (remoteIndex !== -1) host.options.remotes.splice(remoteIndex, 1);
|
|
2770
|
+
const loadedModule = host.moduleCache.get(remote.name);
|
|
2771
|
+
if (loadedModule) {
|
|
2772
|
+
const remoteInfo = loadedModule.remoteInfo;
|
|
2773
|
+
const key = remoteInfo.entryGlobalName;
|
|
2774
|
+
if (CurrentGlobal[key]) if (Object.getOwnPropertyDescriptor(CurrentGlobal, key)?.configurable) delete CurrentGlobal[key];
|
|
2775
|
+
else CurrentGlobal[key] = void 0;
|
|
2776
|
+
const remoteEntryUniqueKey = getRemoteEntryUniqueKey(loadedModule.remoteInfo);
|
|
2777
|
+
if (globalLoading[remoteEntryUniqueKey]) delete globalLoading[remoteEntryUniqueKey];
|
|
2778
|
+
host.snapshotHandler.manifestCache.delete(remoteInfo.entry);
|
|
2779
|
+
let remoteInsId = remoteInfo.buildVersion ? composeKeyWithSeparator(remoteInfo.name, remoteInfo.buildVersion) : remoteInfo.name;
|
|
2780
|
+
const remoteInsIndex = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((ins) => {
|
|
2781
|
+
if (remoteInfo.buildVersion) return ins.options.id === remoteInsId;
|
|
2782
|
+
else return ins.name === remoteInsId;
|
|
2783
|
+
});
|
|
2784
|
+
if (remoteInsIndex !== -1) {
|
|
2785
|
+
const remoteIns = CurrentGlobal.__FEDERATION__.__INSTANCES__[remoteInsIndex];
|
|
2786
|
+
remoteInsId = remoteIns.options.id || remoteInsId;
|
|
2787
|
+
const globalShareScopeMap = getGlobalShareScope();
|
|
2788
|
+
let isAllSharedNotUsed = true;
|
|
2789
|
+
const needDeleteKeys = [];
|
|
2790
|
+
Object.keys(globalShareScopeMap).forEach((instId) => {
|
|
2791
|
+
const shareScopeMap = globalShareScopeMap[instId];
|
|
2792
|
+
shareScopeMap && Object.keys(shareScopeMap).forEach((shareScope) => {
|
|
2793
|
+
const shareScopeVal = shareScopeMap[shareScope];
|
|
2794
|
+
shareScopeVal && Object.keys(shareScopeVal).forEach((shareName) => {
|
|
2795
|
+
const sharedPkgs = shareScopeVal[shareName];
|
|
2796
|
+
sharedPkgs && Object.keys(sharedPkgs).forEach((shareVersion) => {
|
|
2797
|
+
const shared = sharedPkgs[shareVersion];
|
|
2798
|
+
if (shared && typeof shared === "object" && shared.from === remoteInfo.name) if (shared.loaded || shared.loading) {
|
|
2799
|
+
shared.useIn = shared.useIn.filter((usedHostName) => usedHostName !== remoteInfo.name);
|
|
2800
|
+
if (shared.useIn.length) isAllSharedNotUsed = false;
|
|
2801
|
+
else needDeleteKeys.push([
|
|
2802
|
+
instId,
|
|
2803
|
+
shareScope,
|
|
2804
|
+
shareName,
|
|
2805
|
+
shareVersion
|
|
2806
|
+
]);
|
|
2807
|
+
} else needDeleteKeys.push([
|
|
2808
|
+
instId,
|
|
2809
|
+
shareScope,
|
|
2810
|
+
shareName,
|
|
2811
|
+
shareVersion
|
|
2812
|
+
]);
|
|
2813
|
+
});
|
|
2814
|
+
});
|
|
2815
|
+
});
|
|
2816
|
+
});
|
|
2817
|
+
if (isAllSharedNotUsed) {
|
|
2818
|
+
remoteIns.shareScopeMap = {};
|
|
2819
|
+
delete globalShareScopeMap[remoteInsId];
|
|
2820
|
+
}
|
|
2821
|
+
needDeleteKeys.forEach(([insId, shareScope, shareName, shareVersion]) => {
|
|
2822
|
+
delete globalShareScopeMap[insId]?.[shareScope]?.[shareName]?.[shareVersion];
|
|
2823
|
+
});
|
|
2824
|
+
CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(remoteInsIndex, 1);
|
|
2825
|
+
}
|
|
2826
|
+
const { hostGlobalSnapshot } = getGlobalRemoteInfo(remote, host);
|
|
2827
|
+
if (hostGlobalSnapshot) {
|
|
2828
|
+
const remoteKey = hostGlobalSnapshot && "remotesInfo" in hostGlobalSnapshot && hostGlobalSnapshot.remotesInfo && getInfoWithoutType(hostGlobalSnapshot.remotesInfo, remote.name).key;
|
|
2829
|
+
if (remoteKey) {
|
|
2830
|
+
delete hostGlobalSnapshot.remotesInfo[remoteKey];
|
|
2831
|
+
if (Boolean(Global.__FEDERATION__.__MANIFEST_LOADING__[remoteKey])) delete Global.__FEDERATION__.__MANIFEST_LOADING__[remoteKey];
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
host.moduleCache.delete(remote.name);
|
|
2835
|
+
}
|
|
2836
|
+
} catch (err) {
|
|
2837
|
+
logger.error(`removeRemote failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
};
|
|
2841
|
+
//#endregion
|
|
2842
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime-core/dist/core.js
|
|
2843
|
+
var USE_SNAPSHOT = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN === "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;
|
|
2844
|
+
var ModuleFederation = class {
|
|
2845
|
+
constructor(userOptions) {
|
|
2846
|
+
this.hooks = new PluginSystem({
|
|
2847
|
+
beforeInit: new SyncWaterfallHook("beforeInit"),
|
|
2848
|
+
init: new SyncHook(),
|
|
2849
|
+
beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
|
|
2850
|
+
initContainer: new AsyncWaterfallHook("initContainer")
|
|
2851
|
+
});
|
|
2852
|
+
this.version = "2.4.0";
|
|
2853
|
+
this.moduleCache = /* @__PURE__ */ new Map();
|
|
2854
|
+
this.loaderHook = new PluginSystem({
|
|
2855
|
+
getModuleInfo: new SyncHook(),
|
|
2856
|
+
createScript: new SyncHook(),
|
|
2857
|
+
createLink: new SyncHook(),
|
|
2858
|
+
fetch: new AsyncHook(),
|
|
2859
|
+
loadEntryError: new AsyncHook(),
|
|
2860
|
+
getModuleFactory: new AsyncHook()
|
|
2861
|
+
});
|
|
2862
|
+
this.bridgeHook = new PluginSystem({
|
|
2863
|
+
beforeBridgeRender: new SyncHook(),
|
|
2864
|
+
afterBridgeRender: new SyncHook(),
|
|
2865
|
+
beforeBridgeDestroy: new SyncHook(),
|
|
2866
|
+
afterBridgeDestroy: new SyncHook()
|
|
2867
|
+
});
|
|
2868
|
+
const plugins = USE_SNAPSHOT ? [snapshotPlugin(), generatePreloadAssetsPlugin()] : [];
|
|
2869
|
+
const defaultOptions = {
|
|
2870
|
+
id: getBuilderId$1(),
|
|
2871
|
+
name: userOptions.name,
|
|
2872
|
+
plugins,
|
|
2873
|
+
remotes: [],
|
|
2874
|
+
shared: {},
|
|
2875
|
+
inBrowser: true
|
|
2876
|
+
};
|
|
2877
|
+
this.name = userOptions.name;
|
|
2878
|
+
this.options = defaultOptions;
|
|
2879
|
+
this.snapshotHandler = new SnapshotHandler(this);
|
|
2880
|
+
this.sharedHandler = new SharedHandler(this);
|
|
2881
|
+
this.remoteHandler = new RemoteHandler(this);
|
|
2882
|
+
this.shareScopeMap = this.sharedHandler.shareScopeMap;
|
|
2883
|
+
this.registerPlugins([...defaultOptions.plugins, ...userOptions.plugins || []]);
|
|
2884
|
+
this.options = this.formatOptions(defaultOptions, userOptions);
|
|
2885
|
+
}
|
|
2886
|
+
initOptions(userOptions) {
|
|
2887
|
+
if (userOptions.name && userOptions.name !== this.options.name) error(getShortErrorMsg(RUNTIME_010, runtimeDescMap));
|
|
2888
|
+
this.registerPlugins(userOptions.plugins);
|
|
2889
|
+
const options = this.formatOptions(this.options, userOptions);
|
|
2890
|
+
this.options = options;
|
|
2891
|
+
return options;
|
|
2892
|
+
}
|
|
2893
|
+
async loadShare(pkgName, extraOptions) {
|
|
2894
|
+
return this.sharedHandler.loadShare(pkgName, extraOptions);
|
|
2895
|
+
}
|
|
2896
|
+
loadShareSync(pkgName, extraOptions) {
|
|
2897
|
+
return this.sharedHandler.loadShareSync(pkgName, extraOptions);
|
|
2898
|
+
}
|
|
2899
|
+
initializeSharing(shareScopeName = DEFAULT_SCOPE, extraOptions) {
|
|
2900
|
+
return this.sharedHandler.initializeSharing(shareScopeName, extraOptions);
|
|
2901
|
+
}
|
|
2902
|
+
initRawContainer(name, url, container) {
|
|
2903
|
+
const remoteInfo = getRemoteInfo({
|
|
2904
|
+
name,
|
|
2905
|
+
entry: url
|
|
2906
|
+
});
|
|
2907
|
+
const module = new Module$1({
|
|
2908
|
+
host: this,
|
|
2909
|
+
remoteInfo
|
|
2910
|
+
});
|
|
2911
|
+
module.remoteEntryExports = container;
|
|
2912
|
+
this.moduleCache.set(name, module);
|
|
2913
|
+
return module;
|
|
2914
|
+
}
|
|
2915
|
+
async loadRemote(id, options) {
|
|
2916
|
+
return this.remoteHandler.loadRemote(id, options);
|
|
2917
|
+
}
|
|
2918
|
+
async preloadRemote(preloadOptions) {
|
|
2919
|
+
return this.remoteHandler.preloadRemote(preloadOptions);
|
|
2920
|
+
}
|
|
2921
|
+
initShareScopeMap(scopeName, shareScope, extraOptions = {}) {
|
|
2922
|
+
this.sharedHandler.initShareScopeMap(scopeName, shareScope, extraOptions);
|
|
2923
|
+
}
|
|
2924
|
+
formatOptions(globalOptions, userOptions) {
|
|
2925
|
+
const { allShareInfos: shared } = formatShareConfigs(globalOptions, userOptions);
|
|
2926
|
+
const { userOptions: userOptionsRes, options: globalOptionsRes } = this.hooks.lifecycle.beforeInit.emit({
|
|
2927
|
+
origin: this,
|
|
2928
|
+
userOptions,
|
|
2929
|
+
options: globalOptions,
|
|
2930
|
+
shareInfo: shared
|
|
2931
|
+
});
|
|
2932
|
+
const remotes = this.remoteHandler.formatAndRegisterRemote(globalOptionsRes, userOptionsRes);
|
|
2933
|
+
const { allShareInfos } = this.sharedHandler.registerShared(globalOptionsRes, userOptionsRes);
|
|
2934
|
+
const plugins = [...globalOptionsRes.plugins];
|
|
2935
|
+
if (userOptionsRes.plugins) userOptionsRes.plugins.forEach((plugin) => {
|
|
2936
|
+
if (!plugins.includes(plugin)) plugins.push(plugin);
|
|
2937
|
+
});
|
|
2938
|
+
const optionsRes = {
|
|
2939
|
+
...globalOptions,
|
|
2940
|
+
...userOptions,
|
|
2941
|
+
plugins,
|
|
2942
|
+
remotes,
|
|
2943
|
+
shared: allShareInfos,
|
|
2944
|
+
id: userOptionsRes.id || globalOptions.id
|
|
2945
|
+
};
|
|
2946
|
+
this.hooks.lifecycle.init.emit({
|
|
2947
|
+
origin: this,
|
|
2948
|
+
options: optionsRes
|
|
2949
|
+
});
|
|
2950
|
+
return optionsRes;
|
|
2951
|
+
}
|
|
2952
|
+
registerPlugins(plugins) {
|
|
2953
|
+
const pluginRes = registerPlugins(plugins, this);
|
|
2954
|
+
this.options.plugins = this.options.plugins.reduce((res, plugin) => {
|
|
2955
|
+
if (!plugin) return res;
|
|
2956
|
+
if (res && !res.find((item) => item.name === plugin.name)) res.push(plugin);
|
|
2957
|
+
return res;
|
|
2958
|
+
}, pluginRes || []);
|
|
2959
|
+
}
|
|
2960
|
+
registerRemotes(remotes, options) {
|
|
2961
|
+
return this.remoteHandler.registerRemotes(remotes, options);
|
|
2962
|
+
}
|
|
2963
|
+
registerShared(shared) {
|
|
2964
|
+
this.sharedHandler.registerShared(this.options, {
|
|
2965
|
+
...this.options,
|
|
2966
|
+
shared
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
};
|
|
2970
|
+
//#endregion
|
|
2971
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime/dist/utils.js
|
|
2972
|
+
function getBuilderId() {
|
|
2973
|
+
return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
2974
|
+
}
|
|
2975
|
+
function getGlobalFederationInstance(name, version) {
|
|
2976
|
+
const buildId = getBuilderId();
|
|
2977
|
+
return CurrentGlobal.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
|
|
2978
|
+
if (buildId && GMInstance.options.id === buildId) return true;
|
|
2979
|
+
if (GMInstance.options.name === name && !GMInstance.options.version && !version) return true;
|
|
2980
|
+
if (GMInstance.options.name === name && version && GMInstance.options.version === version) return true;
|
|
2981
|
+
return false;
|
|
2982
|
+
});
|
|
2983
|
+
}
|
|
2984
|
+
//#endregion
|
|
2985
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime@2.4.0_node-fetch@2.7.0/node_modules/@module-federation/runtime/dist/index.js
|
|
2986
|
+
function createInstance(options) {
|
|
2987
|
+
const instance = new ((getGlobalFederationConstructor()) || ModuleFederation)({
|
|
2988
|
+
id: `${options.name}@${options.version || Date.now()}`,
|
|
2989
|
+
...options
|
|
2990
|
+
});
|
|
2991
|
+
setGlobalFederationInstance(instance);
|
|
2992
|
+
return instance;
|
|
2993
|
+
}
|
|
2994
|
+
var FederationInstance = null;
|
|
2995
|
+
/**
|
|
2996
|
+
* @deprecated Use createInstance or getInstance instead
|
|
2997
|
+
*/
|
|
2998
|
+
function init(options) {
|
|
2999
|
+
const instance = getGlobalFederationInstance(options.name, options.version);
|
|
3000
|
+
const normalizedOptions = {
|
|
3001
|
+
...options,
|
|
3002
|
+
id: options.id || ""
|
|
3003
|
+
};
|
|
3004
|
+
if (!instance) {
|
|
3005
|
+
FederationInstance = createInstance(normalizedOptions);
|
|
3006
|
+
return FederationInstance;
|
|
3007
|
+
} else {
|
|
3008
|
+
instance.initOptions(normalizedOptions);
|
|
3009
|
+
if (!FederationInstance) FederationInstance = instance;
|
|
3010
|
+
return instance;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
setGlobalFederationConstructor(ModuleFederation);
|
|
3014
|
+
//#endregion
|
|
3015
|
+
export { init as t };
|
|
3016
|
+
|
|
3017
|
+
//# sourceMappingURL=dist-CEUHjZe8.js.map
|