@lark-apaas/fullstack-cli 0.1.0-alpha.1 → 0.1.0-alpha.3

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.
@@ -9,9 +9,8 @@ async function main() {
9
9
  const userProjectRoot = process.env.INIT_CWD || process.cwd();
10
10
  const pluginRoot = path.resolve(__dirname, '..');
11
11
 
12
- // 如果在插件自己的目录,跳过
13
- const isInstallingPlugin = __dirname.includes('/node_modules/@lark-apaas/fullstack-cli/');
14
- if (isInstallingPlugin || userProjectRoot === pluginRoot) {
12
+ // 只有在插件自己的开发目录中才跳过(避免在开发插件时触发 sync)
13
+ if (userProjectRoot === pluginRoot) {
15
14
  console.log('[fullstack-cli] Skip syncing (installing plugin itself)');
16
15
  process.exit(0);
17
16
  }
@@ -27,8 +26,7 @@ async function main() {
27
26
  console.log('[fullstack-cli] Starting sync...');
28
27
 
29
28
  // 加载配置文件(从 dist 目录加载编译后的配置)
30
- const configPath = path.join(pluginRoot, 'dist', 'postinstall.config.js');
31
- const { default: config } = await import(`file://${configPath}`);
29
+ const { default: config } = await import('../dist/postinstall.config.js');
32
30
 
33
31
  if (!config || !config.sync) {
34
32
  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.1",
3
+ "version": "0.1.0-alpha.3",
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