@cedarjs/project-config 7.0.0 → 8.0.0-canary.3263
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/config.d.ts +47 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +30 -30
- package/dist/packageManager.js +2 -1
- package/dist/paths.d.ts +0 -3
- package/dist/paths.d.ts.map +1 -1
- package/dist/workspaces.js +2 -1
- package/package.json +10 -28
- package/dist/cjs/config.d.ts +0 -154
- package/dist/cjs/config.d.ts.map +0 -1
- package/dist/cjs/configPath.d.ts +0 -5
- package/dist/cjs/configPath.d.ts.map +0 -1
- package/dist/cjs/envVarDefinitions.d.ts +0 -14
- package/dist/cjs/envVarDefinitions.d.ts.map +0 -1
- package/dist/cjs/envVars.d.ts +0 -32
- package/dist/cjs/envVars.d.ts.map +0 -1
- package/dist/cjs/findUp.d.ts +0 -5
- package/dist/cjs/findUp.d.ts.map +0 -1
- package/dist/cjs/generatedDataDir.d.ts +0 -10
- package/dist/cjs/generatedDataDir.d.ts.map +0 -1
- package/dist/cjs/index.d.ts +0 -9
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -701
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/packageManager.d.ts +0 -20
- package/dist/cjs/packageManager.d.ts.map +0 -1
- package/dist/cjs/packageManager.js +0 -349
- package/dist/cjs/paths.d.ts +0 -152
- package/dist/cjs/paths.d.ts.map +0 -1
- package/dist/cjs/prisma.d.ts +0 -63
- package/dist/cjs/prisma.d.ts.map +0 -1
- package/dist/cjs/workspaces.d.ts +0 -2
- package/dist/cjs/workspaces.d.ts.map +0 -1
- package/dist/cjs/workspaces.js +0 -376
- package/dist/package.json +0 -1
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type PackageManager = 'yarn' | 'npm' | 'pnpm';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the package manager used by the Cedar project. Falls back to 'yarn'
|
|
4
|
-
* if we can't determine what package manager the project uses
|
|
5
|
-
*/
|
|
6
|
-
export declare function getPackageManager(): PackageManager;
|
|
7
|
-
export declare function resetPackageManagerCache(): void;
|
|
8
|
-
/**
|
|
9
|
-
* Gets a string suitable for displaying to the user when telling them to run a
|
|
10
|
-
* Cedar bin command, like `yarn cedar upgrade` or
|
|
11
|
-
* `yarn cedar generate page home /`.
|
|
12
|
-
*
|
|
13
|
-
* This is a duplicate of what's in `cli-helpers/packageManager`. Please
|
|
14
|
-
* prefer the other one if you can. This one is only here for packages that
|
|
15
|
-
* can't import cli-helpers.
|
|
16
|
-
* TODO: Remove this one when we've fully moved to tree-shakable ESM sub-path
|
|
17
|
-
* imports
|
|
18
|
-
*/
|
|
19
|
-
export declare function prettyPrintCedarCommand(args: string[]): string;
|
|
20
|
-
//# sourceMappingURL=packageManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageManager.d.ts","sourceRoot":"","sources":["../../src/packageManager.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;AAIpD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAgClD;AAMD,wBAAgB,wBAAwB,SAEvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAM9D"}
|
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/packageManager.ts
|
|
31
|
-
var packageManager_exports = {};
|
|
32
|
-
__export(packageManager_exports, {
|
|
33
|
-
getPackageManager: () => getPackageManager,
|
|
34
|
-
prettyPrintCedarCommand: () => prettyPrintCedarCommand,
|
|
35
|
-
resetPackageManagerCache: () => resetPackageManagerCache
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(packageManager_exports);
|
|
38
|
-
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
39
|
-
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
40
|
-
|
|
41
|
-
// src/paths.ts
|
|
42
|
-
var import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
43
|
-
var import_path2 = __toESM(require("path"), 1);
|
|
44
|
-
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
45
|
-
|
|
46
|
-
// src/config.ts
|
|
47
|
-
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
48
|
-
var import_deepmerge = __toESM(require("deepmerge"), 1);
|
|
49
|
-
var toml = __toESM(require("smol-toml"), 1);
|
|
50
|
-
var import_string_env_interpolation = require("string-env-interpolation");
|
|
51
|
-
|
|
52
|
-
// src/findUp.ts
|
|
53
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
54
|
-
var import_path = __toESM(require("path"), 1);
|
|
55
|
-
function findUp(file, startingDirectory = process.cwd()) {
|
|
56
|
-
const possibleFilepath = import_path.default.join(startingDirectory, file);
|
|
57
|
-
if (import_node_fs.default.existsSync(possibleFilepath)) {
|
|
58
|
-
return possibleFilepath;
|
|
59
|
-
}
|
|
60
|
-
const parentDirectory = import_path.default.dirname(startingDirectory);
|
|
61
|
-
if (parentDirectory === startingDirectory) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
return findUp(file, parentDirectory);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/configPath.ts
|
|
68
|
-
var CONFIG_FILE_NAMES = ["cedar.toml", "redwood.toml"];
|
|
69
|
-
var getConfigPathCache = /* @__PURE__ */ new Map();
|
|
70
|
-
var getConfigPath = (cwd = process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd()) => {
|
|
71
|
-
const cachedPath = getConfigPathCache.get(cwd);
|
|
72
|
-
if (cachedPath) {
|
|
73
|
-
return cachedPath;
|
|
74
|
-
}
|
|
75
|
-
const configPath = findUp("cedar.toml", cwd) || findUp("redwood.toml", cwd);
|
|
76
|
-
if (!configPath) {
|
|
77
|
-
throw new Error(
|
|
78
|
-
`Could not find a "${CONFIG_FILE_NAMES.join('" or "')}" file, are you sure you're in a Cedar project?`
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
getConfigPathCache.set(cwd, configPath);
|
|
82
|
-
return configPath;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// src/config.ts
|
|
86
|
-
var DEFAULT_CONFIG = {
|
|
87
|
-
web: {
|
|
88
|
-
title: "Cedar App",
|
|
89
|
-
port: 8910,
|
|
90
|
-
path: "./web",
|
|
91
|
-
target: "browser" /* BROWSER */,
|
|
92
|
-
includeEnvironmentVariables: [],
|
|
93
|
-
apiUrl: "/.api/functions",
|
|
94
|
-
fastRefresh: true,
|
|
95
|
-
a11y: true,
|
|
96
|
-
sourceMap: false
|
|
97
|
-
},
|
|
98
|
-
api: {
|
|
99
|
-
title: "Cedar App",
|
|
100
|
-
port: 8911,
|
|
101
|
-
path: "./api",
|
|
102
|
-
target: "node" /* NODE */,
|
|
103
|
-
prismaConfig: "./api/prisma.config.cjs",
|
|
104
|
-
prismaGenerateArgs: [],
|
|
105
|
-
serverConfig: "./api/server.config.js",
|
|
106
|
-
debugPort: void 0
|
|
107
|
-
},
|
|
108
|
-
graphql: {
|
|
109
|
-
fragments: false,
|
|
110
|
-
trustedDocuments: false,
|
|
111
|
-
includeScalars: { File: true }
|
|
112
|
-
},
|
|
113
|
-
browser: {
|
|
114
|
-
open: false
|
|
115
|
-
},
|
|
116
|
-
generate: {
|
|
117
|
-
tests: true,
|
|
118
|
-
stories: true,
|
|
119
|
-
nestScaffoldByModel: true
|
|
120
|
-
},
|
|
121
|
-
notifications: {
|
|
122
|
-
versionUpdates: []
|
|
123
|
-
},
|
|
124
|
-
studio: {
|
|
125
|
-
basePort: 4318,
|
|
126
|
-
graphiql: {
|
|
127
|
-
authImpersonation: {
|
|
128
|
-
authProvider: void 0,
|
|
129
|
-
userId: void 0,
|
|
130
|
-
email: void 0,
|
|
131
|
-
jwtSecret: "secret"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
test: {
|
|
136
|
-
autoConsentToDbReset: false
|
|
137
|
-
},
|
|
138
|
-
experimental: {
|
|
139
|
-
opentelemetry: {
|
|
140
|
-
enabled: false,
|
|
141
|
-
wrapApi: true
|
|
142
|
-
},
|
|
143
|
-
cli: {
|
|
144
|
-
autoInstall: true,
|
|
145
|
-
plugins: [
|
|
146
|
-
{
|
|
147
|
-
package: "@cedarjs/cli-storybook-vite"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
package: "@cedarjs/cli-data-migrate"
|
|
151
|
-
}
|
|
152
|
-
]
|
|
153
|
-
},
|
|
154
|
-
useSDLCodeGenForGraphQLTypes: false,
|
|
155
|
-
streamingSsr: {
|
|
156
|
-
enabled: false
|
|
157
|
-
},
|
|
158
|
-
rsc: {
|
|
159
|
-
enabled: false
|
|
160
|
-
},
|
|
161
|
-
realtime: {
|
|
162
|
-
enabled: false
|
|
163
|
-
},
|
|
164
|
-
reactCompiler: {
|
|
165
|
-
enabled: false,
|
|
166
|
-
lintOnly: false
|
|
167
|
-
},
|
|
168
|
-
packagesWorkspace: {
|
|
169
|
-
enabled: false
|
|
170
|
-
},
|
|
171
|
-
gqlorm: {
|
|
172
|
-
enabled: false,
|
|
173
|
-
organizationModel: "Organization",
|
|
174
|
-
membershipModel: "Membership",
|
|
175
|
-
membershipUserField: "userId",
|
|
176
|
-
membershipOrganizationField: "organizationId"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
function getConfig(configPath) {
|
|
181
|
-
const config = (0, import_deepmerge.default)(DEFAULT_CONFIG, getRawConfig(configPath));
|
|
182
|
-
return config;
|
|
183
|
-
}
|
|
184
|
-
function getRawConfig(configPath = getConfigPath()) {
|
|
185
|
-
try {
|
|
186
|
-
return toml.parse((0, import_string_env_interpolation.env)(import_node_fs2.default.readFileSync(configPath, "utf8")));
|
|
187
|
-
} catch (e) {
|
|
188
|
-
throw new Error(`Could not parse "${configPath}": ${e}`);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/generatedDataDir.ts
|
|
193
|
-
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
194
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
195
|
-
function getGeneratedDataDirPath(cwd = process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd()) {
|
|
196
|
-
const configPath = getConfigPath(cwd);
|
|
197
|
-
const projectRoot = import_node_path.default.dirname(configPath);
|
|
198
|
-
const rootDotCedarDir = import_node_path.default.join(projectRoot, ".cedar");
|
|
199
|
-
const rootDotRedwoodDir = import_node_path.default.join(projectRoot, ".redwood");
|
|
200
|
-
const generatedDirPath = import_node_fs3.default.existsSync(rootDotCedarDir) ? rootDotCedarDir : import_node_fs3.default.existsSync(rootDotRedwoodDir) ? rootDotRedwoodDir : rootDotCedarDir;
|
|
201
|
-
return generatedDirPath;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// src/paths.ts
|
|
205
|
-
var getBaseDir = (configPath = getConfigPath()) => {
|
|
206
|
-
return import_path2.default.dirname(configPath);
|
|
207
|
-
};
|
|
208
|
-
var resolveFile = (filePath, extensions = [".js", ".tsx", ".ts", ".jsx", ".mjs", ".mts", ".cjs"]) => {
|
|
209
|
-
for (const extension of extensions) {
|
|
210
|
-
const p = `${filePath}${extension}`;
|
|
211
|
-
if (import_node_fs4.default.existsSync(p)) {
|
|
212
|
-
return p;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
return null;
|
|
216
|
-
};
|
|
217
|
-
var getPathsCache = /* @__PURE__ */ new Map();
|
|
218
|
-
function getPaths(BASE_DIR = getBaseDir()) {
|
|
219
|
-
if (getPathsCache.has(BASE_DIR)) {
|
|
220
|
-
return getPathsCache.get(BASE_DIR);
|
|
221
|
-
}
|
|
222
|
-
const routes = resolveFile(import_path2.default.join(BASE_DIR, "web/src/Routes"));
|
|
223
|
-
const { prismaConfig: prismaConfigFromConfig } = getConfig(
|
|
224
|
-
getConfigPath(BASE_DIR)
|
|
225
|
-
).api;
|
|
226
|
-
const prismaConfigBase = import_path2.default.join(
|
|
227
|
-
BASE_DIR,
|
|
228
|
-
prismaConfigFromConfig.replace(/\.[^.]+$/, "")
|
|
229
|
-
);
|
|
230
|
-
const prismaConfig = resolveFile(prismaConfigBase) || import_path2.default.join(BASE_DIR, prismaConfigFromConfig);
|
|
231
|
-
const viteConfig = resolveFile(
|
|
232
|
-
import_path2.default.join(BASE_DIR, "web/vite.config")
|
|
233
|
-
);
|
|
234
|
-
const generatedBase = getGeneratedDataDirPath(BASE_DIR);
|
|
235
|
-
const paths = {
|
|
236
|
-
base: BASE_DIR,
|
|
237
|
-
generated: {
|
|
238
|
-
base: generatedBase,
|
|
239
|
-
schema: import_path2.default.join(generatedBase, "schema.graphql"),
|
|
240
|
-
types: {
|
|
241
|
-
includes: import_path2.default.join(generatedBase, "types/includes"),
|
|
242
|
-
mirror: import_path2.default.join(generatedBase, "types/mirror")
|
|
243
|
-
},
|
|
244
|
-
prebuild: import_path2.default.join(generatedBase, "prebuild")
|
|
245
|
-
},
|
|
246
|
-
scripts: import_path2.default.join(BASE_DIR, "scripts"),
|
|
247
|
-
packages: import_path2.default.join(BASE_DIR, "packages"),
|
|
248
|
-
generatorTemplates: import_path2.default.join(BASE_DIR, "generatorTemplates"),
|
|
249
|
-
api: {
|
|
250
|
-
base: import_path2.default.join(BASE_DIR, "api"),
|
|
251
|
-
prismaConfig,
|
|
252
|
-
functions: import_path2.default.join(BASE_DIR, "api/src/functions"),
|
|
253
|
-
graphql: import_path2.default.join(BASE_DIR, "api/src/graphql"),
|
|
254
|
-
lib: import_path2.default.join(BASE_DIR, "api/src/lib"),
|
|
255
|
-
config: import_path2.default.join(BASE_DIR, "api/src/config"),
|
|
256
|
-
services: import_path2.default.join(BASE_DIR, "api/src/services"),
|
|
257
|
-
directives: import_path2.default.join(BASE_DIR, "api/src/directives"),
|
|
258
|
-
subscriptions: import_path2.default.join(BASE_DIR, "api/src/subscriptions"),
|
|
259
|
-
src: import_path2.default.join(BASE_DIR, "api/src"),
|
|
260
|
-
dist: import_path2.default.join(BASE_DIR, "api/dist"),
|
|
261
|
-
types: import_path2.default.join(BASE_DIR, "api/types"),
|
|
262
|
-
models: import_path2.default.join(BASE_DIR, "api/src/models"),
|
|
263
|
-
mail: import_path2.default.join(BASE_DIR, "api/src", "mail"),
|
|
264
|
-
jobs: import_path2.default.join(BASE_DIR, "api/src/jobs"),
|
|
265
|
-
distJobs: import_path2.default.join(BASE_DIR, "api/dist/jobs"),
|
|
266
|
-
jobsConfig: resolveFile(import_path2.default.join(BASE_DIR, "api/src/lib", "jobs")),
|
|
267
|
-
distJobsConfig: resolveFile(
|
|
268
|
-
import_path2.default.join(BASE_DIR, "api/dist", "lib", "jobs")
|
|
269
|
-
),
|
|
270
|
-
logger: resolveFile(import_path2.default.join(BASE_DIR, "api/src/lib", "logger"))
|
|
271
|
-
},
|
|
272
|
-
web: {
|
|
273
|
-
routes,
|
|
274
|
-
base: import_path2.default.join(BASE_DIR, "web"),
|
|
275
|
-
pages: import_path2.default.join(BASE_DIR, "web/src/pages/"),
|
|
276
|
-
components: import_path2.default.join(BASE_DIR, "web/src/components"),
|
|
277
|
-
layouts: import_path2.default.join(BASE_DIR, "web/src/layouts/"),
|
|
278
|
-
src: import_path2.default.join(BASE_DIR, "web/src"),
|
|
279
|
-
storybook: import_path2.default.join(BASE_DIR, "web/.storybook"),
|
|
280
|
-
app: resolveFile(import_path2.default.join(BASE_DIR, "web/src/App")),
|
|
281
|
-
document: resolveFile(import_path2.default.join(BASE_DIR, "web/src/Document")),
|
|
282
|
-
html: import_path2.default.join(BASE_DIR, "web/index.html"),
|
|
283
|
-
config: import_path2.default.join(BASE_DIR, "web/config"),
|
|
284
|
-
viteConfig,
|
|
285
|
-
postcss: import_path2.default.join(BASE_DIR, "web/config/postcss.config.cjs"),
|
|
286
|
-
storybookConfig: import_path2.default.join(BASE_DIR, "web/.storybook/main.js"),
|
|
287
|
-
storybookPreviewConfig: resolveFile(
|
|
288
|
-
import_path2.default.join(BASE_DIR, "web/.storybook/preview")
|
|
289
|
-
),
|
|
290
|
-
storybookManagerConfig: import_path2.default.join(BASE_DIR, "web/.storybook/manager.js"),
|
|
291
|
-
dist: import_path2.default.join(BASE_DIR, "web/dist"),
|
|
292
|
-
distBrowser: import_path2.default.join(BASE_DIR, "web/dist/browser"),
|
|
293
|
-
distRsc: import_path2.default.join(BASE_DIR, "web/dist/rsc"),
|
|
294
|
-
distSsr: import_path2.default.join(BASE_DIR, "web/dist/ssr"),
|
|
295
|
-
distSsrDocument: import_path2.default.join(BASE_DIR, "web/dist/ssr/Document"),
|
|
296
|
-
distSsrEntryServer: import_path2.default.join(BASE_DIR, "web/dist/ssr/entry.server"),
|
|
297
|
-
distRouteHooks: import_path2.default.join(BASE_DIR, "web/dist/ssr/routeHooks"),
|
|
298
|
-
distRscEntries: import_path2.default.join(BASE_DIR, "web/dist/rsc/entries.mjs"),
|
|
299
|
-
routeManifest: import_path2.default.join(BASE_DIR, "web/dist/ssr/route-manifest.json"),
|
|
300
|
-
types: import_path2.default.join(BASE_DIR, "web/types"),
|
|
301
|
-
entryClient: resolveFile(import_path2.default.join(BASE_DIR, "web/src/entry.client")),
|
|
302
|
-
// new vite/stream entry point for client
|
|
303
|
-
entryServer: resolveFile(import_path2.default.join(BASE_DIR, "web/src/entry.server")),
|
|
304
|
-
graphql: import_path2.default.join(BASE_DIR, "web/src/graphql")
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
import_node_fs4.default.mkdirSync(paths.generated.types.includes, { recursive: true });
|
|
308
|
-
import_node_fs4.default.mkdirSync(paths.generated.types.mirror, { recursive: true });
|
|
309
|
-
getPathsCache.set(BASE_DIR, paths);
|
|
310
|
-
return paths;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// src/packageManager.ts
|
|
314
|
-
var packageManagerCache;
|
|
315
|
-
function getPackageManager() {
|
|
316
|
-
if (packageManagerCache) {
|
|
317
|
-
return packageManagerCache;
|
|
318
|
-
}
|
|
319
|
-
const base = getPaths().base;
|
|
320
|
-
packageManagerCache = "yarn";
|
|
321
|
-
const envPackageManager = process.env.npm_config_user_agent?.split(" ")[0]?.split("/")[0];
|
|
322
|
-
if (isPackageManager(envPackageManager)) {
|
|
323
|
-
packageManagerCache = envPackageManager;
|
|
324
|
-
} else if (import_node_fs5.default.existsSync(import_node_path2.default.join(base, "yarn.lock"))) {
|
|
325
|
-
packageManagerCache = "yarn";
|
|
326
|
-
} else if (import_node_fs5.default.existsSync(import_node_path2.default.join(base, "pnpm-lock.yaml"))) {
|
|
327
|
-
packageManagerCache = "pnpm";
|
|
328
|
-
} else if (import_node_fs5.default.existsSync(import_node_path2.default.join(base, "package-lock.json"))) {
|
|
329
|
-
packageManagerCache = "npm";
|
|
330
|
-
}
|
|
331
|
-
return packageManagerCache;
|
|
332
|
-
}
|
|
333
|
-
function isPackageManager(pm) {
|
|
334
|
-
return pm === "yarn" || pm === "npm" || pm === "pnpm";
|
|
335
|
-
}
|
|
336
|
-
function resetPackageManagerCache() {
|
|
337
|
-
packageManagerCache = void 0;
|
|
338
|
-
}
|
|
339
|
-
function prettyPrintCedarCommand(args) {
|
|
340
|
-
const packageManager = getPackageManager();
|
|
341
|
-
const packageManagerBin = packageManager === "npm" ? "npx" : packageManager;
|
|
342
|
-
return `${packageManagerBin} cedar ${args.join(" ")}`;
|
|
343
|
-
}
|
|
344
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
345
|
-
0 && (module.exports = {
|
|
346
|
-
getPackageManager,
|
|
347
|
-
prettyPrintCedarCommand,
|
|
348
|
-
resetPackageManagerCache
|
|
349
|
-
});
|
package/dist/cjs/paths.d.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
export interface NodeTargetPaths {
|
|
2
|
-
base: string;
|
|
3
|
-
directives: string;
|
|
4
|
-
prismaConfig: string;
|
|
5
|
-
src: string;
|
|
6
|
-
functions: string;
|
|
7
|
-
graphql: string;
|
|
8
|
-
lib: string;
|
|
9
|
-
services: string;
|
|
10
|
-
subscriptions: string;
|
|
11
|
-
config: string;
|
|
12
|
-
dist: string;
|
|
13
|
-
types: string;
|
|
14
|
-
models: string;
|
|
15
|
-
mail: string;
|
|
16
|
-
jobs: string;
|
|
17
|
-
distJobs: string;
|
|
18
|
-
jobsConfig: string | null;
|
|
19
|
-
distJobsConfig: string | null;
|
|
20
|
-
logger: string | null;
|
|
21
|
-
}
|
|
22
|
-
export interface WebPaths {
|
|
23
|
-
base: string;
|
|
24
|
-
src: string;
|
|
25
|
-
storybook: string;
|
|
26
|
-
app: string;
|
|
27
|
-
document: string;
|
|
28
|
-
html: string;
|
|
29
|
-
routes: string;
|
|
30
|
-
pages: string;
|
|
31
|
-
components: string;
|
|
32
|
-
layouts: string;
|
|
33
|
-
config: string;
|
|
34
|
-
viteConfig: string;
|
|
35
|
-
entryClient: string | null;
|
|
36
|
-
entryServer: string | null;
|
|
37
|
-
postcss: string;
|
|
38
|
-
storybookConfig: string;
|
|
39
|
-
storybookPreviewConfig: string | null;
|
|
40
|
-
storybookManagerConfig: string;
|
|
41
|
-
dist: string;
|
|
42
|
-
distBrowser: string;
|
|
43
|
-
distRsc: string;
|
|
44
|
-
distSsr: string;
|
|
45
|
-
distSsrDocument: string;
|
|
46
|
-
distSsrEntryServer: string;
|
|
47
|
-
distRouteHooks: string;
|
|
48
|
-
distRscEntries: string;
|
|
49
|
-
routeManifest: string;
|
|
50
|
-
types: string;
|
|
51
|
-
graphql: string;
|
|
52
|
-
}
|
|
53
|
-
export interface Paths {
|
|
54
|
-
base: string;
|
|
55
|
-
generated: {
|
|
56
|
-
base: string;
|
|
57
|
-
schema: string;
|
|
58
|
-
types: {
|
|
59
|
-
includes: string;
|
|
60
|
-
mirror: string;
|
|
61
|
-
};
|
|
62
|
-
prebuild: string;
|
|
63
|
-
};
|
|
64
|
-
web: WebPaths;
|
|
65
|
-
api: NodeTargetPaths;
|
|
66
|
-
scripts: string;
|
|
67
|
-
packages: string;
|
|
68
|
-
generatorTemplates: string;
|
|
69
|
-
}
|
|
70
|
-
export interface PagesDependency {
|
|
71
|
-
/** the variable to which the import is assigned */
|
|
72
|
-
importName: string;
|
|
73
|
-
/** @alias importName */
|
|
74
|
-
constName: string;
|
|
75
|
-
/** absolute path without extension */
|
|
76
|
-
importPath: string;
|
|
77
|
-
/** absolute path with extension */
|
|
78
|
-
path: string;
|
|
79
|
-
/** const ${importName} = { ...data structure for async imports... } */
|
|
80
|
-
importStatement: string;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The Cedar config file is used as an anchor for the base directory of a
|
|
84
|
-
* project.
|
|
85
|
-
*/
|
|
86
|
-
export declare const getBaseDir: (configPath?: string) => string;
|
|
87
|
-
export declare const getBaseDirFromFile: (file: string) => string;
|
|
88
|
-
/**
|
|
89
|
-
* Use this to resolve files when the path to the file is known,
|
|
90
|
-
* but the extension is not.
|
|
91
|
-
*/
|
|
92
|
-
export declare const resolveFile: (filePath: string, extensions?: string[]) => string | null;
|
|
93
|
-
export declare function getPaths(BASE_DIR?: string): Paths;
|
|
94
|
-
/**
|
|
95
|
-
* Returns the route hook for the supplied page path.
|
|
96
|
-
* Note that the page name doesn't have to match
|
|
97
|
-
*
|
|
98
|
-
* @param pagePath
|
|
99
|
-
* @returns string
|
|
100
|
-
*/
|
|
101
|
-
export declare const getRouteHookForPage: (pagePath: string | undefined | null) => string | null;
|
|
102
|
-
/**
|
|
103
|
-
* Use this function to find the app route hook.
|
|
104
|
-
* If it is present, you get the path to the file - in prod, you get the built version in dist.
|
|
105
|
-
* In dev, you get the source version.
|
|
106
|
-
*
|
|
107
|
-
* @param forProd
|
|
108
|
-
* @returns string | null
|
|
109
|
-
*/
|
|
110
|
-
export declare const getAppRouteHook: (forProd?: boolean) => string | null;
|
|
111
|
-
/**
|
|
112
|
-
* Gets the built server entry file path.
|
|
113
|
-
* Throws an error if the file does not exist.
|
|
114
|
-
*/
|
|
115
|
-
export declare function getBuiltServerEntryFile(): string;
|
|
116
|
-
/**
|
|
117
|
-
* Gets the built Document file path.
|
|
118
|
-
* Throws an error if the file does not exist.
|
|
119
|
-
*/
|
|
120
|
-
export declare function getBuiltDocumentFile(): string;
|
|
121
|
-
/**
|
|
122
|
-
* Process the pages directory and return information useful for automated imports.
|
|
123
|
-
*
|
|
124
|
-
* Note: glob.sync returns posix style paths on Windows machines
|
|
125
|
-
* @deprecated I will write a seperate method that use `getFiles` instead. This
|
|
126
|
-
* is used by structure, babel auto-importer and the eslint plugin.
|
|
127
|
-
*/
|
|
128
|
-
export declare const processPagesDir: (webPagesDir?: string) => PagesDependency[];
|
|
129
|
-
/**
|
|
130
|
-
* Converts Windows-style paths to Posix-style
|
|
131
|
-
* C:\Users\Bob\dev\Cedar -> /c/Users/Bob/dev/Cedar
|
|
132
|
-
*
|
|
133
|
-
* The conversion only happens on Windows systems, and only for paths that are
|
|
134
|
-
* not already Posix-style
|
|
135
|
-
*
|
|
136
|
-
* @param path Filesystem path
|
|
137
|
-
*/
|
|
138
|
-
export declare const ensurePosixPath: (path: string) => string;
|
|
139
|
-
/**
|
|
140
|
-
* Switches backslash to regular slash on Windows so the path works in
|
|
141
|
-
* import statements
|
|
142
|
-
* C:\Users\Bob\dev\Cedar\UserPage\UserPage ->
|
|
143
|
-
* C:/Users/Bob/dev/Cedar/UserPage/UserPage
|
|
144
|
-
*
|
|
145
|
-
* @param path Filesystem path
|
|
146
|
-
*/
|
|
147
|
-
export declare const importStatementPath: (path: string) => string;
|
|
148
|
-
export declare function projectRootIsEsm(): boolean;
|
|
149
|
-
export declare function projectSideIsEsm(side: 'api' | 'web'): boolean;
|
|
150
|
-
export declare function projectIsEsm(): boolean;
|
|
151
|
-
export declare const isTypeScriptProject: () => boolean;
|
|
152
|
-
//# sourceMappingURL=paths.d.ts.map
|
package/dist/cjs/paths.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/paths.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB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,GAAI,UAAU,MAAM,GAAG,SAAS,GAAG,IAAI,kBAetE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,iBAAe,kBAmB9C,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,cAAa,MAA6B,KACzC,eAAe,EAsBjB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,WAa3C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,WAQ/C,CAAA;AAWD,wBAAgB,gBAAgB,YAE/B;AAGD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,WAKnD;AAED,wBAAgB,YAAY,YAY3B;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA"}
|
package/dist/cjs/prisma.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { PrismaConfig } from 'prisma';
|
|
2
|
-
/**
|
|
3
|
-
* Reads and returns the Prisma configuration at the specified path.
|
|
4
|
-
*
|
|
5
|
-
* @param prismaConfigPath - Absolute path to the Prisma configuration file
|
|
6
|
-
* @returns The Prisma configuration object
|
|
7
|
-
*/
|
|
8
|
-
export declare function loadPrismaConfig(prismaConfigPath: string): Promise<PrismaConfig>;
|
|
9
|
-
/**
|
|
10
|
-
* Gets the schema path from Prisma config.
|
|
11
|
-
* Defaults to 'schema.prisma' in the same directory as the config file if not
|
|
12
|
-
* specified.
|
|
13
|
-
*
|
|
14
|
-
* @param prismaConfigPath - Absolute path to the Prisma configuration file
|
|
15
|
-
* @returns Absolute path to the schema file or directory
|
|
16
|
-
*/
|
|
17
|
-
export declare function getSchemaPath(prismaConfigPath: string): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the Prisma schemas for the current project's default schema location.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getPrismaSchemas(): Promise<import("@prisma/schema-files-loader").GetSchemaResult>;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the active datasource provider (e.g. `postgresql`, `mysql`, `sqlite`)
|
|
24
|
-
* configured in the project's `schema.prisma`.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getPrismaDatasourceProvider(): Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the migrations path from Prisma config.
|
|
29
|
-
* Defaults to 'migrations' in the same directory as the schema.
|
|
30
|
-
*
|
|
31
|
-
* @param prismaConfigPath - Absolute path to the Prisma configuration file
|
|
32
|
-
* @returns Absolute path to the migrations directory
|
|
33
|
-
*/
|
|
34
|
-
export declare function getMigrationsPath(prismaConfigPath: string): Promise<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Gets the database directory (directory containing the schema).
|
|
37
|
-
* If schema is a directory, returns that directory.
|
|
38
|
-
* If schema is a file, returns its parent directory.
|
|
39
|
-
*
|
|
40
|
-
* @param prismaConfigPath - Absolute path to the Prisma configuration file
|
|
41
|
-
* @returns Absolute path to the database directory
|
|
42
|
-
*/
|
|
43
|
-
export declare function getDbDir(prismaConfigPath: string): Promise<string>;
|
|
44
|
-
/**
|
|
45
|
-
* Gets the data migrations directory path.
|
|
46
|
-
* Data migrations are a Cedar feature (not Prisma) that live alongside Prisma
|
|
47
|
-
* migrations.
|
|
48
|
-
* Defaults to 'dataMigrations' in the same directory as Prisma migrations.
|
|
49
|
-
*
|
|
50
|
-
* @param prismaConfigPath - Absolute path to the Prisma configuration file
|
|
51
|
-
* @returns Absolute path to the data migrations directory
|
|
52
|
-
*/
|
|
53
|
-
export declare function getDataMigrationsPath(prismaConfigPath: string): Promise<string>;
|
|
54
|
-
type ResolveReturnType = {
|
|
55
|
-
clientPath: string;
|
|
56
|
-
error: undefined;
|
|
57
|
-
} | {
|
|
58
|
-
clientPath: string | undefined;
|
|
59
|
-
error: string;
|
|
60
|
-
};
|
|
61
|
-
export declare function resolveGeneratedPrismaClient(): Promise<ResolveReturnType>;
|
|
62
|
-
export {};
|
|
63
|
-
//# sourceMappingURL=prisma.d.ts.map
|
package/dist/cjs/prisma.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../src/prisma.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAQ1C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,yBA8B9D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,MAAM,mBAY3D;AAED;;GAEG;AACH,wBAAsB,gBAAgB,mEAgBrC;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC,CAWnE;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED,KAAK,iBAAiB,GAClB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACxC;IAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAwD/E"}
|
package/dist/cjs/workspaces.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/workspaces.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQhE"}
|