@devvit/cli 0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0 → 0.12.9-next-2026-01-13-18-29-17-b6cd561bc.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.
package/bin/devvit.js CHANGED
@@ -7,13 +7,16 @@ import { config as dotenvConfig } from 'dotenv';
7
7
 
8
8
  import { getCurrentCommandEventData } from '../dist/lib/hooks/init/fire-event.js';
9
9
  import { sendEvent } from '../dist/util/metrics.js';
10
+ import { shouldRedact } from '../dist/util/redaction.js';
10
11
 
11
12
  dotenvConfig();
12
13
 
13
14
  run(undefined, import.meta.url)
14
15
  .then(() => flush())
15
16
  .catch(async (err) => {
16
- const rawCommand = `devvit ${process.argv.slice(2).join(' ')}`;
17
+ const argv = process.argv.slice(2);
18
+ const shouldRedactRawCommandLine = shouldRedact(argv);
19
+ const rawCommand = shouldRedactRawCommandLine ? '<redacted>' : `devvit ${argv.join(' ')}`;
17
20
 
18
21
  const event = {
19
22
  source: 'devplatform_cli',
@@ -23,8 +26,12 @@ run(undefined, import.meta.url)
23
26
  ...(getCurrentCommandEventData() ?? {
24
27
  cli_raw_command_line: rawCommand,
25
28
  }),
26
- cli_error_message: StringUtil.caughtToString(err, 'message'),
27
- cli_error_stack: StringUtil.caughtToString(err, 'stack'),
29
+ cli_error_message: shouldRedactRawCommandLine
30
+ ? '<redacted>'
31
+ : StringUtil.caughtToString(err, 'message'),
32
+ cli_error_stack: shouldRedactRawCommandLine
33
+ ? '<redacted>'
34
+ : StringUtil.caughtToString(err, 'stack'),
28
35
  },
29
36
  };
30
37
  await sendEvent(event);
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAc1E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAuBlE,MAAM,CAAC,OAAO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OAAO,OAAO,IAAK,SAAQ,aAAa;;IAC7C,OAAgB,OAAO,EAAE,MAAM,EAAE,CAAW;IAC5C,OAAgB,WAAW,SAA0B;IAErD,OAAgB,QAAQ,WAA6C;IAErE,OAAgB,IAAI;;MAMT;IAEX,OAAgB,KAAK;;;MAWV;IA8BI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4OpC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE;IAAE,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC5D,OAAO,CAAC,MAAM,CAAC,CAOjB;AAgGD,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAc1E;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASxE;AACD,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB3F;AAED,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE;IAAE,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAW/B"}
@@ -57,7 +57,7 @@ class Init extends DevvitCommand {
57
57
  source: 'devplatform_cli',
58
58
  noun: 'init',
59
59
  devplatform: {
60
- cli_raw_command_line: 'devvit ' + process.argv[2] + ' ' + redactCode(process.argv.slice(3)).join(' '),
60
+ cli_raw_command_line: 'devvit ' + process.argv.slice(2).join(' '),
61
61
  cli_is_valid_command: true,
62
62
  cli_command: 'init',
63
63
  },
@@ -438,6 +438,3 @@ function syncDependenciesToCurrentCliVersion(deps) {
438
438
  }
439
439
  }
440
440
  }
