@devvit/server 0.12.1-next-2025-09-08-16-36-02-0857fd917.0 → 0.12.1-next-2025-09-08-19-45-32-89a065252.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { context, getContextCache, runWithContext, setContextCache } from './context.js';
2
2
  export { createServer } from './create-server.js';
3
- export { getServerPort } from './get-server-port.js';
4
3
  export { Context, setContext } from './server-context.js';
4
+ export { getServerPort } from '@devvit/shared-types/server/get-server-port.js';
5
5
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC"}
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { context, getContextCache, runWithContext, setContextCache } from './context.js';
2
2
  export { createServer } from './create-server.js';
3
- export { getServerPort } from './get-server-port.js';
4
3
  export { Context, setContext } from './server-context.js';
4
+ export { getServerPort } from '@devvit/shared-types/server/get-server-port.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/server",
3
- "version": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0",
3
+ "version": "0.12.1-next-2025-09-08-19-45-32-89a065252.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,10 +8,12 @@
8
8
  },
9
9
  "type": "module",
10
10
  "exports": {
11
- ".": "./index.js",
11
+ ".": {
12
+ "browser": "./serverImportInClientCodePanic.js",
13
+ "default": "./index.js"
14
+ },
12
15
  "./package.json": "./package.json"
13
16
  },
14
- "main": "./dist/index.js",
15
17
  "files": [
16
18
  "**"
17
19
  ],
@@ -28,20 +30,18 @@
28
30
  "test:unit": "vitest run",
29
31
  "test:unit-with-coverage": "vitest run --coverage"
30
32
  },
31
- "types": "./dist/index.d.ts",
32
33
  "dependencies": {
33
- "@devvit/protos": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0",
34
- "@devvit/public-api": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0",
35
- "@devvit/shared": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0",
36
- "@devvit/shared-types": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0"
34
+ "@devvit/protos": "0.12.1-next-2025-09-08-19-45-32-89a065252.0",
35
+ "@devvit/public-api": "0.12.1-next-2025-09-08-19-45-32-89a065252.0",
36
+ "@devvit/shared": "0.12.1-next-2025-09-08-19-45-32-89a065252.0",
37
+ "@devvit/shared-types": "0.12.1-next-2025-09-08-19-45-32-89a065252.0"
37
38
  },
38
39
  "devDependencies": {
39
- "@devvit/repo-tools": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0",
40
- "@devvit/tsconfig": "0.12.1-next-2025-09-08-16-36-02-0857fd917.0",
40
+ "@devvit/repo-tools": "0.12.1-next-2025-09-08-19-45-32-89a065252.0",
41
+ "@devvit/tsconfig": "0.12.1-next-2025-09-08-19-45-32-89a065252.0",
41
42
  "eslint": "9.11.1",
42
43
  "typescript": "5.8.3",
43
44
  "vitest": "1.6.1"
44
45
  },
45
- "source": "./src/index.ts",
46
- "gitHead": "9c81842620a8bd6824ee42532789c29eb57bbe29"
46
+ "gitHead": "f26bdc215ac18d3f501b4dc720461ba096126721"
47
47
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Hey! If you're seeing this, you're probably trying to run server code in the
3
+ * client context, or you have your server build environment set up incorrectly.
4
+ * To fix this:
5
+ * 1) Check that you're not importing server code in your client files. If you
6
+ * are, you should import from `@devvit/web/client` instead of
7
+ * `@devvit/web/server`. `@devvit/server` is server only and has no client
8
+ * support.
9
+ * 2) If this is coming from server code, ensure that your client's tsconfig &
10
+ * build environment is set up correctly - specifically, make sure you do NOT
11
+ * have `compilerOptions.customConditions` set to include `["browser"]` in
12
+ * your `tsconfig.json` file. Also, verify that whatever bundler you're using
13
+ * (esbuild, vite, etc.) is bundling the client code for a Node environment,
14
+ * and not a web browser!
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=serverImportInClientCodePanic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverImportInClientCodePanic.d.ts","sourceRoot":"","sources":["../src/serverImportInClientCodePanic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Hey! If you're seeing this, you're probably trying to run server code in the
3
+ * client context, or you have your server build environment set up incorrectly.
4
+ * To fix this:
5
+ * 1) Check that you're not importing server code in your client files. If you
6
+ * are, you should import from `@devvit/web/client` instead of
7
+ * `@devvit/web/server`. `@devvit/server` is server only and has no client
8
+ * support.
9
+ * 2) If this is coming from server code, ensure that your client's tsconfig &
10
+ * build environment is set up correctly - specifically, make sure you do NOT
11
+ * have `compilerOptions.customConditions` set to include `["browser"]` in
12
+ * your `tsconfig.json` file. Also, verify that whatever bundler you're using
13
+ * (esbuild, vite, etc.) is bundling the client code for a Node environment,
14
+ * and not a web browser!
15
+ */
16
+ console.error("Can't import server code in the client!");
17
+ export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * Gets the port the internal server should run on. Call this when starting the server to get the
3
- * port to use.
4
- * @example createServer(myHandler).listen(getServerPort());
5
- * @returns The port to use for the server.
6
- */
7
- export declare function getServerPort(): number;
8
- //# sourceMappingURL=get-server-port.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-server-port.d.ts","sourceRoot":"","sources":["../src/get-server-port.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAMtC"}
@@ -1,14 +0,0 @@
1
- import process from 'node:process';
2
- /**
3
- * Gets the port the internal server should run on. Call this when starting the server to get the
4
- * port to use.
5
- * @example createServer(myHandler).listen(getServerPort());
6
- * @returns The port to use for the server.
7
- */
8
- export function getServerPort() {
9
- const envPort = Number(process.env.WEBBIT_PORT);
10
- if (isNaN(envPort)) {
11
- return 3000;
12
- }
13
- return envPort;
14
- }