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 mode Exit fullscreen mode

admin-repository.ts

import { Admin } from './admin';

export class AdminRepository {
  admins: Admin[];
  createOneAdmin() {
    //null
  }
  updateOneAdmin() {
    //null
  }
  deleteOneAdmin() {
    //null
  }
  findManyAdmins() {
    //null
  }
}
Enter fullscreen mode Exit fullscreen mode

Command

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

New files:
my-company.ts

export class MyCompany {
  id: string;
}
Enter fullscreen mode Exit 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 mode Exit 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 mode Exit fullscreen mode

new-repository.ts

import { New } from './new';

export class NewRepository {
  news: New[];
  createOneNew() {
    //null
  }
  updateOneNew() {
    //null
  }
  deleteOneNew() {
    //null
  }
  findManyNews() {
    //null
  }
}
Enter fullscreen mode Exit fullscreen mode

Command

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

New files:
new-user.ts

export class NewUser {
  id: string;
}
Enter fullscreen mode Exit 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 mode Exit fullscreen mode

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

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay