@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 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.startsWith(modelsDir)) return;
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 '../../../../../db/src';
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('../../../../../db/src').ModelsClient<import('../../../../../db/src/registerModels').ModelModules, Record<string, never>>;
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 as zz } from '../../../../../db/src';
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>;
@@ -1,4 +1,4 @@
1
- import { z, mongoose } from '../../../../../db/src';
1
+ import { z, mongoose } from '@rpcbase/db';
2
2
  export declare const ZUser: z.ZodObject<{
3
3
  email: z.ZodString;
4
4
  }, z.core.$strip>;
@@ -1,4 +1,4 @@
1
- import { z } from '../../../../../db/src';
1
+ import { z } from '@rpcbase/db';
2
2
  export declare const ZUser: z.ZodObject<{
3
3
  email: z.ZodString;
4
4
  }, z.core.$strip>;
@@ -1,4 +1,4 @@
1
- import { z } from '../../../../../db/src';
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('../../../../node_modules/mongoose').Schema<any, import('../../../../node_modules/mongoose').Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
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('../../../../node_modules/mongoose').DefaultTimestampProps, import('../../../../node_modules/mongoose').Document<unknown, {}, {
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('../../../../node_modules/mongoose').DefaultTimestampProps, {
93
+ } & import('mongoose').DefaultTimestampProps, {
94
94
  id: string;
95
- }, import('../../../../node_modules/mongoose').ResolveSchemaOptions<{
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('../../../../node_modules/mongoose').DefaultTimestampProps & Required<{
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('../../../../node_modules/mongoose').SchemaDefinitionProperty<undefined, any, any>;
134
+ [path: string]: import('mongoose').SchemaDefinitionProperty<undefined, any, any>;
135
135
  } | {
136
- [x: string]: import('../../../../node_modules/mongoose').SchemaDefinitionProperty<any, any, import('../../../../node_modules/mongoose').Document<unknown, {}, {
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('../../../../node_modules/mongoose').DefaultTimestampProps, {
165
+ } & import('mongoose').DefaultTimestampProps, {
166
166
  id: string;
167
- }, import('../../../../node_modules/mongoose').ResolveSchemaOptions<{
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('../../../../node_modules/mongoose').DefaultTimestampProps & Required<{
199
+ } & import('mongoose').DefaultTimestampProps & Required<{
200
200
  _id: string;
201
201
  }> & {
202
202
  __v: number;
@@ -1,4 +1,4 @@
1
- import { z } from '../../../../../db/src';
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;
@@ -1,4 +1,4 @@
1
- import { z } from '../../../../../db/src';
1
+ import { z } from '@rpcbase/db';
2
2
  export declare const ZPost: z.ZodObject<{
3
3
  title: z.ZodString;
4
4
  }, z.core.$strip>;
@@ -1,4 +1,4 @@
1
- import { z } from '../../../../../db/src';
1
+ import { z } from '@rpcbase/db';
2
2
  export declare const ZPost: z.ZodObject<{
3
3
  title: z.ZodString;
4
4
  }, z.core.$strip>;
@@ -1,5 +1,5 @@
1
- import { z } from '../../../../../db/src';
1
+ import { z } from '@rpcbase/db';
2
2
  export declare const ZA: z.ZodString;
3
- declare const local: import('../../../../../db/src').ModelsClient<import('../../../../../db/src/registerModels').ModelModules, Record<string, never>>;
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,3 +1,3 @@
1
- import { z } from '../../../../../db/src';
1
+ import { z } from '@rpcbase/db';
2
2
  export declare const ZA: z.ZodString;
3
3
  //# sourceMappingURL=export-specifiers.output.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;AAalC,wBAAgB,0BAA0B,IAAI,MAAM,CAkBnD"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/vite",
3
- "version": "0.115.0",
3
+ "version": "0.117.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"