From 9782abbca225c1afe80cfe3398271645e6dfdeaa Mon Sep 17 00:00:00 2001 From: Nathan Totten Date: Thu, 21 Sep 2023 07:23:44 -0400 Subject: [PATCH 1/3] updated package.json --- .npmrc | 2 ++ package-lock.json | 4 ++-- package.json | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.npmrc b/.npmrc index 4eae7876f..d7547c71d 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,3 @@ lockfile-version=3 +//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} +@zuplo:registry=https://npm.pkg.github.com \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cbaff6a29..768b16c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@readme/httpsnippet", + "name": "@zuplo/httpsnippet", "version": "7.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@readme/httpsnippet", + "name": "@zuplo/httpsnippet", "version": "7.1.2", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 13568a19c..d30fe7f84 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "@readme/httpsnippet", + "name": "@zuplo/httpsnippet", "version": "7.1.2", "description": "HTTP Request snippet generator for *most* languages", - "homepage": "https://github.com/readmeio/httpsnippet", + "homepage": "https://github.com/zuplo/httpsnippet", "license": "MIT", "sideEffects": false, "type": "module", @@ -66,7 +66,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/readmeio/httpsnippet.git" + "url": "https://github.com/zuplo/httpsnippet.git" }, "scripts": { "build": "tsup", From 8d2ed08144a12d6377e878e29073d1628b89d2e0 Mon Sep 17 00:00:00 2001 From: Nathan Totten Date: Thu, 21 Sep 2023 08:48:40 -0400 Subject: [PATCH 2/3] updated bundle config --- package-lock.json | 42 +++++++++++++++++++++++++++++------------- package.json | 7 ++++--- src/index.ts | 10 ++++++---- tsup.config.ts | 4 +++- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 768b16c3c..616f60fe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,10 @@ "version": "7.1.2", "license": "MIT", "dependencies": { - "formdata-to-string": "^1.1.0", + "@zuplo/formdata-to-string": "^1.1.0", "qs": "^6.11.2", - "stringify-object": "^3.3.0" + "stringify-object": "^3.3.0", + "url": "^0.11.3" }, "devDependencies": { "@readme/eslint-config": "^13.0.1", @@ -2369,6 +2370,18 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@zuplo/formdata-to-string": { + "version": "1.1.0", + "resolved": "https://npm.pkg.github.com/download/@zuplo/formdata-to-string/1.1.0/a576c5d7393c51c1c9b1030f269234fedfa90cd7", + "integrity": "sha512-rAuwzt+UDg08r8uYL1eVlzWcARdD44+LNK8LBYMXheKtu3fOi0r64grpKQ6KysiCz0HalidLdQG3Apo5HcrjNA==", + "license": "ISC", + "dependencies": { + "undici": "^5.24.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -5018,17 +5031,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/formdata-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/formdata-to-string/-/formdata-to-string-1.1.0.tgz", - "integrity": "sha512-f+jVhrBYfgRsHnOBL+1djGwZ4qOAXiIz/JrV1qHIE1cJ30b6IxKWmNmWybxR7vgXYhBHVHeqcbhtGE5J5OAXxQ==", - "dependencies": { - "undici": "^5.24.0" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -9049,6 +9051,20 @@ "punycode": "^2.1.0" } }, + "node_modules/url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, "node_modules/v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", diff --git a/package.json b/package.json index d30fe7f84..7f7e0b1c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zuplo/httpsnippet", - "version": "7.1.2", + "version": "7.2.2", "description": "HTTP Request snippet generator for *most* languages", "homepage": "https://github.com/zuplo/httpsnippet", "license": "MIT", @@ -79,9 +79,10 @@ "test": "vitest --coverage" }, "dependencies": { - "formdata-to-string": "^1.1.0", + "@zuplo/formdata-to-string": "^1.1.0", "qs": "^6.11.2", - "stringify-object": "^3.3.0" + "stringify-object": "^3.3.0", + "url": "^0.11.3" }, "devDependencies": { "@readme/eslint-config": "^13.0.1", diff --git a/src/index.ts b/src/index.ts index 0aa4b4918..4fcab720c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,13 @@ +import type { Request as NpmHarRequest, Param, PostDataCommon } from 'har-format'; import type { ReducedHelperObject } from './helpers/reducer.js'; import type { ClientId, TargetId } from './targets/index.js'; -import type { Param, PostDataCommon, Request as NpmHarRequest } from 'har-format'; -import type { UrlWithParsedQuery } from 'node:url'; +// eslint-disable-next-line unicorn/prefer-node-protocol +import type { UrlWithParsedQuery } from 'url'; -import { format as urlFormat, parse as urlParse } from 'node:url'; +// eslint-disable-next-line unicorn/prefer-node-protocol, node/no-deprecated-api +import { format as urlFormat, parse as urlParse } from 'url'; -import formDataToString from 'formdata-to-string'; +import formDataToString from '@zuplo/formdata-to-string'; import { stringify as queryStringify } from 'qs'; import { getHeaderName } from './helpers/headers.js'; diff --git a/tsup.config.ts b/tsup.config.ts index ff3603e24..7fdb2b2b0 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -2,7 +2,9 @@ import { defineConfig } from 'tsup'; export default defineConfig(options => ({ ...options, - + bundle: true, + platform: 'browser', + target: ['es2022'], cjsInterop: true, dts: true, entry: ['src/index.ts', 'src/helpers/code-builder.ts', 'src/helpers/reducer.ts', 'src/targets/index.ts'], From 314d21447a3279c09fe48a82eb0bd740d545bf67 Mon Sep 17 00:00:00 2001 From: Adrian Machado Date: Fri, 22 Sep 2023 00:22:39 +0000 Subject: [PATCH 3/3] Apply patch from upstream --- src/helpers/__snapshots__/utils.test.ts.snap | 2 +- src/targets/http/target.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/__snapshots__/utils.test.ts.snap b/src/helpers/__snapshots__/utils.test.ts.snap index 4eb88e018..a4cc15d87 100644 --- a/src/helpers/__snapshots__/utils.test.ts.snap +++ b/src/helpers/__snapshots__/utils.test.ts.snap @@ -78,7 +78,7 @@ exports[`availableTargets > returns all available targets 1`] = ` "title": "HTTP/1.1", }, ], - "default": "1.1", + "default": "http1.1", "key": "http", "title": "HTTP", }, diff --git a/src/targets/http/target.ts b/src/targets/http/target.ts index ffd1e5d14..1dce0de1b 100644 --- a/src/targets/http/target.ts +++ b/src/targets/http/target.ts @@ -6,7 +6,7 @@ export const http: Target = { info: { key: 'http', title: 'HTTP', - default: '1.1', + default: 'http1.1', }, clientsById: { 'http1.1': http11,