@devvit/shared-types 0.12.6-next-2025-12-03-22-15-24-1118f1acb.0 → 0.12.6-next-2025-12-04-17-41-15-e72f7a778.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/shared-types",
3
- "version": "0.12.6-next-2025-12-03-22-15-24-1118f1acb.0",
3
+ "version": "0.12.6-next-2025-12-04-17-41-15-e72f7a778.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "types": "./dist/index.d.ts",
35
35
  "dependencies": {
36
- "@devvit/protos": "0.12.6-next-2025-12-03-22-15-24-1118f1acb.0",
36
+ "@devvit/protos": "0.12.6-next-2025-12-04-17-41-15-e72f7a778.0",
37
37
  "jsonschema": "1.4.1",
38
38
  "uuid": "9.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@devvit/repo-tools": "0.12.6-next-2025-12-03-22-15-24-1118f1acb.0",
42
- "@devvit/tsconfig": "0.12.6-next-2025-12-03-22-15-24-1118f1acb.0",
41
+ "@devvit/repo-tools": "0.12.6-next-2025-12-04-17-41-15-e72f7a778.0",
42
+ "@devvit/tsconfig": "0.12.6-next-2025-12-04-17-41-15-e72f7a778.0",
43
43
  "@types/redis-mock": "0.17.1",
44
44
  "@types/uuid": "9.0.0",
45
45
  "chokidar-cli": "3.0.0",
@@ -51,5 +51,5 @@
51
51
  "vitest": "1.6.1"
52
52
  },
53
53
  "source": "./src/index.ts",
54
- "gitHead": "3293b1077156dc32b6ae842db48735106cad6b16"
54
+ "gitHead": "9e85bf5a3b222c0fcea567b6572a3f4200c8980e"
55
55
  }
@@ -0,0 +1,15 @@
1
+ import '../shared/devvit-worker-global.js';
2
+ import type { Config } from '../Config.js';
3
+ export declare const MOCK_HEADERS: {
4
+ "devvit-subreddit": string;
5
+ "devvit-subreddit-name": string;
6
+ "devvit-user": string;
7
+ "devvit-app-user": string;
8
+ "devvit-app": string;
9
+ "devvit-version": string;
10
+ };
11
+ export declare const installGlobalConfig: (config: Config) => void;
12
+ export declare const makeConfig: ({ plugins, }?: {
13
+ plugins?: Record<string, unknown>;
14
+ }) => Config;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,eAAO,MAAM,YAAY;;;;;;;CAOxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,IAIpD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,eAExB;IACD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,KAAG,MA0BR,CAAC"}
package/test/index.js ADDED
@@ -0,0 +1,41 @@
1
+ import '../shared/devvit-worker-global.js';
2
+ import { Header } from '../Header.js';
3
+ export const MOCK_HEADERS = {
4
+ [Header.Subreddit]: 't5_testsub',
5
+ [Header.SubredditName]: 'testsub',
6
+ [Header.User]: 't2_testuser',
7
+ [Header.AppUser]: 't2_testuser',
8
+ [Header.App]: 'test-app',
9
+ [Header.Version]: '0.0.0-test',
10
+ };
11
+ export const installGlobalConfig = (config) => {
12
+ var _a;
13
+ globalThis.devvit ?? (globalThis.devvit = {});
14
+ globalThis.devvit.config = config;
15
+ (_a = globalThis.devvit).compute ?? (_a.compute = { platform: 'node' });
16
+ };
17
+ export const makeConfig = ({ plugins = {}, } = {}) => {
18
+ return {
19
+ assets: {},
20
+ providedDefinitions: [],
21
+ webviewAssets: {},
22
+ getPermissions: () => [],
23
+ export: () => ({
24
+ hostname: '',
25
+ provides: [],
26
+ uses: [],
27
+ permissions: [],
28
+ }),
29
+ provides: () => { },
30
+ addPermissions: () => { },
31
+ use(definition) {
32
+ if (definition.fullName in plugins) {
33
+ return plugins[definition.fullName];
34
+ }
35
+ throw new Error(`Plugin not mocked: ${definition.fullName}`);
36
+ },
37
+ uses(definition) {
38
+ return definition.fullName in plugins;
39
+ },
40
+ };
41
+ };