typed-bridge 2.0.2 → 2.0.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/context.md +6 -0
- package/dist/bridge/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +4 -4
package/context.md
CHANGED
|
@@ -166,3 +166,9 @@ console.log(user)
|
|
|
166
166
|
2. Add `'module.method': handler` to `src/bridge/index.ts`
|
|
167
167
|
3. (If validating) add types in `src/bridge/<module>/types.ts`
|
|
168
168
|
4. Run `npm run gen:typed-bridge-client` to refresh the client
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## **Environment Variables**
|
|
173
|
+
|
|
174
|
+
Typed Bridge automatically imports `.env` variables for you, internally using [`dotenv`](https://www.npmjs.com/package/dotenv`). This means any environment variables defined in a `.env` file at the root of your project will be available to your application without additional setup.
|
package/dist/bridge/index.js
CHANGED
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createBridge = exports.onShutdown = exports.createMiddleware = void 0;
|
|
7
|
-
const helpers_1 = require("@/helpers");
|
|
8
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
8
|
const compression_1 = __importDefault(require("compression"));
|
|
10
9
|
const cors_1 = __importDefault(require("cors"));
|
|
11
10
|
const express_1 = __importDefault(require("express"));
|
|
12
11
|
const path_1 = __importDefault(require("path"));
|
|
13
12
|
const __1 = require("..");
|
|
13
|
+
const helpers_1 = require("../helpers");
|
|
14
14
|
const middlewares = [];
|
|
15
15
|
const createMiddleware = (pattern, handler) => middlewares.push({ pattern, handler });
|
|
16
16
|
exports.createMiddleware = createMiddleware;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -284,6 +284,10 @@ tbConfig.logs.error = true // Enable error logging
|
|
|
284
284
|
tbConfig.responseDelay = 0 // Custom response delay in milliseconds (useful for testing)
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
+
## Environment File
|
|
288
|
+
|
|
289
|
+
Typed Bridge automatically imports `.env` variables for you, internally using [`dotenv`](https://www.npmjs.com/package/dotenv).
|
|
290
|
+
|
|
287
291
|
## Developer
|
|
288
292
|
|
|
289
293
|
Developed & maintained by [neilveil](https://github.com/neilveil). Give a ⭐ to support this project!
|
|
@@ -291,7 +295,3 @@ Developed & maintained by [neilveil](https://github.com/neilveil). Give a ⭐ to
|
|
|
291
295
|
---
|
|
292
296
|
|
|
293
297
|
[Context for AI IDE](https://raw.githubusercontent.com/neilveil/typed-bridge/refs/heads/main/context.md)
|
|
294
|
-
|
|
295
|
-
## To do
|
|
296
|
-
|
|
297
|
-
- Auto import `.env` variables
|