{"version":3,"file":"defaults.js","sources":["../../../src/import-protection-plugin/defaults.ts"],"sourcesContent":["import type { ImportProtectionEnvRules } from '../schema'\nimport type { Pattern } from './utils'\n\nexport interface DefaultImportProtectionRules {\n  client: Required<ImportProtectionEnvRules>\n  server: Required<ImportProtectionEnvRules>\n}\n\nconst frameworks = ['react', 'solid', 'vue'] as const\n\n/**\n * Returns the default import protection rules.\n *\n * All three framework variants are always included so that, e.g., a React\n * project also denies `@tanstack/solid-start/server` imports.\n */\nexport function getDefaultImportProtectionRules(): DefaultImportProtectionRules {\n  const clientSpecifiers: Array<Pattern> = frameworks.map(\n    (fw) => `@tanstack/${fw}-start/server`,\n  )\n\n  return {\n    client: {\n      specifiers: clientSpecifiers,\n      files: ['**/*.server.*'],\n      excludeFiles: ['**/node_modules/**'],\n    },\n    server: {\n      specifiers: [],\n      files: ['**/*.client.*'],\n      excludeFiles: ['**/node_modules/**'],\n    },\n  }\n}\n\n/**\n * Marker module specifiers that restrict a file to a specific environment.\n */\nexport function getMarkerSpecifiers(): {\n  serverOnly: Array<string>\n  clientOnly: Array<string>\n} {\n  return {\n    serverOnly: frameworks.map((fw) => `@tanstack/${fw}-start/server-only`),\n    clientOnly: frameworks.map((fw) => `@tanstack/${fw}-start/client-only`),\n  }\n}\n"],"names":[],"mappings":"AAQA,MAAM,aAAa,CAAC,SAAS,SAAS,KAAK;AAQpC,SAAS,kCAAgE;AAC9E,QAAM,mBAAmC,WAAW;AAAA,IAClD,CAAC,OAAO,aAAa,EAAE;AAAA,EAAA;AAGzB,SAAO;AAAA,IACL,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,OAAO,CAAC,eAAe;AAAA,MACvB,cAAc,CAAC,oBAAoB;AAAA,IAAA;AAAA,IAErC,QAAQ;AAAA,MACN,YAAY,CAAA;AAAA,MACZ,OAAO,CAAC,eAAe;AAAA,MACvB,cAAc,CAAC,oBAAoB;AAAA,IAAA;AAAA,EACrC;AAEJ;AAKO,SAAS,sBAGd;AACA,SAAO;AAAA,IACL,YAAY,WAAW,IAAI,CAAC,OAAO,aAAa,EAAE,oBAAoB;AAAA,IACtE,YAAY,WAAW,IAAI,CAAC,OAAO,aAAa,EAAE,oBAAoB;AAAA,EAAA;AAE1E;"}