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

Can't load customized config file. #334

Closed
ibarapascal opened this issue Apr 5, 2020 · 4 comments
Closed

Can't load customized config file. #334

ibarapascal opened this issue Apr 5, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ibarapascal
Copy link

Bug description

To Reproduce

1. Operating system

Win10

2. Arkit version and CLI arguments

1.6.2 and 1.5.0

npx arkit -d src/
npx arkit -d src/ -c arkit.json

3. Arkit config, if any was used

Default one (same as the demo)

And the below one

arkit.json

{
  "$schema": "https://arkit.pro/schema.json",
  "excludePatterns": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"],
  "components": [
    {
      "type": "API",
      "patterns": ["src/models/*", "src/api.tsx"]
    },
    {
      "type": "Redux",
      "patterns": ["src/reducer", "src/store.tsx"]
    },
    {
      "type": "Component",
      "patterns": ["**/*.ts", "**/*.tsx"],
      "excludePatterns": []
    }
  ],
  "output": [
    {
      "path": "temp/arkit.svg",
      "groups": [
        {
          "first": true,
          "components": ["Component"]
        },
        {
          "type": "Dependencies",
          "components": ["Dependency"]
        },
        {
          "type": "Redux",
          "components": ["Redux"]
        },
        {
          "type": "API",
          "components": ["API"]
        }
      ]
    }
  ]
}

4. Source code example, if it's possible

image

5.Others

Always the default settings

image

@ibarapascal ibarapascal added the bug Something isn't working label Apr 5, 2020
@jackyang9451
Copy link

the same as me

@RostislavDugin
Copy link

RostislavDugin commented May 11, 2020

Hello, I tried to set config through PowerShell and Git Bash - did not work.

UPD: also tried on Ubuntu 16 - did not work

@RostislavDugin
Copy link

@ibarapascal,
@tianjidiaobao,

I've found the problem.

Quick answer

Specify path to configuration file relatively to "working folder".

For example, you have the next file structure:

project/
  /src
  /arkit-config.json

Then you should run:
> npx arkit .\src\ -c ./../arkit-config.json

Why does it work so

When you run arkit through command line, the application sets directory that you want to parse in directory variable. Then, it builds abosulte path to your config file as directory + config_file.

So, if you try to run > npx arkit .\src\ -c arkit-config.json, final path to your config file will be src/arkit-config.json.

The problem is in file config.ts here:
image

Moreover, if you try to work with arkit from arkit's project folder - it works fine...


I will make a commit with description on weekends, now - just short solution.
P.S. @dyatko can you add me in LinkedIn, please. I have a small question :)

@ibarapascal

This comment has been minimized.

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

No branches or pull requests

4 participants