From acff3c0dd3c577efd5e48bf35b09bd01b70e2b5f Mon Sep 17 00:00:00 2001 From: Korobeinikov Evgeny Date: Fri, 18 Jul 2025 18:26:39 +0300 Subject: [PATCH] generate package json in mirror Signed-off-by: Korobeinikov Evgeny --- tools/mirror.mjs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/mirror.mjs b/tools/mirror.mjs index 378639d36..58a017955 100644 --- a/tools/mirror.mjs +++ b/tools/mirror.mjs @@ -18,11 +18,32 @@ const sources = [ ".gitignore" ] +const projects = [ + "arkoala-arkts", + "incremental", + "interop", + "ui2abc" +] + const gitignoreOhos = `out sdk koala_build.log ` +function generatePackageJson(configPath) { + + const packageJson = { + "name": "root", + "private": true, + "//": "DO NOT ADD dependencies or devDependencies clauses to this level! Keep subfolders autonomous.", + "scripts": { + "prepare": `${ projects.map(name => { return `cd ${name} && npm i && cd ..`}).join(" && ") }`, + } + } + + fs.writeFileSync(configPath, JSON.stringify(packageJson, null, 4), 'utf-8'); +} + // Improve: need remove const excludes = [ ".gitlab-ci.yml", @@ -70,6 +91,8 @@ function main() { fs.mkdirSync(outPath) + generatePackageJson(path.join(outPath, "package.json")) + const matches = (file, patterns) => patterns.some(p => file.endsWith(p) || file.match(`/${p}/`)) sources.forEach(project => { -- Gitee