@vadimcomanescu/nadicode-design-system 2.0.6 → 2.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/.agents/skills/seed/SKILL.md +17 -8
- package/.agents/skills/seed/contract.md +5 -4
- package/.agents/skills/seed/intent-map.md +3 -3
- package/.agents/skills/seed/recipes/agents-chat.md +44 -20
- package/.agents/skills/seed/recipes/marketing-shell.md +10 -19
- package/.agents/skills/seed/recipes/navigation-shell.md +5 -5
- package/.agents/skills/seed/recipes/service-detail.md +1 -1
- package/.agents/skills/seed/references/blocks.md +30 -26
- package/.agents/skills/seed/references/brand-override.md +3 -1
- package/.agents/skills/seed/references/components.md +22 -2
- package/.agents/skills/seed/references/dashboard-patterns.md +12 -12
- package/.agents/skills/seed/references/nextjs.md +20 -80
- package/.agents/skills/seed/references/tokens.md +57 -248
- package/README.md +43 -215
- package/contracts/block-props-schemas.json +2186 -0
- package/contracts/component-props-schemas.json +8322 -0
- package/contracts/consumer-contract.json +178 -0
- package/contracts/consumer-intent-map.json +707 -0
- package/contracts/message-catalog-contract.json +820 -0
- package/contracts/page-kit-props-schemas.json +1894 -0
- package/contracts/public-surface-registry.json +6162 -0
- package/contracts/public-surface-registry.schema.json +227 -0
- package/contracts/release-governance-baseline.json +850 -0
- package/contracts/spec-manifest.json +46 -0
- package/css/tokens.css +300 -122
- package/dist/catalog.json +2166 -162
- package/dist/chunk-2BADJLMV.js +117 -0
- package/dist/chunk-35EX5FP5.js +106 -0
- package/dist/chunk-4IGBBIYW.js +47 -0
- package/dist/chunk-4WPZ6T7V.js +186 -0
- package/dist/chunk-5PZ4VR2D.js +142 -0
- package/dist/chunk-5UESKK6S.js +76 -0
- package/dist/chunk-7A2RXKGH.js +205 -0
- package/dist/{chunk-DF47R6LN.js → chunk-AWIG4QN6.js} +9 -9
- package/dist/chunk-AYWL4IYM.js +67 -0
- package/dist/chunk-C7WHMSF3.js +114 -0
- package/dist/{chunk-SV3KZ6CB.js → chunk-DSMGCFMJ.js} +7 -2
- package/dist/{chunk-4K3PATUT.js → chunk-EEL4RAPC.js} +13 -1
- package/dist/{chunk-ILIHQ2KZ.js → chunk-EK43W2Y6.js} +16 -10
- package/dist/chunk-FV2G6SAF.js +134 -0
- package/dist/chunk-FX23F33E.js +57 -0
- package/dist/chunk-GJPTPLCQ.js +52 -0
- package/dist/chunk-HJ3A2YNO.js +163 -0
- package/dist/chunk-HJZRSPWB.js +38 -0
- package/dist/chunk-HWHJ6IRQ.js +78 -0
- package/dist/chunk-HZERHGBT.js +77 -0
- package/dist/{chunk-AUSYEAIJ.js → chunk-I66XWYSS.js} +32 -8
- package/dist/chunk-IXQGKJU4.js +183 -0
- package/dist/chunk-JDJY4ABS.js +60 -0
- package/dist/chunk-K7NQ6ZAW.js +84 -0
- package/dist/chunk-KWILREVQ.js +147 -0
- package/dist/chunk-LCKLZ4XK.js +60 -0
- package/dist/{chunk-WI37ZYIF.js → chunk-M4XKO45H.js} +13 -1
- package/dist/chunk-NEHCPO53.js +44 -0
- package/dist/chunk-OJ7OO3QB.js +269 -0
- package/dist/{chunk-ZHTQF2KI.js → chunk-OSNTB6RY.js} +29 -22
- package/dist/{chunk-GMMPLZLC.js → chunk-PDSQC6VE.js} +1 -1
- package/dist/chunk-QIHA7S3A.js +36 -0
- package/dist/chunk-QQOWC53X.js +98 -0
- package/dist/chunk-RKQPU75I.js +126 -0
- package/dist/chunk-U4GYSYGN.js +120 -0
- package/dist/chunk-UGV45DH3.js +18 -0
- package/dist/chunk-VBZQ4DBE.js +52 -0
- package/dist/{chunk-LQLFA2EL.js → chunk-VDONTZZX.js} +2 -2
- package/dist/chunk-VEO56RH4.js +105 -0
- package/dist/chunk-VJ5VD4UT.js +91 -0
- package/dist/{chunk-RWNJ54CI.js → chunk-VN475YZS.js} +1 -1
- package/dist/chunk-VNNAL4A6.js +110 -0
- package/dist/chunk-VZCB4APK.js +94 -0
- package/dist/chunk-W7FXDRQJ.js +94 -0
- package/dist/{chunk-5I3FWRC5.js → chunk-WOYBVPXK.js} +10 -10
- package/dist/chunk-WST5NLLC.js +73 -0
- package/dist/chunk-X6VXWEDO.js +125 -0
- package/dist/chunk-XTASI4IY.js +60 -0
- package/dist/chunk-Z233ZQZE.js +33 -0
- package/dist/chunk-ZKLB5N3Q.js +110 -0
- package/dist/chunk-ZM2NODUK.js +39 -0
- package/dist/components/blocks/AccountLockedBlock.js +7 -57
- package/dist/components/blocks/ActivityFeedBlock.js +6 -39
- package/dist/components/blocks/AgentConversationBlock.d.ts +6 -1
- package/dist/components/blocks/AgentConversationBlock.js +45 -71
- package/dist/components/blocks/AgentRunOverviewBlock.js +1 -1
- package/dist/components/blocks/AgentWorkbenchBlock.d.ts +5 -1
- package/dist/components/blocks/AgentWorkbenchBlock.js +47 -46
- package/dist/components/blocks/AudioVisualizerBlock.d.ts +1 -1
- package/dist/components/blocks/AudioVisualizerBlock.js +2 -2
- package/dist/components/blocks/AuthLayout.js +2 -2
- package/dist/components/blocks/AuthSuccessBlock.js +5 -60
- package/dist/components/blocks/BannerBlock.js +38 -38
- package/dist/components/blocks/BarChartBlock.d.ts +1 -1
- package/dist/components/blocks/BarChartBlock.js +2 -2
- package/dist/components/blocks/CallToActionBlock.d.ts +1 -1
- package/dist/components/blocks/CallToActionBlock.js +7 -53
- package/dist/components/blocks/ChangelogBlock.js +45 -142
- package/dist/components/blocks/ChartBlock.js +38 -38
- package/dist/components/blocks/ChartCollectionBlock.js +3 -3
- package/dist/components/blocks/ChatLayout.d.ts +4 -1
- package/dist/components/blocks/ChatLayout.js +39 -39
- package/dist/components/blocks/CodeBlock.js +7 -60
- package/dist/components/blocks/ComparisonBlock.js +9 -94
- package/dist/components/blocks/ContactBlock.js +11 -120
- package/dist/components/blocks/CreateBlock.js +39 -39
- package/dist/components/blocks/DataGridBlock.js +40 -40
- package/dist/components/blocks/DirectoryBlock.js +43 -43
- package/dist/components/blocks/FAQBlock.js +44 -82
- package/dist/components/blocks/FeatureBlock.d.ts +10 -14
- package/dist/components/blocks/FeatureBlock.js +54 -196
- package/dist/components/blocks/FeatureGridBlock.d.ts +1 -1
- package/dist/components/blocks/FeatureGridBlock.js +2 -2
- package/dist/components/blocks/FooterBlock.d.ts +2 -2
- package/dist/components/blocks/FooterBlock.js +11 -67
- package/dist/components/blocks/GalleryBlock.js +38 -38
- package/dist/components/blocks/HeaderBlock.d.ts +2 -2
- package/dist/components/blocks/HeaderBlock.js +39 -39
- package/dist/components/blocks/HeatmapChartBlock.d.ts +1 -1
- package/dist/components/blocks/HeatmapChartBlock.js +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +6 -3
- package/dist/components/blocks/HeroBlock.js +53 -236
- package/dist/components/blocks/HeroSectionBlock.d.ts +1 -1
- package/dist/components/blocks/HeroSectionBlock.js +59 -63
- package/dist/components/blocks/IntegrationsBlock.d.ts +1 -1
- package/dist/components/blocks/IntegrationsBlock.js +42 -42
- package/dist/components/blocks/InteractiveAreaChartBlock.d.ts +1 -1
- package/dist/components/blocks/InteractiveAreaChartBlock.js +40 -40
- package/dist/components/blocks/KanbanDemoBlock.js +3 -3
- package/dist/components/blocks/LoginBlock.js +2 -2
- package/dist/components/blocks/LogoCloud.js +2 -13
- package/dist/components/blocks/NavUser.js +42 -42
- package/dist/components/blocks/NewsletterBlock.js +11 -84
- package/dist/components/blocks/NotFoundBlock.js +41 -41
- package/dist/components/blocks/OnboardingBlock.js +38 -38
- package/dist/components/blocks/PasswordRecoveryBlock.js +14 -142
- package/dist/components/blocks/PricingBlock.d.ts +1 -1
- package/dist/components/blocks/PricingBlock.js +13 -112
- package/dist/components/blocks/ProcessFlowBlock.js +10 -77
- package/dist/components/blocks/ResetPasswordBlock.js +11 -125
- package/dist/components/blocks/SettingsLayout.js +42 -42
- package/dist/components/blocks/SignUpBlock.d.ts +1 -1
- package/dist/components/blocks/SignUpBlock.js +3 -3
- package/dist/components/blocks/SocialProofBlock.d.ts +7 -11
- package/dist/components/blocks/SocialProofBlock.js +10 -108
- package/dist/components/blocks/StatsBlock.d.ts +1 -1
- package/dist/components/blocks/StatsBlock.js +40 -40
- package/dist/components/blocks/StatsMarketingBlock.d.ts +1 -1
- package/dist/components/blocks/StatsMarketingBlock.js +7 -38
- package/dist/components/blocks/TeamBlock.d.ts +1 -1
- package/dist/components/blocks/TeamBlock.js +4 -52
- package/dist/components/blocks/TestimonialsBlock.d.ts +1 -1
- package/dist/components/blocks/TestimonialsBlock.js +5 -133
- package/dist/components/blocks/TwoFactorChallengeBlock.js +46 -131
- package/dist/components/blocks/TwoFactorSetupBlock.js +53 -220
- package/dist/components/blocks/UsageDonutBlock.d.ts +1 -1
- package/dist/components/blocks/UsageDonutBlock.js +2 -2
- package/dist/components/blocks/VoiceAgentCard.d.ts +3 -1
- package/dist/components/blocks/VoiceAgentCard.js +7 -76
- package/dist/components/blocks/WizardBlock.js +39 -39
- package/dist/components/blocks/user/InviteUserModal.js +38 -38
- package/dist/components/logos/index.js +2 -2
- package/dist/components/page-kits/AccountLockedPageKit.d.ts +10 -0
- package/dist/components/page-kits/AccountLockedPageKit.js +48 -0
- package/dist/components/page-kits/AgentsChatPageKit.d.ts +46 -0
- package/dist/components/page-kits/AgentsChatPageKit.js +290 -0
- package/dist/components/page-kits/AnalyticsPageKit.d.ts +49 -0
- package/dist/components/page-kits/AnalyticsPageKit.js +277 -0
- package/dist/components/page-kits/BlogContentPageKit.d.ts +64 -0
- package/dist/components/page-kits/BlogContentPageKit.js +296 -0
- package/dist/components/page-kits/CheckoutPageKit.d.ts +36 -0
- package/dist/components/page-kits/CheckoutPageKit.js +209 -0
- package/dist/components/page-kits/CompanySuitePageKit.d.ts +25 -0
- package/dist/components/page-kits/CompanySuitePageKit.js +240 -0
- package/dist/components/page-kits/CrudFormPageKit.d.ts +54 -0
- package/dist/components/page-kits/CrudFormPageKit.js +138 -0
- package/dist/components/page-kits/CrudListDetailPageKit.d.ts +70 -0
- package/dist/components/page-kits/CrudListDetailPageKit.js +138 -0
- package/dist/components/page-kits/DashboardPageKit.d.ts +39 -0
- package/dist/components/page-kits/DashboardPageKit.js +284 -0
- package/dist/components/page-kits/ErrorPageKit.d.ts +22 -0
- package/dist/components/page-kits/ErrorPageKit.js +55 -0
- package/dist/components/page-kits/KanbanBoardPageKit.d.ts +31 -0
- package/dist/components/page-kits/KanbanBoardPageKit.js +305 -0
- package/dist/components/page-kits/LandingPageKit.d.ts +29 -0
- package/dist/components/page-kits/LandingPageKit.js +222 -0
- package/dist/components/page-kits/LoginPageKit.d.ts +16 -0
- package/dist/components/page-kits/LoginPageKit.js +43 -0
- package/dist/components/page-kits/MarketingShellPageKit.d.ts +21 -0
- package/dist/components/page-kits/MarketingShellPageKit.js +131 -0
- package/dist/components/page-kits/NavigationShellPageKit.d.ts +41 -0
- package/dist/components/page-kits/NavigationShellPageKit.js +132 -0
- package/dist/components/page-kits/OnboardingPageKit.d.ts +26 -0
- package/dist/components/page-kits/OnboardingPageKit.js +248 -0
- package/dist/components/page-kits/PricingPageKit.d.ts +41 -0
- package/dist/components/page-kits/PricingPageKit.js +279 -0
- package/dist/components/page-kits/ProfileSettingsPageKit.d.ts +50 -0
- package/dist/components/page-kits/ProfileSettingsPageKit.js +171 -0
- package/dist/components/page-kits/RecoveryPageKit.d.ts +17 -0
- package/dist/components/page-kits/RecoveryPageKit.js +58 -0
- package/dist/components/page-kits/ResetPageKit.d.ts +14 -0
- package/dist/components/page-kits/ResetPageKit.js +52 -0
- package/dist/components/page-kits/ServiceSuitePageKit.d.ts +25 -0
- package/dist/components/page-kits/ServiceSuitePageKit.js +321 -0
- package/dist/components/page-kits/SettingsPageKit.d.ts +27 -0
- package/dist/components/page-kits/SettingsPageKit.js +11 -0
- package/dist/components/page-kits/SignupPageKit.d.ts +15 -0
- package/dist/components/page-kits/SignupPageKit.js +41 -0
- package/dist/components/page-kits/SuccessPageKit.d.ts +15 -0
- package/dist/components/page-kits/SuccessPageKit.js +146 -0
- package/dist/components/page-kits/TeamSettingsPageKit.d.ts +50 -0
- package/dist/components/page-kits/TeamSettingsPageKit.js +297 -0
- package/dist/components/page-kits/TwoFactorPageKit.d.ts +16 -0
- package/dist/components/page-kits/TwoFactorPageKit.js +156 -0
- package/dist/components/page-kits/VerifyEmailPageKit.d.ts +15 -0
- package/dist/components/page-kits/VerifyEmailPageKit.js +146 -0
- package/dist/components/page-kits/VoiceAgentsPageKit.d.ts +35 -0
- package/dist/components/page-kits/VoiceAgentsPageKit.js +250 -0
- package/dist/components/ui/Accordion.js +38 -38
- package/dist/components/ui/AgentMessageBubble.d.ts +20 -4
- package/dist/components/ui/AgentMessageBubble.js +39 -39
- package/dist/components/ui/AgentStatus.d.ts +1 -1
- package/dist/components/ui/AgentStatus.js +5 -10
- package/dist/components/ui/AgentTerminal.d.ts +4 -1
- package/dist/components/ui/AgentTerminal.js +3 -1
- package/dist/components/ui/AgentTimeline.d.ts +2 -2
- package/dist/components/ui/AgentTimeline.js +15 -6
- package/dist/components/ui/AnimatedDialog.js +38 -38
- package/dist/components/ui/AnimatedSheet.js +38 -38
- package/dist/components/ui/ApprovalCard.js +1 -1
- package/dist/components/ui/AudioWaveform.js +2 -76
- package/dist/components/ui/AvatarUpload.js +1 -1
- package/dist/components/ui/Breadcrumb.js +41 -143
- package/dist/components/ui/Calendar.js +38 -38
- package/dist/components/ui/Carousel.js +38 -38
- package/dist/components/ui/ChartCard.js +5 -38
- package/dist/components/ui/ChatActions.d.ts +14 -0
- package/dist/components/ui/ChatActions.js +52 -0
- package/dist/components/ui/ChatBranch.d.ts +18 -0
- package/dist/components/ui/ChatBranch.js +84 -0
- package/dist/components/ui/ChatChainOfThought.d.ts +25 -0
- package/dist/components/ui/ChatChainOfThought.js +99 -0
- package/dist/components/ui/ChatConfirmation.d.ts +37 -0
- package/dist/components/ui/ChatConfirmation.js +115 -0
- package/dist/components/ui/ChatGreeting.d.ts +18 -0
- package/dist/components/ui/ChatGreeting.js +80 -0
- package/dist/components/ui/ChatMessage.d.ts +40 -0
- package/dist/components/ui/ChatMessage.js +96 -0
- package/dist/components/ui/ChatPlan.d.ts +29 -0
- package/dist/components/ui/ChatPlan.js +86 -0
- package/dist/components/ui/ChatPromptInput.d.ts +32 -0
- package/dist/components/ui/ChatPromptInput.js +193 -0
- package/dist/components/ui/ChatPromptInputAttachments.d.ts +9 -0
- package/dist/components/ui/ChatPromptInputAttachments.js +145 -0
- package/dist/components/ui/ChatQueue.d.ts +32 -0
- package/dist/components/ui/ChatQueue.js +93 -0
- package/dist/components/ui/ChatReasoning.d.ts +20 -0
- package/dist/components/ui/ChatReasoning.js +91 -0
- package/dist/components/ui/ChatResponse.d.ts +14 -0
- package/dist/components/ui/ChatResponse.js +25 -0
- package/dist/components/ui/ChatShimmer.d.ts +23 -0
- package/dist/components/ui/ChatShimmer.js +6 -0
- package/dist/components/ui/ChatSources.d.ts +30 -0
- package/dist/components/ui/ChatSources.js +113 -0
- package/dist/components/ui/ChatSuggestion.d.ts +13 -0
- package/dist/components/ui/ChatSuggestion.js +41 -0
- package/dist/components/ui/ChatThinkingMessage.d.ts +12 -0
- package/dist/components/ui/ChatThinkingMessage.js +55 -0
- package/dist/components/ui/ChatToolCall.d.ts +41 -0
- package/dist/components/ui/ChatToolCall.js +192 -0
- package/dist/components/ui/CheckStatus.d.ts +1 -1
- package/dist/components/ui/Checkbox.js +38 -38
- package/dist/components/ui/CheckoutForm.js +38 -38
- package/dist/components/ui/CheckoutFormDemo.js +43 -44
- package/dist/components/ui/Combobox.js +38 -38
- package/dist/components/ui/Command.js +38 -38
- package/dist/components/ui/ContextMenu.js +38 -38
- package/dist/components/ui/Conversation.d.ts +21 -0
- package/dist/components/ui/Conversation.js +196 -0
- package/dist/components/ui/ConversationThread.d.ts +8 -2
- package/dist/components/ui/ConversationThread.js +34 -16
- package/dist/components/ui/DataFreshness.js +2 -73
- package/dist/components/ui/DataTable.js +40 -40
- package/dist/components/ui/DatePicker.js +38 -38
- package/dist/components/ui/DateRangePicker.js +38 -38
- package/dist/components/ui/Dialog.js +38 -38
- package/dist/components/ui/DropdownMenu.js +39 -39
- package/dist/components/ui/FileUpload.js +38 -38
- package/dist/components/ui/InputOTP.js +38 -38
- package/dist/components/ui/KanbanBoard.js +2 -2
- package/dist/components/ui/LanguageSwitcher.js +38 -38
- package/dist/components/ui/Menubar.js +38 -38
- package/dist/components/ui/MouseEffect.js +1 -1
- package/dist/components/ui/NativeSelect.js +2 -18
- package/dist/components/ui/NavigationMenu.js +38 -38
- package/dist/components/ui/NotificationCenter.js +38 -38
- package/dist/components/ui/Pagination.js +42 -153
- package/dist/components/ui/RadioGroup.js +38 -38
- package/dist/components/ui/Resizable.js +38 -38
- package/dist/components/ui/SearchCommand.js +38 -38
- package/dist/components/ui/Select.js +38 -38
- package/dist/components/ui/SettingsModal.js +38 -38
- package/dist/components/ui/ShaderBackground.js +2 -2
- package/dist/components/ui/Sheet.js +38 -38
- package/dist/components/ui/Sidebar.js +41 -41
- package/dist/components/ui/StyleToggle.js +1 -1
- package/dist/components/ui/TagInput.js +38 -38
- package/dist/components/ui/ThemeToggle.js +39 -39
- package/dist/components/ui/ThinkingIndicator.d.ts +3 -1
- package/dist/components/ui/ThinkingIndicator.js +2 -1
- package/dist/components/ui/Toast.js +38 -38
- package/dist/components/ui/Toaster.js +38 -38
- package/dist/components/ui/ToolCallCard.d.ts +1 -1
- package/dist/components/ui/ToolCallCard.js +5 -1
- package/dist/components/ui/TreeView.js +38 -38
- package/dist/components/ui/charts/index.js +1 -1
- package/dist/components/ui/icons/index.js +38 -38
- package/dist/components/ui/text-effects/index.js +2 -2
- package/dist/hooks/use-scroll-to-bottom.d.ts +13 -0
- package/dist/hooks/use-scroll-to-bottom.js +2 -0
- package/dist/hooks/use-shader-preset.js +2 -2
- package/dist/index.js +43 -43
- package/dist/internal/local-image-assets.d.ts +12 -0
- package/dist/lib/shader-presets.js +1 -1
- package/dist/lib/tokens.config.d.ts +19 -0
- package/dist/messages/en.js +1 -1
- package/dist/messages/it.js +1 -1
- package/dist/test/PublicSeedTestProvider.js +2 -2
- package/dist/test/simulate-ime-composition.d.ts +54 -0
- package/dist/test/simulate-ime-composition.js +55 -0
- package/eslint-rules/nadicode/config.js +2 -0
- package/eslint-rules/nadicode/index.js +4 -0
- package/eslint-rules/nadicode/rules/no-deprecated-ds-import.js +77 -0
- package/eslint-rules/nadicode/rules/no-forbidden-page-kit-import.js +99 -0
- package/eslint-rules/nadicode/rules/no-unregistered-glass.js +2 -0
- package/package.json +895 -686
- package/scripts/ds-check.mjs +102 -73
- package/src/lib/tokens.config.js +63 -41
- package/dist/chunk-MLUSJTS2.js +0 -107
- package/dist/{chunk-5DKCZWC6.js → chunk-CQEUNASC.js} +1 -1
- package/dist/{chunk-4HRVRW2X.js → chunk-J2DCQDXO.js} +2 -2
- package/dist/{chunk-6MFAZU4B.js → chunk-RGE5OQMZ.js} +1 -1
- package/dist/{chunk-PJNHVPHF.js → chunk-TYP2MR3Q.js} +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { resolve, dirname } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const RULES_DIR = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const REGISTRY_PATH = resolve(RULES_DIR, "../../../contracts/public-surface-registry.json");
|
|
7
|
+
const DS_PACKAGE = "@vadimcomanescu/nadicode-design-system";
|
|
8
|
+
|
|
9
|
+
let deprecatedSubpaths = null;
|
|
10
|
+
|
|
11
|
+
function loadDeprecatedSubpaths() {
|
|
12
|
+
if (deprecatedSubpaths) {
|
|
13
|
+
return deprecatedSubpaths;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
deprecatedSubpaths = new Map();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const registry = JSON.parse(readFileSync(REGISTRY_PATH, "utf8"));
|
|
20
|
+
for (const entry of registry.entries ?? []) {
|
|
21
|
+
if (entry.stability === "deprecated" && entry.deprecation) {
|
|
22
|
+
deprecatedSubpaths.set(entry.subpath, {
|
|
23
|
+
replacement: entry.deprecation.replacement,
|
|
24
|
+
removalVersion: entry.deprecation.removalVersion,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
// Registry unavailable (e.g. consumer repo without local contracts).
|
|
30
|
+
// Rule becomes a no-op.
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return deprecatedSubpaths;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const rule = {
|
|
37
|
+
meta: {
|
|
38
|
+
type: "suggestion",
|
|
39
|
+
docs: {
|
|
40
|
+
description:
|
|
41
|
+
"Warn when importing a deprecated export from @vadimcomanescu/nadicode-design-system.",
|
|
42
|
+
},
|
|
43
|
+
schema: [],
|
|
44
|
+
},
|
|
45
|
+
create(context) {
|
|
46
|
+
return {
|
|
47
|
+
ImportDeclaration(node) {
|
|
48
|
+
const source = node.source.value;
|
|
49
|
+
if (typeof source !== "string" || !source.startsWith(DS_PACKAGE)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const subpath = "./" + source.slice(DS_PACKAGE.length + 1);
|
|
54
|
+
if (subpath === "./") {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const deprecated = loadDeprecatedSubpaths();
|
|
59
|
+
const info = deprecated.get(subpath);
|
|
60
|
+
if (!info) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const parts = [
|
|
65
|
+
`"${source}" is deprecated and will be removed in v${info.removalVersion}.`,
|
|
66
|
+
];
|
|
67
|
+
if (info.replacement) {
|
|
68
|
+
parts.push(`Use "${DS_PACKAGE}/${info.replacement.slice(2)}" instead.`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
context.report({ node, message: parts.join(" ") });
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default rule;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { resolve, dirname } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const RULES_DIR = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const REGISTRY_PATH = resolve(RULES_DIR, "../../../contracts/public-surface-registry.json");
|
|
7
|
+
const DS_PACKAGE = "@vadimcomanescu/nadicode-design-system";
|
|
8
|
+
|
|
9
|
+
let forbiddenByPageKit = null;
|
|
10
|
+
|
|
11
|
+
function loadForbiddenMap() {
|
|
12
|
+
if (forbiddenByPageKit) {
|
|
13
|
+
return forbiddenByPageKit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
forbiddenByPageKit = new Map();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const registry = JSON.parse(readFileSync(REGISTRY_PATH, "utf8"));
|
|
20
|
+
for (const entry of registry.entries ?? []) {
|
|
21
|
+
if (
|
|
22
|
+
entry.category === "page-kits" &&
|
|
23
|
+
entry.pageKitContract?.forbiddenComponents?.length > 0
|
|
24
|
+
) {
|
|
25
|
+
const forbidden = new Set(entry.pageKitContract.forbiddenComponents);
|
|
26
|
+
forbiddenByPageKit.set(entry.subpath, {
|
|
27
|
+
canonicalExport: entry.canonicalExport,
|
|
28
|
+
forbidden,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// Registry unavailable. Rule becomes a no-op.
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return forbiddenByPageKit;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function subpathFromImport(source) {
|
|
40
|
+
if (!source.startsWith(DS_PACKAGE + "/")) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return "./" + source.slice(DS_PACKAGE.length + 1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const rule = {
|
|
47
|
+
meta: {
|
|
48
|
+
type: "problem",
|
|
49
|
+
docs: {
|
|
50
|
+
description:
|
|
51
|
+
"Disallow importing components that are forbidden alongside a page-kit from the design system.",
|
|
52
|
+
},
|
|
53
|
+
schema: [],
|
|
54
|
+
},
|
|
55
|
+
create(context) {
|
|
56
|
+
const dsImports = [];
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
ImportDeclaration(node) {
|
|
60
|
+
const source = node.source.value;
|
|
61
|
+
if (typeof source !== "string" || !source.startsWith(DS_PACKAGE + "/")) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
dsImports.push({ node, subpath: subpathFromImport(source) });
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"Program:exit"() {
|
|
68
|
+
const map = loadForbiddenMap();
|
|
69
|
+
if (map.size === 0 || dsImports.length === 0) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const activePageKits = dsImports.filter((imp) => map.has(imp.subpath));
|
|
74
|
+
if (activePageKits.length === 0) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
for (const imp of dsImports) {
|
|
79
|
+
for (const pk of activePageKits) {
|
|
80
|
+
const pkData = map.get(pk.subpath);
|
|
81
|
+
if (pkData.forbidden.has(imp.subpath)) {
|
|
82
|
+
context.report({
|
|
83
|
+
node: imp.node,
|
|
84
|
+
message:
|
|
85
|
+
'"{{source}}" is forbidden when using {{pageKit}}. This import violates the page-kit\'s cross-domain contract.',
|
|
86
|
+
data: {
|
|
87
|
+
source: imp.node.source.value,
|
|
88
|
+
pageKit: pkData.canonicalExport,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default rule;
|