@beff/aula-cli 0.4.2 → 0.5.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/README.md +1 -1
- package/dist/licenses/fonts-OFL-NotoSans.txt +94 -0
- package/dist/src/aula-render.core.wasm +0 -0
- package/dist/src/{chunk-7KT36JRP.js → chunk-2NMVSQG4.js} +83 -93
- package/dist/src/{chunk-46KT47TH.js → chunk-5VYKT646.js} +1 -1
- package/dist/src/chunk-A5QHTZKT.js +6 -0
- package/dist/src/{chunk-CIFP475T.js → chunk-DQ2NGXNI.js} +6 -321
- package/dist/src/chunk-EQ3DVZV5.js +15 -0
- package/dist/src/chunk-IKKANHTF.js +94 -0
- package/dist/src/chunk-JDXHKYLZ.js +369 -0
- package/dist/src/chunk-JVCECTG2.js +77 -0
- package/dist/src/{chunk-BT3Z5CJI.js → chunk-YBHISJLN.js} +70 -31
- package/dist/src/cli.js +12 -7
- package/dist/src/{commands-QCUCX2GF.js → commands-34YCDSR5.js} +8 -5
- package/dist/src/{problems-7BVC64RO.js → problems-U4QXN6RO.js} +4 -2
- package/dist/src/project-WS7P5VIH.js +12 -0
- package/dist/src/render-child.js +284 -9
- package/dist/src/{run-5WC5WRZ2.js → run-7PM6EPND.js} +45 -9
- package/dist/src/{server-GK3EWFX3.js → server-YQYW4FT4.js} +6 -5
- package/dist/src/site-SVNNSF72.js +139 -0
- package/dist/web/app/assets/9733ee91/aula-method.js +1 -0
- package/dist/web/app/assets/9733ee91/aula.js +1 -0
- package/dist/web/app/assets/{dcda3118 → 9733ee91}/build-worker.js +2 -2
- package/dist/web/app/assets/9733ee91/index.js +52 -0
- package/dist/web/app/assets/__vite-browser-external-B57JSoUh.js +1 -0
- package/dist/web/app/assets/aula-voice-worker-CjOTYyla.js +52 -0
- package/dist/web/app/assets/{aula.core5-BhR-OOvz.wasm → aula.core5-CfWXNps1.wasm} +0 -0
- package/dist/web/app/assets/{index-C_rGCAZR.css → index-BXxc0ZmT.css} +1 -1
- package/dist/web/app/assets/protocol-CylXac4E.js +15 -0
- package/dist/web/app/assets/src-CkCfHCj6.js +25 -0
- package/dist/web/app/index.html +4 -4
- package/dist/web/site/assets/64cc3acd/aula-method.js +1 -0
- package/dist/web/site/assets/64cc3acd/aula.js +1 -0
- package/dist/web/site/assets/64cc3acd/build-worker.js +696 -0
- package/dist/web/site/assets/64cc3acd/index.js +52 -0
- package/dist/web/site/assets/__vite-browser-external-BtQTJ51O.js +1 -0
- package/dist/web/site/assets/__vite-browser-external-uE9Q5hLF.js +1 -0
- package/dist/web/site/assets/aula-voice-worker-CbfByYTT.js +54 -0
- package/dist/web/site/assets/aula.core-BtiPQSZi.wasm +0 -0
- package/dist/web/site/assets/aula.core5-CfWXNps1.wasm +0 -0
- package/dist/web/site/assets/esbuild-BaXVPFT2.wasm +0 -0
- package/dist/web/site/assets/index-Dn5gqwRn.css +2 -0
- package/dist/web/site/assets/protocol-C4jhAcOf.js +15 -0
- package/dist/web/site/assets/rolldown-runtime-BLXQ4ufn.js +1 -0
- package/dist/web/site/assets/src-BlEGe8aL.js +25 -0
- package/dist/web/site/index.html +39 -0
- package/package.json +2 -2
- package/dist/src/chunk-GFCJYE75.js +0 -42
- package/dist/src/project-NWT5MDQI.js +0 -11
- package/dist/web/app/assets/__vite-browser-external-BTgt74Au.js +0 -1
- package/dist/web/app/assets/aula-voice-worker-CZGtnmSr.js +0 -52
- package/dist/web/app/assets/dcda3118/aula-method.js +0 -1
- package/dist/web/app/assets/dcda3118/aula.js +0 -1
- package/dist/web/app/assets/dcda3118/index.js +0 -52
- package/dist/web/app/assets/protocol-OKrdpPQW.js +0 -15
- package/dist/web/app/assets/src-DYumAKNc.js +0 -25
package/README.md
CHANGED
|
@@ -8,4 +8,4 @@ The package has no model file. The first command that narrates or times a video
|
|
|
8
8
|
|
|
9
9
|
## Licenses
|
|
10
10
|
|
|
11
|
-
aula's own code is MIT; the engine includes eSpeak NG, GPL-3.0-or-later, so the package as a whole is MIT AND GPL-3.0-or-later. The engine component also has third-party code and data, with their own licenses, in `dist/licenses/`: eSpeak NG (GPL-3.0-or-later), misaki (Apache-2.0), spaCy (MIT) and the fonts Nunito Sans
|
|
11
|
+
aula's own code is MIT; the engine includes eSpeak NG, GPL-3.0-or-later, so the package as a whole is MIT AND GPL-3.0-or-later. The engine component also has third-party code and data, with their own licenses, in `dist/licenses/`: eSpeak NG (GPL-3.0-or-later), misaki (Apache-2.0), spaCy (MIT) and the fonts Nunito Sans, JetBrains Mono and Noto Sans (SIL Open Font License 1.1).
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
|
|
2
|
+
Copyright 2016 Google LLC. All Rights Reserved. (Noto Sans Symbols: the arrows)
|
|
3
|
+
|
|
4
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
5
|
+
This license is copied below, and is also available with a FAQ at:
|
|
6
|
+
https://openfontlicense.org
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
11
|
+
-----------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
PREAMBLE
|
|
14
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
15
|
+
development of collaborative font projects, to support the font creation
|
|
16
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
17
|
+
open framework in which fonts may be shared and improved in partnership
|
|
18
|
+
with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
22
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply
|
|
27
|
+
to any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
DEFINITIONS
|
|
30
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
31
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
32
|
+
include source files, build scripts and documentation.
|
|
33
|
+
|
|
34
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
35
|
+
copyright statement(s).
|
|
36
|
+
|
|
37
|
+
"Original Version" refers to the collection of Font Software components as
|
|
38
|
+
distributed by the Copyright Holder(s).
|
|
39
|
+
|
|
40
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
41
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
42
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
43
|
+
new environment.
|
|
44
|
+
|
|
45
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
46
|
+
writer or other person who contributed to the Font Software.
|
|
47
|
+
|
|
48
|
+
PERMISSION & CONDITIONS
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
50
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
51
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
52
|
+
Software, subject to the following conditions:
|
|
53
|
+
|
|
54
|
+
1) Neither the Font Software nor any of its individual components,
|
|
55
|
+
in Original or Modified Versions, may be sold by itself.
|
|
56
|
+
|
|
57
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
58
|
+
redistributed and/or sold with any software, provided that each copy
|
|
59
|
+
contains the above copyright notice and this license. These can be
|
|
60
|
+
included either as stand-alone text files, human-readable headers or
|
|
61
|
+
in the appropriate machine-readable metadata fields within text or
|
|
62
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
63
|
+
|
|
64
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
65
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
66
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
67
|
+
presented to the users.
|
|
68
|
+
|
|
69
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
70
|
+
Software shall not be used to promote, endorse or advertise any
|
|
71
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
72
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
73
|
+
permission.
|
|
74
|
+
|
|
75
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
76
|
+
must be distributed entirely under this license, and must not be
|
|
77
|
+
distributed under any other license. The requirement for fonts to
|
|
78
|
+
remain under this license does not apply to any document created
|
|
79
|
+
using the Font Software.
|
|
80
|
+
|
|
81
|
+
TERMINATION
|
|
82
|
+
This license becomes null and void if any of the above conditions are
|
|
83
|
+
not met.
|
|
84
|
+
|
|
85
|
+
DISCLAIMER
|
|
86
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
87
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
88
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
89
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
90
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
91
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
92
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
93
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
94
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
// ../aula-project/src/diagnostics.ts
|
|
2
|
-
import { diagnosticOf } from "@beff/aula/run";
|
|
3
|
-
function error(message, more = {}) {
|
|
4
|
-
return { severity: "error", message, ...more, stack: [], related: [] };
|
|
5
|
-
}
|
|
6
|
-
var isError = (d) => d.severity === "error";
|
|
7
|
-
var Problems = class extends Error {
|
|
8
|
-
diagnostics;
|
|
9
|
-
constructor(diagnostics) {
|
|
10
|
-
super(diagnostics.map((d) => d.message).join("\n"));
|
|
11
|
-
this.diagnostics = diagnostics;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
function wrongArgument(message, hint) {
|
|
15
|
-
return new Problems([error(message, hint === void 0 ? {} : { hint })]);
|
|
16
|
-
}
|
|
17
|
-
function diagnosticsOf(e, host2) {
|
|
18
|
-
return e instanceof Problems ? e.diagnostics : [diagnosticOf(e, "", host2)];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// ../aula-project/src/node.ts
|
|
22
|
-
import path from "node:path";
|
|
23
|
-
import { pathToFileURL } from "node:url";
|
|
24
|
-
import { isProjectDefinition } from "@beff/aula";
|
|
25
|
-
import { definedAt, loadEngine, v8Frames } from "@beff/aula/run";
|
|
26
|
-
|
|
27
1
|
// ../../node_modules/.pnpm/@beff+client@1.0.1/node_modules/@beff/client/dist/esm/openapi-pp.js
|
|
28
2
|
var removeNullUnionBranch = (definition) => {
|
|
29
3
|
if (typeof definition === "boolean") {
|
|
@@ -93,24 +67,24 @@ var joinWithDot = (it) => {
|
|
|
93
67
|
}
|
|
94
68
|
return acc;
|
|
95
69
|
};
|
|
96
|
-
var printPath = (parentPath,
|
|
97
|
-
const mergedPath = [...parentPath, ...
|
|
70
|
+
var printPath = (parentPath, path) => {
|
|
71
|
+
const mergedPath = [...parentPath, ...path];
|
|
98
72
|
return mergedPath.length > 0 ? `(${joinWithDot(mergedPath)})` : "";
|
|
99
73
|
};
|
|
100
74
|
var joinFilteredStrings = (it) => {
|
|
101
75
|
return it.filter((it2) => it2.length > 0).join(" ");
|
|
102
76
|
};
|
|
103
77
|
var printRegularError = (err, parentPath, showReceived) => {
|
|
104
|
-
const
|
|
78
|
+
const path = printPath(parentPath, err.path);
|
|
105
79
|
const msg = [err.message, showReceived ? `received: ${prettyPrintValue(err.received)}` : ""].filter((it) => it.length > 0).join(", ");
|
|
106
|
-
return joinFilteredStrings([
|
|
80
|
+
return joinFilteredStrings([path, msg]);
|
|
107
81
|
};
|
|
108
82
|
var printUnionError = (err, parentPath) => {
|
|
109
|
-
const
|
|
83
|
+
const path = printPath(parentPath, err.path);
|
|
110
84
|
const printedErrors = printErrorsPart(err.errors, [], false);
|
|
111
85
|
const innerMessages = printedErrors.length > 5 ? printedErrors.slice(0, 5).join(" OR ") + " and more..." : printedErrors.join(" | ");
|
|
112
86
|
const msg = [`Failed to decode one of (${innerMessages})`, `received: ${prettyPrintValue(err.received)}`].filter((it) => it.length > 0).join(", ");
|
|
113
|
-
return joinFilteredStrings([
|
|
87
|
+
return joinFilteredStrings([path, msg]);
|
|
114
88
|
};
|
|
115
89
|
var printErrorsPart = (it, parentPath, showReceived) => {
|
|
116
90
|
return it.map((err) => {
|
|
@@ -1039,9 +1013,9 @@ var Parsers = parser_default.buildParsers();
|
|
|
1039
1013
|
|
|
1040
1014
|
// ../aula-bundle/src/index.ts
|
|
1041
1015
|
var SOURCE_PREFIX = "tree:";
|
|
1042
|
-
function dirname(
|
|
1043
|
-
const at =
|
|
1044
|
-
return at < 0 ? "" :
|
|
1016
|
+
function dirname(path) {
|
|
1017
|
+
const at = path.lastIndexOf("/");
|
|
1018
|
+
return at < 0 ? "" : path.slice(0, at);
|
|
1045
1019
|
}
|
|
1046
1020
|
function join(from, relative) {
|
|
1047
1021
|
const parts = from === "" ? [] : from.split("/");
|
|
@@ -1061,7 +1035,7 @@ var LOADERS = /* @__PURE__ */ new Map([
|
|
|
1061
1035
|
["mjs", "js"],
|
|
1062
1036
|
["json", "json"]
|
|
1063
1037
|
]);
|
|
1064
|
-
var loaderOf = (
|
|
1038
|
+
var loaderOf = (path) => LOADERS.get(path.slice(path.lastIndexOf(".") + 1)) ?? "ts";
|
|
1065
1039
|
function treePlugin(tree, imports) {
|
|
1066
1040
|
return {
|
|
1067
1041
|
name: "aula-tree",
|
|
@@ -1077,12 +1051,12 @@ function treePlugin(tree, imports) {
|
|
|
1077
1051
|
errors: [{ text: `cannot find the package "${args.path}" in node_modules or the workspace packages` }]
|
|
1078
1052
|
};
|
|
1079
1053
|
}
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1082
|
-
for (const candidate of [
|
|
1054
|
+
const path = join(dirname(args.importer), args.path);
|
|
1055
|
+
if (path === null) return { errors: [{ text: `"${args.path}" is outside the folder you opened` }] };
|
|
1056
|
+
for (const candidate of [path, `${path}.ts`, `${path}/index.ts`]) {
|
|
1083
1057
|
if (await tree.read(candidate) !== null) return { path: candidate, namespace: "tree" };
|
|
1084
1058
|
}
|
|
1085
|
-
return { errors: [{ text: `cannot find "${args.path}" (${
|
|
1059
|
+
return { errors: [{ text: `cannot find "${args.path}" (${path})` }] };
|
|
1086
1060
|
});
|
|
1087
1061
|
build.onLoad({ filter: /.*/, namespace: "tree" }, async (args) => {
|
|
1088
1062
|
const contents = await tree.read(args.path);
|
|
@@ -1208,57 +1182,76 @@ async function resolvePackage(tree, specifier, importer) {
|
|
|
1208
1182
|
}
|
|
1209
1183
|
var ORDER = /^(\d+)-/;
|
|
1210
1184
|
var projectName = (folder) => folder.replace(ORDER, "");
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
var GLUE = [
|
|
1215
|
-
`${path.dirname(new URL(import.meta.resolve("@beff/aula")).pathname)}/`,
|
|
1216
|
-
new URL(import.meta.url).pathname
|
|
1217
|
-
];
|
|
1218
|
-
function host(capabilities, root, glue = []) {
|
|
1219
|
-
const all = [...GLUE, ...glue];
|
|
1220
|
-
return {
|
|
1221
|
-
frames: v8Frames,
|
|
1222
|
-
name: (file) => file.startsWith("/") && !file.includes("/node_modules/") && !all.some((g) => file.startsWith(g)) ? path.relative(root, file) : void 0,
|
|
1223
|
-
exists: (file) => capabilities.fs.existsSync(path.resolve(root, file))
|
|
1224
|
-
};
|
|
1185
|
+
function sectionHeading(folder) {
|
|
1186
|
+
const words = projectName(folder).replaceAll("-", " ");
|
|
1187
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
1225
1188
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1189
|
+
var compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
1190
|
+
function folderOrder(a, b) {
|
|
1191
|
+
const x = ORDER.exec(a)?.[1];
|
|
1192
|
+
const y = ORDER.exec(b)?.[1];
|
|
1193
|
+
if (x === void 0 || y === void 0) {
|
|
1194
|
+
if (x !== y) return x === void 0 ? 1 : -1;
|
|
1195
|
+
} else {
|
|
1196
|
+
const [m, n] = [x.replace(/^0+/, ""), y.replace(/^0+/, "")];
|
|
1197
|
+
const by = m.length - n.length || compare(m, n);
|
|
1198
|
+
if (by !== 0) return by;
|
|
1199
|
+
}
|
|
1200
|
+
return compare(projectName(a), projectName(b)) || compare(a, b);
|
|
1228
1201
|
}
|
|
1229
|
-
async function
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1202
|
+
async function subfolders(tree, folder) {
|
|
1203
|
+
const names = await tree.list(folder);
|
|
1204
|
+
return names.filter((name) => name !== "node_modules" && !name.startsWith(".")).toSorted(folderOrder);
|
|
1205
|
+
}
|
|
1206
|
+
var exists = async (tree, path) => await tree.read(path) !== null;
|
|
1207
|
+
async function projectModules(tree, root) {
|
|
1208
|
+
if (await exists(tree, "index.ts"))
|
|
1209
|
+
return { _tag: "Right", right: [{ module: "index.ts", name: projectName(root) }] };
|
|
1210
|
+
const found = [];
|
|
1211
|
+
for (const folder of await subfolders(tree, "")) {
|
|
1212
|
+
if (await exists(tree, `${folder}/index.ts`)) {
|
|
1213
|
+
found.push({ module: `${folder}/index.ts`, name: projectName(folder) });
|
|
1214
|
+
continue;
|
|
1215
|
+
}
|
|
1216
|
+
for (const inner of await subfolders(tree, folder)) {
|
|
1217
|
+
const module = `${folder}/${inner}/index.ts`;
|
|
1218
|
+
if (await exists(tree, module)) found.push({ module, name: projectName(inner), section: sectionHeading(folder) });
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
const errors = [];
|
|
1222
|
+
found.forEach((project, i) => {
|
|
1223
|
+
const first = found.findIndex((other) => other.name === project.name);
|
|
1224
|
+
if (first === i) return;
|
|
1225
|
+
const folders = [found[first], project].map((p) => (p?.module ?? "").slice(0, -"/index.ts".length));
|
|
1226
|
+
errors.push({
|
|
1227
|
+
severity: "error",
|
|
1228
|
+
message: `two projects have the name ${project.name}: ${folders.join(" and ")}`,
|
|
1229
|
+
hint: "the name of a project is its folder name without the order prefix: rename one of the folders",
|
|
1230
|
+
stack: [],
|
|
1231
|
+
related: []
|
|
1232
|
+
});
|
|
1233
|
+
});
|
|
1234
|
+
return errors.length > 0 ? { _tag: "Left", left: errors } : { _tag: "Right", right: found };
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// ../aula-project/src/diagnostics.ts
|
|
1238
|
+
import { diagnosticOf } from "@beff/aula/run";
|
|
1239
|
+
function error(message, more = {}) {
|
|
1240
|
+
return { severity: "error", message, ...more, stack: [], related: [] };
|
|
1241
|
+
}
|
|
1242
|
+
var isError = (d) => d.severity === "error";
|
|
1243
|
+
var Problems = class extends Error {
|
|
1244
|
+
diagnostics;
|
|
1245
|
+
constructor(diagnostics) {
|
|
1246
|
+
super(diagnostics.map((d) => d.message).join("\n"));
|
|
1247
|
+
this.diagnostics = diagnostics;
|
|
1236
1248
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
if (!isProjectDefinition(exported)) {
|
|
1241
|
-
const rel = path.relative(root, file);
|
|
1242
|
-
throw new Problems([
|
|
1243
|
-
error(`the default export of ${rel} is not made by defineProject`, {
|
|
1244
|
-
location: { file: rel, line: 1, col: 0 },
|
|
1245
|
-
hint: "write `export default defineProject({ title, theme, chapters: [ \u2026 ] })`"
|
|
1246
|
-
})
|
|
1247
|
-
]);
|
|
1248
|
-
}
|
|
1249
|
-
return exported;
|
|
1249
|
+
};
|
|
1250
|
+
function wrongArgument(message, hint) {
|
|
1251
|
+
return new Problems([error(message, hint === void 0 ? {} : { hint })]);
|
|
1250
1252
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
async function withSource(capabilities, root, d) {
|
|
1254
|
-
if (d.source !== void 0 || d.location === void 0) return d;
|
|
1255
|
-
const file = path.resolve(root, d.location.file);
|
|
1256
|
-
if (!capabilities.fs.existsSync(file)) return d;
|
|
1257
|
-
const text = await capabilities.fs.readFile(file, "utf8");
|
|
1258
|
-
const lines = text.split("\n");
|
|
1259
|
-
if (lines.at(-1) === "") lines.pop();
|
|
1260
|
-
const line = lines[d.location.line - 1];
|
|
1261
|
-
return line === void 0 || d.location.line < 1 ? d : { ...d, source: line.replace(/\r$/, "") };
|
|
1253
|
+
function diagnosticsOf(e, host) {
|
|
1254
|
+
return e instanceof Problems ? e.diagnostics : [diagnosticOf(e, "", host)];
|
|
1262
1255
|
}
|
|
1263
1256
|
|
|
1264
1257
|
export {
|
|
@@ -1269,14 +1262,11 @@ export {
|
|
|
1269
1262
|
buildParsers,
|
|
1270
1263
|
Parsers,
|
|
1271
1264
|
bundle,
|
|
1265
|
+
projectName,
|
|
1266
|
+
projectModules,
|
|
1272
1267
|
error,
|
|
1273
1268
|
isError,
|
|
1274
1269
|
Problems,
|
|
1275
1270
|
wrongArgument,
|
|
1276
|
-
diagnosticsOf
|
|
1277
|
-
host,
|
|
1278
|
-
loadProject,
|
|
1279
|
-
folderOf,
|
|
1280
|
-
nameOf,
|
|
1281
|
-
withSource
|
|
1271
|
+
diagnosticsOf
|
|
1282
1272
|
};
|