bit icon indicating copy to clipboard operation
bit copied to clipboard

Added support for non root (home) deployment of bit-server #4923

Open pgangwani opened this issue 4 years ago • 4 comments

Fixes Issue

#4923

How to test

  1. Clone, checkout https://github.com/pgangwani/bit-server-static-public-path-issue
  2. Above repo represent setup where bit-server is not deploeyed on root / of the domain
  3. Make sure we setup bit locally with link name bit-local
# clone
git clone https://github.com/teambit/bit.git
cd bit

# install
rm -rf node_modules public/bit
bit install # this might take a long time
bit compile

# probably not needed:
# npm run build
# npm run build:types 
## OR
# npm run build:windows 

# one time registration
npm run dev-link bit-local
# OR
npm run dev-link:windows bd

# you will then be able to run:
bd -v
# output will be "last-tag 0.0.516"
# (unlike bit -v, which outputs "0.0.516"

# etc 
> ~/project/example-project$
bd start --rebuild
  1. Run npm run reproduce:issue
  2. Goto /bit-dev/ route and test the server with & without pushing components.

Proposed Changes

  • Need help on how to remove hardcoded values to be coming from configs
  • Test all use case
  • Review comments for sure

pgangwani avatar Oct 13 '21 14:10 pgangwani

very nice! need to

  • [ ] replace hard coded values with configuration (worst case I'll do it)
  • [ ] remove unrelated files (yarn.lock, prettiers)

KutnerUri avatar Oct 13 '21 14:10 KutnerUri

very nice! need to

  • [ ] replace hard coded values with configuration (worst case I'll do it)
  • [x] remove unrelated files (yarn.lock, prettiers)

Removed unrelated file. As discussed over slack, I really need to connect stuff. I could connect only static/ folder till now and was able to make changes in respective to files to make it work in /bit-dev/ route

pgangwani avatar Oct 13 '21 19:10 pgangwani

forwarded publicPath to graphql aspect and react-router aspect. Only left to deduce the basename for preview iframe, I need to think how to do that.

KutnerUri avatar Oct 17 '21 18:10 KutnerUri

forwarded publicPath to graphql aspect and react-router aspect. Only left to deduce the basename for preview iframe, I need to think how to do that.

Thanks @KutnerUri for interim update. Will checkout latest and test. Can you share the steps how can I test when I have just scope.json ?

pgangwani avatar Oct 18 '21 09:10 pgangwani