create-request 1.6.0 → 2.0.0-next.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/package.json CHANGED
@@ -1,74 +1,76 @@
1
1
  {
2
2
  "name": "create-request",
3
- "version": "1.6.0",
4
- "description": "A modern, chainable wrapper for fetch with automatic retries, timeouts, comprehensive error handling, and first-class TypeScript support",
5
- "main": "dist/library/index.cjs",
6
- "module": "dist/library/index.esm.js",
7
- "types": "dist/library/index.d.ts",
8
- "sideEffects": false,
3
+ "version": "2.0.0-next.0",
4
+ "description": "A tiny, chainable, fully typed wrapper around fetch: retries, timeouts, cancellation, interceptors, api instances, schema validation and one error type",
9
5
  "type": "module",
10
- "files": [
11
- "dist/library",
12
- "README.md",
13
- "LICENSE",
14
- "CHANGELOG.md"
15
- ],
6
+ "sideEffects": false,
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
16
10
  "exports": {
17
11
  ".": {
18
- "types": "./dist/library/index.d.ts",
19
12
  "import": {
20
- "production": "./dist/library/index.esm.min.js",
21
- "default": "./dist/library/index.esm.js"
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
22
15
  },
23
16
  "require": {
24
- "production": "./dist/library/index.min.cjs",
25
- "default": "./dist/library/index.cjs"
17
+ "types": "./dist/index.d.cts",
18
+ "default": "./dist/index.cjs"
26
19
  }
27
- }
20
+ },
21
+ "./package.json": "./package.json"
28
22
  },
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "MIGRATION.md",
27
+ "CHANGELOG.md",
28
+ "LICENSE"
29
+ ],
29
30
  "scripts": {
30
- "dev": "cross-env BUILD_ENV=development rollup -c rollup.config.js -w",
31
- "build": "cross-env BUILD_ENV=production rollup -c rollup.config.js",
32
- "analyze": "cross-env ANALYZE=true BUILD_ENV=production rollup -c rollup.config.js",
33
- "lint": "eslint 'src/**/*.{js,ts,json}' 'test/**/*.{js,ts,json}'",
34
- "lint:quiet": "eslint 'src/**/*.{js,ts,json}' 'test/**/*.{js,ts,json}' --quiet",
35
- "lint:fix": "eslint \"**/*.ts\" --ignore-path .eslintignore --fix",
36
- "format": "prettier --write \"**/*.{ts,js,json}\"",
37
- "check": "concurrently \"npm run lint\" \"npm run test\" \"npm run check:size\"",
38
- "check:size": "npm run build && npx size-limit",
31
+ "build": "tsdown",
32
+ "dev": "tsdown --watch",
33
+ "typecheck": "tsc -p tsconfig.json && tsc -p test/tsconfig.json",
34
+ "lint": "eslint .",
35
+ "lint:fix": "eslint . --fix",
36
+ "format": "prettier --write .",
37
+ "format:check": "prettier --check .",
39
38
  "test": "node --import tsx --test \"test/**/*.test.ts\"",
40
- "test:quiet": "node --import tsx --test \"test/**/*.test.ts\" > /dev/null",
39
+ "test:unit": "node --import tsx --test \"test/unit/**/*.test.ts\"",
41
40
  "test:e2e": "node --import tsx --test \"test/e2e/**/*.test.ts\"",
42
- "test:coverage": "c8 --reporter=text --reporter=html --reporter=lcov npm test",
43
- "prepare": "husky",
41
+ "test:types": "node scripts/extract-readme-snippets.mjs && tsc -p test/types/tsconfig.json",
42
+ "test:coverage": "c8 npm test",
43
+ "size": "size-limit",
44
+ "pack:check": "attw --pack . --profile node16 && publint",
45
+ "check": "npm run lint && npm run format:check && npm run typecheck && npm run test:types && npm run test:coverage && npm run build && npm run test:types:node && npm run pack:check && npm run size",
46
+ "release:patch": "node scripts/release.mjs patch",
47
+ "release:minor": "node scripts/release.mjs minor",
48
+ "release:major": "node scripts/release.mjs major",
49
+ "release:next": "node scripts/release.mjs next",
44
50
  "prepack": "npm run build",
45
- "preversion": "npm run check",
46
- "prepublishOnly": "npm run build && npm test",
47
- "publish:beta": "npm version prerelease --preid=beta -m \"chore(release): %s\" && git push origin --follow-tags && npm publish --tag beta",
48
- "publish:rc": "npm version prerelease --preid=rc -m \"chore(release): %s\" && git push origin --follow-tags && npm publish --tag rc",
49
- "publish:patch": "npm version patch -m \"chore(release): %s\" && git push origin --follow-tags && npm publish",
50
- "publish:minor": "npm version minor -m \"chore(release): %s\" && git push origin --follow-tags && npm publish",
51
- "publish:major": "npm version major -m \"chore(release): %s\" && git push origin --follow-tags && npm publish"
51
+ "prepare": "node .husky/install.mjs",
52
+ "test:types:node": "tsc -p test/types/node-only/tsconfig.json"
52
53
  },
