-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: Extract dependency graphing from core as extensions
- Loading branch information
Showing
13 changed files
with
161 additions
and
55 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/injectable-extension-for-dependency-graphing/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Dependency graphing for Injectable in Ogre Tools | ||
|
||
Todo | ||
|
||
## Documentation | ||
|
||
Check unit tests for documentation. |
14 changes: 14 additions & 0 deletions
14
packages/injectable-extension-for-dependency-graphing/babel.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current', | ||
}, | ||
}, | ||
], | ||
|
||
'@babel/react', | ||
], | ||
}; |
19 changes: 19 additions & 0 deletions
19
packages/injectable-extension-for-dependency-graphing/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { DiContainer, InjectionToken } from '@ogre-tools/injectable'; | ||
|
||
declare module '@ogre-tools/injectable-extensions-for-dependency-graphing' { | ||
interface GraphCustomizer { | ||
shouldCustomize: (instance: any) => boolean; | ||
// Todo: add proper typing | ||
customizeLink: (link: any) => void; | ||
customizeNode: (node: any) => void; | ||
} | ||
|
||
export const dependencyGraphCustomizerToken: InjectionToken< | ||
GraphCustomizer, | ||
void | ||
>; | ||
|
||
export function registerDependencyGraphing(di: DiContainer): void; | ||
|
||
export const plantUmlDependencyGraphInjectable: InjectionToken<string, void>; | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/injectable-extension-for-dependency-graphing/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
dependencyGraphCustomizerToken, | ||
plantUmlDependencyGraphInjectable, | ||
registerDependencyGraphing, | ||
} from './src/dependency-graphing'; | ||
|
||
export { | ||
registerDependencyGraphing, | ||
plantUmlDependencyGraphInjectable, | ||
dependencyGraphCustomizerToken, | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/injectable-extension-for-dependency-graphing/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/injectable-extension-for-dependency-graphing/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@ogre-tools/injectable-extensions-for-dependency-graphing", | ||
"private": false, | ||
"version": "5.2.0", | ||
"description": "Dependency graphing for Injectable in Ogre Tools", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ogre-works/ogre-tools" | ||
}, | ||
"main": "build/index.js", | ||
"types": "./index.d.ts", | ||
"keywords": [ | ||
"js" | ||
], | ||
"author": "Ogre Works", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@ogre-tools/fp": "^5.2.0", | ||
"@ogre-tools/injectable": "^5.2.0", | ||
"lodash": "^4.17.21" | ||
}, | ||
"peerDependencies": {}, | ||
"bugs": { | ||
"url": "https://github.com/ogre-works/ogre-tools/issues" | ||
}, | ||
"homepage": "https://github.com/ogre-works/ogre-tools#readme", | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
...eateContainer.dependency-graphing.test.js → ...-graphing/src/dependency-graphing.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...es/injectable-extension-for-dependency-graphing/src/lifecycleEnumForDependencyGraphing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export default { | ||
singleton: { | ||
name: 'Singleton', | ||
shortName: 'S', | ||
color: 'lightGreen', | ||
}, | ||
|
||
keyedSingleton: { | ||
name: 'Keyed', | ||
shortName: 'K', | ||
color: 'pink', | ||
}, | ||
|
||
transient: { | ||
name: 'Transient', | ||
shortName: 'T', | ||
color: 'orchid', | ||
}, | ||
|
||
injectionToken: { | ||
name: 'Transient', | ||
shortName: 'X', | ||
color: 'orange', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import getInjectionToken from './src/getInjectionToken/getInjectionToken'; | ||
import getInjectionToken, { | ||
injectionTokenSymbol, | ||
} from './src/getInjectionToken/getInjectionToken'; | ||
|
||
import getInjectable from './src/getInjectable/getInjectable'; | ||
import lifecycleEnum from './src/dependency-injection-container/lifecycleEnum'; | ||
import createContainer from './src/dependency-injection-container/createContainer'; | ||
|
||
import { | ||
registerDependencyGraphing, | ||
plantUmlDependencyGraphInjectable, | ||
dependencyGraphCustomizerToken, | ||
} from './src/dependency-injection-container/extensions/dependency-graphing/dependency-graphing'; | ||
import createContainer, { | ||
injectionDecoratorToken, | ||
} from './src/dependency-injection-container/createContainer'; | ||
|
||
export { | ||
getInjectionToken, | ||
createContainer, | ||
getInjectable, | ||
getInjectionToken, | ||
injectionDecoratorToken, | ||
injectionTokenSymbol, | ||
lifecycleEnum, | ||
createContainer, | ||
registerDependencyGraphing, | ||
plantUmlDependencyGraphInjectable, | ||
dependencyGraphCustomizerToken, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters