Compare commits

..

8 Commits

Author SHA1 Message Date
32332309dc v4.3.8
Some checks failed
Default (tags) / security (push) Successful in 13s
Default (tags) / test (push) Failing after 37s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-16 21:55:40 +00:00
9d29bd92da fix(core): Ensure correct ArrayBuffer return, fix fetch body typing, reorganize node-only tests, and bump tsbuild devDependency 2025-11-16 21:55:40 +00:00
6d148bb59e 4.3.7
Some checks failed
Default (tags) / security (push) Successful in 10s
Default (tags) / test (push) Failing after 36s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-01 15:53:47 +00:00
e0f586693c fix(ci): Update dependencies, add deno.lock, and reorganize tests for browser and Node environments 2025-11-01 15:53:47 +00:00
df28cd4778 4.3.6
Some checks failed
Default (tags) / security (push) Successful in 4s
Default (tags) / test (push) Successful in 43s
Default (tags) / release (push) Failing after 29s
Default (tags) / metadata (push) Successful in 54s
2025-10-26 14:12:38 +00:00
f49cbd2b6a fix(ci): Use .npmrc for registry authentication in Gitea workflow and add conditional npmjs publish 2025-10-26 14:12:37 +00:00
984b53cba2 4.3.5
Some checks failed
Default (tags) / security (push) Successful in 11s
Default (tags) / test (push) Successful in 47s
Default (tags) / release (push) Failing after 29s
Default (tags) / metadata (push) Successful in 57s
2025-10-26 14:07:55 +00:00
4c55243646 fix(workflows): Remove npmci wrappers from CI workflows and use pnpm/npm CLI directly 2025-10-26 14:07:55 +00:00
15 changed files with 9656 additions and 3420 deletions

View File

@@ -23,24 +23,16 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies - name: Audit production dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod pnpm audit --audit-level=high --prod
continue-on-error: true continue-on-error: true
- name: Audit development dependencies - name: Audit development dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev pnpm audit --audit-level=high --dev
continue-on-error: true continue-on-error: true
test: test:
@@ -55,12 +47,10 @@ jobs:
- name: Test stable - name: Test stable
run: | run: |
npmci node install stable pnpm install
npmci npm install pnpm test
npmci npm test
- name: Test build - name: Test build
run: | run: |
npmci node install stable pnpm install
npmci npm install pnpm build
npmci npm build

View File

@@ -23,22 +23,16 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Audit production dependencies - name: Audit production dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod pnpm audit --audit-level=high --prod
continue-on-error: true continue-on-error: true
- name: Audit development dependencies - name: Audit development dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev pnpm audit --audit-level=high --dev
continue-on-error: true continue-on-error: true
test: test:
@@ -51,23 +45,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Test stable - name: Test stable
run: | run: |
npmci node install stable pnpm install
npmci npm install pnpm test
npmci npm test
- name: Test build - name: Test build
run: | run: |
npmci node install stable pnpm install
npmci npm install pnpm build
npmci npm build
release: release:
needs: test needs: test
@@ -79,28 +65,26 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Release - name: Release
run: | run: |
npmci node install stable pnpm install
npmci npm install
# Extract server host from GITHUB_SERVER_URL (remove https://) # Extract server host from GITHUB_SERVER_URL (remove https://)
GITEA_HOST="${GITHUB_SERVER_URL#https://}" GITEA_HOST="${GITHUB_SERVER_URL#https://}"
GITEA_REGISTRY="$GITHUB_SERVER_URL/api/packages/$GITHUB_REPOSITORY_OWNER/npm/" GITEA_REGISTRY="$GITHUB_SERVER_URL/api/packages/$GITHUB_REPOSITORY_OWNER/npm/"
# Configure Gitea npm registry
npmci command npm config set @${GITHUB_REPOSITORY_OWNER}:registry "$GITEA_REGISTRY" # Create .npmrc for Gitea authentication
npmci command npm config set "//${GITEA_HOST}/api/packages/${GITHUB_REPOSITORY_OWNER}/npm/:_authToken" "$GITEA_TOKEN" echo "@${GITHUB_REPOSITORY_OWNER}:registry=${GITEA_REGISTRY}" > .npmrc
echo "//${GITEA_HOST}/api/packages/${GITHUB_REPOSITORY_OWNER}/npm/:_authToken=${GITEA_TOKEN}" >> .npmrc
# Publish to Gitea # Publish to Gitea
npmci command npm publish pnpm publish --no-git-checks
# Conditionally publish to npmjs.org if token exists # Conditionally publish to npmjs.org if token exists
if [ -n "$NPMCI_TOKEN_NPM" ]; then if [ -n "$NPMCI_TOKEN_NPM" ]; then
npmci command npm config set registry https://registry.npmjs.org # Update .npmrc for npmjs.org
npmci npm publish echo "registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${NPMCI_TOKEN_NPM}" >> .npmrc
pnpm publish --no-git-checks
fi fi
metadata: metadata:
@@ -114,24 +98,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Code quality - name: Code quality
run: | run: |
npmci command npm install -g typescript npm install -g typescript
npmci npm install pnpm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts - name: Build docs and upload artifacts
run: | run: |
npmci node install stable pnpm install
npmci npm install
pnpm install -g @git.zone/tsdoc pnpm install -g @git.zone/tsdoc
npmci command tsdoc tsdoc
continue-on-error: true continue-on-error: true

