@cedarjs/codemods 6.0.0-canary.2623 → 6.0.0-canary.2625

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.
@@ -11,7 +11,7 @@ const handler = () => {
11
11
  async ({ setOutput }) => {
12
12
  const redwoodProjectPaths = getPaths();
13
13
  const files = getFilesWithPattern({
14
- pattern: "validateWith",
14
+ substring: "validateWith",
15
15
  filesToSearch: [redwoodProjectPaths.api.src]
16
16
  });
17
17
  await runTransform({
@@ -1,19 +1,34 @@
1
- import { rgPath } from "@vscode/ripgrep";
2
- import execa from "execa";
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
3
  const getFilesWithPattern = ({
4
- pattern,
4
+ substring,
5
5
  filesToSearch
6
6
  }) => {
7
- try {
8
- const { stdout } = execa.sync(rgPath, [
9
- "--files-with-matches",
10
- pattern,
11
- ...filesToSearch
12
- ]);
13
- return stdout.toString().split("\n");
14
- } catch {
15
- return [];
7
+ const found = [];
8
+ for (const root of filesToSearch) {
9
+ if (!fs.existsSync(root)) {
10
+ continue;
11
+ }
12
+ const entries = fs.globSync("**/*", {
13
+ cwd: root,
14
+ withFileTypes: true,
15
+ exclude: ["**/node_modules/**"]
16
+ });
17
+ for (const entry of entries) {
18
+ if (!entry.isFile()) {
19
+ continue;
20
+ }
21
+ const filePath = path.join(entry.parentPath, entry.name);
22
+ try {
23
+ const contents = fs.readFileSync(filePath, "utf8");
24
+ if (contents.includes(substring)) {
25
+ found.push(filePath);
26
+ }
27
+ } catch {
28
+ }
29
+ }
16
30
  }
31
+ return found;
17
32
  };
18
33
  var getFilesWithPattern_default = getFilesWithPattern;
19
34
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/codemods",
3
- "version": "6.0.0-canary.2623",
3
+ "version": "6.0.0-canary.2625",
4
4
  "description": "Codemods to ease upgrading a CedarJS Project",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,11 +29,10 @@
29
29
  "@babel/parser": "7.29.7",
30
30
  "@babel/plugin-transform-typescript": "^7.26.8",
31
31
  "@babel/traverse": "7.29.7",
32
- "@cedarjs/cli-helpers": "6.0.0-canary.2623",
33
- "@cedarjs/project-config": "6.0.0-canary.2623",
32
+ "@cedarjs/cli-helpers": "6.0.0-canary.2625",
33
+ "@cedarjs/project-config": "6.0.0-canary.2625",
34
34
  "@svgr/core": "8.1.0",
35
35
  "@svgr/plugin-jsx": "8.1.0",
36
- "@vscode/ripgrep": "1.17.1",
37
36
  "@whatwg-node/fetch": "0.10.13",
38
37
  "cheerio": "1.2.0",
39
38
  "deepmerge": "4.3.1",
@@ -48,7 +47,7 @@
48
47
  "yargs": "17.7.3"
49
48
  },
50
49
  "devDependencies": {
51
- "@cedarjs/framework-tools": "6.0.0-canary.2623",
50
+ "@cedarjs/framework-tools": "6.0.0-canary.2625",
52
51
  "@types/babel__core": "7.20.5",
53
52
  "@types/jscodeshift": "17.3.0",
54
53
  "@types/yargs": "17.0.35",