Introduces a monorepo structure, relies on yarn workspaces to share
dependencies, and lerna for syncing versions across the monorepo.

* Create 2 workspaces:
    'packages' and 'website'
* Create 2 public packages:
    'babel-plugin-react-native-web' and 'react-native-web'
* Create 1 private package:
    'benchmarks'

A simple release script runs the tests, builds the package assets,
increments the package version numbers, git commits and tags, publishes
the package to npm, pushes the changes to github, and releases the
website update.

Close #657
This commit is contained in:
Nicolas Gallagher
2017-12-21 17:28:36 +00:00
parent 14d87f4b30
commit 3026465ae3
466 changed files with 4102 additions and 2912 deletions

View File

@@ -1,4 +1,6 @@
const generateData = require('inline-style-prefixer/generator');
'use strict';
const generator = require('inline-style-prefixer/generator');
const path = require('path');
const browserList = {
@@ -16,6 +18,9 @@ const browserList = {
and_chr: 38
};
generateData(browserList, {
staticPath: path.join(__dirname, '../src/modules/prefixStyles/static.js'),
generator(browserList, {
staticPath: path.join(
__dirname,
'../packages/react-native-web/src/modules/prefixStyles/static.js'
)
});

11
scripts/jest/config.js Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
module.exports = {
rootDir: process.cwd(),
roots: ['<rootDir>/packages'],
setupFiles: ['raf/polyfill'],
setupTestFrameworkScriptFile: require.resolve('./setupFramework.js'),
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jsdom',
timers: 'fake'
};

View File

@@ -0,0 +1,11 @@
/* eslint-env jasmine, jest */
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
import createSerializer from '../../packages/react-native-web/jest/createSerializer';
import { StyleSheet } from '../../packages/react-native-web/src';
const serializer = createSerializer(StyleSheet);
Enzyme.configure({ adapter: new Adapter() });
expect.addSnapshotSerializer(serializer);

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env node
'use strict';
const execSync = require('child_process').execSync;
const version = process.argv.slice(2)[0];
console.log(`Publishing ${version}`);
// use lerna to bump versions and dependencies
execSync(`./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes`);
// add changes
execSync('git add .');
// commit and tag
execSync(`git commit -m "${version}" && git tag -m ${version} "${version}"`);
// publish to npm
execSync('yarn publish');
// push to github
execSync('git push --tags origin master');