From a293e9e54345b314c503eb8ac8a151cf6e60dd6b Mon Sep 17 00:00:00 2001 From: jack zhang <1098626505@qq.com> Date: Mon, 29 Apr 2024 19:27:32 +0800 Subject: [PATCH] fix: build order bug (#4223) * fix: build order bug * fix: remove getCompatible error tip * fix: add workflow npmignore --- packages/core/build/src/build.ts | 3 ++- packages/core/build/src/constant.ts | 1 + packages/core/server/src/plugin-manager/utils.ts | 3 +-- .../@nocobase/plugin-workflow-action-trigger/.npmignore | 2 ++ .../plugins/@nocobase/plugin-workflow-aggregate/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-delay/.npmignore | 2 ++ .../@nocobase/plugin-workflow-dynamic-calculation/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-loop/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-manual/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-parallel/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-request/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-sql/.npmignore | 2 ++ packages/plugins/@nocobase/plugin-workflow-test/.npmignore | 2 ++ 13 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 packages/plugins/@nocobase/plugin-workflow-action-trigger/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-aggregate/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-delay/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-loop/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-manual/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-parallel/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-request/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-sql/.npmignore create mode 100644 packages/plugins/@nocobase/plugin-workflow-test/.npmignore diff --git a/packages/core/build/src/build.ts b/packages/core/build/src/build.ts index d861bfbc3b..3b2f72a985 100755 --- a/packages/core/build/src/build.ts +++ b/packages/core/build/src/build.ts @@ -53,7 +53,8 @@ export async function build(pkgs: string[]) { if (clientCore) { await buildPackage(clientCore, 'es', buildClient); } - const esmPackages = cjsPackages.filter(pkg => ESM_PACKAGES.includes(pkg.name)); + const esmPackages = packages.filter(pkg => ESM_PACKAGES.includes(pkg.name)); + await buildPackages(esmPackages, 'lib', buildCjs); await buildPackages(esmPackages, 'es', buildEsm); // plugins/*、samples/* diff --git a/packages/core/build/src/constant.ts b/packages/core/build/src/constant.ts index 3b91cbd397..a19585b488 100644 --- a/packages/core/build/src/constant.ts +++ b/packages/core/build/src/constant.ts @@ -49,6 +49,7 @@ export const getCjsPackages = (packages: Package[]) => packages .filter((item) => !PLUGINS_DIR.some((dir) => item.location.startsWith(dir))) .filter((item) => !item.location.startsWith(PRESETS_DIR)) + .filter((item) => !ESM_PACKAGES.includes(item.name)) .filter((item) => !CJS_EXCLUDE_PACKAGES.includes(item.location)); // tar diff --git a/packages/core/server/src/plugin-manager/utils.ts b/packages/core/server/src/plugin-manager/utils.ts index b1068af784..f2f200072b 100644 --- a/packages/core/server/src/plugin-manager/utils.ts +++ b/packages/core/server/src/plugin-manager/utils.ts @@ -522,8 +522,7 @@ export async function getCompatible(packageName: string) { if (hasSrc) { try { externalVersion = await getExternalVersionFromSource(packageName); - } catch (error) { - console.log('getExternalVersionFromSource error:', error); + } catch { hasError = true; } } diff --git a/packages/plugins/@nocobase/plugin-workflow-action-trigger/.npmignore b/packages/plugins/@nocobase/plugin-workflow-action-trigger/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-action-trigger/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-aggregate/.npmignore b/packages/plugins/@nocobase/plugin-workflow-aggregate/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-aggregate/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-delay/.npmignore b/packages/plugins/@nocobase/plugin-workflow-delay/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-delay/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/.npmignore b/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-loop/.npmignore b/packages/plugins/@nocobase/plugin-workflow-loop/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-loop/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-manual/.npmignore b/packages/plugins/@nocobase/plugin-workflow-manual/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-manual/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-parallel/.npmignore b/packages/plugins/@nocobase/plugin-workflow-parallel/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-parallel/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-request/.npmignore b/packages/plugins/@nocobase/plugin-workflow-request/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-request/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-sql/.npmignore b/packages/plugins/@nocobase/plugin-workflow-sql/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-sql/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-workflow-test/.npmignore b/packages/plugins/@nocobase/plugin-workflow-test/.npmignore new file mode 100644 index 0000000000..c593fe9df7 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-workflow-test/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/src \ No newline at end of file