@htlkg/core 0.0.3 → 0.0.9

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/package.json CHANGED
@@ -1,57 +1,61 @@
1
1
  {
2
- "name": "@htlkg/core",
3
- "version": "0.0.3",
4
- "type": "module",
5
- "exports": {
6
- ".": {
7
- "import": "./dist/index.js",
8
- "types": "./dist/index.d.ts"
9
- },
10
- "./auth": {
11
- "import": "./dist/auth/index.js",
12
- "types": "./dist/auth/index.d.ts"
13
- },
14
- "./types": {
15
- "import": "./dist/types/index.js",
16
- "types": "./dist/types/index.d.ts"
17
- },
18
- "./utils": {
19
- "import": "./dist/utils/index.js",
20
- "types": "./dist/utils/index.d.ts"
21
- },
22
- "./constants": {
23
- "import": "./dist/constants/index.js",
24
- "types": "./dist/constants/index.d.ts"
25
- },
26
- "./errors": {
27
- "import": "./dist/errors/index.js",
28
- "types": "./dist/errors/index.d.ts"
29
- },
30
- "./amplify-astro-adapter": {
31
- "import": "./dist/amplify-astro-adapter/index.js",
32
- "types": "./dist/amplify-astro-adapter/index.d.ts"
33
- }
34
- },
35
- "files": [
36
- "src",
37
- "dist"
38
- ],
39
- "dependencies": {
40
- "aws-amplify": "^6.15.7"
41
- },
42
- "devDependencies": {
43
- "astro": "^5.14.7",
44
- "tsup": "^8.0.0",
45
- "typescript": "^5.9.2",
46
- "vitest": "^3.2.4"
47
- },
48
- "publishConfig": {
49
- "access": "restricted"
50
- },
51
- "scripts": {
52
- "build": "tsup",
53
- "dev": "tsup --watch",
54
- "test": "vitest run",
55
- "test:watch": "vitest"
56
- }
57
- }
2
+ "name": "@htlkg/core",
3
+ "version": "0.0.9",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.js",
8
+ "types": "./dist/index.d.ts"
9
+ },
10
+ "./auth": {
11
+ "import": "./dist/auth/index.js",
12
+ "types": "./dist/auth/index.d.ts"
13
+ },
14
+ "./types": {
15
+ "import": "./dist/types/index.js",
16
+ "types": "./dist/types/index.d.ts"
17
+ },
18
+ "./utils": {
19
+ "import": "./dist/utils/index.js",
20
+ "types": "./dist/utils/index.d.ts"
21
+ },
22
+ "./constants": {
23
+ "import": "./dist/constants/index.js",
24
+ "types": "./dist/constants/index.d.ts"
25
+ },
26
+ "./errors": {
27
+ "import": "./dist/errors/index.js",
28
+ "types": "./dist/errors/index.d.ts"
29
+ },
30
+ "./amplify-astro-adapter": {
31
+ "import": "./dist/amplify-astro-adapter/index.js",
32
+ "types": "./dist/amplify-astro-adapter/index.d.ts"
33
+ }
34
+ },
35
+ "files": [
36
+ "src",
37
+ "dist"
38
+ ],
39
+ "scripts": {
40
+ "build": "tsup",
41
+ "dev": "tsup --watch",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest",
44
+ "prepublishOnly": "pnpm build",
45
+ "version:patch": "pnpm version patch --no-git-tag-version",
46
+ "version:minor": "pnpm version minor --no-git-tag-version",
47
+ "version:major": "pnpm version major --no-git-tag-version"
48
+ },
49
+ "dependencies": {
50
+ "aws-amplify": "^6.15.7"
51
+ },
52
+ "devDependencies": {
53
+ "astro": "^5.14.7",
54
+ "tsup": "^8.0.0",
55
+ "typescript": "^5.9.2",
56
+ "vitest": "^3.2.4"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public"
60
+ }
61
+ }
@@ -48,13 +48,16 @@ describe("createCookieStorageAdapterFromAstroContext", () => {
48
48
  delete: vi.fn(),
49
49
  };
50
50
 
51
- const mockRequest = new Request("https://example.com", {
52
- headers: { cookie: "test=header-value; other=value2" },
53
- });
51
+ // Use plain function for headers.get to avoid any mock-related issues
52
+ const mockRequest = {
53
+ headers: {
54
+ get: (name: string) => name === 'cookie' ? "test=header-value; other=value2" : null,
55
+ },
56
+ };
54
57
 
55
58
  const context: AstroServer.ServerContext = {
56
59
  cookies: mockCookies as any,
57
- request: mockRequest,
60
+ request: mockRequest as any,
58
61
  };
59
62
 
60
63
  const adapter = await createCookieStorageAdapterFromAstroContext(context);
@@ -70,13 +73,16 @@ describe("createCookieStorageAdapterFromAstroContext", () => {
70
73
  delete: vi.fn(),
71
74
  };
72
75
 
73
- const mockRequest = new Request("https://example.com", {
74
- headers: { cookie: "test=hello%20world" },
75
- });
76
+ // Use plain function for headers.get to avoid any mock-related issues
77
+ const mockRequest = {
78
+ headers: {
79
+ get: (name: string) => name === 'cookie' ? "test=hello%20world" : null,
80
+ },
81
+ };
76
82
 
77
83
  const context: AstroServer.ServerContext = {
78
84
  cookies: mockCookies as any,
79
- request: mockRequest,
85
+ request: mockRequest as any,
80
86
  };
81
87
 
82
88
  const adapter = await createCookieStorageAdapterFromAstroContext(context);
@@ -122,13 +128,16 @@ describe("createCookieStorageAdapterFromAstroContext", () => {
122
128
  // No getAll method
123
129
  };
124
130
 
125
- const mockRequest = new Request("https://example.com", {
126
- headers: { cookie: "cookie1=value1; cookie2=value2" },
127
- });
131
+ // Use plain function for headers.get to avoid any mock-related issues
132
+ const mockRequest = {
133
+ headers: {
134
+ get: (name: string) => name === 'cookie' ? "cookie1=value1; cookie2=value2" : null,
135
+ },
136
+ };
128
137
 
129
138
  const context: AstroServer.ServerContext = {
130
139
  cookies: mockCookies as any,
131
- request: mockRequest,
140
+ request: mockRequest as any,
132
141
  };
133
142
 
134
143
  const adapter = await createCookieStorageAdapterFromAstroContext(context);