@nuxtjs/strapi
Advanced tools
Comparing version 0.1.10 to 0.3.0
@@ -5,2 +5,16 @@ # Changelog | ||
## [0.3.0](https://github.com/nuxt-community/strapi-module/compare/v0.1.11...v0.3.0) (2021-01-19) | ||
### [0.1.13](https://github.com/nuxt-community/strapi-module/compare/v0.1.11...v0.1.13) (2021-01-19) | ||
### [0.1.12](https://github.com/nuxt-community/strapi-module/compare/v0.1.11...v0.1.12) (2021-01-19) | ||
### [0.1.11](https://github.com/nuxt-community/strapi-module/compare/v0.1.9...v0.1.11) (2021-01-19) | ||
### Features | ||
* added typescript support and updated docs accordingly ([#94](https://github.com/nuxt-community/strapi-module/issues/94)) ([64f1927](https://github.com/nuxt-community/strapi-module/commit/64f1927c2a412d0b8c0c8920431b1dbe30f35f2b)) | ||
* module improvements ([#96](https://github.com/nuxt-community/strapi-module/issues/96)) ([de5be3b](https://github.com/nuxt-community/strapi-module/commit/de5be3b72ad36e5e531cca1c5fe6d50d15ec51dc)) | ||
### [0.1.10](https://github.com/nuxt-community/strapi-module/compare/v0.1.9...v0.1.10) (2021-01-08) | ||
@@ -7,0 +21,0 @@ |
@@ -1,28 +0,44 @@ | ||
const { resolve } = require('path') | ||
const defu = require('defu') | ||
'use strict'; | ||
const defaults = { | ||
url: process.env.STRAPI_URL || 'http://localhost:1337', | ||
entities: [] | ||
} | ||
const path = require('path'); | ||
const defu2 = require('defu'); | ||
const ms2 = require('ms'); | ||
module.exports = async function (moduleOptions) { | ||
const { nuxt } = this | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
const options = defu(moduleOptions, nuxt.options.strapi, defaults) | ||
const defu2__default = /*#__PURE__*/_interopDefaultLegacy(defu2); | ||
const ms2__default = /*#__PURE__*/_interopDefaultLegacy(ms2); | ||
nuxt.options.publicRuntimeConfig = nuxt.options.publicRuntimeConfig || {} | ||
nuxt.options.publicRuntimeConfig.strapi = nuxt.options.publicRuntimeConfig.strapi || {} | ||
nuxt.options.publicRuntimeConfig.strapi.url = options.url | ||
var name = "@nuxtjs/strapi"; | ||
var version = "0.1.11"; | ||
const defaults = { | ||
url: process.env.STRAPI_URL || "http://localhost:1337", | ||
entities: [], | ||
key: "strapi_jwt", | ||
expires: "session", | ||
cookie: {} | ||
}; | ||
async function strapiModule(moduleOptions) { | ||
const {nuxt} = this; | ||
const options = defu2__default['default'](moduleOptions, nuxt.options.strapi, defaults); | ||
if (typeof options.expires === "string" && options.expires !== "session") { | ||
options.expires = ms2__default['default'](options.expires); | ||
} | ||
nuxt.options.publicRuntimeConfig = nuxt.options.publicRuntimeConfig || {}; | ||
nuxt.options.publicRuntimeConfig.strapi = nuxt.options.publicRuntimeConfig.strapi || {}; | ||
nuxt.options.publicRuntimeConfig.strapi.url = options.url; | ||
const runtimeDir = path.resolve(__dirname, "runtime"); | ||
nuxt.options.alias["~strapi"] = runtimeDir; | ||
nuxt.options.build.transpile.push(runtimeDir, "destr", "requrl", "hookable", "ufo"); | ||
this.addPlugin({ | ||
src: resolve(__dirname, 'plugin.js'), | ||
fileName: 'strapi.js', | ||
src: path.resolve(runtimeDir, "plugin.js"), | ||
fileName: "strapi.js", | ||
options | ||
}) | ||
await this.requireModule('@nuxt/http') | ||
await this.requireModule('cookie-universal-nuxt') | ||
}); | ||
await this.requireModule("@nuxt/http"); | ||
await this.requireModule("cookie-universal-nuxt"); | ||
} | ||
strapiModule.meta = {name, version}; | ||
module.exports.meta = require('../package.json') | ||
module.exports = strapiModule; |
{ | ||
"name": "@nuxtjs/strapi", | ||
"version": "0.1.10", | ||
"description": "Strapi module for NuxtJS", | ||
"version": "0.3.0", | ||
"description": "Strapi module for Nuxt", | ||
"repository": "nuxt-community/strapi-module", | ||
"license": "MIT", | ||
"author": "NuxtJS", | ||
"contributors": [ | ||
{ | ||
"name": "Benjamin Canac <canacb1@gmail.com>" | ||
} | ||
], | ||
"sideEffects": false, | ||
"main": "lib/module.js", | ||
"typings": "./types/index.d.ts", | ||
"files": [ | ||
"lib" | ||
"lib", | ||
"types" | ||
], | ||
"main": "lib/module.js", | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"dev": "nuxt example", | ||
"build": "siroc build && yarn build:runtime", | ||
"build:runtime": "tsc -p tsconfig.runtime.json && copyfiles \"src/runtime/**/*\" -e \"**/*.ts\" -u 2 lib/runtime", | ||
"dev": "yarn nuxt-ts example", | ||
"docs": "nuxt docs", | ||
"lint": "eslint --ext .js,.vue .", | ||
"release": "yarn test && standard-version && git push --follow-tags && npm publish", | ||
"lint": "eslint --ext .ts --ext .vue .", | ||
"release": "yarn test && standard-version && yarn build && git push --follow-tags && npm publish", | ||
"test": "yarn lint && jest" | ||
@@ -27,7 +25,9 @@ }, | ||
"@nuxt/http": "^0.6.2", | ||
"@nuxt/ufo": "^0.5.3", | ||
"cookie-universal-nuxt": "^2.1.4", | ||
"defu": "^3.2.2", | ||
"destr": "^1.0.1", | ||
"hookable": "^4.3.1", | ||
"requrl": "^3.0.2" | ||
"ms": "^2.1.3", | ||
"requrl": "^3.0.2", | ||
"ufo": "^0.5.4" | ||
}, | ||
@@ -37,9 +37,16 @@ "devDependencies": { | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/preset-typescript": "^7.12.7", | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-conventional": "^11.0.0", | ||
"@nuxt/test-utils": "^0.1.2", | ||
"@nuxt/types": "^2.14.12", | ||
"@nuxt/typescript-build": "^2.0.3", | ||
"@nuxt/typescript-runtime": "^2.0.0", | ||
"@nuxtjs/eslint-config": "^5.0.0", | ||
"@nuxtjs/eslint-config-typescript": "^5.0.0", | ||
"@nuxtjs/module-test-utils": "latest", | ||
"@types/jest": "^26.0.20", | ||
"babel-eslint": "latest", | ||
"babel-jest": "^26.6.3", | ||
"copyfiles": "^2.4.1", | ||
"eslint": "^7.17.0", | ||
@@ -49,3 +56,6 @@ "husky": "^4.3.7", | ||
"nuxt": "2.14.12", | ||
"standard-version": "^9.1.0" | ||
"siroc": "^0.6.0", | ||
"standard-version": "^9.1.0", | ||
"ts-loader": "^8.0.14", | ||
"typescript": "^4.1.3" | ||
}, | ||
@@ -52,0 +62,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23036
14
406
8
24
2
1
+ Addeddestr@^1.0.1
+ Addedms@^2.1.3
+ Addedufo@^0.5.4
+ Addedms@2.1.3(transitive)
+ Addedufo@0.5.5(transitive)
- Removed@nuxt/ufo@^0.5.3
- Removed@nuxt/ufo@0.5.4(transitive)