@lage-run/cli 0.31.1 → 0.31.3
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/commands/exec/executeRemotely.js +1 -1
- package/lib/commands/exec/executeRemotely.js.map +1 -1
- package/lib/commands/exec/simulateFileAccess.d.ts +1 -1
- package/lib/commands/exec/simulateFileAccess.js +15 -5
- package/lib/commands/exec/simulateFileAccess.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 17 Apr 2025 08:09:27 GMT",
|
|
6
|
+
"version": "0.31.3",
|
|
7
|
+
"tag": "@lage-run/cli_v0.31.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "email not defined",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "00e45954e48cdddcb3fa4b68a6e732a43ec7bd57",
|
|
14
|
+
"comment": "Update dependency workspace-tools to v0.38.3"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "renovate@whitesourcesoftware.com",
|
|
18
|
+
"package": "@lage-run/cli",
|
|
19
|
+
"commit": "00e45954e48cdddcb3fa4b68a6e732a43ec7bd57",
|
|
20
|
+
"comment": "Update dependency chokidar to v3.6.0"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Sat, 12 Apr 2025 08:09:17 GMT",
|
|
27
|
+
"version": "0.31.2",
|
|
28
|
+
"tag": "@lage-run/cli_v0.31.2",
|
|
29
|
+
"comments": {
|
|
30
|
+
"patch": [
|
|
31
|
+
{
|
|
32
|
+
"author": "kchau@microsoft.com",
|
|
33
|
+
"package": "@lage-run/cli",
|
|
34
|
+
"commit": "f8331c07cbef78945014d941c7171d48aae0e25c",
|
|
35
|
+
"comment": "make sure to touch / probe all directories deeply"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Wed, 02 Apr 2025 08:10:04 GMT",
|
|
6
42
|
"version": "0.31.1",
|
|
7
43
|
"tag": "@lage-run/cli_v0.31.1",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Thu, 17 Apr 2025 08:09:27 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.31.3
|
|
8
|
+
|
|
9
|
+
Thu, 17 Apr 2025 08:09:27 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Update dependency workspace-tools to v0.38.3 (email not defined)
|
|
14
|
+
- Update dependency chokidar to v3.6.0 (renovate@whitesourcesoftware.com)
|
|
15
|
+
|
|
16
|
+
## 0.31.2
|
|
17
|
+
|
|
18
|
+
Sat, 12 Apr 2025 08:09:17 GMT
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- make sure to touch / probe all directories deeply (kchau@microsoft.com)
|
|
23
|
+
|
|
7
24
|
## 0.31.1
|
|
8
25
|
|
|
9
|
-
Wed, 02 Apr 2025 08:
|
|
26
|
+
Wed, 02 Apr 2025 08:10:04 GMT
|
|
10
27
|
|
|
11
28
|
### Patches
|
|
12
29
|
|
|
@@ -124,7 +124,7 @@ async function executeRemotely(options, command) {
|
|
|
124
124
|
process.exitCode = response.exitCode;
|
|
125
125
|
// we will simulate file access even if exit code may be non-zero
|
|
126
126
|
const relativeGlobalInputsForTarget = _path.default.relative(root, _path.default.join(response.cwd, response.globalInputHashFile));
|
|
127
|
-
await (0, _simulateFileAccess.simulateFileAccess)(logger, [
|
|
127
|
+
await (0, _simulateFileAccess.simulateFileAccess)(logger, root, [
|
|
128
128
|
...response.inputs,
|
|
129
129
|
relativeGlobalInputsForTarget
|
|
130
130
|
], response.outputs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/exec/executeRemotely.ts"],"sourcesContent":["import path from \"path\";\nimport type { Logger } from \"@lage-run/logger\";\nimport createLogger from \"@lage-run/logger\";\nimport { initializeReporters } from \"../initializeReporters.js\";\nimport type { ReporterInitOptions } from \"../../types/ReporterInitOptions.js\";\nimport type { LageClient } from \"@lage-run/rpc\";\nimport { ConnectError, createClient } from \"@lage-run/rpc\";\nimport { filterArgsForTasks } from \"../run/filterArgsForTasks.js\";\nimport { simulateFileAccess } from \"./simulateFileAccess.js\";\nimport { parseServerOption } from \"../parseServerOption.js\";\nimport { getWorkspaceRoot } from \"workspace-tools\";\nimport type { Command } from \"commander\";\nimport { launchServerInBackground } from \"../launchServerInBackground.js\";\n\ninterface ExecRemotelyOptions extends ReporterInitOptions {\n cwd?: string;\n server?: string | boolean;\n timeout?: number;\n tasks: string[];\n nodeArg?: string;\n}\n\nasync function tryCreateClient(host: string, port: number) {\n const client = createClient({\n baseUrl: `http://${host}:${port}`,\n httpVersion: \"2\",\n });\n\n try {\n const success = await client.ping({});\n if (success.pong) {\n return client;\n }\n } catch (e) {\n if (e instanceof ConnectError) {\n return undefined;\n }\n\n throw e;\n }\n\n return undefined;\n}\n\nasync function tryCreateClientWithRetries(host: string, port: number, logger: Logger) {\n let client: ReturnType<typeof createClient> | undefined;\n\n const start = Date.now();\n while (Date.now() - start < 5 * 1000) {\n try {\n client = await tryCreateClient(host, port);\n\n if (client) {\n return client;\n }\n } catch (e) {\n if (e instanceof ConnectError) {\n logger.error(\"Error connecting to server\", e);\n }\n }\n\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n\n return undefined;\n}\n\nasync function executeOnServer(args: string[], client: LageClient, logger: Logger) {\n const task = args.length === 1 ? args[0] : args[1];\n const packageName = args.length > 1 ? args[0] : undefined;\n\n if (!task) {\n throw new Error(\"No task provided\");\n }\n\n const { taskArgs } = filterArgsForTasks(args ?? []);\n\n try {\n const response = await client.runTarget({\n packageName,\n task,\n taskArgs,\n });\n logger.info(`Task ${response.packageName} ${response.task} exited with code ${response.exitCode}`);\n return response;\n } catch (error) {\n if (error instanceof ConnectError) {\n logger.error(\"Error connecting to server\", { error });\n } else {\n logger.error(\"Error running task\", { error });\n }\n }\n}\n\nexport async function executeRemotely(options: ExecRemotelyOptions, command: Command) {\n // launch a 'lage-server.js' process, detached if it is not already running\n // send the command to the server process\n const { server, tasks, nodeArg } = options;\n const timeout = options.timeout ?? 5 * 60;\n\n const { host, port } = parseServerOption(server);\n\n const logger = createLogger();\n options.logLevel = options.logLevel ?? \"info\";\n options.reporter = options.reporter ?? \"json\";\n initializeReporters(logger, options);\n\n const root = getWorkspaceRoot(options.cwd ?? process.cwd())!;\n\n let client = await tryCreateClient(host, port);\n const args = command.args;\n\n logger.info(`Command args ${command.args.join(\" \")}`);\n\n if (!client) {\n await launchServerInBackground({\n host,\n port,\n tasks,\n args,\n timeout,\n logger,\n root,\n nodeArg,\n });\n\n logger.info(\"Creating a client to connect to the background services\");\n client = await tryCreateClientWithRetries(host, port, logger);\n\n if (!client) {\n throw new Error(\"Server could not be started\");\n }\n }\n\n logger.info(`Executing on server http://${host}:${port}`);\n const response = await executeOnServer(args, client, logger);\n\n if (response) {\n process.stdout.write(response.stdout);\n process.stderr.write(response.stderr);\n process.exitCode = response.exitCode;\n\n // we will simulate file access even if exit code may be non-zero\n const relativeGlobalInputsForTarget = path.relative(root, path.join(response.cwd, response.globalInputHashFile));\n await simulateFileAccess(logger, [...response.inputs, relativeGlobalInputsForTarget], response.outputs);\n } else {\n process.exitCode = 1;\n }\n\n logger.info(\"Task execution finished\");\n}\n"],"names":["executeRemotely","tryCreateClient","host","port","client","createClient","baseUrl","httpVersion","success","ping","pong","e","ConnectError","undefined","tryCreateClientWithRetries","logger","start","Date","now","error","Promise","resolve","setTimeout","executeOnServer","args","task","length","packageName","Error","taskArgs","filterArgsForTasks","response","runTarget","info","exitCode","options","command","server","tasks","nodeArg","timeout","parseServerOption","createLogger","logLevel","reporter","initializeReporters","root","getWorkspaceRoot","cwd","process","join","launchServerInBackground","stdout","write","stderr","relativeGlobalInputsForTarget","path","relative","globalInputHashFile","simulateFileAccess","inputs","outputs"],"mappings":";;;;+BA8FsBA;;;eAAAA;;;6DA9FL;+DAEQ;qCACW;qBAGO;oCACR;oCACA;mCACD;gCACD;0CAEQ;;;;;;AAUzC,eAAeC,gBAAgBC,IAAY,EAAEC,IAAY;IACvD,MAAMC,SAASC,IAAAA,iBAAY,EAAC;QAC1BC,SAAS,CAAC,OAAO,EAAEJ,KAAK,CAAC,EAAEC,MAAM;QACjCI,aAAa;IACf;IAEA,IAAI;QACF,MAAMC,UAAU,MAAMJ,OAAOK,IAAI,CAAC,CAAC;QACnC,IAAID,QAAQE,IAAI,EAAE;YAChB,OAAON;QACT;IACF,EAAE,OAAOO,GAAG;QACV,IAAIA,aAAaC,iBAAY,EAAE;YAC7B,OAAOC;QACT;QAEA,MAAMF;IACR;IAEA,OAAOE;AACT;AAEA,eAAeC,2BAA2BZ,IAAY,EAAEC,IAAY,EAAEY,MAAc;IAClF,IAAIX;IAEJ,MAAMY,QAAQC,KAAKC,GAAG;IACtB,MAAOD,KAAKC,GAAG,KAAKF,QAAQ,IAAI,KAAM;QACpC,IAAI;YACFZ,SAAS,MAAMH,gBAAgBC,MAAMC;YAErC,IAAIC,QAAQ;gBACV,OAAOA;YACT;QACF,EAAE,OAAOO,GAAG;YACV,IAAIA,aAAaC,iBAAY,EAAE;gBAC7BG,OAAOI,KAAK,CAAC,8BAA8BR;YAC7C;QACF;QAEA,MAAM,IAAIS,QA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C,IAAAA,wCAAmB,EAAC9B,QAAQoB;IAE5B,MAAMW,OAAOC,IAAAA,gCAAgB,EAACZ,QAAQa,GAAG,IAAIC,QAAQD,GAAG;IAExD,IAAI5C,SAAS,MAAMH,gBAAgBC,MAAMC;IACzC,MAAMqB,OAAOY,QAAQZ,IAAI;IAEzBT,OAAOkB,IAAI,CAAC,CAAC,aAAa,EAAEG,QAAQZ,IAAI,CAAC0B,IAAI,CAAC,MAAM;IAEpD,IAAI,CAAC9C,QAAQ;QACX,MAAM+C,IAAAA,kDAAwB,EAAC;YAC7BjD;YACAC;YACAmC;YACAd;YACAgB;YACAzB;YACA+B;YACAP;QACF;QAEAxB,OAAOkB,IAAI,CAAC;QACZ7B,SAAS,MAAMU,2BAA2BZ,MAAMC,MAAMY;QAEtD,IAAI,CAACX,QAAQ;YACX,MAAM,IAAIwB,MAAM;QAClB;IACF;IAEAb,OAAOkB,IAAI,CAAC,CAAC,2BAA2B,EAAE/B,KAAK,CAAC,EAAEC,MAAM;IACxD,MAAM4B,WAAW,MAAMR,gBAAgBC,MAAMpB,QAAQW;IAErD,IAAIgB,UAAU;QACZkB,QAAQG,MAAM,CAACC,KAAK,CAACtB,SAASqB,MAAM;QACpCH,QAAQK,MAAM,CAACD,KAAK,CAACtB,SAASuB,MAAM;QACpCL,QAAQf,QAAQ,GAAGH,SAASG,QAAQ;QAEpC,iEAAiE;QACjE,MAAMqB,gCAAgCC,aAAI,CAACC,QAAQ,CAACX,MAAMU,aAAI,CAACN,IAAI,CAACnB,SAASiB,GAAG,EAAEjB,SAAS2B,mBAAmB;QAC9G,MAAMC,IAAAA,sCAAkB,EAAC5C,QAAQ;
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/exec/executeRemotely.ts"],"sourcesContent":["import path from \"path\";\nimport type { Logger } from \"@lage-run/logger\";\nimport createLogger from \"@lage-run/logger\";\nimport { initializeReporters } from \"../initializeReporters.js\";\nimport type { ReporterInitOptions } from \"../../types/ReporterInitOptions.js\";\nimport type { LageClient } from \"@lage-run/rpc\";\nimport { ConnectError, createClient } from \"@lage-run/rpc\";\nimport { filterArgsForTasks } from \"../run/filterArgsForTasks.js\";\nimport { simulateFileAccess } from \"./simulateFileAccess.js\";\nimport { parseServerOption } from \"../parseServerOption.js\";\nimport { getWorkspaceRoot } from \"workspace-tools\";\nimport type { Command } from \"commander\";\nimport { launchServerInBackground } from \"../launchServerInBackground.js\";\n\ninterface ExecRemotelyOptions extends ReporterInitOptions {\n cwd?: string;\n server?: string | boolean;\n timeout?: number;\n tasks: string[];\n nodeArg?: string;\n}\n\nasync function tryCreateClient(host: string, port: number) {\n const client = createClient({\n baseUrl: `http://${host}:${port}`,\n httpVersion: \"2\",\n });\n\n try {\n const success = await client.ping({});\n if (success.pong) {\n return client;\n }\n } catch (e) {\n if (e instanceof ConnectError) {\n return undefined;\n }\n\n throw e;\n }\n\n return undefined;\n}\n\nasync function tryCreateClientWithRetries(host: string, port: number, logger: Logger) {\n let client: ReturnType<typeof createClient> | undefined;\n\n const start = Date.now();\n while (Date.now() - start < 5 * 1000) {\n try {\n client = await tryCreateClient(host, port);\n\n if (client) {\n return client;\n }\n } catch (e) {\n if (e instanceof ConnectError) {\n logger.error(\"Error connecting to server\", e);\n }\n }\n\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n\n return undefined;\n}\n\nasync function executeOnServer(args: string[], client: LageClient, logger: Logger) {\n const task = args.length === 1 ? args[0] : args[1];\n const packageName = args.length > 1 ? args[0] : undefined;\n\n if (!task) {\n throw new Error(\"No task provided\");\n }\n\n const { taskArgs } = filterArgsForTasks(args ?? []);\n\n try {\n const response = await client.runTarget({\n packageName,\n task,\n taskArgs,\n });\n logger.info(`Task ${response.packageName} ${response.task} exited with code ${response.exitCode}`);\n return response;\n } catch (error) {\n if (error instanceof ConnectError) {\n logger.error(\"Error connecting to server\", { error });\n } else {\n logger.error(\"Error running task\", { error });\n }\n }\n}\n\nexport async function executeRemotely(options: ExecRemotelyOptions, command: Command) {\n // launch a 'lage-server.js' process, detached if it is not already running\n // send the command to the server process\n const { server, tasks, nodeArg } = options;\n const timeout = options.timeout ?? 5 * 60;\n\n const { host, port } = parseServerOption(server);\n\n const logger = createLogger();\n options.logLevel = options.logLevel ?? \"info\";\n options.reporter = options.reporter ?? \"json\";\n initializeReporters(logger, options);\n\n const root = getWorkspaceRoot(options.cwd ?? process.cwd())!;\n\n let client = await tryCreateClient(host, port);\n const args = command.args;\n\n logger.info(`Command args ${command.args.join(\" \")}`);\n\n if (!client) {\n await launchServerInBackground({\n host,\n port,\n tasks,\n args,\n timeout,\n logger,\n root,\n nodeArg,\n });\n\n logger.info(\"Creating a client to connect to the background services\");\n client = await tryCreateClientWithRetries(host, port, logger);\n\n if (!client) {\n throw new Error(\"Server could not be started\");\n }\n }\n\n logger.info(`Executing on server http://${host}:${port}`);\n const response = await executeOnServer(args, client, logger);\n\n if (response) {\n process.stdout.write(response.stdout);\n process.stderr.write(response.stderr);\n process.exitCode = response.exitCode;\n\n // we will simulate file access even if exit code may be non-zero\n const relativeGlobalInputsForTarget = path.relative(root, path.join(response.cwd, response.globalInputHashFile));\n await simulateFileAccess(logger, root, [...response.inputs, relativeGlobalInputsForTarget], response.outputs);\n } else {\n process.exitCode = 1;\n }\n\n logger.info(\"Task execution finished\");\n}\n"],"names":["executeRemotely","tryCreateClient","host","port","client","createClient","baseUrl","httpVersion","success","ping","pong","e","ConnectError","undefined","tryCreateClientWithRetries","logger","start","Date","now","error","Promise","resolve","setTimeout","executeOnServer","args","task","length","packageName","Error","taskArgs","filterArgsForTasks","response","runTarget","info","exitCode","options","command","server","tasks","nodeArg","timeout","parseServerOption","createLogger","logLevel","reporter","initializeReporters","root","getWorkspaceRoot","cwd","process","join","launchServerInBackground","stdout","write","stderr","relativeGlobalInputsForTarget","path","relative","globalInputHashFile","simulateFileAccess","inputs","outputs"],"mappings":";;;;+BA8FsBA;;;eAAAA;;;6DA9FL;+DAEQ;qCACW;qBAGO;oCACR;oCACA;mCACD;gCACD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,2BAA2BZ,MAAMC,MAAMY;QAEtD,IAAI,CAACX,QAAQ;YACX,MAAM,IAAIwB,MAAM;QAClB;IACF;IAEAb,OAAOkB,IAAI,CAAC,CAAC,2BAA2B,EAAE/B,KAAK,CAAC,EAAEC,MAAM;IACxD,MAAM4B,WAAW,MAAMR,gBAAgBC,MAAMpB,QAAQW;IAErD,IAAIgB,UAAU;QACZkB,QAAQG,MAAM,CAACC,KAAK,CAACtB,SAASqB,MAAM;QACpCH,QAAQK,MAAM,CAACD,KAAK,CAACtB,SAASuB,MAAM;QACpCL,QAAQf,QAAQ,GAAGH,SAASG,QAAQ;QAEpC,iEAAiE;QACjE,MAAMqB,gCAAgCC,aAAI,CAACC,QAAQ,CAACX,MAAMU,aAAI,CAACN,IAAI,CAACnB,SAASiB,GAAG,EAAEjB,SAAS2B,mBAAmB;QAC9G,MAAMC,IAAAA,sCAAkB,EAAC5C,QAAQ+B,MAAM;eAAIf,SAAS6B,MAAM;YAAEL;SAA8B,EAAExB,SAAS8B,OAAO;IAC9G,OAAO;QACLZ,QAAQf,QAAQ,GAAG;IACrB;IAEAnB,OAAOkB,IAAI,CAAC;AACd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Logger } from "@lage-run/logger";
|
|
2
|
-
export declare function simulateFileAccess(logger: Logger, inputs: string[], outputs: string[]): Promise<void>;
|
|
2
|
+
export declare function simulateFileAccess(logger: Logger, root: string, inputs: string[], outputs: string[]): Promise<void>;
|
|
@@ -10,15 +10,23 @@ Object.defineProperty(exports, "simulateFileAccess", {
|
|
|
10
10
|
});
|
|
11
11
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
12
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
13
|
-
const _workspacetools = require("workspace-tools");
|
|
14
13
|
function _interop_require_default(obj) {
|
|
15
14
|
return obj && obj.__esModule ? obj : {
|
|
16
15
|
default: obj
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
|
-
async function simulateFileAccess(logger, inputs, outputs) {
|
|
20
|
-
const root = (0, _workspacetools.getWorkspaceRoot)(process.cwd());
|
|
18
|
+
async function simulateFileAccess(logger, root, inputs, outputs) {
|
|
21
19
|
logger.silly("Now probing and touching inputs and outputs");
|
|
20
|
+
// Helper to get all directory parts up to root
|
|
21
|
+
const getAllDirectoryParts = (filePath)=>{
|
|
22
|
+
const parts = [];
|
|
23
|
+
let dirPath = _path.default.dirname(filePath);
|
|
24
|
+
while(dirPath !== "." && dirPath !== ""){
|
|
25
|
+
parts.push(dirPath);
|
|
26
|
+
dirPath = _path.default.dirname(dirPath);
|
|
27
|
+
}
|
|
28
|
+
return parts;
|
|
29
|
+
};
|
|
22
30
|
const inputDirectories = new Set();
|
|
23
31
|
// probe input files
|
|
24
32
|
let fd;
|
|
@@ -29,7 +37,8 @@ async function simulateFileAccess(logger, inputs, outputs) {
|
|
|
29
37
|
} catch (e) {
|
|
30
38
|
// ignore
|
|
31
39
|
}
|
|
32
|
-
|
|
40
|
+
// Add all directory parts to the set
|
|
41
|
+
getAllDirectoryParts(input).forEach((dir)=>inputDirectories.add(dir));
|
|
33
42
|
}
|
|
34
43
|
for (const directory of inputDirectories){
|
|
35
44
|
try {
|
|
@@ -43,7 +52,8 @@ async function simulateFileAccess(logger, inputs, outputs) {
|
|
|
43
52
|
const time = new Date();
|
|
44
53
|
const outputDirectories = new Set();
|
|
45
54
|
for (const output of outputs){
|
|
46
|
-
|
|
55
|
+
// Add all directory parts to the set
|
|
56
|
+
getAllDirectoryParts(output).forEach((dir)=>outputDirectories.add(dir));
|
|
47
57
|
try {
|
|
48
58
|
_fs.default.utimesSync(_path.default.join(root, output), time, time);
|
|
49
59
|
} catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/exec/simulateFileAccess.ts"],"sourcesContent":["import type { Logger } from \"@lage-run/logger\";\nimport path from \"path\";\nimport fs from \"fs\";\
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/exec/simulateFileAccess.ts"],"sourcesContent":["import type { Logger } from \"@lage-run/logger\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport async function simulateFileAccess(logger: Logger, root: string, inputs: string[], outputs: string[]) {\n logger.silly(\"Now probing and touching inputs and outputs\");\n\n // Helper to get all directory parts up to root\n const getAllDirectoryParts = (filePath: string): string[] => {\n const parts: string[] = [];\n let dirPath = path.dirname(filePath);\n\n while (dirPath !== \".\" && dirPath !== \"\") {\n parts.push(dirPath);\n dirPath = path.dirname(dirPath);\n }\n\n return parts;\n };\n\n const inputDirectories = new Set<string>();\n\n // probe input files\n let fd: number;\n for (const input of inputs) {\n try {\n fd = fs.openSync(path.join(root, input), \"r\");\n fs.closeSync(fd);\n } catch (e) {\n // ignore\n }\n\n // Add all directory parts to the set\n getAllDirectoryParts(input).forEach((dir) => inputDirectories.add(dir));\n }\n\n for (const directory of inputDirectories) {\n try {\n fd = fs.openSync(path.join(root, directory), \"r\");\n fs.closeSync(fd);\n } catch (e) {\n // ignore\n }\n }\n\n // touch output files\n const time = new Date();\n const outputDirectories = new Set<string>();\n for (const output of outputs) {\n // Add all directory parts to the set\n getAllDirectoryParts(output).forEach((dir) => outputDirectories.add(dir));\n\n try {\n fs.utimesSync(path.join(root, output), time, time);\n } catch (e) {\n // ignore\n }\n }\n\n for (const directory of outputDirectories) {\n try {\n fs.utimesSync(path.join(root, directory), time, time);\n } catch (e) {\n // ignore\n }\n }\n}\n"],"names":["simulateFileAccess","logger","root","inputs","outputs","silly","getAllDirectoryParts","filePath","parts","dirPath","path","dirname","push","inputDirectories","Set","fd","input","fs","openSync","join","closeSync","e","forEach","dir","add","directory","time","Date","outputDirectories","output","utimesSync"],"mappings":";;;;+BAIsBA;;;eAAAA;;;6DAHL;2DACF;;;;;;AAER,eAAeA,mBAAmBC,MAAc,EAAEC,IAAY,EAAEC,MAAgB,EAAEC,OAAiB;IACxGH,OAAOI,KAAK,CAAC;IAEb,+CAA+C;IAC/C,MAAMC,u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AAOL,GAAG;QACV,SAAS;QACX;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.3",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
"lint": "monorepo-scripts lint"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@lage-run/cache": "^1.3.
|
|
25
|
-
"@lage-run/config": "^0.4.
|
|
24
|
+
"@lage-run/cache": "^1.3.12",
|
|
25
|
+
"@lage-run/config": "^0.4.13",
|
|
26
26
|
"@lage-run/format-hrtime": "^0.1.6",
|
|
27
27
|
"@lage-run/globby": "^14.2.1",
|
|
28
|
-
"@lage-run/hasher": "^1.8.
|
|
28
|
+
"@lage-run/hasher": "^1.8.2",
|
|
29
29
|
"@lage-run/logger": "^1.3.1",
|
|
30
|
-
"@lage-run/reporters": "^1.3.
|
|
30
|
+
"@lage-run/reporters": "^1.3.1",
|
|
31
31
|
"@lage-run/rpc": "^1.4.0",
|
|
32
|
-
"@lage-run/runners": "^1.2.
|
|
33
|
-
"@lage-run/scheduler": "^1.5.
|
|
34
|
-
"@lage-run/scheduler-types": "^0.3.
|
|
35
|
-
"@lage-run/target-graph": "^0.11.
|
|
32
|
+
"@lage-run/runners": "^1.2.2",
|
|
33
|
+
"@lage-run/scheduler": "^1.5.5",
|
|
34
|
+
"@lage-run/scheduler-types": "^0.3.24",
|
|
35
|
+
"@lage-run/target-graph": "^0.11.2",
|
|
36
36
|
"@lage-run/worker-threads-pool": "^0.9.0",
|
|
37
|
-
"chokidar": "3.
|
|
37
|
+
"chokidar": "3.6.0",
|
|
38
38
|
"commander": "9.5.0",
|
|
39
39
|
"execa": "5.1.1",
|
|
40
40
|
"fast-glob": "3.3.3",
|
|
41
41
|
"proper-lockfile": "^4.1.2",
|
|
42
42
|
"shell-quote": "^1.8.1",
|
|
43
|
-
"workspace-tools": "0.38.
|
|
43
|
+
"workspace-tools": "0.38.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@lage-run/monorepo-fixture": "^0.1.0",
|