Skip to content

Commit d26dbe2

Browse files
Merge pull request #18 from codemod/simplify-project-structure
feat: simplify project structure and improve documentation
2 parents 36a5cb0 + 37311d7 commit d26dbe2

File tree

23 files changed

+38
-770
lines changed

23 files changed

+38
-770
lines changed

.editorconfig

Lines changed: 0 additions & 10 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 6 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
# Contributing
22

3-
Thank you for helping improve <ECOSYSTEM_NAME> codemods. This project provides automated migrations to help the community adopt new features and upgrade across breaking changes.
3+
Thanks for helping users adopt the latest features with your codemods!
44

5-
## How we work
5+
### Before You Open a PR
66

7-
- Propose: open an issue before large changes
8-
- Safety: codemods must be safe, predictable, idempotent
9-
- Tests: include multiple fixtures (positive/negative/idempotent)
10-
- Documentation: update per-recipe README and root docs
7+
- **Issue**: Check for an existing issue, or open one first.
8+
- **Safety**: Codemods must be safe, predictable, and idempotent (running twice should not change code again). Avoid mixing patterns with different safety levels.
9+
- **Naming**: In `codemod.yaml`, the codemod name must start with `@<scope>`, where `<scope>` is this repo's GitHub org.
10+
- **Tests**: Add multiple fixtures (positive and negative).
11+
- **Docs**: Update the README for your codemod.
1112

12-
For workflow structure and orchestration details, see: https://docs.codemod.com/cli/workflows
13+
### Development
1314

14-
## Getting started
15+
- Scaffold a new codemod:
16+
```bash
17+
npx codemod@latest init
18+
```
19+
- Test your codemod locally;
20+
```bash
21+
cd /path/to/sample/project
22+
npx codemod workflow run -w /path/to/my-codemod/workflow.yaml
23+
```
24+
### Project Layout
1525

16-
```bash
17-
npm install
18-
npm run lint
19-
npm run validate
20-
npm run typecheck
21-
npm run test
22-
```
26+
- Place all codemods in the `codemods/` directory.
2327

24-
## Scaffolding a new codemod
28+
### Checks
2529

26-
```bash
27-
npx codemod@latest init codemods/my-codemod
28-
```
30+
- Lint/format: npm run check (Biome)
31+
- Types: npm run typecheck
2932

30-
During prompts, select appropriate options for your use case. Placeholders to adapt:
31-
- Name: `@<NAMESPACE>/<MAJOR_VERSION>/<codemod-name>`
33+
### Pull Requests
3234

33-
## Commit messages
35+
- Describe the codemod and its migration use case.
36+
- Follow Conventional Commits:
3437

35-
Use Conventional Commits:
36-
- `feat(scope):` add a new codemod or capability
37-
- `fix(scope):` bugfixes in a transform or tests
38-
- `docs(scope):` docs-only changes
39-
- `refactor(scope):` code changes that neither fix a bug nor add a feature
40-
- `test(scope):` add or adjust fixtures/tests
41-
- `chore(scope):` tooling, CI, formatting, repo hygiene
38+
| Type | Usage |
39+
|----------|--------------------------------------|
40+
| feat | New codemod or capability |
41+
| fix | Bugfix in a transform or test |
42+
| docs | Documentation-only changes |
43+
| refactor | Non-feature, non-bugfix code changes |
44+
| test | Add or update fixtures/tests |
45+
| chore | Tooling, CI, formatting, repo hygiene|
4246

43-
## Security
47+
### License
4448

45-
See SECURITY.md and report privately.
46-
47-
## License
48-
49-
MIT
49+
By contributing, you agree that your work will be licensed under the MIT License.

SECURITY.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

codemods/shell-codemod/.gitignore

Lines changed: 0 additions & 33 deletions
This file was deleted.

codemods/shell-codemod/README.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

codemods/shell-codemod/codemod.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

codemods/shell-codemod/scripts/cleanup.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

codemods/shell-codemod/scripts/setup.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

codemods/shell-codemod/scripts/transform.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)