Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuxtjs/strapi

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/strapi - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Changelog

### [0.1.2](https://github.com/nuxt-community/strapi-module/compare/v0.1.1...v0.1.2) (2020-07-16)
### Features
* use runtimeConfig to avoid building when changing Strapi URL ([4442467](https://github.com/nuxt-community/strapi-module/commit/4442467b294ee7352dccf3131682e20b0f89f706))
### Bug Fixes
* update test with new example ([404fdca](https://github.com/nuxt-community/strapi-module/commit/404fdca6f880c685d31c84a20838b5fd5e05b1e0))
### [0.1.1](https://github.com/nuxt-company/strapi-module/compare/v0.1.0...v0.1.1) (2020-07-08)

@@ -7,0 +19,0 @@

3

lib/module.js

@@ -16,3 +16,4 @@ const { resolve } = require('path')

this.options.publicRuntimeConfig = this.options.publicRuntimeConfig || {}
this.options.publicRuntimeConfig.strapiUrl = options.url
this.options.publicRuntimeConfig.strapi = this.options.publicRuntimeConfig.strapi || {}
this.options.publicRuntimeConfig.strapi.url = options.url

@@ -19,0 +20,0 @@ this.addPlugin({

@@ -11,2 +11,4 @@ import Vue from 'vue'

ctx.$config = ctx.$config || {} // fallback for Nuxt < 2.13
const runtimeConfig = ctx.$config.strapi || {}
this.state = Vue.observable({ user: null })

@@ -16,3 +18,3 @@

this.$http = ctx.$http.create({})
this.$http.setBaseURL('<%= options.url %>')
this.$http.setBaseURL(runtimeConfig.url || '<%= options.url %>')
this.$http.onError((err) => {

@@ -144,28 +146,28 @@ const { response: { data: { message: msg } } } = err

<%= JSON.stringify(options.entities) %>.forEach((entity) => {
Object.defineProperty(Strapi.prototype, `$${entity}`, {
get: function () {
const that = this
return {
find: function (...args) {
return that.find(entity, ...args)
},
findOne: function (...args) {
return that.findOne(entity, ...args)
},
count: function (...args) {
return that.count(entity, ...args)
},
create: function (...args) {
return that.create(entity, ...args)
},
update: function (...args) {
return that.update(entity, ...args)
},
delete: function (...args) {
return that.delete(entity, ...args)
Object.defineProperty(Strapi.prototype, `$${entity}`, {
get () {
const that = this
return {
find (...args) {
return that.find(entity, ...args)
},
findOne (...args) {
return that.findOne(entity, ...args)
},
count (...args) {
return that.count(entity, ...args)
},
create (...args) {
return that.create(entity, ...args)
},
update (...args) {
return that.update(entity, ...args)
},
delete (...args) {
return that.delete(entity, ...args)
}
}
}
}
})
})
})

@@ -172,0 +174,0 @@ const strapi = new Strapi(ctx)

{
"name": "@nuxtjs/strapi",
"version": "0.1.1",
"version": "0.1.2",
"description": "",

@@ -23,3 +23,3 @@ "repository": "",

"dependencies": {
"@nuxt/http": "^0.5.7",
"@nuxt/http": "^0.5.9",
"cookie-universal-nuxt": "^2.1.4",

@@ -26,0 +26,0 @@ "defu": "^2.0.4",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc