create-geekron-website 0.1.4 → 0.1.6

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 CHANGED
@@ -11124,7 +11124,20 @@ var CMS_CONFIGS = {
11124
11124
  dependencies: {
11125
11125
  "@geekron/strapi": "latest"
11126
11126
  },
11127
- filesToCopy: []
11127
+ filesToCopy: [
11128
+ {
11129
+ source: "strapi/config",
11130
+ destination: "config",
11131
+ isDirectory: true,
11132
+ overwrite: true
11133
+ },
11134
+ {
11135
+ source: "strapi/src",
11136
+ destination: "src",
11137
+ isDirectory: true,
11138
+ overwrite: true
11139
+ }
11140
+ ]
11128
11141
  }
11129
11142
  };
11130
11143
  var RENDERER_CONFIGS = {
@@ -12062,13 +12075,35 @@ async function copyCmsFiles(filesToCopy, targetDir) {
12062
12075
  const spinner = ora("Copying CMS files...").start();
12063
12076
  try {
12064
12077
  const templatesDir = path.join(__dirname, "../../templates");
12078
+ let copiedCount = 0;
12065
12079
  for (const file of filesToCopy) {
12066
12080
  const sourcePath = path.join(templatesDir, file.source);
12067
12081
  const destPath = path.join(targetDir, file.destination);
12082
+ const overwrite = file.overwrite !== false;
12083
+ if (!await import_fs_extra.default.pathExists(sourcePath)) {
12084
+ logger.warn(`Source path does not exist: ${file.source}`);
12085
+ continue;
12086
+ }
12068
12087
  await import_fs_extra.default.ensureDir(path.dirname(destPath));
12069
- await import_fs_extra.default.copy(sourcePath, destPath);
12088
+ const sourceStats = await import_fs_extra.default.stat(sourcePath);
12089
+ const isDirectory = file.isDirectory ?? sourceStats.isDirectory();
12090
+ if (isDirectory) {
12091
+ if (overwrite) {
12092
+ await import_fs_extra.default.copy(sourcePath, destPath, { overwrite: true });
12093
+ } else {
12094
+ await import_fs_extra.default.copy(sourcePath, destPath, { overwrite: false, errorOnExist: false });
12095
+ }
12096
+ copiedCount++;
12097
+ } else {
12098
+ if (overwrite || !await import_fs_extra.default.pathExists(destPath)) {
12099
+ await import_fs_extra.default.copy(sourcePath, destPath, { overwrite: true });
12100
+ copiedCount++;
12101
+ } else {
12102
+ logger.warn(`File already exists, skipping: ${file.destination}`);
12103
+ }
12104
+ }
12070
12105
  }
12071
- spinner.succeed(`Copied ${filesToCopy.length} CMS configuration file(s)`);
12106
+ spinner.succeed(`Copied ${copiedCount} CMS configuration file(s)/folder(s)`);
12072
12107
  } catch (error) {
12073
12108
  spinner.fail("Failed to copy CMS files");
12074
12109
  throw error;
@@ -0,0 +1,5 @@
1
+ export default () => ({
2
+ website: {
3
+ enabled: true
4
+ }
5
+ });
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-geekron-website",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "CLI tool to create Geekron websites",
5
5
  "author": {
6
6
  "name": "Geekron",
@@ -0,0 +1,5 @@
1
+ export default () => ({
2
+ website: {
3
+ enabled: true
4
+ }
5
+ });
@@ -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
+ }