@expo/steps 1.0.25 → 1.0.29
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/dist_commonjs/BuildConfig.cjs +6 -2
- package/dist_commonjs/BuildConfig.d.ts +4 -3
- package/dist_commonjs/BuildConfig.js.map +1 -1
- package/dist_commonjs/BuildConfigParser.cjs +16 -6
- package/dist_commonjs/BuildConfigParser.d.ts +1 -3
- package/dist_commonjs/BuildConfigParser.js.map +1 -1
- package/dist_commonjs/BuildFunction.cjs +10 -4
- package/dist_commonjs/BuildFunction.d.ts +5 -3
- package/dist_commonjs/BuildFunction.js.map +1 -1
- package/dist_commonjs/BuildStep.cjs +60 -12
- package/dist_commonjs/BuildStep.d.ts +21 -4
- package/dist_commonjs/BuildStep.js.map +1 -1
- package/dist_commonjs/BuildStepContext.cjs +50 -1
- package/dist_commonjs/BuildStepContext.d.ts +29 -4
- package/dist_commonjs/BuildStepContext.js.map +1 -1
- package/dist_commonjs/BuildStepInput.cjs +27 -1
- package/dist_commonjs/BuildStepInput.d.ts +31 -17
- package/dist_commonjs/BuildStepInput.js.map +1 -1
- package/dist_commonjs/BuildStepOutput.cjs +21 -1
- package/dist_commonjs/BuildStepOutput.d.ts +18 -8
- package/dist_commonjs/BuildStepOutput.js.map +1 -1
- package/dist_commonjs/BuildWorkflowValidator.cjs +25 -1
- package/dist_commonjs/BuildWorkflowValidator.d.ts +2 -1
- package/dist_commonjs/BuildWorkflowValidator.js.map +1 -1
- package/dist_commonjs/cli/cli.cjs +2 -2
- package/dist_commonjs/cli/cli.js.map +1 -1
- package/dist_commonjs/index.cjs +5 -3
- package/dist_commonjs/index.d.ts +1 -0
- package/dist_commonjs/index.js.map +1 -1
- package/dist_commonjs/scripts/runCustomFunction.cjs +106 -0
- package/dist_commonjs/scripts/runCustomFunction.d.ts +1 -0
- package/dist_commonjs/scripts/runCustomFunction.js.map +1 -0
- package/dist_commonjs/utils/customFunction.cjs +32 -0
- package/dist_commonjs/utils/customFunction.d.ts +13 -0
- package/dist_commonjs/utils/customFunction.js.map +1 -0
- package/dist_esm/BuildConfig.d.ts +4 -3
- package/dist_esm/BuildConfig.js +7 -3
- package/dist_esm/BuildConfig.js.map +1 -1
- package/dist_esm/BuildConfigParser.d.ts +1 -3
- package/dist_esm/BuildConfigParser.js +16 -6
- package/dist_esm/BuildConfigParser.js.map +1 -1
- package/dist_esm/BuildFunction.d.ts +5 -3
- package/dist_esm/BuildFunction.js +10 -4
- package/dist_esm/BuildFunction.js.map +1 -1
- package/dist_esm/BuildStep.d.ts +21 -4
- package/dist_esm/BuildStep.js +59 -12
- package/dist_esm/BuildStep.js.map +1 -1
- package/dist_esm/BuildStepContext.d.ts +29 -4
- package/dist_esm/BuildStepContext.js +50 -1
- package/dist_esm/BuildStepContext.js.map +1 -1
- package/dist_esm/BuildStepInput.d.ts +31 -17
- package/dist_esm/BuildStepInput.js +27 -1
- package/dist_esm/BuildStepInput.js.map +1 -1
- package/dist_esm/BuildStepOutput.d.ts +18 -8
- package/dist_esm/BuildStepOutput.js +21 -1
- package/dist_esm/BuildStepOutput.js.map +1 -1
- package/dist_esm/BuildWorkflowValidator.d.ts +2 -1
- package/dist_esm/BuildWorkflowValidator.js +22 -1
- package/dist_esm/BuildWorkflowValidator.js.map +1 -1
- package/dist_esm/cli/cli.js +2 -2
- package/dist_esm/cli/cli.js.map +1 -1
- package/dist_esm/index.d.ts +1 -0
- package/dist_esm/index.js +1 -0
- package/dist_esm/index.js.map +1 -1
- package/dist_esm/scripts/runCustomFunction.d.ts +1 -0
- package/dist_esm/scripts/runCustomFunction.js +101 -0
- package/dist_esm/scripts/runCustomFunction.js.map +1 -0
- package/dist_esm/utils/customFunction.d.ts +13 -0
- package/dist_esm/utils/customFunction.js +25 -0
- package/dist_esm/utils/customFunction.js.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import assert from 'assert';
|
|
2
|
+
import { createLogger } from '@expo/logger';
|
|
3
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
+
import { BuildStepOutput } from '../BuildStepOutput.js';
|
|
5
|
+
import { BuildStepInput } from '../BuildStepInput.js';
|
|
6
|
+
import { BuildStepContext } from '../BuildStepContext.js';
|
|
7
|
+
import { spawnAsync } from '../utils/shell/spawn.js';
|
|
8
|
+
async function runCustomJsFunctionAsync() {
|
|
9
|
+
const customJavascriptFunctionModulePath = process.argv[2];
|
|
10
|
+
const functionArgs = process.argv[3];
|
|
11
|
+
assert(customJavascriptFunctionModulePath, 'customJavascriptFunctionModulePath is required');
|
|
12
|
+
assert(functionArgs, 'serializedFunctionParams is required');
|
|
13
|
+
let serializedFunctionArguments;
|
|
14
|
+
try {
|
|
15
|
+
serializedFunctionArguments = JSON.parse(functionArgs);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
console.error('Failed to parse serializedFunctionParams');
|
|
19
|
+
throw e;
|
|
20
|
+
}
|
|
21
|
+
const logger = createLogger({
|
|
22
|
+
name: 'customFunctionLogger',
|
|
23
|
+
streams: [
|
|
24
|
+
{
|
|
25
|
+
type: 'raw',
|
|
26
|
+
stream: {
|
|
27
|
+
write: (rec) => {
|
|
28
|
+
if (rec) {
|
|
29
|
+
switch (rec.level) {
|
|
30
|
+
case 20: // Debug level
|
|
31
|
+
if (rec.msg) {
|
|
32
|
+
console.debug(rec.msg);
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
case 30: // Info level
|
|
36
|
+
if (rec.msg) {
|
|
37
|
+
console.log(rec.msg);
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case 40: // Warn level
|
|
41
|
+
if (rec.msg) {
|
|
42
|
+
console.warn(rec.msg);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case 50: // Error level
|
|
46
|
+
case 60: // Fatal level
|
|
47
|
+
if (rec.msg) {
|
|
48
|
+
console.error(rec.msg);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
const ctx = BuildStepContext.deserialize(serializedFunctionArguments.ctx, logger);
|
|
61
|
+
const inputs = Object.fromEntries(Object.entries(serializedFunctionArguments.inputs).map(([id, input]) => [
|
|
62
|
+
id,
|
|
63
|
+
BuildStepInput.deserialize(input, logger),
|
|
64
|
+
]));
|
|
65
|
+
const outputs = Object.fromEntries(Object.entries(serializedFunctionArguments.outputs).map(([id, output]) => [
|
|
66
|
+
id,
|
|
67
|
+
BuildStepOutput.deserialize(output),
|
|
68
|
+
]));
|
|
69
|
+
const env = serializedFunctionArguments.env;
|
|
70
|
+
const envBefore = cloneDeep(serializedFunctionArguments.env);
|
|
71
|
+
let customModule;
|
|
72
|
+
try {
|
|
73
|
+
customModule = await require(customJavascriptFunctionModulePath);
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
console.error('Failed to load custom function module');
|
|
77
|
+
throw e;
|
|
78
|
+
}
|
|
79
|
+
const customJavascriptFunction = customModule.default;
|
|
80
|
+
await customJavascriptFunction(ctx, { inputs, outputs, env });
|
|
81
|
+
const promises = [];
|
|
82
|
+
for (const output of Object.values(outputs)) {
|
|
83
|
+
if (output.rawValue) {
|
|
84
|
+
assert(output.value, 'output.value is required');
|
|
85
|
+
promises.push(spawnAsync('set-output', [output.id, output.value], {
|
|
86
|
+
env,
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
for (const envName of Object.keys(env)) {
|
|
91
|
+
const envValue = env[envName];
|
|
92
|
+
if (envValue !== envBefore[envName] && envValue) {
|
|
93
|
+
promises.push(spawnAsync('set-env', [envName, envValue], {
|
|
94
|
+
env,
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
await Promise.all(promises);
|
|
99
|
+
}
|
|
100
|
+
void runCustomJsFunctionAsync();
|
|
101
|
+
//# sourceMappingURL=runCustomFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCustomFunction.js","sourceRoot":"","sources":["../../src/scripts/runCustomFunction.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,KAAK,UAAU,wBAAwB;IACrC,MAAM,kCAAkC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAErC,MAAM,CAAC,kCAAkC,EAAE,gDAAgD,CAAC,CAAC;IAC7F,MAAM,CAAC,YAAY,EAAE,sCAAsC,CAAC,CAAC;IAE7D,IAAI,2BAAmE,CAAC;IACxE,IAAI;QACF,2BAA2B,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;KACxD;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC1D,MAAM,CAAC,CAAC;KACT;IAED,MAAM,MAAM,GAAG,YAAY,CAAC;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE;oBACN,KAAK,EAAE,CAAC,GAAQ,EAAE,EAAE;wBAClB,IAAI,GAAG,EAAE;4BACP,QAAQ,GAAG,CAAC,KAAK,EAAE;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;SACH;KACF;IACD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,KAAK,wBAAwB,EAAE,CAAC","sourcesContent":["import assert from 'assert';\n\nimport { createLogger } from '@expo/logger';\nimport { SpawnPromise, SpawnResult } from '@expo/spawn-async';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { BuildStepOutput } from '../BuildStepOutput.js';\nimport { BuildStepInput } from '../BuildStepInput.js';\nimport { SerializedCustomBuildFunctionArguments } from '../utils/customFunction.js';\nimport { BuildStepContext } from '../BuildStepContext.js';\nimport { BuildStepFunction } from '../BuildStep.js';\nimport { spawnAsync } from '../utils/shell/spawn.js';\n\nasync function runCustomJsFunctionAsync(): Promise<void> {\n const customJavascriptFunctionModulePath = process.argv[2];\n const functionArgs = process.argv[3];\n\n assert(customJavascriptFunctionModulePath, 'customJavascriptFunctionModulePath is required');\n assert(functionArgs, 'serializedFunctionParams is required');\n\n let serializedFunctionArguments: SerializedCustomBuildFunctionArguments;\n try {\n serializedFunctionArguments = JSON.parse(functionArgs);\n } catch (e) {\n console.error('Failed to parse serializedFunctionParams');\n throw e;\n }\n\n const logger = createLogger({\n name: 'customFunctionLogger',\n streams: [\n {\n type: 'raw',\n stream: {\n write: (rec: any) => {\n if (rec) {\n switch (rec.level) {\n case 20: // Debug level\n if (rec.msg) {\n console.debug(rec.msg);\n }\n break;\n case 30: // Info level\n if (rec.msg) {\n console.log(rec.msg);\n }\n break;\n case 40: // Warn level\n if (rec.msg) {\n console.warn(rec.msg);\n }\n break;\n case 50: // Error level\n case 60: // Fatal level\n if (rec.msg) {\n console.error(rec.msg);\n }\n break;\n default:\n break;\n }\n }\n },\n },\n },\n ],\n });\n\n const ctx = BuildStepContext.deserialize(serializedFunctionArguments.ctx, logger);\n const inputs = Object.fromEntries(\n Object.entries(serializedFunctionArguments.inputs).map(([id, input]) => [\n id,\n BuildStepInput.deserialize(input, logger),\n ])\n );\n const outputs = Object.fromEntries(\n Object.entries(serializedFunctionArguments.outputs).map(([id, output]) => [\n id,\n BuildStepOutput.deserialize(output),\n ])\n );\n const env = serializedFunctionArguments.env;\n const envBefore = cloneDeep(serializedFunctionArguments.env);\n\n let customModule: any;\n try {\n customModule = await require(customJavascriptFunctionModulePath);\n } catch (e) {\n console.error('Failed to load custom function module');\n throw e;\n }\n\n const customJavascriptFunction: BuildStepFunction = customModule.default;\n\n await customJavascriptFunction(ctx, { inputs, outputs, env });\n\n const promises: SpawnPromise<SpawnResult>[] = [];\n for (const output of Object.values(outputs)) {\n if (output.rawValue) {\n assert(output.value, 'output.value is required');\n promises.push(\n spawnAsync('set-output', [output.id, output.value], {\n env,\n })\n );\n }\n }\n for (const envName of Object.keys(env)) {\n const envValue = env[envName];\n if (envValue !== envBefore[envName] && envValue) {\n promises.push(\n spawnAsync('set-env', [envName, envValue], {\n env,\n })\n );\n }\n }\n await Promise.all(promises);\n}\n\nvoid runCustomJsFunctionAsync();\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BuildStepFunction } from '../BuildStep.js';
|
|
2
|
+
import { BuildStepEnv } from '../BuildStepEnv.js';
|
|
3
|
+
import { SerializedBuildStepInput } from '../BuildStepInput.js';
|
|
4
|
+
import { SerializedBuildStepOutput } from '../BuildStepOutput.js';
|
|
5
|
+
import { SerializedBuildStepContext } from '../BuildStepContext.js';
|
|
6
|
+
export declare const SCRIPTS_PATH: string;
|
|
7
|
+
export interface SerializedCustomBuildFunctionArguments {
|
|
8
|
+
env: BuildStepEnv;
|
|
9
|
+
inputs: Record<string, SerializedBuildStepInput>;
|
|
10
|
+
outputs: Record<string, SerializedBuildStepOutput>;
|
|
11
|
+
ctx: SerializedBuildStepContext;
|
|
12
|
+
}
|
|
13
|
+
export declare function createCustomFunctionCall(customFunctionModulePath: string): BuildStepFunction;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { createContext } from 'this-file';
|
|
3
|
+
import { spawnAsync } from './shell/spawn.js';
|
|
4
|
+
const thisFileCtx = createContext();
|
|
5
|
+
export const SCRIPTS_PATH = path.join(thisFileCtx.dirname, '../../dist_commonjs/scripts');
|
|
6
|
+
export function createCustomFunctionCall(customFunctionModulePath) {
|
|
7
|
+
return async (ctx, { env, inputs, outputs }) => {
|
|
8
|
+
const serializedArguments = {
|
|
9
|
+
env,
|
|
10
|
+
inputs: Object.fromEntries(Object.entries(inputs).map(([id, input]) => [id, input.serialize()])),
|
|
11
|
+
outputs: Object.fromEntries(Object.entries(outputs).map(([id, output]) => [id, output.serialize()])),
|
|
12
|
+
ctx: ctx.serialize(),
|
|
13
|
+
};
|
|
14
|
+
await spawnAsync('node', [
|
|
15
|
+
path.join(SCRIPTS_PATH, 'runCustomFunction.cjs'),
|
|
16
|
+
customFunctionModulePath,
|
|
17
|
+
JSON.stringify(serializedArguments),
|
|
18
|
+
], {
|
|
19
|
+
logger: ctx.logger,
|
|
20
|
+
cwd: ctx.workingDirectory,
|
|
21
|
+
env,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=customFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customFunction.js","sourceRoot":"","sources":["../../src/utils/customFunction.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAQ1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,GAAG,aAAa,EAAE,CAAC;AAEpC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAC;AAS1F,MAAM,UAAU,wBAAwB,CAAC,wBAAgC;IACvE,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QAC7C,MAAM,mBAAmB,GAA2C;YAClE,GAAG;YACH,MAAM,EAAE,MAAM,CAAC,WAAW,CACxB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CACrE;YACD,OAAO,EAAE,MAAM,CAAC,WAAW,CACzB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CACxE;YACD,GAAG,EAAE,GAAG,CAAC,SAAS,EAAE;SACrB,CAAC;QACF,MAAM,UAAU,CACd,MAAM,EACN;YACE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC;YAChD,wBAAwB;YACxB,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC;SACpC,EACD;YACE,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,GAAG,EAAE,GAAG,CAAC,gBAAgB;YACzB,GAAG;SACJ,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\n\nimport { createContext } from 'this-file';\n\nimport { BuildStepFunction } from '../BuildStep.js';\nimport { BuildStepEnv } from '../BuildStepEnv.js';\nimport { SerializedBuildStepInput } from '../BuildStepInput.js';\nimport { SerializedBuildStepOutput } from '../BuildStepOutput.js';\nimport { SerializedBuildStepContext } from '../BuildStepContext.js';\n\nimport { spawnAsync } from './shell/spawn.js';\n\nconst thisFileCtx = createContext();\n\nexport const SCRIPTS_PATH = path.join(thisFileCtx.dirname, '../../dist_commonjs/scripts');\n\nexport interface SerializedCustomBuildFunctionArguments {\n env: BuildStepEnv;\n inputs: Record<string, SerializedBuildStepInput>;\n outputs: Record<string, SerializedBuildStepOutput>;\n ctx: SerializedBuildStepContext;\n}\n\nexport function createCustomFunctionCall(customFunctionModulePath: string): BuildStepFunction {\n return async (ctx, { env, inputs, outputs }) => {\n const serializedArguments: SerializedCustomBuildFunctionArguments = {\n env,\n inputs: Object.fromEntries(\n Object.entries(inputs).map(([id, input]) => [id, input.serialize()])\n ),\n outputs: Object.fromEntries(\n Object.entries(outputs).map(([id, output]) => [id, output.serialize()])\n ),\n ctx: ctx.serialize(),\n };\n await spawnAsync(\n 'node',\n [\n path.join(SCRIPTS_PATH, 'runCustomFunction.cjs'),\n customFunctionModulePath,\n JSON.stringify(serializedArguments),\n ],\n {\n logger: ctx.logger,\n cwd: ctx.workingDirectory,\n env,\n }\n );\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/steps",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.29",
|
|
5
5
|
"main": "./dist_commonjs/index.cjs",
|
|
6
6
|
"types": "./dist_esm/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@jest/globals": "^29.4.1",
|
|
35
35
|
"@types/jest": "^29.4.0",
|
|
36
|
+
"@types/lodash.clonedeep": "^4.5.7",
|
|
36
37
|
"@types/lodash.get": "^4.4.7",
|
|
37
38
|
"@types/node": "^18.11.18",
|
|
38
39
|
"chokidar-cli": "^3.0.0",
|
|
@@ -50,7 +51,9 @@
|
|
|
50
51
|
"@expo/logger": "1.0.21",
|
|
51
52
|
"@expo/spawn-async": "^1.7.0",
|
|
52
53
|
"arg": "^5.0.2",
|
|
54
|
+
"fs-extra": "^11.1.1",
|
|
53
55
|
"joi": "^17.7.0",
|
|
56
|
+
"lodash.clonedeep": "^4.5.0",
|
|
54
57
|
"lodash.get": "^4.4.2",
|
|
55
58
|
"this-file": "^2.0.3",
|
|
56
59
|
"uuid": "^9.0.0",
|
|
@@ -60,5 +63,5 @@
|
|
|
60
63
|
"node": "18.13.0",
|
|
61
64
|
"yarn": "1.22.19"
|
|
62
65
|
},
|
|
63
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "33a20f9f03da5e7b57faee5f5dde97e6700b6931"
|
|
64
67
|
}
|