@kamaalio/codemod-kit 0.0.9 → 0.0.11

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/README.md CHANGED
@@ -17,7 +17,6 @@ import type { CodeMod } from '@kamaalio/codemod-kit';
17
17
  const myCodemod: CodeMod = {
18
18
  name: 'my-codemod',
19
19
  languages: ['typescript'],
20
- commitMessage: 'feat(codemod): my first codemod',
21
20
  transformer: async (content, filename) => {
22
21
  // ... transform the content
23
22
  },
@@ -53,14 +52,12 @@ A codemod is defined by the `Codemod` type:
53
52
  export type Codemod = {
54
53
  name: string;
55
54
  languages: Set<NapiLang> | Array<NapiLang>;
56
- commitMessage: string;
57
55
  transformer: (content: SgRoot<TypesMap> | string, filename?: Optional<string>) => Promise<Modifications>;
58
56
  };
59
57
  ```
60
58
 
61
59
  - `name`: The name of the codemod.
62
60
  - `languages`: The languages the codemod applies to.
63
- - `commitMessage`: The commit message to use when applying the codemod.
64
61
  - `transformer`: The function that transforms the code.
65
62
 
66
63
  ### `Modifications`
@@ -5,7 +5,6 @@ import type { Optional } from '../utils/type-utils.js';
5
5
  export type Codemod = {
6
6
  name: string;
7
7
  languages: Set<NapiLang> | Array<NapiLang>;
8
- commitMessage: string;
9
8
  transformer: (content: SgRoot<TypesMap> | string, filename?: Optional<string>) => Promise<string>;
10
9
  };
11
10
  export type ModificationsReport = {
package/dist/index.cjs CHANGED
@@ -69,6 +69,7 @@ async function runCodemods(codemods, transformationPath, options) {
69
69
  }
70
70
  async function runCodemod(codemod, transformationPath, options) {
71
71
  const { hooks, log: enableLogging, dry: runInDryMode } = defaultedOptions(options);
72
+ await hooks.preCodemodRun(codemod);
72
73
  const globItems = await external_fast_glob_default().glob([
73
74
  '**/*'
74
75
  ], {
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ async function runCodemods(codemods, transformationPath, options) {
28
28
  }
29
29
  async function runCodemod(codemod, transformationPath, options) {
30
30
  const { hooks, log: enableLogging, dry: runInDryMode } = defaultedOptions(options);
31
+ await hooks.preCodemodRun(codemod);
31
32
  const globItems = await fast_glob.glob([
32
33
  '**/*'
33
34
  ], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kamaalio/codemod-kit",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "author": "Kamaal Farah",
6
6
  "license": "MIT",