Skip to content

Commit

Permalink
feat(create): Pin TypeScript version
Browse files Browse the repository at this point in the history
Fixes #268. Since TypeScript does not really follow SemVer, minor versions can (and do) break Vendure compilation.
  • Loading branch information
michaelbromley committed Mar 30, 2020
1 parent 63166a2 commit a2fba13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/create/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const REQUIRED_NODE_VERSION = '>=8.9.0';
/**
* The TypeScript version needs to pinned because minor versions often
* introduce breaking changes.
*/
export const TYPESCRIPT_VERSION = '3.7.5';
4 changes: 2 additions & 2 deletions packages/create/src/create-vendure-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import os from 'os';
import path from 'path';
import { Observable } from 'rxjs';

import { REQUIRED_NODE_VERSION } from './constants';
import { gatherCiUserResponses, gatherUserResponses } from './gather-user-responses';
import {
checkDbConnection,
Expand All @@ -22,7 +23,6 @@ import { CliLogLevel } from './types';

// tslint:disable-next-line:no-var-requires
const packageJson = require('../package.json');
const REQUIRED_NODE_VERSION = '>=8.9.0';
checkNodeVersion(REQUIRED_NODE_VERSION);

let projectName: string | undefined;
Expand Down Expand Up @@ -128,7 +128,7 @@ async function createApp(
.then(() => {
if (devDependencies.length) {
subscriber.next(`Installing ${devDependencies.join(', ')}`);
return installPackages(root, useYarn, devDependencies, true, logLevel);
return installPackages(root, useYarn, devDependencies, true, logLevel, isCi);
}
})
.then(() => subscriber.complete())
Expand Down
2 changes: 2 additions & 0 deletions packages/create/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import fs from 'fs-extra';
import path from 'path';
import semver from 'semver';

import { TYPESCRIPT_VERSION } from './constants';
import { CliLogLevel, DbType } from './types';

/**
Expand Down Expand Up @@ -235,6 +236,7 @@ export function getDependencies(
const devDependencies = ['concurrently'];
if (usingTs) {
devDependencies.push('ts-node');
dependencies.push(`typescript@${TYPESCRIPT_VERSION}`);
}

return { dependencies, devDependencies };
Expand Down

0 comments on commit a2fba13

Please sign in to comment.