nuxt-users 1.37.0 → 1.37.2

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,64 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.37.2
5
+
6
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.37.1...v1.37.2)
7
+
8
+ ### 🩹 Fixes
9
+
10
+ - Updates default MySQL root password ([38ea927](https://github.com/rrd108/nuxt-users/commit/38ea927))
11
+
12
+ ### 📖 Documentation
13
+
14
+ - Add info about .env.local ([6026a06](https://github.com/rrd108/nuxt-users/commit/6026a06))
15
+ - Add `SECURITY.md` ([a7104dc](https://github.com/rrd108/nuxt-users/commit/a7104dc))
16
+
17
+ ### 🏡 Chore
18
+
19
+ - Fix release tagging ([9b56a2f](https://github.com/rrd108/nuxt-users/commit/9b56a2f))
20
+
21
+ ### ✅ Tests
22
+
23
+ - Increase time ([6c8e7b5](https://github.com/rrd108/nuxt-users/commit/6c8e7b5))
24
+
25
+ ### 🤖 CI
26
+
27
+ - Fixes peer dependency version resolution ([ca6610a](https://github.com/rrd108/nuxt-users/commit/ca6610a))
28
+ - Fix: Nuxt 4 app creation in CI ([827ffaf](https://github.com/rrd108/nuxt-users/commit/827ffaf))
29
+ - Fix nuxt4 app creation command ([ca8707a](https://github.com/rrd108/nuxt-users/commit/ca8707a))
30
+
31
+ ### ❤️ Contributors
32
+
33
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
34
+ - Kolja Nolte ([@thaikolja](https://github.com/thaikolja))
35
+
36
+ ## v1.37.1
37
+
38
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.37.0...v1.37.1)
39
+
40
+ ### 🩹 Fixes
41
+
42
+ - Add text to emojis ([e2e0ad5](https://github.com/rrd108/nuxt-users/commit/e2e0ad5))
43
+ - Options merging bug what caused missing migrations error message with mysql ([f2d75ec](https://github.com/rrd108/nuxt-users/commit/f2d75ec))
44
+ - Script output ([f478099](https://github.com/rrd108/nuxt-users/commit/f478099))
45
+
46
+ ### 💅 Refactors
47
+
48
+ - Test scripts for efficiency ([8f0a31a](https://github.com/rrd108/nuxt-users/commit/8f0a31a))
49
+
50
+ ### 📖 Documentation
51
+
52
+ - Describing using env variables ([f20414f](https://github.com/rrd108/nuxt-users/commit/f20414f))
53
+
54
+ ### 🏡 Chore
55
+
56
+ - **release:** V1.37.0 ([2f9b2a6](https://github.com/rrd108/nuxt-users/commit/2f9b2a6))
57
+
58
+ ### ❤️ Contributors
59
+
60
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
61
+
4
62
  ## v1.37.0
5
63
 
6
64
  [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.36.0...v1.37.0)
package/dist/cli.mjs CHANGED
@@ -327,63 +327,58 @@ const projectInfo = defineCommand({
327
327
  async run() {
328
328
  try {
329
329
  console.log("[Nuxt Users] Loading Nuxt project...");
330
+ console.log("[Nuxt Users] \u2139\uFE0F Note: This command only reads .env files. If you use .env.local or other env files, export those variables first.");
330
331
  const nuxt = await loadNuxt({ cwd: process.cwd() });
331
332
  console.log("[Nuxt Users] \u2705 Nuxt project loaded successfully!");
332
333
  console.log("[Nuxt Users] \u{1F4C1} Source directory:", nuxt.options.srcDir);
333
334
  console.log("[Nuxt Users] \u{1F310} Base URL:", nuxt.options.app?.baseURL || "/");
335
+ console.log();
334
336
  const nuxtUsersConfig = nuxt.options.runtimeConfig?.nuxtUsers;
335
337
  if (nuxtUsersConfig) {
336
- console.log("[Nuxt Users] \u{1F527} Nuxt Users module configuration:");
337
- console.log("[Nuxt Users] Database connector:", nuxtUsersConfig.connector?.name);
338
+ console.log("[Nuxt Users] \u{1F4BE} Database Configuration:");
339
+ console.log("[Nuxt Users] Connector:", nuxtUsersConfig.connector?.name);
338
340
  if (nuxtUsersConfig.connector?.options) {
339
341
  const options = nuxtUsersConfig.connector.options;
340
- if (options.host) {
341
- console.log("[Nuxt Users] Database host:", options.host);
342
+ const connectorName = nuxtUsersConfig.connector.name;
343
+ if (connectorName === "sqlite") {
344
+ console.log("[Nuxt Users] Path:", options.path || "Not configured");
342
345
  }
343
- if (options.port) {
344
- console.log("[Nuxt Users] Database port:", options.port);
345
- }
346
- if (options.user) {
347
- console.log("[Nuxt Users] Database user:", options.user);
348
- }
349
- if (options.database) {
350
- console.log("[Nuxt Users] Database name:", options.database);
351
- }
352
- if (options.path) {
353
- console.log("[Nuxt Users] Database path:", options.path);
346
+ if (connectorName === "mysql" || connectorName === "postgresql") {
347
+ console.log("[Nuxt Users] Host:", options.host || "Not configured");
348
+ console.log("[Nuxt Users] Port:", options.port || "Not configured");
349
+ console.log("[Nuxt Users] Database:", options.database || "Not configured");
350
+ console.log("[Nuxt Users] User:", options.user || "Not configured");
354
351
  }
355
352
  }
356
- console.log("[Nuxt Users] Users table:", nuxtUsersConfig.tables?.users);
357
- console.log("[Nuxt Users] Personal access tokens table:", nuxtUsersConfig.tables?.personalAccessTokens);
358
- console.log("[Nuxt Users] Password reset tokens table:", nuxtUsersConfig.tables?.passwordResetTokens);
353
+ console.log();
354
+ console.log("[Nuxt Users] \u{1F4CB} Table Configuration:");
355
+ console.log("[Nuxt Users] Users:", nuxtUsersConfig.tables?.users);
356
+ console.log("[Nuxt Users] Tokens:", nuxtUsersConfig.tables?.personalAccessTokens);
357
+ console.log("[Nuxt Users] Password resets:", nuxtUsersConfig.tables?.passwordResetTokens);
358
+ console.log("[Nuxt Users] Migrations:", nuxtUsersConfig.tables?.migrations);
359
+ console.log();
359
360
  try {
360
361
  const migrationsTableExists = await checkTableExists(nuxtUsersConfig, "migrations");
362
+ console.log("[Nuxt Users] \u{1F4CA} Migration Status:");
361
363
  if (migrationsTableExists) {
362
364
  const appliedMigrations = await getAppliedMigrations(nuxtUsersConfig);
363
- console.log("[Nuxt Users] \u{1F4CA} Migrations:");
364
- console.log("[Nuxt Users] Migrations table exists: yes \u2705");
365
- console.log("[Nuxt Users] Applied migrations count:", appliedMigrations.length);
365
+ console.log("[Nuxt Users] Table exists: yes \u2705");
366
+ console.log("[Nuxt Users] Applied migrations:", appliedMigrations.length);
366
367
  if (appliedMigrations.length > 0) {
367
- console.log("[Nuxt Users] Applied migrations:", appliedMigrations.join(", "));
368
+ appliedMigrations.forEach((migration) => {
369
+ console.log("[Nuxt Users] -", migration);
370
+ });
368
371
  }
369
372
  } else {
370
- console.log("[Nuxt Users] \u{1F4CA} Migrations:");
371
- console.log("[Nuxt Users] Migrations table exists: no \u274C");
372
- console.log('[Nuxt Users] Run "npx nuxt-users migrate" to set up the database');
373
+ console.log("[Nuxt Users] Table exists: no \u274C");
374
+ console.log('[Nuxt Users] \u27A1\uFE0F Run "npx nuxt-users migrate" to set up the database');
373
375
  }
374
376
  } catch (error) {
375
- console.log("[Nuxt Users] \u26A0\uFE0F Could not check migrations:", error instanceof Error ? error.message : "Unknown error");
377
+ console.log("[Nuxt Users] Status: \u26A0\uFE0F Error -", error instanceof Error ? error.message : "Unknown error");
376
378
  }
377
379
  } else {
378
380
  console.log("[Nuxt Users] \u26A0\uFE0F Nuxt Users module not configured in runtime config");
379
381
  }
380
- const publicConfig = nuxt.options.runtimeConfig?.nuxtUsers;
381
- if (publicConfig) {
382
- console.log("[Nuxt Users] \u{1F30D} Public runtime config:");
383
- console.log("[Nuxt Users] Users table exists:", publicConfig.tables?.users);
384
- console.log("[Nuxt Users] Personal access tokens table exists:", publicConfig.tables?.personalAccessTokens);
385
- console.log("[Nuxt Users] Password reset tokens table exists:", publicConfig.tables?.passwordResetTokens);
386
- }
387
382
  } catch (error) {
388
383
  console.error("[Nuxt Users] \u274C Could not load Nuxt project:", error);
389
384
  process.exit(1);
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
3
  "configKey": "nuxtUsers",
4
- "version": "1.37.0",
4
+ "version": "1.37.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
- "version": "1.37.0",
3
+ "version": "1.37.2",
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",
@@ -63,7 +63,7 @@
63
63
  "build": "nuxt-module-build build",
64
64
  "postbuild": "node scripts/post-build.js",
65
65
  "prerelease": "node -v | grep -q 'v22' || (echo 'Please use Node.js v22 for deployment' && exit 1)",
66
- "release": "yarn lint && yarn test && changelogen --release && yarn build && yarn publish && git push --follow-tags",
66
+ "release": "yarn lint && yarn test && yarn prepack && changelogen --release && yarn publish && git push --follow-tags",
67
67
  "lint": "eslint .",
68
68
  "lint:fix": "eslint . --fix",
69
69
  "pretest": "node -v | grep -q 'v22' || (echo 'Please use Node.js v22 for testing' && exit 1)",
@@ -105,7 +105,7 @@
105
105
  "@nuxt/kit": "^3.17.6 || ^4.0.0",
106
106
  "bcrypt": "^6.0.0",
107
107
  "nodemailer": "^7.0.5",
108
- "nuxt-api-shield": "^0.8.0"
108
+ "nuxt-api-shield": "^0.8.0 || ^0.10.0"
109
109
  },
110
110
  "peerDependenciesMeta": {
111
111
  "nuxt-api-shield": {
@@ -10,7 +10,7 @@ export DB_CONNECTOR="mysql"
10
10
  export DB_HOST=${DB_HOST:-"localhost"}
11
11
  export DB_PORT=${DB_PORT:-"3306"}
12
12
  export DB_USER=${DB_USER:-"root"}
13
- export DB_PASSWORD=${DB_PASSWORD:-"123"}
13
+ export DB_PASSWORD=${DB_PASSWORD:-"rrd"}
14
14
  export DB_NAME=${DB_NAME:-"test_db"}
15
15
 
16
16
  echo "Database configuration:"
@@ -36,7 +36,7 @@ done
36
36
  # Final check if MySQL is running
37
37
  if ! mysql -h"$DB_HOST" -P"$DB_PORT" -u"$DB_USER" -e "SELECT 1;" >/dev/null 2>&1; then
38
38
  echo "Error: Cannot connect to MySQL after multiple retries. Please ensure MySQL is running and accessible."
39
- echo "You can start MySQL with: docker run --name mysql-test -e MYSQL_ROOT_PASSWORD=123 -e MYSQL_DATABASE=test_db -p 3306:3306 -d mysql:5.7"
39
+ echo "You can start MySQL with: docker run --name mysql-test -e MYSQL_ROOT_PASSWORD=rrd -e MYSQL_DATABASE=test_db -p 3306:3306 -d mysql:5.7"
40
40
  exit 1
41
41
  fi
42
42