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

contents changed in original source code when running now dev #3

Closed
mike-engel opened this issue Jul 31, 2019 · 5 comments · Fixed by #19
Closed

contents changed in original source code when running now dev #3

mike-engel opened this issue Jul 31, 2019 · 5 comments · Fixed by #19
Assignees
Labels
bug Something isn't working

Comments

@mike-engel
Copy link
Collaborator

mike-engel commented Jul 31, 2019

Note: This was transferred from the official now-builders repo.

Not sure if I should post this here or in now-cli repo, but here it is:

When running now dev with @now/rust builder using index.rs entry point, it keeps changing the content of Cargo.toml and index.rs

Changes in Cargo.toml

[[bin]]
name = "index"
-path = "index.rs"
+path = "/Users/fatih/dev/paper/services/embed/github/index.rs"

Changes in index.rs

+use now_lambda::lambda;
+use std::error::Error;

// my handler code here

+fn main() -> Result<(), Box<dyn Error>> {
+    Ok(lambda!(handler))
+}

The problem is I'm not supposed to commit this changes, and I think this change should only be applied in private copy (somewhere in /var/private?).

Another problem is when running now dev again, it will add another template over and over again, it's possible that I get something like this

+use now_lambda::lambda;
+use std::error::Error;

+use now_lambda::lambda;
+use std::error::Error;

+use now_lambda::lambda;
+use std::error::Error;

// my handler code here

+fn main() -> Result<(), Box<dyn Error>> {
+    Ok(lambda!(handler))
+}

+fn main() -> Result<(), Box<dyn Error>> {
+    Ok(lambda!(handler))
+}


+fn main() -> Result<(), Box<dyn Error>> {
+    Ok(lambda!(handler))
+}

My config

now.json

{
  "builders": [
    {
      "src": "services/embed/**/index.rs",
      "use": "@now/rust@canary"
    },
  ]
}

Version

❯ now --version
15.4.0
❯ uname -a
Darwin TVLK-FatihKalifa.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
❯ cargo --version
cargo 1.35.0 (6f3e9c367 2019-04-04)
@mike-engel mike-engel self-assigned this Jul 31, 2019
@mike-engel mike-engel added the bug Something isn't working label Jul 31, 2019
@cbrevik
Copy link

cbrevik commented Aug 18, 2019

Is there any way to get around this? Been trying to use now-rust, but this (and a few other bugs) make it a bit difficult.

@mike-engel
Copy link
Collaborator Author

mike-engel commented Aug 19, 2019

@cbrevik unfortunately I'm still working on #1 as I get time. If you'd like to help, let me know

Also, can you file issues for the other bugs?

@cbrevik
Copy link

cbrevik commented Aug 19, 2019

Sure @mike-engel, let me look it over later to see if I can help.

The main one I had trouble with was using now-cli@16.1.1 with now-rust, I can submit an issue with reproduction for that.

@cbrevik
Copy link

cbrevik commented Sep 2, 2019

I was looking at the PR earlier thinking of helping out. Tried cloning this project and referencing/debugging it from an adjacent test project, but I am having some issues. Do you know if there is any documentation/guides on developing/debugging now-builders locally?

@mike-engel
Copy link
Collaborator Author

@cbrevik No, unfortunately not 😞 The best I can think of right now is an npm link or npm install ../path/to/fork. I haven't personally had too much luck with those, but you may try browsing spectrum or looking through the issues on now. Sorry I can't be too much help right now. I'm preparing to move a long distance, but afterward can help more 😄

ecklf added a commit that referenced this issue Mar 13, 2023
* initial rework

* add tsconfig

* add demo

* update Cargo.toml

* update README

* rename exports

* rename exported types, add prettier

* 4.0.1-canary.0

* use canary for demo, cleanup

* use style guide, cleanup

* update README

* add more examples

* improve examples

* polish demos

* demo: nextjs, fix layout, use identical seed

* runtime: used boxed err

* update dep, simplify examples

* merged handler example (wip)

* Change `impl IntoResponse` into `Response<Body>` (#1)

* Rework to allow merging api endpoints

* Rework all examples and simplify structure

* remove `IntoResponse`

---------

Co-authored-by: Florentin / 珞辰 <ecklf@icloud.com>

* dedup body (#2)

* dedup body

* merge pub use

* update docs, use Cargo workspaces

* update examples, `0.2.0`

* `4.0.0-canary.1`

* fix typo

* migrate fixtures tests (wip)

* migrate fixtures tests - 2 (wip)

* migrate fixtures tests - 3 (wip)

* add dynamic path example

* `4.0.0-canary.2`

* migrate fixtures test

* add husky

* add `.env.example` for cron

* add http helpers (#3)

* add http helpers

* remove opinionated payload

* re-add direct crate ref, fix invalid eslint

* `4.0.0-canary.3`

* `0.2.1`

* remove merged example

* update README

* cleanup workspace members

* cleanup

* fix newline

* rm gitignore from test

* `4.0.0.beta.0`

---------

Co-authored-by: Douglas Parsons <dglsparsons@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants