@cedarjs/codemods 2.7.1-next.0 → 2.8.0-rc.37
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/codemods/list.yargs.js +13 -47
- package/dist/codemods/redwood/v2.3.x/tsconfigForRouteHooks/tsconfigForRouteHooks.js +7 -37
- package/dist/codemods/redwood/v2.3.x/tsconfigForRouteHooks/tsconfigForRouteHooks.yargs.js +6 -42
- package/dist/codemods/redwood/v2.x.x/configureFastify/configureFastify.js +3 -23
- package/dist/codemods/redwood/v2.x.x/configureFastify/configureFastify.yargs.js +22 -58
- package/dist/codemods/redwood/v2.x.x/updateResolverTypes/updateResolverTypes.js +6 -26
- package/dist/codemods/redwood/v2.x.x/updateResolverTypes/updateResolverTypes.yargs.js +12 -48
- package/dist/codemods/redwood/v4.2.x/updateClerkGetCurrentUser/updateClerkGetCurrentUser.js +3 -23
- package/dist/codemods/redwood/v4.2.x/updateClerkGetCurrentUser/updateClerkGetCurrentUser.yargs.js +15 -48
- package/dist/codemods/redwood/v4.x.x/useArmor/useArmor.js +3 -23
- package/dist/codemods/redwood/v4.x.x/useArmor/useArmor.yargs.js +12 -48
- package/dist/codemods/redwood/v5.x.x/cellQueryResult/cellQueryResult.js +3 -23
- package/dist/codemods/redwood/v5.x.x/cellQueryResult/cellQueryResult.yargs.js +10 -46
- package/dist/codemods/redwood/v5.x.x/detectEmptyCells/detectEmptyCells.js +12 -31
- package/dist/codemods/redwood/v5.x.x/detectEmptyCells/detectEmptyCells.yargs.js +6 -42
- package/dist/codemods/redwood/v5.x.x/renameValidateWith/renameValidateWith.js +3 -23
- package/dist/codemods/redwood/v5.x.x/renameValidateWith/renameValidateWith.yargs.js +12 -48
- package/dist/codemods/redwood/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.js +3 -23
- package/dist/codemods/redwood/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.yargs.js +15 -51
- package/dist/codemods/redwood/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.js +8 -42
- package/dist/codemods/redwood/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.yargs.js +6 -42
- package/dist/codemods/redwood/v5.x.x/upgradeToReact18/upgradeToReact18.js +20 -56
- package/dist/codemods/redwood/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.js +14 -46
- package/dist/codemods/redwood/v6.x.x/changeGlobalToGlobalThis/changeGlobalToGlobalThis.js +3 -23
- package/dist/codemods/redwood/v6.x.x/changeGlobalToGlobalThis/changeGlobalToGlobalThis.yargs.js +15 -48
- package/dist/codemods/redwood/v6.x.x/convertJsToJsx/convertJsToJsx.js +5 -35
- package/dist/codemods/redwood/v6.x.x/convertJsToJsx/convertJsToJsx.yargs.js +10 -46
- package/dist/codemods/redwood/v6.x.x/entryClientNullCheck/entryClientNullCheck.js +3 -23
- package/dist/codemods/redwood/v6.x.x/entryClientNullCheck/entryClientNullCheck.yargs.js +12 -48
- package/dist/codemods/redwood/v6.x.x/processEnvDotNotation/processEnvDotNotation.js +3 -23
- package/dist/codemods/redwood/v6.x.x/processEnvDotNotation/processEnvDotNotation.yargs.js +12 -48
- package/dist/codemods/redwood/v6.x.x/replaceComponentSvgs/replaceComponentSvgs.js +20 -50
- package/dist/codemods/redwood/v6.x.x/replaceComponentSvgs/replaceComponentSvgs.yargs.js +12 -48
- package/dist/codemods/redwood/v6.x.x/updateDevFatalErrorPage/updateDevFatalErrorPage.js +15 -49
- package/dist/codemods/redwood/v6.x.x/updateDevFatalErrorPage/updateDevFatalErrorPage.yargs.js +6 -42
- package/dist/codemods/redwood/v6.x.x/updateThemeConfig/updateThemeConfig.js +3 -23
- package/dist/codemods/redwood/v6.x.x/updateThemeConfig/updateThemeConfig.yargs.js +12 -48
- package/dist/codemods/redwood/v7.x.x/updateGraphQLConfig/updateGraphqlConfig.js +8 -42
- package/dist/codemods/redwood/v7.x.x/updateGraphQLConfig/updateGraphqlConfig.yargs.js +6 -42
- package/dist/codemods/v2.3.x/moveGeneratorTemplates/moveGeneratorTemplates.js +15 -45
- package/dist/codemods/v2.3.x/moveGeneratorTemplates/moveGeneratorTemplates.yargs.js +6 -42
- package/dist/codemods/v2.7.x/prismaV7Prep/prismaV7Prep.js +25 -57
- package/dist/codemods/v2.7.x/prismaV7Prep/prismaV7Prep.yargs.js +62 -80
- package/dist/codemods.js +24 -46
- package/dist/lib/cells.js +33 -75
- package/dist/lib/fetchFileFromTemplate.js +5 -25
- package/dist/lib/getFilesWithPattern.js +6 -36
- package/dist/lib/getRootPackageJSON.js +8 -38
- package/dist/lib/isTSProject.js +6 -36
- package/dist/lib/prettify.js +12 -42
- package/dist/lib/runTransform.js +4 -38
- package/dist/lib/ts2js.js +9 -39
- package/package.json +9 -9
|
@@ -1,52 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var useArmor_yargs_exports = {};
|
|
30
|
-
__export(useArmor_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(useArmor_yargs_exports);
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
38
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
39
|
-
var import_isTSProject = __toESM(require("../../../../lib/isTSProject"));
|
|
40
|
-
var import_runTransform = __toESM(require("../../../../lib/runTransform"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import task from "tasuku";
|
|
3
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
+
import isTSProject from "../../../../lib/isTSProject.js";
|
|
5
|
+
import runTransform from "../../../../lib/runTransform.js";
|
|
41
6
|
const command = "use-armor";
|
|
42
7
|
const description = "(v4.x.x->v4.x.x) Updates createGraphQLHandler config to use GraphQL Armor config as needed";
|
|
43
8
|
const handler = () => {
|
|
44
|
-
(
|
|
45
|
-
const graphqlHandlerFile =
|
|
46
|
-
await (
|
|
47
|
-
transformPath:
|
|
9
|
+
task("Use Armor", async ({ setOutput }) => {
|
|
10
|
+
const graphqlHandlerFile = isTSProject ? "graphql.ts" : "graphql.js";
|
|
11
|
+
await runTransform({
|
|
12
|
+
transformPath: path.join(import.meta.dirname, "useArmor.js"),
|
|
48
13
|
targetPaths: [
|
|
49
|
-
|
|
14
|
+
path.join(getPaths().api.base, "src", "functions", graphqlHandlerFile)
|
|
50
15
|
]
|
|
51
16
|
});
|
|
52
17
|
setOutput(
|
|
@@ -54,9 +19,8 @@ const handler = () => {
|
|
|
54
19
|
);
|
|
55
20
|
});
|
|
56
21
|
};
|
|
57
|
-
|
|
58
|
-
0 && (module.exports = {
|
|
22
|
+
export {
|
|
59
23
|
command,
|
|
60
24
|
description,
|
|
61
25
|
handler
|
|
62
|
-
}
|
|
26
|
+
};
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var cellQueryResult_exports = {};
|
|
20
|
-
__export(cellQueryResult_exports, {
|
|
21
|
-
default: () => transform
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(cellQueryResult_exports);
|
|
24
1
|
const cellFunctionsToCheck = ["Success", "Failure", "Loading", "Empty"];
|
|
25
2
|
const nonSpreadVariables = [
|
|
26
3
|
"previousData",
|
|
@@ -108,3 +85,6 @@ function transform(file, api) {
|
|
|
108
85
|
lineTerminator: "\n"
|
|
109
86
|
});
|
|
110
87
|
}
|
|
88
|
+
export {
|
|
89
|
+
transform as default
|
|
90
|
+
};
|
|
@@ -1,58 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var cellQueryResult_yargs_exports = {};
|
|
30
|
-
__export(cellQueryResult_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(cellQueryResult_yargs_exports);
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
38
|
-
var import_cells = require("../../../../lib/cells");
|
|
39
|
-
var import_runTransform = __toESM(require("../../../../lib/runTransform"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import task from "tasuku";
|
|
3
|
+
import { findCells } from "../../../../lib/cells.js";
|
|
4
|
+
import runTransform from "../../../../lib/runTransform.js";
|
|
40
5
|
const command = "cell-query-result";
|
|
41
6
|
const description = "(v4.x.x->v5.x.x) Updates cells to use the `queryResult` property";
|
|
42
7
|
const handler = () => {
|
|
43
|
-
(
|
|
44
|
-
await (
|
|
45
|
-
transformPath:
|
|
46
|
-
targetPaths:
|
|
8
|
+
task("cellQueryResult", async ({ setOutput }) => {
|
|
9
|
+
await runTransform({
|
|
10
|
+
transformPath: path.join(import.meta.dirname, "cellQueryResult.js"),
|
|
11
|
+
targetPaths: findCells()
|
|
47
12
|
});
|
|
48
13
|
setOutput(
|
|
49
14
|
"Updates to your cells are complete! Please run `yarn cedar lint --fix` to prettify your code"
|
|
50
15
|
);
|
|
51
16
|
});
|
|
52
17
|
};
|
|
53
|
-
|
|
54
|
-
0 && (module.exports = {
|
|
18
|
+
export {
|
|
55
19
|
command,
|
|
56
20
|
description,
|
|
57
21
|
handler
|
|
58
|
-
}
|
|
22
|
+
};
|
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var detectEmptyCells_exports = {};
|
|
20
|
-
__export(detectEmptyCells_exports, {
|
|
21
|
-
detectEmptyCells: () => detectEmptyCells
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(detectEmptyCells_exports);
|
|
24
|
-
var import_cells = require("../../../../lib/cells");
|
|
1
|
+
import {
|
|
2
|
+
findCells,
|
|
3
|
+
fileToAst,
|
|
4
|
+
getCellGqlQuery,
|
|
5
|
+
parseGqlQueryToAst
|
|
6
|
+
} from "../../../../lib/cells.js";
|
|
25
7
|
async function detectEmptyCells(taskContext) {
|
|
26
8
|
const warnings = [];
|
|
27
|
-
const cellPaths =
|
|
9
|
+
const cellPaths = findCells();
|
|
28
10
|
const susceptibleCells = cellPaths.filter((cellPath) => {
|
|
29
|
-
const fileContents =
|
|
30
|
-
const cellQuery =
|
|
11
|
+
const fileContents = fileToAst(cellPath);
|
|
12
|
+
const cellQuery = getCellGqlQuery(fileContents);
|
|
31
13
|
if (!cellQuery) {
|
|
32
14
|
return false;
|
|
33
15
|
}
|
|
34
16
|
let fields;
|
|
35
17
|
try {
|
|
36
|
-
fields =
|
|
18
|
+
fields = parseGqlQueryToAst(cellQuery)[0].fields;
|
|
37
19
|
} catch {
|
|
38
20
|
warnings.push(cellPath);
|
|
39
21
|
return;
|
|
@@ -82,7 +64,6 @@ async function detectEmptyCells(taskContext) {
|
|
|
82
64
|
const taskContextMethod = warnings.length > 0 ? "setWarning" : "setOutput";
|
|
83
65
|
taskContext[taskContextMethod](message.join("\n"));
|
|
84
66
|
}
|
|
85
|
-
|
|
86
|
-
0 && (module.exports = {
|
|
67
|
+
export {
|
|
87
68
|
detectEmptyCells
|
|
88
|
-
}
|
|
69
|
+
};
|
|
@@ -1,48 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var detectEmptyCells_yargs_exports = {};
|
|
30
|
-
__export(detectEmptyCells_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(detectEmptyCells_yargs_exports);
|
|
36
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
37
|
-
var import_detectEmptyCells = require("./detectEmptyCells");
|
|
1
|
+
import task from "tasuku";
|
|
2
|
+
import { detectEmptyCells } from "./detectEmptyCells.js";
|
|
38
3
|
const command = "detect-empty-cells";
|
|
39
4
|
const description = "(v4.x.x->v5.x.x) Detects Cells susceptible to the new Empty behavior";
|
|
40
5
|
const handler = () => {
|
|
41
|
-
(
|
|
6
|
+
task(
|
|
42
7
|
"Detecting Cells susceptible to the new Empty behavior",
|
|
43
8
|
async (taskContext) => {
|
|
44
9
|
try {
|
|
45
|
-
await
|
|
10
|
+
await detectEmptyCells(taskContext);
|
|
46
11
|
} catch (e) {
|
|
47
12
|
taskContext.setError(
|
|
48
13
|
"Failed to detect cells susceptible to the new Empty behavior in your project \n" + e?.message
|
|
@@ -51,9 +16,8 @@ const handler = () => {
|
|
|
51
16
|
}
|
|
52
17
|
);
|
|
53
18
|
};
|
|
54
|
-
|
|
55
|
-
0 && (module.exports = {
|
|
19
|
+
export {
|
|
56
20
|
command,
|
|
57
21
|
description,
|
|
58
22
|
handler
|
|
59
|
-
}
|
|
23
|
+
};
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var renameValidateWith_exports = {};
|
|
20
|
-
__export(renameValidateWith_exports, {
|
|
21
|
-
default: () => transform
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(renameValidateWith_exports);
|
|
24
1
|
function transform(file, api) {
|
|
25
2
|
const j = api.jscodeshift;
|
|
26
3
|
const root = j(file.source);
|
|
@@ -30,3 +7,6 @@ function transform(file, api) {
|
|
|
30
7
|
}).replaceWith({ type: "Identifier", name: "validateWithSync" });
|
|
31
8
|
return root.toSource();
|
|
32
9
|
}
|
|
10
|
+
export {
|
|
11
|
+
transform as default
|
|
12
|
+
};
|
|
@@ -1,65 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var renameValidateWith_yargs_exports = {};
|
|
30
|
-
__export(renameValidateWith_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(renameValidateWith_yargs_exports);
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
38
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
39
|
-
var import_getFilesWithPattern = __toESM(require("../../../../lib/getFilesWithPattern"));
|
|
40
|
-
var import_runTransform = __toESM(require("../../../../lib/runTransform"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import task from "tasuku";
|
|
3
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
+
import getFilesWithPattern from "../../../../lib/getFilesWithPattern.js";
|
|
5
|
+
import runTransform from "../../../../lib/runTransform.js";
|
|
41
6
|
const command = "rename-validate-with";
|
|
42
7
|
const description = "(v4.x.x->v5.x.x) Renames validateWith to validateWithSync";
|
|
43
8
|
const handler = () => {
|
|
44
|
-
(
|
|
9
|
+
task(
|
|
45
10
|
"Renaming `validateWith` to `validateWithSync`",
|
|
46
11
|
async ({ setOutput }) => {
|
|
47
|
-
const redwoodProjectPaths =
|
|
48
|
-
const files = (
|
|
12
|
+
const redwoodProjectPaths = getPaths();
|
|
13
|
+
const files = getFilesWithPattern({
|
|
49
14
|
pattern: "validateWith",
|
|
50
15
|
filesToSearch: [redwoodProjectPaths.api.src]
|
|
51
16
|
});
|
|
52
|
-
await (
|
|
53
|
-
transformPath:
|
|
17
|
+
await runTransform({
|
|
18
|
+
transformPath: path.join(import.meta.dirname, "renameValidateWith.js"),
|
|
54
19
|
targetPaths: files
|
|
55
20
|
});
|
|
56
21
|
setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
|
|
57
22
|
}
|
|
58
23
|
);
|
|
59
24
|
};
|
|
60
|
-
|
|
61
|
-
0 && (module.exports = {
|
|
25
|
+
export {
|
|
62
26
|
command,
|
|
63
27
|
description,
|
|
64
28
|
handler
|
|
65
|
-
}
|
|
29
|
+
};
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var updateAuth0ToV2_exports = {};
|
|
20
|
-
__export(updateAuth0ToV2_exports, {
|
|
21
|
-
default: () => transform
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(updateAuth0ToV2_exports);
|
|
24
1
|
function transform(file, api) {
|
|
25
2
|
const j = api.jscodeshift;
|
|
26
3
|
const ast = j(file.source);
|
|
@@ -46,3 +23,6 @@ function transform(file, api) {
|
|
|
46
23
|
lineTerminator: "\n"
|
|
47
24
|
});
|
|
48
25
|
}
|
|
26
|
+
export {
|
|
27
|
+
transform as default
|
|
28
|
+
};
|
|
@@ -1,68 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var updateAuth0ToV2_yargs_exports = {};
|
|
30
|
-
__export(updateAuth0ToV2_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(updateAuth0ToV2_yargs_exports);
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
var import_execa = __toESM(require("execa"));
|
|
38
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
39
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
40
|
-
var import_isTSProject = __toESM(require("../../../../lib/isTSProject"));
|
|
41
|
-
var import_runTransform = __toESM(require("../../../../lib/runTransform"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import execa from "execa";
|
|
3
|
+
import task from "tasuku";
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
5
|
+
import isTSProject from "../../../../lib/isTSProject.js";
|
|
6
|
+
import runTransform from "../../../../lib/runTransform.js";
|
|
42
7
|
const command = "update-auth0-to-v2";
|
|
43
8
|
const description = "(v4.x.x->v5.x.x) Updates the web-side auth.{ts,js} file to the v2 SDK";
|
|
44
9
|
const handler = () => {
|
|
45
|
-
(
|
|
46
|
-
const authFile =
|
|
10
|
+
task("Updating Auth0 to v2", async ({ setOutput }) => {
|
|
11
|
+
const authFile = isTSProject ? "auth.ts" : "auth.js";
|
|
47
12
|
try {
|
|
48
|
-
await
|
|
49
|
-
cwd:
|
|
13
|
+
await execa.command("yarn up @auth0/auth0-spa-js@^2", {
|
|
14
|
+
cwd: getPaths().web.base
|
|
50
15
|
});
|
|
51
16
|
} catch {
|
|
52
17
|
console.error(
|
|
53
18
|
"Couldn't update @auth0/auth0-spa-js; you'll have to upgrade it manually to the latest v2.x.x version"
|
|
54
19
|
);
|
|
55
20
|
}
|
|
56
|
-
await (
|
|
57
|
-
transformPath:
|
|
58
|
-
targetPaths: [
|
|
21
|
+
await runTransform({
|
|
22
|
+
transformPath: path.join(import.meta.dirname, "updateAuth0ToV2.js"),
|
|
23
|
+
targetPaths: [path.join(getPaths().web.src, authFile)]
|
|
59
24
|
});
|
|
60
25
|
setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
|
|
61
26
|
});
|
|
62
27
|
};
|
|
63
|
-
|
|
64
|
-
0 && (module.exports = {
|
|
28
|
+
export {
|
|
65
29
|
command,
|
|
66
30
|
description,
|
|
67
31
|
handler
|
|
68
|
-
}
|
|
32
|
+
};
|
|
@@ -1,46 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var updateNodeEngineTo18_exports = {};
|
|
30
|
-
__export(updateNodeEngineTo18_exports, {
|
|
31
|
-
updateNodeEngineTo18: () => updateNodeEngineTo18
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(updateNodeEngineTo18_exports);
|
|
34
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
35
|
-
var import_path = __toESM(require("path"));
|
|
36
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
37
4
|
async function updateNodeEngineTo18() {
|
|
38
|
-
const packageJSONPath =
|
|
39
|
-
const packageJSON = JSON.parse(
|
|
5
|
+
const packageJSONPath = path.join(getPaths().base, "package.json");
|
|
6
|
+
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, "utf-8"));
|
|
40
7
|
packageJSON.engines.node = "=18.x";
|
|
41
|
-
|
|
8
|
+
fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, 2));
|
|
42
9
|
}
|
|
43
|
-
|
|
44
|
-
0 && (module.exports = {
|
|
10
|
+
export {
|
|
45
11
|
updateNodeEngineTo18
|
|
46
|
-
}
|
|
12
|
+
};
|
|
@@ -1,57 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var updateNodeEngineTo18_yargs_exports = {};
|
|
30
|
-
__export(updateNodeEngineTo18_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(updateNodeEngineTo18_yargs_exports);
|
|
36
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
37
|
-
var import_updateNodeEngineTo18 = require("./updateNodeEngineTo18");
|
|
1
|
+
import task from "tasuku";
|
|
2
|
+
import { updateNodeEngineTo18 } from "./updateNodeEngineTo18.js";
|
|
38
3
|
const command = "update-node-engine-to-18";
|
|
39
4
|
const description = '(v4.x.x->v5.x.x) Updates `engines.node` to `"=18.x"` in your project\'s root package.json';
|
|
40
5
|
const handler = () => {
|
|
41
|
-
(
|
|
6
|
+
task(
|
|
42
7
|
'Updating `engines.node` to `"=18.x"` in root package.json',
|
|
43
8
|
async ({ setError }) => {
|
|
44
9
|
try {
|
|
45
|
-
await
|
|
10
|
+
await updateNodeEngineTo18();
|
|
46
11
|
} catch (e) {
|
|
47
12
|
setError("Failed to codemod your project \n" + e?.message);
|
|
48
13
|
}
|
|
49
14
|
}
|
|
50
15
|
);
|
|
51
16
|
};
|
|
52
|
-
|
|
53
|
-
0 && (module.exports = {
|
|
17
|
+
export {
|
|
54
18
|
command,
|
|
55
19
|
description,
|
|
56
20
|
handler
|
|
57
|
-
}
|
|
21
|
+
};
|