@keymanapp/kmc 18.0.8-alpha → 18.0.9-alpha

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.
Files changed (32) hide show
  1. package/README.md +146 -60
  2. package/build/src/commands/analyze.d.ts +20 -0
  3. package/build/src/commands/analyze.d.ts.map +1 -1
  4. package/build/src/commands/analyze.js +8 -2
  5. package/build/src/commands/analyze.js.map +1 -1
  6. package/build/src/commands/build.d.ts.map +1 -1
  7. package/build/src/commands/build.js +5 -3
  8. package/build/src/commands/build.js.map +1 -1
  9. package/build/src/commands/buildTestData/index.d.ts.map +1 -1
  10. package/build/src/commands/buildTestData/index.js +10 -8
  11. package/build/src/commands/buildTestData/index.js.map +1 -1
  12. package/build/src/commands/messageCommand.d.ts +3 -0
  13. package/build/src/commands/messageCommand.d.ts.map +1 -0
  14. package/build/src/commands/messageCommand.js +239 -0
  15. package/build/src/commands/messageCommand.js.map +1 -0
  16. package/build/src/kmc.js +4 -2
  17. package/build/src/kmc.js.map +1 -1
  18. package/build/src/messages/infrastructureMessages.d.ts +44 -25
  19. package/build/src/messages/infrastructureMessages.d.ts.map +1 -1
  20. package/build/src/messages/infrastructureMessages.js +38 -28
  21. package/build/src/messages/infrastructureMessages.js.map +1 -1
  22. package/build/src/messages/messageNamespaces.d.ts +5 -1
  23. package/build/src/messages/messageNamespaces.d.ts.map +1 -1
  24. package/build/src/messages/messageNamespaces.js +16 -3
  25. package/build/src/messages/messageNamespaces.js.map +1 -1
  26. package/build/src/util/NodeCompilerCallbacks.js +3 -3
  27. package/build/src/util/NodeCompilerCallbacks.js.map +1 -1
  28. package/build/src/util/extendedCompilerOptions.d.ts +7 -0
  29. package/build/src/util/extendedCompilerOptions.d.ts.map +1 -1
  30. package/build/src/util/extendedCompilerOptions.js +26 -19
  31. package/build/src/util/extendedCompilerOptions.js.map +1 -1
  32. package/package.json +12 -12
@@ -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,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAiB/D,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO;SAC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;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]="6669e390-dd00-5dae-a180-6fe9ca8ae7ec")}catch(e){}}();
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=6669e390-dd00-5dae-a180-6fe9ca8ae7ec
58
+ //# debugId=4542efb2-9630-55a9-800d-24e26362ae86
57
59
  //# sourceMappingURL=kmc.js.map
