New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): add plugins flag to newapp command #2754
Conversation
…f plugins to generate one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good! That's such a great improvement for app creation!
I think it would be nice if the newapp
command logs the config if you loaded it from a file using the --config
flag.
try { | ||
let configFile; | ||
const isDefaultApp = !plugins && !config; | ||
|
||
validateAppName(appName); | ||
validatePlugins(plugins); | ||
validateConfig(config); | ||
if (config) configFile = loadConfigFile(config); | ||
const { pluginsDeps, pluginsConfig } = getPluginsDepsAndConfig({ | ||
isDefaultApp, | ||
plugins, | ||
configFile, | ||
}); | ||
const appPath = createNewApp(appName); | ||
createPackageJsonFile({ | ||
appName, | ||
baseAppPackageJSON, | ||
pluginsDeps, | ||
appPath, | ||
}); | ||
createConfigFile({ appPath, config, pluginsConfig }); | ||
createWebpackConfigFiles({ appPath, port, baseAppPath }); | ||
createTestConfigFiles({ appPath, baseAppPath }); | ||
createSrcFiles({ appPath, appName, baseAppPath }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!! 👍
``` | ||
|
||
Creating a new Proposals app | ||
|
||
```bash | ||
$ pgui newapp proposals | ||
Creating a new app: proposals | ||
Directory: /Users/victorguedes/Documents/decred/politeiagui/plugins-structure/apps/proposals | ||
Directory: /Directory/apps/proposals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!! Good job!
This PR aims to extend the
newapp
CLI to accept aplugins
flag with a list of comma separated plugins to add to the app.Todo:
package.json
of the newly created appDecided to create a basic api for plugins config file and implement template after we have a better idea how all core packages will be integrated.