@aiready/core 0.5.4 → 0.5.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.
package/dist/index.d.mts CHANGED
@@ -118,6 +118,7 @@ interface CLIOptions {
118
118
  }
119
119
  /**
120
120
  * Resolve output file path, defaulting to .aiready directory
121
+ * Creates parent directories if they don't exist.
121
122
  * @param userPath - User-provided output path (optional)
122
123
  * @param defaultFilename - Default filename to use
123
124
  * @param workingDir - Working directory (default: process.cwd())
package/dist/index.d.ts CHANGED
@@ -118,6 +118,7 @@ interface CLIOptions {
118
118
  }
119
119
  /**
120
120
  * Resolve output file path, defaulting to .aiready directory
121
+ * Creates parent directories if they don't exist.
121
122
  * @param userPath - User-provided output path (optional)
122
123
  * @param defaultFilename - Default filename to use
123
124
  * @param workingDir - Working directory (default: process.cwd())
package/dist/index.js CHANGED
@@ -191,14 +191,18 @@ function mergeConfigWithDefaults(userConfig, defaults) {
191
191
  var import_fs2 = require("fs");
192
192
  var import_path2 = require("path");
193
193
  function resolveOutputPath(userPath, defaultFilename, workingDir = process.cwd()) {
194
+ let outputPath;
194
195
  if (userPath) {
195
- return userPath;
196
+ outputPath = userPath;
197
+ } else {
198
+ const aireadyDir = (0, import_path2.join)(workingDir, ".aiready");
199
+ outputPath = (0, import_path2.join)(aireadyDir, defaultFilename);
196
200
  }
197
- const aireadyDir = (0, import_path2.join)(workingDir, ".aiready");
198
- if (!(0, import_fs2.existsSync)(aireadyDir)) {
199
- (0, import_fs2.mkdirSync)(aireadyDir, { recursive: true });
201
+ const parentDir = (0, import_path2.dirname)(outputPath);
202
+ if (!(0, import_fs2.existsSync)(parentDir)) {
203
+ (0, import_fs2.mkdirSync)(parentDir, { recursive: true });
200
204
  }
201
- return (0, import_path2.join)(aireadyDir, defaultFilename);
205
+ return outputPath;
202
206
  }
203
207
  function loadMergedConfig(directory, defaults, cliOptions) {
204
208
  const config = loadConfig(directory);
package/dist/index.mjs CHANGED
@@ -158,14 +158,18 @@ function mergeConfigWithDefaults(userConfig, defaults) {
158
158
  import { writeFileSync, mkdirSync, existsSync as existsSync2 } from "fs";
159
159
  import { join as join2, dirname as dirname2 } from "path";
160
160
  function resolveOutputPath(userPath, defaultFilename, workingDir = process.cwd()) {
161
+ let outputPath;
161
162
  if (userPath) {
162
- return userPath;
163
+ outputPath = userPath;
164
+ } else {
165
+ const aireadyDir = join2(workingDir, ".aiready");
166
+ outputPath = join2(aireadyDir, defaultFilename);
163
167
  }
164
- const aireadyDir = join2(workingDir, ".aiready");
165
- if (!existsSync2(aireadyDir)) {
166
- mkdirSync(aireadyDir, { recursive: true });
168
+ const parentDir = dirname2(outputPath);
169
+ if (!existsSync2(parentDir)) {
170
+ mkdirSync(parentDir, { recursive: true });
167
171
  }
168
- return join2(aireadyDir, defaultFilename);
172
+ return outputPath;
169
173
  }
170
174
  function loadMergedConfig(directory, defaults, cliOptions) {
171
175
  const config = loadConfig(directory);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/core",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Shared utilities for AIReady analysis tools",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",