stonyx 0.2.3-alpha.5 → 0.2.3-alpha.50

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.
Files changed (67) hide show
  1. package/README.md +18 -7
  2. package/config/{environment.js → environment copy.ts } +16 -12
  3. package/dist/cli/help.d.ts +8 -0
  4. package/dist/cli/help.js +43 -0
  5. package/dist/cli/load-commands.d.ts +10 -0
  6. package/dist/cli/load-commands.js +49 -0
  7. package/dist/cli/new.d.ts +49 -0
  8. package/dist/cli/new.js +341 -0
  9. package/dist/cli/serve.d.ts +6 -0
  10. package/dist/cli/serve.js +49 -0
  11. package/dist/cli/test-setup.d.ts +1 -0
  12. package/dist/cli/test-setup.js +30 -0
  13. package/dist/cli/test.d.ts +4 -0
  14. package/dist/cli/test.js +23 -0
  15. package/dist/cli.d.ts +2 -0
  16. package/dist/cli.js +53 -0
  17. package/dist/exports/config.d.ts +2 -0
  18. package/dist/exports/config.js +2 -0
  19. package/dist/exports/log.d.ts +2 -0
  20. package/{src → dist}/exports/log.js +1 -2
  21. package/dist/exports/test-helpers.d.ts +5 -0
  22. package/dist/exports/test-helpers.js +7 -0
  23. package/dist/lifecycle.d.ts +7 -0
  24. package/dist/lifecycle.js +18 -0
  25. package/dist/main.d.ts +22 -0
  26. package/dist/main.js +102 -0
  27. package/dist/modules.d.ts +5 -0
  28. package/dist/modules.js +93 -0
  29. package/dist/util/import-config.d.ts +52 -0
  30. package/dist/util/import-config.js +256 -0
  31. package/dist/util/resolve-entry-point.d.ts +1 -0
  32. package/dist/util/resolve-entry-point.js +14 -0
  33. package/dist/util/resolve-module-name.d.ts +14 -0
  34. package/dist/util/resolve-module-name.js +33 -0
  35. package/package.json +41 -12
  36. package/scripts/postinstall.js +24 -2
  37. package/.claude/index.md +0 -96
  38. package/.github/workflows/ci.yml +0 -16
  39. package/.github/workflows/publish.yml +0 -51
  40. package/docs/api.md +0 -89
  41. package/docs/cli.md +0 -78
  42. package/docs/configuration.md +0 -72
  43. package/docs/conventions/discord-conventions.md +0 -62
  44. package/docs/conventions/framework-modules.md +0 -127
  45. package/docs/conventions/index.md +0 -24
  46. package/docs/conventions/orm-conventions.md +0 -158
  47. package/docs/conventions/project-structure.md +0 -105
  48. package/docs/conventions/rest-conventions.md +0 -96
  49. package/docs/conventions/testing-conventions.md +0 -56
  50. package/docs/developing-modules.md +0 -108
  51. package/docs/index.md +0 -15
  52. package/docs/lifecycle.md +0 -47
  53. package/docs/logging.md +0 -52
  54. package/docs/modules.md +0 -78
  55. package/docs/testing.md +0 -64
  56. package/src/cli/help.js +0 -48
  57. package/src/cli/load-commands.js +0 -56
  58. package/src/cli/new.js +0 -237
  59. package/src/cli/serve.js +0 -38
  60. package/src/cli/test-setup.js +0 -8
  61. package/src/cli/test.js +0 -27
  62. package/src/cli.js +0 -63
  63. package/src/exports/config.js +0 -3
  64. package/src/exports/test-helpers.js +0 -8
  65. package/src/lifecycle.js +0 -17
  66. package/src/main.js +0 -101
  67. package/src/modules.js +0 -112