View File

@@ -1,5 +1,39 @@
# Changelog # Changelog
## 2025-11-16 - 4.3.8 - fix(core)
Ensure correct ArrayBuffer return, fix fetch body typing, reorganize node-only tests, and bump tsbuild devDependency
- core_node: Fix arrayBuffer() to ensure an ArrayBuffer is returned (avoid returning SharedArrayBuffer) to improve interoperability when consuming binary responses.
- core_fetch: Cast request body to BodyInit when assigning to fetch options and preserve duplex = 'half' for ReadableStream bodies to satisfy typings and streaming behavior.
- tests: Reorganize tests into Node-only variants (rename/remove multi-platform test files to test.*.node.ts) to separate platform-specific test coverage.
- chore: Bump devDependency @git.zone/tsbuild from ^2.6.8 to ^2.7.1.
## 2025-11-01 - 4.3.7 - fix(ci)
Update dependencies, add deno.lock, and reorganize tests for browser and Node environments
- Add deno.lock with resolved npm package versions for deterministic Deno/npm usage
- Bump @push.rocks/smartenv dependency to ^6.0.0
- Bump devDependencies: @git.zone/tsbuild -> ^2.6.8, @git.zone/tsrun -> ^1.6.2, @git.zone/tstest -> ^2.7.0
- Reorganize tests: move browser tests to chromium variants and add environment-specific test files for node, bun, deno (streaming, timeout, streamNode, etc.)
- Update package.json dependency ranges to match upgraded lockfile and test tooling
## 2025-10-26 - 4.3.6 - fix(ci)
Use .npmrc for registry authentication in Gitea workflow and add conditional npmjs publish
- Replace npm config set commands with creating a .npmrc file for Gitea registry authentication in .gitea/workflows/default_tags.yaml
- Add conditional update of .npmrc and publishing to npmjs.org when NPMCI_TOKEN_NPM is provided
- Keep pnpm publish --no-git-checks; improve CI credential handling to be file-based
## 2025-10-26 - 4.3.5 - fix(workflows)
Remove npmci wrappers from CI workflows and use pnpm/npm CLI directly
- Removed global npmci installation and npmci npm prepare steps from Gitea workflow files
- Use pnpm install/test/build instead of npmci-wrapped commands in test jobs
- Replace npmci command npm config set ... with direct npm config set calls for registry/auth configuration
- Use pnpm publish --no-git-checks for Gitea publishing and use pnpm publish for conditional npmjs publish when token present
- Simplified dependency auditing to run pnpm audit and set registry via npm config set
- Install tsdoc globally and run tsdoc during docs build step (replacing npmci command usage)
## 2025-10-25 - 4.3.4 - fix(ci) ## 2025-10-25 - 4.3.4 - fix(ci)
Fix Gitea workflow publish invocation to run npm publish via npmci command Fix Gitea workflow publish invocation to run npm publish via npmci command

