create-geekron-website 0.1.3 → 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/README.md +2 -2
- 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 +2 -2
- 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/README.md
CHANGED
|
@@ -43,7 +43,7 @@ bash shell/build.sh
|
|
|
43
43
|
使用交互式发布脚本:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npm run
|
|
46
|
+
npm run release
|
|
47
47
|
# 或直接执行
|
|
48
48
|
bash shell/publish.sh
|
|
49
49
|
```
|
|
@@ -52,7 +52,7 @@ bash shell/publish.sh
|
|
|
52
52
|
1. 检查 npm 登录状态
|
|
53
53
|
2. 检查 Git 工作区状态
|
|
54
54
|
3. 可选更新版本号
|
|
55
|
-
4.
|
|
55
|
+
4. 自动构建项目(静默模式)
|
|
56
56
|
5. 发布到 npm
|
|
57
57
|
6. 可选创建 Git tag
|
|
58
58
|
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-geekron-website",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "CLI tool to create Geekron websites",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Geekron",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"dev": "bun run src/index.ts",
|
|
22
22
|
"build": "bash shell/build.sh",
|
|
23
|
-
"
|
|
23
|
+
"release": "bash shell/publish.sh",
|
|
24
24
|
"prepublishOnly": "bash shell/build.sh"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
@@ -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
|
+
}
|