create-forgeon 0.3.21 → 0.3.22
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 +1 -1
- package/src/modules/executor.test.mjs +14 -10
- package/src/modules/files-image.mjs +21 -15
package/package.json
CHANGED
|
@@ -611,16 +611,20 @@ function assertFilesImageWiring(projectRoot) {
|
|
|
611
611
|
const filesPackage = fs.readFileSync(path.join(projectRoot, 'packages', 'files', 'package.json'), 'utf8');
|
|
612
612
|
assert.match(filesPackage, /@forgeon\/files-image/);
|
|
613
613
|
|
|
614
|
-
const filesModule = fs.readFileSync(
|
|
615
|
-
path.join(projectRoot, 'packages', 'files', 'src', 'forgeon-files.module.ts'),
|
|
616
|
-
'utf8',
|
|
617
|
-
);
|
|
618
|
-
assert.match(filesModule, /ForgeonFilesImageModule/);
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
614
|
+
const filesModule = fs.readFileSync(
|
|
615
|
+
path.join(projectRoot, 'packages', 'files', 'src', 'forgeon-files.module.ts'),
|
|
616
|
+
'utf8',
|
|
617
|
+
);
|
|
618
|
+
assert.match(filesModule, /ForgeonFilesImageModule/);
|
|
619
|
+
assert.match(
|
|
620
|
+
filesModule,
|
|
621
|
+
/imports: \[FilesConfigModule, (?:ForgeonFilesAccessModule, )?ForgeonFilesImageModule, DbPrismaModule, \.\.\.\(options\.imports \?\? \[\]\)\],/,
|
|
622
|
+
);
|
|
623
|
+
|
|
624
|
+
const filesService = fs.readFileSync(
|
|
625
|
+
path.join(projectRoot, 'packages', 'files', 'src', 'files.service.ts'),
|
|
626
|
+
'utf8',
|
|
627
|
+
);
|
|
624
628
|
assert.match(filesService, /FilesImageService/);
|
|
625
629
|
assert.match(filesService, /filesImageService\.sanitizeForStorage/);
|
|
626
630
|
assert.match(filesService, /sanitizeForStorage\({/);
|
|
@@ -115,21 +115,27 @@ function patchAppModule(targetRoot) {
|
|
|
115
115
|
fs.writeFileSync(filePath, `${content.trimEnd()}\n`, 'utf8');
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function patchFilesModule(targetRoot) {
|
|
119
|
-
const filePath = path.join(targetRoot, 'packages', 'files', 'src', 'forgeon-files.module.ts');
|
|
120
|
-
if (!fs.existsSync(filePath)) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
let content = fs.readFileSync(filePath, 'utf8').replace(/\r\n/g, '\n');
|
|
125
|
-
content = ensureImportLine(content, "import { ForgeonFilesImageModule } from '@forgeon/files-image';");
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
118
|
+
function patchFilesModule(targetRoot) {
|
|
119
|
+
const filePath = path.join(targetRoot, 'packages', 'files', 'src', 'forgeon-files.module.ts');
|
|
120
|
+
if (!fs.existsSync(filePath)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let content = fs.readFileSync(filePath, 'utf8').replace(/\r\n/g, '\n');
|
|
125
|
+
content = ensureImportLine(content, "import { ForgeonFilesImageModule } from '@forgeon/files-image';");
|
|
126
|
+
if (!content.includes('imports: [FilesConfigModule, ForgeonFilesImageModule,')) {
|
|
127
|
+
content = content.replace(
|
|
128
|
+
'imports: [FilesConfigModule, DbPrismaModule, ...(options.imports ?? [])],',
|
|
129
|
+
'imports: [FilesConfigModule, ForgeonFilesImageModule, DbPrismaModule, ...(options.imports ?? [])],',
|
|
130
|
+
);
|
|
131
|
+
content = content.replace(
|
|
132
|
+
'imports: [FilesConfigModule, ForgeonFilesAccessModule, DbPrismaModule, ...(options.imports ?? [])],',
|
|
133
|
+
'imports: [FilesConfigModule, ForgeonFilesAccessModule, ForgeonFilesImageModule, DbPrismaModule, ...(options.imports ?? [])],',
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
fs.writeFileSync(filePath, `${content.trimEnd()}\n`, 'utf8');
|
|
138
|
+
}
|
|
133
139
|
|
|
134
140
|
function patchFilesController(targetRoot) {
|
|
135
141
|
const filePath = path.join(targetRoot, 'packages', 'files', 'src', 'files.controller.ts');
|