Code Monkey home page Code Monkey logo

arkit's Introduction

arkit
🇸🇪arkitektur

Arkit NPM package Download arkit Dependents Build status Test coverage Technical debt

Visualises JavaScript, TypeScript and Flow codebases as meaningful and committable architecture diagrams

  • Associates source files with configured architectural components
  • Renders grouped components and dependency graph including Node.js modules
  • Supports JavaScript, TypeScript and Flow source code and Vue/Nuxt
  • Exports codebase architecture visualisation as SVG, PNG or Plant UML diagram
  • Integrates into development flow, so your CI, VCS, README and PRs are happy

Usage

# Run arkit straight away
npx arkit

# Or add it to your project as a dev dependency
npm install arkit --save-dev
yarn add arkit --dev
# Run arkit against your source folder and save result as SVG
npx arkit src/ -o arkit.svg

# You can also specify source files to start from and output format
npx arkit -f src/main.js -o puml

# And get some more with debugging and file exclusions
LEVEL=info npx arkit -e "node_modules,test,dist,coverage" -o puml

⚠️ Arkit is using a web service to convert PlantUML to SVG/PNG. It's hosted at arkit.pro and does not store any data. If you want to use Arkit at work make sure this is fine with your company tools policy.

If your project is huge and first diagrams look messy, it's better to generate them per feature, architectural layer, etc.

Once you satisfied with results, add arkit command to your build script, so it will keep your architecture diagrams up-to-date.

Configuration

Arkit can be configured using basic CLI arguments or advanced JSON, JS module or package.json configuration.

Basic CLI arguments

user@machine:~$ npx arkit --help
arkit [directory]

Options:
  -d, --directory  Working directory                              [default: "."]
  -c, --config     Config file path (json or js)         [default: "arkit.json"]
  -o, --output     Output path or type (svg, png or puml) [default: "arkit.svg"]
  -f, --first      File patterns to be first in the graph               [string]
  -e, --exclude    File patterns to exclude from the graph
        [default: "test,tests,dist,coverage,**/*.test.*,**/*.spec.*,**/*.min.*"]
  -h, --help       Show help                                           [boolean]
  -v, --version    Show version number                                 [boolean]

Advanced arkit.json with JSON schema for autocomplete and validation

{
  "$schema": "https://arkit.pro/schema.json",
  "excludePatterns": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"],
  "components": [
    {
      "type": "Dependency",
      "patterns": ["node_modules/*"]
    },
    {
      "type": "Component",
      "patterns": ["**/*.ts", "**/*.tsx"]
    }
  ],
  "output": [
    {
      "path": "arkit.svg",
      "groups": [
        {
          "first": true,
          "components": ["Component"]
        },
        {
          "type": "Dependencies",
          "components": ["Dependency"]
        }
      ]
    }
  ]
}

See more possible JSON configuration options in the examples below

Real-world examples

Express.js using npx arkit

Express architecture graph

Arkit dependency graph

ReactDOM using npx arkit and config in arkit.json

ReactDOM architecture graph

Vue/Nuxt TodoMVC using yarn arkit -o arkit.svg

Vue and Nuxt dependency graph

Contribution

The tool is under active development, so please feel free to contribute with suggestions and pull requests. Your feedback is priceless.

Relevant projects

  • Dependency cruiser validates and visualizes dependencies
  • Madge generates a visual graph of module dependencies
  • dependo visualizes CommonJS, AMD, or ES6 module dependencies
  • JSCity visualizes JavaScript source code as navigable 3D cities
  • colony in-browser graphs representing the links between your Node.js code and its dependencies
  • TsUML generates UML diagrams from TypeScript source code

Fun stats, stargazers map by worldstar

GitHub stargazer map
Give a Github star to get on the map.

arkit's People

Contributors

austil avatar dependabot[bot] avatar dyatko avatar renovate-bot avatar renovate[bot] avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arkit's Issues

Using `class` in a Vue template causes parsing error

Bug description

Including class on a template element (even commented-out) results in a parsing error, and file to be missing from output SVG.

[2019-08-29 06:10:00.902 +0000] ERROR: Error parsing <...>/src/views/Test.vue

To Reproduce

  1. Operating system: macOS 10.14.6
  2. Arkit version and CLI arguments: v1.6.2
  • arkit -e "node_modules" src/views
  1. Arkit config, if any was used: none

  2. Source code example, if it's possible:

src/views/Test.vue

FAIL

