mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-08-15 18:45:06 +00:00
Update prettier and reformat source code
This commit is contained in:
@@ -11,7 +11,10 @@ const getDirectories = (source) =>
|
||||
|
||||
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');
|
||||
const moduleMapOutfile = path.join(
|
||||
packagesDir,
|
||||
'babel-plugin-react-native-web/src/moduleMap.js'
|
||||
);
|
||||
|
||||
const moduleMap = getDirectories(exportsDir).reduce((acc, curr) => {
|
||||
acc[curr] = true;
|
||||
|
||||
@@ -14,5 +14,8 @@ 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'
|
||||
)
|
||||
});
|
||||
|
||||
@@ -18,21 +18,26 @@ const oneTimeCode = argv.otp;
|
||||
console.log(`Publishing react-native-web@${version}`);
|
||||
|
||||
// Collect 'react-native-web' workspaces and package manifests
|
||||
const workspacePaths = require('../package.json').workspaces.reduce((acc, w) => {
|
||||
const resolvedPaths = glob.sync(w);
|
||||
resolvedPaths.forEach((p) => {
|
||||
// Remove duplicates and unrelated packages
|
||||
if (p.includes('react-native-web') && acc.indexOf(p) === -1) {
|
||||
acc.push(p);
|
||||
}
|
||||
});
|
||||
return acc;
|
||||
}, []);
|
||||
const workspacePaths = require('../package.json').workspaces.reduce(
|
||||
(acc, w) => {
|
||||
const resolvedPaths = glob.sync(w);
|
||||
resolvedPaths.forEach((p) => {
|
||||
// Remove duplicates and unrelated packages
|
||||
if (p.includes('react-native-web') && acc.indexOf(p) === -1) {
|
||||
acc.push(p);
|
||||
}
|
||||
});
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
const workspaces = workspacePaths.map((dir) => {
|
||||
const directory = path.resolve(dir);
|
||||
const packageJsonPath = path.join(directory, 'package.json');
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
|
||||
const packageJson = JSON.parse(
|
||||
fs.readFileSync(packageJsonPath, { encoding: 'utf-8' })
|
||||
);
|
||||
return { directory, packageJson, packageJsonPath };
|
||||
});
|
||||
|
||||
@@ -48,7 +53,10 @@ workspaces.forEach(({ directory, packageJson, packageJsonPath }) => {
|
||||
packageJson.devDependencies[name] = version;
|
||||
}
|
||||
});
|
||||
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
||||
fs.writeFileSync(
|
||||
packageJsonPath,
|
||||
JSON.stringify(packageJson, null, 2) + '\n'
|
||||
);
|
||||
});
|
||||
|
||||
// Commit changes
|
||||
|
||||
Reference in New Issue
Block a user