Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@sport-activities/nuxt-di
Advanced tools
Basic DI that give you access to your services as singletons through this.$services
npm i -S @nuxt-modules/di --registry http://nexus3.osiris.withoxylane.com/repository/JSCorp/
In nuxt.config.js
modules: [
...,
['@nuxt-modules/di', {
baseUrl: process.env.BASE_URL
}],
...
]
Nuxt context is automatically injected as first argument of service constructor and you can pass custom data through module options (see example below)
Service classes as to be in a services
folder in the project root.
Adds babel es6 decorator support
npm i -S babel-plugin-transform-decorators-legacy
In nuxt.config.js
build: {
babel: {
'plugins': ['transform-decorators-legacy']
},
...
}
Then you have tag your services with the @injectable()
decorator.
import injectable from '@nuxt-modules/di/decorators'
@injectable('myUserService')
export default class User {
constructor ({ app }, { baseUrl }) {
this.app = app
this.BASE_URL = baseUrl
}
...
}
For example, this service will be then accessible through this.$services.myUserService
Decorator basically just adds a getInjectableName(void): string
method to injected service. So you can avoid decorators usage if you implements the method on your own.
export default class User {
constructor ({ app }, { baseUrl }) {
this.app = app
this.BASE_URL = baseUrl
}
getInjectableName() {
return 'myUserService'
}
}
FAQs
Dependency Injector
We found that @sport-activities/nuxt-di demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.