Socket
Socket
Sign inDemoInstall

druxt

Package Overview
Dependencies
74
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.17.0 to 0.18.0

39

dist/druxt.esm.js

@@ -12,3 +12,3 @@ import chalk from 'chalk';

var name = "druxt";
var version = "0.17.0";
var version = "0.18.0";
var description = "The Fully Decoupled Drupal Framework for Nuxt.js.";

@@ -51,4 +51,4 @@ var keywords = [

var dependencies = {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/proxy": "^2.1.0",
axios: "^0.21.1",
chalk: "^4.1.2",

@@ -65,2 +65,3 @@ deepmerge: "^4.2.2",

var peerDependencies = {
axios: "*",
consola: "*"

@@ -130,2 +131,10 @@ };

}
if (!options.axios) {
this.options.axios = {
baseURL: options.baseUrl,
proxy: !!this.options.proxy,
...this.options.axios
};
this.addModule("@nuxtjs/axios");
}
this.nuxt.hook("components:dirs", (dirs) => {

@@ -142,6 +151,9 @@ dirs.push({ path: join(__dirname, "components") });

plugins = typeof extendPlugins === "function" ? extendPlugins(plugins) : plugins;
const index = plugins.findIndex(({ src }) => src === `${this.options.buildDir}/druxt.js`);
const plugin = plugins[index];
plugins.splice(index, 1);
plugins.unshift(plugin);
const axiosIndex = plugins.findIndex(({ src }) => src === `${this.options.buildDir}/axios.js`);
const axiosPlugin = plugins[axiosIndex];
plugins.splice(axiosIndex, 1);
const druxtIndex = plugins.findIndex(({ src }) => src === `${this.options.buildDir}/druxt.js`);
const druxtPlugin = plugins[druxtIndex];
plugins.splice(druxtIndex, 1);
plugins = [axiosPlugin, druxtPlugin, ...plugins];
return plugins;

@@ -173,10 +185,11 @@ };

}
let axiosSettings = {};
if (baseUrl && !(options.proxy || {}).api) {
axiosSettings.baseURL = baseUrl;
this.axios = {};
if (typeof options.axios === "function") {
this.axios = options.axios;
} else {
this.axios = axios.create({
...options.axios || {},
baseURL: baseUrl
});
}
if (typeof options.axios === "object") {
axiosSettings = Object.assign(axiosSettings, options.axios);
}
this.axios = axios.create(axiosSettings);
if (options.debug) {

@@ -183,0 +196,0 @@ const log = this.log;

@@ -25,3 +25,3 @@ 'use strict';

var name = "druxt";
var version = "0.17.0";
var version = "0.18.0";
var description = "The Fully Decoupled Drupal Framework for Nuxt.js.";

@@ -64,4 +64,4 @@ var keywords = [

var dependencies = {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/proxy": "^2.1.0",
axios: "^0.21.1",
chalk: "^4.1.2",

@@ -78,2 +78,3 @@ deepmerge: "^4.2.2",

var peerDependencies = {
axios: "*",
consola: "*"

@@ -143,2 +144,10 @@ };

}
if (!options.axios) {
this.options.axios = {
baseURL: options.baseUrl,
proxy: !!this.options.proxy,
...this.options.axios
};
this.addModule("@nuxtjs/axios");
}
this.nuxt.hook("components:dirs", (dirs) => {

@@ -155,6 +164,9 @@ dirs.push({ path: path.join(__dirname, "components") });

plugins = typeof extendPlugins === "function" ? extendPlugins(plugins) : plugins;
const index = plugins.findIndex(({ src }) => src === `${this.options.buildDir}/druxt.js`);
const plugin = plugins[index];
plugins.splice(index, 1);
plugins.unshift(plugin);
const axiosIndex = plugins.findIndex(({ src }) => src === `${this.options.buildDir}/axios.js`);
const axiosPlugin = plugins[axiosIndex];
plugins.splice(axiosIndex, 1);
const druxtIndex = plugins.findIndex(({ src }) => src === `${this.options.buildDir}/druxt.js`);
const druxtPlugin = plugins[druxtIndex];
plugins.splice(druxtIndex, 1);
plugins = [axiosPlugin, druxtPlugin, ...plugins];
return plugins;

@@ -186,10 +198,11 @@ };

}
let axiosSettings = {};
if (baseUrl && !(options.proxy || {}).api) {
axiosSettings.baseURL = baseUrl;
this.axios = {};
if (typeof options.axios === "function") {
this.axios = options.axios;
} else {
this.axios = axios__default['default'].create({
...options.axios || {},
baseURL: baseUrl
});
}
if (typeof options.axios === "object") {
axiosSettings = Object.assign(axiosSettings, options.axios);
}
this.axios = axios__default['default'].create(axiosSettings);
if (options.debug) {

@@ -196,0 +209,0 @@ const log = this.log;

{
"name": "druxt",
"version": "0.17.0",
"version": "0.18.0",
"description": "The Fully Decoupled Drupal Framework for Nuxt.js.",

@@ -41,4 +41,4 @@ "keywords": [

"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/proxy": "^2.1.0",
"axios": "^0.21.1",
"chalk": "^4.1.2",

@@ -55,2 +55,3 @@ "deepmerge": "^4.2.2",

"peerDependencies": {
"axios": "*",
"consola": "*"

@@ -57,0 +58,0 @@ },

import { DruxtClient } from 'druxt'
export default (context, inject) => {
export default ({ app }, inject) => {
const options = <%= JSON.stringify(options) %>

@@ -11,2 +11,11 @@

<% if (typeof options.axios === 'object') { %>
// Axios settings.
console.warn('[druxt] Axios instance settings are deprecated, use @nuxtjs/axios module configuration instead.')
options.axios = <%= JSON.stringify(options.axios) %>
<% } else { %>
// Use the @nuxtjs/axios module Axios instance.
options.axios = app.$axios
<% } %>
const druxt = new DruxtClient(options.baseUrl, options)

@@ -13,0 +22,0 @@ druxt.settings = options

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc