@arcgis/node-toolkit 6.0.0-next.12 → 6.0.0-next.13
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/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +6 -5
- package/dist/vite/installPlaywright.js +16 -3
- package/package.json +1 -1
package/dist/markdown.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const markdownTextLimit = 65000;
|
|
2
2
|
/**
|
|
3
3
|
* Split markdown to fit into GitHub comment length limit. Splits at best available
|
|
4
|
-
* places: headings, code blocks and details sections, blank lines.
|
|
4
|
+
* places: headings (higher levels first), code blocks and details sections, blank lines.
|
|
5
5
|
*
|
|
6
6
|
* Use cases: automated reports in issues, pull request check status comments,
|
|
7
7
|
* reporting public API diff inside a pr comment.
|
package/dist/markdown.js
CHANGED
|
@@ -39,9 +39,10 @@ function getBoundary(content, limit, initialBlocks, atLineStart) {
|
|
|
39
39
|
const aligned = textStart === index && (index > 0 || atLineStart);
|
|
40
40
|
const fence = aligned ? /^ {0,3}(`{3,}|~{3,})([^\r\n]*)/u.exec(line) : null;
|
|
41
41
|
const activeFence = blocks.at(-1)?.fence;
|
|
42
|
+
const heading = aligned && activeFence === void 0 ? /^ {0,3}(#{1,6})\s/u.exec(line) : null;
|
|
42
43
|
const opening = aligned && activeFence === void 0 ? /^[ \t]*<details\b[^>]*>(?:\s*<summary\b[^>]*>[\s\S]*?<\/summary\s*>)?/iu.exec(content.slice(index)) : null;
|
|
43
|
-
const kind = !aligned ? "text" : activeFence !== void 0 ? "line" : opening !== null || fence !== null ? "block" :
|
|
44
|
-
consider(textStart, kind);
|
|
44
|
+
const kind = !aligned ? "text" : activeFence !== void 0 ? "line" : opening !== null || fence !== null ? "block" : heading !== null ? "heading" : /^\s*$/u.test(line) ? "blank" : "line";
|
|
45
|
+
consider(textStart, kind, heading?.[1].length);
|
|
45
46
|
if (activeFence !== void 0) {
|
|
46
47
|
if (fence !== null && fence[1].startsWith(activeFence[0]) && fence[1].length >= activeFence.length && fence[2].trim() === "") {
|
|
47
48
|
blocks.pop();
|
|
@@ -80,12 +81,12 @@ function getBoundary(content, limit, initialBlocks, atLineStart) {
|
|
|
80
81
|
throw new Error("Markdown limit is too small to split the enclosing blocks.");
|
|
81
82
|
}
|
|
82
83
|
return best;
|
|
83
|
-
function consider(index, kind) {
|
|
84
|
+
function consider(index, kind, headingLevel = 0) {
|
|
84
85
|
if (index <= 0 || index + closeBlocks(blocks, content[index - 1] === "\n").length > limit) {
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
87
|
-
if (best === void 0 || boundaryKinds.indexOf(kind) < boundaryKinds.indexOf(best.kind) || kind === best.kind && index > best.index) {
|
|
88
|
-
best = { index, kind, blocks: [...blocks] };
|
|
88
|
+
if (best === void 0 || boundaryKinds.indexOf(kind) < boundaryKinds.indexOf(best.kind) || kind === best.kind && (headingLevel < best.headingLevel || headingLevel === best.headingLevel && index > best.index)) {
|
|
89
|
+
best = { index, kind, headingLevel, blocks: [...blocks] };
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
}
|
|
@@ -2,7 +2,7 @@ import { mkdir, rm, stat } from "node:fs/promises";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { findPath, existsAsync } from "../file.js";
|
|
5
|
-
import { runCommand } from "../shell.js";
|
|
5
|
+
import { runCommand, collectOutput } from "../shell.js";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
let installPromise;
|
|
8
8
|
function installPlaywright() {
|
|
@@ -26,7 +26,20 @@ async function ensureInstalled() {
|
|
|
26
26
|
throw new Error("Playwright not found in node_modules. Please install it first.");
|
|
27
27
|
}
|
|
28
28
|
const { chromium } = await import(pathToFileURL(join(playwrightCwd, "index.mjs")).href);
|
|
29
|
-
|
|
29
|
+
const executablePath = chromium.executablePath();
|
|
30
|
+
const isReady = async () => {
|
|
31
|
+
if (!await existsAsync(executablePath)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (process.platform === "linux" && process.env.CI) {
|
|
35
|
+
const dependencies = await collectOutput("ldd", [executablePath], {
|
|
36
|
+
env: { ...process.env, [`LC_ALL`]: "C" }
|
|
37
|
+
});
|
|
38
|
+
return !dependencies.includes("=> not found");
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
if (await isReady()) {
|
|
30
43
|
return;
|
|
31
44
|
}
|
|
32
45
|
const home = homedir();
|
|
@@ -36,7 +49,7 @@ async function ensureInstalled() {
|
|
|
36
49
|
await mkdir(stateDir, { recursive: true });
|
|
37
50
|
const releaseLock = await acquireLock(lockPath);
|
|
38
51
|
try {
|
|
39
|
-
if (await
|
|
52
|
+
if (await isReady()) {
|
|
40
53
|
return;
|
|
41
54
|
}
|
|
42
55
|
const installArgs = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/node-toolkit",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.13",
|
|
4
4
|
"description": "Collection of common internal build-time patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"type": "module",
|