drizzle-kit 0.19.2-9340465 → 0.19.2-b5df8a6
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/index.cjs +6223 -611
- package/loader.mjs +15 -25
- package/package.json +3 -4
- package/utils.js +10813 -10799
package/loader.mjs
CHANGED
|
@@ -2,44 +2,34 @@ import esbuild from "esbuild";
|
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
4
|
|
|
5
|
-
const parse = (it) => {
|
|
6
|
-
if (!it) return { drizzle: false };
|
|
7
|
-
|
|
8
|
-
if (it.endsWith("__drizzle__")) {
|
|
9
|
-
const offset = "file://".length;
|
|
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
5
|
export function resolve(specifier, context, nextResolve) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
if (specifier.startsWith("__drizzle__")) {
|
|
7
|
+
if (!specifier.endsWith(".ts")) {
|
|
8
|
+
const url = specifier.slice("__drizzle__".length).toString();
|
|
9
|
+
return nextResolve(url);
|
|
10
|
+
}
|
|
21
11
|
|
|
22
|
-
if (drizzle) {
|
|
23
12
|
return {
|
|
24
13
|
shortCircuit: true,
|
|
25
|
-
url:
|
|
14
|
+
url: specifier,
|
|
26
15
|
};
|
|
27
16
|
}
|
|
28
17
|
|
|
29
|
-
const
|
|
30
|
-
const parentURL =
|
|
31
|
-
? new URL(`file://${path.resolve(
|
|
32
|
-
:
|
|
18
|
+
const { parentURL: url } = context;
|
|
19
|
+
const parentURL = url?.startsWith("__drizzle__")
|
|
20
|
+
? new URL(`file://${path.resolve(url.slice("__drizzle__".length))}`)
|
|
21
|
+
: url;
|
|
33
22
|
|
|
34
23
|
// Let Node.js handle all other specifiers.
|
|
35
24
|
return nextResolve(specifier, { ...context, parentURL });
|
|
36
25
|
}
|
|
37
26
|
|
|
38
27
|
export async function load(url, context, defaultLoad) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
28
|
+
if (url.startsWith("__drizzle__")) {
|
|
29
|
+
|
|
30
|
+
const path = url.slice("__drizzle__".length).trim();
|
|
31
|
+
const file = readFileSync(path, "utf-8");
|
|
32
|
+
if (path.endsWith(".ts") || path.endsWith(".mts")) {
|
|
43
33
|
const source = esbuild.transformSync(file, {
|
|
44
34
|
loader: "ts",
|
|
45
35
|
format: "esm",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-kit",
|
|
3
|
-
"version": "0.19.2-
|
|
3
|
+
"version": "0.19.2-b5df8a6",
|
|
4
4
|
"repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
|
|
5
5
|
"author": "Drizzle Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"camelcase": "^7.0.1",
|
|
56
56
|
"chalk": "^5.2.0",
|
|
57
57
|
"commander": "^9.4.1",
|
|
58
|
+
"esbuild": "^0.18.6",
|
|
59
|
+
"esbuild-register": "^3.4.2",
|
|
58
60
|
"glob": "^8.1.0",
|
|
59
61
|
"hanji": "^0.0.5",
|
|
60
62
|
"json-diff": "0.9.0",
|
|
@@ -75,10 +77,7 @@
|
|
|
75
77
|
"better-sqlite3": "^8.4.0",
|
|
76
78
|
"dockerode": "^3.3.4",
|
|
77
79
|
"dotenv": "^16.0.3",
|
|
78
|
-
"drizzle-kit": "0.19.2-e313bce",
|
|
79
80
|
"drizzle-orm": "0.27.0-56b9edc",
|
|
80
|
-
"esbuild": "^0.17.19",
|
|
81
|
-
"esbuild-register": "^3.4.2",
|
|
82
81
|
"eslint": "^8.29.0",
|
|
83
82
|
"eslint-config-prettier": "^8.5.0",
|
|
84
83
|
"eslint-plugin-prettier": "^4.2.1",
|