@geekmidas/cli 10.0.0-alpha.32 → 10.0.0-alpha.34
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-URVD4bTj.cjs → config-DMpzmsQL.cjs} +2 -2
- package/dist/{config-URVD4bTj.cjs.map → config-DMpzmsQL.cjs.map} +1 -1
- package/dist/{config-BH3Ki69F.mjs → config-Du8AQJRK.mjs} +2 -2
- package/dist/{config-BH3Ki69F.mjs.map → config-Du8AQJRK.mjs.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/discover-CMxesskG.mjs.map +1 -1
- package/dist/discover-CroTIm0K.cjs.map +1 -1
- package/dist/{github-BrDmlm1x.mjs → github-DN-92LWP.mjs} +3 -3
- package/dist/{github-BrDmlm1x.mjs.map → github-DN-92LWP.mjs.map} +1 -1
- package/dist/{github-B2fis34P.cjs → github-JhvrmjQp.cjs} +3 -3
- package/dist/{github-B2fis34P.cjs.map → github-JhvrmjQp.cjs.map} +1 -1
- package/dist/{index-p89EzILa.d.mts → index-CAp22ul5.d.cts} +2 -2
- package/dist/{index-p89EzILa.d.mts.map → index-CAp22ul5.d.cts.map} +1 -1
- package/dist/{index-rU9u761a.d.cts → index-DxXMtQNT.d.mts} +2 -2
- package/dist/{index-rU9u761a.d.cts.map → index-DxXMtQNT.d.mts.map} +1 -1
- package/dist/index.cjs +125 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +126 -82
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-CnPtWnkR.mjs → migrate-BbhXxQer.mjs} +4 -4
- package/dist/{migrate-CnPtWnkR.mjs.map → migrate-BbhXxQer.mjs.map} +1 -1
- package/dist/{migrate-BiasgAIN.cjs → migrate-u1oRHz6K.cjs} +4 -4
- package/dist/{migrate-BiasgAIN.cjs.map → migrate-u1oRHz6K.cjs.map} +1 -1
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +1 -1
- package/dist/{ready-DXtNfk7v.cjs → ready-CXhoutix.cjs} +108 -25
- package/dist/ready-CXhoutix.cjs.map +1 -0
- package/dist/{ready-CvP3JVEw.mjs → ready-D1BCiaYU.mjs} +106 -29
- package/dist/ready-D1BCiaYU.mjs.map +1 -0
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{types-CzK6hsXP.d.mts → types-BTiu5kwo.d.mts} +26 -1
- package/dist/{types-CzK6hsXP.d.mts.map → types-BTiu5kwo.d.mts.map} +1 -1
- package/dist/{types-DOOAevjG.d.cts → types-Bj_FpeTc.d.cts} +26 -1
- package/dist/{types-DOOAevjG.d.cts.map → types-Bj_FpeTc.d.cts.map} +1 -1
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-Bav3TVrP.cjs → workspace-CAJk6UmC.cjs} +11 -4
- package/dist/{workspace-Bav3TVrP.cjs.map → workspace-CAJk6UmC.cjs.map} +1 -1
- package/dist/{workspace-T4IVGSoB.mjs → workspace-CsL76tpc.mjs} +11 -4
- package/dist/{workspace-T4IVGSoB.mjs.map → workspace-CsL76tpc.mjs.map} +1 -1
- package/dist/{workspace-C97QUCIf.mjs → workspace-DB2YHgOl.mjs} +4 -3
- package/dist/{workspace-C97QUCIf.mjs.map → workspace-DB2YHgOl.mjs.map} +1 -1
- package/dist/{workspace-BhiMkRuA.cjs → workspace-LKFnEBX8.cjs} +4 -3
- package/dist/{workspace-BhiMkRuA.cjs.map → workspace-LKFnEBX8.cjs.map} +1 -1
- package/package.json +14 -14
- package/dist/ready-CvP3JVEw.mjs.map +0 -1
- package/dist/ready-DXtNfk7v.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
4
4
|
const require_discover = require("./discover-CroTIm0K.cjs");
|
|
5
|
-
const require_config = require("./config-
|
|
6
|
-
const require_workspace = require("./workspace-
|
|
5
|
+
const require_config = require("./config-DMpzmsQL.cjs");
|
|
6
|
+
const require_workspace = require("./workspace-CAJk6UmC.cjs");
|
|
7
7
|
const require_storage = require("./storage-C2JC31V9.cjs");
|
|
8
|
-
const require_workspace$1 = require("./workspace-
|
|
8
|
+
const require_workspace$1 = require("./workspace-LKFnEBX8.cjs");
|
|
9
9
|
const require_OpenApiTsGenerator = require("./OpenApiTsGenerator-D1nhN98m.cjs");
|
|
10
10
|
const require_openapi = require("./openapi.cjs");
|
|
11
|
-
const require_ready = require("./ready-
|
|
11
|
+
const require_ready = require("./ready-CXhoutix.cjs");
|
|
12
12
|
const require_emit = require("./emit-BdoPFjZf.cjs");
|
|
13
13
|
const require_reconcile = require("./reconcile-BxZTV2vl.cjs");
|
|
14
14
|
let commander = require("commander");
|
|
@@ -42,7 +42,7 @@ let _geekmidas_constructs_subscribers = require("@geekmidas/constructs/subscribe
|
|
|
42
42
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
43
43
|
let node_dns_promises = require("node:dns/promises");
|
|
44
44
|
//#region package.json
|
|
45
|
-
var version = "10.0.0-alpha.
|
|
45
|
+
var version = "10.0.0-alpha.34";
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/auth/credentials.ts
|
|
48
48
|
/**
|
|
@@ -1092,9 +1092,9 @@ async function workspaceDevCommand(workspace, options) {
|
|
|
1092
1092
|
...reconciled.env
|
|
1093
1093
|
};
|
|
1094
1094
|
if (options.migrate || options.seed) {
|
|
1095
|
-
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-
|
|
1095
|
+
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
|
|
1096
1096
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
1097
|
-
} else await Promise.resolve().then(() => require("./migrate-
|
|
1097
|
+
} else await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
1098
1098
|
logger$10.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
1099
1099
|
});
|
|
1100
1100
|
const appUrls = {};
|
|
@@ -3107,6 +3107,7 @@ const PROVISIONERS = {
|
|
|
3107
3107
|
context.deferred.push(...statementsFor({
|
|
3108
3108
|
id: declaration.id,
|
|
3109
3109
|
database: postgres.databaseName,
|
|
3110
|
+
ownsDatabase: true,
|
|
3110
3111
|
runtime,
|
|
3111
3112
|
owner,
|
|
3112
3113
|
...reads ? { reader: (0, _geekmidas_db_pg_roles.readerRole)(runtime) } : {},
|
|
@@ -3342,6 +3343,7 @@ function statementsFor(options) {
|
|
|
3342
3343
|
owner,
|
|
3343
3344
|
...reader ? { reader } : {},
|
|
3344
3345
|
schema,
|
|
3346
|
+
...options.ownsDatabase ? { database } : {},
|
|
3345
3347
|
passwords: {
|
|
3346
3348
|
runtime: derivedPassword(context, runtime),
|
|
3347
3349
|
owner: derivedPassword(context, owner),
|
|
@@ -8646,7 +8648,27 @@ functions it called on the way.
|
|
|
8646
8648
|
${database ? "gkm test # starts services, injects secrets, then runs vitest" : "gkm test"}
|
|
8647
8649
|
\`\`\`
|
|
8648
8650
|
|
|
8649
|
-
Run tests through \`gkm test\`, not \`vitest\` directly${database ? " — it is what starts the database and injects the secrets the suite needs" : ""}
|
|
8651
|
+
Run tests through \`gkm test\`, not \`vitest\` directly${database ? " — it is what starts the database and injects the secrets the suite needs" : ""}.${database ? `
|
|
8652
|
+
|
|
8653
|
+
**Factories, one per database.** \`test/factories/<construct>.ts\` at the
|
|
8654
|
+
project root — \`database.ts\` for \`Database\` — exports
|
|
8655
|
+
\`createFactory(db)\`. A feature test gets each by service name, on that
|
|
8656
|
+
test's transaction — the one \`db.get\` returns and its endpoints use — so
|
|
8657
|
+
ask for it rather than importing and building one. Sign in the way a person
|
|
8658
|
+
does, through \`browser.signIn\`:
|
|
8659
|
+
|
|
8660
|
+
\`\`\`typescript
|
|
8661
|
+
it('reads a user', async ({ browser, db, factories }) => {
|
|
8662
|
+
const factory = await factories.get('database');
|
|
8663
|
+
const ada = await factory.insert('users', { email: 'ada@example.com' });
|
|
8664
|
+
|
|
8665
|
+
await browser.signIn(ada.email);
|
|
8666
|
+
// … act through browser.api …
|
|
8667
|
+
|
|
8668
|
+
const app = await db.get('database');
|
|
8669
|
+
// … assert on what was written …
|
|
8670
|
+
});
|
|
8671
|
+
\`\`\`` : ""}`;
|
|
8650
8672
|
}
|
|
8651
8673
|
//#endregion
|
|
8652
8674
|
//#region src/init/dependencies.ts
|
|
@@ -8774,26 +8796,26 @@ function loadPackageJson() {
|
|
|
8774
8796
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
8775
8797
|
*/
|
|
8776
8798
|
const GEEKMIDAS_VERSIONS = {
|
|
8777
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
8778
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
8779
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
8780
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
8781
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
8782
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
8783
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
8784
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
8785
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
8786
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
8787
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
8788
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
8789
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
8790
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
8791
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
8792
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
8793
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
8794
|
-
"@geekmidas/studio": "~10.0.0-alpha.
|
|
8795
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
8796
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
8799
|
+
"@geekmidas/audit": "~10.0.0-alpha.34",
|
|
8800
|
+
"@geekmidas/auth": "~10.0.0-alpha.34",
|
|
8801
|
+
"@geekmidas/cache": "~10.0.0-alpha.34",
|
|
8802
|
+
"@geekmidas/client": "~10.0.0-alpha.34",
|
|
8803
|
+
"@geekmidas/cloud": "~10.0.0-alpha.34",
|
|
8804
|
+
"@geekmidas/constructs": "~10.0.0-alpha.34",
|
|
8805
|
+
"@geekmidas/db": "~10.0.0-alpha.34",
|
|
8806
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.34",
|
|
8807
|
+
"@geekmidas/envkit": "~10.0.0-alpha.34",
|
|
8808
|
+
"@geekmidas/errors": "~10.0.0-alpha.34",
|
|
8809
|
+
"@geekmidas/events": "~10.0.0-alpha.34",
|
|
8810
|
+
"@geekmidas/logger": "~10.0.0-alpha.34",
|
|
8811
|
+
"@geekmidas/manifest": "~10.0.0-alpha.34",
|
|
8812
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.34",
|
|
8813
|
+
"@geekmidas/schema": "~10.0.0-alpha.34",
|
|
8814
|
+
"@geekmidas/services": "~10.0.0-alpha.34",
|
|
8815
|
+
"@geekmidas/storage": "~10.0.0-alpha.34",
|
|
8816
|
+
"@geekmidas/studio": "~10.0.0-alpha.34",
|
|
8817
|
+
"@geekmidas/telescope": "~10.0.0-alpha.34",
|
|
8818
|
+
"@geekmidas/testkit": "~10.0.0-alpha.34",
|
|
8797
8819
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
8798
8820
|
};
|
|
8799
8821
|
//#endregion
|
|
@@ -10369,6 +10391,18 @@ function rootConstructDependencies(options) {
|
|
|
10369
10391
|
};
|
|
10370
10392
|
}
|
|
10371
10393
|
/**
|
|
10394
|
+
* What `test/factories/` imports at the root: the factory and faker, and
|
|
10395
|
+
* Kysely's types where the root does not already install it for the
|
|
10396
|
+
* constructs.
|
|
10397
|
+
*/
|
|
10398
|
+
function rootFactoryDependencies(options) {
|
|
10399
|
+
return {
|
|
10400
|
+
"@geekmidas/testkit": GEEKMIDAS_VERSIONS["@geekmidas/testkit"],
|
|
10401
|
+
"@faker-js/faker": DEPENDENCY_VERSIONS["@faker-js/faker"],
|
|
10402
|
+
...options.template === "fullstack" ? {} : { kysely: DEPENDENCY_VERSIONS.kysely }
|
|
10403
|
+
};
|
|
10404
|
+
}
|
|
10405
|
+
/**
|
|
10372
10406
|
* Generate monorepo root files (pnpm-workspace.yaml, root package.json, etc.)
|
|
10373
10407
|
*/
|
|
10374
10408
|
function generateMonorepoFiles(options, _template) {
|
|
@@ -10407,6 +10441,7 @@ function generateMonorepoFiles(options, _template) {
|
|
|
10407
10441
|
turbo: DEPENDENCY_VERSIONS["turbo"],
|
|
10408
10442
|
typescript: TOOLCHAIN_VERSIONS["typescript"],
|
|
10409
10443
|
vitest: TOOLCHAIN_VERSIONS["vitest"],
|
|
10444
|
+
...options.constructs.database ? rootFactoryDependencies(options) : {},
|
|
10410
10445
|
...deploy.devDependencies
|
|
10411
10446
|
}
|
|
10412
10447
|
};
|
|
@@ -11987,9 +12022,9 @@ function generateSourceFiles(options, template) {
|
|
|
11987
12022
|
//#endregion
|
|
11988
12023
|
//#region src/init/generators/test.ts
|
|
11989
12024
|
/**
|
|
11990
|
-
* Generate test infrastructure files when database is enabled
|
|
11991
|
-
*
|
|
11992
|
-
* factory
|
|
12025
|
+
* Generate test infrastructure files when database is enabled: the
|
|
12026
|
+
* transaction-isolated test config and an example spec, in the app. The
|
|
12027
|
+
* factory is the project's — see {@link generateTestFactoryFiles}.
|
|
11993
12028
|
*/
|
|
11994
12029
|
function generateTestFiles(options, _template) {
|
|
11995
12030
|
if (!options.constructs.database) return [];
|
|
@@ -11997,10 +12032,9 @@ function generateTestFiles(options, _template) {
|
|
|
11997
12032
|
const schema = !options.monorepo ? "../src/constructs/database.ts" : `@${options.name}/constructs/database.ts`;
|
|
11998
12033
|
db.urlKey;
|
|
11999
12034
|
db.ownerUrlKey;
|
|
12000
|
-
return [
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
content: `import { it as itVitest } from 'vitest';
|
|
12035
|
+
return [{
|
|
12036
|
+
path: "test/config.ts",
|
|
12037
|
+
content: `import { it as itVitest } from 'vitest';
|
|
12004
12038
|
import { wrapVitestKyselyTransaction } from '@geekmidas/testkit/kysely';
|
|
12005
12039
|
import { type Database, database } from '${schema}';
|
|
12006
12040
|
|
|
@@ -12010,17 +12044,56 @@ export const it = wrapVitestKyselyTransaction<Database>(itVitest, {
|
|
|
12010
12044
|
connection: database,
|
|
12011
12045
|
});
|
|
12012
12046
|
`
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12047
|
+
}, {
|
|
12048
|
+
path: "test/example.spec.ts",
|
|
12049
|
+
content: `import { describe, expect } from 'vitest';
|
|
12050
|
+
import { it } from './config.ts';
|
|
12051
|
+
|
|
12052
|
+
describe('example', () => {
|
|
12053
|
+
it('should have a working test setup', async ({ trx }) => {
|
|
12054
|
+
// trx is a Kysely transaction; everything in it is rolled back after the
|
|
12055
|
+
// test
|
|
12056
|
+
expect(trx).toBeDefined();
|
|
12057
|
+
});
|
|
12058
|
+
});
|
|
12059
|
+
`
|
|
12060
|
+
}];
|
|
12061
|
+
}
|
|
12062
|
+
/**
|
|
12063
|
+
* The database's test factory, at the project root:
|
|
12064
|
+
* `test/factories/<construct>.ts`.
|
|
12065
|
+
*
|
|
12066
|
+
* A factory belongs to a database, not to an app, so there is one per database
|
|
12067
|
+
* for the whole project. `gkm test` finds it by that name and hands every
|
|
12068
|
+
* feature test \`factories.get('database')\`, built on the test's transaction.
|
|
12069
|
+
*/
|
|
12070
|
+
function generateTestFactoryFiles(options) {
|
|
12071
|
+
if (!options.constructs.database) return [];
|
|
12072
|
+
const db = databaseFor();
|
|
12073
|
+
const schema = options.monorepo && options.template === "fullstack" ? `@${options.name}/constructs/database.ts` : options.monorepo ? `../../${options.apiPath}/src/constructs/database.ts` : "../../src/constructs/database.ts";
|
|
12074
|
+
return [{
|
|
12075
|
+
path: `test/factories/${(0, _geekmidas_manifest.kebabCase)(db.id)}.ts`,
|
|
12076
|
+
content: `import type { Kysely } from 'kysely';
|
|
12017
12077
|
import { KyselyFactory } from '@geekmidas/testkit/kysely';
|
|
12018
12078
|
import type { Database } from '${schema}';
|
|
12019
|
-
|
|
12079
|
+
|
|
12080
|
+
const usersBuilder = KyselyFactory.createBuilder<Database, 'users'>(
|
|
12081
|
+
'users',
|
|
12082
|
+
({ faker }) => ({
|
|
12083
|
+
id: faker.string.uuid(),
|
|
12084
|
+
name: faker.person.fullName(),
|
|
12085
|
+
email: faker.internet.email(),
|
|
12086
|
+
createdAt: new Date(),
|
|
12087
|
+
}),
|
|
12088
|
+
);
|
|
12020
12089
|
|
|
12021
12090
|
const builders = { users: usersBuilder };
|
|
12022
12091
|
const seeds = {};
|
|
12023
12092
|
|
|
12093
|
+
/**
|
|
12094
|
+
* This database's factory. \`gkm test\` builds it on each feature test's
|
|
12095
|
+
* transaction and hands it over as \`factories.get('${(0, _geekmidas_manifest.serviceKey)(db.id)}')\`.
|
|
12096
|
+
*/
|
|
12024
12097
|
export function createFactory(db: Kysely<Database>) {
|
|
12025
12098
|
return new KyselyFactory<Database, typeof builders, typeof seeds>(
|
|
12026
12099
|
builders,
|
|
@@ -12031,38 +12104,7 @@ export function createFactory(db: Kysely<Database>) {
|
|
|
12031
12104
|
|
|
12032
12105
|
export type Factory = ReturnType<typeof createFactory>;
|
|
12033
12106
|
`
|
|
12034
|
-
|
|
12035
|
-
{
|
|
12036
|
-
path: "test/factory/users.ts",
|
|
12037
|
-
content: `import { KyselyFactory } from '@geekmidas/testkit/kysely';
|
|
12038
|
-
import type { Database } from '${schema}';
|
|
12039
|
-
|
|
12040
|
-
export const usersBuilder = KyselyFactory.createBuilder<Database, 'users'>(
|
|
12041
|
-
'users',
|
|
12042
|
-
({ faker }) => ({
|
|
12043
|
-
id: faker.string.uuid(),
|
|
12044
|
-
name: faker.person.fullName(),
|
|
12045
|
-
email: faker.internet.email(),
|
|
12046
|
-
createdAt: new Date(),
|
|
12047
|
-
}),
|
|
12048
|
-
);
|
|
12049
|
-
`
|
|
12050
|
-
},
|
|
12051
|
-
{
|
|
12052
|
-
path: "test/example.spec.ts",
|
|
12053
|
-
content: `import { describe, expect } from 'vitest';
|
|
12054
|
-
import { it } from './config.ts';
|
|
12055
|
-
|
|
12056
|
-
describe('example', () => {
|
|
12057
|
-
it('should have a working test setup', async ({ trx }) => {
|
|
12058
|
-
// trx is a Kysely transaction; everything in it is rolled back after the
|
|
12059
|
-
// test
|
|
12060
|
-
expect(trx).toBeDefined();
|
|
12061
|
-
});
|
|
12062
|
-
});
|
|
12063
|
-
`
|
|
12064
|
-
}
|
|
12065
|
-
];
|
|
12107
|
+
}];
|
|
12066
12108
|
}
|
|
12067
12109
|
//#endregion
|
|
12068
12110
|
//#region src/init/generators/ui.ts
|
|
@@ -14532,7 +14574,8 @@ async function initCommand(projectName, options = {}) {
|
|
|
14532
14574
|
...generateGithubFiles(templateOptions),
|
|
14533
14575
|
...generateMonorepoFiles(templateOptions, baseTemplate),
|
|
14534
14576
|
...generateRootConstructs(templateOptions),
|
|
14535
|
-
...generateModelsPackage(templateOptions)
|
|
14577
|
+
...generateModelsPackage(templateOptions),
|
|
14578
|
+
...generateTestFactoryFiles(templateOptions)
|
|
14536
14579
|
] : [];
|
|
14537
14580
|
const webAppFiles = isFullstack ? frontendFramework === "tanstack-start" ? generateTanStackWebFiles(templateOptions) : frontendFramework === "expo" ? generateExpoAppFiles(templateOptions) : generateWebAppFiles(templateOptions) : [];
|
|
14538
14581
|
const authAppFiles = isFullstack ? generateAuthAppFiles(templateOptions) : [];
|
|
@@ -14995,7 +15038,7 @@ var NoStoredSecrets = class extends Error {
|
|
|
14995
15038
|
}
|
|
14996
15039
|
};
|
|
14997
15040
|
async function reconcile(secrets, workspace, stage) {
|
|
14998
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-
|
|
15041
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-LKFnEBX8.cjs")).then((n) => n.workspace_exports);
|
|
14999
15042
|
const result = require_reconcile.reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
15000
15043
|
return result ? {
|
|
15001
15044
|
secrets: result.secrets,
|
|
@@ -15339,7 +15382,8 @@ async function testCommand(options = {}) {
|
|
|
15339
15382
|
patterns: require_workspace$1.constructGlobs(workspace),
|
|
15340
15383
|
cacheBackend: require_workspace$1.backendsOf(workspace).cache,
|
|
15341
15384
|
stage: require_workspace.TEST_STAGE,
|
|
15342
|
-
env: finalCredentials
|
|
15385
|
+
env: finalCredentials,
|
|
15386
|
+
factories: (0, node_path.join)(workspace.root, workspace.test.factories ?? "test/factories")
|
|
15343
15387
|
}) : void 0;
|
|
15344
15388
|
if (options.prepare) {
|
|
15345
15389
|
console.log(manifestPath ? ` 🧪 Test harness written beside ${manifestPath}` : " 🧪 Nothing to prepare: this project declares no constructs");
|
|
@@ -15393,7 +15437,7 @@ async function testCommand(options = {}) {
|
|
|
15393
15437
|
* starts without the reference data the app needs.
|
|
15394
15438
|
*/
|
|
15395
15439
|
async function migrateTestStage(workspace, env) {
|
|
15396
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
15440
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
|
|
15397
15441
|
const { discover } = await Promise.resolve().then(() => require("./discover-CroTIm0K.cjs")).then((n) => n.discover_exports);
|
|
15398
15442
|
const sources = {};
|
|
15399
15443
|
const manifest = await discover({
|
|
@@ -15838,7 +15882,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
15838
15882
|
try {
|
|
15839
15883
|
const globalOptions = program.opts();
|
|
15840
15884
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
15841
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
15885
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
|
|
15842
15886
|
await migrateCommand({
|
|
15843
15887
|
...options,
|
|
15844
15888
|
...construct ? { construct } : {}
|
|
@@ -15852,7 +15896,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
15852
15896
|
try {
|
|
15853
15897
|
const globalOptions = program.opts();
|
|
15854
15898
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
15855
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
15899
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
|
|
15856
15900
|
await seedCommand({
|
|
15857
15901
|
...options,
|
|
15858
15902
|
...construct ? { construct } : {}
|
|
@@ -15866,7 +15910,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
15866
15910
|
try {
|
|
15867
15911
|
const globalOptions = program.opts();
|
|
15868
15912
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
15869
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
15913
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
|
|
15870
15914
|
await migrationCommand({
|
|
15871
15915
|
construct,
|
|
15872
15916
|
...name ? { name } : {}
|
|
@@ -16034,7 +16078,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
16034
16078
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
16035
16079
|
process.exit(1);
|
|
16036
16080
|
}
|
|
16037
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-
|
|
16081
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-LKFnEBX8.cjs")).then((n) => n.workspace_exports);
|
|
16038
16082
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
16039
16083
|
if (!result) {
|
|
16040
16084
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -16093,7 +16137,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
16093
16137
|
try {
|
|
16094
16138
|
const globalOptions = program.opts();
|
|
16095
16139
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16096
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
16140
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-JhvrmjQp.cjs"));
|
|
16097
16141
|
await deployGithubCommand(options);
|
|
16098
16142
|
} catch (error) {
|
|
16099
16143
|
console.error(formatError(error));
|