Rename extension variable for consistency
Signed-off-by: Min Kim <minkimcello@gmail.com>
This commit is contained in:
@@ -21,7 +21,7 @@ export interface AdditionalActionsOptions {
|
||||
name: string;
|
||||
version: string;
|
||||
id: string;
|
||||
extension: string;
|
||||
extensionName: string;
|
||||
}
|
||||
|
||||
export async function installFrontend(options: AdditionalActionsOptions) {
|
||||
@@ -57,12 +57,12 @@ export async function addFrontendLegacy(options: AdditionalActionsOptions) {
|
||||
);
|
||||
|
||||
if (lastImportIndex !== -1 && lastRouteIndex !== -1) {
|
||||
const importLine = `import { ${options.extension} } from '${options.name}';`;
|
||||
const importLine = `import { ${options.extensionName} } from '${options.name}';`;
|
||||
if (!content.includes(importLine)) {
|
||||
revLines.splice(lastImportIndex, 0, importLine);
|
||||
}
|
||||
|
||||
const componentLine = `<Route path="/${options.id}" element={<${options.extension} />} />`;
|
||||
const componentLine = `<Route path="/${options.id}" element={<${options.extensionName} />} />`;
|
||||
if (!content.includes(componentLine)) {
|
||||
const [indentation] = revLines[lastRouteIndex + 1].match(/^\s*/) ?? [];
|
||||
revLines.splice(lastRouteIndex + 1, 0, indentation + componentLine);
|
||||
|
||||
@@ -78,7 +78,7 @@ export default async () => {
|
||||
`${camelCase(options.id)}Module${camelCase(
|
||||
options.moduleId,
|
||||
)[0].toUpperCase()}${camelCase(options.moduleId).slice(1)}`; // used in default-backend-module template
|
||||
const extension = `${upperFirst(camelCase(options.id))}Page`; // used in default-plugin template
|
||||
const extensionName = `${upperFirst(camelCase(options.id))}Page`; // used in default-plugin template
|
||||
const pluginVar = `${camelCase(options.id)}Plugin`; // used in default-backend-plugin and default-plugin template
|
||||
|
||||
let modified = false;
|
||||
@@ -101,7 +101,7 @@ export default async () => {
|
||||
name: packageName,
|
||||
pluginVersion: options.baseVersion,
|
||||
moduleVar,
|
||||
extension,
|
||||
extensionName,
|
||||
pluginVar,
|
||||
...options,
|
||||
},
|
||||
@@ -113,7 +113,7 @@ export default async () => {
|
||||
name: packageName,
|
||||
version: options.baseVersion,
|
||||
id: options.id, // for frontend legacy
|
||||
extension: extension, // for frontend legacy
|
||||
extensionName, // for frontend legacy
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user