@baseplate-dev/plugin-auth 1.0.6 → 1.0.8
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 +970 -0
- package/LICENSE +114 -123
- package/README.md +3 -3
- package/dist/auth/core/common.d.ts +2 -5
- package/dist/auth/core/common.js +15 -19
- package/dist/auth/core/components/auth-definition-editor.js +51 -30
- package/dist/auth/core/components/role-editor-form/role-dialog.d.ts +12 -0
- package/dist/auth/core/components/role-editor-form/role-dialog.js +29 -0
- package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts +10 -0
- package/dist/auth/core/components/role-editor-form/role-editor-form.js +54 -0
- package/dist/auth/core/node.d.ts +3 -3
- package/dist/auth/core/node.js +29 -40
- package/dist/auth/core/schema/migrations.d.ts +3 -0
- package/dist/auth/core/schema/migrations.js +54 -0
- package/dist/auth/core/schema/plugin-definition.d.ts +11 -74
- package/dist/auth/core/schema/plugin-definition.js +9 -20
- package/dist/auth/core/schema/roles/constants.js +34 -0
- package/dist/auth/core/schema/roles/index.d.ts +3 -0
- package/dist/auth/core/schema/roles/index.js +3 -0
- package/dist/auth/core/schema/roles/schema.d.ts +62 -0
- package/dist/auth/core/schema/roles/schema.js +38 -0
- package/dist/auth/core/web.d.ts +3 -3
- package/dist/auth/core/web.js +34 -6
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/plugin.json +8 -0
- package/dist/auth/utils/get-auth-plugin-definition.d.ts +9 -0
- package/dist/auth/utils/get-auth-plugin-definition.js +10 -0
- package/dist/auth/utils/index.d.ts +2 -0
- package/dist/auth/utils/index.js +2 -0
- package/dist/better-auth/admin/common.d.ts +5 -0
- package/dist/better-auth/admin/common.js +29 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +510 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +123 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +510 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js +9 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +12 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +24 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +260 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +41 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +249 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +20 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts +2 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/index.js +2 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +22 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +78 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +162 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +509 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +114 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +510 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.js +9 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +12 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +24 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +260 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +41 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +495 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +22 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/index.d.ts +2 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/index.js +2 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +22 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +89 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +171 -0
- package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +244 -0
- package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +54 -0
- package/dist/better-auth/admin/generators/admin-crud-roles-column/index.d.ts +2 -0
- package/dist/better-auth/admin/generators/admin-crud-roles-column/index.js +2 -0
- package/dist/better-auth/admin/node.d.ts +5 -0
- package/dist/better-auth/admin/node.js +57 -0
- package/dist/better-auth/admin/schema/manage-role-action.d.ts +12 -0
- package/dist/better-auth/admin/schema/manage-role-action.js +6 -0
- package/dist/better-auth/admin/schema/reset-password-action.d.ts +12 -0
- package/dist/better-auth/admin/schema/reset-password-action.js +6 -0
- package/dist/better-auth/admin/schema/roles-column.d.ts +9 -0
- package/dist/better-auth/admin/schema/roles-column.js +6 -0
- package/dist/better-auth/admin/web.d.ts +5 -0
- package/dist/better-auth/admin/web.js +39 -0
- package/dist/better-auth/constants/model-names.d.ts +8 -0
- package/dist/better-auth/constants/model-names.js +8 -0
- package/dist/better-auth/constants/packages.d.ts +4 -0
- package/dist/better-auth/constants/packages.js +4 -0
- package/dist/better-auth/core/common.d.ts +6 -0
- package/dist/better-auth/core/common.js +20 -0
- package/dist/better-auth/core/components/better-auth-definition-editor.d.ts +5 -0
- package/dist/better-auth/core/components/better-auth-definition-editor.js +62 -0
- package/dist/better-auth/core/index.d.ts +2 -0
- package/dist/better-auth/core/index.js +2 -0
- package/dist/better-auth/core/node.d.ts +5 -0
- package/dist/better-auth/core/node.js +64 -0
- package/dist/better-auth/core/schema/models.d.ts +3 -0
- package/dist/better-auth/core/schema/models.js +293 -0
- package/dist/better-auth/core/schema/plugin-definition.d.ts +8 -0
- package/dist/better-auth/core/schema/plugin-definition.js +9 -0
- package/dist/better-auth/core/schema/schema-issue-checker.d.ts +3 -0
- package/dist/better-auth/core/schema/schema-issue-checker.js +21 -0
- package/dist/better-auth/core/web.d.ts +6 -0
- package/dist/better-auth/core/web.js +26 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/better-auth-admin-module.generator.d.ts +73 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/better-auth-admin-module.generator.js +56 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/index.d.ts +111 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/index.js +11 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-paths.d.ts +13 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-paths.js +25 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-renderers.d.ts +56 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-renderers.js +57 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/ts-import-providers.d.ts +21 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/ts-import-providers.js +30 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/typed-templates.d.ts +47 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/typed-templates.js +33 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/index.d.ts +4 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/index.js +3 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/templates/module/schema/admin-auth.mutations.ts +48 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/templates/module/services/admin-auth.service.ts +106 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/better-auth-email-templates.generator.d.ts +44 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/better-auth-email-templates.generator.js +48 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/index.d.ts +100 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/index.js +9 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-paths.d.ts +14 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-paths.js +26 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-renderers.d.ts +42 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-renderers.js +59 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/typed-templates.d.ts +63 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/typed-templates.js +42 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/index.d.ts +2 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/index.js +2 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts +151 -0
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js +109 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts +234 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/index.js +11 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.d.ts +16 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.js +28 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts +116 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js +91 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts +48 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js +40 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts +110 -0
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js +83 -0
- package/dist/better-auth/generators/fastify/better-auth-module/index.d.ts +4 -0
- package/dist/better-auth/generators/fastify/better-auth-module/index.js +3 -0
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/plugins/better-auth.plugin.ts +34 -0
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/schema/user-session.queries.ts +22 -0
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/auth.ts +107 -0
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/user-session.service.ts +84 -0
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/utils/headers.utils.ts +21 -0
- package/dist/better-auth/generators/fastify/index.d.ts +5 -0
- package/dist/better-auth/generators/fastify/index.js +5 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/index.d.ts +66 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/index.js +9 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-paths.d.ts +12 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-paths.js +24 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-renderers.d.ts +38 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/template-renderers.js +43 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/typed-templates.d.ts +27 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/generated/typed-templates.js +18 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/index.d.ts +2 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/index.js +2 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/seed-initial-user.generator.d.ts +49 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/seed-initial-user.generator.js +64 -0
- package/dist/better-auth/generators/fastify/seed-initial-user/templates/src/prisma/seed-initial-user.ts +64 -0
- package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts +43 -0
- package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.js +37 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts +72 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/index.js +11 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts +14 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js +26 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.d.ts +27 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.js +43 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts +18 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js +27 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts +51 -0
- package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js +48 -0
- package/dist/better-auth/generators/react/better-auth-hooks/index.d.ts +2 -0
- package/dist/better-auth/generators/react/better-auth-hooks/index.js +2 -0
- package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-log-out.ts +16 -0
- package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-session.ts +29 -0
- package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts +260 -0
- package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.js +26 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts +1492 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/index.js +9 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.d.ts +16 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.js +28 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts +261 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.js +44 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts +2457 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.js +83 -0
- package/dist/better-auth/generators/react/better-auth-pages/index.d.ts +2 -0
- package/dist/better-auth/generators/react/better-auth-pages/index.js +2 -0
- package/dist/better-auth/generators/react/better-auth-pages/templates/routes/forgot-password.tsx +133 -0
- package/dist/better-auth/generators/react/better-auth-pages/templates/routes/login.tsx +152 -0
- package/dist/better-auth/generators/react/better-auth-pages/templates/routes/register.tsx +164 -0
- package/dist/better-auth/generators/react/better-auth-pages/templates/routes/reset-password.tsx +177 -0
- package/dist/better-auth/generators/react/better-auth-pages/templates/routes/verify-email.tsx +109 -0
- package/dist/better-auth/generators/react/index.d.ts +4 -0
- package/dist/better-auth/generators/react/index.js +4 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts +537 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/index.js +11 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.d.ts +13 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.js +25 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts +271 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.js +51 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts +21 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js +30 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts +258 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.js +33 -0
- package/dist/better-auth/generators/react/react-better-auth/index.d.ts +4 -0
- package/dist/better-auth/generators/react/react-better-auth/index.js +3 -0
- package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts +291 -0
- package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.js +74 -0
- package/dist/better-auth/generators/react/react-better-auth/templates/src/app/auth-loaded-gate.tsx +55 -0
- package/dist/better-auth/generators/react/react-better-auth/templates/src/services/auth-client.ts +13 -0
- package/dist/better-auth/index.d.ts +3 -0
- package/dist/better-auth/index.js +2 -0
- package/dist/better-auth/plugin.json +9 -0
- package/dist/better-auth/static/icon.svg +10 -0
- package/dist/common/components/auth-config-tabs.d.ts +2 -0
- package/dist/common/components/auth-config-tabs.js +21 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/local-auth/admin/common.d.ts +5 -0
- package/dist/local-auth/admin/common.js +29 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +510 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +127 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +510 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js +9 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +12 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +24 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +260 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +41 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +249 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +20 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts +2 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js +2 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +22 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +78 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +162 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +509 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +119 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +510 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js +9 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +12 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +24 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +260 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +41 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +495 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +22 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts +2 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js +2 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +22 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +89 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +171 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +244 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +54 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts +2 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js +2 -0
- package/dist/local-auth/admin/node.d.ts +5 -0
- package/dist/local-auth/admin/node.js +57 -0
- package/dist/local-auth/admin/schema/manage-role-action.d.ts +12 -0
- package/dist/local-auth/admin/schema/manage-role-action.js +6 -0
- package/dist/local-auth/admin/schema/reset-password-action.d.ts +12 -0
- package/dist/local-auth/admin/schema/reset-password-action.js +6 -0
- package/dist/local-auth/admin/schema/roles-column.d.ts +9 -0
- package/dist/local-auth/admin/schema/roles-column.js +6 -0
- package/dist/local-auth/admin/web.d.ts +5 -0
- package/dist/local-auth/admin/web.js +39 -0
- package/dist/local-auth/constants/model-names.d.ts +23 -0
- package/dist/local-auth/constants/model-names.js +23 -0
- package/dist/local-auth/core/common.d.ts +6 -0
- package/dist/local-auth/core/common.js +20 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.d.ts +5 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.js +63 -0
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +13 -0
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js +40 -0
- package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js +20 -0
- package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.ts +18 -0
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +122 -0
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +82 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +327 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +18 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js +30 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +95 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +87 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +45 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js +46 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +372 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +140 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +17 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +18 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +21 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js +24 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts +35 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js +39 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts +55 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +76 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +95 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +24 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +87 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +144 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +38 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +165 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +244 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +71 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +226 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +358 -0
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +44 -0
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +48 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +100 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +14 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +26 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +42 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +59 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +63 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +42 -0
- package/dist/local-auth/core/generators/auth-email-templates/index.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-email-templates/index.js +2 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js +14 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js +12 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js +14 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
- package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +57 -0
- package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js +32 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts +93 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts +14 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js +26 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts +35 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js +45 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +29 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js +37 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts +71 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js +50 -0
- package/dist/local-auth/core/generators/auth-hooks/index.d.ts +4 -0
- package/dist/local-auth/core/generators/auth-hooks/index.js +3 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +30 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +33 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +16 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +32 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +15 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +16 -0
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +179 -0
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +115 -0
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +458 -0
- package/dist/local-auth/core/generators/auth-module/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +25 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +37 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +160 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +120 -0
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts +36 -0
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js +40 -0
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +402 -0
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +207 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js +4 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.ts +7 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.worker.d.ts +6 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.worker.js +18 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.worker.ts +22 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts +8 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js +16 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.ts +21 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js +23 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts +26 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +19 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +25 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +17 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +24 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +36 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +43 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts +40 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js +106 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.ts +146 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js +40 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts +54 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts +42 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +191 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +262 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js +38 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.ts +42 -0
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +279 -0
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +65 -0
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +1575 -0
- package/dist/local-auth/core/generators/auth-routes/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +18 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +28 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +277 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +62 -0
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +21 -0
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +30 -0
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +2323 -0
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +120 -0
- package/dist/local-auth/core/generators/auth-routes/index.d.ts +4 -0
- package/dist/local-auth/core/generators/auth-routes/index.js +3 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts +10 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js +11 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.ts +12 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +60 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +127 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +100 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +187 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +75 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +149 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +153 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +292 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +106 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +206 -0
- package/dist/local-auth/core/generators/index.d.ts +10 -0
- package/dist/local-auth/core/generators/index.js +10 -0
- package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts +9 -0
- package/dist/local-auth/core/generators/react-auth/react-auth.generator.js +31 -0
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts +568 -0
- package/dist/local-auth/core/generators/react-session/generated/index.js +11 -0
- package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts +13 -0
- package/dist/local-auth/core/generators/react-session/generated/template-paths.js +25 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +282 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.js +51 -0
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts +21 -0
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js +30 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +547 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.js +35 -0
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +301 -0
- package/dist/local-auth/core/generators/react-session/react-session.generator.js +48 -0
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js +72 -0
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +99 -0
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +58 -0
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js +103 -0
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.ts +122 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +90 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.js +9 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts +12 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js +24 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +50 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js +46 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +39 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js +20 -0
- package/dist/local-auth/core/generators/seed-initial-user/index.d.ts +2 -0
- package/dist/local-auth/core/generators/seed-initial-user/index.js +2 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +58 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +61 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts +3 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js +33 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.ts +45 -0
- package/dist/local-auth/core/node.d.ts +5 -0
- package/dist/local-auth/core/node.js +76 -0
- package/dist/local-auth/core/schema/models.d.ts +3 -0
- package/dist/local-auth/core/schema/models.js +281 -0
- package/dist/local-auth/core/schema/plugin-definition.d.ts +9 -0
- package/dist/local-auth/core/schema/plugin-definition.js +10 -0
- package/dist/local-auth/core/schema/schema-issue-checker.d.ts +3 -0
- package/dist/local-auth/core/schema/schema-issue-checker.js +21 -0
- package/dist/local-auth/core/web.d.ts +6 -0
- package/dist/local-auth/core/web.js +26 -0
- package/dist/local-auth/index.d.ts +2 -0
- package/dist/local-auth/index.js +2 -0
- package/dist/local-auth/plugin.json +14 -0
- package/dist/local-auth/static/icon.svg +1 -0
- package/dist/placeholder-auth/constants/model-names.d.ts +4 -0
- package/dist/placeholder-auth/constants/model-names.js +4 -0
- package/dist/placeholder-auth/core/common.d.ts +2 -5
- package/dist/placeholder-auth/core/common.js +11 -20
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +21 -29
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +3 -12
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +0 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +0 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts +1 -7
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js +2 -14
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +3 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +0 -15
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +7 -32
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +4 -6
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js +1 -7
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +6 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts +10 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js +8 -5
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts +3 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js +2 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/placeholder-auth-module.generator.d.ts +64 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/placeholder-auth-module.generator.js +44 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts +5 -21
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js +17 -26
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.ts +21 -31
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts +1 -1
- package/dist/placeholder-auth/core/node.d.ts +3 -3
- package/dist/placeholder-auth/core/node.js +11 -17
- package/dist/placeholder-auth/core/schema/models.d.ts +2 -5
- package/dist/placeholder-auth/core/schema/models.js +46 -28
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +2 -79
- package/dist/placeholder-auth/core/schema/plugin-definition.js +2 -15
- package/dist/placeholder-auth/core/web.d.ts +3 -3
- package/dist/placeholder-auth/core/web.js +16 -6
- package/dist/placeholder-auth/plugin.json +10 -0
- package/dist/web/assets/_virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-DdyPR8Y-.js +242 -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__.js-BfSk5vRC.js +384 -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__.js-DZIcwf2B.js +125 -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__.js-CXGct_48.js +80678 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-Ci5_qYaj.js +7380 -0
- package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__.js-Do-7VDVw.js +13567 -0
- package/dist/web/assets/arduino-BP2nYunF.js +21 -0
- package/dist/web/assets/auth-8qJtXAgU.js +1 -0
- package/dist/web/assets/bash-Zh_IyzBN.js +192 -0
- package/dist/web/assets/basic-3mvohyEL.js +28 -0
- package/dist/web/assets/c-C7Ey31hW.js +74 -0
- package/dist/web/assets/clike-D9YNFwtw.js +41 -0
- package/dist/web/assets/common-23-wvKrM.js +39 -0
- package/dist/web/assets/common-B-NI9TR-.js +37 -0
- package/dist/web/assets/common-BBriDRRy.js +63 -0
- package/dist/web/assets/common-BvU-7KsV.js +39 -0
- package/dist/web/assets/common-DBBUvtGu.js +37 -0
- package/dist/web/assets/common-eFh2vwGb.js +18 -0
- package/dist/web/assets/cpp-_RjA_yNA.js +82 -0
- package/dist/web/assets/csharp-0LZzOc6Q.js +301 -0
- package/dist/web/assets/css-D7TbgetL.js +70 -0
- package/dist/web/assets/diff-CtSa_15w.js +54 -0
- package/dist/web/assets/dist-BjxypexQ.js +18953 -0
- package/dist/web/assets/dist-SBfmsOB2.js +3576 -0
- package/dist/web/assets/get-auth-plugin-definition-x8oAsN1R.js +14 -0
- package/dist/web/assets/go-CzER04EZ.js +36 -0
- package/dist/web/assets/hostInit-oh7k6PLP.js +99 -0
- package/dist/web/assets/index-D-gGyBWJ.js +2 -0
- package/dist/web/assets/ini-CU-wHLTy.js +51 -0
- package/dist/web/assets/java-HAvRESj1.js +116 -0
- package/dist/web/assets/javascript-BVAr0eZH.js +124 -0
- package/dist/web/assets/json-DN8T4yFI.js +38 -0
- package/dist/web/assets/kotlin-DkCMjTKK.js +83 -0
- package/dist/web/assets/less-ZXX1tgaG.js +42 -0
- package/dist/web/assets/lua-D9bD4wrb.js +28 -0
- package/dist/web/assets/makefile-CKoRpler.js +40 -0
- package/dist/web/assets/markdown-_2_uVr2L.js +278 -0
- package/dist/web/assets/markup-BVZ8HhdW.js +176 -0
- package/dist/web/assets/markup-templating-BDIRuVJH.js +94 -0
- package/dist/web/assets/mf-entry-bootstrap-0-f953ebce.js +35 -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-dNFTOjqi.js +1599 -0
- package/dist/web/assets/models-BpslIbU7.js +304 -0
- package/dist/web/assets/models-CKab4MTC.js +285 -0
- package/dist/web/assets/objectivec-DPgB68It.js +25 -0
- package/dist/web/assets/perl-Cul_ma_h.js +92 -0
- package/dist/web/assets/php-JTON0zp9.js +298 -0
- package/dist/web/assets/plugin-definition-8Exesd6T.js +78 -0
- package/dist/web/assets/plugin-definition-ChBrbazJ.js +11 -0
- package/dist/web/assets/python-CURlmZ7M.js +73 -0
- package/dist/web/assets/r-8lr7pbGm.js +30 -0
- package/dist/web/assets/regex-CxQ7DXCx.js +96 -0
- package/dist/web/assets/rolldown-runtime-FZ4Itg2g.js +42 -0
- package/dist/web/assets/ruby-BoFHz67P.js +175 -0
- package/dist/web/assets/rust-CpZXpaj0.js +107 -0
- package/dist/web/assets/sass-DG0YAnL7.js +65 -0
- package/dist/web/assets/scss-BDRIqhak.js +70 -0
- package/dist/web/assets/sql-C-bL8_gT.js +40 -0
- package/dist/web/assets/styles-Cc26Bbxc.css +120 -0
- package/dist/web/assets/styles-Cuq4wgvD.js +176 -0
- package/dist/web/assets/swift-rQ52kfab.js +107 -0
- package/dist/web/assets/typescript-CDkIWcT8.js +57 -0
- package/dist/web/assets/vbnet-_PL7-T9d.js +32 -0
- package/dist/web/assets/virtualExposes-BwIds34r.js +2 -0
- package/dist/web/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-RJNeuwba.js +259 -0
- package/dist/web/assets/virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-RzPgl37a.js +129 -0
- package/dist/web/assets/virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-DM6Ir1_S.js +203 -0
- package/dist/web/assets/vite-preload-helper-iIio8xkS.js +67 -0
- package/dist/web/assets/web-BZd3bM0n.js +410 -0
- package/dist/web/assets/web-BgWG7dYl.js +123 -0
- package/dist/web/assets/web-CXHw8SK7.js +118 -0
- package/dist/web/assets/web-CnB-sqCR.js +357 -0
- package/dist/web/assets/web-DHv2aVpi.js +106 -0
- package/dist/web/assets/web-DNrWXjpS.js +46 -0
- package/dist/web/assets/web-D_H-MoGI.js +46 -0
- package/dist/web/assets/workerBundle-GFUata9j.js +10 -0
- package/dist/web/assets/yaml-C9m3vuV5.js +90 -0
- package/dist/web/index.html +2 -2
- package/dist/web/remoteEntry.js +2 -0
- package/dist/web/remoteEntry.ssr.js +43 -0
- package/package.json +53 -47
- 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/generators/auth-apollo/auth-apollo.generator.d.ts +0 -28
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js +0 -43
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-apollo/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-apollo/index.js.map +0 -1
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js +0 -15
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js.map +0 -1
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.ts +0 -16
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +0 -73
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js +0 -40
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts +0 -124
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/index.js +0 -11
- package/dist/auth/core/generators/auth-email-password/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts +0 -14
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js +0 -26
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts +0 -58
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js +0 -55
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +0 -25
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js +0 -32
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts +0 -105
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js +0 -58
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/index.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +0 -2
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +0 -3
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +0 -3
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +0 -33
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +0 -44
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +0 -21
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +0 -74
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +0 -121
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +0 -61
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js +0 -33
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts +0 -127
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/index.js +0 -11
- package/dist/auth/core/generators/auth-hooks/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts +0 -17
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js +0 -27
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts +0 -47
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js +0 -50
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +0 -16
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js +0 -27
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts +0 -131
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js +0 -83
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/index.d.ts +0 -2
- package/dist/auth/core/generators/auth-hooks/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/index.js +0 -2
- package/dist/auth/core/generators/auth-hooks/index.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts +0 -18
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.gql +0 -10
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js +0 -22
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts +0 -39
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +0 -2
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.gql +0 -5
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +0 -27
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +0 -29
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +0 -8
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +0 -12
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +0 -16
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +0 -15
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +0 -16
- package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts +0 -94
- package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/auth-module.generator.js +0 -70
- package/dist/auth/core/generators/auth-module/auth-module.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/index.d.ts +0 -182
- package/dist/auth/core/generators/auth-module/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/index.js +0 -11
- package/dist/auth/core/generators/auth-module/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts +0 -19
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-paths.js +0 -29
- package/dist/auth/core/generators/auth-module/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts +0 -80
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js +0 -79
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts +0 -22
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js +0 -31
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts +0 -134
- package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/typed-templates.js +0 -113
- package/dist/auth/core/generators/auth-module/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-module/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/index.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +0 -17
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +0 -23
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +0 -18
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +0 -22
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +0 -19
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +0 -23
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts +0 -43
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js +0 -180
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.ts +0 -250
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js +0 -38
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts +0 -42
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts +0 -176
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js +0 -38
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/index.d.ts +0 -495
- package/dist/auth/core/generators/auth-routes/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/index.js +0 -9
- package/dist/auth/core/generators/auth-routes/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts +0 -15
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js +0 -25
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts +0 -176
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js +0 -55
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts +0 -638
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js +0 -57
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/index.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/index.js +0 -2
- package/dist/auth/core/generators/auth-routes/index.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js +0 -85
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +0 -161
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/queries.gql +0 -15
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js +0 -77
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +0 -148
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +0 -1
- package/dist/auth/core/generators/index.d.ts +0 -8
- package/dist/auth/core/generators/index.d.ts.map +0 -1
- package/dist/auth/core/generators/index.js +0 -8
- package/dist/auth/core/generators/index.js.map +0 -1
- package/dist/auth/core/generators/react-auth/index.d.ts.map +0 -1
- package/dist/auth/core/generators/react-auth/index.js.map +0 -1
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts +0 -9
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/react-auth/react-auth.generator.js +0 -31
- package/dist/auth/core/generators/react-auth/react-auth.generator.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/index.d.ts +0 -74
- package/dist/auth/core/generators/react-session/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/index.js +0 -11
- package/dist/auth/core/generators/react-session/generated/index.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts +0 -16
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-paths.js +0 -26
- package/dist/auth/core/generators/react-session/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts +0 -27
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-renderers.js +0 -49
- package/dist/auth/core/generators/react-session/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts +0 -64
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js +0 -42
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts +0 -46
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/typed-templates.js +0 -82
- package/dist/auth/core/generators/react-session/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/react-session/index.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/index.js.map +0 -1
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts +0 -58
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/react-session.generator.js +0 -54
- package/dist/auth/core/generators/react-session/react-session.generator.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts +0 -7
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.gql +0 -6
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js +0 -25
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.tsx +0 -28
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js +0 -18
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +0 -45
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts +0 -12
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js +0 -15
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts +0 -30
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +0 -79
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js +0 -133
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.ts +0 -153
- package/dist/auth/core/index.d.ts.map +0 -1
- package/dist/auth/core/index.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/models.d.ts +0 -9
- package/dist/auth/core/schema/models.d.ts.map +0 -1
- package/dist/auth/core/schema/models.js +0 -203
- package/dist/auth/core/schema/models.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/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/metadata.json +0 -8
- package/dist/auth0/constants/packages.d.ts +0 -6
- package/dist/auth0/constants/packages.d.ts.map +0 -1
- package/dist/auth0/constants/packages.js +0 -6
- package/dist/auth0/constants/packages.js.map +0 -1
- package/dist/auth0/core/common.d.ts +0 -7
- package/dist/auth0/core/common.d.ts.map +0 -1
- package/dist/auth0/core/common.js +0 -28
- package/dist/auth0/core/common.js.map +0 -1
- package/dist/auth0/core/components/auth-definition-editor.d.ts +0 -5
- package/dist/auth0/core/components/auth-definition-editor.d.ts.map +0 -1
- package/dist/auth0/core/components/auth-definition-editor.js +0 -61
- package/dist/auth0/core/components/auth-definition-editor.js.map +0 -1
- package/dist/auth0/core/node.d.ts +0 -5
- package/dist/auth0/core/node.d.ts.map +0 -1
- package/dist/auth0/core/node.js +0 -49
- package/dist/auth0/core/node.js.map +0 -1
- package/dist/auth0/core/schema/migrations.d.ts +0 -3
- package/dist/auth0/core/schema/migrations.d.ts.map +0 -1
- package/dist/auth0/core/schema/migrations.js +0 -19
- package/dist/auth0/core/schema/migrations.js.map +0 -1
- package/dist/auth0/core/schema/models.d.ts +0 -6
- package/dist/auth0/core/schema/models.d.ts.map +0 -1
- package/dist/auth0/core/schema/models.js +0 -39
- package/dist/auth0/core/schema/models.js.map +0 -1
- package/dist/auth0/core/schema/plugin-definition.d.ts +0 -83
- package/dist/auth0/core/schema/plugin-definition.d.ts.map +0 -1
- package/dist/auth0/core/schema/plugin-definition.js +0 -17
- package/dist/auth0/core/schema/plugin-definition.js.map +0 -1
- package/dist/auth0/core/web.d.ts +0 -6
- package/dist/auth0/core/web.d.ts.map +0 -1
- package/dist/auth0/core/web.js +0 -14
- package/dist/auth0/core/web.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +0 -75
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +0 -120
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +0 -105
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js +0 -11
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts +0 -13
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js +0 -23
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts +0 -55
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js +0 -52
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts +0 -10
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js +0 -23
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts +0 -43
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js +0 -28
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/index.d.ts +0 -2
- package/dist/auth0/generators/fastify/auth0-module/index.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/index.js +0 -2
- package/dist/auth0/generators/fastify/auth0-module/index.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/templates/module/services/management.ts +0 -22
- package/dist/auth0/generators/fastify/auth0-module/templates/module/services/user-session.service.ts +0 -101
- package/dist/auth0/generators/fastify/index.d.ts +0 -2
- package/dist/auth0/generators/fastify/index.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/index.js +0 -2
- package/dist/auth0/generators/fastify/index.js.map +0 -1
- package/dist/auth0/generators/index.d.ts.map +0 -1
- package/dist/auth0/generators/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts +0 -10
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js +0 -41
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-apollo/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-apollo/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-apollo/index.js +0 -2
- package/dist/auth0/generators/react/auth0-apollo/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-apollo/templates/auth-link.ts +0 -11
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +0 -40
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +0 -40
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts +0 -72
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js +0 -11
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +0 -16
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +0 -26
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts +0 -29
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js +0 -47
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts +0 -16
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js +0 -27
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +0 -52
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +0 -69
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-hooks/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/index.js +0 -2
- package/dist/auth0/generators/react/auth0-hooks/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.gql +0 -10
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.ts +0 -29
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-log-out.ts +0 -14
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-session.ts +0 -23
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts +0 -143
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js +0 -26
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts +0 -278
- package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/index.js +0 -9
- package/dist/auth0/generators/react/auth0-pages/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts +0 -12
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js +0 -20
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts +0 -144
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js +0 -37
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts +0 -263
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.js +0 -18
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-pages/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/index.js +0 -2
- package/dist/auth0/generators/react/auth0-pages/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-pages/templates/routes/login.tsx +0 -31
- package/dist/auth0/generators/react/index.d.ts +0 -5
- package/dist/auth0/generators/react/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/index.js +0 -5
- package/dist/auth0/generators/react/index.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/index.d.ts +0 -286
- package/dist/auth0/generators/react/react-auth0/generated/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/index.js +0 -9
- package/dist/auth0/generators/react/react-auth0/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts +0 -12
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.js +0 -22
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts +0 -149
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js +0 -39
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts +0 -136
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js +0 -17
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/index.d.ts +0 -2
- package/dist/auth0/generators/react/react-auth0/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/react-auth0/index.js +0 -2
- package/dist/auth0/generators/react/react-auth0/index.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +0 -178
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js +0 -107
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js.map +0 -1
- package/dist/auth0/generators/react/react-auth0/templates/src/app/auth-loaded-gate.tsx +0 -78
- package/dist/auth0/metadata.json +0 -8
- package/dist/auth0/static/icon.svg +0 -7
- package/dist/common/compiler/generator-creators.d.ts +0 -18
- package/dist/common/compiler/generator-creators.d.ts.map +0 -1
- package/dist/common/compiler/generator-creators.js +0 -34
- package/dist/common/compiler/generator-creators.js.map +0 -1
- package/dist/common/compiler/index.d.ts +0 -2
- package/dist/common/compiler/index.d.ts.map +0 -1
- package/dist/common/compiler/index.js +0 -2
- package/dist/common/compiler/index.js.map +0 -1
- package/dist/common/index.d.ts +0 -3
- package/dist/common/index.d.ts.map +0 -1
- package/dist/common/index.js +0 -3
- package/dist/common/index.js.map +0 -1
- package/dist/common/roles/components/index.d.ts +0 -2
- package/dist/common/roles/components/index.d.ts.map +0 -1
- package/dist/common/roles/components/index.js +0 -2
- package/dist/common/roles/components/index.js.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.d.ts +0 -14
- package/dist/common/roles/components/role-editor-form/role-dialog.d.ts.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.js +0 -29
- package/dist/common/roles/components/role-editor-form/role-dialog.js.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts +0 -10
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-editor-form.js +0 -49
- package/dist/common/roles/components/role-editor-form/role-editor-form.js.map +0 -1
- package/dist/common/roles/constants.d.ts.map +0 -1
- package/dist/common/roles/constants.js +0 -25
- package/dist/common/roles/constants.js.map +0 -1
- package/dist/common/roles/index.d.ts +0 -4
- package/dist/common/roles/index.d.ts.map +0 -1
- package/dist/common/roles/index.js +0 -4
- package/dist/common/roles/index.js.map +0 -1
- package/dist/common/roles/schema.d.ts +0 -84
- package/dist/common/roles/schema.d.ts.map +0 -1
- package/dist/common/roles/schema.js +0 -44
- package/dist/common/roles/schema.js.map +0 -1
- package/dist/index.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-current-user.d.ts +0 -14
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.gql +0 -10
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js +0 -23
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts +0 -34
- 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 +0 -45
- 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 +0 -27
- 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/placeholder-auth/metadata.json +0 -9
- package/dist/web/assets/__federation_expose_auth0CoreCommon-CSWdt8d_.js +0 -56
- package/dist/web/assets/__federation_expose_auth0CoreCommon-CSWdt8d_.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-DjVw47sM.js +0 -201
- package/dist/web/assets/__federation_expose_auth0CoreWeb-DjVw47sM.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreCommon-CvHJZFIq.js +0 -36
- package/dist/web/assets/__federation_expose_authCoreCommon-CvHJZFIq.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreWeb-CrFEmZp3.js +0 -401
- package/dist/web/assets/__federation_expose_authCoreWeb-CrFEmZp3.js.map +0 -1
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js +0 -39
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js.map +0 -1
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CpxfTdxv.js +0 -197
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CpxfTdxv.js.map +0 -1
- package/dist/web/assets/__federation_fn_import-CGvRdRVe.js +0 -421
- package/dist/web/assets/__federation_fn_import-CGvRdRVe.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-D1kBtwsm.js +0 -341
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-D1kBtwsm.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B7442OYh.js +0 -10289
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B7442OYh.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-X318M5Ml.js +0 -23637
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-X318M5Ml.js.map +0 -1
- package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js +0 -250
- package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js.map +0 -1
- package/dist/web/assets/__federation_shared_react-uocnGSER.js +0 -7
- package/dist/web/assets/__federation_shared_react-uocnGSER.js.map +0 -1
- package/dist/web/assets/__federation_shared_zod-BK7IELHt.js +0 -4380
- package/dist/web/assets/__federation_shared_zod-BK7IELHt.js.map +0 -1
- package/dist/web/assets/index-B1hOKVPw.js +0 -574
- package/dist/web/assets/index-B1hOKVPw.js.map +0 -1
- package/dist/web/assets/index-l0sNRNKZ.js.map +0 -1
- package/dist/web/assets/index-ydDQKauE.js +0 -101
- package/dist/web/assets/index-ydDQKauE.js.map +0 -1
- package/dist/web/assets/index.esm-DYWXRkn-.js +0 -2627
- package/dist/web/assets/index.esm-DYWXRkn-.js.map +0 -1
- package/dist/web/assets/model-merger-BVBtbNAj.js +0 -1708
- package/dist/web/assets/model-merger-BVBtbNAj.js.map +0 -1
- package/dist/web/assets/plugin-definition-Bdhuga1j.js +0 -36
- package/dist/web/assets/plugin-definition-Bdhuga1j.js.map +0 -1
- package/dist/web/assets/plugin-definition-C9d7ykhX.js +0 -24
- package/dist/web/assets/plugin-definition-C9d7ykhX.js.map +0 -1
- package/dist/web/assets/plugin-definition-QzgXWr1I.js +0 -24
- package/dist/web/assets/plugin-definition-QzgXWr1I.js.map +0 -1
- package/dist/web/assets/react-B23vKoD0.js +0 -47
- package/dist/web/assets/react-B23vKoD0.js.map +0 -1
- package/dist/web/assets/remoteEntry.js +0 -66
- package/dist/web/assets/remoteEntry.js.map +0 -1
- package/dist/web/assets/role-editor-form-BkcoVwtU.js +0 -319
- package/dist/web/assets/role-editor-form-BkcoVwtU.js.map +0 -1
- package/dist/web/assets/style-ZUYizAnf.css +0 -93
- package/dist/web/assets/styles-Dfjm_ApH.js +0 -201
- package/dist/web/assets/styles-Dfjm_ApH.js.map +0 -1
- package/dist/web-export.js.map +0 -1
- package/manifest.json +0 -4
- /package/dist/{common → auth/core/schema}/roles/constants.d.ts +0 -0
- /package/dist/{auth0 → better-auth}/generators/index.d.ts +0 -0
- /package/dist/{auth0 → better-auth}/generators/index.js +0 -0
- /package/dist/{auth0/generators/react/auth0-hooks → better-auth/generators/react/better-auth-hooks}/templates/src/hooks/use-required-user-id.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/templates/session-error-link.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/session-cookie.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/route.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/route.tsx +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-auth/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-auth/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-session/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-session/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-session/templates/src/app/user-session-provider.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/index.js +0 -0
|
@@ -0,0 +1,3576 @@
|
|
|
1
|
+
import { t as __vitePreload } from "./vite-preload-helper-iIio8xkS.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.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.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.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.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
|
+
let timeout = 2e4;
|
|
393
|
+
let timeoutId;
|
|
394
|
+
const links = document.getElementsByTagName("link");
|
|
395
|
+
for (let i = 0; i < links.length; i++) {
|
|
396
|
+
const l = links[i];
|
|
397
|
+
const linkHref = l.getAttribute("href");
|
|
398
|
+
const linkRel = l.getAttribute("rel");
|
|
399
|
+
if (linkHref && isStaticResourcesEqual(linkHref, info.url) && linkRel === info.attrs["rel"]) {
|
|
400
|
+
link = l;
|
|
401
|
+
needAttach = false;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (!link) {
|
|
406
|
+
link = document.createElement("link");
|
|
407
|
+
link.setAttribute("href", info.url);
|
|
408
|
+
let createLinkRes = void 0;
|
|
409
|
+
let shouldApplyAttrs = true;
|
|
410
|
+
const attrs = info.attrs;
|
|
411
|
+
if (info.createLinkHook) {
|
|
412
|
+
createLinkRes = info.createLinkHook(info.url, attrs);
|
|
413
|
+
if (createLinkRes instanceof HTMLLinkElement) {
|
|
414
|
+
link = createLinkRes;
|
|
415
|
+
shouldApplyAttrs = false;
|
|
416
|
+
} else if (typeof createLinkRes === "object") {
|
|
417
|
+
if ("link" in createLinkRes && createLinkRes.link) {
|
|
418
|
+
link = createLinkRes.link;
|
|
419
|
+
shouldApplyAttrs = false;
|
|
420
|
+
}
|
|
421
|
+
if ("timeout" in createLinkRes && createLinkRes.timeout) timeout = createLinkRes.timeout;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (attrs && shouldApplyAttrs) Object.keys(attrs).forEach((name) => {
|
|
425
|
+
if (link && !link.getAttribute(name)) link.setAttribute(name, attrs[name]);
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
if (!needAttach) {
|
|
429
|
+
Promise.resolve().then(() => {
|
|
430
|
+
info?.cb && info?.cb();
|
|
431
|
+
});
|
|
432
|
+
return {
|
|
433
|
+
link,
|
|
434
|
+
needAttach
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
const onLinkComplete = (prev, event) => {
|
|
438
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
439
|
+
const onLinkCompleteCallback = () => {
|
|
440
|
+
if (event?.type === "error") {
|
|
441
|
+
const linkError = /* @__PURE__ */ new Error(event?.isTimeout ? `LinkNetworkError: Link "${info.url}" timed out.` : `LinkNetworkError: Failed to load link "${info.url}" - the URL is unreachable or the server returned an error.`);
|
|
442
|
+
linkError.name = "LinkNetworkError";
|
|
443
|
+
info?.onErrorCallback && info?.onErrorCallback(linkError);
|
|
444
|
+
} else info?.cb && info?.cb();
|
|
445
|
+
};
|
|
446
|
+
if (link) {
|
|
447
|
+
link.onerror = null;
|
|
448
|
+
link.onload = null;
|
|
449
|
+
safeWrapper(() => {
|
|
450
|
+
const { needDeleteLink = true } = info;
|
|
451
|
+
if (needDeleteLink) link?.parentNode && link.parentNode.removeChild(link);
|
|
452
|
+
});
|
|
453
|
+
if (prev) {
|
|
454
|
+
const res = prev(event);
|
|
455
|
+
onLinkCompleteCallback();
|
|
456
|
+
return res;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
onLinkCompleteCallback();
|
|
460
|
+
};
|
|
461
|
+
link.onerror = onLinkComplete.bind(null, link.onerror);
|
|
462
|
+
link.onload = onLinkComplete.bind(null, link.onload);
|
|
463
|
+
timeoutId = setTimeout(() => {
|
|
464
|
+
onLinkComplete(null, {
|
|
465
|
+
type: "error",
|
|
466
|
+
isTimeout: true
|
|
467
|
+
});
|
|
468
|
+
}, timeout);
|
|
469
|
+
return {
|
|
470
|
+
link,
|
|
471
|
+
needAttach
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
function loadScript(url, info) {
|
|
475
|
+
const { attrs = {}, createScriptHook } = info;
|
|
476
|
+
return new Promise((resolve, reject) => {
|
|
477
|
+
const { script, needAttach } = createScript({
|
|
478
|
+
url,
|
|
479
|
+
cb: resolve,
|
|
480
|
+
onErrorCallback: reject,
|
|
481
|
+
attrs: {
|
|
482
|
+
fetchpriority: "high",
|
|
483
|
+
...attrs
|
|
484
|
+
},
|
|
485
|
+
createScriptHook,
|
|
486
|
+
needDeleteScript: true
|
|
487
|
+
});
|
|
488
|
+
needAttach && document.head.appendChild(script);
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.7.0/node_modules/@module-federation/error-codes/dist/getShortErrorMsg.mjs
|
|
493
|
+
var getDocsUrl = (errorCode) => {
|
|
494
|
+
return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
|
|
495
|
+
};
|
|
496
|
+
var getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
|
|
497
|
+
const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
|
|
498
|
+
args && msg.push(`args: ${JSON.stringify(args)}`);
|
|
499
|
+
msg.push(getDocsUrl(errorCode));
|
|
500
|
+
originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
|
|
501
|
+
return msg.join("\n");
|
|
502
|
+
};
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.7.0/node_modules/@module-federation/error-codes/dist/browser.mjs
|
|
505
|
+
function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
|
|
506
|
+
return logger(getShortErrorMsg(code, descMap, args, originalErrorMsg));
|
|
507
|
+
}
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/logger.js
|
|
510
|
+
var LOG_CATEGORY = "[ Federation Runtime ]";
|
|
511
|
+
var logger = createLogger(LOG_CATEGORY);
|
|
512
|
+
function assert(condition, msgOrCode, descMap, args, context) {
|
|
513
|
+
if (!condition) if (descMap !== void 0) error(msgOrCode, descMap, args, void 0, context);
|
|
514
|
+
else error(msgOrCode);
|
|
515
|
+
}
|
|
516
|
+
function error(msgOrCode, descMap, args, originalErrorMsg, context) {
|
|
517
|
+
if (descMap !== void 0) return logAndReport(msgOrCode, descMap, args ?? {}, (msg) => {
|
|
518
|
+
throw new Error(`${LOG_CATEGORY}: ${msg}`);
|
|
519
|
+
}, originalErrorMsg, context);
|
|
520
|
+
const msg = msgOrCode;
|
|
521
|
+
if (msg instanceof Error) {
|
|
522
|
+
if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;
|
|
523
|
+
throw msg;
|
|
524
|
+
}
|
|
525
|
+
throw new Error(`${LOG_CATEGORY}: ${msg}`);
|
|
526
|
+
}
|
|
527
|
+
function warn$1(msg) {
|
|
528
|
+
if (msg instanceof Error) {
|
|
529
|
+
if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;
|
|
530
|
+
logger.warn(msg);
|
|
531
|
+
} else logger.warn(msg);
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/tool.js
|
|
535
|
+
function addUniqueItem(arr, item) {
|
|
536
|
+
if (arr.findIndex((name) => name === item) === -1) arr.push(item);
|
|
537
|
+
return arr;
|
|
538
|
+
}
|
|
539
|
+
function getFMId(remoteInfo) {
|
|
540
|
+
if ("version" in remoteInfo && remoteInfo.version) return `${remoteInfo.name}:${remoteInfo.version}`;
|
|
541
|
+
else if ("entry" in remoteInfo && remoteInfo.entry) return `${remoteInfo.name}:${remoteInfo.entry}`;
|
|
542
|
+
else return `${remoteInfo.name}`;
|
|
543
|
+
}
|
|
544
|
+
function isRemoteInfoWithEntry(remote) {
|
|
545
|
+
return typeof remote.entry !== "undefined";
|
|
546
|
+
}
|
|
547
|
+
function isPureRemoteEntry(remote) {
|
|
548
|
+
return !remote.entry.includes(".json");
|
|
549
|
+
}
|
|
550
|
+
function isObject(val) {
|
|
551
|
+
return val && typeof val === "object";
|
|
552
|
+
}
|
|
553
|
+
var objectToString = Object.prototype.toString;
|
|
554
|
+
function isPlainObject(val) {
|
|
555
|
+
return objectToString.call(val) === "[object Object]";
|
|
556
|
+
}
|
|
557
|
+
function arrayOptions(options) {
|
|
558
|
+
return Array.isArray(options) ? options : [options];
|
|
559
|
+
}
|
|
560
|
+
function getRemoteEntryInfoFromSnapshot(snapshot) {
|
|
561
|
+
return "remoteEntry" in snapshot ? {
|
|
562
|
+
url: snapshot.remoteEntry,
|
|
563
|
+
type: snapshot.remoteEntryType,
|
|
564
|
+
globalName: snapshot.globalName
|
|
565
|
+
} : {
|
|
566
|
+
url: "",
|
|
567
|
+
type: "global",
|
|
568
|
+
globalName: ""
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
var processModuleAlias = (name, subPath) => {
|
|
572
|
+
let moduleName;
|
|
573
|
+
if (name.endsWith("/")) moduleName = name.slice(0, -1);
|
|
574
|
+
else moduleName = name;
|
|
575
|
+
if (subPath.startsWith(".")) subPath = subPath.slice(1);
|
|
576
|
+
moduleName = moduleName + subPath;
|
|
577
|
+
return moduleName;
|
|
578
|
+
};
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/global.js
|
|
581
|
+
var CurrentGlobal = typeof globalThis === "object" ? globalThis : window;
|
|
582
|
+
var nativeGlobal = (() => {
|
|
583
|
+
try {
|
|
584
|
+
return document.defaultView;
|
|
585
|
+
} catch {
|
|
586
|
+
return CurrentGlobal;
|
|
587
|
+
}
|
|
588
|
+
})();
|
|
589
|
+
var Global = nativeGlobal;
|
|
590
|
+
function definePropertyGlobalVal(target, key, val) {
|
|
591
|
+
Object.defineProperty(target, key, {
|
|
592
|
+
value: val,
|
|
593
|
+
configurable: false,
|
|
594
|
+
writable: true
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
function includeOwnProperty(target, key) {
|
|
598
|
+
return Object.hasOwnProperty.call(target, key);
|
|
599
|
+
}
|
|
600
|
+
if (!includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__")) definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
601
|
+
var globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
602
|
+
function setGlobalDefaultVal(target) {
|
|
603
|
+
if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);
|
|
604
|
+
if (!includeOwnProperty(target, "__FEDERATION__")) {
|
|
605
|
+
definePropertyGlobalVal(target, "__FEDERATION__", {
|
|
606
|
+
__GLOBAL_PLUGIN__: [],
|
|
607
|
+
__INSTANCES__: [],
|
|
608
|
+
moduleInfo: {},
|
|
609
|
+
__SHARE__: {},
|
|
610
|
+
__MANIFEST_LOADING__: {},
|
|
611
|
+
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
612
|
+
});
|
|
613
|
+
definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);
|
|
614
|
+
}
|
|
615
|
+
target.__FEDERATION__.__GLOBAL_PLUGIN__ ??= [];
|
|
616
|
+
target.__FEDERATION__.__INSTANCES__ ??= [];
|
|
617
|
+
target.__FEDERATION__.moduleInfo ??= {};
|
|
618
|
+
target.__FEDERATION__.__SHARE__ ??= {};
|
|
619
|
+
target.__FEDERATION__.__MANIFEST_LOADING__ ??= {};
|
|
620
|
+
target.__FEDERATION__.__PRELOADED_MAP__ ??= /* @__PURE__ */ new Map();
|
|
621
|
+
}
|
|
622
|
+
setGlobalDefaultVal(CurrentGlobal);
|
|
623
|
+
setGlobalDefaultVal(nativeGlobal);
|
|
624
|
+
function setGlobalFederationInstance(FederationInstance) {
|
|
625
|
+
CurrentGlobal.__FEDERATION__.__INSTANCES__.push(FederationInstance);
|
|
626
|
+
}
|
|
627
|
+
function getGlobalFederationConstructor() {
|
|
628
|
+
return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
|
|
629
|
+
}
|
|
630
|
+
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
631
|
+
if (isDebug) {
|
|
632
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
633
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.7.0";
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function getInfoWithoutType(target, key) {
|
|
637
|
+
if (typeof key === "string") if (target[key]) return {
|
|
638
|
+
value: target[key],
|
|
639
|
+
key
|
|
640
|
+
};
|
|
641
|
+
else {
|
|
642
|
+
const targetKeys = Object.keys(target);
|
|
643
|
+
for (const targetKey of targetKeys) {
|
|
644
|
+
const [targetTypeOrName, _] = targetKey.split(":");
|
|
645
|
+
const nKey = `${targetTypeOrName}:${key}`;
|
|
646
|
+
const typeWithKeyRes = target[nKey];
|
|
647
|
+
if (typeWithKeyRes) return {
|
|
648
|
+
value: typeWithKeyRes,
|
|
649
|
+
key: nKey
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
return {
|
|
653
|
+
value: void 0,
|
|
654
|
+
key
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
else error(`getInfoWithoutType: "key" must be a string, got ${typeof key} (${JSON.stringify(key)}).`);
|
|
658
|
+
}
|
|
659
|
+
var getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo;
|
|
660
|
+
var getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot) => {
|
|
661
|
+
const getModuleInfo = getInfoWithoutType(snapshot, getFMId(moduleInfo)).value;
|
|
662
|
+
if (getModuleInfo && !getModuleInfo.version && "version" in moduleInfo && moduleInfo["version"]) getModuleInfo.version = moduleInfo["version"];
|
|
663
|
+
if (getModuleInfo) return getModuleInfo;
|
|
664
|
+
if ("version" in moduleInfo && moduleInfo["version"]) {
|
|
665
|
+
const { version, ...resModuleInfo } = moduleInfo;
|
|
666
|
+
const moduleKeyWithoutVersion = getFMId(resModuleInfo);
|
|
667
|
+
const getModuleInfoWithoutVersion = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion).value;
|
|
668
|
+
if (getModuleInfoWithoutVersion?.version === version) return getModuleInfoWithoutVersion;
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
var getGlobalSnapshotInfoByModuleInfo = (moduleInfo) => getTargetSnapshotInfoByModuleInfo(moduleInfo, nativeGlobal.__FEDERATION__.moduleInfo);
|
|
672
|
+
var setGlobalSnapshotInfoByModuleInfo = (remoteInfo, moduleDetailInfo) => {
|
|
673
|
+
const moduleKey = getFMId(remoteInfo);
|
|
674
|
+
nativeGlobal.__FEDERATION__.moduleInfo[moduleKey] = moduleDetailInfo;
|
|
675
|
+
return nativeGlobal.__FEDERATION__.moduleInfo;
|
|
676
|
+
};
|
|
677
|
+
var addGlobalSnapshot = (moduleInfos) => {
|
|
678
|
+
nativeGlobal.__FEDERATION__.moduleInfo = {
|
|
679
|
+
...nativeGlobal.__FEDERATION__.moduleInfo,
|
|
680
|
+
...moduleInfos
|
|
681
|
+
};
|
|
682
|
+
return () => {
|
|
683
|
+
const keys = Object.keys(moduleInfos);
|
|
684
|
+
for (const key of keys) delete nativeGlobal.__FEDERATION__.moduleInfo[key];
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
var getRemoteEntryExports = (name, globalName) => {
|
|
688
|
+
const remoteEntryKey = globalName || `__FEDERATION_${name}:custom__`;
|
|
689
|
+
return {
|
|
690
|
+
remoteEntryKey,
|
|
691
|
+
entryExports: CurrentGlobal[remoteEntryKey]
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
var getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__;
|
|
695
|
+
var getPreloaded = (id) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(id);
|
|
696
|
+
var setPreloaded = (id) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(id, true);
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/constants.js
|
|
699
|
+
var buildIdentifier = "[0-9A-Za-z-]+";
|
|
700
|
+
var build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`;
|
|
701
|
+
var numericIdentifier = "0|[1-9]\\d*";
|
|
702
|
+
var numericIdentifierLoose = "[0-9]+";
|
|
703
|
+
var nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
|
|
704
|
+
var preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;
|
|
705
|
+
var preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`;
|
|
706
|
+
var preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`;
|
|
707
|
+
var preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`;
|
|
708
|
+
var xRangeIdentifier = `${numericIdentifier}|x|X|\\*`;
|
|
709
|
+
var xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;
|
|
710
|
+
var hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`;
|
|
711
|
+
var loosePlain = `[v=\\s]*${`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`}${preReleaseLoose}?${build}?`;
|
|
712
|
+
var gtlt = "((?:<|>)?=?)";
|
|
713
|
+
var comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`;
|
|
714
|
+
var loneTilde = "(?:~>?)";
|
|
715
|
+
var tildeTrim = `(\\s*)${loneTilde}\\s+`;
|
|
716
|
+
var loneCaret = "(?:\\^)";
|
|
717
|
+
var caretTrim = `(\\s*)${loneCaret}\\s+`;
|
|
718
|
+
var star = "(<|>)?=?\\s*\\*";
|
|
719
|
+
var caret = `^${loneCaret}${xRangePlain}$`;
|
|
720
|
+
var fullPlain = `v?${`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`}${preRelease}?${build}?`;
|
|
721
|
+
var tilde = `^${loneTilde}${xRangePlain}$`;
|
|
722
|
+
var xRange = `^${gtlt}\\s*${xRangePlain}$`;
|
|
723
|
+
var comparator = `^${gtlt}\\s*(${fullPlain})$|^$`;
|
|
724
|
+
var gte0 = "^\\s*>=\\s*0.0.0\\s*$";
|
|
725
|
+
//#endregion
|
|
726
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/utils.js
|
|
727
|
+
function parseRegex(source) {
|
|
728
|
+
return new RegExp(source);
|
|
729
|
+
}
|
|
730
|
+
function isXVersion(version) {
|
|
731
|
+
return !version || version.toLowerCase() === "x" || version === "*";
|
|
732
|
+
}
|
|
733
|
+
function pipe(...fns) {
|
|
734
|
+
return (x) => fns.reduce((v, f) => f(v), x);
|
|
735
|
+
}
|
|
736
|
+
function extractComparator(comparatorString) {
|
|
737
|
+
return comparatorString.match(parseRegex(comparator));
|
|
738
|
+
}
|
|
739
|
+
function combineVersion(major, minor, patch, preRelease) {
|
|
740
|
+
const mainVersion = `${major}.${minor}.${patch}`;
|
|
741
|
+
if (preRelease) return `${mainVersion}-${preRelease}`;
|
|
742
|
+
return mainVersion;
|
|
743
|
+
}
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/parser.js
|
|
746
|
+
function parseHyphen(range) {
|
|
747
|
+
return range.replace(parseRegex(hyphenRange), (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease) => {
|
|
748
|
+
if (isXVersion(fromMajor)) from = "";
|
|
749
|
+
else if (isXVersion(fromMinor)) from = `>=${fromMajor}.0.0`;
|
|
750
|
+
else if (isXVersion(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0`;
|
|
751
|
+
else from = `>=${from}`;
|
|
752
|
+
if (isXVersion(toMajor)) to = "";
|
|
753
|
+
else if (isXVersion(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
754
|
+
else if (isXVersion(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
755
|
+
else if (toPreRelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`;
|
|
756
|
+
else to = `<=${to}`;
|
|
757
|
+
return `${from} ${to}`.trim();
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
function parseComparatorTrim(range) {
|
|
761
|
+
return range.replace(parseRegex(comparatorTrim), "$1$2$3");
|
|
762
|
+
}
|
|
763
|
+
function parseTildeTrim(range) {
|
|
764
|
+
return range.replace(parseRegex(tildeTrim), "$1~");
|
|
765
|
+
}
|
|
766
|
+
function parseCaretTrim(range) {
|
|
767
|
+
return range.replace(parseRegex(caretTrim), "$1^");
|
|
768
|
+
}
|
|
769
|
+
function parseCarets(range) {
|
|
770
|
+
return range.trim().split(/\s+/).map((rangeVersion) => rangeVersion.replace(parseRegex(caret), (_, major, minor, patch, preRelease) => {
|
|
771
|
+
if (isXVersion(major)) return "";
|
|
772
|
+
else if (isXVersion(minor)) return `>=${major}.0.0 <${Number(major) + 1}.0.0-0`;
|
|
773
|
+
else if (isXVersion(patch)) if (major === "0") return `>=${major}.${minor}.0 <${major}.${Number(minor) + 1}.0-0`;
|
|
774
|
+
else return `>=${major}.${minor}.0 <${Number(major) + 1}.0.0-0`;
|
|
775
|
+
else if (preRelease) if (major === "0") if (minor === "0") return `>=${major}.${minor}.${patch}-${preRelease} <${major}.${minor}.${Number(patch) + 1}-0`;
|
|
776
|
+
else return `>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
777
|
+
else return `>=${major}.${minor}.${patch}-${preRelease} <${Number(major) + 1}.0.0-0`;
|
|
778
|
+
else {
|
|
779
|
+
if (major === "0") if (minor === "0") return `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0`;
|
|
780
|
+
else return `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
781
|
+
return `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
782
|
+
}
|
|
783
|
+
})).join(" ");
|
|
784
|
+
}
|
|
785
|
+
function parseTildes(range) {
|
|
786
|
+
return range.trim().split(/\s+/).map((rangeVersion) => rangeVersion.replace(parseRegex(tilde), (_, major, minor, patch, preRelease) => {
|
|
787
|
+
if (isXVersion(major)) return "";
|
|
788
|
+
else if (isXVersion(minor)) return `>=${major}.0.0 <${Number(major) + 1}.0.0-0`;
|
|
789
|
+
else if (isXVersion(patch)) return `>=${major}.${minor}.0 <${major}.${Number(minor) + 1}.0-0`;
|
|
790
|
+
else if (preRelease) return `>=${major}.${minor}.${patch}-${preRelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
791
|
+
return `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
792
|
+
})).join(" ");
|
|
793
|
+
}
|
|
794
|
+
function parseXRanges(range) {
|
|
795
|
+
return range.split(/\s+/).map((rangeVersion) => rangeVersion.trim().replace(parseRegex(xRange), (ret, gtlt, major, minor, patch, preRelease) => {
|
|
796
|
+
const isXMajor = isXVersion(major);
|
|
797
|
+
const isXMinor = isXMajor || isXVersion(minor);
|
|
798
|
+
const isXPatch = isXMinor || isXVersion(patch);
|
|
799
|
+
if (gtlt === "=" && isXPatch) gtlt = "";
|
|
800
|
+
preRelease = "";
|
|
801
|
+
if (isXMajor) if (gtlt === ">" || gtlt === "<") return "<0.0.0-0";
|
|
802
|
+
else return "*";
|
|
803
|
+
else if (gtlt && isXPatch) {
|
|
804
|
+
if (isXMinor) minor = 0;
|
|
805
|
+
patch = 0;
|
|
806
|
+
if (gtlt === ">") {
|
|
807
|
+
gtlt = ">=";
|
|
808
|
+
if (isXMinor) {
|
|
809
|
+
major = Number(major) + 1;
|
|
810
|
+
minor = 0;
|
|
811
|
+
patch = 0;
|
|
812
|
+
} else {
|
|
813
|
+
minor = Number(minor) + 1;
|
|
814
|
+
patch = 0;
|
|
815
|
+
}
|
|
816
|
+
} else if (gtlt === "<=") {
|
|
817
|
+
gtlt = "<";
|
|
818
|
+
if (isXMinor) major = Number(major) + 1;
|
|
819
|
+
else minor = Number(minor) + 1;
|
|
820
|
+
}
|
|
821
|
+
if (gtlt === "<") preRelease = "-0";
|
|
822
|
+
return `${gtlt + major}.${minor}.${patch}${preRelease}`;
|
|
823
|
+
} else if (isXMinor) return `>=${major}.0.0${preRelease} <${Number(major) + 1}.0.0-0`;
|
|
824
|
+
else if (isXPatch) return `>=${major}.${minor}.0${preRelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
825
|
+
return ret;
|
|
826
|
+
})).join(" ");
|
|
827
|
+
}
|
|
828
|
+
function parseStar(range) {
|
|
829
|
+
return range.trim().replace(parseRegex(star), "");
|
|
830
|
+
}
|
|
831
|
+
function parseGTE0(comparatorString) {
|
|
832
|
+
return comparatorString.trim().replace(parseRegex(gte0), "");
|
|
833
|
+
}
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/compare.js
|
|
836
|
+
function compareAtom(rangeAtom, versionAtom) {
|
|
837
|
+
rangeAtom = Number(rangeAtom) || rangeAtom;
|
|
838
|
+
versionAtom = Number(versionAtom) || versionAtom;
|
|
839
|
+
if (rangeAtom > versionAtom) return 1;
|
|
840
|
+
if (rangeAtom === versionAtom) return 0;
|
|
841
|
+
return -1;
|
|
842
|
+
}
|
|
843
|
+
function comparePreRelease(rangeAtom, versionAtom) {
|
|
844
|
+
const { preRelease: rangePreRelease } = rangeAtom;
|
|
845
|
+
const { preRelease: versionPreRelease } = versionAtom;
|
|
846
|
+
if (rangePreRelease === void 0 && Boolean(versionPreRelease)) return 1;
|
|
847
|
+
if (Boolean(rangePreRelease) && versionPreRelease === void 0) return -1;
|
|
848
|
+
if (rangePreRelease === void 0 && versionPreRelease === void 0) return 0;
|
|
849
|
+
for (let i = 0, n = rangePreRelease.length; i <= n; i++) {
|
|
850
|
+
const rangeElement = rangePreRelease[i];
|
|
851
|
+
const versionElement = versionPreRelease[i];
|
|
852
|
+
if (rangeElement === versionElement) continue;
|
|
853
|
+
if (rangeElement === void 0 && versionElement === void 0) return 0;
|
|
854
|
+
if (!rangeElement) return 1;
|
|
855
|
+
if (!versionElement) return -1;
|
|
856
|
+
return compareAtom(rangeElement, versionElement);
|
|
857
|
+
}
|
|
858
|
+
return 0;
|
|
859
|
+
}
|
|
860
|
+
function compareVersion(rangeAtom, versionAtom) {
|
|
861
|
+
return compareAtom(rangeAtom.major, versionAtom.major) || compareAtom(rangeAtom.minor, versionAtom.minor) || compareAtom(rangeAtom.patch, versionAtom.patch) || comparePreRelease(rangeAtom, versionAtom);
|
|
862
|
+
}
|
|
863
|
+
function eq(rangeAtom, versionAtom) {
|
|
864
|
+
return rangeAtom.version === versionAtom.version;
|
|
865
|
+
}
|
|
866
|
+
function compare(rangeAtom, versionAtom) {
|
|
867
|
+
switch (rangeAtom.operator) {
|
|
868
|
+
case "":
|
|
869
|
+
case "=": return eq(rangeAtom, versionAtom);
|
|
870
|
+
case ">": return compareVersion(rangeAtom, versionAtom) < 0;
|
|
871
|
+
case ">=": return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) < 0;
|
|
872
|
+
case "<": return compareVersion(rangeAtom, versionAtom) > 0;
|
|
873
|
+
case "<=": return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) > 0;
|
|
874
|
+
case void 0: return true;
|
|
875
|
+
default: return false;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/semver/index.js
|
|
880
|
+
function parseComparatorString(range) {
|
|
881
|
+
return pipe(parseCarets, parseTildes, parseXRanges, parseStar)(range);
|
|
882
|
+
}
|
|
883
|
+
function parseRange(range) {
|
|
884
|
+
return pipe(parseHyphen, parseComparatorTrim, parseTildeTrim, parseCaretTrim)(range.trim()).split(/\s+/).join(" ");
|
|
885
|
+
}
|
|
886
|
+
function satisfy(version, range) {
|
|
887
|
+
if (!version) return false;
|
|
888
|
+
const extractedVersion = extractComparator(version);
|
|
889
|
+
if (!extractedVersion) return false;
|
|
890
|
+
const [, versionOperator, , versionMajor, versionMinor, versionPatch, versionPreRelease] = extractedVersion;
|
|
891
|
+
const versionAtom = {
|
|
892
|
+
operator: versionOperator,
|
|
893
|
+
version: combineVersion(versionMajor, versionMinor, versionPatch, versionPreRelease),
|
|
894
|
+
major: versionMajor,
|
|
895
|
+
minor: versionMinor,
|
|
896
|
+
patch: versionPatch,
|
|
897
|
+
preRelease: versionPreRelease?.split(".")
|
|
898
|
+
};
|
|
899
|
+
const orRanges = range.split("||");
|
|
900
|
+
for (const orRange of orRanges) {
|
|
901
|
+
const trimmedOrRange = orRange.trim();
|
|
902
|
+
if (!trimmedOrRange) return true;
|
|
903
|
+
if (trimmedOrRange === "*" || trimmedOrRange === "x") return true;
|
|
904
|
+
try {
|
|
905
|
+
const parsedSubRange = parseRange(trimmedOrRange);
|
|
906
|
+
if (!parsedSubRange.trim()) return true;
|
|
907
|
+
const parsedComparatorString = parsedSubRange.split(" ").map((rangeVersion) => parseComparatorString(rangeVersion)).join(" ");
|
|
908
|
+
if (!parsedComparatorString.trim()) return true;
|
|
909
|
+
const comparators = parsedComparatorString.split(/\s+/).map((comparator) => parseGTE0(comparator)).filter(Boolean);
|
|
910
|
+
if (comparators.length === 0) continue;
|
|
911
|
+
let subRangeSatisfied = true;
|
|
912
|
+
for (const comparator of comparators) {
|
|
913
|
+
const extractedComparator = extractComparator(comparator);
|
|
914
|
+
if (!extractedComparator) {
|
|
915
|
+
subRangeSatisfied = false;
|
|
916
|
+
break;
|
|
917
|
+
}
|
|
918
|
+
const [, rangeOperator, , rangeMajor, rangeMinor, rangePatch, rangePreRelease] = extractedComparator;
|
|
919
|
+
if (!compare({
|
|
920
|
+
operator: rangeOperator,
|
|
921
|
+
version: combineVersion(rangeMajor, rangeMinor, rangePatch, rangePreRelease),
|
|
922
|
+
major: rangeMajor,
|
|
923
|
+
minor: rangeMinor,
|
|
924
|
+
patch: rangePatch,
|
|
925
|
+
preRelease: rangePreRelease?.split(".")
|
|
926
|
+
}, versionAtom)) {
|
|
927
|
+
subRangeSatisfied = false;
|
|
928
|
+
break;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
if (subRangeSatisfied) return true;
|
|
932
|
+
} catch (e) {
|
|
933
|
+
console.error(`[semver] Error processing range part "${trimmedOrRange}":`, e);
|
|
934
|
+
continue;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
return false;
|
|
938
|
+
}
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/constant.js
|
|
941
|
+
var DEFAULT_SCOPE = "default";
|
|
942
|
+
var DEFAULT_REMOTE_TYPE = "global";
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/share.js
|
|
945
|
+
function formatShare(shareArgs, from, name, shareStrategy) {
|
|
946
|
+
let get;
|
|
947
|
+
if ("get" in shareArgs) get = shareArgs.get;
|
|
948
|
+
else if ("lib" in shareArgs) get = () => Promise.resolve(shareArgs.lib);
|
|
949
|
+
else get = () => Promise.resolve(() => {
|
|
950
|
+
error(`Cannot get shared "${name}" from "${from}": neither "get" nor "lib" is provided in the share config.`);
|
|
951
|
+
});
|
|
952
|
+
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.`);
|
|
953
|
+
return {
|
|
954
|
+
deps: [],
|
|
955
|
+
useIn: [],
|
|
956
|
+
from,
|
|
957
|
+
loading: null,
|
|
958
|
+
...shareArgs,
|
|
959
|
+
shareConfig: {
|
|
960
|
+
requiredVersion: `^${shareArgs.version}`,
|
|
961
|
+
singleton: false,
|
|
962
|
+
eager: false,
|
|
963
|
+
strictVersion: false,
|
|
964
|
+
...shareArgs.shareConfig
|
|
965
|
+
},
|
|
966
|
+
get,
|
|
967
|
+
loaded: shareArgs?.loaded || "lib" in shareArgs ? true : void 0,
|
|
968
|
+
version: shareArgs.version ?? "0",
|
|
969
|
+
scope: Array.isArray(shareArgs.scope) ? shareArgs.scope : [shareArgs.scope ?? "default"],
|
|
970
|
+
strategy: (shareArgs.strategy ?? shareStrategy) || "version-first",
|
|
971
|
+
treeShaking: shareArgs.treeShaking ? {
|
|
972
|
+
...shareArgs.treeShaking,
|
|
973
|
+
mode: shareArgs.treeShaking.mode ?? "server-calc",
|
|
974
|
+
status: shareArgs.treeShaking.status ?? TreeShakingStatus.UNKNOWN,
|
|
975
|
+
useIn: []
|
|
976
|
+
} : void 0
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
function formatShareConfigs(prevOptions, newOptions) {
|
|
980
|
+
const shareArgs = newOptions.shared || {};
|
|
981
|
+
const from = newOptions.name;
|
|
982
|
+
const newShareInfos = Object.keys(shareArgs).reduce((res, pkgName) => {
|
|
983
|
+
const arrayShareArgs = arrayOptions(shareArgs[pkgName]);
|
|
984
|
+
res[pkgName] = res[pkgName] || [];
|
|
985
|
+
arrayShareArgs.forEach((shareConfig) => {
|
|
986
|
+
res[pkgName].push(formatShare(shareConfig, from, pkgName, newOptions.shareStrategy));
|
|
987
|
+
});
|
|
988
|
+
return res;
|
|
989
|
+
}, {});
|
|
990
|
+
const allShareInfos = { ...prevOptions.shared };
|
|
991
|
+
Object.keys(newShareInfos).forEach((shareKey) => {
|
|
992
|
+
if (!allShareInfos[shareKey]) allShareInfos[shareKey] = newShareInfos[shareKey];
|
|
993
|
+
else newShareInfos[shareKey].forEach((newUserSharedOptions) => {
|
|
994
|
+
if (!allShareInfos[shareKey].find((sharedVal) => sharedVal.version === newUserSharedOptions.version)) allShareInfos[shareKey].push(newUserSharedOptions);
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
return {
|
|
998
|
+
allShareInfos,
|
|
999
|
+
newShareInfos
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
function shouldUseTreeShaking(treeShaking, usedExports) {
|
|
1003
|
+
if (!treeShaking) return false;
|
|
1004
|
+
const { status, mode } = treeShaking;
|
|
1005
|
+
if (status === TreeShakingStatus.NO_USE) return false;
|
|
1006
|
+
if (status === TreeShakingStatus.CALCULATED) return true;
|
|
1007
|
+
if (mode === "runtime-infer") {
|
|
1008
|
+
if (!usedExports) return true;
|
|
1009
|
+
return isMatchUsedExports(treeShaking, usedExports);
|
|
1010
|
+
}
|
|
1011
|
+
return false;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* compare version a and b, return true if a is less than b
|
|
1015
|
+
*/
|
|
1016
|
+
function versionLt(a, b) {
|
|
1017
|
+
const transformInvalidVersion = (version) => {
|
|
1018
|
+
if (!Number.isNaN(Number(version))) {
|
|
1019
|
+
const splitArr = version.split(".");
|
|
1020
|
+
let validVersion = version;
|
|
1021
|
+
for (let i = 0; i < 3 - splitArr.length; i++) validVersion += ".0";
|
|
1022
|
+
return validVersion;
|
|
1023
|
+
}
|
|
1024
|
+
return version;
|
|
1025
|
+
};
|
|
1026
|
+
if (satisfy(transformInvalidVersion(a), `<=${transformInvalidVersion(b)}`)) return true;
|
|
1027
|
+
else return false;
|
|
1028
|
+
}
|
|
1029
|
+
var findVersion = (shareVersionMap, cb) => {
|
|
1030
|
+
const callback = cb || function(prev, cur) {
|
|
1031
|
+
return versionLt(prev, cur);
|
|
1032
|
+
};
|
|
1033
|
+
return Object.keys(shareVersionMap).reduce((prev, cur) => {
|
|
1034
|
+
if (!prev) return cur;
|
|
1035
|
+
if (callback(prev, cur)) return cur;
|
|
1036
|
+
if (prev === "0") return cur;
|
|
1037
|
+
return prev;
|
|
1038
|
+
}, 0);
|
|
1039
|
+
};
|
|
1040
|
+
var isLoaded = (shared) => {
|
|
1041
|
+
return Boolean(shared.loaded) || typeof shared.lib === "function";
|
|
1042
|
+
};
|
|
1043
|
+
var isLoading = (shared) => {
|
|
1044
|
+
return Boolean(shared.loading);
|
|
1045
|
+
};
|
|
1046
|
+
var isMatchUsedExports = (treeShaking, usedExports) => {
|
|
1047
|
+
if (!treeShaking || !usedExports) return false;
|
|
1048
|
+
const { usedExports: treeShakingUsedExports } = treeShaking;
|
|
1049
|
+
if (!treeShakingUsedExports) return false;
|
|
1050
|
+
if (usedExports.every((e) => treeShakingUsedExports.includes(e))) return true;
|
|
1051
|
+
return false;
|
|
1052
|
+
};
|
|
1053
|
+
function findSingletonVersionOrderByVersion(shareScopeMap, scope, pkgName, treeShaking) {
|
|
1054
|
+
const versions = shareScopeMap[scope][pkgName];
|
|
1055
|
+
let version = "";
|
|
1056
|
+
let useTreesShaking = shouldUseTreeShaking(treeShaking);
|
|
1057
|
+
const callback = function(prev, cur) {
|
|
1058
|
+
if (useTreesShaking) {
|
|
1059
|
+
if (!versions[prev].treeShaking) return true;
|
|
1060
|
+
if (!versions[cur].treeShaking) return false;
|
|
1061
|
+
return !isLoaded(versions[prev].treeShaking) && versionLt(prev, cur);
|
|
1062
|
+
}
|
|
1063
|
+
return !isLoaded(versions[prev]) && versionLt(prev, cur);
|
|
1064
|
+
};
|
|
1065
|
+
if (useTreesShaking) {
|
|
1066
|
+
version = findVersion(shareScopeMap[scope][pkgName], callback);
|
|
1067
|
+
if (version) return {
|
|
1068
|
+
version,
|
|
1069
|
+
useTreesShaking
|
|
1070
|
+
};
|
|
1071
|
+
useTreesShaking = false;
|
|
1072
|
+
}
|
|
1073
|
+
return {
|
|
1074
|
+
version: findVersion(shareScopeMap[scope][pkgName], callback),
|
|
1075
|
+
useTreesShaking
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
var isLoadingOrLoaded = (shared) => {
|
|
1079
|
+
return isLoaded(shared) || isLoading(shared);
|
|
1080
|
+
};
|
|
1081
|
+
function findSingletonVersionOrderByLoaded(shareScopeMap, scope, pkgName, treeShaking) {
|
|
1082
|
+
const versions = shareScopeMap[scope][pkgName];
|
|
1083
|
+
let version = "";
|
|
1084
|
+
let useTreesShaking = shouldUseTreeShaking(treeShaking);
|
|
1085
|
+
const callback = function(prev, cur) {
|
|
1086
|
+
if (useTreesShaking) {
|
|
1087
|
+
if (!versions[prev].treeShaking) return true;
|
|
1088
|
+
if (!versions[cur].treeShaking) return false;
|
|
1089
|
+
if (isLoadingOrLoaded(versions[cur].treeShaking)) if (isLoadingOrLoaded(versions[prev].treeShaking)) return Boolean(versionLt(prev, cur));
|
|
1090
|
+
else return true;
|
|
1091
|
+
if (isLoadingOrLoaded(versions[prev].treeShaking)) return false;
|
|
1092
|
+
}
|
|
1093
|
+
if (isLoadingOrLoaded(versions[cur])) if (isLoadingOrLoaded(versions[prev])) return Boolean(versionLt(prev, cur));
|
|
1094
|
+
else return true;
|
|
1095
|
+
if (isLoadingOrLoaded(versions[prev])) return false;
|
|
1096
|
+
return versionLt(prev, cur);
|
|
1097
|
+
};
|
|
1098
|
+
if (useTreesShaking) {
|
|
1099
|
+
version = findVersion(shareScopeMap[scope][pkgName], callback);
|
|
1100
|
+
if (version) return {
|
|
1101
|
+
version,
|
|
1102
|
+
useTreesShaking
|
|
1103
|
+
};
|
|
1104
|
+
useTreesShaking = false;
|
|
1105
|
+
}
|
|
1106
|
+
return {
|
|
1107
|
+
version: findVersion(shareScopeMap[scope][pkgName], callback),
|
|
1108
|
+
useTreesShaking
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
function getFindShareFunction(strategy) {
|
|
1112
|
+
if (strategy === "loaded-first") return findSingletonVersionOrderByLoaded;
|
|
1113
|
+
return findSingletonVersionOrderByVersion;
|
|
1114
|
+
}
|
|
1115
|
+
function getRegisteredShare(localShareScopeMap, pkgName, shareInfo, resolveShare) {
|
|
1116
|
+
if (!localShareScopeMap) return;
|
|
1117
|
+
const { shareConfig, scope = DEFAULT_SCOPE, strategy, treeShaking } = shareInfo;
|
|
1118
|
+
const scopes = Array.isArray(scope) ? scope : [scope];
|
|
1119
|
+
for (const sc of scopes) if (shareConfig && localShareScopeMap[sc] && localShareScopeMap[sc][pkgName]) {
|
|
1120
|
+
const { requiredVersion } = shareConfig;
|
|
1121
|
+
const { version: maxOrSingletonVersion, useTreesShaking } = getFindShareFunction(strategy)(localShareScopeMap, sc, pkgName, treeShaking);
|
|
1122
|
+
const defaultResolver = () => {
|
|
1123
|
+
const shared = localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
|
|
1124
|
+
if (shareConfig.singleton) {
|
|
1125
|
+
if (typeof requiredVersion === "string" && !satisfy(maxOrSingletonVersion, requiredVersion)) {
|
|
1126
|
+
const msg = `Version ${maxOrSingletonVersion} from ${maxOrSingletonVersion && shared.from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`;
|
|
1127
|
+
if (shareConfig.strictVersion) error(msg);
|
|
1128
|
+
else warn$1(msg);
|
|
1129
|
+
}
|
|
1130
|
+
return {
|
|
1131
|
+
shared,
|
|
1132
|
+
useTreesShaking
|
|
1133
|
+
};
|
|
1134
|
+
} else {
|
|
1135
|
+
if (requiredVersion === false || requiredVersion === "*") return {
|
|
1136
|
+
shared,
|
|
1137
|
+
useTreesShaking
|
|
1138
|
+
};
|
|
1139
|
+
if (satisfy(maxOrSingletonVersion, requiredVersion)) return {
|
|
1140
|
+
shared,
|
|
1141
|
+
useTreesShaking
|
|
1142
|
+
};
|
|
1143
|
+
const _usedTreeShaking = shouldUseTreeShaking(treeShaking);
|
|
1144
|
+
if (_usedTreeShaking) for (const [versionKey, versionValue] of Object.entries(localShareScopeMap[sc][pkgName])) {
|
|
1145
|
+
if (!shouldUseTreeShaking(versionValue.treeShaking, treeShaking?.usedExports)) continue;
|
|
1146
|
+
if (satisfy(versionKey, requiredVersion)) return {
|
|
1147
|
+
shared: versionValue,
|
|
1148
|
+
useTreesShaking: _usedTreeShaking
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
for (const [versionKey, versionValue] of Object.entries(localShareScopeMap[sc][pkgName])) if (satisfy(versionKey, requiredVersion)) return {
|
|
1152
|
+
shared: versionValue,
|
|
1153
|
+
useTreesShaking: false
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
const params = {
|
|
1158
|
+
shareScopeMap: localShareScopeMap,
|
|
1159
|
+
scope: sc,
|
|
1160
|
+
pkgName,
|
|
1161
|
+
version: maxOrSingletonVersion,
|
|
1162
|
+
GlobalFederation: Global.__FEDERATION__,
|
|
1163
|
+
shareInfo,
|
|
1164
|
+
resolver: defaultResolver
|
|
1165
|
+
};
|
|
1166
|
+
return (resolveShare.emit(params) || params).resolver();
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
function getGlobalShareScope() {
|
|
1170
|
+
return Global.__FEDERATION__.__SHARE__;
|
|
1171
|
+
}
|
|
1172
|
+
function getTargetSharedOptions(options) {
|
|
1173
|
+
const { pkgName, extraOptions, shareInfos } = options;
|
|
1174
|
+
const defaultResolver = (sharedOptions) => {
|
|
1175
|
+
if (!sharedOptions) return;
|
|
1176
|
+
const shareVersionMap = {};
|
|
1177
|
+
sharedOptions.forEach((shared) => {
|
|
1178
|
+
shareVersionMap[shared.version] = shared;
|
|
1179
|
+
});
|
|
1180
|
+
const callback = function(prev, cur) {
|
|
1181
|
+
return !isLoaded(shareVersionMap[prev]) && versionLt(prev, cur);
|
|
1182
|
+
};
|
|
1183
|
+
return shareVersionMap[findVersion(shareVersionMap, callback)];
|
|
1184
|
+
};
|
|
1185
|
+
const resolver = extraOptions?.resolver ?? defaultResolver;
|
|
1186
|
+
const isPlainObject = (val) => {
|
|
1187
|
+
return val !== null && typeof val === "object" && !Array.isArray(val);
|
|
1188
|
+
};
|
|
1189
|
+
const merge = (...sources) => {
|
|
1190
|
+
const out = {};
|
|
1191
|
+
for (const src of sources) {
|
|
1192
|
+
if (!src) continue;
|
|
1193
|
+
for (const [key, value] of Object.entries(src)) {
|
|
1194
|
+
const prev = out[key];
|
|
1195
|
+
if (isPlainObject(prev) && isPlainObject(value)) out[key] = merge(prev, value);
|
|
1196
|
+
else if (value !== void 0) out[key] = value;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
return out;
|
|
1200
|
+
};
|
|
1201
|
+
return merge(resolver(shareInfos[pkgName]), extraOptions?.customShareInfo);
|
|
1202
|
+
}
|
|
1203
|
+
var addUseIn = (shared, from) => {
|
|
1204
|
+
if (!shared.useIn) shared.useIn = [];
|
|
1205
|
+
addUniqueItem(shared.useIn, from);
|
|
1206
|
+
};
|
|
1207
|
+
function directShare(shared, useTreesShaking) {
|
|
1208
|
+
if (useTreesShaking && shared.treeShaking) return shared.treeShaking;
|
|
1209
|
+
return shared;
|
|
1210
|
+
}
|
|
1211
|
+
//#endregion
|
|
1212
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/manifest.js
|
|
1213
|
+
function composeRemoteRequestId(remoteName, expose) {
|
|
1214
|
+
if (!expose || expose === ".") return remoteName;
|
|
1215
|
+
return `${remoteName}/${expose.replace(/^\.\//, "")}`;
|
|
1216
|
+
}
|
|
1217
|
+
function matchRemoteWithNameAndExpose(remotes, id) {
|
|
1218
|
+
for (const remote of remotes) {
|
|
1219
|
+
const isNameMatched = id.startsWith(remote.name);
|
|
1220
|
+
let expose = id.replace(remote.name, "");
|
|
1221
|
+
if (isNameMatched) {
|
|
1222
|
+
if (expose.startsWith("/")) {
|
|
1223
|
+
const pkgNameOrAlias = remote.name;
|
|
1224
|
+
expose = `.${expose}`;
|
|
1225
|
+
return {
|
|
1226
|
+
pkgNameOrAlias,
|
|
1227
|
+
expose,
|
|
1228
|
+
remote
|
|
1229
|
+
};
|
|
1230
|
+
} else if (expose === "") return {
|
|
1231
|
+
pkgNameOrAlias: remote.name,
|
|
1232
|
+
expose: ".",
|
|
1233
|
+
remote
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
const isAliasMatched = remote.alias && id.startsWith(remote.alias);
|
|
1237
|
+
let exposeWithAlias = remote.alias && id.replace(remote.alias, "");
|
|
1238
|
+
if (remote.alias && isAliasMatched) {
|
|
1239
|
+
if (exposeWithAlias && exposeWithAlias.startsWith("/")) {
|
|
1240
|
+
const pkgNameOrAlias = remote.alias;
|
|
1241
|
+
exposeWithAlias = `.${exposeWithAlias}`;
|
|
1242
|
+
return {
|
|
1243
|
+
pkgNameOrAlias,
|
|
1244
|
+
expose: exposeWithAlias,
|
|
1245
|
+
remote
|
|
1246
|
+
};
|
|
1247
|
+
} else if (exposeWithAlias === "") return {
|
|
1248
|
+
pkgNameOrAlias: remote.alias,
|
|
1249
|
+
expose: ".",
|
|
1250
|
+
remote
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
function matchRemote(remotes, nameOrAlias) {
|
|
1256
|
+
for (const remote of remotes) {
|
|
1257
|
+
if (nameOrAlias === remote.name) return remote;
|
|
1258
|
+
if (remote.alias && nameOrAlias === remote.alias) return remote;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
//#endregion
|
|
1262
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.7.0/node_modules/@module-federation/error-codes/dist/error-codes.mjs
|
|
1263
|
+
var RUNTIME_001 = "RUNTIME-001";
|
|
1264
|
+
var RUNTIME_002 = "RUNTIME-002";
|
|
1265
|
+
var RUNTIME_003 = "RUNTIME-003";
|
|
1266
|
+
var RUNTIME_004 = "RUNTIME-004";
|
|
1267
|
+
var RUNTIME_005 = "RUNTIME-005";
|
|
1268
|
+
var RUNTIME_006 = "RUNTIME-006";
|
|
1269
|
+
var RUNTIME_007 = "RUNTIME-007";
|
|
1270
|
+
var RUNTIME_008 = "RUNTIME-008";
|
|
1271
|
+
var RUNTIME_009 = "RUNTIME-009";
|
|
1272
|
+
var RUNTIME_010 = "RUNTIME-010";
|
|
1273
|
+
var RUNTIME_011 = "RUNTIME-011";
|
|
1274
|
+
var RUNTIME_012 = "RUNTIME-012";
|
|
1275
|
+
var RUNTIME_013 = "RUNTIME-013";
|
|
1276
|
+
var RUNTIME_014 = "RUNTIME-014";
|
|
1277
|
+
var RUNTIME_015 = "RUNTIME-015";
|
|
1278
|
+
var TYPE_001 = "TYPE-001";
|
|
1279
|
+
var BUILD_001 = "BUILD-001";
|
|
1280
|
+
var BUILD_002 = "BUILD-002";
|
|
1281
|
+
//#endregion
|
|
1282
|
+
//#region ../../node_modules/.pnpm/@module-federation+error-codes@2.7.0/node_modules/@module-federation/error-codes/dist/desc.mjs
|
|
1283
|
+
var runtimeDescMap = {
|
|
1284
|
+
[RUNTIME_001]: "Failed to get remoteEntry exports.",
|
|
1285
|
+
[RUNTIME_002]: "The remote entry interface does not contain \"init\"",
|
|
1286
|
+
[RUNTIME_003]: "Failed to get manifest.",
|
|
1287
|
+
[RUNTIME_004]: "Failed to locate remote.",
|
|
1288
|
+
[RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
|
|
1289
|
+
[RUNTIME_006]: "Invalid loadShareSync function call from runtime",
|
|
1290
|
+
[RUNTIME_007]: "Failed to get remote snapshot.",
|
|
1291
|
+
[RUNTIME_008]: "Failed to load script resources.",
|
|
1292
|
+
[RUNTIME_009]: "Please call createInstance first.",
|
|
1293
|
+
[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.",
|
|
1294
|
+
[RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
1295
|
+
[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.",
|
|
1296
|
+
[RUNTIME_013]: "The manifest is not a valid Module Federation manifest.",
|
|
1297
|
+
[RUNTIME_014]: "The remote does not expose the requested module.",
|
|
1298
|
+
[RUNTIME_015]: "Remote container initialization failed."
|
|
1299
|
+
};
|
|
1300
|
+
var typeDescMap = { [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." };
|
|
1301
|
+
var buildDescMap = {
|
|
1302
|
+
[BUILD_001]: "Failed to find expose module.",
|
|
1303
|
+
[BUILD_002]: "PublicPath is required in prod mode."
|
|
1304
|
+
};
|
|
1305
|
+
({
|
|
1306
|
+
...runtimeDescMap,
|
|
1307
|
+
...typeDescMap,
|
|
1308
|
+
...buildDescMap
|
|
1309
|
+
});
|
|
1310
|
+
//#endregion
|
|
1311
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/load.js
|
|
1312
|
+
var importCallback = ".then(callbacks[0]).catch(callbacks[1])";
|
|
1313
|
+
async function loadEsmEntry({ entry, remoteEntryExports }) {
|
|
1314
|
+
return new Promise((resolve, reject) => {
|
|
1315
|
+
try {
|
|
1316
|
+
if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${entry}")${importCallback}`)([resolve, reject]);
|
|
1317
|
+
else __vitePreload(() => import(
|
|
1318
|
+
/* webpackIgnore: true */
|
|
1319
|
+
/* @vite-ignore */
|
|
1320
|
+
entry
|
|
1321
|
+
).then(resolve), [], import.meta.url).catch(reject);
|
|
1322
|
+
else resolve(remoteEntryExports);
|
|
1323
|
+
} catch (e) {
|
|
1324
|
+
error(`Failed to load ESM entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
async function loadSystemJsEntry({ entry, remoteEntryExports }) {
|
|
1329
|
+
return new Promise((resolve, reject) => {
|
|
1330
|
+
try {
|
|
1331
|
+
if (!remoteEntryExports) if (typeof __system_context__ === "undefined") System.import(entry).then(resolve).catch(reject);
|
|
1332
|
+
else new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);
|
|
1333
|
+
else resolve(remoteEntryExports);
|
|
1334
|
+
} catch (e) {
|
|
1335
|
+
error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
function handleRemoteEntryLoaded(name, globalName, entry) {
|
|
1340
|
+
const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);
|
|
1341
|
+
if (!entryExports) error(RUNTIME_001, runtimeDescMap, {
|
|
1342
|
+
remoteName: name,
|
|
1343
|
+
remoteEntryUrl: entry,
|
|
1344
|
+
remoteEntryKey
|
|
1345
|
+
});
|
|
1346
|
+
return entryExports;
|
|
1347
|
+
}
|
|
1348
|
+
async function loadEntryScript({ name, globalName, entry, remoteInfo, loaderHook, getEntryUrl, resourceContext }) {
|
|
1349
|
+
const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);
|
|
1350
|
+
if (remoteEntryExports) return remoteEntryExports;
|
|
1351
|
+
const url = getEntryUrl ? getEntryUrl(entry) : entry;
|
|
1352
|
+
return loadScript(url, {
|
|
1353
|
+
attrs: {},
|
|
1354
|
+
createScriptHook: (url, attrs) => {
|
|
1355
|
+
const res = loaderHook.lifecycle.createScript.emit({
|
|
1356
|
+
url,
|
|
1357
|
+
attrs,
|
|
1358
|
+
remoteInfo,
|
|
1359
|
+
resourceContext: resourceContext ? {
|
|
1360
|
+
...resourceContext,
|
|
1361
|
+
url
|
|
1362
|
+
} : void 0
|
|
1363
|
+
});
|
|
1364
|
+
if (!res) return;
|
|
1365
|
+
if (res instanceof HTMLScriptElement) return res;
|
|
1366
|
+
if ("script" in res || "timeout" in res) return res;
|
|
1367
|
+
}
|
|
1368
|
+
}).then(() => {
|
|
1369
|
+
return handleRemoteEntryLoaded(name, globalName, entry);
|
|
1370
|
+
}, (loadError) => {
|
|
1371
|
+
const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
|
|
1372
|
+
error(RUNTIME_008, runtimeDescMap, {
|
|
1373
|
+
remoteName: name,
|
|
1374
|
+
resourceUrl: url
|
|
1375
|
+
}, originalMsg);
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl, resourceContext }) {
|
|
1379
|
+
const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
|
|
1380
|
+
switch (type) {
|
|
1381
|
+
case "esm":
|
|
1382
|
+
case "module": return loadEsmEntry({
|
|
1383
|
+
entry,
|
|
1384
|
+
remoteEntryExports
|
|
1385
|
+
});
|
|
1386
|
+
case "system": return loadSystemJsEntry({
|
|
1387
|
+
entry,
|
|
1388
|
+
remoteEntryExports
|
|
1389
|
+
});
|
|
1390
|
+
default: return loadEntryScript({
|
|
1391
|
+
entry,
|
|
1392
|
+
globalName,
|
|
1393
|
+
name,
|
|
1394
|
+
remoteInfo,
|
|
1395
|
+
loaderHook,
|
|
1396
|
+
getEntryUrl,
|
|
1397
|
+
resourceContext
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
function getRemoteEntryUniqueKey(remoteInfo) {
|
|
1402
|
+
const { entry, name } = remoteInfo;
|
|
1403
|
+
return composeKeyWithSeparator(name, entry);
|
|
1404
|
+
}
|
|
1405
|
+
async function getRemoteEntry(params) {
|
|
1406
|
+
const { origin, remoteEntryExports, remoteInfo, getEntryUrl, resourceContext, _inErrorHandling = false } = params;
|
|
1407
|
+
const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);
|
|
1408
|
+
if (remoteEntryExports) return remoteEntryExports;
|
|
1409
|
+
if (!globalLoading[uniqueKey]) {
|
|
1410
|
+
const loadEntryHook = origin.remoteHandler.hooks.lifecycle.loadEntry;
|
|
1411
|
+
const loaderHook = origin.loaderHook;
|
|
1412
|
+
globalLoading[uniqueKey] = loadEntryHook.emit({
|
|
1413
|
+
origin,
|
|
1414
|
+
loaderHook,
|
|
1415
|
+
remoteInfo,
|
|
1416
|
+
remoteEntryExports
|
|
1417
|
+
}).then((res) => {
|
|
1418
|
+
if (res) return res;
|
|
1419
|
+
return loadEntryDom({
|
|
1420
|
+
remoteInfo,
|
|
1421
|
+
remoteEntryExports,
|
|
1422
|
+
loaderHook,
|
|
1423
|
+
getEntryUrl,
|
|
1424
|
+
resourceContext
|
|
1425
|
+
});
|
|
1426
|
+
}).then(async (res) => {
|
|
1427
|
+
await origin.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1428
|
+
origin,
|
|
1429
|
+
remoteInfo,
|
|
1430
|
+
remoteEntryExports: res
|
|
1431
|
+
});
|
|
1432
|
+
return res;
|
|
1433
|
+
}).catch(async (err) => {
|
|
1434
|
+
const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);
|
|
1435
|
+
const isScriptExecutionError = err instanceof Error && err.message.includes("ScriptExecutionError");
|
|
1436
|
+
if (err instanceof Error && err.message.includes("RUNTIME-008") && !isScriptExecutionError && !_inErrorHandling) {
|
|
1437
|
+
const wrappedGetRemoteEntry = (params) => {
|
|
1438
|
+
return getRemoteEntry({
|
|
1439
|
+
...params,
|
|
1440
|
+
_inErrorHandling: true
|
|
1441
|
+
});
|
|
1442
|
+
};
|
|
1443
|
+
const RemoteEntryExports = await origin.loaderHook.lifecycle.loadEntryError.emit({
|
|
1444
|
+
getRemoteEntry: wrappedGetRemoteEntry,
|
|
1445
|
+
origin,
|
|
1446
|
+
remoteInfo,
|
|
1447
|
+
remoteEntryExports,
|
|
1448
|
+
globalLoading,
|
|
1449
|
+
uniqueKey
|
|
1450
|
+
});
|
|
1451
|
+
if (RemoteEntryExports) {
|
|
1452
|
+
await origin.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1453
|
+
origin,
|
|
1454
|
+
remoteInfo,
|
|
1455
|
+
remoteEntryExports: RemoteEntryExports,
|
|
1456
|
+
recovered: true
|
|
1457
|
+
});
|
|
1458
|
+
return RemoteEntryExports;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
await origin.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1462
|
+
origin,
|
|
1463
|
+
remoteInfo,
|
|
1464
|
+
error: err
|
|
1465
|
+
});
|
|
1466
|
+
throw err;
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
return globalLoading[uniqueKey];
|
|
1470
|
+
}
|
|
1471
|
+
function getRemoteInfo(remote) {
|
|
1472
|
+
return {
|
|
1473
|
+
...remote,
|
|
1474
|
+
entry: "entry" in remote ? remote.entry : "",
|
|
1475
|
+
type: remote.type || "global",
|
|
1476
|
+
entryGlobalName: remote.entryGlobalName || remote.name,
|
|
1477
|
+
shareScope: remote.shareScope || "default"
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
//#endregion
|
|
1481
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/env.js
|
|
1482
|
+
function getBuilderId$1() {
|
|
1483
|
+
return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1484
|
+
}
|
|
1485
|
+
//#endregion
|
|
1486
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/plugin.js
|
|
1487
|
+
function registerPlugins(plugins, instance) {
|
|
1488
|
+
const globalPlugins = getGlobalHostPlugins();
|
|
1489
|
+
const hookInstances = [
|
|
1490
|
+
instance.hooks,
|
|
1491
|
+
instance.remoteHandler.hooks,
|
|
1492
|
+
instance.sharedHandler.hooks,
|
|
1493
|
+
instance.snapshotHandler.hooks,
|
|
1494
|
+
instance.loaderHook,
|
|
1495
|
+
instance.bridgeHook
|
|
1496
|
+
];
|
|
1497
|
+
if (globalPlugins.length > 0) globalPlugins.forEach((plugin) => {
|
|
1498
|
+
if (plugins?.find((item) => item.name !== plugin.name)) plugins.push(plugin);
|
|
1499
|
+
});
|
|
1500
|
+
if (plugins && plugins.length > 0) plugins.forEach((plugin) => {
|
|
1501
|
+
hookInstances.forEach((hookInstance) => {
|
|
1502
|
+
hookInstance.applyPlugin(plugin, instance);
|
|
1503
|
+
});
|
|
1504
|
+
});
|
|
1505
|
+
return plugins;
|
|
1506
|
+
}
|
|
1507
|
+
//#endregion
|
|
1508
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/context.js
|
|
1509
|
+
function remoteToEntry(r) {
|
|
1510
|
+
return {
|
|
1511
|
+
name: r.name,
|
|
1512
|
+
alias: r.alias,
|
|
1513
|
+
entry: "entry" in r ? r.entry : void 0,
|
|
1514
|
+
version: "version" in r ? r.version : void 0,
|
|
1515
|
+
type: r.type,
|
|
1516
|
+
entryGlobalName: r.entryGlobalName,
|
|
1517
|
+
shareScope: r.shareScope
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Build a partial MFContext from runtime Options.
|
|
1522
|
+
* Used to enrich diagnostic entries with host context at error sites.
|
|
1523
|
+
*/
|
|
1524
|
+
function optionsToMFContext(options) {
|
|
1525
|
+
const shared = {};
|
|
1526
|
+
for (const [pkgName, versions] of Object.entries(options.shared)) {
|
|
1527
|
+
const first = versions[0];
|
|
1528
|
+
if (first) shared[pkgName] = {
|
|
1529
|
+
version: first.version,
|
|
1530
|
+
singleton: first.shareConfig?.singleton,
|
|
1531
|
+
requiredVersion: first.shareConfig?.requiredVersion === false ? false : first.shareConfig?.requiredVersion,
|
|
1532
|
+
eager: first.eager,
|
|
1533
|
+
strictVersion: first.shareConfig?.strictVersion
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
return {
|
|
1537
|
+
project: {
|
|
1538
|
+
name: options.name,
|
|
1539
|
+
mfRole: options.remotes?.length > 0 ? "host" : "unknown"
|
|
1540
|
+
},
|
|
1541
|
+
mfConfig: {
|
|
1542
|
+
name: options.name,
|
|
1543
|
+
remotes: options.remotes?.map(remoteToEntry) ?? [],
|
|
1544
|
+
shared
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
//#endregion
|
|
1549
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/preload.js
|
|
1550
|
+
function defaultPreloadArgs(preloadConfig) {
|
|
1551
|
+
return {
|
|
1552
|
+
resourceCategory: "sync",
|
|
1553
|
+
share: true,
|
|
1554
|
+
depsRemote: true,
|
|
1555
|
+
...preloadConfig
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
function formatPreloadArgs(remotes, preloadArgs) {
|
|
1559
|
+
return preloadArgs.map((args) => {
|
|
1560
|
+
const remoteInfo = matchRemote(remotes, args.nameOrAlias);
|
|
1561
|
+
assert(remoteInfo, `Unable to preload ${args.nameOrAlias} as it is not included in ${!remoteInfo && safeToString({
|
|
1562
|
+
remoteInfo,
|
|
1563
|
+
remotes
|
|
1564
|
+
})}`);
|
|
1565
|
+
return {
|
|
1566
|
+
remote: remoteInfo,
|
|
1567
|
+
preloadConfig: defaultPreloadArgs(args)
|
|
1568
|
+
};
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
function normalizePreloadExposes(exposes) {
|
|
1572
|
+
if (!exposes) return [];
|
|
1573
|
+
return exposes.map((expose) => {
|
|
1574
|
+
if (expose === ".") return expose;
|
|
1575
|
+
if (expose.startsWith("./")) return expose.replace("./", "");
|
|
1576
|
+
return expose;
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
function isTimeoutError(error) {
|
|
1580
|
+
if (!(error instanceof Error)) return false;
|
|
1581
|
+
return error.message.includes("timed out") || error.name.includes("Timeout");
|
|
1582
|
+
}
|
|
1583
|
+
function createAssetResult(context, url, status, error) {
|
|
1584
|
+
return {
|
|
1585
|
+
url,
|
|
1586
|
+
status,
|
|
1587
|
+
resourceType: context.resourceType,
|
|
1588
|
+
initiator: context.initiator,
|
|
1589
|
+
id: context.id,
|
|
1590
|
+
error
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
async function waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, context) {
|
|
1594
|
+
const cachedRemote = host.moduleCache.get(entryRemoteInfo.name);
|
|
1595
|
+
const url = entryRemoteInfo.entry;
|
|
1596
|
+
if (cachedRemote?.remoteEntryExports) return createAssetResult(context, url, "cached");
|
|
1597
|
+
try {
|
|
1598
|
+
if (!await getRemoteEntry({
|
|
1599
|
+
origin: host,
|
|
1600
|
+
remoteInfo: entryRemoteInfo,
|
|
1601
|
+
remoteEntryExports: cachedRemote?.remoteEntryExports,
|
|
1602
|
+
resourceContext: {
|
|
1603
|
+
...context,
|
|
1604
|
+
url
|
|
1605
|
+
}
|
|
1606
|
+
})) throw new Error(`Failed to load remoteEntry "${url}".`);
|
|
1607
|
+
return createAssetResult(context, url, "success");
|
|
1608
|
+
} catch (error) {
|
|
1609
|
+
return createAssetResult(context, url, isTimeoutError(error) ? "timeout" : "error", error);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
function waitForLinkPreload({ host, remoteInfo, url, attrs, context, needDeleteLink }) {
|
|
1613
|
+
return new Promise((resolve) => {
|
|
1614
|
+
const { link, needAttach } = createLink({
|
|
1615
|
+
url,
|
|
1616
|
+
cb: () => {
|
|
1617
|
+
resolve(createAssetResult(context, url, needAttach ? "success" : "cached"));
|
|
1618
|
+
},
|
|
1619
|
+
onErrorCallback: (error) => {
|
|
1620
|
+
resolve(createAssetResult(context, url, isTimeoutError(error) ? "timeout" : "error", error));
|
|
1621
|
+
},
|
|
1622
|
+
attrs,
|
|
1623
|
+
createLinkHook: (hookUrl, hookAttrs) => {
|
|
1624
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
1625
|
+
url: hookUrl,
|
|
1626
|
+
attrs: hookAttrs,
|
|
1627
|
+
remoteInfo,
|
|
1628
|
+
resourceContext: {
|
|
1629
|
+
...context,
|
|
1630
|
+
url: hookUrl
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
if (res instanceof HTMLLinkElement) return res;
|
|
1634
|
+
return res;
|
|
1635
|
+
},
|
|
1636
|
+
needDeleteLink
|
|
1637
|
+
});
|
|
1638
|
+
needAttach && document.head.appendChild(link);
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
function waitForScriptPreload({ host, remoteInfo, url, attrs, context }) {
|
|
1642
|
+
return new Promise((resolve) => {
|
|
1643
|
+
const { script, needAttach } = createScript({
|
|
1644
|
+
url,
|
|
1645
|
+
cb: () => {
|
|
1646
|
+
resolve(createAssetResult(context, url, needAttach ? "success" : "cached"));
|
|
1647
|
+
},
|
|
1648
|
+
onErrorCallback: (error) => {
|
|
1649
|
+
resolve(createAssetResult(context, url, isTimeoutError(error) ? "timeout" : "error", error));
|
|
1650
|
+
},
|
|
1651
|
+
attrs,
|
|
1652
|
+
createScriptHook: (hookUrl, hookAttrs) => {
|
|
1653
|
+
const res = host.loaderHook.lifecycle.createScript.emit({
|
|
1654
|
+
url: hookUrl,
|
|
1655
|
+
attrs: hookAttrs,
|
|
1656
|
+
remoteInfo,
|
|
1657
|
+
resourceContext: {
|
|
1658
|
+
...context,
|
|
1659
|
+
url: hookUrl
|
|
1660
|
+
}
|
|
1661
|
+
});
|
|
1662
|
+
if (res instanceof HTMLScriptElement) return res;
|
|
1663
|
+
return res;
|
|
1664
|
+
},
|
|
1665
|
+
needDeleteScript: true
|
|
1666
|
+
});
|
|
1667
|
+
needAttach && document.head.appendChild(script);
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
function createResourceContext(baseContext, resourceType) {
|
|
1671
|
+
return {
|
|
1672
|
+
...baseContext,
|
|
1673
|
+
resourceType
|
|
1674
|
+
};
|
|
1675
|
+
}
|
|
1676
|
+
function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseContext = {
|
|
1677
|
+
initiator: "preloadRemote",
|
|
1678
|
+
id: remoteInfo.name
|
|
1679
|
+
}) {
|
|
1680
|
+
const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;
|
|
1681
|
+
const results = [];
|
|
1682
|
+
if (host.options.inBrowser) {
|
|
1683
|
+
entryAssets.forEach((asset) => {
|
|
1684
|
+
const { moduleInfo: entryRemoteInfo } = asset;
|
|
1685
|
+
results.push(waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, createResourceContext(baseContext, "remoteEntry")));
|
|
1686
|
+
});
|
|
1687
|
+
if (useLinkPreload) {
|
|
1688
|
+
const defaultAttrs = {
|
|
1689
|
+
rel: "preload",
|
|
1690
|
+
as: "style"
|
|
1691
|
+
};
|
|
1692
|
+
cssAssets.forEach((cssUrl) => {
|
|
1693
|
+
results.push(waitForLinkPreload({
|
|
1694
|
+
host,
|
|
1695
|
+
remoteInfo,
|
|
1696
|
+
url: cssUrl,
|
|
1697
|
+
attrs: defaultAttrs,
|
|
1698
|
+
context: createResourceContext(baseContext, "css")
|
|
1699
|
+
}));
|
|
1700
|
+
});
|
|
1701
|
+
} else {
|
|
1702
|
+
const defaultAttrs = {
|
|
1703
|
+
rel: "stylesheet",
|
|
1704
|
+
type: "text/css"
|
|
1705
|
+
};
|
|
1706
|
+
cssAssets.forEach((cssUrl) => {
|
|
1707
|
+
results.push(waitForLinkPreload({
|
|
1708
|
+
host,
|
|
1709
|
+
remoteInfo,
|
|
1710
|
+
url: cssUrl,
|
|
1711
|
+
attrs: defaultAttrs,
|
|
1712
|
+
needDeleteLink: false,
|
|
1713
|
+
context: createResourceContext(baseContext, "css")
|
|
1714
|
+
}));
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
if (useLinkPreload) {
|
|
1718
|
+
const defaultAttrs = {
|
|
1719
|
+
rel: "preload",
|
|
1720
|
+
as: "script"
|
|
1721
|
+
};
|
|
1722
|
+
jsAssetsWithoutEntry.forEach((jsUrl) => {
|
|
1723
|
+
results.push(waitForLinkPreload({
|
|
1724
|
+
host,
|
|
1725
|
+
remoteInfo,
|
|
1726
|
+
url: jsUrl,
|
|
1727
|
+
attrs: defaultAttrs,
|
|
1728
|
+
context: createResourceContext(baseContext, "js")
|
|
1729
|
+
}));
|
|
1730
|
+
});
|
|
1731
|
+
} else {
|
|
1732
|
+
const defaultAttrs = {
|
|
1733
|
+
fetchpriority: "high",
|
|
1734
|
+
type: remoteInfo?.type === "module" ? "module" : "text/javascript"
|
|
1735
|
+
};
|
|
1736
|
+
jsAssetsWithoutEntry.forEach((jsUrl) => {
|
|
1737
|
+
results.push(waitForScriptPreload({
|
|
1738
|
+
host,
|
|
1739
|
+
remoteInfo,
|
|
1740
|
+
url: jsUrl,
|
|
1741
|
+
attrs: defaultAttrs,
|
|
1742
|
+
context: createResourceContext(baseContext, "js")
|
|
1743
|
+
}));
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
return Promise.all(results);
|
|
1748
|
+
}
|
|
1749
|
+
//#endregion
|
|
1750
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/module/index.js
|
|
1751
|
+
function getAvailableExposeNames(remoteSnapshot) {
|
|
1752
|
+
if (!remoteSnapshot || !("modules" in remoteSnapshot) || !Array.isArray(remoteSnapshot.modules)) return;
|
|
1753
|
+
const exposes = remoteSnapshot.modules.map((module) => module.moduleName).filter(Boolean);
|
|
1754
|
+
return exposes.length ? exposes.join(",") : void 0;
|
|
1755
|
+
}
|
|
1756
|
+
function createRemoteEntryInitOptions(remoteInfo, hostShareScopeMap, rawInitScope) {
|
|
1757
|
+
const localShareScopeMap = hostShareScopeMap;
|
|
1758
|
+
const shareScopeKeys = Array.isArray(remoteInfo.shareScope) ? remoteInfo.shareScope : [remoteInfo.shareScope];
|
|
1759
|
+
if (!shareScopeKeys.length) shareScopeKeys.push("default");
|
|
1760
|
+
shareScopeKeys.forEach((shareScopeKey) => {
|
|
1761
|
+
if (!localShareScopeMap[shareScopeKey]) localShareScopeMap[shareScopeKey] = {};
|
|
1762
|
+
});
|
|
1763
|
+
const remoteEntryInitOptions = {
|
|
1764
|
+
version: remoteInfo.version || "",
|
|
1765
|
+
shareScopeKeys: Array.isArray(remoteInfo.shareScope) ? shareScopeKeys : remoteInfo.shareScope || "default"
|
|
1766
|
+
};
|
|
1767
|
+
Object.defineProperty(remoteEntryInitOptions, "shareScopeMap", {
|
|
1768
|
+
value: localShareScopeMap,
|
|
1769
|
+
enumerable: false
|
|
1770
|
+
});
|
|
1771
|
+
return {
|
|
1772
|
+
remoteEntryInitOptions,
|
|
1773
|
+
shareScope: localShareScopeMap[shareScopeKeys[0]],
|
|
1774
|
+
initScope: rawInitScope ?? []
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
var Module$1 = class {
|
|
1778
|
+
constructor({ remoteInfo, host }) {
|
|
1779
|
+
this.inited = false;
|
|
1780
|
+
this.initing = false;
|
|
1781
|
+
this.lib = void 0;
|
|
1782
|
+
this.remoteInfo = remoteInfo;
|
|
1783
|
+
this.host = host;
|
|
1784
|
+
}
|
|
1785
|
+
async getEntry(expose) {
|
|
1786
|
+
if (this.remoteEntryExports) return this.remoteEntryExports;
|
|
1787
|
+
const remoteEntryExports = await getRemoteEntry({
|
|
1788
|
+
origin: this.host,
|
|
1789
|
+
remoteInfo: this.remoteInfo,
|
|
1790
|
+
remoteEntryExports: this.remoteEntryExports,
|
|
1791
|
+
resourceContext: {
|
|
1792
|
+
initiator: "loadRemote",
|
|
1793
|
+
id: composeRemoteRequestId(this.remoteInfo.name, expose),
|
|
1794
|
+
resourceType: "remoteEntry"
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
assert(remoteEntryExports, `remoteEntryExports is undefined \n ${safeToString(this.remoteInfo)}`);
|
|
1798
|
+
this.remoteEntryExports = remoteEntryExports;
|
|
1799
|
+
return this.remoteEntryExports;
|
|
1800
|
+
}
|
|
1801
|
+
async init(id, remoteSnapshot, rawInitScope, expose) {
|
|
1802
|
+
const remoteEntryExports = await this.getEntry(expose);
|
|
1803
|
+
if (this.inited) {
|
|
1804
|
+
await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1805
|
+
id,
|
|
1806
|
+
remoteInfo: this.remoteInfo,
|
|
1807
|
+
remoteSnapshot,
|
|
1808
|
+
remoteEntryExports,
|
|
1809
|
+
cached: true,
|
|
1810
|
+
origin: this.host
|
|
1811
|
+
});
|
|
1812
|
+
return remoteEntryExports;
|
|
1813
|
+
}
|
|
1814
|
+
if (this.initPromise) {
|
|
1815
|
+
try {
|
|
1816
|
+
await this.initPromise;
|
|
1817
|
+
await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1818
|
+
id,
|
|
1819
|
+
remoteInfo: this.remoteInfo,
|
|
1820
|
+
remoteSnapshot,
|
|
1821
|
+
remoteEntryExports,
|
|
1822
|
+
cached: true,
|
|
1823
|
+
origin: this.host
|
|
1824
|
+
});
|
|
1825
|
+
} catch (initError) {
|
|
1826
|
+
await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1827
|
+
id,
|
|
1828
|
+
remoteInfo: this.remoteInfo,
|
|
1829
|
+
remoteSnapshot,
|
|
1830
|
+
remoteEntryExports,
|
|
1831
|
+
error: initError,
|
|
1832
|
+
cached: true,
|
|
1833
|
+
origin: this.host
|
|
1834
|
+
});
|
|
1835
|
+
throw initError;
|
|
1836
|
+
}
|
|
1837
|
+
return remoteEntryExports;
|
|
1838
|
+
}
|
|
1839
|
+
this.initing = true;
|
|
1840
|
+
this.initPromise = (async () => {
|
|
1841
|
+
await this.host.loaderHook.lifecycle.beforeInitRemote.emit({
|
|
1842
|
+
id,
|
|
1843
|
+
remoteInfo: this.remoteInfo,
|
|
1844
|
+
remoteSnapshot,
|
|
1845
|
+
origin: this.host
|
|
1846
|
+
});
|
|
1847
|
+
const { remoteEntryInitOptions, shareScope, initScope } = createRemoteEntryInitOptions(this.remoteInfo, this.host.shareScopeMap, rawInitScope);
|
|
1848
|
+
const initContainerOptions = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1849
|
+
shareScope,
|
|
1850
|
+
remoteEntryInitOptions,
|
|
1851
|
+
initScope,
|
|
1852
|
+
remoteInfo: this.remoteInfo,
|
|
1853
|
+
origin: this.host
|
|
1854
|
+
});
|
|
1855
|
+
if (typeof remoteEntryExports?.init === "undefined") error(RUNTIME_002, runtimeDescMap, {
|
|
1856
|
+
hostName: this.host.name,
|
|
1857
|
+
remoteName: this.remoteInfo.name,
|
|
1858
|
+
remoteEntryUrl: this.remoteInfo.entry,
|
|
1859
|
+
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1860
|
+
}, void 0, optionsToMFContext(this.host.options));
|
|
1861
|
+
try {
|
|
1862
|
+
await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
|
|
1863
|
+
} catch (initError) {
|
|
1864
|
+
error(RUNTIME_015, runtimeDescMap, {
|
|
1865
|
+
hostName: this.host.name,
|
|
1866
|
+
remoteName: this.remoteInfo.name,
|
|
1867
|
+
remoteEntryUrl: this.remoteInfo.entry,
|
|
1868
|
+
remoteEntryKey: this.remoteInfo.entryGlobalName,
|
|
1869
|
+
shareScope: this.remoteInfo.shareScope
|
|
1870
|
+
}, `${initError}`, optionsToMFContext(this.host.options));
|
|
1871
|
+
}
|
|
1872
|
+
await this.host.hooks.lifecycle.initContainer.emit({
|
|
1873
|
+
...initContainerOptions,
|
|
1874
|
+
id,
|
|
1875
|
+
remoteSnapshot,
|
|
1876
|
+
remoteEntryExports
|
|
1877
|
+
});
|
|
1878
|
+
this.inited = true;
|
|
1879
|
+
})();
|
|
1880
|
+
try {
|
|
1881
|
+
await this.initPromise;
|
|
1882
|
+
await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1883
|
+
id,
|
|
1884
|
+
remoteInfo: this.remoteInfo,
|
|
1885
|
+
remoteSnapshot,
|
|
1886
|
+
remoteEntryExports,
|
|
1887
|
+
origin: this.host
|
|
1888
|
+
});
|
|
1889
|
+
} catch (initError) {
|
|
1890
|
+
await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1891
|
+
id,
|
|
1892
|
+
remoteInfo: this.remoteInfo,
|
|
1893
|
+
remoteSnapshot,
|
|
1894
|
+
remoteEntryExports,
|
|
1895
|
+
error: initError,
|
|
1896
|
+
origin: this.host
|
|
1897
|
+
});
|
|
1898
|
+
throw initError;
|
|
1899
|
+
} finally {
|
|
1900
|
+
this.initing = false;
|
|
1901
|
+
this.initPromise = void 0;
|
|
1902
|
+
}
|
|
1903
|
+
return remoteEntryExports;
|
|
1904
|
+
}
|
|
1905
|
+
async get(id, expose, options, remoteSnapshot) {
|
|
1906
|
+
const { loadFactory = true } = options || { loadFactory: true };
|
|
1907
|
+
const remoteEntryExports = await this.init(id, remoteSnapshot, void 0, expose);
|
|
1908
|
+
this.lib = remoteEntryExports;
|
|
1909
|
+
await this.host.loaderHook.lifecycle.beforeGetExpose.emit({
|
|
1910
|
+
id,
|
|
1911
|
+
expose,
|
|
1912
|
+
moduleInfo: this.remoteInfo,
|
|
1913
|
+
remoteEntryExports,
|
|
1914
|
+
origin: this.host
|
|
1915
|
+
});
|
|
1916
|
+
let moduleFactory;
|
|
1917
|
+
try {
|
|
1918
|
+
const hookModuleFactory = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1919
|
+
remoteEntryExports,
|
|
1920
|
+
expose,
|
|
1921
|
+
moduleInfo: this.remoteInfo
|
|
1922
|
+
});
|
|
1923
|
+
moduleFactory = typeof hookModuleFactory === "function" ? hookModuleFactory : void 0;
|
|
1924
|
+
if (!moduleFactory) moduleFactory = await remoteEntryExports.get(expose);
|
|
1925
|
+
if (!moduleFactory) error(RUNTIME_014, runtimeDescMap, {
|
|
1926
|
+
hostName: this.host.name,
|
|
1927
|
+
remoteName: this.remoteInfo.name,
|
|
1928
|
+
remoteEntryUrl: this.remoteInfo.entry,
|
|
1929
|
+
expose,
|
|
1930
|
+
requestId: id,
|
|
1931
|
+
availableExposes: getAvailableExposeNames(remoteSnapshot)
|
|
1932
|
+
}, void 0, optionsToMFContext(this.host.options));
|
|
1933
|
+
await this.host.loaderHook.lifecycle.afterGetExpose.emit({
|
|
1934
|
+
id,
|
|
1935
|
+
expose,
|
|
1936
|
+
moduleInfo: this.remoteInfo,
|
|
1937
|
+
remoteEntryExports,
|
|
1938
|
+
moduleFactory,
|
|
1939
|
+
origin: this.host
|
|
1940
|
+
});
|
|
1941
|
+
} catch (getExposeError) {
|
|
1942
|
+
await this.host.loaderHook.lifecycle.afterGetExpose.emit({
|
|
1943
|
+
id,
|
|
1944
|
+
expose,
|
|
1945
|
+
moduleInfo: this.remoteInfo,
|
|
1946
|
+
remoteEntryExports,
|
|
1947
|
+
error: getExposeError,
|
|
1948
|
+
origin: this.host
|
|
1949
|
+
});
|
|
1950
|
+
throw getExposeError;
|
|
1951
|
+
}
|
|
1952
|
+
const symbolName = processModuleAlias(this.remoteInfo.name, expose);
|
|
1953
|
+
const wrapModuleFactory = this.wraperFactory(moduleFactory, symbolName);
|
|
1954
|
+
if (!loadFactory) return wrapModuleFactory;
|
|
1955
|
+
await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
|
|
1956
|
+
id,
|
|
1957
|
+
expose,
|
|
1958
|
+
moduleInfo: this.remoteInfo,
|
|
1959
|
+
loadFactory,
|
|
1960
|
+
origin: this.host
|
|
1961
|
+
});
|
|
1962
|
+
try {
|
|
1963
|
+
const exposeContent = await wrapModuleFactory();
|
|
1964
|
+
await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
|
|
1965
|
+
id,
|
|
1966
|
+
expose,
|
|
1967
|
+
moduleInfo: this.remoteInfo,
|
|
1968
|
+
loadFactory,
|
|
1969
|
+
exposeModule: exposeContent,
|
|
1970
|
+
origin: this.host
|
|
1971
|
+
});
|
|
1972
|
+
return exposeContent;
|
|
1973
|
+
} catch (executeFactoryError) {
|
|
1974
|
+
await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
|
|
1975
|
+
id,
|
|
1976
|
+
expose,
|
|
1977
|
+
moduleInfo: this.remoteInfo,
|
|
1978
|
+
loadFactory,
|
|
1979
|
+
error: executeFactoryError,
|
|
1980
|
+
origin: this.host
|
|
1981
|
+
});
|
|
1982
|
+
throw executeFactoryError;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
wraperFactory(moduleFactory, id) {
|
|
1986
|
+
function defineModuleId(res, id) {
|
|
1987
|
+
if (res && typeof res === "object" && Object.isExtensible(res) && !Object.getOwnPropertyDescriptor(res, Symbol.for("mf_module_id"))) Object.defineProperty(res, Symbol.for("mf_module_id"), {
|
|
1988
|
+
value: id,
|
|
1989
|
+
enumerable: false
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
return () => {
|
|
1993
|
+
const res = moduleFactory();
|
|
1994
|
+
if (res instanceof Promise) return res.then((asyncRes) => {
|
|
1995
|
+
defineModuleId(asyncRes, id);
|
|
1996
|
+
return asyncRes;
|
|
1997
|
+
});
|
|
1998
|
+
defineModuleId(res, id);
|
|
1999
|
+
return res;
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
//#endregion
|
|
2004
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/syncHook.js
|
|
2005
|
+
var SyncHook = class {
|
|
2006
|
+
constructor(type) {
|
|
2007
|
+
this.type = "";
|
|
2008
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
2009
|
+
if (type) this.type = type;
|
|
2010
|
+
}
|
|
2011
|
+
on(fn) {
|
|
2012
|
+
if (typeof fn === "function") this.listeners.add(fn);
|
|
2013
|
+
}
|
|
2014
|
+
once(fn) {
|
|
2015
|
+
const self = this;
|
|
2016
|
+
this.on(function wrapper(...args) {
|
|
2017
|
+
self.remove(wrapper);
|
|
2018
|
+
return fn.apply(null, args);
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
emit(...data) {
|
|
2022
|
+
let result;
|
|
2023
|
+
if (this.listeners.size > 0) this.listeners.forEach((fn) => {
|
|
2024
|
+
const nextResult = fn(...data);
|
|
2025
|
+
if (nextResult !== void 0) result = nextResult;
|
|
2026
|
+
});
|
|
2027
|
+
return result;
|
|
2028
|
+
}
|
|
2029
|
+
remove(fn) {
|
|
2030
|
+
this.listeners.delete(fn);
|
|
2031
|
+
}
|
|
2032
|
+
removeAll() {
|
|
2033
|
+
this.listeners.clear();
|
|
2034
|
+
}
|
|
2035
|
+
};
|
|
2036
|
+
//#endregion
|
|
2037
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/asyncHook.js
|
|
2038
|
+
var AsyncHook = class extends SyncHook {
|
|
2039
|
+
emit(...data) {
|
|
2040
|
+
let result;
|
|
2041
|
+
const ls = Array.from(this.listeners);
|
|
2042
|
+
if (ls.length > 0) {
|
|
2043
|
+
let i = 0;
|
|
2044
|
+
const call = (prev) => {
|
|
2045
|
+
if (prev === false) return false;
|
|
2046
|
+
else if (i < ls.length) return Promise.resolve(ls[i++].apply(null, data)).then((result) => {
|
|
2047
|
+
if (result === void 0 || data.length === 1 && result === data[0]) return call(prev);
|
|
2048
|
+
return call(result);
|
|
2049
|
+
});
|
|
2050
|
+
else return prev;
|
|
2051
|
+
};
|
|
2052
|
+
result = call();
|
|
2053
|
+
}
|
|
2054
|
+
return Promise.resolve(result);
|
|
2055
|
+
}
|
|
2056
|
+
};
|
|
2057
|
+
//#endregion
|
|
2058
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/syncWaterfallHook.js
|
|
2059
|
+
function checkReturnData(originalData, returnedData) {
|
|
2060
|
+
if (!isObject(returnedData)) return false;
|
|
2061
|
+
if (originalData !== returnedData) {
|
|
2062
|
+
for (const key in originalData) if (!(key in returnedData)) return false;
|
|
2063
|
+
}
|
|
2064
|
+
return true;
|
|
2065
|
+
}
|
|
2066
|
+
var SyncWaterfallHook = class extends SyncHook {
|
|
2067
|
+
constructor(type) {
|
|
2068
|
+
super();
|
|
2069
|
+
this.onerror = error;
|
|
2070
|
+
this.type = type;
|
|
2071
|
+
}
|
|
2072
|
+
emit(data) {
|
|
2073
|
+
if (!isObject(data)) error(`The data for the "${this.type}" hook should be an object.`);
|
|
2074
|
+
for (const fn of this.listeners) try {
|
|
2075
|
+
const tempData = fn(data);
|
|
2076
|
+
if (tempData === void 0) continue;
|
|
2077
|
+
if (checkReturnData(data, tempData)) data = tempData;
|
|
2078
|
+
else {
|
|
2079
|
+
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
2080
|
+
break;
|
|
2081
|
+
}
|
|
2082
|
+
} catch (e) {
|
|
2083
|
+
warn$1(e);
|
|
2084
|
+
this.onerror(e);
|
|
2085
|
+
}
|
|
2086
|
+
return data;
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
//#endregion
|
|
2090
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/asyncWaterfallHooks.js
|
|
2091
|
+
var AsyncWaterfallHook = class extends SyncHook {
|
|
2092
|
+
constructor(type) {
|
|
2093
|
+
super();
|
|
2094
|
+
this.onerror = error;
|
|
2095
|
+
this.type = type;
|
|
2096
|
+
}
|
|
2097
|
+
emit(data) {
|
|
2098
|
+
if (!isObject(data)) error(`The response data for the "${this.type}" hook must be an object.`);
|
|
2099
|
+
const ls = Array.from(this.listeners);
|
|
2100
|
+
if (ls.length > 0) {
|
|
2101
|
+
let i = 0;
|
|
2102
|
+
const processError = (e) => {
|
|
2103
|
+
warn$1(e);
|
|
2104
|
+
this.onerror(e);
|
|
2105
|
+
return data;
|
|
2106
|
+
};
|
|
2107
|
+
const call = (prevData) => {
|
|
2108
|
+
if (prevData !== void 0 && checkReturnData(data, prevData)) data = prevData;
|
|
2109
|
+
else if (prevData !== void 0) {
|
|
2110
|
+
this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
|
|
2111
|
+
return data;
|
|
2112
|
+
}
|
|
2113
|
+
if (i < ls.length) try {
|
|
2114
|
+
return Promise.resolve(ls[i++](data)).then(call, processError);
|
|
2115
|
+
} catch (e) {
|
|
2116
|
+
return processError(e);
|
|
2117
|
+
}
|
|
2118
|
+
return data;
|
|
2119
|
+
};
|
|
2120
|
+
return Promise.resolve(call(data));
|
|
2121
|
+
}
|
|
2122
|
+
return Promise.resolve(data);
|
|
2123
|
+
}
|
|
2124
|
+
};
|
|
2125
|
+
//#endregion
|
|
2126
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/utils/hooks/pluginSystem.js
|
|
2127
|
+
var PluginSystem = class {
|
|
2128
|
+
constructor(lifecycle) {
|
|
2129
|
+
this.registerPlugins = {};
|
|
2130
|
+
this.lifecycle = lifecycle;
|
|
2131
|
+
this.lifecycleKeys = Object.keys(lifecycle);
|
|
2132
|
+
}
|
|
2133
|
+
applyPlugin(plugin, instance) {
|
|
2134
|
+
assert(isPlainObject(plugin), "Plugin configuration is invalid.");
|
|
2135
|
+
const pluginName = plugin.name;
|
|
2136
|
+
assert(pluginName, "A name must be provided by the plugin.");
|
|
2137
|
+
if (!this.registerPlugins[pluginName]) {
|
|
2138
|
+
this.registerPlugins[pluginName] = plugin;
|
|
2139
|
+
plugin.apply?.(instance);
|
|
2140
|
+
Object.keys(this.lifecycle).forEach((key) => {
|
|
2141
|
+
const pluginLife = plugin[key];
|
|
2142
|
+
if (pluginLife) this.lifecycle[key].on(pluginLife);
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
removePlugin(pluginName) {
|
|
2147
|
+
assert(pluginName, "A name is required.");
|
|
2148
|
+
const plugin = this.registerPlugins[pluginName];
|
|
2149
|
+
assert(plugin, `The plugin "${pluginName}" is not registered.`);
|
|
2150
|
+
Object.keys(plugin).forEach((key) => {
|
|
2151
|
+
if (key !== "name") this.lifecycle[key].remove(plugin[key]);
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
};
|
|
2155
|
+
//#endregion
|
|
2156
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.js
|
|
2157
|
+
function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
2158
|
+
const remoteEntryInfo = getRemoteEntryInfoFromSnapshot(remoteSnapshot);
|
|
2159
|
+
if (!remoteEntryInfo.url) error(RUNTIME_011, runtimeDescMap, { remoteName: remoteInfo.name });
|
|
2160
|
+
let entryUrl = getResourceUrl(remoteSnapshot, remoteEntryInfo.url);
|
|
2161
|
+
remoteInfo.type = remoteEntryInfo.type;
|
|
2162
|
+
remoteInfo.entryGlobalName = remoteEntryInfo.globalName;
|
|
2163
|
+
remoteInfo.entry = entryUrl;
|
|
2164
|
+
remoteInfo.version = remoteSnapshot.version;
|
|
2165
|
+
remoteInfo.buildVersion = remoteSnapshot.buildVersion;
|
|
2166
|
+
}
|
|
2167
|
+
function snapshotPlugin() {
|
|
2168
|
+
return {
|
|
2169
|
+
name: "snapshot-plugin",
|
|
2170
|
+
async afterResolve(args) {
|
|
2171
|
+
const { remote, pkgNameOrAlias, expose, origin, remoteInfo, id } = args;
|
|
2172
|
+
if (!isRemoteInfoWithEntry(remote) || !isPureRemoteEntry(remote)) {
|
|
2173
|
+
const { remoteSnapshot, globalSnapshot } = await origin.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2174
|
+
moduleInfo: remote,
|
|
2175
|
+
id: composeRemoteRequestId(remote.name, expose)
|
|
2176
|
+
});
|
|
2177
|
+
assignRemoteInfo(remoteInfo, remoteSnapshot);
|
|
2178
|
+
const preloadOptions = {
|
|
2179
|
+
remote,
|
|
2180
|
+
preloadConfig: {
|
|
2181
|
+
nameOrAlias: pkgNameOrAlias,
|
|
2182
|
+
exposes: [expose],
|
|
2183
|
+
resourceCategory: "sync",
|
|
2184
|
+
share: false,
|
|
2185
|
+
depsRemote: false
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
const assets = await origin.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2189
|
+
origin,
|
|
2190
|
+
preloadOptions,
|
|
2191
|
+
remoteInfo,
|
|
2192
|
+
remote,
|
|
2193
|
+
remoteSnapshot,
|
|
2194
|
+
globalSnapshot
|
|
2195
|
+
});
|
|
2196
|
+
if (assets) preloadAssets(remoteInfo, origin, assets, false, {
|
|
2197
|
+
initiator: "loadRemote",
|
|
2198
|
+
id
|
|
2199
|
+
}).catch(() => void 0);
|
|
2200
|
+
return {
|
|
2201
|
+
...args,
|
|
2202
|
+
remoteSnapshot
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2205
|
+
return args;
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
//#endregion
|
|
2210
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/plugins/generate-preload-assets.js
|
|
2211
|
+
function splitId(id) {
|
|
2212
|
+
const splitInfo = id.split(":");
|
|
2213
|
+
if (splitInfo.length === 1) return {
|
|
2214
|
+
name: splitInfo[0],
|
|
2215
|
+
version: void 0
|
|
2216
|
+
};
|
|
2217
|
+
else if (splitInfo.length === 2) return {
|
|
2218
|
+
name: splitInfo[0],
|
|
2219
|
+
version: splitInfo[1]
|
|
2220
|
+
};
|
|
2221
|
+
else return {
|
|
2222
|
+
name: splitInfo[1],
|
|
2223
|
+
version: splitInfo[2]
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
function traverseModuleInfo(globalSnapshot, remoteInfo, traverse, isRoot, memo = {}, remoteSnapshot) {
|
|
2227
|
+
const { value: snapshotValue } = getInfoWithoutType(globalSnapshot, getFMId(remoteInfo));
|
|
2228
|
+
const effectiveRemoteSnapshot = remoteSnapshot || snapshotValue;
|
|
2229
|
+
if (effectiveRemoteSnapshot && !isManifestProvider(effectiveRemoteSnapshot)) {
|
|
2230
|
+
traverse(effectiveRemoteSnapshot, remoteInfo, isRoot);
|
|
2231
|
+
if (effectiveRemoteSnapshot.remotesInfo) {
|
|
2232
|
+
const remoteKeys = Object.keys(effectiveRemoteSnapshot.remotesInfo);
|
|
2233
|
+
for (const key of remoteKeys) {
|
|
2234
|
+
if (memo[key]) continue;
|
|
2235
|
+
memo[key] = true;
|
|
2236
|
+
const subRemoteInfo = splitId(key);
|
|
2237
|
+
const remoteValue = effectiveRemoteSnapshot.remotesInfo[key];
|
|
2238
|
+
traverseModuleInfo(globalSnapshot, {
|
|
2239
|
+
name: subRemoteInfo.name,
|
|
2240
|
+
version: remoteValue.matchedVersion
|
|
2241
|
+
}, traverse, false, memo, void 0);
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
var isExisted = (type, url) => {
|
|
2247
|
+
return document.querySelector(`${type}[${type === "link" ? "href" : "src"}="${url}"]`);
|
|
2248
|
+
};
|
|
2249
|
+
function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, remoteSnapshot) {
|
|
2250
|
+
const cssAssets = [];
|
|
2251
|
+
const jsAssets = [];
|
|
2252
|
+
const entryAssets = [];
|
|
2253
|
+
const loadedSharedJsAssets = /* @__PURE__ */ new Set();
|
|
2254
|
+
const loadedSharedCssAssets = /* @__PURE__ */ new Set();
|
|
2255
|
+
const { options } = origin;
|
|
2256
|
+
const { preloadConfig: rootPreloadConfig } = preloadOptions;
|
|
2257
|
+
const { depsRemote } = rootPreloadConfig;
|
|
2258
|
+
traverseModuleInfo(globalSnapshot, remote, (moduleInfoSnapshot, remoteInfo, isRoot) => {
|
|
2259
|
+
let preloadConfig;
|
|
2260
|
+
if (isRoot) preloadConfig = rootPreloadConfig;
|
|
2261
|
+
else if (Array.isArray(depsRemote)) {
|
|
2262
|
+
const findPreloadConfig = depsRemote.find((remoteConfig) => {
|
|
2263
|
+
if (remoteConfig.nameOrAlias === remoteInfo.name || remoteConfig.nameOrAlias === remoteInfo.alias) return true;
|
|
2264
|
+
return false;
|
|
2265
|
+
});
|
|
2266
|
+
if (!findPreloadConfig) return;
|
|
2267
|
+
preloadConfig = defaultPreloadArgs(findPreloadConfig);
|
|
2268
|
+
} else if (depsRemote === true) preloadConfig = rootPreloadConfig;
|
|
2269
|
+
else return;
|
|
2270
|
+
const remoteEntryUrl = getResourceUrl(moduleInfoSnapshot, getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);
|
|
2271
|
+
if (remoteEntryUrl) entryAssets.push({
|
|
2272
|
+
name: remoteInfo.name,
|
|
2273
|
+
moduleInfo: {
|
|
2274
|
+
name: remoteInfo.name,
|
|
2275
|
+
entry: remoteEntryUrl,
|
|
2276
|
+
type: "remoteEntryType" in moduleInfoSnapshot ? moduleInfoSnapshot.remoteEntryType : "global",
|
|
2277
|
+
entryGlobalName: "globalName" in moduleInfoSnapshot ? moduleInfoSnapshot.globalName : remoteInfo.name,
|
|
2278
|
+
shareScope: "",
|
|
2279
|
+
version: "version" in moduleInfoSnapshot ? moduleInfoSnapshot.version : void 0
|
|
2280
|
+
},
|
|
2281
|
+
url: remoteEntryUrl
|
|
2282
|
+
});
|
|
2283
|
+
let moduleAssetsInfo = "modules" in moduleInfoSnapshot ? moduleInfoSnapshot.modules : [];
|
|
2284
|
+
const normalizedPreloadExposes = normalizePreloadExposes(preloadConfig.exposes);
|
|
2285
|
+
if (normalizedPreloadExposes.length && "modules" in moduleInfoSnapshot) moduleAssetsInfo = moduleInfoSnapshot?.modules?.reduce((assets, moduleAssetInfo) => {
|
|
2286
|
+
if (normalizedPreloadExposes?.indexOf(moduleAssetInfo.moduleName) !== -1) assets.push(moduleAssetInfo);
|
|
2287
|
+
return assets;
|
|
2288
|
+
}, []);
|
|
2289
|
+
function handleAssets(assets) {
|
|
2290
|
+
const assetsRes = assets.map((asset) => getResourceUrl(moduleInfoSnapshot, asset));
|
|
2291
|
+
if (preloadConfig.filter) return assetsRes.filter(preloadConfig.filter);
|
|
2292
|
+
return assetsRes;
|
|
2293
|
+
}
|
|
2294
|
+
if (moduleAssetsInfo) {
|
|
2295
|
+
const assetsLength = moduleAssetsInfo.length;
|
|
2296
|
+
for (let index = 0; index < assetsLength; index++) {
|
|
2297
|
+
const assetsInfo = moduleAssetsInfo[index];
|
|
2298
|
+
const exposeFullPath = `${remoteInfo.name}/${assetsInfo.moduleName}`;
|
|
2299
|
+
origin.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
2300
|
+
id: assetsInfo.moduleName === "." ? remoteInfo.name : exposeFullPath,
|
|
2301
|
+
name: remoteInfo.name,
|
|
2302
|
+
remoteSnapshot: moduleInfoSnapshot,
|
|
2303
|
+
preloadConfig,
|
|
2304
|
+
remote: remoteInfo,
|
|
2305
|
+
origin
|
|
2306
|
+
});
|
|
2307
|
+
if (getPreloaded(exposeFullPath)) continue;
|
|
2308
|
+
if (preloadConfig.resourceCategory === "all") {
|
|
2309
|
+
cssAssets.push(...handleAssets(assetsInfo.assets.css.async));
|
|
2310
|
+
cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));
|
|
2311
|
+
jsAssets.push(...handleAssets(assetsInfo.assets.js.async));
|
|
2312
|
+
jsAssets.push(...handleAssets(assetsInfo.assets.js.sync));
|
|
2313
|
+
} else if (preloadConfig.resourceCategory === "sync") {
|
|
2314
|
+
cssAssets.push(...handleAssets(assetsInfo.assets.css.sync));
|
|
2315
|
+
jsAssets.push(...handleAssets(assetsInfo.assets.js.sync));
|
|
2316
|
+
}
|
|
2317
|
+
setPreloaded(exposeFullPath);
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
}, true, {}, remoteSnapshot);
|
|
2321
|
+
if (remoteSnapshot.shared && remoteSnapshot.shared.length > 0) {
|
|
2322
|
+
const collectSharedAssets = (shareInfo, snapshotShared) => {
|
|
2323
|
+
const { shared: registeredShared } = getRegisteredShare(origin.shareScopeMap, snapshotShared.sharedName, shareInfo, origin.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
2324
|
+
if (registeredShared && typeof registeredShared.lib === "function") {
|
|
2325
|
+
snapshotShared.assets.js.sync.forEach((asset) => {
|
|
2326
|
+
loadedSharedJsAssets.add(asset);
|
|
2327
|
+
});
|
|
2328
|
+
snapshotShared.assets.css.sync.forEach((asset) => {
|
|
2329
|
+
loadedSharedCssAssets.add(asset);
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
remoteSnapshot.shared.forEach((shared) => {
|
|
2334
|
+
const shareInfos = options.shared?.[shared.sharedName];
|
|
2335
|
+
if (!shareInfos) return;
|
|
2336
|
+
const sharedOptions = shared.version ? shareInfos.find((s) => s.version === shared.version) : shareInfos;
|
|
2337
|
+
if (!sharedOptions) return;
|
|
2338
|
+
arrayOptions(sharedOptions).forEach((s) => {
|
|
2339
|
+
collectSharedAssets(s, shared);
|
|
2340
|
+
});
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
const needPreloadJsAssets = jsAssets.filter((asset) => !loadedSharedJsAssets.has(asset) && !isExisted("script", asset));
|
|
2344
|
+
return {
|
|
2345
|
+
cssAssets: cssAssets.filter((asset) => !loadedSharedCssAssets.has(asset) && !isExisted("link", asset)),
|
|
2346
|
+
jsAssetsWithoutEntry: needPreloadJsAssets,
|
|
2347
|
+
entryAssets: entryAssets.filter((entry) => !isExisted("script", entry.url))
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
var generatePreloadAssetsPlugin = function() {
|
|
2351
|
+
return {
|
|
2352
|
+
name: "generate-preload-assets-plugin",
|
|
2353
|
+
async generatePreloadAssets(args) {
|
|
2354
|
+
const { origin, preloadOptions, remoteInfo, remote, globalSnapshot, remoteSnapshot } = args;
|
|
2355
|
+
if (isRemoteInfoWithEntry(remote) && isPureRemoteEntry(remote)) return {
|
|
2356
|
+
cssAssets: [],
|
|
2357
|
+
jsAssetsWithoutEntry: [],
|
|
2358
|
+
entryAssets: [{
|
|
2359
|
+
name: remote.name,
|
|
2360
|
+
url: remote.entry,
|
|
2361
|
+
moduleInfo: {
|
|
2362
|
+
name: remoteInfo.name,
|
|
2363
|
+
entry: remote.entry,
|
|
2364
|
+
type: remoteInfo.type || "global",
|
|
2365
|
+
entryGlobalName: "",
|
|
2366
|
+
shareScope: ""
|
|
2367
|
+
}
|
|
2368
|
+
}]
|
|
2369
|
+
};
|
|
2370
|
+
assignRemoteInfo(remoteInfo, remoteSnapshot);
|
|
2371
|
+
return generatePreloadAssets(origin, preloadOptions, remoteInfo, globalSnapshot, remoteSnapshot);
|
|
2372
|
+
}
|
|
2373
|
+
};
|
|
2374
|
+
};
|
|
2375
|
+
//#endregion
|
|
2376
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/SnapshotHandler.js
|
|
2377
|
+
function getGlobalRemoteInfo(moduleInfo, origin) {
|
|
2378
|
+
const hostGlobalSnapshot = getGlobalSnapshotInfoByModuleInfo({
|
|
2379
|
+
name: origin.name,
|
|
2380
|
+
version: origin.options.version
|
|
2381
|
+
});
|
|
2382
|
+
const globalRemoteInfo = hostGlobalSnapshot && "remotesInfo" in hostGlobalSnapshot && hostGlobalSnapshot.remotesInfo && getInfoWithoutType(hostGlobalSnapshot.remotesInfo, moduleInfo.name).value;
|
|
2383
|
+
if (globalRemoteInfo && globalRemoteInfo.matchedVersion) return {
|
|
2384
|
+
hostGlobalSnapshot,
|
|
2385
|
+
globalSnapshot: getGlobalSnapshot(),
|
|
2386
|
+
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
2387
|
+
name: moduleInfo.name,
|
|
2388
|
+
version: globalRemoteInfo.matchedVersion
|
|
2389
|
+
})
|
|
2390
|
+
};
|
|
2391
|
+
return {
|
|
2392
|
+
hostGlobalSnapshot: void 0,
|
|
2393
|
+
globalSnapshot: getGlobalSnapshot(),
|
|
2394
|
+
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
2395
|
+
name: moduleInfo.name,
|
|
2396
|
+
version: "version" in moduleInfo ? moduleInfo.version : void 0
|
|
2397
|
+
})
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2400
|
+
var SnapshotHandler = class {
|
|
2401
|
+
constructor(HostInstance) {
|
|
2402
|
+
this.loadingHostSnapshot = null;
|
|
2403
|
+
this.manifestCache = /* @__PURE__ */ new Map();
|
|
2404
|
+
this.hooks = new PluginSystem({
|
|
2405
|
+
beforeLoadRemoteSnapshot: new AsyncHook("beforeLoadRemoteSnapshot"),
|
|
2406
|
+
loadSnapshot: new AsyncWaterfallHook("loadGlobalSnapshot"),
|
|
2407
|
+
loadRemoteSnapshot: new AsyncWaterfallHook("loadRemoteSnapshot"),
|
|
2408
|
+
afterLoadSnapshot: new AsyncWaterfallHook("afterLoadSnapshot")
|
|
2409
|
+
});
|
|
2410
|
+
this.manifestLoading = Global.__FEDERATION__.__MANIFEST_LOADING__;
|
|
2411
|
+
this.HostInstance = HostInstance;
|
|
2412
|
+
this.loaderHook = HostInstance.loaderHook;
|
|
2413
|
+
}
|
|
2414
|
+
async loadRemoteSnapshotInfo({ moduleInfo, id, initiator = "loadRemote" }) {
|
|
2415
|
+
const { options } = this.HostInstance;
|
|
2416
|
+
await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
|
|
2417
|
+
options,
|
|
2418
|
+
moduleInfo,
|
|
2419
|
+
origin: this.HostInstance
|
|
2420
|
+
});
|
|
2421
|
+
let hostSnapshot = getGlobalSnapshotInfoByModuleInfo({
|
|
2422
|
+
name: this.HostInstance.options.name,
|
|
2423
|
+
version: this.HostInstance.options.version
|
|
2424
|
+
});
|
|
2425
|
+
if (!hostSnapshot) {
|
|
2426
|
+
hostSnapshot = {
|
|
2427
|
+
version: this.HostInstance.options.version || "",
|
|
2428
|
+
remoteEntry: "",
|
|
2429
|
+
remotesInfo: {}
|
|
2430
|
+
};
|
|
2431
|
+
addGlobalSnapshot({ [this.HostInstance.options.name]: hostSnapshot });
|
|
2432
|
+
}
|
|
2433
|
+
if (hostSnapshot && "remotesInfo" in hostSnapshot && !getInfoWithoutType(hostSnapshot.remotesInfo, moduleInfo.name).value) {
|
|
2434
|
+
if ("version" in moduleInfo || "entry" in moduleInfo) hostSnapshot.remotesInfo = {
|
|
2435
|
+
...hostSnapshot?.remotesInfo,
|
|
2436
|
+
[moduleInfo.name]: { matchedVersion: "version" in moduleInfo ? moduleInfo.version : moduleInfo.entry }
|
|
2437
|
+
};
|
|
2438
|
+
}
|
|
2439
|
+
const { hostGlobalSnapshot, remoteSnapshot, globalSnapshot } = this.getGlobalRemoteInfo(moduleInfo);
|
|
2440
|
+
const { remoteSnapshot: globalRemoteSnapshot, globalSnapshot: globalSnapshotRes } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
2441
|
+
options,
|
|
2442
|
+
moduleInfo,
|
|
2443
|
+
hostGlobalSnapshot,
|
|
2444
|
+
remoteSnapshot,
|
|
2445
|
+
globalSnapshot
|
|
2446
|
+
});
|
|
2447
|
+
let mSnapshot;
|
|
2448
|
+
let gSnapshot;
|
|
2449
|
+
if (globalRemoteSnapshot) if (isManifestProvider(globalRemoteSnapshot)) {
|
|
2450
|
+
const remoteEntry = globalRemoteSnapshot.remoteEntry;
|
|
2451
|
+
const moduleSnapshot = await this.loadManifestSnapshot(remoteEntry, moduleInfo, {}, {
|
|
2452
|
+
initiator,
|
|
2453
|
+
id: id || moduleInfo.name
|
|
2454
|
+
});
|
|
2455
|
+
const globalSnapshotRes = setGlobalSnapshotInfoByModuleInfo({
|
|
2456
|
+
...moduleInfo,
|
|
2457
|
+
entry: remoteEntry
|
|
2458
|
+
}, moduleSnapshot);
|
|
2459
|
+
mSnapshot = moduleSnapshot;
|
|
2460
|
+
gSnapshot = globalSnapshotRes;
|
|
2461
|
+
} else {
|
|
2462
|
+
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2463
|
+
options: this.HostInstance.options,
|
|
2464
|
+
moduleInfo,
|
|
2465
|
+
remoteSnapshot: globalRemoteSnapshot,
|
|
2466
|
+
from: "global"
|
|
2467
|
+
});
|
|
2468
|
+
mSnapshot = remoteSnapshotRes;
|
|
2469
|
+
gSnapshot = globalSnapshotRes;
|
|
2470
|
+
}
|
|
2471
|
+
else if (isRemoteInfoWithEntry(moduleInfo)) {
|
|
2472
|
+
const moduleSnapshot = await this.loadManifestSnapshot(moduleInfo.entry, moduleInfo, {}, {
|
|
2473
|
+
initiator,
|
|
2474
|
+
id: id || moduleInfo.name
|
|
2475
|
+
});
|
|
2476
|
+
const globalSnapshotRes = setGlobalSnapshotInfoByModuleInfo(moduleInfo, moduleSnapshot);
|
|
2477
|
+
mSnapshot = moduleSnapshot;
|
|
2478
|
+
gSnapshot = globalSnapshotRes;
|
|
2479
|
+
} else error(RUNTIME_007, runtimeDescMap, {
|
|
2480
|
+
remoteName: moduleInfo.name,
|
|
2481
|
+
remoteVersion: moduleInfo.version,
|
|
2482
|
+
hostName: this.HostInstance.options.name,
|
|
2483
|
+
globalSnapshot: JSON.stringify(globalSnapshotRes)
|
|
2484
|
+
}, void 0, optionsToMFContext(this.HostInstance.options));
|
|
2485
|
+
await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
2486
|
+
id,
|
|
2487
|
+
host: this.HostInstance,
|
|
2488
|
+
options,
|
|
2489
|
+
moduleInfo,
|
|
2490
|
+
remoteSnapshot: mSnapshot
|
|
2491
|
+
});
|
|
2492
|
+
return {
|
|
2493
|
+
remoteSnapshot: mSnapshot,
|
|
2494
|
+
globalSnapshot: gSnapshot
|
|
2495
|
+
};
|
|
2496
|
+
}
|
|
2497
|
+
getGlobalRemoteInfo(moduleInfo) {
|
|
2498
|
+
return getGlobalRemoteInfo(moduleInfo, this.HostInstance);
|
|
2499
|
+
}
|
|
2500
|
+
async getManifestJson(manifestUrl, moduleInfo, extraOptions, resourceOptions) {
|
|
2501
|
+
const getManifest = async () => {
|
|
2502
|
+
const remoteInfo = getRemoteInfo(moduleInfo);
|
|
2503
|
+
let manifestJson = this.manifestCache.get(manifestUrl);
|
|
2504
|
+
if (manifestJson) return manifestJson;
|
|
2505
|
+
try {
|
|
2506
|
+
let res = await this.loaderHook.lifecycle.fetch.emit(manifestUrl, {}, remoteInfo, resourceOptions ? {
|
|
2507
|
+
...resourceOptions,
|
|
2508
|
+
url: manifestUrl,
|
|
2509
|
+
resourceType: "manifest"
|
|
2510
|
+
} : void 0);
|
|
2511
|
+
if (!res || !(res instanceof Response)) res = await fetch(manifestUrl, {});
|
|
2512
|
+
manifestJson = await res.json();
|
|
2513
|
+
} catch (err) {
|
|
2514
|
+
manifestJson = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2515
|
+
id: manifestUrl,
|
|
2516
|
+
error: err,
|
|
2517
|
+
from: "runtime",
|
|
2518
|
+
lifecycle: "afterResolve",
|
|
2519
|
+
remote: remoteInfo,
|
|
2520
|
+
origin: this.HostInstance
|
|
2521
|
+
});
|
|
2522
|
+
if (!manifestJson) {
|
|
2523
|
+
delete this.manifestLoading[manifestUrl];
|
|
2524
|
+
error(RUNTIME_003, runtimeDescMap, {
|
|
2525
|
+
manifestUrl,
|
|
2526
|
+
moduleName: moduleInfo.name,
|
|
2527
|
+
hostName: this.HostInstance.options.name
|
|
2528
|
+
}, `${err}`, optionsToMFContext(this.HostInstance.options));
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
const missingRequiredFields = [
|
|
2532
|
+
!manifestJson.metaData && "metaData",
|
|
2533
|
+
!manifestJson.exposes && "exposes",
|
|
2534
|
+
!manifestJson.shared && "shared"
|
|
2535
|
+
].filter(Boolean);
|
|
2536
|
+
if (missingRequiredFields.length > 0) await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2537
|
+
id: manifestUrl,
|
|
2538
|
+
error: /* @__PURE__ */ new Error(`"${manifestUrl}" is not a valid federation manifest for remote "${moduleInfo.name}". Missing required fields: ${missingRequiredFields.join(", ")}.`),
|
|
2539
|
+
from: "runtime",
|
|
2540
|
+
lifecycle: "afterResolve",
|
|
2541
|
+
remote: remoteInfo,
|
|
2542
|
+
origin: this.HostInstance
|
|
2543
|
+
});
|
|
2544
|
+
if (missingRequiredFields.length > 0) error(RUNTIME_013, runtimeDescMap, {
|
|
2545
|
+
manifestUrl,
|
|
2546
|
+
moduleName: moduleInfo.name,
|
|
2547
|
+
hostName: this.HostInstance.options.name,
|
|
2548
|
+
missingFields: missingRequiredFields.join(",")
|
|
2549
|
+
}, void 0, optionsToMFContext(this.HostInstance.options));
|
|
2550
|
+
this.manifestCache.set(manifestUrl, manifestJson);
|
|
2551
|
+
return manifestJson;
|
|
2552
|
+
};
|
|
2553
|
+
return getManifest();
|
|
2554
|
+
}
|
|
2555
|
+
async loadManifestSnapshot(manifestUrl, moduleInfo, extraOptions, resourceOptions) {
|
|
2556
|
+
const asyncLoadProcess = async () => {
|
|
2557
|
+
const manifestJson = await this.getManifestJson(manifestUrl, moduleInfo, extraOptions, resourceOptions);
|
|
2558
|
+
const remoteSnapshot = generateSnapshotFromManifest(manifestJson, { version: manifestUrl });
|
|
2559
|
+
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2560
|
+
options: this.HostInstance.options,
|
|
2561
|
+
moduleInfo,
|
|
2562
|
+
manifestJson,
|
|
2563
|
+
remoteSnapshot,
|
|
2564
|
+
manifestUrl,
|
|
2565
|
+
from: "manifest"
|
|
2566
|
+
});
|
|
2567
|
+
return remoteSnapshotRes;
|
|
2568
|
+
};
|
|
2569
|
+
if (!this.manifestLoading[manifestUrl]) this.manifestLoading[manifestUrl] = asyncLoadProcess().then((res) => res);
|
|
2570
|
+
return this.manifestLoading[manifestUrl];
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2573
|
+
//#endregion
|
|
2574
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/shared/index.js
|
|
2575
|
+
var SharedHandler = class {
|
|
2576
|
+
constructor(host) {
|
|
2577
|
+
this.hooks = new PluginSystem({
|
|
2578
|
+
beforeRegisterShare: new SyncWaterfallHook("beforeRegisterShare"),
|
|
2579
|
+
afterResolve: new AsyncWaterfallHook("afterResolve"),
|
|
2580
|
+
beforeLoadShare: new AsyncWaterfallHook("beforeLoadShare"),
|
|
2581
|
+
loadShare: new AsyncHook(),
|
|
2582
|
+
afterLoadShare: new SyncHook("afterLoadShare"),
|
|
2583
|
+
errorLoadShare: new SyncHook("errorLoadShare"),
|
|
2584
|
+
resolveShare: new SyncWaterfallHook("resolveShare"),
|
|
2585
|
+
initContainerShareScopeMap: new SyncWaterfallHook("initContainerShareScopeMap")
|
|
2586
|
+
});
|
|
2587
|
+
this.host = host;
|
|
2588
|
+
this.shareScopeMap = {};
|
|
2589
|
+
this.initTokens = {};
|
|
2590
|
+
this._setGlobalShareScopeMap(host.options);
|
|
2591
|
+
}
|
|
2592
|
+
emitAfterLoadShare({ lifecycle, pkgName, shareInfo, selectedShared }) {
|
|
2593
|
+
try {
|
|
2594
|
+
this.hooks.lifecycle.afterLoadShare.emit({
|
|
2595
|
+
pkgName,
|
|
2596
|
+
shareInfo,
|
|
2597
|
+
selectedShared,
|
|
2598
|
+
shared: this.host.options.shared,
|
|
2599
|
+
shareScopeMap: this.shareScopeMap,
|
|
2600
|
+
lifecycle,
|
|
2601
|
+
origin: this.host
|
|
2602
|
+
});
|
|
2603
|
+
} catch (error) {
|
|
2604
|
+
warn$1(error);
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
emitErrorLoadShare({ lifecycle, pkgName, shareInfo, error, recovered }) {
|
|
2608
|
+
try {
|
|
2609
|
+
this.hooks.lifecycle.errorLoadShare.emit({
|
|
2610
|
+
pkgName,
|
|
2611
|
+
shareInfo,
|
|
2612
|
+
shared: this.host.options.shared,
|
|
2613
|
+
shareScopeMap: this.shareScopeMap,
|
|
2614
|
+
lifecycle,
|
|
2615
|
+
origin: this.host,
|
|
2616
|
+
error,
|
|
2617
|
+
recovered
|
|
2618
|
+
});
|
|
2619
|
+
} catch (hookError) {
|
|
2620
|
+
warn$1(hookError);
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
registerShared(globalOptions, userOptions) {
|
|
2624
|
+
const { newShareInfos, allShareInfos } = formatShareConfigs(globalOptions, userOptions);
|
|
2625
|
+
Object.keys(newShareInfos).forEach((sharedKey) => {
|
|
2626
|
+
newShareInfos[sharedKey].forEach((sharedVal) => {
|
|
2627
|
+
sharedVal.scope.forEach((sc) => {
|
|
2628
|
+
this.hooks.lifecycle.beforeRegisterShare.emit({
|
|
2629
|
+
origin: this.host,
|
|
2630
|
+
pkgName: sharedKey,
|
|
2631
|
+
shared: sharedVal
|
|
2632
|
+
});
|
|
2633
|
+
if (!this.shareScopeMap[sc]?.[sharedKey]) this.setShared({
|
|
2634
|
+
pkgName: sharedKey,
|
|
2635
|
+
lib: sharedVal.lib,
|
|
2636
|
+
get: sharedVal.get,
|
|
2637
|
+
loaded: sharedVal.loaded || Boolean(sharedVal.lib),
|
|
2638
|
+
shared: sharedVal,
|
|
2639
|
+
from: userOptions.name
|
|
2640
|
+
});
|
|
2641
|
+
});
|
|
2642
|
+
});
|
|
2643
|
+
});
|
|
2644
|
+
return {
|
|
2645
|
+
newShareInfos,
|
|
2646
|
+
allShareInfos
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
async loadShare(pkgName, extraOptions) {
|
|
2650
|
+
const { host } = this;
|
|
2651
|
+
const shareOptions = getTargetSharedOptions({
|
|
2652
|
+
pkgName,
|
|
2653
|
+
extraOptions,
|
|
2654
|
+
shareInfos: host.options.shared
|
|
2655
|
+
});
|
|
2656
|
+
let shareOptionsRes = shareOptions;
|
|
2657
|
+
try {
|
|
2658
|
+
if (shareOptions?.scope) await Promise.all(shareOptions.scope.map(async (shareScope) => {
|
|
2659
|
+
await Promise.all(this.initializeSharing(shareScope, { strategy: shareOptions.strategy }));
|
|
2660
|
+
}));
|
|
2661
|
+
shareOptionsRes = (await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
2662
|
+
pkgName,
|
|
2663
|
+
shareInfo: shareOptions,
|
|
2664
|
+
shared: host.options.shared,
|
|
2665
|
+
origin: host
|
|
2666
|
+
})).shareInfo;
|
|
2667
|
+
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.`);
|
|
2668
|
+
const resolvedShareOptions = shareOptionsRes;
|
|
2669
|
+
const { shared: registeredShared, useTreesShaking } = getRegisteredShare(this.shareScopeMap, pkgName, shareOptionsRes, this.hooks.lifecycle.resolveShare) || {};
|
|
2670
|
+
if (registeredShared) {
|
|
2671
|
+
const targetShared = directShare(registeredShared, useTreesShaking);
|
|
2672
|
+
if (targetShared.lib) {
|
|
2673
|
+
addUseIn(targetShared, host.options.name);
|
|
2674
|
+
this.emitAfterLoadShare({
|
|
2675
|
+
lifecycle: "loadShare",
|
|
2676
|
+
pkgName,
|
|
2677
|
+
shareInfo: resolvedShareOptions,
|
|
2678
|
+
selectedShared: registeredShared
|
|
2679
|
+
});
|
|
2680
|
+
return targetShared.lib;
|
|
2681
|
+
} else if (targetShared.loading && !targetShared.loaded) {
|
|
2682
|
+
const factory = await targetShared.loading;
|
|
2683
|
+
targetShared.loaded = true;
|
|
2684
|
+
if (!targetShared.lib) targetShared.lib = factory;
|
|
2685
|
+
addUseIn(targetShared, host.options.name);
|
|
2686
|
+
this.emitAfterLoadShare({
|
|
2687
|
+
lifecycle: "loadShare",
|
|
2688
|
+
pkgName,
|
|
2689
|
+
shareInfo: resolvedShareOptions,
|
|
2690
|
+
selectedShared: registeredShared
|
|
2691
|
+
});
|
|
2692
|
+
return factory;
|
|
2693
|
+
} else {
|
|
2694
|
+
const asyncLoadProcess = async () => {
|
|
2695
|
+
const factory = await targetShared.get();
|
|
2696
|
+
addUseIn(targetShared, host.options.name);
|
|
2697
|
+
targetShared.loaded = true;
|
|
2698
|
+
targetShared.lib = factory;
|
|
2699
|
+
return factory;
|
|
2700
|
+
};
|
|
2701
|
+
const loading = asyncLoadProcess();
|
|
2702
|
+
this.setShared({
|
|
2703
|
+
pkgName,
|
|
2704
|
+
loaded: false,
|
|
2705
|
+
shared: registeredShared,
|
|
2706
|
+
from: host.options.name,
|
|
2707
|
+
lib: null,
|
|
2708
|
+
loading,
|
|
2709
|
+
treeShaking: useTreesShaking ? targetShared : void 0
|
|
2710
|
+
});
|
|
2711
|
+
const factory = await loading;
|
|
2712
|
+
this.emitAfterLoadShare({
|
|
2713
|
+
lifecycle: "loadShare",
|
|
2714
|
+
pkgName,
|
|
2715
|
+
shareInfo: resolvedShareOptions,
|
|
2716
|
+
selectedShared: registeredShared
|
|
2717
|
+
});
|
|
2718
|
+
return factory;
|
|
2719
|
+
}
|
|
2720
|
+
} else {
|
|
2721
|
+
if (extraOptions?.customShareInfo) {
|
|
2722
|
+
this.emitErrorLoadShare({
|
|
2723
|
+
lifecycle: "loadShare",
|
|
2724
|
+
pkgName,
|
|
2725
|
+
shareInfo: resolvedShareOptions,
|
|
2726
|
+
recovered: true
|
|
2727
|
+
});
|
|
2728
|
+
return false;
|
|
2729
|
+
}
|
|
2730
|
+
const _useTreeShaking = shouldUseTreeShaking(resolvedShareOptions.treeShaking);
|
|
2731
|
+
const targetShared = directShare(resolvedShareOptions, _useTreeShaking);
|
|
2732
|
+
const asyncLoadProcess = async () => {
|
|
2733
|
+
const factory = await targetShared.get();
|
|
2734
|
+
targetShared.lib = factory;
|
|
2735
|
+
targetShared.loaded = true;
|
|
2736
|
+
addUseIn(targetShared, host.options.name);
|
|
2737
|
+
const { shared: gShared, useTreesShaking: gUseTreeShaking } = getRegisteredShare(this.shareScopeMap, pkgName, resolvedShareOptions, this.hooks.lifecycle.resolveShare) || {};
|
|
2738
|
+
if (gShared) {
|
|
2739
|
+
const targetGShared = directShare(gShared, gUseTreeShaking);
|
|
2740
|
+
targetGShared.lib = factory;
|
|
2741
|
+
targetGShared.loaded = true;
|
|
2742
|
+
gShared.from = resolvedShareOptions.from;
|
|
2743
|
+
}
|
|
2744
|
+
return factory;
|
|
2745
|
+
};
|
|
2746
|
+
const loading = asyncLoadProcess();
|
|
2747
|
+
this.setShared({
|
|
2748
|
+
pkgName,
|
|
2749
|
+
loaded: false,
|
|
2750
|
+
shared: resolvedShareOptions,
|
|
2751
|
+
from: host.options.name,
|
|
2752
|
+
lib: null,
|
|
2753
|
+
loading,
|
|
2754
|
+
treeShaking: _useTreeShaking ? targetShared : void 0
|
|
2755
|
+
});
|
|
2756
|
+
const factory = await loading;
|
|
2757
|
+
this.emitAfterLoadShare({
|
|
2758
|
+
lifecycle: "loadShare",
|
|
2759
|
+
pkgName,
|
|
2760
|
+
shareInfo: resolvedShareOptions,
|
|
2761
|
+
selectedShared: resolvedShareOptions
|
|
2762
|
+
});
|
|
2763
|
+
return factory;
|
|
2764
|
+
}
|
|
2765
|
+
} catch (shareError) {
|
|
2766
|
+
this.emitErrorLoadShare({
|
|
2767
|
+
lifecycle: "loadShare",
|
|
2768
|
+
pkgName,
|
|
2769
|
+
shareInfo: shareOptionsRes,
|
|
2770
|
+
error: shareError
|
|
2771
|
+
});
|
|
2772
|
+
throw shareError;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
/**
|
|
2776
|
+
* This function initializes the sharing sequence (executed only once per share scope).
|
|
2777
|
+
* It accepts one argument, the name of the share scope.
|
|
2778
|
+
* If the share scope does not exist, it creates one.
|
|
2779
|
+
*/
|
|
2780
|
+
initializeSharing(shareScopeName = DEFAULT_SCOPE, extraOptions) {
|
|
2781
|
+
const { host } = this;
|
|
2782
|
+
const from = extraOptions?.from;
|
|
2783
|
+
const strategy = extraOptions?.strategy;
|
|
2784
|
+
let initScope = extraOptions?.initScope;
|
|
2785
|
+
const promises = [];
|
|
2786
|
+
if (from !== "build") {
|
|
2787
|
+
const { initTokens } = this;
|
|
2788
|
+
if (!initScope) initScope = [];
|
|
2789
|
+
let initToken = initTokens[shareScopeName];
|
|
2790
|
+
if (!initToken) initToken = initTokens[shareScopeName] = { from: this.host.name };
|
|
2791
|
+
if (initScope.indexOf(initToken) >= 0) return promises;
|
|
2792
|
+
initScope.push(initToken);
|
|
2793
|
+
}
|
|
2794
|
+
const shareScope = this.shareScopeMap;
|
|
2795
|
+
const hostName = host.options.name;
|
|
2796
|
+
if (!shareScope[shareScopeName]) shareScope[shareScopeName] = {};
|
|
2797
|
+
const scope = shareScope[shareScopeName];
|
|
2798
|
+
const register = (name, shared) => {
|
|
2799
|
+
const { version, eager } = shared;
|
|
2800
|
+
scope[name] = scope[name] || {};
|
|
2801
|
+
const versions = scope[name];
|
|
2802
|
+
const activeVersion = versions[version] && directShare(versions[version]);
|
|
2803
|
+
const activeVersionEager = Boolean(activeVersion && ("eager" in activeVersion && activeVersion.eager || "shareConfig" in activeVersion && activeVersion.shareConfig?.eager));
|
|
2804
|
+
if (!activeVersion || activeVersion.strategy !== "loaded-first" && !activeVersion.loaded && (Boolean(!eager) !== !activeVersionEager ? eager : hostName > versions[version].from)) versions[version] = shared;
|
|
2805
|
+
};
|
|
2806
|
+
const initRemoteModule = async (key) => {
|
|
2807
|
+
const { module } = await host.remoteHandler.getRemoteModuleAndOptions({ id: key });
|
|
2808
|
+
let remoteEntryExports = void 0;
|
|
2809
|
+
try {
|
|
2810
|
+
remoteEntryExports = await module.getEntry();
|
|
2811
|
+
} catch (error) {
|
|
2812
|
+
remoteEntryExports = await host.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2813
|
+
id: key,
|
|
2814
|
+
error,
|
|
2815
|
+
from: "runtime",
|
|
2816
|
+
lifecycle: "beforeLoadShare",
|
|
2817
|
+
remote: module.remoteInfo,
|
|
2818
|
+
origin: host
|
|
2819
|
+
});
|
|
2820
|
+
if (!remoteEntryExports) return;
|
|
2821
|
+
} finally {
|
|
2822
|
+
if (remoteEntryExports?.init && !module.initing) {
|
|
2823
|
+
module.remoteEntryExports = remoteEntryExports;
|
|
2824
|
+
await module.init(void 0, void 0, initScope);
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
};
|
|
2828
|
+
Object.keys(host.options.shared).forEach((shareName) => {
|
|
2829
|
+
host.options.shared[shareName].forEach((shared) => {
|
|
2830
|
+
if (shared.scope.includes(shareScopeName)) register(shareName, shared);
|
|
2831
|
+
});
|
|
2832
|
+
});
|
|
2833
|
+
if (host.options.shareStrategy === "version-first" || strategy === "version-first") host.options.remotes.forEach((remote) => {
|
|
2834
|
+
if (remote.shareScope === shareScopeName) promises.push(initRemoteModule(remote.name));
|
|
2835
|
+
});
|
|
2836
|
+
return promises;
|
|
2837
|
+
}
|
|
2838
|
+
loadShareSync(pkgName, extraOptions) {
|
|
2839
|
+
const { host } = this;
|
|
2840
|
+
const shareOptions = getTargetSharedOptions({
|
|
2841
|
+
pkgName,
|
|
2842
|
+
extraOptions,
|
|
2843
|
+
shareInfos: host.options.shared
|
|
2844
|
+
});
|
|
2845
|
+
try {
|
|
2846
|
+
if (shareOptions?.scope) shareOptions.scope.forEach((shareScope) => {
|
|
2847
|
+
this.initializeSharing(shareScope, { strategy: shareOptions.strategy });
|
|
2848
|
+
});
|
|
2849
|
+
const { shared: registeredShared } = getRegisteredShare(this.shareScopeMap, pkgName, shareOptions, this.hooks.lifecycle.resolveShare) || {};
|
|
2850
|
+
if (registeredShared) {
|
|
2851
|
+
if (typeof registeredShared.lib === "function") {
|
|
2852
|
+
addUseIn(registeredShared, host.options.name);
|
|
2853
|
+
if (!registeredShared.loaded) {
|
|
2854
|
+
registeredShared.loaded = true;
|
|
2855
|
+
if (registeredShared.from === host.options.name) shareOptions.loaded = true;
|
|
2856
|
+
}
|
|
2857
|
+
this.emitAfterLoadShare({
|
|
2858
|
+
lifecycle: "loadShareSync",
|
|
2859
|
+
pkgName,
|
|
2860
|
+
shareInfo: shareOptions,
|
|
2861
|
+
selectedShared: registeredShared
|
|
2862
|
+
});
|
|
2863
|
+
return registeredShared.lib;
|
|
2864
|
+
}
|
|
2865
|
+
if (typeof registeredShared.get === "function") {
|
|
2866
|
+
const module = registeredShared.get();
|
|
2867
|
+
if (!(module instanceof Promise)) {
|
|
2868
|
+
addUseIn(registeredShared, host.options.name);
|
|
2869
|
+
this.setShared({
|
|
2870
|
+
pkgName,
|
|
2871
|
+
loaded: true,
|
|
2872
|
+
from: host.options.name,
|
|
2873
|
+
lib: module,
|
|
2874
|
+
shared: registeredShared
|
|
2875
|
+
});
|
|
2876
|
+
this.emitAfterLoadShare({
|
|
2877
|
+
lifecycle: "loadShareSync",
|
|
2878
|
+
pkgName,
|
|
2879
|
+
shareInfo: shareOptions,
|
|
2880
|
+
selectedShared: registeredShared
|
|
2881
|
+
});
|
|
2882
|
+
return module;
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
if (shareOptions.lib) {
|
|
2887
|
+
if (!shareOptions.loaded) shareOptions.loaded = true;
|
|
2888
|
+
this.emitAfterLoadShare({
|
|
2889
|
+
lifecycle: "loadShareSync",
|
|
2890
|
+
pkgName,
|
|
2891
|
+
shareInfo: shareOptions,
|
|
2892
|
+
selectedShared: shareOptions
|
|
2893
|
+
});
|
|
2894
|
+
return shareOptions.lib;
|
|
2895
|
+
}
|
|
2896
|
+
if (shareOptions.get) {
|
|
2897
|
+
const module = shareOptions.get();
|
|
2898
|
+
if (module instanceof Promise) error(extraOptions?.from === "build" ? RUNTIME_005 : RUNTIME_006, runtimeDescMap, {
|
|
2899
|
+
hostName: host.options.name,
|
|
2900
|
+
sharedPkgName: pkgName
|
|
2901
|
+
}, void 0, optionsToMFContext(host.options));
|
|
2902
|
+
shareOptions.lib = module;
|
|
2903
|
+
this.setShared({
|
|
2904
|
+
pkgName,
|
|
2905
|
+
loaded: true,
|
|
2906
|
+
from: host.options.name,
|
|
2907
|
+
lib: shareOptions.lib,
|
|
2908
|
+
shared: shareOptions
|
|
2909
|
+
});
|
|
2910
|
+
this.emitAfterLoadShare({
|
|
2911
|
+
lifecycle: "loadShareSync",
|
|
2912
|
+
pkgName,
|
|
2913
|
+
shareInfo: shareOptions,
|
|
2914
|
+
selectedShared: shareOptions
|
|
2915
|
+
});
|
|
2916
|
+
return shareOptions.lib;
|
|
2917
|
+
}
|
|
2918
|
+
error(RUNTIME_006, runtimeDescMap, {
|
|
2919
|
+
hostName: host.options.name,
|
|
2920
|
+
sharedPkgName: pkgName
|
|
2921
|
+
}, void 0, optionsToMFContext(host.options));
|
|
2922
|
+
} catch (shareError) {
|
|
2923
|
+
this.emitErrorLoadShare({
|
|
2924
|
+
lifecycle: "loadShareSync",
|
|
2925
|
+
pkgName,
|
|
2926
|
+
shareInfo: shareOptions,
|
|
2927
|
+
error: shareError
|
|
2928
|
+
});
|
|
2929
|
+
throw shareError;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
initShareScopeMap(scopeName, shareScope, extraOptions = {}) {
|
|
2933
|
+
const { host } = this;
|
|
2934
|
+
this.shareScopeMap[scopeName] = shareScope;
|
|
2935
|
+
this.hooks.lifecycle.initContainerShareScopeMap.emit({
|
|
2936
|
+
shareScope,
|
|
2937
|
+
options: host.options,
|
|
2938
|
+
origin: host,
|
|
2939
|
+
scopeName,
|
|
2940
|
+
hostShareScopeMap: extraOptions.hostShareScopeMap
|
|
2941
|
+
});
|
|
2942
|
+
}
|
|
2943
|
+
setShared({ pkgName, shared, from, lib, loading, loaded, get, treeShaking }) {
|
|
2944
|
+
const { version, scope = "default", ...shareInfo } = shared;
|
|
2945
|
+
const scopes = Array.isArray(scope) ? scope : [scope];
|
|
2946
|
+
const mergeAttrs = (shared) => {
|
|
2947
|
+
const merge = (s, key, val) => {
|
|
2948
|
+
if (val && !s[key]) s[key] = val;
|
|
2949
|
+
};
|
|
2950
|
+
const targetShared = treeShaking ? shared.treeShaking : shared;
|
|
2951
|
+
merge(targetShared, "loaded", loaded);
|
|
2952
|
+
merge(targetShared, "loading", loading);
|
|
2953
|
+
merge(targetShared, "get", get);
|
|
2954
|
+
};
|
|
2955
|
+
scopes.forEach((sc) => {
|
|
2956
|
+
if (!this.shareScopeMap[sc]) this.shareScopeMap[sc] = {};
|
|
2957
|
+
if (!this.shareScopeMap[sc][pkgName]) this.shareScopeMap[sc][pkgName] = {};
|
|
2958
|
+
if (!this.shareScopeMap[sc][pkgName][version]) this.shareScopeMap[sc][pkgName][version] = {
|
|
2959
|
+
version,
|
|
2960
|
+
scope: [sc],
|
|
2961
|
+
...shareInfo,
|
|
2962
|
+
lib
|
|
2963
|
+
};
|
|
2964
|
+
const registeredShared = this.shareScopeMap[sc][pkgName][version];
|
|
2965
|
+
mergeAttrs(registeredShared);
|
|
2966
|
+
if (from && registeredShared.from !== from) registeredShared.from = from;
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
_setGlobalShareScopeMap(hostOptions) {
|
|
2970
|
+
const globalShareScopeMap = getGlobalShareScope();
|
|
2971
|
+
const identifier = hostOptions.id || hostOptions.name;
|
|
2972
|
+
if (identifier && !globalShareScopeMap[identifier]) globalShareScopeMap[identifier] = this.shareScopeMap;
|
|
2973
|
+
}
|
|
2974
|
+
};
|
|
2975
|
+
//#endregion
|
|
2976
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/remote/index.js
|
|
2977
|
+
var RemoteHandler = class {
|
|
2978
|
+
constructor(host) {
|
|
2979
|
+
this.hooks = new PluginSystem({
|
|
2980
|
+
beforeRegisterRemote: new SyncWaterfallHook("beforeRegisterRemote"),
|
|
2981
|
+
registerRemote: new SyncWaterfallHook("registerRemote"),
|
|
2982
|
+
beforeRequest: new AsyncWaterfallHook("beforeRequest"),
|
|
2983
|
+
afterMatchRemote: new AsyncHook("afterMatchRemote"),
|
|
2984
|
+
onLoad: new AsyncHook("onLoad"),
|
|
2985
|
+
afterLoadRemote: new AsyncHook("afterLoadRemote"),
|
|
2986
|
+
handlePreloadModule: new SyncHook("handlePreloadModule"),
|
|
2987
|
+
errorLoadRemote: new AsyncHook("errorLoadRemote"),
|
|
2988
|
+
beforePreloadRemote: new AsyncHook("beforePreloadRemote"),
|
|
2989
|
+
generatePreloadAssets: new AsyncHook("generatePreloadAssets"),
|
|
2990
|
+
afterPreloadRemote: new AsyncHook("afterPreloadRemote"),
|
|
2991
|
+
loadEntry: new AsyncHook()
|
|
2992
|
+
});
|
|
2993
|
+
this.host = host;
|
|
2994
|
+
this.idToRemoteMap = {};
|
|
2995
|
+
}
|
|
2996
|
+
formatAndRegisterRemote(globalOptions, userOptions) {
|
|
2997
|
+
return (userOptions.remotes || []).reduce((res, remote) => {
|
|
2998
|
+
this.registerRemote(remote, res, { force: false });
|
|
2999
|
+
return res;
|
|
3000
|
+
}, globalOptions.remotes);
|
|
3001
|
+
}
|
|
3002
|
+
setIdToRemoteMap(id, remoteMatchInfo) {
|
|
3003
|
+
const { remote, expose } = remoteMatchInfo;
|
|
3004
|
+
const { name, alias } = remote;
|
|
3005
|
+
this.idToRemoteMap[id] = {
|
|
3006
|
+
name: remote.name,
|
|
3007
|
+
expose
|
|
3008
|
+
};
|
|
3009
|
+
if (alias && id.startsWith(name)) {
|
|
3010
|
+
const idWithAlias = id.replace(name, alias);
|
|
3011
|
+
this.idToRemoteMap[idWithAlias] = {
|
|
3012
|
+
name: remote.name,
|
|
3013
|
+
expose
|
|
3014
|
+
};
|
|
3015
|
+
return;
|
|
3016
|
+
}
|
|
3017
|
+
if (alias && id.startsWith(alias)) {
|
|
3018
|
+
const idWithName = id.replace(alias, name);
|
|
3019
|
+
this.idToRemoteMap[idWithName] = {
|
|
3020
|
+
name: remote.name,
|
|
3021
|
+
expose
|
|
3022
|
+
};
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
async loadRemote(id, options) {
|
|
3026
|
+
const { host } = this;
|
|
3027
|
+
const startMatchInfo = matchRemoteWithNameAndExpose(host.options.remotes, id);
|
|
3028
|
+
let completeRequestId = id;
|
|
3029
|
+
let completeExpose = startMatchInfo?.expose;
|
|
3030
|
+
let completeRemote = startMatchInfo ? getRemoteInfo(startMatchInfo.remote) : void 0;
|
|
3031
|
+
let afterLoadRemoteArgs;
|
|
3032
|
+
try {
|
|
3033
|
+
const { loadFactory = true } = options || { loadFactory: true };
|
|
3034
|
+
const { module, moduleOptions, remoteMatchInfo } = await this.getRemoteModuleAndOptions({ id });
|
|
3035
|
+
const { pkgNameOrAlias, remote, expose, id: idRes, remoteSnapshot } = remoteMatchInfo;
|
|
3036
|
+
completeRequestId = idRes;
|
|
3037
|
+
completeExpose = expose;
|
|
3038
|
+
completeRemote = getRemoteInfo(remote);
|
|
3039
|
+
const moduleOrFactory = await module.get(idRes, expose, options, remoteSnapshot);
|
|
3040
|
+
const moduleWrapper = await this.hooks.lifecycle.onLoad.emit({
|
|
3041
|
+
id: idRes,
|
|
3042
|
+
pkgNameOrAlias,
|
|
3043
|
+
expose,
|
|
3044
|
+
exposeModule: loadFactory ? moduleOrFactory : void 0,
|
|
3045
|
+
exposeModuleFactory: loadFactory ? void 0 : moduleOrFactory,
|
|
3046
|
+
remote,
|
|
3047
|
+
options: moduleOptions,
|
|
3048
|
+
moduleInstance: module,
|
|
3049
|
+
origin: host
|
|
3050
|
+
});
|
|
3051
|
+
this.setIdToRemoteMap(id, remoteMatchInfo);
|
|
3052
|
+
afterLoadRemoteArgs = {
|
|
3053
|
+
id: completeRequestId,
|
|
3054
|
+
expose: completeExpose,
|
|
3055
|
+
remote: completeRemote,
|
|
3056
|
+
options,
|
|
3057
|
+
origin: host
|
|
3058
|
+
};
|
|
3059
|
+
if (typeof moduleWrapper === "function") return moduleWrapper;
|
|
3060
|
+
return moduleOrFactory;
|
|
3061
|
+
} catch (error) {
|
|
3062
|
+
const { from = "runtime" } = options || { from: "runtime" };
|
|
3063
|
+
let failOver;
|
|
3064
|
+
try {
|
|
3065
|
+
failOver = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
3066
|
+
id,
|
|
3067
|
+
error,
|
|
3068
|
+
from,
|
|
3069
|
+
lifecycle: "onLoad",
|
|
3070
|
+
expose: completeExpose,
|
|
3071
|
+
remote: completeRemote,
|
|
3072
|
+
origin: host
|
|
3073
|
+
});
|
|
3074
|
+
} catch (hookError) {
|
|
3075
|
+
afterLoadRemoteArgs = {
|
|
3076
|
+
id: completeRequestId,
|
|
3077
|
+
expose: completeExpose,
|
|
3078
|
+
remote: completeRemote,
|
|
3079
|
+
options,
|
|
3080
|
+
error: hookError,
|
|
3081
|
+
origin: host
|
|
3082
|
+
};
|
|
3083
|
+
throw hookError;
|
|
3084
|
+
}
|
|
3085
|
+
if (!failOver) {
|
|
3086
|
+
afterLoadRemoteArgs = {
|
|
3087
|
+
id: completeRequestId,
|
|
3088
|
+
expose: completeExpose,
|
|
3089
|
+
remote: completeRemote,
|
|
3090
|
+
options,
|
|
3091
|
+
error,
|
|
3092
|
+
origin: host
|
|
3093
|
+
};
|
|
3094
|
+
throw error;
|
|
3095
|
+
}
|
|
3096
|
+
afterLoadRemoteArgs = {
|
|
3097
|
+
id: completeRequestId,
|
|
3098
|
+
expose: completeExpose,
|
|
3099
|
+
remote: completeRemote,
|
|
3100
|
+
options,
|
|
3101
|
+
error,
|
|
3102
|
+
origin: host,
|
|
3103
|
+
recovered: true
|
|
3104
|
+
};
|
|
3105
|
+
return failOver;
|
|
3106
|
+
} finally {
|
|
3107
|
+
if (afterLoadRemoteArgs) await this.hooks.lifecycle.afterLoadRemote.emit(afterLoadRemoteArgs);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
async preloadRemote(preloadOptions) {
|
|
3111
|
+
const { host } = this;
|
|
3112
|
+
const preloadResults = [];
|
|
3113
|
+
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
3114
|
+
preloadOps: preloadOptions,
|
|
3115
|
+
options: host.options,
|
|
3116
|
+
origin: host
|
|
3117
|
+
});
|
|
3118
|
+
const preloadOps = formatPreloadArgs(host.options.remotes, preloadOptions);
|
|
3119
|
+
const createPreloadAssetOps = (ops) => {
|
|
3120
|
+
const { preloadConfig, remote } = ops;
|
|
3121
|
+
const exposes = preloadConfig.exposes || [];
|
|
3122
|
+
if (!exposes.length) return [{
|
|
3123
|
+
ops,
|
|
3124
|
+
id: `${remote.name}/*`
|
|
3125
|
+
}];
|
|
3126
|
+
return exposes.map((expose) => ({
|
|
3127
|
+
ops: {
|
|
3128
|
+
...ops,
|
|
3129
|
+
preloadConfig: {
|
|
3130
|
+
...preloadConfig,
|
|
3131
|
+
exposes: [expose]
|
|
3132
|
+
}
|
|
3133
|
+
},
|
|
3134
|
+
id: composeRemoteRequestId(remote.name, expose)
|
|
3135
|
+
}));
|
|
3136
|
+
};
|
|
3137
|
+
let preloadError;
|
|
3138
|
+
await Promise.all(preloadOps.flatMap(createPreloadAssetOps).map(async (assetOps) => {
|
|
3139
|
+
const { ops, id: preloadId } = assetOps;
|
|
3140
|
+
const { remote, preloadConfig } = ops;
|
|
3141
|
+
const remoteInfo = getRemoteInfo(remote);
|
|
3142
|
+
try {
|
|
3143
|
+
const { globalSnapshot, remoteSnapshot } = await host.snapshotHandler.loadRemoteSnapshotInfo({
|
|
3144
|
+
moduleInfo: remote,
|
|
3145
|
+
id: preloadId,
|
|
3146
|
+
initiator: "preloadRemote"
|
|
3147
|
+
});
|
|
3148
|
+
const assets = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
3149
|
+
origin: host,
|
|
3150
|
+
preloadOptions: ops,
|
|
3151
|
+
remote,
|
|
3152
|
+
remoteInfo,
|
|
3153
|
+
globalSnapshot,
|
|
3154
|
+
remoteSnapshot
|
|
3155
|
+
});
|
|
3156
|
+
if (!assets) return;
|
|
3157
|
+
const results = await preloadAssets(remoteInfo, host, assets, true, {
|
|
3158
|
+
initiator: "preloadRemote",
|
|
3159
|
+
id: preloadId
|
|
3160
|
+
});
|
|
3161
|
+
preloadResults.push({
|
|
3162
|
+
remote,
|
|
3163
|
+
remoteInfo,
|
|
3164
|
+
preloadConfig,
|
|
3165
|
+
id: preloadId,
|
|
3166
|
+
results
|
|
3167
|
+
});
|
|
3168
|
+
} catch (error) {
|
|
3169
|
+
preloadResults.push({
|
|
3170
|
+
remote,
|
|
3171
|
+
remoteInfo,
|
|
3172
|
+
preloadConfig,
|
|
3173
|
+
id: preloadId,
|
|
3174
|
+
results: [{
|
|
3175
|
+
url: remoteInfo.entry,
|
|
3176
|
+
status: "error",
|
|
3177
|
+
resourceType: /\.json(?:$|[?#])/i.test(remoteInfo.entry) ? "manifest" : "remoteEntry",
|
|
3178
|
+
initiator: "preloadRemote",
|
|
3179
|
+
id: preloadId,
|
|
3180
|
+
error
|
|
3181
|
+
}]
|
|
3182
|
+
});
|
|
3183
|
+
}
|
|
3184
|
+
}));
|
|
3185
|
+
const failedResults = preloadResults.flatMap((preloadResult) => preloadResult.results.filter((result) => result.status === "error" || result.status === "timeout"));
|
|
3186
|
+
if (failedResults.length > 0) {
|
|
3187
|
+
preloadError = /* @__PURE__ */ new Error(`preloadRemote failed to load ${failedResults.length} resource(s).`);
|
|
3188
|
+
Object.assign(preloadError, {
|
|
3189
|
+
results: preloadResults,
|
|
3190
|
+
failedResults
|
|
3191
|
+
});
|
|
3192
|
+
}
|
|
3193
|
+
await this.hooks.lifecycle.afterPreloadRemote.emit({
|
|
3194
|
+
preloadOps: preloadOptions,
|
|
3195
|
+
options: host.options,
|
|
3196
|
+
origin: host,
|
|
3197
|
+
results: preloadResults,
|
|
3198
|
+
error: preloadError
|
|
3199
|
+
});
|
|
3200
|
+
if (preloadError) throw preloadError;
|
|
3201
|
+
}
|
|
3202
|
+
registerRemotes(remotes, options) {
|
|
3203
|
+
const { host } = this;
|
|
3204
|
+
remotes.forEach((remote) => {
|
|
3205
|
+
this.registerRemote(remote, host.options.remotes, { force: options?.force });
|
|
3206
|
+
});
|
|
3207
|
+
}
|
|
3208
|
+
async getRemoteModuleAndOptions(options) {
|
|
3209
|
+
const { host } = this;
|
|
3210
|
+
const { id } = options;
|
|
3211
|
+
let loadRemoteArgs;
|
|
3212
|
+
try {
|
|
3213
|
+
loadRemoteArgs = await this.hooks.lifecycle.beforeRequest.emit({
|
|
3214
|
+
id,
|
|
3215
|
+
options: host.options,
|
|
3216
|
+
origin: host
|
|
3217
|
+
});
|
|
3218
|
+
} catch (error) {
|
|
3219
|
+
loadRemoteArgs = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
3220
|
+
id,
|
|
3221
|
+
options: host.options,
|
|
3222
|
+
origin: host,
|
|
3223
|
+
from: "runtime",
|
|
3224
|
+
error,
|
|
3225
|
+
lifecycle: "beforeRequest"
|
|
3226
|
+
});
|
|
3227
|
+
if (!loadRemoteArgs) throw error;
|
|
3228
|
+
}
|
|
3229
|
+
const { id: idRes } = loadRemoteArgs;
|
|
3230
|
+
const remoteSplitInfo = matchRemoteWithNameAndExpose(host.options.remotes, idRes);
|
|
3231
|
+
if (!remoteSplitInfo) try {
|
|
3232
|
+
error(RUNTIME_004, runtimeDescMap, {
|
|
3233
|
+
hostName: host.options.name,
|
|
3234
|
+
requestId: idRes
|
|
3235
|
+
}, void 0, optionsToMFContext(host.options));
|
|
3236
|
+
} catch (matchError) {
|
|
3237
|
+
await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
3238
|
+
id: idRes,
|
|
3239
|
+
options: host.options,
|
|
3240
|
+
error: matchError,
|
|
3241
|
+
origin: host
|
|
3242
|
+
});
|
|
3243
|
+
throw matchError;
|
|
3244
|
+
}
|
|
3245
|
+
const { remote: rawRemote } = remoteSplitInfo;
|
|
3246
|
+
const remoteInfo = getRemoteInfo(rawRemote);
|
|
3247
|
+
await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
3248
|
+
id: idRes,
|
|
3249
|
+
...remoteSplitInfo,
|
|
3250
|
+
options: host.options,
|
|
3251
|
+
remoteInfo,
|
|
3252
|
+
origin: host
|
|
3253
|
+
});
|
|
3254
|
+
const matchInfo = await host.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
3255
|
+
id: idRes,
|
|
3256
|
+
...remoteSplitInfo,
|
|
3257
|
+
options: host.options,
|
|
3258
|
+
origin: host,
|
|
3259
|
+
remoteInfo
|
|
3260
|
+
});
|
|
3261
|
+
const { remote, expose } = matchInfo;
|
|
3262
|
+
assert(remote && expose, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${idRes}.`);
|
|
3263
|
+
let module = host.moduleCache.get(remote.name);
|
|
3264
|
+
const moduleOptions = {
|
|
3265
|
+
host,
|
|
3266
|
+
remoteInfo
|
|
3267
|
+
};
|
|
3268
|
+
if (!module) {
|
|
3269
|
+
module = new Module$1(moduleOptions);
|
|
3270
|
+
host.moduleCache.set(remote.name, module);
|
|
3271
|
+
}
|
|
3272
|
+
return {
|
|
3273
|
+
module,
|
|
3274
|
+
moduleOptions,
|
|
3275
|
+
remoteMatchInfo: matchInfo
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
registerRemote(remote, targetRemotes, options) {
|
|
3279
|
+
const { host } = this;
|
|
3280
|
+
const normalizeRemote = () => {
|
|
3281
|
+
if (remote.alias) {
|
|
3282
|
+
const findEqual = targetRemotes.find((item) => remote.alias && (item.name.startsWith(remote.alias) || item.alias?.startsWith(remote.alias)));
|
|
3283
|
+
assert(!findEqual, `The alias ${remote.alias} of remote ${remote.name} is not allowed to be the prefix of ${findEqual && findEqual.name} name or alias`);
|
|
3284
|
+
}
|
|
3285
|
+
if ("entry" in remote) {
|
|
3286
|
+
if (typeof window !== "undefined" && !remote.entry.startsWith("http")) remote.entry = new URL(remote.entry, window.location.origin).href;
|
|
3287
|
+
}
|
|
3288
|
+
if (!remote.shareScope) remote.shareScope = DEFAULT_SCOPE;
|
|
3289
|
+
if (!remote.type) remote.type = DEFAULT_REMOTE_TYPE;
|
|
3290
|
+
};
|
|
3291
|
+
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
3292
|
+
remote,
|
|
3293
|
+
origin: host
|
|
3294
|
+
});
|
|
3295
|
+
const registeredRemote = targetRemotes.find((item) => item.name === remote.name);
|
|
3296
|
+
if (!registeredRemote) {
|
|
3297
|
+
normalizeRemote();
|
|
3298
|
+
targetRemotes.push(remote);
|
|
3299
|
+
this.hooks.lifecycle.registerRemote.emit({
|
|
3300
|
+
remote,
|
|
3301
|
+
origin: host
|
|
3302
|
+
});
|
|
3303
|
+
} else {
|
|
3304
|
+
const messages = [`The remote "${remote.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
|
|
3305
|
+
if (options?.force) {
|
|
3306
|
+
this.removeRemote(registeredRemote);
|
|
3307
|
+
normalizeRemote();
|
|
3308
|
+
targetRemotes.push(remote);
|
|
3309
|
+
this.hooks.lifecycle.registerRemote.emit({
|
|
3310
|
+
remote,
|
|
3311
|
+
origin: host
|
|
3312
|
+
});
|
|
3313
|
+
warn(messages.join(" "));
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
removeRemote(remote) {
|
|
3318
|
+
try {
|
|
3319
|
+
const { host } = this;
|
|
3320
|
+
const { name } = remote;
|
|
3321
|
+
const remoteIndex = host.options.remotes.findIndex((item) => item.name === name);
|
|
3322
|
+
if (remoteIndex !== -1) host.options.remotes.splice(remoteIndex, 1);
|
|
3323
|
+
const globalSnapshotKey = getInfoWithoutType(CurrentGlobal.__FEDERATION__.moduleInfo, getFMId(remote)).key;
|
|
3324
|
+
delete CurrentGlobal.__FEDERATION__.moduleInfo[globalSnapshotKey];
|
|
3325
|
+
if ("entry" in remote) {
|
|
3326
|
+
host.snapshotHandler.manifestCache.delete(remote.entry);
|
|
3327
|
+
delete Global.__FEDERATION__.__MANIFEST_LOADING__[remote.entry];
|
|
3328
|
+
}
|
|
3329
|
+
const { hostGlobalSnapshot } = getGlobalRemoteInfo(remote, host);
|
|
3330
|
+
if (hostGlobalSnapshot) {
|
|
3331
|
+
const remoteKey = hostGlobalSnapshot && "remotesInfo" in hostGlobalSnapshot && hostGlobalSnapshot.remotesInfo && getInfoWithoutType(hostGlobalSnapshot.remotesInfo, remote.name).key;
|
|
3332
|
+
if (remoteKey) delete hostGlobalSnapshot.remotesInfo[remoteKey];
|
|
3333
|
+
}
|
|
3334
|
+
const loadedModule = host.moduleCache.get(remote.name);
|
|
3335
|
+
if (loadedModule) {
|
|
3336
|
+
const remoteInfo = loadedModule.remoteInfo;
|
|
3337
|
+
const key = remoteInfo.entryGlobalName;
|
|
3338
|
+
if (CurrentGlobal[key]) if (Object.getOwnPropertyDescriptor(CurrentGlobal, key)?.configurable) delete CurrentGlobal[key];
|
|
3339
|
+
else CurrentGlobal[key] = void 0;
|
|
3340
|
+
const remoteEntryUniqueKey = getRemoteEntryUniqueKey(loadedModule.remoteInfo);
|
|
3341
|
+
if (globalLoading[remoteEntryUniqueKey]) delete globalLoading[remoteEntryUniqueKey];
|
|
3342
|
+
let remoteInsId = remoteInfo.buildVersion ? composeKeyWithSeparator(remoteInfo.name, remoteInfo.buildVersion) : remoteInfo.name;
|
|
3343
|
+
const remoteInsIndex = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((ins) => {
|
|
3344
|
+
if (remoteInfo.buildVersion) return ins.options.id === remoteInsId;
|
|
3345
|
+
else return ins.name === remoteInsId;
|
|
3346
|
+
});
|
|
3347
|
+
if (remoteInsIndex !== -1) {
|
|
3348
|
+
const remoteIns = CurrentGlobal.__FEDERATION__.__INSTANCES__[remoteInsIndex];
|
|
3349
|
+
remoteInsId = remoteIns.options.id || remoteInsId;
|
|
3350
|
+
const globalShareScopeMap = getGlobalShareScope();
|
|
3351
|
+
let isAllSharedNotUsed = true;
|
|
3352
|
+
const needDeleteKeys = [];
|
|
3353
|
+
Object.keys(globalShareScopeMap).forEach((instId) => {
|
|
3354
|
+
const shareScopeMap = globalShareScopeMap[instId];
|
|
3355
|
+
shareScopeMap && Object.keys(shareScopeMap).forEach((shareScope) => {
|
|
3356
|
+
const shareScopeVal = shareScopeMap[shareScope];
|
|
3357
|
+
shareScopeVal && Object.keys(shareScopeVal).forEach((shareName) => {
|
|
3358
|
+
const sharedPkgs = shareScopeVal[shareName];
|
|
3359
|
+
sharedPkgs && Object.keys(sharedPkgs).forEach((shareVersion) => {
|
|
3360
|
+
const shared = sharedPkgs[shareVersion];
|
|
3361
|
+
if (shared && typeof shared === "object" && shared.from === remoteInfo.name) if (shared.loaded || shared.loading) {
|
|
3362
|
+
shared.useIn = shared.useIn.filter((usedHostName) => usedHostName !== remoteInfo.name);
|
|
3363
|
+
if (shared.useIn.length) isAllSharedNotUsed = false;
|
|
3364
|
+
else needDeleteKeys.push([
|
|
3365
|
+
instId,
|
|
3366
|
+
shareScope,
|
|
3367
|
+
shareName,
|
|
3368
|
+
shareVersion
|
|
3369
|
+
]);
|
|
3370
|
+
} else needDeleteKeys.push([
|
|
3371
|
+
instId,
|
|
3372
|
+
shareScope,
|
|
3373
|
+
shareName,
|
|
3374
|
+
shareVersion
|
|
3375
|
+
]);
|
|
3376
|
+
});
|
|
3377
|
+
});
|
|
3378
|
+
});
|
|
3379
|
+
});
|
|
3380
|
+
if (isAllSharedNotUsed) {
|
|
3381
|
+
remoteIns.shareScopeMap = {};
|
|
3382
|
+
delete globalShareScopeMap[remoteInsId];
|
|
3383
|
+
}
|
|
3384
|
+
needDeleteKeys.forEach(([insId, shareScope, shareName, shareVersion]) => {
|
|
3385
|
+
delete globalShareScopeMap[insId]?.[shareScope]?.[shareName]?.[shareVersion];
|
|
3386
|
+
});
|
|
3387
|
+
CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(remoteInsIndex, 1);
|
|
3388
|
+
}
|
|
3389
|
+
host.moduleCache.delete(remote.name);
|
|
3390
|
+
}
|
|
3391
|
+
} catch (err) {
|
|
3392
|
+
logger.error(`removeRemote failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
};
|
|
3396
|
+
//#endregion
|
|
3397
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime-core@2.7.0/node_modules/@module-federation/runtime-core/dist/core.js
|
|
3398
|
+
var USE_SNAPSHOT = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN === "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;
|
|
3399
|
+
var ModuleFederation = class {
|
|
3400
|
+
constructor(userOptions) {
|
|
3401
|
+
this.hooks = new PluginSystem({
|
|
3402
|
+
beforeInit: new SyncWaterfallHook("beforeInit"),
|
|
3403
|
+
init: new SyncHook(),
|
|
3404
|
+
beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
|
|
3405
|
+
initContainer: new AsyncWaterfallHook("initContainer")
|
|
3406
|
+
});
|
|
3407
|
+
this.version = "2.7.0";
|
|
3408
|
+
this.moduleCache = /* @__PURE__ */ new Map();
|
|
3409
|
+
this.loaderHook = new PluginSystem({
|
|
3410
|
+
getModuleInfo: new SyncHook(),
|
|
3411
|
+
createScript: new SyncHook(),
|
|
3412
|
+
createLink: new SyncHook(),
|
|
3413
|
+
fetch: new AsyncHook(),
|
|
3414
|
+
loadEntryError: new AsyncHook(),
|
|
3415
|
+
afterLoadEntry: new AsyncHook("afterLoadEntry"),
|
|
3416
|
+
beforeInitRemote: new AsyncHook("beforeInitRemote"),
|
|
3417
|
+
afterInitRemote: new AsyncHook("afterInitRemote"),
|
|
3418
|
+
beforeGetExpose: new AsyncHook("beforeGetExpose"),
|
|
3419
|
+
afterGetExpose: new AsyncHook("afterGetExpose"),
|
|
3420
|
+
beforeExecuteFactory: new AsyncHook("beforeExecuteFactory"),
|
|
3421
|
+
afterExecuteFactory: new AsyncHook("afterExecuteFactory"),
|
|
3422
|
+
getModuleFactory: new AsyncHook()
|
|
3423
|
+
});
|
|
3424
|
+
this.bridgeHook = new PluginSystem({
|
|
3425
|
+
beforeBridgeRender: new SyncHook(),
|
|
3426
|
+
afterBridgeRender: new SyncHook(),
|
|
3427
|
+
beforeBridgeDestroy: new SyncHook(),
|
|
3428
|
+
afterBridgeDestroy: new SyncHook()
|
|
3429
|
+
});
|
|
3430
|
+
const plugins = USE_SNAPSHOT ? [snapshotPlugin(), generatePreloadAssetsPlugin()] : [];
|
|
3431
|
+
const defaultOptions = {
|
|
3432
|
+
id: getBuilderId$1(),
|
|
3433
|
+
name: userOptions.name,
|
|
3434
|
+
plugins,
|
|
3435
|
+
remotes: [],
|
|
3436
|
+
shared: {},
|
|
3437
|
+
inBrowser: true
|
|
3438
|
+
};
|
|
3439
|
+
this.name = userOptions.name;
|
|
3440
|
+
this.options = defaultOptions;
|
|
3441
|
+
this.snapshotHandler = new SnapshotHandler(this);
|
|
3442
|
+
this.sharedHandler = new SharedHandler(this);
|
|
3443
|
+
this.remoteHandler = new RemoteHandler(this);
|
|
3444
|
+
this.shareScopeMap = this.sharedHandler.shareScopeMap;
|
|
3445
|
+
this.registerPlugins([...defaultOptions.plugins, ...userOptions.plugins || []]);
|
|
3446
|
+
this.options = this.formatOptions(defaultOptions, userOptions);
|
|
3447
|
+
}
|
|
3448
|
+
initOptions(userOptions) {
|
|
3449
|
+
if (userOptions.name && userOptions.name !== this.options.name) error(getShortErrorMsg(RUNTIME_010, runtimeDescMap));
|
|
3450
|
+
this.registerPlugins(userOptions.plugins);
|
|
3451
|
+
const options = this.formatOptions(this.options, userOptions);
|
|
3452
|
+
this.options = options;
|
|
3453
|
+
return options;
|
|
3454
|
+
}
|
|
3455
|
+
async loadShare(pkgName, extraOptions) {
|
|
3456
|
+
return this.sharedHandler.loadShare(pkgName, extraOptions);
|
|
3457
|
+
}
|
|
3458
|
+
loadShareSync(pkgName, extraOptions) {
|
|
3459
|
+
return this.sharedHandler.loadShareSync(pkgName, extraOptions);
|
|
3460
|
+
}
|
|
3461
|
+
initializeSharing(shareScopeName = DEFAULT_SCOPE, extraOptions) {
|
|
3462
|
+
return this.sharedHandler.initializeSharing(shareScopeName, extraOptions);
|
|
3463
|
+
}
|
|
3464
|
+
initRawContainer(name, url, container) {
|
|
3465
|
+
const remoteInfo = getRemoteInfo({
|
|
3466
|
+
name,
|
|
3467
|
+
entry: url
|
|
3468
|
+
});
|
|
3469
|
+
const module = new Module$1({
|
|
3470
|
+
host: this,
|
|
3471
|
+
remoteInfo
|
|
3472
|
+
});
|
|
3473
|
+
module.remoteEntryExports = container;
|
|
3474
|
+
this.moduleCache.set(name, module);
|
|
3475
|
+
return module;
|
|
3476
|
+
}
|
|
3477
|
+
async loadRemote(id, options) {
|
|
3478
|
+
return this.remoteHandler.loadRemote(id, options);
|
|
3479
|
+
}
|
|
3480
|
+
async preloadRemote(preloadOptions) {
|
|
3481
|
+
return this.remoteHandler.preloadRemote(preloadOptions);
|
|
3482
|
+
}
|
|
3483
|
+
initShareScopeMap(scopeName, shareScope, extraOptions = {}) {
|
|
3484
|
+
this.sharedHandler.initShareScopeMap(scopeName, shareScope, extraOptions);
|
|
3485
|
+
}
|
|
3486
|
+
formatOptions(globalOptions, userOptions) {
|
|
3487
|
+
const { allShareInfos: shared } = formatShareConfigs(globalOptions, userOptions);
|
|
3488
|
+
const { userOptions: userOptionsRes, options: globalOptionsRes } = this.hooks.lifecycle.beforeInit.emit({
|
|
3489
|
+
origin: this,
|
|
3490
|
+
userOptions,
|
|
3491
|
+
options: globalOptions,
|
|
3492
|
+
shareInfo: shared
|
|
3493
|
+
});
|
|
3494
|
+
const remotes = this.remoteHandler.formatAndRegisterRemote(globalOptionsRes, userOptionsRes);
|
|
3495
|
+
const { allShareInfos } = this.sharedHandler.registerShared(globalOptionsRes, userOptionsRes);
|
|
3496
|
+
const plugins = [...globalOptionsRes.plugins];
|
|
3497
|
+
if (userOptionsRes.plugins) userOptionsRes.plugins.forEach((plugin) => {
|
|
3498
|
+
if (!plugins.includes(plugin)) plugins.push(plugin);
|
|
3499
|
+
});
|
|
3500
|
+
const optionsRes = {
|
|
3501
|
+
...globalOptions,
|
|
3502
|
+
...userOptions,
|
|
3503
|
+
plugins,
|
|
3504
|
+
remotes,
|
|
3505
|
+
shared: allShareInfos,
|
|
3506
|
+
id: userOptionsRes.id || globalOptions.id
|
|
3507
|
+
};
|
|
3508
|
+
this.hooks.lifecycle.init.emit({
|
|
3509
|
+
origin: this,
|
|
3510
|
+
options: optionsRes
|
|
3511
|
+
});
|
|
3512
|
+
return optionsRes;
|
|
3513
|
+
}
|
|
3514
|
+
registerPlugins(plugins) {
|
|
3515
|
+
const pluginRes = registerPlugins(plugins, this);
|
|
3516
|
+
this.options.plugins = this.options.plugins.reduce((res, plugin) => {
|
|
3517
|
+
if (!plugin) return res;
|
|
3518
|
+
if (res && !res.find((item) => item.name === plugin.name)) res.push(plugin);
|
|
3519
|
+
return res;
|
|
3520
|
+
}, pluginRes || []);
|
|
3521
|
+
}
|
|
3522
|
+
registerRemotes(remotes, options) {
|
|
3523
|
+
return this.remoteHandler.registerRemotes(remotes, options);
|
|
3524
|
+
}
|
|
3525
|
+
registerShared(shared) {
|
|
3526
|
+
this.sharedHandler.registerShared(this.options, {
|
|
3527
|
+
...this.options,
|
|
3528
|
+
shared
|
|
3529
|
+
});
|
|
3530
|
+
}
|
|
3531
|
+
};
|
|
3532
|
+
//#endregion
|
|
3533
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime@2.7.0/node_modules/@module-federation/runtime/dist/utils.js
|
|
3534
|
+
function getBuilderId() {
|
|
3535
|
+
return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
3536
|
+
}
|
|
3537
|
+
function getGlobalFederationInstance(name, version) {
|
|
3538
|
+
const buildId = getBuilderId();
|
|
3539
|
+
return CurrentGlobal.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
|
|
3540
|
+
if (buildId && GMInstance.options.id === buildId) return true;
|
|
3541
|
+
if (GMInstance.options.name === name && !GMInstance.options.version && !version) return true;
|
|
3542
|
+
if (GMInstance.options.name === name && version && GMInstance.options.version === version) return true;
|
|
3543
|
+
return false;
|
|
3544
|
+
});
|
|
3545
|
+
}
|
|
3546
|
+
//#endregion
|
|
3547
|
+
//#region ../../node_modules/.pnpm/@module-federation+runtime@2.7.0/node_modules/@module-federation/runtime/dist/index.js
|
|
3548
|
+
function createInstance(options) {
|
|
3549
|
+
const instance = new ((getGlobalFederationConstructor()) || ModuleFederation)({
|
|
3550
|
+
id: `${options.name}@${options.version || Date.now()}`,
|
|
3551
|
+
...options
|
|
3552
|
+
});
|
|
3553
|
+
setGlobalFederationInstance(instance);
|
|
3554
|
+
return instance;
|
|
3555
|
+
}
|
|
3556
|
+
var FederationInstance = null;
|
|
3557
|
+
function init(options) {
|
|
3558
|
+
const instance = getGlobalFederationInstance(options.name, options.version);
|
|
3559
|
+
const normalizedOptions = {
|
|
3560
|
+
...options,
|
|
3561
|
+
id: options.id || ""
|
|
3562
|
+
};
|
|
3563
|
+
if (!instance) {
|
|
3564
|
+
FederationInstance = createInstance(normalizedOptions);
|
|
3565
|
+
return FederationInstance;
|
|
3566
|
+
} else {
|
|
3567
|
+
instance.initOptions(normalizedOptions);
|
|
3568
|
+
if (!FederationInstance) FederationInstance = instance;
|
|
3569
|
+
return instance;
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
setGlobalFederationConstructor(ModuleFederation);
|
|
3573
|
+
//#endregion
|
|
3574
|
+
export { init as t };
|
|
3575
|
+
|
|
3576
|
+
//# sourceMappingURL=dist-SBfmsOB2.js.map
|