Skip to content

Refactor repo type handling in download-deps.js#24

Open
finscn wants to merge 1 commit intococos:v4.0.0from
finscn:patch-1
Open

Refactor repo type handling in download-deps.js#24
finscn wants to merge 1 commit intococos:v4.0.0from
finscn:patch-1

Conversation

@finscn
Copy link

@finscn finscn commented Jan 1, 2026

Refactor getGitUrl and getNormalizedOrigin functions to handle different repo types more clearly.

目前的版本只支持 git 或者 url+'.git' 不够通用.
不支持 纯https 的 url 形式.

本修改解决了这个问题.

现在可以用下面这种格式的 配置了:

{
    "from": {
        "type": "https",
        "url": "https://aaa.bbb/cccc/dddd/eeee/my-external",
        "checkout": "branch-test"
    }
}

其实理论上可以省略 type , 判断如果没有 type 且有 url 时, 直接使用 url.
但是我看你们的代码里 没有type 会抛出异常, 也就是说 在你们的原始设计里 type 是必选项. 所以我也就保留了type.
虽然有点冗余, 但是挺清晰, 也没什么不好.

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

Refactor getGitUrl and getNormalizedOrigin functions to handle different repo types more clearly.

目前的版本只支持 git 或者  url+'.git'  不够通用.
不支持 纯https 的 url 形式.

本修改解决了这个问题.

现在可以用下面这种格式的 配置了: 
```json
{
    "from": {
        "type": "https",
        "url": "https://aaa.bbb/cccc/dddd/eeee/my-external",
        "checkout": "branch-test"
    }
}
```

```
@star-e star-e added the investigation Investigate the impact on the code base label Jan 12, 2026
@star-e star-e self-assigned this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

investigation Investigate the impact on the code base

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants