@tanstack/start-plugin-core 1.163.3 → 1.163.4

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.
Files changed (47) hide show
  1. package/dist/esm/constants.d.ts +1 -0
  2. package/dist/esm/constants.js +2 -0
  3. package/dist/esm/constants.js.map +1 -1
  4. package/dist/esm/import-protection-plugin/ast.d.ts +3 -0
  5. package/dist/esm/import-protection-plugin/ast.js +8 -0
  6. package/dist/esm/import-protection-plugin/ast.js.map +1 -0
  7. package/dist/esm/import-protection-plugin/constants.d.ts +6 -0
  8. package/dist/esm/import-protection-plugin/constants.js +24 -0
  9. package/dist/esm/import-protection-plugin/constants.js.map +1 -0
  10. package/dist/esm/import-protection-plugin/extensionlessAbsoluteIdResolver.d.ts +22 -0
  11. package/dist/esm/import-protection-plugin/extensionlessAbsoluteIdResolver.js +95 -0
  12. package/dist/esm/import-protection-plugin/extensionlessAbsoluteIdResolver.js.map +1 -0
  13. package/dist/esm/import-protection-plugin/plugin.d.ts +2 -13
  14. package/dist/esm/import-protection-plugin/plugin.js +684 -299
  15. package/dist/esm/import-protection-plugin/plugin.js.map +1 -1
  16. package/dist/esm/import-protection-plugin/postCompileUsage.js +4 -2
  17. package/dist/esm/import-protection-plugin/postCompileUsage.js.map +1 -1
  18. package/dist/esm/import-protection-plugin/rewriteDeniedImports.d.ts +4 -5
  19. package/dist/esm/import-protection-plugin/rewriteDeniedImports.js +225 -3
  20. package/dist/esm/import-protection-plugin/rewriteDeniedImports.js.map +1 -1
  21. package/dist/esm/import-protection-plugin/sourceLocation.d.ts +4 -7
  22. package/dist/esm/import-protection-plugin/sourceLocation.js +18 -73
  23. package/dist/esm/import-protection-plugin/sourceLocation.js.map +1 -1
  24. package/dist/esm/import-protection-plugin/types.d.ts +94 -0
  25. package/dist/esm/import-protection-plugin/utils.d.ts +33 -1
  26. package/dist/esm/import-protection-plugin/utils.js +69 -3
  27. package/dist/esm/import-protection-plugin/utils.js.map +1 -1
  28. package/dist/esm/import-protection-plugin/virtualModules.d.ts +30 -2
  29. package/dist/esm/import-protection-plugin/virtualModules.js +66 -23
  30. package/dist/esm/import-protection-plugin/virtualModules.js.map +1 -1
  31. package/dist/esm/start-compiler-plugin/plugin.d.ts +2 -1
  32. package/dist/esm/start-compiler-plugin/plugin.js +1 -2
  33. package/dist/esm/start-compiler-plugin/plugin.js.map +1 -1
  34. package/package.json +4 -4
  35. package/src/constants.ts +2 -0
  36. package/src/import-protection-plugin/INTERNALS.md +462 -60
  37. package/src/import-protection-plugin/ast.ts +7 -0
  38. package/src/import-protection-plugin/constants.ts +25 -0
  39. package/src/import-protection-plugin/extensionlessAbsoluteIdResolver.ts +121 -0
  40. package/src/import-protection-plugin/plugin.ts +1080 -597
  41. package/src/import-protection-plugin/postCompileUsage.ts +8 -2
  42. package/src/import-protection-plugin/rewriteDeniedImports.ts +141 -9
  43. package/src/import-protection-plugin/sourceLocation.ts +19 -89
  44. package/src/import-protection-plugin/types.ts +103 -0
  45. package/src/import-protection-plugin/utils.ts +123 -4
  46. package/src/import-protection-plugin/virtualModules.ts +117 -31
  47. package/src/start-compiler-plugin/plugin.ts +7 -2
@@ -9,4 +9,5 @@ export declare const ENTRY_POINTS: {
9
9
  readonly start: "#tanstack-start-entry";
10
10
  readonly router: "#tanstack-router-entry";
11
11
  };
12
+ export declare const SERVER_FN_LOOKUP = "server-fn-module-lookup";
12
13
  export declare const TRANSFORM_ID_REGEX: RegExp[];
@@ -11,9 +11,11 @@ const ENTRY_POINTS = {
11
11
  start: "#tanstack-start-entry",
12
12
  router: "#tanstack-router-entry"
13
13
  };
