@expo/build-tools 1.0.3 → 1.0.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.
@@ -19,11 +19,10 @@ function createUploadArtifactStepsFunction(ctx) {
19
19
  id: 'upload_artifact',
20
20
  name: 'Upload artifact',
21
21
  inputProviders: [
22
- // TODO: refactor when BuildStepInput supports "allowedValues" option
23
- // either "application-archive" or "build-artifact"
24
22
  steps_1.BuildStepInput.createProvider({
25
23
  id: 'type',
26
24
  defaultValue: BuildArtifactType.APPLICATION_ARCHIVE,
25
+ allowedValues: [BuildArtifactType.APPLICATION_ARCHIVE, BuildArtifactType.BUILD_ARTIFACT],
27
26
  }),
28
27
  steps_1.BuildStepInput.createProvider({ id: 'path', required: true }),
29
28
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../../src/steps/functions/uploadArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,uCAA4D;AAC5D,4DAAoC;AAEpC,2CAA2D;AAE3D,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,gEAA2C,CAAA;IAC3C,sDAAiC,CAAA;AACnC,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,SAAgB,iCAAiC,CAC/C,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE;YACd,qEAAqE;YACrE,mDAAmD;YACnD,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,MAAM;gBACV,YAAY,EAAE,iBAAiB,CAAC,mBAAmB;aACpD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC9D;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,MAAM,YAAY,GAAG,mCAAmC,CAAC,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACxF,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACxF,MAAM,GAAG,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAtBD,8EAsBC;AAED,SAAS,mCAAmC,CAAC,KAAa;IACxD,MAAM,aAAa,GAAa,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACjE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,IAAI,KAAK,mDAAmD,aAAa;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;KACH;IACD,OAAO,KAAK,KAAK,iBAAiB,CAAC,mBAAmB;QACpD,CAAC,CAAC,sBAAY,CAAC,mBAAmB;QAClC,CAAC,CAAC,sBAAY,CAAC,eAAe,CAAC;AACnC,CAAC","sourcesContent":["import path from 'path';\n\nimport { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { ArtifactType, BuildContext } from '../../context';\n\nenum BuildArtifactType {\n APPLICATION_ARCHIVE = 'application-archive',\n BUILD_ARTIFACT = 'build-artifact',\n}\n\nexport function createUploadArtifactStepsFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'upload_artifact',\n name: 'Upload artifact',\n inputProviders: [\n // TODO: refactor when BuildStepInput supports \"allowedValues\" option\n // either \"application-archive\" or \"build-artifact\"\n BuildStepInput.createProvider({\n id: 'type',\n defaultValue: BuildArtifactType.APPLICATION_ARCHIVE,\n }),\n BuildStepInput.createProvider({ id: 'path', required: true }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const artifactType = validateAndConvertBuildArtifactType(nullthrows(inputs.type.value));\n const filePath = path.resolve(stepsCtx.workingDirectory, nullthrows(inputs.path.value));\n await ctx.uploadArtifacts(artifactType, [filePath], stepsCtx.logger);\n },\n });\n}\n\nfunction validateAndConvertBuildArtifactType(input: string): ArtifactType {\n const allowedValues: string[] = Object.values(BuildArtifactType);\n if (!allowedValues.includes(input)) {\n throw new Error(\n `\"${input}\" is not allowed artifact type, allowed values: ${allowedValues\n .map((i) => `\"${i}\"`)\n .join(', ')}`\n );\n }\n return input === BuildArtifactType.APPLICATION_ARCHIVE\n ? ArtifactType.APPLICATION_ARCHIVE\n : ArtifactType.BUILD_ARTIFACTS;\n}\n"]}
1
+ {"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../../src/steps/functions/uploadArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,uCAA4D;AAC5D,4DAAoC;AAEpC,2CAA2D;AAE3D,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,gEAA2C,CAAA;IAC3C,sDAAiC,CAAA;AACnC,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,SAAgB,iCAAiC,CAC/C,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,MAAM;gBACV,YAAY,EAAE,iBAAiB,CAAC,mBAAmB;gBACnD,aAAa,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,cAAc,CAAC;aACzF,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC9D;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,MAAM,YAAY,GAAG,mCAAmC,CAAC,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACxF,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACxF,MAAM,GAAG,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AArBD,8EAqBC;AAED,SAAS,mCAAmC,CAAC,KAAa;IACxD,MAAM,aAAa,GAAa,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACjE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,IAAI,KAAK,mDAAmD,aAAa;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;KACH;IACD,OAAO,KAAK,KAAK,iBAAiB,CAAC,mBAAmB;QACpD,CAAC,CAAC,sBAAY,CAAC,mBAAmB;QAClC,CAAC,CAAC,sBAAY,CAAC,eAAe,CAAC;AACnC,CAAC","sourcesContent":["import path from 'path';\n\nimport { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { ArtifactType, BuildContext } from '../../context';\n\nenum BuildArtifactType {\n APPLICATION_ARCHIVE = 'application-archive',\n BUILD_ARTIFACT = 'build-artifact',\n}\n\nexport function createUploadArtifactStepsFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'upload_artifact',\n name: 'Upload artifact',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'type',\n defaultValue: BuildArtifactType.APPLICATION_ARCHIVE,\n allowedValues: [BuildArtifactType.APPLICATION_ARCHIVE, BuildArtifactType.BUILD_ARTIFACT],\n }),\n BuildStepInput.createProvider({ id: 'path', required: true }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const artifactType = validateAndConvertBuildArtifactType(nullthrows(inputs.type.value));\n const filePath = path.resolve(stepsCtx.workingDirectory, nullthrows(inputs.path.value));\n await ctx.uploadArtifacts(artifactType, [filePath], stepsCtx.logger);\n },\n });\n}\n\nfunction validateAndConvertBuildArtifactType(input: string): ArtifactType {\n const allowedValues: string[] = Object.values(BuildArtifactType);\n if (!allowedValues.includes(input)) {\n throw new Error(\n `\"${input}\" is not allowed artifact type, allowed values: ${allowedValues\n .map((i) => `\"${i}\"`)\n .join(', ')}`\n );\n }\n return input === BuildArtifactType.APPLICATION_ARCHIVE\n ? ArtifactType.APPLICATION_ARCHIVE\n : ArtifactType.BUILD_ARTIFACTS;\n}\n"]}
@@ -6,14 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getParentAndDescendantProcessPidsAsync = void 0;
7
7
  const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
8
8
  async function getChildrenPidsAsync(parentPids) {
9
- const result = await (0, turtle_spawn_1.default)('pgrep', ['-P', parentPids.join(',')], {
10
- stdio: 'pipe',
11
- });
12
- return result.stdout
13
- .toString()
14
- .split('\n')
15
- .map((i) => Number(i.trim()))
16
- .filter((i) => i);
9
+ try {
10
+ const result = await (0, turtle_spawn_1.default)('pgrep', ['-P', parentPids.join(',')], {
11
+ stdio: 'pipe',
12
+ });
13
+ return result.stdout
14
+ .toString()
15
+ .split('\n')
16
+ .map((i) => Number(i.trim()))
17
+ .filter((i) => i);
18
+ }
19
+ catch {
20
+ return [];
21
+ }
17
22
  }
18
23
  async function getParentAndDescendantProcessPidsAsync(ppid) {
19
24
  const children = new Set([ppid]);
@@ -1 +1 @@
1
- {"version":3,"file":"processes.js","sourceRoot":"","sources":["../../src/utils/processes.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AAEvC,KAAK,UAAU,oBAAoB,CAAC,UAAoB;IACtD,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAK,EAAC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;QAChE,KAAK,EAAE,MAAM;KACd,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM;SACjB,QAAQ,EAAE;SACV,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;SAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAEM,KAAK,UAAU,sCAAsC,CAAC,IAAY;IACvE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,IAAI,gBAAgB,GAAG,IAAI,CAAC;IAC5B,OAAO,gBAAgB,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;QACvD,gBAAgB,GAAG,KAAK,CAAC;QACzB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACtB,gBAAgB,GAAG,IAAI,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACnB;SACF;KACF;IACD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC;AAdD,wFAcC","sourcesContent":["import spawn from '@expo/turtle-spawn';\n\nasync function getChildrenPidsAsync(parentPids: number[]): Promise<number[]> {\n const result = await spawn('pgrep', ['-P', parentPids.join(',')], {\n stdio: 'pipe',\n });\n return result.stdout\n .toString()\n .split('\\n')\n .map((i) => Number(i.trim()))\n .filter((i) => i);\n}\n\nexport async function getParentAndDescendantProcessPidsAsync(ppid: number): Promise<number[]> {\n const children = new Set<number>([ppid]);\n let shouldCheckAgain = true;\n while (shouldCheckAgain) {\n const pids = await getChildrenPidsAsync([...children]);\n shouldCheckAgain = false;\n for (const pid of pids) {\n if (!children.has(pid)) {\n shouldCheckAgain = true;\n children.add(pid);\n }\n }\n }\n return [...children];\n}\n"]}
1
+ {"version":3,"file":"processes.js","sourceRoot":"","sources":["../../src/utils/processes.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AAEvC,KAAK,UAAU,oBAAoB,CAAC,UAAoB;IACtD,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAK,EAAC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;YAChE,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM;aACjB,QAAQ,EAAE;aACV,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;aAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;KACrB;IAAC,MAAM;QACN,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAEM,KAAK,UAAU,sCAAsC,CAAC,IAAY;IACvE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,IAAI,gBAAgB,GAAG,IAAI,CAAC;IAC5B,OAAO,gBAAgB,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;QACvD,gBAAgB,GAAG,KAAK,CAAC;QACzB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACtB,gBAAgB,GAAG,IAAI,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACnB;SACF;KACF;IACD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC;AAdD,wFAcC","sourcesContent":["import spawn from '@expo/turtle-spawn';\n\nasync function getChildrenPidsAsync(parentPids: number[]): Promise<number[]> {\n try {\n const result = await spawn('pgrep', ['-P', parentPids.join(',')], {\n stdio: 'pipe',\n });\n return result.stdout\n .toString()\n .split('\\n')\n .map((i) => Number(i.trim()))\n .filter((i) => i);\n } catch {\n return [];\n }\n}\n\nexport async function getParentAndDescendantProcessPidsAsync(ppid: number): Promise<number[]> {\n const children = new Set<number>([ppid]);\n let shouldCheckAgain = true;\n while (shouldCheckAgain) {\n const pids = await getChildrenPidsAsync([...children]);\n shouldCheckAgain = false;\n for (const pid of pids) {\n if (!children.has(pid)) {\n shouldCheckAgain = true;\n children.add(pid);\n }\n }\n }\n return [...children];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  "@expo/logger": "1.0.0",
28
28
  "@expo/package-manager": "^0.0.57",
29
29
  "@expo/plist": "^0.0.20",
30
- "@expo/steps": "1.0.0",
30
+ "@expo/steps": "1.0.4",
31
31
  "@expo/template-file": "1.0.0",
32
32
  "@expo/turtle-spawn": "1.0.0",
33
33
  "@expo/xcpretty": "^4.2.2",
@@ -61,5 +61,5 @@
61
61
  "node": "18.13.0",
62
62
  "yarn": "1.22.19"
63
63
  },
64
- "gitHead": "4a09927db0bd87a212b328b389d290234e85523a"
64
+ "gitHead": "ea62cd92782b0c5cb5cee6ec9cd4341c7bcb78a0"
65
65
  }