@avora-labs/cli 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +218 -0
- package/bin/avora.mjs +5 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +64 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.command.d.ts +3 -0
- package/dist/commands/add.command.d.ts.map +1 -0
- package/dist/commands/add.command.js +83 -0
- package/dist/commands/add.command.js.map +1 -0
- package/dist/commands/config.command.d.ts +3 -0
- package/dist/commands/config.command.d.ts.map +1 -0
- package/dist/commands/config.command.js +71 -0
- package/dist/commands/config.command.js.map +1 -0
- package/dist/commands/generate.command.d.ts +3 -0
- package/dist/commands/generate.command.d.ts.map +1 -0
- package/dist/commands/generate.command.js +258 -0
- package/dist/commands/generate.command.js.map +1 -0
- package/dist/commands/info.command.d.ts +3 -0
- package/dist/commands/info.command.d.ts.map +1 -0
- package/dist/commands/info.command.js +92 -0
- package/dist/commands/info.command.js.map +1 -0
- package/dist/commands/init.command.d.ts +3 -0
- package/dist/commands/init.command.d.ts.map +1 -0
- package/dist/commands/init.command.js +230 -0
- package/dist/commands/init.command.js.map +1 -0
- package/dist/commands/new.command.d.ts +3 -0
- package/dist/commands/new.command.d.ts.map +1 -0
- package/dist/commands/new.command.js +50 -0
- package/dist/commands/new.command.js.map +1 -0
- package/dist/commands/plugin.command.d.ts +3 -0
- package/dist/commands/plugin.command.d.ts.map +1 -0
- package/dist/commands/plugin.command.js +153 -0
- package/dist/commands/plugin.command.js.map +1 -0
- package/dist/commands/remove.command.d.ts +3 -0
- package/dist/commands/remove.command.d.ts.map +1 -0
- package/dist/commands/remove.command.js +89 -0
- package/dist/commands/remove.command.js.map +1 -0
- package/dist/registry/amf-config.d.ts +31 -0
- package/dist/registry/amf-config.d.ts.map +1 -0
- package/dist/registry/amf-config.js +97 -0
- package/dist/registry/amf-config.js.map +1 -0
- package/dist/registry/meta-registry.d.ts +105 -0
- package/dist/registry/meta-registry.d.ts.map +1 -0
- package/dist/registry/meta-registry.js +364 -0
- package/dist/registry/meta-registry.js.map +1 -0
- package/dist/schematics/app/app.schematic.d.ts +3 -0
- package/dist/schematics/app/app.schematic.d.ts.map +1 -0
- package/dist/schematics/app/app.schematic.js +149 -0
- package/dist/schematics/app/app.schematic.js.map +1 -0
- package/dist/schematics/form/form.schematic.d.ts +4 -0
- package/dist/schematics/form/form.schematic.d.ts.map +1 -0
- package/dist/schematics/form/form.schematic.js +100 -0
- package/dist/schematics/form/form.schematic.js.map +1 -0
- package/dist/schematics/page/page.schematic.d.ts +3 -0
- package/dist/schematics/page/page.schematic.d.ts.map +1 -0
- package/dist/schematics/page/page.schematic.js +147 -0
- package/dist/schematics/page/page.schematic.js.map +1 -0
- package/dist/schematics/table/table.schematic.d.ts +3 -0
- package/dist/schematics/table/table.schematic.d.ts.map +1 -0
- package/dist/schematics/table/table.schematic.js +58 -0
- package/dist/schematics/table/table.schematic.js.map +1 -0
- package/dist/types/cli.types.d.ts +104 -0
- package/dist/types/cli.types.d.ts.map +1 -0
- package/dist/types/cli.types.js +3 -0
- package/dist/types/cli.types.js.map +1 -0
- package/dist/utils/credentials.d.ts +19 -0
- package/dist/utils/credentials.d.ts.map +1 -0
- package/dist/utils/credentials.js +99 -0
- package/dist/utils/credentials.js.map +1 -0
- package/dist/utils/diff.d.ts +11 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +45 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/file-utils.d.ts +11 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +30 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/dist/utils/logger.d.ts +21 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +63 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/prompt.d.ts +8 -0
- package/dist/utils/prompt.d.ts.map +1 -0
- package/dist/utils/prompt.js +63 -0
- package/dist/utils/prompt.js.map +1 -0
- package/dist/utils/template-engine.d.ts +9 -0
- package/dist/utils/template-engine.d.ts.map +1 -0
- package/dist/utils/template-engine.js +23 -0
- package/dist/utils/template-engine.js.map +1 -0
- package/dist/utils/transaction.d.ts +37 -0
- package/dist/utils/transaction.d.ts.map +1 -0
- package/dist/utils/transaction.js +94 -0
- package/dist/utils/transaction.js.map +1 -0
- package/package.json +66 -0
- package/templates/app/app.component.ts.ejs +9 -0
- package/templates/app/app.config.ts.ejs +27 -0
- package/templates/app/app.meta.ts.ejs +58 -0
- package/templates/app/app.routes.ts.ejs +9 -0
- package/templates/app/dashboard.page.ts.ejs +61 -0
- package/templates/form/form.meta.ts.ejs +77 -0
- package/templates/page/page.meta.ts.ejs +112 -0
- package/templates/table/table.meta.ts.ejs +78 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { FormMeta } from '@avora-labs/meta-forge';
|
|
2
|
+
|
|
3
|
+
export const <%= camelName %>: FormMeta = {
|
|
4
|
+
id: '<%= formId %>',
|
|
5
|
+
layout: '<%= layout %>',
|
|
6
|
+
<% if (layout === 'grid') { %>
|
|
7
|
+
columns: <%= columns %>,
|
|
8
|
+
<% } %>
|
|
9
|
+
<% if (apiEndpoint) { %>
|
|
10
|
+
apiEndpoint: '<%= apiEndpoint %>',
|
|
11
|
+
apiMethod: 'POST',
|
|
12
|
+
<% } %>
|
|
13
|
+
<%
|
|
14
|
+
function renderFields(fields) {
|
|
15
|
+
let output = '';
|
|
16
|
+
for (let i = 0; i < fields.length; i++) {
|
|
17
|
+
const f = fields[i];
|
|
18
|
+
if (f.type === 'repeater') {
|
|
19
|
+
output += `{ key: '${f.key}', label: '${f.label}', type: 'repeater', children: [\n`;
|
|
20
|
+
output += renderFields(f.children).split('\n').map(l => ' ' + l).join('\n');
|
|
21
|
+
output += `\n] }`;
|
|
22
|
+
} else {
|
|
23
|
+
let extra = f.key === 'name' ? ", validators: [{ type: 'required' }]" : "";
|
|
24
|
+
output += `{ key: '${f.key}', label: '${f.label}', type: '${f.type}'${extra} }`;
|
|
25
|
+
}
|
|
26
|
+
if (i < fields.length - 1) output += ',\n';
|
|
27
|
+
}
|
|
28
|
+
return output;
|
|
29
|
+
}
|
|
30
|
+
%>
|
|
31
|
+
fields: [
|
|
32
|
+
<%- renderFields(parsedFields).split('\n').map(l => ' ' + l).join('\n').trim() %>,
|
|
33
|
+
// Add more FieldMeta entries here
|
|
34
|
+
// Supported types: text, email, password, number, select, multi-select,
|
|
35
|
+
// radio, checkbox, toggle, date, datetime, file, textarea, otp,
|
|
36
|
+
// currency, range, rich-text, repeater, group, ...
|
|
37
|
+
],
|
|
38
|
+
<% if (stepper) { %>
|
|
39
|
+
steps: [
|
|
40
|
+
<% for (let i = 0; i < steps; i++) { %>
|
|
41
|
+
{
|
|
42
|
+
title: 'Step <%= i + 1 %>',
|
|
43
|
+
description: 'Step <%= i + 1 %> description',
|
|
44
|
+
fields: [], // add field keys from the fields array above
|
|
45
|
+
validate: true
|
|
46
|
+
},
|
|
47
|
+
<% } %>
|
|
48
|
+
],
|
|
49
|
+
<% } %>
|
|
50
|
+
onSubmit: {
|
|
51
|
+
type: 'dispatch-multiple',
|
|
52
|
+
config: {
|
|
53
|
+
mode: 'sequential',
|
|
54
|
+
actions: [
|
|
55
|
+
<% if (apiEndpoint) { %>
|
|
56
|
+
{
|
|
57
|
+
type: 'api',
|
|
58
|
+
config: {
|
|
59
|
+
endpointId: '<%= apiEndpoint %>',
|
|
60
|
+
method: 'POST',
|
|
61
|
+
body: 'formValue',
|
|
62
|
+
storeResultAs: '<%= formId %>Result'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
<% } %>
|
|
66
|
+
{
|
|
67
|
+
type: 'notify',
|
|
68
|
+
config: { type: 'success', message: '<%= titleName %> saved successfully!' }
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
onCancel: {
|
|
74
|
+
type: 'go-back',
|
|
75
|
+
config: {}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { AppMeta } from '@avora-labs/meta-forge';
|
|
2
|
+
type Pages = AppMeta['pages'];
|
|
3
|
+
type PageMeta = Pages[number];
|
|
4
|
+
<% if (sections.includes('form')) { %>
|
|
5
|
+
// TODO: Replace with an imported form configuration generated via 'avora generate form'
|
|
6
|
+
<% } %>
|
|
7
|
+
|
|
8
|
+
export const <%= camelName %>: PageMeta = {
|
|
9
|
+
id: '<%= kebabName %>',
|
|
10
|
+
path: '<%= routePath %>',
|
|
11
|
+
title: '<%= titleName %>',
|
|
12
|
+
layout: '<%= layout %>',
|
|
13
|
+
<% if (guard) { %>
|
|
14
|
+
guard: { requireAuth: true, redirectTo: '/login' },
|
|
15
|
+
<% } %>
|
|
16
|
+
sections: [
|
|
17
|
+
<% if (sections.includes('page-header')) { %>
|
|
18
|
+
{
|
|
19
|
+
type: 'page-header',
|
|
20
|
+
config: {
|
|
21
|
+
title: '<%= titleName %>',
|
|
22
|
+
subtitle: 'Manage <%= titleName %>',
|
|
23
|
+
actions: [
|
|
24
|
+
// {
|
|
25
|
+
// label: 'Add <%= titleName %>',
|
|
26
|
+
// icon: 'plus',
|
|
27
|
+
// variant: 'primary',
|
|
28
|
+
// action: { type: 'navigate', config: { path: '/<%= routePath %>/new' } }
|
|
29
|
+
// }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
<% } %>
|
|
34
|
+
<% if (sections.includes('stats-grid')) { %>
|
|
35
|
+
{
|
|
36
|
+
type: 'stats-grid',
|
|
37
|
+
config: {
|
|
38
|
+
stats: [
|
|
39
|
+
{ label: 'Total', value: '0', icon: 'layers', color: '#6366f1' },
|
|
40
|
+
{ label: 'Active', value: '0', icon: 'check-circle', color: '#22c55e' },
|
|
41
|
+
],
|
|
42
|
+
columns: 4
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
<% } %>
|
|
46
|
+
<% if (sections.includes('table')) { %>
|
|
47
|
+
{
|
|
48
|
+
type: 'table',
|
|
49
|
+
id: '<%= kebabName %>-table',
|
|
50
|
+
config: {
|
|
51
|
+
<% if (pagination) { %>
|
|
52
|
+
pagination: true,
|
|
53
|
+
<% } %>
|
|
54
|
+
columns: [
|
|
55
|
+
{ key: 'id', label: 'ID', type: 'text' },
|
|
56
|
+
{ key: 'name', label: 'Name', type: 'text' }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
<% } else if (sections.includes('form')) { %>
|
|
61
|
+
{
|
|
62
|
+
type: 'form',
|
|
63
|
+
id: '<%= kebabName %>-form',
|
|
64
|
+
config: {
|
|
65
|
+
fields: [
|
|
66
|
+
{ key: 'name', label: 'Name', type: 'text', validators: [{ type: 'required' }] }
|
|
67
|
+
],
|
|
68
|
+
onSubmit: { type: 'notify', config: { type: 'success', message: 'Submitted!' } }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
<% } else if (sections.includes('stepper-form')) { %>
|
|
72
|
+
{
|
|
73
|
+
type: 'stepper-form',
|
|
74
|
+
id: '<%= kebabName %>-stepper',
|
|
75
|
+
config: {
|
|
76
|
+
fields: [],
|
|
77
|
+
steps: [
|
|
78
|
+
{ title: 'Step 1', fields: [] },
|
|
79
|
+
{ title: 'Step 2', fields: [] },
|
|
80
|
+
{ title: 'Review', fields: [] },
|
|
81
|
+
],
|
|
82
|
+
onSubmit: { type: 'notify', config: { type: 'success', message: 'Submitted!' } }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
<% } else if (sections.includes('accordion')) { %>
|
|
86
|
+
{
|
|
87
|
+
type: 'accordion',
|
|
88
|
+
config: {
|
|
89
|
+
panels: [
|
|
90
|
+
{
|
|
91
|
+
title: 'Section 1',
|
|
92
|
+
sections: [{ type: 'form', config: { fields: [] } }]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
<% } else if (sections.includes('card')) { %>
|
|
98
|
+
{
|
|
99
|
+
type: 'card',
|
|
100
|
+
config: {
|
|
101
|
+
title: '<%= titleName %>',
|
|
102
|
+
content: 'Card content goes here.',
|
|
103
|
+
variant: 'default'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
<% } else { %>
|
|
107
|
+
// TODO: Add sections here
|
|
108
|
+
// { type: 'form', config: { fields: [] } }
|
|
109
|
+
// { type: 'table', config: { columns: [] } }
|
|
110
|
+
<% } %>
|
|
111
|
+
]
|
|
112
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { TableMeta } from '@avora-labs/meta-forge';
|
|
2
|
+
|
|
3
|
+
export const <%= camelName %>: TableMeta = {
|
|
4
|
+
id: '<%= tableId %>',
|
|
5
|
+
<% if (apiEndpoint) { %>
|
|
6
|
+
apiEndpoint: '<%= apiEndpoint %>',
|
|
7
|
+
<% } %>
|
|
8
|
+
columns: [
|
|
9
|
+
<% columns.forEach(col => { %>
|
|
10
|
+
{
|
|
11
|
+
key: '<%= col.key %>',
|
|
12
|
+
label: '<%= col.label %>',
|
|
13
|
+
<% if (col.type !== 'text') { %>
|
|
14
|
+
type: '<%= col.type %>',
|
|
15
|
+
<% } %>
|
|
16
|
+
<% if (col.sortable) { %>
|
|
17
|
+
sortable: true,
|
|
18
|
+
<% } %>
|
|
19
|
+
},
|
|
20
|
+
<% }) %>
|
|
21
|
+
],
|
|
22
|
+
|
|
23
|
+
// ── Row Actions ────────────────────────────────────────────────────────────
|
|
24
|
+
actions: {
|
|
25
|
+
row: [
|
|
26
|
+
{
|
|
27
|
+
label: 'Edit',
|
|
28
|
+
icon: 'pencil',
|
|
29
|
+
variant: 'ghost',
|
|
30
|
+
action: {
|
|
31
|
+
type: 'navigate',
|
|
32
|
+
config: { path: '/<%= kebabName %>/{{row.id}}/edit' }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Delete',
|
|
37
|
+
icon: 'trash-2',
|
|
38
|
+
variant: 'danger',
|
|
39
|
+
action: {
|
|
40
|
+
type: 'confirm',
|
|
41
|
+
config: {
|
|
42
|
+
title: 'Delete Item',
|
|
43
|
+
message: 'Are you sure you want to delete this item?',
|
|
44
|
+
variant: 'danger',
|
|
45
|
+
onConfirm: {
|
|
46
|
+
type: 'notify',
|
|
47
|
+
config: { type: 'success', message: 'Item deleted!' }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
toolbar: [
|
|
54
|
+
{
|
|
55
|
+
label: 'Add New',
|
|
56
|
+
icon: 'plus',
|
|
57
|
+
variant: 'primary',
|
|
58
|
+
action: {
|
|
59
|
+
type: 'navigate',
|
|
60
|
+
config: { path: '/<%= kebabName %>/new' }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
bulk: []
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// ── Pagination ─────────────────────────────────────────────────────────────
|
|
68
|
+
pagination: {
|
|
69
|
+
enabled: true,
|
|
70
|
+
pageSize: 10,
|
|
71
|
+
pageSizeOptions: [10, 25, 50, 100]
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// ── Features ───────────────────────────────────────────────────────────────
|
|
75
|
+
searchable: true,
|
|
76
|
+
selectable: false,
|
|
77
|
+
exportable: false,
|
|
78
|
+
};
|