@netlify/build-info 6.0.8-rc → 6.1.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.
- package/lib/bin.js +0 -0
- package/lib/detect-build-system.js +15 -3
- package/lib/get-build-info.js +4 -6
- package/package.json +4 -3
package/lib/bin.js
CHANGED
|
File without changes
|
|
@@ -100,7 +100,7 @@ const BUILD_SYSTEMS = {
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
bazel: async (baseDir, rootDir) => {
|
|
103
|
-
const bazel = ['.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel'];
|
|
103
|
+
const bazel = ['.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'BUILD.bazel'];
|
|
104
104
|
const bazelConfigPath = lookFor(bazel, baseDir, rootDir);
|
|
105
105
|
if (bazelConfigPath) {
|
|
106
106
|
return Promise.resolve({
|
|
@@ -108,9 +108,21 @@ const BUILD_SYSTEMS = {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
+
moon: async (baseDir, rootDir) => {
|
|
112
|
+
const moon = ['.moon'];
|
|
113
|
+
const moonConfigPath = lookFor(moon, baseDir, rootDir, 'directory');
|
|
114
|
+
if (moonConfigPath) {
|
|
115
|
+
const pkgJson = getPkgJson(moonConfigPath);
|
|
116
|
+
const { devDependencies } = pkgJson;
|
|
117
|
+
return Promise.resolve({
|
|
118
|
+
name: 'moon',
|
|
119
|
+
version: devDependencies?.moon,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
},
|
|
111
123
|
};
|
|
112
|
-
const lookFor = (configFile, baseDir, rootDir) => {
|
|
113
|
-
return findUpSync(configFile, { cwd: baseDir, stopAt: rootDir });
|
|
124
|
+
const lookFor = (configFile, baseDir, rootDir, type) => {
|
|
125
|
+
return findUpSync(configFile, { cwd: baseDir, stopAt: rootDir, type: type });
|
|
114
126
|
};
|
|
115
127
|
const getPkgJson = (configPath) => {
|
|
116
128
|
return JSON.parse(readFileSync(path.join(path.dirname(configPath), 'package.json'), 'utf-8'));
|
package/lib/get-build-info.js
CHANGED
|
@@ -6,16 +6,18 @@ import { getWorkspaceInfo } from './workspaces.js';
|
|
|
6
6
|
export const getBuildInfo = async (opts) => {
|
|
7
7
|
const context = await getContext(opts);
|
|
8
8
|
let frameworks = [];
|
|
9
|
+
let buildSystems = [];
|
|
9
10
|
try {
|
|
10
|
-
// if the framework detection is crashing we should not crash the build info and package-manager
|
|
11
|
+
// if the framework or buildSystem detection is crashing we should not crash the build info and package-manager
|
|
11
12
|
// detection
|
|
12
13
|
frameworks = await listFrameworks({ projectDir: context.projectDir });
|
|
14
|
+
buildSystems = await detectBuildSystems(context.projectDir, context.rootDir);
|
|
13
15
|
}
|
|
14
16
|
catch {
|
|
15
17
|
// TODO: build reporting to buildbot see: https://github.com/netlify/pillar-workflow/issues/1001
|
|
16
18
|
// noop
|
|
17
19
|
}
|
|
18
|
-
const info = { frameworks };
|
|
20
|
+
const info = { frameworks, buildSystems };
|
|
19
21
|
// only if we find a root package.json we know this is a javascript workspace
|
|
20
22
|
if (Object.keys(context.rootPackageJson).length > 0) {
|
|
21
23
|
info.packageManager = await detectPackageManager(context.projectDir, context.rootDir);
|
|
@@ -24,9 +26,5 @@ export const getBuildInfo = async (opts) => {
|
|
|
24
26
|
info.jsWorkspaces = workspaceInfo;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
|
-
const buildSystems = await detectBuildSystems(context.projectDir, context.rootDir);
|
|
28
|
-
if (buildSystems.length > 0) {
|
|
29
|
-
info.buildSystems = buildSystems;
|
|
30
|
-
}
|
|
31
29
|
return info;
|
|
32
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build-info",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Build info utility",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"author": "Netlify Inc.",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@netlify/framework-info": "^9.5.
|
|
33
|
+
"@netlify/framework-info": "^9.5.3",
|
|
34
34
|
"@npmcli/map-workspaces": "^2.0.0",
|
|
35
35
|
"find-up": "^6.3.0",
|
|
36
36
|
"read-pkg": "^7.1.0",
|
|
@@ -51,5 +51,6 @@
|
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": "^14.16.0 || >=16.0.0"
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"gitHead": "e22d6106d734d2b4b7b49d2a2350be21913c0cbf"
|
|
55
56
|
}
|