-
-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move kit as oss and part of orm repo
- Loading branch information
1 parent
15ff6b4
commit 4beb53c
Showing
115 changed files
with
49,242 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ jobs: | |
matrix: | ||
package: | ||
- drizzle-orm | ||
- drizzle-kit | ||
- drizzle-zod | ||
- drizzle-typebox | ||
- drizzle-valibot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
**/.DS_Store | ||
|
||
!src | ||
!tests | ||
!vitest.config.ts | ||
!README.md | ||
!CONTRIBUTING.md | ||
!schema.ts | ||
|
||
!.eslint | ||
!.gitignore | ||
!package.json | ||
!tsconfig.json | ||
!tsconfig.cli-types.json | ||
!pnpm-lock.yaml | ||
!.github | ||
!build.ts | ||
!build.dev.ts | ||
|
||
tests/test.ts | ||
|
||
!patches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Contributing | ||
|
||
Welcome to the Drizzle Kit Contribution Guide! | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as esbuild from "esbuild"; | ||
import { cpSync } from "node:fs"; | ||
|
||
esbuild.buildSync({ | ||
entryPoints: ["./src/utils.ts"], | ||
bundle: true, | ||
outfile: "dist/utils.js", | ||
format: "cjs", | ||
target: "node16", | ||
platform: "node", | ||
external: ["drizzle-orm", "pg-native", "esbuild"], | ||
banner: { | ||
js: `#!/usr/bin/env -S node --loader @esbuild-kit/esm-loader --no-warnings`, | ||
}, | ||
}); | ||
|
||
esbuild.buildSync({ | ||
entryPoints: ["./src/cli/index.ts"], | ||
bundle: true, | ||
outfile: "dist/index.cjs", | ||
format: "cjs", | ||
target: "node16", | ||
platform: "node", | ||
external: [ | ||
"commander", | ||
"json-diff", | ||
"glob", | ||
"esbuild", | ||
"drizzle-orm", | ||
"pg-native", | ||
"better-sqlite3" | ||
], | ||
banner: { | ||
js: `#!/usr/bin/env -S node --loader ./dist/loader.mjs --no-warnings`, | ||
}, | ||
}); | ||
|
||
cpSync("./src/loader.mjs", "dist/loader.mjs"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import * as esbuild from 'esbuild'; | ||
import { readFileSync, writeFileSync } from 'node:fs'; | ||
import * as tsup from 'tsup'; | ||
import pkg from './package.json'; | ||
|
||
esbuild.buildSync({ | ||
entryPoints: ['./src/utils.ts'], | ||
bundle: true, | ||
outfile: 'dist/utils.js', | ||
format: 'cjs', | ||
target: 'node16', | ||
platform: 'node', | ||
external: [ | ||
'@libsql/client', | ||
'commander', | ||
'json-diff', | ||
'glob', | ||
'esbuild', | ||
'drizzle-orm', | ||
'pg-native', | ||
'better-sqlite3', | ||
], | ||
banner: { | ||
js: `#!/usr/bin/env node`, | ||
}, | ||
}); | ||
|
||
esbuild.buildSync({ | ||
entryPoints: ['./src/utils.ts'], | ||
bundle: true, | ||
outfile: 'dist/utils.mjs', | ||
format: 'esm', | ||
target: 'node16', | ||
platform: 'node', | ||
external: [ | ||
'@libsql/client', | ||
'commander', | ||
'json-diff', | ||
'glob', | ||
'esbuild', | ||
'drizzle-orm', | ||
'pg-native', | ||
'better-sqlite3', | ||
], | ||
banner: { | ||
js: `#!/usr/bin/env node`, | ||
}, | ||
}); | ||
|
||
esbuild.buildSync({ | ||
entryPoints: ['./src/cli/index.ts'], | ||
bundle: true, | ||
outfile: 'dist/bin.cjs', | ||
format: 'cjs', | ||
target: 'node16', | ||
platform: 'node', | ||
define: { | ||
'process.env.DRIZZLE_KIT_VERSION': `"${pkg.version}"`, | ||
}, | ||
external: [ | ||
'@libsql/client', | ||
'esbuild', | ||
'drizzle-orm', | ||
'pg-native', | ||
'better-sqlite3', | ||
], | ||
banner: { | ||
js: `#!/usr/bin/env node`, | ||
}, | ||
}); | ||
|
||
const main = async () => { | ||
await tsup.build({ | ||
entryPoints: ['./src/index.ts', './src/api.ts'], | ||
outDir: './dist', | ||
splitting: false, | ||
dts: true, | ||
format: ['cjs', 'esm'], | ||
outExtension: (ctx) => { | ||
if (ctx.format === 'cjs') { | ||
return { | ||
dts: '.d.ts', | ||
js: '.js', | ||
}; | ||
} | ||
return { | ||
dts: '.d.mts', | ||
js: '.mjs', | ||
}; | ||
}, | ||
}); | ||
|
||
const apiCjs = readFileSync('./dist/api.js', 'utf8').replace(/await import\(/g, 'require('); | ||
writeFileSync('./dist/api.js', apiCjs); | ||
}; | ||
|
||
main().catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"name": "drizzle-kit", | ||
"version": "0.23.0", | ||
"repository": "https://github.com/drizzle-team/drizzle-kit-mirror", | ||
"author": "Drizzle Team", | ||
"license": "MIT", | ||
"bin": { | ||
"drizzle-kit": "./bin.cjs" | ||
}, | ||
"scripts": { | ||
"api": "tsx ./dev/api.ts", | ||
"migrate:old": "drizzle-kit generate:mysql", | ||
"cli": "tsx ./src/cli/index.ts", | ||
"test": "TEST_CONFIG_PATH_PREFIX=./tests/cli/ vitest", | ||
"build": "rm -rf ./dist && tsx build.ts && cp package.json dist/ && attw --pack dist", | ||
"build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs", | ||
"packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack", | ||
"tsc": "tsc -p tsconfig.build.json", | ||
"pub": "cp package.json readme.md dist/ && cd dist && npm publish" | ||
}, | ||
"dependencies": { | ||
"@drizzle-team/brocli": "^0.8.2", | ||
"@esbuild-kit/esm-loader": "^2.5.5", | ||
"esbuild": "^0.19.7", | ||
"esbuild-register": "^3.5.0" | ||
}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.15.3", | ||
"@aws-sdk/client-rds-data": "^3.556.0", | ||
"@cloudflare/workers-types": "^4.20230518.0", | ||
"@electric-sql/pglite": "^0.1.5", | ||
"@hono/node-server": "^1.9.0", | ||
"@hono/zod-validator": "^0.2.1", | ||
"@libsql/client": "^0.4.2", | ||
"@neondatabase/serverless": "^0.9.1", | ||
"@originjs/vite-plugin-commonjs": "^1.0.3", | ||
"@planetscale/database": "^1.16.0", | ||
"@types/better-sqlite3": "^7.6.4", | ||
"@types/dockerode": "^3.3.28", | ||
"@types/glob": "^8.1.0", | ||
"@types/json-diff": "^1.0.3", | ||
"@types/minimatch": "^5.1.2", | ||
"@types/node": "^18.11.15", | ||
"@types/pg": "^8.10.7", | ||
"@types/pluralize": "^0.0.33", | ||
"@types/semver": "^7.5.5", | ||
"@types/uuid": "^9.0.8", | ||
"@types/ws": "^8.5.10", | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0", | ||
"@vercel/postgres": "^0.8.0", | ||
"ava": "^5.1.0", | ||
"better-sqlite3": "^9.4.3", | ||
"camelcase": "^7.0.1", | ||
"chalk": "^5.2.0", | ||
"commander": "^12.1.0", | ||
"dockerode": "^3.3.4", | ||
"dotenv": "^16.0.3", | ||
"drizzle-kit": "0.22.8", | ||
"drizzle-orm": "0.32.0-85c8008", | ||
"env-paths": "^3.0.0", | ||
"esbuild-node-externals": "^1.9.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"get-port": "^6.1.2", | ||
"glob": "^8.1.0", | ||
"hanji": "^0.0.5", | ||
"hono": "^4.1.5", | ||
"json-diff": "1.0.6", | ||
"minimatch": "^7.4.3", | ||
"mysql2": "2.3.3", | ||
"node-fetch": "^3.3.2", | ||
"pg": "^8.11.5", | ||
"pluralize": "^8.0.0", | ||
"postgres": "^3.4.4", | ||
"prettier": "^2.8.1", | ||
"semver": "^7.5.4", | ||
"superjson": "^2.2.1", | ||
"tsup": "^8.0.2", | ||
"tsx": "^3.12.1", | ||
"typescript": "^5.4.3", | ||
"uuid": "^9.0.1", | ||
"vite-tsconfig-paths": "^4.3.2", | ||
"vitest": "^1.4.0", | ||
"wrangler": "^3.22.1", | ||
"ws": "^8.16.0", | ||
"zod": "^3.20.2", | ||
"zx": "^7.2.2" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./index.d.mts", | ||
"default": "./index.mjs" | ||
}, | ||
"require": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"types": "./index.d.mts", | ||
"default": "./index.mjs" | ||
}, | ||
"./api": { | ||
"import": { | ||
"types": "./api.d.mts", | ||
"default": "./api.mjs" | ||
}, | ||
"require": { | ||
"types": "./api.d.ts", | ||
"default": "./api.js" | ||
}, | ||
"types": "./api.d.mts", | ||
"default": "./api.mjs" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/lib/difflib.js b/lib/difflib.js | ||
index 80d250e7e18bdc972df3621ee5c05ffff0e3659f..94916f33dbae0d3eea6f74e2c619c4c6f52cc125 100644 | ||
--- a/lib/difflib.js | ||
+++ b/lib/difflib.js | ||
@@ -17,7 +17,7 @@ Function restore(delta, which): | ||
|
||
Function unifiedDiff(a, b): | ||
For two lists of strings, return a delta in unified diff format. | ||
- | ||
+. | ||
Class SequenceMatcher: | ||
A flexible class for comparing pairs of sequences of any type. | ||
|
||
@@ -75,7 +75,7 @@ Class Differ: | ||
|
||
SequenceMatcher = (function() { | ||
|
||
- SequenceMatcher.name = 'SequenceMatcher'; | ||
+ // SequenceMatcher.name = 'SequenceMatcher'; | ||
|
||
/* | ||
SequenceMatcher is a flexible class for comparing pairs of sequences of | ||
@@ -737,7 +737,7 @@ Class Differ: | ||
|
||
Differ = (function() { | ||
|
||
- Differ.name = 'Differ'; | ||
+ // Differ.name = 'Differ'; | ||
|
||
/* | ||
Differ is a class for comparing sequences of lines of text, and |
Oops, something went wrong.