@epic-web/workshop-utils 6.41.3 → 6.42.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epic-web/workshop-utils",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.42.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -202,26 +202,26 @@
|
|
|
202
202
|
"@kentcdodds/md-temp": "^10.0.1",
|
|
203
203
|
"@mdx-js/mdx": "^3.1.1",
|
|
204
204
|
"@playwright/test": "^1.56.1",
|
|
205
|
-
"@react-router/node": "^7.9.
|
|
206
|
-
"@sentry/react-router": "^10.
|
|
205
|
+
"@react-router/node": "^7.9.5",
|
|
206
|
+
"@sentry/react-router": "^10.25.0",
|
|
207
207
|
"@testing-library/dom": "^10.4.1",
|
|
208
208
|
"@testing-library/jest-dom": "^6.9.1",
|
|
209
209
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
210
210
|
"@types/chai": "^5.2.3",
|
|
211
211
|
"@types/chai-dom": "^1.11.3",
|
|
212
|
-
"@vitest/expect": "^4.0.
|
|
213
|
-
"chai": "^6.2.
|
|
212
|
+
"@vitest/expect": "^4.0.8",
|
|
213
|
+
"chai": "^6.2.1",
|
|
214
214
|
"chai-dom": "^1.12.1",
|
|
215
215
|
"chalk": "^5.6.2",
|
|
216
216
|
"chokidar": "^4.0.3",
|
|
217
217
|
"close-with-grace": "^2.3.0",
|
|
218
218
|
"cookie": "^1.0.2",
|
|
219
219
|
"cross-spawn": "^7.0.6",
|
|
220
|
-
"dayjs": "^1.11.
|
|
221
|
-
"esbuild": "^0.
|
|
220
|
+
"dayjs": "^1.11.19",
|
|
221
|
+
"esbuild": "^0.27.0",
|
|
222
222
|
"execa": "^9.6.0",
|
|
223
223
|
"find-process": "^2.0.0",
|
|
224
|
-
"fkill": "^
|
|
224
|
+
"fkill": "^10.0.0",
|
|
225
225
|
"fs-extra": "^11.3.2",
|
|
226
226
|
"globby": "^15.0.0",
|
|
227
227
|
"ignore": "^7.0.5",
|
|
@@ -235,14 +235,14 @@
|
|
|
235
235
|
"parse-git-diff": "^0.0.19",
|
|
236
236
|
"react": "^19.2.0",
|
|
237
237
|
"react-dom": "^19.2.0",
|
|
238
|
-
"react-router": "^7.9.
|
|
238
|
+
"react-router": "^7.9.5",
|
|
239
239
|
"rehype": "^13.0.2",
|
|
240
240
|
"rehype-autolink-headings": "^7.1.0",
|
|
241
241
|
"remark": "^15.0.1",
|
|
242
242
|
"remark-emoji": "^5.0.2",
|
|
243
243
|
"remark-gfm": "^4.0.1",
|
|
244
244
|
"shell-quote": "^1.8.3",
|
|
245
|
-
"shiki": "^3.
|
|
245
|
+
"shiki": "^3.15.0",
|
|
246
246
|
"unified": "^11.0.5",
|
|
247
247
|
"unist-util-remove-position": "^5.0.0",
|
|
248
248
|
"unist-util-visit": "^5.0.0",
|
|
@@ -251,12 +251,12 @@
|
|
|
251
251
|
"devDependencies": {
|
|
252
252
|
"@types/hast": "^3.0.4",
|
|
253
253
|
"@types/mdast": "^4.0.4",
|
|
254
|
-
"@types/node": "^24.
|
|
255
|
-
"@types/react": "^19.2.
|
|
254
|
+
"@types/node": "^24.10.0",
|
|
255
|
+
"@types/react": "^19.2.3",
|
|
256
256
|
"@types/react-dom": "^19.2.2",
|
|
257
257
|
"@types/shell-quote": "^1.7.5",
|
|
258
258
|
"tshy": "^3.0.3",
|
|
259
|
-
"vitest": "^4.0.
|
|
259
|
+
"vitest": "^4.0.8"
|
|
260
260
|
},
|
|
261
261
|
"repository": {
|
|
262
262
|
"type": "git",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compile-mdx.test.d.ts","sourceRoot":"","sources":["../../src/compile-mdx.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
|
-
import fs from 'fs';
|
|
54
|
-
import os from 'os';
|
|
55
|
-
import path from 'path';
|
|
56
|
-
import { describe, it, expect } from 'vitest';
|
|
57
|
-
import { compileMdx } from './compile-mdx.server.js';
|
|
58
|
-
// Disposable object for temporary files
|
|
59
|
-
function createTempFile(name, content) {
|
|
60
|
-
const tempDir = os.tmpdir();
|
|
61
|
-
const testFile = path.join(tempDir, name);
|
|
62
|
-
fs.writeFileSync(testFile, content);
|
|
63
|
-
return {
|
|
64
|
-
path: testFile,
|
|
65
|
-
[Symbol.dispose]() {
|
|
66
|
-
try {
|
|
67
|
-
fs.unlinkSync(testFile);
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
// Ignore cleanup errors
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
describe('compileMdx title parsing', () => {
|
|
76
|
-
it('should extract title with backticks correctly', async () => {
|
|
77
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
78
|
-
try {
|
|
79
|
-
// Create a temporary MDX file with backticks in title
|
|
80
|
-
const testMdxContent = `# Title with \`something\` highlighted
|
|
81
|
-
|
|
82
|
-
This is some content.
|
|
83
|
-
`;
|
|
84
|
-
const tempFile = __addDisposableResource(env_1, createTempFile('test-backtick-title.mdx', testMdxContent), false);
|
|
85
|
-
const result = await compileMdx(tempFile.path);
|
|
86
|
-
// The title should be extracted correctly, preserving the full text
|
|
87
|
-
expect(result.title).toBe('Title with `something` highlighted');
|
|
88
|
-
}
|
|
89
|
-
catch (e_1) {
|
|
90
|
-
env_1.error = e_1;
|
|
91
|
-
env_1.hasError = true;
|
|
92
|
-
}
|
|
93
|
-
finally {
|
|
94
|
-
__disposeResources(env_1);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
it('should extract title with multiple backticks correctly', async () => {
|
|
98
|
-
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
99
|
-
try {
|
|
100
|
-
const testMdxContent = `# \`Code\` and \`more code\` in title
|
|
101
|
-
|
|
102
|
-
This is some content.
|
|
103
|
-
`;
|
|
104
|
-
const tempFile = __addDisposableResource(env_2, createTempFile('test-multiple-backticks.mdx', testMdxContent), false);
|
|
105
|
-
const result = await compileMdx(tempFile.path);
|
|
106
|
-
expect(result.title).toBe('`Code` and `more code` in title');
|
|
107
|
-
}
|
|
108
|
-
catch (e_2) {
|
|
109
|
-
env_2.error = e_2;
|
|
110
|
-
env_2.hasError = true;
|
|
111
|
-
}
|
|
112
|
-
finally {
|
|
113
|
-
__disposeResources(env_2);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
it('should extract title with mixed markdown correctly', async () => {
|
|
117
|
-
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
118
|
-
try {
|
|
119
|
-
const testMdxContent = `# Title with \`code\` and **bold** text
|
|
120
|
-
|
|
121
|
-
This is some content.
|
|
122
|
-
`;
|
|
123
|
-
const tempFile = __addDisposableResource(env_3, createTempFile('test-mixed-markdown.mdx', testMdxContent), false);
|
|
124
|
-
const result = await compileMdx(tempFile.path);
|
|
125
|
-
// Bold formatting should be stripped, but backticks preserved
|
|
126
|
-
expect(result.title).toBe('Title with `code` and bold text');
|
|
127
|
-
}
|
|
128
|
-
catch (e_3) {
|
|
129
|
-
env_3.error = e_3;
|
|
130
|
-
env_3.hasError = true;
|
|
131
|
-
}
|
|
132
|
-
finally {
|
|
133
|
-
__disposeResources(env_3);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
//# sourceMappingURL=compile-mdx.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compile-mdx.test.js","sourceRoot":"","sources":["../../src/compile-mdx.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,wCAAwC;AACxC,SAAS,cAAc,CAAC,IAAY,EAAE,OAAe;IACpD,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,EAAE,CAAA;IAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACzC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAEnC,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,CAAC,MAAM,CAAC,OAAO,CAAC;YACf,IAAI,CAAC;gBACJ,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;YACxB,CAAC;YAAC,MAAM,CAAC;gBACR,wBAAwB;YACzB,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC;AAED,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;;;YAC9D,sDAAsD;YACtD,MAAM,cAAc,GAAG;;;CAGxB,CAAA;YAEC,MAAM,QAAQ,kCAAG,cAAc,CAAC,yBAAyB,EAAE,cAAc,CAAC,QAAA,CAAA;YAE1E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;YAE9C,oEAAoE;YACpE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;;;;;;;;;KAC/D,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;;;YACvE,MAAM,cAAc,GAAG;;;CAGxB,CAAA;YAEC,MAAM,QAAQ,kCAAG,cAAc,CAC9B,6BAA6B,EAC7B,cAAc,CACd,QAAA,CAAA;YAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;YAE9C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAA;;;;;;;;;KAC5D,CAAC,CAAA;IAEF,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;;;YACnE,MAAM,cAAc,GAAG;;;CAGxB,CAAA;YAEC,MAAM,QAAQ,kCAAG,cAAc,CAAC,yBAAyB,EAAE,cAAc,CAAC,QAAA,CAAA;YAE1E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;YAE9C,8DAA8D;YAC9D,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAA;;;;;;;;;KAC5D,CAAC,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import fs from 'fs'\nimport os from 'os'\nimport path from 'path'\nimport { describe, it, expect } from 'vitest'\nimport { compileMdx } from './compile-mdx.server.js'\n\n// Disposable object for temporary files\nfunction createTempFile(name: string, content: string) {\n\tconst tempDir = os.tmpdir()\n\tconst testFile = path.join(tempDir, name)\n\tfs.writeFileSync(testFile, content)\n\n\treturn {\n\t\tpath: testFile,\n\t\t[Symbol.dispose]() {\n\t\t\ttry {\n\t\t\t\tfs.unlinkSync(testFile)\n\t\t\t} catch {\n\t\t\t\t// Ignore cleanup errors\n\t\t\t}\n\t\t},\n\t}\n}\n\ndescribe('compileMdx title parsing', () => {\n\tit('should extract title with backticks correctly', async () => {\n\t\t// Create a temporary MDX file with backticks in title\n\t\tconst testMdxContent = `# Title with \\`something\\` highlighted\n\nThis is some content.\n`\n\n\t\tusing tempFile = createTempFile('test-backtick-title.mdx', testMdxContent)\n\n\t\tconst result = await compileMdx(tempFile.path)\n\n\t\t// The title should be extracted correctly, preserving the full text\n\t\texpect(result.title).toBe('Title with `something` highlighted')\n\t})\n\n\tit('should extract title with multiple backticks correctly', async () => {\n\t\tconst testMdxContent = `# \\`Code\\` and \\`more code\\` in title\n\nThis is some content.\n`\n\n\t\tusing tempFile = createTempFile(\n\t\t\t'test-multiple-backticks.mdx',\n\t\t\ttestMdxContent,\n\t\t)\n\n\t\tconst result = await compileMdx(tempFile.path)\n\n\t\texpect(result.title).toBe('`Code` and `more code` in title')\n\t})\n\n\tit('should extract title with mixed markdown correctly', async () => {\n\t\tconst testMdxContent = `# Title with \\`code\\` and **bold** text\n\nThis is some content.\n`\n\n\t\tusing tempFile = createTempFile('test-mixed-markdown.mdx', testMdxContent)\n\n\t\tconst result = await compileMdx(tempFile.path)\n\n\t\t// Bold formatting should be stripped, but backticks preserved\n\t\texpect(result.title).toBe('Title with `code` and bold text')\n\t})\n})\n"]}
|