@fougere/cli 0.12.4-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 CHANGED
@@ -1,4 +1,8 @@
1
1
  import type { Conventions } from '@fougere/core';
2
- /** The loader every command needs. */
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
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,sCAAsC;AACtC,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CActF"}
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
- /** The loader every command needs. */
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 bare = createJiti(import.meta.url, { interopDefault: true });
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(import.meta.url, {
17
+ const jiti = createJiti(project, {
11
18
  interopDefault: true,
12
19
  alias: await frondAliases(root, conventions),
13
20
  ...(reread ? { moduleCache: false } : {}),
@@ -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,sCAAsC;AACtC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAY,EAAE,MAAM,GAAG,KAAK;IAC9D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,eAAe,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAqC,CAAC,CAAC;IAEzF,MAAM,WAAW,GAAG,kBAAkB,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE;QACvC,cAAc,EAAE,IAAI;QACpB,KAAK,EAAE,MAAM,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC;QAC5C,GAAG,CAAC,MAAM,CAA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C,IAAI,EAAE,WAAW,CAAC;QAC5C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAC,CAAC;IACH,eAAe,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAqC,CAAC,CAAC;IAEzF,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { loadScript, reachableOps } from '@fougere/testing';
1
+ import { loadScript, reachableOps } from '@fougere/testing/load';
2
2
  import { writeFile } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
4
  import ProjectScan from '../services/ProjectScan.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fougere/cli",
3
- "version": "0.12.4-alpha.0",
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,28 +42,28 @@
42
42
  "jiti": "^2.4.2",
43
43
  "picocolors": "^1.1.1",
44
44
  "safe-regex": "^2.1.1",
45
- "@fougere/compiler": "0.12.4-alpha.0",
46
- "@fougere/container": "0.12.4-alpha.0",
47
- "@fougere/core": "0.12.4-alpha.0",
48
- "@fougere/schema": "0.12.4-alpha.0",
49
- "@fougere/testing": "0.12.4-alpha.0",
50
- "@fougere/transport-http": "0.12.4-alpha.0",
51
- "@fougere/defaults": "0.12.4-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"
52
52
  },
53
53
  "devDependencies": {
54
54
  "vitest": "^4.1.0",
55
- "@fougere/admin": "0.12.4-alpha.0",
56
- "@fougere/next": "0.12.4-alpha.0",
57
- "@fougere/nuxt": "0.12.4-alpha.0",
58
- "@fougere/oclif": "0.12.4-alpha.0",
59
- "@fougere/svelte": "0.12.4-alpha.0",
60
- "@fougere/react": "0.12.4-alpha.0"
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"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
65
  "peerDependencies": {
66
- "@fougere/adapter-sql": "^0.12.4-alpha.0"
66
+ "@fougere/adapter-sql": "^0.12.5-alpha.0"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@fougere/adapter-sql": {
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
- /** The loader every command needs. */
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 bare = createJiti(import.meta.url, { interopDefault: true });
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(import.meta.url, {
20
+ const jiti = createJiti(project, {
14
21
  interopDefault: true,
15
22
  alias: await frondAliases(root, conventions),
16
23
  ...(reread ? { moduleCache: false } : {}),
@@ -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
  }