@model-w/preset-nuxt3 1.0.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.ts +16 -5
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -235,8 +235,10 @@ export function defineModelWConfig(
235
235
  });
236
236
  const apiUrl =
237
237
  config.apiUrl ||
238
- env.get({ name: "API_URL", buildDefault: "http://localhost" });
238
+ env.get({ name: "NUXT_API_URL", buildDefault: "http://localhost" });
239
239
 
240
+ const proxyTarget = config.apiUrl ||
241
+ env.get({ name: "NUXT_PROXY_OPTIONS_TARGET", buildDefault: "http://localhost" });
240
242
  const backAlias = config.backAlias || "back";
241
243
  const cmsAlias = config.cmsAlias || "wubba-lubba-dub-dub";
242
244
 
@@ -248,11 +250,11 @@ export function defineModelWConfig(
248
250
  );
249
251
 
250
252
  const sentryDsn =
251
- config.sentryDsn || env.get({ name: "SENTRY_DSN", defaultValue: "" });
252
- const environment =
253
+ config.sentryDsn || env.get({ name: "NUXT_PUBLIC_SENTRY_DSN", defaultValue: "" });
254
+ const sentryEnvironment =
253
255
  config.environment ||
254
256
  env.get({
255
- name: "ENVIRONMENT",
257
+ name: "NUXT_PUBLIC_SENTRY_ENVIRONMENT",
256
258
  defaultValue: sentryDsn ? undefined : "",
257
259
  });
258
260
 
@@ -263,6 +265,15 @@ export function defineModelWConfig(
263
265
 
264
266
  runtimeConfig: defu(config.runtimeConfig || {}, {
265
267
  apiUrl,
268
+ proxy: {
269
+ options: { target: proxyTarget },
270
+ },
271
+ public: {
272
+ sentry: {
273
+ dsn: sentryDsn,
274
+ environment: sentryEnvironment,
275
+ },
276
+ },
266
277
  }),
267
278
 
268
279
  proxy: {
@@ -297,7 +308,7 @@ export function defineModelWConfig(
297
308
 
298
309
  sentry: {
299
310
  dsn: sentryDsn,
300
- environment: environment,
311
+ environment: sentryEnvironment,
301
312
  } as SentryOptions,
302
313
 
303
314
  modules: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@model-w/preset-nuxt3",
3
- "version": "1.0.4",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "Preset of Nuxt3 for ModelW",
6
6
  "license": "WTFPL",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@model-w/axios": "1.x",
40
- "@model-w/proxy": "1.x",
40
+ "@model-w/proxy": "2.x",
41
41
  "@model-w/sentry": "1.x",
42
42
  "@vuelidate/core": "2.0.x",
43
43
  "@vuelidate/validators": "2.0.x",