@rpcbase/vite 0.115.0 → 0.117.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/index.js +11 -2
- package/dist/plugins/prune-models-for-client/fixtures/alias-and-types.input.d.ts +2 -2
- package/dist/plugins/prune-models-for-client/fixtures/alias-and-types.output.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/fixtures/chained-bindings.input.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/fixtures/chained-bindings.output.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/fixtures/contact-model.input.d.ts +11 -11
- package/dist/plugins/prune-models-for-client/fixtures/contact-model.output.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/fixtures/destructuring-bindings.input.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/fixtures/destructuring-bindings.output.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/fixtures/export-specifiers.input.d.ts +2 -2
- package/dist/plugins/prune-models-for-client/fixtures/export-specifiers.output.d.ts +1 -1
- package/dist/plugins/prune-models-for-client/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -300,8 +300,17 @@ function inferIsSsrTransform(transformOptions) {
|
|
|
300
300
|
if (!transformOptions || typeof transformOptions !== "object") return false;
|
|
301
301
|
return transformOptions.ssr === true;
|
|
302
302
|
}
|
|
303
|
+
function isPrunableModelsFilePath(filePath) {
|
|
304
|
+
const normalized = filePath.replaceAll("\\", "/");
|
|
305
|
+
const parts = normalized.split("/");
|
|
306
|
+
if (parts.includes("node_modules")) return false;
|
|
307
|
+
if (parts.length < 2) return false;
|
|
308
|
+
if (!parts.some((part, index) => part === "models" && index < parts.length - 1)) return false;
|
|
309
|
+
if (normalized.endsWith(".d.ts")) return false;
|
|
310
|
+
const ext = path$1.posix.extname(normalized);
|
|
311
|
+
return ext === ".ts" || ext === ".tsx" || ext === ".mts" || ext === ".cts";
|
|
312
|
+
}
|
|
303
313
|
function pruneModelsForClientPlugin() {
|
|
304
|
-
const modelsDir = `${path$1.resolve(process.cwd(), "src/models")}${path$1.sep}`;
|
|
305
314
|
const prune = createTransformSource();
|
|
306
315
|
return {
|
|
307
316
|
name: "lz-models-prune-for-browser",
|
|
@@ -309,7 +318,7 @@ function pruneModelsForClientPlugin() {
|
|
|
309
318
|
transform(code, id, transformOptions) {
|
|
310
319
|
if (inferIsSsrTransform(transformOptions)) return;
|
|
311
320
|
const filePath = id.split("?", 1)[0] ?? id;
|
|
312
|
-
if (!filePath
|
|
321
|
+
if (!isPrunableModelsFilePath(filePath)) return;
|
|
313
322
|
const nextCode = prune({ code, filePath });
|
|
314
323
|
if (!nextCode) return;
|
|
315
324
|
return { code: nextCode };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { z as zz } from '
|
|
1
|
+
import { z as zz } from '@rpcbase/db';
|
|
2
2
|
export declare const ZThing: zz.ZodObject<{
|
|
3
3
|
value: zz.ZodNumber;
|
|
4
4
|
}, zz.core.$strip>;
|
|
5
5
|
type Thing = DbSchema;
|
|
6
6
|
export declare const x: Thing;
|
|
7
|
-
export declare const leaked: import('
|
|
7
|
+
export declare const leaked: import('@rpcbase/db').ModelsClient<import('../../../../../db/src/registerModels').ModelModules, Record<string, never>>;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=alias-and-types.input.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from '
|
|
1
|
+
import { z } from '@rpcbase/db';
|
|
2
2
|
export declare const contactIdSchema: z.ZodString;
|
|
3
3
|
export declare const contactEmailSchema: z.ZodObject<{
|
|
4
4
|
value: z.ZodString;
|
|
@@ -29,7 +29,7 @@ export declare const ZContact: z.ZodObject<{
|
|
|
29
29
|
updatedAt: z.ZodString;
|
|
30
30
|
}, z.core.$strip>;
|
|
31
31
|
export type IContact = z.infer<typeof ZContact>;
|
|
32
|
-
export declare const ContactSchema: import('
|
|
32
|
+
export declare const ContactSchema: import('mongoose').Schema<any, import('mongoose').Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
33
33
|
collection: string;
|
|
34
34
|
timestamps: true;
|
|
35
35
|
}, {
|
|
@@ -61,7 +61,7 @@ export declare const ContactSchema: import('../../../../node_modules/mongoose').
|
|
|
61
61
|
address?: string | null | undefined;
|
|
62
62
|
notes?: string | null | undefined;
|
|
63
63
|
avatarUrl?: string | null | undefined;
|
|
64
|
-
} & import('
|
|
64
|
+
} & import('mongoose').DefaultTimestampProps, import('mongoose').Document<unknown, {}, {
|
|
65
65
|
_id: string;
|
|
66
66
|
displayName: string;
|
|
67
67
|
workspaceId: string;
|
|
@@ -90,9 +90,9 @@ export declare const ContactSchema: import('../../../../node_modules/mongoose').
|
|
|
90
90
|
address?: string | null | undefined;
|
|
91
91
|
notes?: string | null | undefined;
|
|
92
92
|
avatarUrl?: string | null | undefined;
|
|
93
|
-
} & import('
|
|
93
|
+
} & import('mongoose').DefaultTimestampProps, {
|
|
94
94
|
id: string;
|
|
95
|
-
}, import('
|
|
95
|
+
}, import('mongoose').ResolveSchemaOptions<{
|
|
96
96
|
collection: string;
|
|
97
97
|
timestamps: true;
|
|
98
98
|
}>> & Omit<{
|
|
@@ -124,16 +124,16 @@ export declare const ContactSchema: import('../../../../node_modules/mongoose').
|
|
|
124
124
|
address?: string | null | undefined;
|
|
125
125
|
notes?: string | null | undefined;
|
|
126
126
|
avatarUrl?: string | null | undefined;
|
|
127
|
-
} & import('
|
|
127
|
+
} & import('mongoose').DefaultTimestampProps & Required<{
|
|
128
128
|
_id: string;
|
|
129
129
|
}> & {
|
|
130
130
|
__v: number;
|
|
131
131
|
}, "id"> & {
|
|
132
132
|
id: string;
|
|
133
133
|
}, {
|
|
134
|
-
[path: string]: import('
|
|
134
|
+
[path: string]: import('mongoose').SchemaDefinitionProperty<undefined, any, any>;
|
|
135
135
|
} | {
|
|
136
|
-
[x: string]: import('
|
|
136
|
+
[x: string]: import('mongoose').SchemaDefinitionProperty<any, any, import('mongoose').Document<unknown, {}, {
|
|
137
137
|
_id: string;
|
|
138
138
|
displayName: string;
|
|
139
139
|
workspaceId: string;
|
|
@@ -162,9 +162,9 @@ export declare const ContactSchema: import('../../../../node_modules/mongoose').
|
|
|
162
162
|
address?: string | null | undefined;
|
|
163
163
|
notes?: string | null | undefined;
|
|
164
164
|
avatarUrl?: string | null | undefined;
|
|
165
|
-
} & import('
|
|
165
|
+
} & import('mongoose').DefaultTimestampProps, {
|
|
166
166
|
id: string;
|
|
167
|
-
}, import('
|
|
167
|
+
}, import('mongoose').ResolveSchemaOptions<{
|
|
168
168
|
collection: string;
|
|
169
169
|
timestamps: true;
|
|
170
170
|
}>> & Omit<{
|
|
@@ -196,7 +196,7 @@ export declare const ContactSchema: import('../../../../node_modules/mongoose').
|
|
|
196
196
|
address?: string | null | undefined;
|
|
197
197
|
notes?: string | null | undefined;
|
|
198
198
|
avatarUrl?: string | null | undefined;
|
|
199
|
-
} & import('
|
|
199
|
+
} & import('mongoose').DefaultTimestampProps & Required<{
|
|
200
200
|
_id: string;
|
|
201
201
|
}> & {
|
|
202
202
|
__v: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from '
|
|
1
|
+
import { z } from '@rpcbase/db';
|
|
2
2
|
export declare const ZA: z.ZodString;
|
|
3
|
-
declare const local: import('
|
|
3
|
+
declare const local: import('@rpcbase/db').ModelsClient<import('../../../../../db/src/registerModels').ModelModules, Record<string, never>>;
|
|
4
4
|
export { local as exported };
|
|
5
5
|
//# sourceMappingURL=export-specifiers.input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/prune-models-for-client/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/prune-models-for-client/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA2BlC,wBAAgB,0BAA0B,IAAI,MAAM,CAiBnD"}
|