@@ -1 +1 @@
1
- {"debug_id":"6669e390-dd00-5dae-a180-6fe9ca8ae7ec","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;AAEjD,MAAM,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;AAC9C,IAAG,YAAY,CAAC,SAAS,EAAE,EAAE;IAC3B,YAAY,CAAC,IAAI,EAAE,CAAC;CACrB;AACD,IAAI;IACF,MAAM,GAAG,EAAE,CAAC;CACb;AAAC,OAAM,CAAC,EAAE;IACT,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAClC;AAED,gFAAgF;AAChF,8EAA8E;AAC9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ructureMessages {
2
+ static FATAL_UnexpectedException: number;
2
3
  static Fatal_UnexpectedException: (o: {
3
4
  e: any;
4
5
  }) => import("@keymanapp/common-types").CompilerEvent;
5
- static FATAL_UnexpectedException: number;
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 INFO_BuildingFile: number;
18
+ static ERROR_FileDoesNotExist: number;
17
19
  static Error_FileDoesNotExist: (o: {
18
20
  filename: string;
19
21
  }) => import("@keymanapp/common-types").CompilerEvent;
20
- static ERROR_FileDoesNotExist: number;
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 INFO_FileBuiltSuccessfully: number;
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 INFO_FileNotBuiltSuccessfully: number;
53
+ static ERROR_InvalidProjectFile: number;
50
54
  static Error_InvalidProjectFile: (o: {
51
55
  message: string;
52
56
  }) => import("@keymanapp/common-types").CompilerEvent;
53
- static ERROR_InvalidProjectFile: number;
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 HINT_FilenameHasDifferingCase: number;
62
+ static ERROR_UnknownFileFormat: number;
59
63
  static Error_UnknownFileFormat: (o: {
60
64
  format: string;
61
65
  }) => import("@keymanapp/common-types").CompilerEvent;
62
- static ERROR_UnknownFileFormat: number;
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 INFO_ProjectBuiltSuccessfully: number;
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 INFO_ProjectNotBuiltSuccessfully: number;
90
+ static INFO_TooManyMessages: number;
85
91
  static Info_TooManyMessages: (o: {
86
92
  count: number;
87
93
  }) => import("@keymanapp/common-types").CompilerEvent;
88
- static INFO_TooManyMessages: number;
94
+ static ERROR_FileTypeNotFound: number;
89
95
  static Error_FileTypeNotFound: (o: {
90
96
  ext: string;
91
97
  }) => import("@keymanapp/common-types").CompilerEvent;
92
- static ERROR_FileTypeNotFound: number;
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 ERROR_CannotCreateFolder: number;
109
+ static ERROR_InvalidProjectFolder: number;
104
110
  static Error_InvalidProjectFolder: (o: {
105
111
  folderName: string;
106
112
  }) => import("@keymanapp/common-types").CompilerEvent;
107
- static ERROR_InvalidProjectFolder: number;
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 Error_OutFileCanOnlyBeSpecifiedWithSingleInfile: () => import("@keymanapp/common-types").CompilerEvent;
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 ERROR_InvalidMessageFormat: number;
125
+ static ERROR_MessageNamespaceNotFound: number;
120
126
  static Error_MessageNamespaceNotFound: (o: {
121
127
  code: number;
122
128
  }) => import("@keymanapp/common-types").CompilerEvent;
123
- static ERROR_MessageNamespaceNotFound: number;
129
+ static ERROR_MessageCodeNotFound: number;
124
130
  static Error_MessageCodeNotFound: (o: {
125
131
  code: number;
126
132
  }) => import("@keymanapp/common-types").CompilerEvent;
127
- static ERROR_MessageCodeNotFound: number;
133
+ static ERROR_MessageCannotBeCoerced: number;
128
134
  static Error_MessageCannotBeCoerced: (o: {
129
135
  code: number;
130
136
  }) => import("@keymanapp/common-types").CompilerEvent;
131
- static ERROR_MessageCannotBeCoerced: number;
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,qDAAqE;IACnH,MAAM,CAAC,yBAAyB,SAAqB;IAGrD,MAAM,CAAC,iBAAiB,MAAM;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAA,gBAAgB,EAAC,MAAM,CAAA;KAAC;;;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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]="e85b7300-d78d-5300-8e63-8876894a08c2")}catch(e){}}();
2
- import { 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 Error_FileDoesNotExist = (o) => m(this.ERROR_FileDoesNotExist, `File ${o.filename} does not exist`);
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 Error_FileTypeNotRecognized = (o) => m(this.ERROR_FileTypeNotRecognized, `Unrecognised input file ${o.filename}, expecting ${o.extensions}, or project folder`);
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 Error_OutFileNotValidForProjects = () => m(this.ERROR_OutFileNotValidForProjects, `--out-file should not be specified for project builds`);
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 Error_InvalidProjectFile = (o) => m(this.ERROR_InvalidProjectFile, `Project file is not valid: ${o.message}`);
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 Hint_FilenameHasDifferingCase = (o) => m(this.HINT_FilenameHasDifferingCase, `File on disk '${o.filename}' does not match case of '${o.reference}' in source file; this is an error on platforms with case-sensitive filesystems.`);
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 Error_UnknownFileFormat = (o) => m(this.ERROR_UnknownFileFormat, `Unknown file format ${o.format}; only Markdown (.md), JSON (.json), and Text (.txt) are supported.`);
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 Info_TooManyMessages = (o) => m(this.INFO_TooManyMessages, `More than ${o.count} warnings or errors received; suppressing further messages.`);
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 Error_FileTypeNotFound = (o) => m(this.ERROR_FileTypeNotFound, `A file of type ${o.ext} was not found in the project.`);
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 Error_NotAProjectFile = (o) => m(this.ERROR_NotAProjectFile, `File ${o.filename} must have a .kpj extension to be treated as a project.`);
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 Info_WarningsHaveFailedBuild = () => m(this.INFO_WarningsHaveFailedBuild, `The build failed because option "treat warnings as errors" is enabled and there are one or more warnings.`);
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 Error_CannotCreateFolder = (o) => m(this.ERROR_CannotCreateFolder, null, `Unable to create folder ${o.folderName}: ${o.e ?? 'unknown error'}`);
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 Error_InvalidProjectFolder = (o) => m(this.ERROR_InvalidProjectFolder, `The folder ${o.folderName} does not appear to be a Keyman Developer project.`);
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 Error_UnsupportedProjectVersion = (o) => m(this.ERROR_UnsupportedProjectVersion, `Project version ${o.version} is not supported by this version of Keyman Developer.`);
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 Hint_ProjectIsVersion10 = () => m(this.HINT_ProjectIsVersion10, `The project file is an older version and can be upgraded to version 17.0`);
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 Error_OutFileCanOnlyBeSpecifiedWithSingleInfile = () => m(this.ERROR_OutFileCanOnlyBeSpecifiedWithSingleInfile, `Parameter --out-file can only be used with a single input file.`);
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 Error_InvalidMessageFormat = (o) => m(this.ERROR_InvalidMessageFormat, `Invalid parameter: --message ${o.message} must match format '[KM]#####[:Disable|Info|Hint|Warn|Error]'`);
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 Error_MessageNamespaceNotFound = (o) => m(this.ERROR_MessageNamespaceNotFound, `Invalid parameter: --message KM${o.code?.toString(16)} does not have a recognized namespace`);
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 Error_MessageCodeNotFound = (o) => m(this.ERROR_MessageCodeNotFound, `Invalid parameter: --message KM${o.code?.toString(16)} is not a recognized code`);
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 Error_MessageCannotBeCoerced = (o) => m(this.ERROR_MessageCannotBeCoerced, `Invalid parameter: --message KM${o.code?.toString(16)} is not a info, hint or warn message type and cannot be coerced`);
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=e85b7300-d78d-5300-8e63-8876894a08c2
76
+ //# debugId=20670923-6d88-5a0c-97aa-d77f25852eee
67
77
  //# sourceMappingURL=infrastructureMessages.js.map