Skip to content

Commit

Permalink
Add cross-env (shx doesn't allow this)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr committed Jun 29, 2024
1 parent f7b7bae commit 3ddd5bf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 8 additions & 4 deletions desktop/docs/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ are similar to that in the web code.

Some extra ones specific to the code here are:

- [shx](https://github.com/shelljs/shx) for providing a portable way to use
Unix commands in our `package.json` scripts. This allows us to use the same
commands (like `ln`) across different platforms like Linux and Windows.

- [@tsconfig/recommended](https://github.com/tsconfig/bases) gives us a base
tsconfig for the Node.js version that our current Electron version uses.

- [shx](https://github.com/shelljs/shx) provides us a portable way to use Unix
commands in our `package.json` scripts. This allows us to use the same
commands (like `ln`) across both POSIX platforms (Linux, macOS) and Windows.

- [cross-env](https://github.com/kentcdodds/cross-env) is similar to shx, but
for allowing us to set environment variables in a way that also works on
Windows.

## Functionality

### Format conversion
Expand Down
5 changes: 3 additions & 2 deletions desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"build": "yarn build-renderer && yarn build-main",
"build-main": "tsc && electron-builder",
"build-main:quick": "tsc && electron-builder --dir --config.compression=store --config.mac.identity=null",
"build-renderer": "cd ../web && yarn install && yarn build:photos && cd ../desktop && shx rm -f out && shx ln -sf ../web/apps/photos/out out",
"build-renderer": "cross-env-shell _ENTE_IS_DESKTOP=1 \"cd ../web && yarn install && yarn build:photos && cd ../desktop && shx rm -f out && shx ln -sf ../web/apps/photos/out out\"",
"build:ci": "yarn build-renderer && tsc",
"build:quick": "yarn build-renderer && yarn build-main:quick",
"dev": "concurrently --kill-others --success first --names 'main,rndr' \"yarn dev-main\" \"yarn dev-renderer\"",
"dev-main": "tsc && electron .",
"dev-renderer": "cd ../web && yarn install && yarn dev:photos",
"dev-renderer": "cross-env-shell _ENTE_IS_DESKTOP=1 \"cd ../web && yarn install && yarn dev:photos\"",
"postinstall": "electron-builder install-app-deps",
"lint": "yarn prettier --check --log-level warn . && yarn eslint && yarn tsc",
"lint-fix": "yarn prettier --write --log-level warn . && yarn eslint && yarn tsc"
Expand Down Expand Up @@ -46,6 +46,7 @@
"@types/eslint__js": "^8.42.3",
"@types/ffmpeg-static": "^3.0",
"concurrently": "^8",
"cross-env": "^7.0.3",
"electron": "^30",
"electron-builder": "25.0.0-alpha.8",
"eslint": "^9.4.0",
Expand Down
7 changes: 7 additions & 0 deletions desktop/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,13 @@ crc@^3.8.0:
dependencies:
buffer "^5.1.0"

cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
Expand Down

0 comments on commit 3ddd5bf

Please sign in to comment.