@tanstack/start-plugin-core 1.161.3 → 1.162.0
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/dist/esm/import-protection-plugin/defaults.d.ts +6 -4
- package/dist/esm/import-protection-plugin/defaults.js +3 -12
- package/dist/esm/import-protection-plugin/defaults.js.map +1 -1
- package/dist/esm/import-protection-plugin/plugin.d.ts +1 -1
- package/dist/esm/import-protection-plugin/plugin.js +488 -257
- package/dist/esm/import-protection-plugin/plugin.js.map +1 -1
- package/dist/esm/import-protection-plugin/postCompileUsage.d.ts +4 -2
- package/dist/esm/import-protection-plugin/postCompileUsage.js +31 -150
- package/dist/esm/import-protection-plugin/postCompileUsage.js.map +1 -1
- package/dist/esm/import-protection-plugin/rewriteDeniedImports.js +13 -9
- package/dist/esm/import-protection-plugin/rewriteDeniedImports.js.map +1 -1
- package/dist/esm/import-protection-plugin/sourceLocation.d.ts +32 -66
- package/dist/esm/import-protection-plugin/sourceLocation.js +129 -56
- package/dist/esm/import-protection-plugin/sourceLocation.js.map +1 -1
- package/dist/esm/import-protection-plugin/trace.d.ts +10 -0
- package/dist/esm/import-protection-plugin/trace.js +30 -44
- package/dist/esm/import-protection-plugin/trace.js.map +1 -1
- package/dist/esm/import-protection-plugin/utils.d.ts +8 -4
- package/dist/esm/import-protection-plugin/utils.js +43 -1
- package/dist/esm/import-protection-plugin/utils.js.map +1 -1
- package/dist/esm/import-protection-plugin/virtualModules.d.ts +7 -1
- package/dist/esm/import-protection-plugin/virtualModules.js +104 -135
- package/dist/esm/import-protection-plugin/virtualModules.js.map +1 -1
- package/package.json +8 -8
- package/src/import-protection-plugin/defaults.ts +8 -19
- package/src/import-protection-plugin/plugin.ts +776 -433
- package/src/import-protection-plugin/postCompileUsage.ts +57 -229
- package/src/import-protection-plugin/rewriteDeniedImports.ts +34 -42
- package/src/import-protection-plugin/sourceLocation.ts +184 -185
- package/src/import-protection-plugin/trace.ts +38 -49
- package/src/import-protection-plugin/utils.ts +62 -1
- package/src/import-protection-plugin/virtualModules.ts +163 -177
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { CompileStartFrameworkOptions } from '../types.js';
|
|
2
1
|
import { ImportProtectionEnvRules } from '../schema.js';
|
|
3
2
|
export interface DefaultImportProtectionRules {
|
|
4
3
|
client: Required<ImportProtectionEnvRules>;
|
|
5
4
|
server: Required<ImportProtectionEnvRules>;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
|
-
* Returns the default import protection rules
|
|
7
|
+
* Returns the default import protection rules.
|
|
8
|
+
*
|
|
9
|
+
* All three framework variants are always included so that, e.g., a React
|
|
10
|
+
* project also denies `@tanstack/solid-start/server` imports.
|
|
9
11
|
*/
|
|
10
|
-
export declare function getDefaultImportProtectionRules(
|
|
12
|
+
export declare function getDefaultImportProtectionRules(): DefaultImportProtectionRules;
|
|
11
13
|
/**
|
|
12
14
|
* Marker module specifiers that restrict a file to a specific environment.
|
|
13
15
|
*/
|
|
14
|
-
export declare function getMarkerSpecifiers(
|
|
16
|
+
export declare function getMarkerSpecifiers(): {
|
|
15
17
|
serverOnly: Array<string>;
|
|
16
18
|
clientOnly: Array<string>;
|
|
17
19
|
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"react",
|
|
4
|
-
"solid",
|
|
5
|
-
"vue"
|
|
6
|
-
];
|
|
1
|
+
const frameworks = ["react", "solid", "vue"];
|
|
2
|
+
function getDefaultImportProtectionRules() {
|
|
7
3
|
const clientSpecifiers = frameworks.map(
|
|
8
4
|
(fw) => `@tanstack/${fw}-start/server`
|
|
9
5
|
);
|
|
@@ -18,12 +14,7 @@ function getDefaultImportProtectionRules(_framework) {
|
|
|
18
14
|
}
|
|
19
15
|
};
|
|
20
16
|
}
|
|
21
|
-
function getMarkerSpecifiers(
|
|
22
|
-
const frameworks = [
|
|
23
|
-
"react",
|
|
24
|
-
"solid",
|
|
25
|
-
"vue"
|
|
26
|
-
];
|
|
17
|
+
function getMarkerSpecifiers() {
|
|
27
18
|
return {
|
|
28
19
|
serverOnly: frameworks.map((fw) => `@tanstack/${fw}-start/server-only`),
|
|
29
20
|
clientOnly: frameworks.map((fw) => `@tanstack/${fw}-start/client-only`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sources":["../../../src/import-protection-plugin/defaults.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"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 },\n server: {\n specifiers: [],\n files: ['**/*.client.*'],\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,IAAA;AAAA,IAEzB,QAAQ;AAAA,MACN,YAAY,CAAA;AAAA,MACZ,OAAO,CAAC,eAAe;AAAA,IAAA;AAAA,EACzB;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;"}
|
|
@@ -2,7 +2,7 @@ import { PluginOption } from 'vite';
|
|
|
2
2
|
import { CompileStartFrameworkOptions, GetConfigFn } from '../types.js';
|
|
3
3
|
export { RESOLVED_MOCK_MODULE_ID } from './virtualModules.js';
|
|
4
4
|
export { rewriteDeniedImports } from './rewriteDeniedImports.js';
|
|
5
|
-
export { dedupePatterns } from './utils.js';
|
|
5
|
+
export { dedupePatterns, extractImportSources } from './utils.js';
|
|
6
6
|
export type { Pattern } from './utils.js';
|
|
7
7
|
export interface ImportProtectionPluginOptions {
|
|
8
8
|
getConfig: GetConfigFn;
|