<template>
  <div class='thing'></div>
</template>

<script>
</script>

PASS

<template>
  <div></div>
</template>

<script>
</script>

Allow NodeJS version >= 8.11

Is your feature request related to a problem?

We are currently using node 8.11 on developer machines and during CI.

arkit works perfectly under node 8.11, but requires >= 8.15 in package.json

Would be nice if arkit allowed 8.11 and we did not need to run yarn with --ignore-engines.

Describe the solution you'd like

In package.json, replace

"engines": {
  "node": ">= 8.15.0"
},

with

"engines": {
  "node": ">= 8.11.0"
},

Describe alternatives you've considered

Not found tsconfig.json

Does not work. Cannot find the file /home/user/git/tsconfig.json, but it has never been there.

To Reproduce

  1. Linux Ubuntu 18.04
  2. Arkit version 1.3.17
  3. Command npx arkit ./src/ -o arkit.svg

Result of performance:

npx: установлен 268 в 3.057s
Running against /home/user/git/toster-extension/src with the following config:
{
  "components": [
    {
      "type": "Dependency",
      "patterns": [
        "node_modules/*"
      ]
    },
    {
      "type": "Component",
      "patterns": [
        "**/*.ts",
        "**/*.js",
        "**/*.jsx",
        "**/*.tsx"
      ]
    }
  ],
  "excludePatterns": [
    "../test",
    "../tests",
    "../dist",
    "../coverage",
    "../**/*.test.*",
    "../**/*.spec.*",
    "../**/*.min.*"
  ],
  "output": [
    {
      "path": [
        "../arkit.svg"
      ],
      "groups": [
        {
          "first": true,
          "components": [
            "Component"
          ]
        },
        {
          "type": "Dependencies",
          "components": [
            "Dependency"
          ]
        }
      ]
    }
  ]
}
File not found: /home/user/git/tsconfig.json

Support for Quasar Framework

Is your feature request related to a problem?
A clear description of what the problem is. Ex. I'm always frustrated when...
I have a task to document project created with https://quasar.dev/
I would really like to use your tool for that.
Describe the solution you'd like
A clear description of what you want to happen.
Support with arkit.js conf or any other nice way to use Arkit with Quasar

Describe alternatives you've considered

  • manually configuring Arkit
  • search for other solution for architecture presentation of code

How to show dependencies of npm packages required in project via dependency graph

