Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to JSR.io #634

Merged
merged 115 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
0106e79
Migrate deps.ts to import map in deno.jsonc
MasterKale Nov 4, 2024
c4b672d
Update dnt build script
MasterKale Nov 4, 2024
e839c9d
Migrate imports away from deps.ts
MasterKale Nov 4, 2024
9a84369
Delete deps.ts from server
MasterKale Nov 4, 2024
d0e8648
Copy deno fmt settings into server and types
MasterKale Nov 4, 2024
69a4693
Remove superfluous root deno.jsonc
MasterKale Nov 4, 2024
b6ae2ec
Run pnpm install from root
MasterKale Nov 4, 2024
a807a99
Try to specify formatting settings in lint-staged
MasterKale Nov 4, 2024
b54f37e
Use non-Homebrew Deno install for now
MasterKale Nov 4, 2024
d17a490
Update types dnt to same version
MasterKale Nov 5, 2024
814eb71
Remove files to prepare for a Deno + JSR future
MasterKale Nov 5, 2024
0bd8c14
Go back to Homebrew Deno
MasterKale Nov 5, 2024
a53432f
Set up Deno workspace
MasterKale Nov 5, 2024
55e1747
Get extract-dom-types working with Deno
MasterKale Nov 5, 2024
0523a67
Add JSR meta to types
MasterKale Nov 5, 2024
29d2453
Migrate some root devDeps to browser package.json
MasterKale Nov 5, 2024
761fa8d
Specify files to include
MasterKale Nov 5, 2024
35aedd9
Mark this an alpha release
MasterKale Nov 5, 2024
bfb115c
Clean up types package
MasterKale Nov 5, 2024
0222187
Remove unnecessary deno.lock
MasterKale Nov 5, 2024
91cb7ec
Remove build task from types
MasterKale Nov 5, 2024
18d1644
Skip building server with dnt for JSR
MasterKale Nov 5, 2024
57acee8
Install test libraries
MasterKale Nov 5, 2024
8d157c2
Remove outdated deno.lock from server
MasterKale Nov 5, 2024
8a538f9
Remove old server package.json
MasterKale Nov 5, 2024
df27c1b
Update tests to use @std libs
MasterKale Nov 5, 2024
8687305
Get stricter about types in MetadataService
MasterKale Nov 5, 2024
ee5effa
Get more explicit about typing in SettingsService
MasterKale Nov 5, 2024
881a0b8
Update server README
MasterKale Nov 5, 2024
7e75de3
Update types README
MasterKale Nov 5, 2024
b168a90
Remove explicit types from server/deno.jsonc
MasterKale Nov 5, 2024
699d0fb
Try to understand how to reference types for JSR
MasterKale Nov 5, 2024
714813e
Increment server to alpha2
MasterKale Nov 5, 2024
887e246
Explicitly suggest installing types from JSR too
MasterKale Nov 5, 2024
e527963
Drop Deno v1.46 testing from CI
MasterKale Nov 5, 2024
193fa9f
Update root deno.lock
MasterKale Nov 5, 2024
a42cde3
Try to set up Deno caching
MasterKale Nov 5, 2024
616ba2f
Try to just get server tests running
MasterKale Nov 5, 2024
81a9d6d
Remove test type
MasterKale Nov 5, 2024
65a0f71
Create a deno.jsonc for browser
MasterKale Nov 5, 2024
662e2b3
Sprinkle in some file extensions into Browser
MasterKale Nov 5, 2024
f3c4335
Port browserSupportsWebAuthn tests to Deno
MasterKale Nov 5, 2024
10dfc5e
Port browserSupportsWebAuthnAutofill tests to Deno
MasterKale Nov 5, 2024
8ace2c4
Port platformAuthenticatorIsAvailable tests
MasterKale Nov 5, 2024
a6eedce
Port WebAuthnAbortService tests to Deno
MasterKale Nov 5, 2024
08e07ba
Update index tests to Deno
MasterKale Nov 5, 2024
2506508
Make it possible to stub browserSupportsWebAuthn
MasterKale Nov 5, 2024
0408a4f
Migrate registration tests to Deno
MasterKale Nov 6, 2024
118f0ab
Enable stubbing browserSupportsWebAuthnAutofill
MasterKale Nov 6, 2024
c6f28c3
Delete Jest configs
MasterKale Nov 6, 2024
e3efafd
Manually run `deno fmt` on browser
MasterKale Nov 6, 2024
00cdb23
Clean up stubbing in registration tests
MasterKale Nov 6, 2024
c567bba
Refine registration tests
MasterKale Nov 8, 2024
a41f6bd
Await assertRejects in metadata test
MasterKale Nov 8, 2024
7e98772
Improve browserSupportsWebAuthnAutofill test
MasterKale Nov 8, 2024
d1d2737
Migrate authentication tests
MasterKale Nov 8, 2024
f17dd16
Commit introduction of jsdom for tests
MasterKale Nov 8, 2024
f16544e
Keep package.json around as a .txt file for now
MasterKale Nov 9, 2024
ab0331c
Re-enable browser tests
MasterKale Nov 9, 2024
df17704
Tweak CI step name
MasterKale Nov 9, 2024
ef6bd1b
Refine includes and excludes
MasterKale Nov 9, 2024
e505770
Add explicit typing to WebAuthnAbortService
MasterKale Nov 9, 2024
c64e01f
Delete old docs and homepage
MasterKale Nov 10, 2024
3dd7c11
Remove pnpm bootstrap script
MasterKale Nov 10, 2024
e7f9c8f
Remove @deno/cache-dir
MasterKale Nov 13, 2024
61e6d7f
Reinstall dnt
MasterKale Nov 21, 2024
a345338
Reinstate types dnt build
MasterKale Nov 21, 2024
618f2e0
Update deno.lock
MasterKale Nov 21, 2024
ac22a5d
Understand Deno's monorepo linking better
MasterKale Nov 21, 2024
7cc3818
Reinstate server dnt build
MasterKale Nov 21, 2024
b9e5381
Add browser dnt build
MasterKale Nov 21, 2024
6d5641d
Get an initial UMD build going
MasterKale Nov 22, 2024
bdd0b30
Try to get Rollup working on dnt output again
MasterKale Nov 23, 2024
26ffb71
Pull in CommonJS Rollup plugin
MasterKale Nov 23, 2024
6536526
Incorporate Babel into Rollup
MasterKale Nov 23, 2024
224188c
Finally figure out the UMD build
MasterKale Nov 23, 2024
c6c8381
Clean up Browser folder
MasterKale Nov 23, 2024
df8cca8
Clean up some Browser Deno tasks
MasterKale Nov 23, 2024
71778af
Add deno.land/x Browser import shortcut
MasterKale Nov 23, 2024
338d15b
Restore @deno/cache-dir
MasterKale Nov 23, 2024
50536b3
Run `deno fmt packages/`
MasterKale Nov 23, 2024
a87cfb6
Add some console output from UMD build
MasterKale Nov 23, 2024
1781ff6
Prepare publish tasks
MasterKale Nov 23, 2024
b1c0b02
Prevent Deno from formatting extracted DOM types
MasterKale Nov 23, 2024
f95fe71
Support publishing browser to JSR
MasterKale Nov 23, 2024
370df5a
Outline versioning script steps
MasterKale Nov 23, 2024
46be6c3
Rename deno.jsonc to deno.json
MasterKale Nov 23, 2024
0d39088
Use Deno's native JSON importing
MasterKale Nov 23, 2024
5338929
Commit minor deno.lock change
MasterKale Nov 23, 2024
e3f05b0
Finish initial versioning script
MasterKale Nov 23, 2024
dfacbd2
Enable Deno across the entire repo
MasterKale Nov 23, 2024
f6bd98a
Update deployment handbook for new process
MasterKale Nov 23, 2024
b6eb5d3
Add links to the various package repos
MasterKale Nov 23, 2024
cdc6e1e
Update version to -alpha3
MasterKale Nov 23, 2024
380f471
Update CHANGELOG for v11.0.0
MasterKale Nov 23, 2024
3afd91f
Stop double-building when publishing
MasterKale Nov 23, 2024
f778661
Run `deno fmt` on packages
MasterKale Nov 23, 2024
8c6e4e5
Update browser and server READMs
MasterKale Nov 23, 2024
cdbeaea
Replace lingering references to pnpm
MasterKale Nov 23, 2024
2a6a9c3
Delete VS Code tasks
MasterKale Nov 23, 2024
bd5bc51
Update installation instructions
MasterKale Nov 24, 2024
7b081eb
Change "Usage" to "Documentation"
MasterKale Nov 24, 2024
9c49b11
Slim down deno.land/x README
MasterKale Nov 24, 2024
f2a1102
Restore ES2021 UMD browser build
MasterKale Nov 24, 2024
01f26a8
Keep Deno out of /example and scratch envs
MasterKale Nov 24, 2024
bdc9b08
Refine version task to only consider src/ changes
MasterKale Nov 24, 2024
2556630
Tweak VS Code settings
MasterKale Nov 24, 2024
02eac3b
Deprecate deno.land/x hosting support
MasterKale Nov 24, 2024
6868b63
Simplify installation guidance
MasterKale Nov 25, 2024
e5589ad
Refine deno.land/x migration guidance
MasterKale Nov 25, 2024
14a2520
Tweak UMD docs in browser README
MasterKale Nov 25, 2024
d39b6f7
Remove leading $ for cleaner copy-pastes
MasterKale Nov 25, 2024
e7c3d34
Make everything "Deno v1.43 and higher"
MasterKale Nov 25, 2024
d91d3c1
Get more specific with README registry URLs
MasterKale Nov 25, 2024
9c05d27
Remove an empty import from a test
MasterKale Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 45 additions & 53 deletions .github/workflows/ciChecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,58 @@ name: CI Checks

