Getting Started

Is there a manual or getting started guide? I can’t seem to even figure out how to open a folder to edit an existing project from VSCode, get npm modules installed, etc. etc.

Hi @Martinfink :wave:

We’re here to help. About opening an existing project from VSCode it depends how you share those files with your iOS device.

  • If you do so via Git then create a new project and tick the “Clone from repository” option. Follow the instructions and you should be able to fetch your Git repository and start from there.
  • If you do it via iCloud then create a new project and choose as directory the iCloud directory where the files you’re interested in are located.

Regarding npm modules, play.js will resolve and fetch the dependencies you have defined in your package.json file located at the root of your project. Just define your dependencies there and hit the “Play” button.

There’s few things also worth mentioning:

  • When running Node.js projects, an index.js file located at the root of the project will serve as entry point to your application.
  • When developing using an iPhone or iPad you need to keep in mind iOS sandboxing limitations. For instance: you cannot spawn child processes, read or write outside play.js documents directory, etc.

Hope that helps :slightly_smiling_face:

Great!. Thanks for the info. Perhaps in the future, adding an “Open Folder…” option with an indication that it will create the index.js entry point (or perhaps even copy the existing entry point to index.js) would be great. I just couldn’t figure out how to start…

Ok, now I can see what you mean with the sandbox limitation and no access to files outside the sandbox. Is there a way to “migrate” a project that lives on iCloud Drive (VSCode) and moves it all within the play.js sandbox? Is the only way from git or is there another way?

You can use the Files app iOS provides and copy that folder into “My iPad” > “play.js” > “apps” > HERE YOUR PROJECT ID > “src”