@@ -0,0 +1,30 @@
1
+ import { createRequire } from 'module';
2
+ import { importConfig } from '../util/import-config.js';
3
+ const cwd = process.cwd();
4
+ const { default: Stonyx } = await import('stonyx');
5
+ const config = await importConfig(`${cwd}/config/environment`);
6
+ new Stonyx(config, cwd);
7
+ // Drain the event loop once qunit finishes. Modules loaded by Stonyx
8
+ // (e.g. @stonyx/rest-server) may keep listeners/servers open that would
9
+ // otherwise block the process from exiting, causing CI to hit timeouts
10
+ // even though all tests passed.
11
+ //
12
+ // qunit's CLI bin does `delete require.cache[qunitPath]` and re-requires
13
+ // qunit before running, so any qunit instance we grab synchronously from
14
+ // this --import setup is a DIFFERENT object than the one qunit's CLI
15
+ // actually uses. We defer the hook registration with setImmediate so it
16
+ // runs AFTER the qunit bin has populated require.cache with its own
17
+ // instance; grabbing qunit via CJS require at that point returns the
18
+ // instance the tests are running on.
19
+ //
20
+ // See: https://github.com/abofs/stonyx/issues/55
21
+ const require = createRequire(import.meta.url);
22
+ setImmediate(() => {
23
+ const qunitPath = require.resolve('qunit', {
24
+ paths: [`${cwd}/node_modules`, cwd]
25
+ });
26
+ const QUnit = require(qunitPath);
27
+ QUnit.on('runEnd', () => {
28
+ setImmediate(() => process.exit(process.exitCode ?? 0));
29
+ });
30
+ });
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_TEST_GLOB = "test/**/*-test.{js,ts}";
2
+ export default function test({ args }: {
3
+ args: string[];
4
+ }): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { spawn } from 'child_process';
2
+ import { fileURLToPath, pathToFileURL } from 'url';
3
+ import path from 'path';
4
+ export const DEFAULT_TEST_GLOB = 'test/**/*-test.{js,ts}';
5
+ export default async function test({ args }) {
6
+ const cwd = process.cwd();
7
+ const setupFile = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'test-setup.js');
8
+ const setupFileUrl = pathToFileURL(setupFile).href;
9
+ const qunitBin = path.resolve(cwd, 'node_modules/qunit/bin/qunit.js');
10
+ const testArgs = args.length > 0 ? args : [DEFAULT_TEST_GLOB];
11
+ const child = spawn(process.execPath, [
12
+ '--import', setupFileUrl,
13
+ qunitBin,
14
+ ...testArgs
15
+ ], {
16
+ cwd,
17
+ stdio: 'inherit',
18
+ env: { ...process.env, NODE_ENV: 'test' }
19
+ });
20
+ child.on('close', (code) => {
21
+ process.exit(code ?? 1);
22
+ });
23
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ import serve from './cli/serve.js';
3
+ import test from './cli/test.js';
4
+ import help from './cli/help.js';
5
+ import newCommand from './cli/new.js';
6
+ import loadModuleCommands from './cli/load-commands.js';
7
+ import { importConfig } from './util/import-config.js';
8
+ try {
9
+ process.loadEnvFile();
10
+ }
11
+ catch { /* no .env file */ }
12
+ const aliases = { s: 'serve', t: 'test', h: 'help', n: 'new' };
13
+ const builtInCommands = {
14
+ serve: { description: 'Bootstrap Stonyx and run the app', run: serve },
15
+ test: { description: 'Bootstrap Stonyx in test mode and run tests', run: test },
16
+ new: { description: 'Scaffold a new Stonyx project', run: newCommand },
17
+ help: { description: 'Show available commands', run: help }
18
+ };
19
+ const args = process.argv.slice(2);
20
+ const commandName = aliases[args[0]] || args[0];
21
+ const commandArgs = args.slice(1);
22
+ async function main() {
23
+ if (!commandName || commandName === 'help') {
24
+ await help({ args: commandArgs, builtInCommands, loadModuleCommands });
25
+ return;
26
+ }
27
+ const builtIn = builtInCommands[commandName];
28
+ if (builtIn) {
29
+ await builtIn.run({ args: commandArgs });
30
+ return;
31
+ }
32
+ // Search module commands
33
+ const moduleCommands = await loadModuleCommands();
34
+ const moduleCommand = moduleCommands[commandName];
35
+ if (moduleCommand) {
36
+ const cwd = process.cwd();
37
+ if (moduleCommand.bootstrap) {
38
+ const config = await importConfig(`${cwd}/config/environment`);
39
+ const { default: Stonyx } = await import('./main.js');
40
+ new Stonyx(config, cwd);
41
+ await Stonyx.ready;
42
+ }
43
+ await moduleCommand.run({ args: commandArgs, cwd });
44
+ return;
45
+ }
46
+ console.error(`Unknown command: ${args[0]}\n`);
47
+ await help({ args: [], builtInCommands, loadModuleCommands });
48
+ process.exit(1);
49
+ }
50
+ main().catch(error => {
51
+ console.error(error);
52
+ process.exit(1);
53
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("stonyx").StoynxConfig;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import Stonyx from 'stonyx';
2
+ export default Stonyx.config;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@stonyx/logs").default;
2
+ export default _default;
@@ -1,3 +1,2 @@
1
1
  import Stonyx from 'stonyx';
2
-
3
- export default Stonyx.log;
2
+ export default Stonyx.log;
@@ -0,0 +1,5 @@
1
+ interface TestHooks {
2
+ before(fn: () => Promise<void>): void;
3
+ }
4
+ export declare function setupIntegrationTests(hooks: TestHooks): void;
5
+ export {};
@@ -0,0 +1,7 @@
1
+ import Stonyx from 'stonyx';
2
+ export function setupIntegrationTests(hooks) {
3
+ hooks.before(async function () {
4
+ await Stonyx.ready;
5
+ console.log('Stonyx ready');
6
+ });
7
+ }
@@ -0,0 +1,7 @@
1
+ export interface StoynxModule {
2
+ init?(): Promise<void>;
3
+ startup?(): Promise<void>;
4
+ shutdown?(): Promise<void>;
5
+ }
6
+ export declare function runStartupHooks(modules: StoynxModule[]): Promise<void>;
7
+ export declare function runShutdownHooks(modules: StoynxModule[]): Promise<void>;
@@ -0,0 +1,18 @@
1
+ export async function runStartupHooks(modules) {
2
+ for (const module of modules) {
3
+ if (typeof module.startup === 'function')
4
+ await module.startup();
5
+ }
6
+ }
7
+ export async function runShutdownHooks(modules) {
8
+ for (const module of [...modules].reverse()) {
9
+ if (typeof module.shutdown === 'function') {
10
+ try {
11
+ await module.shutdown();
12
+ }
13
+ catch (error) {
14
+ console.error('Error during module shutdown:', error);
15
+ }
16
+ }
17
+ }
18
+ }
package/dist/main.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import Chronicle from '@stonyx/logs';
2
+ import type { StoynxModule } from './lifecycle.js';
3
+ import type { StoynxConfig } from './modules.js';
4
+ export default class Stonyx {
5
+ static initialized: boolean;
6
+ static modulePromises: Record<string, unknown>;
7
+ static instance: Stonyx;
8
+ static ready: Promise<void>;
9
+ config: StoynxConfig;
10
+ chronicle: Chronicle;
11
+ modules: StoynxModule[];
12
+ constructor(config: StoynxConfig, rootPath: string);
13
+ start(config: StoynxConfig, rootPath: string): Promise<void>;
14
+ /**
15
+ * Allows users to define their own log for any extra class via environment config
16
+ */
17
+ configureUserLogs(): void;
18
+ static get log(): Chronicle;
19
+ static get config(): StoynxConfig;
20
+ }
21
+ export { waitForModule } from './modules.js';
22
+ export type { StoynxConfig } from './modules.js';
package/dist/main.js ADDED
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Copyright 2025 Stone Costa
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import Chronicle from '@stonyx/logs';
17
+ import loadModules from './modules.js';
18
+ import { mergeObject } from '@stonyx/utils/object';
19
+ import { importConfig, CONFIG_NOT_FOUND_PREFIX } from './util/import-config.js';
20
+ import { resolveModuleName } from './util/resolve-module-name.js';
21
+ export default class Stonyx {
22
+ static initialized = false;
23
+ static modulePromises = {};
24
+ static instance;
25
+ static ready;
26
+ config;
27
+ chronicle;
28
+ modules;
29
+ constructor(config, rootPath) {
30
+ if (Stonyx.instance)
31
+ return Stonyx.instance;
32
+ Stonyx.instance = this;
33
+ Stonyx.ready = this.start(config, rootPath);
34
+ }
35
+ async start(config, rootPath) {
36
+ if (!config)
37
+ throw new Error('Stonyx requires full environment configuration on startup');
38
+ if (!rootPath)
39
+ throw new Error('Stonyx requires root project\'s path on startup');
40
+ // Transform config from stonyx-modules running as a standalone.
41
+ // Signal is the consumer's `package.json#name` (see resolveModuleName);
42
+ // this replaces the brittle `rootPath.includes('stonyx-')` heuristic so
43
+ // non-canonical rootPaths (worktrees, forks, renames) still work.
44
+ const moduleName = resolveModuleName(rootPath);
45
+ if (moduleName) {
46
+ const flatConfig = config;
47
+ const siblingModules = flatConfig.modules || {};
48
+ config = { [moduleName]: config, ...siblingModules };
49
+ delete config.modules;
50
+ }
51
+ this.config = config;
52
+ this.chronicle = new Chronicle({ additionalLogs: { title: 'green' } });
53
+ Stonyx.initialized = true;
54
+ // Auto-merge test environment overrides (after initialized flag, before modules load)
55
+ // Uses in-place mutation to preserve existing references (e.g. stonyx/config export cache)
56
+ if (process.env.NODE_ENV === 'test') {
57
+ try {
58
+ const testOverrides = await importConfig(`${rootPath}/test/config/environment`);
59
+ const merged = mergeObject(config, testOverrides);
60
+ Object.assign(config, merged);
61
+ }
62
+ catch (err) {
63
+ // A test override that is genuinely ABSENT is non-fatal. Everything else
64
+ // re-throws — including `CONFIG_NOT_LOADABLE_PREFIX`, which is the whole
65
+ // point of that prefix existing (abofs/stonyx#105, invariant I2). A
66
+ // config the consumer wrote and this loader declined must never reach
67
+ // the caller as "you have no test overrides".
68
+ if (!(err instanceof Error) || !err.message.startsWith(CONFIG_NOT_FOUND_PREFIX))
69
+ throw err;
70
+ }
71
+ }
72
+ this.modules = await loadModules(config, rootPath, this.chronicle);
73
+ this.configureUserLogs();
74
+ }
75
+ /**
76
+ * Allows users to define their own log for any extra class via environment config
77
+ */
78
+ configureUserLogs() {
79
+ const { chronicle } = this;
80
+ for (const [className, config] of Object.entries(this.config)) {
81
+ if (!config || typeof config !== 'object')
82
+ continue;
83
+ if (className in chronicle)
84
+ continue;
85
+ const { logColor, logMethod, logTimestamp } = config;
86
+ if (!logColor)
87
+ continue;
88
+ chronicle.defineType(logMethod || className, logColor, { logTimestamp: !!logTimestamp });
89
+ }
90
+ }
91
+ static get log() {
92
+ if (!Stonyx.initialized)
93
+ throw new Error('Stonyx has not been initialized yet');
94
+ return Stonyx.instance.chronicle;
95
+ }
96
+ static get config() {
97
+ if (!Stonyx.initialized)
98
+ throw new Error('Stonyx has not been initialized yet');
99
+ return Stonyx.instance.config;
100
+ }
101
+ }
102
+ export { waitForModule } from './modules.js';
@@ -0,0 +1,5 @@
1
+ import type { StoynxModule } from './lifecycle.js';
2
+ import type Chronicle from '@stonyx/logs';
3
+ export type StoynxConfig = Record<string, Record<string, unknown> | unknown>;
4
+ export default function loadModules(config: StoynxConfig, rootPath: string, chronicle: Chronicle): Promise<StoynxModule[]>;
5
+ export declare function waitForModule(moduleName: string): Promise<void>;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Validates and initializes stonyx modules
3
+ * TODO: Refactor into a ModuleLoader class (good coding exercise)
4
+ */
5
+ import { readFile } from '@stonyx/utils/file';
6
+ import { kebabCaseToCamelCase } from '@stonyx/utils/string';
7
+ import { mergeObject } from '@stonyx/utils/object';
8
+ import { importConfig } from './util/import-config.js';
9
+ const modulePromises = {};
10
+ // Configure module-specific logging
11
+ function configureLog(chronicle, module, config) {
12
+ const { logColor, logMethod, logTimestamp } = config;
13
+ if (!logColor)
14
+ return;
15
+ chronicle.defineType(logMethod || module, logColor, { logTimestamp: !!logTimestamp });
16
+ }
17
+ function initializeModule(moduleName, moduleClass, modules, initPromises) {
18
+ const moduleInstance = new moduleClass();
19
+ modules.push(moduleInstance);
20
+ if (!moduleInstance.init)
21
+ return;
22
+ initPromises.push((async () => {
23
+ await moduleInstance.init();
24
+ modulePromises[moduleName]?.resolve();
25
+ })());
26
+ }
27
+ export default async function loadModules(config, rootPath, chronicle) {
28
+ const modules = [];
29
+ const initPromises = [];
30
+ const rootPackage = await readFile(`${rootPath}/package.json`, { json: true });
31
+ const dependencies = (rootPackage.devDependencies || {});
32
+ const projectName = typeof rootPackage.name === 'string' ? rootPackage.name : '';
33
+ // Expose rootPath to public configuration
34
+ config.rootPath = rootPath;
35
+ const moduleDependencies = Object.keys(dependencies).filter((moduleName) => moduleName.startsWith('@stonyx/'));
36
+ // Setup module promises prior to initialization
37
+ for (const moduleName of moduleDependencies) {
38
+ const promise = {};
39
+ modulePromises[moduleName] = promise;
40
+ promise.ready = new Promise(resolve => promise.resolve = resolve);
41
+ }
42
+ // Standalone module configuration
43
+ if (Array.isArray(rootPackage.keywords) && rootPackage.keywords.includes('stonyx-module')) {
44
+ configureLog(chronicle, projectName, config);
45
+ const entryPoint = typeof rootPackage.main === 'string' ? rootPackage.main : '';
46
+ const { default: moduleClass } = await import(`${rootPath}/${entryPoint}`);
47
+ initializeModule(projectName, moduleClass, modules, initPromises);
48
+ }
49
+ for (const moduleName of moduleDependencies) {
50
+ const modulePackage = await readFile(`${rootPath}/node_modules/${moduleName}/package.json`, { json: true, missingFileCallback: (_filePath) => {
51
+ console.warn(`Warning: Could not locate stonyx module: "${moduleName}". Module was not loaded`);
52
+ return '';
53
+ } });
54
+ if (!modulePackage)
55
+ continue;
56
+ const keywords = Array.isArray(modulePackage.keywords) ? modulePackage.keywords : [];
57
+ if (!keywords.includes('stonyx-module')) {
58
+ console.warn(`Warning: Stonyx modules must contain the "stonyx-module" keyword. Module was not loaded`);
59
+ continue;
60
+ }
61
+ if (!keywords.includes('stonyx-async')) {
62
+ modulePromises[moduleName].resolve();
63
+ continue;
64
+ }
65
+ try {
66
+ // Load & Configure Async Modules
67
+ const moduleConfig = await importConfig(`${rootPath}/node_modules/${moduleName}/config/environment`);
68
+ const module = kebabCaseToCamelCase(moduleName.split('/').pop() ?? moduleName);
69
+ const userConfig = config[module] || {};
70
+ const finalConfig = mergeObject(moduleConfig, userConfig);
71
+ config[module] = finalConfig;
72
+ // Configure module-specific logging
73
+ configureLog(chronicle, module, finalConfig);
74
+ const entryPoint = modulePackage.main;
75
+ const { default: moduleClass } = await import(`${rootPath}/node_modules/${moduleName}/${entryPoint}`);
76
+ initializeModule(moduleName, moduleClass, modules, initPromises);
77
+ }
78
+ catch (error) {
79
+ console.error(error);
80
+ throw new Error(`Stonyx modules with async loading must have a config/environment.js file with default configurations. Module "${moduleName}" failed to load.`);
81
+ }
82
+ }
83
+ // Wait until all modules are initialized
84
+ await Promise.all(initPromises);
85
+ return modules;
86
+ }
87
+ export async function waitForModule(moduleName) {
88
+ const fullName = `@stonyx/${moduleName}`;
89
+ const modulePromise = modulePromises[fullName];
90
+ if (!modulePromise)
91
+ throw new Error(`Could wait for module: ${fullName}. Module was not registered in project dependencies`);
92
+ await modulePromises[fullName].ready;
93
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * "There is no config here." Callers are allowed to treat this as benign —
3
+ * `src/main.ts` does, for the optional `test/config/environment.*` override.
4
+ *
5
+ * `main.ts` matches on this exact string, so it is exported rather than
6
+ * duplicated: the swallow and the thrower must not be able to drift apart.
7
+ */
8
+ export declare const CONFIG_NOT_FOUND_PREFIX = "Config not found:";
9
+ /**
10
+ * "There is a config here and I declined to load it." Deliberately NOT prefixed
11
+ * with `CONFIG_NOT_FOUND_PREFIX`, because `main.ts`'s `NODE_ENV=test` catch
12
+ * swallows that prefix and must not swallow this.
13
+ *
14
+ * This is invariant I2 of the Sprint 93 install-and-boot cluster — "no silent
15
+ * decline". Before #105 the two states were literally indistinguishable:
16
+ * measured against `stonyx@0.2.3-beta.95`, a consumer with `config/environment.ts`
17
+ * and the same consumer after `mv config/environment.js config/environment.xyz`
18
+ * both produced the byte-identical `Config not found: .../config/environment.js`.
19
+ */
20
+ export declare const CONFIG_NOT_LOADABLE_PREFIX = "Config present but not loadable:";
21
+ /**
22
+ * Did this runtime refuse OUR config file, or something our config imported?
23
+ *
24
+ * `FILE_TYPE_REFUSAL_CODES.has(code)` alone cannot tell. A config that loaded
25
+ * and ran perfectly well, but whose own nested `import()` hit a `.ts` under
26
+ * `node_modules`, throws the SAME code — and was reported as "this Node runtime
27
+ * refused to load your config", naming a file that is fine. That misdirection
28
+ * points the consumer at the one file that is not the problem, and the likeliest
29
+ * instance of it is the exact `.ts`-under-node_modules case this loader's own
30
+ * docs tell people to look for.
31
+ *
32
+ * FAIL DIRECTION — this is the property, not an implementation detail.
33
+ * `true` means "re-frame this as a refusal of the config", which is exactly the
34
+ * F-3 misdirection above. So when no path can be extracted this returns
35
+ * `false`, and the caller rethrows Node's own error untouched, `cause` and all.
36
+ * The consumer then reads what actually happened instead of a friendly sentence
37
+ * about the wrong file. This is what makes every future gap in the two patterns
38
+ * harmless: an unparseable message costs the I2 re-framing, not correctness.
39
+ *
40
+ * It previously returned `true` here, on the reasoning that keeping the loud
41
+ * re-frame mattered more than getting the filename right. Measured, that is
42
+ * backwards: the raw error is loud too — `main.ts`'s `NODE_ENV=test` swallow
43
+ * only absorbs `CONFIG_NOT_FOUND_PREFIX`, which a Node refusal never starts
44
+ * with — so failing this way loses nothing and stops naming the wrong file.
45
+ *
46
+ * Exported ONLY so its branches can be reached directly. Driving it through
47
+ * `importConfig` reaches the two path-comparison outcomes and nothing else.
48
+ * A predicate inside the guard that makes failures loud does not get to have
49
+ * branches no test can reach.
50
+ */
51
+ export declare function refusalIsAboutTheConfig(message: string, configPath: string): boolean;
52
+ export declare function importConfig<T = unknown>(basePath: string): Promise<T>;