@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.
Files changed (53) hide show
  1. package/dist/codemods/list.yargs.js +13 -47
  2. package/dist/codemods/redwood/v2.3.x/tsconfigForRouteHooks/tsconfigForRouteHooks.js +7 -37
  3. package/dist/codemods/redwood/v2.3.x/tsconfigForRouteHooks/tsconfigForRouteHooks.yargs.js +6 -42
  4. package/dist/codemods/redwood/v2.x.x/configureFastify/configureFastify.js +3 -23
  5. package/dist/codemods/redwood/v2.x.x/configureFastify/configureFastify.yargs.js +22 -58
  6. package/dist/codemods/redwood/v2.x.x/updateResolverTypes/updateResolverTypes.js +6 -26
  7. package/dist/codemods/redwood/v2.x.x/updateResolverTypes/updateResolverTypes.yargs.js +12 -48
  8. package/dist/codemods/redwood/v4.2.x/updateClerkGetCurrentUser/updateClerkGetCurrentUser.js +3 -23
  9. package/dist/codemods/redwood/v4.2.x/updateClerkGetCurrentUser/updateClerkGetCurrentUser.yargs.js +15 -48
  10. package/dist/codemods/redwood/v4.x.x/useArmor/useArmor.js +3 -23
  11. package/dist/codemods/redwood/v4.x.x/useArmor/useArmor.yargs.js +12 -48
  12. package/dist/codemods/redwood/v5.x.x/cellQueryResult/cellQueryResult.js +3 -23
  13. package/dist/codemods/redwood/v5.x.x/cellQueryResult/cellQueryResult.yargs.js +10 -46
  14. package/dist/codemods/redwood/v5.x.x/detectEmptyCells/detectEmptyCells.js +12 -31
  15. package/dist/codemods/redwood/v5.x.x/detectEmptyCells/detectEmptyCells.yargs.js +6 -42
  16. package/dist/codemods/redwood/v5.x.x/renameValidateWith/renameValidateWith.js +3 -23
  17. package/dist/codemods/redwood/v5.x.x/renameValidateWith/renameValidateWith.yargs.js +12 -48
  18. package/dist/codemods/redwood/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.js +3 -23
  19. package/dist/codemods/redwood/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.yargs.js +15 -51
  20. package/dist/codemods/redwood/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.js +8 -42
  21. package/dist/codemods/redwood/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.yargs.js +6 -42
  22. package/dist/codemods/redwood/v5.x.x/upgradeToReact18/upgradeToReact18.js +20 -56
  23. package/dist/codemods/redwood/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.js +14 -46
  24. package/dist/codemods/redwood/v6.x.x/changeGlobalToGlobalThis/changeGlobalToGlobalThis.js +3 -23
  25. package/dist/codemods/redwood/v6.x.x/changeGlobalToGlobalThis/changeGlobalToGlobalThis.yargs.js +15 -48
  26. package/dist/codemods/redwood/v6.x.x/convertJsToJsx/convertJsToJsx.js +5 -35
  27. package/dist/codemods/redwood/v6.x.x/convertJsToJsx/convertJsToJsx.yargs.js +10 -46
  28. package/dist/codemods/redwood/v6.x.x/entryClientNullCheck/entryClientNullCheck.js +3 -23
  29. package/dist/codemods/redwood/v6.x.x/entryClientNullCheck/entryClientNullCheck.yargs.js +12 -48
  30. package/dist/codemods/redwood/v6.x.x/processEnvDotNotation/processEnvDotNotation.js +3 -23
  31. package/dist/codemods/redwood/v6.x.x/processEnvDotNotation/processEnvDotNotation.yargs.js +12 -48
  32. package/dist/codemods/redwood/v6.x.x/replaceComponentSvgs/replaceComponentSvgs.js +20 -50
  33. package/dist/codemods/redwood/v6.x.x/replaceComponentSvgs/replaceComponentSvgs.yargs.js +12 -48
  34. package/dist/codemods/redwood/v6.x.x/updateDevFatalErrorPage/updateDevFatalErrorPage.js +15 -49
  35. package/dist/codemods/redwood/v6.x.x/updateDevFatalErrorPage/updateDevFatalErrorPage.yargs.js +6 -42
  36. package/dist/codemods/redwood/v6.x.x/updateThemeConfig/updateThemeConfig.js +3 -23
  37. package/dist/codemods/redwood/v6.x.x/updateThemeConfig/updateThemeConfig.yargs.js +12 -48
  38. package/dist/codemods/redwood/v7.x.x/updateGraphQLConfig/updateGraphqlConfig.js +8 -42
  39. package/dist/codemods/redwood/v7.x.x/updateGraphQLConfig/updateGraphqlConfig.yargs.js +6 -42
  40. package/dist/codemods/v2.3.x/moveGeneratorTemplates/moveGeneratorTemplates.js +15 -45
  41. package/dist/codemods/v2.3.x/moveGeneratorTemplates/moveGeneratorTemplates.yargs.js +6 -42
  42. package/dist/codemods/v2.7.x/prismaV7Prep/prismaV7Prep.js +25 -57
  43. package/dist/codemods/v2.7.x/prismaV7Prep/prismaV7Prep.yargs.js +62 -80
  44. package/dist/codemods.js +24 -46
  45. package/dist/lib/cells.js +33 -75
  46. package/dist/lib/fetchFileFromTemplate.js +5 -25
  47. package/dist/lib/getFilesWithPattern.js +6 -36
  48. package/dist/lib/getRootPackageJSON.js +8 -38
  49. package/dist/lib/isTSProject.js +6 -36
  50. package/dist/lib/prettify.js +12 -42
  51. package/dist/lib/runTransform.js +4 -38
  52. package/dist/lib/ts2js.js +9 -39
  53. package/package.json +9 -9
