cli/new: remove params from config
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -48,7 +48,6 @@ describe('writeTemplateContents', () => {
|
||||
...baseConfig,
|
||||
roleParams: { role: 'frontend-plugin', pluginId: 'test' },
|
||||
builtInParams: {},
|
||||
params: {},
|
||||
packageName: '@internal/plugin-test',
|
||||
packagePath: 'plugins/plugin-test',
|
||||
},
|
||||
@@ -84,9 +83,6 @@ describe('writeTemplateContents', () => {
|
||||
...baseConfig,
|
||||
roleParams: { role: 'frontend-plugin', pluginId: 'test' },
|
||||
builtInParams: {},
|
||||
params: {
|
||||
pluginId: 'test',
|
||||
},
|
||||
packageName: '@internal/plugin-test',
|
||||
packagePath: 'out',
|
||||
},
|
||||
|
||||
@@ -36,8 +36,17 @@ export async function writeTemplateContents(
|
||||
try {
|
||||
const isMonoRepo = await getIsMonoRepo();
|
||||
|
||||
const { role, ...roleValues } = input.roleParams;
|
||||
|
||||
const templater = await PortableTemplater.create({
|
||||
values: input.params,
|
||||
values: {
|
||||
...roleValues,
|
||||
...input.builtInParams,
|
||||
packageName: input.packageName,
|
||||
privatePackage: input.private,
|
||||
packageVersion: input.version,
|
||||
license: input.license,
|
||||
},
|
||||
templatedValues: template.templateValues,
|
||||
});
|
||||
|
||||
|
||||
@@ -51,14 +51,6 @@ describe('collectTemplateParams', () => {
|
||||
builtInParams: {
|
||||
owner: 'me',
|
||||
},
|
||||
params: {
|
||||
license: 'Apache-2.0',
|
||||
packageName: '@internal/plugin-test',
|
||||
packageVersion: '0.1.0',
|
||||
privatePackage: true,
|
||||
pluginId: 'test',
|
||||
owner: 'me',
|
||||
},
|
||||
version: '0.1.0',
|
||||
license: 'Apache-2.0',
|
||||
private: true,
|
||||
@@ -83,14 +75,6 @@ describe('collectTemplateParams', () => {
|
||||
builtInParams: {
|
||||
owner: undefined,
|
||||
},
|
||||
params: {
|
||||
license: 'Apache-2.0',
|
||||
packageName: '@internal/plugin-other',
|
||||
packageVersion: '0.1.0',
|
||||
privatePackage: true,
|
||||
pluginId: 'other',
|
||||
owner: undefined,
|
||||
},
|
||||
version: '0.1.0',
|
||||
license: 'Apache-2.0',
|
||||
private: true,
|
||||
|
||||
@@ -84,13 +84,6 @@ export async function collectPortableTemplateInput(
|
||||
builtInParams: {
|
||||
owner: answers.owner,
|
||||
} as PortableTemplateInputBuiltInParams,
|
||||
params: {
|
||||
...answers,
|
||||
packageName: packageParams.packageName,
|
||||
privatePackage: config.private,
|
||||
packageVersion: config.version,
|
||||
license: config.license,
|
||||
},
|
||||
license: config.license,
|
||||
version: config.version,
|
||||
private: config.private,
|
||||
|
||||
@@ -109,7 +109,6 @@ export type PortableTemplateInputBuiltInParams = {
|
||||
export type PortableTemplateInput = {
|
||||
roleParams: PortableTemplateInputRoleParams;
|
||||
builtInParams: PortableTemplateInputBuiltInParams;
|
||||
params: PortableTemplateParams;
|
||||
|
||||
license: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user