@dyanet/nextjs-config-aws 1.1.0 → 1.1.2
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 +21 -0
- package/README.md +3 -56
- package/dist/cjs/index.js +2 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/server/index.js +6 -7
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/index.js +5 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +3 -0
- package/dist/esm/server/get-config.js +2 -2
- package/dist/esm/server/index.js +2 -7
- package/dist/esm/server/index.js.map +1 -1
- package/dist/esm/server/internal/index.js +2 -2
- 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 +6 -10
- 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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dyanet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -28,6 +28,9 @@ npm install @dyanet/nextjs-config-aws
|
|
|
28
28
|
npm install next react
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
Supports **Next.js `>=14`** and **React `>=18`** (App Router). Developed and tested against
|
|
32
|
+
the latest Next.js and React.
|
|
33
|
+
|
|
31
34
|
For AWS services, install the SDK clients you need:
|
|
32
35
|
|
|
33
36
|
```bash
|
|
@@ -324,8 +327,6 @@ export async function GET() {
|
|
|
324
327
|
}
|
|
325
328
|
```
|
|
326
329
|
|
|
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
330
|
### Server Action
|
|
330
331
|
|
|
331
332
|
```typescript
|
|
@@ -403,60 +404,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|
|
403
404
|
|
|
404
405
|
## Advanced Usage
|
|
405
406
|
|
|
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
407
|
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
408
|
|
|
462
409
|
```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/client/index.js
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* These utilities are designed for use in client components ('use client')
|
|
5
5
|
* to access runtime environment variables injected by PublicEnvScript.
|
|
6
6
|
*/
|
|
7
|
-
export { env, envFrom, getAllEnv, hasEnv } from './env';
|
|
7
|
+
export { env, envFrom, getAllEnv, hasEnv } from './env.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Client-side components for Next.js configuration management.
|
|
3
3
|
*/
|
|
4
|
-
export { PublicEnvScript, filterEnvVars, generateScriptContent, } from './public-env-script';
|
|
4
|
+
export { PublicEnvScript, filterEnvVars, generateScriptContent, } from './public-env-script.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
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,10 +47,10 @@
|
|
|
55
47
|
*/
|
|
56
48
|
// Error classes for error handling
|
|
57
49
|
export { ConfigurationError, ValidationError } from '@dyanet/config-aws';
|
|
58
|
-
// Server-side configuration loading
|
|
59
|
-
export { getConfig } from './server';
|
|
50
|
+
// Server-side configuration loading
|
|
51
|
+
export { getConfig } from './server/index.js';
|
|
60
52
|
// Component for runtime environment variables
|
|
61
|
-
export { PublicEnvScript } from './components';
|
|
53
|
+
export { PublicEnvScript } from './components/index.js';
|
|
62
54
|
// Client-side environment variable access
|
|
63
|
-
export { env } from './client';
|
|
55
|
+
export { env } from './client/index.js';
|
|
64
56
|
//# sourceMappingURL=index.js.map
|
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"}
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
import { ConfigManager, } from '@dyanet/config-aws';
|
|
31
|
-
import { detectEnvironment } from './internal/environment';
|
|
32
|
-
import { createLoaders } from './internal/loader-factory';
|
|
31
|
+
import { detectEnvironment } from './internal/environment.js';
|
|
32
|
+
import { createLoaders } from './internal/loader-factory.js';
|
|
33
33
|
/**
|
|
34
34
|
* Cache storage for configuration
|
|
35
35
|
* Uses a Map to support multiple cache keys (for different option combinations)
|
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
|
-
export { getConfig, clearConfigCache, getConfigCacheSize, invalidateConfig, } from './get-config';
|
|
4
|
+
export { getConfig, clearConfigCache, getConfigCacheSize, invalidateConfig, } from './get-config.js';
|
|
5
|
+
export { createConfigProvider, ConfigProvider, useConfig, ConfigContext, } from './config-provider.js';
|
|
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"}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* These are not exported from the public API.
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export { detectEnvironment } from './environment';
|
|
7
|
-
export { createLoaders } from './loader-factory';
|
|
6
|
+
export { detectEnvironment } from './environment.js';
|
|
7
|
+
export { createLoaders } from './loader-factory.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
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.2",
|
|
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": [
|
|
@@ -23,10 +18,11 @@
|
|
|
23
18
|
"LICENSE"
|
|
24
19
|
],
|
|
25
20
|
"scripts": {
|
|
26
|
-
"build": "npm run clean && npm run build:types && npm run build:esm && npm run build:cjs",
|
|
21
|
+
"build": "npm run clean && npm run build:types && npm run build:esm && npm run build:cjs && npm run build:postbuild",
|
|
27
22
|
"build:types": "tsc --project tsconfig.types.json",
|
|
28
23
|
"build:esm": "tsc --project tsconfig.esm.json",
|
|
29
24
|
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
25
|
+
"build:postbuild": "node ../../scripts/postbuild.mjs ./dist",
|
|
30
26
|
"clean": "rimraf dist",
|
|
31
27
|
"test": "jest",
|
|
32
28
|
"test:watch": "jest --watch",
|
|
@@ -65,13 +61,13 @@
|
|
|
65
61
|
"@dyanet/config-aws": "^1.0.0"
|
|
66
62
|
},
|
|
67
63
|
"peerDependencies": {
|
|
68
|
-
"next": "
|
|
69
|
-
"react": "
|
|
64
|
+
"next": ">=14.0.0",
|
|
65
|
+
"react": ">=18.0.0"
|
|
70
66
|
},
|
|
71
67
|
"devDependencies": {
|
|
68
|
+
"@aws-sdk/client-s3": "^3.0.0",
|
|
72
69
|
"@aws-sdk/client-secrets-manager": "^3.0.0",
|
|
73
70
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
74
|
-
"@aws-sdk/client-s3": "^3.0.0",
|
|
75
71
|
"@types/jest": "^29.5.0",
|
|
76
72
|
"@types/node": "^20.0.0",
|
|
77
73
|
"@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"}
|