@kamaalio/codemod-kit 0.0.4 → 0.0.5

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,5 +11,5 @@ type RunCodemodOptions = {
11
11
  dry?: boolean;
12
12
  };
13
13
  export declare function runCodemods(codemods: Array<Codemod>, transformationPath: string, options?: RunCodemodOptions): Promise<Record<string, Array<Result<Modifications, Error>>>>;
14
- export declare function runCodemod(codemod: Codemod, transformationPath: string, globItems: Array<string>, options?: RunCodemodOptions): Promise<Array<Result<Modifications, Error>>>;
14
+ export declare function runCodemod(codemod: Codemod, transformationPath: string, options?: RunCodemodOptions): Promise<Array<Result<Modifications, Error>>>;
15
15
  export {};
package/dist/index.cjs CHANGED
@@ -63,17 +63,17 @@ function collectionIsEmpty(collection) {
63
63
  return 0 === getCollectionCount(collection);
64
64
  }
65
65
  async function runCodemods(codemods, transformationPath, options) {
66
+ const results = {};
67
+ for (const codemod of codemods)results[codemod.name] = await runCodemod(codemod, transformationPath, options);
68
+ return results;
69
+ }
70
+ async function runCodemod(codemod, transformationPath, options) {
71
+ const { hooks, log: enableLogging, dry: runInDryMode } = defaultedOptions(options);
66
72
  const globItems = await external_fast_glob_default().glob([
67
73
  '**/*'
68
74
  ], {
69
75
  cwd: transformationPath
70
76
  });
71
- const results = {};
72
- for (const codemod of codemods)results[codemod.name] = await runCodemod(codemod, transformationPath, globItems, options);
73
- return results;
74
- }
75
- async function runCodemod(codemod, transformationPath, globItems, options) {
76
- const { hooks, log: enableLogging, dry: runInDryMode } = defaultedOptions(options);
77
77
  const extensions = new Set(Array.from(codemod.languages).reduce((acc, language)=>{
78
78
  const mappedExtensions = LANG_TO_EXTENSIONS_MAPPING[language.toLowerCase()];
79
79
  if (null == mappedExtensions) return acc;
package/dist/index.js CHANGED
@@ -22,17 +22,17 @@ function collectionIsEmpty(collection) {
22
22
  return 0 === getCollectionCount(collection);
23
23
  }
24
24
  async function runCodemods(codemods, transformationPath, options) {
25
+ const results = {};
26
+ for (const codemod of codemods)results[codemod.name] = await runCodemod(codemod, transformationPath, options);
27
+ return results;
28
+ }
29
+ async function runCodemod(codemod, transformationPath, options) {
30
+ const { hooks, log: enableLogging, dry: runInDryMode } = defaultedOptions(options);
25
31
  const globItems = await fast_glob.glob([
26
32
  '**/*'
27
33
  ], {
28
34
  cwd: transformationPath
29
35
  });
30
- const results = {};
31
- for (const codemod of codemods)results[codemod.name] = await runCodemod(codemod, transformationPath, globItems, options);
32
- return results;
33
- }
34
- async function runCodemod(codemod, transformationPath, globItems, options) {
35
- const { hooks, log: enableLogging, dry: runInDryMode } = defaultedOptions(options);
36
36
  const extensions = new Set(Array.from(codemod.languages).reduce((acc, language)=>{
37
37
  const mappedExtensions = LANG_TO_EXTENSIONS_MAPPING[language.toLowerCase()];
38
38
  if (null == mappedExtensions) return acc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kamaalio/codemod-kit",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "author": "Kamaal Farah",
6
6
  "license": "MIT",