@valbuild/server 0.127.0 → 0.129.0
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @valbuild/server
|
|
2
2
|
|
|
3
|
+
## 0.129.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`e20f6fb`](https://github.com/valbuild/val/commit/e20f6fbcc215c310eef49a44c1a592c1e2081613), [`7d34ecc`](https://github.com/valbuild/val/commit/7d34ecce787a0709025ae7b4764cb6c3ad1f766b), [`0c351c4`](https://github.com/valbuild/val/commit/0c351c4f97ae7f09772eab0e856ae69821b803b7), [`41a0d76`](https://github.com/valbuild/val/commit/41a0d76636a2dce3f1e506d93170d97e46041d98), [`9e0ebb0`](https://github.com/valbuild/val/commit/9e0ebb00430f05ef92dff031309f73b8075a7d99)]:
|
|
8
|
+
- @valbuild/ui@0.129.0
|
|
9
|
+
- @valbuild/core@0.129.0
|
|
10
|
+
- @valbuild/shared@0.129.0
|
|
11
|
+
|
|
12
|
+
## 0.128.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`8b52b33`](https://github.com/valbuild/val/commit/8b52b33e1f629f14f66cc71dcc7cf415d210c7d4), [`362fb49`](https://github.com/valbuild/val/commit/362fb49f30d2b04c4ff78d54dca2bf5ad978a05c), [`c595799`](https://github.com/valbuild/val/commit/c59579977a436ec530c6c69f2b340ab9829d97ab)]:
|
|
17
|
+
- @valbuild/core@0.128.0
|
|
18
|
+
- @valbuild/shared@0.128.0
|
|
19
|
+
- @valbuild/ui@0.127.0
|
|
20
|
+
|
|
3
21
|
## 0.127.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -184,7 +184,7 @@ export declare function handleUniqueFolderCheck(ctx: FixHandlerContext): Promise
|
|
|
184
184
|
*/
|
|
185
185
|
export declare function checkGalleryFiles(input: {
|
|
186
186
|
entryKeys: string[];
|
|
187
|
-
|
|
187
|
+
dir: string;
|
|
188
188
|
projectRoot: string;
|
|
189
189
|
fs: Pick<IValFSHost, "fileExists" | "readDirectory">;
|
|
190
190
|
}): {
|
|
@@ -3189,8 +3189,8 @@ class ValOps {
|
|
|
3189
3189
|
if (sourceForModule !== undefined) {
|
|
3190
3190
|
snapshot.sources[moduleFilePath] = sourceForModule;
|
|
3191
3191
|
}
|
|
3192
|
-
if (serialized.type === "record" && serialized.mediaType && serialized.
|
|
3193
|
-
const dir = serialized.
|
|
3192
|
+
if (serialized.type === "record" && serialized.mediaType && serialized.dir) {
|
|
3193
|
+
const dir = serialized.dir;
|
|
3194
3194
|
const existing = galleryDirectoryToModules.get(dir);
|
|
3195
3195
|
if (existing) {
|
|
3196
3196
|
existing.push(moduleFilePath);
|
|
@@ -3284,10 +3284,10 @@ class ValOps {
|
|
|
3284
3284
|
typeError: true
|
|
3285
3285
|
});
|
|
3286
3286
|
} else {
|
|
3287
|
-
const directory = "
|
|
3287
|
+
const directory = "dir" in validationError.value && validationError.value.dir;
|
|
3288
3288
|
if (typeof directory !== "string") {
|
|
3289
3289
|
addError({
|
|
3290
|
-
message: `Expected gallery validation error 'value' to have property '
|
|
3290
|
+
message: `Expected gallery validation error 'value' to have property 'dir' of type 'string'. Found: ${typeof directory}. ${TYPE_ERROR_MESSAGE}`,
|
|
3291
3291
|
typeError: true
|
|
3292
3292
|
});
|
|
3293
3293
|
} else {
|
|
@@ -14964,7 +14964,7 @@ async function handleRemoteFileUpload(ctx) {
|
|
|
14964
14964
|
return uploadRemoteFileCore(ctx, fileRefProp, fileSourceMetadata, resolveRemoteFileSchema);
|
|
14965
14965
|
}
|
|
14966
14966
|
|
|
14967
|
-
// Gallery (s.
|
|
14967
|
+
// Gallery (s.imageset({ ... }).remote() / s.fileset({ ... }).remote()) upload.
|
|
14968
14968
|
// Unlike a single image/file field, a gallery entry is keyed by its local file
|
|
14969
14969
|
// path and the value is bare metadata (no FileSource), so we derive the file
|
|
14970
14970
|
// ref from the key and synthesize the image/file schema from the record's
|
|
@@ -15005,10 +15005,10 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
15005
15005
|
// synthesize the serialized image/file schema (matching how single fields
|
|
15006
15006
|
// serialize) for the remote ref's validation hash.
|
|
15007
15007
|
//
|
|
15008
|
-
// `accept`/`
|
|
15008
|
+
// `accept`/`dir` come from the RECORD that holds the entry, resolved
|
|
15009
15009
|
// from the entry's PARENT path - not from the module root, which is only the
|
|
15010
15010
|
// record when the gallery is the whole module. A nested gallery
|
|
15011
|
-
// (s.object({ gallery: s.
|
|
15011
|
+
// (s.object({ gallery: s.imageset(...) })) would otherwise synthesize a schema
|
|
15012
15012
|
// with no options and bake a validation hash into the remote ref that can
|
|
15013
15013
|
// never validate, so a mismatch fails fast instead of uploading.
|
|
15014
15014
|
const [, parentModulePath] = core.Internal.splitModuleFilePathAndModulePath(core.Internal.parentOfSourcePath(ctx.sourcePath));
|
|
@@ -15021,7 +15021,7 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
15021
15021
|
}
|
|
15022
15022
|
const {
|
|
15023
15023
|
accept,
|
|
15024
|
-
|
|
15024
|
+
dir
|
|
15025
15025
|
} = recordSchema;
|
|
15026
15026
|
const schema = mediaType === "image" ? {
|
|
15027
15027
|
type: "image",
|
|
@@ -15030,8 +15030,8 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
15030
15030
|
...(accept ? {
|
|
15031
15031
|
accept
|
|
15032
15032
|
} : {}),
|
|
15033
|
-
...(
|
|
15034
|
-
|
|
15033
|
+
...(dir ? {
|
|
15034
|
+
dir
|
|
15035
15035
|
} : {})
|
|
15036
15036
|
}
|
|
15037
15037
|
} : {
|
|
@@ -15071,14 +15071,14 @@ async function handleRemoteFileCheck() {
|
|
|
15071
15071
|
}
|
|
15072
15072
|
async function handleUniqueFolderCheck(ctx) {
|
|
15073
15073
|
const value = ctx.validationError.value;
|
|
15074
|
-
if (!value || typeof value.
|
|
15074
|
+
if (!value || typeof value.dir !== "string") {
|
|
15075
15075
|
return {
|
|
15076
15076
|
success: false,
|
|
15077
15077
|
errorMessage: `Unexpected value in unique folder check for ${ctx.sourcePath}`
|
|
15078
15078
|
};
|
|
15079
15079
|
}
|
|
15080
15080
|
const {
|
|
15081
|
-
|
|
15081
|
+
dir
|
|
15082
15082
|
} = value;
|
|
15083
15083
|
const conflicts = [];
|
|
15084
15084
|
for (const file of ctx.valFiles) {
|
|
@@ -15088,14 +15088,14 @@ async function handleUniqueFolderCheck(ctx) {
|
|
|
15088
15088
|
validate: false
|
|
15089
15089
|
});
|
|
15090
15090
|
const schema = otherModule.schema;
|
|
15091
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.
|
|
15091
|
+
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.dir === dir && schema.mediaType) {
|
|
15092
15092
|
conflicts.push(otherModuleFilePath);
|
|
15093
15093
|
}
|
|
15094
15094
|
}
|
|
15095
15095
|
if (conflicts.length > 0) {
|
|
15096
15096
|
return {
|
|
15097
15097
|
success: false,
|
|
15098
|
-
errorMessage: `Gallery directory '${
|
|
15098
|
+
errorMessage: `Gallery directory '${dir}' in ${ctx.moduleFilePath} is also used by: ${conflicts.join(", ")}. Each gallery must use a unique directory.`
|
|
15099
15099
|
};
|
|
15100
15100
|
}
|
|
15101
15101
|
return {
|
|
@@ -15125,7 +15125,7 @@ async function handleUniqueFolderCheck(ctx) {
|
|
|
15125
15125
|
*/
|
|
15126
15126
|
function checkGalleryFiles(input) {
|
|
15127
15127
|
const {
|
|
15128
|
-
|
|
15128
|
+
dir,
|
|
15129
15129
|
projectRoot,
|
|
15130
15130
|
fs
|
|
15131
15131
|
} = input;
|
|
@@ -15134,7 +15134,7 @@ function checkGalleryFiles(input) {
|
|
|
15134
15134
|
const missingTrackedFiles = entries.filter(entry => !entry.remote && !fs.fileExists(path__namespace["default"].join(projectRoot, entry.localPath))).map(entry => entry.localPath);
|
|
15135
15135
|
const filesInDir = [];
|
|
15136
15136
|
try {
|
|
15137
|
-
const found = fs.readDirectory(path__namespace["default"].join(projectRoot,
|
|
15137
|
+
const found = fs.readDirectory(path__namespace["default"].join(projectRoot, dir), undefined, undefined, ["**/*"]);
|
|
15138
15138
|
for (const entry of found) {
|
|
15139
15139
|
filesInDir.push("/" + path__namespace["default"].relative(projectRoot, entry).split(path__namespace["default"].sep).join("/"));
|
|
15140
15140
|
}
|
|
@@ -15148,14 +15148,14 @@ function checkGalleryFiles(input) {
|
|
|
15148
15148
|
}
|
|
15149
15149
|
async function handleCheckAllFiles(ctx) {
|
|
15150
15150
|
const value = ctx.validationError.value;
|
|
15151
|
-
if (!value || typeof value.
|
|
15151
|
+
if (!value || typeof value.dir !== "string") {
|
|
15152
15152
|
return {
|
|
15153
15153
|
success: false,
|
|
15154
15154
|
errorMessage: `Unexpected value in check-all-files for ${ctx.sourcePath}`
|
|
15155
15155
|
};
|
|
15156
15156
|
}
|
|
15157
15157
|
const {
|
|
15158
|
-
|
|
15158
|
+
dir
|
|
15159
15159
|
} = value;
|
|
15160
15160
|
const source = ctx.valModule.source;
|
|
15161
15161
|
if (!source || typeof source !== "object" || Array.isArray(source)) {
|
|
@@ -15169,7 +15169,7 @@ async function handleCheckAllFiles(ctx) {
|
|
|
15169
15169
|
untrackedFiles
|
|
15170
15170
|
} = checkGalleryFiles({
|
|
15171
15171
|
entryKeys: Object.keys(source),
|
|
15172
|
-
|
|
15172
|
+
dir,
|
|
15173
15173
|
projectRoot: ctx.projectRoot,
|
|
15174
15174
|
fs: ctx.fs
|
|
15175
15175
|
});
|
|
@@ -3189,8 +3189,8 @@ class ValOps {
|
|
|
3189
3189
|
if (sourceForModule !== undefined) {
|
|
3190
3190
|
snapshot.sources[moduleFilePath] = sourceForModule;
|
|
3191
3191
|
}
|
|
3192
|
-
if (serialized.type === "record" && serialized.mediaType && serialized.
|
|
3193
|
-
const dir = serialized.
|
|
3192
|
+
if (serialized.type === "record" && serialized.mediaType && serialized.dir) {
|
|
3193
|
+
const dir = serialized.dir;
|
|
3194
3194
|
const existing = galleryDirectoryToModules.get(dir);
|
|
3195
3195
|
if (existing) {
|
|
3196
3196
|
existing.push(moduleFilePath);
|
|
@@ -3284,10 +3284,10 @@ class ValOps {
|
|
|
3284
3284
|
typeError: true
|
|
3285
3285
|
});
|
|
3286
3286
|
} else {
|
|
3287
|
-
const directory = "
|
|
3287
|
+
const directory = "dir" in validationError.value && validationError.value.dir;
|
|
3288
3288
|
if (typeof directory !== "string") {
|
|
3289
3289
|
addError({
|
|
3290
|
-
message: `Expected gallery validation error 'value' to have property '
|
|
3290
|
+
message: `Expected gallery validation error 'value' to have property 'dir' of type 'string'. Found: ${typeof directory}. ${TYPE_ERROR_MESSAGE}`,
|
|
3291
3291
|
typeError: true
|
|
3292
3292
|
});
|
|
3293
3293
|
} else {
|
|
@@ -14964,7 +14964,7 @@ async function handleRemoteFileUpload(ctx) {
|
|
|
14964
14964
|
return uploadRemoteFileCore(ctx, fileRefProp, fileSourceMetadata, resolveRemoteFileSchema);
|
|
14965
14965
|
}
|
|
14966
14966
|
|
|
14967
|
-
// Gallery (s.
|
|
14967
|
+
// Gallery (s.imageset({ ... }).remote() / s.fileset({ ... }).remote()) upload.
|
|
14968
14968
|
// Unlike a single image/file field, a gallery entry is keyed by its local file
|
|
14969
14969
|
// path and the value is bare metadata (no FileSource), so we derive the file
|
|
14970
14970
|
// ref from the key and synthesize the image/file schema from the record's
|
|
@@ -15005,10 +15005,10 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
15005
15005
|
// synthesize the serialized image/file schema (matching how single fields
|
|
15006
15006
|
// serialize) for the remote ref's validation hash.
|
|
15007
15007
|
//
|
|
15008
|
-
// `accept`/`
|
|
15008
|
+
// `accept`/`dir` come from the RECORD that holds the entry, resolved
|
|
15009
15009
|
// from the entry's PARENT path - not from the module root, which is only the
|
|
15010
15010
|
// record when the gallery is the whole module. A nested gallery
|
|
15011
|
-
// (s.object({ gallery: s.
|
|
15011
|
+
// (s.object({ gallery: s.imageset(...) })) would otherwise synthesize a schema
|
|
15012
15012
|
// with no options and bake a validation hash into the remote ref that can
|
|
15013
15013
|
// never validate, so a mismatch fails fast instead of uploading.
|
|
15014
15014
|
const [, parentModulePath] = core.Internal.splitModuleFilePathAndModulePath(core.Internal.parentOfSourcePath(ctx.sourcePath));
|
|
@@ -15021,7 +15021,7 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
15021
15021
|
}
|
|
15022
15022
|
const {
|
|
15023
15023
|
accept,
|
|
15024
|
-
|
|
15024
|
+
dir
|
|
15025
15025
|
} = recordSchema;
|
|
15026
15026
|
const schema = mediaType === "image" ? {
|
|
15027
15027
|
type: "image",
|
|
@@ -15030,8 +15030,8 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
15030
15030
|
...(accept ? {
|
|
15031
15031
|
accept
|
|
15032
15032
|
} : {}),
|
|
15033
|
-
...(
|
|
15034
|
-
|
|
15033
|
+
...(dir ? {
|
|
15034
|
+
dir
|
|
15035
15035
|
} : {})
|
|
15036
15036
|
}
|
|
15037
15037
|
} : {
|
|
@@ -15071,14 +15071,14 @@ async function handleRemoteFileCheck() {
|
|
|
15071
15071
|
}
|
|
15072
15072
|
async function handleUniqueFolderCheck(ctx) {
|
|
15073
15073
|
const value = ctx.validationError.value;
|
|
15074
|
-
if (!value || typeof value.
|
|
15074
|
+
if (!value || typeof value.dir !== "string") {
|
|
15075
15075
|
return {
|
|
15076
15076
|
success: false,
|
|
15077
15077
|
errorMessage: `Unexpected value in unique folder check for ${ctx.sourcePath}`
|
|
15078
15078
|
};
|
|
15079
15079
|
}
|
|
15080
15080
|
const {
|
|
15081
|
-
|
|
15081
|
+
dir
|
|
15082
15082
|
} = value;
|
|
15083
15083
|
const conflicts = [];
|
|
15084
15084
|
for (const file of ctx.valFiles) {
|
|
@@ -15088,14 +15088,14 @@ async function handleUniqueFolderCheck(ctx) {
|
|
|
15088
15088
|
validate: false
|
|
15089
15089
|
});
|
|
15090
15090
|
const schema = otherModule.schema;
|
|
15091
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.
|
|
15091
|
+
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.dir === dir && schema.mediaType) {
|
|
15092
15092
|
conflicts.push(otherModuleFilePath);
|
|
15093
15093
|
}
|
|
15094
15094
|
}
|
|
15095
15095
|
if (conflicts.length > 0) {
|
|
15096
15096
|
return {
|
|
15097
15097
|
success: false,
|
|
15098
|
-
errorMessage: `Gallery directory '${
|
|
15098
|
+
errorMessage: `Gallery directory '${dir}' in ${ctx.moduleFilePath} is also used by: ${conflicts.join(", ")}. Each gallery must use a unique directory.`
|
|
15099
15099
|
};
|
|
15100
15100
|
}
|
|
15101
15101
|
return {
|
|
@@ -15125,7 +15125,7 @@ async function handleUniqueFolderCheck(ctx) {
|
|
|
15125
15125
|
*/
|
|
15126
15126
|
function checkGalleryFiles(input) {
|
|
15127
15127
|
const {
|
|
15128
|
-
|
|
15128
|
+
dir,
|
|
15129
15129
|
projectRoot,
|
|
15130
15130
|
fs
|
|
15131
15131
|
} = input;
|
|
@@ -15134,7 +15134,7 @@ function checkGalleryFiles(input) {
|
|
|
15134
15134
|
const missingTrackedFiles = entries.filter(entry => !entry.remote && !fs.fileExists(path__namespace["default"].join(projectRoot, entry.localPath))).map(entry => entry.localPath);
|
|
15135
15135
|
const filesInDir = [];
|
|
15136
15136
|
try {
|
|
15137
|
-
const found = fs.readDirectory(path__namespace["default"].join(projectRoot,
|
|
15137
|
+
const found = fs.readDirectory(path__namespace["default"].join(projectRoot, dir), undefined, undefined, ["**/*"]);
|
|
15138
15138
|
for (const entry of found) {
|
|
15139
15139
|
filesInDir.push("/" + path__namespace["default"].relative(projectRoot, entry).split(path__namespace["default"].sep).join("/"));
|
|
15140
15140
|
}
|
|
@@ -15148,14 +15148,14 @@ function checkGalleryFiles(input) {
|
|
|
15148
15148
|
}
|
|
15149
15149
|
async function handleCheckAllFiles(ctx) {
|
|
15150
15150
|
const value = ctx.validationError.value;
|
|
15151
|
-
if (!value || typeof value.
|
|
15151
|
+
if (!value || typeof value.dir !== "string") {
|
|
15152
15152
|
return {
|
|
15153
15153
|
success: false,
|
|
15154
15154
|
errorMessage: `Unexpected value in check-all-files for ${ctx.sourcePath}`
|
|
15155
15155
|
};
|
|
15156
15156
|
}
|
|
15157
15157
|
const {
|
|
15158
|
-
|
|
15158
|
+
dir
|
|
15159
15159
|
} = value;
|
|
15160
15160
|
const source = ctx.valModule.source;
|
|
15161
15161
|
if (!source || typeof source !== "object" || Array.isArray(source)) {
|
|
@@ -15169,7 +15169,7 @@ async function handleCheckAllFiles(ctx) {
|
|
|
15169
15169
|
untrackedFiles
|
|
15170
15170
|
} = checkGalleryFiles({
|
|
15171
15171
|
entryKeys: Object.keys(source),
|
|
15172
|
-
|
|
15172
|
+
dir,
|
|
15173
15173
|
projectRoot: ctx.projectRoot,
|
|
15174
15174
|
fs: ctx.fs
|
|
15175
15175
|
});
|
|
@@ -3155,8 +3155,8 @@ class ValOps {
|
|
|
3155
3155
|
if (sourceForModule !== undefined) {
|
|
3156
3156
|
snapshot.sources[moduleFilePath] = sourceForModule;
|
|
3157
3157
|
}
|
|
3158
|
-
if (serialized.type === "record" && serialized.mediaType && serialized.
|
|
3159
|
-
const dir = serialized.
|
|
3158
|
+
if (serialized.type === "record" && serialized.mediaType && serialized.dir) {
|
|
3159
|
+
const dir = serialized.dir;
|
|
3160
3160
|
const existing = galleryDirectoryToModules.get(dir);
|
|
3161
3161
|
if (existing) {
|
|
3162
3162
|
existing.push(moduleFilePath);
|
|
@@ -3250,10 +3250,10 @@ class ValOps {
|
|
|
3250
3250
|
typeError: true
|
|
3251
3251
|
});
|
|
3252
3252
|
} else {
|
|
3253
|
-
const directory = "
|
|
3253
|
+
const directory = "dir" in validationError.value && validationError.value.dir;
|
|
3254
3254
|
if (typeof directory !== "string") {
|
|
3255
3255
|
addError({
|
|
3256
|
-
message: `Expected gallery validation error 'value' to have property '
|
|
3256
|
+
message: `Expected gallery validation error 'value' to have property 'dir' of type 'string'. Found: ${typeof directory}. ${TYPE_ERROR_MESSAGE}`,
|
|
3257
3257
|
typeError: true
|
|
3258
3258
|
});
|
|
3259
3259
|
} else {
|
|
@@ -14930,7 +14930,7 @@ async function handleRemoteFileUpload(ctx) {
|
|
|
14930
14930
|
return uploadRemoteFileCore(ctx, fileRefProp, fileSourceMetadata, resolveRemoteFileSchema);
|
|
14931
14931
|
}
|
|
14932
14932
|
|
|
14933
|
-
// Gallery (s.
|
|
14933
|
+
// Gallery (s.imageset({ ... }).remote() / s.fileset({ ... }).remote()) upload.
|
|
14934
14934
|
// Unlike a single image/file field, a gallery entry is keyed by its local file
|
|
14935
14935
|
// path and the value is bare metadata (no FileSource), so we derive the file
|
|
14936
14936
|
// ref from the key and synthesize the image/file schema from the record's
|
|
@@ -14971,10 +14971,10 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
14971
14971
|
// synthesize the serialized image/file schema (matching how single fields
|
|
14972
14972
|
// serialize) for the remote ref's validation hash.
|
|
14973
14973
|
//
|
|
14974
|
-
// `accept`/`
|
|
14974
|
+
// `accept`/`dir` come from the RECORD that holds the entry, resolved
|
|
14975
14975
|
// from the entry's PARENT path - not from the module root, which is only the
|
|
14976
14976
|
// record when the gallery is the whole module. A nested gallery
|
|
14977
|
-
// (s.object({ gallery: s.
|
|
14977
|
+
// (s.object({ gallery: s.imageset(...) })) would otherwise synthesize a schema
|
|
14978
14978
|
// with no options and bake a validation hash into the remote ref that can
|
|
14979
14979
|
// never validate, so a mismatch fails fast instead of uploading.
|
|
14980
14980
|
const [, parentModulePath] = Internal.splitModuleFilePathAndModulePath(Internal.parentOfSourcePath(ctx.sourcePath));
|
|
@@ -14987,7 +14987,7 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
14987
14987
|
}
|
|
14988
14988
|
const {
|
|
14989
14989
|
accept,
|
|
14990
|
-
|
|
14990
|
+
dir
|
|
14991
14991
|
} = recordSchema;
|
|
14992
14992
|
const schema = mediaType === "image" ? {
|
|
14993
14993
|
type: "image",
|
|
@@ -14996,8 +14996,8 @@ async function handleRemoteGalleryFileUpload(ctx) {
|
|
|
14996
14996
|
...(accept ? {
|
|
14997
14997
|
accept
|
|
14998
14998
|
} : {}),
|
|
14999
|
-
...(
|
|
15000
|
-
|
|
14999
|
+
...(dir ? {
|
|
15000
|
+
dir
|
|
15001
15001
|
} : {})
|
|
15002
15002
|
}
|
|
15003
15003
|
} : {
|
|
@@ -15037,14 +15037,14 @@ async function handleRemoteFileCheck() {
|
|
|
15037
15037
|
}
|
|
15038
15038
|
async function handleUniqueFolderCheck(ctx) {
|
|
15039
15039
|
const value = ctx.validationError.value;
|
|
15040
|
-
if (!value || typeof value.
|
|
15040
|
+
if (!value || typeof value.dir !== "string") {
|
|
15041
15041
|
return {
|
|
15042
15042
|
success: false,
|
|
15043
15043
|
errorMessage: `Unexpected value in unique folder check for ${ctx.sourcePath}`
|
|
15044
15044
|
};
|
|
15045
15045
|
}
|
|
15046
15046
|
const {
|
|
15047
|
-
|
|
15047
|
+
dir
|
|
15048
15048
|
} = value;
|
|
15049
15049
|
const conflicts = [];
|
|
15050
15050
|
for (const file of ctx.valFiles) {
|
|
@@ -15054,14 +15054,14 @@ async function handleUniqueFolderCheck(ctx) {
|
|
|
15054
15054
|
validate: false
|
|
15055
15055
|
});
|
|
15056
15056
|
const schema = otherModule.schema;
|
|
15057
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.
|
|
15057
|
+
if ((schema === null || schema === void 0 ? void 0 : schema.type) === "record" && schema.dir === dir && schema.mediaType) {
|
|
15058
15058
|
conflicts.push(otherModuleFilePath);
|
|
15059
15059
|
}
|
|
15060
15060
|
}
|
|
15061
15061
|
if (conflicts.length > 0) {
|
|
15062
15062
|
return {
|
|
15063
15063
|
success: false,
|
|
15064
|
-
errorMessage: `Gallery directory '${
|
|
15064
|
+
errorMessage: `Gallery directory '${dir}' in ${ctx.moduleFilePath} is also used by: ${conflicts.join(", ")}. Each gallery must use a unique directory.`
|
|
15065
15065
|
};
|
|
15066
15066
|
}
|
|
15067
15067
|
return {
|
|
@@ -15091,7 +15091,7 @@ async function handleUniqueFolderCheck(ctx) {
|
|
|
15091
15091
|
*/
|
|
15092
15092
|
function checkGalleryFiles(input) {
|
|
15093
15093
|
const {
|
|
15094
|
-
|
|
15094
|
+
dir,
|
|
15095
15095
|
projectRoot,
|
|
15096
15096
|
fs
|
|
15097
15097
|
} = input;
|
|
@@ -15100,7 +15100,7 @@ function checkGalleryFiles(input) {
|
|
|
15100
15100
|
const missingTrackedFiles = entries.filter(entry => !entry.remote && !fs.fileExists(path__default.join(projectRoot, entry.localPath))).map(entry => entry.localPath);
|
|
15101
15101
|
const filesInDir = [];
|
|
15102
15102
|
try {
|
|
15103
|
-
const found = fs.readDirectory(path__default.join(projectRoot,
|
|
15103
|
+
const found = fs.readDirectory(path__default.join(projectRoot, dir), undefined, undefined, ["**/*"]);
|
|
15104
15104
|
for (const entry of found) {
|
|
15105
15105
|
filesInDir.push("/" + path__default.relative(projectRoot, entry).split(path__default.sep).join("/"));
|
|
15106
15106
|
}
|
|
@@ -15114,14 +15114,14 @@ function checkGalleryFiles(input) {
|
|
|
15114
15114
|
}
|
|
15115
15115
|
async function handleCheckAllFiles(ctx) {
|
|
15116
15116
|
const value = ctx.validationError.value;
|
|
15117
|
-
if (!value || typeof value.
|
|
15117
|
+
if (!value || typeof value.dir !== "string") {
|
|
15118
15118
|
return {
|
|
15119
15119
|
success: false,
|
|
15120
15120
|
errorMessage: `Unexpected value in check-all-files for ${ctx.sourcePath}`
|
|
15121
15121
|
};
|
|
15122
15122
|
}
|
|
15123
15123
|
const {
|
|
15124
|
-
|
|
15124
|
+
dir
|
|
15125
15125
|
} = value;
|
|
15126
15126
|
const source = ctx.valModule.source;
|
|
15127
15127
|
if (!source || typeof source !== "object" || Array.isArray(source)) {
|
|
@@ -15135,7 +15135,7 @@ async function handleCheckAllFiles(ctx) {
|
|
|
15135
15135
|
untrackedFiles
|
|
15136
15136
|
} = checkGalleryFiles({
|
|
15137
15137
|
entryKeys: Object.keys(source),
|
|
15138
|
-
|
|
15138
|
+
dir,
|
|
15139
15139
|
projectRoot: ctx.projectRoot,
|
|
15140
15140
|
fs: ctx.fs
|
|
15141
15141
|
});
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"types": "dist/valbuild-server.cjs.d.ts",
|
|
19
|
-
"version": "0.
|
|
19
|
+
"version": "0.129.0",
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@prettier/sync": "^0.6.1",
|
|
22
22
|
"@types/jest": "^30.0.0"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"typescript": "^6.0.3",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
31
|
"zod-validation-error": "^5.0.0",
|
|
32
|
-
"@valbuild/
|
|
33
|
-
"@valbuild/
|
|
34
|
-
"@valbuild/
|
|
32
|
+
"@valbuild/core": "0.129.0",
|
|
33
|
+
"@valbuild/shared": "0.129.0",
|
|
34
|
+
"@valbuild/ui": "0.129.0"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": "^20.19.0 || >=22"
|