@crowdedkingdoms/crowdyjs 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +56 -34
- package/README.md +83 -50
- package/dist/crowdy-client.d.ts +3 -0
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +2 -0
- package/dist/domains/playerCodeProjects.d.ts +25 -0
- package/dist/domains/playerCodeProjects.d.ts.map +1 -0
- package/dist/domains/playerCodeProjects.js +299 -0
- package/dist/domains/playerCompute.d.ts +1 -1
- package/dist/domains/playerCompute.js +1 -1
- package/dist/generated/graphql.d.ts +792 -7
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +57 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/live-coding/rust-analysis.d.ts.map +1 -1
- package/dist/live-coding/rust-analysis.js +64 -1
- package/dist/live-coding/worker-transport.d.ts +3 -0
- package/dist/live-coding/worker-transport.d.ts.map +1 -1
- package/dist/live-coding/worker-transport.js +13 -0
- package/dist/mod-studio/controller.d.ts +188 -0
- package/dist/mod-studio/controller.d.ts.map +1 -0
- package/dist/mod-studio/controller.js +915 -0
- package/dist/mod-studio/diagnostics.d.ts +22 -0
- package/dist/mod-studio/diagnostics.d.ts.map +1 -0
- package/dist/mod-studio/diagnostics.js +141 -0
- package/dist/mod-studio/dom-shell.d.ts +55 -0
- package/dist/mod-studio/dom-shell.d.ts.map +1 -0
- package/dist/mod-studio/dom-shell.js +527 -0
- package/dist/mod-studio/editor.d.ts +17 -0
- package/dist/mod-studio/editor.d.ts.map +1 -0
- package/dist/mod-studio/editor.js +1 -0
- package/dist/mod-studio/index.d.ts +10 -0
- package/dist/mod-studio/index.d.ts.map +1 -0
- package/dist/mod-studio/index.js +9 -0
- package/dist/mod-studio/models.d.ts +149 -0
- package/dist/mod-studio/models.d.ts.map +1 -0
- package/dist/mod-studio/models.js +62 -0
- package/dist/mod-studio/monaco-editor.d.ts +16 -0
- package/dist/mod-studio/monaco-editor.d.ts.map +1 -0
- package/dist/mod-studio/monaco-editor.js +548 -0
- package/dist/mod-studio/mount.d.ts +17 -0
- package/dist/mod-studio/mount.d.ts.map +1 -0
- package/dist/mod-studio/mount.js +86 -0
- package/dist/mod-studio/starter-projects.d.ts +11 -0
- package/dist/mod-studio/starter-projects.d.ts.map +1 -0
- package/dist/mod-studio/starter-projects.js +102 -0
- package/dist/mod-studio/styles.d.ts +2 -0
- package/dist/mod-studio/styles.d.ts.map +1 -0
- package/dist/mod-studio/styles.js +14 -0
- package/dist/mod-studio/textarea-editor.d.ts +8 -0
- package/dist/mod-studio/textarea-editor.d.ts.map +1 -0
- package/dist/mod-studio/textarea-editor.js +71 -0
- package/package.json +4 -4
- package/dist/live-coding/ide.d.ts +0 -23
- package/dist/live-coding/ide.d.ts.map +0 -1
- package/dist/live-coding/ide.js +0 -514
- package/dist/live-coding/index.d.ts +0 -8
- package/dist/live-coding/index.d.ts.map +0 -1
- package/dist/live-coding/index.js +0 -7
- package/dist/live-coding/live-coding-controller.d.ts +0 -75
- package/dist/live-coding/live-coding-controller.d.ts.map +0 -1
- package/dist/live-coding/live-coding-controller.js +0 -141
- package/dist/live-coding/mount.d.ts +0 -26
- package/dist/live-coding/mount.d.ts.map +0 -1
- package/dist/live-coding/mount.js +0 -108
- package/dist/live-coding/templates.d.ts +0 -17
- package/dist/live-coding/templates.d.ts.map +0 -1
- package/dist/live-coding/templates.js +0 -59
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ModStudioTarget } from './models.js';
|
|
2
|
+
export type ModStudioDiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
3
|
+
export type ModStudioDiagnosticSource = 'rustc' | 'local-advisory';
|
|
4
|
+
export interface ModStudioDiagnostic {
|
|
5
|
+
target: ModStudioTarget;
|
|
6
|
+
path: string;
|
|
7
|
+
line: number;
|
|
8
|
+
column: number;
|
|
9
|
+
endLine?: number;
|
|
10
|
+
endColumn?: number;
|
|
11
|
+
severity: ModStudioDiagnosticSeverity;
|
|
12
|
+
message: string;
|
|
13
|
+
code?: string;
|
|
14
|
+
source: ModStudioDiagnosticSource;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parse rustc's authoritative human or JSON output. Locations are converted to
|
|
18
|
+
* one-based project paths for UI lists; Monaco adapters convert back to marker
|
|
19
|
+
* ranges. Non-location summary lines remain in the Build output, not Problems.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseRustcDiagnostics(output: string | null | undefined, defaultTarget: ModStudioTarget): ModStudioDiagnostic[];
|
|
22
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/mod-studio/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAChF,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,gBAAgB,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,2BAA2B,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,yBAAyB,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,aAAa,EAAE,eAAe,GAC7B,mBAAmB,EAAE,CA8EvB"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { normalizeModStudioPath, } from './models.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parse rustc's authoritative human or JSON output. Locations are converted to
|
|
4
|
+
* one-based project paths for UI lists; Monaco adapters convert back to marker
|
|
5
|
+
* ranges. Non-location summary lines remain in the Build output, not Problems.
|
|
6
|
+
*/
|
|
7
|
+
export function parseRustcDiagnostics(output, defaultTarget) {
|
|
8
|
+
if (!output)
|
|
9
|
+
return [];
|
|
10
|
+
const diagnostics = [];
|
|
11
|
+
const lines = output.replace(/\r\n?/gu, '\n').split('\n');
|
|
12
|
+
let pending;
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
const json = parseJsonDiagnostic(line, defaultTarget);
|
|
15
|
+
if (json.length > 0) {
|
|
16
|
+
diagnostics.push(...json);
|
|
17
|
+
pending = undefined;
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const header = line.match(/^\s*(error|warning|info|note)(?:\[([^\]]+)\])?:\s*(.+?)\s*$/u);
|
|
21
|
+
if (header) {
|
|
22
|
+
pending = {
|
|
23
|
+
severity: normalizeSeverity(header[1]),
|
|
24
|
+
message: header[3],
|
|
25
|
+
...(header[2] ? { code: header[2] } : {}),
|
|
26
|
+
};
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const arrow = line.match(/^\s*-->\s+(.+?):(\d+):(\d+)(?:-(\d+))?\s*$/u);
|
|
30
|
+
if (arrow && pending) {
|
|
31
|
+
const location = normalizeLocation(arrow[1], defaultTarget);
|
|
32
|
+
diagnostics.push({
|
|
33
|
+
...location,
|
|
34
|
+
line: Number(arrow[2]),
|
|
35
|
+
column: Number(arrow[3]),
|
|
36
|
+
...(arrow[4] ? { endColumn: Number(arrow[4]) } : {}),
|
|
37
|
+
...pending,
|
|
38
|
+
source: 'rustc',
|
|
39
|
+
});
|
|
40
|
+
pending = undefined;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const compact = line.match(/^\s*(.+?):(\d+):(\d+):\s*(error|warning|info|note)(?:\[([^\]]+)\])?:\s*(.+?)\s*$/u);
|
|
44
|
+
if (compact) {
|
|
45
|
+
diagnostics.push({
|
|
46
|
+
...normalizeLocation(compact[1], defaultTarget),
|
|
47
|
+
line: Number(compact[2]),
|
|
48
|
+
column: Number(compact[3]),
|
|
49
|
+
severity: normalizeSeverity(compact[4]),
|
|
50
|
+
message: compact[6],
|
|
51
|
+
...(compact[5] ? { code: compact[5] } : {}),
|
|
52
|
+
source: 'rustc',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const seen = new Set();
|
|
57
|
+
return diagnostics.filter((diagnostic) => {
|
|
58
|
+
const key = [
|
|
59
|
+
diagnostic.target,
|
|
60
|
+
diagnostic.path,
|
|
61
|
+
diagnostic.line,
|
|
62
|
+
diagnostic.column,
|
|
63
|
+
diagnostic.severity,
|
|
64
|
+
diagnostic.code,
|
|
65
|
+
diagnostic.message,
|
|
66
|
+
].join(':');
|
|
67
|
+
if (seen.has(key))
|
|
68
|
+
return false;
|
|
69
|
+
seen.add(key);
|
|
70
|
+
return true;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function parseJsonDiagnostic(line, defaultTarget) {
|
|
74
|
+
if (!line.trimStart().startsWith('{'))
|
|
75
|
+
return [];
|
|
76
|
+
let value;
|
|
77
|
+
try {
|
|
78
|
+
value = JSON.parse(line);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
if (!isRecord(value))
|
|
84
|
+
return [];
|
|
85
|
+
const message = isRecord(value.message) ? value.message : value;
|
|
86
|
+
if (!isRecord(message) || typeof message.message !== 'string')
|
|
87
|
+
return [];
|
|
88
|
+
const level = typeof message.level === 'string' ? normalizeSeverity(message.level) : 'error';
|
|
89
|
+
const code = isRecord(message.code) && typeof message.code.code === 'string'
|
|
90
|
+
? message.code.code
|
|
91
|
+
: undefined;
|
|
92
|
+
const spans = Array.isArray(message.spans) ? message.spans : [];
|
|
93
|
+
return spans
|
|
94
|
+
.filter((span) => isRecord(span) &&
|
|
95
|
+
span.is_primary === true &&
|
|
96
|
+
typeof span.file_name === 'string' &&
|
|
97
|
+
Number.isSafeInteger(span.line_start) &&
|
|
98
|
+
Number.isSafeInteger(span.column_start))
|
|
99
|
+
.map((span) => ({
|
|
100
|
+
...normalizeLocation(span.file_name, defaultTarget),
|
|
101
|
+
line: span.line_start,
|
|
102
|
+
column: span.column_start,
|
|
103
|
+
...(Number.isSafeInteger(span.line_end)
|
|
104
|
+
? { endLine: span.line_end }
|
|
105
|
+
: {}),
|
|
106
|
+
...(Number.isSafeInteger(span.column_end)
|
|
107
|
+
? { endColumn: span.column_end }
|
|
108
|
+
: {}),
|
|
109
|
+
severity: level,
|
|
110
|
+
message: message.message,
|
|
111
|
+
...(code ? { code } : {}),
|
|
112
|
+
source: 'rustc',
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
function normalizeLocation(value, defaultTarget) {
|
|
116
|
+
let path = value.trim().replace(/\\/gu, '/');
|
|
117
|
+
let target = defaultTarget;
|
|
118
|
+
const targetMatch = path.match(/(?:^|\/)(server|client)\/(.+)$/iu);
|
|
119
|
+
if (targetMatch) {
|
|
120
|
+
target = targetMatch[1].toUpperCase();
|
|
121
|
+
path = targetMatch[2];
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const sourceIndex = path.lastIndexOf('/src/');
|
|
125
|
+
if (sourceIndex >= 0)
|
|
126
|
+
path = path.slice(sourceIndex + 1);
|
|
127
|
+
else if (path.includes('/'))
|
|
128
|
+
path = path.replace(/^.*\/(?=Cargo\.toml$)/u, '');
|
|
129
|
+
}
|
|
130
|
+
return { target, path: normalizeModStudioPath(path) };
|
|
131
|
+
}
|
|
132
|
+
function normalizeSeverity(value) {
|
|
133
|
+
if (value === 'warning')
|
|
134
|
+
return 'warning';
|
|
135
|
+
if (value === 'info' || value === 'note' || value === 'help')
|
|
136
|
+
return 'info';
|
|
137
|
+
return 'error';
|
|
138
|
+
}
|
|
139
|
+
function isRecord(value) {
|
|
140
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
141
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ModStudioController, type ModStudioState } from './controller.js';
|
|
2
|
+
/** Modular DOM shell; editor implementations mount into `editorHost`. */
|
|
3
|
+
export declare class ModStudioDomShell {
|
|
4
|
+
private readonly controller;
|
|
5
|
+
readonly root: HTMLElement;
|
|
6
|
+
readonly editorHost: HTMLElement;
|
|
7
|
+
private readonly projectSelect;
|
|
8
|
+
private readonly saveBadge;
|
|
9
|
+
private readonly saveAction;
|
|
10
|
+
private readonly remoteAction;
|
|
11
|
+
private readonly testAction;
|
|
12
|
+
private readonly deployAction;
|
|
13
|
+
private readonly runtimeStatus;
|
|
14
|
+
private readonly budgetStatus;
|
|
15
|
+
private readonly newForm;
|
|
16
|
+
private readonly newName;
|
|
17
|
+
private readonly newKind;
|
|
18
|
+
private readonly explorer;
|
|
19
|
+
private readonly tabs;
|
|
20
|
+
private readonly settingsName;
|
|
21
|
+
private readonly settingsDescription;
|
|
22
|
+
private readonly serverModuleName;
|
|
23
|
+
private readonly clientModuleName;
|
|
24
|
+
private readonly pairing;
|
|
25
|
+
private readonly problemsPanel;
|
|
26
|
+
private readonly buildPanel;
|
|
27
|
+
private readonly logsPanel;
|
|
28
|
+
private readonly runsPanel;
|
|
29
|
+
private readonly invokePanel;
|
|
30
|
+
private readonly invokeExport;
|
|
31
|
+
private readonly invokeParams;
|
|
32
|
+
private readonly invokeResult;
|
|
33
|
+
private readonly panelButtons;
|
|
34
|
+
private readonly panels;
|
|
35
|
+
private activePanel;
|
|
36
|
+
private disposed;
|
|
37
|
+
constructor(host: HTMLElement, controller: ModStudioController);
|
|
38
|
+
render(state: ModStudioState): void;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
private createPanel;
|
|
41
|
+
private activatePanel;
|
|
42
|
+
private renderProjects;
|
|
43
|
+
private renderSaveState;
|
|
44
|
+
private renderExplorer;
|
|
45
|
+
private projectSection;
|
|
46
|
+
private projectFileRow;
|
|
47
|
+
private referenceSection;
|
|
48
|
+
private renderTabs;
|
|
49
|
+
private renderSettings;
|
|
50
|
+
private renderProblems;
|
|
51
|
+
private renderBuild;
|
|
52
|
+
private renderRuntimeRows;
|
|
53
|
+
private run;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=dom-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-shell.d.ts","sourceRoot":"","sources":["../../src/mod-studio/dom-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAYzB,yEAAyE;AACzE,qBAAa,iBAAiB;IAoC1B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAnC7B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAc;IAC5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC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