@arcgis/codemod 6.0.0-next.42 → 6.0.0-next.44

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/README.md CHANGED
@@ -6,13 +6,14 @@ This package provides automated refactors to help migrate away from deprecated o
6
6
  These include codemods for removing the `__esri` namespace and
7
7
  converting global namespace types to explicit `@arcgis/core` imports,
8
8
  normalizing legacy Calcite icon names,
9
- and updating geometry operator usage.
9
+ updating geometry operator usage,
10
+ and migrating the Feature (next) and Features (next) components.
10
11
 
11
12
  ## Requirements
12
13
 
13
14
  - Node.js 24
14
15
  - A project using the ArcGIS Maps SDK for JavaScript
15
- - This codemod operates exclusively on TypeScript files. You do not need to run this tool if the project does not use TypeScript.
16
+ - Supported file types depend on the codemod. The `feature-next-to-feature` codemod supports JavaScript, TypeScript, JSX, TSX, and HTML; `features-next-to-features` supports JavaScript, TypeScript, JSX, and TSX.
16
17
 
17
18
  ## Before you begin
18
19
 
@@ -25,7 +26,7 @@ If your project uses **ESLint, Prettier, or other formatters/linters**, run them
25
26
  > that is under version control (Git) so you can review changes using `git diff` or your IDE’s diff tools. If your
26
27
  > project is not under version control, create a backup before running the codemod.
27
28
 
28
- By default, codemods run on all TypeScript files in the current directory and subdirectories.
29
+ By default, codemods run on supported source files in the current directory and subdirectories.
29
30
  You can manually run it on a different directory by providing it as an argument.
30
31
 
31
32
  Codemods respect `.gitignore` files and will not modify any files ignored by them.
