gomtm-cli 0.6.86 → 0.6.94

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/bin/gomtm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gomtm-cli",
3
3
  "private": false,
4
- "version": "0.6.86",
4
+ "version": "0.6.94",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",
@@ -15,11 +15,24 @@
15
15
  "sideEffects": false,
16
16
  "scripts": {
17
17
  "build--": "bun build src/cli/main.ts --outdir=dist/gomtm-cli.js --target node",
18
- "build": "echo "
18
+ "build": "next build "
19
+ },
20
+ "dependencies": {
21
+ "next": "^15.1.6",
22
+ "react": "^19.0.0",
23
+ "react-dom": "^19.0.0"
19
24
  },
20
- "dependencies": {},
21
25
  "devDependencies": {
22
26
  "commander": "^12.1.0",
23
- "vite": "^6.0.3"
27
+ "vite": "^6.0.3",
28
+ "@types/node": "^22",
29
+ "@types/react": "^19.0.2",
30
+ "@types/react-dom": "^19.0.0",
31
+ "tailwind-merge": "^2.5.5",
32
+ "tailwind-scrollbar": "^3.1.0",
33
+ "tailwind-scrollbar-hide": "^1.1.7",
34
+ "tailwindcss": "^3.4.17",
35
+ "tailwindcss-animate": "^1.0.7",
36
+ "typescript": "^5.7"
24
37
  }
25
38
  }
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from "react";
2
+ export const runtime = "edge"; //nodejs
3
+ export const dynamic = "force-dynamic";
4
+
5
+ export default async function Layout(props: {
6
+ children: ReactNode;
7
+ }) {
8
+ const { children } = props;
9
+ return (
10
+ <html lang="en" suppressHydrationWarning>
11
+ <body>{children}</body>
12
+ </html>
13
+ );
14
+ }
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ export default function Page(props: { params: any }) {
3
+ return <>hello</>;
4
+ }
package/src/cli/main.ts-- DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- import { program } from "commander";
3
- import dotenv from "dotenv";
4
- import fs from "node:fs";
5
- import path from "node:path";
6
- import { fileURLToPath } from "node:url";
7
-
8
- const __dirname = fileURLToPath(new URL(".", import.meta.url));
9
-
10
- const envFiles = ["../../env/dev.env", "./env/dev.env", ".env"];
11
- function loadEnv() {
12
- // biome-ignore lint/complexity/noForEach: <explanation>
13
- envFiles.forEach((envFile) => {
14
- if (fs.existsSync(envFile)) {
15
- const envPath = path.resolve(envFile);
16
- const dotenvConfig = dotenv.config({
17
- path: envPath,
18
- });
19
- if (dotenvConfig.error) {
20
- throw new Error("parse env error", dotenvConfig.error);
21
- }
22
- }
23
- });
24
- }
25
- (async () => {
26
- await loadEnv();
27
- program.command("build_mtmaiui").action(async () => {
28
- console.log("(build_mtmaiui)", import.meta.url);
29
-
30
- // const projectDir = path.resolve(__dirname, "../../../packages/mtmaiui");
31
- // await vite.build({
32
- // configFile: path.resolve(projectDir, "vite.config.js"),
33
- // });
34
- });
35
-
36
- // program.command("gen").action(async () => {
37
- // try {
38
- // await exec("drizzle-kit generate");
39
- // await compileMigrations();
40
- // } catch (e) {
41
- // console.error("执行 compile-migrations 失败", e);
42
- // process.exit(1);
43
- // }
44
- // });
45
- // program.command("dp_workflow").action(async () => {
46
- // try {
47
- // const codeRoot = path.resolve(
48
- // path.dirname(fileURLToPath(import.meta.url)),
49
- // "../",
50
- // );
51
- // const cmd = `cd ${codeRoot} && bun run dp_workflow`;
52
- // console.log("执行命令:", cmd);
53
- // await exec(cmd);
54
- // } catch (e) {
55
- // console.error("执行 dp_workflow 失败", e);
56
- // process.exit(1);
57
- // }
58
- // });
59
- program.parse();
60
- })();
package/src/lib/exec.ts DELETED
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env node
2
- import child_process from "node:child_process";
3
- import { mkdirSync } from "node:fs";
4
- import { dirname } from "node:path";
5
-
6
- export const exec = (
7
- command: string,
8
- options?: child_process.SpawnSyncOptionsWithBufferEncoding & {
9
- env?;
10
- logPath?: string;
11
- args?: string[];
12
- },
13
- ) => {
14
- const logFile = options?.logPath;
15
- let logStream = process.stdout;
16
- if (logFile) {
17
- const dirName = dirname(logFile);
18
- mkdirSync(dirName, { recursive: true });
19
- //@ts-ignore
20
- logStream = openSync(logFile, "a");
21
- }
22
- return new Promise((resolve, reject) => {
23
- try {
24
- const childProcess = child_process.spawn(command, {
25
- shell: true,
26
- stdio: [process.stdin, logStream, logStream],
27
- env: { ...process.env, ...(options?.env || {}) },
28
- ...options,
29
- });
30
- childProcess.on("error", (e) => {
31
- console.log("error", e);
32
- reject(e);
33
- });
34
- // a.stdout!.on("data",(data)=>{
35
- // console.log("on data:", data.toString())
36
- // })
37
- childProcess.once("exit", (num) => {
38
- if (num !== 0) {
39
- console.log("exe 命令出错,code=", {
40
- code: num,
41
- command,
42
- });
43
- reject(num);
44
- } else {
45
- resolve(num);
46
- }
47
- });
48
- } catch (e) {
49
- console.log({ message: "[exec error]", error: e, command });
50
- reject(e);
51
- }
52
- });
53
- };