Compare commits

...
Author SHA1 Message Date
levaliciousandClaude Opus 5.5 97070f6c1d [LevK]: Build and test as a standalone package
Split out of actions/toolkit (packages/http-client, history kept by filter-repo).
Brings the 2024 [LevK] packaging edits forward onto current upstream:

- tsconfig.json: the monorepo root's compiler options inlined, no extends
- jest.config.cjs: the root's ts-jest transform, rooted at tests/
  (isolatedModules: ESM lib/ and sources run through CommonJS)
- __tests__/ -> tests/
- package.json: test = jest, build = tsc; jest/ts-jest/typescript as
  devDependencies; repository, homepage, bugs on git.levk.dev
- .gitignore: node_modules/, lib/, audit.json
- HttpCodes.PayloadTooLarge = 413 (the 2024 edit; still missing upstream)

Not carried over from 2024: the _getExistingOrDefaultHeader type
narrowing (upstream has since fixed it properly), version reset to 1.0.0 (dependents' ranges
need upstream's numbering) and the Unlicense field (the code is MIT).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UHXzGrsxfkGk8LmwrBbHNZ
2026-10-12 15:01:27 -04:00
11 changed files with 5451 additions and 16 deletions

No files matched your search

+4
View File
@@ -1,2 +1,6 @@
testoutput.txt testoutput.txt
npm-debug.log npm-debug.log
lib/
audit.json
node_modules/
+24
View File
@@ -0,0 +1,24 @@
/** @type {import('jest').Config} */
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
transform: {
'^.+\\.(ts|js)$': ['ts-jest', {
diagnostics: {warnOnly: true},
tsconfig: {
allowJs: true,
isolatedModules: true,
esModuleInterop: true,
module: 'commonjs',
moduleResolution: 'node'
}
}]
},
verbose: true
}
+5393 -1
View File
File diff suppressed because it is too large. Load diff
+14 -11
View File
@@ -7,7 +7,7 @@
"actions", "actions",
"http" "http"
], ],
"homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client", "homepage": "https://git.levk.dev/actions/http-client",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
@@ -21,18 +21,18 @@
"types": "./lib/auth.d.ts", "types": "./lib/auth.d.ts",
"import": "./lib/auth.js" "import": "./lib/auth.js"
}, },
"./lib/proxy": { "./lib/proxy": {
"types": "./lib/proxy.d.ts", "types": "./lib/proxy.d.ts",
"import": "./lib/proxy.js" "import": "./lib/proxy.js"
}, },
"./lib/interfaces": { "./lib/interfaces": {
"types": "./lib/interfaces.d.ts", "types": "./lib/interfaces.d.ts",
"import": "./lib/interfaces.js" "import": "./lib/interfaces.js"
} }
}, },
"directories": { "directories": {
"lib": "lib", "lib": "lib",
"test": "__tests__" "test": "tests"
}, },
"files": [ "files": [
"lib", "lib",
@@ -43,25 +43,28 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/actions/toolkit.git", "url": "https://git.levk.dev/actions/http-client.git"
"directory": "packages/http-client"
}, },
"scripts": { "scripts": {
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
"test": "echo \"Error: run tests from root\" && exit 1", "test": "jest",
"build": "tsc", "build": "tsc",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/*.ts",
"tsc": "tsc" "tsc": "tsc"
}, },
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://git.levk.dev/actions/http-client/issues"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.4",
"@types/node": "24.1.0", "@types/node": "24.1.0",
"@types/proxy": "^1.0.1",
"@types/tunnel": "0.0.3", "@types/tunnel": "0.0.3",
"jest": "^29.6.4",
"proxy": "^2.1.1", "proxy": "^2.1.1",
"@types/proxy": "^1.0.1" "ts-jest": "^29.1.1",
"typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"tunnel": "^0.0.6", "tunnel": "^0.0.6",
+1
View File
@@ -30,6 +30,7 @@ export enum HttpCodes {
RequestTimeout = 408, RequestTimeout = 408,
Conflict = 409, Conflict = 409,
Gone = 410, Gone = 410,
PayloadTooLarge = 413,
TooManyRequests = 429, TooManyRequests = 429,
InternalServerError = 500, InternalServerError = 500,
NotImplemented = 501, NotImplemented = 501,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+15 -4
View File
@@ -1,13 +1,24 @@
{ {
"extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"esModuleInterop": true,
"strict": true,
"declaration": true,
"target": "es6",
"skipLibCheck": true,
"sourceMap": true,
"noImplicitAny": false,
"useUnknownInCatchVariables": false,
"outDir": "./lib", "outDir": "./lib",
"rootDir": "./src", "rootDir": "./src",
"module": "node16", "module": "node16",
"moduleResolution": "node16", "moduleResolution": "node16"
"declaration": true
}, },
"include": [ "include": [
"./src" "./src"
],
"exclude": [
"node_modules",
"**/*.test.ts",
"**/__mocks__/*"
] ]
} }