mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Flatten the shared/ folder (#11297)
* shared/src -> shared It's not a real package and doesn't even have package.json. This will also make importing less weird if we drop Haste. * Get rid of shared/utils Moved event-specific into shared/event. Moved rest to the root since distinction has always been pretty arbitrary. * Fix references to old shared/src paths
This commit is contained in:
@@ -38,6 +38,7 @@ const config = {
|
||||
'packages/*/*.js',
|
||||
// Source files
|
||||
'packages/*/src/**/*.js',
|
||||
'packages/shared/**/*.js',
|
||||
],
|
||||
ignore: ['**/node_modules/**'],
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ const update = async ({cwd, dry, version}) => {
|
||||
await writeJson(packagePath, rootPackage, {spaces: 2});
|
||||
|
||||
// Update ReactVersion source file
|
||||
const reactVersionPath = join(cwd, 'packages/shared/src/ReactVersion.js');
|
||||
const reactVersionPath = join(cwd, 'packages/shared/ReactVersion.js');
|
||||
const reactVersion = readFileSync(reactVersionPath, 'utf8').replace(
|
||||
/module\.exports = '[^']+';/,
|
||||
`module.exports = '${version}';`
|
||||
|
||||
@@ -189,9 +189,7 @@ function getInternalModules(moduleType) {
|
||||
// we tell Rollup where these files are located internally, otherwise
|
||||
// it doesn't pick them up and assumes they're external
|
||||
let aliases = {
|
||||
reactProdInvariant: resolve(
|
||||
'./packages/shared/src/utils/reactProdInvariant.js'
|
||||
),
|
||||
reactProdInvariant: resolve('./packages/shared/reactProdInvariant.js'),
|
||||
};
|
||||
if (moduleType === RENDERER) {
|
||||
// Renderers bundle the whole reconciler.
|
||||
|
||||
@@ -15,7 +15,7 @@ const versions = {
|
||||
.version,
|
||||
'packages/react-test-renderer/package.json': require('../../packages/react-test-renderer/package.json')
|
||||
.version,
|
||||
'packages/shared/src/ReactVersion.js': require('../../packages/shared/src/ReactVersion'),
|
||||
'packages/shared/ReactVersion.js': require('../../packages/shared/ReactVersion'),
|
||||
};
|
||||
|
||||
let allVersionsMatch = true;
|
||||
|
||||
Reference in New Issue
Block a user