@cedarjs/codemods 2.7.1-next.0 → 2.7.1-next.34
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,44 +1,11 @@
|
|
|
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 replaceComponentSvgs_exports = {};
|
|
30
|
-
__export(replaceComponentSvgs_exports, {
|
|
31
|
-
default: () => transform
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(replaceComponentSvgs_exports);
|
|
34
|
-
var import_promises = __toESM(require("fs/promises"));
|
|
35
|
-
var import_path = __toESM(require("path"));
|
|
36
|
-
var import_core = require("@svgr/core");
|
|
37
|
-
var import_pascalcase = __toESM(require("pascalcase"));
|
|
38
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
1
|
+
import fs from "fs/promises";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { transform as svgrTransform } from "@svgr/core";
|
|
4
|
+
import pascalcase from "pascalcase";
|
|
5
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
39
6
|
async function convertSvgToReactComponent(svgFilePath, outputPath, componentName, typescript) {
|
|
40
|
-
const svgContents = await
|
|
41
|
-
const jsCode = await (
|
|
7
|
+
const svgContents = await fs.readFile(svgFilePath, "utf-8");
|
|
8
|
+
const jsCode = await svgrTransform(
|
|
42
9
|
svgContents,
|
|
43
10
|
{
|
|
44
11
|
jsxRuntime: "automatic",
|
|
@@ -49,7 +16,7 @@ async function convertSvgToReactComponent(svgFilePath, outputPath, componentName
|
|
|
49
16
|
componentName
|
|
50
17
|
}
|
|
51
18
|
);
|
|
52
|
-
await
|
|
19
|
+
await fs.writeFile(outputPath, jsCode);
|
|
53
20
|
console.log();
|
|
54
21
|
console.log(`SVG converted to React component: ${outputPath}`);
|
|
55
22
|
}
|
|
@@ -88,10 +55,10 @@ async function transform(file, api) {
|
|
|
88
55
|
if (!sourcePath) {
|
|
89
56
|
return;
|
|
90
57
|
}
|
|
91
|
-
const currentFolder =
|
|
92
|
-
let pathToSvgFile =
|
|
58
|
+
const currentFolder = path.dirname(file.path);
|
|
59
|
+
let pathToSvgFile = path.resolve(currentFolder, sourcePath);
|
|
93
60
|
if (sourcePath.startsWith("src/")) {
|
|
94
|
-
pathToSvgFile = sourcePath.replace("src/",
|
|
61
|
+
pathToSvgFile = sourcePath.replace("src/", getPaths().web.src + "/");
|
|
95
62
|
}
|
|
96
63
|
const svgsUsedAsComponent = root.findJSXElements(svgName);
|
|
97
64
|
const svgsUsedAsRenderProp = root.find(j.JSXExpressionContainer, {
|
|
@@ -120,14 +87,14 @@ async function transform(file, api) {
|
|
|
120
87
|
if (svgsToConvert.length > 0) {
|
|
121
88
|
await Promise.all(
|
|
122
89
|
svgsToConvert.map(async (svg) => {
|
|
123
|
-
const svgFileNameWithoutExtension =
|
|
90
|
+
const svgFileNameWithoutExtension = path.basename(
|
|
124
91
|
svg.filePath,
|
|
125
|
-
|
|
92
|
+
path.extname(svg.filePath)
|
|
126
93
|
);
|
|
127
|
-
const componentName = (
|
|
94
|
+
const componentName = pascalcase(svgFileNameWithoutExtension);
|
|
128
95
|
const newFileName = `${componentName}SVG`;
|
|
129
|
-
const outputPath =
|
|
130
|
-
|
|
96
|
+
const outputPath = path.join(
|
|
97
|
+
path.dirname(svg.filePath),
|
|
131
98
|
`${newFileName}.${isTS ? "tsx" : "jsx"}`
|
|
132
99
|
);
|
|
133
100
|
try {
|
|
@@ -144,7 +111,7 @@ async function transform(file, api) {
|
|
|
144
111
|
return;
|
|
145
112
|
}
|
|
146
113
|
svg.importSourcePath.value = svg.importSourcePath.value.replace(
|
|
147
|
-
`${svgFileNameWithoutExtension}${
|
|
114
|
+
`${svgFileNameWithoutExtension}${path.extname(svg.filePath)}`,
|
|
148
115
|
newFileName
|
|
149
116
|
);
|
|
150
117
|
})
|
|
@@ -152,3 +119,6 @@ async function transform(file, api) {
|
|
|
152
119
|
}
|
|
153
120
|
return root.toSource();
|
|
154
121
|
}
|
|
122
|
+
export {
|
|
123
|
+
transform as default
|
|
124
|
+
};
|
|
@@ -1,61 +1,25 @@
|
|
|
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 replaceComponentSvgs_yargs_exports = {};
|
|
30
|
-
__export(replaceComponentSvgs_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(replaceComponentSvgs_yargs_exports);
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
var import_fast_glob = __toESM(require("fast-glob"));
|
|
38
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
39
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
40
|
-
var import_runTransform = __toESM(require("../../../../lib/runTransform"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
import task from "tasuku";
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
5
|
+
import runTransform from "../../../../lib/runTransform.js";
|
|
41
6
|
const command = "replace-component-svgs";
|
|
42
7
|
const description = "(v5.x.x->v6.x.x) Converts imported SVGs used as components to React components";
|
|
43
8
|
const handler = () => {
|
|
44
|
-
(
|
|
45
|
-
const targetPaths =
|
|
46
|
-
cwd:
|
|
9
|
+
task("Replace Component Svgs", async ({ setOutput }) => {
|
|
10
|
+
const targetPaths = fg.sync("**/*.{js,jsx,tsx}", {
|
|
11
|
+
cwd: getPaths().web.src,
|
|
47
12
|
absolute: true
|
|
48
13
|
});
|
|
49
|
-
await (
|
|
50
|
-
transformPath:
|
|
14
|
+
await runTransform({
|
|
15
|
+
transformPath: path.join(import.meta.dirname, "replaceComponentSvgs.js"),
|
|
51
16
|
targetPaths
|
|
52
17
|
});
|
|
53
18
|
setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
|
|
54
19
|
});
|
|
55
20
|
};
|
|
56
|
-
|
|
57
|
-
0 && (module.exports = {
|
|
21
|
+
export {
|
|
58
22
|
command,
|
|
59
23
|
description,
|
|
60
24
|
handler
|
|
61
|
-
}
|
|
25
|
+
};
|
|
@@ -1,58 +1,24 @@
|
|
|
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 updateDevFatalErrorPage_exports = {};
|
|
30
|
-
__export(updateDevFatalErrorPage_exports, {
|
|
31
|
-
updateDevFatalErrorPage: () => updateDevFatalErrorPage
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(updateDevFatalErrorPage_exports);
|
|
34
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
35
|
-
var import_path = __toESM(require("path"));
|
|
36
|
-
var import_fetch = require("@whatwg-node/fetch");
|
|
37
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fetch } from "@whatwg-node/fetch";
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
38
5
|
const updateDevFatalErrorPage = async () => {
|
|
39
|
-
const rwPaths =
|
|
40
|
-
const webFatalErrorPagesDir =
|
|
41
|
-
const filename =
|
|
6
|
+
const rwPaths = getPaths();
|
|
7
|
+
const webFatalErrorPagesDir = path.join(rwPaths.web.pages, "FatalErrorPage");
|
|
8
|
+
const filename = path.join(webFatalErrorPagesDir, "FatalErrorPage");
|
|
42
9
|
const url = "https://raw.githubusercontent.com/cedarjs/cedar/aa89556781dddc4730d3c8605040dc63a1ba6c1a/packages/create-cedar-app/templates/ts/web/src/pages/FatalErrorPage/FatalErrorPage.tsx";
|
|
43
|
-
const isTsxPage =
|
|
44
|
-
|
|
10
|
+
const isTsxPage = fs.existsSync(
|
|
11
|
+
path.join(webFatalErrorPagesDir, "FatalErrorPage.tsx")
|
|
45
12
|
);
|
|
46
|
-
const isJsxPage =
|
|
47
|
-
|
|
13
|
+
const isJsxPage = fs.existsSync(
|
|
14
|
+
path.join(webFatalErrorPagesDir, "FatalErrorPage.jsx")
|
|
48
15
|
);
|
|
49
16
|
const ext = isTsxPage ? "tsx" : isJsxPage ? "jsx" : "js";
|
|
50
|
-
const res = await
|
|
17
|
+
const res = await fetch(url);
|
|
51
18
|
const text = await res.text();
|
|
52
19
|
const newFatalErrorPage = `${filename}.${ext}`;
|
|
53
|
-
|
|
20
|
+
fs.writeFileSync(newFatalErrorPage, text);
|
|
54
21
|
};
|
|
55
|
-
|
|
56
|
-
0 && (module.exports = {
|
|
22
|
+
export {
|
|
57
23
|
updateDevFatalErrorPage
|
|
58
|
-
}
|
|
24
|
+
};
|
package/dist/codemods/redwood/v6.x.x/updateDevFatalErrorPage/updateDevFatalErrorPage.yargs.js
CHANGED
|
@@ -1,50 +1,14 @@
|
|
|
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 updateDevFatalErrorPage_yargs_exports = {};
|
|
30
|
-
__export(updateDevFatalErrorPage_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(updateDevFatalErrorPage_yargs_exports);
|
|
36
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
37
|
-
var import_updateDevFatalErrorPage = require("./updateDevFatalErrorPage");
|
|
1
|
+
import task from "tasuku";
|
|
2
|
+
import { updateDevFatalErrorPage } from "./updateDevFatalErrorPage.js";
|
|
38
3
|
const command = "update-dev-fatal-error-page";
|
|
39
4
|
const description = "(v5.x.x->v6.x.x) Update Fatal Error Page with development version from the create-cedar-app template";
|
|
40
5
|
const handler = () => {
|
|
41
|
-
(
|
|
42
|
-
await
|
|
6
|
+
task("Update Fatal Error Page with regular import", async () => {
|
|
7
|
+
await updateDevFatalErrorPage();
|
|
43
8
|
});
|
|
44
9
|
};
|
|
45
|
-
|
|
46
|
-
0 && (module.exports = {
|
|
10
|
+
export {
|
|
47
11
|
command,
|
|
48
12
|
description,
|
|
49
13
|
handler
|
|
50
|
-
}
|
|
14
|
+
};
|
|
@@ -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 updateThemeConfig_exports = {};
|
|
20
|
-
__export(updateThemeConfig_exports, {
|
|
21
|
-
default: () => transform
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(updateThemeConfig_exports);
|
|
24
1
|
function transform(file, api) {
|
|
25
2
|
const j = api.jscodeshift;
|
|
26
3
|
const root = j(file.source);
|
|
@@ -49,3 +26,6 @@ function transform(file, api) {
|
|
|
49
26
|
});
|
|
50
27
|
return root.toSource();
|
|
51
28
|
}
|
|
29
|
+
export {
|
|
30
|
+
transform as default
|
|
31
|
+
};
|
|
@@ -1,61 +1,25 @@
|
|
|
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 updateThemeConfig_yargs_exports = {};
|
|
30
|
-
__export(updateThemeConfig_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(updateThemeConfig_yargs_exports);
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
var import_fast_glob = __toESM(require("fast-glob"));
|
|
38
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
39
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
40
|
-
var import_runTransform = __toESM(require("../../../../lib/runTransform"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
import task from "tasuku";
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
5
|
+
import runTransform from "../../../../lib/runTransform.js";
|
|
41
6
|
const command = "update-theme-config";
|
|
42
7
|
const description = "(v5.x.x->v6.x.x) Converts mantine and chakra UI configs to use ESM syntax";
|
|
43
8
|
const handler = () => {
|
|
44
|
-
(
|
|
45
|
-
const targetPaths =
|
|
46
|
-
cwd:
|
|
9
|
+
task("Update Theme Config", async ({ setOutput }) => {
|
|
10
|
+
const targetPaths = fg.sync("{chakra,mantine}.config.{js,jsx,tsx,ts}", {
|
|
11
|
+
cwd: getPaths().web.config,
|
|
47
12
|
absolute: true
|
|
48
13
|
});
|
|
49
|
-
await (
|
|
50
|
-
transformPath:
|
|
14
|
+
await runTransform({
|
|
15
|
+
transformPath: path.join(import.meta.dirname, "updateThemeConfig.js"),
|
|
51
16
|
targetPaths
|
|
52
17
|
});
|
|
53
18
|
setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
|
|
54
19
|
});
|
|
55
20
|
};
|
|
56
|
-
|
|
57
|
-
0 && (module.exports = {
|
|
21
|
+
export {
|
|
58
22
|
command,
|
|
59
23
|
description,
|
|
60
24
|
handler
|
|
61
|
-
}
|
|
25
|
+
};
|
|
@@ -1,48 +1,14 @@
|
|
|
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 updateGraphqlConfig_exports = {};
|
|
30
|
-
__export(updateGraphqlConfig_exports, {
|
|
31
|
-
updateGraphqlConfig: () => updateGraphqlConfig
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(updateGraphqlConfig_exports);
|
|
34
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
35
|
-
var import_path = __toESM(require("path"));
|
|
36
|
-
var import_fetch = require("@whatwg-node/fetch");
|
|
37
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fetch } from "@whatwg-node/fetch";
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
38
5
|
const updateGraphqlConfig = async () => {
|
|
39
|
-
const res = await
|
|
6
|
+
const res = await fetch(
|
|
40
7
|
"https://raw.githubusercontent.com/cedarjs/cedar/refs/tags/v0.4.0/packages/create-cedar-app/templates/ts/graphql.config.js"
|
|
41
8
|
);
|
|
42
9
|
const text = await res.text();
|
|
43
|
-
|
|
10
|
+
fs.writeFileSync(path.join(getPaths().base, "graphql.config.js"), text);
|
|
44
11
|
};
|
|
45
|
-
|
|
46
|
-
0 && (module.exports = {
|
|
12
|
+
export {
|
|
47
13
|
updateGraphqlConfig
|
|
48
|
-
}
|
|
14
|
+
};
|
|
@@ -1,50 +1,14 @@
|
|
|
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 updateGraphqlConfig_yargs_exports = {};
|
|
30
|
-
__export(updateGraphqlConfig_yargs_exports, {
|
|
31
|
-
command: () => command,
|
|
32
|
-
description: () => description,
|
|
33
|
-
handler: () => handler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(updateGraphqlConfig_yargs_exports);
|
|
36
|
-
var import_tasuku = __toESM(require("tasuku"));
|
|
37
|
-
var import_updateGraphqlConfig = require("./updateGraphqlConfig");
|
|
1
|
+
import task from "tasuku";
|
|
2
|
+
import { updateGraphqlConfig } from "./updateGraphqlConfig.js";
|
|
38
3
|
const command = "update-graphql-config";
|
|
39
4
|
const description = "(v6.x->v7.x) Update graphql.config.js from the create-cedar-app template";
|
|
40
5
|
const handler = () => {
|
|
41
|
-
(
|
|
42
|
-
await
|
|
6
|
+
task("Update root graphql.config.js file", async () => {
|
|
7
|
+
await updateGraphqlConfig();
|
|
43
8
|
});
|
|
44
9
|
};
|
|
45
|
-
|
|
46
|
-
0 && (module.exports = {
|
|
10
|
+
export {
|
|
47
11
|
command,
|
|
48
12
|
description,
|
|
49
13
|
handler
|
|
50
|
-
}
|
|
14
|
+
};
|
|
@@ -1,51 +1,21 @@
|
|
|
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 moveGeneratorTemplates_exports = {};
|
|
30
|
-
__export(moveGeneratorTemplates_exports, {
|
|
31
|
-
default: () => moveGeneratorTemplates_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(moveGeneratorTemplates_exports);
|
|
34
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
35
|
-
var import_node_path = __toESM(require("node:path"));
|
|
36
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
37
4
|
async function moveGeneratorTemplates() {
|
|
38
|
-
const apiGeneratorsOld =
|
|
39
|
-
const webGeneratorsOld =
|
|
40
|
-
const generatorsDir =
|
|
5
|
+
const apiGeneratorsOld = path.join(getPaths().api.base, "generators");
|
|
6
|
+
const webGeneratorsOld = path.join(getPaths().web.base, "generators");
|
|
7
|
+
const generatorsDir = path.join(getPaths().base, "generatorTemplates");
|
|
41
8
|
const move = (oldPath, newPath) => {
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
9
|
+
if (fs.existsSync(oldPath)) {
|
|
10
|
+
fs.mkdirSync(path.dirname(newPath), { recursive: true });
|
|
11
|
+
fs.cpSync(oldPath, newPath, { recursive: true });
|
|
12
|
+
fs.rmSync(oldPath, { recursive: true, force: true });
|
|
46
13
|
}
|
|
47
14
|
};
|
|
48
|
-
move(apiGeneratorsOld,
|
|
49
|
-
move(webGeneratorsOld,
|
|
15
|
+
move(apiGeneratorsOld, path.join(generatorsDir, "api"));
|
|
16
|
+
move(webGeneratorsOld, path.join(generatorsDir, "web"));
|
|
50
17
|
}
|
|
51
18
|
var moveGeneratorTemplates_default = moveGeneratorTemplates;
|
|
19
|
+
export {
|
|
20
|
+
moveGeneratorTemplates_default as default
|
|
21
|
+
};
|