@next-core/build-config-factory 2.25.46 → 2.26.0

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/post-build.js +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/build-config-factory",
3
- "version": "2.25.46",
3
+ "version": "2.26.0",
4
4
  "description": "build config factory",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/build-config-factory",
6
6
  "license": "GPL-3.0",
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "sideEffects": false,
17
17
  "dependencies": {
18
- "@next-core/brick-utils": "^2.51.20",
18
+ "@next-core/brick-utils": "^2.52.0",
19
19
  "@next-core/repo-config": "^0.2.5",
20
20
  "@next-core/typedoc-plugin-filter-inherit": "^1.2.5",
21
- "@next-core/webpack-config-factory": "^2.23.0",
21
+ "@next-core/webpack-config-factory": "^2.24.0",
22
22
  "change-case": "^4.1.2",
23
23
  "chokidar": "^3.5.3",
24
24
  "fs-extra": "^10.1.0",
@@ -34,5 +34,5 @@
34
34
  "typedoc": "^0.19.2",
35
35
  "typedoc-plugin-no-inherit": "^1.2.2"
36
36
  },
37
- "gitHead": "8aee98be63c09c9d9f972823b2c5b3a93fc047f2"
37
+ "gitHead": "5814c04ee30fa90c2e6df59d34891c75c1f54bc9"
38
38
  }
package/src/post-build.js CHANGED
@@ -160,6 +160,37 @@ const mergeEditors = () => {
160
160
  });
161
161
  fs.removeSync(distEditorsDir);
162
162
  }
163
+
164
+ const distPropertyEditorsDir = path.join(brickDir, "dist-property-editors");
165
+ const distPropertyEditorsJsonPath = path.join(
166
+ distPropertyEditorsDir,
167
+ "editors.json"
168
+ );
169
+ if (fs.existsSync(distPropertyEditorsJsonPath)) {
170
+ const distDir = path.join(brickDir, "dist");
171
+ const bricksJsonPath = path.join(distDir, "bricks.json");
172
+ const bricksJson = fs.readJsonSync(bricksJsonPath);
173
+ fs.writeJsonSync(
174
+ bricksJsonPath,
175
+ {
176
+ ...bricksJson,
177
+ ...fs.readJsonSync(distPropertyEditorsJsonPath),
178
+ },
179
+ {
180
+ spaces: 2,
181
+ }
182
+ );
183
+ fs.copySync(
184
+ distPropertyEditorsDir,
185
+ path.join(distDir, "property-editors"),
186
+ {
187
+ filter: (src) => {
188
+ return !src.endsWith("editors.json");
189
+ },
190
+ }
191
+ );
192
+ fs.removeSync(distPropertyEditorsJsonPath);
193
+ }
163
194
  };
164
195
 
165
196
  module.exports = (scope) => {