@devicecloud.dev/dcd 3.3.3 → 3.3.4-beta.2

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/methods.js CHANGED
@@ -17,6 +17,7 @@ const promises_2 = require("node:stream/promises");
17
17
  const StreamZip = require("node-stream-zip");
18
18
  const plist_1 = require("plist");
19
19
  const node_crypto_1 = require("node:crypto");
20
+ const path = require("path");
20
21
  const cloud_1 = require("./commands/cloud");
21
22
  const PERMITTED_EXTENSIONS = new Set([
22
23
  'yml',
@@ -199,7 +200,7 @@ const extractAppMetadataIosZip = async (appFilePath) => new Promise((resolve, re
199
200
  });
200
201
  exports.extractAppMetadataIosZip = extractAppMetadataIosZip;
201
202
  const extractAppMetadataIos = async (appFolderPath) => {
202
- const infoPlistPath = nodePath.join(appFolderPath, 'Info.plist');
203
+ const infoPlistPath = path.normalize(path.join(appFolderPath, 'Info.plist'));
203
204
  const buffer = await (0, promises_1.readFile)(infoPlistPath);
204
205
  const data = await parseInfoPlist(buffer);
205
206
  const appId = data.CFBundleIdentifier;
package/dist/plan.js CHANGED
@@ -98,10 +98,12 @@ async function plan(input, includeTags, excludeTags, excludeFlows) {
98
98
  return acc;
99
99
  }, {});
100
100
  const allFiles = await Promise.all(unfilteredFlowFiles.map((filePath) => checkDependencies(filePath))).then((results) => [...new Set(results.flat())]);
101
+ console.log('Found include tags in workspace config', workspaceConfig.includeTags);
101
102
  const allIncludeTags = [
102
103
  ...includeTags,
103
104
  ...(workspaceConfig.includeTags || []),
104
105
  ];
106
+ console.log('Found exclude tags in workspace config', workspaceConfig.excludeTags);
105
107
  const allExcludeTags = [
106
108
  ...excludeTags,
107
109
  ...(workspaceConfig.excludeTags || []),
@@ -36,19 +36,47 @@ function isFlowFile(filePath) {
36
36
  }
37
37
  const readYamlFileAsJson = (filePath) => {
38
38
  try {
39
- const yamlText = fs.readFileSync(filePath, 'utf8');
40
- return yaml.load(yamlText);
39
+ const normalizedPath = path.normalize(filePath);
40
+ console.log('[YAML Parser] Reading file:', normalizedPath);
41
+ const yamlText = fs.readFileSync(normalizedPath, 'utf8');
42
+ console.log('[YAML Parser] File contents:', '\n' + yamlText);
43
+ const result = yaml.load(yamlText);
44
+ console.log('[YAML Parser] Parsed result:', JSON.stringify(result, null, 2));
45
+ // Ensure includeTags and excludeTags are always arrays if present
46
+ if (result && typeof result === 'object') {
47
+ if ('includeTags' in result && !Array.isArray(result.includeTags)) {
48
+ console.log('[YAML Parser] Converting includeTags to array:', {
49
+ from: result.includeTags,
50
+ to: result.includeTags ? [result.includeTags] : [],
51
+ });
52
+ result.includeTags = result.includeTags ? [result.includeTags] : [];
53
+ }
54
+ if ('excludeTags' in result && !Array.isArray(result.excludeTags)) {
55
+ console.log('[YAML Parser] Converting excludeTags to array:', {
56
+ from: result.excludeTags,
57
+ to: result.excludeTags ? [result.excludeTags] : [],
58
+ });
59
+ result.excludeTags = result.excludeTags ? [result.excludeTags] : [];
60
+ }
61
+ }
62
+ return result;
41
63
  }
42
64
  catch (error) {
43
- const message = `Error parsing YAML file ${filePath}: ${error}`;
44
- console.error(message);
45
- throw new Error(message);
65
+ console.error('[YAML Parser] Error parsing file:', {
66
+ filePath,
67
+ normalizedPath: path.normalize(filePath),
68
+ errorName: error instanceof Error ? error.name : 'Unknown',
69
+ errorMessage: error instanceof Error ? error.message : String(error),
70
+ errorStack: error instanceof Error ? error.stack : undefined,
71
+ });
72
+ throw new Error(`Error parsing YAML file ${filePath}: ${error}`);
46
73
  }
47
74
  };
48
75
  exports.readYamlFileAsJson = readYamlFileAsJson;
49
76
  const readTestYamlFileAsJson = (filePath) => {
50
77
  try {
51
- const yamlText = fs.readFileSync(filePath, 'utf8');
78
+ const normalizedPath = path.normalize(filePath);
79
+ const yamlText = fs.readFileSync(normalizedPath, 'utf8');
52
80
  const normalizedText = yamlText.replaceAll('\r\n', '\n');
53
81
  if (normalizedText.includes('\n---\n')) {
54
82
  const yamlTexts = normalizedText.split('\n---\n');
@@ -93,7 +121,7 @@ const checkIfFilesExistInWorkspace = (commandName, command, absoluteFilePath) =>
93
121
  const directory = path.dirname(absoluteFilePath);
94
122
  const buildError = (error) => `Flow file "${absoluteFilePath}" has a command "${commandName}" that references a ${error} ${JSON.stringify(command)}`;
95
123
  const processFilePath = (relativePath) => {
96
- const absoluteFilePath = path.resolve(directory, relativePath);
124
+ const absoluteFilePath = path.normalize(path.resolve(directory, relativePath));
97
125
  const error = checkFile(absoluteFilePath);
98
126
  if (error)
99
127
  errors.push(buildError(error));
@@ -101,7 +129,7 @@ const checkIfFilesExistInWorkspace = (commandName, command, absoluteFilePath) =>
101
129
  };
102
130
  // simple command
103
131
  if (typeof command === 'string') {
104
- processFilePath(path.normalize(directory + '/' + command));
132
+ processFilePath(path.normalize(path.join(directory, command)));
105
133
  }
106
134
  // array command
107
135
  if (Array.isArray(command)) {
@@ -398,5 +398,5 @@
398
398
  ]
399
399
  }
400
400
  },
401
- "version": "3.3.3"
401
+ "version": "3.3.4-beta.2"
402
402
  }
package/package.json CHANGED
@@ -80,7 +80,7 @@
80
80
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
81
81
  "version": "oclif readme && git add README.md"
82
82
  },
83
- "version": "3.3.3",
83
+ "version": "3.3.4-beta.2",
84
84
  "bugs": {
85
85
  "url": "https://discord.gg/gm3mJwcNw8"
86
86
  },