14
+ const SERVER_FN_LOOKUP = "server-fn-module-lookup";
14
15
  const TRANSFORM_ID_REGEX = [/\.[cm]?[tj]sx?($|\?)/];
15
16
  export {
16
17
  ENTRY_POINTS,
18
+ SERVER_FN_LOOKUP,
17
19
  TRANSFORM_ID_REGEX,
18
20
  VITE_ENVIRONMENT_NAMES
19
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const VITE_ENVIRONMENT_NAMES = {\n // 'ssr' is chosen as the name for the server environment to ensure backwards compatibility\n // with vite plugins that are not compatible with the new vite environment API (e.g. tailwindcss)\n server: 'ssr',\n client: 'client',\n} as const\n\nexport type ViteEnvironmentNames =\n (typeof VITE_ENVIRONMENT_NAMES)[keyof typeof VITE_ENVIRONMENT_NAMES]\n\n// for client and router:\n// if a user has a custom server/client entry point file, resolve.alias will point to this\n// otherwise it will be aliased to the default entry point in the respective framework plugin\nexport const ENTRY_POINTS = {\n client: 'virtual:tanstack-start-client-entry',\n server: 'virtual:tanstack-start-server-entry',\n // the start entry point must always be provided by the user\n start: '#tanstack-start-entry',\n router: '#tanstack-router-entry',\n} as const\n\n// matches\n// .ts, .tsx, .cts, .mts, .js, .jsx, .cjs, .mjs\n// with optional query params after\n// but not .json\nexport const TRANSFORM_ID_REGEX = [/\\.[cm]?[tj]sx?($|\\?)/]\n"],"names":[],"mappings":"AAAO,MAAM,yBAAyB;AAAA;AAAA;AAAA,EAGpC,QAAQ;AAAA,EACR,QAAQ;AACV;AAQO,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,QAAQ;AAAA;AAAA,EAER,OAAO;AAAA,EACP,QAAQ;AACV;AAMO,MAAM,qBAAqB,CAAC,sBAAsB;"}
1
+ {"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const VITE_ENVIRONMENT_NAMES = {\n // 'ssr' is chosen as the name for the server environment to ensure backwards compatibility\n // with vite plugins that are not compatible with the new vite environment API (e.g. tailwindcss)\n server: 'ssr',\n client: 'client',\n} as const\n\nexport type ViteEnvironmentNames =\n (typeof VITE_ENVIRONMENT_NAMES)[keyof typeof VITE_ENVIRONMENT_NAMES]\n\n// for client and router:\n// if a user has a custom server/client entry point file, resolve.alias will point to this\n// otherwise it will be aliased to the default entry point in the respective framework plugin\nexport const ENTRY_POINTS = {\n client: 'virtual:tanstack-start-client-entry',\n server: 'virtual:tanstack-start-server-entry',\n // the start entry point must always be provided by the user\n start: '#tanstack-start-entry',\n router: '#tanstack-router-entry',\n} as const\n\nexport const SERVER_FN_LOOKUP = 'server-fn-module-lookup'\n\n// matches\n// .ts, .tsx, .cts, .mts, .js, .jsx, .cjs, .mjs\n// with optional query params after\n// but not .json\nexport const TRANSFORM_ID_REGEX = [/\\.[cm]?[tj]sx?($|\\?)/]\n"],"names":[],"mappings":"AAAO,MAAM,yBAAyB;AAAA;AAAA;AAAA,EAGpC,QAAQ;AAAA,EACR,QAAQ;AACV;AAQO,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,QAAQ;AAAA;AAAA,EAER,OAAO;AAAA,EACP,QAAQ;AACV;AAEO,MAAM,mBAAmB;AAMzB,MAAM,qBAAqB,CAAC,sBAAsB;"}
@@ -0,0 +1,3 @@
1
+ import { parseAst } from '@tanstack/router-utils';
2
+ export type ParsedAst = ReturnType<typeof parseAst>;
3
+ export declare function parseImportProtectionAst(code: string): ParsedAst;
@@ -0,0 +1,8 @@
1
+ import { parseAst } from "@tanstack/router-utils";
2
+ function parseImportProtectionAst(code) {
3
+ return parseAst({ code });
4
+ }
5
+ export {
6
+ parseImportProtectionAst
7
+ };
8
+ //# sourceMappingURL=ast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.js","sources":["../../../src/import-protection-plugin/ast.ts"],"sourcesContent":["import { parseAst } from '@tanstack/router-utils'\n\nexport type ParsedAst = ReturnType<typeof parseAst>\n\nexport function parseImportProtectionAst(code: string): ParsedAst {\n return parseAst({ code })\n}\n"],"names":[],"mappings":";AAIO,SAAS,yBAAyB,MAAyB;AAChE,SAAO,SAAS,EAAE,MAAM;AAC1B;"}
@@ -0,0 +1,6 @@
1
+ export declare const SERVER_FN_LOOKUP_QUERY = "?server-fn-module-lookup";
2
+ export declare const IMPORT_PROTECTION_DEBUG: boolean;
3
+ export declare const IMPORT_PROTECTION_DEBUG_FILTER: string | undefined;
4
+ export declare const KNOWN_SOURCE_EXTENSIONS: Set<string>;
5
+ /** Vite's browser-visible prefix for virtual modules (replaces `\0`). */
6
+ export declare const VITE_BROWSER_VIRTUAL_PREFIX = "/@id/__x00__";
@@ -0,0 +1,24 @@
1
+ import { SERVER_FN_LOOKUP } from "../constants.js";
2
+ const SERVER_FN_LOOKUP_QUERY = `?${SERVER_FN_LOOKUP}`;
3
+ const IMPORT_PROTECTION_DEBUG = process.env.TSR_IMPORT_PROTECTION_DEBUG === "1" || process.env.TSR_IMPORT_PROTECTION_DEBUG === "true";
4
+ const IMPORT_PROTECTION_DEBUG_FILTER = process.env.TSR_IMPORT_PROTECTION_DEBUG_FILTER;
5
+ const KNOWN_SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([
6
+ ".ts",
7
+ ".tsx",
8
+ ".mts",
9
+ ".cts",
10
+ ".js",
11
+ ".jsx",
12
+ ".mjs",
13
+ ".cjs",
14
+ ".json"
15
+ ]);
16
+ const VITE_BROWSER_VIRTUAL_PREFIX = "/@id/__x00__";
17
+ export {
18
+ IMPORT_PROTECTION_DEBUG,
19
+ IMPORT_PROTECTION_DEBUG_FILTER,
20
+ KNOWN_SOURCE_EXTENSIONS,
21
+ SERVER_FN_LOOKUP_QUERY,
22
+ VITE_BROWSER_VIRTUAL_PREFIX
23
+ };
24
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/import-protection-plugin/constants.ts"],"sourcesContent":["import { SERVER_FN_LOOKUP } from '../constants'\n\nexport const SERVER_FN_LOOKUP_QUERY = `?${SERVER_FN_LOOKUP}`\n\nexport const IMPORT_PROTECTION_DEBUG =\n process.env.TSR_IMPORT_PROTECTION_DEBUG === '1' ||\n process.env.TSR_IMPORT_PROTECTION_DEBUG === 'true'\n\nexport const IMPORT_PROTECTION_DEBUG_FILTER =\n process.env.TSR_IMPORT_PROTECTION_DEBUG_FILTER\n\nexport const KNOWN_SOURCE_EXTENSIONS = new Set([\n '.ts',\n '.tsx',\n '.mts',\n '.cts',\n '.js',\n '.jsx',\n '.mjs',\n '.cjs',\n '.json',\n])\n\n/** Vite's browser-visible prefix for virtual modules (replaces `\\0`). */\nexport const VITE_BROWSER_VIRTUAL_PREFIX = '/@id/__x00__'\n"],"names":[],"mappings":";AAEO,MAAM,yBAAyB,IAAI,gBAAgB;AAEnD,MAAM,0BACX,QAAQ,IAAI,gCAAgC,OAC5C,QAAQ,IAAI,gCAAgC;AAEvC,MAAM,iCACX,QAAQ,IAAI;AAEP,MAAM,8CAA8B,IAAI;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,MAAM,8BAA8B;"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Canonicalize extensionless absolute IDs like `/src/foo.server` to the
3
+ * physical file when possible.
4
+ *
5
+ * Keeps a small cache plus a reverse index so we can invalidate on HMR
6
+ * updates without clearing the whole map.
7
+ */
8
+ export declare class ExtensionlessAbsoluteIdResolver {
9
+ private entries;
10
+ private keysByDep;
11
+ clear(): void;
12
+ /**
13
+ * Invalidate any cached entries that might be affected by changes to `id`.
14
+ * We invalidate both the file and its containing directory.
15
+ */
16
+ invalidateByFile(id: string): void;
17
+ resolve(id: string): string;
18
+ private invalidateDep;
19
+ private buildDepsForKey;
20
+ private indexDeps;
21
+ private deleteKey;
22
+ }
@@ -0,0 +1,95 @@
1
+ import { isAbsolute, dirname, extname, basename } from "node:path";
2
+ import { resolveModulePath } from "exsolve";
3
+ import { KNOWN_SOURCE_EXTENSIONS } from "./constants.js";
4
+ import { normalizeFilePath } from "./utils.js";
5
+ const FILE_RESOLUTION_EXTENSIONS = [...KNOWN_SOURCE_EXTENSIONS];
6
+ class ExtensionlessAbsoluteIdResolver {
7
+ entries = /* @__PURE__ */ new Map();
8
+ keysByDep = /* @__PURE__ */ new Map();
9
+ clear() {
10
+ this.entries.clear();
11
+ this.keysByDep.clear();
12
+ }
13
+ /**
14
+ * Invalidate any cached entries that might be affected by changes to `id`.
15
+ * We invalidate both the file and its containing directory.
16
+ */
17
+ invalidateByFile(id) {
18
+ const file = normalizeFilePath(id);
19
+ this.invalidateDep(`file:${file}`);
20
+ if (isAbsolute(file)) {
21
+ this.invalidateDep(`dir:${dirname(file)}`);
22
+ }
23
+ }
24
+ resolve(id) {
25
+ const key = normalizeFilePath(id);
26
+ const cached = this.entries.get(key);
27
+ if (cached) return cached.value;
28
+ let result = key;
29
+ let resolvedPhysical;
30
+ if (isAbsolute(key)) {
31
+ const ext = extname(key);
32
+ if (!FILE_RESOLUTION_EXTENSIONS.includes(ext)) {
33
+ const resolved = resolveModulePath(`./${basename(key)}`, {
34
+ from: dirname(key),
35
+ extensions: FILE_RESOLUTION_EXTENSIONS,
36
+ try: true
37
+ });
38
+ if (resolved) {
39
+ resolvedPhysical = resolved;
40
+ result = normalizeFilePath(resolved);
41
+ }
42
+ }
43
+ }
44
+ const resolvedFile = resolvedPhysical ? normalizeFilePath(resolvedPhysical) : void 0;
45
+ const deps = this.buildDepsForKey(key, resolvedFile);
46
+ this.entries.set(key, { value: result, deps });
47
+ this.indexDeps(key, deps);
48
+ return result;
49
+ }
50
+ invalidateDep(dep) {
51
+ const keys = this.keysByDep.get(dep);
52
+ if (!keys) return;
53
+ for (const key of Array.from(keys)) {
54
+ this.deleteKey(key);
55
+ }
56
+ }
57
+ buildDepsForKey(key, resolvedFile) {
58
+ const deps = /* @__PURE__ */ new Set();
59
+ deps.add(`file:${key}`);
60
+ if (isAbsolute(key)) {
61
+ deps.add(`dir:${dirname(key)}`);
62
+ }
63
+ if (resolvedFile) {
64
+ deps.add(`file:${resolvedFile}`);
65
+ }
66
+ return deps;
67
+ }
68
+ indexDeps(key, deps) {
69
+ for (const dep of deps) {
70
+ let keys = this.keysByDep.get(dep);
71
+ if (!keys) {
72
+ keys = /* @__PURE__ */ new Set();
73
+ this.keysByDep.set(dep, keys);
74
+ }
75
+ keys.add(key);
76
+ }
77
+ }
78
+ deleteKey(key) {
79
+ const entry = this.entries.get(key);
80
+ this.entries.delete(key);
81
+ if (!entry) return;
82
+ for (const dep of entry.deps) {
83
+ const keys = this.keysByDep.get(dep);
84
+ if (!keys) continue;
85
+ keys.delete(key);
86
+ if (keys.size === 0) {
87
+ this.keysByDep.delete(dep);
88
+ }
89
+ }
90
+ }
91
+ }
92
+ export {
93
+ ExtensionlessAbsoluteIdResolver
94
+ };
95
+ //# sourceMappingURL=extensionlessAbsoluteIdResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionlessAbsoluteIdResolver.js","sources":["../../../src/import-protection-plugin/extensionlessAbsoluteIdResolver.ts"],"sourcesContent":["import { basename, dirname, extname, isAbsolute } from 'node:path'\nimport { resolveModulePath } from 'exsolve'\n\nimport { KNOWN_SOURCE_EXTENSIONS } from './constants'\nimport { normalizeFilePath } from './utils'\n\nconst FILE_RESOLUTION_EXTENSIONS = [...KNOWN_SOURCE_EXTENSIONS]\n\ntype DepKey = `file:${string}` | `dir:${string}`\n\n/**\n * Canonicalize extensionless absolute IDs like `/src/foo.server` to the\n * physical file when possible.\n *\n * Keeps a small cache plus a reverse index so we can invalidate on HMR\n * updates without clearing the whole map.\n */\nexport class ExtensionlessAbsoluteIdResolver {\n private entries = new Map<string, { value: string; deps: Set<DepKey> }>()\n private keysByDep = new Map<DepKey, Set<string>>()\n\n clear(): void {\n this.entries.clear()\n this.keysByDep.clear()\n }\n\n /**\n * Invalidate any cached entries that might be affected by changes to `id`.\n * We invalidate both the file and its containing directory.\n */\n invalidateByFile(id: string): void {\n const file = normalizeFilePath(id)\n this.invalidateDep(`file:${file}`)\n if (isAbsolute(file)) {\n this.invalidateDep(`dir:${dirname(file)}`)\n }\n }\n\n resolve(id: string): string {\n const key = normalizeFilePath(id)\n const cached = this.entries.get(key)\n if (cached) return cached.value\n\n let result = key\n let resolvedPhysical: string | undefined\n\n if (isAbsolute(key)) {\n const ext = extname(key)\n if (!FILE_RESOLUTION_EXTENSIONS.includes(ext)) {\n const resolved = resolveModulePath(`./${basename(key)}`, {\n from: dirname(key),\n extensions: FILE_RESOLUTION_EXTENSIONS,\n try: true,\n })\n if (resolved) {\n resolvedPhysical = resolved\n result = normalizeFilePath(resolved)\n }\n }\n }\n\n const resolvedFile = resolvedPhysical\n ? normalizeFilePath(resolvedPhysical)\n : undefined\n\n const deps = this.buildDepsForKey(key, resolvedFile)\n this.entries.set(key, { value: result, deps })\n this.indexDeps(key, deps)\n return result\n }\n\n private invalidateDep(dep: DepKey): void {\n const keys = this.keysByDep.get(dep)\n if (!keys) return\n\n // Copy because deleting keys mutates indexes.\n for (const key of Array.from(keys)) {\n this.deleteKey(key)\n }\n }\n\n private buildDepsForKey(key: string, resolvedFile: string | undefined) {\n const deps = new Set<DepKey>()\n deps.add(`file:${key}`)\n\n if (isAbsolute(key)) {\n deps.add(`dir:${dirname(key)}`)\n }\n if (resolvedFile) {\n deps.add(`file:${resolvedFile}`)\n }\n\n return deps\n }\n\n private indexDeps(key: string, deps: Set<DepKey>): void {\n for (const dep of deps) {\n let keys = this.keysByDep.get(dep)\n if (!keys) {\n keys = new Set<string>()\n this.keysByDep.set(dep, keys)\n }\n keys.add(key)\n }\n }\n\n private deleteKey(key: string): void {\n const entry = this.entries.get(key)\n this.entries.delete(key)\n if (!entry) return\n\n for (const dep of entry.deps) {\n const keys = this.keysByDep.get(dep)\n if (!keys) continue\n keys.delete(key)\n if (keys.size === 0) {\n this.keysByDep.delete(dep)\n }\n }\n }\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,6BAA6B,CAAC,GAAG,uBAAuB;AAWvD,MAAM,gCAAgC;AAAA,EACnC,8BAAc,IAAA;AAAA,EACd,gCAAgB,IAAA;AAAA,EAExB,QAAc;AACZ,SAAK,QAAQ,MAAA;AACb,SAAK,UAAU,MAAA;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,iBAAiB,IAAkB;AACjC,UAAM,OAAO,kBAAkB,EAAE;AACjC,SAAK,cAAc,QAAQ,IAAI,EAAE;AACjC,QAAI,WAAW,IAAI,GAAG;AACpB,WAAK,cAAc,OAAO,QAAQ,IAAI,CAAC,EAAE;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA,QAAQ,IAAoB;AAC1B,UAAM,MAAM,kBAAkB,EAAE;AAChC,UAAM,SAAS,KAAK,QAAQ,IAAI,GAAG;AACnC,QAAI,eAAe,OAAO;AAE1B,QAAI,SAAS;AACb,QAAI;AAEJ,QAAI,WAAW,GAAG,GAAG;AACnB,YAAM,MAAM,QAAQ,GAAG;AACvB,UAAI,CAAC,2BAA2B,SAAS,GAAG,GAAG;AAC7C,cAAM,WAAW,kBAAkB,KAAK,SAAS,GAAG,CAAC,IAAI;AAAA,UACvD,MAAM,QAAQ,GAAG;AAAA,UACjB,YAAY;AAAA,UACZ,KAAK;AAAA,QAAA,CACN;AACD,YAAI,UAAU;AACZ,6BAAmB;AACnB,mBAAS,kBAAkB,QAAQ;AAAA,QACrC;AAAA,MACF;AAAA,IACF;AAEA,UAAM,eAAe,mBACjB,kBAAkB,gBAAgB,IAClC;AAEJ,UAAM,OAAO,KAAK,gBAAgB,KAAK,YAAY;AACnD,SAAK,QAAQ,IAAI,KAAK,EAAE,OAAO,QAAQ,MAAM;AAC7C,SAAK,UAAU,KAAK,IAAI;AACxB,WAAO;AAAA,EACT;AAAA,EAEQ,cAAc,KAAmB;AACvC,UAAM,OAAO,KAAK,UAAU,IAAI,GAAG;AACnC,QAAI,CAAC,KAAM;AAGX,eAAW,OAAO,MAAM,KAAK,IAAI,GAAG;AAClC,WAAK,UAAU,GAAG;AAAA,IACpB;AAAA,EACF;AAAA,EAEQ,gBAAgB,KAAa,cAAkC;AACrE,UAAM,2BAAW,IAAA;AACjB,SAAK,IAAI,QAAQ,GAAG,EAAE;AAEtB,QAAI,WAAW,GAAG,GAAG;AACnB,WAAK,IAAI,OAAO,QAAQ,GAAG,CAAC,EAAE;AAAA,IAChC;AACA,QAAI,cAAc;AAChB,WAAK,IAAI,QAAQ,YAAY,EAAE;AAAA,IACjC;AAEA,WAAO;AAAA,EACT;AAAA,EAEQ,UAAU,KAAa,MAAyB;AACtD,eAAW,OAAO,MAAM;AACtB,UAAI,OAAO,KAAK,UAAU,IAAI,GAAG;AACjC,UAAI,CAAC,MAAM;AACT,mCAAW,IAAA;AACX,aAAK,UAAU,IAAI,KAAK,IAAI;AAAA,MAC9B;AACA,WAAK,IAAI,GAAG;AAAA,IACd;AAAA,EACF;AAAA,EAEQ,UAAU,KAAmB;AACnC,UAAM,QAAQ,KAAK,QAAQ,IAAI,GAAG;AAClC,SAAK,QAAQ,OAAO,GAAG;AACvB,QAAI,CAAC,MAAO;AAEZ,eAAW,OAAO,MAAM,MAAM;AAC5B,YAAM,OAAO,KAAK,UAAU,IAAI,GAAG;AACnC,UAAI,CAAC,KAAM;AACX,WAAK,OAAO,GAAG;AACf,UAAI,KAAK,SAAS,GAAG;AACnB,aAAK,UAAU,OAAO,GAAG;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AACF;"}
@@ -1,15 +1,4 @@
1
1
  import { PluginOption } from 'vite';
2
- import { CompileStartFrameworkOptions, GetConfigFn } from '../types.js';
3
- export { rewriteDeniedImports } from './rewriteDeniedImports.js';
4
- export { dedupePatterns, extractImportSources } from './utils.js';
5
- export type { Pattern } from './utils.js';
6
- export interface ImportProtectionPluginOptions {
7
- getConfig: GetConfigFn;
8
- framework: CompileStartFrameworkOptions;
9
- environments: Array<{
10
- name: string;
11
- type: 'client' | 'server';
12
- }>;
13
- providerEnvName: string;
14
- }
2
+ import { ImportProtectionPluginOptions } from './types.js';
3
+ export type { ImportProtectionPluginOptions } from './types.js';
15
4
  export declare function importProtectionPlugin(opts: ImportProtectionPluginOptions): PluginOption;