@nocobase/build 2.1.0-beta.26 → 2.1.0-beta.29
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.
- package/lib/buildPlugin.js +5 -2
- package/lib/utils/buildPluginUtils.js +13 -0
- package/package.json +2 -2
package/lib/buildPlugin.js
CHANGED
|
@@ -529,8 +529,11 @@ async function buildPluginClient(cwd, userConfig, sourcemap, log, lane = "client
|
|
|
529
529
|
});
|
|
530
530
|
clientFiles.push(...commercialFiles);
|
|
531
531
|
}
|
|
532
|
-
const
|
|
533
|
-
|
|
532
|
+
const sourceCwds = [cwd];
|
|
533
|
+
if (isCommercial) {
|
|
534
|
+
sourceCwds.push(import_path.default.join(process.cwd(), "packages/pro-plugins", import_constant.PLUGIN_COMMERCIAL));
|
|
535
|
+
}
|
|
536
|
+
const sourcePackages = (0, import_buildPluginUtils.getPluginBrowserSourcePackages)(sourceCwds, import_constant.globExcludeFiles);
|
|
534
537
|
const excludePackages = (0, import_buildPluginUtils.getExcludePackages)(sourcePackages, external, pluginPrefix);
|
|
535
538
|
(0, import_buildPluginUtils.checkRequire)(clientFiles, log);
|
|
536
539
|
(0, import_buildPluginUtils.buildCheck)({ cwd, packageJson, entry: lane, files: clientFiles, log });
|
|
@@ -39,6 +39,7 @@ __export(buildPluginUtils_exports, {
|
|
|
39
39
|
getPackageJsonPackages: () => getPackageJsonPackages,
|
|
40
40
|
getPackageNameFromString: () => getPackageNameFromString,
|
|
41
41
|
getPackagesFromFiles: () => getPackagesFromFiles,
|
|
42
|
+
getPluginBrowserSourcePackages: () => getPluginBrowserSourcePackages,
|
|
42
43
|
getSourcePackages: () => getSourcePackages,
|
|
43
44
|
isNotBuiltinModule: () => isNotBuiltinModule,
|
|
44
45
|
isValidPackageName: () => isValidPackageName
|
|
@@ -46,6 +47,7 @@ __export(buildPluginUtils_exports, {
|
|
|
46
47
|
module.exports = __toCommonJS(buildPluginUtils_exports);
|
|
47
48
|
var import_fs = __toESM(require("fs"));
|
|
48
49
|
var import_chalk = __toESM(require("chalk"));
|
|
50
|
+
var import_fast_glob = __toESM(require("fast-glob"));
|
|
49
51
|
var import_module = require("module");
|
|
50
52
|
var import_path = __toESM(require("path"));
|
|
51
53
|
const requireRegex = /require\s*\(['"`](.*?)['"`]\)/g;
|
|
@@ -76,6 +78,16 @@ function getPackagesFromFiles(files) {
|
|
|
76
78
|
]).flat().map(getPackageNameFromString).filter(Boolean).filter(isNotBuiltinModule);
|
|
77
79
|
return [...new Set(packageNames)];
|
|
78
80
|
}
|
|
81
|
+
function getPluginBrowserSourcePackages(cwds, excludeFiles) {
|
|
82
|
+
const files = cwds.flatMap(
|
|
83
|
+
(cwd) => import_fast_glob.default.globSync(["src/**/*.{ts,js,tsx,jsx,mjs}", "!src/server/**", ...excludeFiles], {
|
|
84
|
+
cwd,
|
|
85
|
+
absolute: true
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
const source = files.map((item) => import_fs.default.readFileSync(item, "utf-8"));
|
|
89
|
+
return getPackagesFromFiles(source);
|
|
90
|
+
}
|
|
79
91
|
function getSourcePackages(fileSources) {
|
|
80
92
|
return getPackagesFromFiles(fileSources);
|
|
81
93
|
}
|
|
@@ -163,6 +175,7 @@ function checkFileSize(outDir, log) {
|
|
|
163
175
|
getPackageJsonPackages,
|
|
164
176
|
getPackageNameFromString,
|
|
165
177
|
getPackagesFromFiles,
|
|
178
|
+
getPluginBrowserSourcePackages,
|
|
166
179
|
getSourcePackages,
|
|
167
180
|
isNotBuiltinModule,
|
|
168
181
|
isValidPackageName
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/build",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.29",
|
|
4
4
|
"description": "Library build tool based on rollup.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"build": "tsup",
|
|
54
54
|
"build:watch": "tsup --watch"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "86c41be29dcbcac6fd6aa46b4a137ef07a27c1d0"
|
|
57
57
|
}
|