Comments (3)
Sounds good!
What commands would we want it for? run
, test
, build
and check
seem like obvious ones.
Making it a flag means there's yet another flag that can't be passed easily down into the Gleam program, and --watch
seems like a common one that would be wanted. Perhaps it could be a command itself: gleam watch test
If this feature also included a way to communicate with other processes in a similar fashion to how the language server works, ...
What do you mean by this?
from gleam.
Making it a flag means there's yet another flag that can't be passed easily down into the Gleam program
No flags can be easily passed down into a gleam program in my experience:
% gleam run -m lustre/try --include-styles
error: Found argument '--include-styles' which wasn't expected, or isn't valid in this context
If you tried to supply `--include-styles` as a value rather than a flag, use `-- --include-styles`
USAGE:
gleam run --module <MODULE>
For more information try --help
But a watch
command sounds fine in any case.
What do you mean by this?
I'd like to be able to spawn gleam watch
as a (os) process and have some way of it telling my program when/which files have changed/been compiled. Maybe that's just output on stdout or maybe its events on a socket, but some way of knowing when this stuff happened would be immensely useful I think.
I'd like to, for example, re-run lustre_ssg any time some source files change. If the compiler already has a filesystem watcher it feels a bit silly if I have to re-implement all that functionality (and it is seemingly non-trivial to do this cross-platform) so if the binary could just expose that info it'd be super great.
from gleam.
No flags can be easily passed down into a gleam program in my experience:
That's a bug with Clap when only flags are passed. It doesn't in any way impact how we design the CLI API.
I'd like to be able to spawn gleam watch as a (os) process and have some way of it telling my program when/which files have changed/been compiled.
Gleam won't offer anything like this as part of this feature as it means we're accidentally shifting into being a generic build tool rather than a specific one, and I want to do a lot of R&D before we consider moving into that space as it's extremely easy to make a rubbish generic build tool / task runner.
For this specific example you don't actually need anything new from the compiler to run the site generator, you just run gleam run -m lustre_ssg --watch
(or whatever the command will be).
from gleam.
Related Issues (20)
- Variables in constants not being escaped on JS HOT 2
- Broken output pipe crashes compiler HOT 1
- LSP completion only works when starting from an empty line HOT 1
- OTP27 export moduledoc and doc for module docs and function docs HOT 2
- Add pre-built binary for Android HOT 5
- `gleam build` doesn't have permission to link `priv` on Windows HOT 2
- LSP: Allow jumping to definition on qualified import module name, and unqualified import in import statement. HOT 3
- Formatter: Unexpectily moves last comment of custom type constructor args out to its parent type scope HOT 4
- gleam publish --revert HOT 3
- Only add Hex link to HTML docs when publishing to Hex HOT 1
- Bad suggestion on import file HOT 1
- Warn for unreachable code after todo and panic HOT 8
- Formatter puts comment into wrong block HOT 2
- [DTS] return type not correct, `null !== undefined` in js. HOT 1
- Improve error message for `use` functions with wrong last argument HOT 1
- Improve error message for `use` with function with incorrect arity HOT 1
- Improve error message when there's something that's not a function to the left of `use` HOT 2
- Dev dependencies are written into the app list in .app.src HOT 10
- Unable to give completions to LSP for dot completions HOT 2
- Support specifying multiple license files and other text files for the Hex tarball HOT 5
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 gleam.