441
- function redactCode(args) {
442
- return args.map((arg) => (arg.toLowerCase().includes('--') ? arg : '<code redacted>'));
443
- }
@@ -1 +1 @@
1
- {"version":3,"file":"fire-event.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/init/fire-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAcxC,wBAAgB,0BAA0B;0BANd,MAAM;0BACN,OAAO;iBAChB,MAAM,GAAG,SAAS;cAMpC;AAED,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,CAyBtB,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"fire-event.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/init/fire-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAexC,wBAAgB,0BAA0B;0BANd,MAAM;0BACN,OAAO;iBAChB,MAAM,GAAG,SAAS;cAMpC;AAED,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,CA2BtB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { sendEvent } from '../../../util/metrics.js';
2
+ import { shouldRedact } from '../../../util/redaction.js';
2
3
  // Yes, this is a global variable. It's not ideal, but it's the only way to
3
4
  // preserve the data from the `init` hook into the error handler.
4
5
  let CURRENT_COMMAND_EVENT_DATA = undefined;
@@ -7,12 +8,14 @@ export function getCurrentCommandEventData() {
7
8
  }
8
9
  const hook = async function (options) {
9
10
  const isValidCommand = options.id && options.config.commandIDs.includes(options.id);
10
- // argv[0] is the path to node
11
- // argv[1] is the path to the JS script that was run
12
- // we only need indices 2+
13
- const rawCommand = `devvit ${process.argv.slice(2).join(' ')}`;
11
+ // Do not capture init's argv. The init "code" can be passed via argv and is a one-time-use token.
12
+ // Also do not capture argv for `settings` commands because users may include secrets and we don't want
13
+ // to accidentally ingest them (especially on failures).
14
+ const argv = process.argv.slice(2);
15
+ const shouldRedactRawCommandLine = shouldRedact(argv);
16
+ const cliRawCommandLine = shouldRedactRawCommandLine ? '<redacted>' : `devvit ${argv.join(' ')}`;
14
17
  CURRENT_COMMAND_EVENT_DATA = {
15
- cli_raw_command_line: rawCommand,
18
+ cli_raw_command_line: cliRawCommandLine,
16
19
  cli_is_valid_command: Boolean(isValidCommand),
17
20
  cli_command: isValidCommand ? options.id : undefined,
18
21
  };
@@ -0,0 +1,2 @@
1
+ export declare function shouldRedact(argv: string[]): boolean;
2
+ //# sourceMappingURL=redaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction.d.ts","sourceRoot":"","sources":["../../src/util/redaction.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAGpD"}
@@ -0,0 +1,4 @@
1
+ export function shouldRedact(argv) {
2
+ // Users may include secrets when using this command incorrectly, so we redact it.
3
+ return argv[0] === 'settings' && argv[1] === 'set';
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=redaction.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction.test.d.ts","sourceRoot":"","sources":["../../src/util/redaction.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { shouldRedact } from './redaction.js';
3
+ describe('shouldRedact', () => {
4
+ test('redacts settings set', () => {
5
+ expect(shouldRedact(['settings', 'set'])).toBe(true);
6
+ expect(shouldRedact(['settings', 'set', 'foo', 'bar'])).toBe(true);
7
+ });
8
+ test('does not redact settings get', () => {
9
+ expect(shouldRedact(['settings', 'get'])).toBe(false);
10
+ expect(shouldRedact(['settings', 'get', 'foo'])).toBe(false);
11
+ });
12
+ test('does not redact other settings commands', () => {
13
+ expect(shouldRedact(['settings', 'list'])).toBe(false);
14
+ expect(shouldRedact(['settings'])).toBe(false);
15
+ });
16
+ test('does not redact other commands', () => {
17
+ expect(shouldRedact(['deploy'])).toBe(false);
18
+ expect(shouldRedact(['upload'])).toBe(false);
19
+ });
20
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/cli",
3
- "version": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
3
+ "version": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
4
4
  "description": "Reddit's Dev Platform CLI Tool",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "@reddit/dev-platform",
@@ -26,7 +26,6 @@
26
26
  "build": "rm -rf dist && tsc",
27
27
  "clean": "rm -rf .turbo coverage dist docs.json oclif.manifest.json",
28
28
  "clobber": "yarn clean && rm -rf node_modules",
29
- "dev": "tsc --watch",
30
29
  "install:dev": "./scripts/install.sh",
31
30
  "lint": "redlint .",
32
31
  "lint:fix": "yarn lint --fix",
@@ -41,10 +40,10 @@
41
40
  },
42
41
  "types": "dist/index.d.ts",
43
42
  "dependencies": {
44
- "@devvit/build-pack": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
45
- "@devvit/protos": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
46
- "@devvit/public-api": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
47
- "@devvit/shared-types": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
43
+ "@devvit/build-pack": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
44
+ "@devvit/protos": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
45
+ "@devvit/public-api": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
46
+ "@devvit/shared-types": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
48
47
  "@improbable-eng/grpc-web": "0.15.0",
49
48
  "@improbable-eng/grpc-web-node-http-transport": "0.15.0",
50
49
  "@oclif/core": "2.9.4",
@@ -75,8 +74,8 @@
75
74
  "ws": "8.18.0"
76
75
  },
77
76
  "devDependencies": {
78
- "@devvit/repo-tools": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
79
- "@devvit/tsconfig": "0.12.9-next-2026-01-12-21-31-23-d0283fd9f.0",
77
+ "@devvit/repo-tools": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
78
+ "@devvit/tsconfig": "0.12.9-next-2026-01-13-18-29-17-b6cd561bc.0",
80
79
  "@types/file-type": "10.9.1",
81
80
  "@types/inquirer": "9.0.3",
82
81
  "@types/js-yaml": "4.0.5",
@@ -112,5 +111,5 @@
112
111
  ]
113
112
  }
114
113
  },
115
- "gitHead": "b71906b170eed394c98a7ef6665c6d6deb90a6d2"
114
+ "gitHead": "82aa13486eb36fcac0d2820d6a42164840e1015a"
116
115
  }