@nocobase/build 2.0.0-alpha.51 → 2.0.0-alpha.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -339,7 +339,11 @@ async function buildProPluginServer(cwd, userConfig, sourcemap, log) {
339
339
  };
340
340
  if (!cwd.includes(import_constant.PLUGIN_COMMERCIAL)) {
341
341
  externalOptions.external = [/^[./]/];
342
- externalOptions.noExternal = [entryFile, /@nocobase\/plugin-commercial\/server/, /dist\/server\/index\.js/];
342
+ externalOptions.noExternal = [
343
+ entryFile,
344
+ /@nocobase\/plugin-commercial\/server/,
345
+ /dist\/server\/index\.js/
346
+ ];
343
347
  externalOptions.onSuccess = async () => {
344
348
  const serverFiles2 = [import_path.default.join(cwd, target_dir, "server", "index.js")];
345
349
  serverFiles2.forEach((file) => {
@@ -348,6 +352,9 @@ async function buildProPluginServer(cwd, userConfig, sourcemap, log) {
348
352
  };
349
353
  externalOptions.esbuildPlugins = [import_pluginEsbuildCommercialInject.default];
350
354
  }
355
+ if (cwd.includes(import_constant.PLUGIN_COMMERCIAL)) {
356
+ externalOptions.noExternal = [/@nocobase\/plugin-license/, /dist\/server\/index\.js/];
357
+ }
351
358
  await (0, import_tsup.build)(
352
359
  userConfig.modifyTsupConfig({
353
360
  entry: [entryFile],
package/lib/constant.js CHANGED
@@ -36,6 +36,7 @@ __export(constant_exports, {
36
36
  PACKAGES_PATH: () => PACKAGES_PATH,
37
37
  PLUGINS_DIR: () => PLUGINS_DIR,
38
38
  PLUGIN_COMMERCIAL: () => PLUGIN_COMMERCIAL,
39
+ PLUGIN_LICENSE: () => PLUGIN_LICENSE,
39
40
  PRESETS_DIR: () => PRESETS_DIR,
40
41
  ROOT_PATH: () => ROOT_PATH,
41
42
  TAR_OUTPUT_DIR: () => TAR_OUTPUT_DIR,
@@ -78,8 +79,13 @@ const PACKAGES_PATH = import_path.default.join(ROOT_PATH, "packages");
78
79
  const PLUGINS_DIR = ["plugins", "samples", "pro-plugins"].concat((process.env.PLUGINS_DIRS || "").split(",")).filter(Boolean).map((name) => import_path.default.join(PACKAGES_PATH, name));
79
80
  const PRESETS_DIR = import_path.default.join(PACKAGES_PATH, "presets");
80
81
  const PLUGIN_COMMERCIAL = "@nocobase/plugin-commercial";
82
+ const PLUGIN_LICENSE = "@nocobase/plugin-license";
81
83
  const getPluginPackages = (packages) => packages.filter((item) => PLUGINS_DIR.some((pluginDir) => item.location.startsWith(pluginDir))).sort((a, b) => {
82
- return a.name === PLUGIN_COMMERCIAL ? -1 : 1;
84
+ const priority = {
85
+ [PLUGIN_LICENSE]: 0,
86
+ [PLUGIN_COMMERCIAL]: 1
87
+ };
88
+ return (priority[a.name] ?? 99) - (priority[b.name] ?? 99);
83
89
  });
84
90
  const getPresetsPackages = (packages) => packages.filter((item) => item.location.startsWith(PRESETS_DIR));
85
91
  const CORE_APP = import_path.default.join(PACKAGES_PATH, "core/app");
@@ -104,6 +110,7 @@ const TAR_OUTPUT_DIR = process.env.TAR_PATH ? process.env.TAR_PATH : import_path
104
110
  PACKAGES_PATH,
105
111
  PLUGINS_DIR,
106
112
  PLUGIN_COMMERCIAL,
113
+ PLUGIN_LICENSE,
107
114
  PRESETS_DIR,
108
115
  ROOT_PATH,
109
116
  TAR_OUTPUT_DIR,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/build",
3
- "version": "2.0.0-alpha.51",
3
+ "version": "2.0.0-alpha.53",
4
4
  "description": "Library build tool based on rollup.",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -54,5 +54,5 @@
54
54
  "build": "tsup",
55
55
  "build:watch": "tsup --watch"
56
56
  },
57
- "gitHead": "a1e34dd97f370d54f3d80a6b83ab7ddb9c72dc18"
57
+ "gitHead": "ff30cf8261f5a97b3f24c3752af5bbc564167b37"
58
58
  }