Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Watching Files #7

Closed
ebebbington opened this issue Feb 18, 2020 · 5 comments
Closed

Not Watching Files #7

ebebbington opened this issue Feb 18, 2020 · 5 comments

Comments

@ebebbington
Copy link

Hey,

With the --watch flag or options present, denon doesn't seem to watch for changes. I assume i can run a a Deno app with Denon, make a change to the file, and it would show the new change without restarting the server.

My Setup

  • Windows 10
  • Deno application using Drash, with Denon
  • Deno Version:
PS Some\Path\To\My\Project> deno --version
deno 0.33.0
v8 8.1.108
typescript 3.7.2

Command
I can running the following command to use denon to initiate the server:

Note: the below command is the way it is because after installing denon, the command for it isn't working and i can't be bothered to look into it yet

deno --allow-net --allow-read --allow-run --allow-env --allow-write https://deno.land/x/denon/denon.ts

Config

# .denonrc
{
    "files": [
        "app.ts"
    ],
    "quiet": false,
    "debug": true,
    "fullscreen": true,
    "extensions": [
        "js",
        "ts"
    ],
    "match": [
        "*.ts"
    ],
    "skip": [
        "*_test.ts",
        "*_test.js"
    ],
    "interval": 500,
    "watch": [
        "./"
    ],
    "execute": {
        ".ts": ["deno", "--allow-read", "--allow-env", "--allow-write", "--allow-run", "--allow-net"]
    }
}

Summary
Denon runs the app fine, it starts the correct file, and i can view the project in the browser, but watch doesn't 'seem' o be working, for example, i have a console.log('Hello'), i run the app, change the log text to console.log('Hello world'), but still see "Hello" and not "Hello World"

@ebebbington
Copy link
Author

After running the Command:

[DENON] Watching D:\Development\environments\todo
Compile file:///D:/Development/environments/todo/resources/home_resource.ts

Deno server started at localhost:1337.


@eliassjogreen
Copy link
Member

eliassjogreen commented Feb 20, 2020

Looked into the issue and it turns out it was due to some faulty documentation. The problem is that the extensions array needs to include a dot before the extension. Will fix the readme asap

update: Found out that the match and skip glob was also not working as expected so will try to fix that. Seems to be an issue with the globToRegExp method or the passed parameters. It only seems to create a regexp for the file name and not for the whole path which does not match the glob.

@eliassjogreen
Copy link
Member

eliassjogreen commented Feb 20, 2020

Working .denonrc:

{
    "files": [
        "app.ts"
    ],
    "quiet": false,
    "debug": true,
    "fullscreen": true,
    "extensions": [
        ".js",
        ".ts"
    ],
    "interval": 500,
    "watch": [
        "./"
    ],
    "execute": {
        ".ts": ["deno", "--allow-read", "--allow-env", "--allow-write", "--allow-run", "--allow-net"]
    }
}

@ebebbington
Copy link
Author

Adjusted my .denonrc and it works perfectly, i'll emit the skip and match blocks for now then

@ebebbington
Copy link
Author

I'll leave it open for whether you want this issue to reference the issues above or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants