-
Notifications
You must be signed in to change notification settings - Fork 209
fix: use local gts path for generated tsconfig.json #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,10 +95,15 @@ test.serial('use as a non-locally installed module', async t => { | |
const GTS = `${stagingPath}/kitchen/node_modules/.bin/gts`; | ||
const tmpDir = tmp.dirSync({keep, unsafeCleanup: true}); | ||
await ncpp('test/fixtures', `${tmpDir.name}/`); | ||
|
||
const opts = {cwd: `${tmpDir.name}/kitchen`}; | ||
// It's important to use `-n` here because we don't want to overwrite | ||
// the version of gts installed, as it will trigger the npm install. | ||
await simpleExecp(`${GTS} init -n`, opts); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed |
||
await simpleExecp(`${GTS} init -y`, opts); | ||
// The `extends` field must use the local gts path. | ||
const tsconfigJson = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Could you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test file uses lots of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree its not that big of a deal since its a test file, especially if there are a lot of places where |
||
fs.readFileSync(`${tmpDir.name}/kitchen/tsconfig.json`, 'utf8'); | ||
const tsconfig = JSON.parse(tsconfigJson); | ||
t.deepEqual(tsconfig.extends, './node_modules/gts/tsconfig-google.json'); | ||
|
||
await simpleExecp(`${GTS} check kitchen/src/server.ts`, opts); | ||
if (!keep) { | ||
tmpDir.removeCallback(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
path.join
be used instead of using/
directly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have a different value here depending on on which platform the source code is generated, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. I would expect
tsconfig
to be likepackage.json
where we can always use/
, but we should probably make sure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows has always supported
/
as a path separator as well as\
. So I don't see any issues with this if we consider all the current major OS's.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sounds good.