chore: options instead of positional args
Signed-off-by: Alper Altay <alper.altay@lego.com>
This commit is contained in:
@@ -91,7 +91,9 @@ export const backendModule = createFactory<Options>({
|
||||
});
|
||||
}
|
||||
|
||||
await addToBackend(name, 'module');
|
||||
await addToBackend(name, {
|
||||
type: 'module',
|
||||
});
|
||||
|
||||
if (options.owner) {
|
||||
await addCodeownersEntry(`/plugins/${dirName}`, options.owner);
|
||||
|
||||
@@ -79,7 +79,9 @@ export const backendPlugin = createFactory<Options>({
|
||||
);
|
||||
});
|
||||
|
||||
await addToBackend(name, 'plugin');
|
||||
await addToBackend(name, {
|
||||
type: 'plugin',
|
||||
});
|
||||
}
|
||||
|
||||
if (options.owner) {
|
||||
|
||||
@@ -198,9 +198,14 @@ export async function addPackageDependency(
|
||||
}
|
||||
}
|
||||
|
||||
export async function addToBackend(name: string, type: 'plugin' | 'module') {
|
||||
export async function addToBackend(
|
||||
name: string,
|
||||
options: {
|
||||
type: 'plugin' | 'module';
|
||||
},
|
||||
) {
|
||||
if (await fs.pathExists(paths.resolveTargetRoot('packages/backend'))) {
|
||||
await Task.forItem('backend', `adding ${type}`, async () => {
|
||||
await Task.forItem('backend', `adding ${options.type}`, async () => {
|
||||
const backendFilePath = paths.resolveTargetRoot(
|
||||
'packages/backend/src/index.ts',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user