drizzle-kit 0.20.0-c31f6ba → 0.20.0-ca89eb7
Sign up to get free protection for your applications and to get access to all the features.
- package/cli/commands/pgConnect.d.ts +5 -0
- package/cli/commands/pgIntrospect.d.ts +3 -5
- package/cli/commands/sqliteIntrospect.d.ts +3 -3
- package/cli/commands/utils.d.ts +2 -2
- package/cli/utils.d.ts +11 -0
- package/cli/validations/mysql.d.ts +77 -126
- package/cli/validations/studio.d.ts +118 -73
- package/cli/views.d.ts +2 -2
- package/drivers/index.d.ts +3 -3
- package/global.d.ts +1 -0
- package/index.cjs +6589 -6247
- package/index.d.ts +2 -2
- package/orm-extenstions/d1-driver/session.d.ts +2 -3
- package/package.json +7 -6
- package/serializer/index.d.ts +4 -4
- package/serializer/pgSerializer.d.ts +4 -4
- package/serializer/sqliteSerializer.d.ts +3 -3
- package/serializer/studioUtils.d.ts +19 -1
- package/sqlite-introspect.d.ts +2 -2
- package/utils-studio.d.ts +5 -0
- package/utils-studio.js +3367 -0
- package/utils.d.ts +2 -22
- package/utils.js +6895 -6023
- package/loader.mjs +0 -57
package/loader.mjs
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
import esbuild from "esbuild";
|
2
|
-
import * as path from "path";
|
3
|
-
import { readFileSync } from "fs";
|
4
|
-
|
5
|
-
const parse = (it) => {
|
6
|
-
if (!it) return { drizzle: false };
|
7
|
-
|
8
|
-
if (it.endsWith("__drizzle__")) {
|
9
|
-
const offset = it.startsWith("file://") ? "file://".length : 0;
|
10
|
-
const clean = it.slice(offset, -"__drizzle__".length);
|
11
|
-
return { drizzle: true, clean, original: it };
|
12
|
-
}
|
13
|
-
return { drizzle: false, clean: it };
|
14
|
-
};
|
15
|
-
|
16
|
-
export function resolve(specifier, context, nextResolve) {
|
17
|
-
const { drizzle, clean } = parse(specifier);
|
18
|
-
if (drizzle && !clean.endsWith(".ts") && !clean.endsWith(".mts")) {
|
19
|
-
return nextResolve(clean);
|
20
|
-
}
|
21
|
-
|
22
|
-
if (drizzle) {
|
23
|
-
return {
|
24
|
-
shortCircuit: true,
|
25
|
-
url: `file://${specifier}`,
|
26
|
-
};
|
27
|
-
}
|
28
|
-
|
29
|
-
const parsedParent = parse(context.parentURL);
|
30
|
-
const parentURL = parsedParent.drizzle
|
31
|
-
? new URL(`file://${path.resolve(parsedParent.clean)}`)
|
32
|
-
: context.parentURL;
|
33
|
-
|
34
|
-
// Let Node.js handle all other specifiers.
|
35
|
-
return nextResolve(specifier, { ...context, parentURL });
|
36
|
-
}
|
37
|
-
|
38
|
-
export async function load(url, context, defaultLoad) {
|
39
|
-
const { drizzle, clean } = parse(url);
|
40
|
-
if (drizzle) {
|
41
|
-
const file = readFileSync(clean, "utf-8");
|
42
|
-
if (clean.endsWith(".ts") || clean.endsWith(".mts")) {
|
43
|
-
const source = esbuild.transformSync(file, {
|
44
|
-
loader: "ts",
|
45
|
-
format: "esm",
|
46
|
-
});
|
47
|
-
return {
|
48
|
-
format: "module",
|
49
|
-
shortCircuit: true,
|
50
|
-
source: source.code,
|
51
|
-
};
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
// let Node.js handle all other URLs
|
56
|
-
return defaultLoad(url, context, defaultLoad);
|
57
|
-
}
|