拆分出 Node.js-binary target

This commit is contained in:
Aoran Zeng committed 2026-08-12 18:08:47 +08:00
1 parent e358d5e931
commit e83118fe2f
5 files changed
+77 -85

No files matched your search

+42 -7
View File
@@ -1,14 +1,49 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Mr. Will <mr.will.com@outlook.com>
* |
* Created On : <2023-08-30>
* Major Revision : 2
* Last Modified : <2025-07-11>
* ------------------------------------------------------------*/
static MirrorSite_t NpmMirror =
{
IS_DedicatedMirrorSite,
"npmmirror", "npmmirror", "npmmirror (阿里云赞助)", "https://npmmirror.com/",
{SKIP, NULL, NULL, NULL, ACCURATE}
};
def_target(pl_js_group, "js/javascript/node/nodejs");
void
pl_js_group_prelude (void)
{
chef_prep_this (pl_js_group, gsr);
chef_set_recipe_created_on (this, "2023-09-09");
chef_set_recipe_last_updated (this, "2025-07-11");
// 组换源的 leader target 应把所有 follower target 的贡献者都记录过来
chef_set_chefs (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@lontten", "@MrWillCom");
/* ProjectScope 支持 npm, yarn v2, pnpm, 不支持 yarn v1 */
chef_set_scope_cap (this, ProjectScope, ScopeCap_Able_And_Implemented);
chef_set_scope_cap (this, UserScope, ScopeCap_Able_And_Implemented);
chef_set_scope_cap (this, SystemScope, ScopeCap_Unknown);
chef_set_default_scope (this, UserScope);
chef_allow_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://registry.npmjs.org/", FeedByPrelude}, /* @note 根据 pnpm 官网,有最后的斜线 */
{&NpmMirror, "https://registry.npmmirror.com", FeedByPrelude},
{&Huawei, "https://mirrors.huaweicloud.com/repository/npm/", FeedByPrelude},
{&Tencent, "https://mirrors.cloud.tencent.com/npm/", FeedByPrelude}
def_sources_end()
// 29MB 大小
chef_set_rest_smURL_with_postfix (this, "/@tensorflow/tfjs/-/tfjs-4.22.0.tgz");
}
void
pl_js_check_cmd (bool *npm_exist, bool *yarn_exist, bool *pnpm_exist)
{
@@ -0,0 +1,31 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* ------------------------------------------------------------*/
def_sources_target(pl_nodejs_binary, "nodejs-binary");
void
pl_nodejs_binary_prelude (void)
{
chef_prep_sources_target (pl_nodejs_binary);
chef_set_recipe_created_on (this, "2023-09-09");
chef_set_recipe_last_updated (this, "2026-08-12");
chef_set_chefs (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://nodejs.org/dist/", FeedByPrelude},
{&NpmMirror, "https://npmmirror.com/mirrors", FeedByPrelude},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/",FeedByPrelude},
{&Bfsu, "https://mirrors.bfsu.edu.cn/nodejs-release/",FeedByPrelude},
{&Ustc, "https://mirrors.ustc.edu.cn/node/",FeedByPrelude},
{&Huawei, "https://mirrors.huaweicloud.com/nodejs/",FeedByPrelude},
{&Tencent, "https://mirrors.cloud.tencent.com/nodejs-release/", FeedByPrelude}
def_sources_end()
chef_set_rest_smURL_with_postfix (this, "/v23.4.0/node-v23.4.0-linux-x64.tar.xz");
}
-74
View File
@@ -1,74 +0,0 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* ------------------------------------------------------------*/
static MirrorSite_t NpmMirror =
{
IS_DedicatedMirrorSite,
"npmmirror", "npmmirror", "npmmirror (阿里云赞助)", "https://npmmirror.com/",
{SKIP, NULL, NULL, NULL, ACCURATE}
};
def_target(pl_js_group, "js/javascript/node/nodejs");
void
pl_js_group_prelude (void)
{
chef_prep_this (pl_js_group, gsr);
chef_set_recipe_created_on (this, "2023-09-09");
chef_set_recipe_last_updated (this, "2025-07-11");
// 组换源的 leader target 应把所有 follower target 的贡献者都记录过来
chef_set_chefs (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@lontten", "@MrWillCom");
/* ProjectScope 支持 npm, yarn v2, pnpm, 不支持 yarn v1 */
chef_set_scope_cap (this, ProjectScope, ScopeCap_Able_And_Implemented);
chef_set_scope_cap (this, UserScope, ScopeCap_Able_And_Implemented);
chef_set_scope_cap (this, SystemScope, ScopeCap_Unknown);
chef_set_default_scope (this, UserScope);
chef_allow_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://registry.npmjs.org/", FeedByPrelude}, /* @note 根据 pnpm 官网,有最后的斜线 */
{&NpmMirror, "https://registry.npmmirror.com", FeedByPrelude},
{&Huawei, "https://mirrors.huaweicloud.com/repository/npm/", FeedByPrelude},
{&Tencent, "https://mirrors.cloud.tencent.com/npm/", FeedByPrelude}
def_sources_end()
// 29MB 大小
chef_set_rest_smURL_with_postfix (this, "/@tensorflow/tfjs/-/tfjs-4.22.0.tgz");
}
def_sources_target(pl_js_nodejs_binary, "nodejs-binary");
void
pl_js_nodejs_binary_prelude (void)
{
chef_prep_sources_target (pl_js_nodejs_binary);
chef_set_recipe_created_on (this, "2023-09-09");
chef_set_recipe_last_updated (this, "2026-08-12");
chef_set_chefs (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://nodejs.org/dist/", FeedByPrelude},
{&NpmMirror, "https://npmmirror.com/mirrors", FeedByPrelude},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/",FeedByPrelude},
{&Bfsu, "https://mirrors.bfsu.edu.cn/nodejs-release/",FeedByPrelude},
{&Ustc, "https://mirrors.ustc.edu.cn/node/",FeedByPrelude},
{&Huawei, "https://mirrors.huaweicloud.com/nodejs/",FeedByPrelude},
{&Tencent, "https://mirrors.cloud.tencent.com/nodejs-release/", FeedByPrelude}
def_sources_end()
chef_set_rest_smURL_with_postfix (this, "/v23.4.0/node-v23.4.0-linux-x64.tar.xz");
}
+2 -2
View File
@@ -25,7 +25,7 @@ pl_nvm_prelude (void)
chef_set_note (this, "nvm 不支持 Fish shell", "nvm does not support Fish");
chef_use_other_target_sources (this, &pl_js_nodejs_binary_target);
chef_use_other_target_sources (this, &pl_nodejs_binary_target);
}
@@ -46,7 +46,7 @@ pl_nvm_getsrc (char *option)
void
pl_nvm_setsrc (char *option)
{
Source_t source = chsrc_yield_source_and_confirm (&pl_js_nodejs_binary_target, option);
Source_t source = chsrc_yield_source_and_confirm (&pl_nodejs_binary_target, option);
char *w = xy_strcat (3, "export NVM_NODEJS_ORG_MIRROR=", source.url, "\n");
+2 -2
View File
@@ -27,7 +27,7 @@
#include "lang/Python/uv/uv.c"
#include "lang/JavaScript/common.h"
#include "lang/JavaScript/Node.js-binary.c"
#include "lang/JavaScript/npm.c"
#include "lang/JavaScript/pnpm.c"
#include "lang/JavaScript/Yarn.c"
@@ -242,5 +242,5 @@ chsrc_init_menu ()
#undef add
chef_set_preludefn_for_sources_target (pl_py_pypi);
chef_set_preludefn_for_sources_target (pl_js_nodejs_binary);
chef_set_preludefn_for_sources_target (pl_nodejs_binary);
}