Skip to content

Commit

Permalink
Merge branch 'v2-dev' into chore/syncMain
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost authored Nov 21, 2024
2 parents 473d4fb + f0ddab5 commit b164fac
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const PKG_PLUGIN_TOOLS = resolve(CWD, "./packages/plugin-tools");
// Build plugin dts
const PKG_DTS = resolve(CWD, "./js-plugins/dts");

// Build ReplaceDirnamePlugin
const PKG_REPLACE_DIRNAME_PLUGIN = resolve(CWD, "./rust-plugins/replace-dirname");

// Build rust_plugin_react
const PKG_RUST_PLUGIN = resolve(CWD, "./rust-plugins");

Expand Down Expand Up @@ -106,7 +109,8 @@ export const installLinuxProtobuf = async () => {
export const buildCore = () =>
execa(DEFAULT_PACKAGE_MANAGER, ["build:rs"], {
cwd: PKG_CORE,
}).then(buildCoreCjs);
stdio: "inherit",
}).then(buildReplaceDirnamePlugin).then(buildCoreCjs);

export const buildCoreCjs = () =>
execa(DEFAULT_PACKAGE_MANAGER, ["build:cjs"], {
Expand All @@ -131,6 +135,11 @@ export const buildDts = () =>
cwd: PKG_DTS,
});

export const buildReplaceDirnamePlugin = () =>
execa(DEFAULT_PACKAGE_MANAGER, ["build"], {
cwd: PKG_REPLACE_DIRNAME_PLUGIN,
});

// build rust plugins
export const rustPlugins = () => batchBuildPlugins(PKG_RUST_PLUGIN);

Expand Down Expand Up @@ -187,15 +196,15 @@ export const buildRustPlugins = async () => {
!excludedJsPlugin.includes(file)
);
});

const total = rustPluginDirs.length;
const filterPlugins = ["replace-dirname"];
const buildPlugins = rustPluginDirs.filter(item => !filterPlugins.includes(item))
const total = buildPlugins.length;
console.log("\n");
logger(`Found ${total} Rust plugins to build \n`, {
color: "rust",
title: "Rust Info",
});

for (const pluginDir of rustPluginDirs) {
for (const pluginDir of buildPlugins) {
const pluginPath = resolve(PKG_RUST_PLUGIN, pluginDir);
await runTask(
`Built Rust plugin: ${pluginDir}`,
Expand Down

0 comments on commit b164fac

Please sign in to comment.