nuxt-users 1.17.2 → 1.17.3

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,25 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.17.3
5
+
6
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.17.2...v1.17.3)
7
+
8
+ ### 🩹 Fixes
9
+
10
+ - Cli version mismatch ([86d49c4](https://github.com/rrd108/nuxt-users/commit/86d49c4))
11
+ - Import paths and exports types ([16b5a28](https://github.com/rrd108/nuxt-users/commit/16b5a28))
12
+ - Cli version ([586194f](https://github.com/rrd108/nuxt-users/commit/586194f))
13
+ - Use runtime config for password reset link ([f462f64](https://github.com/rrd108/nuxt-users/commit/f462f64))
14
+
15
+ ### 🏡 Chore
16
+
17
+ - **release:** V1.17.2 ([f640ba2](https://github.com/rrd108/nuxt-users/commit/f640ba2))
18
+
19
+ ### ❤️ Contributors
20
+
21
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
22
+
4
23
  ## v1.17.2
5
24
 
6
25
  [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.17.1...v1.17.2)
package/dist/cli.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
+ import { readFileSync } from 'node:fs';
3
4
  import { defaultOptions } from './module.mjs';
4
5
  import { loadNuxt } from '@nuxt/kit';
5
6
  import { defu } from 'defu';
@@ -263,11 +264,20 @@ const projectInfo = defineCommand({
263
264
  }
264
265
  });
265
266
 
267
+ const getVersion = () => {
268
+ try {
269
+ const packagePath = new URL("../package.json", import.meta.url);
270
+ const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
271
+ return packageJson.version;
272
+ } catch {
273
+ return "unknown";
274
+ }
275
+ };
266
276
  const main = defineCommand({
267
277
  meta: {
268
278
  name: "nuxt-users",
269
279
  description: "CLI for Nuxt Users Module - Manage users, migrations, and database operations",
270
- version: "1.17.2"
280
+ version: getVersion()
271
281
  },
272
282
  subCommands: {
273
283
  migrate,
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
3
  "configKey": "nuxtUsers",
4
- "version": "1.17.2",
4
+ "version": "1.17.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
@@ -1,6 +1,9 @@
1
1
  import { defineEventHandler, readBody, createError } from "h3";
2
2
  import { sendPasswordResetLink } from "../../../services/password.js";
3
+ import { useRuntimeConfig } from "#imports";
3
4
  export default defineEventHandler(async (event) => {
5
+ const { nuxtUsers } = useRuntimeConfig();
6
+ const options = nuxtUsers;
4
7
  const body = await readBody(event);
5
8
  const { email } = body;
6
9
  if (!email || typeof email !== "string") {
@@ -10,7 +13,7 @@ export default defineEventHandler(async (event) => {
10
13
  });
11
14
  }
12
15
  try {
13
- await sendPasswordResetLink(email, event.context.nuxtUsers);
16
+ await sendPasswordResetLink(email, options);
14
17
  return { message: "If a user with that email exists, a password reset link has been sent." };
15
18
  } catch (error) {
16
19
  if (error instanceof Error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "description": "A comprehensive user management module for Nuxt 3 and Nuxt 4 applications with authentication, authorization, database support, and CLI tools",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -53,7 +53,7 @@
53
53
  "nuxt-users": "./dist/cli.mjs"
54
54
  },
55
55
  "scripts": {
56
- "prepack": "node scripts/replace-version.js && nuxt-module-build build && node scripts/post-build.js",
56
+ "prepack": "nuxt-module-build build && node scripts/post-build.js",
57
57
  "postinstall": "node -e \"try { require('fs').chmodSync('./dist/cli.mjs', '755') } catch(e) {}\"",
58
58
  "predev": "node -v | grep -q 'v22' || (echo 'Please use Node.js v22 for development' && exit 1)",
59
59
  "dev": "yarn dev:prepare && nuxi dev playground",