on:
push:
branches: [ master, beta ]
branches: [master, beta]
pull_request:
branches: [ master, beta ]
branches: [master, beta]

jobs:
unit_tests:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 20, 22 ]
deno-version: [ 'v1.46.x', 'v2.0.x' ]
node-version: [20, 22]
deno-version: ['v2.0.x']

steps:
- uses: actions/checkout@v4

# Install Node
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Confirm installed Node version
run: node -v

# Install Deno
- name: Setup Deno ${{ matrix.deno-version }}
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno-version }}
- name: Confirm installed Deno version
run: deno -V

# Install pnpm w/cache for quicker installs
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Setup pnpm 9.12.3
uses: pnpm/action-setup@v4
with:
version: 9.12.3
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

# Install deps
- name: Install dependencies
run: pnpm install

# Build and test packages
- name: Build & test @simplewebauthn/types
run: npm run build:types # browser tests will need this to be built
- name: Build & test @simplewebauthn/server
run: npm run build:server # dnt will test everything in Node too
- name: Test @simplewebauthn/browser
run: npm run test:browser
- uses: actions/checkout@v4

# Install Node
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Confirm installed Node version
run: node -v

# Install Deno
- name: Setup Deno ${{ matrix.deno-version }}
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno-version }}
- name: Confirm installed Deno version
run: deno -V

