-
Notifications
You must be signed in to change notification settings - Fork 1
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: pass generalAnswers to configure plugins #23
Changes from all commits
2e14aad
33959ec
6d95abb
ee10ac0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,7 @@ module.exports = { | |
baz: '4', | ||
array: [ | ||
Boolean(100 + 500 * 1) | ||
] | ||
], | ||
specials: /\n\t\r/g, | ||
extraSlash: /\, \, \\/g | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,13 +65,13 @@ export const run = async ({ | |
? [baseGeneralPromptsHandler, generalPromptsHandler] | ||
: [baseGeneralPromptsHandler]; | ||
|
||
await configBuilder.handleGeneralQuestions(generalPrompts, generalPromptsHandlers, opts); | ||
const generalAnswers = await configBuilder.handleGeneralQuestions(generalPrompts, generalPromptsHandlers, opts); | ||
|
||
const { pluginNames, configNotes } = await getPluginNames(opts); | ||
const extraPackages = getExtraPackagesToInstall ? getExtraPackagesToInstall() : { names: [], notes: [] }; | ||
|
||
await configBuilder.configurePlugins(pluginNames, createPluginsConfig); | ||
await configBuilder.configurePlugins({ pluginNames, createPluginsConfig, generalAnswers }); | ||
|
||
const extraPackages = getExtraPackagesToInstall ? getExtraPackagesToInstall() : { names: [], notes: [] }; | ||
Comment on lines
+72
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Поменял их местами, чтобы при настройке одного плагина можно было добавить и другой: комплиментарный |
||
const packageNamesToInstall = pluginNames.concat(extraPackages.names); | ||
|
||
if (opts.language === "ts") { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ export const installPackages = async ( | |
pluginsToInstall: string[], | ||
registry: string, | ||
): Promise<string> => { | ||
const spinner = ora("Installing packages").start(); | ||
const spinner = ora("Installing packages (this may take a while)").start(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Изначально хотел сделать так, чтоб процесс установки выводился в консоль, но чет не нашел, как это сделать с сабпроцессами, чтобы оно работало как с нативными пакетными менеджерами. Добавил тут эту приписку, чтобы не выглядело, так, как будто оно зависло. Гермиона устанавливается не быстро (например, сборка нативных модулей занимает какое-то время) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А чего не юзнуть There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Попробовал
Нет. С 6 версии он pure esm, а
Это все еще ничего не даст. Сам There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Пробовал по-всякому, и |
||
|
||
const pluginsPackages = pluginsToInstall.map(packageNameFromPlugin).join(" "); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import type { HermioneConfig } from "./hermioneConfig"; | ||
import type { Answers } from "./toolOpts"; | ||
|
||
export interface PluginsConfig { | ||
[plugin: string]: (config: HermioneConfig) => void | Promise<void>; | ||
[plugin: string]: (config: HermioneConfig, generalAnswers?: Answers) => void | Promise<void>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Сделал тут |
||
} |
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.
Это может быть полезно в тех случаях, когда от ответа на такой вопрос зависит, как именно будет производиться настройка плагина