Comments (9)
It works for local repositories, but only for projects in GOPATH. I plan to include support for Go Module projects soon.
from gocity.
@emmanuelay I see your fork at https://github.com/emmanuelay/gocity with the "local" subcommand added. But I can't for the life of me figure out how to build and run it. How were you building it? Here's what I'm doing:
git clone [email protected]:emmanuelay/gocity.git
cd gocity
git checkout front-end
make
git checkout master
go build
./gocity local
As far as I can tell, the yarn build stuff is working, but the go:embed stuff doesn't seem to be doing its job. I'm still getting the dreaded "Please inform a valid Github URL" message. When I look at the minified js, I still see the old if
statement there, without the "local" bits you added at https://github.com/emmanuelay/gocity/blob/4309562f60b68f0ff0e3c04e554933037a19f46c/src/App.js#L277, so obviously I'm missing something simple.
@rodrigo-brito I can't find any build procedure other than what's implied by the github workflow, Makefile, Dockerfile, and other hints. Am I doing the build above approximately right as far as you can tell?
The Go module support would be awesome.
from gocity.
Hi @stevegt, in a recent change we removed the dependency of GOPATH here e9221fe
We can make a small change now to provide this feature.
To open a local server with a public project, we can use gocity open <GITHUB_IMPORT>
To open the same server in a local project we can include support to the current dir in open
command. Something like this:
gocity open . # current dir
gocity open ./myfolder # subdirectory
from gocity.
@rodrigo-brito Being able to gocity open .
would be fantastic -- that was the first thing I tried. ;-) What would need to be changed, and do you need any help with that?
So far, I think part of the build problem I'm having with @emmanuelay's https://github.com/emmanuelay/gocity/blob/4309562f60b68f0ff0e3c04e554933037a19f46c has to do with the fact that the go build looks for assets under ./handle/assets, but the front-end Makefile leaves the built assets in ./build. It looks like that fork has a partially-implemented equivalent of #75 -- it already has the go:embed in there. @emmanuelay were you just manually copying from ./build to ./handle/assets, or am I still missing a build step?
from gocity.
You are correct, I'm copying the build versions manually from frontend
branch to ./handle/assets
. If you have a suggestion to keep in the main branch, it will help me a lot. The problem is: When we install the gocity
binary, all the assets must be inside the binary.
An alternative to it is:
- After publishing gocity frontend, we provide an online version of the JS Bundle. eg:
https://go-city.github.io/main.js
and - Instead of embedding the JS file, we only embed the index.html in which imports this file.
What you think?
from gocity.
Now, gociy open .
works.
Implemented here ff93c3e
from gocity.
Works! Looking through the diff, I can see that wasn't a small change. ;-) Thank you.
For the assets, I'd keep embedding them in the binary. Was there a good reason for putting all of the front-end stuff in a different branch, rather than in a subdirectory in the master branch?
For now, and if front-end does need to stay in a different branch, than I'd do something like this:
- have the front-end Makefile copy the assets into ./assets
- put ./assets in .gitignore in both branches
- have the master Makefile copy the assets from ./assets into ./handle/assets
Want me to give you a PR for that?
from gocity.
Was there a good reason for putting all of the front-end stuff in a different branch, rather than in a subdirectory in the master branch?
When we put the JS files in the master branch, Github recognizes the project as a JS Project instead of a Go Project.
Want me to give you a PR for that?
Thank you, but don't
I'm planning to remove React and Bulma and transform the front-end in a simple interface. Then I will include everything in a single and external asset.
from gocity.
I'm closing the issue.
I will track the demand of the embeded asset in another issue.
from gocity.
Related Issues (20)
- Installation fails HOT 3
- Create a test file for visitor.go HOT 4
- Create a test file for analyzer.go HOT 2
- Create a test file for fetch.go HOT 2
- Create a test file for cors.go HOT 2
- Create a test file for headers.go HOT 3
- Replace Packer by Pkger HOT 3
- Eliminate utils package HOT 5
- Update Dockerfile to Go 1.15
- Upgrade Github Actions
- Include Codecov in github actions HOT 3
- Remove Travis badge HOT 1
- Include github actions in frontend branch HOT 2
- Incluide WTC for dev environment
- private repos HOT 2
- can the website export city as png? HOT 1
- Replace Pkger with `go:embed` HOT 3
- How to stop rotation HOT 6
- cleanup and refactor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocity.