Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/himanoa/dependencies-based-clone
https://github.com/himanoa/dependencies-based-clone
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/himanoa/dependencies-based-clone
- Owner: himanoa
- License: mit
- Created: 2023-09-23T03:55:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-07T03:34:47.000Z (about 1 year ago)
- Last Synced: 2024-12-08T21:41:43.648Z (25 days ago)
- Language: TypeScript
- Size: 251 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## dependencies-based-clone
A tool to clone TypeScript source files into a separate directory based on dependency relationships and rules.
### How to use
1. Initialize the configuration:
```bash
npx @himanoa/dependencies-based-clone init-config
```
2. Open dbc.config.json with your editor.
3. Define your copy rules:
- from: A regular expression that matches the source files you want to clone.
- to: The destination file name. You can use placeholders like $1 which will expand groups defined in the from regex.Example:
```json
{
"rules": [{
"from": "path/to/source/(.*)\.ts",
"to": "path/to/destination/$1.js"
}]
}
```4. Execute the clone:
```bash
npx @himanoa/dependencies-based-clone clone src/index.ts
```This will start from src/index.ts, resolve its imports, and recursively clone files based on your rules.