@objectstack/nuxt 3.2.8 → 3.3.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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +12 -0
- package/package.json +5 -5
- package/src/nuxt.test.ts +16 -7
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/nuxt@3.
|
|
2
|
+
> @objectstack/nuxt@3.3.0 build /home/runner/work/spec/spec/packages/adapters/nuxt
|
|
3
3
|
> tsup --config ../../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m6.90 KB[39m
|
|
14
14
|
[32mCJS[39m [1mdist/index.js.map [22m[32m12.03 KB[39m
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 60ms
|
|
16
16
|
[32mESM[39m [1mdist/index.mjs [22m[32m5.71 KB[39m
|
|
17
17
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m12.06 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 67ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 13110ms
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m1015.00 B[39m
|
|
22
22
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1015.00 B[39m
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectstack/nuxt",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"h3": "^1.15.
|
|
16
|
-
"@objectstack/runtime": "^3.
|
|
15
|
+
"h3": "^1.15.10",
|
|
16
|
+
"@objectstack/runtime": "^3.3.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"h3": "^1.15.
|
|
19
|
+
"h3": "^1.15.10",
|
|
20
20
|
"typescript": "^5.0.0",
|
|
21
21
|
"vitest": "^4.1.0",
|
|
22
|
-
"@objectstack/runtime": "3.
|
|
22
|
+
"@objectstack/runtime": "3.3.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsup --config ../../../tsup.config.ts",
|
package/src/nuxt.test.ts
CHANGED
|
@@ -7,9 +7,8 @@ const mockDispatcher = {
|
|
|
7
7
|
getDiscoveryInfo: vi.fn().mockReturnValue({ version: '1.0', endpoints: [] }),
|
|
8
8
|
handleAuth: vi.fn().mockResolvedValue({ handled: true, response: { body: { ok: true }, status: 200 } }),
|
|
9
9
|
handleGraphQL: vi.fn().mockResolvedValue({ data: {} }),
|
|
10
|
-
handleMetadata: vi.fn().mockResolvedValue({ handled: true, response: { body: { objects: [] }, status: 200 } }),
|
|
11
|
-
handleData: vi.fn().mockResolvedValue({ handled: true, response: { body: { records: [] }, status: 200 } }),
|
|
12
10
|
handleStorage: vi.fn().mockResolvedValue({ handled: true, response: { body: {}, status: 200 } }),
|
|
11
|
+
dispatch: vi.fn().mockResolvedValue({ handled: true, response: { body: { success: true }, status: 200 } }),
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
vi.mock('@objectstack/runtime', () => {
|
|
@@ -101,16 +100,26 @@ describe('createH3Router', () => {
|
|
|
101
100
|
const app = createTestApp();
|
|
102
101
|
const res = await makeRequest(app, '/api/meta/objects');
|
|
103
102
|
expect(res.status).toBe(200);
|
|
104
|
-
expect(
|
|
105
|
-
|
|
103
|
+
expect(mockDispatcher.dispatch).toHaveBeenCalledWith(
|
|
104
|
+
'GET',
|
|
105
|
+
'/meta/objects',
|
|
106
|
+
undefined,
|
|
107
|
+
expect.any(Object),
|
|
108
|
+
expect.objectContaining({ request: expect.anything() }),
|
|
109
|
+
);
|
|
106
110
|
});
|
|
107
111
|
|
|
108
112
|
it('handles data route', async () => {
|
|
109
113
|
const app = createTestApp();
|
|
110
114
|
const res = await makeRequest(app, '/api/data/account');
|
|
111
115
|
expect(res.status).toBe(200);
|
|
112
|
-
expect(
|
|
113
|
-
|
|
116
|
+
expect(mockDispatcher.dispatch).toHaveBeenCalledWith(
|
|
117
|
+
'GET',
|
|
118
|
+
'/data/account',
|
|
119
|
+
undefined,
|
|
120
|
+
expect.any(Object),
|
|
121
|
+
expect.objectContaining({ request: expect.anything() }),
|
|
122
|
+
);
|
|
114
123
|
});
|
|
115
124
|
|
|
116
125
|
it('handles storage route', async () => {
|
|
@@ -121,7 +130,7 @@ describe('createH3Router', () => {
|
|
|
121
130
|
});
|
|
122
131
|
|
|
123
132
|
it('handles errors', async () => {
|
|
124
|
-
mockDispatcher.
|
|
133
|
+
mockDispatcher.dispatch.mockRejectedValueOnce(
|
|
125
134
|
Object.assign(new Error('Forbidden'), { statusCode: 403 }),
|
|
126
135
|
);
|
|
127
136
|
const app = createTestApp();
|