I am unable to generate dependencies of npm packages like express, mongoose, etc in the dependency graph. I tried advanced arkit.json config, initially I ran npx arkit -c with arkit.json as below
{ "$schema": "https://arkit.pro/schema.json", "excludePatterns": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"], "components": [ { "type": "Dependency", "patterns": ["node_modules/*"] }, { "type": "Component", "patterns": ["**/*.js", "**/*.jsx"] } ], "output": [ { "path": "arkit.svg", "groups": [ { "first": true, "components": ["Component"] }, { "type": "Dependencies", "components": ["Dependency"] } ] } ] }
With this JSON, I am not getting dependencies like Arkit or Vue/Nuxt TodoMVC in arkit examples, furthermore selecting only node_modules and omitting components in arkit.json, I am getting this huge graph

I also looked over Arkit or Vue/Nuxt TodoMVC but was unable to find arkit.json which could solve my problem, issue # 28 wrt user "karevn" occurs when I tried to alter arkit.json like this
{ "type": "Dependency", "patterns": ["node_modules/*"] },

Can't load customized config file.

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

CloudFront cannot establish a connection with the origin 504

Bug description:

<H1>504 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.

To Reproduce

  1. Operating system
    Linux but not sure this is relevant
  2. Arkit version and CLI arguments
    just npx arkit
  3. Arkit config, if any was used
    none
  4. Source code example, if it's possible
    NA

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Hi! This project looks very interesting. I wanted to try it with a somewhat medium project of mine, and it throws the following error:

`arkit

<--- Last few GCs --->

[3367:0x2768af0] 53796 ms: Scavenge 1382.2 (1424.7) -> 1381.5 (1425.2) MB, 4.3 / 0.0 ms (average mu = 0.300, current mu = 0.258) allocation failure
[3367:0x2768af0] 53802 ms: Scavenge 1382.2 (1425.2) -> 1381.6 (1425.7) MB, 4.3 / 0.0 ms (average mu = 0.300, current mu = 0.258) allocation failure
[3367:0x2768af0] 53807 ms: Scavenge 1382.4 (1425.7) -> 1381.8 (1426.2) MB, 3.4 / 0.0 ms (average mu = 0.300, current mu = 0.258) allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0x329731dcfc5d]

Security context: 0x1dd77731d971
1: next [0x1dd777319711](this=0x2a7e75a871c1 )
2: /* anonymous */ [0x10b6bb2d4ec1] [/app/frontend/node_modules/ts-morph/dist/utils/ArrayUtils.js:~59] [pc=0x329735b54ad8](this=0x337c958302c1 <JSFunction ArrayUtils (sfi = 0x10b6bb2d40d9)>,0x2a7e75a871c1 )
3: /...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20190226.145847.3367.001.json
Node.js report completed
1: 0x953b10 node::Abort() [node]
2: 0x9547f4 node::OnFatalError(char const*, char const*) [node]
3: 0xb32bee v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb32e24 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xf32452 [node]
6: 0xf32558 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
7: 0xf3ec78 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xf3f78b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf424c1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xf0c6f4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
11: 0x11c2b3e v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0x329731dcfc5d
Aborted (core dumped)`

would you know if there's something I could try to fix this? Also let me know if you need the report.

Cheers!

Not implemented feature for syntax kind 'ObjectBindingPattern' / 'ArrayBindingPattern'

Bug description

To Reproduce

  1. Operating system - Ubuntu 17.10

  2. Arkit version and CLI arguments - 1.5.0
    LEVEL=trace npx arkit -o arkit.svg > arkit-logs.txt

  3. Arkit config, if any was used - no

  4. Source code example, if it's possible - no


There is html file in arkit.svg:

<!DOCTYPE html>
	<html>
	  <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta charset="utf-8">
		<title>Application Error</title>
		<style media="screen">
		  html,body,iframe {
			margin: 0;
			padding: 0;
		  }
		  html,body {
			height: 100%;
			overflow: hidden;
		  }
		  iframe {
			width: 100%;
			height: 100%;
			border: 0;
		  }
		</style>
	  </head>
	  <body>
		<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
	  </body>
	</html>

There are some errors in logs:

[2019-03-26 09:52:49.137 +0000] �[33mWARN �[39m: �[36mNot implemented feature for syntax kind 'ObjectBindingPattern'.�[39m
    Error: Not implemented feature for syntax kind 'ObjectBindingPattern'.
        at NotImplementedError.BaseError [as constructor] (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/BaseError.js:8:28)
        at new NotImplementedError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/NotImplementedError.js:10:23)
        at Object.getNotImplementedForSyntaxKindError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/helpers.js:79:12)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getNameNode (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:35:34)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getName (/home/ITRANSITION.CORP/d.semigradsky/.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:42:33)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:57:28)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.InitializerSetExpressionableNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/initializer/InitializerSetExpressionableNode.js:50:43)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.TypedNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/TypedNode.js:85:43)

and

[2019-03-26 09:52:50.002 +0000] �[33mWARN �[39m: �[36mNot implemented feature for syntax kind 'ArrayBindingPattern'.�[39m
    Error: Not implemented feature for syntax kind 'ArrayBindingPattern'.
        at NotImplementedError.BaseError [as constructor] (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/BaseError.js:8:28)
        at new NotImplementedError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/NotImplementedError.js:10:23)
        at Object.getNotImplementedForSyntaxKindError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/helpers.js:79:12)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getNameNode (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:35:34)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getName (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:42:33)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:57:28)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.InitializerSetExpressionableNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/initializer/InitializerSetExpressionableNode.js:50:43)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.TypedNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/TypedNode.js:85:43)

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Configuration option 'packageRules[0].node' should be a json object, Invalid configuration option: arkit, Invalid configuration option: author, Invalid configuration option: bin, Invalid configuration option: bugs, Invalid configuration option: eslintConfig, Invalid configuration option: eslintIgnore, Invalid configuration option: homepage, Invalid configuration option: jest, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: packageRules[1].@types/jest, Invalid configuration option: packageRules[1].@types/node, Invalid configuration option: packageRules[1].@types/pino, Invalid configuration option: packageRules[1].@types/progress, Invalid configuration option: packageRules[1].@types/resolve, Invalid configuration option: packageRules[1].@types/yargs, Invalid configuration option: packageRules[1].@typescript-eslint/eslint-plugin, Invalid configuration option: packageRules[1].@typescript-eslint/parser, Invalid configuration option: packageRules[1].eslint, Invalid configuration option: packageRules[1].eslint-config-prettier, Invalid configuration option: packageRules[1].eslint-plugin-import, Invalid configuration option: packageRules[1].eslint-plugin-node, Invalid configuration option: packageRules[1].eslint-plugin-prettier, Invalid configuration option: packageRules[1].jest, Invalid configuration option: packageRules[1].prettier, Invalid configuration option: packageRules[1].ts-jest, Invalid configuration option: packageRules[1].tslint, Invalid configuration option: packageRules[1].typescript, Invalid configuration option: packageRules[1].typescript-json-schema, Invalid configuration option: packageRules[1].worldstar, Invalid configuration option: packageRules[2].nanomatch, Invalid configuration option: packageRules[2].pino, Invalid configuration option: packageRules[2].pino-pretty, Invalid configuration option: packageRules[2].progress, Invalid configuration option: packageRules[2].resolve, Invalid configuration option: packageRules[2].ts-morph, Invalid configuration option: packageRules[2].tsconfig-paths, Invalid configuration option: packageRules[2].yargs, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: types, Invalid configuration option: version, The "node" object can only be configured at the top level of a config but was found inside "packageRules[0]"

TypeError: componentsByName[component.name].push is not a function

Bug Description
when I try to get the diagram of my NodeJS file I use the command "npx arkit -f .\code\code.js -o code.svg"
I got this error
orignalcode\node_modules\arkit\dist\generator.js:124
componentsByName[component.name].push(component);
^

TypeError: componentsByName[component.name].push is not a function

can anyone help me please to get over this error?

"npx arkit src/ -o arkit.svg " gives npm ERR! errno -4048

npx arkit src/ -o arkit.svg on Windows 10 results in

C:\javasource\ngx-datatable-master>npx arkit src/ -o arkit.svg
npm ERR! path C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343' -> 'C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json'
npm ERR! { [Error: EPERM: operation not permitted, rename 'C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343' -> 'C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343' -> 'C:\dev\npm-cache-current_npx\2900\node_modules\arkit\node_modules\base\package.json'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! 'C:\dev\npm-cache-current\_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343',
npm ERR! dest:
npm ERR! 'C:\dev\npm-cache-current\_npx\2900\node_modules\arkit\node_modules\base\package.json' },
npm ERR! stack:
npm ERR! "Error: EPERM: operation not permitted, rename 'C:\dev\npm-cache-current\_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343' -> 'C:\dev\npm-cache-current\_npx\2900\node_modules\arkit\node_modules\base\package.json'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! 'C:\dev\npm-cache-current\_npx\2900\node_modules\arkit\node_modules\base\package.json.3809823343',
npm ERR! dest:
npm ERR! 'C:\dev\npm-cache-current\_npx\2900\node_modules\arkit\node_modules\base\package.json',
npm ERR! parent: 'arkit' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR! C:\dev\npm-cache-current_logs\2019-08-05T09_54_42_228Z-debug.log
Install for arkit@latest failed with code 4294963248

root paths

I want arkit to resolve "/something" as ./src/something.js - as my parcel do.

arkit must use standard jsconfig.json configuration:

{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
      "/src/*": ["./src/*"]
    },
...

or some alternative in schema config

Arkit crashes when parsing node_modules wrt .js file extensions

Bug description

To Reproduce

  1. Operating system
    Windows 10

  2. Arkit version and CLI arguments
    Version
    1.6.4
    CLI arguments
    npx arkit --config

  3. Arkit config, if any was used
    { "$schema": "https://arkit.pro/schema.json", "excludePatterns": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"], "components": [ { "type": "Dependency", "patterns": ["node_modules/**/*.js"] }, { "type": "Component", "patterns": ["**/*.js", "**/*.jsx"] } ], "output": [ { "path": "arkit.svg", "groups": [ { "first": true, "components": ["Component"] }, { "type": "Dependencies", "components": ["Dependency"] } ] } ] }

  4. Source code example, if it's possible
    Source code cannot be provided due to the privacy of the codebase

I posted the #428 yesterday, in which I needed help, although I figured out how to extract package.json dependencies from node_modules it seems like arkit crashes when used in medium-large projects like in issue #28

Problem with module.exports whitout class name

I'm use your lib arkit for read my node-js microservices.
Is a very good tool, but I have a problem with js files when developers make direct use de module.exports = ({}) and not declare the class by name.
Exists a solution for this problem?

To Reproduce
module.exports = ({
config,
routerRegister,
httpErrorMiddleware,
notFoundMiddleware,
healthCheckMiddleware,
swaggerMiddleware,
}) => { content of class }

How detect dependencies with aliases

There is an alias "@" in my project, and arkit cannot catch this dependency.
For example:
Main.vue
import callAdapter from '@/modules/callAdapter';

2019-03-26_14-50-42

  1. Windows 10
  2. 1.5.0

502 Bad gateway

I am getting 502 gateway in my arkit.svg file

To Reproduce

  1. Operating system
    Windows 10

  2. Arkit version and CLI arguments
    1.6.2
    npx arkit src/ -o arkit.svg

  3. Arkit config, if any was used
    The arkit said me this was used

{
  "components": [
    {
      "type": "Dependency",
      "patterns": [
        "node_modules/*"
      ]
    },
    {
      "type": "Component",
      "patterns": [
        "**/*.ts",
        "**/*.js",
        "**/*.jsx",
        "**/*.tsx"
      ]
    },
    {
      "type": "Vue",
      "format": "full",
      "patterns": [
        "**/*.vue"
      ]
    }
  ],
  "excludePatterns": [
    "..\\test",
    "..\\tests",
    "..\\dist",
    "..\\coverage",
    "..\\**\\*.test.*",
    "..\\**\\*.spec.*",
    "..\\**\\*.min.*"
  ],
  "output": [
    {
      "path": [
        "..\\arkit.svg"
      ],
      "groups": [
        {
          "first": true,
          "components": [
            "Component",
            "Vue"
          ]
        },
        {
          "type": "Dependencies",
          "components": [
            "Dependency"
          ]
        }
      ]
    }
  ]
}
  1. Source code example, if it's possible
    just running the command

arkit.svg contains:

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • nanomatch ^1.2.13
  • pino ^8.0.0
  • pino-pretty ^11.0.0
  • progress ^2.0.3
  • resolve ^1.20.0
  • ts-morph ^22.0.0
  • tsconfig-paths ^4.0.0
  • yargs ^17.0.0
  • @types/jest 29.5.12
  • @types/node 20.12.7
  • @types/pino 7.0.5
  • @types/progress 2.0.7
  • @types/resolve 1.20.6
  • @types/yargs 17.0.32
  • @typescript-eslint/eslint-plugin 7.7.1
  • @typescript-eslint/parser 7.7.1
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-n 17.2.1
  • eslint-plugin-prettier 5.1.3
  • jest 29.7.0
  • prettier 3.2.5
  • ts-jest 29.1.2
  • tslint 6.1.3
  • typescript 5.4.5
  • typescript-json-schema 0.63.0
  • worldstar 1.2.3
  • node >= 8.11.0
travis
.travis.yml
  • node 10

  • Check this box to trigger a request for Renovate to run again on this repository

Allow CLI option to explicitly provide config path

Is your feature request related to a problem?
The graphs produced by this package have really helped me organize a larger project I'm working on. There are many different groups of components in the system though, and I would like to be able to generate graphs for each group, by itself, as well as for the system as a whole. If there were a command line option to specify a config file, I would be able to save a config file for each group that I want a graph for, then just provide the appropriate filename when calling arkit.

Describe the solution you'd like
Just a simple command line option that allows config file specification instead of just assuming arkit.json or the contents of package.json.

Describe alternatives you've considered
Right now so far as I can tell this means I have to reach in and edit arkit.json every time.

Exclusion does not work

Exclude does not work

To Reproduce

  1. os: ubuntu
  2. markit version: 1.6.2 command: npx arkit -o arkit.svg --exclude *test*
  3. no config file
  4. clone this https://github.com/rohanjr/create-daml-app

TypeScript: import types ignored

Since TypeScript 2.9 there are import-types. At the moment arkit does not understand this kind of imports.

To Reproduce

  1. OSX 10.14.3
  2. 1.5.3
// types.ts
export interface Foo {}

// index.ts
type Foo = import('./types').Foo;

export class Bar {
  constructor(private foo: Foo) {}
}

Arkit crash during running on medium size project

Bug description

To Reproduce

  1. Operating system
    Ubuntu 16/04
  2. Arkit version and CLI arguments
    1.3.13
╰─$ node --version
v10.15.2

  1. Arkit config, if any was used
{
  "components": [
    {
      "type": "Dependency",
      "patterns": [
        "node_modules/*"
      ]
    },
    {
      "type": "Component",
      "patterns": [
        "**/*.ts",
        "**/*.js",
        "**/*.jsx",
        "**/*.tsx"
      ]
    }
  ],
  "excludePatterns": [
    "test",
    "tests",
    "dist",
    "coverage",
    "**/*.test.*",
    "**/*.spec.*",
    "**/*.min.*"
  ],
  "output": [
    {
      "path": [
        "svg"
      ],
      "groups": [
        {
          "first": true,
          "components": [
            "Component"
          ]
        },
        {
          "type": "Dependencies",
          "components": [
            "Dependency"
          ]
        }
      ]
    }
  ]
}

  1. Source code example, if it's possible
    I run on my project, so cant share it whole source base

Arkit does not generate architecture visualization

Bug description

Arkit does not generate architecture visualization and gets stuck during architecture generation as shown in the following picture
1

I tested it on both OS namely windows 10 and ubuntu 18.04.5, and used different repos, even those Github repos on which arkit worked perfectly a week earlier

To Reproduce
1. Operating system

Windows 10
Ubuntu 18.04.5 LTS

2. Arkit version and CLI arguments

Version: 1.6.4 
npx arkit

3. Arkit config, if any was used

Script: "arkit": "arkit -o arkit.svg",

4. Source code example, if it's possible

Opening and ending tag mismatch: meta line 0 and head

Bug description

error on line 22 at column 11: Opening and ending tag mismatch: meta line 0 and head

  1. Ubuntu 16.04
  2. 1.3.17, -
  3. { "components": [ { "type": "Entry", "patterns": [ "src/*.js" ] }, { "type": "Lib", "patterns": [ "src/lib" ] }, { "type": "Blockchain", "patterns": [ "src/blockchain" ] }, { "type": "Component", "patterns": [ "src/**/*.js" ], "excludePatterns": [ "**/__tests__/**", "**/*-test.js" ] } ], "excludePatterns": [ "test", "tests", "dist", "coverage", "**/*.test.*", "**/*.spec.*", "**/*.min.*" ], "output": [ { "path": [ "arkit.svg" ], "groups": [ { "first": true, "components": [ "Entry" ], "patterns": [ "src/index.js" ] }, { "type": "Redux", "patterns": [ "src/redux/**" ] }, { "type": "Components", "patterns": [ "src/components/**" ] }, { "type": "Containers", "patterns": [ "src/containers/**" ] }, { "components": [ "Component", "Entry", "Lib", "Blockchain" ] } ] } ] }

image

Teleporters

When the application grows it's become harder and hander to trace connections, and wiring become an issue.

For example, this graph should be simple, as long as the application is really super small

Screen Shot 2019-10-27 at 8 40 07 am

However - what if some group, for a some another group would be represented locally, just next to it?

  • easy to trace which dependencies are used by some group
  • easier to wire the graph
  • less noise

Describe the solution you'd like
A special flag on a group, to indicate that it could be represented on per-other-group basic.

Describe alternatives you've considered
"microservices/frontends", or just separate configs for different groups isolating them could be a better option, however, you will lose observability.

Object.values is not a function

Bug description
Object.values is not a function

To Reproduce

  1. Windows 10
  2. 1.3.17 npx arkit src/ -o arkit.svg
  3. --
  4. onStateChanged(evt) { const isEmpty = value => value === ''; const isReset = isEmpty(evt.target.value); const user = { ...this.state.user, [evt.target.id]: evt.target.value }; const isFormComplete = !isReset && !Object.values(user).some(isEmpty); this.setState({ user, isFormComplete }); }

Class function part of graph

Describe the solution you'd like
Would love to be able to parse classes and include function relations in the graph.

Question - Asking to learn

hi @dyatko thanks for making this project and sharing it.

I created https://github.com/imvetri/ui-editor where I built a concept tool that can generate component code from a minimal code and also I found a way to generate code from configuration. I mean, as an user, I'll design a component, design variants with interaction, it will generate code targeting a particular framework of choice, for concept I generated against reactJS's component syntax.

I'm trying to do a reverse of what I did earlier. Earlier concept saves component information in form of configuration, and generates code based on string manipulation. Now, I'm trying to find some inspiration or ideas or clues to scan a code base and reduce it down to configuration.

I came across your project and it is able to trace the function call flow. Do you have any ideas or suggestion on reducing a frontend code base down to configuration states of show / hide of different combination of component and its variants?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.