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

kras configuration broken #532

Closed
3 tasks done
cloeffl opened this issue Aug 24, 2022 · 1 comment
Closed
3 tasks done

kras configuration broken #532

cloeffl opened this issue Aug 24, 2022 · 1 comment
Labels
bug Something isn't working cli Concerns the piral-cli application.
Milestone

Comments

@cloeffl
Copy link

cloeffl commented Aug 24, 2022

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version?
  • Did you perform a search in the issues?

Environment Details and Version

Piral 0.14.29

Description

After upgrading from Piral 0.14.23 to 0.14.29 the mock server is no longer working as expected. Scripts in the mocks directory are not getting loaded. Spinning up a new instance with the default template also does not allow to use the provided mock at /api/posts

Steps to Reproduce

  1. npx -p piral-cli piral new --template default
  2. npm start
  3. open http://localhost:1234/api/posts in a browser

Expected behavior

Mock data is returned

Actual behavior

The Piral Instance is loaded.

Possible Origin / Solution

Accessing kras frontend shows that no scripts are loaded.

@cloeffl cloeffl added the bug Something isn't working label Aug 24, 2022
@cloeffl cloeffl changed the title Kras configuration broken kras configuration broken Aug 24, 2022
@FlorianRappl
Copy link
Contributor

FlorianRappl commented Aug 24, 2022

Alright, thanks for the info.

We stopped generating a default directory, I guess we should include that again.

In the meantime you can create a .krasrc file next to the package.json and put, e.g.,

{
    "injectors": {
        "script": {
            "directory": "src/mocks"       
        }
    }
}

in there. This will tell kras to use the src/mocks directory as a source for the script injector.

Alternatively, you can also set the sources for all injectors like this:

{
    "sources": ["src/mocks"]
}

(This one avoids having to know / repeat all injectors that you'd like to use)

@FlorianRappl FlorianRappl added cli Concerns the piral-cli application. in-review The item is currently being reviewed. in-implementation The item is currently being implemented. and removed in-review The item is currently being reviewed. labels Aug 24, 2022
@FlorianRappl FlorianRappl added this to the 0.14.30 milestone Aug 25, 2022
@FlorianRappl FlorianRappl added in-testing The item is already out in preview and can be tested. and removed in-implementation The item is currently being implemented. in-testing The item is already out in preview and can be tested. labels Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Concerns the piral-cli application.
Projects
None yet
Development

No branches or pull requests

2 participants