@mherod/get-cookie 4.3.0 → 4.3.1

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/.husky/commit-msg CHANGED
File without changes
package/.husky/pre-commit CHANGED
File without changes
package/.husky/pre-push CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@mherod/get-cookie",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "Node.js module for querying cookies from Chrome, Firefox, and Safari browsers",
5
+ "packageManager": "pnpm@9.15.2",
5
6
  "type": "module",
6
7
  "source": "src/index.ts",
7
8
  "bin": {
@@ -24,6 +25,29 @@
24
25
  "publishConfig": {
25
26
  "access": "public"
26
27
  },
28
+ "scripts": {
29
+ "clean": "rm -rf dist",
30
+ "build:lib": "tsup --config tsup.lib.ts",
31
+ "build:cli": "tsup --config tsup.cli.ts",
32
+ "build": "pnpm run build:lib && pnpm run build:cli",
33
+ "test": "jest",
34
+ "type-check": "tsc --noEmit --skipLibCheck",
35
+ "lint": "biome check --diagnostic-level=error .",
36
+ "lint:fix": "biome check --write .",
37
+ "lint:staged": "biome check --staged --write .",
38
+ "format": "biome format --write .",
39
+ "format:check": "biome check --diagnostic-level=error .",
40
+ "validate": "pnpm run type-check && pnpm run lint && pnpm run test && pnpm run check-links && pnpm run format:check",
41
+ "prepack": "pnpm run validate",
42
+ "prepublishOnly": "pnpm run clean && pnpm run validate && pnpm run build",
43
+ "dev": "tsc -w -p tsconfig.json & tsc-alias -w -p tsconfig.json",
44
+ "read-github": "NODE_OPTIONS=\"-r tsconfig-paths/register\" tsx scripts/read-github-cookies.ts",
45
+ "prepare": "husky install",
46
+ "docs": "typedoc && ./scripts/fix-typedoc.sh && vitepress build docs",
47
+ "docs:dev": "vitepress dev docs",
48
+ "docs:preview": "vitepress preview docs",
49
+ "check-links": "./scripts/check-vitepress-links.sh"
50
+ },
27
51
  "engines": {
28
52
  "node": "^20.0.0 || ^22.0.0 || ^24.0.0"
29
53
  },
@@ -90,25 +114,5 @@
90
114
  "biome format --write --no-errors-on-unmatched",
91
115
  "./scripts/check-vitepress-links.sh"
92
116
  ]
93
- },
94
- "scripts": {
95
- "clean": "rm -rf dist",
96
- "build:lib": "tsup --config tsup.lib.ts",
97
- "build:cli": "tsup --config tsup.cli.ts",
98
- "build": "pnpm run build:lib && pnpm run build:cli",
99
- "test": "jest",
100
- "type-check": "tsc --noEmit --skipLibCheck",
101
- "lint": "biome check --diagnostic-level=error .",
102
- "lint:fix": "biome check --write .",
103
- "lint:staged": "biome check --staged --write .",
104
- "format": "biome format --write .",
105
- "format:check": "biome check --diagnostic-level=error .",
106
- "validate": "pnpm run type-check && pnpm run lint && pnpm run test && pnpm run check-links && pnpm run format:check",
107
- "dev": "tsc -w -p tsconfig.json & tsc-alias -w -p tsconfig.json",
108
- "read-github": "NODE_OPTIONS=\"-r tsconfig-paths/register\" tsx scripts/read-github-cookies.ts",
109
- "docs": "typedoc && ./scripts/fix-typedoc.sh && vitepress build docs",
110
- "docs:dev": "vitepress dev docs",
111
- "docs:preview": "vitepress preview docs",
112
- "check-links": "./scripts/check-vitepress-links.sh"
113
117
  }
114
- }
118
+ }
@@ -1,11 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(gh pr list:*)",
5
- "Bash(gh repo view:*)",
6
- "Bash(gh pr checkout:*)",
7
- "Bash(gh pr view:*)"
8
- ],
9
- "deny": []
10
- }
11
- }
@@ -1,15 +0,0 @@
1
- {
2
- "name": "test-exports",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC",
12
- "dependencies": {
13
- "@mherod/get-cookie": "link:.."
14
- }
15
- }
@@ -1,12 +0,0 @@
1
- import { getCookie, getChromeCookie } from '@mherod/get-cookie';
2
-
3
- // Test ESM imports
4
- console.log('getCookie type:', typeof getCookie);
5
- console.log('getChromeCookie type:', typeof getChromeCookie);
6
-
7
- // Test that we can import types in JSDoc
8
- /** @type {import('@mherod/get-cookie').CookieSpec} */
9
- const spec = { name: 'test', domain: 'example.com' };
10
-
11
- console.log('ESM imports successful!');
12
- console.log('CookieSpec:', spec);
@@ -1,14 +0,0 @@
1
- const { getCookie, getChromeCookie } = require('@mherod/get-cookie');
2
-
3
- // Test CommonJS imports
4
- console.log('getCookie type:', typeof getCookie);
5
- console.log('getChromeCookie type:', typeof getChromeCookie);
6
-
7
- // Test basic usage
8
- getCookie({ name: 'test', domain: 'example.com' })
9
- .then(cookies => {
10
- console.log('getCookie works, returned:', cookies.length, 'cookies');
11
- })
12
- .catch(err => {
13
- console.log('getCookie test complete (error expected if no cookies found)');
14
- });
@@ -1,61 +0,0 @@
1
- import {
2
- getCookie,
3
- getChromeCookie,
4
- getFirefoxCookie,
5
- getGroupedRenderedCookies,
6
- getMergedRenderedCookies,
7
- type CookieSpec,
8
- type ExportedCookie,
9
- type RenderOptions,
10
- type BrowserName,
11
- type CookieQueryStrategy,
12
- type MultiCookieSpec,
13
- } from '@mherod/get-cookie';
14
-
15
- // Test type imports
16
- const cookieSpec: CookieSpec = {
17
- name: 'test',
18
- domain: 'example.com'
19
- };
20
-
21
- const multiSpec: MultiCookieSpec = [
22
- { name: 'test1', domain: 'example.com' },
23
- { name: 'test2', domain: 'api.example.com' }
24
- ];
25
-
26
- const renderOptions: RenderOptions = {
27
- format: 'grouped',
28
- separator: '; ',
29
- showFilePaths: true
30
- };
31
-
32
- const browserName: BrowserName = 'Chrome';
33
-
34
- // Test function signatures
35
- async function testFunctions() {
36
- const cookies: ExportedCookie[] = await getCookie(cookieSpec);
37
- const chromeCookies: ExportedCookie[] = await getChromeCookie(cookieSpec);
38
- const firefoxCookies: ExportedCookie[] = await getFirefoxCookie(cookieSpec);
39
- const groupedCookies: string[] = await getGroupedRenderedCookies(cookieSpec, renderOptions);
40
- const mergedCookies: string = await getMergedRenderedCookies(cookieSpec, renderOptions);
41
-
42
- // Test ExportedCookie type
43
- const exampleCookie: ExportedCookie = {
44
- name: 'session',
45
- domain: 'example.com',
46
- value: 'abc123',
47
- expiry: new Date(),
48
- meta: {
49
- file: '/path/to/cookies',
50
- browser: 'Chrome',
51
- secure: true,
52
- httpOnly: true,
53
- path: '/'
54
- }
55
- };
56
-
57
- console.log('All type imports successful!');
58
- }
59
-
60
- // Test that types are properly exported
61
- export { CookieSpec, ExportedCookie };