@devvit/web 0.11.20-next-2025-07-24-16-29-19-3f98b8c68.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/LICENSE +26 -0
- package/README.md +38 -0
- package/client/clientImportInServerCodePanic.d.ts +15 -0
- package/client/clientImportInServerCodePanic.d.ts.map +1 -0
- package/client/clientImportInServerCodePanic.js +15 -0
- package/client/index.d.ts +3 -0
- package/client/index.d.ts.map +1 -0
- package/client/index.js +2 -0
- package/package.json +42 -0
- package/server/index.d.ts +8 -0
- package/server/index.d.ts.map +1 -0
- package/server/index.js +7 -0
- package/server/serverImportInClientCodePanic.d.ts +15 -0
- package/server/serverImportInClientCodePanic.d.ts.map +1 -0
- package/server/serverImportInClientCodePanic.js +15 -0
- package/shared/index.d.ts +2 -0
- package/shared/index.d.ts.map +1 -0
- package/shared/index.js +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2023 Reddit Inc.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
13
|
+
contributors may be used to endorse or promote products derived from
|
|
14
|
+
this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
17
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
19
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
22
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
23
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
24
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
25
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
26
|
+
SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @devvit/web
|
|
2
|
+
|
|
3
|
+
A central package for all your Devvit Web needs! This package provides the core functionality for
|
|
4
|
+
building web applications with Devvit. Just bring your own framework and start building!
|
|
5
|
+
|
|
6
|
+
## Exports
|
|
7
|
+
This package exports the following modules:
|
|
8
|
+
- `@devvit/web/server`: Server-side utilities for Devvit web applications, including Redis clients,
|
|
9
|
+
access to the Reddit API, and more.
|
|
10
|
+
- `@devvit/web/client`: Client-side utilities for Devvit web applications, including access to our
|
|
11
|
+
client-side context, effects, and more.
|
|
12
|
+
- **NOTE:** If you are having difficulty importing from this package, you may need to
|
|
13
|
+
set `compilerOptions.customConditions` to `["browser"]` in your `tsconfig.json` file. (This
|
|
14
|
+
should be done for you automatically if you used one of our starter templates.)
|
|
15
|
+
- `@devvit/web/shared`: Shared utilities and types for Devvit web applications - usable on both
|
|
16
|
+
the client and server.
|
|
17
|
+
|
|
18
|
+
## Other packages
|
|
19
|
+
All the functionality in this package is also available in the following packages:
|
|
20
|
+
- `@devvit/client`: Client-side utilities for Devvit web applications.
|
|
21
|
+
- `@devvit/media`: Media-related utilities for Devvit web applications.
|
|
22
|
+
- `@devvit/realtime`: Realtime communication utilities for Devvit web applications.
|
|
23
|
+
- `@devvit/reddit`: Reddit API client for Devvit web applications.
|
|
24
|
+
- `@devvit/redis`: Redis client for Devvit web applications.
|
|
25
|
+
- `@devvit/scheduler`: Scheduler utilities for Devvit web applications.
|
|
26
|
+
- `@devvit/server`: Server-side utilities for Devvit web applications.
|
|
27
|
+
- `@devvit/settings`: Settings management utilities for Devvit web applications.
|
|
28
|
+
- `@devvit/shared`: Shared utilities and types for Devvit web applications - usable on both
|
|
29
|
+
the client and server.
|
|
30
|
+
|
|
31
|
+
One single `@devvit/web` dependency replaces all of these packages, so you can use it to
|
|
32
|
+
build your web application without needing to install or manage multiple packages.
|
|
33
|
+
|
|
34
|
+
However, *not* included here is the following package:
|
|
35
|
+
- `@devvit/payments`: Payment-related utilities for Devvit web applications. Once your app has been
|
|
36
|
+
approved to handle payments, you can use this package to handle payments in your web application.
|
|
37
|
+
|
|
38
|
+
Sign up for Reddit's Developer Platform [here!](https://developers.reddit.com)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hey! If you're seeing this, you're probably trying to run client code in the
|
|
3
|
+
* server context, or you have your server build environment set up incorrectly.
|
|
4
|
+
* To fix this:
|
|
5
|
+
* 1) Check that you're not importing client code in your server files. If you
|
|
6
|
+
* are, you should import from `@devvit/web/server` instead of
|
|
7
|
+
* `@devvit/web/client`.
|
|
8
|
+
* 2) Ensure that your server's tsconfig & build environment is set up correctly
|
|
9
|
+
* - specifically, make sure you do NOT set `compilerOptions.customConditions`
|
|
10
|
+
* to `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
|
|
11
|
+
* bundler you're using (esbuild, vite, etc.) is bundling the server code
|
|
12
|
+
* for a Node environment, and not a web browser!
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=clientImportInServerCodePanic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientImportInServerCodePanic.d.ts","sourceRoot":"","sources":["../../src/client/clientImportInServerCodePanic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hey! If you're seeing this, you're probably trying to run client code in the
|
|
3
|
+
* server context, or you have your server build environment set up incorrectly.
|
|
4
|
+
* To fix this:
|
|
5
|
+
* 1) Check that you're not importing client code in your server files. If you
|
|
6
|
+
* are, you should import from `@devvit/web/server` instead of
|
|
7
|
+
* `@devvit/web/client`.
|
|
8
|
+
* 2) Ensure that your server's tsconfig & build environment is set up correctly
|
|
9
|
+
* - specifically, make sure you do NOT set `compilerOptions.customConditions`
|
|
10
|
+
* to `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
|
|
11
|
+
* bundler you're using (esbuild, vite, etc.) is bundling the server code
|
|
12
|
+
* for a Node environment, and not a web browser!
|
|
13
|
+
*/
|
|
14
|
+
console.error("Can't import client code in the server!");
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC"}
|
package/client/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devvit/web",
|
|
3
|
+
"version": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
4
|
+
"license": "BSD-3-Clause",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://developers.reddit.com/"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"clean": "rm -rf .turbo coverage dist",
|
|
13
|
+
"clobber": "yarn clean && rm -rf node_modules",
|
|
14
|
+
"dev": "tsc -w",
|
|
15
|
+
"lint": "redlint .",
|
|
16
|
+
"lint:fix": "yarn lint --fix",
|
|
17
|
+
"prepublishOnly": "publish-package-json",
|
|
18
|
+
"test": "yarn test:types && yarn lint",
|
|
19
|
+
"test:types": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@devvit/client": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
23
|
+
"@devvit/media": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
24
|
+
"@devvit/realtime": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
25
|
+
"@devvit/reddit": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
26
|
+
"@devvit/redis": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
27
|
+
"@devvit/scheduler": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
28
|
+
"@devvit/server": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
29
|
+
"@devvit/settings": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
30
|
+
"@devvit/shared": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@devvit/repo-tools": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
34
|
+
"@devvit/tsconfig": "0.11.20-next-2025-07-24-16-29-19-3f98b8c68.0",
|
|
35
|
+
"eslint": "9.11.1",
|
|
36
|
+
"typescript": "5.8.3"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"directory": "dist"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "b3418c8f7766ec7945a1a79def9b4930c884f3fe"
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from '@devvit/media';
|
|
2
|
+
export * from '@devvit/realtime/server';
|
|
3
|
+
export * from '@devvit/reddit';
|
|
4
|
+
export * from '@devvit/redis';
|
|
5
|
+
export * from '@devvit/scheduler';
|
|
6
|
+
export * from '@devvit/server';
|
|
7
|
+
export * from '@devvit/settings';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
package/server/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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 client 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`.
|
|
8
|
+
* 2) Ensure that your client's tsconfig & build environment is set up correctly
|
|
9
|
+
* - specifically, make sure you set `compilerOptions.customConditions` to
|
|
10
|
+
* `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
|
|
11
|
+
* bundler you're using (esbuild, vite, etc.) is bundling the client code
|
|
12
|
+
* for a web browser, and not a Node environment!
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=serverImportInClientCodePanic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverImportInClientCodePanic.d.ts","sourceRoot":"","sources":["../../src/server/serverImportInClientCodePanic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 client 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`.
|
|
8
|
+
* 2) Ensure that your client's tsconfig & build environment is set up correctly
|
|
9
|
+
* - specifically, make sure you set `compilerOptions.customConditions` to
|
|
10
|
+
* `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
|
|
11
|
+
* bundler you're using (esbuild, vite, etc.) is bundling the client code
|
|
12
|
+
* for a web browser, and not a Node environment!
|
|
13
|
+
*/
|
|
14
|
+
console.error("Can't import server code in the client!");
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/shared/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@devvit/shared';
|