@@ -1,46 +1,11 @@
1
- "use strict";
2
- var __create = Object.create;
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 upgradeToReact18_exports = {};
30
- __export(upgradeToReact18_exports, {
31
- checkAndTransformReactRoot: () => checkAndTransformReactRoot,
32
- checkAndUpdateCustomWebIndex: () => checkAndUpdateCustomWebIndex,
33
- upgradeReactDepsTo18: () => upgradeReactDepsTo18
34
- });
35
- module.exports = __toCommonJS(upgradeToReact18_exports);
36
- var import_node_fs = __toESM(require("node:fs"));
37
- var import_path = __toESM(require("path"));
38
- var import_cheerio = require("cheerio");
39
- var import_execa = __toESM(require("execa"));
40
- var import_project_config = require("@cedarjs/project-config");
1
+ import fs from "node:fs";
2
+ import path from "path";
3
+ import { load } from "cheerio";
4
+ import execa from "execa";
5
+ import { getPaths } from "@cedarjs/project-config";
41
6
  function checkAndTransformReactRoot(taskContext) {
42
- const indexHTMLFilepath = import_path.default.join((0, import_project_config.getPaths)().web.src, "index.html");
43
- const indexHTML = (0, import_cheerio.load)(import_node_fs.default.readFileSync(indexHTMLFilepath, "utf-8"));
7
+ const indexHTMLFilepath = path.join(getPaths().web.src, "index.html");
8
+ const indexHTML = load(fs.readFileSync(indexHTMLFilepath, "utf-8"));
44
9
  const reactRoot = indexHTML("#redwood-app");
45
10
  const reactRootChildren = reactRoot.children();
46
11
  if (reactRootChildren.length) {
@@ -64,16 +29,16 @@ function checkAndTransformReactRoot(taskContext) {
64
29
  }
65
30
  indexHTML("body").append(reactRootChildren);
66
31
  reactRoot.text("");
67
- import_node_fs.default.writeFileSync(indexHTMLFilepath, indexHTML.html());
32
+ fs.writeFileSync(indexHTMLFilepath, indexHTML.html());
68
33
  }
69
34
  async function upgradeReactDepsTo18() {
70
- const redwoodProjectPaths = (0, import_project_config.getPaths)();
71
- const webPackageJSONPath = import_path.default.join(
35
+ const redwoodProjectPaths = getPaths();
36
+ const webPackageJSONPath = path.join(
72
37
  redwoodProjectPaths.web.base,
73
38
  "package.json"
74
39
  );
75
40
  const webPackageJSON = JSON.parse(
76
- import_node_fs.default.readFileSync(webPackageJSONPath, "utf-8")
41
+ fs.readFileSync(webPackageJSONPath, "utf-8")
77
42
  );
78
43
  const latestReactVersion = "18.2.0";
79
44
  for (const requiredReactDep of ["react", "react-dom"]) {
@@ -84,24 +49,24 @@ async function upgradeReactDepsTo18() {
84
49
  }
85
50
  webPackageJSON.dependencies[requiredReactDep] = latestReactVersion;
86
51
  }
87
- import_node_fs.default.writeFileSync(webPackageJSONPath, JSON.stringify(webPackageJSON, null, 2));
88
- await import_execa.default.command("yarn install", {
52
+ fs.writeFileSync(webPackageJSONPath, JSON.stringify(webPackageJSON, null, 2));
53
+ await execa.command("yarn install", {
89
54
  cwd: redwoodProjectPaths.base
90
55
  });
91
56
  }
92
57
  async function checkAndUpdateCustomWebIndex(taskContext) {
93
- const redwoodProjectPaths = (0, import_project_config.getPaths)();
58
+ const redwoodProjectPaths = getPaths();
94
59
  const bundlerToCustomWebIndex = {
95
- vite: import_path.default.join(redwoodProjectPaths.web.src, "entry-client.jsx"),
96
- webpack: import_path.default.join(redwoodProjectPaths.web.src, "index.js")
60
+ vite: path.join(redwoodProjectPaths.web.src, "entry-client.jsx"),
61
+ webpack: path.join(redwoodProjectPaths.web.src, "index.js")
97
62
  };
98
63
  const customWebIndexFound = Object.entries(bundlerToCustomWebIndex).find(
99
- ([, filepath]) => import_node_fs.default.existsSync(filepath)
64
+ ([, filepath]) => fs.existsSync(filepath)
100
65
  );
101
66
  if (!customWebIndexFound) {
102
67
  return;
103
68
  }
104
- import_node_fs.default.writeFileSync(customWebIndexFound[1], customWebIndexTemplate);
69
+ fs.writeFileSync(customWebIndexFound[1], customWebIndexTemplate);
105
70
  taskContext.setWarning(
106
71
  [
107
72
  `We updated the custom web index for you at ${customWebIndexFound[1]}.`,
@@ -127,9 +92,8 @@ if (redwoodAppElement.children?.length > 0) {
127
92
  root.render(<App />)
128
93
  }
129
94
  `;
130
- // Annotate the CommonJS export names for ESM import in node:
131
- 0 && (module.exports = {
95
+ export {
132
96
  checkAndTransformReactRoot,
133
97
  checkAndUpdateCustomWebIndex,
134
98
  upgradeReactDepsTo18
135
- });
99
+ };
@@ -1,56 +1,24 @@
1
- "use strict";
2
- var __create = Object.create;
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 upgradeToReact18_yargs_exports = {};
30
- __export(upgradeToReact18_yargs_exports, {
31
- command: () => command,
32
- description: () => description,
33
- handler: () => handler
34
- });
35
- module.exports = __toCommonJS(upgradeToReact18_yargs_exports);
36
- var import_tasuku = __toESM(require("tasuku"));
37
- var import_upgradeToReact18 = require("./upgradeToReact18");
1
+ import task from "tasuku";
2
+ import {
3
+ checkAndTransformReactRoot,
4
+ upgradeReactDepsTo18,
5
+ checkAndUpdateCustomWebIndex
6
+ } from "./upgradeToReact18.js";
38
7
  const command = "upgrade-to-react-18";
39
8
  const description = "(v4.x.x->v5.0.0) Upgrades a project to React 18 and checks the react root";
40
9
  const handler = () => {
41
- (0, import_tasuku.default)("Check and transform react root", async (taskContext) => {
42
- (0, import_upgradeToReact18.checkAndTransformReactRoot)(taskContext);
10
+ task("Check and transform react root", async (taskContext) => {
11
+ checkAndTransformReactRoot(taskContext);
43
12
  });
44
- (0, import_tasuku.default)("Check and update custom web index", async (taskContext) => {
45
- await (0, import_upgradeToReact18.checkAndUpdateCustomWebIndex)(taskContext);
13
+ task("Check and update custom web index", async (taskContext) => {
14
+ await checkAndUpdateCustomWebIndex(taskContext);
46
15
  });
47
- (0, import_tasuku.default)("Update react deps", async () => {
48
- await (0, import_upgradeToReact18.upgradeReactDepsTo18)();
16
+ task("Update react deps", async () => {
17
+ await upgradeReactDepsTo18();
49
18
  });
50
19
  };
51
- // Annotate the CommonJS export names for ESM import in node:
52
- 0 && (module.exports = {
20
+ export {
53
21
  command,
54
22
  description,
55
23
  handler
56
- });
24
+ };
@@ -1,29 +1,9 @@
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 changeGlobalToGlobalThis_exports = {};
20
- __export(changeGlobalToGlobalThis_exports, {
21
- default: () => transform
22
- });
23
- module.exports = __toCommonJS(changeGlobalToGlobalThis_exports);
24
1
  function transform(file, api) {
25
2
  const j = api.jscodeshift;
26
3
  const ast = j(file.source);
27
4
  ast.find(j.Identifier, { name: "global" }).replaceWith(j.identifier("globalThis"));
28
5
  return ast.toSource();
29
6
  }
7
+ export {
8
+ transform as default
9
+ };
@@ -1,60 +1,27 @@
1
- "use strict";
2
- var __create = Object.create;
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 changeGlobalToGlobalThis_yargs_exports = {};
30
- __export(changeGlobalToGlobalThis_yargs_exports, {
31
- command: () => command,
32
- description: () => description,
33
- handler: () => handler
34
- });
35
- module.exports = __toCommonJS(changeGlobalToGlobalThis_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 = "change-global-to-global-this";
42
7
  const description = "(v6.x.x->v6.x.x) Converts world to bazinga";
43
8
  const handler = () => {
44
- (0, import_tasuku.default)("Change Global To Global This", async ({ setOutput }) => {
45
- await (0, import_runTransform.default)({
46
- transformPath: import_path.default.join(__dirname, "changeGlobalToGlobalThis.js"),
47
- targetPaths: import_fast_glob.default.sync("**/*.{js,jsx,tsx}", {
48
- cwd: (0, import_project_config.getPaths)().web.src,
9
+ task("Change Global To Global This", async ({ setOutput }) => {
10
+ await runTransform({
11
+ transformPath: path.join(
12
+ import.meta.dirname,
13
+ "changeGlobalToGlobalThis.js"
14
+ ),
15
+ targetPaths: fg.sync("**/*.{js,jsx,tsx}", {
16
+ cwd: getPaths().web.src,
49
17
  absolute: true
50
18
  })
51
19
  });
52
20
  setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
53
21
  });
54
22
  };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
23
+ export {
57
24
  command,
58
25
  description,
59
26
  handler
60
- });
27
+ };
@@ -1,45 +1,15 @@
1
- "use strict";
2
- var __create = Object.create;
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 convertJsToJsx_exports = {};
30
- __export(convertJsToJsx_exports, {
31
- default: () => transform
32
- });
33
- module.exports = __toCommonJS(convertJsToJsx_exports);
34
- var import_node_fs = __toESM(require("node:fs"));
1
+ import fs from "node:fs";
35
2
  function transform(file, api) {
36
3
  const j = api.jscodeshift;
37
4
  const ast = j(file.source);
38
5
  const containsJSX = ast.find(j.JSXElement).length !== 0 || ast.find(j.JSXFragment).length !== 0 || ast.find(j.JSXText).length !== 0;
39
6
  if (containsJSX) {
40
- import_node_fs.default.renameSync(
7
+ fs.renameSync(
41
8
  file.path,
42
9
  file.path.substring(0, file.path.lastIndexOf(".")) + ".jsx"
43
10
  );
44
11
  }
45
12
  }
13
+ export {
14
+ transform as default
15
+ };
@@ -1,59 +1,23 @@
1
- "use strict";
2
- var __create = Object.create;
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 convertJsToJsx_yargs_exports = {};
30
- __export(convertJsToJsx_yargs_exports, {
31
- command: () => command,
32
- description: () => description,
33
- handler: () => handler
34
- });
35
- module.exports = __toCommonJS(convertJsToJsx_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_runTransform = __toESM(require("../../../../lib/runTransform"));
1
+ import path from "path";
2
+ import fg from "fast-glob";
3
+ import task from "tasuku";
4
+ import runTransform from "../../../../lib/runTransform.js";
40
5
  const command = "convert-js-to-jsx";
41
6
  const description = "(v5.x.x->v6.x.x) Converts web components from .js to .jsx";
42
7
  const handler = () => {
43
- (0, import_tasuku.default)("Convert Js To Jsx", async ({ setOutput }) => {
44
- await (0, import_runTransform.default)({
45
- transformPath: import_path.default.join(__dirname, "convertJsToJsx.js"),
8
+ task("Convert Js To Jsx", async ({ setOutput }) => {
9
+ await runTransform({
10
+ transformPath: path.join(import.meta.dirname, "convertJsToJsx.js"),
46
11
  // All files in web/src that are .js
47
- targetPaths: import_fast_glob.default.sync("web/src/**/*.js")
12
+ targetPaths: fg.sync("web/src/**/*.js")
48
13
  });
49
14
  setOutput(
50
15
  "All done! Your file contents have not been changed just the extension."
51
16
  );
52
17
  });
53
18
  };
54
- // Annotate the CommonJS export names for ESM import in node:
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 entryClientNullCheck_exports = {};
20
- __export(entryClientNullCheck_exports, {
21
- default: () => transform
22
- });
23
- module.exports = __toCommonJS(entryClientNullCheck_exports);
24
1
  function transform(file, api) {
25
2
  const j = api.jscodeshift;
26
3
  const ast = j(file.source);
@@ -49,3 +26,6 @@ function transform(file, api) {
49
26
  );
50
27
  return ast.toSource();
51
28
  }
29
+ export {
30
+ transform as default
31
+ };
@@ -1,60 +1,24 @@
1
- "use strict";
2
- var __create = Object.create;
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 entryClientNullCheck_yargs_exports = {};
30
- __export(entryClientNullCheck_yargs_exports, {
31
- command: () => command,
32
- description: () => description,
33
- handler: () => handler
34
- });
35
- module.exports = __toCommonJS(entryClientNullCheck_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 = "entry-client-null-check";
42
7
  const description = "(v6.x.x->v6.x.x) Converts world to bazinga";
43
8
  const handler = () => {
44
- (0, import_tasuku.default)("Entry Client Null Check", async ({ setOutput }) => {
45
- await (0, import_runTransform.default)({
46
- transformPath: import_path.default.join(__dirname, "entryClientNullCheck.js"),
47
- targetPaths: import_fast_glob.default.sync("entry.client.{jsx,tsx}", {
48
- cwd: (0, import_project_config.getPaths)().web.src,
9
+ task("Entry Client Null Check", async ({ setOutput }) => {
10
+ await runTransform({
11
+ transformPath: path.join(import.meta.dirname, "entryClientNullCheck.js"),
12
+ targetPaths: fg.sync("entry.client.{jsx,tsx}", {
13
+ cwd: getPaths().web.src,
49
14
  absolute: true
50
15
  })
51
16
  });
52
17
  setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
53
18
  });
54
19
  };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
20
+ export {
57
21
  command,
58
22
  description,
59
23
  handler
60
- });
24
+ };
@@ -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 processEnvDotNotation_exports = {};
20
- __export(processEnvDotNotation_exports, {
21
- default: () => transform
22
- });
23
- module.exports = __toCommonJS(processEnvDotNotation_exports);
24
1
  function transform(file, api) {
25
2
  const j = api.jscodeshift;
26
3
  const root = j(file.source);
@@ -42,3 +19,6 @@ function transform(file, api) {
42
19
  });
43
20
  return root.toSource();
44
21
  }
22
+ export {
23
+ transform as default
24
+ };
@@ -1,60 +1,24 @@
1
- "use strict";
2
- var __create = Object.create;
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 processEnvDotNotation_yargs_exports = {};
30
- __export(processEnvDotNotation_yargs_exports, {
31
- command: () => command,
32
- description: () => description,
33
- handler: () => handler
34
- });
35
- module.exports = __toCommonJS(processEnvDotNotation_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 = "process-env-dot-notation";
42
7
  const description = "(v6.x.x->v6.x.x) Converts world to bazinga";
43
8
  const handler = () => {
44
- (0, import_tasuku.default)("Process Env Dot Notation", async ({ setOutput }) => {
45
- await (0, import_runTransform.default)({
46
- transformPath: import_path.default.join(__dirname, "processEnvDotNotation.js"),
47
- targetPaths: import_fast_glob.default.sync("**/*.{js,jsx,tsx}", {
48
- cwd: (0, import_project_config.getPaths)().web.src,
9
+ task("Process Env Dot Notation", async ({ setOutput }) => {
10
+ await runTransform({
11
+ transformPath: path.join(import.meta.dirname, "processEnvDotNotation.js"),
12
+ targetPaths: fg.sync("**/*.{js,jsx,tsx}", {
13
+ cwd: getPaths().web.src,
49
14
  absolute: true
50
15
  })
51
16
  });
52
17
  setOutput("All done! Run `yarn cedar lint --fix` to prettify your code");
53
18
  });
54
19
  };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
20
+ export {
57
21
  command,
58
22
  description,
59
23
  handler
60
- });
24
+ };