@cdmbase/wiki-browser 12.0.18-alpha.5
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/LICENSE +21 -0
- package/lib/components/Logo.d.ts +4 -0
- package/lib/components/Logo.d.ts.map +1 -0
- package/lib/components/Logo.js +16 -0
- package/lib/components/Logo.js.map +1 -0
- package/lib/components/help/SidebarSearch.d.ts +8 -0
- package/lib/components/help/SidebarSearch.d.ts.map +1 -0
- package/lib/components/help/SidebarSearch.js +111 -0
- package/lib/components/help/SidebarSearch.js.map +1 -0
- package/lib/components/help/index.d.ts +2 -0
- package/lib/components/help/index.d.ts.map +1 -0
- package/lib/components/landing/FeatureCard.d.ts +13 -0
- package/lib/components/landing/FeatureCard.d.ts.map +1 -0
- package/lib/components/landing/FeatureCard.js +85 -0
- package/lib/components/landing/FeatureCard.js.map +1 -0
- package/lib/components/landing/QuickLinkCard.d.ts +8 -0
- package/lib/components/landing/QuickLinkCard.d.ts.map +1 -0
- package/lib/components/landing/QuickLinkCard.js +26 -0
- package/lib/components/landing/QuickLinkCard.js.map +1 -0
- package/lib/components/landing/SearchInput.d.ts +10 -0
- package/lib/components/landing/SearchInput.d.ts.map +1 -0
- package/lib/components/landing/SearchInput.js +223 -0
- package/lib/components/landing/SearchInput.js.map +1 -0
- package/lib/components/landing/index.d.ts +4 -0
- package/lib/components/landing/index.d.ts.map +1 -0
- package/lib/components/welcome.d.ts +3 -0
- package/lib/components/welcome.d.ts.map +1 -0
- package/lib/compute.d.ts +4 -0
- package/lib/compute.d.ts.map +1 -0
- package/lib/compute.js +96 -0
- package/lib/compute.js.map +1 -0
- package/lib/config/env-config.d.ts +4 -0
- package/lib/config/env-config.d.ts.map +1 -0
- package/lib/config/env-config.js +7 -0
- package/lib/config/env-config.js.map +1 -0
- package/lib/docs.config.d.ts +48 -0
- package/lib/docs.config.d.ts.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/loaders/search.d.ts +1 -0
- package/lib/loaders/search.d.ts.map +1 -0
- package/lib/module.d.ts +4 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +11 -0
- package/lib/module.js.map +1 -0
- package/lib/pages/ArticlePage/ArticlePage.d.ts +4 -0
- package/lib/pages/ArticlePage/ArticlePage.d.ts.map +1 -0
- package/lib/pages/ArticlePage/ArticlePage.js +222 -0
- package/lib/pages/ArticlePage/ArticlePage.js.map +1 -0
- package/lib/pages/ArticlePage/index.d.ts +3 -0
- package/lib/pages/ArticlePage/index.d.ts.map +1 -0
- package/lib/pages/ArticlePage/index.js +3 -0
- package/lib/pages/ArticlePage/index.js.map +1 -0
- package/lib/pages/CategoryCollection/CategoryCollection.d.ts +4 -0
- package/lib/pages/CategoryCollection/CategoryCollection.d.ts.map +1 -0
- package/lib/pages/CategoryCollection/CategoryCollection.js +103 -0
- package/lib/pages/CategoryCollection/CategoryCollection.js.map +1 -0
- package/lib/pages/CategoryCollection/index.d.ts +3 -0
- package/lib/pages/CategoryCollection/index.d.ts.map +1 -0
- package/lib/pages/CategoryCollection/index.js +3 -0
- package/lib/pages/CategoryCollection/index.js.map +1 -0
- package/lib/pages/Help/HelpIndex.d.ts +4 -0
- package/lib/pages/Help/HelpIndex.d.ts.map +1 -0
- package/lib/pages/Help/HelpIndex.js +44 -0
- package/lib/pages/Help/HelpIndex.js.map +1 -0
- package/lib/pages/Help/index.d.ts +4 -0
- package/lib/pages/Help/index.d.ts.map +1 -0
- package/lib/pages/Help/index.js +226 -0
- package/lib/pages/Help/index.js.map +1 -0
- package/lib/pages/Landing/index.d.ts +3 -0
- package/lib/pages/Landing/index.d.ts.map +1 -0
- package/lib/pages/Landing/index.js +281 -0
- package/lib/pages/Landing/index.js.map +1 -0
- package/lib/routes.json +2533 -0
- package/lib/seo.d.ts +22 -0
- package/lib/seo.d.ts.map +1 -0
- package/lib/slot-fill/FooterFill.d.ts +3 -0
- package/lib/slot-fill/FooterFill.d.ts.map +1 -0
- package/lib/slot-fill/FooterFill.js +18 -0
- package/lib/slot-fill/FooterFill.js.map +1 -0
- package/lib/slot-fill/LogoFill.d.ts +5 -0
- package/lib/slot-fill/LogoFill.d.ts.map +1 -0
- package/lib/slot-fill/LogoFill.js +74 -0
- package/lib/slot-fill/LogoFill.js.map +1 -0
- package/lib/slot-fill/consts.d.ts +5 -0
- package/lib/slot-fill/consts.d.ts.map +1 -0
- package/lib/slot-fill/consts.js +1 -0
- package/lib/slot-fill/consts.js.map +1 -0
- package/lib/slot-fill/index.d.ts +4 -0
- package/lib/slot-fill/index.d.ts.map +1 -0
- package/lib/templates/assets/images/add-link-frontend.png +0 -0
- package/lib/templates/assets/images/add-package-backend.png +0 -0
- package/lib/templates/assets/images/add-to-backend-module.png +0 -0
- package/lib/templates/assets/images/add-upload-client-frontend.png +0 -0
- package/lib/templates/assets/images/additional-parameters.png +0 -0
- package/lib/templates/assets/images/aeh-implementation.png +0 -0
- package/lib/templates/assets/images/aeh-usage.png +0 -0
- package/lib/templates/assets/images/apollo-client/recommendation_cache_mgmt.png +0 -0
- package/lib/templates/assets/images/app-deploy-new-version/jenkins1.PNG +0 -0
- package/lib/templates/assets/images/app-deploy-new-version/jenkins2.PNG +0 -0
- package/lib/templates/assets/images/auth-wrapper-code.png +0 -0
- package/lib/templates/assets/images/cdebase.png +0 -0
- package/lib/templates/assets/images/cdm-locales-directory.png +0 -0
- package/lib/templates/assets/images/client-settings.png +0 -0
- package/lib/templates/assets/images/codegen_file_update.png +0 -0
- package/lib/templates/assets/images/configuration.png +0 -0
- package/lib/templates/assets/images/copy-plugin.png +0 -0
- package/lib/templates/assets/images/docusaurus.png +0 -0
- package/lib/templates/assets/images/error-link.png +0 -0
- package/lib/templates/assets/images/error-sample.png +0 -0
- package/lib/templates/assets/images/extension copy.png +0 -0
- package/lib/templates/assets/images/extension.png +0 -0
- package/lib/templates/assets/images/graphql/graphql-folder-backend.png +0 -0
- package/lib/templates/assets/images/graphql/graphql-folder-with-gql.png +0 -0
- package/lib/templates/assets/images/i18n-config.png +0 -0
- package/lib/templates/assets/images/image.png +0 -0
- package/lib/templates/assets/images/logo.svg +10 -0
- package/lib/templates/assets/images/logo1.svg +1 -0
- package/lib/templates/assets/images/modify-upload-false-server.png +0 -0
- package/lib/templates/assets/images/navigation-auth-enabled.png +0 -0
- package/lib/templates/assets/images/org-dashboard-navigation.png +0 -0
- package/lib/templates/assets/images/org-navigation.png +0 -0
- package/lib/templates/assets/images/preferences_graphql_type.png +0 -0
- package/lib/templates/assets/images/provider.png +0 -0
- package/lib/templates/assets/images/route-config.png +0 -0
- package/lib/templates/assets/images/service-accounts.png +0 -0
- package/lib/templates/assets/images/source-code/source-code-environments.png +0 -0
- package/lib/templates/assets/images/source-code/source-code-organization.png +0 -0
- package/lib/templates/assets/images/spin-clone-develop-deployment/jenkins-changes.png +0 -0
- package/lib/templates/assets/images/spin-clone-develop-deployment/lerna-changes.png +0 -0
- package/lib/templates/assets/images/spin-clone-develop-deployment/root-package-json-changes.png +0 -0
- package/lib/templates/assets/images/spin-clone-develop-deployment/values-dev-changes.png +0 -0
- package/lib/templates/assets/images/sso-mappers.png +0 -0
- package/lib/templates/assets/images/sso-picture-mapper.png +0 -0
- package/lib/templates/assets/images/sso-settings.png +0 -0
- package/lib/templates/assets/images/timesheet_apollo_cache.png +0 -0
- package/lib/templates/assets/images/timesheet_query.png +0 -0
- package/lib/templates/assets/images/tutorial/docsVersionDropdown.png +0 -0
- package/lib/templates/assets/images/tutorial/localeDropdown.png +0 -0
- package/lib/templates/assets/images/unauthenticated.png +0 -0
- package/lib/templates/assets/images/undraw_docusaurus_mountain.svg +170 -0
- package/lib/templates/assets/images/undraw_docusaurus_react.svg +169 -0
- package/lib/templates/assets/images/undraw_docusaurus_tree.svg +1 -0
- package/lib/templates/assets/images/vite-plugin-config.png +0 -0
- package/lib/templates/content/docs/Generators/Project/generate-fullproject.md +12 -0
- package/lib/templates/content/docs/LLM/Logger.llm.md +194 -0
- package/lib/templates/content/docs/LLM/backend-proxies-services-llm.md +2687 -0
- package/lib/templates/content/docs/LLM/backend-service-llm.md +3384 -0
- package/lib/templates/content/docs/LLM/db_migration_llm.md +954 -0
- package/lib/templates/content/docs/LLM/frontend/REMIX-15.3-upgrade-llm.md +1245 -0
- package/lib/templates/content/docs/LLM/inngest/INNGEST_FUNCTION_DEVELOPMENT_GUIDE_LLM.md +1241 -0
- package/lib/templates/content/docs/LLM/inngest/INNGEST_NAMESPACE_LLM.md +384 -0
- package/lib/templates/content/docs/LLM/llm_workflow_namespace.md +384 -0
- package/lib/templates/content/docs/LLM/organization-components-form-llm.md +1395 -0
- package/lib/templates/content/docs/LLM/page-component-llm.md +173 -0
- package/lib/templates/content/docs/LLM/preferences-settings-llm.md +2781 -0
- package/lib/templates/content/docs/LLM/tailwind-css-llm.md +502 -0
- package/lib/templates/content/docs/UI/SchemaBasedUI.md +334 -0
- package/lib/templates/content/docs/UI/SlotFillComponent.md +334 -0
- package/lib/templates/content/docs/adminide-modules/account/auth0-login.md +31 -0
- package/lib/templates/content/docs/adminide-modules/account/index.md +14 -0
- package/lib/templates/content/docs/adminide-modules/account/keycloak-remix-setup.md +86 -0
- package/lib/templates/content/docs/adminide-modules/account/remix-auth-setup.md +79 -0
- package/lib/templates/content/docs/adminide-modules/account/various-auth-qatest.md +157 -0
- package/lib/templates/content/docs/adminide-modules/api-builders/graphql.md +906 -0
- package/lib/templates/content/docs/adminide-modules/billing/payments/index.md +14 -0
- package/lib/templates/content/docs/adminide-modules/billing/payments/stripe/index.md +14 -0
- package/lib/templates/content/docs/adminide-modules/billing/payments/stripe/settingup-stripe-locally.md +25 -0
- package/lib/templates/content/docs/adminide-modules/billing/tier-config.md +293 -0
- package/lib/templates/content/docs/adminide-modules/connectors/Connector.md +207 -0
- package/lib/templates/content/docs/adminide-modules/file-upload/index.md +16 -0
- package/lib/templates/content/docs/adminide-modules/file-upload/setup.md +435 -0
- package/lib/templates/content/docs/adminide-modules/file-upload/upload-file-using-signed-url.md +161 -0
- package/lib/templates/content/docs/adminide-modules/preferences/AddAdditionalPermissions.md +151 -0
- package/lib/templates/content/docs/adminide-modules/preferences/Configuration.md +241 -0
- package/lib/templates/content/docs/adminide-modules/preferences/Policy-Configuration.md +61 -0
- package/lib/templates/content/docs/adminide-modules/preferences/UI-components/ResourceSettingsLoader.md +319 -0
- package/lib/templates/content/docs/adminide-modules/preferences/contribute_scope_target.md +280 -0
- package/lib/templates/content/docs/adminide-modules/preferences/generate-urii.md +94 -0
- package/lib/templates/content/docs/adminide-modules/preferences/index.md +28 -0
- package/lib/templates/content/docs/adminide-modules/preferences/machine-configuration.md +157 -0
- package/lib/templates/content/docs/adminide-modules/preferences/pageSettings/generateCdecodeUri.md +1289 -0
- package/lib/templates/content/docs/adminide-modules/preferences/pageSettings/migratingFromUseSettings.md +215 -0
- package/lib/templates/content/docs/adminide-modules/preferences/permissions/Roles-Permissions.md +72 -0
- package/lib/templates/content/docs/adminide-modules/preferences/permissions/settingUserPermissions.md +139 -0
- package/lib/templates/content/docs/adminide-modules/preferences/preference-dependency.md +138 -0
- package/lib/templates/content/docs/adminide-modules/preferences/route-based-configuration.md +41 -0
- package/lib/templates/content/docs/adminide-modules/preferences/schema-configuration.md +71 -0
- package/lib/templates/content/docs/adminide-modules/preferences/supported.md +24 -0
- package/lib/templates/content/docs/adminide-modules/preferences/useSettingsLoader.md +248 -0
- package/lib/templates/content/docs/adminide-modules/project-tools/auth-providers.md +1317 -0
- package/lib/templates/content/docs/adminide-modules/project-tools/keycloak-guide.md +543 -0
- package/lib/templates/content/docs/adminide-modules/project-tools/tenant-management/tenant-based-authentication.md +846 -0
- package/lib/templates/content/docs/adminide-modules/project-tools/tenant-management/tenant-management.md +708 -0
- package/lib/templates/content/docs/adminide-modules/project-tools/tenant-management/tenants.md +1117 -0
- package/lib/templates/content/docs/chrome-extension/index.md +14 -0
- package/lib/templates/content/docs/chrome-extension/setup.md +30 -0
- package/lib/templates/content/docs/contributing/adding-package.md +23 -0
- package/lib/templates/content/docs/contributing/adding_new_modules.md +99 -0
- package/lib/templates/content/docs/contributing/architecture-updates.md +19 -0
- package/lib/templates/content/docs/contributing/avoid-using-promises-ui.md +116 -0
- package/lib/templates/content/docs/contributing/coding-guidelines.md +111 -0
- package/lib/templates/content/docs/contributing/do-and-dont.md +42 -0
- package/lib/templates/content/docs/contributing/faq.md +22 -0
- package/lib/templates/content/docs/contributing/folder-setup/browser.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/config.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/containers-server.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/core.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/graphql.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/index.md +30 -0
- package/lib/templates/content/docs/contributing/folder-setup/module.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/server.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/services.md +12 -0
- package/lib/templates/content/docs/contributing/folder-setup/store.md +12 -0
- package/lib/templates/content/docs/contributing/frontend-coding.md +30 -0
- package/lib/templates/content/docs/contributing/git-subtree-sharing.md +73 -0
- package/lib/templates/content/docs/contributing/graphql-subscriptions.md +69 -0
- package/lib/templates/content/docs/contributing/how-to-contribute.md +30 -0
- package/lib/templates/content/docs/contributing/how_to_check_pure_esm.md +29 -0
- package/lib/templates/content/docs/contributing/index.md +60 -0
- package/lib/templates/content/docs/contributing/installation-issues.md +23 -0
- package/lib/templates/content/docs/contributing/keyboard-shortcut.md +131 -0
- package/lib/templates/content/docs/contributing/language/locale-support.md +12 -0
- package/lib/templates/content/docs/contributing/lerna-build-tools.md +516 -0
- package/lib/templates/content/docs/contributing/lerna-yarn-workspaces.md +95 -0
- package/lib/templates/content/docs/contributing/lint-and-formatter.md +20 -0
- package/lib/templates/content/docs/contributing/mobile-setup.md +16 -0
- package/lib/templates/content/docs/contributing/project-setup.md +233 -0
- package/lib/templates/content/docs/contributing/react/index.md +14 -0
- package/lib/templates/content/docs/contributing/react/lazy-component.md +70 -0
- package/lib/templates/content/docs/contributing/run-various-options.md +124 -0
- package/lib/templates/content/docs/contributing/schema-first-graphql-types.md +37 -0
- package/lib/templates/content/docs/contributing/source-code-organization.md +57 -0
- package/lib/templates/content/docs/contributing/staging-docker.md +88 -0
- package/lib/templates/content/docs/contributing/third-party/apollo-client-v3-tutorials.md +28 -0
- package/lib/templates/content/docs/contributing/third-party/index.md +18 -0
- package/lib/templates/content/docs/contributing/typescript-contribution.md +16 -0
- package/lib/templates/content/docs/devops/app-deploy-new-version.md +30 -0
- package/lib/templates/content/docs/devops/index.md +14 -0
- package/lib/templates/content/docs/devops/mobile-jenkins-build.md +40 -0
- package/lib/templates/content/docs/devops/versioning-the-project.md +128 -0
- package/lib/templates/content/docs/error-handler/application-error-handler.md +40 -0
- package/lib/templates/content/docs/error-handler/error-handling.md +26 -0
- package/lib/templates/content/docs/error-handler/index.md +16 -0
- package/lib/templates/content/docs/error-handler/logging-errors.md +14 -0
- package/lib/templates/content/docs/feature-api/copy-operation.md +427 -0
- package/lib/templates/content/docs/feature-api/feature-browser/assets.md +46 -0
- package/lib/templates/content/docs/feature-api/feature-browser/auth-permissions.md +12 -0
- package/lib/templates/content/docs/feature-api/feature-browser/feature.md +131 -0
- package/lib/templates/content/docs/feature-api/feature-browser/index.md +22 -0
- package/lib/templates/content/docs/feature-api/feature-browser/routes-menu.md +110 -0
- package/lib/templates/content/docs/feature-api/feature-browser/routing-convention.md +124 -0
- package/lib/templates/content/docs/feature-api/feature-browser/routing.md +338 -0
- package/lib/templates/content/docs/feature-api/feature-mobile/auth-permissions.md +20 -0
- package/lib/templates/content/docs/feature-api/feature-mobile/feature.md +130 -0
- package/lib/templates/content/docs/feature-api/feature-mobile/index.md +18 -0
- package/lib/templates/content/docs/feature-api/feature-mobile/navigation.md +187 -0
- package/lib/templates/content/docs/feature-api/feature-server/Scheduling.md +44 -0
- package/lib/templates/content/docs/feature-api/feature-server/dataloader.md +320 -0
- package/lib/templates/content/docs/feature-api/feature-server/dependency-injection.md +81 -0
- package/lib/templates/content/docs/feature-api/feature-server/feature.md +65 -0
- package/lib/templates/content/docs/feature-api/feature-server/generic-dataloader.md +135 -0
- package/lib/templates/content/docs/feature-api/feature-server/index.md +40 -0
- package/lib/templates/content/docs/feature-api/feature-server/migration.md +127 -0
- package/lib/templates/content/docs/feature-api/feature-server/mongo-model.md +72 -0
- package/lib/templates/content/docs/feature-api/feature-server/permissions.md +12 -0
- package/lib/templates/content/docs/feature-api/feature-server/policies.md +57 -0
- package/lib/templates/content/docs/feature-api/feature-server/preferences.md +57 -0
- package/lib/templates/content/docs/feature-api/feature-server/repositories.md +114 -0
- package/lib/templates/content/docs/feature-api/feature-server/resolvers.md +126 -0
- package/lib/templates/content/docs/feature-api/feature-server/rules.md +132 -0
- package/lib/templates/content/docs/feature-api/feature-server/schema.md +12 -0
- package/lib/templates/content/docs/feature-api/feature-server/services.md +102 -0
- package/lib/templates/content/docs/feature-api/feature-server/setup-resource-crud.md +359 -0
- package/lib/templates/content/docs/feature-api/index.md +18 -0
- package/lib/templates/content/docs/graphql/apolloClient-mutation.md +94 -0
- package/lib/templates/content/docs/graphql/index.md +14 -0
- package/lib/templates/content/docs/graphql/scalars.md +15 -0
- package/lib/templates/content/docs/help/index.md +14 -0
- package/lib/templates/content/docs/help/intro.md +16 -0
- package/lib/templates/content/docs/intl/ant-design-menu-translation.md +74 -0
- package/lib/templates/content/docs/intl/intl-namespace.md +129 -0
- package/lib/templates/content/docs/intl/vite-plugin-intl.md +87 -0
- package/lib/templates/content/docs/intl/webpack-plugin-intl.md +12 -0
- package/lib/templates/content/docs/intro.md +18 -0
- package/lib/templates/content/docs/knowledge/basic-fullstack.md +238 -0
- package/lib/templates/content/docs/mailing/index.md +14 -0
- package/lib/templates/content/docs/mailing/mailing-template.md +148 -0
- package/lib/templates/content/docs/mobile/App-navigation-generator.md +410 -0
- package/lib/templates/content/docs/mobile/MobileTestCases.md +264 -0
- package/lib/templates/content/docs/mobile/eas-profile-build.md +107 -0
- package/lib/templates/content/docs/mobile/expo-push-notification-setup.md +216 -0
- package/lib/templates/content/docs/mobile/index.md +14 -0
- package/lib/templates/content/docs/mobile/routes.md +83 -0
- package/lib/templates/content/docs/organization/adding-account-context.md +116 -0
- package/lib/templates/content/docs/organization/adding-org-mobile-navigation.md +22 -0
- package/lib/templates/content/docs/organization/adding-org-web-navigation.md +12 -0
- package/lib/templates/content/docs/organization/index.md +20 -0
- package/lib/templates/content/docs/organization/initialization.md +20 -0
- package/lib/templates/content/docs/organization/organization-resource-vs-resource.md +112 -0
- package/lib/templates/content/docs/remix/configuration/component-structure-best-practices.md +152 -0
- package/lib/templates/content/docs/remix/configuration/configurations.md +218 -0
- package/lib/templates/content/docs/remix/configuration/css-import-and-stylesheets.md +142 -0
- package/lib/templates/content/docs/remix/configuration/dont-subcomponent-network.md +166 -0
- package/lib/templates/content/docs/remix/configuration/generated-data-loaders.md +122 -0
- package/lib/templates/content/docs/remix/configuration/generated-resource-loaders.md +257 -0
- package/lib/templates/content/docs/remix/configuration/query-params-generator.md +216 -0
- package/lib/templates/content/docs/remix/configuration/routes-extra-icons.md +103 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-advanced.md +86 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-auth.md +113 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-best-practices.md +55 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-fields.md +79 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-graphql.md +79 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-index.md +112 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-loaders.md +165 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-middleware.md +196 -0
- package/lib/templates/content/docs/remix/configuration/routes-json-overview.md +53 -0
- package/lib/templates/content/docs/remix/data-loaders.md +43 -0
- package/lib/templates/content/docs/remix/devtools/remix-devtools.md +58 -0
- package/lib/templates/content/docs/remix/examples/changes-using-servercode.md +79 -0
- package/lib/templates/content/docs/remix/extra-icons.md +62 -0
- package/lib/templates/content/docs/remix/extra-links.md +65 -0
- package/lib/templates/content/docs/remix/generated-data-loaders.md +114 -0
- package/lib/templates/content/docs/remix/queryParamsGenerator.md +89 -0
- package/lib/templates/content/docs/remix/resources.md +16 -0
- package/lib/templates/content/docs/remix/styles.md +132 -0
- package/lib/templates/content/docs/remix/wiki.md +12 -0
- package/lib/templates/content/docs/security/auth-wrapper/auth-wrapper.md +24 -0
- package/lib/templates/content/docs/security/index.md +18 -0
- package/lib/templates/content/docs/security/secure-button-mobilenative.md +88 -0
- package/lib/templates/content/docs/security/secure-button-web.md +89 -0
- package/lib/templates/content/docs/server-side/account-customization.md +82 -0
- package/lib/templates/content/docs/server-side/apollo/caching.md +164 -0
- package/lib/templates/content/docs/server-side/backend-architecture/FINAL-DECISION.md +209 -0
- package/lib/templates/content/docs/server-side/backend-architecture/TRUE-FINAL-ARCHITECTURE.md +603 -0
- package/lib/templates/content/docs/server-side/backend-architecture/index1.md +0 -0
- package/lib/templates/content/docs/server-side/backend-coding.md +839 -0
- package/lib/templates/content/docs/server-side/e2b/manageing-template.md +197 -0
- package/lib/templates/content/docs/server-side/index.md +14 -0
- package/lib/templates/content/docs/server-side/inngest-functions-module.md +309 -0
- package/lib/templates/content/docs/server-side/listen-stripe-events.md +43 -0
- package/lib/templates/content/docs/server-side/slug-service.md +323 -0
- package/lib/templates/content/docs/tests/index.md +18 -0
- package/lib/templates/content/docs/tests/jest-test-debug-vscode.md +40 -0
- package/lib/templates/content/docs/tests/known-errors.md +116 -0
- package/lib/templates/content/docs/tests/service-test-template.md +118 -0
- package/lib/templates/content/docs/tests/test-setup.md +93 -0
- package/lib/templates/content/docs/xstate.md +23 -0
- package/lib/types.d.ts +37 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/utils/docsNavigation.d.ts +9 -0
- package/lib/utils/docsNavigation.d.ts.map +1 -0
- package/lib/utils/docsNavigation.js +37 -0
- package/lib/utils/docsNavigation.js.map +1 -0
- package/lib/utils/helpCenterUtils.d.ts +26 -0
- package/lib/utils/helpCenterUtils.d.ts.map +1 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +3 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/markdownLoader.d.ts +36 -0
- package/lib/utils/markdownLoader.d.ts.map +1 -0
- package/lib/utils/markdownLoader.js +2242 -0
- package/lib/utils/markdownLoader.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
meta:
|
|
3
|
+
title: Organization Resources vs normal resources
|
|
4
|
+
description: Organization Resources vs normal resources
|
|
5
|
+
date: '2023-06-02T00:00:00'
|
|
6
|
+
updated: '2024-06-02T00:00:00'
|
|
7
|
+
excerpt: Organization Resources vs normal resources...
|
|
8
|
+
headers:
|
|
9
|
+
Cache-Control: no-cache
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Organization Resources vs normal resources
|
|
13
|
+
|
|
14
|
+
To differentiate between organizational resources and normal resources based on the criteria that organizational resources are those that involve grouping people (e.g., teams, projects, channels), while normal resources do not inherently involve grouping or managing people (e.g., timesheet entries, documents), we can define clear guidelines and scenarios.
|
|
15
|
+
|
|
16
|
+
### Criteria for Differentiating Resources
|
|
17
|
+
|
|
18
|
+
1. **Organizational Resources:**
|
|
19
|
+
- Involve grouping or managing people.
|
|
20
|
+
- Examples include teams, projects, channels, departments, and committees.
|
|
21
|
+
- These resources typically have members and are used to structure and manage the organization.
|
|
22
|
+
- Direct Member Management: Projects allow for direct addition of members. This is useful when the resource needs to directly manage the contributions and roles of individual members.
|
|
23
|
+
- Flexibility in Roles: You can assign specific roles and permissions directly to members within the project.
|
|
24
|
+
|
|
25
|
+
2. **Normal Resources:**
|
|
26
|
+
- Do not involve grouping or managing people.
|
|
27
|
+
- Examples include timesheet entries, documents, files, individual tasks, and logs.
|
|
28
|
+
- These resources are typically individual records or items not used to organize people within the organization.
|
|
29
|
+
- Team-Based Management: Properties manage access through teams. This ensures that permissions are handled at a higher level of abstraction, simplifying the management of access for resources that don't require granular control over individual members.
|
|
30
|
+
- Scalability and Simplification: By using teams, you reduce the complexity of managing permissions directly on a large number of individual resources. Instead, you manage permissions at the team level and assign teams to resources.
|
|
31
|
+
|
|
32
|
+
### Scenarios Covered
|
|
33
|
+
|
|
34
|
+
1. **Teams:**
|
|
35
|
+
- **Organizational Resource:** A team is a group of people working together on specific tasks or projects. It has members who are part of the organization.
|
|
36
|
+
- **Example:** Development team, Marketing team.
|
|
37
|
+
|
|
38
|
+
2. **Projects:**
|
|
39
|
+
- **Organizational Resource:** A project involves a group of people working towards a common goal or deliverable. It has members assigned to it.
|
|
40
|
+
- **Example:** Project Alpha, Website Redesign Project.
|
|
41
|
+
|
|
42
|
+
3. **Channels:**
|
|
43
|
+
- **Organizational Resource:** Channels are used for communication within a group of people, such as in a messaging or collaboration platform.
|
|
44
|
+
- **Example:** Slack channel for the Sales team, Microsoft Teams channel for the HR department.
|
|
45
|
+
|
|
46
|
+
4. **Timesheet Entries:**
|
|
47
|
+
- **Normal Resource:** Timesheet entries are individual records of time worked by employees. They are not used to organize or manage people directly.
|
|
48
|
+
- **Example:** Time record for an employee for a specific date and time.
|
|
49
|
+
|
|
50
|
+
5. **Documents and Files:**
|
|
51
|
+
- **Normal Resource:** Documents and files are individual items that do not involve grouping people.
|
|
52
|
+
- **Example:** Company policy document, financial report file.
|
|
53
|
+
|
|
54
|
+
6. **Individual Tasks:**
|
|
55
|
+
- **Normal Resource:** Tasks assigned to individuals that do not involve managing a group of people.
|
|
56
|
+
- **Example:** Task to update a document, task to attend a meeting.
|
|
57
|
+
|
|
58
|
+
### Implementation
|
|
59
|
+
|
|
60
|
+
Based on the differentiation criteria, you can structure your methods and data storage accordingly.
|
|
61
|
+
|
|
62
|
+
#### Data Storage
|
|
63
|
+
|
|
64
|
+
##### Organization Collection
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"_id": "org_123",
|
|
69
|
+
"name": "Organization Name",
|
|
70
|
+
"resources": {
|
|
71
|
+
"projects": [
|
|
72
|
+
{ "id": "project_1", "name": "Project 1" },
|
|
73
|
+
{ "id": "project_2", "name": "Project 2" }
|
|
74
|
+
],
|
|
75
|
+
"teams": [
|
|
76
|
+
{ "id": "team_1", "name": "Team 1" },
|
|
77
|
+
{ "id": "team_2", "name": "Team 2" }
|
|
78
|
+
],
|
|
79
|
+
"channels": [
|
|
80
|
+
{ "id": "channel_1", "name": "Channel 1" },
|
|
81
|
+
{ "id": "channel_2", "name": "Channel 2" }
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
##### Timesheet Collection
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"_id": "timesheet_1",
|
|
92
|
+
"orgId": "org_123",
|
|
93
|
+
"userId": "user_456",
|
|
94
|
+
"timeEntries": [
|
|
95
|
+
{ "startTime": "2023-07-01T08:00:00Z", "endTime": "2023-07-01T16:00:00Z", "task": "Development" },
|
|
96
|
+
{ "startTime": "2023-07-02T08:00:00Z", "endTime": "2023-07-02T16:00:00Z", "task": "Meeting" }
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Explanation of Differentiation
|
|
102
|
+
|
|
103
|
+
- **Organizational Resources:** These include entities that group people together, such as teams, projects, and channels. These resources are managed within the `resources` field of the organization document.
|
|
104
|
+
- **Normal Resources:** These are individual records that do not inherently group people. Examples include timesheet entries, documents, and individual tasks. These resources are stored in their own collections and linked to the organization via a foreign key (e.g., `orgId`).
|
|
105
|
+
|
|
106
|
+
### Benefits
|
|
107
|
+
|
|
108
|
+
- **Scalability:** By separating organizational resources from normal resources, the system can handle large numbers of individual records without impacting the performance of organization-level operations.
|
|
109
|
+
- **Clarity:** The clear separation of concerns ensures that resources are managed appropriately based on their type, improving maintainability and readability.
|
|
110
|
+
- **Efficiency:** Operations related to adding, removing, and querying resources are more efficient because each resource type is stored and managed in the most appropriate way.
|
|
111
|
+
|
|
112
|
+
This approach provides a structured and scalable way to differentiate and manage organizational resources and normal resources within your application.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
meta:
|
|
3
|
+
title: Component Structure Best Practices
|
|
4
|
+
description: Component Structure Best Practices
|
|
5
|
+
date: '2023-06-02T00:00:00'
|
|
6
|
+
updated: '2024-06-02T00:00:00'
|
|
7
|
+
excerpt: Component Structure Best Practices...
|
|
8
|
+
headers:
|
|
9
|
+
Cache-Control: no-cache
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Component Structure Best Practices
|
|
13
|
+
|
|
14
|
+
This guide outlines best practices for structuring components in your application, focusing on the proper placement of network requests and separation of concerns.
|
|
15
|
+
|
|
16
|
+
## Don't: Place Network Requests in Subcomponents
|
|
17
|
+
|
|
18
|
+
Avoid placing GraphQL queries or other network requests directly in subcomponents. This practice can lead to performance issues and makes it harder to manage data flow.
|
|
19
|
+
|
|
20
|
+
### Example of What Not to Do
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
// SubComponent.js
|
|
24
|
+
import { gql, useQuery } from '@apollo/client';
|
|
25
|
+
|
|
26
|
+
const GET_USERS = gql`
|
|
27
|
+
query GetUsers {
|
|
28
|
+
users {
|
|
29
|
+
id
|
|
30
|
+
name
|
|
31
|
+
email
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
function SubComponent() {
|
|
37
|
+
const { data, loading, error } = useQuery(GET_USERS);
|
|
38
|
+
|
|
39
|
+
if (loading) return <p>Loading...</p>;
|
|
40
|
+
if (error) return <p>Error: {error.message}</p>;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div>
|
|
44
|
+
<h1>Users</h1>
|
|
45
|
+
<ul>
|
|
46
|
+
{data.users.map((user) => (
|
|
47
|
+
<li key={user.id}>
|
|
48
|
+
{user.name} ({user.email})
|
|
49
|
+
</li>
|
|
50
|
+
))}
|
|
51
|
+
</ul>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default SubComponent;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Do: Centralize Data Fetching in Main Components
|
|
60
|
+
|
|
61
|
+
Instead, centralize data fetching in the main routed components and pass data down to subcomponents as props.
|
|
62
|
+
|
|
63
|
+
### Step-by-Step Refactor
|
|
64
|
+
|
|
65
|
+
1. **Define the GraphQL Query in the Main Page**
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
// mainPage.js
|
|
69
|
+
import { gql } from '@apollo/client';
|
|
70
|
+
|
|
71
|
+
const GET_USERS = gql`
|
|
72
|
+
query GetUsers {
|
|
73
|
+
users {
|
|
74
|
+
id
|
|
75
|
+
name
|
|
76
|
+
email
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
2. **Set Up the Loader Function**
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
// mainPage.js
|
|
86
|
+
import { json, LoaderFunction } from '@remix-run/node';
|
|
87
|
+
import { useLoaderData } from '@remix-run/react';
|
|
88
|
+
import { initializeApollo } from '~/utils/apolloClient';
|
|
89
|
+
import SubComponent from './SubComponent';
|
|
90
|
+
|
|
91
|
+
export let loader: LoaderFunction = async () => {
|
|
92
|
+
const client = initializeApollo();
|
|
93
|
+
try {
|
|
94
|
+
const { data } = await client.query({ query: GET_USERS });
|
|
95
|
+
return json(data);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.error('Error fetching users:', error);
|
|
98
|
+
throw new Response('Error fetching users', { status: 500 });
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Create the SubComponent as a Pure Component**
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
// SubComponent.js
|
|
107
|
+
function SubComponent({ users }) {
|
|
108
|
+
return (
|
|
109
|
+
<div>
|
|
110
|
+
<h1>Users</h1>
|
|
111
|
+
<ul>
|
|
112
|
+
{users.map((user) => (
|
|
113
|
+
<li key={user.id}>
|
|
114
|
+
{user.name} ({user.email})
|
|
115
|
+
</li>
|
|
116
|
+
))}
|
|
117
|
+
</ul>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export default SubComponent;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
4. **Use the SubComponent in the Main Page**
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
// mainPage.js
|
|
129
|
+
import { useLoaderData } from '@remix-run/react';
|
|
130
|
+
import SubComponent from './SubComponent';
|
|
131
|
+
|
|
132
|
+
export default function MainPage() {
|
|
133
|
+
const { users } = useLoaderData();
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div>
|
|
137
|
+
<SubComponent users={users} />
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Benefits of This Approach
|
|
144
|
+
|
|
145
|
+
1. **Improved Performance**: Data fetching is handled during server-side rendering.
|
|
146
|
+
2. **Better Separation of Concerns**: Subcomponents are pure and focused on presentation.
|
|
147
|
+
3. **Easier Testing**: Pure components are simpler to unit test.
|
|
148
|
+
4. **Enhanced Reusability**: Subcomponents can be used in different contexts with different data.
|
|
149
|
+
|
|
150
|
+
By following these best practices, you can create more maintainable, performant, and scalable components in your application.
|
|
151
|
+
|
|
152
|
+
[Back to Index](routes-json-index.md) | [Previous: CSS Import and Stylesheets](css-import-and-stylesheets.md) | [Next: Configuration Management](configurations.md)
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
meta:
|
|
3
|
+
title: Configurations
|
|
4
|
+
description: Configurations
|
|
5
|
+
date: '2023-06-02T00:00:00'
|
|
6
|
+
updated: '2024-06-02T00:00:00'
|
|
7
|
+
excerpt: Configurations...
|
|
8
|
+
headers:
|
|
9
|
+
Cache-Control: no-cache
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
### Retrieving Configurations and Permissions in the Loader Data
|
|
13
|
+
|
|
14
|
+
To retrieve configurations and permissions in the loader data, you need to:
|
|
15
|
+
|
|
16
|
+
1. **Define Configurations in Routes**: Specify the configurations you need in the `configurations` field of the route definition. You can either fetch all configurations (`['*']`) or list specific configuration keys.
|
|
17
|
+
2. **Use `resourceParams`**: This allows dynamic resolution of parameters for specific resources using placeholders like `$params` to construct the query or path used to fetch the configuration and permissions.
|
|
18
|
+
3. **Fetch Data in Loader**: The loader fetches the configuration and permissions based on the defined `resourceParams` and configurations.
|
|
19
|
+
|
|
20
|
+
Here’s how you can set up **routes**, **resourceParams**, and **configuration** to get configurations in the loader data.
|
|
21
|
+
|
|
22
|
+
### Example 1: Generic Configuration (`configurations: ['*']`)
|
|
23
|
+
|
|
24
|
+
This will retrieve all available configurations generically for the route.
|
|
25
|
+
|
|
26
|
+
#### Route Definition:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
export const project_route = [
|
|
30
|
+
{
|
|
31
|
+
name: 'menu.projects',
|
|
32
|
+
path: PROJECTS_ROUTES.projectView,
|
|
33
|
+
key: 'project-view',
|
|
34
|
+
priority: 7,
|
|
35
|
+
position: IMenuPosition.Middle,
|
|
36
|
+
icon: {
|
|
37
|
+
name: 'AiOutlineProject',
|
|
38
|
+
style: { fontSize: 'large' },
|
|
39
|
+
},
|
|
40
|
+
component: () => import('./components/index'),
|
|
41
|
+
authority: [IPreDefineAccountPermissions.viewSelfProjects, IPreDefineAccountPermissions.viewOthersProjects],
|
|
42
|
+
extraPermissions: [
|
|
43
|
+
IPreDefineAccountPermissions.manageSelfProjects,
|
|
44
|
+
IPreDefineAccountPermissions.editSelfProjects,
|
|
45
|
+
IPreDefineAccountPermissions.createSelfProjects,
|
|
46
|
+
],
|
|
47
|
+
extraParams: ({ params }) => ({
|
|
48
|
+
resourceParams: {
|
|
49
|
+
path: IConfigCollectionName.Organizations, // Default to Organizations, could change to Projects based on logic
|
|
50
|
+
fragment: IConfigFragmentName.Settings,
|
|
51
|
+
query: {
|
|
52
|
+
name: '$params.orgName',
|
|
53
|
+
},
|
|
54
|
+
configKey: '', // Optional. Add the initial hierarchy of the settings, or leave empty.
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
configurations: ['*'], // Fetch all configurations
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### Component Usage:
|
|
63
|
+
|
|
64
|
+
Within the component, the configurations and permissions retrieved via the loader can be accessed using `useLoaderData`:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
export default () => {
|
|
68
|
+
const loaderData = useLoaderData<{
|
|
69
|
+
permissions: IPermissions;
|
|
70
|
+
configurations: IPreferences;
|
|
71
|
+
dataContext: any;
|
|
72
|
+
}>();
|
|
73
|
+
|
|
74
|
+
const { permissions, configurations, dataContext } = loaderData;
|
|
75
|
+
const { preferencesInput } = dataContext; // Use this to get the settings URI for updates
|
|
76
|
+
|
|
77
|
+
const [updateConfigurationMutation] = useUpdateConfigurationMutation();
|
|
78
|
+
|
|
79
|
+
const overrides: IConfigurationOverridesInput = {
|
|
80
|
+
resource: preferencesInput.editableSettingsInput, // Override based on resource
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Function to update specific configuration
|
|
84
|
+
const updateConfiguration = ({
|
|
85
|
+
key,
|
|
86
|
+
value,
|
|
87
|
+
}: {
|
|
88
|
+
key: IConfigurationsFlattenedKeys;
|
|
89
|
+
value: string | number | boolean;
|
|
90
|
+
}) => {
|
|
91
|
+
return updateConfigurationMutation({
|
|
92
|
+
variables: {
|
|
93
|
+
key,
|
|
94
|
+
input: preferencesInput,
|
|
95
|
+
value,
|
|
96
|
+
target: ConfigurationTarget.ORGANIZATION_RESOURCE, // Use based on URI or resource context
|
|
97
|
+
overrides,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Further component logic...
|
|
103
|
+
};
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### When to Use `resourceParams`:
|
|
107
|
+
|
|
108
|
+
For organization-related pages, you generally **do not need to specify `resourceParams`** explicitly because the system will automatically resolve the organization's settings using the `:orgName` from the route. For example, the following default behavior will occur:
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
resourceParams = { path: 'organizations', query: { name: params.orgName }, fragment: 'settings' };
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
However, for **resource-specific pages** such as `o/:orgName/projects/:projectId`, you must provide `resourceParams` to get the specific configurations and permissions related to that resource (in this case, `projectId`):
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
resourceParams = {
|
|
118
|
+
path: IConfigCollectionName.Projects,
|
|
119
|
+
query: {
|
|
120
|
+
name: '$params.projectId', // Retrieves configurations for the specific project
|
|
121
|
+
},
|
|
122
|
+
fragment: IConfigFragmentName.Settings,
|
|
123
|
+
};
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Example 2: Fetching Specific Configuration Keys
|
|
127
|
+
|
|
128
|
+
When you want to optimize the loader by fetching only specific configurations, you can define the required configuration keys in the route.
|
|
129
|
+
|
|
130
|
+
#### Route Definition:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
export const project_route = [
|
|
134
|
+
{
|
|
135
|
+
name: 'menu.projects',
|
|
136
|
+
path: PROJECTS_ROUTES.projectView,
|
|
137
|
+
key: 'project-view',
|
|
138
|
+
priority: 7,
|
|
139
|
+
position: IMenuPosition.Middle,
|
|
140
|
+
icon: {
|
|
141
|
+
name: 'AiOutlineProject',
|
|
142
|
+
style: { fontSize: 'large' },
|
|
143
|
+
},
|
|
144
|
+
component: () => import('./components/index'),
|
|
145
|
+
authority: [IPreDefineAccountPermissions.viewSelfProjects, IPreDefineAccountPermissions.viewOthersProjects],
|
|
146
|
+
extraPermissions: [
|
|
147
|
+
IPreDefineAccountPermissions.manageSelfProjects,
|
|
148
|
+
IPreDefineAccountPermissions.editSelfProjects,
|
|
149
|
+
IPreDefineAccountPermissions.createSelfProjects,
|
|
150
|
+
],
|
|
151
|
+
extraParams: ({ params }) => ({
|
|
152
|
+
resourceParams: {
|
|
153
|
+
path: IConfigCollectionName.Projects,
|
|
154
|
+
fragment: IConfigFragmentName.Settings,
|
|
155
|
+
query: {
|
|
156
|
+
name: '$params.projectId', // Use the project ID for specific project configuration
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
}),
|
|
160
|
+
configurations: ['organization.projectDefaults', 'organization.projectSettings'], // Fetch specific configurations
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This fetches only the `projectDefaults` and `projectSettings` configurations for the project.
|
|
166
|
+
|
|
167
|
+
### Example 3: No Configurations Specified
|
|
168
|
+
|
|
169
|
+
If `configurations` is not specified in the route definition, no configuration data will be included in the loader. This is useful for pages where configurations are not required.
|
|
170
|
+
|
|
171
|
+
#### Route Definition (No Configurations):
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
export const project_route = [
|
|
175
|
+
{
|
|
176
|
+
name: 'menu.projects',
|
|
177
|
+
path: PROJECTS_ROUTES.projectView,
|
|
178
|
+
key: 'project-view',
|
|
179
|
+
priority: 7,
|
|
180
|
+
position: IMenuPosition.Middle,
|
|
181
|
+
icon: {
|
|
182
|
+
name: 'AiOutlineProject',
|
|
183
|
+
style: { fontSize: 'large' },
|
|
184
|
+
},
|
|
185
|
+
component: () => import('./components/index'),
|
|
186
|
+
authority: [IPreDefineAccountPermissions.viewSelfProjects, IPreDefineAccountPermissions.viewOthersProjects],
|
|
187
|
+
extraPermissions: [
|
|
188
|
+
IPreDefineAccountPermissions.manageSelfProjects,
|
|
189
|
+
IPreDefineAccountPermissions.editSelfProjects,
|
|
190
|
+
IPreDefineAccountPermissions.createSelfProjects,
|
|
191
|
+
],
|
|
192
|
+
extraParams: ({ params }) => ({
|
|
193
|
+
resourceParams: {
|
|
194
|
+
path: IConfigCollectionName.Projects,
|
|
195
|
+
fragment: IConfigFragmentName.Settings,
|
|
196
|
+
query: {
|
|
197
|
+
name: '$params.projectId',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
}),
|
|
201
|
+
// No configurations specified, so the loader won't fetch any
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
In this case, no configurations will be fetched or included in the loader data.
|
|
207
|
+
|
|
208
|
+
### Conclusion:
|
|
209
|
+
|
|
210
|
+
- **Generic Configurations (`['*']`)**: Fetch all available configurations if you need them.
|
|
211
|
+
- **Specific Configurations**: Use specific configuration keys to optimize performance.
|
|
212
|
+
- **No Configurations**: If no configurations are needed, simply omit the `configurations` field from the route definition.
|
|
213
|
+
|
|
214
|
+
In addition to using the above approach for configuring routes, try avoiding the use of `useSettings` or its wrapped loaders and hooks. Instead, use the route-based configuration outlined earlier to manage the retrieval of configurations and permissions. This method provides a more flexible and efficient way to handle dynamic data in the loader, ensuring that you have full control over the configurations fetched for each route or resource.
|
|
215
|
+
|
|
216
|
+
This route-based approach allows for a more streamlined and maintainable way of handling settings, reducing dependencies on custom hooks or loaders like useSettings, and centralizing your configuration management within your routes.
|
|
217
|
+
|
|
218
|
+
[Back to Index](routes-json-index.md) | [Previous: Component Structure](component-structure-best-practices.md) | [Next: Icon System](routes-extra-icons.md)
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
meta:
|
|
3
|
+
title: CSS Import and Stylesheet Links
|
|
4
|
+
description: CSS Import and Stylesheet Links
|
|
5
|
+
date: '2023-06-02T00:00:00'
|
|
6
|
+
updated: '2024-06-02T00:00:00'
|
|
7
|
+
excerpt: CSS Import and Stylesheet Links...
|
|
8
|
+
headers:
|
|
9
|
+
Cache-Control: no-cache
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# CSS Import and Stylesheet Links
|
|
13
|
+
|
|
14
|
+
This guide demonstrates how to import CSS files from a package and return them as stylesheet links in a TypeScript project.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
To use CSS imports, follow these steps:
|
|
19
|
+
|
|
20
|
+
1. Install the necessary packages:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install <your-css-package>
|
|
24
|
+
# or
|
|
25
|
+
yarn add <your-css-package>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Importing CSS Files
|
|
29
|
+
|
|
30
|
+
### Method 1: Direct Import
|
|
31
|
+
|
|
32
|
+
Append `?url` at the end of the CSS import:
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import '<your-css-package>/any.css';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Method 2: Named Import with URL
|
|
39
|
+
|
|
40
|
+
Use a named import with `?url`:
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
import mainStyles from '<your-css-package>/main.css?url';
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Note: Add `@ts-ignore` above the import to avoid TypeScript errors:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
//@ts-ignore
|
|
50
|
+
import mainStyles from '<your-css-package>/main.css?url';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Defining Stylesheet Links
|
|
54
|
+
|
|
55
|
+
Create a function to return stylesheet links:
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
//@ts-ignore
|
|
59
|
+
import mainStyles from '<your-css-package>/main.css?url';
|
|
60
|
+
//@ts-ignore
|
|
61
|
+
import customStyles from '../styles/landing.css?url';
|
|
62
|
+
|
|
63
|
+
export const links = () => {
|
|
64
|
+
return [
|
|
65
|
+
{
|
|
66
|
+
rel: 'stylesheet',
|
|
67
|
+
href: customStyles as unknown as string,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
rel: 'stylesheet',
|
|
71
|
+
href: mainStyles as unknown as string,
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
};
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Usage in Components
|
|
78
|
+
|
|
79
|
+
### Route Component (app.tsx)
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { LinksFunction } from 'remix';
|
|
83
|
+
import buttonStyles from '../styles/button.css?url';
|
|
84
|
+
|
|
85
|
+
export const links: LinksFunction = () => {
|
|
86
|
+
return [{ rel: 'stylesheet', href: buttonStyles }];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
import Button from '../components/Button';
|
|
90
|
+
|
|
91
|
+
const ComponentWithLoader = (props) => {
|
|
92
|
+
return (
|
|
93
|
+
<React.Suspense fallback={<Spinner />}>
|
|
94
|
+
<Await resolve={OwnerPropertiesLoader} errorElement={<Alert>Error loading TypeLists!</Alert>}>
|
|
95
|
+
<div>
|
|
96
|
+
<h1>Welcome to my Remix app!</h1>
|
|
97
|
+
<Button />
|
|
98
|
+
</div>
|
|
99
|
+
</Await>
|
|
100
|
+
</React.Suspense>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Subcomponent (Button.tsx)
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
export default function Button() {
|
|
109
|
+
return <button className="custom-button">Click me</button>;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Troubleshooting
|
|
114
|
+
|
|
115
|
+
### Error: No route matches URL "/styles/landing.css"
|
|
116
|
+
|
|
117
|
+
Ensure the `styles` folder is copied to the `lib` folder. Check `rollup.config.base.mjs` for the correct copy plugin configuration:
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
const additionalPlugins = [copy({ patterns: ['**/cdm-locales/**/*', '**/styles/**/*'], rootDir: './src' })];
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Build error: Could not resolve "../styles/landing.css?url"
|
|
124
|
+
|
|
125
|
+
Add the `ignoreCssUrlPlugin` to `rollup.config.base.mjs` after the `typescript` plugin:
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
// Add this import at the top of the file
|
|
129
|
+
import { ignoreCssUrlPlugin } from '@common-stack/rollup-vite-utils/lib/rollup/pluginIgnore.js';
|
|
130
|
+
|
|
131
|
+
// In the plugins array
|
|
132
|
+
plugins: [
|
|
133
|
+
// ... other plugins
|
|
134
|
+
typescript(),
|
|
135
|
+
ignoreCssUrlPlugin(),
|
|
136
|
+
// ... other plugins
|
|
137
|
+
];
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
By following these guidelines, you can effectively manage CSS imports and stylesheets in your TypeScript project.
|
|
141
|
+
|
|
142
|
+
[Back to Index](routes-json-index.md) | [Previous: Resource Loaders](generated-resource-loaders.md) | [Next: Component Structure](component-structure-best-practices.md)
|