@aeriajs/cli 0.0.187 → 0.0.189

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.
@@ -1,15 +1,9 @@
1
1
  export declare const buildAeriaLang: () => Promise<{
2
- readonly success: true;
3
- readonly emittedFiles: readonly [];
4
- readonly diagnostics?: undefined;
5
- } | {
6
- readonly success: false;
7
- readonly diagnostics: import("aeria-lang").CompilationError;
8
- readonly emittedFiles?: undefined;
9
- } | {
10
- readonly success: true;
11
- readonly emittedFiles: string[];
12
- readonly diagnostics?: undefined;
2
+ emittedFiles: Record<string, string>;
3
+ success: boolean;
4
+ ast: import("@aeriajs/compiler").ProgramNode;
5
+ errors: import("@aeriajs/compiler").Diagnostic[];
6
+ errorCount: number;
13
7
  } | undefined>;
14
8
  export declare const buildAeriaLangPhase: () => Promise<{
15
9
  readonly _tag: "Result";
@@ -1,16 +1,9 @@
1
- import ts from 'typescript';
2
- import { build, ppDiagnostic } from 'aeria-lang';
3
1
  import { Result } from '@aeriajs/types';
4
- import { getUserTsconfig } from './compile.js';
5
2
  export const buildAeriaLang = async () => {
6
- const tsConfig = await getUserTsconfig();
7
3
  try {
8
- return await build(['schemas/*.aeria'], {
4
+ const { compileFromFiles } = await import('@aeriajs/compiler');
5
+ return await compileFromFiles('schemas', {
9
6
  outDir: '.aeria/out',
10
- // deprecated: new compiler only outputs esnext
11
- module: tsConfig.compilerOptions.module === ts.ModuleKind.CommonJS
12
- ? 'commonjs'
13
- : 'esnext',
14
7
  });
15
8
  }
16
9
  catch (err) {
@@ -25,12 +18,12 @@ export const buildAeriaLangPhase = async () => {
25
18
  return Result.result('skipped aeria-lang build (@aeria-lang/build dependency is absent)');
26
19
  }
27
20
  if (!result.success) {
28
- return Result.error(ppDiagnostic(result.diagnostics));
21
+ return Result.error(result.errors.map((error) => `\n${error.fileLocation}:${error.location.line} at column (${error.location.start}-${error.location.end}) - ${error.message}`).join(' | '));
29
22
  }
30
- if (result.emittedFiles.length === 0) {
23
+ if (Object.keys(result.emittedFiles).length === 0) {
31
24
  return Result.result('no aeria files to build');
32
25
  }
33
- return Result.result(result.emittedFiles.length > 0
26
+ return Result.result(Object.keys(result.emittedFiles).length > 0
34
27
  ? 'aeria files built'
35
28
  : 'no aeria files to build');
36
29
  };
package/dist/compile.js CHANGED
@@ -108,9 +108,7 @@ export const compilationPhase = async (options = {}) => {
108
108
  if (!options.useTsc) {
109
109
  const transpileCtx = await transpile.init({
110
110
  outdir: tsConfig.compilerOptions.outDir,
111
- format: tsConfig.compilerOptions.module === ts.ModuleKind.CommonJS
112
- ? 'cjs'
113
- : 'esm',
111
+ sourcemap: tsConfig.compilerOptions.sourceMap,
114
112
  });
115
113
  await transpileCtx.rebuild();
116
114
  await transpileCtx.dispose();
package/dist/watch.js CHANGED
@@ -1,4 +1,3 @@
1
- import ts from 'typescript';
2
1
  import * as chokidar from 'chokidar';
3
2
  import { fileURLToPath } from 'node:url';
4
3
  import { spawn, fork } from 'node:child_process';
@@ -22,7 +21,7 @@ const compileOnChanges = async (transpileCtx) => {
22
21
  success: false,
23
22
  };
24
23
  }
25
- log('info', result);
24
+ log('info', String(result));
26
25
  if (transpileCtx) {
27
26
  try {
28
27
  await transpileCtx.rebuild();
@@ -60,9 +59,7 @@ export const watch = async (options = {}) => {
60
59
  const transpileCtx = !options.useTsc
61
60
  ? await transpile.init({
62
61
  outdir: tsConfig.compilerOptions.outDir,
63
- format: tsConfig.compilerOptions.module === ts.ModuleKind.CommonJS
64
- ? 'cjs'
65
- : 'esm',
62
+ sourcemap: tsConfig.compilerOptions.sourceMap,
66
63
  })
67
64
  : null;
68
65
  const initialCompilationResult = await compileOnChanges(transpileCtx);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aeriajs/cli",
3
3
  "type": "module",
4
- "version": "0.0.187",
4
+ "version": "0.0.189",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -34,16 +34,18 @@
34
34
  "devDependencies": {
35
35
  "@aeriajs/builtins": "link:../builtins",
36
36
  "@aeriajs/common": "link:../common",
37
+ "@aeriajs/compiler": "link:../compiler",
37
38
  "@aeriajs/core": "link:../core",
38
39
  "@aeriajs/entrypoint": "link:../entrypoint",
39
40
  "@aeriajs/types": "link:../types"
40
41
  },
41
42
  "peerDependencies": {
42
- "@aeriajs/builtins": "^0.0.239",
43
- "@aeriajs/common": "^0.0.135",
44
- "@aeriajs/core": "^0.0.239",
45
- "@aeriajs/entrypoint": "^0.0.139",
46
- "@aeriajs/types": "^0.0.117"
43
+ "@aeriajs/builtins": "^0.0.240",
44
+ "@aeriajs/common": "^0.0.136",
45
+ "@aeriajs/compiler": "^0.0.1",
46
+ "@aeriajs/core": "^0.0.240",
47
+ "@aeriajs/entrypoint": "^0.0.140",
48
+ "@aeriajs/types": "^0.0.118"
47
49
  },
48
50
  "optionalDependencies": {
49
51
  "aeria-lang": "0.0.11"