7188
deno.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartrequest", "name": "@push.rocks/smartrequest",
"version": "4.3.4", "version": "4.3.8",
"private": false, "private": false,
"description": "A module for modern HTTP/HTTPS requests with support for form data, file uploads, JSON, binary data, streams, and more.", "description": "A module for modern HTTP/HTTPS requests with support for form data, file uploads, JSON, binary data, streams, and more.",
"exports": { "exports": {
@@ -39,7 +39,7 @@
}, },
"homepage": "https://code.foss.global/push.rocks/smartrequest#readme", "homepage": "https://code.foss.global/push.rocks/smartrequest#readme",
"dependencies": { "dependencies": {
"@push.rocks/smartenv": "^5.0.13", "@push.rocks/smartenv": "^6.0.0",
"@push.rocks/smartpath": "^6.0.0", "@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.0.4", "@push.rocks/smartpromise": "^4.0.4",
"@push.rocks/smarturl": "^3.1.0", "@push.rocks/smarturl": "^3.1.0",
@@ -47,9 +47,9 @@
"form-data": "^4.0.4" "form-data": "^4.0.4"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.6.4", "@git.zone/tsbuild": "^2.7.1",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.6.2",
"@git.zone/tstest": "^2.3.4", "@git.zone/tstest": "^2.7.0",
"@types/node": "^22.9.0" "@types/node": "^22.9.0"
}, },
"files": [ "files": [

5734
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
import { tap, expect } from '@git.zone/tstest/tapbundle'; import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as fs from 'fs'; import * as fs from 'node:fs';
import { SmartRequest } from '../ts/index.js'; import { SmartRequest } from '../ts/index.js';
tap.test('should send a buffer using buffer() method', async () => { tap.test('should send a buffer using buffer() method', async () => {

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartrequest', name: '@push.rocks/smartrequest',
version: '4.3.4', version: '4.3.8',
description: 'A module for modern HTTP/HTTPS requests with support for form data, file uploads, JSON, binary data, streams, and more.' description: 'A module for modern HTTP/HTTPS requests with support for form data, file uploads, JSON, binary data, streams, and more.'
} }

View File

@@ -71,7 +71,7 @@ export class CoreRequest extends AbstractCoreRequest<
// Check for Buffer (Node.js polyfills in browser may provide this) // Check for Buffer (Node.js polyfills in browser may provide this)
(typeof Buffer !== 'undefined' && this.options.requestBody instanceof Buffer) (typeof Buffer !== 'undefined' && this.options.requestBody instanceof Buffer)
) { ) {
fetchOptions.body = this.options.requestBody; fetchOptions.body = this.options.requestBody as BodyInit;
// If streaming, we need to set duplex mode // If streaming, we need to set duplex mode
if (this.options.requestBody instanceof ReadableStream) { if (this.options.requestBody instanceof ReadableStream) {

View File

@@ -115,10 +115,12 @@ export class CoreResponse<T = any>
*/ */
async arrayBuffer(): Promise<ArrayBuffer> { async arrayBuffer(): Promise<ArrayBuffer> {
const buffer = await this.collectBody(); const buffer = await this.collectBody();
return buffer.buffer.slice( const sliced = buffer.buffer.slice(
buffer.byteOffset, buffer.byteOffset,
buffer.byteOffset + buffer.byteLength, buffer.byteOffset + buffer.byteLength,
); );
// Ensure we return ArrayBuffer, not SharedArrayBuffer
return sliced instanceof ArrayBuffer ? sliced : new ArrayBuffer(0);
} }
/** /**