create-forgeon 0.3.7 → 0.3.9
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/package.json
CHANGED
|
@@ -102,7 +102,7 @@ async function selectProviderForCapability({
|
|
|
102
102
|
|
|
103
103
|
const picked = await promptSelectImpl({
|
|
104
104
|
message: `Module "${moduleId}" requires capability: ${capabilityId}`,
|
|
105
|
-
defaultValue:
|
|
105
|
+
defaultValue: providers[0].id,
|
|
106
106
|
choices,
|
|
107
107
|
});
|
|
108
108
|
|
|
@@ -440,6 +440,7 @@ function assertFilesImageWiring(projectRoot) {
|
|
|
440
440
|
const appModule = fs.readFileSync(path.join(projectRoot, 'apps', 'api', 'src', 'app.module.ts'), 'utf8');
|
|
441
441
|
assert.match(appModule, /filesImageConfig/);
|
|
442
442
|
assert.match(appModule, /filesImageEnvSchema/);
|
|
443
|
+
assert.match(appModule, /ForgeonFilesImageModule/);
|
|
443
444
|
|
|
444
445
|
const apiPackage = fs.readFileSync(path.join(projectRoot, 'apps', 'api', 'package.json'), 'utf8');
|
|
445
446
|
assert.match(apiPackage, /@forgeon\/files-image/);
|
|
@@ -84,11 +84,31 @@ function patchAppModule(targetRoot) {
|
|
|
84
84
|
let content = fs.readFileSync(filePath, 'utf8').replace(/\r\n/g, '\n');
|
|
85
85
|
content = ensureImportLine(
|
|
86
86
|
content,
|
|
87
|
-
"import { filesImageConfig, filesImageEnvSchema } from '@forgeon/files-image';",
|
|
87
|
+
"import { filesImageConfig, filesImageEnvSchema, ForgeonFilesImageModule } from '@forgeon/files-image';",
|
|
88
88
|
);
|
|
89
89
|
content = ensureLoadItem(content, 'filesImageConfig');
|
|
90
90
|
content = ensureValidatorSchema(content, 'filesImageEnvSchema');
|
|
91
91
|
|
|
92
|
+
if (!content.includes(' ForgeonFilesImageModule,')) {
|
|
93
|
+
if (content.includes(' ForgeonI18nModule.register({')) {
|
|
94
|
+
content = ensureLineBefore(content, ' ForgeonI18nModule.register({', ' ForgeonFilesImageModule,');
|
|
95
|
+
} else if (content.includes(' ForgeonAuthModule.register({')) {
|
|
96
|
+
content = ensureLineBefore(content, ' ForgeonAuthModule.register({', ' ForgeonFilesImageModule,');
|
|
97
|
+
} else if (content.includes(' ForgeonAuthModule.register(),')) {
|
|
98
|
+
content = ensureLineBefore(content, ' ForgeonAuthModule.register(),', ' ForgeonFilesImageModule,');
|
|
99
|
+
} else if (content.includes(' ForgeonFilesModule,')) {
|
|
100
|
+
content = ensureLineAfter(content, ' ForgeonFilesModule,', ' ForgeonFilesImageModule,');
|
|
101
|
+
} else if (content.includes(' DbPrismaModule,')) {
|
|
102
|
+
content = ensureLineAfter(content, ' DbPrismaModule,', ' ForgeonFilesImageModule,');
|
|
103
|
+
} else if (content.includes(' ForgeonLoggerModule,')) {
|
|
104
|
+
content = ensureLineAfter(content, ' ForgeonLoggerModule,', ' ForgeonFilesImageModule,');
|
|
105
|
+
} else if (content.includes(' ForgeonSwaggerModule,')) {
|
|
106
|
+
content = ensureLineAfter(content, ' ForgeonSwaggerModule,', ' ForgeonFilesImageModule,');
|
|
107
|
+
} else {
|
|
108
|
+
content = ensureLineAfter(content, ' CoreErrorsModule,', ' ForgeonFilesImageModule,');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
92
112
|
fs.writeFileSync(filePath, `${content.trimEnd()}\n`, 'utf8');
|
|
93
113
|
}
|
|
94
114
|
|
package/src/run-add-module.mjs
CHANGED
|
@@ -147,7 +147,7 @@ async function confirmInstallPlan(moduleSequence, requestedModuleId) {
|
|
|
147
147
|
printInstallPlan(moduleSequence);
|
|
148
148
|
const picked = await promptSelect({
|
|
149
149
|
message: `Apply now for "${requestedModuleId}"?`,
|
|
150
|
-
defaultValue: '
|
|
150
|
+
defaultValue: 'apply',
|
|
151
151
|
choices: [
|
|
152
152
|
{ label: 'Yes, apply install plan', value: 'apply' },
|
|
153
153
|
{ label: 'Cancel', value: 'cancel' },
|