Skip to content

Commit

Permalink
chore(projects-test): update TS version resolution from root
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Feb 9, 2021
1 parent dc468bc commit 2b01409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/fluentui/projects-test/src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export async function typings() {
logger(`✔️ Temporary directory was created: ${tmpDirectory}`);

// Install dependencies, ensuring we specify the same TS version as our projects use
const tsVersion = fs.readJSONSync(config.paths.base('scripts', 'package.json')).dependencies.typescript;
const rootPkgJson: { devDependencies: Record<string, string> } = fs.readJSONSync(config.paths.base('package.json'));
const { typescript: tsVersion } = rootPkgJson.devDependencies;

const dependencies = ['@types/react', '@types/react-dom', 'react', 'react-dom', `typescript@${tsVersion}`].join(' ');
await sh(`yarn add ${dependencies}`, tmpDirectory);
Expand All @@ -32,6 +33,9 @@ export async function typings() {
fs.copyFileSync(scaffoldPath('tsconfig.json'), path.resolve(tmpDirectory, 'tsconfig.json'));
logger(`✔️ Source and configs were copied`);

await sh(`which yarn`);
await sh(`yarn --version`);
await sh(`yarn tsc --version`);
await sh(`yarn tsc --noEmit`, tmpDirectory);
logger(`✔️ Example project was successfully built: ${tmpDirectory}`);
}

0 comments on commit 2b01409

Please sign in to comment.