Skip to content

Commit

Permalink
fix: Windows paths for custom client configuration files (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Feb 27, 2023
1 parent 3a9b90d commit bdea5fd
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/core/options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import merge from 'lodash.mergewith'
// @ts-ignore
import { relativeTo } from '@nuxt/utils'
import * as Integrations from '@sentry/integrations'
import { canInitialize } from './utils'

Expand Down Expand Up @@ -124,6 +126,7 @@ export async function resolveClientOptions (moduleContainer, moduleOptions, logg
let clientConfigPath
if (typeof (options.clientConfig) === 'string') {
clientConfigPath = moduleContainer.nuxt.resolver.resolveAlias(options.clientConfig)
clientConfigPath = relativeTo(moduleContainer.options.buildDir, clientConfigPath)
} else {
options.config = merge(options.config, options.clientConfig)
}
Expand All @@ -143,6 +146,7 @@ export async function resolveClientOptions (moduleContainer, moduleOptions, logg
if (options.customClientIntegrations) {
if (typeof (options.customClientIntegrations) === 'string') {
customClientIntegrations = moduleContainer.nuxt.resolver.resolveAlias(options.customClientIntegrations)
customClientIntegrations = relativeTo(moduleContainer.options.buildDir, customClientIntegrations)
} else {
logger.warn(`Invalid customClientIntegrations option. Expected a file path, got "${typeof (options.customClientIntegrations)}".`)
}
Expand Down
1 change: 1 addition & 0 deletions lib/plugin.client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/order */
import Vue from 'vue'
import merge from '~lodash.mergewith'
import * as Sentry from '~@sentry/vue'
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin.lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function attemptLoadSentry (ctx, inject) {

if (!window.<%= globals.nuxt %>) {
<% if (options.dev) { %>
console.warn(`$sentryLoad was called but window.<%= globals.nuxt %> is not available, delaying sentry loading until onNuxtReady callback. Do you really need to use lazy loading for Sentry?`)
console.warn('$sentryLoad was called but window.<%= globals.nuxt %> is not available, delaying sentry loading until onNuxtReady callback. Do you really need to use lazy loading for Sentry?')
<% } %>
<% if (options.lazy.injectLoadHook) { %>
window.<%= globals.readyCallback %>(() => loadSentry(ctx, inject))
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
}
},
"dependencies": {
"@nuxt/utils": "2.x",
"@sentry/integrations": "^7.38.0",
"@sentry/node": "^7.38.0",
"@sentry/vue": "^7.38.0",
Expand Down
49 changes: 49 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,24 @@
ua-parser-js "^0.7.28"
ufo "^0.7.4"

"@nuxt/[email protected]":
version "2.16.0"
resolved "https://registry.yarnpkg.com/@nuxt/utils/-/utils-2.16.0.tgz#dfb7eb2da446e152ff9b382c045a2be172f22407"
integrity sha512-/6eLMKYn/hFr17HNtcgIHaO1rKqrSfGxABPQCikLIpq/hRcXz0tCQHgwLfG9nEzFyY7fzulPIICjRB9EEEe3tA==
dependencies:
consola "^2.15.3"
create-require "^1.1.1"
fs-extra "^10.1.0"
hash-sum "^2.0.0"
jiti "^1.16.2"
lodash "^4.17.21"
proper-lockfile "^4.1.2"
semver "^7.3.8"
serialize-javascript "^6.0.1"
signal-exit "^3.0.7"
ua-parser-js "^1.0.33"
ufo "^1.0.1"

"@nuxt/[email protected]":
version "2.15.8"
resolved "https://registry.yarnpkg.com/@nuxt/vue-app/-/vue-app-2.15.8.tgz#46b7ec8fc93f8d1f4cdf4f6b04134cb40ceb7c4a"
Expand Down Expand Up @@ -6171,6 +6189,15 @@ from2@^2.1.0:
inherits "^2.0.1"
readable-stream "^2.0.0"

fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
Expand Down Expand Up @@ -7942,6 +7969,11 @@ jest@^29.3.1:
import-local "^3.0.2"
jest-cli "^29.3.1"

jiti@^1.16.2:
version "1.17.1"
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.17.1.tgz#264daa43ee89a03e8be28c3d712ccc4eb9f1e8ed"
integrity sha512-NZIITw8uZQFuzQimqjUxIrIcEdxYDFIe/0xYfIlVXTkiBjjyBEvgasj5bb0/cHtPRD/NziPbT312sFrkI5ALpw==

jiti@^1.9.2:
version "1.16.0"
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.16.0.tgz#f72065954446ad1866fa8d6bcc3bed3cc1cebdaa"
Expand Down Expand Up @@ -11228,6 +11260,13 @@ serialize-javascript@^6.0.0:
dependencies:
randombytes "^2.1.0"

serialize-javascript@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c"
integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==
dependencies:
randombytes "^2.1.0"

serve-placeholder@^1.2.3:
version "1.2.4"
resolved "https://registry.yarnpkg.com/serve-placeholder/-/serve-placeholder-1.2.4.tgz#513eac9c435272c7fe9a86612c852ae9b1467fd4"
Expand Down Expand Up @@ -12255,6 +12294,11 @@ ua-parser-js@^0.7.28:
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.32.tgz#cd8c639cdca949e30fa68c44b7813ef13e36d211"
integrity sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==

ua-parser-js@^1.0.33:
version "1.0.33"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.33.tgz#f21f01233e90e7ed0f059ceab46eb190ff17f8f4"
integrity sha512-RqshF7TPTE0XLYAqmjlu5cLLuGdKrNu9O1KLA/qp39QtbZwuzwv1dT46DZSopoUMsYgXpB3Cv8a03FI8b74oFQ==

ufo@^0.7.4:
version "0.7.11"
resolved "https://registry.yarnpkg.com/ufo/-/ufo-0.7.11.tgz#17defad497981290383c5d26357773431fdbadcb"
Expand All @@ -12265,6 +12309,11 @@ ufo@^1.0.0:
resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.0.1.tgz#64ed43b530706bda2e4892f911f568cf4cf67d29"
integrity sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==

ufo@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.1.tgz#e70265e7152f3aba425bd013d150b2cdf4056d7c"
integrity sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==

uglify-js@^3.1.4, uglify-js@^3.5.1:
version "3.17.4"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c"
Expand Down

0 comments on commit bdea5fd

Please sign in to comment.