@dsmrt/axiom-config 1.2.8 → 1.2.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @dsmrt/axiom-config
2
2
 
3
+ ## 1.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - cbe2273: chore: bump all packages to pick up dependency updates
8
+
9
+ ## 1.2.9
10
+
11
+ ### Patch Changes
12
+
13
+ - d5d1a20: chore: remove glob dependency, update AWS SDK and tooling deps
14
+
15
+ Replace glob with native node:fs existsSync for config file discovery.
16
+ Bump @aws-sdk/* from 3.716 to 3.1127, @biomejs/biome to 2.5.12, tsup to 8.5.1.
17
+ - d5d1a20: fix: prod env uses no-suffix config file, falls back to .axiom.prod.*
18
+
19
+ When the active env equals `prodEnvName` (default `"prod"`), `loadConfig` now
20
+ treats the bare config file (`.axiom.js` / `.axiom.json` / `.axiom.ts`) as the
21
+ complete prod config and no longer also tries to load `.axiom.prod.*` on top of
22
+ it. `.axiom.prod.*` is only consulted as a fallback when no no-suffix file
23
+ exists. `ENV=prod` and `--env prod` no longer throw when only a bare config
24
+ file is present.
25
+
3
26
  ## 1.2.8
4
27
 
5
28
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ __export(index_exports, {
30
30
  });
31
31
  module.exports = __toCommonJS(index_exports);
32
32
  var import_node_fs = require("fs");
33
- var import_glob = require("glob");
33
+ var import_node_path = require("path");
34
34
  var isDebugEnabled = () => process.env.AXIOM_DEBUG === "true" || process.env.AXIOM_DEBUG === "1";
35
35
  var debug = (message, ...args) => {
36
36
  if (isDebugEnabled()) {
@@ -179,32 +179,28 @@ function mergeDeep(target, ...sources) {
179
179
  var configPath = (input) => {
180
180
  const envIndicator = input?.env ? `.${input.env}` : "";
181
181
  const extensions = ["json", "js", "mjs", "ts", "mts"];
182
- const pattern = `.axiom${envIndicator}.{${extensions.join(",")}}`;
182
+ const prefix = `.axiom${envIndicator}`;
183
183
  debug(
184
- `Searching for config files with pattern: ${pattern}`,
184
+ `Searching for config files matching: ${prefix}.{${extensions.join(",")}}`,
185
185
  input?.cwd ? `from ${input.cwd}` : "from current directory"
186
186
  );
187
187
  const cwd = input?.cwd || process.cwd();
188
188
  let currentDir = cwd;
189
189
  let found;
190
190
  while (true) {
191
- const matches = (0, import_glob.globSync)(pattern, {
192
- cwd: currentDir,
193
- absolute: true,
194
- nodir: true
195
- });
191
+ const matches = extensions.map((ext) => (0, import_node_path.join)(currentDir, `${prefix}.${ext}`)).filter(import_node_fs.existsSync);
196
192
  if (matches.length > 0) {
197
193
  found = matches[0];
198
194
  break;
199
195
  }
200
- const parent = require("path").dirname(currentDir);
196
+ const parent = (0, import_node_path.dirname)(currentDir);
201
197
  if (parent === currentDir) {
202
198
  break;
203
199
  }
204
200
  currentDir = parent;
205
201
  }
206
202
  if (found === void 0) {
207
- debug(`Config file not found! Searched for pattern: ${pattern}`);
203
+ debug(`Config file not found! Searched for: ${prefix}.{${extensions.join(",")}}`);
208
204
  throw new Error(
209
205
  `Axiom config files not found: .axiom${envIndicator}.json, .axiom${envIndicator}.js .axiom${envIndicator}.ts`
210
206
  );
package/dist/index.mjs CHANGED
@@ -6,8 +6,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  });
7
7
 
8
8
  // src/index.ts
9
- import { readFileSync } from "node:fs";
10
- import { globSync } from "glob";
9
+ import { existsSync, readFileSync } from "fs";
10
+ import { dirname, join } from "path";
11
11
  var isDebugEnabled = () => process.env.AXIOM_DEBUG === "true" || process.env.AXIOM_DEBUG === "1";
12
12
  var debug = (message, ...args) => {
13
13
  if (isDebugEnabled()) {
@@ -156,32 +156,28 @@ function mergeDeep(target, ...sources) {
156
156
  var configPath = (input) => {
157
157
  const envIndicator = input?.env ? `.${input.env}` : "";
158
158
  const extensions = ["json", "js", "mjs", "ts", "mts"];
159
- const pattern = `.axiom${envIndicator}.{${extensions.join(",")}}`;
159
+ const prefix = `.axiom${envIndicator}`;
160
160
  debug(
161
- `Searching for config files with pattern: ${pattern}`,
161
+ `Searching for config files matching: ${prefix}.{${extensions.join(",")}}`,
162
162
  input?.cwd ? `from ${input.cwd}` : "from current directory"
163
163
  );
164
164
  const cwd = input?.cwd || process.cwd();
165
165
  let currentDir = cwd;
166
166
  let found;
167
167
  while (true) {
168
- const matches = globSync(pattern, {
169
- cwd: currentDir,
170
- absolute: true,
171
- nodir: true
172
- });
168
+ const matches = extensions.map((ext) => join(currentDir, `${prefix}.${ext}`)).filter(existsSync);
173
169
  if (matches.length > 0) {
174
170
  found = matches[0];
175
171
  break;
176
172
  }
177
- const parent = __require("node:path").dirname(currentDir);
173
+ const parent = dirname(currentDir);
178
174
  if (parent === currentDir) {
179
175
  break;
180
176
  }
181
177
  currentDir = parent;
182
178
  }
183
179
  if (found === void 0) {
184
- debug(`Config file not found! Searched for pattern: ${pattern}`);
180
+ debug(`Config file not found! Searched for: ${prefix}.{${extensions.join(",")}}`);
185
181
  throw new Error(
186
182
  `Axiom config files not found: .axiom${envIndicator}.json, .axiom${envIndicator}.js .axiom${envIndicator}.ts`
187
183
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmrt/axiom-config",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "description": "Config library for axiom cli",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -24,18 +24,17 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@biomejs/biome": "^2.3.8",
28
- "@changesets/cli": "^2.27.11",
29
- "@types/node": "^22.12.0",
30
- "@types/yargs": "^17.0.33",
31
- "@vitest/coverage-v8": "^4.0.0",
27
+ "@biomejs/biome": "^2.5.12",
28
+ "@changesets/cli": "^3.0.2",
29
+ "@types/node": "^26.4.1",
30
+ "@types/yargs": "^17.0.35",
31
+ "@vitest/coverage-v8": "^5.0.0",
32
32
  "ts-node": "^10.9.2",
33
- "tsup": "^8.3.5",
33
+ "tsup": "^8.5.1",
34
34
  "typescript": "^5.7.2",
35
- "vitest": "^4.1.0"
35
+ "vitest": "^5.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "glob": "^10.5.0",
39
38
  "yargs": "^17.7.2"
40
39
  },
41
40
  "scripts": {