@lage-run/config 0.1.4 → 0.2.1
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/CHANGELOG.json +37 -1
- package/CHANGELOG.md +19 -2
- package/lib/getConcurrency.js +5 -3
- package/lib/getConfig.d.ts +3 -0
- package/lib/getConfig.js +7 -15
- package/lib/getMaxWorkersPerTask.js +6 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +19 -7
- package/lib/readConfigFile.d.ts +5 -0
- package/lib/readConfigFile.js +24 -0
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@lage-run/config",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 08 May 2023 22:26:52 GMT",
|
|
6
|
+
"tag": "@lage-run/config_v0.2.1",
|
|
7
|
+
"version": "0.2.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@lage-run/config",
|
|
13
|
+
"comment": "Bump @lage-run/scheduler-types to v0.3.9",
|
|
14
|
+
"commit": "5a132808f166179bc316a279c9e11a13d3a39103"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@lage-run/config",
|
|
19
|
+
"comment": "Bump @lage-run/target-graph to v0.8.6",
|
|
20
|
+
"commit": "5a132808f166179bc316a279c9e11a13d3a39103"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Wed, 26 Apr 2023 04:56:20 GMT",
|
|
27
|
+
"tag": "@lage-run/config_v0.2.0",
|
|
28
|
+
"version": "0.2.0",
|
|
29
|
+
"comments": {
|
|
30
|
+
"minor": [
|
|
31
|
+
{
|
|
32
|
+
"author": "elcraig@microsoft.com",
|
|
33
|
+
"package": "@lage-run/config",
|
|
34
|
+
"commit": "56910ce2ef67d9d3dc99b7a75df007820e9444c8",
|
|
35
|
+
"comment": "Add readConfigFile API to read the file without defaults"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Tue, 25 Apr 2023 02:51:19 GMT",
|
|
6
42
|
"tag": "@lage-run/config_v0.1.4",
|
|
7
43
|
"version": "0.1.4",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
# Change Log - @lage-run/config
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 08 May 2023 22:26:52 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.2.1
|
|
8
|
+
|
|
9
|
+
Mon, 08 May 2023 22:26:52 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @lage-run/scheduler-types to v0.3.9
|
|
14
|
+
- Bump @lage-run/target-graph to v0.8.6
|
|
15
|
+
|
|
16
|
+
## 0.2.0
|
|
17
|
+
|
|
18
|
+
Wed, 26 Apr 2023 04:56:20 GMT
|
|
19
|
+
|
|
20
|
+
### Minor changes
|
|
21
|
+
|
|
22
|
+
- Add readConfigFile API to read the file without defaults (elcraig@microsoft.com)
|
|
23
|
+
|
|
7
24
|
## 0.1.4
|
|
8
25
|
|
|
9
|
-
Tue, 25 Apr 2023 02:
|
|
26
|
+
Tue, 25 Apr 2023 02:51:19 GMT
|
|
10
27
|
|
|
11
28
|
### Patches
|
|
12
29
|
|
package/lib/getConcurrency.js
CHANGED
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "getConcurrency", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getConcurrency;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _os = /*#__PURE__*/
|
|
10
|
-
function
|
|
11
|
+
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
package/lib/getConfig.d.ts
CHANGED
package/lib/getConfig.js
CHANGED
|
@@ -4,27 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "getConfig", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _os = /*#__PURE__*/
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) {
|
|
11
|
+
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
12
|
+
const _readConfigFile = require("./readConfigFile.js");
|
|
13
|
+
function _interop_require_default(obj) {
|
|
13
14
|
return obj && obj.__esModule ? obj : {
|
|
14
15
|
default: obj
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
async function getConfig(cwd) {
|
|
18
|
-
|
|
19
|
-
const root = (0, _workspaceTools.getWorkspaceRoot)(cwd);
|
|
20
|
-
if (!root) {
|
|
21
|
-
throw new Error("This must be called inside a codebase that is part of a JavaScript workspace.");
|
|
22
|
-
}
|
|
23
|
-
// Search for lage.config.js file
|
|
24
|
-
const ConfigModuleName = "lage";
|
|
25
|
-
const configExplorer = await (0, _cosmiconfig.cosmiconfig)(ConfigModuleName);
|
|
26
|
-
const results = await configExplorer.search(root ?? cwd);
|
|
27
|
-
const config = results?.config;
|
|
19
|
+
const config = await (0, _readConfigFile.readConfigFile)(cwd) || {};
|
|
28
20
|
return {
|
|
29
21
|
cacheOptions: config?.cacheOptions ?? {},
|
|
30
22
|
ignore: config?.ignore ?? [],
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getMaxWorkersPerTask: ()
|
|
13
|
-
|
|
12
|
+
getMaxWorkersPerTask: function() {
|
|
13
|
+
return getMaxWorkersPerTask;
|
|
14
|
+
},
|
|
15
|
+
getMaxWorkersPerTaskFromOptions: function() {
|
|
16
|
+
return getMaxWorkersPerTaskFromOptions;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
function getMaxWorkersPerTask(pipelineConfig, concurrency) {
|
|
16
20
|
const maxWorkersPerTask = new Map();
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { getConfig } from "./getConfig.js";
|
|
2
2
|
export { getConcurrency } from "./getConcurrency.js";
|
|
3
3
|
export { getMaxWorkersPerTask, getMaxWorkersPerTaskFromOptions } from "./getMaxWorkersPerTask.js";
|
|
4
|
+
export { readConfigFile } from "./readConfigFile.js";
|
|
4
5
|
export type { PipelineDefinition } from "./types/PipelineDefinition.js";
|
|
5
6
|
export type { ConfigOptions } from "./types/ConfigOptions.js";
|
|
6
7
|
export type { CacheOptions } from "./types/CacheOptions.js";
|
package/lib/index.js
CHANGED
|
@@ -9,11 +9,23 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getConfig: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
getConfig: function() {
|
|
13
|
+
return _getConfig.getConfig;
|
|
14
|
+
},
|
|
15
|
+
getConcurrency: function() {
|
|
16
|
+
return _getConcurrency.getConcurrency;
|
|
17
|
+
},
|
|
18
|
+
getMaxWorkersPerTask: function() {
|
|
19
|
+
return _getMaxWorkersPerTask.getMaxWorkersPerTask;
|
|
20
|
+
},
|
|
21
|
+
getMaxWorkersPerTaskFromOptions: function() {
|
|
22
|
+
return _getMaxWorkersPerTask.getMaxWorkersPerTaskFromOptions;
|
|
23
|
+
},
|
|
24
|
+
readConfigFile: function() {
|
|
25
|
+
return _readConfigFile.readConfigFile;
|
|
26
|
+
}
|
|
16
27
|
});
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
28
|
+
const _getConfig = require("./getConfig.js");
|
|
29
|
+
const _getConcurrency = require("./getConcurrency.js");
|
|
30
|
+
const _getMaxWorkersPerTask = require("./getMaxWorkersPerTask.js");
|
|
31
|
+
const _readConfigFile = require("./readConfigFile.js");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "readConfigFile", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return readConfigFile;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _cosmiconfig = require("cosmiconfig");
|
|
12
|
+
const _workspacetools = require("workspace-tools");
|
|
13
|
+
const ConfigModuleName = "lage";
|
|
14
|
+
async function readConfigFile(cwd) {
|
|
15
|
+
// Verify presence of git
|
|
16
|
+
const root = (0, _workspacetools.getWorkspaceRoot)(cwd);
|
|
17
|
+
if (!root) {
|
|
18
|
+
throw new Error("This must be called inside a codebase that is part of a JavaScript workspace.");
|
|
19
|
+
}
|
|
20
|
+
// Search for lage.config.js file
|
|
21
|
+
const configExplorer = await (0, _cosmiconfig.cosmiconfig)(ConfigModuleName);
|
|
22
|
+
const results = await configExplorer.search(root ?? cwd);
|
|
23
|
+
return results?.config || undefined;
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/config",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Config management for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"backfill-config": "^6.3.1",
|
|
24
24
|
"@lage-run/logger": "^1.3.0",
|
|
25
|
-
"@lage-run/scheduler-types": "^0.3.
|
|
26
|
-
"@lage-run/target-graph": "^0.8.
|
|
25
|
+
"@lage-run/scheduler-types": "^0.3.9",
|
|
26
|
+
"@lage-run/target-graph": "^0.8.6",
|
|
27
27
|
"workspace-tools": "^0.34.0",
|
|
28
28
|
"cosmiconfig": "^7.0.0"
|
|
29
29
|
},
|