@lsbjordao/type-taxon-script 1.1.15 → 1.1.16

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/dist/export.js CHANGED
@@ -17,6 +17,7 @@ const path_1 = __importDefault(require("path"));
17
17
  const child_process_1 = require("child_process");
18
18
  const csv_parser_1 = __importDefault(require("csv-parser"));
19
19
  const cli_spinner_1 = require("cli-spinner");
20
+ const tscBin = require.resolve('typescript/bin/tsc');
20
21
  function deleteJSFiles(folderPath) {
21
22
  return __awaiter(this, void 0, void 0, function* () {
22
23
  try {
@@ -84,7 +85,12 @@ console.log(jsonData)
84
85
  const tempFilePath = './temp/exportTemp.ts';
85
86
  fs_1.default.writeFileSync(tempFilePath, fileContent, 'utf-8');
86
87
  const fileToTranspile = 'exportTemp';
87
- (0, child_process_1.exec)(`tsc --ignoreConfig ./temp/${fileToTranspile}.ts`, (error, stdout, stderr) => {
88
+ const tempTsConfig = JSON.stringify({
89
+ compilerOptions: { target: 'ES2016', module: 'commonjs', esModuleInterop: true, skipLibCheck: true },
90
+ files: [`./${fileToTranspile}.ts`]
91
+ });
92
+ fs_1.default.writeFileSync('./temp/tsconfig.json', tempTsConfig, 'utf-8');
93
+ (0, child_process_1.exec)(`node "${tscBin}" -p ./temp/tsconfig.json`, (error, stdout, stderr) => {
88
94
  if (stdout) {
89
95
  spinner.stop();
90
96
  console.error('\x1b[31m✖ TS Error:\x1b[0m\n\n' + `${stdout}`);
@@ -97,6 +103,7 @@ console.log(jsonData)
97
103
  }
98
104
  try {
99
105
  fs_1.default.unlinkSync(`./temp/${fileToTranspile}.ts`);
106
+ fs_1.default.unlinkSync('./temp/tsconfig.json');
100
107
  }
101
108
  catch (err) {
102
109
  spinner.stop();
@@ -176,7 +183,12 @@ console.log(jsonData)
176
183
  // console.log('\\x1b[1m\\x1b[32m✔ Process finished.\\x1b[0m')`;
177
184
  fs_1.default.writeFileSync(tempFilePath, fileContent, 'utf-8');
178
185
  const fileToTranspile = 'exportTemp';
179
- (0, child_process_1.exec)(`tsc --ignoreConfig ./temp/${fileToTranspile}.ts`, (error, stdout, stderr) => {
186
+ const tempTsConfig = JSON.stringify({
187
+ compilerOptions: { target: 'ES2016', module: 'commonjs', esModuleInterop: true, skipLibCheck: true },
188
+ files: [`./${fileToTranspile}.ts`]
189
+ });
190
+ fs_1.default.writeFileSync('./temp/tsconfig.json', tempTsConfig, 'utf-8');
191
+ (0, child_process_1.exec)(`node "${tscBin}" -p ./temp/tsconfig.json`, (error, stdout, stderr) => {
180
192
  if (stdout) {
181
193
  spinner.stop();
182
194
  console.error('\x1b[31m✖ TS Error:\x1b[0m\n\n' + `${stdout}`);
@@ -189,6 +201,7 @@ console.log(jsonData)
189
201
  }
190
202
  try {
191
203
  fs_1.default.unlinkSync(`./temp/${fileToTranspile}.ts`);
204
+ fs_1.default.unlinkSync('./temp/tsconfig.json');
192
205
  }
193
206
  catch (err) {
194
207
  spinner.stop();
@@ -18,6 +18,7 @@ const child_process_1 = require("child_process");
18
18
  const csv_parser_1 = __importDefault(require("csv-parser"));
19
19
  const plainjs_1 = require("@json2csv/plainjs");
20
20
  const transforms_1 = require("@json2csv/transforms");
21
+ const tscBin = require.resolve('typescript/bin/tsc');
21
22
  const cli_spinner_1 = require("cli-spinner");
22
23
  function deleteJSFiles(folderPath) {
23
24
  return __awaiter(this, void 0, void 0, function* () {
@@ -86,7 +87,12 @@ console.log(jsonData)
86
87
  const tempFilePath = './temp/exportTemp.ts';
87
88
  fs_1.default.writeFileSync(tempFilePath, fileContent, 'utf-8');
88
89
  const fileToTranspile = 'exportTemp';
89
- (0, child_process_1.exec)(`tsc --ignoreConfig ./temp/${fileToTranspile}.ts`, (error, stdout, stderr) => {
90
+ const tempTsConfig = JSON.stringify({
91
+ compilerOptions: { target: 'ES2016', module: 'commonjs', esModuleInterop: true, skipLibCheck: true },
92
+ files: [`./${fileToTranspile}.ts`]
93
+ });
94
+ fs_1.default.writeFileSync('./temp/tsconfig.json', tempTsConfig, 'utf-8');
95
+ (0, child_process_1.exec)(`node "${tscBin}" -p ./temp/tsconfig.json`, (error, stdout, stderr) => {
90
96
  if (stdout) {
91
97
  spinner.stop();
92
98
  console.error('\x1b[31m✖ TS Error:\x1b[0m\n\n' + `${stdout}`);
@@ -99,6 +105,7 @@ console.log(jsonData)
99
105
  }
100
106
  try {
101
107
  fs_1.default.unlinkSync(`./temp/${fileToTranspile}.ts`);
108
+ fs_1.default.unlinkSync('./temp/tsconfig.json');
102
109
  }
103
110
  catch (err) {
104
111
  spinner.stop();
@@ -192,7 +199,12 @@ console.log(jsonData)
192
199
  // console.log('\\x1b[1m\\x1b[32m✔ Process finished.\\x1b[0m')`;
193
200
  fs_1.default.writeFileSync(tempFilePath, fileContent, 'utf-8');
194
201
  const fileToTranspile = 'exportTemp';
195
- (0, child_process_1.exec)(`tsc --ignoreConfig ./temp/${fileToTranspile}.ts`, (error, stdout, stderr) => {
202
+ const tempTsConfig = JSON.stringify({
203
+ compilerOptions: { target: 'ES2016', module: 'commonjs', esModuleInterop: true, skipLibCheck: true },
204
+ files: [`./${fileToTranspile}.ts`]
205
+ });
206
+ fs_1.default.writeFileSync('./temp/tsconfig.json', tempTsConfig, 'utf-8');
207
+ (0, child_process_1.exec)(`node "${tscBin}" -p ./temp/tsconfig.json`, (error, stdout, stderr) => {
196
208
  if (stdout) {
197
209
  spinner.stop();
198
210
  console.error('\x1b[31m✖ TS Error:\x1b[0m\n\n' + `${stdout}`);
@@ -205,6 +217,7 @@ console.log(jsonData)
205
217
  }
206
218
  try {
207
219
  fs_1.default.unlinkSync(`./temp/${fileToTranspile}.ts`);
220
+ fs_1.default.unlinkSync('./temp/tsconfig.json');
208
221
  }
209
222
  catch (err) {
210
223
  spinner.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsbjordao/type-taxon-script",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "author": "Lucas Jordão <tucarj@gmail.com> & André Eppinghaus <andreeppinghaus@gmail.com> & Vicente Calfo <vicentecalfo@gmail.com>",
5
5
  "license": "ISC",
6
6
  "description": "TypeTaxonScript",