opral / inlang-message-sdk

0 stars 0 forks source link

`project.rename()` API #95

Open samuelstroschein opened 1 week ago

samuelstroschein commented 1 week ago

Context

Apps need a programmatic API to rename a project (see INLMC-102)

Proposal

Offer project.rename() as an API that renames the project file in the filesystem WITHOUT triggering a reload of the project. A reload of the project would lead to decreased UX.

Signature

type Rename = ({to : string}) => void | throw ProjectRenameError 
console.log(project.name())
>> foo

await project.rename({ to: "backend" })

console.log(project.name())
>> backend

await project.rename({ to: "frontend.inlang" })
>> 💥 throw ProjectRenameError("To must not end with the filextension")
jldec commented 1 week ago

related to MESDK-62 and MESDK-136