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.
@@ -97,5 +97,5 @@ try {
97
97
  commands[process.argv[2]](cmd);
98
98
  }
99
99
  catch (err) {
100
- console.log(err);
100
+ console.log("The input command failed. Please try again using 'tspace-mysql help'");
101
101
  }
@@ -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/builds';
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tspace-mysql",
3
- "version": "1.5.0-beta.13",
3
+ "version": "1.5.0-beta.15",
4
4
  "description": "mysql query builder object relational mapping",
5
5
  "main": "build/lib/index.js",
6
6
  "types": "build/lib/index.d.ts",