@cedarjs/project-config 7.0.0-canary.3259 → 7.0.0-rc.123
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/dist/cjs/config.d.ts +154 -0
- package/dist/cjs/config.d.ts.map +1 -0
- package/dist/cjs/configPath.d.ts +5 -0
- package/dist/cjs/configPath.d.ts.map +1 -0
- package/dist/cjs/envVarDefinitions.d.ts +14 -0
- package/dist/cjs/envVarDefinitions.d.ts.map +1 -0
- package/dist/cjs/envVars.d.ts +32 -0
- package/dist/cjs/envVars.d.ts.map +1 -0
- package/dist/cjs/findUp.d.ts +5 -0
- package/dist/cjs/findUp.d.ts.map +1 -0
- package/dist/cjs/generatedDataDir.d.ts +10 -0
- package/dist/cjs/generatedDataDir.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +701 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/packageManager.d.ts +20 -0
- package/dist/cjs/packageManager.d.ts.map +1 -0
- package/dist/cjs/packageManager.js +349 -0
- package/dist/cjs/paths.d.ts +152 -0
- package/dist/cjs/paths.d.ts.map +1 -0
- package/dist/cjs/prisma.d.ts +63 -0
- package/dist/cjs/prisma.d.ts.map +1 -0
- package/dist/cjs/workspaces.d.ts +2 -0
- package/dist/cjs/workspaces.d.ts.map +1 -0
- package/dist/cjs/workspaces.js +376 -0
- package/dist/config.d.ts +3 -47
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +30 -30
- package/dist/package.json +1 -0
- package/dist/packageManager.js +1 -2
- package/dist/paths.d.ts +3 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/workspaces.js +1 -2
- package/package.json +28 -10
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as toml from 'smol-toml';
|
|
2
|
+
export declare enum TargetEnum {
|
|
3
|
+
NODE = "node",
|
|
4
|
+
BROWSER = "browser",
|
|
5
|
+
REACT_NATIVE = "react-native",
|
|
6
|
+
ELECTRON = "electron"
|
|
7
|
+
}
|
|
8
|
+
export interface NodeTargetConfig {
|
|
9
|
+
title: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
host?: string;
|
|
12
|
+
port: number;
|
|
13
|
+
path: string;
|
|
14
|
+
target: TargetEnum.NODE;
|
|
15
|
+
prismaConfig: string;
|
|
16
|
+
prismaGenerateArgs: string[];
|
|
17
|
+
serverConfig: string;
|
|
18
|
+
debugPort?: number | boolean;
|
|
19
|
+
}
|
|
20
|
+
interface BrowserTargetConfig {
|
|
21
|
+
title: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
host?: string;
|
|
24
|
+
port: number;
|
|
25
|
+
path: string;
|
|
26
|
+
target: TargetEnum.BROWSER;
|
|
27
|
+
includeEnvironmentVariables: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Specify the URL to your api-server.
|
|
30
|
+
* This can be an absolute path proxied on the current domain (`/.netlify/functions`),
|
|
31
|
+
* or a fully qualified URL (`https://api.example.org:8911/functions`).
|
|
32
|
+
*
|
|
33
|
+
* Note: This should not include the path to the GraphQL Server.
|
|
34
|
+
**/
|
|
35
|
+
apiUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional: FQDN or absolute path to the GraphQL serverless function, without the trailing slash.
|
|
38
|
+
* This will override the apiUrl configuration just for the graphql function
|
|
39
|
+
* Example: `./redwood/functions/graphql` or `https://api.redwoodjs.com/graphql`
|
|
40
|
+
*/
|
|
41
|
+
apiGraphQLUrl?: string;
|
|
42
|
+
fastRefresh: boolean;
|
|
43
|
+
a11y: boolean;
|
|
44
|
+
sourceMap: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface GraphiQLStudioConfig {
|
|
47
|
+
endpoint?: string;
|
|
48
|
+
authImpersonation?: AuthImpersonationConfig;
|
|
49
|
+
}
|
|
50
|
+
type SupportedAuthImpersonationProviders = 'dbAuth' | 'netlify' | 'supabase';
|
|
51
|
+
interface AuthImpersonationConfig {
|
|
52
|
+
authProvider?: SupportedAuthImpersonationProviders;
|
|
53
|
+
jwtSecret?: string;
|
|
54
|
+
userId?: string;
|
|
55
|
+
email?: string;
|
|
56
|
+
roles?: string[];
|
|
57
|
+
}
|
|
58
|
+
interface StudioConfig {
|
|
59
|
+
basePort: number;
|
|
60
|
+
graphiql?: GraphiQLStudioConfig;
|
|
61
|
+
}
|
|
62
|
+
export interface Config {
|
|
63
|
+
web: BrowserTargetConfig;
|
|
64
|
+
api: NodeTargetConfig;
|
|
65
|
+
browser: {
|
|
66
|
+
open: boolean | string;
|
|
67
|
+
};
|
|
68
|
+
generate: {
|
|
69
|
+
tests: boolean;
|
|
70
|
+
stories: boolean;
|
|
71
|
+
nestScaffoldByModel: boolean;
|
|
72
|
+
};
|
|
73
|
+
graphql: {
|
|
74
|
+
fragments: boolean;
|
|
75
|
+
trustedDocuments: boolean;
|
|
76
|
+
includeScalars: {
|
|
77
|
+
File: boolean;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
notifications: {
|
|
81
|
+
versionUpdates: string[];
|
|
82
|
+
};
|
|
83
|
+
studio: StudioConfig;
|
|
84
|
+
test: {
|
|
85
|
+
/**
|
|
86
|
+
* When true, `cedar test api` automatically supplies Prisma's
|
|
87
|
+
* `PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION` env var for the
|
|
88
|
+
* destructive test-database reset, instead of requiring a human to set
|
|
89
|
+
* it, whenever the reset target has already passed Cedar's own
|
|
90
|
+
* test-database identity guard (a check that the resolved test database
|
|
91
|
+
* isn't the same database as `DATABASE_URL`). Opt-in and off by
|
|
92
|
+
* default: this only shortcuts Prisma's AI-agent consent prompt, not
|
|
93
|
+
* Cedar's guard against resetting the wrong database.
|
|
94
|
+
*/
|
|
95
|
+
autoConsentToDbReset: boolean;
|
|
96
|
+
};
|
|
97
|
+
experimental: {
|
|
98
|
+
opentelemetry: {
|
|
99
|
+
enabled: boolean;
|
|
100
|
+
wrapApi: boolean;
|
|
101
|
+
apiSdk?: string;
|
|
102
|
+
};
|
|
103
|
+
cli: {
|
|
104
|
+
autoInstall: boolean;
|
|
105
|
+
plugins: CLIPlugin[];
|
|
106
|
+
};
|
|
107
|
+
useSDLCodeGenForGraphQLTypes: boolean;
|
|
108
|
+
streamingSsr: {
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
};
|
|
111
|
+
rsc: {
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
};
|
|
114
|
+
realtime: {
|
|
115
|
+
enabled: boolean;
|
|
116
|
+
};
|
|
117
|
+
reactCompiler: {
|
|
118
|
+
enabled: boolean;
|
|
119
|
+
lintOnly: boolean;
|
|
120
|
+
};
|
|
121
|
+
packagesWorkspace: {
|
|
122
|
+
enabled: boolean;
|
|
123
|
+
};
|
|
124
|
+
gqlorm: {
|
|
125
|
+
enabled: boolean;
|
|
126
|
+
organizationModel?: string;
|
|
127
|
+
membershipModel?: string;
|
|
128
|
+
membershipUserField?: string;
|
|
129
|
+
membershipOrganizationField?: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export interface CLIPlugin {
|
|
134
|
+
package: string;
|
|
135
|
+
enabled?: boolean;
|
|
136
|
+
}
|
|
137
|
+
export declare const DEFAULT_CONFIG: Config;
|
|
138
|
+
/**
|
|
139
|
+
* These configuration options are modified by the user via the Cedar config
|
|
140
|
+
* file.
|
|
141
|
+
*
|
|
142
|
+
* @param configPath Path to the config file. Defaults to automatically finding
|
|
143
|
+
* the project config file (cedar.toml or redwood.toml)
|
|
144
|
+
*/
|
|
145
|
+
export declare function getConfig(configPath?: string): Config;
|
|
146
|
+
/**
|
|
147
|
+
* Returns a JSON representation of the config file without any default values.
|
|
148
|
+
*
|
|
149
|
+
* @param configPath Path to the config file. Defaults to automatically finding
|
|
150
|
+
* the project config file (cedar.toml or redwood.toml)
|
|
151
|
+
*/
|
|
152
|
+
export declare function getRawConfig(configPath?: string): toml.TomlTable;
|
|
153
|
+
export {};
|
|
154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AAY,EAAE;YACZ,OAAO,EAAE,OAAO,CAAA;SACjB,CAAA;QACD,GAAG,EAAE;YACH,OAAO,EAAE,OAAO,CAAA;SACjB,CAAA;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,OAAO,CAAA;SACjB,CAAA;QACD,aAAa,EAAE;YACb,OAAO,EAAE,OAAO,CAAA;YAChB,QAAQ,EAAE,OAAO,CAAA;SAClB,CAAA;QACD,iBAAiB,EAAE;YACjB,OAAO,EAAE,OAAO,CAAA;SACjB,CAAA;QACD,MAAM,EAAE;YACN,OAAO,EAAE,OAAO,CAAA;YAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;YAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;YACxB,mBAAmB,CAAC,EAAE,MAAM,CAAA;YAC5B,2BAA2B,CAAC,EAAE,MAAM,CAAA;SACrC,CAAA;KACF,CAAA;CACF;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,cAAc,EAAE,MA6F5B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,SAAkB,kBAMxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configPath.d.ts","sourceRoot":"","sources":["../../src/configPath.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,MAAK,MAAuE,KAC3E,MAmBF,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function getEnvVarDefinitions(): {
|
|
2
|
+
RWJS_ENV: {
|
|
3
|
+
RWJS_API_GRAPHQL_URL: string;
|
|
4
|
+
RWJS_API_URL: string;
|
|
5
|
+
__REDWOOD__APP_TITLE: string;
|
|
6
|
+
RWJS_EXP_STREAMING_SSR: boolean;
|
|
7
|
+
RWJS_EXP_RSC: boolean;
|
|
8
|
+
};
|
|
9
|
+
RWJS_DEBUG_ENV: {
|
|
10
|
+
RWJS_SRC_ROOT: string;
|
|
11
|
+
REDWOOD_ENV_EDITOR: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=envVarDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envVarDefinitions.d.ts","sourceRoot":"","sources":["../../src/envVarDefinitions.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB;;;;;;;;;;;;EA0CnC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface ReadEnvVarOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The pre-fork `REDWOOD_`-prefixed name for this env var. Still read, so
|
|
4
|
+
* projects don't break on upgrade, but the `CEDAR_`-prefixed name wins.
|
|
5
|
+
*/
|
|
6
|
+
deprecatedAlias: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Read an env var that was renamed when Cedar forked from Redwood.
|
|
10
|
+
*
|
|
11
|
+
* The `CEDAR_`-prefixed name wins. The `REDWOOD_`-prefixed one keeps working
|
|
12
|
+
* so existing projects don't break on upgrade.
|
|
13
|
+
*
|
|
14
|
+
* Empty strings are treated as unset, matching how a `.env` file with a blank
|
|
15
|
+
* value behaves.
|
|
16
|
+
*/
|
|
17
|
+
export declare function readEnvVar(name: string, { deprecatedAlias }: ReadEnvVarOptions): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Parse a port from an env var, rejecting anything that isn't a usable port.
|
|
20
|
+
*
|
|
21
|
+
* `parseInt` alone is not enough here: it stops at the first non-digit, so
|
|
22
|
+
* `"8080abc"` would become `8080` and `"1.5"` would become `1`. Silently
|
|
23
|
+
* binding a port the user didn't ask for is how a deployment ends up
|
|
24
|
+
* unreachable, so the whole value has to look like an integer.
|
|
25
|
+
*
|
|
26
|
+
* Out-of-range values are rejected here too, so a bad env var is reported as
|
|
27
|
+
* a bad env var rather than surfacing later as a `ERR_SOCKET_BAD_PORT` from
|
|
28
|
+
* `listen()`. Port 0 is allowed — it means "pick a free port".
|
|
29
|
+
*/
|
|
30
|
+
export declare function parsePort(value: string, envVarName: string): number;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=envVars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envVars.d.ts","sourceRoot":"","sources":["../../src/envVars.ts"],"names":[],"mappings":"AAAA,UAAU,iBAAiB;IACzB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,EAAE,eAAe,EAAE,EAAE,iBAAiB,GACrC,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAkBnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findUp.d.ts","sourceRoot":"","sources":["../../src/findUp.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,iBAAiB,GAAE,MAAsB,GACxC,MAAM,GAAG,IAAI,CAef"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on the location of the project config file (e.g. cedar.toml), it checks
|
|
3
|
+
* for the existence of `.cedar/` or `.redwood/` directories. If either is found,
|
|
4
|
+
* it returns the path to that directory.
|
|
5
|
+
*
|
|
6
|
+
* If neither directory exists yet it default to `.cedar/` in the resolved
|
|
7
|
+
* project root.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getGeneratedDataDirPath(cwd?: string): string;
|
|
10
|
+
//# sourceMappingURL=generatedDataDir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generatedDataDir.d.ts","sourceRoot":"","sources":["../../src/generatedDataDir.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,MAAuE,UAc7E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './config.js';
|
|
2
|
+
export * from './configPath.js';
|
|
3
|
+
export * from './envVars.js';
|
|
4
|
+
export * from './generatedDataDir.js';
|
|
5
|
+
export * from './paths.js';
|
|
6
|
+
export * from './findUp.js';
|
|
7
|
+
export * from './prisma.js';
|
|
8
|
+
export { getEnvVarDefinitions } from './envVarDefinitions.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA"}
|