Comments (6)
This is a bug. The recursive watching of source markdown files (src.base
parameter in configs, which defaults to docs/md
) should be supported.
I am unable to reproduce locally (node v 12.16.0 / macOS). What is your node version / OS? Apparently there are issues with ts-node-dev
's recursive file watching and node 14.
I am not sure if it will actually be fixed anytime soon or if lower versions of node will solve the issue, as this seems to be a caveat of node's own fs.watch
API which stops it from properly functioning on platforms other than Windows and macOS. The behavior change that results in raised issues is evidently due to node 14 throwing an error vs previous versions silently ignoring it.
I'll keep this issue open to monitor the situation with ts-node-dev
issues. If there is no fix in near future for this, I suspect the best course of action would be to look for an alternative at least for non-Windows/macOs machines (though that perhaps leads to slower reload times on dev).
P.S. @mnn in the meantime you can actually add your work-around in .codedoc/watch.ts
, so that codedoc serve
(or codedoc s
) would work for you (if it is more convenient). I suspect it would look something like this:
// .codedoc/watch.ts
import { exec, spawn } from 'child_process';
import { config } from './config';
const cmd = 'find';
const params = `${config.src.base} | entr -r ts-node .codedoc/serve`;
// ...
(Though you would need to test to ensure this works).
from codedoc.
I am using Linux 64b (Manjaro) and node 13.12.0.
Oh yes, multiplatform file watching is rather problematic. This is not a first time I hit similar issue, most likely caused by the same underlying cause.
Thank you very much for the tip, it lead me to this (a bit convoluted) solution:
const cmd = 'find';
const params = `${config.src.base} | entr -r npx --no-install ts-node -P .codedoc/tsconfig.json .codedoc/serve`;
from codedoc.
as part of this commit, this also should be fixed. the fix is deployed via the combination of @codedoc/[email protected]
and @codedoc/[email protected]
, and you should be able to update to it like this:
npm i -g @codedoc/cli@latest
codedoc update latest
in this update, tiered watching is used, and markdown files are now watched using node-watch
, which should be able to properly watch recursive file changes on Linux machines as well. ts-node-dev
is only used for watching TypeScript code, which should already be working properly with recursive watching even on Linux machines.
@mnn since I do not have a Linux machine for testing, I am going to keep this issue open for now until you confirm this update fixes the recursive watching issue.
from codedoc.
Sorry, don't have much free time now. Just quickly tested it on a fresh project (same directory structure as my original project), and change detection is working now 🙂. Thank you very much.
from codedoc.
thats a nice work-around.
unfortunately, filewatcher
(which is used by ts-node-dev
for watching files) itself seems to be dead, so a stable/performant solution might not come soon. I will play around with a fork of filewatcher
/ ts-node-dev
that uses this package instead, see if it works out.
if this drags out long, I will add your solution to the boilerplate repo so that new repositories will use entr
instead of ts-node-dev
on linux machines. I am just a bit hesitant due to the performance drawback.
from codedoc.
Sorry, don't have much free time now. Just quickly tested it on a fresh project (same directory structure as my original project), and change detection is working now 🙂. Thank you very much.
thank you for testing, and that was still pretty fast!
from codedoc.
Related Issues (20)
- The build process on gh-actions omits terminal output colors HOT 2
- Theme assets broken when hosted on GitLab Pages HOT 7
- New release with ansi_up fix HOT 4
- Hooking codedoc's router to run code on page change HOT 7
- Search shortcut (CMD+F / ctrl+F) displays the modal n times
- Help with plugin development and publishing on NPM HOT 7
- enhance the underline code block feature to support more languages HOT 2
- support info underlines in codeblocks
- update set-value to a non-vulnerable version
- Support RTL HOT 1
- decreasing the width-size of TOC HOT 2
- Ability to copy multiple lines from codeblocks HOT 7
- Running Codedoc as a container in Raspberry Pi
- GitHub Pages deployment failure after succeeding HOT 3
- Local build not working: TypeError: merge is not a function HOT 4
- Integrated Search missing HOT 2
- Update marked to 4.0.10 to avoid CVE-2022-21680 HOT 1
- Build not working: Non-string value passed to `ts.resolveTypeReferenceDirective` HOT 1
- Pre-build plugin HOT 1
- github action failure 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 codedoc.