Skip to content

Commit

Permalink
Cross OS compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Sep 19, 2023
1 parent 591e4bc commit 9184a70
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"license": "MIT",
"private": true,
"scripts": {
"start": "ts-node ./src/index.ts"
"start": "concurrently \"npx @envy/browser\" \"ts-node ./src/index.ts\""
},
"dependencies": {
"@apollo/server": "^4.9.3",
"@envy/browser": "*",
"@envy/node": "*",
"@sanity/client": "^4.0.1",
"apollo-utilities": "^1.3.4",
Expand Down
5 changes: 3 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"src/index.html"
],
"bin": {
"browser": "bin/start.cjs"
"envy": "bin/start.cjs"
},
"type": "module",
"repository": "https://github.com/FormidableLabs/envy.git",
Expand All @@ -16,7 +16,7 @@
"test": "jest",
"prebuild": "rimraf dist && rimraf bin",
"build": "yarn build:parcel && yarn build:scripts",
"build:parcel": "NODE_ENV=production parcel build --no-cache",
"build:parcel": "cross-env NODE_ENV=production parcel build --no-cache",
"build:scripts": "copyfiles --flat ./src/scripts/start.cjs ./src/scripts/startCollector.cjs ./src/scripts/startViewer.cjs ./bin",
"lint": "tsc --noEmit && eslint ./src --ext .ts,.tsx"
},
Expand Down Expand Up @@ -47,6 +47,7 @@
"autoprefixer": "^10.4.15",
"buffer": "^5.5.0||^6.0.0",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
"crypto-browserify": "^3.12.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/browser/src/scripts/startViewer.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ const argv = require('yargs-parser')(process.argv.slice(2));

const port = argv.viewerPort || 9998;

const root = path.resolve(__dirname, '../dist');
const root = path.resolve(__dirname, '..', 'dist');
servor({
root,
fallback: 'index.html',
port: port,
reload: false,
}).then(() => {
// eslint-disable-next-line no-console
console.log(chalk.cyan(`🚀 Envy web viewer started on http://localhost:${port}`));
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3803,6 +3803,13 @@ create-require@^1.1.0:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

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-fetch@^3.1.5:
version "3.1.8"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82"
Expand All @@ -3819,7 +3826,7 @@ cross-spawn@^5.1.0:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
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"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down

0 comments on commit 9184a70

Please sign in to comment.