@keymanapp/kmc 17.0.279-beta → 17.0.280-beta
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/build/src/commands/build.d.ts.map +1 -1
- package/build/src/commands/build.js +4 -2
- package/build/src/commands/build.js.map +1 -1
- package/build/src/commands/messageCommand.d.ts +3 -0
- package/build/src/commands/messageCommand.d.ts.map +1 -0
- package/build/src/commands/messageCommand.js +239 -0
- package/build/src/commands/messageCommand.js.map +1 -0
- package/build/src/kmc.js +4 -2
- package/build/src/kmc.js.map +1 -1
- package/build/src/messages/infrastructureMessages.d.ts +44 -25
- package/build/src/messages/infrastructureMessages.d.ts.map +1 -1
- package/build/src/messages/infrastructureMessages.js +38 -28
- package/build/src/messages/infrastructureMessages.js.map +1 -1
- package/build/src/messages/messageNamespaces.d.ts +5 -1
- package/build/src/messages/messageNamespaces.d.ts.map +1 -1
- package/build/src/messages/messageNamespaces.js +16 -3
- package/build/src/messages/messageNamespaces.js.map +1 -1
- package/build/src/util/extendedCompilerOptions.d.ts +7 -0
- package/build/src/util/extendedCompilerOptions.d.ts.map +1 -1
- package/build/src/util/extendedCompilerOptions.js +26 -19
- package/build/src/util/extendedCompilerOptions.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAyB,eAAe,EAAmB,MAAM,yBAAyB,CAAC;AASlG,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QAqD5C;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAyB,eAAe,EAAmB,MAAM,yBAAyB,CAAC;AASlG,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QAqD5C;AA6CD,iBAAe,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAoE1I;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;CAE7B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="48864c7f-3846-57fc-bef9-33822222e700")}catch(e){}}();
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { buildActivities } from './buildClasses/buildActivities.js';
|
|
@@ -79,6 +79,8 @@ async function buildFile(filenames, _options, commander) {
|
|
|
79
79
|
// folder ('.') as a project-style build
|
|
80
80
|
filenames.push('.');
|
|
81
81
|
}
|
|
82
|
+
/* c8 ignore next 6 */
|
|
83
|
+
// full test on console log of error message not justified; check with user test recommended
|
|
82
84
|
if (filenames.length > 1 && commanderOptions.outFile) {
|
|
83
85
|
// -o can only be specified with a single input file
|
|
84
86
|
callbacks.reportMessage(InfrastructureMessages.Error_OutFileCanOnlyBeSpecifiedWithSingleInfile());
|
|
@@ -162,5 +164,5 @@ async function build(filename, outfile, parentCallbacks, options) {
|
|
|
162
164
|
export const unitTestEndpoints = {
|
|
163
165
|
build,
|
|
164
166
|
};
|
|
165
|
-
//# debugId=
|
|
167
|
+
//# debugId=48864c7f-3846-57fc-bef9-33822222e700
|
|
166
168
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"48864c7f-3846-57fc-bef9-33822222e700","file":"build.js","mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAoC,MAAM,yBAAyB,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,sBAAsB;IACtB,MAAM,YAAY,GAAG,OAAO;SACzB,OAAO,CAAC,OAAO,CAAC;SAChB,MAAM,CAAC,SAAS,EAAE,qCAAqC,CAAC;SACxD,MAAM,CAAC,YAAY,EAAE,yEAAyE,CAAC;QAEhG,4EAA4E;QAC5E,yCAAyC;SACxC,MAAM,CAAC,aAAa,EAAE,qCAAqC,CAAC;SAC5D,MAAM,CAAC,mCAAmC,E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D,SAAS,CAAC,aAAa,CAAC,OAAO,YAAY,YAAY;gBACrD,CAAC,CAAC,sBAAsB,CAAC,gCAAgC,CAAC,EAAC,QAAQ,EAAC,aAAa,EAAE,gBAAgB,EAAC,CAAC;gBACrG,CAAC,CAAC,sBAAsB,CAAC,6BAA6B,CAAC,EAAC,QAAQ,EAAC,aAAa,EAAE,gBAAgB,EAAC,CAAC,CACnG,CAAC;SACH;QAED,OAAO,MAAM,CAAC;KACf;IAAC,OAAM,CAAC,EAAE;QACT,eAAe,CAAC,aAAa,CAAC,sBAAsB,CAAC,yBAAyB,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;QACrF,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK;CACN,CAAC","names":[],"sourceRoot":"","sources":["../../../src/commands/build.ts"],"version":3}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/messageCommand.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAyB5C,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAQ9C"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4ce735ab-b2c1-585a-9814-d527ddc6281e")}catch(e){}}();
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { CompilerError } from '@keymanapp/common-types';
|
|
5
|
+
import { Option } from 'commander';
|
|
6
|
+
import { messageNamespaceKeys, messageSources } from '../messages/messageNamespaces.js';
|
|
7
|
+
import { NodeCompilerCallbacks } from '../util/NodeCompilerCallbacks.js';
|
|
8
|
+
import { exitProcess } from '../util/sysexits.js';
|
|
9
|
+
import { InfrastructureMessages } from '../messages/infrastructureMessages.js';
|
|
10
|
+
import { findMessageDetails } from '../util/extendedCompilerOptions.js';
|
|
11
|
+
import { escapeMarkdownChar } from '@keymanapp/developer-utils';
|
|
12
|
+
;
|
|
13
|
+
export function declareMessage(program) {
|
|
14
|
+
program
|
|
15
|
+
.command('message [messages...]')
|
|
16
|
+
.description(`Describe one or more compiler messages. Note: Markdown format is always written to files on disk.`)
|
|
17
|
+
.addOption(new Option('-f, --format <format>', 'Output format').choices(['text', 'markdown', 'json']).default('text'))
|
|
18
|
+
.option('-o, --out-path <out-path>', 'Output path for Markdown files; output filename for text and json formats')
|
|
19
|
+
.option('-a, --all-messages', 'Emit descriptions for all messages (text, json)')
|
|
20
|
+
.action(messageCommand);
|
|
21
|
+
}
|
|
22
|
+
async function messageCommand(messages, _options, commander) {
|
|
23
|
+
const commanderOptions = commander.optsWithGlobals();
|
|
24
|
+
const options = initialize(commanderOptions);
|
|
25
|
+
if (!options) {
|
|
26
|
+
await exitProcess(1);
|
|
27
|
+
}
|
|
28
|
+
const callbacks = new NodeCompilerCallbacks(options);
|
|
29
|
+
let result = false;
|
|
30
|
+
if (options.format == 'markdown') {
|
|
31
|
+
result = messageCommandMarkdown(messages, options, callbacks);
|
|
32
|
+
}
|
|
33
|
+
else { // json or text format
|
|
34
|
+
if (messages.length == 0 && !options.allMessages) {
|
|
35
|
+
console.error('Must specify at least one message code or -a for all messages');
|
|
36
|
+
callbacks.reportMessage(InfrastructureMessages.Error_MustSpecifyMessageCode());
|
|
37
|
+
await exitProcess(1);
|
|
38
|
+
}
|
|
39
|
+
const messageDetails = messages.length
|
|
40
|
+
? messages.map(message => translateMessageInputToCode(message, callbacks))
|
|
41
|
+
: allMessageDetails();
|
|
42
|
+
if (callbacks.messageCount > 0) {
|
|
43
|
+
await exitProcess(1);
|
|
44
|
+
}
|
|
45
|
+
let text = null;
|
|
46
|
+
if (options.format == 'json') {
|
|
47
|
+
const data = getMessagesAsArrayForJson(messageDetails);
|
|
48
|
+
if (data) {
|
|
49
|
+
text = JSON.stringify(data, null, 2);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
text = getMessagesAsText(messageDetails);
|
|
54
|
+
}
|
|
55
|
+
result = text != null;
|
|
56
|
+
if (result) {
|
|
57
|
+
if (options.outPath) {
|
|
58
|
+
fs.writeFileSync(options.outPath, text, 'utf-8');
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
process.stdout.write(text);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (!result) {
|
|
66
|
+
await exitProcess(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// We have a redirect pattern for https://help.keyman.com/go/km<#####> to
|
|
70
|
+
// the corresponding compiler message reference document in
|
|
71
|
+
// /developer/latest-version/reference/errors/km<#####>
|
|
72
|
+
const helpUrl = (code) => `https://help.keyman.com/go/${CompilerError.formatCode(code).toLowerCase()}`;
|
|
73
|
+
const getModuleName = (ms) => `${ms.module}.${ms.class.name}`;
|
|
74
|
+
function translateMessageInputToCode(message, callbacks) {
|
|
75
|
+
const pattern = /^(KM)?([0-9a-f]+)$/i;
|
|
76
|
+
const result = message.match(pattern);
|
|
77
|
+
if (!result) {
|
|
78
|
+
callbacks.reportMessage(InfrastructureMessages.Error_UnrecognizedMessageCode({ message }));
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const code = Number.parseInt(result[2], 16);
|
|
82
|
+
return findMessageDetails(code, callbacks);
|
|
83
|
+
}
|
|
84
|
+
function initialize(options) {
|
|
85
|
+
// We don't want to rename command line options to match the precise
|
|
86
|
+
// properties that we have in CompilerOptions, but nor do we want to rename
|
|
87
|
+
// CompilerOptions properties...
|
|
88
|
+
return {
|
|
89
|
+
// CompilerBaseOptions
|
|
90
|
+
logLevel: options.logLevel,
|
|
91
|
+
logFormat: options.logFormat,
|
|
92
|
+
color: options.color,
|
|
93
|
+
// MessageOptions
|
|
94
|
+
format: options.format ?? 'text',
|
|
95
|
+
outPath: options.outPath
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const getMessageIdentifiersSorted = (cls) => Object.keys(cls)
|
|
99
|
+
.filter(id => typeof cls[id] == 'number')
|
|
100
|
+
.sort((a, b) => CompilerError.error(cls[a]) - CompilerError.error(cls[b]));
|
|
101
|
+
function allMessageDetails() {
|
|
102
|
+
let result = [];
|
|
103
|
+
messageNamespaceKeys.forEach((namespace) => {
|
|
104
|
+
const ms = messageSources[namespace];
|
|
105
|
+
const ids = getMessageIdentifiersSorted(ms.class);
|
|
106
|
+
for (const id of ids) {
|
|
107
|
+
const code = ms.class[id];
|
|
108
|
+
if (typeof code != 'number') {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
result.push({
|
|
112
|
+
code,
|
|
113
|
+
id,
|
|
114
|
+
class: ms.class,
|
|
115
|
+
module: ms.module
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
const toTitleCase = (s) => s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
|
|
122
|
+
function getMessageDetail(cls, id, escapeMarkdown) {
|
|
123
|
+
const o = /^(INFO|HINT|WARN|ERROR|FATAL)_([A-Za-z0-9_]+)$/.exec(id);
|
|
124
|
+
if (!o) {
|
|
125
|
+
throw new Error(`Unexpected compiler message ${id}, does not match message error format`);
|
|
126
|
+
}
|
|
127
|
+
const f = toTitleCase(o[1]) + '_' + o[2];
|
|
128
|
+
const event = cls[f]?.({} /* ignore arguments*/);
|
|
129
|
+
if (!event) {
|
|
130
|
+
throw new Error(`Call to ${cls.name}.${f} returned null`);
|
|
131
|
+
}
|
|
132
|
+
event.detail = (event.detail ?? '').replace(/^[ ]+/gm, ''); // TODO(lowpri): dedent may be too naive?
|
|
133
|
+
event.message = event.message ?? '';
|
|
134
|
+
event.message = event?.exceptionVar
|
|
135
|
+
? 'This is an internal error; the message will vary'
|
|
136
|
+
: (escapeMarkdown ? `${escapeMarkdownChar(event.message, false)}` : event.message);
|
|
137
|
+
return event;
|
|
138
|
+
}
|
|
139
|
+
/*---------------------------------------------------------------------------
|
|
140
|
+
* Get messages in text format
|
|
141
|
+
*---------------------------------------------------------------------------*/
|
|
142
|
+
function getMessagesAsText(messages) {
|
|
143
|
+
const result = messages.reduce((prev, message) => {
|
|
144
|
+
return prev + '\n' + formatMessageAsText(getModuleName({ class: message.class, module: message.module }), message.class, message.code, message.id);
|
|
145
|
+
}, '');
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
function formatMessageAsText(moduleName, cls, code, id) {
|
|
149
|
+
const message = getMessageDetail(cls, id, false);
|
|
150
|
+
return `${id}
|
|
151
|
+
* Code: ${CompilerError.formatCode(code)}
|
|
152
|
+
* Module: ${moduleName}
|
|
153
|
+
* Message: ${message.message}
|
|
154
|
+
* Reference: ${helpUrl(code)}
|
|
155
|
+
|
|
156
|
+
${message.detail}
|
|
157
|
+
`;
|
|
158
|
+
}
|
|
159
|
+
/*---------------------------------------------------------------------------
|
|
160
|
+
* Get messages as array of objects, for export to JSON
|
|
161
|
+
*---------------------------------------------------------------------------*/
|
|
162
|
+
function getMessagesAsArrayForJson(messages) {
|
|
163
|
+
return messages.map(message => ({
|
|
164
|
+
code: CompilerError.formatCode(message.code),
|
|
165
|
+
id: message.id,
|
|
166
|
+
class: message.class.name,
|
|
167
|
+
module: message.module,
|
|
168
|
+
detail: (() => getMessageDetail(message.class, message.id, false).detail)()
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
/*---------------------------------------------------------------------------
|
|
172
|
+
* Export as Markdown
|
|
173
|
+
*---------------------------------------------------------------------------*/
|
|
174
|
+
function messageCommandMarkdown(messages, options, callbacks) {
|
|
175
|
+
if (messages.length) {
|
|
176
|
+
callbacks.reportMessage(InfrastructureMessages.Error_MessagesCannotBeFilteredForMarkdownFormat());
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
if (!options.outPath) {
|
|
180
|
+
callbacks.reportMessage(InfrastructureMessages.Error_OutputPathMustBeSpecifiedForMarkdownFormat());
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
if (!fs.existsSync(options.outPath) || !fs.statSync(options.outPath)?.isDirectory()) {
|
|
184
|
+
callbacks.reportMessage(InfrastructureMessages.Error_OutputPathMustExistAndBeADirectory({ outPath: options.outPath }));
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
exportAllMessagesAsMarkdown(options.outPath);
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
function exportAllMessagesAsMarkdown(outPath) {
|
|
191
|
+
let index = `---
|
|
192
|
+
title: Compiler Messages Reference
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
`;
|
|
196
|
+
messageNamespaceKeys.forEach((namespace) => {
|
|
197
|
+
const ms = messageSources[namespace];
|
|
198
|
+
const moduleName = getModuleName(ms);
|
|
199
|
+
index += `* [${moduleName}](${moduleName.toLowerCase()})\n`;
|
|
200
|
+
exportModuleMessagesAsMarkdown(moduleName, ms, outPath);
|
|
201
|
+
});
|
|
202
|
+
fs.writeFileSync(path.join(outPath, 'index.md'), index, 'utf-8');
|
|
203
|
+
}
|
|
204
|
+
function exportModuleMessagesAsMarkdown(moduleName, ms, outPath) {
|
|
205
|
+
const cls = ms.class;
|
|
206
|
+
let index = `---
|
|
207
|
+
title: Compiler Messages Reference for @keymanapp/${ms.module}
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
Code | Identifier | Message
|
|
211
|
+
------|------------|---------
|
|
212
|
+
`;
|
|
213
|
+
const ids = getMessageIdentifiersSorted(cls);
|
|
214
|
+
for (const id of ids) {
|
|
215
|
+
const code = cls[id];
|
|
216
|
+
const filename = CompilerError.formatCode(code).toLowerCase();
|
|
217
|
+
const message = getMessageDetail(cls, id, true);
|
|
218
|
+
const content = formatMessageAsMarkdown(moduleName, id, message);
|
|
219
|
+
index += `[${CompilerError.formatCode(code)}](${filename}) | \`${id}\` | ${message.message}\n`;
|
|
220
|
+
fs.writeFileSync(path.join(outPath, filename + '.md'), content, 'utf-8');
|
|
221
|
+
}
|
|
222
|
+
fs.writeFileSync(path.join(outPath, moduleName + '.md'), index, 'utf-8');
|
|
223
|
+
}
|
|
224
|
+
function formatMessageAsMarkdown(moduleName, id, message) {
|
|
225
|
+
return `---
|
|
226
|
+
title: ${CompilerError.formatCode(message.code)}: ${id}
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
| | |
|
|
230
|
+
|------------|---------- |
|
|
231
|
+
| Message | ${message.message} |
|
|
232
|
+
| Module | [${moduleName}](${moduleName.toLowerCase()}) |
|
|
233
|
+
| Identifier | \`${id}\` |
|
|
234
|
+
|
|
235
|
+
${message.detail}
|
|
236
|
+
`;
|
|
237
|
+
}
|
|
238
|
+
//# debugId=4ce735ab-b2c1-585a-9814-d527ddc6281e
|
|
239
|
+
//# sourceMappingURL=messageCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"debug_id":"4ce735ab-b2c1-585a-9814-d527ddc6281e","file":"messageCommand.js","mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAA0C,aAAa,EAAyC,MAAM,yBAAyB,CAAC;AACvI,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAyB,oBAAoB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAyB,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EA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I,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,QAAQ,SAAS,EAAE,QAAQ,OAAO,CAAC,OAAO,IAAI,CAAC;QAC/F,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAC1E;IAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,uBAAuB,CAAC,UAAkB,EAAE,EAAU,EAAE,OAAsB;IACrF,OAAO;SACA,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;;;;;iBAKrC,OAAO,CAAC,OAAO;kBACd,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE;mBACtC,EAAE;;EAEnB,OAAO,CAAC,MAAM;CACf,CAAA;AACD,CAAC","names":[],"sourceRoot":"","sources":["../../../src/commands/messageCommand.ts"],"version":3}
|
package/build/src/kmc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4542efb2-9630-55a9-800d-24e26362ae86")}catch(e){}}();
|
|
3
3
|
/**
|
|
4
4
|
* kmc - Keyman Next Generation Compiler
|
|
5
5
|
*/
|
|
@@ -10,6 +10,7 @@ import { KeymanSentry, loadOptions } from '@keymanapp/developer-utils';
|
|
|
10
10
|
import KEYMAN_VERSION from "@keymanapp/keyman-version";
|
|
11
11
|
import { TestKeymanSentry } from './util/TestKeymanSentry.js';
|
|
12
12
|
import { exitProcess } from './util/sysexits.js';
|
|
13
|
+
import { declareMessage } from './commands/messageCommand.js';
|
|
13
14
|
await TestKeymanSentry.runTestIfCLRequested();
|
|
14
15
|
if (KeymanSentry.isEnabled()) {
|
|
15
16
|
KeymanSentry.init();
|
|
@@ -41,6 +42,7 @@ async function run() {
|
|
|
41
42
|
.addOption(new Option('--error-reporting', 'Enable error reporting to keyman.com (overriding user settings)'));
|
|
42
43
|
declareBuild(program);
|
|
43
44
|
declareAnalyze(program);
|
|
45
|
+
declareMessage(program);
|
|
44
46
|
/* Future commands:
|
|
45
47
|
declareClean(program);
|
|
46
48
|
declareCopy(program);
|
|
@@ -53,5 +55,5 @@ async function run() {
|
|
|
53
55
|
await program.parseAsync(process.argv)
|
|
54
56
|
.catch(reason => console.error(reason));
|
|
55
57
|
}
|
|
56
|
-
//# debugId=
|
|
58
|
+
//# debugId=4542efb2-9630-55a9-800d-24e26362ae86
|
|
57
59
|
//# sourceMappingURL=kmc.js.map
|
package/build/src/kmc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"4542efb2-9630-55a9-800d-24e26362ae86","file":"kmc.js","mappings":";;AACA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO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
2
|
+
static FATAL_UnexpectedException: number;
|
|
2
3
|
static Fatal_UnexpectedException: (o: {
|
|
3
4
|
e: any;
|
|
4
5
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
5
|
-
static
|
|
6
|
+
static INFO_BuildingFile: number;
|
|
6
7
|
static Info_BuildingFile: (o: {
|
|
7
8
|
filename: string;
|
|
8
9
|
relativeFilename: string;
|
|
@@ -11,20 +12,21 @@ export declare class InfrastructureMessages {
|
|
|
11
12
|
line?: number;
|
|
12
13
|
code: number;
|
|
13
14
|
message: string;
|
|
15
|
+
detail?: string;
|
|
14
16
|
exceptionVar?: any;
|
|
15
17
|
};
|
|
16
|
-
static
|
|
18
|
+
static ERROR_FileDoesNotExist: number;
|
|
17
19
|
static Error_FileDoesNotExist: (o: {
|
|
18
20
|
filename: string;
|
|
19
21
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
20
|
-
static
|
|
22
|
+
static ERROR_FileTypeNotRecognized: number;
|
|
21
23
|
static Error_FileTypeNotRecognized: (o: {
|
|
22
24
|
filename: string;
|
|
23
25
|
extensions: string;
|
|
24
26
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
25
|
-
static ERROR_FileTypeNotRecognized: number;
|
|
26
|
-
static Error_OutFileNotValidForProjects: () => import("@keymanapp/common-types").CompilerEvent;
|
|
27
27
|
static ERROR_OutFileNotValidForProjects: number;
|
|
28
|
+
static Error_OutFileNotValidForProjects: () => import("@keymanapp/common-types").CompilerEvent;
|
|
29
|
+
static INFO_FileBuiltSuccessfully: number;
|
|
28
30
|
static Info_FileBuiltSuccessfully: (o: {
|
|
29
31
|
filename: string;
|
|
30
32
|
relativeFilename: string;
|
|
@@ -33,9 +35,10 @@ export declare class InfrastructureMessages {
|
|
|
33
35
|
line?: number;
|
|
34
36
|
code: number;
|
|
35
37
|
message: string;
|
|
38
|
+
detail?: string;
|
|
36
39
|
exceptionVar?: any;
|
|
37
40
|
};
|
|
38
|
-
static
|
|
41
|
+
static INFO_FileNotBuiltSuccessfully: number;
|
|
39
42
|
static Info_FileNotBuiltSuccessfully: (o: {
|
|
40
43
|
filename: string;
|
|
41
44
|
relativeFilename: string;
|
|
@@ -44,22 +47,23 @@ export declare class InfrastructureMessages {
|
|
|
44
47
|
line?: number;
|
|
45
48
|
code: number;
|
|
46
49
|
message: string;
|
|
50
|
+
detail?: string;
|
|
47
51
|
exceptionVar?: any;
|
|
48
52
|
};
|
|
49
|
-
static
|
|
53
|
+
static ERROR_InvalidProjectFile: number;
|
|
50
54
|
static Error_InvalidProjectFile: (o: {
|
|
51
55
|
message: string;
|
|
52
56
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
53
|
-
static
|
|
57
|
+
static HINT_FilenameHasDifferingCase: number;
|
|
54
58
|
static Hint_FilenameHasDifferingCase: (o: {
|
|
55
59
|
reference: string;
|
|
56
60
|
filename: string;
|
|
57
61
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
58
|
-
static
|
|
62
|
+
static ERROR_UnknownFileFormat: number;
|
|
59
63
|
static Error_UnknownFileFormat: (o: {
|
|
60
64
|
format: string;
|
|
61
65
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
62
|
-
static
|
|
66
|
+
static INFO_ProjectBuiltSuccessfully: number;
|
|
63
67
|
static Info_ProjectBuiltSuccessfully: (o: {
|
|
64
68
|
filename: string;
|
|
65
69
|
relativeFilename: string;
|
|
@@ -68,9 +72,10 @@ export declare class InfrastructureMessages {
|
|
|
68
72
|
line?: number;
|
|
69
73
|
code: number;
|
|
70
74
|
message: string;
|
|
75
|
+
detail?: string;
|
|
71
76
|
exceptionVar?: any;
|
|
72
77
|
};
|
|
73
|
-
static
|
|
78
|
+
static INFO_ProjectNotBuiltSuccessfully: number;
|
|
74
79
|
static Info_ProjectNotBuiltSuccessfully: (o: {
|
|
75
80
|
filename: string;
|
|
76
81
|
relativeFilename: string;
|
|
@@ -79,55 +84,69 @@ export declare class InfrastructureMessages {
|
|
|
79
84
|
line?: number;
|
|
80
85
|
code: number;
|
|
81
86
|
message: string;
|
|
87
|
+
detail?: string;
|
|
82
88
|
exceptionVar?: any;
|
|
83
89
|
};
|
|
84
|
-
static
|
|
90
|
+
static INFO_TooManyMessages: number;
|
|
85
91
|
static Info_TooManyMessages: (o: {
|
|
86
92
|
count: number;
|
|
87
93
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
88
|
-
static
|
|
94
|
+
static ERROR_FileTypeNotFound: number;
|
|
89
95
|
static Error_FileTypeNotFound: (o: {
|
|
90
96
|
ext: string;
|
|
91
97
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
92
|
-
static
|
|
98
|
+
static ERROR_NotAProjectFile: number;
|
|
93
99
|
static Error_NotAProjectFile: (o: {
|
|
94
100
|
filename: string;
|
|
95
101
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
96
|
-
static ERROR_NotAProjectFile: number;
|
|
97
|
-
static Info_WarningsHaveFailedBuild: () => import("@keymanapp/common-types").CompilerEvent;
|
|
98
102
|
static INFO_WarningsHaveFailedBuild: number;
|
|
103
|
+
static Info_WarningsHaveFailedBuild: () => import("@keymanapp/common-types").CompilerEvent;
|
|
104
|
+
static ERROR_CannotCreateFolder: number;
|
|
99
105
|
static Error_CannotCreateFolder: (o: {
|
|
100
106
|
folderName: string;
|
|
101
107
|
e: any;
|
|
102
108
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
103
|
-
static
|
|
109
|
+
static ERROR_InvalidProjectFolder: number;
|
|
104
110
|
static Error_InvalidProjectFolder: (o: {
|
|
105
111
|
folderName: string;
|
|
106
112
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
107
|
-
static
|
|
113
|
+
static ERROR_UnsupportedProjectVersion: number;
|
|
108
114
|
static Error_UnsupportedProjectVersion: (o: {
|
|
109
115
|
version: string;
|
|
110
116
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
111
|
-
static ERROR_UnsupportedProjectVersion: number;
|
|
112
|
-
static Hint_ProjectIsVersion10: () => import("@keymanapp/common-types").CompilerEvent;
|
|
113
117
|
static HINT_ProjectIsVersion10: number;
|
|
114
|
-
static
|
|
118
|
+
static Hint_ProjectIsVersion10: () => import("@keymanapp/common-types").CompilerEvent;
|
|
115
119
|
static ERROR_OutFileCanOnlyBeSpecifiedWithSingleInfile: number;
|
|
120
|
+
static Error_OutFileCanOnlyBeSpecifiedWithSingleInfile: () => import("@keymanapp/common-types").CompilerEvent;
|
|
121
|
+
static ERROR_InvalidMessageFormat: number;
|
|
116
122
|
static Error_InvalidMessageFormat: (o: {
|
|
117
123
|
message: string;
|
|
118
124
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
119
|
-
static
|
|
125
|
+
static ERROR_MessageNamespaceNotFound: number;
|
|
120
126
|
static Error_MessageNamespaceNotFound: (o: {
|
|
121
127
|
code: number;
|
|
122
128
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
123
|
-
static
|
|
129
|
+
static ERROR_MessageCodeNotFound: number;
|
|
124
130
|
static Error_MessageCodeNotFound: (o: {
|
|
125
131
|
code: number;
|
|
126
132
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
127
|
-
static
|
|
133
|
+
static ERROR_MessageCannotBeCoerced: number;
|
|
128
134
|
static Error_MessageCannotBeCoerced: (o: {
|
|
129
135
|
code: number;
|
|
130
136
|
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
131
|
-
static
|
|
137
|
+
static ERROR_UnrecognizedMessageCode: number;
|
|
138
|
+
static Error_UnrecognizedMessageCode: (o: {
|
|
139
|
+
message: string;
|
|
140
|
+
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
141
|
+
static ERROR_MustSpecifyMessageCode: number;
|
|
142
|
+
static Error_MustSpecifyMessageCode: () => import("@keymanapp/common-types").CompilerEvent;
|
|
143
|
+
static ERROR_MessagesCannotBeFilteredForMarkdownFormat: number;
|
|
144
|
+
static Error_MessagesCannotBeFilteredForMarkdownFormat: () => import("@keymanapp/common-types").CompilerEvent;
|
|
145
|
+
static ERROR_OutputPathMustBeSpecifiedForMarkdownFormat: number;
|
|
146
|
+
static Error_OutputPathMustBeSpecifiedForMarkdownFormat: () => import("@keymanapp/common-types").CompilerEvent;
|
|
147
|
+
static ERROR_OutputPathMustExistAndBeADirectory: number;
|
|
148
|
+
static Error_OutputPathMustExistAndBeADirectory: (o: {
|
|
149
|
+
outPath: string;
|
|
150
|
+
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
132
151
|
}
|
|
133
152
|
//# sourceMappingURL=infrastructureMessages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructureMessages.d.ts","sourceRoot":"","sources":["../../../src/messages/infrastructureMessages.ts"],"names":[],"mappings":"AASA,qBAAa,sBAAsB;IACjC,MAAM,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,
|
|
1
|
+
{"version":3,"file":"infrastructureMessages.d.ts","sourceRoot":"","sources":["../../../src/messages/infrastructureMessages.ts"],"names":[],"mappings":"AASA,qBAAa,sBAAsB;IACjC,MAAM,CAAC,yBAAyB,SAAqB;IACrD,MAAM,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,qDAAoG;IAGlJ,MAAM,CAAC,iBAAiB,SAAoB;IAC5C,MAAM,CAAC,iBAAiB,MAAM;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAA,gBAAgB,EAAC,MAAM,CAAA;KAAC;;;;;;;MAC5B;IAE3C,MAAM,CAAC,sBAAsB,SAAqB;IAClD,MAAM,CAAC,sBAAsB,MAAM;QAAC,QAAQ,EAAC,MAAM,CAAA;KAAC,qDACR;IAE5C,MAAM,CAAC,2BAA2B,SAAqB;IACvD,MAAM,CAAC,2BAA2B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,qDACqB;IAEnG,MAAM,CAAC,gCAAgC,SAAqB;IAC5D,MAAM,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,CAAC,4BAA4B,SAAqB;IACxD,MAAM,CAAC,4BAA4B,wDAEgC;IAEnE,MAAM,CAAC,+CAA+C,SAAqB;IAC3E,MAAM,CAAC,+CAA+C,wDAED;IAErD,MAAM,CAAC,gDAAgD,SAAqB;IAC5E,MAAM,CAAC,gDAAgD,wDAEe;IAEtE,MAAM,CAAC,wCAAwC,SAAqB;IACpE,MAAM,CAAC,wCAAwC,MAAM;QAAC,OAAO,EAAC,MAAM,CAAA;KAAC,qDAEF;CACpE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
-
import { CompilerError, CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m } from "@keymanapp/common-types";
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="20670923-6d88-5a0c-97aa-d77f25852eee")}catch(e){}}();
|
|
2
|
+
import { CompilerError, CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m, CompilerMessageDef as def, CompilerMessageSpecWithException } from "@keymanapp/common-types";
|
|
3
3
|
const Namespace = CompilerErrorNamespace.Infrastructure;
|
|
4
4
|
const SevInfo = CompilerErrorSeverity.Info | Namespace;
|
|
5
5
|
const SevHint = CompilerErrorSeverity.Hint | Namespace;
|
|
@@ -7,61 +7,71 @@ const SevHint = CompilerErrorSeverity.Hint | Namespace;
|
|
|
7
7
|
const SevError = CompilerErrorSeverity.Error | Namespace;
|
|
8
8
|
const SevFatal = CompilerErrorSeverity.Fatal | Namespace;
|
|
9
9
|
export class InfrastructureMessages {
|
|
10
|
-
static Fatal_UnexpectedException = (o) => m(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error');
|
|
11
10
|
static FATAL_UnexpectedException = SevFatal | 0x0001;
|
|
11
|
+
static Fatal_UnexpectedException = (o) => CompilerMessageSpecWithException(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error');
|
|
12
12
|
// For this message, we override the filename with the passed-in file. A bit of a hack but does the job
|
|
13
|
-
static Info_BuildingFile = (o) => ({ filename: o.filename, ...m(this.INFO_BuildingFile, `Building ${o.relativeFilename}`) });
|
|
14
13
|
static INFO_BuildingFile = SevInfo | 0x0002;
|
|
15
|
-
static
|
|
14
|
+
static Info_BuildingFile = (o) => ({ filename: o.filename, ...m(this.INFO_BuildingFile, `Building ${def(o.relativeFilename)}`) });
|
|
16
15
|
static ERROR_FileDoesNotExist = SevError | 0x0003;
|
|
17
|
-
static
|
|
16
|
+
static Error_FileDoesNotExist = (o) => m(this.ERROR_FileDoesNotExist, `File ${def(o.filename)} does not exist`);
|
|
18
17
|
static ERROR_FileTypeNotRecognized = SevError | 0x0004;
|
|
19
|
-
static
|
|
18
|
+
static Error_FileTypeNotRecognized = (o) => m(this.ERROR_FileTypeNotRecognized, `Unrecognised input file ${def(o.filename)}, expecting ${def(o.extensions)}, or project folder`);
|
|
20
19
|
static ERROR_OutFileNotValidForProjects = SevError | 0x0005;
|
|
20
|
+
static Error_OutFileNotValidForProjects = () => m(this.ERROR_OutFileNotValidForProjects, `--out-file should not be specified for project builds`);
|
|
21
21
|
// For this message, we override the filename with the passed-in file. A bit of a hack but does the job
|
|
22
|
-
static Info_FileBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_FileBuiltSuccessfully, `${o.relativeFilename} built successfully.`) });
|
|
23
22
|
static INFO_FileBuiltSuccessfully = SevInfo | 0x0006;
|
|
23
|
+
static Info_FileBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_FileBuiltSuccessfully, `${def(o.relativeFilename)} built successfully.`) });
|
|
24
24
|
// For this message, we override the filename with the passed-in file. A bit of a hack but does the job
|
|
25
|
-
static Info_FileNotBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_FileNotBuiltSuccessfully, `${o.relativeFilename} failed to build.`) });
|
|
26
25
|
static INFO_FileNotBuiltSuccessfully = SevInfo | 0x0007;
|
|
27
|
-
static
|
|
26
|
+
static Info_FileNotBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_FileNotBuiltSuccessfully, `${def(o.relativeFilename)} failed to build.`) });
|
|
28
27
|
static ERROR_InvalidProjectFile = SevError | 0x0008;
|
|
29
|
-
static
|
|
28
|
+
static Error_InvalidProjectFile = (o) => m(this.ERROR_InvalidProjectFile, `Project file is not valid: ${def(o.message)}`);
|
|
30
29
|
static HINT_FilenameHasDifferingCase = SevHint | 0x0009;
|
|
31
|
-
static
|
|
30
|
+
static Hint_FilenameHasDifferingCase = (o) => m(this.HINT_FilenameHasDifferingCase, `File on disk '${def(o.filename)}' does not match case of '${def(o.reference)}' in source file; this is an error on platforms with case-sensitive filesystems.`);
|
|
32
31
|
static ERROR_UnknownFileFormat = SevError | 0x000A;
|
|
32
|
+
static Error_UnknownFileFormat = (o) => m(this.ERROR_UnknownFileFormat, `Unknown file format ${def(o.format)}; only Markdown (.md), JSON (.json), and Text (.txt) are supported.`);
|
|
33
33
|
// For this message, we override the filename with the passed-in file. A bit of a hack but does the job
|
|
34
|
-
static Info_ProjectBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_ProjectBuiltSuccessfully, `Project ${o.relativeFilename} built successfully.`) });
|
|
35
34
|
static INFO_ProjectBuiltSuccessfully = SevInfo | 0x000B;
|
|
35
|
+
static Info_ProjectBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_ProjectBuiltSuccessfully, `Project ${def(o.relativeFilename)} built successfully.`) });
|
|
36
36
|
// For this message, we override the filename with the passed-in file. A bit of a hack but does the job
|
|
37
|
-
static Info_ProjectNotBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_ProjectNotBuiltSuccessfully, `Project ${o.relativeFilename} failed to build.`) });
|
|
38
37
|
static INFO_ProjectNotBuiltSuccessfully = SevInfo | 0x000C;
|
|
39
|
-
static
|
|
38
|
+
static Info_ProjectNotBuiltSuccessfully = (o) => ({ filename: o.filename, ...m(this.INFO_ProjectNotBuiltSuccessfully, `Project ${def(o.relativeFilename)} failed to build.`) });
|
|
40
39
|
static INFO_TooManyMessages = SevInfo | 0x000D;
|
|
41
|
-
static
|
|
40
|
+
static Info_TooManyMessages = (o) => m(this.INFO_TooManyMessages, `More than ${def(o.count)} warnings or errors received; suppressing further messages.`);
|
|
42
41
|
static ERROR_FileTypeNotFound = SevError | 0x000E;
|
|
43
|
-
static
|
|
42
|
+
static Error_FileTypeNotFound = (o) => m(this.ERROR_FileTypeNotFound, `A file of type ${def(o.ext)} was not found in the project.`);
|
|
44
43
|
static ERROR_NotAProjectFile = SevError | 0x000F;
|
|
45
|
-
static
|
|
44
|
+
static Error_NotAProjectFile = (o) => m(this.ERROR_NotAProjectFile, `File ${def(o.filename)} must have a .kpj extension to be treated as a project.`);
|
|
46
45
|
static INFO_WarningsHaveFailedBuild = SevInfo | 0x0010;
|
|
47
|
-
static
|
|
46
|
+
static Info_WarningsHaveFailedBuild = () => m(this.INFO_WarningsHaveFailedBuild, `The build failed because option "treat warnings as errors" is enabled and there are one or more warnings.`);
|
|
48
47
|
static ERROR_CannotCreateFolder = SevError | 0x0011;
|
|
49
|
-
static
|
|
48
|
+
static Error_CannotCreateFolder = (o) => CompilerMessageSpecWithException(this.ERROR_CannotCreateFolder, null, `Unable to create folder ${def(o.folderName)}: ${o.e ?? 'unknown error'}`);
|
|
50
49
|
static ERROR_InvalidProjectFolder = SevError | 0x0012;
|
|
51
|
-
static
|
|
50
|
+
static Error_InvalidProjectFolder = (o) => m(this.ERROR_InvalidProjectFolder, `The folder ${def(o.folderName)} does not appear to be a Keyman Developer project.`);
|
|
52
51
|
static ERROR_UnsupportedProjectVersion = SevError | 0x0013;
|
|
53
|
-
static
|
|
52
|
+
static Error_UnsupportedProjectVersion = (o) => m(this.ERROR_UnsupportedProjectVersion, `Project version ${def(o.version)} is not supported by this version of Keyman Developer.`);
|
|
54
53
|
static HINT_ProjectIsVersion10 = SevHint | 0x0014;
|
|
55
|
-
static
|
|
54
|
+
static Hint_ProjectIsVersion10 = () => m(this.HINT_ProjectIsVersion10, `The project file is an older version and can be upgraded to version 17.0`);
|
|
56
55
|
static ERROR_OutFileCanOnlyBeSpecifiedWithSingleInfile = SevError | 0x0015;
|
|
57
|
-
static
|
|
56
|
+
static Error_OutFileCanOnlyBeSpecifiedWithSingleInfile = () => m(this.ERROR_OutFileCanOnlyBeSpecifiedWithSingleInfile, `Parameter --out-file can only be used with a single input file.`);
|
|
58
57
|
static ERROR_InvalidMessageFormat = SevError | 0x0016;
|
|
59
|
-
static
|
|
58
|
+
static Error_InvalidMessageFormat = (o) => m(this.ERROR_InvalidMessageFormat, `Invalid parameter: --message ${def(o.message)} must match format '[KM]#####[:Disable|Info|Hint|Warn|Error]'`);
|
|
60
59
|
static ERROR_MessageNamespaceNotFound = SevError | 0x0017;
|
|
61
|
-
static
|
|
60
|
+
static Error_MessageNamespaceNotFound = (o) => m(this.ERROR_MessageNamespaceNotFound, `Invalid parameter: --message ${def(o.code ? CompilerError.formatCode(o.code) : undefined)} does not have a recognized namespace`);
|
|
62
61
|
static ERROR_MessageCodeNotFound = SevError | 0x0018;
|
|
63
|
-
static
|
|
62
|
+
static Error_MessageCodeNotFound = (o) => m(this.ERROR_MessageCodeNotFound, `Invalid parameter: --message ${o.code ? CompilerError.formatCode(o.code) : undefined} is not a recognized code`);
|
|
64
63
|
static ERROR_MessageCannotBeCoerced = SevError | 0x0019;
|
|
64
|
+
static Error_MessageCannotBeCoerced = (o) => m(this.ERROR_MessageCannotBeCoerced, `Invalid parameter: --message ${def(o.code ? CompilerError.formatCode(o.code) : undefined)} is not of type 'info', 'hint' or 'warn', and cannot be coerced`);
|
|
65
|
+
static ERROR_UnrecognizedMessageCode = SevError | 0x001a;
|
|
66
|
+
static Error_UnrecognizedMessageCode = (o) => m(this.ERROR_UnrecognizedMessageCode, `Invalid parameter: message identifier '${def(o.message)}' must match format '[KM]#####'`);
|
|
67
|
+
static ERROR_MustSpecifyMessageCode = SevError | 0x001b;
|
|
68
|
+
static Error_MustSpecifyMessageCode = () => m(this.ERROR_MustSpecifyMessageCode, `Must specify at least one message code or -a for all messages`);
|
|
69
|
+
static ERROR_MessagesCannotBeFilteredForMarkdownFormat = SevError | 0x001c;
|
|
70
|
+
static Error_MessagesCannotBeFilteredForMarkdownFormat = () => m(this.ERROR_MessagesCannotBeFilteredForMarkdownFormat, `Messages cannot be filtered for markdown format`);
|
|
71
|
+
static ERROR_OutputPathMustBeSpecifiedForMarkdownFormat = SevError | 0x001d;
|
|
72
|
+
static Error_OutputPathMustBeSpecifiedForMarkdownFormat = () => m(this.ERROR_OutputPathMustBeSpecifiedForMarkdownFormat, `Output path must be specified with -o for markdown output format`);
|
|
73
|
+
static ERROR_OutputPathMustExistAndBeADirectory = SevError | 0x001e;
|
|
74
|
+
static Error_OutputPathMustExistAndBeADirectory = (o) => m(this.ERROR_OutputPathMustExistAndBeADirectory, `Output path ${def(o.outPath)} must exist and must be a folder`);
|
|
65
75
|
}
|
|
66
|
-
//# debugId=
|
|
76
|
+
//# debugId=20670923-6d88-5a0c-97aa-d77f25852eee
|
|
67
77
|
//# sourceMappingURL=infrastructureMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"20670923-6d88-5a0c-97aa-d77f25852eee","file":"infrastructureMessages.js","mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,IAAI,CAAC,EAAE,kBAAkB,IAAI,GAAG,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAE9L,MAAM,SAAS,GAAG,sBAAsB,CAAC,cAAc,CAAC;AACxD,MAAM,OAAO,GAAG,qBAAqB,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AAC,CAAC,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC","names":[],"sourceRoot":"","sources":["../../../src/messages/infrastructureMessages.ts"],"version":3}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CompilerErrorNamespace } from '@keymanapp/common-types';
|
|
2
|
-
export declare const messageNamespaces: Record<CompilerErrorNamespace, any>;
|
|
3
2
|
export declare const messageNamespaceKeys: number[];
|
|
3
|
+
export type CompilerMessageSource = {
|
|
4
|
+
module: string;
|
|
5
|
+
class: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const messageSources: Record<CompilerErrorNamespace, CompilerMessageSource>;
|
|
4
8
|
//# sourceMappingURL=messageNamespaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageNamespaces.d.ts","sourceRoot":"","sources":["../../../src/messages/messageNamespaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"messageNamespaces.d.ts","sourceRoot":"","sources":["../../../src/messages/messageNamespaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AA0BtF,eAAO,MAAM,oBAAoB,UAA8D,CAAC;AAEhG,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAWhF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d446b355-ad00-5dd7-9f58-3a3f122e751c")}catch(e){}}();
|
|
2
2
|
import { CommonTypesMessages, CompilerErrorNamespace } from '@keymanapp/common-types';
|
|
3
3
|
import { AnalyzerMessages } from '@keymanapp/kmc-analyze';
|
|
4
4
|
import { KeyboardInfoCompilerMessages } from '@keymanapp/kmc-keyboard-info';
|
|
@@ -9,7 +9,7 @@ import { ModelInfoCompilerMessages } from '@keymanapp/kmc-model-info';
|
|
|
9
9
|
import { PackageCompilerMessages } from '@keymanapp/kmc-package';
|
|
10
10
|
import { InfrastructureMessages } from './infrastructureMessages.js';
|
|
11
11
|
// Maps every compiler error namespace to the corresponding implementation
|
|
12
|
-
|
|
12
|
+
const messageNamespaces = {
|
|
13
13
|
[CompilerErrorNamespace.LdmlKeyboardCompiler]: LdmlKeyboardCompilerMessages,
|
|
14
14
|
[CompilerErrorNamespace.CommonTypes]: CommonTypesMessages,
|
|
15
15
|
[CompilerErrorNamespace.KmnCompiler]: KmnCompilerMessages,
|
|
@@ -24,5 +24,18 @@ export const messageNamespaces = {
|
|
|
24
24
|
// This works around pain points in enumerating enum members in Typescript
|
|
25
25
|
// ref https://www.totaltypescript.com/iterate-over-object-keys-in-typescript
|
|
26
26
|
export const messageNamespaceKeys = Object.keys(messageNamespaces).map(v => Number.parseInt(v));
|
|
27
|
-
|
|
27
|
+
// TODO: consolidate with messageNamespaces above
|
|
28
|
+
export const messageSources = {
|
|
29
|
+
[CompilerErrorNamespace.LdmlKeyboardCompiler]: { module: 'kmc-ldml', class: LdmlKeyboardCompilerMessages },
|
|
30
|
+
[CompilerErrorNamespace.CommonTypes]: { module: 'common-types', class: CommonTypesMessages },
|
|
31
|
+
[CompilerErrorNamespace.KmnCompiler]: { module: 'kmc-kmn', class: KmnCompilerMessages },
|
|
32
|
+
[CompilerErrorNamespace.ModelCompiler]: { module: 'kmc-model', class: ModelCompilerMessages },
|
|
33
|
+
[CompilerErrorNamespace.PackageCompiler]: { module: 'kmc-package', class: PackageCompilerMessages },
|
|
34
|
+
[CompilerErrorNamespace.Infrastructure]: { module: 'kmc', class: InfrastructureMessages },
|
|
35
|
+
[CompilerErrorNamespace.Analyzer]: { module: 'kmc-analyze', class: AnalyzerMessages },
|
|
36
|
+
[CompilerErrorNamespace.KmwCompiler]: { module: 'kmc-kmn', class: KmwCompilerMessages },
|
|
37
|
+
[CompilerErrorNamespace.ModelInfoCompiler]: { module: 'kmc-model-info', class: ModelInfoCompilerMessages },
|
|
38
|
+
[CompilerErrorNamespace.KeyboardInfoCompiler]: { module: 'kmc-keyboard-info', class: KeyboardInfoCompilerMessages },
|
|
39
|
+
};
|
|
40
|
+
//# debugId=d446b355-ad00-5dd7-9f58-3a3f122e751c
|
|
28
41
|
//# sourceMappingURL=messageNamespaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"d446b355-ad00-5dd7-9f58-3a3f122e751c","file":"messageNamespaces.js","mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,0EAA0E;AAC1E,MAAM,iBAAiB,GAAwC;IAC7D,CAAC,sBAAsB,CAAC,oBAA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AAE,MAAM,EAAE,aAAa,EAAQ,KAAK,EAAE,uBAAuB,EAAE;IAC9G,CAAC,sBAAsB,CAAC,cAAc,CAAC,EAAQ,EAAE,MAAM,EAAE,KAAK,EAAgB,KAAK,EAAE,sBAAsB,EAAE;IAC7G,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAc,EAAE,MAAM,EAAE,aAAa,EAAQ,KAAK,EAAE,gBAAgB,EAAE;IACvG,CAAC,sBAAsB,CAAC,WAAW,CAAC,EAAW,EAAE,MAAM,EAAE,SAAS,EAAY,KAAK,EAAE,mBAAmB,EAAE;IAC1G,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,EAAK,EAAE,MAAM,EAAE,gBAAgB,EAAK,KAAK,EAAE,yBAAyB,EAAE;IAChH,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,4BAA4B,EAAE;CACpH,CAAC","names":[],"sourceRoot":"","sources":["../../../src/messages/messageNamespaces.ts"],"version":3}
|
|
@@ -24,6 +24,13 @@ export interface ExtendedCompilerOptions extends CompilerOptions {
|
|
|
24
24
|
* message; or `null` if parameter is invalid.
|
|
25
25
|
*/
|
|
26
26
|
declare function commandOptionsMessageToCompilerOptionsMessage(message: string, callbacks: CompilerCallbacks): CompilerMessageOverride;
|
|
27
|
+
export interface CompilerMessageDetail {
|
|
28
|
+
code: number;
|
|
29
|
+
id: any;
|
|
30
|
+
module: string;
|
|
31
|
+
class: any;
|
|
32
|
+
}
|
|
33
|
+
export declare function findMessageDetails(code: number, callbacks: CompilerCallbacks): CompilerMessageDetail;
|
|
27
34
|
/**
|
|
28
35
|
* Verifies that a given message is valid and that the severity is allowed to be
|
|
29
36
|
* modified (Info, Hint and Warn only -- Error and Fatal cannot be modified)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendedCompilerOptions.d.ts","sourceRoot":"","sources":["../../../src/util/extendedCompilerOptions.ts"],"names":[],"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BAAuB,EAAE,SAAS,EAAE,iBAAiB,WAa5F;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,GAAG,uBAAuB,CAuBnH;AAGD;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fa7cd91b-d534-589e-be3f-ecaed00bfb26")}catch(e){}}();
|
|
2
2
|
import { CompilerError, CompilerErrorSeverity } from '@keymanapp/common-types';
|
|
3
3
|
import { InfrastructureMessages } from '../messages/infrastructureMessages.js';
|
|
4
|
-
import { messageNamespaceKeys,
|
|
4
|
+
import { messageNamespaceKeys, messageSources } from '../messages/messageNamespaces.js';
|
|
5
5
|
;
|
|
6
6
|
/**
|
|
7
7
|
* converts an --message command line parameter `<id>[:level]` and verifies that
|
|
@@ -46,6 +46,26 @@ function commandOptionsMessagesToCompilerOptionsMessages(messages, callbacks) {
|
|
|
46
46
|
}
|
|
47
47
|
return result;
|
|
48
48
|
}
|
|
49
|
+
export function findMessageDetails(code, callbacks) {
|
|
50
|
+
const namespace = CompilerError.namespace(code);
|
|
51
|
+
if (!messageNamespaceKeys.includes(namespace)) {
|
|
52
|
+
callbacks.reportMessage(InfrastructureMessages.Error_MessageNamespaceNotFound({ code }));
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const source = messageSources[namespace];
|
|
56
|
+
if (!source) {
|
|
57
|
+
throw new Error(`Unexpected missing namespace for code ${code.toString(16)}`);
|
|
58
|
+
}
|
|
59
|
+
// For the given namespace object, iterate through the members to find the matching value
|
|
60
|
+
const keys = Object.keys(source.class);
|
|
61
|
+
const m = source.class;
|
|
62
|
+
const id = keys.find(key => typeof m[key] == 'number' && CompilerError.error(m[key]) === code);
|
|
63
|
+
if (!id) {
|
|
64
|
+
callbacks.reportMessage(InfrastructureMessages.Error_MessageCodeNotFound({ code }));
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return { code: m[id], id, module: source.module, class: source.class };
|
|
68
|
+
}
|
|
49
69
|
/**
|
|
50
70
|
* Verifies that a given message is valid and that the severity is allowed to be
|
|
51
71
|
* modified (Info, Hint and Warn only -- Error and Fatal cannot be modified)
|
|
@@ -54,25 +74,12 @@ function commandOptionsMessagesToCompilerOptionsMessages(messages, callbacks) {
|
|
|
54
74
|
* @returns true if the message can be overridden
|
|
55
75
|
*/
|
|
56
76
|
function checkMessageOverride(override, callbacks) {
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
callbacks.reportMessage(InfrastructureMessages.Error_MessageNamespaceNotFound({ code: override.code }));
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
const source = messageNamespaces[namespace];
|
|
63
|
-
if (!source) {
|
|
64
|
-
throw new Error(`Unexpected missing namespace for code ${override.code.toString(16)}`);
|
|
65
|
-
}
|
|
66
|
-
// For the given namespace object, iterate through the members to find the matching value
|
|
67
|
-
const keys = Object.keys(source);
|
|
68
|
-
const m = source;
|
|
69
|
-
const key = keys.find(key => typeof m[key] == 'number' && CompilerError.error(m[key]) === override.code);
|
|
70
|
-
if (!key) {
|
|
71
|
-
callbacks.reportMessage(InfrastructureMessages.Error_MessageCodeNotFound({ code: override.code }));
|
|
77
|
+
const details = findMessageDetails(override.code, callbacks);
|
|
78
|
+
if (!details) {
|
|
72
79
|
return false;
|
|
73
80
|
}
|
|
74
81
|
const validSeverityMasks = [CompilerErrorSeverity.Info, CompilerErrorSeverity.Hint, CompilerErrorSeverity.Warn];
|
|
75
|
-
if (!validSeverityMasks.includes(CompilerError.severity(
|
|
82
|
+
if (!validSeverityMasks.includes(CompilerError.severity(details.code))) {
|
|
76
83
|
callbacks.reportMessage(InfrastructureMessages.Error_MessageCannotBeCoerced({ code: override.code }));
|
|
77
84
|
return false;
|
|
78
85
|
}
|
|
@@ -114,5 +121,5 @@ export const unitTestEndpoints = {
|
|
|
114
121
|
checkMessageOverride,
|
|
115
122
|
commandOptionsMessageToCompilerOptionsMessage
|
|
116
123
|
};
|
|
117
|
-
//# debugId=
|
|
124
|
+
//# debugId=fa7cd91b-d534-589e-be3f-ecaed00bfb26
|
|
118
125
|
//# sourceMappingURL=extendedCompilerOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"fa7cd91b-d534-589e-be3f-ecaed00bfb26","file":"extendedCompilerOptions.js","mappings":";AAAA,OAAO,EAAqB,aAAa,EAAE,qBAAqB,EAAwE,MAAM,yBAAyB,CAAC;AACxK,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAavF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,SAAS,6CAA6C,CAAC,OAAe,EAAE,SAA4B;IAClG,MAAM,OAAO,GAAG,iEAAiE,CAAC;IAClF,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,IAAG,CAAC,MAAM,EAAE;QACV,SAAS,CAAC,aAAa,CAAC,sBAAsB,CAAC,0BAA0B,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC;KACb;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,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CAAC,EAAE;QACrE,SAAS,CAAC,aAAa,CAAC,sBAAsB,CAAC,4BAA4B,CAAC,EAAC,IAAI,EAAC,QAAQ,CAAC,IAAI,EAAC,CAAC,CAAC,CAAC;QACnG,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAAY,EAAE,SAA4B;IACxF,MAAM,SAAS,GAAG,+CAA+C,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9F,IAAG,CAAC,SAAS,EAAE;QACb,OAAO,IAAI,CAAC;KACb;IAED,oEAAoE;IACpE,2EAA2E;IAC3E,gCAAgC;IAChC,OAAO;QACL,sBAAsB;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,kBAAkB;QAClB,wBAAwB,EAAE,OAAO,CAAC,eAAe;QACjD,SAAS,EAAE,OAAO,CAAC,KAAK;QACxB,wBAAwB,EAAE,OAAO,CAAC,wBAAwB;QAC1D,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,kBAAkB;QAClB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,gBAAgB,EAAE,SAAS;KAC5B,CAAA;AACH,CAAC;AAGD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,oBAAoB;IACpB,6CAA6C;CAC9C,CAAC","names":[],"sourceRoot":"","sources":["../../../src/util/extendedCompilerOptions.ts"],"version":3}
|
package/package.json
CHANGED
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"kmlmp": "build/src/kmlmp.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@keymanapp/common-types": "17.0.
|
|
38
|
-
"@keymanapp/developer-utils": "17.0.
|
|
39
|
-
"@keymanapp/keyman-version": "17.0.
|
|
40
|
-
"@keymanapp/kmc-analyze": "17.0.
|
|
41
|
-
"@keymanapp/kmc-keyboard-info": "17.0.
|
|
42
|
-
"@keymanapp/kmc-kmn": "17.0.
|
|
43
|
-
"@keymanapp/kmc-ldml": "17.0.
|
|
44
|
-
"@keymanapp/kmc-model": "17.0.
|
|
45
|
-
"@keymanapp/kmc-model-info": "17.0.
|
|
46
|
-
"@keymanapp/kmc-package": "17.0.
|
|
47
|
-
"@keymanapp/models-types": "17.0.
|
|
37
|
+
"@keymanapp/common-types": "17.0.280-beta",
|
|
38
|
+
"@keymanapp/developer-utils": "17.0.280-beta",
|
|
39
|
+
"@keymanapp/keyman-version": "17.0.280-beta",
|
|
40
|
+
"@keymanapp/kmc-analyze": "17.0.280-beta",
|
|
41
|
+
"@keymanapp/kmc-keyboard-info": "17.0.280-beta",
|
|
42
|
+
"@keymanapp/kmc-kmn": "17.0.280-beta",
|
|
43
|
+
"@keymanapp/kmc-ldml": "17.0.280-beta",
|
|
44
|
+
"@keymanapp/kmc-model": "17.0.280-beta",
|
|
45
|
+
"@keymanapp/kmc-model-info": "17.0.280-beta",
|
|
46
|
+
"@keymanapp/kmc-package": "17.0.280-beta",
|
|
47
|
+
"@keymanapp/models-types": "17.0.280-beta",
|
|
48
48
|
"@sentry/node": "^7.57.0",
|
|
49
49
|
"chalk": "^2.4.2",
|
|
50
50
|
"commander": "^10.0.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"type": "git",
|
|
87
87
|
"url": "git+https://github.com/keymanapp/keyman.git"
|
|
88
88
|
},
|
|
89
|
-
"version": "17.0.
|
|
89
|
+
"version": "17.0.280-beta"
|
|
90
90
|
}
|