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

how to set up so all code can be easily instrumented? #23946

Open
bkerin opened this issue May 22, 2024 · 4 comments
Open

how to set up so all code can be easily instrumented? #23946

bkerin opened this issue May 22, 2024 · 4 comments
Labels
question a question about the use of Deno

Comments

@bkerin
Copy link

bkerin commented May 22, 2024

I'd like the entirety of everything being used to notice if I stick console.log("something") in it but if I have to re-run deno task dev or something after instrumenting something that's fine too.

So far I found deno info and deno vendor but the first doesn't go down to source-level for npm packages:

deno info "npm:@hono/auth-js"
dependencies: 13 unique
size: 4.79MB

npm:/@hono/auth-js@1.0.7 (50.04KB)
├─┬ npm:/@auth/core@0.31.0_preact@10.11.3 (1.51MB)
│ ├── npm:/@panva/hkdf@1.1.1 (12.33KB)
│ ├── npm:/@types/cookie@0.6.0 (9.84KB)
│ ├── npm:/cookie@0.6.0 (23.18KB)
│ ├── npm:/jose@5.3.0 (495.36KB)
│ ├── npm:/oauth4webapi@2.10.4 (149.44KB)
│ ├── npm:/preact@10.11.3 (1.09MB)
│ └─┬ npm:/preact-render-to-string@5.2.3_preact@10.11.3 (350.21KB)
│   ├── npm:/preact@10.11.3 (1.09MB)
│   └── npm:/pretty-format@3.8.0 (17.72KB)
├── npm:/hono@4.3.8 (801.25KB)
└─┬ npm:/react@18.3.1 (310.65KB)
  └─┬ npm:/loose-envify@1.4.0 (5.68KB)
    └── npm:/js-tokens@4.0.0 (14.72KB)

And the latter didn't seem to get picked up automatically (though maybe I failed to reset a cache or something if that has to be done manually). And per-module vendor isn't really what I want anyway, I'd like it to just all be there 100% of the time.

I'd be fine with the right cp -r if that's the best way. Any advice appreciated.

@marvinhagemeister
Copy link
Contributor

Add "vendor": true in your deno.json (note that this is different from the deno vendor command). Enabling that option in deno.json will put all npm modules in a local node_modules folder and all other dependencies in a vendor/ folder in your project.

@marvinhagemeister marvinhagemeister added the question a question about the use of Deno label May 22, 2024
@bkerin
Copy link
Author

bkerin commented May 25, 2024

Thanks. One small thing:

If node_modules doesn't already exist an unhelpful error happens:

$ rm -rf node_modules/
---------------------------------------------------------------------------
$ deno task dev
error: No such file or directory (os error 2)
[ble: exit 1]
---------------------------------------------------------------------------

Just naming the missing file would mostly mitigate this.

Manually creating node_modules/ fixes it.

I didn't check if the same issue exists for vendor/

@lucacasonato
Copy link
Member

Where is that error coming from @bkerin? How did you create the node_modules/ folder then?

@bkerin
Copy link
Author

bkerin commented Jun 8, 2024

Besides what I showed I don't know more about where it was coming from. IIRC I just did mkdir node_modules and then it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question a question about the use of Deno
Projects
None yet
Development

No branches or pull requests

3 participants