diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..1458d8531 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Pear Desktop - Dev Container", + // Keep in sync with `.github/workflows/build.yml` + "image": "mcr.microsoft.com/devcontainers/typescript-node:24", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": {}, + "postCreateCommand": "pnpm install --frozen-lockfile" + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Configure tool-specific properties. + // "customizations": {}, + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7958e9685..674400d09 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ node_modules .idea .pnp.* +.pnpm-store .yarn/* !.yarn/patches !.yarn/plugins diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..7664c1f36 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node-terminal", + "name": "Run Script: dev (pear-desktop)", + "request": "launch", + "command": "pnpm run dev", + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index b9f79caf1..6c4a29540 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,10 @@ pnpm install --frozen-lockfile pnpm dev ``` +Instead of installing pnpm on your system, you can also use [devcontainers](https://containers.dev/). You can use devcontainers either as a development environment in VS Code, or as a way to easily build the project without installing dependencies on your host system. + +Note that this has it's own limitations (for example, GUI doesn't work on, at least some, Linux hosts). + ## Build your own plugins Using plugins, you can: @@ -279,6 +283,16 @@ export default createPlugin({ Builds the app for macOS, Linux, and Windows, using [electron-builder](https://github.com/electron-userland/electron-builder). +### Building in devcontainer + +1. Clone the repo; +2. Open the folder in VS Code; +3. Reopen in container when prompted; +4. Run `pnpm build` as above (choosing the desired target); +5. Collect the built files from the `dist` folder. + +Since devcontainer uses a mount for the workspace, the built files will be available on the host system as well. + ## Production Preview ```bash