mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-25 15:42:24 +00:00
Reorganize monorepo structure
* Move all config files to './configs' * Simplify './scripts' folder.
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
const createConfig = ({ modules }) => ({
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
loose: true,
|
||||
modules,
|
||||
exclude: ['transform-typeof-symbol'],
|
||||
targets: {
|
||||
browsers: [
|
||||
'chrome 38',
|
||||
'android 4',
|
||||
'firefox 40',
|
||||
'ios_saf 7',
|
||||
'safari 7',
|
||||
'ie 10',
|
||||
'ie_mob 11',
|
||||
'edge 12',
|
||||
'opera 16',
|
||||
'op_mini 12',
|
||||
'and_uc 9',
|
||||
'and_chr 38'
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
'@babel/preset-react',
|
||||
'@babel/preset-flow'
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-transform-flow-strip-types',
|
||||
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }],
|
||||
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||||
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator'
|
||||
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
|
||||
});
|
||||
|
||||
module.exports = function () {
|
||||
return process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test'
|
||||
? createConfig({ modules: 'commonjs' })
|
||||
: createConfig({ modules: false });
|
||||
};
|
||||
@@ -9,7 +9,7 @@ const isDirectory = (source) => fs.lstatSync(source).isDirectory();
|
||||
const getDirectories = (source) =>
|
||||
fs.readdirSync(source).filter((name) => isDirectory(path.join(source, name)));
|
||||
|
||||
const packagesDir = path.join(__dirname, '../../packages/');
|
||||
const packagesDir = path.join(__dirname, '../packages/');
|
||||
const exportsDir = path.join(packagesDir, 'react-native-web/src/exports');
|
||||
const moduleMapOutfile = path.join(packagesDir, 'babel-plugin-react-native-web/src/moduleMap.js');
|
||||
|
||||
@@ -14,5 +14,5 @@ const browserList = {
|
||||
};
|
||||
|
||||
generator(browserList, {
|
||||
path: path.join(__dirname, '../../packages/react-native-web/src/modules/prefixStyles/static.js')
|
||||
path: path.join(__dirname, '../packages/react-native-web/src/modules/prefixStyles/static.js')
|
||||
});
|
||||
@@ -1,22 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '<rootDir>/packages/react-native-web/src/vendor/'],
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/packages/benchmarks/',
|
||||
'<rootDir>/packages/docs/',
|
||||
'<rootDir>/packages/examples/',
|
||||
'<rootDir>/packages/react-native-web/dist/'
|
||||
],
|
||||
rootDir: process.cwd(),
|
||||
roots: ['<rootDir>/packages'],
|
||||
setupFiles: [require.resolve('./setupFiles.dom.js')],
|
||||
snapshotFormat: {
|
||||
printBasicPrototype: false
|
||||
},
|
||||
testEnvironment: 'jsdom',
|
||||
testMatch: ['**/__tests__/**/?(*-)+(spec|test).[jt]s?(x)'],
|
||||
timers: 'fake'
|
||||
};
|
||||
|
||||
('**/?(*.)+(spec|test).[jt]s?(x)');
|
||||
@@ -1,19 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '<rootDir>/packages/react-native-web/src/vendor/'],
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/packages/benchmarks/',
|
||||
'<rootDir>/packages/docs/',
|
||||
'<rootDir>/packages/examples/',
|
||||
'<rootDir>/packages/react-native-web/dist/'
|
||||
],
|
||||
rootDir: process.cwd(),
|
||||
roots: ['<rootDir>/packages'],
|
||||
snapshotFormat: {
|
||||
printBasicPrototype: false
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/__tests__/**/?(*-)+(spec|test).node.[jt]s?(x)'],
|
||||
timers: 'fake'
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// JSDOM doesn't implement ResizeObserver
|
||||
class ResizeObserver {
|
||||
disconnect() {}
|
||||
observe() {}
|
||||
unobserve() {}
|
||||
}
|
||||
window.ResizeObserver = ResizeObserver;
|
||||
|
||||
// JSDOM doesn't provide values for 'clientWidth' etc
|
||||
Object.defineProperty(window.document.documentElement, 'clientHeight', {
|
||||
get: function () {
|
||||
return this._jsdomClientWidth || window.innerHeight;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(window.document.documentElement, 'clientWidth', {
|
||||
get: function () {
|
||||
return this._jsdomClientWidth || window.innerWidth;
|
||||
}
|
||||
});
|
||||
@@ -18,7 +18,7 @@ const oneTimeCode = argv.otp;
|
||||
console.log(`Publishing ${version}`);
|
||||
|
||||
// Collect workspaces and package manifests
|
||||
const workspacePaths = require('../../package.json').workspaces.concat(['./']);
|
||||
const workspacePaths = require('../package.json').workspaces.concat(['./']);
|
||||
const workspaces = workspacePaths.reduce((acc, curr) => {
|
||||
const packageDirectories = glob.sync(path.resolve(curr));
|
||||
packageDirectories.forEach((directory) => {
|
||||
Reference in New Issue
Block a user