@next-core/build-next-bricks 1.14.4 → 1.14.5
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/package.json +2 -2
- package/src/scanBricks.js +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/build-next-bricks",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.5",
|
|
4
4
|
"description": "Build next bricks",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/build-next-bricks",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@next-core/brick-manifest": "^0.5.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "52657fac0127bf11af3815539756182cf53bfb39"
|
|
57
57
|
}
|
package/src/scanBricks.js
CHANGED
|
@@ -719,17 +719,18 @@ export default async function scanBricks(packageDir) {
|
|
|
719
719
|
if (files.length) {
|
|
720
720
|
await Promise.all(
|
|
721
721
|
[...new Set(files)].map((file) => {
|
|
722
|
-
const
|
|
722
|
+
const dirName = path.dirname(file);
|
|
723
723
|
const lastName = path.basename(file);
|
|
724
724
|
const matchExtension = /\.[tj]sx?$/.test(lastName);
|
|
725
725
|
const noExtension = !lastName.includes(".");
|
|
726
|
+
/** @type {[string, Set<string>]} */
|
|
726
727
|
let fileInfo;
|
|
727
728
|
|
|
728
729
|
if (matchExtension || noExtension) {
|
|
729
|
-
fileInfo = [
|
|
730
|
+
fileInfo = [dirName, new Set([lastName.replace(/\.[^.]+$/, "")])];
|
|
730
731
|
}
|
|
731
732
|
if (noExtension && existsSync(file) && statSync(file).isDirectory()) {
|
|
732
|
-
fileInfo = [
|
|
733
|
+
fileInfo = [dirName, new Set(["index"])];
|
|
733
734
|
}
|
|
734
735
|
|
|
735
736
|
if (fileInfo) {
|