@geekmidas/cli 10.0.0-alpha.22 → 10.0.0-alpha.23
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/index.cjs +32 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +32 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ import prompts from "prompts";
|
|
|
39
39
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
40
40
|
import { serviceContext } from "@geekmidas/services";
|
|
41
41
|
//#region package.json
|
|
42
|
-
var version = "10.0.0-alpha.
|
|
42
|
+
var version = "10.0.0-alpha.23";
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/auth/credentials.ts
|
|
45
45
|
/**
|
|
@@ -8409,26 +8409,26 @@ function loadPackageJson() {
|
|
|
8409
8409
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
8410
8410
|
*/
|
|
8411
8411
|
const GEEKMIDAS_VERSIONS = {
|
|
8412
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
8413
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
8414
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
8415
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
8416
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
8417
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
8418
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
8419
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
8420
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
8421
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
8422
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
8423
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
8424
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
8425
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
8426
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
8427
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
8428
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
8429
|
-
"@geekmidas/studio": "~10.0.0-alpha.
|
|
8430
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
8431
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
8412
|
+
"@geekmidas/audit": "~10.0.0-alpha.23",
|
|
8413
|
+
"@geekmidas/auth": "~10.0.0-alpha.23",
|
|
8414
|
+
"@geekmidas/cache": "~10.0.0-alpha.23",
|
|
8415
|
+
"@geekmidas/client": "~10.0.0-alpha.23",
|
|
8416
|
+
"@geekmidas/cloud": "~10.0.0-alpha.23",
|
|
8417
|
+
"@geekmidas/constructs": "~10.0.0-alpha.23",
|
|
8418
|
+
"@geekmidas/db": "~10.0.0-alpha.23",
|
|
8419
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.23",
|
|
8420
|
+
"@geekmidas/envkit": "~10.0.0-alpha.23",
|
|
8421
|
+
"@geekmidas/errors": "~10.0.0-alpha.23",
|
|
8422
|
+
"@geekmidas/events": "~10.0.0-alpha.23",
|
|
8423
|
+
"@geekmidas/logger": "~10.0.0-alpha.23",
|
|
8424
|
+
"@geekmidas/manifest": "~10.0.0-alpha.23",
|
|
8425
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.23",
|
|
8426
|
+
"@geekmidas/schema": "~10.0.0-alpha.23",
|
|
8427
|
+
"@geekmidas/services": "~10.0.0-alpha.23",
|
|
8428
|
+
"@geekmidas/storage": "~10.0.0-alpha.23",
|
|
8429
|
+
"@geekmidas/studio": "~10.0.0-alpha.23",
|
|
8430
|
+
"@geekmidas/telescope": "~10.0.0-alpha.23",
|
|
8431
|
+
"@geekmidas/testkit": "~10.0.0-alpha.23",
|
|
8432
8432
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
8433
8433
|
};
|
|
8434
8434
|
//#endregion
|
|
@@ -15232,8 +15232,10 @@ async function writeTestHarness(options) {
|
|
|
15232
15232
|
cache: cacheBackendsIn(declared, options.cacheBackend)
|
|
15233
15233
|
});
|
|
15234
15234
|
const database = await databaseSource(declared, sources, endpoints.map(({ construct }) => construct));
|
|
15235
|
+
const files = [.../* @__PURE__ */ new Set([...Object.values(manifest.constructs).map(({ source }) => source.file), ...manifest.endpoints.map(({ source }) => source.file)])];
|
|
15235
15236
|
const harnessFor = (dir) => harnessModule({
|
|
15236
15237
|
dir,
|
|
15238
|
+
files,
|
|
15237
15239
|
database,
|
|
15238
15240
|
surfaces: surfaces.map((id, index) => ({
|
|
15239
15241
|
id,
|
|
@@ -15306,7 +15308,7 @@ function specifierFrom(dir, file) {
|
|
|
15306
15308
|
return path.startsWith(".") ? path : `./${path}`;
|
|
15307
15309
|
}
|
|
15308
15310
|
function harnessModule(options) {
|
|
15309
|
-
const { surfaces, auths, drivers, database, dir } = options;
|
|
15311
|
+
const { surfaces, auths, drivers, database, dir, files } = options;
|
|
15310
15312
|
const plugins = [...new Set(auths.flatMap(({ plugins }) => plugins))].sort();
|
|
15311
15313
|
const imports = [
|
|
15312
15314
|
`import {${database ? " type DatabaseOf," : ""} featureTest, loadTestManifest } from '@geekmidas/constructs/testing';`,
|
|
@@ -15315,7 +15317,8 @@ function harnessModule(options) {
|
|
|
15315
15317
|
...surfaces.map(({ id }) => `import { createApi as create${id} } from './clients/${kebabCase(id)}.js';`),
|
|
15316
15318
|
...auths.length ? [`import { createAuthClient } from 'better-auth/client';`] : [],
|
|
15317
15319
|
...plugins.length ? [`import { ${plugins.join(", ")} } from 'better-auth/client/plugins';`] : [],
|
|
15318
|
-
...drivers.imports ? [drivers.imports] : []
|
|
15320
|
+
...drivers.imports ? [drivers.imports] : [],
|
|
15321
|
+
...files.map((file, index) => `import * as __module${index} from '${specifierFrom(dir, file)}';`)
|
|
15319
15322
|
];
|
|
15320
15323
|
const url = (id) => `manifest.env[${JSON.stringify(provideKey(id, "url"))}]!`;
|
|
15321
15324
|
const members = [...surfaces.map(({ id, secured }) => ` /** \`${id}\`, at ${provideKey(id, "url")}. */
|
|
@@ -15341,8 +15344,13 @@ export class Browser extends TestBrowser {
|
|
|
15341
15344
|
${members.join("\n\n")}
|
|
15342
15345
|
}
|
|
15343
15346
|
|
|
15347
|
+
/** The app's modules, by the path the manifest records for each. */
|
|
15348
|
+
const modules = {
|
|
15349
|
+
${files.map((file, index) => `\t${JSON.stringify(file)}: __module${index},`).join("\n")}
|
|
15350
|
+
};
|
|
15351
|
+
|
|
15344
15352
|
/** \`it\`, for a test that drives the app the way it runs deployed. */
|
|
15345
|
-
export const it = featureTest${database ? "<Browser, DatabaseOf<typeof __database>>" : ""}({ manifest, browser: Browser });
|
|
15353
|
+
export const it = featureTest${database ? "<Browser, DatabaseOf<typeof __database>>" : ""}({ manifest, modules, browser: Browser });
|
|
15346
15354
|
`;
|
|
15347
15355
|
}
|
|
15348
15356
|
//#endregion
|