# Set up caching for quicker installs
- name: Get DENO_DIR store directory
shell: bash
# Expecting "DENO_DIR location: /Users/matt/Library/Caches/deno" somewhere in `deno info`
run: |
echo "DENO_DIR=$(deno info | grep "DENO_DIR" | awk '{print $3}')" >> $GITHUB_ENV
- name: Setup Deno cache
uses: actions/cache@v4
with:
path: ${{ env.DENO_DIR }}
key: ${{ runner.os }}-deno-dir-${{ hashFiles('**/deno.lock') }}
restore-keys: |
${{ runner.os }}-deno-dir-

# Install deps
- name: Install dependencies
run: deno install

# Build and test packages
- name: Test @simplewebauthn/server
run: cd packages/server && deno task test
- name: Test @simplewebauthn/browser
run: cd packages/browser && deno task test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ example/*.crt
example/fido-conformance-mds/*
!example/fido-conformance-mds/.gitkeep
packages/*/package-lock.json
scratchenv/
scratchenv*
.nx/cache
.nx/workspace-data
9 changes: 5 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"deno.path": "/opt/homebrew/bin/deno",
"deno.enablePaths": [
"./packages/server",
"./packages/types"
"deno.enable": true,
"deno.config": "./deno.json",
"deno.disablePaths": [
"./scratchenv",
"./example"
],
"deno.config": "./deno.jsonc",
"editor.rulers": [
100
],
Expand Down
38 changes: 0 additions & 38 deletions .vscode/tasks.json

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v11.0.0-alpha3

This build is **functionally identical** as v11.0.0. This one just involves massive monorepo
infrastructure changes that I'm putting through its paces.

## v11.0.0 - The one that auto-registers

Say hello to support for automatic passkey registration, support for valid conditional UI `<input>`
Expand Down
20 changes: 0 additions & 20 deletions DOCS.md

This file was deleted.

59 changes: 37 additions & 22 deletions HANDBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,74 @@ Notes for myself that I don't want cluttering up the README

### Step 0: Things you might have missed

#### Did you update the version of `"typescript"` in the monorepo's root **package.json** file?
#### Did you update to a newer version of **Deno**?

Run this first to update **packages/types/dom.ts** then commit the changes:

```
(cd packages/types; pnpm run extract-dom-types)
(cd packages/types; deno task extract-dom-types)
```

### Step 1: Determine which packages need to be published

Run this command, **but cancel out the first time!** Use it to determine which packages need entries
in CHANGELOG.md:
Run this command to determine which packages need entries in CHANGELOG.md:

```
pnpm run update-version
deno task version
```

### Step 2: Update CHANGELOG.md
### Step 2: Update package versions

Update `"version"` in the following **deno.json** files for each package that needs a new release:

- **@simplewebauthn/browser**: [packages/browser/deno.json](./packages/browser/deno.json)
- **@simplewebauthn/server**: [packages/server/deno.json](./packages/server/deno.json)
- **@simplewebauthn/types**: [packages/types/deno.json](./packages/types/deno.json)

Continue using your best judgement on what an appropriate new version number should be.

Commit these changes.

### Step 3: Update CHANGELOG.md

Add entries to CHANGELOG.md for the packages determined in the step above.

### Step 3: Update package versions
Commit these changes.

Re-run Step 1, **but go all the way through with it this time** so that the latest changes have an
entry in the CHANGELOG that gets bundled with the release:
### Step 4: Create a git tag for the chosen version

```
pnpm run update-version
```
Create a tag on HEAD for the new version number.

### Step 4: Publish packages

The following commands can be run from the root of the monorepo to build the respective package,
then **publish it to both [NPM](https://www.npmjs.com/search?q=%40simplewebauthn) and
[JSR](https://jsr.io/@simplewebauthn)**.

### Step 4: Need to publish `types`?
#### Need to publish @simplewebauthn/types?

```
pnpm run publish:types
deno task publish:types
```

### Step 5: Need to publish `browser`?
#### Need to publish @simplewebauthn/browser?

```
pnpm run publish:browser
deno task publish:browser
```

### Step 6: Need to publish `server`?
#### Need to publish @simplewebauthn/server?

1.
- [ ] Make sure the correct version of `types` is on NPM
- The `npm install` step that dnt performs while building the project pulls from NPM. The build
will fail if the version of `types` specified in `mappings` in **build_npm.ts** is unavailable.
- [ ] Make sure the correct version of **@simplewebauthn/types** is on NPM
- The `npm install` step that dnt performs while building **@simplewebauthn/server** pulls from
NPM. The build will fail if the version of **@simplewebauthn/types** specified in
[packages/types/deno.json](./packages/types/deno.json) is unavailable on NPM.

```
pnpm run publish:server
deno task publish:server
```

### Step 7: Push up `HEAD` to `origin`
### Step 5: Push up `HEAD` to `origin`

Don't forget to push up the latest changes to `origin` when everything's been published!
Loading