@devicecloud.dev/dcd 0.0.7 → 1.0.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.
@@ -33,6 +33,7 @@ export default class Cloud extends Command {
33
33
  arm64: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
34
34
  async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
35
35
  env: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
36
+ 'exclude-flows': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
36
37
  'exclude-tags': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
37
38
  flows: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
38
39
  'google-play': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -53,7 +53,7 @@ class Cloud extends core_1.Command {
53
53
  try {
54
54
  await (0, methods_1.versionCheck)(this.config.version);
55
55
  const { args, flags, raw } = await this.parse(Cloud);
56
- const { 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, arm64, async, env, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ios-device': iOSDevice, 'ios-version': iOSVersion, name, orientation, ...rest } = flags;
56
+ const { 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, arm64, async, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ios-device': iOSDevice, 'ios-version': iOSVersion, name, orientation, ...rest } = flags;
57
57
  if (arm64) {
58
58
  (0, cli_ux_1.info)('Contact hello@devicecloud.dev to enquire about arm64 devices');
59
59
  (0, cli_ux_1.exit)();
@@ -86,7 +86,7 @@ class Cloud extends core_1.Command {
86
86
  }
87
87
  let executionPlan;
88
88
  try {
89
- executionPlan = await (0, plan_1.plan)(flowFile, includeTags.flat(), excludeTags.flat());
89
+ executionPlan = await (0, plan_1.plan)(flowFile, includeTags.flat(), excludeTags.flat(), excludeFlows.flat());
90
90
  }
91
91
  catch (error) {
92
92
  console.error(error);
@@ -9,6 +9,7 @@ export declare const flags: {
9
9
  arm64: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
10
  async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  env: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'exclude-flows': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
12
13
  'exclude-tags': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
13
14
  flows: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
15
  'google-play': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
package/dist/constants.js CHANGED
@@ -47,12 +47,21 @@ exports.flags = {
47
47
  char: 'e',
48
48
  description: 'One or more environment variables to inject into your flows',
49
49
  multiple: true,
50
+ multipleNonGreedy: true,
51
+ }),
52
+ 'exclude-flows': core_1.Flags.string({
53
+ default: [],
54
+ description: 'Sub directories to ignore when building the flow file list',
55
+ multiple: true,
56
+ multipleNonGreedy: true,
57
+ parse: (input) => input.split(','),
50
58
  }),
51
59
  'exclude-tags': core_1.Flags.string({
52
60
  aliases: ['exclude-tags'],
53
61
  default: [],
54
62
  description: 'Flows which have these tags will be excluded from the run',
55
63
  multiple: true,
64
+ multipleNonGreedy: true,
56
65
  parse: (input) => input.split(','),
57
66
  }),
58
67
  flows: core_1.Flags.string({
@@ -68,6 +77,7 @@ exports.flags = {
68
77
  default: [],
69
78
  description: 'Only flows which have these tags will be included in the run',
70
79
  multiple: true,
80
+ multipleNonGreedy: true,
71
81
  parse: (input) => input.split(','),
72
82
  }),
73
83
  'ios-device': core_1.Flags.string({
package/dist/plan.d.ts CHANGED
@@ -10,5 +10,5 @@ interface IFlowSequence {
10
10
  continueOnFailure?: boolean;
11
11
  flows: string[];
12
12
  }
13
- export declare function plan(input: string, includeTags: string[], excludeTags: string[]): Promise<IExecutionPlan>;
13
+ export declare function plan(input: string, includeTags: string[], excludeTags: string[], excludeFlows?: string[]): Promise<IExecutionPlan>;
14
14
  export {};
package/dist/plan.js CHANGED
@@ -5,7 +5,7 @@ const glob_1 = require("glob");
5
5
  const fs = require("node:fs");
6
6
  const path = require("node:path");
7
7
  const planMethods_1 = require("./planMethods");
8
- async function plan(input, includeTags, excludeTags) {
8
+ async function plan(input, includeTags, excludeTags, excludeFlows) {
9
9
  if (!fs.existsSync(input)) {
10
10
  throw new Error(`Flow path does not exist: ${path.resolve(input)}`);
11
11
  }
@@ -28,10 +28,17 @@ async function plan(input, includeTags, excludeTags) {
28
28
  totalFlowFiles: 1,
29
29
  };
30
30
  }
31
+ // raw list of all yaml files beneath entry point
31
32
  let unfilteredFlowFiles = await (0, planMethods_1.walk)(input, planMethods_1.isFlowFile);
32
33
  if (unfilteredFlowFiles.length === 0) {
33
34
  throw new Error(`Flow directory does not contain any Flow files: ${path.resolve(input)}`);
34
35
  }
36
+ // filter out files that match the exclude list
37
+ if (excludeFlows) {
38
+ for (const flow of excludeFlows) {
39
+ unfilteredFlowFiles = unfilteredFlowFiles.filter((file) => !file.startsWith(path.resolve(flow)));
40
+ }
41
+ }
35
42
  const configFilePath = unfilteredFlowFiles.find((file) => file.endsWith('config.yaml') || file.endsWith('config.yml'));
36
43
  if (configFilePath)
37
44
  unfilteredFlowFiles = unfilteredFlowFiles.filter((file) => file !== configFilePath);
@@ -41,6 +48,7 @@ async function plan(input, includeTags, excludeTags) {
41
48
  const workspaceConfig = configFilePath
42
49
  ? (0, planMethods_1.readYamlFileAsJson)(configFilePath)
43
50
  : {};
51
+ // list of relative file paths from search
44
52
  let unsortedFlowFiles = topLevelFlowFiles;
45
53
  if (workspaceConfig.flows) {
46
54
  const globs = workspaceConfig.flows.map((glob) => glob);
@@ -48,6 +56,7 @@ async function plan(input, includeTags, excludeTags) {
48
56
  cwd: input,
49
57
  nodir: true,
50
58
  });
59
+ // overwrite the list of files with the globbed ones
51
60
  unsortedFlowFiles = matchedFiles.filter((file) => file !== 'config.yaml' &&
52
61
  (file.endsWith('.yaml') || file.endsWith('.yml')));
53
62
  }
@@ -109,6 +109,14 @@
109
109
  "multiple": true,
110
110
  "type": "option"
111
111
  },
112
+ "exclude-flows": {
113
+ "description": "Sub directories to ignore when building the flow file list",
114
+ "name": "exclude-flows",
115
+ "default": [],
116
+ "hasDynamicHelp": false,
117
+ "multiple": true,
118
+ "type": "option"
119
+ },
112
120
  "exclude-tags": {
113
121
  "aliases": [
114
122
  "exclude-tags"
@@ -220,5 +228,5 @@
220
228
  ]
221
229
  }
222
230
  },
223
- "version": "0.0.7"
231
+ "version": "1.0.0"
224
232
  }
package/package.json CHANGED
@@ -73,7 +73,7 @@
73
73
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
74
74
  "version": "oclif readme && git add README.md"
75
75
  },
76
- "version": "0.0.7",
76
+ "version": "1.0.0",
77
77
  "bugs": {
78
78
  "url": "https://discord.gg/gm3mJwcNw8"
79
79
  },