@expo/build-tools 1.0.207 → 1.0.208-alpha.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.
@@ -39,7 +39,7 @@ const FlowConfigSchema = zod_1.z.object({
39
39
  });
40
40
  const WorkspaceConfigSchema = zod_1.z.object({
41
41
  flows: zod_1.z.array(zod_1.z.string()).optional(),
42
- executionOrder: zod_1.z.record(zod_1.z.unknown()).optional(),
42
+ executionOrder: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
43
43
  includeTags: zod_1.z.array(zod_1.z.string()).optional(),
44
44
  excludeTags: zod_1.z.array(zod_1.z.string()).optional(),
45
45
  });
@@ -1 +1 @@
1
- {"version":3,"file":"findMaestroPathsFlowsToExecuteAsync.js","sourceRoot":"","sources":["../../src/utils/findMaestroPathsFlowsToExecuteAsync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,kFAiFC;AAzGD,qCAAyC;AACzC,gDAAkC;AAGlC,2CAA6B;AAC7B,6BAAwB;AACxB,2CAA4C;AAC5C,0DAA2B;AAE3B,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC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AC,8BAA8B,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,QAAQ,EACR,WAAW,EACX,WAAW,GAKZ;IACC,6EAA6E;IAC7E,MAAM,YAAY,GAChB,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhF,8EAA8E;IAC9E,MAAM,YAAY,GAChB,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjF,OAAO,YAAY,IAAI,YAAY,CAAC;AACtC,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport * as path from 'node:path';\n\nimport { bunyan } from '@expo/logger';\nimport * as yaml from 'yaml';\nimport { z } from 'zod';\nimport { asyncResult } from '@expo/results';\nimport fg from 'fast-glob';\n\nconst FlowConfigSchema = z.object({\n name: z.string().optional(),\n tags: z.array(z.string()).optional(),\n});\n\nconst WorkspaceConfigSchema = z.object({\n flows: z.array(z.string()).optional(),\n executionOrder: z.record(z.unknown()).optional(),\n includeTags: z.array(z.string()).optional(),\n excludeTags: z.array(z.string()).optional(),\n});\n\ntype FlowConfig = z.infer<typeof FlowConfigSchema>;\ntype WorkspaceConfig = z.infer<typeof WorkspaceConfigSchema>;\n\nexport async function findMaestroPathsFlowsToExecuteAsync({\n workingDirectory,\n flowPath,\n includeTags: _includeTags,\n excludeTags: _excludeTags,\n logger,\n}: {\n workingDirectory: string;\n flowPath: string;\n includeTags: string[] | undefined;\n excludeTags: string[] | undefined;\n logger: bunyan;\n}): Promise<string[]> {\n const absoluteFlowPath = path.resolve(workingDirectory, flowPath);\n // If it's a file, just return it (no validation needed)\n const stat = await fs.stat(absoluteFlowPath);\n\n if (stat.isFile()) {\n logger.info(`Found a file: ${path.relative(workingDirectory, absoluteFlowPath)}`);\n return [absoluteFlowPath];\n }\n\n // It's a directory - discover flow files\n logger.info(`Found a directory: ${path.relative(workingDirectory, absoluteFlowPath)}`);\n\n // Check for workspace config\n logger.info(`Searching for workspace config...`);\n const workspaceConfig = await findAndParseWorkspaceConfigAsync({\n dirPath: absoluteFlowPath,\n workingDirectory,\n logger,\n });\n logger.info(`Using workspace config: ${JSON.stringify(workspaceConfig)}`);\n\n if (workspaceConfig?.executionOrder) {\n logger.warn(`Execution order is not supported yet. Ignoring.`);\n }\n\n logger.info(`Searching for flow files...`);\n const { flows } = await findAndParseFlowFilesAsync({\n dirPath: absoluteFlowPath,\n workingDirectory,\n workspaceConfig,\n logger,\n });\n\n if (flows.length === 0) {\n logger.info(\n `No valid flow files found in: ${path.relative(workingDirectory, absoluteFlowPath)}`\n );\n return [];\n }\n\n const includeTags = [...(_includeTags ?? []), ...(workspaceConfig?.includeTags ?? [])];\n const excludeTags = [...(_excludeTags ?? []), ...(workspaceConfig?.excludeTags ?? [])];\n\n if (includeTags.length === 0 && excludeTags.length === 0) {\n logger.info(`No tags provided, returning all flows.`);\n return flows.map(({ path }) => path);\n }\n\n logger.info(\n `Filtering flows by tags. Tags to include: ${JSON.stringify(includeTags)}. Tags to exclude: ${JSON.stringify(excludeTags) ?? 'none'}.`\n );\n return flows\n .filter(({ config, path: flowPath }) => {\n const shouldInclude = matchesTags({\n flowTags: config?.tags ?? [],\n includeTags,\n excludeTags,\n });\n\n logger.info(\n shouldInclude\n ? `- ${path.relative(workingDirectory, flowPath)} matches tags, including.`\n : `- ${path.relative(workingDirectory, flowPath)} does not match tags, excluding.`\n );\n\n return shouldInclude;\n })\n .map(({ path }) => path);\n}\n\nasync function findAndParseWorkspaceConfigAsync({\n dirPath,\n workingDirectory,\n logger,\n}: {\n dirPath: string;\n workingDirectory: string;\n logger: bunyan;\n}): Promise<WorkspaceConfig | null> {\n const configPaths = await fg(['config.yaml', 'config.yml'], {\n cwd: dirPath,\n absolute: true,\n });\n\n if (configPaths.length === 0) {\n logger.info(`No workspace config found in: ${path.relative(workingDirectory, dirPath)}`);\n return null;\n }\n\n for (const configPath of configPaths) {\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n const configDoc = yaml.parse(content);\n if (!configDoc) {\n logger.warn(\n `No content found in workspace config: ${path.relative(workingDirectory, configPath)}`\n );\n continue;\n }\n logger.info(`Using workspace config from: ${path.relative(workingDirectory, configPath)}`);\n return WorkspaceConfigSchema.parse(configDoc);\n } catch (err) {\n logger.warn(\n { err },\n `Failed to parse workspace config: ${path.relative(workingDirectory, configPath)}`\n );\n continue;\n }\n }\n\n logger.info(`No valid workspace config found in: ${path.relative(workingDirectory, dirPath)}`);\n return null;\n}\n\nasync function findAndParseFlowFilesAsync({\n workingDirectory,\n dirPath,\n workspaceConfig,\n logger,\n}: {\n workingDirectory: string;\n dirPath: string;\n workspaceConfig: WorkspaceConfig | null;\n logger: bunyan;\n}): Promise<{ flows: { config: FlowConfig; path: string }[] }> {\n const flows: { config: FlowConfig; path: string }[] = [];\n\n // Determine flow patterns from config or use default\n const flowPatterns = workspaceConfig?.flows ?? ['*'];\n logger.info(`Using flow patterns: ${JSON.stringify(flowPatterns)}`);\n\n // Use fast-glob to find matching files\n const matchedFiles = await fg(flowPatterns, {\n cwd: dirPath,\n absolute: true,\n onlyFiles: true,\n ignore: ['*/config.yaml', '*/config.yml'], // Skip workspace config files\n });\n\n logger.info(`Found ${matchedFiles.length} potential flow files`);\n\n // Parse each matched file\n for (const filePath of matchedFiles) {\n // Skip non-YAML files\n const ext = path.extname(filePath);\n if (ext !== '.yaml' && ext !== '.yml') {\n logger.info(`Skipping non-YAML file: ${path.relative(workingDirectory, filePath)}`);\n continue;\n }\n\n const result = await asyncResult(parseFlowFile(filePath));\n if (result.ok) {\n logger.info(`Found flow file: ${path.relative(workingDirectory, filePath)}`);\n flows.push({ config: result.value, path: filePath });\n } else {\n logger.info(\n { err: result.reason },\n `Skipping flow file: ${path.relative(workingDirectory, filePath)}`\n );\n }\n }\n\n return { flows };\n}\n\nasync function parseFlowFile(filePath: string): Promise<FlowConfig> {\n const content = await fs.readFile(filePath, 'utf-8');\n const documents = yaml.parseAllDocuments(content);\n const configDoc = documents[0];\n if (!configDoc) {\n throw new Error(`No config section found in ${filePath}`);\n }\n return FlowConfigSchema.parse(configDoc.toJS());\n}\n\nfunction matchesTags({\n flowTags,\n includeTags,\n excludeTags,\n}: {\n flowTags: string[];\n includeTags: string[];\n excludeTags: string[];\n}): boolean {\n // Include logic: if includeTags is empty OR flow has any of the include tags\n const includeMatch =\n includeTags.length === 0 || includeTags.some((tag) => flowTags.includes(tag));\n\n // Exclude logic: if excludeTags is empty OR flow has none of the exclude tags\n const excludeMatch =\n excludeTags.length === 0 || !excludeTags.some((tag) => flowTags.includes(tag));\n\n return includeMatch && excludeMatch;\n}\n"]}
1
+ {"version":3,"file":"findMaestroPathsFlowsToExecuteAsync.js","sourceRoot":"","sources":["../../src/utils/findMaestroPathsFlowsToExecuteAsync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,kFAiFC;AAzGD,qCAAyC;AACzC,gDAAkC;AAGlC,2CAA6B;AAC7B,6BAAwB;AACxB,2CAA4C;AAC5C,0DAA2B;AAE3B,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC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,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,QAAQ,EACR,WAAW,EACX,WAAW,GAKZ;IACC,6EAA6E;IAC7E,MAAM,YAAY,GAChB,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhF,8EAA8E;IAC9E,MAAM,YAAY,GAChB,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjF,OAAO,YAAY,IAAI,YAAY,CAAC;AACtC,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport * as path from 'node:path';\n\nimport { bunyan } from '@expo/logger';\nimport * as yaml from 'yaml';\nimport { z } from 'zod';\nimport { asyncResult } from '@expo/results';\nimport fg from 'fast-glob';\n\nconst FlowConfigSchema = z.object({\n name: z.string().optional(),\n tags: z.array(z.string()).optional(),\n});\n\nconst WorkspaceConfigSchema = z.object({\n flows: z.array(z.string()).optional(),\n executionOrder: z.record(z.string(), z.unknown()).optional(),\n includeTags: z.array(z.string()).optional(),\n excludeTags: z.array(z.string()).optional(),\n});\n\ntype FlowConfig = z.infer<typeof FlowConfigSchema>;\ntype WorkspaceConfig = z.infer<typeof WorkspaceConfigSchema>;\n\nexport async function findMaestroPathsFlowsToExecuteAsync({\n workingDirectory,\n flowPath,\n includeTags: _includeTags,\n excludeTags: _excludeTags,\n logger,\n}: {\n workingDirectory: string;\n flowPath: string;\n includeTags: string[] | undefined;\n excludeTags: string[] | undefined;\n logger: bunyan;\n}): Promise<string[]> {\n const absoluteFlowPath = path.resolve(workingDirectory, flowPath);\n // If it's a file, just return it (no validation needed)\n const stat = await fs.stat(absoluteFlowPath);\n\n if (stat.isFile()) {\n logger.info(`Found a file: ${path.relative(workingDirectory, absoluteFlowPath)}`);\n return [absoluteFlowPath];\n }\n\n // It's a directory - discover flow files\n logger.info(`Found a directory: ${path.relative(workingDirectory, absoluteFlowPath)}`);\n\n // Check for workspace config\n logger.info(`Searching for workspace config...`);\n const workspaceConfig = await findAndParseWorkspaceConfigAsync({\n dirPath: absoluteFlowPath,\n workingDirectory,\n logger,\n });\n logger.info(`Using workspace config: ${JSON.stringify(workspaceConfig)}`);\n\n if (workspaceConfig?.executionOrder) {\n logger.warn(`Execution order is not supported yet. Ignoring.`);\n }\n\n logger.info(`Searching for flow files...`);\n const { flows } = await findAndParseFlowFilesAsync({\n dirPath: absoluteFlowPath,\n workingDirectory,\n workspaceConfig,\n logger,\n });\n\n if (flows.length === 0) {\n logger.info(\n `No valid flow files found in: ${path.relative(workingDirectory, absoluteFlowPath)}`\n );\n return [];\n }\n\n const includeTags = [...(_includeTags ?? []), ...(workspaceConfig?.includeTags ?? [])];\n const excludeTags = [...(_excludeTags ?? []), ...(workspaceConfig?.excludeTags ?? [])];\n\n if (includeTags.length === 0 && excludeTags.length === 0) {\n logger.info(`No tags provided, returning all flows.`);\n return flows.map(({ path }) => path);\n }\n\n logger.info(\n `Filtering flows by tags. Tags to include: ${JSON.stringify(includeTags)}. Tags to exclude: ${JSON.stringify(excludeTags) ?? 'none'}.`\n );\n return flows\n .filter(({ config, path: flowPath }) => {\n const shouldInclude = matchesTags({\n flowTags: config?.tags ?? [],\n includeTags,\n excludeTags,\n });\n\n logger.info(\n shouldInclude\n ? `- ${path.relative(workingDirectory, flowPath)} matches tags, including.`\n : `- ${path.relative(workingDirectory, flowPath)} does not match tags, excluding.`\n );\n\n return shouldInclude;\n })\n .map(({ path }) => path);\n}\n\nasync function findAndParseWorkspaceConfigAsync({\n dirPath,\n workingDirectory,\n logger,\n}: {\n dirPath: string;\n workingDirectory: string;\n logger: bunyan;\n}): Promise<WorkspaceConfig | null> {\n const configPaths = await fg(['config.yaml', 'config.yml'], {\n cwd: dirPath,\n absolute: true,\n });\n\n if (configPaths.length === 0) {\n logger.info(`No workspace config found in: ${path.relative(workingDirectory, dirPath)}`);\n return null;\n }\n\n for (const configPath of configPaths) {\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n const configDoc = yaml.parse(content);\n if (!configDoc) {\n logger.warn(\n `No content found in workspace config: ${path.relative(workingDirectory, configPath)}`\n );\n continue;\n }\n logger.info(`Using workspace config from: ${path.relative(workingDirectory, configPath)}`);\n return WorkspaceConfigSchema.parse(configDoc);\n } catch (err) {\n logger.warn(\n { err },\n `Failed to parse workspace config: ${path.relative(workingDirectory, configPath)}`\n );\n continue;\n }\n }\n\n logger.info(`No valid workspace config found in: ${path.relative(workingDirectory, dirPath)}`);\n return null;\n}\n\nasync function findAndParseFlowFilesAsync({\n workingDirectory,\n dirPath,\n workspaceConfig,\n logger,\n}: {\n workingDirectory: string;\n dirPath: string;\n workspaceConfig: WorkspaceConfig | null;\n logger: bunyan;\n}): Promise<{ flows: { config: FlowConfig; path: string }[] }> {\n const flows: { config: FlowConfig; path: string }[] = [];\n\n // Determine flow patterns from config or use default\n const flowPatterns = workspaceConfig?.flows ?? ['*'];\n logger.info(`Using flow patterns: ${JSON.stringify(flowPatterns)}`);\n\n // Use fast-glob to find matching files\n const matchedFiles = await fg(flowPatterns, {\n cwd: dirPath,\n absolute: true,\n onlyFiles: true,\n ignore: ['*/config.yaml', '*/config.yml'], // Skip workspace config files\n });\n\n logger.info(`Found ${matchedFiles.length} potential flow files`);\n\n // Parse each matched file\n for (const filePath of matchedFiles) {\n // Skip non-YAML files\n const ext = path.extname(filePath);\n if (ext !== '.yaml' && ext !== '.yml') {\n logger.info(`Skipping non-YAML file: ${path.relative(workingDirectory, filePath)}`);\n continue;\n }\n\n const result = await asyncResult(parseFlowFile(filePath));\n if (result.ok) {\n logger.info(`Found flow file: ${path.relative(workingDirectory, filePath)}`);\n flows.push({ config: result.value, path: filePath });\n } else {\n logger.info(\n { err: result.reason },\n `Skipping flow file: ${path.relative(workingDirectory, filePath)}`\n );\n }\n }\n\n return { flows };\n}\n\nasync function parseFlowFile(filePath: string): Promise<FlowConfig> {\n const content = await fs.readFile(filePath, 'utf-8');\n const documents = yaml.parseAllDocuments(content);\n const configDoc = documents[0];\n if (!configDoc) {\n throw new Error(`No config section found in ${filePath}`);\n }\n return FlowConfigSchema.parse(configDoc.toJS());\n}\n\nfunction matchesTags({\n flowTags,\n includeTags,\n excludeTags,\n}: {\n flowTags: string[];\n includeTags: string[];\n excludeTags: string[];\n}): boolean {\n // Include logic: if includeTags is empty OR flow has any of the include tags\n const includeMatch =\n includeTags.length === 0 || includeTags.some((tag) => flowTags.includes(tag));\n\n // Exclude logic: if excludeTags is empty OR flow has none of the exclude tags\n const excludeMatch =\n excludeTags.length === 0 || !excludeTags.some((tag) => flowTags.includes(tag));\n\n return includeMatch && excludeMatch;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "1.0.207",
3
+ "version": "1.0.208-alpha.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  "@expo/config": "10.0.6",
28
28
  "@expo/config-plugins": "9.0.12",
29
29
  "@expo/downloader": "1.0.206",
30
- "@expo/eas-build-job": "1.0.206",
30
+ "@expo/eas-build-job": "1.0.208-alpha.0",
31
31
  "@expo/env": "^0.4.0",
32
32
  "@expo/logger": "1.0.206",
33
33
  "@expo/package-manager": "1.7.0",
34
34
  "@expo/plist": "^0.2.0",
35
35
  "@expo/results": "^1.0.0",
36
- "@expo/steps": "1.0.206",
36
+ "@expo/steps": "1.0.208-alpha.0",
37
37
  "@expo/template-file": "1.0.206",
38
38
  "@expo/turtle-spawn": "1.0.206",
39
39
  "@expo/xcpretty": "^4.3.1",
@@ -79,5 +79,5 @@
79
79
  "node": "20.14.0",
80
80
  "yarn": "1.22.21"
81
81
  },
82
- "gitHead": "66b6021fa020fa890e6f01f8f2ed80edb5b6c436"
82
+ "gitHead": "b421ff4a84ee2a8552d81aa728a3a2938dd1faf9"
83
83
  }