Skip to content
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

Change the display name of project to product #68

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/cool-pets-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@featureboard/code-generator': patch
'@featureboard/nx-plugin': patch
'@featureboard/cli': patch
---

Change the display name of project to product
4 changes: 2 additions & 2 deletions apps/cli/src/commands/code-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function codeGenCommand() {
'FeatureBoard API key',
process.env.FEATUREBOARD_API_KEY,
)
.option('-p, --project <name>', 'FeatureBoard project name')
.option('-p, --product <name>', 'FeatureBoard product name')
.option('-d, --dryRun', 'Dry run show what files have changed', false)
.option('-q, --quiet', "Don't show file changes", false)
.option(
Expand Down Expand Up @@ -132,7 +132,7 @@ export function codeGenCommand() {
template: options.template as Template,
tree: tree,
relativeFilePath: options.output!,
featureBoardProjectName: options.project,
featureBoardProductName: options.product,
auth: bearerToken
? {
featureBoardBearerToken: bearerToken,
Expand Down
2 changes: 1 addition & 1 deletion libs/code-generator/src/lib/code-generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('code-generator', () => {
subFolder: subFolder,
template: 'dotnet-api',
interactive: false,
featureBoardProjectName: 'SaaSy Icons',
featureBoardProductName: 'SaaSy Icons',
auth: { featureBoardApiKey: 'This is totally a key' },
}
})
Expand Down
8 changes: 4 additions & 4 deletions libs/code-generator/src/lib/code-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface CodeGeneratorOptions {
template: Template
auth: FeatureBoardAuth
apiEndpoint?: string
featureBoardProjectName?: string
featureBoardProductName?: string

interactive: boolean

Expand Down Expand Up @@ -63,22 +63,22 @@ export async function codeGenerator(
}

async function getConfig({
featureBoardProjectName,
featureBoardProductName,
auth,
interactive,
apiEndpoint = 'https://api.featureboard.app',
}: {
interactive: boolean
auth: FeatureBoardAuth
featureBoardProjectName?: string
featureBoardProductName?: string
apiEndpoint?: string
}): Promise<null | [FeatureBoardProject, FeatureBoardFeature[]]> {
const projectResults = await getProjects(apiEndpoint, auth)

let project = projectResults.projects.find(
(x: any) =>
x.name.toLowerCase() ===
featureBoardProjectName?.toLocaleLowerCase(),
featureBoardProductName?.toLocaleLowerCase(),
)

if (!project && interactive) {
Expand Down
2 changes: 1 addition & 1 deletion libs/nx-plugin/src/executors/code-gen/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('code-Executor', () => {
projectName: 'my-app',
subFolder: './',
template: 'dotnet-api',
featureBoardProjectName: 'SaaSy Icons',
featureBoardProductName: 'SaaSy Icons',
featureBoardApiKey: 'This is totally a key',
}

Expand Down
2 changes: 1 addition & 1 deletion libs/nx-plugin/src/executors/code-gen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"x-prompt": "What is the name of the project you want to add the component to?"
},

"featureBoardProjectName": {
"featureBoardProductName": {
"type": "string",
"description": "The name of the FeatureBoard project you want to pull the types from."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:
The name of the FeatureBoard product you want to pull the types from.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "description" above also need to change? "The name of the project to add the component to."

},
Expand Down
2 changes: 1 addition & 1 deletion libs/nx-plugin/src/executors/code-gen/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Template } from '@featureboard/code-generator'
export interface CodeGenExecutorSchema {
template: Template
projectName: string
featureBoardProjectName: string
featureBoardProductName: string
featureBoardApiKey: string
subFolder: string
}
2 changes: 1 addition & 1 deletion libs/nx-plugin/src/generators/code-gen/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('code-generator', () => {
projectName: 'my-app',
subFolder: './',
template: 'dotnet-api',
featureBoardProjectName: 'SaaSy Icons',
featureBoardProductName: 'SaaSy Icons',
featureBoardApiKey: 'This is totally a key',
}

Expand Down
4 changes: 2 additions & 2 deletions libs/nx-plugin/src/generators/code-gen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"x-prompt": "What is the name of the project you want to add the component to?"
},

"featureBoardProjectName": {
"featureBoardProductName": {
"type": "string",
"description": "The name of the FeatureBoard project you want to pull the types from."
"description": "The name of the FeatureBoard product you want to pull the types from."
},

"featureBoardApiKey": {
Expand Down
2 changes: 1 addition & 1 deletion libs/nx-plugin/src/generators/code-gen/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Template } from '@featureboard/code-generator'
export interface CodeGenGeneratorSchema {
template: Template
projectName: string
featureBoardProjectName: string
featureBoardProductName: string
featureBoardApiKey: string
subFolder: string
}