drizzle-kit 0.19.2-144c09c → 0.19.2-e313bce

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.
Files changed (3) hide show
  1. package/index.cjs +5 -5
  2. package/loader.mjs +7 -4
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -5532,7 +5532,7 @@ var init_mysqlImports = __esm({
5532
5532
  const schemas = [];
5533
5533
  for (let i = 0; i < imports.length; i++) {
5534
5534
  const it = imports[i];
5535
- const i0 = await import(`__drizzle__${it}`);
5535
+ const i0 = await import(`${it}__drizzle__`);
5536
5536
  const i0values = Object.values(i0);
5537
5537
  i0values.forEach((t) => {
5538
5538
  if ((0, import_drizzle_orm.is)(t, import_mysql_core.MySqlTable)) {
@@ -5943,7 +5943,7 @@ var init_pgImports = __esm({
5943
5943
  const schemas = [];
5944
5944
  for (let i = 0; i < imports.length; i++) {
5945
5945
  const it = imports[i];
5946
- const i0 = await import(`__drizzle__${it}`);
5946
+ const i0 = await import(`${it}__drizzle__`);
5947
5947
  const i0values = Object.values(i0);
5948
5948
  i0values.forEach((t) => {
5949
5949
  if ((0, import_pg_core.isPgEnum)(t)) {
@@ -6473,7 +6473,7 @@ var init_sqliteImports = __esm({
6473
6473
  const enums = [];
6474
6474
  for (let i = 0; i < imports.length; i++) {
6475
6475
  const it = imports[i];
6476
- const i0 = await import(`__drizzle__${it}`);
6476
+ const i0 = await import(`${it}__drizzle__`);
6477
6477
  const i0values = Object.values(i0);
6478
6478
  i0values.forEach((t) => {
6479
6479
  if ((0, import_drizzle_orm7.is)(t, import_sqlite_core.SQLiteTable)) {
@@ -45083,7 +45083,7 @@ var drizzleConfigFromFile = async (configPath) => {
45083
45083
  process.exit(1);
45084
45084
  }
45085
45085
  console.log(source_default.grey(`Reading config file '${path3}'`));
45086
- const required = await import(`__drizzle__${path3}`);
45086
+ const required = await import(`${path3}__drizzle__`);
45087
45087
  const content = required.default ?? required;
45088
45088
  const res = mySqlCliConfigSchema.safeParse(content);
45089
45089
  if (!res.success) {
@@ -45113,7 +45113,7 @@ var readDrizzleConfig = async (configPath) => {
45113
45113
  process.exit(1);
45114
45114
  }
45115
45115
  console.log(source_default.grey(`Reading config file '${path3}'`));
45116
- const required = await import(`__drizzle__${path3}`);
45116
+ const required = await import(`${path3}__drizzle__`);
45117
45117
  const content = required.default ?? required;
45118
45118
  return content;
45119
45119
  };
package/loader.mjs CHANGED
@@ -3,8 +3,11 @@ import * as path from "path";
3
3
  import { readFileSync } from "fs";
4
4
 
5
5
  const parse = (it) => {
6
+ if (!it) return { drizzle: false };
7
+
6
8
  if (it.endsWith("__drizzle__")) {
7
- const clean = it.slice(-"__drizzle__".length);
9
+ const offset = "file://".length;
10
+ const clean = it.slice(offset, -"__drizzle__".length);
8
11
  return { drizzle: true, clean, original: it };
9
12
  }
10
13
  return { drizzle: false, clean: it };
@@ -12,14 +15,14 @@ const parse = (it) => {
12
15
 
13
16
  export function resolve(specifier, context, nextResolve) {
14
17
  const { drizzle, clean } = parse(specifier);
15
- if (drizzle && !specifier.endsWith(".ts") && !specifier.endsWith(".mts")) {
18
+ if (drizzle && !clean.endsWith(".ts") && !clean.endsWith(".mts")) {
16
19
  return nextResolve(clean);
17
20
  }
18
21
 
19
22
  if (drizzle) {
20
23
  return {
21
24
  shortCircuit: true,
22
- url: specifier,
25
+ url: `file://${specifier}`,
23
26
  };
24
27
  }
25
28
 
@@ -36,7 +39,7 @@ export async function load(url, context, defaultLoad) {
36
39
  const { drizzle, clean } = parse(url);
37
40
  if (drizzle) {
38
41
  const file = readFileSync(clean, "utf-8");
39
- if (path.endsWith(".ts") || path.endsWith(".mts")) {
42
+ if (clean.endsWith(".ts") || clean.endsWith(".mts")) {
40
43
  const source = esbuild.transformSync(file, {
41
44
  loader: "ts",
42
45
  format: "esm",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.19.2-144c09c",
3
+ "version": "0.19.2-e313bce",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",