All Projects → apleshkov → saber

apleshkov / saber

Licence: MIT License
Dependency injection (DI) & Inversion of Control (IoC) command line tool for Swift based on code generation

Programming Languages

swift
15916 projects
Makefile
30231 projects

Projects that are alternatives of or similar to saber

dargo
Dependency Injection for GO
Stars: ✭ 26 (+23.81%)
Mutual labels:  dependency-injection, inversion-of-control
mindjs
Minimalistic, pure Node.js framework superpowered with Dependency Injection 💡 💻 🚀
Stars: ✭ 17 (-19.05%)
Mutual labels:  dependency-injection, inversion-of-control
jimple
Just a dependency injection container to NodeJS and to the browser using new ES6 features
Stars: ✭ 72 (+242.86%)
Mutual labels:  dependency-injection, inversion-of-control
awilix-express
Awilix helpers/middleware for Express
Stars: ✭ 100 (+376.19%)
Mutual labels:  dependency-injection, inversion-of-control
ThunderboltIoc
One of the very first IoC frameworks for .Net that has no reflection. An IoC that casts its services before thunder casts its bolts.
Stars: ✭ 40 (+90.48%)
Mutual labels:  dependency-injection, inversion-of-control
vesselize
⛵ A JavaScript IoC container that works seamlessly with Vue.js and React.
Stars: ✭ 22 (+4.76%)
Mutual labels:  dependency-injection, inversion-of-control
ufw
A minimalist framework for rapid server side applications prototyping in C++ with dependency injection support.
Stars: ✭ 19 (-9.52%)
Mutual labels:  dependency-injection, inversion-of-control
Typhoon
Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
Stars: ✭ 2,711 (+12809.52%)
Mutual labels:  dependency-injection, inversion-of-control
vue-ioc
IoC and DI for Vue powered by InversifyJS and inspired by Angular Module syntactic sugar.
Stars: ✭ 39 (+85.71%)
Mutual labels:  dependency-injection, inversion-of-control
inversify-koa-utils
inversify-koa-utils is a module based on inversify-express-utils. This module has utilities for koa 2 applications development using decorators and IoC Dependency Injection (with inversify)
Stars: ✭ 27 (+28.57%)
Mutual labels:  dependency-injection, inversion-of-control
iocgo
A lightweight Inversion of Control (IoC) (Dependency Injection) container for Golang
Stars: ✭ 36 (+71.43%)
Mutual labels:  dependency-injection, inversion-of-control
telephone-ts
Telephone-ts: The "Event Emitter-less" TypeScript Event Architecture.
Stars: ✭ 22 (+4.76%)
Mutual labels:  dependency-injection, inversion-of-control
waiter
Dependency injection, Inversion of control container for rust with compile time binding.
Stars: ✭ 71 (+238.1%)
Mutual labels:  dependency-injection, inversion-of-control
Components.js
🧩 A semantic dependency injection framework
Stars: ✭ 34 (+61.9%)
Mutual labels:  dependency-injection, inversion-of-control
stashbox
A lightweight, fast, and portable dependency injection framework for .NET-based solutions.
Stars: ✭ 120 (+471.43%)
Mutual labels:  dependency-injection, inversion-of-control
avaje-inject
Dependency injection via APT (source code generation) ala "Server side Dagger DI"
Stars: ✭ 114 (+442.86%)
Mutual labels:  dependency-injection, inversion-of-control
Typedi
Simple yet powerful dependency injection tool for JavaScript and TypeScript.
Stars: ✭ 2,832 (+13385.71%)
Mutual labels:  dependency-injection, inversion-of-control
Inversify Express Example
The official express + inversify+ inversify-express-utils examples
Stars: ✭ 210 (+900%)
Mutual labels:  dependency-injection, inversion-of-control
di
Simple and yet powerful Dependency Injection for Go
Stars: ✭ 188 (+795.24%)
Mutual labels:  dependency-injection, inversion-of-control
Griffin.Container
Inversion of control container with (almost) zero configuration
Stars: ✭ 13 (-38.1%)
Mutual labels:  dependency-injection, inversion-of-control

Saber

Dependency Injection (DI) / Inversion of Control (IoC) command line tool for Swift based on code generation.

Saber requires no frameworks, just parses sources (via SourceKitten), finds annotations and generates containers.

Documentation

Please, see wiki and examples.

Installation

Building on macOS requires Xcode w/ Swift 4.2 and Swift Package Manager.

Mint

$ mint install apleshkov/saber

Homebrew

TODO (not notable enough yet)

Make

Clone & run make install in the root directory of this project.

Run make uninstall to uninstall.

Usage

$ saber help
Available commands:

   help        Display general or command-specific help
   sources     Generate containers from sources
   version     Print current version
   xcodeproj   Generate containers from Xcode project

sources

Saber traverses swift-files --from recursively and generates container classes to --out.

Example: saber sources --workDir . --from Sources --out Sources/Saber

$ saber help sources
Generate containers from sources

[--workDir (string)]
	Working directory (optional)

[--from (string)]
	Directory with sources (is relative to --workDir if any)

[--out (string)]
	Output directory (is relative to --workDir if any)

[--config (string)]
	Path to *.yml or YAML text (optional)

[--log (string)]
	Could be 'info' (by default) or 'debug' (optional)

xcodeproj (on macOS only)

Saber parses Xcode project at --path, traverses enumerated --targets and generates container classes to --out. The main difference from the sources command is an ability to work with Swift modules.

Example: saber xcodeproj --workDir . --path MyProject.xcodeproj --targets Target1,Target2 --out Sources/Saber

$ saber help xcodeproj
Generate containers from Xcode project

[--workDir (string)]
	Working directory (optional)

[--path (string)]
	Path to *.xcodeproj (is relative to --workDir if any)

[--targets (string)]
	Comma-separated list of project target names

[--out (string)]
	Output directory (is relative to --workDir if any)

[--config (string)]
	Path to *.yml or YAML text (optional)

[--log (string)]
	Could be 'info' (by default) or 'debug' (optional)

Configuration

Provide it via --config as text or file:

# Access level for generated classes (internal by default)
accessLevel: internal # public, open, ...
# Identation for generated files (4 spaces by default)
indentation:
    type: space # or tab
    size: 4
# Lazy typealias (see wiki; none by default)
lazyTypealias: LazyInjection

Development

Xcode: clone, run make xcodeproj and then open a generated Saber.xcodeproj. Use make docker_linux_test to test on Linux inside a docker container.

Linux: make clean, make build and make test

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].