Skip to content

Commit 9b236ce

Browse files
committed
refactor: restructure src/lib and src/runtime now that runtime is fixed
BREAKING CHANGE: createRemoteJWKSet now uses fetch, because of that its Node.js only options.agent property has been removed and new fetch-related options were added
1 parent c4abaa2 commit 9b236ce

File tree

151 files changed

+2698
-3352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+2698
-3352
lines changed

.electron_flags.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ echo $(electron -i <<< 'process.exit(0)' 2> /dev/null | grep "Using" | awk '{$1=
22

33
electron -i <<< 'process.exit(parseInt(process.versions.node, 10))' &> /dev/null
44
NODE_VERSION=$?
5-
export NODE_OPTIONS='--no-warnings --enable-source-maps'
5+
export NODE_OPTIONS='--no-warnings --enable-source-maps --import=tsx/esm'
66

77
if [[ $NODE_VERSION -eq 18 ]]; then
88
export NODE_OPTIONS+=' --experimental-global-webcrypto'

.github/workflows/test.yml

Lines changed: 4 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,6 @@ jobs:
1313
build:
1414
uses: ./.github/workflows/build.yml
1515

16-
typings:
17-
needs:
18-
- build
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v4
23-
- name: Setup node
24-
id: node
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: lts/*
28-
cache: 'npm'
29-
- run: npm clean-install
30-
- name: Load cached dist
31-
uses: actions/cache@v4
32-
id: dist
33-
with:
34-
path: dist
35-
key: ${{ needs.build.outputs.cache-key }}
36-
fail-on-cache-miss: true
37-
- name: Check TypeScript type definitions
38-
run: npm run test:types
39-
4016
node-versions:
4117
uses: panva/.github/.github/workflows/node-versions.yml@main
4218
with:
@@ -45,7 +21,6 @@ jobs:
4521
node:
4622
needs:
4723
- node-versions
48-
- build
4924
strategy:
5025
fail-fast: false
5126
matrix:
@@ -66,61 +41,38 @@ jobs:
6641
cache: 'npm'
6742
check-latest: true
6843
- run: npm clean-install
69-
- name: Load cached dist
70-
uses: actions/cache@v4
71-
id: dist
72-
with:
73-
path: dist
74-
key: ${{ needs.build.outputs.cache-key }}
75-
fail-on-cache-miss: true
7644
- name: Run Test Suite
7745
run: npm run ${{ matrix.suite }}
7846

7947
deno:
80-
needs:
81-
- build
8248
runs-on: ubuntu-latest
8349
steps:
8450
- name: Checkout
8551
uses: actions/checkout@v4
8652
- uses: denoland/setup-deno@v1
8753
with:
8854
deno-version: latest
89-
- name: Load cached dist
90-
uses: actions/cache@v4
91-
id: dist
92-
with:
93-
path: dist
94-
key: ${{ needs.build.outputs.cache-key }}
95-
fail-on-cache-miss: true
96-
- name: Test Deno Definitions
97-
run: deno check dist/deno/index.ts
9855
- name: Setup node
9956
uses: actions/setup-node@v4
10057
with:
10158
node-version: lts/*
10259
cache: 'npm'
10360
- run: npm clean-install
61+
- name: Test Deno Definitions
62+
run: |
63+
npm run build:deno
64+
deno check dist/deno/index.ts
10465
- name: Test Deno
10566
run: npm run tap:deno
10667

10768
bun:
108-
needs:
109-
- build
11069
runs-on: ubuntu-latest
11170
steps:
11271
- name: Checkout
11372
uses: actions/checkout@v4
11473
- uses: oven-sh/setup-bun@v1
11574
with:
11675
bun-version: latest
117-
- name: Load cached dist
118-
uses: actions/cache@v4
119-
id: dist
120-
with:
121-
path: dist
122-
key: ${{ needs.build.outputs.cache-key }}
123-
fail-on-cache-miss: true
12476
- name: Setup node
12577
uses: actions/setup-node@v4
12678
with:
@@ -131,8 +83,6 @@ jobs:
13183
run: npm run tap:bun
13284

13385
workerd:
134-
needs:
135-
- build
13686
runs-on: ubuntu-latest
13787
steps:
13888
- name: Checkout
@@ -144,19 +94,10 @@ jobs:
14494
cache: 'npm'
14595
- run: npm clean-install
14696
- run: npm install --global workerd
147-
- name: Load cached dist
148-
uses: actions/cache@v4
149-
id: dist
150-
with:
151-
path: dist
152-
key: ${{ needs.build.outputs.cache-key }}
153-
fail-on-cache-miss: true
15497
- name: Run Test Suite
15598
run: npm run tap:workerd
15699

157100
edge-runtime:
158-
needs:
159-
- build
160101
runs-on: ubuntu-latest
161102
steps:
162103
- name: Checkout
@@ -167,19 +108,10 @@ jobs:
167108
node-version: lts/*
168109
cache: 'npm'
169110
- run: npm clean-install
170-
- name: Load cached dist
171-
uses: actions/cache@v4
172-
id: dist
173-
with:
174-
path: dist
175-
key: ${{ needs.build.outputs.cache-key }}
176-
fail-on-cache-miss: true
177111
- name: Run Test Suite
178112
run: npm run tap:edge-runtime
179113

180114
browsers:
181-
needs:
182-
- build
183115
runs-on: ${{ matrix.runs-on || 'ubuntu-latest' }}
184116
strategy:
185117
fail-fast: false
@@ -206,21 +138,12 @@ jobs:
206138
run: |
207139
sudo sqlite3 "$HOME/Library/Application Support/com.apple.TCC/TCC.db" "INSERT OR REPLACE INTO access VALUES('kTCCServiceAppleEvents','com.devexpress.testcafe-browser-tools',0,2,3,1,X'fade0c0000000068000000010000000700000007000000080000001443fa4ca5141baeda21aeca1f50894673b440d4690000000800000014f8afcf6e69791b283e55bd0b03e39e422745770e0000000800000014bf4fc1aed64c871a49fc6bc9dd3878ce5d4d17c6',NULL,0,'com.apple.Safari',X'fade0c000000002c00000001000000060000000200000010636f6d2e6170706c652e53616661726900000003',NULL,1687952810,NULL,NULL,'UNUSED',1687952810);"
208140
sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "INSERT OR REPLACE INTO access VALUES('kTCCServiceScreenCapture','com.devexpress.testcafe-browser-tools',0,2,3,1,X'fade0c0000000068000000010000000700000007000000080000001443fa4ca5141baeda21aeca1f50894673b440d4690000000800000014f8afcf6e69791b283e55bd0b03e39e422745770e0000000800000014bf4fc1aed64c871a49fc6bc9dd3878ce5d4d17c6',NULL,0,'UNUSED',NULL,0,1687952810,NULL,NULL,'UNUSED',1687952810);"
209-
- name: Load cached dist
210-
uses: actions/cache@v4
211-
id: dist
212-
with:
213-
path: dist
214-
key: ${{ needs.build.outputs.cache-key }}
215-
fail-on-cache-miss: true
216141
- name: Run Test Suite
217142
run: npm run tap:browsers
218143
env:
219144
BROWSER: ${{ matrix.browser }}
220145

221146
electron:
222-
needs:
223-
- build
224147
runs-on: macos-latest
225148
steps:
226149
- name: Checkout
@@ -231,13 +154,6 @@ jobs:
231154
node-version: lts/*
232155
cache: 'npm'
233156
- run: npm clean-install
234-
- name: Load cached dist
235-
uses: actions/cache@v4
236-
id: dist
237-
with:
238-
path: dist
239-
key: ${{ needs.build.outputs.cache-key }}
240-
fail-on-cache-miss: true
241157
- name: Install Electron
242158
run: npm install --global electron
243159
- name: Run Test Suite

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ tap/*.js
124124
tap/*.js.map
125125
tap/run-*.mjs
126126
tap/run-*.mjs.map
127+
tap/run-*.cjs
128+
tap/run-*.cjs.map
127129
*.bak
128130
*.bun
129131
tap/.workerd.capnp

.node_flags.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ echo "Using Node.js $(node --version)"
22

33
node -e 'process.exit(parseInt(process.versions.node, 10))' &> /dev/null
44
NODE_VERSION=$?
5-
export NODE_OPTIONS='--no-warnings --enable-source-maps'
5+
export NODE_OPTIONS='--no-warnings --enable-source-maps --import=tsx/esm'
66

77
if [[ $NODE_VERSION -eq 18 ]]; then
88
export NODE_OPTIONS+=' --experimental-global-webcrypto'

ava.config.cjs

Lines changed: 0 additions & 21 deletions
This file was deleted.

ava.config.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const files = ['test/**/*.test.ts']
2+
3+
if ('CITGM' in process.env) {
4+
files.push("!**/remote.test.ts")
5+
}
6+
7+
export default {
8+
extensions: {
9+
ts: 'module',
10+
mjs: true,
11+
},
12+
files,
13+
workerThreads: false,
14+
nodeArguments: ['--enable-source-maps'],
15+
}

0 commit comments

Comments
 (0)