@fougere/compiler 0.8.4-alpha.0
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/LICENSE +21 -0
- package/dist/boot.d.ts +42 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +59 -0
- package/dist/boot.js.map +1 -0
- package/dist/declarations.d.ts +35 -0
- package/dist/declarations.d.ts.map +1 -0
- package/dist/declarations.js +75 -0
- package/dist/declarations.js.map +1 -0
- package/dist/imports.d.ts +17 -0
- package/dist/imports.d.ts.map +1 -0
- package/dist/imports.js +78 -0
- package/dist/imports.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/placement.d.ts +26 -0
- package/dist/placement.d.ts.map +1 -0
- package/dist/placement.js +69 -0
- package/dist/placement.js.map +1 -0
- package/dist/scan/adapters.d.ts +3 -0
- package/dist/scan/adapters.d.ts.map +1 -0
- package/dist/scan/adapters.js +25 -0
- package/dist/scan/adapters.js.map +1 -0
- package/dist/scan/bundling.d.ts +3 -0
- package/dist/scan/bundling.d.ts.map +1 -0
- package/dist/scan/bundling.js +15 -0
- package/dist/scan/bundling.js.map +1 -0
- package/dist/scan/contract.d.ts +27 -0
- package/dist/scan/contract.d.ts.map +1 -0
- package/dist/scan/contract.js +45 -0
- package/dist/scan/contract.js.map +1 -0
- package/dist/scan/emit.d.ts +11 -0
- package/dist/scan/emit.d.ts.map +1 -0
- package/dist/scan/emit.js +143 -0
- package/dist/scan/emit.js.map +1 -0
- package/dist/scan/handler-parser.d.ts +24 -0
- package/dist/scan/handler-parser.d.ts.map +1 -0
- package/dist/scan/handler-parser.js +602 -0
- package/dist/scan/handler-parser.js.map +1 -0
- package/dist/scan/scanner.d.ts +11 -0
- package/dist/scan/scanner.d.ts.map +1 -0
- package/dist/scan/scanner.js +565 -0
- package/dist/scan/scanner.js.map +1 -0
- package/dist/scan/statement.d.ts +5 -0
- package/dist/scan/statement.d.ts.map +1 -0
- package/dist/scan/statement.js +134 -0
- package/dist/scan/statement.js.map +1 -0
- package/package.json +55 -0
- package/src/boot.ts +105 -0
- package/src/declarations.ts +110 -0
- package/src/imports.ts +94 -0
- package/src/index.ts +14 -0
- package/src/placement.ts +86 -0
- package/src/scan/adapters.ts +32 -0
- package/src/scan/bundling.ts +14 -0
- package/src/scan/contract.ts +79 -0
- package/src/scan/emit.ts +160 -0
- package/src/scan/handler-parser.ts +683 -0
- package/src/scan/scanner.ts +686 -0
- package/src/scan/statement.ts +159 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fougere contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/boot.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type App, type CreateAppOptions, type Extension, type FougereConfig, type Transport } from '@fougere/core';
|
|
2
|
+
import type { Container } from '@fougere/container';
|
|
3
|
+
interface BootOptions {
|
|
4
|
+
/** Project root. Defaults to process.cwd(). */
|
|
5
|
+
root?: string;
|
|
6
|
+
/** Override config (merged with fougere.config.ts). */
|
|
7
|
+
config?: Partial<FougereConfig>;
|
|
8
|
+
/** Container factory. Required. */
|
|
9
|
+
createContainer: () => Container;
|
|
10
|
+
/** Only boot these fronds (by name). Absent = all. */
|
|
11
|
+
fronds?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Remote fronds — label → address. A declared remote wins over local
|
|
14
|
+
* presence (the frond runs elsewhere). Requires `remoteTransport`.
|
|
15
|
+
*/
|
|
16
|
+
remotes?: Record<string, string>;
|
|
17
|
+
/** Builds the transport to reach `remotes`. Supplied by a layer-2 package. */
|
|
18
|
+
remoteTransport?: (url: string) => Transport;
|
|
19
|
+
/** Carries an announced fact out of this process. */
|
|
20
|
+
onEmit?: CreateAppOptions['onEmit'];
|
|
21
|
+
/**
|
|
22
|
+
* storage setup — returns the storage handle (db), an storageFactory, and its two halves.
|
|
23
|
+
* The `db` value is forwarded to the auth provider via AuthContext when `auth` is set.
|
|
24
|
+
*/
|
|
25
|
+
db?: (config: FougereConfig) => {
|
|
26
|
+
db?: unknown;
|
|
27
|
+
storageFactory: CreateAppOptions['storageFactory'];
|
|
28
|
+
/** Bring the schema up to date — an extension's `up`, because it runs after the container. */
|
|
29
|
+
migrate?: (app: App) => Promise<void> | void;
|
|
30
|
+
/** Closes what the factory opened — `boot()` called it, so `boot()` releases it. */
|
|
31
|
+
close?: () => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* What this app takes on beyond its fronds. Appended after the framework's own, so a
|
|
35
|
+
* host adds to the ascent — or replaces a member of it by declaring the same name.
|
|
36
|
+
*/
|
|
37
|
+
extensions?: readonly (Extension | undefined)[];
|
|
38
|
+
}
|
|
39
|
+
/** Boot a Fougere app from fougere.config.ts. */
|
|
40
|
+
export declare function boot(options: BootOptions): Promise<App>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=boot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAIxK,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,UAAU,WAAW;IACnB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,mCAAmC;IACnC,eAAe,EAAE,MAAM,SAAS,CAAC;IACjC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8EAA8E;IAC9E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IAC7C,qDAAqD;IACrD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC;;;OAGG;IACH,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK;QAC9B,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACnD,8FAA8F;QAC9F,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC7C,oFAAoF;QACpF,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,CAAC;CACjD;AAED,iDAAiD;AACjD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CA4D7D"}
|
package/dist/boot.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Logger, applyConfig, createApp, migrating, seeding } from '@fougere/core';
|
|
2
|
+
import { loadConfig } from '@fougere/core/node';
|
|
3
|
+
import { scanProject } from './scan/scanner.js';
|
|
4
|
+
/** Boot a Fougere app from fougere.config.ts. */
|
|
5
|
+
export async function boot(options) {
|
|
6
|
+
const bootStart = performance.now();
|
|
7
|
+
const log = new Logger('boot');
|
|
8
|
+
const root = options.root ?? process.cwd();
|
|
9
|
+
log.info(`root: ${root}`);
|
|
10
|
+
log.debug('loading config');
|
|
11
|
+
const fileConfig = await loadConfig(root);
|
|
12
|
+
const config = { ...fileConfig, ...options.config };
|
|
13
|
+
// What this config changes in the process, said the same way at boot and at reload —
|
|
14
|
+
// there is one applier, and a host re-reading later calls the very same function.
|
|
15
|
+
applyConfig(config);
|
|
16
|
+
log.info('config loaded');
|
|
17
|
+
let dbSetup;
|
|
18
|
+
if (options.db) {
|
|
19
|
+
log.debug('initializing database');
|
|
20
|
+
dbSetup = options.db(config);
|
|
21
|
+
log.info('database initialized');
|
|
22
|
+
}
|
|
23
|
+
log.debug('creating app (scan + container)');
|
|
24
|
+
const app = await createApp({
|
|
25
|
+
// boot() lives on the Node entry, so boot() is what reads the disk. `createApp` is
|
|
26
|
+
// handed the answer and reaches for nothing.
|
|
27
|
+
scan: await scanProject(root, options.fronds, config.conventions),
|
|
28
|
+
createContainer: options.createContainer,
|
|
29
|
+
storageFactory: dbSetup?.storageFactory,
|
|
30
|
+
db: dbSetup?.db,
|
|
31
|
+
auth: config.auth,
|
|
32
|
+
remotes: options.remotes,
|
|
33
|
+
ports: config.ports,
|
|
34
|
+
// Read from the config for the same reason `ports` is, one line up: it is a fact the
|
|
35
|
+
// project states, not one the caller passes. Absent here, `serveRest` and
|
|
36
|
+
// `serveGraphQL` both answered `pass` on an app whose config declared them — the
|
|
37
|
+
// hosts got it right through their own boot (`app/shared/src/boot.ts`), and this
|
|
38
|
+
// path, the conventional one, served nothing.
|
|
39
|
+
adapters: config.adapters,
|
|
40
|
+
// boot() called the factory, so boot() owns closing what it opened. Not an extension:
|
|
41
|
+
// it was opened before the container existed, so it closes after the container goes.
|
|
42
|
+
onDispose: dbSetup?.close,
|
|
43
|
+
/**
|
|
44
|
+
* The whole ascent, in one ordered list — tables, then rows, then whatever the host takes on.
|
|
45
|
+
*/
|
|
46
|
+
extensions: [
|
|
47
|
+
migrating(dbSetup?.migrate, (message) => log.warn(message)),
|
|
48
|
+
seeding((message) => log.debug(message)),
|
|
49
|
+
...(options.extensions ?? []),
|
|
50
|
+
],
|
|
51
|
+
onEmit: options.onEmit,
|
|
52
|
+
remoteTransport: options.remoteTransport,
|
|
53
|
+
});
|
|
54
|
+
log.info(`ascent: ${app.extensions().join(' → ') || 'nothing declared'}`);
|
|
55
|
+
const ms = (performance.now() - bootStart).toFixed(0);
|
|
56
|
+
log.info(`ready in ${ms}ms — ${app.fronds.length} frond(s)`);
|
|
57
|
+
return app;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=boot.js.map
|
package/dist/boot.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAuF,MAAM,eAAe,CAAC;AACxK,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;A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AE,OAAO,EAAE,EAAE;QACf,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,qFAAqF;QACrF,0EAA0E;QAC1E,iFAAiF;QACjF,iFAAiF;QACjF,8CAA8C;QAC9C,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,sFAAsF;QACtF,qFAAqF;QACrF,SAAS,EAAE,OAAO,EAAE,KAAK;QACzB;;WAEG;QACH,UAAU,EAAE;YACV,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3D,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACxC,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;SAC9B;QACD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,eAAe,EAAE,OAAO,CAAC,eAAe;KACzC,CAAC,CAAC;IAEH,GAAG,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAE1E,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,WAAW,CAAC,CAAC;IAE7D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** What a handler file declares besides its handler. */
|
|
2
|
+
import { type Conventions } from '@fougere/core';
|
|
3
|
+
import { type HandlerEntry } from '@fougere/core/descriptor';
|
|
4
|
+
export interface HandlerDeclaration {
|
|
5
|
+
/** Stable rule name — the same vocabulary `verify()` uses. */
|
|
6
|
+
rule: 'handler-declaration';
|
|
7
|
+
frond: string;
|
|
8
|
+
filePath: string;
|
|
9
|
+
/** The handler that hosts it. */
|
|
10
|
+
handler: string;
|
|
11
|
+
/** What is declared — `AGREED_WITHIN`, `says`, `Assessment`. */
|
|
12
|
+
subject: string;
|
|
13
|
+
/** What it is in the source: a value, or a shape. */
|
|
14
|
+
kind: 'value' | 'shape';
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Everything a handler file declares that is not the handler itself.
|
|
19
|
+
*
|
|
20
|
+
* A handler names gestures; what a gesture uses is declared where its nature says, and one
|
|
21
|
+
* question settles which: does it arrive INJECTED or IMPORTED? A threshold, a formula, a word
|
|
22
|
+
* list arrive imported and belong under `rules/`. Anything holding a client, a connection or
|
|
23
|
+
* a cursor arrives injected and belongs under `services/`. Neither ever belongs in the file
|
|
24
|
+
* that calls it — nothing there can be reached by a second caller, and the handler grows into
|
|
25
|
+
* the domain it was supposed to address.
|
|
26
|
+
*
|
|
27
|
+
* It names the two addresses, which `outsideConventions` does on the same question one file
|
|
28
|
+
* higher. Saying "a module beside its entities" instead left the reader to invent a place,
|
|
29
|
+
* and inventing one is the drift both rules report.
|
|
30
|
+
*/
|
|
31
|
+
export declare function handlerDeclarations(fronds: readonly {
|
|
32
|
+
name: string;
|
|
33
|
+
handlers: readonly Pick<HandlerEntry, 'name' | 'filePath'>[];
|
|
34
|
+
}[], conventions: Conventions): Promise<HandlerDeclaration[]>;
|
|
35
|
+
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../src/declarations.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAU7D,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAuBD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;CAC9D,EAAE,EACH,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA0C/B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
let _ts;
|
|
3
|
+
async function loadTs() {
|
|
4
|
+
if (!_ts)
|
|
5
|
+
_ts = (await import('@typescript/typescript6')).default;
|
|
6
|
+
return _ts;
|
|
7
|
+
}
|
|
8
|
+
function subjectsOf(typescript, source) {
|
|
9
|
+
const found = [];
|
|
10
|
+
for (const statement of source.statements) {
|
|
11
|
+
if (typescript.isVariableStatement(statement)) {
|
|
12
|
+
for (const declared of statement.declarationList.declarations)
|
|
13
|
+
if (typescript.isIdentifier(declared.name))
|
|
14
|
+
found.push([declared.name.text, 'value']);
|
|
15
|
+
}
|
|
16
|
+
else if (typescript.isFunctionDeclaration(statement) && statement.name) {
|
|
17
|
+
found.push([statement.name.text, 'value']);
|
|
18
|
+
}
|
|
19
|
+
else if (typescript.isInterfaceDeclaration(statement) ||
|
|
20
|
+
typescript.isTypeAliasDeclaration(statement) ||
|
|
21
|
+
typescript.isEnumDeclaration(statement)) {
|
|
22
|
+
found.push([statement.name.text, 'shape']);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return found;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Everything a handler file declares that is not the handler itself.
|
|
29
|
+
*
|
|
30
|
+
* A handler names gestures; what a gesture uses is declared where its nature says, and one
|
|
31
|
+
* question settles which: does it arrive INJECTED or IMPORTED? A threshold, a formula, a word
|
|
32
|
+
* list arrive imported and belong under `rules/`. Anything holding a client, a connection or
|
|
33
|
+
* a cursor arrives injected and belongs under `services/`. Neither ever belongs in the file
|
|
34
|
+
* that calls it — nothing there can be reached by a second caller, and the handler grows into
|
|
35
|
+
* the domain it was supposed to address.
|
|
36
|
+
*
|
|
37
|
+
* It names the two addresses, which `outsideConventions` does on the same question one file
|
|
38
|
+
* higher. Saying "a module beside its entities" instead left the reader to invent a place,
|
|
39
|
+
* and inventing one is the drift both rules report.
|
|
40
|
+
*/
|
|
41
|
+
export async function handlerDeclarations(fronds, conventions) {
|
|
42
|
+
const typescript = await loadTs();
|
|
43
|
+
const found = [];
|
|
44
|
+
for (const frond of fronds) {
|
|
45
|
+
for (const handler of frond.handlers) {
|
|
46
|
+
const text = await readFile(handler.filePath, 'utf8').catch(() => undefined);
|
|
47
|
+
if (text === undefined)
|
|
48
|
+
continue;
|
|
49
|
+
const source = typescript.createSourceFile(handler.filePath, text, typescript.ScriptTarget.Latest, false);
|
|
50
|
+
for (const [subject, kind] of subjectsOf(typescript, source)) {
|
|
51
|
+
found.push({
|
|
52
|
+
rule: 'handler-declaration',
|
|
53
|
+
frond: frond.name,
|
|
54
|
+
filePath: handler.filePath,
|
|
55
|
+
handler: handler.name,
|
|
56
|
+
subject,
|
|
57
|
+
kind,
|
|
58
|
+
message: kind === 'value'
|
|
59
|
+
? `'${subject}' is declared in ${handler.name}, so only ${handler.name} can reach it. `
|
|
60
|
+
+ `If it needs nothing but its arguments, it is a word of '${frond.name}' and belongs `
|
|
61
|
+
+ `in \`${conventions.dirs.rules}/\`; if it holds a dependency, it belongs in `
|
|
62
|
+
+ `\`${conventions.dirs.services}/\`. Either way it is stated once and imported, and `
|
|
63
|
+
+ `the handler keeps only the gesture.`
|
|
64
|
+
: `'${subject}' is declared in ${handler.name}, which makes the shape of what an `
|
|
65
|
+
+ `operation answers readable only from the file that answers it. A shape belongs `
|
|
66
|
+
+ `with the entity it describes in \`${conventions.dirs.entities}/\`, or in `
|
|
67
|
+
+ `\`${conventions.dirs.rules}/\` beside the words that compute it — where the caller, `
|
|
68
|
+
+ `the test and the other operations can all name it.`,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return found;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["../src/declarations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,IAAI,GAA0B,CAAC;AAC/B,KAAK,UAAU,MAAM;IACnB,IAAI,CAAC,GAAG;QAAE,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC;IAClE,OAAO,GAAG,CAAC;AACb,CAAC;AAgBD,SAAS,UAAU,CAAC,UAAqB,EAAE,MAAqB;IAC9D,MAAM,KAAK,GAAkC,EAAE,CAAC;IAEhD,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,IAAI,UAAU,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9C,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,eAAe,CAAC,YAAY;gBAC3D,IAAI,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC;oBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CA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,CAAC;gBAC7D,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,qBAAqB;oBAC3B,KAAK,EAAE,KAAK,CAAC,IAAI;oBACjB,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,OAAO,EAAE,OAAO,CAAC,IAAI;oBACrB,OAAO;oBACP,IAAI;oBACJ,OAAO,EACL,IAAI,KAAK,OAAO;wBACd,CAAC,CAAC,IAAI,OAAO,oBAAoB,OAAO,CAAC,IAAI,aAAa,OAAO,CAAC,IAAI,iBAAiB;8BACnF,2DAA2D,KAAK,CAAC,IAAI,gBAAgB;8BACrF,QAAQ,WAAW,CAAC,IAAI,CAAC,KAAK,+CAA+C;8BAC7E,KAAK,WAAW,CAAC,IAAI,CAAC,QAAQ,sDAAsD;8BACpF,qCAAqC;wBACzC,CAAC,CAAC,IAAI,OAAO,oBAAoB,OAAO,CAAC,IAAI,qCAAqC;8BAC9E,iFAAiF;8BACjF,qCAAqC,WAAW,CAAC,IAAI,CAAC,QAAQ,aAAa;8BAC3E,KAAK,WAAW,CAAC,IAAI,CAAC,KAAK,2DAA2D;8BACtF,oDAAoD;iBAC7D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** A frond reaching into another one by FILE PATH. */
|
|
2
|
+
import { type FrondDescriptor } from '@fougere/core/descriptor';
|
|
3
|
+
export interface CrossFrondImport {
|
|
4
|
+
/** Stable rule name — the same vocabulary `verify()` uses. */
|
|
5
|
+
rule: 'cross-frond-import';
|
|
6
|
+
/** The frond doing the reaching. */
|
|
7
|
+
frond: string;
|
|
8
|
+
filePath: string;
|
|
9
|
+
/** The specifier as written. */
|
|
10
|
+
specifier: string;
|
|
11
|
+
/** The frond the path lands in — absent when it lands outside every frond. */
|
|
12
|
+
target?: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
/** Every relative import that resolves outside its own frond. */
|
|
16
|
+
export declare function crossFrondImports(fronds: readonly Pick<FrondDescriptor, 'name' | 'source'>[]): Promise<CrossFrondImport[]>;
|
|
17
|
+
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../src/imports.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAWhE,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,oBAAoB,CAAC;IAC3B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AA2BD,iEAAiE;AACjE,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,SAAS,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,CAAC,EAAE,GAC1D,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAwC7B"}
|
package/dist/imports.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import { join, resolve, dirname, relative, isAbsolute } from 'node:path';
|
|
3
|
+
let _ts;
|
|
4
|
+
async function loadTs() {
|
|
5
|
+
if (!_ts)
|
|
6
|
+
_ts = (await import('@typescript/typescript6')).default;
|
|
7
|
+
return _ts;
|
|
8
|
+
}
|
|
9
|
+
/** Is `child` inside `parent`? Path-based, so it says nothing about either existing. */
|
|
10
|
+
function inside(parent, child) {
|
|
11
|
+
const rel = relative(parent, child);
|
|
12
|
+
return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel);
|
|
13
|
+
}
|
|
14
|
+
async function sourcesUnder(dir) {
|
|
15
|
+
const out = [];
|
|
16
|
+
let entries;
|
|
17
|
+
try {
|
|
18
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// Unreadable is the scan's complaint, not this rule's — and an absent directory is
|
|
22
|
+
// ordinary (a frond with no handlers).
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
if (entry.name === 'node_modules' || entry.name.startsWith('.'))
|
|
27
|
+
continue;
|
|
28
|
+
const full = join(dir, entry.name);
|
|
29
|
+
if (entry.isDirectory())
|
|
30
|
+
out.push(...await sourcesUnder(full));
|
|
31
|
+
else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts'))
|
|
32
|
+
out.push(full);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
/** Every relative import that resolves outside its own frond. */
|
|
37
|
+
export async function crossFrondImports(fronds) {
|
|
38
|
+
const typescript = await loadTs();
|
|
39
|
+
// `source.package` is the scoped name the scan already resolved — the remedy this rule
|
|
40
|
+
// prints must be the name that actually resolves, not one rebuilt from a prefix here.
|
|
41
|
+
const roots = fronds.map((frond) => ({
|
|
42
|
+
name: frond.name, path: resolve(frond.source.path), package: frond.source.package,
|
|
43
|
+
}));
|
|
44
|
+
const found = [];
|
|
45
|
+
for (const root of roots) {
|
|
46
|
+
for (const filePath of await sourcesUnder(root.path)) {
|
|
47
|
+
const text = await readFile(filePath, 'utf8').catch(() => undefined);
|
|
48
|
+
if (text === undefined)
|
|
49
|
+
continue;
|
|
50
|
+
for (const { fileName: specifier } of typescript.preProcessFile(text, true, true).importedFiles) {
|
|
51
|
+
if (!specifier.startsWith('.'))
|
|
52
|
+
continue;
|
|
53
|
+
const landed = resolve(dirname(filePath), specifier);
|
|
54
|
+
if (inside(root.path, landed))
|
|
55
|
+
continue;
|
|
56
|
+
const target = roots.find((other) => other.name !== root.name && inside(other.path, landed));
|
|
57
|
+
found.push({
|
|
58
|
+
rule: 'cross-frond-import',
|
|
59
|
+
frond: root.name,
|
|
60
|
+
filePath,
|
|
61
|
+
specifier,
|
|
62
|
+
...(target ? { target: target.name } : {}),
|
|
63
|
+
message: target
|
|
64
|
+
? `'${specifier}' resolves into frond '${target.name}'. A relative path states that `
|
|
65
|
+
+ `these two fronds share a directory tree — a constraint nothing declares, and one `
|
|
66
|
+
+ `that nothing here can see. Write '${target.package}/…' instead: it says the `
|
|
67
|
+
+ `same dependency in terms the model reads, and it is the form \`fougere sync\` writes, `
|
|
68
|
+
+ `so it survives '${target.name}' moving out.`
|
|
69
|
+
: `'${specifier}' resolves outside frond '${root.name}', into no frond at all. `
|
|
70
|
+
+ `Whatever it reaches is not part of any frond's contract, so nothing carries it `
|
|
71
|
+
+ `when this one is deployed on its own.`,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return found;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../src/imports.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEzE,IAAI,GAA0B,CAAC;AAC/B,KAAK,UAAU,MAAM;IACnB,IAAI,CAAC,GAAG;QAAE,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC;IAClE,OAAO,GAAG,CAAC;AACb,CAAC;AAeD,wFAAwF;AACxF,SAAS,MAAM,CAAC,MAAc,EAAE,KAAa;IAC3C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpC,OAAO,GAAG,KAAK,EAAE,IAAI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,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC1C,OAAO,EAAE,MAAM;wBACb,CAAC,CAAC,IAAI,SAAS,0BAA0B,MAAM,CAAC,IAAI,iCAAiC;8BACjF,mFAAmF;8BACnF,qCAAqC,MAAM,CAAC,OAAO,2BAA2B;8BAC9E,wFAAwF;8BACxF,mBAAmB,MAAM,CAAC,IAAI,eAAe;wBACjD,CAAC,CAAC,IAAI,SAAS,6BAA6B,IAAI,CAAC,IAAI,2BAA2B;8BAC5E,iFAAiF;8BACjF,uCAAuC;iBAC9C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The scan: reading a project's source to produce the descriptors core boots from. */
|
|
2
|
+
export { boot } from './boot.js';
|
|
3
|
+
export { scanProject, frondAliases, watchPathsOf } from './scan/scanner.js';
|
|
4
|
+
export { type Conventions, type ConventionsInput, DEFAULT_CONVENTIONS, resolveConventions, frondPackage, frondDirsOf, providerDirsOf, } from '@fougere/core';
|
|
5
|
+
export { RUNTIME_PACKAGES } from './scan/bundling.js';
|
|
6
|
+
export { emitScan, type EmitOptions } from './scan/emit.js';
|
|
7
|
+
export { emitStatement } from './scan/statement.js';
|
|
8
|
+
export { adaptersOf } from './scan/adapters.js';
|
|
9
|
+
export { crossFrondImports, type CrossFrondImport } from './imports.js';
|
|
10
|
+
export { handlerDeclarations, type HandlerDeclaration } from './declarations.js';
|
|
11
|
+
export { outsideConventions, type OutsideConvention } from './placement.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAC5D,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,GAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The scan: reading a project's source to produce the descriptors core boots from. */
|
|
2
|
+
export { boot } from './boot.js';
|
|
3
|
+
export { scanProject, frondAliases, watchPathsOf } from './scan/scanner.js';
|
|
4
|
+
export { DEFAULT_CONVENTIONS, resolveConventions, frondPackage, frondDirsOf, providerDirsOf, } from '@fougere/core';
|
|
5
|
+
export { RUNTIME_PACKAGES } from './scan/bundling.js';
|
|
6
|
+
export { emitScan } from './scan/emit.js';
|
|
7
|
+
export { emitStatement } from './scan/statement.js';
|
|
8
|
+
export { adaptersOf } from './scan/adapters.js';
|
|
9
|
+
export { crossFrondImports } from './imports.js';
|
|
10
|
+
export { handlerDeclarations } from './declarations.js';
|
|
11
|
+
export { outsideConventions } from './placement.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACoC,mBAAmB,EAC5D,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,GAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAoB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAyB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAA2B,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAA0B,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A file inside a frond that no convention names. */
|
|
2
|
+
import { type Conventions } from '@fougere/core';
|
|
3
|
+
import { type FrondDescriptor } from '@fougere/core/descriptor';
|
|
4
|
+
export interface OutsideConvention {
|
|
5
|
+
/** Stable rule name — the same vocabulary `verify()` uses. */
|
|
6
|
+
rule: 'outside-convention';
|
|
7
|
+
frond: string;
|
|
8
|
+
filePath: string;
|
|
9
|
+
kind: 'file' | 'directory';
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* What sits in a frond and belongs to no convention — a directory somebody invented, or a
|
|
14
|
+
* module dropped at the root.
|
|
15
|
+
*
|
|
16
|
+
* The eight names are the frond's whole vocabulary, and until now nothing said so: a scan
|
|
17
|
+
* READS them and steps over everything else in silence, so a file outside them is not
|
|
18
|
+
* refused, it is unseen. That silence is what lets a domain word settle wherever it was
|
|
19
|
+
* first needed — most often in the handler that used it, which is a second rule
|
|
20
|
+
* (`handler-declaration`) reporting the same drift one file lower.
|
|
21
|
+
*
|
|
22
|
+
* It names the addresses rather than describing them: a rule that says "put it somewhere
|
|
23
|
+
* better" is advice, and advice is what everybody already had.
|
|
24
|
+
*/
|
|
25
|
+
export declare function outsideConventions(fronds: readonly Pick<FrondDescriptor, 'name' | 'source'>[], conventions: Conventions): Promise<OutsideConvention[]>;
|
|
26
|
+
//# sourceMappingURL=placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../src/placement.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIhE,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,SAAS,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,CAAC,EAAE,EAC3D,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA2C9B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** A file inside a frond that no convention names. */
|
|
2
|
+
import { frondDirsOf } from '@fougere/core';
|
|
3
|
+
import { readdir } from 'node:fs/promises';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
/**
|
|
6
|
+
* `tests` is not a convention and is not an offence either: `@fougere/testing` reads the
|
|
7
|
+
* LEVEL a case runs at from where its file sits, so a frond holding its own tests is a
|
|
8
|
+
* supported shape (`demos/test-gradient`). The rest are outputs and installs, which are
|
|
9
|
+
* not the project's source at all.
|
|
10
|
+
*/
|
|
11
|
+
const NOT_SOURCE = new Set(['tests', 'node_modules', 'dist', 'build', 'coverage']);
|
|
12
|
+
/** The one file a frond states about itself, at its root. */
|
|
13
|
+
const FROND_FILES = new Set(['frond.config.ts', 'package.json', 'tsconfig.json', 'README.md']);
|
|
14
|
+
/**
|
|
15
|
+
* What sits in a frond and belongs to no convention — a directory somebody invented, or a
|
|
16
|
+
* module dropped at the root.
|
|
17
|
+
*
|
|
18
|
+
* The eight names are the frond's whole vocabulary, and until now nothing said so: a scan
|
|
19
|
+
* READS them and steps over everything else in silence, so a file outside them is not
|
|
20
|
+
* refused, it is unseen. That silence is what lets a domain word settle wherever it was
|
|
21
|
+
* first needed — most often in the handler that used it, which is a second rule
|
|
22
|
+
* (`handler-declaration`) reporting the same drift one file lower.
|
|
23
|
+
*
|
|
24
|
+
* It names the addresses rather than describing them: a rule that says "put it somewhere
|
|
25
|
+
* better" is advice, and advice is what everybody already had.
|
|
26
|
+
*/
|
|
27
|
+
export async function outsideConventions(fronds, conventions) {
|
|
28
|
+
const known = new Set(frondDirsOf(conventions));
|
|
29
|
+
const addresses = [...known].sort().join(', ');
|
|
30
|
+
const found = [];
|
|
31
|
+
for (const frond of fronds) {
|
|
32
|
+
const entries = await readdir(frond.source.path, { withFileTypes: true }).catch(() => []);
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
if (entry.name.startsWith('.') || NOT_SOURCE.has(entry.name))
|
|
35
|
+
continue;
|
|
36
|
+
const filePath = join(frond.source.path, entry.name);
|
|
37
|
+
if (entry.isDirectory()) {
|
|
38
|
+
if (known.has(entry.name))
|
|
39
|
+
continue;
|
|
40
|
+
found.push({
|
|
41
|
+
rule: 'outside-convention',
|
|
42
|
+
frond: frond.name,
|
|
43
|
+
filePath,
|
|
44
|
+
kind: 'directory',
|
|
45
|
+
message: `'${entry.name}/' is a directory no convention names, so nothing in it is read `
|
|
46
|
+
+ `as anything — it is a subject somebody filed under its own word. A frond's `
|
|
47
|
+
+ `directories are ${addresses}. If what it holds computes with nothing injected it `
|
|
48
|
+
+ `is \`${conventions.dirs.rules}/\`; if it holds a dependency it is `
|
|
49
|
+
+ `\`${conventions.dirs.services}/\`.`,
|
|
50
|
+
});
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (!entry.name.endsWith('.ts') || FROND_FILES.has(entry.name))
|
|
54
|
+
continue;
|
|
55
|
+
found.push({
|
|
56
|
+
rule: 'outside-convention',
|
|
57
|
+
frond: frond.name,
|
|
58
|
+
filePath,
|
|
59
|
+
kind: 'file',
|
|
60
|
+
message: `'${entry.name}' sits at the root of '${frond.name}', where the frond states `
|
|
61
|
+
+ `itself and nothing else. A frond's directories are ${addresses} — this one belongs `
|
|
62
|
+
+ `in \`${conventions.dirs.rules}/\` if it computes with nothing injected, in `
|
|
63
|
+
+ `\`${conventions.dirs.services}/\` if it holds a dependency.`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return found;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.js","sourceRoot":"","sources":["../src/placement.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAWjC;;;;;GAKG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AAEnF,6DAA6D;AAC7D,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC;AA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AAW,CAAC,IAAI,CAAC,QAAQ,MAAM;iBACzC,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAS;YACzE,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,KAAK,CAAC,IAAI;gBACjB,QAAQ;gBACR,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,IAAI,KAAK,CAAC,IAAI,0BAA0B,KAAK,CAAC,IAAI,4BAA4B;sBACnF,sDAAsD,SAAS,sBAAsB;sBACrF,QAAQ,WAAW,CAAC,IAAI,CAAC,KAAK,+CAA+C;sBAC7E,KAAK,WAAW,CAAC,IAAI,CAAC,QAAQ,+BAA+B;aAClE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/scan/adapters.ts"],"names":[],"mappings":"AAMA,6FAA6F;AAC7F,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAShE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
/** Which adapters a PROJECT could load, read off its dependencies. */
|
|
4
|
+
const ADAPTER_PACKAGE = /^@fougere\/adapter-(.+)$/;
|
|
5
|
+
/** The adapter names this project depends on — empty when it has no package.json to read. */
|
|
6
|
+
export async function adaptersOf(root) {
|
|
7
|
+
const manifest = await read(join(root, 'package.json'));
|
|
8
|
+
if (!manifest)
|
|
9
|
+
return [];
|
|
10
|
+
const declared = { ...manifest.dependencies, ...manifest.devDependencies };
|
|
11
|
+
return Object.keys(declared)
|
|
12
|
+
.map((name) => ADAPTER_PACKAGE.exec(name)?.[1])
|
|
13
|
+
.filter((name) => name !== undefined);
|
|
14
|
+
}
|
|
15
|
+
async function read(path) {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(await readFile(path, 'utf8'));
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// No manifest, or one that is not JSON. Either way this cannot validate a name, and
|
|
21
|
+
// reporting every `adapters:` key as unknown would be worse than saying nothing.
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/scan/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,sEAAsE;AACtE,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;IACxD,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,EAAE,GAAG,QAAQ,CAAC,YAAY,EAAE,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAE3E,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SACzB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9C,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAC1D,CAAC;AAED,KAAK,UAAU,IAAI,CAAC,IAAY;IAC9B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAa,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,oFAAoF;QACpF,iFAAiF;QACjF,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundling.d.ts","sourceRoot":"","sources":["../../src/scan/bundling.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAY7C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What a Fougere boot loads at RUNTIME, so a bundler must leave it alone. */
|
|
2
|
+
export const RUNTIME_PACKAGES = [
|
|
3
|
+
'@fougere/app',
|
|
4
|
+
'@fougere/core',
|
|
5
|
+
'@fougere/schema',
|
|
6
|
+
'@fougere/defaults',
|
|
7
|
+
'@fougere/transport-http',
|
|
8
|
+
'@fougere/adapter-sql',
|
|
9
|
+
'@fougere/adapter-graphql',
|
|
10
|
+
'@fougere/auth-better',
|
|
11
|
+
'better-sqlite3',
|
|
12
|
+
'jiti',
|
|
13
|
+
'typescript',
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=bundling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundling.js","sourceRoot":"","sources":["../../src/scan/bundling.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,yBAAyB;IACzB,sBAAsB;IACtB,0BAA0B;IAC1B,sBAAsB;IACtB,gBAAgB;IAChB,MAAM;IACN,YAAY;CACb,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** An operation contract, written down — the half two emitters say the same way. */
|
|
2
|
+
import { type OperationContract } from '@fougere/core/descriptor';
|
|
3
|
+
import { type SchemaView } from '@fougere/schema';
|
|
4
|
+
/** A value that ends up as an import in the module being written. */
|
|
5
|
+
export type Live = object;
|
|
6
|
+
/**
|
|
7
|
+
* What the writer needs of an emitter's imports, and nothing more.
|
|
8
|
+
*
|
|
9
|
+
* The two emitters index theirs differently — one by value against a relative path, one
|
|
10
|
+
* by file against the package specifier a project already uses — and neither is wrong for
|
|
11
|
+
* the module it writes. What they agree on is this: a value already imported has an
|
|
12
|
+
* alias, a class can be imported by name, and an entity can be found by its class name.
|
|
13
|
+
*/
|
|
14
|
+
export interface Aliases {
|
|
15
|
+
aliasOf(value: Live): string | undefined;
|
|
16
|
+
named(value: Live, filePath: string, name: string): string;
|
|
17
|
+
/** The entity class this name belongs to — what a `Partial<X>` names as its source. */
|
|
18
|
+
classNamed(name: string): Live | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare const lit: (value: unknown) => string;
|
|
21
|
+
/** What a schema slot becomes in the generated module. */
|
|
22
|
+
export declare function schemaRef(schema: SchemaView | undefined, declaredIn: string, imports: Aliases): string | undefined;
|
|
23
|
+
/** One entry of an operations Map, as its module spells it. */
|
|
24
|
+
export declare function contractOf(op: string, contract: OperationContract, declaredIn: string, imports: Aliases): string;
|
|
25
|
+
/** The operations of one handler, as the Map its reader builds. */
|
|
26
|
+
export declare function operationsOf(operations: ReadonlyMap<string, OperationContract>, declaredIn: string, imports: Aliases, indent: string): string;
|
|
27
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/scan/contract.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE/E,qEAAqE;AACrE,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3D,uFAAuF;IACvF,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C;AAED,eAAO,MAAM,GAAG,UAAW,OAAO,KAAG,MAAuC,CAAC;AAE7E,0DAA0D;AAC1D,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS,CAiBpB;AAED,+DAA+D;AAC/D,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,GACf,MAAM,CAYR;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAC1B,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAClD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR"}
|