@fougere/cli 0.12.2-alpha.0 → 0.12.5-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/dist/loader.d.ts +5 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +10 -3
- package/dist/loader.js.map +1 -1
- package/dist/typescript/EntityTypes.d.ts.map +1 -1
- package/dist/typescript/EntityTypes.js +2 -2
- package/dist/typescript/EntityTypes.js.map +1 -1
- package/fronds/analysis/handlers/ExplainHandler.ts +2 -7
- package/fronds/analysis/handlers/LoadHandler.ts +1 -1
- package/fronds/analysis/handlers/MigrateHandler.ts +7 -1
- package/package.json +22 -15
- package/src/loader.ts +10 -3
- package/src/typescript/EntityTypes.ts +2 -2
- package/templates/workspace/fronds/tsconfig.json +4 -1
package/dist/loader.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { Conventions } from '@fougere/core';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The loader every command needs — made FROM the project, since a module key (`'@fougere/log'`)
|
|
4
|
+
* is resolved against whoever made the loader: made here, it looked in the CLI's own
|
|
5
|
+
* dependencies and never in the project's.
|
|
6
|
+
*/
|
|
3
7
|
export declare function installLoader(root: string, reread?: boolean): Promise<Conventions>;
|
|
4
8
|
//# sourceMappingURL=loader.d.ts.map
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAetF"}
|
package/dist/loader.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { resolve, sep } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
1
3
|
import { frondAliases } from '@fougere/compiler';
|
|
2
4
|
import { resolveConventions } from '@fougere/core';
|
|
3
5
|
import { setModuleLoader, loadConfig } from '@fougere/core/node';
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The loader every command needs — made FROM the project, since a module key (`'@fougere/log'`)
|
|
8
|
+
* is resolved against whoever made the loader: made here, it looked in the CLI's own
|
|
9
|
+
* dependencies and never in the project's.
|
|
10
|
+
*/
|
|
5
11
|
export async function installLoader(root, reread = false) {
|
|
6
12
|
const { createJiti } = await import('jiti');
|
|
7
|
-
const
|
|
13
|
+
const project = pathToFileURL(resolve(root) + sep).href;
|
|
14
|
+
const bare = createJiti(project, { interopDefault: true });
|
|
8
15
|
setModuleLoader((filePath) => bare.import(filePath));
|
|
9
16
|
const conventions = resolveConventions((await loadConfig(root)).conventions);
|
|
10
|
-
const jiti = createJiti(
|
|
17
|
+
const jiti = createJiti(project, {
|
|
11
18
|
interopDefault: true,
|
|
12
19
|
alias: await frondAliases(root, conventions),
|
|
13
20
|
...(reread ? { moduleCache: false } : {}),
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGjE
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,U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mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EntityTypes.d.ts","sourceRoot":"","sources":["../../src/typescript/EntityTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGlG,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2DD,qBAAa,WAAW;IACF,OAAO,CAAC,QAAQ,CAAC,UAAU;IAA/C,OAAO,eAA8D;IAErE,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,gBAAgB,GAAG,WAAW,CAEnD;IAED,MAAM,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAS/C;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { upperFirst } from '@fougere/schema';
|
|
1
|
+
import { Shapes, upperFirst } from '@fougere/schema';
|
|
2
2
|
import { docCommentOf, propertyKey } from './syntax.js';
|
|
3
3
|
/** So a nullable field lands as a union. */
|
|
4
4
|
function typeOf(field) {
|
|
5
|
-
const types =
|
|
5
|
+
const types = Shapes.typesOf(field);
|
|
6
6
|
const nullable = types.includes('null');
|
|
7
7
|
const base = types.find((t) => t !== 'null');
|
|
8
8
|
const inner = baseTypeOf(base, field);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTypes.js","sourceRoot":"","sources":["../../src/typescript/EntityTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA+C,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"EntityTypes.js","sourceRoot":"","sources":["../../src/typescript/EntityTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAA+C,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAOxD,4CAA4C;AAC5C,SAAS,MAAM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12 @@
|
|
|
1
1
|
import {
|
|
2
|
+
addressOf,
|
|
2
3
|
resolveEffectiveOperations,
|
|
3
4
|
type EffectiveOperation,
|
|
4
5
|
type OperationContract,
|
|
5
6
|
} from '@fougere/core';
|
|
6
7
|
import { relative } from 'node:path';
|
|
7
8
|
import ProjectScan from '../services/ProjectScan.js';
|
|
8
|
-
import { ANONYMOUS_SCHEMA_NAME,
|
|
9
|
+
import { ANONYMOUS_SCHEMA_NAME, type SchemaView } from '@fougere/schema';
|
|
9
10
|
import { remotesOf } from '@fougere/core/node';
|
|
10
11
|
|
|
11
12
|
type Cardinality = NonNullable<OperationContract['cardinality']>;
|
|
@@ -232,12 +233,6 @@ function matches(operation: EffectiveOperation, selector: Selector): boolean {
|
|
|
232
233
|
&& (!selector.surface || operation.exposure.surfaces.includes(selector.surface));
|
|
233
234
|
}
|
|
234
235
|
|
|
235
|
-
function addressOf(value: string): string {
|
|
236
|
-
const base = value.endsWith('Handler') ? value.slice(0, -'Handler'.length) : value;
|
|
237
|
-
|
|
238
|
-
return lowerFirst(base);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
236
|
function inputTypeOf(operation: EffectiveOperation): string | null {
|
|
242
237
|
const body = operation.parameters.find((parameter) => parameter.binding.source.kind === 'input');
|
|
243
238
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { loadConfig } from '@fougere/core/node';
|
|
2
2
|
import { resolveStorage } from '@fougere/defaults';
|
|
3
|
-
import {
|
|
3
|
+
import type { Plan, StepChange } from '@fougere/adapter-sql';
|
|
4
4
|
import type { SetDiff } from '@fougere/schema';
|
|
5
5
|
import ProjectScan from '../services/ProjectScan.js';
|
|
6
6
|
import { chainOf } from '../versions.js';
|
|
@@ -54,6 +54,12 @@ export default class MigrateHandler {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// Resolved from the project rather than named in this package's dependencies:
|
|
58
|
+
// `@fougere/adapter-sql` declares `better-sqlite3`, so a CLI depending on it installs
|
|
59
|
+
// 26 MB of native module into every `npm create fougere`. A project that migrates
|
|
60
|
+
// declares the adapter itself, which is where this resolves from.
|
|
61
|
+
const { actualState, desiredTables, planStep, collapseChain, applyStep } = await import('@fougere/adapter-sql');
|
|
62
|
+
|
|
57
63
|
const tables = desiredTables(scan as never);
|
|
58
64
|
// Each frond's chain is composed on its own — its versions are its own line — and the
|
|
59
65
|
// results are gathered by SOURCE, because an engine is what a statement runs against.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5-alpha.0",
|
|
4
4
|
"description": "The Fougere CLI — compose a workspace, serve a frond, call an operation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -42,27 +42,34 @@
|
|
|
42
42
|
"jiti": "^2.4.2",
|
|
43
43
|
"picocolors": "^1.1.1",
|
|
44
44
|
"safe-regex": "^2.1.1",
|
|
45
|
-
"@fougere/compiler": "0.12.
|
|
46
|
-
"@fougere/
|
|
47
|
-
"@fougere/
|
|
48
|
-
"@fougere/
|
|
49
|
-
"@fougere/
|
|
50
|
-
"@fougere/
|
|
51
|
-
"@fougere/
|
|
52
|
-
"@fougere/core": "0.12.2-alpha.0"
|
|
45
|
+
"@fougere/compiler": "0.12.5-alpha.0",
|
|
46
|
+
"@fougere/container": "0.12.5-alpha.0",
|
|
47
|
+
"@fougere/core": "0.12.5-alpha.0",
|
|
48
|
+
"@fougere/schema": "0.12.5-alpha.0",
|
|
49
|
+
"@fougere/testing": "0.12.5-alpha.0",
|
|
50
|
+
"@fougere/transport-http": "0.12.5-alpha.0",
|
|
51
|
+
"@fougere/defaults": "0.12.5-alpha.0"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"vitest": "^4.1.0",
|
|
56
|
-
"@fougere/next": "0.12.
|
|
57
|
-
"@fougere/nuxt": "0.12.
|
|
58
|
-
"@fougere/
|
|
59
|
-
"@fougere/
|
|
60
|
-
"@fougere/
|
|
61
|
-
"@fougere/svelte": "0.12.
|
|
55
|
+
"@fougere/next": "0.12.5-alpha.0",
|
|
56
|
+
"@fougere/nuxt": "0.12.5-alpha.0",
|
|
57
|
+
"@fougere/oclif": "0.12.5-alpha.0",
|
|
58
|
+
"@fougere/react": "0.12.5-alpha.0",
|
|
59
|
+
"@fougere/admin": "0.12.5-alpha.0",
|
|
60
|
+
"@fougere/svelte": "0.12.5-alpha.0"
|
|
62
61
|
},
|
|
63
62
|
"publishConfig": {
|
|
64
63
|
"access": "public"
|
|
65
64
|
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@fougere/adapter-sql": "^0.12.5-alpha.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"@fougere/adapter-sql": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
66
73
|
"scripts": {
|
|
67
74
|
"build": "rm -rf dist && tsc && chmod +x dist/bin.js && node dist/bin.js build",
|
|
68
75
|
"test": "vitest run",
|
package/src/loader.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
+
import { resolve, sep } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
1
3
|
import { frondAliases } from '@fougere/compiler';
|
|
2
4
|
import { resolveConventions } from '@fougere/core';
|
|
3
5
|
import { setModuleLoader, loadConfig } from '@fougere/core/node';
|
|
4
6
|
import type { Conventions } from '@fougere/core';
|
|
5
7
|
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The loader every command needs — made FROM the project, since a module key (`'@fougere/log'`)
|
|
10
|
+
* is resolved against whoever made the loader: made here, it looked in the CLI's own
|
|
11
|
+
* dependencies and never in the project's.
|
|
12
|
+
*/
|
|
7
13
|
export async function installLoader(root: string, reread = false): Promise<Conventions> {
|
|
8
14
|
const { createJiti } = await import('jiti');
|
|
9
|
-
const
|
|
15
|
+
const project = pathToFileURL(resolve(root) + sep).href;
|
|
16
|
+
const bare = createJiti(project, { interopDefault: true });
|
|
10
17
|
setModuleLoader((filePath) => bare.import(filePath) as Promise<Record<string, unknown>>);
|
|
11
18
|
|
|
12
19
|
const conventions = resolveConventions((await loadConfig(root)).conventions);
|
|
13
|
-
const jiti = createJiti(
|
|
20
|
+
const jiti = createJiti(project, {
|
|
14
21
|
interopDefault: true,
|
|
15
22
|
alias: await frondAliases(root, conventions),
|
|
16
23
|
...(reread ? { moduleCache: false } : {}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { upperFirst, type FieldDescriptor, type SchemaDescriptor } from '@fougere/schema';
|
|
1
|
+
import { Shapes, upperFirst, type FieldDescriptor, type SchemaDescriptor } from '@fougere/schema';
|
|
2
2
|
import { docCommentOf, propertyKey } from './syntax.js';
|
|
3
3
|
|
|
4
4
|
export interface EntityTypesOptions {
|
|
@@ -8,7 +8,7 @@ export interface EntityTypesOptions {
|
|
|
8
8
|
|
|
9
9
|
/** So a nullable field lands as a union. */
|
|
10
10
|
function typeOf(field: FieldDescriptor): string {
|
|
11
|
-
const types =
|
|
11
|
+
const types = Shapes.typesOf(field);
|
|
12
12
|
const nullable = types.includes('null');
|
|
13
13
|
const base = types.find((t) => t !== 'null');
|
|
14
14
|
const inner = baseTypeOf(base, field);
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"esModuleInterop": true,
|
|
13
13
|
"skipLibCheck": true,
|
|
14
14
|
"noEmit": true,
|
|
15
|
-
"rootDir": "."
|
|
15
|
+
"rootDir": ".",
|
|
16
|
+
// A frond names its neighbours, it does not walk to them: the alias the Nuxt module
|
|
17
|
+
// registers at runtime (`@fronds/<name>` → the frond directory), stated for the compiler.
|
|
18
|
+
"paths": { "@fronds/*": ["./*"] }
|
|
16
19
|
},
|
|
17
20
|
"include": ["."]
|
|
18
21
|
}
|