Skip to content
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gofynd/fdk-cli",
"version": "8.0.10",
"version": "8.0.11",
"main": "index.js",
"license": "MIT",
"bin": {
Expand Down
10 changes: 10 additions & 0 deletions src/__tests__/setup_extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,16 @@ describe('Extension Commands', () => {
expect(fs.existsSync('payment-ext')).toBe(true);
});

it('should expose logistics launch type with react template only', () => {
expect(Object.values(CONSTANTS.LAUNCH_TYPES)).toContain('Logistics');
expect(CONSTANTS.getTemplateChoices('Logistics')).toEqual([
'Node + React.js + SQLite',
]);
expect(CONSTANTS.getTemplateChoices('logistics')).toEqual([
'Node + React.js + SQLite',
]);
});

it('should re-prompt and validate payment extension name before asking slug', async () => {
await mockAxios
.onGet(URLS.CHECK_PAYMENT_EXTENSION_NAME('payment-ext'))
Expand Down
9 changes: 7 additions & 2 deletions src/helper/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const TEMPLATES = {
'node-react': {
name: 'Node + React.js + SQLite',
repo: 'https://github.com/gofynd/example-extension-javascript-react',
launchTypes: ['Company', 'Application']
launchTypes: ['Company', 'Application', 'Logistics']
},
'payment-node-react': {
name: 'Node + React.js + SQLite(Payment)',
Expand All @@ -76,7 +76,8 @@ export const INIT_ACTIONS = {
export const LAUNCH_TYPES = {
COMPANY: 'Company',
APPLICATION: 'Application',
PAYMENT: 'Payment'
PAYMENT: 'Payment',
LOGISTICS: 'Logistics'
};

export function getRepoUrlForTemplate(templateName: string) {
Expand All @@ -98,6 +99,10 @@ export function getTemplateChoices(launchType: string) {
return Object.entries(TEMPLATES)
.filter(([_, template]) => template.launchTypes.some(t => t.toLowerCase() === type))
.map(([_, template]) => template.name);
} else if (type === LAUNCH_TYPES.LOGISTICS.toLowerCase()) {
return Object.entries(TEMPLATES)
.filter(([_, template]) => template.launchTypes.some(t => t.toLowerCase() === type))
.map(([_, template]) => template.name);
}
// Default to COMPANY if not matched
return Object.entries(TEMPLATES)
Expand Down
Loading