create-geekron-website 0.1.4 → 0.1.5
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/dist/index.js +32 -3
- package/dist/templates/strapi/config/plugins.ts +5 -0
- package/dist/templates/strapi/src/components/base/image.json +24 -0
- package/dist/templates/strapi/src/components/base/video.json +24 -0
- package/package.json +1 -1
- package/templates/strapi/config/plugins.ts +5 -0
- package/templates/strapi/src/components/base/image.json +24 -0
- package/templates/strapi/src/components/base/video.json +24 -0
package/dist/index.js
CHANGED
|
@@ -11124,7 +11124,14 @@ var CMS_CONFIGS = {
|
|
|
11124
11124
|
dependencies: {
|
|
11125
11125
|
"@geekron/strapi": "latest"
|
|
11126
11126
|
},
|
|
11127
|
-
filesToCopy: [
|
|
11127
|
+
filesToCopy: [
|
|
11128
|
+
{
|
|
11129
|
+
source: "strapi/src/components/base",
|
|
11130
|
+
destination: "src/components/base",
|
|
11131
|
+
isDirectory: true,
|
|
11132
|
+
overwrite: true
|
|
11133
|
+
}
|
|
11134
|
+
]
|
|
11128
11135
|
}
|
|
11129
11136
|
};
|
|
11130
11137
|
var RENDERER_CONFIGS = {
|
|
@@ -12062,13 +12069,35 @@ async function copyCmsFiles(filesToCopy, targetDir) {
|
|
|
12062
12069
|
const spinner = ora("Copying CMS files...").start();
|
|
12063
12070
|
try {
|
|
12064
12071
|
const templatesDir = path.join(__dirname, "../../templates");
|
|
12072
|
+
let copiedCount = 0;
|
|
12065
12073
|
for (const file of filesToCopy) {
|
|
12066
12074
|
const sourcePath = path.join(templatesDir, file.source);
|
|
12067
12075
|
const destPath = path.join(targetDir, file.destination);
|
|
12076
|
+
const overwrite = file.overwrite !== false;
|
|
12077
|
+
if (!await import_fs_extra.default.pathExists(sourcePath)) {
|
|
12078
|
+
logger.warn(`Source path does not exist: ${file.source}`);
|
|
12079
|
+
continue;
|
|
12080
|
+
}
|
|
12068
12081
|
await import_fs_extra.default.ensureDir(path.dirname(destPath));
|
|
12069
|
-
await import_fs_extra.default.
|
|
12082
|
+
const sourceStats = await import_fs_extra.default.stat(sourcePath);
|
|
12083
|
+
const isDirectory = file.isDirectory ?? sourceStats.isDirectory();
|
|
12084
|
+
if (isDirectory) {
|
|
12085
|
+
if (overwrite) {
|
|
12086
|
+
await import_fs_extra.default.copy(sourcePath, destPath, { overwrite: true });
|
|
12087
|
+
} else {
|
|
12088
|
+
await import_fs_extra.default.copy(sourcePath, destPath, { overwrite: false, errorOnExist: false });
|
|
12089
|
+
}
|
|
12090
|
+
copiedCount++;
|
|
12091
|
+
} else {
|
|
12092
|
+
if (overwrite || !await import_fs_extra.default.pathExists(destPath)) {
|
|
12093
|
+
await import_fs_extra.default.copy(sourcePath, destPath, { overwrite: true });
|
|
12094
|
+
copiedCount++;
|
|
12095
|
+
} else {
|
|
12096
|
+
logger.warn(`File already exists, skipping: ${file.destination}`);
|
|
12097
|
+
}
|
|
12098
|
+
}
|
|
12070
12099
|
}
|
|
12071
|
-
spinner.succeed(`Copied ${
|
|
12100
|
+
spinner.succeed(`Copied ${copiedCount} CMS configuration file(s)/folder(s)`);
|
|
12072
12101
|
} catch (error) {
|
|
12073
12102
|
spinner.fail("Failed to copy CMS files");
|
|
12074
12103
|
throw error;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_base_images",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Image",
|
|
5
|
+
"icon": "picture"
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"main": {
|
|
10
|
+
"type": "media",
|
|
11
|
+
"multiple": false,
|
|
12
|
+
"allowedTypes": [
|
|
13
|
+
"images"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"sub": {
|
|
17
|
+
"type": "media",
|
|
18
|
+
"multiple": false,
|
|
19
|
+
"allowedTypes": [
|
|
20
|
+
"images"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_base_videos",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Video",
|
|
5
|
+
"icon": "play"
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"url": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true
|
|
12
|
+
},
|
|
13
|
+
"title": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"image": {
|
|
17
|
+
"type": "media",
|
|
18
|
+
"multiple": false,
|
|
19
|
+
"allowedTypes": [
|
|
20
|
+
"images"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_base_images",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Image",
|
|
5
|
+
"icon": "picture"
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"main": {
|
|
10
|
+
"type": "media",
|
|
11
|
+
"multiple": false,
|
|
12
|
+
"allowedTypes": [
|
|
13
|
+
"images"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"sub": {
|
|
17
|
+
"type": "media",
|
|
18
|
+
"multiple": false,
|
|
19
|
+
"allowedTypes": [
|
|
20
|
+
"images"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_base_videos",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Video",
|
|
5
|
+
"icon": "play"
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"url": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true
|
|
12
|
+
},
|
|
13
|
+
"title": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"image": {
|
|
17
|
+
"type": "media",
|
|
18
|
+
"multiple": false,
|
|
19
|
+
"allowedTypes": [
|
|
20
|
+
"images"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|