drizzle-kit 0.18.1-dde2856 → 0.18.1-f3800bf
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 +16287 -5291
- package/loader.mjs +47 -0
- package/package.json +2 -2
- package/utils.js +6 -6
- package/bin.js +0 -24405
- package/index.mjs +0 -36323
package/loader.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import esbuild from "esbuild";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
|
|
5
|
+
export function resolve(specifier, context, nextResolve) {
|
|
6
|
+
if (specifier.startsWith("drizzle://")) {
|
|
7
|
+
if (!specifier.endsWith(".ts")) {
|
|
8
|
+
const url = specifier.slice("drizzle://".length).toString();
|
|
9
|
+
return nextResolve(url);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
shortCircuit: true,
|
|
14
|
+
url: specifier,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { parentURL: url } = context;
|
|
19
|
+
const parentURL = url?.startsWith("drizzle://")
|
|
20
|
+
? new URL(`file://${path.resolve(url.slice("drizzle://".length))}`)
|
|
21
|
+
: url;
|
|
22
|
+
|
|
23
|
+
// Let Node.js handle all other specifiers.
|
|
24
|
+
return nextResolve(specifier, { ...context, parentURL });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function load(url, context, defaultLoad) {
|
|
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")) {
|
|
33
|
+
const source = esbuild.transformSync(file, {
|
|
34
|
+
loader: "ts",
|
|
35
|
+
format: "esm",
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
format: "module",
|
|
39
|
+
shortCircuit: true,
|
|
40
|
+
source: source.code,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// let Node.js handle all other URLs
|
|
46
|
+
return defaultLoad(url, context, defaultLoad);
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-kit",
|
|
3
|
-
"version": "0.18.1-
|
|
3
|
+
"version": "0.18.1-f3800bf",
|
|
4
4
|
"repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
|
|
5
5
|
"author": "Drizzle Team",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
8
|
-
"drizzle-kit": "./
|
|
8
|
+
"drizzle-kit": "./index.cjs"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"migrate:old": "drizzle-kit generate:pg --out ./dev/migrations-pg --schema ./dev/migrations-pg/schema.ts",
|
package/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env -S node --loader @esbuild-kit/esm-loader --no-warnings
|
|
1
|
+
#!/usr/bin/env -S node --loader @esbuild-kit/esm-loader --no-warnings
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -9077,15 +9077,15 @@ var require_glob = __commonJS({
|
|
|
9077
9077
|
return this;
|
|
9078
9078
|
if (n === 0)
|
|
9079
9079
|
return done();
|
|
9080
|
-
var
|
|
9080
|
+
var sync2 = true;
|
|
9081
9081
|
for (var i = 0; i < n; i++) {
|
|
9082
9082
|
this._process(this.minimatch.set[i], i, false, done);
|
|
9083
9083
|
}
|
|
9084
|
-
|
|
9084
|
+
sync2 = false;
|
|
9085
9085
|
function done() {
|
|
9086
9086
|
--self2._processing;
|
|
9087
9087
|
if (self2._processing <= 0) {
|
|
9088
|
-
if (
|
|
9088
|
+
if (sync2) {
|
|
9089
9089
|
process.nextTick(function() {
|
|
9090
9090
|
self2._finish();
|
|
9091
9091
|
});
|
|
@@ -9537,10 +9537,10 @@ var require_glob = __commonJS({
|
|
|
9537
9537
|
});
|
|
9538
9538
|
|
|
9539
9539
|
// src/serializer/index.ts
|
|
9540
|
-
var
|
|
9540
|
+
var glob;
|
|
9541
9541
|
var init_serializer = __esm({
|
|
9542
9542
|
"src/serializer/index.ts"() {
|
|
9543
|
-
|
|
9543
|
+
glob = __toESM(require_glob());
|
|
9544
9544
|
init_source();
|
|
9545
9545
|
}
|
|
9546
9546
|
});
|