@invect/cli 0.0.1 → 0.1.1
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/dist/{chunk-T4KEEHFJ.js → chunk-5XRZFNIV.js} +3 -3
- package/dist/{chunk-DGBTXQND.js → chunk-LKWAVX5Z.js} +2 -2
- package/dist/{generate-JDAYY3OL.js → generate-SCRZDVJT.js} +1 -1
- package/dist/index.js +9 -9
- package/dist/{migrate-JMKLRLSJ.js → migrate-A2N3YKVS.js} +1 -1
- package/package.json +3 -4
|
@@ -44,7 +44,7 @@ async function generateAction(options) {
|
|
|
44
44
|
const configPath = findConfigPath(options.config);
|
|
45
45
|
if (!configPath) {
|
|
46
46
|
console.error(
|
|
47
|
-
pc.red("\u2717 Could not find Invect config file.") + "\n\n" + pc.dim(" Searched for: invect.config.ts in ./, src/, lib/, config/") + "\n" + pc.dim(" Use --config <path> to specify the config file explicitly.") + "\n\n" + pc.dim(" You can create one with: " + pc.cyan("npx invect init")) + "\n"
|
|
47
|
+
pc.red("\u2717 Could not find Invect config file.") + "\n\n" + pc.dim(" Searched for: invect.config.ts in ./, src/, lib/, config/") + "\n" + pc.dim(" Use --config <path> to specify the config file explicitly.") + "\n\n" + pc.dim(" You can create one with: " + pc.cyan("npx invect-cli init")) + "\n"
|
|
48
48
|
);
|
|
49
49
|
process.exit(1);
|
|
50
50
|
}
|
|
@@ -494,7 +494,7 @@ async function runDrizzleKitGenerate() {
|
|
|
494
494
|
const cmd = configFile ? `npx drizzle-kit generate --config ${configFile}` : "npx drizzle-kit generate";
|
|
495
495
|
execSync(cmd, { stdio: "inherit", cwd: process.cwd() });
|
|
496
496
|
console.log(
|
|
497
|
-
pc.bold(pc.green("\n\u2713 SQL migrations generated.\n")) + pc.dim(" Run ") + pc.cyan("npx invect migrate") + pc.dim(" to apply them.\n")
|
|
497
|
+
pc.bold(pc.green("\n\u2713 SQL migrations generated.\n")) + pc.dim(" Run ") + pc.cyan("npx invect-cli migrate") + pc.dim(" to apply them.\n")
|
|
498
498
|
);
|
|
499
499
|
} catch {
|
|
500
500
|
console.error(
|
|
@@ -558,7 +558,7 @@ function printNextSteps() {
|
|
|
558
558
|
pc.dim(" 2. Run ") + pc.cyan("npx drizzle-kit generate") + pc.dim(" to create SQL migrations")
|
|
559
559
|
);
|
|
560
560
|
console.log(
|
|
561
|
-
pc.dim(" 3. Run ") + pc.cyan("npx invect migrate") + pc.dim(" to apply them")
|
|
561
|
+
pc.dim(" 3. Run ") + pc.cyan("npx invect-cli migrate") + pc.dim(" to apply them")
|
|
562
562
|
);
|
|
563
563
|
console.log("");
|
|
564
564
|
}
|
|
@@ -16,7 +16,7 @@ async function migrateAction(options) {
|
|
|
16
16
|
const configPath = findConfigPath(options.config);
|
|
17
17
|
if (!configPath) {
|
|
18
18
|
console.error(
|
|
19
|
-
pc.red("\u2717 Could not find Invect config file.") + "\n" + pc.dim(" Use --config <path> to specify the config file explicitly.") + "\n\n" + pc.dim(" You can create one with: " + pc.cyan("npx invect init")) + "\n"
|
|
19
|
+
pc.red("\u2717 Could not find Invect config file.") + "\n" + pc.dim(" Use --config <path> to specify the config file explicitly.") + "\n\n" + pc.dim(" You can create one with: " + pc.cyan("npx invect-cli init")) + "\n"
|
|
20
20
|
);
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
@@ -82,7 +82,7 @@ async function migrateAction(options) {
|
|
|
82
82
|
);
|
|
83
83
|
if (mode === "migrate") {
|
|
84
84
|
console.error(
|
|
85
|
-
pc.dim(" Have you generated migrations? Run: ") + pc.cyan("npx invect generate") + "\n"
|
|
85
|
+
pc.dim(" Have you generated migrations? Run: ") + pc.cyan("npx invect-cli generate") + "\n"
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
process.exit(1);
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
generateCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5XRZFNIV.js";
|
|
5
5
|
import "./chunk-K4RRNATQ.js";
|
|
6
6
|
import {
|
|
7
7
|
migrateCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LKWAVX5Z.js";
|
|
9
9
|
import {
|
|
10
10
|
findConfigPath,
|
|
11
11
|
loadConfig
|
|
@@ -195,7 +195,7 @@ ${envLine}
|
|
|
195
195
|
});
|
|
196
196
|
if (shouldGenerate) {
|
|
197
197
|
try {
|
|
198
|
-
const { generateAction } = await import("./generate-
|
|
198
|
+
const { generateAction } = await import("./generate-SCRZDVJT.js");
|
|
199
199
|
const schemaDir = fs.existsSync(path.join(process.cwd(), "src")) ? "./src/database" : "./database";
|
|
200
200
|
await generateAction({
|
|
201
201
|
config: configPath,
|
|
@@ -204,14 +204,14 @@ ${envLine}
|
|
|
204
204
|
});
|
|
205
205
|
} catch (error) {
|
|
206
206
|
console.error(
|
|
207
|
-
pc.yellow(" \u26A0 Schema generation failed. You can run it manually later:") + "\n" + pc.dim(` npx invect generate
|
|
207
|
+
pc.yellow(" \u26A0 Schema generation failed. You can run it manually later:") + "\n" + pc.dim(` npx invect-cli generate
|
|
208
208
|
`)
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
211
|
} else {
|
|
212
212
|
console.log(
|
|
213
213
|
pc.dim(
|
|
214
|
-
" Skipped. Run " + pc.cyan("npx invect generate") + " when ready."
|
|
214
|
+
" Skipped. Run " + pc.cyan("npx invect-cli generate") + " when ready."
|
|
215
215
|
)
|
|
216
216
|
);
|
|
217
217
|
}
|
|
@@ -224,7 +224,7 @@ ${envLine}
|
|
|
224
224
|
});
|
|
225
225
|
if (shouldMigrate) {
|
|
226
226
|
try {
|
|
227
|
-
const { migrateAction } = await import("./migrate-
|
|
227
|
+
const { migrateAction } = await import("./migrate-A2N3YKVS.js");
|
|
228
228
|
await migrateAction({
|
|
229
229
|
config: configPath,
|
|
230
230
|
yes: true,
|
|
@@ -233,7 +233,7 @@ ${envLine}
|
|
|
233
233
|
});
|
|
234
234
|
} catch {
|
|
235
235
|
console.error(
|
|
236
|
-
pc.yellow(" \u26A0 Migration failed. You can run it manually:") + "\n" + pc.dim(" npx invect migrate\n")
|
|
236
|
+
pc.yellow(" \u26A0 Migration failed. You can run it manually:") + "\n" + pc.dim(" npx invect-cli migrate\n")
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -249,9 +249,9 @@ ${envLine}
|
|
|
249
249
|
);
|
|
250
250
|
}
|
|
251
251
|
if (!shouldGenerate) {
|
|
252
|
-
nextSteps.push(` ${n++}. Run ${pc.cyan("npx invect generate")} to create schema files`);
|
|
252
|
+
nextSteps.push(` ${n++}. Run ${pc.cyan("npx invect-cli generate")} to create schema files`);
|
|
253
253
|
}
|
|
254
|
-
nextSteps.push(` ${n++}. Run ${pc.cyan("npx invect migrate")} to apply the schema`);
|
|
254
|
+
nextSteps.push(` ${n++}. Run ${pc.cyan("npx invect-cli migrate")} to apply the schema`);
|
|
255
255
|
if (framework.id === "express") {
|
|
256
256
|
nextSteps.push(` ${n++}. Mount the router: ${pc.cyan("app.use('/invect', createInvectRouter(config))")}`);
|
|
257
257
|
} else if (framework.id === "nextjs") {
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invect/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for managing Invect database schemas, migrations, and project setup",
|
|
6
6
|
"bin": {
|
|
7
|
-
"invect": "./dist/index.js"
|
|
8
|
-
"@invect/cli": "./dist/index.js"
|
|
7
|
+
"invect-cli": "./dist/index.js"
|
|
9
8
|
},
|
|
10
9
|
"main": "dist/index.js",
|
|
11
10
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
"jiti": "^2.4.2",
|
|
27
26
|
"picocolors": "^1.1.1",
|
|
28
27
|
"prompts": "^2.4.2",
|
|
29
|
-
"@invect/core": "0.
|
|
28
|
+
"@invect/core": "0.1.1"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@types/prompts": "^2.4.9",
|