@@ -35,6 +36,9 @@ Codemods respect `.gitignore` files and will not modify any files ignored by the
35
36
  - [`refactor-out-esri-namespace`](#refactor-out-the-__esri-namespace)
36
37
  - [`normalize-calcite-icon-names`](#normalize-calcite-icon-names)
37
38
  - [`geometry-operator-renames`](#rename-geometry-operators)
39
+ - [`rename-next-list-components`](#rename-next-list-components)
40
+ - [`feature-next-to-feature`](#migrate-feature-next-to-feature)
41
+ - [`features-next-to-features`](#rename-features-next)
38
42
 
39
43
  ### Refactor out the `__esri` namespace
40
44
 
@@ -130,6 +134,86 @@ const options: BufferExecuteOptions = { unit: "meters" };
130
134
  const buffered = bufferExecute(polyline, 250, options);
131
135
  ```
132
136
 
137
+ ### Rename Next List Components
138
+
139
+ In version 6.0, the next-generation Basemap Layer List, Catalog Layer List, Layer List, and Table List components
140
+ replace their original components. The `rename-next-list-components` codemod updates component tags, package
141
+ subpaths, and public TypeScript symbols to remove the `next` suffix.
142
+
143
+ Run it in the root of your project or with an explicit target directory:
144
+
145
+ ```sh
146
+ npx @arcgis/codemod run rename-next-list-components [<target-directory>]
147
+ ```
148
+
149
+ **Before:**
150
+
151
+ ```tsx
152
+ import type { ArcgisLayerListNext } from "@arcgis/map-components/components/arcgis-layer-list-next";
153
+
154
+ const layerList: ArcgisLayerListNext = document.createElement("arcgis-layer-list-next");
155
+ ```
156
+
157
+ **After:**
158
+
159
+ ```tsx
160
+ import type { ArcgisLayerList } from "@arcgis/map-components/components/arcgis-layer-list";
161
+
162
+ const layerList: ArcgisLayerList = document.createElement("arcgis-layer-list");
163
+ ```
164
+
165
+ ### Migrate Feature (next) to Feature
166
+
167
+ In version 6.0, `arcgis-feature-next` is removed and `arcgis-feature` uses its implementation.
168
+ To update static component tags, imports, element types, and common DOM queries in JavaScript,
169
+ TypeScript, JSX, TSX, and HTML files, run the following command. Local aliases and re-export names are preserved.
170
+
171
+ ```sh
172
+ npx @arcgis/codemod run feature-next-to-feature [<target-directory>]
173
+ ```
174
+
175
+ Review the changes and manually update dynamic references, CSS selectors, framework templates, the removed
176
+ `viewModel` property, and promise chaining on `nextMedia`, `previousMedia`, or `setActiveMedia`.
177
+ The media methods now return `void`. React wrappers are no longer available in 6.0; replace them with
178
+ `<arcgis-feature>` and migrate event handlers manually. The codemod warns about wrapper usages it finds.
179
+
180
+ ### Rename Features (Next)
181
+
182
+ In version 6.0, `arcgis-features-next` is replaced by `arcgis-features`.
183
+ The `features-next-to-features` codemod updates static `@arcgis/map-components` imports,
184
+ imported `ArcgisFeaturesNext` types and their references, JSX tags, and literal DOM tag names passed to
185
+ `querySelector`, `querySelectorAll`, `createElement`, `getElementsByTagName`, `closest`, and `matches`.
186
+ Existing import aliases are preserved; IDs, labels, and other application strings are not renamed.
187
+
188
+ ```sh
189
+ npx @arcgis/codemod run features-next-to-features [<target-directory>]
190
+ ```
191
+
192
+ **Before:**
193
+
194
+ ```tsx
195
+ import type { ArcgisFeaturesNext } from "@arcgis/map-components/components/arcgis-features-next";
196
+ const element = document.querySelector<ArcgisFeaturesNext["el"]>("arcgis-features-next");
197
+ const view = <arcgis-features-next />;
198
+ ```
199
+
200
+ **After:**
201
+
202
+ ```tsx
203
+ import type { ArcgisFeatures } from "@arcgis/map-components/components/arcgis-features";
204
+ const element = document.querySelector<ArcgisFeatures["el"]>("arcgis-features");
205
+ const view = <arcgis-features />;
206
+ ```
207
+
208
+ Review remaining references reported by the codemod. Dynamic imports, re-exports, indirect tag names, compound selectors,
209
+ HTML/CSS templates, and standalone HTML/CSS files require manual migration. Standalone HTML/CSS files
210
+ are not scanned.
211
+
212
+ This codemod only automates the component rename. Applications already using `arcgis-features` must
213
+ also review the [6.0 Features migration notes](https://developers.arcgis.com/javascript/latest/v6-0/#features),
214
+ including removed methods, the abilities property rename, and translation overrides.
215
+ These changes depend on application behavior and are not rewritten automatically.
216
+
133
217
  ## Versioning
134
218
 
135
219
  The codemods are available until the corresponding deprecated feature is removed.
@@ -5,7 +5,7 @@ import $ from "picomatch";
5
5
  import i from "typescript";
6
6
  import { retrievePackageJson as O } from "@arcgis/node-toolkit/packageJson";
7
7
  import { e as C, d as P } from "./cli.js";
8
- const K = "6.0.0-next.42";
8
+ const K = "6.0.0-next.44";
9
9
  function I(e, r) {
10
10
  return e.package.localeCompare(r.package) || e.file.localeCompare(r.file) || e.line - r.line || e.column - r.column || g(e.module, r.module) || g(e.memberOf, r.memberOf) || e.name.localeCompare(r.name) || g(e.kind, r.kind) || g(e.category, r.category) || g(e.provenance, r.provenance) || String(e.deprecated).localeCompare(String(r.deprecated));
11
11
  }
@@ -11,7 +11,7 @@ import { gitIgnoreFileToGlobs as ee } from "@arcgis/node-toolkit/glob";
11
11
  import { identity as q } from "@arcgis/toolkit/function";
12
12
  import { styleText as M } from "node:util";
13
13
  import { randomUUID as le } from "node:crypto";
14
- const pe = (t, e, o) => {
14
+ const me = (t, e, o) => {
15
15
  const s = t[e];
16
16
  return s ? typeof s == "function" ? s() : Promise.resolve(s) : new Promise((n, l) => {
17
17
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(l.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + e + (e.split("/").length !== o ? ". Note that variables only represent file names one level deep." : ""))));
@@ -35,7 +35,7 @@ const pe = (t, e, o) => {
35
35
  target: d.ScriptTarget.ESNext,
36
36
  resolveJsonModule: !0,
37
37
  esModuleInterop: !0
38
- }, S = {
38
+ }, x = {
39
39
  codemod: void 0,
40
40
  codemodName: void 0,
41
41
  projectsData: void 0,
@@ -48,11 +48,11 @@ const pe = (t, e, o) => {
48
48
  // Default build output folder in bundlers
49
49
  "**/dist/**"
50
50
  ];
51
- async function ue() {
52
- const { ignorePatterns: t, globRoot: e, hasIgnoreFiles: o } = await me(), s = await ge(e);
51
+ async function pe() {
52
+ const { ignorePatterns: t, globRoot: e, hasIgnoreFiles: o } = await ue(), s = await ge(e);
53
53
  return t.push(...s.ignorePatterns), !o && !s.hasIgnoreFiles && t.push(...te), { ignorePatterns: t, globRoot: e };
54
54
  }
55
- async function me() {
55
+ async function ue() {
56
56
  const t = [];
57
57
  let e = !1;
58
58
  const o = await T(".git"), s = o === void 0 ? void 0 : r.dirname(o);
@@ -60,17 +60,17 @@ async function me() {
60
60
  do {
61
61
  if (n = f, s !== void 0 && n !== s && !n.startsWith(`${s}/`))
62
62
  break;
63
- const u = r.join(n, ".gitignore");
64
- if (await J(u)) {
65
- e = !0, l = r.dirname(u);
66
- const h = r.relative(l, W()).split("/"), N = ee(u);
63
+ const p = r.join(n, ".gitignore");
64
+ if (await J(p)) {
65
+ e = !0, l = r.dirname(p);
66
+ const h = r.relative(l, W()).split("/"), N = ee(p);
67
67
  for (const b of N) {
68
- const w = b.startsWith("!") ? b.slice(1) : b, y = w.search(/[*?[]/u), P = y === -1 ? w : w.slice(0, y), m = P.split("/"), I = y !== -1 && !P.endsWith("/");
68
+ const w = b.startsWith("!") ? b.slice(1) : b, y = w.search(/[*?[]/u), P = y === -1 ? w : w.slice(0, y), u = P.split("/"), I = y !== -1 && !P.endsWith("/");
69
69
  let v = !0;
70
- const D = Math.min(h.length, m.length);
70
+ const D = Math.min(h.length, u.length);
71
71
  for (let i = 0; i < D; i++) {
72
- const a = m[i];
73
- if (!(I && i === m.length - 1 ? h[i].startsWith(a) : h[i] === a) && a !== "") {
72
+ const a = u[i];
73
+ if (!(I && i === u.length - 1 ? h[i].startsWith(a) : h[i] === a) && a !== "") {
74
74
  v = !1;
75
75
  break;
76
76
  }
@@ -94,8 +94,8 @@ async function ge(t) {
94
94
  });
95
95
  return { ignorePatterns: e.flatMap((s) => {
96
96
  const n = r.relative(t, r.dirname(s)), l = ee(s), f = [];
97
- for (const u of l)
98
- u.startsWith("!") || f.push(r.join(n, u));
97
+ for (const p of l)
98
+ p.startsWith("!") || f.push(r.join(n, p));
99
99
  return f;
100
100
  }), hasIgnoreFiles: e.length > 0 };
101
101
  }
@@ -105,12 +105,12 @@ async function we({
105
105
  includeComponentFiles: e = !1,
106
106
  includeTsConfigFiles: o = !1
107
107
  } = {}) {
108
- const s = await ue(), l = `**/*.{${[
108
+ const s = await pe(), l = `**/*.{${[
109
109
  ...oe,
110
110
  ...se,
111
111
  ...he,
112
112
  ...e ? be : []
113
- ].join(",")}}`, f = r.join(process.cwd(), l), u = r.join(r.resolve(s.globRoot), "/"), U = (await Z(f, {
113
+ ].join(",")}}`, f = r.join(process.cwd(), l), p = r.join(r.resolve(s.globRoot), "/"), U = (await Z(f, {
114
114
  cwd: s.globRoot,
115
115
  ignore: s.ignorePatterns,
116
116
  // The files we are looking for are unlikely to be symbolic links
@@ -121,13 +121,13 @@ async function we({
121
121
  // default behavior). If any tsconfig.json explicitly includes such files,
122
122
  // they will still be codemodded.
123
123
  })).filter(
124
- (i) => i.endsWith(".json") || t === void 0 || u + i === t
124
+ (i) => i.endsWith(".json") || t === void 0 || p + i === t
125
125
  );
126
126
  let h = r.relative(s.globRoot, process.cwd());
127
127
  h !== "" && (h += "/");
128
- const N = u.length + h.length, b = [], w = [], y = /* @__PURE__ */ new Set();
128
+ const N = p.length + h.length, b = [], w = [], y = /* @__PURE__ */ new Set();
129
129
  for (const i of U) {
130
- const a = u + i;
130
+ const a = p + i;
131
131
  if (i.endsWith(".json")) {
132
132
  const c = r.basename(i);
133
133
  c === "package.json" ? b.push(a) : (c.startsWith("tsconfig.") || c.startsWith("jsconfig.")) && w.push(a);
@@ -141,13 +141,13 @@ async function we({
141
141
  const c = a.split("/").length - i.split("/").length;
142
142
  if (c !== 0)
143
143
  return c;
144
- const p = r.basename(i), x = r.basename(a);
145
- return p === x ? 0 : p.endsWith("tsconfig.json") ? -1 : x.endsWith("tsconfig.json") ? 1 : p.endsWith("tsconfig.build.json") ? -1 : x.endsWith("tsconfig.build.json") ? 1 : p.localeCompare(x);
144
+ const m = r.basename(i), S = r.basename(a);
145
+ return m === S ? 0 : m.endsWith("tsconfig.json") ? -1 : S.endsWith("tsconfig.json") ? 1 : m.endsWith("tsconfig.build.json") ? -1 : S.endsWith("tsconfig.build.json") ? 1 : m.localeCompare(S);
146
146
  });
147
- let m = await T("package.json");
148
- m !== void 0 && (m = H(m));
147
+ let u = await T("package.json");
148
+ u !== void 0 && (u = H(u));
149
149
  const I = [
150
- .../* @__PURE__ */ new Set([...b, ...m === void 0 ? [] : [m]])
150
+ .../* @__PURE__ */ new Set([...b, ...u === void 0 ? [] : [u]])
151
151
  ].sort((i, a) => a.length - i.length), v = [], D = /* @__PURE__ */ new Set();
152
152
  if (await Promise.all(
153
153
  w.map(async (i) => {
@@ -164,23 +164,23 @@ async function we({
164
164
  );
165
165
  return;
166
166
  }
167
- const p = d.parseJsonConfigFileContent(
167
+ const m = d.parseJsonConfigFileContent(
168
168
  c.config,
169
169
  d.sys,
170
170
  r.dirname(i),
171
171
  void 0,
172
172
  i
173
- ), x = 18003;
174
- p.errors.filter((k) => k.code !== x).length > 0 && g(
173
+ ), S = 18003;
174
+ m.errors.filter((k) => k.code !== S).length > 0 && g(
175
175
  "warn",
176
176
  a,
177
- d.formatDiagnosticsWithColorAndContext(p.errors, {
177
+ d.formatDiagnosticsWithColorAndContext(m.errors, {
178
178
  getCanonicalFileName: q,
179
179
  getCurrentDirectory: d.sys.getCurrentDirectory,
180
180
  getNewLine: () => d.sys.newLine
181
181
  })
182
182
  );
183
- const L = i === P, K = p.fileNames.filter((k) => {
183
+ const L = i === P, K = m.fileNames.filter((k) => {
184
184
  if (t !== void 0 && k !== t)
185
185
  return !1;
186
186
  const E = k.slice(N);
@@ -193,11 +193,11 @@ async function we({
193
193
  );
194
194
  if (K.length === 0 && !re)
195
195
  return;
196
- const _ = r.dirname(i), ae = z(_, I) ?? m;
196
+ const _ = r.dirname(i), ae = z(_, I) ?? u;
197
197
  v.push(
198
198
  await B(K, _, ae, {
199
199
  filePath: i,
200
- compilerOptions: p.options
200
+ compilerOptions: m.options
201
201
  })
202
202
  );
203
203
  })
@@ -205,13 +205,13 @@ async function we({
205
205
  const i = [...y].map((c) => r.join(process.cwd(), c)), a = Map.groupBy(i, (c) => z(c, I));
206
206
  v.push(
207
207
  ...await Promise.all(
208
- [...a].map(async ([c, p]) => await B(p, process.cwd(), c))
208
+ [...a].map(async ([c, m]) => await B(m, process.cwd(), c))
209
209
  )
210
210
  );
211
211
  }
212
212
  return v.sort(
213
213
  (i, a) => i.cwd.localeCompare(a.cwd) || (i.typeScriptConfig?.filePath ?? "").localeCompare(a.typeScriptConfig?.filePath ?? "") || (i.packageJson?.filePath ?? "").localeCompare(a.packageJson?.filePath ?? "")
214
- ), S.projectsData = v, v;
214
+ ), x.projectsData = v, v;
215
215
  }
216
216
  function Ue(t) {
217
217
  const e = r.extname(t).slice(1);
@@ -237,13 +237,13 @@ async function B(t, e, o, s) {
237
237
  };
238
238
  }
239
239
  function ye() {
240
- S.codemod.meta.needsFooter && (S.codemod.meta.needsFooter = !1, process.exitCode !== void 0 && process.exitCode !== 0 ? g(
240
+ x.codemod.meta.needsFooter && (x.codemod.meta.needsFooter = !1, process.exitCode !== void 0 && process.exitCode !== 0 ? g(
241
241
  "warn",
242
- S.codemodName,
242
+ x.codemodName,
243
243
  "One or more exceptions occurred during the codemod run. Please review the output above."
244
244
  ) : g(
245
245
  "info",
246
- S.codemodName,
246
+ x.codemodName,
247
247
  `${M("green", "Codemod completed successfully.")} Recommended next steps:
248
248
  - Review the codemod changes.
249
249
  - If your project uses ESLint, run ESLint autofix on the changed files.
@@ -252,7 +252,7 @@ function ye() {
252
252
  ));
253
253
  }
254
254
  async function Pe(t, e, o) {
255
- S.codemod = t, S.codemodName = e;
255
+ x.codemod = t, x.codemodName = e;
256
256
  const s = await we({
257
257
  targetFilePath: o,
258
258
  includeComponentFiles: t.meta.includeComponentFiles,
@@ -346,7 +346,7 @@ async function Le(t, e) {
346
346
  process.stderr.write(`Deprecation report submitted to ${e} (${o}).
347
347
  `);
348
348
  }
349
- const Se = /(?:esri|arcgis)/iu, xe = ["/.astro/"], G = ["all", "repositories", "apis", "unused-apis"], Ke = {
349
+ const xe = /(?:esri|arcgis)/iu, Se = ["/.astro/"], G = ["all", "repositories", "apis", "unused-apis"], Ke = {
350
350
  usages: "Refactor-out deprecated API usages",
351
351
  definitions: "Remove deprecated APIs in next breaking changes release"
352
352
  }, _e = {
@@ -354,10 +354,10 @@ const Se = /(?:esri|arcgis)/iu, xe = ["/.astro/"], G = ["all", "repositories", "
354
354
  definitions: "The following deprecated APIs are owned by assigned CODEOWNERS. Remove them in the next breaking changes release."
355
355
  }, He = "This issue is autogenerated and updated regularly based on remaining items. Feel free to add comments and labels, update assignees, set milestone, or create sub-issues. Close it once completed. A new issue will be created if new findings are detected.", qe = "Task", ze = "deprecations sync-issues";
356
356
  function Be(t) {
357
- return Se.test(t);
357
+ return xe.test(t);
358
358
  }
359
359
  function Ve(t) {
360
- return xe.some((e) => `/${t}`.includes(e));
360
+ return Se.some((e) => `/${t}`.includes(e));
361
361
  }
362
362
  const F = new ce(), O = "See https://www.npmjs.com/package/@arcgis/codemod for a list of available public codemods. [Esri internal] Non-public codemods are documented at https://webgis.esri.com/references/codemod/introduction.";
363
363
  F.name("@arcgis/codemod").description("Codemod for migrating or refactoring usages of ArcGIS Maps SDK for JavaScript");
@@ -365,7 +365,7 @@ F.command("run").description("Run a single codemod").argument("<codemodName>", `
365
365
  const o = await ve(e);
366
366
  let s;
367
367
  try {
368
- s = await pe(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod.js"), "./codemods/geometry-operator-renames/codemod.ts": () => import("./codemod2.js"), "./codemods/lumina-component-extras-improvements/codemod.ts": () => import("./codemod3.js"), "./codemods/lumina-toolkit/codemod.ts": () => import("./codemod4.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod5.js"), "./codemods/normalize-calcite-icon-names/codemod.ts": () => import("./codemod6.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod7.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod8.js") }), `./codemods/${t}/codemod.ts`, 4);
368
+ s = await me(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod.js"), "./codemods/feature-next-to-feature/codemod.ts": () => import("./codemod2.js"), "./codemods/features-next-to-features/codemod.ts": () => import("./codemod3.js"), "./codemods/geometry-operator-renames/codemod.ts": () => import("./codemod4.js"), "./codemods/lumina-component-extras-improvements/codemod.ts": () => import("./codemod5.js"), "./codemods/lumina-toolkit/codemod.ts": () => import("./codemod6.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod7.js"), "./codemods/normalize-calcite-icon-names/codemod.ts": () => import("./codemod8.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod9.js"), "./codemods/rename-next-list-components/codemod.ts": () => import("./codemod10.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod11.js") }), `./codemods/${t}/codemod.ts`, 4);
369
369
  } catch (n) {
370
370
  if (
371
371
  // direct Node execution
@@ -537,7 +537,7 @@ export {
537
537
  R as d,
538
538
  Be as e,
539
539
  Me as f,
540
- S as g,
540
+ x as g,
541
541
  ze as h,
542
542
  Ue as i,
543
543
  Ke as j,
@@ -0,0 +1,83 @@
1
+ var g = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), m = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var f = (t, e, s) => {
5
+ if (e != null) {
6
+ typeof e != "object" && typeof e != "function" && m("Object expected");
7
+ var a, l;
8
+ s && (a = e[g("asyncDispose")]), a === void 0 && (a = e[g("dispose")], s && (l = a)), typeof a != "function" && m("Object not disposable"), l && (a = function() {
9
+ try {
10
+ l.call(this);
11
+ } catch (n) {
12
+ return Promise.reject(n);
13
+ }
14
+ }), t.push([s, a, e]);
15
+ } else s && t.push([s]);
16
+ return e;
17
+ }, p = (t, e, s) => {
18
+ var a = typeof SuppressedError == "function" ? SuppressedError : function(i, c, r, o) {
19
+ return o = Error(r), o.name = "SuppressedError", o.error = i, o.suppressed = c, o;
20
+ }, l = (i) => e = s ? new a(i, e, "An error was suppressed during disposal") : (s = !0, i), n = (i) => {
21
+ for (; i = t.pop(); )
22
+ try {
23
+ var c = i[1] && i[1].call(i[2]);
24
+ if (i[0]) return Promise.resolve(c).then(n, (r) => (l(r), n()));
25
+ } catch (r) {
26
+ l(r);
27
+ }
28
+ if (s) throw e;
29
+ };
30
+ return n();
31
+ };
32
+ import { readFile as u, writeFile as d } from "node:fs/promises";
33
+ import { c as L } from "./useProjectInstance.js";
34
+ const y = [
35
+ ["ArcgisBasemapLayerListNext", "ArcgisBasemapLayerList"],
36
+ ["ArcgisCatalogLayerListNext", "ArcgisCatalogLayerList"],
37
+ ["ArcgisLayerListNext", "ArcgisLayerList"],
38
+ ["ArcgisTableListNext", "ArcgisTableList"],
39
+ ["arcgis-basemap-layer-list-next", "arcgis-basemap-layer-list"],
40
+ ["arcgis-catalog-layer-list-next", "arcgis-catalog-layer-list"],
41
+ ["arcgis-layer-list-next", "arcgis-layer-list"],
42
+ ["arcgis-table-list-next", "arcgis-table-list"]
43
+ ], T = [".css", ".html", ".sass", ".scss"];
44
+ function A(t) {
45
+ return T.some((e) => t.endsWith(e));
46
+ }
47
+ function x(t) {
48
+ let e = t;
49
+ for (const [s, a] of y)
50
+ e = e.replaceAll(s, a);
51
+ return e;
52
+ }
53
+ const C = {
54
+ meta: {
55
+ includeComponentFiles: !0,
56
+ needsTypeInformation: !1
57
+ },
58
+ async run(t) {
59
+ for (const n of t) {
60
+ var e = [];
61
+ try {
62
+ const i = f(e, L(n));
63
+ for (const c of i.getCodemodFiles()) {
64
+ const r = c.getFullText(), o = x(r);
65
+ o !== r && c.replaceWithText(o);
66
+ }
67
+ for (const c of n.filePaths.filter(A)) {
68
+ const r = await u(c, "utf8"), o = x(r);
69
+ o !== r && await d(c, o);
70
+ }
71
+ } catch (s) {
72
+ var a = s, l = !0;
73
+ } finally {
74
+ p(e, a, l);
75
+ }
76
+ }
77
+ }
78
+ };
79
+ export {
80
+ C as codemod,
81
+ A as isComponentFile,
82
+ x as renameNextListComponents
83
+ };
@@ -0,0 +1,74 @@
1
+ var c = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), d = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var g = (t, e, s) => {
5
+ if (e != null) {
6
+ typeof e != "object" && typeof e != "function" && d("Object expected");
7
+ var i, r;
8
+ s && (i = e[c("asyncDispose")]), i === void 0 && (i = e[c("dispose")], s && (r = i)), typeof i != "function" && d("Object not disposable"), r && (i = function() {
9
+ try {
10
+ r.call(this);
11
+ } catch (n) {
12
+ return Promise.reject(n);
13
+ }
14
+ }), t.push([s, i, e]);
15
+ } else s && t.push([s]);
16
+ return e;
17
+ }, f = (t, e, s) => {
18
+ var i = typeof SuppressedError == "function" ? SuppressedError : function(o, a, l, m) {
19
+ return m = Error(l), m.name = "SuppressedError", m.error = o, m.suppressed = a, m;
20
+ }, r = (o) => e = s ? new i(o, e, "An error was suppressed during disposal") : (s = !0, o), n = (o) => {
21
+ for (; o = t.pop(); )
22
+ try {
23
+ var a = o[1] && o[1].call(o[2]);
24
+ if (o[0]) return Promise.resolve(a).then(n, (l) => (r(l), n()));
25
+ } catch (l) {
26
+ r(l);
27
+ }
28
+ if (s) throw e;
29
+ };
30
+ return n();
31
+ };
32
+ import { p } from "./actions.js";
33
+ import { c as k } from "./useProjectInstance.js";
34
+ import { p as C } from "./cli.js";
35
+ const j = {
36
+ meta: {
37
+ needsTypeInformation: !1
38
+ },
39
+ run(t) {
40
+ for (const n of t) {
41
+ var e = [];
42
+ try {
43
+ const o = g(e, k(n));
44
+ for (const a of o.getCodemodFiles())
45
+ p(a, {
46
+ "@arcgis/toolkit/intl": {
47
+ getElementLocale: { do: "rename", specifier: "@arcgis/toolkit/intl/dom" },
48
+ startLocaleObserver: { do: "rename", specifier: "@arcgis/toolkit/intl/dom" },
49
+ LocaleObserverResult: { do: "rename", specifier: "@arcgis/toolkit/intl/dom" }
50
+ },
51
+ "@arcgis/toolkit/dom": {
52
+ slotChangeHasContent: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
53
+ slotChangeGetTextContent: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
54
+ slotChangeHasTextContent: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
55
+ slotChangeHasAssignedNode: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
56
+ slotChangeGetAssignedNodes: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
57
+ slotChangeHasAssignedElement: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
58
+ slotChangeGetAssignedElements: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
59
+ getSlotAssignedElements: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
60
+ resolveReferenceElement: { do: "rename", specifier: "@arcgis/toolkit/dom/referenceElement" }
61
+ }
62
+ });
63
+ } catch (s) {
64
+ var i = s, r = !0;
65
+ } finally {
66
+ f(e, i, r);
67
+ }
68
+ }
69
+ C();
70
+ }
71
+ };
72
+ export {
73
+ j as codemod
74
+ };