@dsmrt/axiom-cli 1.3.0 → 1.3.4

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,56 @@
1
1
  # @dsmrt/axiom-cli
2
2
 
3
+ ## 1.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 31ae74a: fix(ci): move --provenance into changeset-publish script to avoid pnpm arg-passthrough bug
8
+ - Updated dependencies [31ae74a]
9
+ - @dsmrt/axiom-config@1.2.3
10
+ - @dsmrt/axiom-aws-sdk@1.0.1
11
+
12
+ ## 1.3.3
13
+
14
+ ### Patch Changes
15
+
16
+ - f64437b: fix(ci): add npm provenance via OIDC and fix NPM_TOKEN env for changesets/action
17
+
18
+ ## 1.3.2
19
+
20
+ ### Patch Changes
21
+
22
+ - 5549ab3: fix: upgrade release CI to Node 22 with frozen lockfile
23
+ - 6ac6d26: fix: support `ENV` environment variable for selecting config
24
+
25
+ `ENV=dev axiom params get` now loads `.axiom.dev.js` (equivalent to `--env dev`).
26
+
27
+ **`@dsmrt/axiom-config`**: `loadConfig` falls back to `process.env.ENV` when no `env` is passed, so library consumers also benefit.
28
+
29
+ **`@dsmrt/axiom-cli`**: middleware maps `ENV` → `argv.env` at parse time so all subcommands see the resolved value. Priority order: `--env` flag > `AXIOM_ENV` > `ENV`.
30
+
31
+ - e8a9421: fix(ci): upgrade pnpm to v9 to match lockfile version 9.0
32
+ - 6ac6d26: fix: `axiom params get` now respects the positional path argument
33
+
34
+ The `[path]` positional was documented but silently ignored — the command
35
+ always fetched from `baseParameterPath`. Now delegates to `buildPath()`:
36
+
37
+ - `axiom params get` → uses `baseParameterPath` from config
38
+ - `axiom params get /` → fetches from SSM root `/`
39
+ - `axiom params get /prod` → absolute path, bypasses config base
40
+ - `axiom params get myService` → relative, resolves to `<baseParameterPath>/myService`
41
+
42
+ - Updated dependencies [5549ab3]
43
+ - Updated dependencies [6ac6d26]
44
+ - @dsmrt/axiom-config@1.2.2
45
+
46
+ ## 1.3.1
47
+
48
+ ### Patch Changes
49
+
50
+ - c941d5d: fix init cli command; fix loadConfigByEnv to allow undefined env
51
+ - Updated dependencies [c941d5d]
52
+ - @dsmrt/axiom-config@1.2.1
53
+
3
54
  ## 1.3.0
4
55
 
5
56
  ### Minor Changes
