emmabastas / elm-embed Goto Github PK
View Code? Open in Web Editor NEWRead, parse and embed environment variables and file content into your Elm code.
License: BSD 3-Clause "New" or "Revised" License
Read, parse and embed environment variables and file content into your Elm code.
License: BSD 3-Clause "New" or "Revised" License
-- elm-generate-scripts/Foo.elm
module Foo exposing (exposed)
import Generate
exposed = Generate.Done ()
unexposed = Generate.Done ()
Here unexposed
is evaluated, and included in the generated file, which it should not
Currently you can combine Embed.Task
's with Embed.andThen
, i.e one embedder can depend on the result of another one. You could for example use the value of an environment variable as the location for a configuration file read by an embedder, which then further affects the behavior of said embedder as it reads more files from disk. Now you have something that looks like a homecocked build system, which lies far outside the scope of elm-embed.
Are there situations where you genuinely need the power to combine embedders? The most legitimate example I can think of would be to have an environment variable to configure the location of a file to be read on disk. A workaround for that could be to use a symlink instead.
to reproduce:
elm make
elm-generate
error:
-- CORRUPT CACHE ---------------------------------------------------------------
It looks like some of the information cached in elm-stuff/ has been corrupted.
this is probably because elm-generate
and elm
share the same cache directory, they should have separate ones!
$ touch elm-embed-scripts
$ elm-embed init
To reproduce:
rm -r elm-stuff
elm-generate make
elm-generate make
error message NO GENERATORS
Currently Embed.File.read
just passes the string to nodejs io functions. The behavior should be decoupled from nodejs, and be made more obvious.
How to go about compiling and testing for osx and windows is something I'll need to figure out. I don't have reliable access to either OS so might be a bit tricky.
$ echo y | elm init
$ echo y | elm-embed init
Put his in elm-embed-scripts/SSCCE.elm
module SSCCE exposing (foo)
import Embed
foo : Embed.Task Int
foo = Embed.succeed 1
$ elm-embed run
Remove type annotation from SSCCE.foo
$ elm-embed run
now crashes
Removing elm-stuff/elm-embed
resolves the issue
elm-embed run
should ignore dotfiles.
There is no reason not to do this as far as I'm aware.
For me to make good design decisions it is critical to know what people would like to use elm-embed for.
So if you have a use case in mind, please leave a comment!
To reproduce:
elm make
elm-generate
You get a bunch of messages like
+-------------------------------------------------------------------------------
| Corrupt File: /home/emma/.elm/0.19.1/packages/avh4/elm-color/1.0.0/artifacts.dat
| Byte Offset: 26385
| Message: not enough bytes
|
| Please report this to https://github.com/elm/compiler/issues
| Trying to continue anyway.
+-------------------------------------------------------------------------------
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.