Stack lockfile to be in the root of the repo; fix tsconfig of templates (#64)

* make the just-stack.json write out to a specific installed version of stack

* change file

* moving the lock file to be saved in the root of the monorepo

* make tsconfig only include src files in the generated packages

* change file

* change file
This commit is contained in:
Kenneth Chau 2019-04-11 11:23:39 -07:00 коммит произвёл GitHub
Родитель 37a57ff6bd
Коммит 7bb9e9b1af
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 66 добавлений и 9 удалений

Просмотреть файл

@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "just-scripts",
"comment": "make the just-stack.json write out to a specific installed version of stack",
"type": "patch"
}
],
"packageName": "just-scripts",
"email": "kchau@microsoft.com"
}

Просмотреть файл

@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "just-stack-single-lib",
"comment": "make tsconfig only include src files in the generated packages",
"type": "patch"
}
],
"packageName": "just-stack-single-lib",
"email": "kchau@microsoft.com"
}

Просмотреть файл

@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "just-stack-uifabric",
"comment": "make tsconfig only include src files in the generated packages",
"type": "patch"
}
],
"packageName": "just-stack-uifabric",
"email": "kchau@microsoft.com"
}

Просмотреть файл

@ -1,15 +1,31 @@
import { getAvailableStacks } from './getAvailableStacks';
import path from 'path';
import fs from 'fs';
import { readPackageJson } from 'just-scripts-utils';
import { resolve } from 'just-task';
export function writeLockFile(rootPath: string) {
const stacks = getAvailableStacks(rootPath);
const lockFile = path.join(rootPath, 'scripts', 'just-stacks.json');
fs.writeFileSync(lockFile, JSON.stringify({ stacks }, null, 2));
const resolvedStacks: { [key: string]: string } = {};
Object.keys(stacks).forEach(stack => {
const packageJsonPath = resolve(stack + '/package.json', path.join(rootPath, 'scripts'));
if (packageJsonPath) {
const packageJson = readPackageJson(path.dirname(packageJsonPath));
if (packageJson) {
resolvedStacks[stack] = packageJson.version;
}
}
});
const lockFile = path.join(rootPath, 'just-stacks.json');
fs.writeFileSync(lockFile, JSON.stringify({ stacks: resolvedStacks }, null, 2));
}
export function readLockFile(rootPath: string) {
const lockFile = path.join(rootPath, 'scripts', 'just-stacks.json');
const lockFile = path.join(rootPath, 'just-stacks.json');
if (!fs.existsSync(lockFile)) {
return null;
}

Просмотреть файл

@ -10,11 +10,14 @@ import { applyStackDiffs } from '../monorepo/applyStackDiffs';
export function upgradeRepoTask(): TaskFunction {
return async function upgradeRepo() {
const rootPath = findMonoRepoRootPath();
if (!rootPath) {
logger.error('Could not find monorepo root path. Not upgrading anything.');
return;
}
const scriptsPath = path.join(rootPath, 'scripts');
const oldStacks = readLockFile(rootPath);
if (oldStacks) {

Просмотреть файл

@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "esnext",
"target": "es2015",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
@ -9,6 +9,8 @@
"downlevelIteration": true,
"strict": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
}
},
"include": ["src/**/*"]
}

Просмотреть файл

@ -1,12 +1,15 @@
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"target": "es5",
"module": "es2015",
"outDir": "./lib",
"importHelpers": true,
"downlevelIteration": true,
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true
}
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react"
},
"include": ["src/**/*"]
}