package/dist/bin/axiom.js CHANGED
@@ -237,8 +237,9 @@ const config: Config = {`;
237
237
  account: "${config.account}",
238
238
  region: "${config.region}",
239
239
  profile: "${config.profile}",
240
+ baseParameterPath: "/${config.name}",
240
241
  },
241
- baseParameterPath: "/${config.name}/prod",${hasCustomTypes ? `
242
+ ${hasCustomTypes ? `
242
243
 
243
244
  // Add your custom config properties here
244
245
  // Example:
@@ -260,7 +261,10 @@ const config: Partial<AxiomConfig> = {` : `import type { Config } from "@dsmrt/a
260
261
  const config: Partial<Config> = {`;
261
262
  return `${importStatement}
262
263
  env: "dev",
263
- baseParameterPath: undefined, // Will be auto-generated as /{name}/dev${hasCustomTypes ? `,
264
+ aws: {
265
+ account: "xxx",
266
+ },
267
+ ${hasCustomTypes ? `,
264
268
 
265
269
  // Override custom config properties for dev environment
266
270
  // Example:
@@ -427,6 +431,17 @@ var awsOptions = () => {
427
431
  };
428
432
  };
429
433
 
434
+ // src/commands/params/utils.ts
435
+ var buildPath = (config, path) => {
436
+ if (path === void 0) {
437
+ return config.aws?.baseParameterPath;
438
+ }
439
+ if (/^\//.test(path)) {
440
+ return path;
441
+ }
442
+ return `${config.aws?.baseParameterPath.replace(/\/$/, "")}/${path}`;
443
+ };
444
+
430
445
  // src/commands/params/get.ts
431
446
  var GetCommand = class {
432
447
  command = "get [path]";
@@ -453,7 +468,7 @@ Example:
453
468
  `Creating SSM client with region: ${config.aws.region}, profile: ${config.aws.profile}`
454
469
  );
455
470
  const collection = new import_axiom_aws_sdk.ParameterCollection(
456
- config.aws?.baseParameterPath,
471
+ buildPath(config, args.path),
457
472
  new import_client_ssm.SSMClient({
458
473
  region: config.aws.region,
459
474
  credentials: await CachedCredentialProvider({
@@ -483,19 +498,6 @@ var import_client_ssm2 = require("@aws-sdk/client-ssm");
483
498
  var import_axiom_config3 = require("@dsmrt/axiom-config");
484
499
  var import_chalk2 = __toESM(require("chalk"));
485
500
  var import_inquirer3 = __toESM(require("inquirer"));
486
-
487
- // src/commands/params/utils.ts
488
- var buildPath = (config, path) => {
489
- if (path === void 0) {
490
- return config.aws?.baseParameterPath;
491
- }
492
- if (/^\//.test(path)) {
493
- return path;
494
- }
495
- return `${config.aws?.baseParameterPath.replace(/\/$/, "")}/${path}`;
496
- };
497
-
498
- // src/commands/params/set.ts
499
501
  var SetCommand = class {
500
502
  command = "set <path> <value>";
501
503
  describe = "Set all parameters under the base path";
@@ -668,6 +670,9 @@ Example: "/root/myParam" or "service/secret"`,
668
670
  if (argv.debug) {
669
671
  process.env.AXIOM_DEBUG = "true";
670
672
  }
673
+ if (argv.env === void 0 && process.env.ENV) {
674
+ argv.env = process.env.ENV;
675
+ }
671
676
  }).command(new Init()).command(new Config()).command(new ParamsCommand()).strict().usage(
672
677
  `
673
678
  Axiom - an AWS focused config cli
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "../chunk-QRHY3BEA.mjs";
2
+ import "../chunk-ASYTLJ3I.mjs";
@@ -35,8 +35,8 @@ var Config = class {
35
35
  };
36
36
 
37
37
  // src/commands/init.ts
38
- import { existsSync, mkdirSync, writeFileSync } from "fs";
39
- import { join } from "path";
38
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
39
+ import { join } from "node:path";
40
40
  import inquirer from "inquirer";
41
41
  var Init = class {
42
42
  command = "init";
@@ -212,8 +212,9 @@ const config: Config = {`;
212
212
  account: "${config.account}",
213
213
  region: "${config.region}",
214
214
  profile: "${config.profile}",
215
+ baseParameterPath: "/${config.name}",
215
216
  },
216
- baseParameterPath: "/${config.name}/prod",${hasCustomTypes ? `
217
+ ${hasCustomTypes ? `
217
218
 
218
219
  // Add your custom config properties here
219
220
  // Example:
@@ -235,7 +236,10 @@ const config: Partial<AxiomConfig> = {` : `import type { Config } from "@dsmrt/a
235
236
  const config: Partial<Config> = {`;
236
237
  return `${importStatement}
237
238
  env: "dev",
238
- baseParameterPath: undefined, // Will be auto-generated as /{name}/dev${hasCustomTypes ? `,
239
+ aws: {
240
+ account: "xxx",
241
+ },
242
+ ${hasCustomTypes ? `,
239
243
 
240
244
  // Override custom config properties for dev environment
241
245
  // Example:
@@ -275,8 +279,8 @@ import {
275
279
  import inquirer2 from "inquirer";
276
280
 
277
281
  // src/cache.ts
278
- import fs from "fs";
279
- import os from "os";
282
+ import fs from "node:fs";
283
+ import os from "node:os";
280
284
  var DEFAULT_DIRECTORY = `${os.homedir()}/.axiom/cache`;
281
285
  var cache_default = class {
282
286
  constructor(cacheDir = DEFAULT_DIRECTORY) {
@@ -405,6 +409,17 @@ var awsOptions = () => {
405
409
  };
406
410
  };
407
411
 
412
+ // src/commands/params/utils.ts
413
+ var buildPath = (config, path) => {
414
+ if (path === void 0) {
415
+ return config.aws?.baseParameterPath;
416
+ }
417
+ if (/^\//.test(path)) {
418
+ return path;
419
+ }
420
+ return `${config.aws?.baseParameterPath.replace(/\/$/, "")}/${path}`;
421
+ };
422
+
408
423
  // src/commands/params/get.ts
409
424
  var GetCommand = class {
410
425
  command = "get [path]";
@@ -431,7 +446,7 @@ Example:
431
446
  `Creating SSM client with region: ${config.aws.region}, profile: ${config.aws.profile}`
432
447
  );
433
448
  const collection = new ParameterCollection(
434
- config.aws?.baseParameterPath,
449
+ buildPath(config, args.path),
435
450
  new SSMClient({
436
451
  region: config.aws.region,
437
452
  credentials: await CachedCredentialProvider({
@@ -465,19 +480,6 @@ import {
465
480
  import { loadConfig as loadConfig3 } from "@dsmrt/axiom-config";
466
481
  import chalk2 from "chalk";
467
482
  import inquirer3 from "inquirer";
468
-
469
- // src/commands/params/utils.ts
470
- var buildPath = (config, path) => {
471
- if (path === void 0) {
472
- return config.aws?.baseParameterPath;
473
- }
474
- if (/^\//.test(path)) {
475
- return path;
476
- }
477
- return `${config.aws?.baseParameterPath.replace(/\/$/, "")}/${path}`;
478
- };
479
-
480
- // src/commands/params/set.ts
481
483
  var SetCommand = class {
482
484
  command = "set <path> <value>";
483
485
  describe = "Set all parameters under the base path";
@@ -650,6 +652,9 @@ yargs(process.argv.slice(2)).env("AXIOM").scriptName("axiom").option("config", {
650
652
  if (argv.debug) {
651
653
  process.env.AXIOM_DEBUG = "true";
652
654
  }
655
+ if (argv.env === void 0 && process.env.ENV) {
656
+ argv.env = process.env.ENV;
657
+ }
653
658
  }).command(new Init()).command(new Config()).command(new ParamsCommand()).strict().usage(
654
659
  `
655
660
  Axiom - an AWS focused config cli
package/dist/index.js CHANGED
@@ -255,8 +255,9 @@ const config: Config = {`;
255
255
  account: "${config.account}",
256
256
  region: "${config.region}",
257
257
  profile: "${config.profile}",
258
+ baseParameterPath: "/${config.name}",
258
259
  },
259
- baseParameterPath: "/${config.name}/prod",${hasCustomTypes ? `
260
+ ${hasCustomTypes ? `
260
261
 
261
262
  // Add your custom config properties here
262
263
  // Example:
@@ -278,7 +279,10 @@ const config: Partial<AxiomConfig> = {` : `import type { Config } from "@dsmrt/a
278
279
  const config: Partial<Config> = {`;
279
280
  return `${importStatement}
280
281
  env: "dev",
281
- baseParameterPath: undefined, // Will be auto-generated as /{name}/dev${hasCustomTypes ? `,
282
+ aws: {
283
+ account: "xxx",
284
+ },
285
+ ${hasCustomTypes ? `,
282
286
 
283
287
  // Override custom config properties for dev environment
284
288
  // Example:
@@ -445,6 +449,17 @@ var awsOptions = () => {
445
449
  };
446
450
  };
447
451
 
452
+ // src/commands/params/utils.ts
453
+ var buildPath = (config, path) => {
454
+ if (path === void 0) {
455
+ return config.aws?.baseParameterPath;
456
+ }
457
+ if (/^\//.test(path)) {
458
+ return path;
459
+ }
460
+ return `${config.aws?.baseParameterPath.replace(/\/$/, "")}/${path}`;
461
+ };
462
+
448
463
  // src/commands/params/get.ts
449
464
  var GetCommand = class {
450
465
  command = "get [path]";
@@ -471,7 +486,7 @@ Example:
471
486
  `Creating SSM client with region: ${config.aws.region}, profile: ${config.aws.profile}`
472
487
  );
473
488
  const collection = new import_axiom_aws_sdk.ParameterCollection(
474
- config.aws?.baseParameterPath,
489
+ buildPath(config, args.path),
475
490
  new import_client_ssm.SSMClient({
476
491
  region: config.aws.region,
477
492
  credentials: await CachedCredentialProvider({
@@ -501,19 +516,6 @@ var import_client_ssm2 = require("@aws-sdk/client-ssm");
501
516
  var import_axiom_config3 = require("@dsmrt/axiom-config");
502
517
  var import_chalk2 = __toESM(require("chalk"));
503
518
  var import_inquirer3 = __toESM(require("inquirer"));
504
-
505
- // src/commands/params/utils.ts
506
- var buildPath = (config, path) => {
507
- if (path === void 0) {
508
- return config.aws?.baseParameterPath;
509
- }
510
- if (/^\//.test(path)) {
511
- return path;
512
- }
513
- return `${config.aws?.baseParameterPath.replace(/\/$/, "")}/${path}`;
514
- };
515
-
516
- // src/commands/params/set.ts
517
519
  var SetCommand = class {
518
520
  command = "set <path> <value>";
519
521
  describe = "Set all parameters under the base path";
@@ -686,6 +688,9 @@ Example: "/root/myParam" or "service/secret"`,
686
688
  if (argv.debug) {
687
689
  process.env.AXIOM_DEBUG = "true";
688
690
  }
691
+ if (argv.env === void 0 && process.env.ENV) {
692
+ argv.env = process.env.ENV;
693
+ }
689
694
  }).command(new Init()).command(new Config()).command(new ParamsCommand()).strict().usage(
690
695
  `
691
696
  Axiom - an AWS focused config cli
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  SetCommand,
8
8
  awsOptions,
9
9
  commonOptions
10
- } from "./chunk-QRHY3BEA.mjs";
10
+ } from "./chunk-ASYTLJ3I.mjs";
11
11
  export {
12
12
  Config,
13
13
  DeleteCommand,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmrt/axiom-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.4",
4
4
  "description": "axiom cli for managing configs including secrets",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -38,7 +38,7 @@
38
38
  "ts-node": "^10.9.2",
39
39
  "tsup": "^8.3.5",
40
40
  "typescript": "^5.7.2",
41
- "vitest": "^4.0.0"
41
+ "vitest": "^4.1.0"
42
42
  },
43
43
  "dependencies": {
44
44
  "@aws-sdk/client-ssm": "^3.716.0",
@@ -48,8 +48,8 @@
48
48
  "chalk": "^4.1.2",
49
49
  "inquirer": "^8.2.6",
50
50
  "yargs": "^17.7.2",
51
- "@dsmrt/axiom-aws-sdk": "^1.0.0",
52
- "@dsmrt/axiom-config": "^1.2.0"
51
+ "@dsmrt/axiom-aws-sdk": "^1.0.1",
52
+ "@dsmrt/axiom-config": "^1.2.3"
53
53
  },
54
54
  "scripts": {
55
55
  "lint": "biome lint",