@azure-net/cli 2.3.61 ā 2.3.62
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/bin/azure-net.js +31 -1
- package/package.json +1 -1
- package/src/commands/generate/generateComponent.js +53 -0
- package/src/commands/generate/generateDesignComponent.js +53 -0
- package/src/commands/generate/generateModuleBase.js +152 -0
- package/src/commands/generate/generateModulePresenter.js +110 -0
- package/src/commands/generate/generateWidget.js +53 -0
- package/src/commands/generate/index.js +6 -1
package/bin/azure-net.js
CHANGED
|
@@ -21,7 +21,12 @@ import {
|
|
|
21
21
|
generatePresenter,
|
|
22
22
|
generateModule,
|
|
23
23
|
generateCrudBase,
|
|
24
|
-
generateCrudPresenter
|
|
24
|
+
generateCrudPresenter,
|
|
25
|
+
generateModuleBase,
|
|
26
|
+
generateModulePresenter,
|
|
27
|
+
generateComponent,
|
|
28
|
+
generateWidget,
|
|
29
|
+
generateDesignComponent
|
|
25
30
|
} from '../src/commands/generate/index.js';
|
|
26
31
|
|
|
27
32
|
const program = new Command();
|
|
@@ -130,4 +135,29 @@ program
|
|
|
130
135
|
.description('Generate CRUD presenter for existing service')
|
|
131
136
|
.action(generateCrudPresenter);
|
|
132
137
|
|
|
138
|
+
program
|
|
139
|
+
.command('make:module-base')
|
|
140
|
+
.description('Generate repository and service for a module')
|
|
141
|
+
.action(generateModuleBase);
|
|
142
|
+
|
|
143
|
+
program
|
|
144
|
+
.command('make:module-presenter')
|
|
145
|
+
.description('Generate presenter for existing service')
|
|
146
|
+
.action(generateModulePresenter);
|
|
147
|
+
|
|
148
|
+
program
|
|
149
|
+
.command('make:component')
|
|
150
|
+
.description('Generate UI component')
|
|
151
|
+
.action(generateComponent);
|
|
152
|
+
|
|
153
|
+
program
|
|
154
|
+
.command('make:widget')
|
|
155
|
+
.description('Generate UI widget')
|
|
156
|
+
.action(generateWidget);
|
|
157
|
+
|
|
158
|
+
program
|
|
159
|
+
.command('make:design-component')
|
|
160
|
+
.description('Generate design system component')
|
|
161
|
+
.action(generateDesignComponent);
|
|
162
|
+
|
|
133
163
|
program.parse();
|
package/package.json
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { selectContext } from '../../utils/contextUtils.js';
|
|
4
|
+
import { writeIfNotExists } from '../../utils/fileUtils.js';
|
|
5
|
+
|
|
6
|
+
const componentTemplate = `<script lang="ts">
|
|
7
|
+
\timport './style.scss';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{{componentName}}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const styleTemplate = `// Add your styles here
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export default async function generateComponent() {
|
|
17
|
+
const context = await selectContext('Select context for component:');
|
|
18
|
+
|
|
19
|
+
const { componentPath } = await prompts({
|
|
20
|
+
type: 'text',
|
|
21
|
+
name: 'componentPath',
|
|
22
|
+
message: 'Component path (e.g. reviews/modals/ReviewModal):',
|
|
23
|
+
validate: value => value.length > 0 ? true : 'Path cannot be empty'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Parse the path
|
|
27
|
+
const normalizedPath = componentPath.replace(/\\/g, '/');
|
|
28
|
+
const pathParts = normalizedPath.split('/');
|
|
29
|
+
const componentName = pathParts[pathParts.length - 1];
|
|
30
|
+
|
|
31
|
+
// Build the full path: src/app/{context}/ui/components/{path}
|
|
32
|
+
const contextUiPath = path.join(process.cwd(), 'src/app', context, 'ui/components');
|
|
33
|
+
const fullComponentPath = path.join(contextUiPath, normalizedPath);
|
|
34
|
+
|
|
35
|
+
console.log(`\nš Generating component: ${componentName}...\n`);
|
|
36
|
+
|
|
37
|
+
// Create Component.svelte
|
|
38
|
+
await writeIfNotExists(
|
|
39
|
+
path.join(fullComponentPath, 'Component.svelte'),
|
|
40
|
+
componentTemplate.replace(/{{componentName}}/g, componentName)
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Create style.scss
|
|
44
|
+
await writeIfNotExists(
|
|
45
|
+
path.join(fullComponentPath, 'style.scss'),
|
|
46
|
+
styleTemplate
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
console.log(`ā
Component created at: ${fullComponentPath}`);
|
|
50
|
+
console.log(`\nš” Files created:`);
|
|
51
|
+
console.log(` - Component.svelte`);
|
|
52
|
+
console.log(` - style.scss`);
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { selectContext } from '../../utils/contextUtils.js';
|
|
4
|
+
import { writeIfNotExists } from '../../utils/fileUtils.js';
|
|
5
|
+
|
|
6
|
+
const designComponentTemplate = `<script lang="ts">
|
|
7
|
+
\timport './style.scss';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{{componentName}}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const styleTemplate = `// Add your styles here
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export default async function generateDesignComponent() {
|
|
17
|
+
const context = await selectContext('Select context for design component:');
|
|
18
|
+
|
|
19
|
+
const { componentPath } = await prompts({
|
|
20
|
+
type: 'text',
|
|
21
|
+
name: 'componentPath',
|
|
22
|
+
message: 'Design component path (e.g. Button/Themes/PrimaryButton):',
|
|
23
|
+
validate: value => value.length > 0 ? true : 'Path cannot be empty'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Parse the path
|
|
27
|
+
const normalizedPath = componentPath.replace(/\\/g, '/');
|
|
28
|
+
const pathParts = normalizedPath.split('/');
|
|
29
|
+
const componentName = pathParts[pathParts.length - 1];
|
|
30
|
+
|
|
31
|
+
// Build the full path: src/app/{context}/ui/design/{path}
|
|
32
|
+
const contextUiPath = path.join(process.cwd(), 'src/app', context, 'ui/design');
|
|
33
|
+
const fullComponentPath = path.join(contextUiPath, normalizedPath);
|
|
34
|
+
|
|
35
|
+
console.log(`\nš Generating design component: ${componentName}...\n`);
|
|
36
|
+
|
|
37
|
+
// Create Component.svelte
|
|
38
|
+
await writeIfNotExists(
|
|
39
|
+
path.join(fullComponentPath, 'Component.svelte'),
|
|
40
|
+
designComponentTemplate.replace(/{{componentName}}/g, componentName)
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Create style.scss
|
|
44
|
+
await writeIfNotExists(
|
|
45
|
+
path.join(fullComponentPath, 'style.scss'),
|
|
46
|
+
styleTemplate
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
console.log(`ā
Design component created at: ${fullComponentPath}`);
|
|
50
|
+
console.log(`\nš” Files created:`);
|
|
51
|
+
console.log(` - Component.svelte`);
|
|
52
|
+
console.log(` - style.scss`);
|
|
53
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import {
|
|
4
|
+
selectContext,
|
|
5
|
+
getContextPath,
|
|
6
|
+
toPascalCase,
|
|
7
|
+
toCamelCase,
|
|
8
|
+
getAvailableFiles,
|
|
9
|
+
toKebabCase
|
|
10
|
+
} from '../../utils/contextUtils.js';
|
|
11
|
+
import { writeIfNotExists, updateIndexTs, updateCoreIndex } from '../../utils/fileUtils.js';
|
|
12
|
+
|
|
13
|
+
const entityTemplate = `export interface I{{name}} {
|
|
14
|
+
\tid: number;
|
|
15
|
+
\t// Add entity fields here
|
|
16
|
+
\tcreated_at: string;
|
|
17
|
+
\tupdated_at: string;
|
|
18
|
+
}`;
|
|
19
|
+
|
|
20
|
+
const repositoryTemplate = `import { {{datasource}} } from '{{datasourceImport}}';
|
|
21
|
+
|
|
22
|
+
export class {{name}}Repository {
|
|
23
|
+
\tprivate endpoint = '{{endpoint}}';
|
|
24
|
+
\t
|
|
25
|
+
\tconstructor(private {{datasourceVar}}: {{datasource}}) {}
|
|
26
|
+
\t
|
|
27
|
+
\tpublic async example() {
|
|
28
|
+
\t\treturn this.{{datasourceVar}}.createRequest(({ http }) =>
|
|
29
|
+
\t\t\thttp.get(this.endpoint)
|
|
30
|
+
\t\t).then(res => res.getData());
|
|
31
|
+
\t}
|
|
32
|
+
}`;
|
|
33
|
+
|
|
34
|
+
const serviceTemplate = `import { ClassMirror } from '@azure-net/kit';
|
|
35
|
+
import { {{name}}Repository } from '\${{context}}/infrastructure/http/repositories';
|
|
36
|
+
|
|
37
|
+
export class {{name}}Service extends ClassMirror<{{name}}Repository> {
|
|
38
|
+
\tconstructor(private {{camelName}}Repository: {{name}}Repository) {
|
|
39
|
+
\t\tsuper({{camelName}}Repository);
|
|
40
|
+
\t}
|
|
41
|
+
\t
|
|
42
|
+
\tdeclare example: {{name}}Repository['example'];
|
|
43
|
+
}`;
|
|
44
|
+
|
|
45
|
+
export default async function generateModuleBase() {
|
|
46
|
+
const context = await selectContext('Select context for module base:');
|
|
47
|
+
|
|
48
|
+
const { name } = await prompts({
|
|
49
|
+
type: 'text',
|
|
50
|
+
name: 'name',
|
|
51
|
+
message: 'Module name (PascalCase):'
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const { endpoint } = await prompts({
|
|
55
|
+
type: 'text',
|
|
56
|
+
name: 'endpoint',
|
|
57
|
+
message: 'API endpoint (e.g. /api/users):'
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const { needEntity } = await prompts({
|
|
61
|
+
type: 'confirm',
|
|
62
|
+
name: 'needEntity',
|
|
63
|
+
message: 'Create domain entity?',
|
|
64
|
+
initial: true
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Get available datasources
|
|
68
|
+
const contextPath = getContextPath(context);
|
|
69
|
+
const coreDatasources = await getAvailableFiles(
|
|
70
|
+
path.join(process.cwd(), 'src/core/datasources')
|
|
71
|
+
);
|
|
72
|
+
const contextDatasources = await getAvailableFiles(
|
|
73
|
+
path.join(contextPath, 'infrastructure/http/datasources')
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const allDatasources = [
|
|
77
|
+
...coreDatasources.map(d => ({ title: `${d} (core)`, value: { name: d, from: 'core' } })),
|
|
78
|
+
...contextDatasources.map(d => ({ title: `${d} (${context})`, value: { name: d, from: context } }))
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
const { datasource } = await prompts({
|
|
82
|
+
type: 'select',
|
|
83
|
+
name: 'datasource',
|
|
84
|
+
message: 'Select datasource:',
|
|
85
|
+
choices: allDatasources
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const pascalName = toPascalCase(name);
|
|
89
|
+
const camelName = toCamelCase(name);
|
|
90
|
+
const entityLower = toKebabCase(pascalName);
|
|
91
|
+
|
|
92
|
+
console.log('\nš Generating module base (repository & service)...\n');
|
|
93
|
+
|
|
94
|
+
// 1. Create Domain entity if needed
|
|
95
|
+
if (needEntity) {
|
|
96
|
+
const domainPath = path.join(contextPath, 'domain', entityLower);
|
|
97
|
+
const modelPath = path.join(domainPath, 'model');
|
|
98
|
+
|
|
99
|
+
await writeIfNotExists(
|
|
100
|
+
path.join(modelPath, `I${pascalName}.ts`),
|
|
101
|
+
entityTemplate.replace(/{{name}}/g, pascalName)
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
await writeIfNotExists(
|
|
105
|
+
path.join(modelPath, 'index.ts'),
|
|
106
|
+
`export * from './I${pascalName}';`
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
await writeIfNotExists(
|
|
110
|
+
path.join(domainPath, 'index.ts'),
|
|
111
|
+
`export * from './model';`
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
console.log(`ā
Domain entity I${pascalName} created`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 2. Create Repository
|
|
118
|
+
const repoPath = path.join(contextPath, 'infrastructure/http/repositories');
|
|
119
|
+
const datasourceImport = datasource.from === 'core'
|
|
120
|
+
? '$core/datasources'
|
|
121
|
+
: `\$${context}/infrastructure/http/datasources`;
|
|
122
|
+
|
|
123
|
+
await writeIfNotExists(
|
|
124
|
+
path.join(repoPath, `${pascalName}Repository.ts`),
|
|
125
|
+
repositoryTemplate
|
|
126
|
+
.replace(/{{name}}/g, pascalName)
|
|
127
|
+
.replace(/{{endpoint}}/g, endpoint)
|
|
128
|
+
.replace(/{{datasource}}/g, datasource.name)
|
|
129
|
+
.replace(/{{datasourceImport}}/g, datasourceImport)
|
|
130
|
+
.replace(/{{datasourceVar}}/g, toCamelCase(datasource.name))
|
|
131
|
+
);
|
|
132
|
+
await updateIndexTs(repoPath);
|
|
133
|
+
|
|
134
|
+
// 3. Create Service
|
|
135
|
+
const servicePath = path.join(contextPath, 'application/services');
|
|
136
|
+
await writeIfNotExists(
|
|
137
|
+
path.join(servicePath, `${pascalName}Service.ts`),
|
|
138
|
+
serviceTemplate
|
|
139
|
+
.replace(/{{name}}/g, pascalName)
|
|
140
|
+
.replace(/{{camelName}}/g, camelName)
|
|
141
|
+
.replace(/{{context}}/g, context)
|
|
142
|
+
);
|
|
143
|
+
await updateIndexTs(servicePath);
|
|
144
|
+
|
|
145
|
+
// Update core index
|
|
146
|
+
await updateCoreIndex();
|
|
147
|
+
|
|
148
|
+
console.log(`\nā
Module base for ${pascalName} created successfully!`);
|
|
149
|
+
console.log(`\nš” Remember to:`);
|
|
150
|
+
console.log(` 1. Add ${pascalName}Repository to InfrastructureProvider`);
|
|
151
|
+
console.log(` 2. Add ${pascalName}Service to ApplicationProvider`);
|
|
152
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import {
|
|
4
|
+
selectContext,
|
|
5
|
+
getContextPath,
|
|
6
|
+
toPascalCase,
|
|
7
|
+
getAvailableFiles,
|
|
8
|
+
getApplicationProviderServices,
|
|
9
|
+
toKebabCase
|
|
10
|
+
} from '../../utils/contextUtils.js';
|
|
11
|
+
import { updateIndexTs, writeIfNotExists, updateCoreIndex } from '../../utils/fileUtils.js';
|
|
12
|
+
|
|
13
|
+
const presenterWithCoreTemplate = `import { {{presenterFactory}} } from '$core/presenters';
|
|
14
|
+
import { ApplicationProvider } from '\${{context}}/application';
|
|
15
|
+
|
|
16
|
+
export const {{name}}Presenter = {{presenterFactory}}('{{name}}Presenter', ({ createAsyncResource, createAsyncAction }) => {
|
|
17
|
+
\tconst { {{serviceName}} } = ApplicationProvider();
|
|
18
|
+
\t
|
|
19
|
+
\t// Add your presenter methods here
|
|
20
|
+
\t
|
|
21
|
+
\treturn {};
|
|
22
|
+
});`;
|
|
23
|
+
|
|
24
|
+
const presenterWithoutCoreTemplate = `import { createPresenter } from '@azure-net/kit';
|
|
25
|
+
import { ApplicationProvider } from '\${{context}}/application';
|
|
26
|
+
|
|
27
|
+
export const {{name}}Presenter = createPresenter('{{name}}Presenter', () => {
|
|
28
|
+
\tconst { {{serviceName}} } = ApplicationProvider();
|
|
29
|
+
\t
|
|
30
|
+
\t// Add your presenter methods here
|
|
31
|
+
\t
|
|
32
|
+
\treturn {};
|
|
33
|
+
});`;
|
|
34
|
+
|
|
35
|
+
export default async function generateModulePresenter() {
|
|
36
|
+
const context = await selectContext('Select context for module presenter:');
|
|
37
|
+
|
|
38
|
+
// Get available services from ApplicationProvider
|
|
39
|
+
const services = await getApplicationProviderServices(context);
|
|
40
|
+
|
|
41
|
+
if (services.length === 0) {
|
|
42
|
+
console.error('ā No services found in ApplicationProvider. Add services manually first.');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const { service } = await prompts({
|
|
47
|
+
type: 'select',
|
|
48
|
+
name: 'service',
|
|
49
|
+
message: 'Select service for presenter:',
|
|
50
|
+
choices: services.map(s => ({ title: s, value: s }))
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const { moduleName } = await prompts({
|
|
54
|
+
type: 'text',
|
|
55
|
+
name: 'moduleName',
|
|
56
|
+
message: 'Module name for presenter (will create folder in delivery):'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Extract entity name from service name
|
|
60
|
+
const pascalName = toPascalCase(moduleName);
|
|
61
|
+
const entityLower = toKebabCase(pascalName);
|
|
62
|
+
|
|
63
|
+
// Get presenter factory
|
|
64
|
+
const corePresenters = await getAvailableFiles(
|
|
65
|
+
path.join(process.cwd(), 'src/core/presenters')
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const { presenterType } = await prompts({
|
|
69
|
+
type: 'select',
|
|
70
|
+
name: 'presenterType',
|
|
71
|
+
message: 'Select presenter factory:',
|
|
72
|
+
choices: [
|
|
73
|
+
{ title: 'Use createPresenter from package', value: 'package' },
|
|
74
|
+
...corePresenters.map(p => ({ title: `Use ${p} from core`, value: p }))
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const contextPath = getContextPath(context);
|
|
79
|
+
const deliveryModulePath = path.join(contextPath, 'delivery', entityLower);
|
|
80
|
+
|
|
81
|
+
console.log('\nš Generating module presenter...\n');
|
|
82
|
+
|
|
83
|
+
// Create Presenter
|
|
84
|
+
const presenterTemplate = presenterType === 'package'
|
|
85
|
+
? presenterWithoutCoreTemplate
|
|
86
|
+
: presenterWithCoreTemplate;
|
|
87
|
+
|
|
88
|
+
const presenterFactory = presenterType === 'package' ? 'createPresenter' : presenterType;
|
|
89
|
+
|
|
90
|
+
await writeIfNotExists(
|
|
91
|
+
path.join(deliveryModulePath, `${pascalName}Presenter.ts`),
|
|
92
|
+
presenterTemplate
|
|
93
|
+
.replace(/{{name}}/g, pascalName)
|
|
94
|
+
.replace(/{{context}}/g, context)
|
|
95
|
+
.replace(/{{serviceName}}/g, service)
|
|
96
|
+
.replace(/{{presenterFactory}}/g, presenterFactory)
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
// Create module index
|
|
100
|
+
await writeIfNotExists(
|
|
101
|
+
path.join(deliveryModulePath, 'index.ts'),
|
|
102
|
+
`export * from './${pascalName}Presenter';`
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
// Update core index
|
|
106
|
+
await updateCoreIndex();
|
|
107
|
+
|
|
108
|
+
console.log(`ā
Module presenter for ${pascalName} created successfully!`);
|
|
109
|
+
console.log(`\nš” Remember to add presenter methods using the ${service}.`);
|
|
110
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { selectContext } from '../../utils/contextUtils.js';
|
|
4
|
+
import { writeIfNotExists } from '../../utils/fileUtils.js';
|
|
5
|
+
|
|
6
|
+
const widgetTemplate = `<script lang="ts">
|
|
7
|
+
\timport './style.scss';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{{widgetName}}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const styleTemplate = `// Add your styles here
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export default async function generateWidget() {
|
|
17
|
+
const context = await selectContext('Select context for widget:');
|
|
18
|
+
|
|
19
|
+
const { widgetPath } = await prompts({
|
|
20
|
+
type: 'text',
|
|
21
|
+
name: 'widgetPath',
|
|
22
|
+
message: 'Widget path (e.g. modals/ConfirmModal):',
|
|
23
|
+
validate: value => value.length > 0 ? true : 'Path cannot be empty'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Parse the path
|
|
27
|
+
const normalizedPath = widgetPath.replace(/\\/g, '/');
|
|
28
|
+
const pathParts = normalizedPath.split('/');
|
|
29
|
+
const widgetName = pathParts[pathParts.length - 1];
|
|
30
|
+
|
|
31
|
+
// Build the full path: src/app/{context}/ui/widgets/{path}
|
|
32
|
+
const contextUiPath = path.join(process.cwd(), 'src/app', context, 'ui/widgets');
|
|
33
|
+
const fullWidgetPath = path.join(contextUiPath, normalizedPath);
|
|
34
|
+
|
|
35
|
+
console.log(`\nš Generating widget: ${widgetName}...\n`);
|
|
36
|
+
|
|
37
|
+
// Create Component.svelte
|
|
38
|
+
await writeIfNotExists(
|
|
39
|
+
path.join(fullWidgetPath, 'Component.svelte'),
|
|
40
|
+
widgetTemplate.replace(/{{widgetName}}/g, widgetName)
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Create style.scss
|
|
44
|
+
await writeIfNotExists(
|
|
45
|
+
path.join(fullWidgetPath, 'style.scss'),
|
|
46
|
+
styleTemplate
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
console.log(`ā
Widget created at: ${fullWidgetPath}`);
|
|
50
|
+
console.log(`\nš” Files created:`);
|
|
51
|
+
console.log(` - Component.svelte`);
|
|
52
|
+
console.log(` - style.scss`);
|
|
53
|
+
}
|
|
@@ -6,4 +6,9 @@ export { default as generateSchema } from './generateSchema.js';
|
|
|
6
6
|
export { default as generatePresenter } from './generatePresenter.js';
|
|
7
7
|
export { default as generateModule } from './generateModule.js';
|
|
8
8
|
export { default as generateCrudBase } from './generateCrudBase.js';
|
|
9
|
-
export { default as generateCrudPresenter } from './generateCrudPresenter.js';
|
|
9
|
+
export { default as generateCrudPresenter } from './generateCrudPresenter.js';
|
|
10
|
+
export { default as generateModuleBase } from './generateModuleBase.js';
|
|
11
|
+
export { default as generateModulePresenter } from './generateModulePresenter.js';
|
|
12
|
+
export { default as generateComponent } from './generateComponent.js';
|
|
13
|
+
export { default as generateWidget } from './generateWidget.js';
|
|
14
|
+
export { default as generateDesignComponent } from './generateDesignComponent.js';
|