-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: don't compile right after generating a project #142
Conversation
Compilation would fail because there's no source files.
Codecov Report
@@ Coverage Diff @@
## master #142 +/- ##
==========================================
+ Coverage 96.64% 96.66% +0.02%
==========================================
Files 10 10
Lines 328 330 +2
Branches 19 19
==========================================
+ Hits 317 319 +2
Misses 11 11
Continue to review full report at Codecov.
|
cp.spawnSync('npm', ['install'], {stdio: 'inherit'}); | ||
// --ignore-scripts so that compilation doesn't happen because there's no | ||
// source files yet. | ||
cp.spawnSync('npm', ['install', '--ignore-scripts'], {stdio: 'inherit'}); |
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.
If someone has a postinstall
script, I don't think that will get invoked either. However, I expect this use case is probably not too common and, if needed, someone can always run npm install
manually if needed.
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.
Yeah, most of the cases gts init
is run from an empty directory. Even though someone had a postinstall
script, they would know what they are doing and be able to figure things out.
test/test-kitchen.ts
Outdated
@@ -113,6 +113,10 @@ test.serial('use as a non-locally installed module', async t => { | |||
// server.ts has a lint error. Should error. | |||
await t.throws(simpleExecp(`${GTS} check src/server.ts`, opts)); | |||
|
|||
// Compilation shouldn't have happened. Hence no `build` directory. | |||
const dirContents = fs.readdirSync(`${tmpDir.name}/kitchen`); | |||
t.is(dirContents.indexOf('build'), -1); |
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.
Is it possible that npm run compile
was run but had an error that caused the build
directory to not be created?
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 verified that the build
directory is created without my change.
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
I moved the new test to a better place. |
Compilation would fail because there's no source files.