mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
* Change prettier dependency in package.json version 1.8.1 * Update yarn.lock * Apply prettier changes * Fix ReactDOMServerIntegration-test.js * Fix test for ReactDOMComponent-test.js
27 lines
616 B
JavaScript
27 lines
616 B
JavaScript
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const chalk = require('chalk');
|
|
const {existsSync} = require('fs');
|
|
const {readJson} = require('fs-extra');
|
|
const {join} = require('path');
|
|
|
|
module.exports = async ({cwd, version}) => {
|
|
const packagePath = join(cwd, 'build', 'packages', 'react', 'package.json');
|
|
|
|
if (!existsSync(packagePath)) {
|
|
throw Error('No build found');
|
|
}
|
|
|
|
const packageJson = await readJson(packagePath);
|
|
|
|
if (packageJson.version !== version) {
|
|
throw Error(
|
|
chalk`Expected version {bold.white ${version}} but found {bold.white ${
|
|
packageJson.version
|
|
}}`
|
|
);
|
|
}
|
|
};
|