shaoshing / train Goto Github PK
View Code? Open in Web Editor NEWAsset Management for web app using Golang.
Asset Management for web app using Golang.
Does it make sense to add a Cache-Control header, or is there a way I can currently add one myself? Right now I'm serving my assets manually to be able to do this.
When train is executed when there are no CSS or no JS files, YUI compressor fails, and the error reporting is unclear:
YUI Compressor error:
...
panic: exit status 1
...
stacktraces, stacktraces everywhere!
suggested solution is to check for len() of []files, skip YUI if 0, and report.
I see that you are calling out to a node-sass binary for Sass compiling. Any interest in using a Go wrapper to libsass instead Wellington? I can PR the needed changes to make make the switch.
Has anyone been able to get this package to work with Beego?
I want you a typescript feature support.
How can one use Train with a CDN service? (Eg. S3 or Fastly).
Do we just have to point the AssetsUrl to the right location?
Could not compile sass:
Error generating source map: couldn't determine public URL for "assets/stylesheets/app.sass".
Without a public URL, there's nothing for the source map to link to.
Custom importers should define the #public_url method.
25655 2014/07/31 11:11:03 Failed to deliver asset
Could not compile sass:
Error generating source map: couldn't determine public URL for "assets/stylesheets/iphone.sass".
Without a public URL, there's nothing for the source map to link to.
Custom importers should define the #public_url method.
25655 2014/07/31 11:11:03 Failed to deliver asset
Could not compile sass:
Error generating source map: couldn't determine public URL for "assets/stylesheets/ipad.sass".
Without a public URL, there's nothing for the source map to link to.
Custom importers should define the #public_url method.
Each time when we start running the train package, and after it invoke interpreter package, it will start a ruby process and don't try to close it even after the train sever been shut down. That causes piling of ruby process.
I recently upgraded train to latest from a version that was at least a few months old. After the upgrade, javascript_tag
and stylesheet_tag
helpers appeared to be broken in production mode. Not sure if this is an issue with train or the way I am using train.
I was able to fix my issues by changing flag.StringVar(&outPath, "out", "./public", "")
in cmd.go
to flag.StringVar(&outPath, "out", "public", "")
. I think the ./
prefix was causing the strings.Replace
calls in WriteToManifest
to fail. Is this a bug with train or do you think there's something wrong with my local setup?
As a 2nd request, would you consider changing HasPublicAssets()
to look for public/assets/manifest.txt
instead of public/assets/
? This would be useful because I'm storing other files in public/assets
besides the files that train generates so I don't delete the entire folder when switching between development/production modes.
Thanks for your help and building this package. Keep up the good work!
When running the command generated by cmd package, it will panic if the public
folder is not existed.
It would be nice if it automatically create the public
when it is not exited, or at least suggest what to do in order to get train
work.
-> clean bundled assets
-> copy assets from assets
panic: exit status 1
goroutine 1 [running]:
main.copyAssets()
/Users/bom_d_van/Code/go/workspace/src/github.com/shaoshing/train/cmd/bundle.go:39 +0x1fd
main.main()
/Users/bom_d_van/Code/go/workspace/src/github.com/shaoshing/train/cmd/bundle.go:21 +0x1d
goroutine 2 [syscall]:
created by runtime.main
/usr/local/go/src/pkg/runtime/proc.c:221
goroutine 3 [syscall]:
syscall.Syscall6()
/usr/local/go/src/pkg/syscall/asm_darwin_amd64.s:38 +0x5
syscall.wait4(0x16057, 0xf84007d2a0, 0x0, 0xf840085750, 0x1, ...)
/usr/local/go/src/pkg/syscall/zsyscall_darwin_amd64.go:32 +0x81
syscall.Wait4(0x16057, 0x23dee1c, 0x0, 0xf840085750, 0x39006, ...)
/usr/local/go/src/pkg/syscall/syscall_bsd.go:136 +0x6a
os.(*Process).wait(0xf8400e45e0, 0xf84007d268, 0x0, 0x0, 0x392a8, ...)
/usr/local/go/src/pkg/os/exec_unix.go:22 +0xe1
os.(*Process).Wait(0xf8400e45e0, 0x0, 0x0, 0x23deef0)
/usr/local/go/src/pkg/os/doc.go:43 +0x25
os/exec.(*Cmd).Wait(0xf8400b3100, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/os/exec/exec.go:308 +0x1b7
os/exec.(*Cmd).Run(0xf8400b3100, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/os/exec/exec.go:232 +0x6d
github.com/shaoshing/train/interpreter._func_001(0xf840066600, 0x0)
/Users/bom_d_van/Code/go/workspace/src/github.com/shaoshing/train/interpreter/bridge.go:57 +0x29
created by github.com/shaoshing/train/interpreter.NewInterpreter
/Users/bom_d_van/Code/go/workspace/src/github.com/shaoshing/train/interpreter/bridge.go:61 +0x16b
goroutine 4 [syscall]:
syscall.Syscall()
/usr/local/go/src/pkg/syscall/asm_darwin_amd64.s:14 +0x5
syscall.Read(0x3c00000004, 0xf8400f6000, 0x800000008000, 0x100000001, 0x0, ...)
/usr/local/go/src/pkg/syscall/zsyscall_darwin_amd64.go:905 +0x78
os.(*File).read(0xf84007d250, 0xf8400f6000, 0x800000008000, 0x800000008000, 0x0, ...)
/usr/local/go/src/pkg/os/file_unix.go:174 +0x58
os.(*File).Read(0xf84007d250, 0xf8400f6000, 0x800000008000, 0xf8400f6000, 0x0, ...)
/usr/local/go/src/pkg/os/file.go:95 +0x83
io.Copy(0xf840066750, 0xf84007d208, 0xf84006ab70, 0xf84007d250, 0x0, ...)
/usr/local/go/src/pkg/io/io.go:360 +0x20c
os/exec._func_003(0xf840075a70, 0xf84007d248, 0x3b065, 0x0, 0x0, ...)
/usr/local/go/src/pkg/os/exec/exec.go:207 +0x5a
os/exec._func_004(0xf84007d300, 0xf840064f40, 0x0, 0x0)
/usr/local/go/src/pkg/os/exec/exec.go:274 +0x1e
created by os/exec.(*Cmd).Start
/usr/local/go/src/pkg/os/exec/exec.go:275 +0x65c
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.