@arcgis/codemod 5.2.0-next.90 → 5.2.0-next.93
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/{actions-ACvjOtUF.js → actions-Dk0H5GL7.js} +1 -1
- package/dist/cli-BG_bddFb.js +269 -0
- package/dist/cli.js +1 -1
- package/dist/{codemod-CJvMRUCq.js → codemod-BL-hF1sl.js} +3 -3
- package/dist/codemod-BsJsUWX-.js +240 -0
- package/dist/{codemod-BSrbZ8nr.js → codemod-CE3IeY9A.js} +3 -3
- package/dist/{codemod-BNhkoGgL.js → codemod-Ct065XZR.js} +4 -4
- package/dist/codemod-D0WPk--E.js +311 -0
- package/dist/{codemod-3QuC4SaX.js → codemod-DVCFvVWI.js} +3 -3
- package/dist/{useProjectInstance-5uuenLkM.js → useProjectInstance-JISA7BBD.js} +13 -16
- package/package.json +4 -4
- package/dist/actions-CKBQcIhe.js +0 -354
- package/dist/actions-CakrAPrI.js +0 -354
- package/dist/actions-CtxXjpuZ.js +0 -354
- package/dist/cli-3BztOTDV.js +0 -266
- package/dist/cli-BIg5ZLTm.js +0 -266
- package/dist/cli-BJ6P_2T-.js +0 -266
- package/dist/cli-CJfbqFa-.js +0 -266
- package/dist/codemod-8GvQmmZV.js +0 -140
- package/dist/codemod-BD9n1ra2.js +0 -74
- package/dist/codemod-BWZBr6IZ.js +0 -140
- package/dist/codemod-Bz1NfItD.js +0 -436
- package/dist/codemod-CRHygcg2.js +0 -74
- package/dist/codemod-CXiJ129U.js +0 -436
- package/dist/codemod-CzsItZhZ.js +0 -74
- package/dist/codemod-DOOtgv8R.js +0 -436
- package/dist/codemod-Dc4LGHgd.js +0 -6080
- package/dist/codemod-UDMxoQjk.js +0 -6080
- package/dist/codemod-Xx_q11AP.js +0 -6080
- package/dist/codemod-urnOPYsG.js +0 -140
- package/dist/useProjectInstance-CGaAin_6.js +0 -50
- package/dist/useProjectInstance-DiZc_C2o.js +0 -50
- package/dist/useProjectInstance-DixfNjtt.js +0 -50
package/dist/codemod-urnOPYsG.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
var p = (i, o) => (o = Symbol[i]) ? o : /* @__PURE__ */ Symbol.for("Symbol." + i), f = (i) => {
|
|
2
|
-
throw TypeError(i);
|
|
3
|
-
};
|
|
4
|
-
var g = (i, o, a) => {
|
|
5
|
-
if (o != null) {
|
|
6
|
-
typeof o != "object" && typeof o != "function" && f("Object expected");
|
|
7
|
-
var n, t;
|
|
8
|
-
a && (n = o[p("asyncDispose")]), n === void 0 && (n = o[p("dispose")], a && (t = n)), typeof n != "function" && f("Object not disposable"), t && (n = function() {
|
|
9
|
-
try {
|
|
10
|
-
t.call(this);
|
|
11
|
-
} catch (r) {
|
|
12
|
-
return Promise.reject(r);
|
|
13
|
-
}
|
|
14
|
-
}), i.push([a, n, o]);
|
|
15
|
-
} else a && i.push([a]);
|
|
16
|
-
return o;
|
|
17
|
-
}, m = (i, o, a) => {
|
|
18
|
-
var n = typeof SuppressedError == "function" ? SuppressedError : function(e, s, c, l) {
|
|
19
|
-
return l = Error(c), l.name = "SuppressedError", l.error = e, l.suppressed = s, l;
|
|
20
|
-
}, t = (e) => o = a ? new n(e, o, "An error was suppressed during disposal") : (a = !0, e), r = (e) => {
|
|
21
|
-
for (; e = i.pop(); )
|
|
22
|
-
try {
|
|
23
|
-
var s = e[1] && e[1].call(e[2]);
|
|
24
|
-
if (e[0]) return Promise.resolve(s).then(r, (c) => (t(c), r()));
|
|
25
|
-
} catch (c) {
|
|
26
|
-
t(c);
|
|
27
|
-
}
|
|
28
|
-
if (a) throw o;
|
|
29
|
-
};
|
|
30
|
-
return r();
|
|
31
|
-
};
|
|
32
|
-
import { f as h, p as P } from "./actions-CKBQcIhe.js";
|
|
33
|
-
import { log as k } from "@arcgis/toolkit/log";
|
|
34
|
-
import { writeFile as u } from "node:fs/promises";
|
|
35
|
-
import { c as y } from "./useProjectInstance-5uuenLkM.js";
|
|
36
|
-
import { p as x, g as J } from "./cli-BJ6P_2T-.js";
|
|
37
|
-
async function v(i, o) {
|
|
38
|
-
const a = /* @__PURE__ */ new Set();
|
|
39
|
-
for (const n of i) {
|
|
40
|
-
const t = n.packageJson;
|
|
41
|
-
if (t === void 0 || a.has(t.filePath))
|
|
42
|
-
continue;
|
|
43
|
-
a.add(t.filePath);
|
|
44
|
-
const r = t.contents;
|
|
45
|
-
try {
|
|
46
|
-
const e = await o(r, t.filePath);
|
|
47
|
-
r !== e && await u(t.filePath, `${JSON.stringify(e, null, 2)}
|
|
48
|
-
`, "utf8");
|
|
49
|
-
} catch (e) {
|
|
50
|
-
process.exitCode = 1, k(
|
|
51
|
-
"error",
|
|
52
|
-
h(t.filePath),
|
|
53
|
-
`Error occurred while migrating: ${String(e)}`,
|
|
54
|
-
typeof e == "object" && e !== null && "stack" in e ? { detail: { stack: e.stack } } : void 0
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function D(i, o) {
|
|
60
|
-
for (const a of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
|
|
61
|
-
const n = i[a];
|
|
62
|
-
if (n) {
|
|
63
|
-
const t = o(n, a);
|
|
64
|
-
t !== n && (i = { ...i, [a]: t });
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return i;
|
|
68
|
-
}
|
|
69
|
-
const d = "@arcgis/components-build-utils", S = {
|
|
70
|
-
[d]: {
|
|
71
|
-
existsAsync: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
72
|
-
// Command-string helpers require manual tokenization before using command-plus-args helpers.
|
|
73
|
-
sh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
|
|
74
|
-
// sp was removed from node-toolkit; collectOutputSync is the closest return-value replacement.
|
|
75
|
-
sp: { do: "rename", name: "collectOutputSync", specifier: "@arcgis/node-toolkit/shell" },
|
|
76
|
-
asyncSh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
|
|
77
|
-
findPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
78
|
-
asyncFindPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
79
|
-
createFileIfNotExists: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
80
|
-
gitIgnoreFileToGlobs: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
81
|
-
gitIgnoreToGlob: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
82
|
-
isPosix: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
83
|
-
toPosixPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
84
|
-
normalizePath: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
85
|
-
toSystemPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
86
|
-
getCwd: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
87
|
-
path: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
88
|
-
PackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
89
|
-
retrievePackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
90
|
-
asyncRetrievePackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
91
|
-
fetchPackageLocation: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
92
|
-
detectPackageManager: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
93
|
-
DependencyManagementOptions: {
|
|
94
|
-
do: "rename",
|
|
95
|
-
specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
|
|
96
|
-
},
|
|
97
|
-
vitePresetPlugin: { do: "rename", specifier: "@arcgis/node-toolkit/vite/presetPlugin" },
|
|
98
|
-
externalizeDependencies: {
|
|
99
|
-
do: "rename",
|
|
100
|
-
specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}, C = {
|
|
104
|
-
meta: {
|
|
105
|
-
needsTypeInformation: !1
|
|
106
|
-
},
|
|
107
|
-
async run(i) {
|
|
108
|
-
await v(
|
|
109
|
-
i,
|
|
110
|
-
(r) => D(
|
|
111
|
-
r,
|
|
112
|
-
(e) => e[d] ? {
|
|
113
|
-
...e,
|
|
114
|
-
[d]: void 0,
|
|
115
|
-
"@arcgis/node-toolkit": e[d]
|
|
116
|
-
} : e
|
|
117
|
-
)
|
|
118
|
-
);
|
|
119
|
-
for (const r of i) {
|
|
120
|
-
var o = [];
|
|
121
|
-
try {
|
|
122
|
-
const e = g(o, y(r));
|
|
123
|
-
for (const s of e.getCodemodFiles())
|
|
124
|
-
P(s, S);
|
|
125
|
-
} catch (a) {
|
|
126
|
-
var n = a, t = !0;
|
|
127
|
-
} finally {
|
|
128
|
-
m(o, n, t);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
x(), k(
|
|
132
|
-
"info",
|
|
133
|
-
J.codemodName,
|
|
134
|
-
"Next step: run npm install/pnpm install/yarn install to get @arcgis/node-toolkit package installed."
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
export {
|
|
139
|
-
C as codemod
|
|
140
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Project as l } from "ts-morph";
|
|
2
|
-
import { log as f } from "@arcgis/toolkit/log";
|
|
3
|
-
import { path as p } from "@arcgis/node-toolkit/path";
|
|
4
|
-
import { g as t, d } from "./cli-BIg5ZLTm.js";
|
|
5
|
-
import { styleText as s } from "node:util";
|
|
6
|
-
function P(e) {
|
|
7
|
-
if (t.project !== void 0)
|
|
8
|
-
throw Error(
|
|
9
|
-
"A different ts-morph Project is already in use. Dispose of it before creating a new one. Example: using project = createProjectInstance(...)"
|
|
10
|
-
);
|
|
11
|
-
const i = t.codemod.meta.needsTypeInformation, o = new l({
|
|
12
|
-
// If tsconfig is missing, or project is untyped, use a permissive and
|
|
13
|
-
// compatible default config
|
|
14
|
-
compilerOptions: e.typeScriptConfig?.compilerOptions ?? {
|
|
15
|
-
...d,
|
|
16
|
-
// Read types from JSDoc annotations if present
|
|
17
|
-
checkJs: i
|
|
18
|
-
},
|
|
19
|
-
// We take care of reading the config file
|
|
20
|
-
tsConfigFilePath: void 0,
|
|
21
|
-
// We add files manually below
|
|
22
|
-
skipAddingFilesFromTsConfig: !0,
|
|
23
|
-
// We call this manually if needed below.
|
|
24
|
-
skipFileDependencyResolution: !0,
|
|
25
|
-
skipLoadingLibFiles: !i
|
|
26
|
-
});
|
|
27
|
-
for (const n of e.filePaths)
|
|
28
|
-
o.addSourceFileAtPath(n);
|
|
29
|
-
i && o.resolveSourceFileDependencies();
|
|
30
|
-
const r = p.relative(process.cwd(), e.cwd);
|
|
31
|
-
process.stdout.write(""), f(
|
|
32
|
-
"info",
|
|
33
|
-
s("blue", r === "" ? process.cwd() : r),
|
|
34
|
-
`Running the codemod on ${s("blue", String(e.filePaths.length))} file${e.filePaths.length !== 1 ? "s" : ""}${e.packageJson?.contents.name === void 0 ? "" : ` from ${s("blue", e.packageJson.contents.name)}`}`
|
|
35
|
-
);
|
|
36
|
-
const c = {
|
|
37
|
-
[Symbol.dispose]() {
|
|
38
|
-
o.saveSync(), o.getRootDirectories().forEach((n) => n.forget()), t.project = void 0;
|
|
39
|
-
},
|
|
40
|
-
projectData: e,
|
|
41
|
-
// Any files added after projectData.filePaths are supporting files for type
|
|
42
|
-
// checking, but are not codemod targets.
|
|
43
|
-
getCodemodFiles: () => o.getSourceFiles().slice(0, e.filePaths.length),
|
|
44
|
-
tsMorph: o
|
|
45
|
-
};
|
|
46
|
-
return t.project = c, c;
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
P as c
|
|
50
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Project as l } from "ts-morph";
|
|
2
|
-
import { log as f } from "@arcgis/toolkit/log";
|
|
3
|
-
import { path as p } from "@arcgis/node-toolkit/path";
|
|
4
|
-
import { g as t, d } from "./cli-3BztOTDV.js";
|
|
5
|
-
import { styleText as s } from "node:util";
|
|
6
|
-
function P(e) {
|
|
7
|
-
if (t.project !== void 0)
|
|
8
|
-
throw Error(
|
|
9
|
-
"A different ts-morph Project is already in use. Dispose of it before creating a new one. Example: using project = createProjectInstance(...)"
|
|
10
|
-
);
|
|
11
|
-
const i = t.codemod.meta.needsTypeInformation, o = new l({
|
|
12
|
-
// If tsconfig is missing, or project is untyped, use a permissive and
|
|
13
|
-
// compatible default config
|
|
14
|
-
compilerOptions: e.typeScriptConfig?.compilerOptions ?? {
|
|
15
|
-
...d,
|
|
16
|
-
// Read types from JSDoc annotations if present
|
|
17
|
-
checkJs: i
|
|
18
|
-
},
|
|
19
|
-
// We take care of reading the config file
|
|
20
|
-
tsConfigFilePath: void 0,
|
|
21
|
-
// We add files manually below
|
|
22
|
-
skipAddingFilesFromTsConfig: !0,
|
|
23
|
-
// We call this manually if needed below.
|
|
24
|
-
skipFileDependencyResolution: !0,
|
|
25
|
-
skipLoadingLibFiles: !i
|
|
26
|
-
});
|
|
27
|
-
for (const n of e.filePaths)
|
|
28
|
-
o.addSourceFileAtPath(n);
|
|
29
|
-
i && o.resolveSourceFileDependencies();
|
|
30
|
-
const r = p.relative(process.cwd(), e.cwd);
|
|
31
|
-
process.stdout.write(""), f(
|
|
32
|
-
"info",
|
|
33
|
-
s("blue", r === "" ? process.cwd() : r),
|
|
34
|
-
`Running the codemod on ${s("blue", String(e.filePaths.length))} file${e.filePaths.length !== 1 ? "s" : ""}${e.packageJson?.contents.name === void 0 ? "" : ` from ${s("blue", e.packageJson.contents.name)}`}`
|
|
35
|
-
);
|
|
36
|
-
const c = {
|
|
37
|
-
[Symbol.dispose]() {
|
|
38
|
-
o.saveSync(), o.getRootDirectories().forEach((n) => n.forget()), t.project = void 0;
|
|
39
|
-
},
|
|
40
|
-
projectData: e,
|
|
41
|
-
// Any files added after projectData.filePaths are supporting files for type
|
|
42
|
-
// checking, but are not codemod targets.
|
|
43
|
-
getCodemodFiles: () => o.getSourceFiles().slice(0, e.filePaths.length),
|
|
44
|
-
tsMorph: o
|
|
45
|
-
};
|
|
46
|
-
return t.project = c, c;
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
P as c
|
|
50
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Project as l } from "ts-morph";
|
|
2
|
-
import { log as f } from "@arcgis/toolkit/log";
|
|
3
|
-
import { path as p } from "@arcgis/node-toolkit/path";
|
|
4
|
-
import { g as t, d } from "./cli-CJfbqFa-.js";
|
|
5
|
-
import { styleText as s } from "node:util";
|
|
6
|
-
function P(e) {
|
|
7
|
-
if (t.project !== void 0)
|
|
8
|
-
throw Error(
|
|
9
|
-
"A different ts-morph Project is already in use. Dispose of it before creating a new one. Example: using project = createProjectInstance(...)"
|
|
10
|
-
);
|
|
11
|
-
const i = t.codemod.meta.needsTypeInformation, o = new l({
|
|
12
|
-
// If tsconfig is missing, or project is untyped, use a permissive and
|
|
13
|
-
// compatible default config
|
|
14
|
-
compilerOptions: e.typeScriptConfig?.compilerOptions ?? {
|
|
15
|
-
...d,
|
|
16
|
-
// Read types from JSDoc annotations if present
|
|
17
|
-
checkJs: i
|
|
18
|
-
},
|
|
19
|
-
// We take care of reading the config file
|
|
20
|
-
tsConfigFilePath: void 0,
|
|
21
|
-
// We add files manually below
|
|
22
|
-
skipAddingFilesFromTsConfig: !0,
|
|
23
|
-
// We call this manually if needed below.
|
|
24
|
-
skipFileDependencyResolution: !0,
|
|
25
|
-
skipLoadingLibFiles: !i
|
|
26
|
-
});
|
|
27
|
-
for (const n of e.filePaths)
|
|
28
|
-
o.addSourceFileAtPath(n);
|
|
29
|
-
i && o.resolveSourceFileDependencies();
|
|
30
|
-
const r = p.relative(process.cwd(), e.cwd);
|
|
31
|
-
process.stdout.write(""), f(
|
|
32
|
-
"info",
|
|
33
|
-
s("blue", r === "" ? process.cwd() : r),
|
|
34
|
-
`Running the codemod on ${s("blue", String(e.filePaths.length))} file${e.filePaths.length !== 1 ? "s" : ""}${e.packageJson?.contents.name === void 0 ? "" : ` from ${s("blue", e.packageJson.contents.name)}`}`
|
|
35
|
-
);
|
|
36
|
-
const c = {
|
|
37
|
-
[Symbol.dispose]() {
|
|
38
|
-
o.saveSync(), o.getRootDirectories().forEach((n) => n.forget()), t.project = void 0;
|
|
39
|
-
},
|
|
40
|
-
projectData: e,
|
|
41
|
-
// Any files added after projectData.filePaths are supporting files for type
|
|
42
|
-
// checking, but are not codemod targets.
|
|
43
|
-
getCodemodFiles: () => o.getSourceFiles().slice(0, e.filePaths.length),
|
|
44
|
-
tsMorph: o
|
|
45
|
-
};
|
|
46
|
-
return t.project = c, c;
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
P as c
|
|
50
|
-
};
|