Closed grez96 closed 3 years ago
To load the config files in the future you can use https://www.npmjs.com/package/cosmiconfig, a well-standardized way to load config files from the package.json or setting files.
To load the config files in the future you can use https://www.npmjs.com/package/cosmiconfig, a well-standardized way to load config files from the package.json or setting files.
Amazing suggestion! I have updated the getProjectConfigData
function to use cosmiconfig and it's a lot cleaner and simpler now. 👍
Support for custom config file Configuration no longer needs to be defined in projects package.json (although this still works for backwards compatibility). The recommended approach is to define a
.react-uirc.json
file which will hold the configuration data. For example,.react-uirc.json
:This functionality was achieved by rewriting the
getProjectPackageData
function asgetProjectConfigData
which will look for configuration data in the.react-urci.json
file in the projects root directory, will default topackage.json
if.react-uirc.json
does not exist.Support for renaming ejected components Component configuration data can now be defined in advanced mode. Currently the only supported properties in advanced mode are:
name
andnewName
. These new properties will allow you to define a custom name for your ejected components. For example,.react-uirc.json
:The above configuration will eject the BaseButton component and rename all occurrences of
BaseButton
toPillButton
. It will also eject VideoPlayer component but will keep its original naming.This functionality is achieved by:
validatePackageComponentList
to support new structure and properties.unifyComponentsSimpleConfigToAdvanced
. Using a single configuration type simplifies code logic.createRenamedIntermediary
createRenamedIntermediary
with thegitMergeFileUtility
, or use the original react-ui component if NO new name is defined.Better Versioning Currently the copy-component utility runs when it detects a version mismatch between the react-ui package.json version and the ejected components meta version file. The problem is that all components will share the same version number when ejected (the current version of react-ui), causing redundant operation of the copy utility.
Now each react-ui component will store and track its own .ReactUIMetaVersion file. This will decouple an individuals components version from the base react-ui package version.
notes Thoroughly tested the script.