nuxt-users 1.41.2 โ 1.43.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.
- package/README.md +10 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/server/plugins/auto-migrate.d.ts +3 -0
- package/dist/runtime/server/plugins/auto-migrate.js +14 -0
- package/package.json +6 -2
- package/scripts/test-mysql.sh +2 -2
- package/scripts/test-nuxt3.sh +10 -6
package/README.md
CHANGED
|
@@ -39,6 +39,16 @@ A user authentication module for Nuxt 3 and Nuxt 4 with database support for SQL
|
|
|
39
39
|
- Nuxt 3 & 4 compatibility
|
|
40
40
|
- Easy customization and extension
|
|
41
41
|
|
|
42
|
+
## Agent Skill
|
|
43
|
+
|
|
44
|
+
Install the **nuxt-users** [Agent Skill](https://agentskills.io/specification) so your AI coding agent (Cursor, Claude Code, etc.) has procedural knowledge for this module. One-time install:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx skills add rrd108/nuxt-users
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
After that, your agent can use the skill when you work on auth, config, CLI, composables, or authorization. The skill is also [listed on the Skills directory](https://skills.sh/) once installs are tracked.
|
|
51
|
+
|
|
42
52
|
## Documentation
|
|
43
53
|
|
|
44
54
|
๐ **Full documentation is available at: [https://nuxt-users.webmania.cc/](https://nuxt-users.webmania.cc/)**
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addServerImportsDir, addServerScanDir, addServerHandler, addRouteMiddleware, addComponentsDir } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addServerImportsDir, addServerScanDir, addServerHandler, addServerPlugin, addRouteMiddleware, addComponentsDir } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
export * from '../dist/runtime/server/internal/index.js';
|
|
4
4
|
|
|
@@ -181,6 +181,7 @@ const module$1 = defineNuxtModule({
|
|
|
181
181
|
middleware: true,
|
|
182
182
|
handler: resolver.resolve("./runtime/server/middleware/authorization.server")
|
|
183
183
|
});
|
|
184
|
+
addServerPlugin(resolver.resolve("./runtime/server/plugins/auto-migrate"));
|
|
184
185
|
addRouteMiddleware({
|
|
185
186
|
name: "authorization.client",
|
|
186
187
|
path: resolver.resolve("./runtime/middleware/authorization.client"),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
import { runMigrations } from "../utils/index.js";
|
|
3
|
+
const plugin = async () => {
|
|
4
|
+
const config = useRuntimeConfig();
|
|
5
|
+
if (!config.nuxtUsers) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
try {
|
|
9
|
+
await runMigrations(config.nuxtUsers);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
console.error("[Nuxt Users] Auto-migration failed:", error);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export default plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-users",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.0",
|
|
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",
|
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"type": "module",
|
|
37
|
+
"resolutions": {
|
|
38
|
+
"@nuxt/kit": "4.3.1"
|
|
39
|
+
},
|
|
37
40
|
"exports": {
|
|
38
41
|
".": {
|
|
39
42
|
"types": "./dist/types.d.mts",
|
|
@@ -118,6 +121,7 @@
|
|
|
118
121
|
}
|
|
119
122
|
},
|
|
120
123
|
"devDependencies": {
|
|
124
|
+
"@nuxt/cli": "^3.26.4",
|
|
121
125
|
"@nuxt/devtools": "^3.0.0",
|
|
122
126
|
"@nuxt/eslint-config": "^1.5.2",
|
|
123
127
|
"@nuxt/kit": "^4.0.0",
|
|
@@ -132,7 +136,7 @@
|
|
|
132
136
|
"changelogen": "^0.6.2",
|
|
133
137
|
"dotenv-cli": "^11.0.0",
|
|
134
138
|
"eslint": "^9.30.1",
|
|
135
|
-
"nuxt": "
|
|
139
|
+
"nuxt": "4.3.1",
|
|
136
140
|
"tsx": "^4.20.3",
|
|
137
141
|
"typescript": "~5.9.0",
|
|
138
142
|
"unbuild": "^3.0.0",
|
package/scripts/test-mysql.sh
CHANGED
|
@@ -48,7 +48,7 @@ echo "Running tests against MySQL..."
|
|
|
48
48
|
# Check if any arguments were passed
|
|
49
49
|
if [ $# -eq 0 ]; then
|
|
50
50
|
# Run all tests except unit tests (database-independent)
|
|
51
|
-
vitest run --exclude="test/unit/"
|
|
51
|
+
npx vitest run --exclude="test/unit/"
|
|
52
52
|
else
|
|
53
|
-
vitest run "$@"
|
|
53
|
+
npx vitest run "$@"
|
|
54
54
|
fi
|
package/scripts/test-nuxt3.sh
CHANGED
|
@@ -38,7 +38,7 @@ cleanup() {
|
|
|
38
38
|
if [ -f "yarn.lock.bak" ]; then
|
|
39
39
|
mv yarn.lock.bak yarn.lock
|
|
40
40
|
fi
|
|
41
|
-
|
|
41
|
+
yarn install
|
|
42
42
|
print_success "Dependencies restored to Nuxt 4."
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -53,17 +53,21 @@ fi
|
|
|
53
53
|
# 2. Set up cleanup trap
|
|
54
54
|
trap cleanup EXIT
|
|
55
55
|
|
|
56
|
-
# 3.
|
|
57
|
-
print_status "๐ฆ
|
|
56
|
+
# 3. Ensure lockfile matches package.json (nuxt 4.3.x), then backup
|
|
57
|
+
print_status "๐ฆ Syncing lockfile and backing up package files..."
|
|
58
|
+
yarn install
|
|
58
59
|
cp package.json package.json.bak
|
|
59
60
|
cp yarn.lock yarn.lock.bak
|
|
60
61
|
|
|
61
|
-
# 4.
|
|
62
|
+
# 4. Drop resolutions so Nuxt 3 gets Kit 3.x (otherwise resolution forces Kit 4 and breaks Nuxt 3)
|
|
63
|
+
node -e "const p=require('./package.json'); delete p.resolutions; require('fs').writeFileSync('package.json', JSON.stringify(p, null, 2));"
|
|
64
|
+
|
|
65
|
+
# 5. Install Nuxt 3
|
|
62
66
|
print_status "๐ Installing Nuxt v3 (version: ${NUXT3_VERSION})..."
|
|
63
67
|
npx nypm@latest i nuxt@${NUXT3_VERSION}
|
|
64
68
|
print_success "Nuxt 3 installed."
|
|
65
69
|
|
|
66
|
-
#
|
|
70
|
+
# 6. Run the specified test
|
|
67
71
|
print_status "๐งช Running tests for '$TEST_TYPE' against Nuxt 3..."
|
|
68
72
|
if [ -f "scripts/test-${TEST_TYPE}.sh" ]; then
|
|
69
73
|
"./scripts/test-${TEST_TYPE}.sh"
|
|
@@ -74,5 +78,5 @@ fi
|
|
|
74
78
|
|
|
75
79
|
print_success "Nuxt 3 tests completed successfully!"
|
|
76
80
|
|
|
77
|
-
#
|
|
81
|
+
# 7. Cleanup will be handled by the trap
|
|
78
82
|
exit 0
|