Skip to content

Commit fa5beeb

Browse files
committed
CI: attest standalone build files. Bump devdeps.
1 parent 0d77da0 commit fa5beeb

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ on:
33
release:
44
types: [created]
55
jobs:
6-
release-js:
7-
name: 'jsbt v0.3.1' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/release.yml@c45f03360e0171b138f04568d2fdd35d7bbc0d35
6+
test-js:
7+
name: 'jsbt v0.3.3' # Should match commit below
8+
uses: paulmillr/jsbt/.github/workflows/release.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea
99
with:
1010
build-path: test/build
1111
secrets:
1212
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1313
permissions:
1414
contents: write
1515
id-token: write
16+
attestations: write

.github/workflows/test-js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ on:
44
- pull_request
55
jobs:
66
test-js:
7-
name: 'jsbt v0.3.1' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/test-js.yml@c45f03360e0171b138f04568d2fdd35d7bbc0d35
7+
name: 'jsbt v0.3.3' # Should match commit below
8+
uses: paulmillr/jsbt/.github/workflows/test-js.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea

index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ftch, jsonrpc, replayable } from 'micro-ftch';
88
99
let enabled = false;
1010
const net = ftch(fetch, {
11-
killswitch: () => enabled,
11+
isValidRequest: () => enabled,
1212
log: (url, options) => console.log(url, options),
1313
timeout: 5000,
1414
concurrencyLimit: 10,
@@ -147,10 +147,9 @@ const getRequestInfo = (req: UnPromise<ReturnType<FetchFn>>) => ({
147147
*/
148148
export function ftch(fetchFunction: FetchFn, opts: FtchOpts = {}): FetchFn {
149149
const ks = opts.isValidRequest || opts.killswitch;
150-
if (ks && typeof ks !== 'function') throw new Error('opts.killswitch must be a function');
150+
if (ks && typeof ks !== 'function') throw new Error('opts.isValidRequest must be a function');
151151
const noNetwork = (url: string) => ks && !ks(url);
152152
const wrappedFetch: FetchFn = async (url, reqOpts = {}) => {
153-
if (opts.log) opts.log(url, reqOpts);
154153
const abort = new AbortController();
155154
let timeout = undefined;
156155
if (opts.timeout !== undefined || reqOpts.timeout !== undefined) {
@@ -171,6 +170,7 @@ export function ftch(fetchFunction: FetchFn, opts: FtchOpts = {}): FetchFn {
171170
h.forEach((v, k) => headers.set(k, v));
172171
}
173172
if (noNetwork(url)) throw new Error('network disabled');
173+
if (opts.log) opts.log(url, reqOpts);
174174
const res = await fetchFunction(url, {
175175
referrerPolicy: 'no-referrer', // avoid sending referrer by default
176176
...reqOpts,
@@ -237,13 +237,13 @@ export class JsonrpcProvider implements JsonrpcInterface {
237237
private batchSize: number;
238238
private headers: Record<string, string>;
239239
private queue: ({ method: string; params: RpcParams } & PromiseCb<any>)[] = [];
240-
constructor(
241-
private fetchFunction: FetchFn,
242-
readonly rpcUrl: string,
243-
options: NetworkOpts = {}
244-
) {
240+
private fetchFunction: FetchFn;
241+
readonly rpcUrl: string;
242+
constructor(fetchFunction: FetchFn, rpcUrl: string, options: NetworkOpts = {}) {
245243
if (typeof fetchFunction !== 'function') throw new Error('fetchFunction is required');
246244
if (typeof rpcUrl !== 'string') throw new Error('rpcUrl is required');
245+
this.fetchFunction = fetchFunction;
246+
this.rpcUrl = rpcUrl;
247247
this.batchSize = options.batchSize === undefined ? 1 : options.batchSize;
248248
this.headers = options.headers || {};
249249
if (typeof this.headers !== 'object') throw new Error('invalid headers: expected object');

package-lock.json

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
}
1818
},
1919
"devDependencies": {
20-
"@paulmillr/jsbt": "0.3.1",
20+
"@paulmillr/jsbt": "0.3.3",
2121
"micro-bmark": "0.4.0",
2222
"micro-should": "0.5.1",
23-
"prettier": "3.3.2",
24-
"typescript": "5.5.2"
23+
"prettier": "3.5.2",
24+
"typescript": "5.8.2"
2525
},
2626
"sideEffects": false,
2727
"author": "Paul Miller (https://paulmillr.com)",

0 commit comments

Comments
 (0)