@arcgis/codemod 6.0.0-next.2 → 6.0.0-next.20
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/chunks/artifact.js +48 -0
- package/dist/chunks/classification.js +222 -0
- package/dist/chunks/cli.js +399 -220
- package/dist/chunks/codemod5.js +0 -1
- package/dist/chunks/componentAudit.js +258 -0
- package/dist/chunks/format.js +121 -188
- package/dist/chunks/github.js +124 -0
- package/dist/chunks/index.js +950 -284
- package/dist/chunks/index2.js +132 -102
- package/dist/chunks/index3.js +342 -0
- package/dist/chunks/sync.js +43 -142
- package/dist/chunks/syncMarkdown.js +32 -0
- package/dist/chunks/useProjectInstance.js +27 -24
- package/package.json +7 -5
- package/dist/chunks/hardcodedBehavior.js +0 -93
package/dist/chunks/sync.js
CHANGED
|
@@ -1,165 +1,66 @@
|
|
|
1
|
-
import { readFile as
|
|
2
|
-
import { log as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.#e = i, this.#s = `${t}/${o}`, this.dryRun = e;
|
|
12
|
-
}
|
|
13
|
-
#e;
|
|
14
|
-
#s;
|
|
15
|
-
#i;
|
|
16
|
-
#n;
|
|
17
|
-
async #t(s, e, i) {
|
|
18
|
-
if (process.env.VITEST !== void 0)
|
|
19
|
-
throw new Error("GitHub requests are disabled while running Vitest.");
|
|
20
|
-
const t = await u(
|
|
21
|
-
"gh",
|
|
22
|
-
["api", "--hostname", this.#e, "--method", s, e, ...i === void 0 ? [] : ["--input", "-"]],
|
|
23
|
-
i === void 0 ? {} : { input: JSON.stringify(i) }
|
|
24
|
-
);
|
|
25
|
-
return t === "" ? void 0 : JSON.parse(t);
|
|
26
|
-
}
|
|
27
|
-
async listOpenIssues(s) {
|
|
28
|
-
const e = await u("gh", [
|
|
29
|
-
"api",
|
|
30
|
-
"--hostname",
|
|
31
|
-
this.#e,
|
|
32
|
-
"--method",
|
|
33
|
-
"GET",
|
|
34
|
-
"--paginate",
|
|
35
|
-
"--slurp",
|
|
36
|
-
"-f",
|
|
37
|
-
`q="${s}" in:title repo:${this.#s} is:issue is:open`,
|
|
38
|
-
"-f",
|
|
39
|
-
"per_page=100",
|
|
40
|
-
"/search/issues"
|
|
41
|
-
]);
|
|
42
|
-
return JSON.parse(e).flatMap(({ items: i }) => i);
|
|
43
|
-
}
|
|
44
|
-
async createIssue(s, e, i, t) {
|
|
45
|
-
if (this.dryRun) {
|
|
46
|
-
const o = this.#n--;
|
|
47
|
-
return this.#i.set(o, s), this.changes.push(`CREATE issue: ${s}`), { number: o, title: s, body: e, assignees: i.map((r) => ({ login: r })) };
|
|
48
|
-
}
|
|
49
|
-
return await this.#t("POST", `/repos/${this.#s}/issues`, {
|
|
50
|
-
title: s,
|
|
51
|
-
body: e,
|
|
52
|
-
assignees: i,
|
|
53
|
-
labels: t,
|
|
54
|
-
type: m
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
async updateIssueBody(s, e) {
|
|
58
|
-
if (this.dryRun) {
|
|
59
|
-
this.changes.push(`UPDATE issue #${s} body`);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
await this.#t("PATCH", `/repos/${this.#s}/issues/${s}`, { body: e });
|
|
63
|
-
}
|
|
64
|
-
async listComments(s) {
|
|
65
|
-
if (this.#i.has(s))
|
|
66
|
-
return [];
|
|
67
|
-
const e = await u("gh", [
|
|
68
|
-
"api",
|
|
69
|
-
"--hostname",
|
|
70
|
-
this.#e,
|
|
71
|
-
"--method",
|
|
72
|
-
"GET",
|
|
73
|
-
"--paginate",
|
|
74
|
-
"--slurp",
|
|
75
|
-
`/repos/${this.#s}/issues/${s}/comments?per_page=100`
|
|
76
|
-
]);
|
|
77
|
-
return JSON.parse(e).flat();
|
|
78
|
-
}
|
|
79
|
-
async createComment(s, e) {
|
|
80
|
-
if (this.dryRun) {
|
|
81
|
-
const i = this.#i.get(s), t = i === void 0 ? `issue #${s}` : `new issue: ${i}`;
|
|
82
|
-
this.changes.push(`ADD comment to ${t}`);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
await this.#t("POST", `/repos/${this.#s}/issues/${s}/comments`, { body: e });
|
|
86
|
-
}
|
|
87
|
-
async updateComment(s, e) {
|
|
88
|
-
if (this.dryRun) {
|
|
89
|
-
this.changes.push(`UPDATE comment #${s}`);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
await this.#t("PATCH", `/repos/${this.#s}/issues/comments/${s}`, { body: e });
|
|
93
|
-
}
|
|
94
|
-
async deleteComment(s) {
|
|
95
|
-
if (this.dryRun) {
|
|
96
|
-
this.changes.push(`REMOVE comment #${s}`);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
await this.#t("DELETE", `/repos/${this.#s}/issues/comments/${s}`);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async function k(n, s, e = 0, i, t = []) {
|
|
103
|
-
const o = w(await f(n, "utf8")), r = y(g(o), e, i), a = new l(o.repository, s);
|
|
104
|
-
await $(r, a, t), s && process.stdout.write(`${E(r)}
|
|
1
|
+
import { readFile as w } from "node:fs/promises";
|
|
2
|
+
import { log as f } from "@arcgis/toolkit/log";
|
|
3
|
+
import { b as I } from "./artifact.js";
|
|
4
|
+
import { f as d, h as $ } from "./cli.js";
|
|
5
|
+
import { c as v, i as g } from "./format.js";
|
|
6
|
+
import { G as y, n as p, s as b } from "./github.js";
|
|
7
|
+
async function D(t, s, o = 0, n, u = {}) {
|
|
8
|
+
const { labels: c = [], closeResolved: l = !1 } = u, r = I(await w(t, "utf8")), e = l && k(r, o, n), a = C(v(r), o, n), i = new y(r.repository, s), h = await S(a, i, c, e ? r.auditKind : void 0);
|
|
9
|
+
s && process.stdout.write(`${[E(a), ...h].filter(Boolean).join(`
|
|
10
|
+
`)}
|
|
105
11
|
`);
|
|
106
12
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
13
|
+
function k(t, s, o) {
|
|
14
|
+
if (s !== 0 || o !== void 0)
|
|
15
|
+
throw new Error("--close-resolved cannot be used with --offset or --limit.");
|
|
16
|
+
return t.complete !== !0 ? (f(
|
|
17
|
+
"warn",
|
|
18
|
+
d,
|
|
19
|
+
"Skipping --close-resolved: the report is not a complete, unfiltered repository-root audit. Issue creation and updates will continue."
|
|
20
|
+
), !1) : !0;
|
|
109
21
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
for (const t of n) {
|
|
113
|
-
let o = i.get(t.title);
|
|
114
|
-
o === void 0 && (o = await s.listOpenIssues(t.title), i.set(t.title, o));
|
|
115
|
-
const r = I(o, t);
|
|
116
|
-
let a;
|
|
117
|
-
r === void 0 ? (a = (await s.createIssue(t.title, t.chunks[0], t.assignees, e)).number, s.dryRun || h("info", c, `Created issue #${a}: ${t.title}`)) : (a = r.number, r.body !== t.chunks[0] && (await s.updateIssueBody(a, t.chunks[0]), s.dryRun || h("info", c, `Updated issue #${a}: ${t.title}`))), await T(s, a, t.chunks.slice(1)), t.changes.push(...s.changes.splice(0));
|
|
118
|
-
}
|
|
22
|
+
function C(t, s, o) {
|
|
23
|
+
return t.slice(s, o === void 0 ? void 0 : s + o);
|
|
119
24
|
}
|
|
120
|
-
function
|
|
121
|
-
const s =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
25
|
+
async function S(t, s, o = [], n) {
|
|
26
|
+
const u = n === void 0 ? t[0]?.title : $[n], c = u === void 0 ? [] : await s.listOpenIssues(u), l = n === void 0 ? [] : c.filter((e) => e.title === u && m(e.body) !== void 0), r = /* @__PURE__ */ new Set();
|
|
27
|
+
for (const e of t) {
|
|
28
|
+
const a = j(c, e);
|
|
29
|
+
let i;
|
|
30
|
+
a === void 0 ? (i = (await s.createIssue(e.title, e.chunks[0], e.assignees, o)).number, s.dryRun || f("info", d, `Created issue #${i}: ${e.title}`)) : (i = a.number, p(a.body) !== p(e.chunks[0]) && (await s.updateIssueBody(i, e.chunks[0]), s.dryRun || f("info", d, `Updated issue #${i}: ${e.title}`))), await b(s, i, e.chunks.slice(1), (h) => h.startsWith(g)), r.add(i), e.changes.push(...s.changes.splice(0));
|
|
31
|
+
}
|
|
32
|
+
for (const e of l)
|
|
33
|
+
r.has(e.number) || (await s.closeIssue(e.number), s.dryRun || f("info", d, `Closed stale issue #${e.number}: ${e.title}`));
|
|
34
|
+
return s.changes.splice(0);
|
|
125
35
|
}
|
|
126
|
-
function E(
|
|
127
|
-
return
|
|
36
|
+
function E(t) {
|
|
37
|
+
return t.map(
|
|
128
38
|
(s) => `ACTIONS: ${s.changes.length === 0 ? "No changes" : s.changes.join("; ")}
|
|
129
39
|
|
|
130
40
|
CODEOWNERS: ${s.owners.length === 0 ? "unowned" : s.owners.join(", ")}
|
|
131
41
|
ASSIGNEES: ${s.assignees.length === 0 ? "none" : s.assignees.join(", ")}
|
|
132
42
|
TITLE: ${s.title}
|
|
133
43
|
|
|
134
|
-
${s.chunks.map((
|
|
135
|
-
${
|
|
44
|
+
${s.chunks.map((o, n) => `--- ${n === 0 ? "BODY" : "COMMENT"} (${n + 1}/${s.chunks.length}) ---
|
|
45
|
+
${o}`).join(`
|
|
136
46
|
|
|
137
47
|
`)}`
|
|
138
48
|
).join(`
|
|
139
49
|
|
|
140
50
|
`);
|
|
141
51
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
return
|
|
52
|
+
function j(t, s) {
|
|
53
|
+
const o = m(s.chunks[0]);
|
|
54
|
+
return t.find((n) => n.title === s.title && m(n.body) === o);
|
|
145
55
|
}
|
|
146
|
-
function
|
|
147
|
-
const s =
|
|
56
|
+
function m(t) {
|
|
57
|
+
const s = t?.split(`
|
|
148
58
|
`, 1)[0];
|
|
149
|
-
return s?.startsWith(
|
|
150
|
-
}
|
|
151
|
-
async function T(n, s, e) {
|
|
152
|
-
const i = (await n.listComments(s)).filter(({ body: t }) => t.startsWith(d));
|
|
153
|
-
for (const [t, o] of e.entries()) {
|
|
154
|
-
const r = i[t];
|
|
155
|
-
r === void 0 ? await n.createComment(s, o) : r.body !== o && await n.updateComment(r.id, o);
|
|
156
|
-
}
|
|
157
|
-
for (const t of i.slice(e.length))
|
|
158
|
-
await n.deleteComment(t.id);
|
|
59
|
+
return s?.startsWith(g) === !0 ? s : void 0;
|
|
159
60
|
}
|
|
160
61
|
export {
|
|
161
62
|
E as formatDryRun,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
63
|
+
C as sliceIssuePlans,
|
|
64
|
+
D as syncDeprecationIssues,
|
|
65
|
+
S as synchronizeIssuePlans
|
|
165
66
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFile as u } from "node:fs/promises";
|
|
2
|
+
import { markdownTextLimit as c, splitMarkdown as m } from "@arcgis/node-toolkit/markdown";
|
|
3
|
+
import { G as p, s as f } from "./github.js";
|
|
4
|
+
import { a as h, i as l } from "./format.js";
|
|
5
|
+
async function x(t, s, e = !1) {
|
|
6
|
+
const { repository: r, issueNumber: i } = w(s), n = new p(r, e), o = $(await u(t, "utf8"));
|
|
7
|
+
await f(n, i, o, (a) => a.startsWith(l)), e && process.stdout.write(
|
|
8
|
+
`${n.changes.length === 0 ? "No changes" : n.changes.join(`
|
|
9
|
+
`)}
|
|
10
|
+
|
|
11
|
+
${o.join(`
|
|
12
|
+
|
|
13
|
+
`)}
|
|
14
|
+
`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function w(t) {
|
|
18
|
+
const s = new URL(t), e = /^\/([^/]+)\/([^/]+)\/issues\/([1-9]\d*)\/?$/u.exec(s.pathname);
|
|
19
|
+
if (s.protocol !== "https:" || e === null || !Number.isSafeInteger(Number(e[3])))
|
|
20
|
+
throw new Error(`Expected an HTTPS GitHub issue URL: ${t}`);
|
|
21
|
+
return { repository: `${s.host}/${e[1]}/${e[2]}`, issueNumber: Number(e[3]) };
|
|
22
|
+
}
|
|
23
|
+
function $(t, s = c) {
|
|
24
|
+
const e = `${h}
|
|
25
|
+
|
|
26
|
+
`;
|
|
27
|
+
return m(t, s - e.length).map((r) => e + r);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
$ as createMarkdownComments,
|
|
31
|
+
x as syncMarkdown
|
|
32
|
+
};
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { Project as p } from "ts-morph";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { styleText as
|
|
6
|
-
function
|
|
7
|
-
if (
|
|
2
|
+
import { g as t, c as a, i as m } from "./cli.js";
|
|
3
|
+
import { log as g } from "@arcgis/toolkit/log";
|
|
4
|
+
import { path as u } from "@arcgis/node-toolkit/path";
|
|
5
|
+
import { styleText as n } from "node:util";
|
|
6
|
+
function S(e, l = !0, f) {
|
|
7
|
+
if (t.project !== void 0)
|
|
8
8
|
throw Error(
|
|
9
9
|
"A different ts-morph Project is already in use. Dispose of it before creating a new one. Example: using project = createProjectInstance(...)"
|
|
10
10
|
);
|
|
11
|
-
const
|
|
11
|
+
const s = t.codemod.meta.needsTypeInformation, i = new p({
|
|
12
12
|
// If tsconfig is missing, or project is untyped, use a permissive and
|
|
13
13
|
// compatible default config
|
|
14
|
-
compilerOptions:
|
|
15
|
-
...
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
compilerOptions: {
|
|
15
|
+
...e.typeScriptConfig?.compilerOptions ?? {
|
|
16
|
+
...a,
|
|
17
|
+
// Read types from JSDoc annotations if present
|
|
18
|
+
checkJs: s
|
|
19
|
+
},
|
|
20
|
+
...f
|
|
18
21
|
},
|
|
19
22
|
// We take care of reading the config file
|
|
20
23
|
tsConfigFilePath: void 0,
|
|
@@ -22,30 +25,30 @@ function v(e, l = !0) {
|
|
|
22
25
|
skipAddingFilesFromTsConfig: !0,
|
|
23
26
|
// We call this manually if needed below.
|
|
24
27
|
skipFileDependencyResolution: !0,
|
|
25
|
-
skipLoadingLibFiles: !
|
|
26
|
-
}),
|
|
27
|
-
const c =
|
|
28
|
+
skipLoadingLibFiles: !s
|
|
29
|
+
}), d = e.filePaths.filter(m).flatMap((o) => {
|
|
30
|
+
const c = i.addSourceFileAtPathIfExists(o);
|
|
28
31
|
return c === void 0 ? [] : [c];
|
|
29
32
|
});
|
|
30
|
-
if (
|
|
31
|
-
const o =
|
|
32
|
-
process.stdout.write(""),
|
|
33
|
+
if (s && i.resolveSourceFileDependencies(), l) {
|
|
34
|
+
const o = u.relative(process.cwd(), e.cwd);
|
|
35
|
+
process.stdout.write(""), g(
|
|
33
36
|
"info",
|
|
34
|
-
|
|
35
|
-
`Running the codemod on ${
|
|
37
|
+
n("blue", o === "" ? process.cwd() : o),
|
|
38
|
+
`Running the codemod on ${n("blue", String(e.filePaths.length))} file${e.filePaths.length !== 1 ? "s" : ""}${e.packageJson?.contents.name === void 0 ? "" : ` from ${n("blue", e.packageJson.contents.name)}`}`
|
|
36
39
|
);
|
|
37
40
|
}
|
|
38
41
|
const r = {
|
|
39
42
|
[Symbol.dispose]() {
|
|
40
|
-
|
|
43
|
+
i.saveSync(), i.getRootDirectories().forEach((o) => o.forget()), t.project = void 0;
|
|
41
44
|
},
|
|
42
45
|
projectData: e,
|
|
43
46
|
// Resolved dependencies support type checking but are not codemod targets.
|
|
44
|
-
getCodemodFiles: () =>
|
|
45
|
-
tsMorph:
|
|
47
|
+
getCodemodFiles: () => d,
|
|
48
|
+
tsMorph: i
|
|
46
49
|
};
|
|
47
|
-
return
|
|
50
|
+
return t.project = r, r;
|
|
48
51
|
}
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
S as c
|
|
51
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/codemod",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.20",
|
|
4
4
|
"description": "A codemod toolkit for updating and modernizing ArcGIS Maps SDK for JavaScript codebases.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,15 +11,17 @@
|
|
|
11
11
|
],
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@arcgis/api-extractor": "6.0.0-next.
|
|
15
|
-
"@arcgis/node-toolkit": "6.0.0-next.
|
|
16
|
-
"@arcgis/toolkit": "6.0.0-next.
|
|
14
|
+
"@arcgis/api-extractor": "6.0.0-next.20",
|
|
15
|
+
"@arcgis/node-toolkit": "6.0.0-next.20",
|
|
16
|
+
"@arcgis/toolkit": "6.0.0-next.20",
|
|
17
17
|
"@commander-js/extra-typings": "^15.0.0",
|
|
18
18
|
"commander": "^15.0.0",
|
|
19
|
+
"semver": "^7.7.3",
|
|
19
20
|
"tinyglobby": "~0.2.17",
|
|
20
21
|
"ts-morph": "^28.0.0",
|
|
21
22
|
"tslib": "^2.8.1",
|
|
22
|
-
"typescript": "~6.0.3"
|
|
23
|
+
"typescript": "~6.0.3",
|
|
24
|
+
"yaml": "^2.8.3"
|
|
23
25
|
},
|
|
24
26
|
"bin": {
|
|
25
27
|
"codemod": "./bin/cli.js"
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { findPath as a } from "@arcgis/node-toolkit/file";
|
|
2
|
-
import { path as s, toPosixPathSeparators as d } from "@arcgis/node-toolkit/path";
|
|
3
|
-
import { collectOutputSync as c } from "@arcgis/node-toolkit/shell";
|
|
4
|
-
import u from "typescript";
|
|
5
|
-
import { retrievePackageJson as g } from "@arcgis/node-toolkit/packageJson";
|
|
6
|
-
function P() {
|
|
7
|
-
const t = a(".git");
|
|
8
|
-
if (t === void 0)
|
|
9
|
-
throw new Error("Unable to find a Git repository for the deprecation audit.");
|
|
10
|
-
const e = s.dirname(t), o = c("git", ["remote", "get-url", "origin"], { cwd: e }), n = c("git", ["rev-parse", "HEAD"], { cwd: e });
|
|
11
|
-
return { repository: l(o), repositoryRoot: e, ref: n };
|
|
12
|
-
}
|
|
13
|
-
function v(t, e) {
|
|
14
|
-
return d(s.relative(e, t));
|
|
15
|
-
}
|
|
16
|
-
function y(t, e, o, n) {
|
|
17
|
-
const i = t === "usages" ? "usage" : "definition";
|
|
18
|
-
process.stderr.write(
|
|
19
|
-
`Deprecations: ${e} ${i}${e === 1 ? "" : "s"} across ${o} file${o === 1 ? "" : "s"} from ${n} package${n === 1 ? "" : "s"}.
|
|
20
|
-
`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
function l(t) {
|
|
24
|
-
const e = t.replace(/\.git$/u, "");
|
|
25
|
-
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
26
|
-
return new URL(e).href.replace(/^https?:\/\//u, "").replace(/\/$/u, "");
|
|
27
|
-
const o = /^(?:ssh:\/\/)?git@([^/:]+)[:/](.+)$/u.exec(e);
|
|
28
|
-
if (o !== null)
|
|
29
|
-
return `${o[1]}/${o[2]}`;
|
|
30
|
-
throw new Error(`Unsupported Git remote URL: ${t}`);
|
|
31
|
-
}
|
|
32
|
-
function w(t) {
|
|
33
|
-
return typeof t == "string" ? t : t.map((e) => e.kind === u.SyntaxKind.JSDocText ? e.text : m(e.getText())).join("");
|
|
34
|
-
}
|
|
35
|
-
function k(t) {
|
|
36
|
-
return t === void 0 ? void 0 : f(u.displayPartsToString([...t]));
|
|
37
|
-
}
|
|
38
|
-
function f(t) {
|
|
39
|
-
return t.replace(
|
|
40
|
-
/\{@link(?:code|plain)?\s+([\s\S]*?)\}/gu,
|
|
41
|
-
(e, o) => p(o)
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
function m(t) {
|
|
45
|
-
const e = /^\{@link(?:code|plain)?\s+([\s\S]*?)\}$/u.exec(t)?.[1];
|
|
46
|
-
return e === void 0 ? t : p(e);
|
|
47
|
-
}
|
|
48
|
-
function p(t) {
|
|
49
|
-
const e = t.trim().replace(/^(\S+)\s+([/:#!.])/u, "$1$2"), o = e.indexOf("|");
|
|
50
|
-
if (o !== -1)
|
|
51
|
-
return e.slice(o + 1).trim() || e.slice(0, o).trim();
|
|
52
|
-
const [n, ...i] = e.split(/\s+/u);
|
|
53
|
-
return i.join(" ") || n;
|
|
54
|
-
}
|
|
55
|
-
function R(t, e) {
|
|
56
|
-
const o = a("package.json", t);
|
|
57
|
-
return o === void 0 ? e : g(s.dirname(o)).name ?? e;
|
|
58
|
-
}
|
|
59
|
-
const r = {
|
|
60
|
-
excludedPackageNames: /* @__PURE__ */ new Set([
|
|
61
|
-
"@arcgis/charts-components-react",
|
|
62
|
-
"@arcgis/coding-components-react",
|
|
63
|
-
"@arcgis/components-build-utils",
|
|
64
|
-
"@arcgis/map-components-react",
|
|
65
|
-
"@arcgis/portal-components-react",
|
|
66
|
-
"@arcgis-test/lit-components-react"
|
|
67
|
-
]),
|
|
68
|
-
excludedDefinitionPathFragments: ["test-package"],
|
|
69
|
-
ignoreDeprecatedApis: ["getReactWrapperOptions"],
|
|
70
|
-
ignoredDeprecationsByIncludes: ["React wrappers are not needed in React 19 or above"]
|
|
71
|
-
};
|
|
72
|
-
function J(t) {
|
|
73
|
-
return t !== void 0 && r.excludedPackageNames.has(t);
|
|
74
|
-
}
|
|
75
|
-
function T(t) {
|
|
76
|
-
return r.excludedDefinitionPathFragments.some(
|
|
77
|
-
(e) => t.includes(e)
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
function E(t, e) {
|
|
81
|
-
return r.ignoreDeprecatedApis.some((o) => o === t) || e != null && r.ignoredDeprecationsByIncludes.some((o) => e.includes(o));
|
|
82
|
-
}
|
|
83
|
-
export {
|
|
84
|
-
v as a,
|
|
85
|
-
R as b,
|
|
86
|
-
E as c,
|
|
87
|
-
k as d,
|
|
88
|
-
T as e,
|
|
89
|
-
w as f,
|
|
90
|
-
P as g,
|
|
91
|
-
y as p,
|
|
92
|
-
J as s
|
|
93
|
-
};
|