If you don’t get any better answers, mine is “create a new file and write it from scratch”. It’s not very much typing, and will get your eyes, mind, and fingers accustomed to what things should look like, which will help you spot anomalies quicker.
No, a PWA can be created with any js tool…Ionic, Angular, Stencil or plain js.
If you are creating your app with Ionic, Angular or Stencil and you want to use their shortcuts, then you need to stick with their conventions for generating services etc and use “ionic g” or “ng g” etc as appropriate.
Or, as @rapropos suggests, just create the required file and use the appropriate js code, you don’t need any other tools.
I suggest you do a course on PWA, there are several introductory videos on youtube…