@infuro/cms-core 1.0.6 → 1.0.7
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 +27 -43
- package/dist/admin.cjs +1 -1
- package/dist/admin.css +12 -15
- package/dist/admin.js +1 -1
- package/dist/cli.cjs +859 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +836 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/migrations/1772178563554-InitialSchema.ts +304 -0
- package/dist/migrations/README.md +3 -0
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -751,14 +751,15 @@ function s3StoragePlugin(config) {
|
|
|
751
751
|
// src/plugins/storage/local.ts
|
|
752
752
|
function getLocalStorage(config) {
|
|
753
753
|
const dir = (config.dir ?? "public/uploads").replace(/\/$/, "");
|
|
754
|
-
const publicPath = config.publicPath ?? `/${dir.replace(/^\/+/, "").replace(/\\/g, "/")}
|
|
754
|
+
const publicPath = config.publicPath ?? (dir === "public/uploads" ? "/uploads" : `/${dir.replace(/^\/+/, "").replace(/\\/g, "/")}`);
|
|
755
755
|
return {
|
|
756
756
|
async upload(buffer, key, _contentType) {
|
|
757
757
|
const fs = await import("fs/promises");
|
|
758
758
|
const path = await import("path");
|
|
759
|
+
const normalizedKey = key.replace(/^\/+/, "").replace(/\.\./g, "");
|
|
760
|
+
const fileName = normalizedKey.replace(/^uploads\//, "");
|
|
759
761
|
const fullDir = path.join(process.cwd(), dir);
|
|
760
762
|
await fs.mkdir(fullDir, { recursive: true });
|
|
761
|
-
const fileName = key.replace(/^\/+/, "").replace(/\.\./g, "");
|
|
762
763
|
const filePath = path.join(fullDir, fileName);
|
|
763
764
|
const fileDir = path.dirname(filePath);
|
|
764
765
|
await fs.mkdir(fileDir, { recursive: true });
|