gg-mysql-connector 1.0.73 → 1.0.75
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.
|
@@ -189,25 +189,28 @@ class ModelGenerator {
|
|
|
189
189
|
const str = ` ${tableName} : { ${stringOfRawColumnKeyAndValue} }`;
|
|
190
190
|
arrayOfColumnKeyValue.push(str);
|
|
191
191
|
// only seed model code
|
|
192
|
-
const tempSeedModel = params.model.find(
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
// const tempSeedModel = params.model.find(
|
|
193
|
+
// (row) => row.tableName === tableName && row.isSeed
|
|
194
|
+
// )
|
|
195
|
+
// if (tempSeedModel) arrayOfSeedColumnKeyValue.push(str)
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
// normal app model code
|
|
198
199
|
const fileName = `${params.appName}_INF.ts`;
|
|
199
200
|
const seedFileName = `seed_INF.ts`;
|
|
200
201
|
const code = `export default interface ${params.appName}_INF { ${arrayOfColumnKeyValue.join("\n")} }`;
|
|
201
|
-
const seedCode = `export default interface seed_INF { ${arrayOfSeedColumnKeyValue.join(
|
|
202
|
+
// const seedCode = `export default interface seed_INF { ${arrayOfSeedColumnKeyValue.join(
|
|
203
|
+
// "\n"
|
|
204
|
+
// )} }`
|
|
202
205
|
for (let row of params.outputDirectory) {
|
|
203
206
|
// normal app model code
|
|
204
207
|
const serverFilePath = path_1.default.join(row, fileName);
|
|
205
208
|
await fs_1.default.writeFileSync(serverFilePath, code);
|
|
206
209
|
console.log("save app model to ", serverFilePath);
|
|
207
210
|
// only seed model code
|
|
208
|
-
const seedServerFilePath =
|
|
209
|
-
await
|
|
210
|
-
console.log("save seed model to ", seedServerFilePath)
|
|
211
|
+
// const seedServerFilePath = path.join(row, seedFileName)
|
|
212
|
+
// await fs.writeFileSync(seedServerFilePath, seedCode)
|
|
213
|
+
// console.log("save seed model to ", seedServerFilePath)
|
|
211
214
|
}
|
|
212
215
|
console.log(`generate interface ${params.appName} ${chalk_1.default.bgGreen(" SUCCESS ")}`);
|
|
213
216
|
return code;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gg-mysql-connector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.75",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.7.5",
|
|
22
|
-
"typescript": "^5.8.
|
|
22
|
+
"typescript": "^5.8.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -250,11 +250,12 @@ export default class ModelGenerator {
|
|
|
250
250
|
// normal app model code
|
|
251
251
|
const str = ` ${tableName} : { ${stringOfRawColumnKeyAndValue} }`
|
|
252
252
|
arrayOfColumnKeyValue.push(str)
|
|
253
|
+
|
|
253
254
|
// only seed model code
|
|
254
|
-
const tempSeedModel = params.model.find(
|
|
255
|
-
|
|
256
|
-
)
|
|
257
|
-
if (tempSeedModel) arrayOfSeedColumnKeyValue.push(str)
|
|
255
|
+
// const tempSeedModel = params.model.find(
|
|
256
|
+
// (row) => row.tableName === tableName && row.isSeed
|
|
257
|
+
// )
|
|
258
|
+
// if (tempSeedModel) arrayOfSeedColumnKeyValue.push(str)
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
// normal app model code
|
|
@@ -263,9 +264,10 @@ export default class ModelGenerator {
|
|
|
263
264
|
const code = `export default interface ${
|
|
264
265
|
params.appName
|
|
265
266
|
}_INF { ${arrayOfColumnKeyValue.join("\n")} }`
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
|
|
268
|
+
// const seedCode = `export default interface seed_INF { ${arrayOfSeedColumnKeyValue.join(
|
|
269
|
+
// "\n"
|
|
270
|
+
// )} }`
|
|
269
271
|
|
|
270
272
|
for (let row of params.outputDirectory) {
|
|
271
273
|
// normal app model code
|
|
@@ -273,9 +275,9 @@ export default class ModelGenerator {
|
|
|
273
275
|
await fs.writeFileSync(serverFilePath, code)
|
|
274
276
|
console.log("save app model to ", serverFilePath)
|
|
275
277
|
// only seed model code
|
|
276
|
-
const seedServerFilePath = path.join(row, seedFileName)
|
|
277
|
-
await fs.writeFileSync(seedServerFilePath, seedCode)
|
|
278
|
-
console.log("save seed model to ", seedServerFilePath)
|
|
278
|
+
// const seedServerFilePath = path.join(row, seedFileName)
|
|
279
|
+
// await fs.writeFileSync(seedServerFilePath, seedCode)
|
|
280
|
+
// console.log("save seed model to ", seedServerFilePath)
|
|
279
281
|
}
|
|
280
282
|
|
|
281
283
|
console.log(
|