53
54
  "keywords": [
54
55
  "fetch",
55
56
  "http",
56
57
  "request",
57
58
  "api",
58
- "xhr",
59
- "ajax",
60
59
  "typescript",
61
60
  "chainable",
62
61
  "fluent",
63
62
  "retry",
64
63
  "timeout",
64
+ "abort",
65
+ "interceptors",
65
66
  "graphql",
66
- "csrf"
67
+ "standard-schema",
68
+ "zod"
67
69
  ],
68
70
  "author": "Daniel Amenou <amenou.daniel@gmail.com>",
69
71
  "license": "MIT",
70
72
  "engines": {
71
- "node": ">=18.3.0"
73
+ "node": ">=22"
72
74
  },
73
75
  "repository": {
74
76
  "type": "git",
@@ -83,34 +85,28 @@
83
85
  "url": "https://github.com/sponsors/DanielAmenou"
84
86
  },
85
87
  "devDependencies": {
86
- "@commitlint/cli": "^20.1.0",
87
- "@commitlint/config-conventional": "^20.0.0",
88
- "@rollup/plugin-commonjs": "^29.0.0",
89
- "@rollup/plugin-node-resolve": "^16.0.3",
90
- "@rollup/plugin-terser": "^0.4.4",
91
- "@rollup/plugin-typescript": "^12.3.0",
92
- "@size-limit/preset-small-lib": "^12.0.0",
93
- "@types/node": "^24.10.1",
94
- "@typescript-eslint/eslint-plugin": "^8.48.0",
95
- "@typescript-eslint/parser": "^8.48.0",
96
- "c8": "^10.1.3",
97
- "concurrently": "^9.2.1",
98
- "cross-env": "^10.1.0",
99
- "eslint": "^9.39.1",
88
+ "@arethetypeswrong/cli": "^0.18.5",
89
+ "@commitlint/cli": "^21.2.3",
90
+ "@commitlint/config-conventional": "^21.2.3",
91
+ "@eslint/js": "^10.0.1",
92
+ "@size-limit/preset-small-lib": "^14.1.0",
93
+ "@types/node": "^24.19.0",
94
+ "c8": "^12.0.0",
95
+ "eslint": "^10.11.0",
100
96
  "eslint-config-prettier": "^10.1.8",
101
- "eslint-import-resolver-typescript": "^4.4.4",
102
- "eslint-plugin-import": "^2.32.0",
103
- "eslint-plugin-jsonc": "^2.21.0",
104
- "eslint-plugin-prettier": "^5.5.4",
97
+ "expect-type": "^1.4.0",
98
+ "globals": "^17.12.0",
105
99
  "husky": "^9.1.7",
106
- "prettier": "^3.7.3",
107
- "rollup": "^4.53.3",
108
- "rollup-plugin-cleaner": "^1.0.0",
109
- "rollup-plugin-visualizer": "^6.0.5",
110
- "size-limit": "^12.0.0",
111
- "tslib": "^2.8.1",
112
- "tsx": "^4.20.6",
100
+ "lint-staged": "^17.6.0",
101
+ "prettier": "^3.9.9",
102
+ "publint": "^0.3.24",
103
+ "size-limit": "^14.1.0",
104
+ "tsdown": "^0.23.0",
105
+ "tsx": "^4.23.15",
113
106
  "typescript": "^5.9.3",
114
- "undici": "^7.16.0"
107
+ "typescript-eslint": "^8.71.0",
108
+ "undici": "^8.11.2",
109
+ "valibot": "^1.5.0",
110
+ "zod": "^4.6.5"
115
111
  }
116
112
  }