tspace-mysql 1.5.0-beta.13 → 1.5.0-beta.15
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/build/cli/index.js
CHANGED
|
@@ -65,17 +65,15 @@ exports.default = (cmd) => {
|
|
|
65
65
|
})));
|
|
66
66
|
let pathModels = [].concat(...files).filter(d => d != null || d === '');
|
|
67
67
|
yield new Promise(r => setTimeout(r, 3000));
|
|
68
|
-
const isFileTs = pathModels.some(pathModel => /\.ts$/.test(pathModel));
|
|
69
|
-
const outDirForBuildTs = 'tmp-migrations-ts
|
|
68
|
+
const isFileTs = pathModels.some(pathModel => /\.ts$/.test(pathModel) && !(/\.d\.ts$/.test(pathModel)));
|
|
69
|
+
const outDirForBuildTs = 'tmp-migrations-ts';
|
|
70
70
|
if (isFileTs) {
|
|
71
71
|
for (const pathModel of pathModels) {
|
|
72
|
-
const command = `tsc "${pathModel}" --outDir ${outDirForBuildTs} --target es6 --esModuleInterop --module commonjs`;
|
|
72
|
+
const command = `tsc "${pathModel}" --outDir ${outDirForBuildTs} --target es6 --esModuleInterop --module commonjs --allowJs`;
|
|
73
73
|
try {
|
|
74
74
|
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
75
75
|
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
76
|
+
catch (error) { }
|
|
79
77
|
}
|
|
80
78
|
const directories = fs.readdirSync(outDirForBuildTs, { withFileTypes: true });
|
|
81
79
|
const files = (yield Promise.all(directories.map((directory) => {
|
|
@@ -141,7 +139,6 @@ exports.default = (cmd) => {
|
|
|
141
139
|
return model;
|
|
142
140
|
}
|
|
143
141
|
catch (err) {
|
|
144
|
-
console.error(err);
|
|
145
142
|
console.log(`Check your 'Model' from path : '${pathModel}' is not instance of Model`);
|
|
146
143
|
return null;
|
|
147
144
|
}
|
|
@@ -170,7 +167,7 @@ exports.default = (cmd) => {
|
|
|
170
167
|
}
|
|
171
168
|
};
|
|
172
169
|
if (push) {
|
|
173
|
-
const filePath = `${dir}/migrations.sql`;
|
|
170
|
+
const filePath = `${cwd}/${dir}/migrations.sql`;
|
|
174
171
|
const sqlString = fs.readFileSync(filePath, 'utf8');
|
|
175
172
|
const sqlStatements = sqlString.split(';');
|
|
176
173
|
for (const sql of sqlStatements) {
|