drizzle-kit 0.19.2-9340465 → 0.19.2-b928697

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 CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env -S node --loader @esbuild-kit/esm-loader --no-warnings
1
+ #!/usr/bin/env node --loader @esbuild-kit/esm-loader --loader drizzle-kit/loader.mjs --no-warnings
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -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(`${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(`${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(`${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)) {
@@ -8807,7 +8807,7 @@ var init_sqlgenerator = __esm({
8807
8807
  if (pgNativeTypes.has(it))
8808
8808
  return true;
8809
8809
  const toCheck = it.replace(/ /g, "");
8810
- return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(");
8810
+ return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(") || /^(\w+)(\[\d*])+$/.test(it);
8811
8811
  };
8812
8812
  Convertor = class {
8813
8813
  };
@@ -44811,7 +44811,8 @@ var package_default = {
44811
44811
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
44812
44812
  pack: "build && package",
44813
44813
  tsc: "tsc -p tsconfig.build.json",
44814
- pub: "cp package.json readme.md dist/ && cd dist && npm publish"
44814
+ pub: "cp package.json readme.md dist/ && cd dist && npm publish",
44815
+ "os:test": "./dist/index.cjs generate:pg --config=test/os-tests-config/drizzle.config.ts"
44815
44816
  },
44816
44817
  ava: {
44817
44818
  files: [
@@ -45084,7 +45085,7 @@ var drizzleConfigFromFile = async (configPath) => {
45084
45085
  process.exit(1);
45085
45086
  }
45086
45087
  console.log(source_default.grey(`Reading config file '${path3}'`));
45087
- const required = await import(`${path3}`);
45088
+ const required = await import(`${path3}__drizzle__`);
45088
45089
  const content = required.default ?? required;
45089
45090
  const res = mySqlCliConfigSchema.safeParse(content);
45090
45091
  if (!res.success) {
@@ -45114,7 +45115,7 @@ var readDrizzleConfig = async (configPath) => {
45114
45115
  process.exit(1);
45115
45116
  }
45116
45117
  console.log(source_default.grey(`Reading config file '${path3}'`));
45117
- const required = await import(`${path3}`);
45118
+ const required = await import(`${path3}__drizzle__`);
45118
45119
  const content = required.default ?? required;
45119
45120
  return content;
45120
45121
  };
package/index.d.ts CHANGED
@@ -34,10 +34,7 @@ export type Config = {
34
34
  password?: string;
35
35
  database: string;
36
36
  ssl?: boolean;
37
- };
38
- } | {
39
- driver: "pg";
40
- dbCredentials: {
37
+ } | {
41
38
  connectionString: string;
42
39
  };
43
40
  } | {
@@ -48,11 +45,7 @@ export type Config = {
48
45
  user?: string;
49
46
  password?: string;
50
47
  database: string;
51
- connectionString: string;
52
- };
53
- } | {
54
- driver: "mysql2";
55
- dbCredentials: {
48
+ } | {
56
49
  connectionString: string;
57
50
  };
58
51
  } | {});
package/loader.mjs CHANGED
@@ -4,9 +4,9 @@ import { readFileSync } from "fs";
4
4
 
5
5
  const parse = (it) => {
6
6
  if (!it) return { drizzle: false };
7
-
7
+
8
8
  if (it.endsWith("__drizzle__")) {
9
- const offset = "file://".length;
9
+ const offset = it.startsWith("file://") ? "file://".length : 0;
10
10
  const clean = it.slice(offset, -"__drizzle__".length);
11
11
  return { drizzle: true, clean, original: it };
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.19.2-9340465",
3
+ "version": "0.19.2-b928697",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -37,7 +37,8 @@
37
37
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
38
38
  "pack": "build && package",
39
39
  "tsc": "tsc -p tsconfig.build.json",
40
- "pub": "cp package.json readme.md dist/ && cd dist && npm publish"
40
+ "pub": "cp package.json readme.md dist/ && cd dist && npm publish",
41
+ "os:test": "./dist/index.cjs generate:pg --config=test/os-tests-config/drizzle.config.ts"
41
42
  },
42
43
  "ava": {
43
44
  "files": [
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 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;
@@ -13583,7 +13583,7 @@ var isPgNativeType = (it) => {
13583
13583
  if (pgNativeTypes.has(it))
13584
13584
  return true;
13585
13585
  const toCheck = it.replace(/ /g, "");
13586
- return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(");
13586
+ return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(") || /^(\w+)(\[\d*])+$/.test(it);
13587
13587
  };
13588
13588
  var Convertor = class {
13589
13589
  };