Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

ILshat Khamitov
ILshat Khamitov

Posted on

Two updates to the rucken copy-paste utility

1) Add support correct generate new files path names

Original files
admin.ts

export class Admin {  id: string;}
Enter fullscreen modeExit fullscreen mode

admin-repository.ts

import { Admin } from './admin';export class AdminRepository {  admins: Admin[];  createOneAdmin() {    //null  }  updateOneAdmin() {    //null  }  deleteOneAdmin() {    //null  }  findManyAdmins() {    //null  }}
Enter fullscreen modeExit fullscreen mode

Command

npx -y rucken copy-paste --find=admin --replace=my-company --path=./libs/feature
Enter fullscreen modeExit fullscreen mode

New files:
my-company.ts

export class MyCompany {  id: string;}
Enter fullscreen modeExit fullscreen mode

my-company-repository.ts

import { MyCompany } from './my-company';export class MyCompanyRepository {  myCompanies: MyCompany[];  createOneMyCompany() {    //null  }  updateOneMyCompany() {    //null  }  deleteOneMyCompany() {    //null  }  findManyMyCompanies() {    //null  }}
Enter fullscreen modeExit fullscreen mode

2) Add support correct replace long text with two or more words, when word for find include in replace options

Original files
new.ts

export class New {  id: string;}
Enter fullscreen modeExit fullscreen mode

new-repository.ts

import { New } from './new';export class NewRepository {  news: New[];  createOneNew() {    //null  }  updateOneNew() {    //null  }  deleteOneNew() {    //null  }  findManyNews() {    //null  }}
Enter fullscreen modeExit fullscreen mode

Command

npx -y rucken copy-paste --find=new --replace=new-user --path=./libs/feature
Enter fullscreen modeExit fullscreen mode

New files:
new-user.ts

export class NewUser {  id: string;}
Enter fullscreen modeExit fullscreen mode

new-user-repository.ts

import { NewUser } from './new-user';export class NewUserRepository {  newUsers: NewUser[];  createOneNewUser() {    //null  }  updateOneNewUser() {    //null  }  deleteOneNewUser() {    //null  }  findManyNewUsers() {    //null  }}
Enter fullscreen modeExit fullscreen mode

https://www.npmjs.com/package/rucken

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Senior Full Stack Developer (Typescript + NestJS + Angular)
  • Location
    Ufa, Russia
  • Education
    Tomsk State University of Control Systems and Radioelectronics
  • Work
    Software Developer
  • Joined

More fromILshat Khamitov

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp