Git Product home page Git Product logo

gulp-elm's People

Contributors

abadi199 avatar azure-pipelines[bot] avatar barbeque avatar bdukes avatar bsudy avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar jackfranklin avatar philopon avatar tsfoster avatar vodik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-elm's Issues

Error when passing zero files to gulp-elm

We have a standard project configuration which tries to compile elm files if they exist. When I use this on a directory without any elm files, I get an error:

[11:07:59] Starting 'elm:xyz-theme'...
Success! Compiled 0 modules.
Success! Compiled 0 modules.
{ Error: ENOENT: no such file or directory, open 'C:\Users\bdukes\AppData\Local\Temp\116412-7312-5w65ic.9nsfko6r.js'
    at Error (native)
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\bdukes\\AppData\\Local\\Temp\\116412-7312-5w65ic.9nsfko6r.js' }
[11:08:00] gulp-notify: [gulp-elm Error] ENOENT: no such file or directory, open 'C:\Users\bdukes\AppData\Local\Temp\116412-7312-5w65ic.9nsfko6r.js'
[11:08:00] Finished 'elm:xyz-theme' after 401 ms

An in-range update of through2 is breaking the build 🚨

The dependency through2 was updated from 2.0.3 to 2.0.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

through2 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/appveyor/branch: Waiting for AppVeyor build to complete (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Not working from sub-directory?

Hi,
I'm not getting any js output from gulp-elm, when I have the source code in a sub-directory. It does work if the code is in my root directory

I also found that I had to use return gulp.src("src/*.elm", {cwd: './src'}) to prevent the compiler complaining it could not find files. (I'm wondering whether the process failed because the elm files are now out of sync with the elm-packages directory.)

Request - Setup with multiple elm.json files using glob patterns

First of all, thank you for this useful package, it saves a lot of time and works well with browser-sync!

I would like to configure the build process according to this simplified directory structure:

project
β”‚
└───elm
β”‚   β”‚   gulpfile.js
β”‚   β”‚
β”‚   └───samples
β”‚       β”‚
β”‚       └───foo
β”‚       β”‚       elm.json
β”‚       β”‚       index.js
β”‚       β”‚       style.scss
β”‚       β”‚       src/Main.elm
β”‚       β”‚
β”‚       └───bar
β”‚               elm.json
β”‚               index.js
β”‚               style.scss
β”‚               src/Main.elm
|
└───assets
    β”‚
    └───samples
        β”‚
        └───foo
        β”‚       index.js
        β”‚       main.js
        β”‚       style.css
        β”‚
        └───bar
                index.js
                main.js
                style.css

❌ This is my attempt to configure gulp-elm (the bundle function is needed because the Elm code is actually more than a single Main.elm):

src('samples/*/src/Main.elm')
    .pipe(elm.bundle('main.js', { cwd: 'samples/*/', debug: true }))
    .pipe(dest('../assets/samples/'))

βœ”οΈ Processing scss files with a similar approach works fine:

 src('samples/*/style.scss', { sourcemaps: true })
    .pipe(sass().on('error', sass.logError))
    .pipe(dest('../assets/samples/', { sourcemaps: true }))

βœ”οΈ Configuring directories one by one works too, e.g this is the directory foo config:

src('samples/foo/src/Main.elm')
    .pipe(elm.bundle('main.js', { cwd: 'samples/foo/', debug: true }))
    .pipe(dest('../assets/samples/foo/'))

It seems that using glob patterns in cwd is not allowed. Are you willing to support this setup?

Sometimes fails with `openFile: dones not exist` when watched

I have a pretty simple gulp file:

const gulp = require("gulp")
const elm = require("gulp-elm")
const plumber = require("gulp-plumber")

gulp.task("elm", function() {
  return gulp.src("src/Main.elm")
    .pipe(plumber(function(err) {
      console.log(err)
      this.emit("end")
    }))
    .pipe(elm.bundle("script.js"))
    .pipe(gulp.dest("build"))
})

gulp.task("watch", function() {
  gulp.watch("src/**/*.elm", ["elm"])
})

Everything works perfectly if I call gulp elm (I manually tested this ~20
times). If however I run gulp watch, and then edit Main.elm (my only
file) it fails ~25% of the time. I did not change the file at all between
saves. I've annotated the following console output with my actions.

[20:16:28] Starting 'elm'...                    # Triggered a save (works)
[BS] 1 file changed (script.js)
[20:16:29] Finished 'elm' after 957 ms
[20:16:31] Starting 'elm'...                    # Triggered a save (works)
[BS] 1 file changed (script.js)
[20:16:32] Finished 'elm' after 913 ms
[20:16:33] Starting 'elm'...                    # Triggered a save (fails)
elm-make: /home/henry/dev/character-sheet/src/Main.elm: openFile: does not exist (No such file or directory)

{ [Error: elm-make: /home/henry/dev/character-sheet/src/Main.elm: openFile: does not exist (No such file or directory)
]
  message: 'elm-make: /home/henry/dev/character-sheet/src/Main.elm: openFile: does not exist (No such file or directory)\n',
  showStack: false,
  showProperties: true,
  plugin: 'gulp-elm',
  __safety: { toString: [Function: bound ] } }
[20:16:33] Finished 'elm' after 243 ms
[20:16:33] Starting 'elm'...                    # Did *not* trigger a save, this
[20:16:33] Finished 'elm' after 2.56 ms         # it just happens after a failure
[20:16:33] Starting 'elm'...                    # Didn't trigger this either
[BS] 1 file changed (script.js)
[20:16:34] Finished 'elm' after 1.19 s

Versions

node: 6.1.0
elm: 0.18.0
gulp: 3.9.1
gulp-elm: 0.6.1
gulp-plumber: 1.1.0

An in-range update of jsdom is breaking the build 🚨

The devDependency jsdom was updated from 12.0.0 to 12.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

jsdom is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build is in progress (Details).
  • ❌ continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 13 commits.

  • b2994f9 Version 12.1.0
  • 2fd2e89 runVMScript's new options argument does not work in browsers
  • c294f50 Add options to the dom.runVMScript method
  • c9c5a05 Add [expected fail] to test output
  • 1bfd7d7 Roll Web Platform Tests
  • dbff7dd Remove dead code
  • 31e23ef Pass through the element to custom resource laoders
  • 96b3787 Fix timing for async scripts
  • c96decf Move from sax to saxes for XML parsing
  • ed11465 Upgrade cssstyle dependency from ^1.0.0 to ^1.1.1
  • 8898b25 Implement fieldset's elements and type properties
  • 6a1722a Fix "input" and "change" events for HTMLInputElement
  • 0cba358 Minor code and README cleanups; note Node.js version requirement

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Doesn't compile multi module projects

Error: Error when searching for modules imported by module 'Main':
Could not find module 'Bar'

Project is layed out as follows:

foo
β”œβ”€β”€ elm-package.json
β”œβ”€β”€ gulpfile.js
└── src
    β”œβ”€β”€ Bar.elm
    └── Main.elm

Main.elm

import Bar
import Graphics.Element exposing (..)

main = empty

Bar.elm

module Bar where
import Graphics.Element exposing (..)

bar = empty

Gulpfile is the one from the README. Works fine with elm-make src/*.elm.

http://kaspar.h1x.com/gulp-elm-foo.zip

Optimize flag not working

I have added the following:

gulp.task("elm", function(){
  return gulp.src('fractal/assets/elm/*.elm', { optimize: true })
    .pipe(plumber())
    .pipe(elm.bundle('elm.js'))
    .pipe(gulp.dest("fractal/assets/js/"))
    .pipe(gulp.dest("htdocs/assets/js/"));
});

However, the optimize flag is not working. It is still compiling in dev mode.

I've also tried the example in the README and still the same issue:

gulp.task('elm', function(){
  return gulp.src('fractal/assets/elm/Main.elm', { optimize: true })
    .pipe(elm())
    .pipe(gulp.dest("fractal/assets/js/"));
});

exception doesn't get caught when watching

When watching for changes, errors in the code make the compiler return an error, which somewhere gets thrown as an Exception by q:

[13:16:29] Starting 'compile:elm'...
(node:8191) DeprecationWarning: 'root' is deprecated, use 'global'
(node:8191) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
-- SYNTAX PROBLEM - <source folder>/TagSelect.elm

I ran into something unexpected when parsing your code!

72|     let
        ^
I am looking for one of the following things:

    end of input
    whitespace



<project folder>/node_modules/q/q.js:155
                throw e;
                ^

This leads to the watch process stopping and not recompiling anything after further changes.

An in-range update of ansi-colors is breaking the build 🚨

The dependency ansi-colors was updated from 3.0.5 to 3.0.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ansi-colors is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • βœ… continuous-integration/travis-ci/push: The Travis CI build passed (Details).
  • ❌ continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 7 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Doesn't work on 0.19

elm-make is gone, replaced with just a single elm binary.

As a shim, installing this shell script as elm-make technically makes it works:

#!/bin/bash
shift  # swallow --yes, its gone
[[ "$@" ]] && exec node_modules/.bin/elm make "$@"

elm-package.json must exist in root directory

We're embedding a small Elm application into our existing React app, and are using gulp-elm for compilation. We noticed that the elm-package.json file must exist in the root directory of the repo, even if the Elm application itself is nested within a few directories.

It would be great to have an option to specify a custom path to elm-package.json, or simply to look for elm-package.json in the same directory that the entry point to the Elm app exists.

EDIT: Can use Gulp's cwd flag to specify current working directory for elm task.
i.e.

gulp.task 'elm-compile-dev', ['elm-init'], ->
  gulp.src config.src, { cwd: 'client/app/public/elm/elm' }
  .pipe(elm({debug: true}))
		.on('error', _onErr)
  .pipe(gulp.dest(config.dest))
  .pipe(browserSync.reload({stream : true}))

Add option to specify output file

Right now the output file will be the same as the source .elm file specified with either the extension ".js" or ".html" depending on what you specify for the filetype option. This means that you cannot specify a different file name or just create a lower case filename which is standard for js and html files.

I believe it would make more sense to reflect the options provided by elm make itself and provide an output parameter that defines the output filename and type.

compile hangs for a few minutes before firing proc.on('close')

I'm having an issue where the gulp-elm task runs elm-make, and the JavaScript output file is written successfully, but then hangs for 1 - 3 minutes before successfully firing the 'close' event of the spawned elm-make process in node and completing the task.

Swapping out

, spawn = require('cross-spawn')
for
, spawn = require('child_process').spawn

in index.js seems to fix the issue.

The gulpfile.js I'm using is here:

https://github.com/stephenhand/form-editor/blob/gulp-elm/gulpfile.js

Source glob fails in 0.8.0

Works: gulp.src('../admin-elm/src/users/Users.elm') (Manual array also works)
Fails:

gulp.src('../admin-elm/src/**/*.elm')
.pipe(elm({
            cwd: '../admin-elm/',
            optimize: true
        }))
.pipe(gulp.dest('public/'))

-----
{ Error: ENOENT: no such file or directory, open '/tmp/gulp-elm-tmp-11884-29168-vn8ssn.9eyka/11884-29168-1fb90pi.lblx.js'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/tmp/gulp-elm-tmp-11884-29168-vn8ssn.9eyka/11884-29168-1fb90pi.lblx.js' }

<removed path>.../node_modules/q/q.js:155
                throw e;
                ^
Error: ENOENT: no such file or directory, open '/tmp/gulp-elm-tmp-11884-29168-vn8ssn.9eyka/11884-29168-1fb90pi.lblx.js'

Elm output mixes with gulp output

The recent change to pipe the elm-make output to stdout directly means that the output from elm-make is mixing with the output from gulp (or other elm-make processes), making the output unreadable when multiple processes are generating output, e.g.

Potential problems could be:
  * M[i15:39:47s] spelled tFinished 'hjs:LandoCalrissian-modulee' after  12 sm
odul[e15:39:47 ] nStarting 'aLandoCalrissian-modulem'...
e[
15:39:47  ] *Finished ' LandoCalrissian-moduleN' after e33 ΞΌse
d to add a source directory or new dependency to elm-package.json
I cannot find module 'Effects'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.