nodebbs 0.0.6 → 0.0.7
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/oclif.manifest.json
CHANGED
|
@@ -91,76 +91,6 @@
|
|
|
91
91
|
"backup.js"
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"db:generate": {
|
|
95
|
-
"aliases": [],
|
|
96
|
-
"args": {},
|
|
97
|
-
"description": "生成 Prisma Client (db:generate)",
|
|
98
|
-
"flags": {
|
|
99
|
-
"env": {
|
|
100
|
-
"char": "e",
|
|
101
|
-
"description": "部署环境 (production, lowmem, basic)",
|
|
102
|
-
"name": "env",
|
|
103
|
-
"hasDynamicHelp": false,
|
|
104
|
-
"multiple": false,
|
|
105
|
-
"options": [
|
|
106
|
-
"production",
|
|
107
|
-
"lowmem",
|
|
108
|
-
"basic"
|
|
109
|
-
],
|
|
110
|
-
"type": "option"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"hasDynamicHelp": false,
|
|
114
|
-
"hiddenAliases": [],
|
|
115
|
-
"id": "db:generate",
|
|
116
|
-
"pluginAlias": "nodebbs",
|
|
117
|
-
"pluginName": "nodebbs",
|
|
118
|
-
"pluginType": "core",
|
|
119
|
-
"strict": true,
|
|
120
|
-
"enableJsonFlag": false,
|
|
121
|
-
"isESM": true,
|
|
122
|
-
"relativePath": [
|
|
123
|
-
"dist",
|
|
124
|
-
"commands",
|
|
125
|
-
"db",
|
|
126
|
-
"generate.js"
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
|
-
"db:migrate": {
|
|
130
|
-
"aliases": [],
|
|
131
|
-
"args": {},
|
|
132
|
-
"description": "执行数据库迁移 (db:migrate)",
|
|
133
|
-
"flags": {
|
|
134
|
-
"env": {
|
|
135
|
-
"char": "e",
|
|
136
|
-
"description": "部署环境 (production, lowmem, basic)",
|
|
137
|
-
"name": "env",
|
|
138
|
-
"hasDynamicHelp": false,
|
|
139
|
-
"multiple": false,
|
|
140
|
-
"options": [
|
|
141
|
-
"production",
|
|
142
|
-
"lowmem",
|
|
143
|
-
"basic"
|
|
144
|
-
],
|
|
145
|
-
"type": "option"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"hasDynamicHelp": false,
|
|
149
|
-
"hiddenAliases": [],
|
|
150
|
-
"id": "db:migrate",
|
|
151
|
-
"pluginAlias": "nodebbs",
|
|
152
|
-
"pluginName": "nodebbs",
|
|
153
|
-
"pluginType": "core",
|
|
154
|
-
"strict": true,
|
|
155
|
-
"enableJsonFlag": false,
|
|
156
|
-
"isESM": true,
|
|
157
|
-
"relativePath": [
|
|
158
|
-
"dist",
|
|
159
|
-
"commands",
|
|
160
|
-
"db",
|
|
161
|
-
"migrate.js"
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
94
|
"db:push": {
|
|
165
95
|
"aliases": [],
|
|
166
96
|
"args": {},
|
|
@@ -788,5 +718,5 @@
|
|
|
788
718
|
]
|
|
789
719
|
}
|
|
790
720
|
},
|
|
791
|
-
"version": "0.0.
|
|
721
|
+
"version": "0.0.7"
|
|
792
722
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class DbGenerate extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
-
};
|
|
7
|
-
run(): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import { execCompose, getComposeFiles } from '../../utils/docker.js';
|
|
3
|
-
import { logger } from '../../utils/logger.js';
|
|
4
|
-
import { EnvFlag, selectEnvironment } from '../../utils/selection.js';
|
|
5
|
-
export default class DbGenerate extends Command {
|
|
6
|
-
static description = '生成 Prisma Client (db:generate)';
|
|
7
|
-
static flags = {
|
|
8
|
-
env: EnvFlag,
|
|
9
|
-
};
|
|
10
|
-
async run() {
|
|
11
|
-
const { flags } = await this.parse(DbGenerate);
|
|
12
|
-
const env = await selectEnvironment(flags.env);
|
|
13
|
-
const { files, isBuiltIn } = await getComposeFiles(env);
|
|
14
|
-
logger.info('正在生成 Prisma Client...');
|
|
15
|
-
await execCompose(files, 'api', ['npm', 'run', 'db:generate'], isBuiltIn);
|
|
16
|
-
logger.success('数据库迁移文件生成完成');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class DbMigrate extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
-
};
|
|
7
|
-
run(): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import { execCompose, getComposeFiles } from '../../utils/docker.js';
|
|
3
|
-
import { logger } from '../../utils/logger.js';
|
|
4
|
-
import { EnvFlag, selectEnvironment } from '../../utils/selection.js';
|
|
5
|
-
export default class DbMigrate extends Command {
|
|
6
|
-
static description = '执行数据库迁移 (db:migrate)';
|
|
7
|
-
static flags = {
|
|
8
|
-
env: EnvFlag,
|
|
9
|
-
};
|
|
10
|
-
async run() {
|
|
11
|
-
const { flags } = await this.parse(DbMigrate);
|
|
12
|
-
const env = await selectEnvironment(flags.env);
|
|
13
|
-
const { files, isBuiltIn } = await getComposeFiles(env);
|
|
14
|
-
logger.info('正在执行数据库迁移...');
|
|
15
|
-
await execCompose(files, 'api', ['npm', 'run', 'db:migrate'], isBuiltIn);
|
|
16
|
-
logger.success('数据库迁移完成');
|
|
17
|
-
}
|
|
18
|
-
}
|