@dyanet/nextjs-config-aws 1.1.0 → 1.1.1
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/README.md +0 -56
- package/dist/cjs/index.js +2 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/index.js +6 -7
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/esm/index.js +2 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/esm/server/index.js +1 -6
- package/dist/esm/server/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +1 -6
- package/dist/types/server/index.d.ts.map +1 -1
- package/package.json +3 -8
- package/dist/cjs/react.js +0 -50
- package/dist/cjs/react.js.map +0 -1
- package/dist/esm/react.js +0 -43
- package/dist/esm/react.js.map +0 -1
- package/dist/types/react.d.ts +0 -43
- package/dist/types/react.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -324,8 +324,6 @@ export async function GET() {
|
|
|
324
324
|
}
|
|
325
325
|
```
|
|
326
326
|
|
|
327
|
-
> **Note:** `getConfig()` works in API routes without any React dependencies. The React context providers (`ConfigProvider`, `useConfig`) are available via a separate import path - see [React Context Providers](#react-context-providers) below.
|
|
328
|
-
|
|
329
327
|
### Server Action
|
|
330
328
|
|
|
331
329
|
```typescript
|
|
@@ -403,60 +401,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|
|
403
401
|
|
|
404
402
|
## Advanced Usage
|
|
405
403
|
|
|
406
|
-
### React Context Providers
|
|
407
|
-
|
|
408
|
-
For sharing configuration across React server components via context, import from the `/react` subpath:
|
|
409
|
-
|
|
410
|
-
```typescript
|
|
411
|
-
// app/layout.tsx
|
|
412
|
-
import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
413
|
-
import { ConfigProvider } from '@dyanet/nextjs-config-aws/react';
|
|
414
|
-
import { z } from 'zod';
|
|
415
|
-
|
|
416
|
-
const schema = z.object({
|
|
417
|
-
DATABASE_URL: z.string(),
|
|
418
|
-
API_KEY: z.string(),
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
export default async function RootLayout({ children }) {
|
|
422
|
-
const config = await getConfig({ schema });
|
|
423
|
-
|
|
424
|
-
return (
|
|
425
|
-
<html>
|
|
426
|
-
<body>
|
|
427
|
-
<ConfigProvider config={config}>
|
|
428
|
-
{children}
|
|
429
|
-
</ConfigProvider>
|
|
430
|
-
</body>
|
|
431
|
-
</html>
|
|
432
|
-
);
|
|
433
|
-
}
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
```typescript
|
|
437
|
-
// app/components/my-component.tsx
|
|
438
|
-
import { useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
439
|
-
|
|
440
|
-
export function MyComponent() {
|
|
441
|
-
const config = useConfig();
|
|
442
|
-
return <div>API Key: {config.API_KEY}</div>;
|
|
443
|
-
}
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
For typed configuration, use `createConfigProvider`:
|
|
447
|
-
|
|
448
|
-
```typescript
|
|
449
|
-
import { createConfigProvider } from '@dyanet/nextjs-config-aws/react';
|
|
450
|
-
|
|
451
|
-
type AppConfig = { DATABASE_URL: string; API_KEY: string };
|
|
452
|
-
|
|
453
|
-
const { ConfigProvider, useConfig } = createConfigProvider<AppConfig>();
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
> **Why a separate import?** The React context providers use `React.createContext()` which requires React to be available. By separating them into `/react`, the main package exports work in all server contexts including API routes and middleware where React isn't loaded.
|
|
457
|
-
|
|
458
|
-
### Custom Loaders
|
|
459
|
-
|
|
460
404
|
For advanced use cases such as custom loaders, direct AWS SDK integration, or fine-grained control over configuration loading, import from `@dyanet/config-aws` directly:
|
|
461
405
|
|
|
462
406
|
```typescript
|
package/dist/cjs/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
|
-
* // Server-side configuration loading
|
|
11
|
+
* // Server-side configuration loading
|
|
12
12
|
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
13
13
|
*
|
|
14
14
|
* const config = await getConfig({
|
|
@@ -31,14 +31,6 @@
|
|
|
31
31
|
* const apiUrl = env('API_URL');
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* // React context providers (for server components only)
|
|
37
|
-
* // Import from '@dyanet/nextjs-config-aws/react' to avoid loading React
|
|
38
|
-
* // in non-React contexts like API routes
|
|
39
|
-
* import { ConfigProvider, useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
34
|
* @remarks
|
|
43
35
|
* For advanced loader access, custom loaders, or direct AWS SDK integration,
|
|
44
36
|
* import from `@dyanet/config-aws` directly:
|
|
@@ -60,7 +52,7 @@ exports.env = exports.PublicEnvScript = exports.getConfig = exports.ValidationEr
|
|
|
60
52
|
var config_aws_1 = require("@dyanet/config-aws");
|
|
61
53
|
Object.defineProperty(exports, "ConfigurationError", { enumerable: true, get: function () { return config_aws_1.ConfigurationError; } });
|
|
62
54
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return config_aws_1.ValidationError; } });
|
|
63
|
-
// Server-side configuration loading
|
|
55
|
+
// Server-side configuration loading
|
|
64
56
|
var server_1 = require("./server");
|
|
65
57
|
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return server_1.getConfig; } });
|
|
66
58
|
// Component for runtime environment variables
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AAEH,mCAAmC;AACnC,iDAAyE;AAAhE,gHAAA,kBAAkB,OAAA;AAAE,6GAAA,eAAe,OAAA;AAE5C,oCAAoC;AACpC,mCAA6D;AAApD,mGAAA,SAAS,OAAA;AAElB,8CAA8C;AAC9C,2CAA0E;AAAjE,6GAAA,eAAe,OAAA;AAExB,0CAA0C;AAC1C,mCAA+B;AAAtB,6FAAA,GAAG,OAAA"}
|
package/dist/cjs/server/index.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Server-side exports for Next.js configuration management.
|
|
4
|
-
*
|
|
5
|
-
* This module exports React-free configuration utilities that work in all
|
|
6
|
-
* server contexts including API routes, middleware, and server components.
|
|
7
|
-
*
|
|
8
|
-
* For React context providers (ConfigProvider, useConfig), import from
|
|
9
|
-
* '@dyanet/nextjs-config-aws/react' instead.
|
|
10
4
|
*/
|
|
11
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.invalidateConfig = exports.getConfigCacheSize = exports.clearConfigCache = exports.getConfig = void 0;
|
|
6
|
+
exports.ConfigContext = exports.useConfig = exports.ConfigProvider = exports.createConfigProvider = exports.invalidateConfig = exports.getConfigCacheSize = exports.clearConfigCache = exports.getConfig = void 0;
|
|
13
7
|
var get_config_1 = require("./get-config");
|
|
14
8
|
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return get_config_1.getConfig; } });
|
|
15
9
|
Object.defineProperty(exports, "clearConfigCache", { enumerable: true, get: function () { return get_config_1.clearConfigCache; } });
|
|
16
10
|
Object.defineProperty(exports, "getConfigCacheSize", { enumerable: true, get: function () { return get_config_1.getConfigCacheSize; } });
|
|
17
11
|
Object.defineProperty(exports, "invalidateConfig", { enumerable: true, get: function () { return get_config_1.invalidateConfig; } });
|
|
12
|
+
var config_provider_1 = require("./config-provider");
|
|
13
|
+
Object.defineProperty(exports, "createConfigProvider", { enumerable: true, get: function () { return config_provider_1.createConfigProvider; } });
|
|
14
|
+
Object.defineProperty(exports, "ConfigProvider", { enumerable: true, get: function () { return config_provider_1.ConfigProvider; } });
|
|
15
|
+
Object.defineProperty(exports, "useConfig", { enumerable: true, get: function () { return config_provider_1.useConfig; } });
|
|
16
|
+
Object.defineProperty(exports, "ConfigContext", { enumerable: true, get: function () { return config_provider_1.ConfigContext; } });
|
|
18
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2CAMsB;AALpB,uGAAA,SAAS,OAAA;AACT,8GAAA,gBAAgB,OAAA;AAChB,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAIlB,qDAK2B;AAJzB,uHAAA,oBAAoB,OAAA;AACpB,iHAAA,cAAc,OAAA;AACd,4GAAA,SAAS,OAAA;AACT,gHAAA,aAAa,OAAA"}
|
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
* // Server-side configuration loading
|
|
10
|
+
* // Server-side configuration loading
|
|
11
11
|
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
12
12
|
*
|
|
13
13
|
* const config = await getConfig({
|
|
@@ -30,14 +30,6 @@
|
|
|
30
30
|
* const apiUrl = env('API_URL');
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* // React context providers (for server components only)
|
|
36
|
-
* // Import from '@dyanet/nextjs-config-aws/react' to avoid loading React
|
|
37
|
-
* // in non-React contexts like API routes
|
|
38
|
-
* import { ConfigProvider, useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
33
|
* @remarks
|
|
42
34
|
* For advanced loader access, custom loaders, or direct AWS SDK integration,
|
|
43
35
|
* import from `@dyanet/config-aws` directly:
|
|
@@ -55,7 +47,7 @@
|
|
|
55
47
|
*/
|
|
56
48
|
// Error classes for error handling
|
|
57
49
|
export { ConfigurationError, ValidationError } from '@dyanet/config-aws';
|
|
58
|
-
// Server-side configuration loading
|
|
50
|
+
// Server-side configuration loading
|
|
59
51
|
export { getConfig } from './server';
|
|
60
52
|
// Component for runtime environment variables
|
|
61
53
|
export { PublicEnvScript } from './components';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,mCAAmC;AACnC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEzE,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAA0B,MAAM,UAAU,CAAC;AAE7D,8CAA8C;AAC9C,OAAO,EAAE,eAAe,EAA6B,MAAM,cAAc,CAAC;AAE1E,0CAA0C;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-side exports for Next.js configuration management.
|
|
3
|
-
*
|
|
4
|
-
* This module exports React-free configuration utilities that work in all
|
|
5
|
-
* server contexts including API routes, middleware, and server components.
|
|
6
|
-
*
|
|
7
|
-
* For React context providers (ConfigProvider, useConfig), import from
|
|
8
|
-
* '@dyanet/nextjs-config-aws/react' instead.
|
|
9
3
|
*/
|
|
10
4
|
export { getConfig, clearConfigCache, getConfigCacheSize, invalidateConfig, } from './get-config';
|
|
5
|
+
export { createConfigProvider, ConfigProvider, useConfig, ConfigContext, } from './config-provider';
|
|
11
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,GACd,MAAM,mBAAmB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
* // Server-side configuration loading
|
|
10
|
+
* // Server-side configuration loading
|
|
11
11
|
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
12
12
|
*
|
|
13
13
|
* const config = await getConfig({
|
|
@@ -30,14 +30,6 @@
|
|
|
30
30
|
* const apiUrl = env('API_URL');
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* // React context providers (for server components only)
|
|
36
|
-
* // Import from '@dyanet/nextjs-config-aws/react' to avoid loading React
|
|
37
|
-
* // in non-React contexts like API routes
|
|
38
|
-
* import { ConfigProvider, useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
33
|
* @remarks
|
|
42
34
|
* For advanced loader access, custom loaders, or direct AWS SDK integration,
|
|
43
35
|
* import from `@dyanet/config-aws` directly:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-side exports for Next.js configuration management.
|
|
3
|
-
*
|
|
4
|
-
* This module exports React-free configuration utilities that work in all
|
|
5
|
-
* server contexts including API routes, middleware, and server components.
|
|
6
|
-
*
|
|
7
|
-
* For React context providers (ConfigProvider, useConfig), import from
|
|
8
|
-
* '@dyanet/nextjs-config-aws/react' instead.
|
|
9
3
|
*/
|
|
10
4
|
export { getConfig, clearConfigCache, getConfigCacheSize, invalidateConfig, type NextConfigOptions, } from './get-config';
|
|
5
|
+
export { createConfigProvider, ConfigProvider, useConfig, ConfigContext, } from './config-provider';
|
|
11
6
|
export type { AwsOptions } from './internal/loader-factory';
|
|
12
7
|
export type { EnvironmentMode } from './internal/environment';
|
|
13
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,GACd,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyanet/nextjs-config-aws",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Next.js adapter for AWS configuration management with support for server components, runtime environment variables, and AWS services integration",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
"import": "./dist/esm/index.js",
|
|
11
11
|
"require": "./dist/cjs/index.js",
|
|
12
12
|
"types": "./dist/types/index.d.ts"
|
|
13
|
-
},
|
|
14
|
-
"./react": {
|
|
15
|
-
"import": "./dist/esm/react.js",
|
|
16
|
-
"require": "./dist/cjs/react.js",
|
|
17
|
-
"types": "./dist/types/react.d.ts"
|
|
18
13
|
}
|
|
19
14
|
},
|
|
20
15
|
"files": [
|
|
@@ -25,7 +20,7 @@
|
|
|
25
20
|
"scripts": {
|
|
26
21
|
"build": "npm run clean && npm run build:types && npm run build:esm && npm run build:cjs",
|
|
27
22
|
"build:types": "tsc --project tsconfig.types.json",
|
|
28
|
-
"build:esm": "tsc --project tsconfig.esm.json",
|
|
23
|
+
"build:esm": "tsc --project tsconfig.esm.json && echo {\"type\":\"module\"} > dist/esm/package.json",
|
|
29
24
|
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
30
25
|
"clean": "rimraf dist",
|
|
31
26
|
"test": "jest",
|
|
@@ -69,9 +64,9 @@
|
|
|
69
64
|
"react": "^19.0.0"
|
|
70
65
|
},
|
|
71
66
|
"devDependencies": {
|
|
67
|
+
"@aws-sdk/client-s3": "^3.0.0",
|
|
72
68
|
"@aws-sdk/client-secrets-manager": "^3.0.0",
|
|
73
69
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
74
|
-
"@aws-sdk/client-s3": "^3.0.0",
|
|
75
70
|
"@types/jest": "^29.5.0",
|
|
76
71
|
"@types/node": "^20.0.0",
|
|
77
72
|
"@types/react": "^19.0.0",
|
package/dist/cjs/react.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* React-specific exports for Next.js configuration management.
|
|
4
|
-
*
|
|
5
|
-
* This module provides React context providers and hooks for accessing
|
|
6
|
-
* configuration in React server components. These exports require React
|
|
7
|
-
* to be available in the runtime environment.
|
|
8
|
-
*
|
|
9
|
-
* For React-free configuration loading (API routes, middleware), use the
|
|
10
|
-
* main package exports instead:
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // API routes, middleware (React-free)
|
|
15
|
-
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
16
|
-
*
|
|
17
|
-
* // React server components (React context)
|
|
18
|
-
* import { ConfigProvider, useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* // In layout.tsx (Server Component)
|
|
24
|
-
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
25
|
-
* import { ConfigProvider } from '@dyanet/nextjs-config-aws/react';
|
|
26
|
-
*
|
|
27
|
-
* export default async function RootLayout({ children }) {
|
|
28
|
-
* const config = await getConfig({ schema });
|
|
29
|
-
* return (
|
|
30
|
-
* <html>
|
|
31
|
-
* <body>
|
|
32
|
-
* <ConfigProvider config={config}>
|
|
33
|
-
* {children}
|
|
34
|
-
* </ConfigProvider>
|
|
35
|
-
* </body>
|
|
36
|
-
* </html>
|
|
37
|
-
* );
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @packageDocumentation
|
|
42
|
-
*/
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.ConfigContext = exports.useConfig = exports.ConfigProvider = exports.createConfigProvider = void 0;
|
|
45
|
-
var config_provider_1 = require("./server/config-provider");
|
|
46
|
-
Object.defineProperty(exports, "createConfigProvider", { enumerable: true, get: function () { return config_provider_1.createConfigProvider; } });
|
|
47
|
-
Object.defineProperty(exports, "ConfigProvider", { enumerable: true, get: function () { return config_provider_1.ConfigProvider; } });
|
|
48
|
-
Object.defineProperty(exports, "useConfig", { enumerable: true, get: function () { return config_provider_1.useConfig; } });
|
|
49
|
-
Object.defineProperty(exports, "ConfigContext", { enumerable: true, get: function () { return config_provider_1.ConfigContext; } });
|
|
50
|
-
//# sourceMappingURL=react.js.map
|
package/dist/cjs/react.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/react.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;;;AAEH,4DAKkC;AAJhC,uHAAA,oBAAoB,OAAA;AACpB,iHAAA,cAAc,OAAA;AACd,4GAAA,SAAS,OAAA;AACT,gHAAA,aAAa,OAAA"}
|
package/dist/esm/react.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React-specific exports for Next.js configuration management.
|
|
3
|
-
*
|
|
4
|
-
* This module provides React context providers and hooks for accessing
|
|
5
|
-
* configuration in React server components. These exports require React
|
|
6
|
-
* to be available in the runtime environment.
|
|
7
|
-
*
|
|
8
|
-
* For React-free configuration loading (API routes, middleware), use the
|
|
9
|
-
* main package exports instead:
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* // API routes, middleware (React-free)
|
|
14
|
-
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
15
|
-
*
|
|
16
|
-
* // React server components (React context)
|
|
17
|
-
* import { ConfigProvider, useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* // In layout.tsx (Server Component)
|
|
23
|
-
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
24
|
-
* import { ConfigProvider } from '@dyanet/nextjs-config-aws/react';
|
|
25
|
-
*
|
|
26
|
-
* export default async function RootLayout({ children }) {
|
|
27
|
-
* const config = await getConfig({ schema });
|
|
28
|
-
* return (
|
|
29
|
-
* <html>
|
|
30
|
-
* <body>
|
|
31
|
-
* <ConfigProvider config={config}>
|
|
32
|
-
* {children}
|
|
33
|
-
* </ConfigProvider>
|
|
34
|
-
* </body>
|
|
35
|
-
* </html>
|
|
36
|
-
* );
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @packageDocumentation
|
|
41
|
-
*/
|
|
42
|
-
export { createConfigProvider, ConfigProvider, useConfig, ConfigContext, } from './server/config-provider';
|
|
43
|
-
//# sourceMappingURL=react.js.map
|
package/dist/esm/react.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,GACd,MAAM,0BAA0B,CAAC"}
|
package/dist/types/react.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React-specific exports for Next.js configuration management.
|
|
3
|
-
*
|
|
4
|
-
* This module provides React context providers and hooks for accessing
|
|
5
|
-
* configuration in React server components. These exports require React
|
|
6
|
-
* to be available in the runtime environment.
|
|
7
|
-
*
|
|
8
|
-
* For React-free configuration loading (API routes, middleware), use the
|
|
9
|
-
* main package exports instead:
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* // API routes, middleware (React-free)
|
|
14
|
-
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
15
|
-
*
|
|
16
|
-
* // React server components (React context)
|
|
17
|
-
* import { ConfigProvider, useConfig } from '@dyanet/nextjs-config-aws/react';
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* // In layout.tsx (Server Component)
|
|
23
|
-
* import { getConfig } from '@dyanet/nextjs-config-aws';
|
|
24
|
-
* import { ConfigProvider } from '@dyanet/nextjs-config-aws/react';
|
|
25
|
-
*
|
|
26
|
-
* export default async function RootLayout({ children }) {
|
|
27
|
-
* const config = await getConfig({ schema });
|
|
28
|
-
* return (
|
|
29
|
-
* <html>
|
|
30
|
-
* <body>
|
|
31
|
-
* <ConfigProvider config={config}>
|
|
32
|
-
* {children}
|
|
33
|
-
* </ConfigProvider>
|
|
34
|
-
* </body>
|
|
35
|
-
* </html>
|
|
36
|
-
* );
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @packageDocumentation
|
|
41
|
-
*/
|
|
42
|
-
export { createConfigProvider, ConfigProvider, useConfig, ConfigContext, } from './server/config-provider';
|
|
43
|
-
//# sourceMappingURL=react.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,GACd,MAAM,0BAA0B,CAAC"}
|