@constructive-io/graphql-env 2.8.12 → 2.8.14
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/env.d.ts +4 -1
- package/env.js +5 -2
- package/esm/env.d.ts +4 -1
- package/esm/env.js +5 -2
- package/esm/merge.d.ts +6 -2
- package/esm/merge.js +7 -3
- package/merge.d.ts +6 -2
- package/merge.js +7 -3
- package/package.json +5 -5
package/env.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { ConstructiveOptions } from '@constructive-io/graphql-types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
4
|
+
*/
|
|
5
|
+
export declare const getGraphQLEnvVars: (env?: NodeJS.ProcessEnv) => Partial<ConstructiveOptions>;
|
package/env.js
CHANGED
|
@@ -10,8 +10,11 @@ const parseEnvBoolean = (val) => {
|
|
|
10
10
|
return undefined;
|
|
11
11
|
return ['true', '1', 'yes'].includes(val.toLowerCase());
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
15
|
+
*/
|
|
16
|
+
const getGraphQLEnvVars = (env = process.env) => {
|
|
17
|
+
const { GRAPHILE_SCHEMA, FEATURES_SIMPLE_INFLECTION, FEATURES_OPPOSITE_BASE_NAMES, FEATURES_POSTGIS, API_ENABLE_META, API_IS_PUBLIC, API_EXPOSED_SCHEMAS, API_META_SCHEMAS, API_ANON_ROLE, API_ROLE_NAME, API_DEFAULT_DATABASE_ID, } = env;
|
|
15
18
|
return {
|
|
16
19
|
graphile: {
|
|
17
20
|
...(GRAPHILE_SCHEMA && {
|
package/esm/env.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { ConstructiveOptions } from '@constructive-io/graphql-types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
4
|
+
*/
|
|
5
|
+
export declare const getGraphQLEnvVars: (env?: NodeJS.ProcessEnv) => Partial<ConstructiveOptions>;
|
package/esm/env.js
CHANGED
|
@@ -7,8 +7,11 @@ const parseEnvBoolean = (val) => {
|
|
|
7
7
|
return undefined;
|
|
8
8
|
return ['true', '1', 'yes'].includes(val.toLowerCase());
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
12
|
+
*/
|
|
13
|
+
export const getGraphQLEnvVars = (env = process.env) => {
|
|
14
|
+
const { GRAPHILE_SCHEMA, FEATURES_SIMPLE_INFLECTION, FEATURES_OPPOSITE_BASE_NAMES, FEATURES_POSTGIS, API_ENABLE_META, API_IS_PUBLIC, API_EXPOSED_SCHEMAS, API_META_SCHEMAS, API_ANON_ROLE, API_ROLE_NAME, API_DEFAULT_DATABASE_ID, } = env;
|
|
12
15
|
return {
|
|
13
16
|
graphile: {
|
|
14
17
|
...(GRAPHILE_SCHEMA && {
|
package/esm/merge.d.ts
CHANGED
|
@@ -9,9 +9,13 @@ import { ConstructiveOptions } from '@constructive-io/graphql-types';
|
|
|
9
9
|
*
|
|
10
10
|
* This is the main entry point for Constructive packages that need
|
|
11
11
|
* both core PGPM options and GraphQL/Graphile options.
|
|
12
|
+
*
|
|
13
|
+
* @param overrides - Runtime overrides to apply last
|
|
14
|
+
* @param cwd - Working directory for config file resolution
|
|
15
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
12
16
|
*/
|
|
13
|
-
export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
|
|
17
|
+
export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
|
|
14
18
|
/**
|
|
15
19
|
* Alias - same as getEnvOptions
|
|
16
20
|
*/
|
|
17
|
-
export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
|
|
21
|
+
export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
|
package/esm/merge.js
CHANGED
|
@@ -12,12 +12,16 @@ import { getGraphQLEnvVars } from './env';
|
|
|
12
12
|
*
|
|
13
13
|
* This is the main entry point for Constructive packages that need
|
|
14
14
|
* both core PGPM options and GraphQL/Graphile options.
|
|
15
|
+
*
|
|
16
|
+
* @param overrides - Runtime overrides to apply last
|
|
17
|
+
* @param cwd - Working directory for config file resolution
|
|
18
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
15
19
|
*/
|
|
16
|
-
export const getEnvOptions = (overrides = {}, cwd = process.cwd()) => {
|
|
20
|
+
export const getEnvOptions = (overrides = {}, cwd = process.cwd(), env = process.env) => {
|
|
17
21
|
// Get core PGPM options (includes pgpmDefaults + config + core env vars)
|
|
18
|
-
const coreOptions = getPgpmEnvOptions({}, cwd);
|
|
22
|
+
const coreOptions = getPgpmEnvOptions({}, cwd, env);
|
|
19
23
|
// Get GraphQL-specific env vars
|
|
20
|
-
const graphqlEnvOptions = getGraphQLEnvVars();
|
|
24
|
+
const graphqlEnvOptions = getGraphQLEnvVars(env);
|
|
21
25
|
// Load config again to get any GraphQL-specific config
|
|
22
26
|
// Config files can contain Constructive options (graphile, features, api)
|
|
23
27
|
// even though loadConfigSync returns PgpmOptions type
|
package/merge.d.ts
CHANGED
|
@@ -9,9 +9,13 @@ import { ConstructiveOptions } from '@constructive-io/graphql-types';
|
|
|
9
9
|
*
|
|
10
10
|
* This is the main entry point for Constructive packages that need
|
|
11
11
|
* both core PGPM options and GraphQL/Graphile options.
|
|
12
|
+
*
|
|
13
|
+
* @param overrides - Runtime overrides to apply last
|
|
14
|
+
* @param cwd - Working directory for config file resolution
|
|
15
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
12
16
|
*/
|
|
13
|
-
export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
|
|
17
|
+
export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
|
|
14
18
|
/**
|
|
15
19
|
* Alias - same as getEnvOptions
|
|
16
20
|
*/
|
|
17
|
-
export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
|
|
21
|
+
export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
|
package/merge.js
CHANGED
|
@@ -18,12 +18,16 @@ const env_2 = require("./env");
|
|
|
18
18
|
*
|
|
19
19
|
* This is the main entry point for Constructive packages that need
|
|
20
20
|
* both core PGPM options and GraphQL/Graphile options.
|
|
21
|
+
*
|
|
22
|
+
* @param overrides - Runtime overrides to apply last
|
|
23
|
+
* @param cwd - Working directory for config file resolution
|
|
24
|
+
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
21
25
|
*/
|
|
22
|
-
const getEnvOptions = (overrides = {}, cwd = process.cwd()) => {
|
|
26
|
+
const getEnvOptions = (overrides = {}, cwd = process.cwd(), env = process.env) => {
|
|
23
27
|
// Get core PGPM options (includes pgpmDefaults + config + core env vars)
|
|
24
|
-
const coreOptions = (0, env_1.getEnvOptions)({}, cwd);
|
|
28
|
+
const coreOptions = (0, env_1.getEnvOptions)({}, cwd, env);
|
|
25
29
|
// Get GraphQL-specific env vars
|
|
26
|
-
const graphqlEnvOptions = (0, env_2.getGraphQLEnvVars)();
|
|
30
|
+
const graphqlEnvOptions = (0, env_2.getGraphQLEnvVars)(env);
|
|
27
31
|
// Load config again to get any GraphQL-specific config
|
|
28
32
|
// Config files can contain Constructive options (graphile, features, api)
|
|
29
33
|
// even though loadConfigSync returns PgpmOptions type
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-env",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.14",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive environment configuration with GraphQL/Graphile support",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@constructive-io/graphql-types": "^2.12.
|
|
33
|
-
"@pgpmjs/env": "^2.9.
|
|
32
|
+
"@constructive-io/graphql-types": "^2.12.10",
|
|
33
|
+
"@pgpmjs/env": "^2.9.2",
|
|
34
34
|
"deepmerge": "^4.3.1"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"postgraphile"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"makage": "^0.1.
|
|
45
|
+
"makage": "^0.1.10"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "f2f9c9851beff3214790dfca371e4ca7f6c1373f"
|
|
48
48
|
}
|