@dunx/create-app 3.0.1 → 3.0.2

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.
@@ -38,7 +38,7 @@ export interface Feature {
38
38
  * `examples/full/src/config.ts` states for every group at once, split so a
39
39
  * selection can state only its own.
40
40
  */
41
- export interface ConfigGroup {
41
+ interface ConfigGroup {
42
42
  readonly schema: readonly string[];
43
43
  readonly field: string;
44
44
  readonly map: string;
@@ -67,3 +67,4 @@ export declare class UnknownFeatureError extends Error {
67
67
  export declare const resolveFeatures: (requested: readonly string[]) => readonly Feature[];
68
68
  /** Which of the resolved features the caller did not ask for. */
69
69
  export declare const impliedBy: (requested: readonly string[], resolved: readonly Feature[]) => readonly string[];
70
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { type Feature } from './features.js';
2
2
  /** Every config group the selection needs, base first, in a stable order. */
3
3
  export declare const configGroupsFor: (features: readonly Feature[]) => readonly string[];
4
- export declare const dependenciesFor: (features: readonly Feature[]) => readonly string[];
5
4
  export declare const manifest: (features: readonly Feature[]) => string;
6
5
  /**
7
6
  * Third-party ranges, pinned here rather than read off `examples/full` at run time:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dunx/create-app",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Scaffold a new dunx application - bunx @dunx/create-app my-api",
5
5
  "keywords": [
6
6
  "bun",
@@ -22,7 +22,7 @@ import { ProfileController } from './profile.controller.js';
22
22
  // `AppConfigService` does not: ConfigModule is global.
23
23
  imports: [DatabaseModule],
24
24
  useFactory: (config: AppConfigService, connection: DbConnection) => ({
25
- secret: config.get('auth').secret,
25
+ secret: config.get('auth.secret'),
26
26
  baseURL: `http://localhost:${config.get('port')}`,
27
27
  // What better-auth matches a pathname against; the global prefix is
28
28
  // what makes the mounted `/auth` route answer here.
@@ -23,7 +23,9 @@ import * as schema from './schema.js';
23
23
  new SyncSqliteOptions({
24
24
  // Required: the type argument every constructor below sees.
25
25
  schema,
26
- filename: config.get('database').file,
26
+ // A dotted path, checked against AppConfig the same way a top-level
27
+ // key is. `config.get('database').file` still reads the same value.
28
+ filename: config.get('database.file'),
27
29
  pragmas: ['foreign_keys = ON'],
28
30
  }),
29
31
  inject: [AppConfigService],
@@ -1,9 +1,9 @@
1
1
  import { Logger } from '@dunx/core';
2
2
  import type { OnInit, OnShutdown } from '@dunx/core';
3
3
  import {
4
+ asSqlite,
4
5
  DbConnection,
5
6
  runSeeds,
6
- SqliteConnection,
7
7
  SyncDatabase,
8
8
  transaction,
9
9
  transactionSync,
@@ -139,10 +139,14 @@ export class Ledger implements OnInit, OnShutdown {
139
139
  'table "ledger" created at onInit',
140
140
  );
141
141
 
142
- // `raw` is `unknown` on the base, so `instanceof` restores the driver type.
143
- if (this.connection instanceof SqliteConnection) {
144
- logger.info(`raw driver -> bun:sqlite ${this.connection.raw.filename}`);
145
- }
142
+ // `raw` is `unknown` on the base, because the base also describes `Bun.SQL`.
143
+ // `asSqlite` checks the connection and hands back the `bun:sqlite` handle, so
144
+ // pragmas and triggers are reachable without a cast.
145
+ const driver = asSqlite(this.connection);
146
+ const journal = driver.query('pragma journal_mode').get();
147
+ logger.info(
148
+ `raw driver -> bun:sqlite ${driver.filename}, ${JSON.stringify(journal)}`,
149
+ );
146
150
 
147
151
  logger.info(
148
152
  `insert -> ${JSON.stringify(this.add('opening balance', 100))}`,
@@ -20,6 +20,10 @@ import { ThumbnailJobs } from './thumbnail.jobs.js';
20
20
  prefix: 'dunx-full',
21
21
  // The container starts the workers at onInit and stops them before
22
22
  // the database they use, so `main.ts` says nothing about queues.
23
+ //
24
+ // `true`, not `'if-any'`: this module declares handlers, and `true`
25
+ // refuses to boot if that ever stops being so. `'if-any'` is for a
26
+ // migration where the wiring lands before the first @JobHandler.
23
27
  consume: true,
24
28
  // Where bullmq forks for a `background` handler. Absolute: the child
25
29
  // resolves it, not this module.