@lark-apaas/fullstack-cli 0.1.0-alpha.1 → 0.1.0-alpha.2
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/bin/sync-scripts.js
CHANGED
|
@@ -27,8 +27,7 @@ async function main() {
|
|
|
27
27
|
console.log('[fullstack-cli] Starting sync...');
|
|
28
28
|
|
|
29
29
|
// 加载配置文件(从 dist 目录加载编译后的配置)
|
|
30
|
-
const
|
|
31
|
-
const { default: config } = await import(`file://${configPath}`);
|
|
30
|
+
const { default: config } = await import('../dist/postinstall.config.js');
|
|
32
31
|
|
|
33
32
|
if (!config || !config.sync) {
|
|
34
33
|
console.warn('[fullstack-cli] No sync configuration found');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "CLI tool for fullstack template management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsc",
|
|
14
14
|
"prepublishOnly": "npm run build",
|
|
15
|
-
"postinstall": "node bin/sync-scripts.js"
|
|
15
|
+
"postinstall": "node bin/sync-scripts.js && echo 'Fullstack CLI installation completed'"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"fullstack",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* fullstack-cli 派生配置
|
|
3
|
-
* 定义哪些文件/目录需要同步到用户项目
|
|
4
|
-
*/
|
|
5
|
-
export interface SyncRule {
|
|
6
|
-
/** 源文件/目录路径(相对于插件根目录) */
|
|
7
|
-
from: string;
|
|
8
|
-
/** 目标文件/目录路径(相对于用户项目根目录) */
|
|
9
|
-
to: string;
|
|
10
|
-
/** 同步类型 */
|
|
11
|
-
type: 'directory' | 'file' | 'append';
|
|
12
|
-
/** 是否覆盖已存在的文件(仅 directory 和 file 类型有效) */
|
|
13
|
-
overwrite?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface PostinstallConfig {
|
|
16
|
-
/** 派生规则 */
|
|
17
|
-
sync: SyncRule[];
|
|
18
|
-
/** 文件权限设置 */
|
|
19
|
-
permissions?: Record<string, number>;
|
|
20
|
-
}
|
|
21
|
-
declare const config: PostinstallConfig;
|
|
22
|
-
export default config;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* fullstack-cli 派生配置
|
|
3
|
-
* 定义哪些文件/目录需要同步到用户项目
|
|
4
|
-
*/
|
|
5
|
-
const config = {
|
|
6
|
-
// 派生规则
|
|
7
|
-
sync: [
|
|
8
|
-
// 1. 派生 scripts 目录(总是覆盖)
|
|
9
|
-
{
|
|
10
|
-
from: 'templates/scripts',
|
|
11
|
-
to: 'scripts',
|
|
12
|
-
type: 'directory',
|
|
13
|
-
overwrite: true,
|
|
14
|
-
},
|
|
15
|
-
// 2. 追加内容到 .gitignore
|
|
16
|
-
{
|
|
17
|
-
from: 'templates/.gitignore.append',
|
|
18
|
-
to: '.gitignore',
|
|
19
|
-
type: 'append',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
// 文件权限设置
|
|
23
|
-
permissions: {
|
|
24
|
-
// 所有 .sh 文件设置为可执行
|
|
25
|
-
'**/*.sh': 0o755,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
export default config;
|
|
File without changes
|