From cffc994765c9eaef0ea063e77297e64a0d24055f Mon Sep 17 00:00:00 2001 From: Yordis Prieto Lazo Date: Tue, 15 Oct 2019 08:33:07 -0700 Subject: [PATCH 1/2] Fix cache folder location --- src/constants.ts | 1 + src/index.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index dfb616313..70db1c804 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -4,6 +4,7 @@ export const paths = { appPackageJson: resolveApp('package.json'), testsSetup: resolveApp('test/setupTests.ts'), appRoot: resolveApp('.'), + cache: resolveApp('node_modules/.cache'), appSrc: resolveApp('src'), appErrorsJson: resolveApp('errors/codes.json'), appErrors: resolveApp('errors'), diff --git a/src/index.ts b/src/index.ts index 846349048..dc559a322 100755 --- a/src/index.ts +++ b/src/index.ts @@ -38,7 +38,7 @@ const createLogger = require('progress-estimator'); // All configuration keys are optional, but it's recommended to specify a storage location. // Learn more about configuration options below. const logger = createLogger({ - storagePath: path.join(__dirname, '.progress-estimator'), + storagePath: path.join(paths.cache, '.progress-estimator'), }); const prog = sade('tsdx'); @@ -52,7 +52,7 @@ let appPackageJson: { try { appPackageJson = fs.readJSONSync(resolveApp('package.json')); -} catch (e) {} +} catch (e) { } // check for custom tsdx.config.js let tsdxConfig = { @@ -81,8 +81,8 @@ async function jsOrTs(filename: string) { const extension = (await isFile(resolveApp(filename + '.ts'))) ? '.ts' : (await isFile(resolveApp(filename + '.tsx'))) - ? '.tsx' - : '.js'; + ? '.tsx' + : '.js'; return resolveApp(`${filename}${extension}`); } @@ -95,7 +95,7 @@ async function getInputs(entries: string[], source?: string) { entries && entries.length ? entries : (source && resolveApp(source)) || - ((await isDir(resolveApp('src'))) && (await jsOrTs('src/index'))) + ((await isDir(resolveApp('src'))) && (await jsOrTs('src/index'))) ) .map(file => glob(file)) .forEach(input => inputs.push(input)); @@ -168,7 +168,7 @@ async function moveTypes() { overwrite: true, }); await fs.remove(paths.appDist + '/src'); - } catch (e) {} + } catch (e) { } } prog @@ -371,7 +371,7 @@ prog `); try { await moveTypes(); - } catch (_error) {} + } catch (_error) { } } }); }); @@ -492,7 +492,7 @@ prog // Allow overriding with jest.config const jestConfigContents = require(paths.jestConfig); jestConfig = { ...jestConfig, ...jestConfigContents }; - } catch {} + } catch { } argv.push( '--config', From ef91a9b883044546574f642ee1947036521a78de Mon Sep 17 00:00:00 2001 From: Yordis Prieto Lazo Date: Tue, 15 Oct 2019 08:35:13 -0700 Subject: [PATCH 2/2] Revert formatter changes --- src/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.ts b/src/index.ts index dc559a322..e0f4af933 100755 --- a/src/index.ts +++ b/src/index.ts @@ -52,7 +52,7 @@ let appPackageJson: { try { appPackageJson = fs.readJSONSync(resolveApp('package.json')); -} catch (e) { } +} catch (e) {} // check for custom tsdx.config.js let tsdxConfig = { @@ -81,8 +81,8 @@ async function jsOrTs(filename: string) { const extension = (await isFile(resolveApp(filename + '.ts'))) ? '.ts' : (await isFile(resolveApp(filename + '.tsx'))) - ? '.tsx' - : '.js'; + ? '.tsx' + : '.js'; return resolveApp(`${filename}${extension}`); } @@ -95,7 +95,7 @@ async function getInputs(entries: string[], source?: string) { entries && entries.length ? entries : (source && resolveApp(source)) || - ((await isDir(resolveApp('src'))) && (await jsOrTs('src/index'))) + ((await isDir(resolveApp('src'))) && (await jsOrTs('src/index'))) ) .map(file => glob(file)) .forEach(input => inputs.push(input)); @@ -168,7 +168,7 @@ async function moveTypes() { overwrite: true, }); await fs.remove(paths.appDist + '/src'); - } catch (e) { } + } catch (e) {} } prog @@ -371,7 +371,7 @@ prog `); try { await moveTypes(); - } catch (_error) { } + } catch (_error) {} } }); }); @@ -492,7 +492,7 @@ prog // Allow overriding with jest.config const jestConfigContents = require(paths.jestConfig); jestConfig = { ...jestConfig, ...jestConfigContents }; - } catch { } + } catch {} argv.push( '--config',