Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions .changeset/small-corners-win.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
'@learncard/simple-signing-service': patch
'@learncard/simple-signing-client': patch
'@learncard/learn-cloud-service': patch
'@learncard/network-brain-service': patch
'@learncard/network-brain-client': patch
'@learncard/learn-cloud-client': patch
'@learncard/simple-signing-plugin': patch
'@learncard/network-plugin': patch
'@learncard/claimable-boosts-plugin': patch
'@learncard/create-http-bridge': patch
'@learncard/did-web-plugin': patch
'@learncard/dynamic-loader-plugin': patch
'learn-card-discord-bot': patch
'@learncard/vc-templates-plugin': patch
'@learncard/learn-cloud-plugin': patch
'@learncard/snap-chapi-example': patch
'@learncard/helpers': patch
'@learncard/encryption-plugin': patch
'@learncard/expiration-plugin': patch
'@learncard/learn-card-plugin': patch
'@learncard/snap-example-dapp': patch
'@learncard/types': patch
'@learncard/ethereum-plugin': patch
'@learncard/react': patch
'@learncard/core': patch
'@learncard/init': patch
'@learncard/ceramic-plugin': patch
'@learncard/crypto-plugin': patch
'@learncard/didkey-plugin': patch
'@learncard/didkit-plugin': patch
'@learncard/vc-api-plugin': patch
'@learncard/meta-mask-snap': patch
'@learncard/chapi-example': patch
'@learncard/chapi-plugin': patch
'@learncard/vpqr-plugin': patch
'@learncard/idx-plugin': patch
'@learncard/vc-plugin': patch
---

Add oxlint
66 changes: 0 additions & 66 deletions .eslintrc.js

This file was deleted.

39 changes: 37 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Test Runner
name: CI

on:
pull_request:
types: [opened, synchronize]

permissions:
contents: write
pull-requests: read

jobs:
Test:
test:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -46,7 +50,38 @@ jobs:
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Run lint fix
id: lintfix
continue-on-error: true
run: |
pnpm lint:fix
status=$?
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
fi
echo "exitcode=$status" >> $GITHUB_OUTPUT

- name: Commit and push lint fixes
if: steps.lintfix.outputs.changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: auto lint fixes"
git push

- name: Fail due to remaining lint errors
if: steps.lintfix.outputs.exitcode != '0'
run: |
echo "Unfixable lint errors remain. Failing CI early."
exit 1

- name: Skip tests after lint commit
if: steps.lintfix.outputs.changes == 'true' && steps.lintfix.outputs.exitcode == '0'
run: echo "Lint fixes pushed; skipping tests."

- name: Run tests
if: steps.lintfix.outputs.changes != 'true' && steps.lintfix.outputs.exitcode == '0'
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
Expand Down
63 changes: 63 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"categories": {
"correctness": "error",
"suspicious": "warn",
"style": "warn"
},
"env": {
"browser": true,
"node": true,
"es2024": true
},
"ignorePatterns": [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"pnpm-lock.yaml",
"**/playwright-report/**",
"**/test-results/**",
"**/swagger-ui/**",
"**/*.spec.ts",
"**/*.test.ts",
"**/*wasm*"
],
"rules": {
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
"no-console": "off",
"no-explicit-any": "off",
"no-null": "off",
"filename-case": "off",
"curly": "off",
"sort-imports": "off",
"func-style": "off",
"no-ternary": "off",
"no-magic-numbers": "off",
"sort-keys": "off",
"prefer-global-this": "off",
"no-await-expression-member": "off",
"init-declarations": "off",
"max-params": "off",
"yoda": ["warn", "never"],
"consistent-type-definitions": ["warn", "type"],
"consistent-indexed-object-style": ["warn", "record"],
"no-nested-ternary": "off",
"no-continue": "off",
"consistent-type-imports": [
"warn",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"number-literal-case": "off",
"no-instanceof-builtins": "off",
"no-async-endpoint-handlers": "off",
"func-names": "off",
"prefer-object-has-own": "off"
}
}
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"oxc.oxc-vscode"
]
}
1 change: 0 additions & 1 deletion examples/chapi-example/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineConfig } from 'astro/config';
import GlobalPolyfill from '@esbuild-plugins/node-globals-polyfill';
import stdlibbrowser from 'node-stdlib-browser';
import basicSsl from '@vitejs/plugin-basic-ssl';
import react from '@astrojs/react';
Expand Down
2 changes: 1 addition & 1 deletion examples/chapi-example/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
export interface Props {
export type Props = {
title: string;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/chapi-example/src/pages/login.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ import Layout from '@layouts/Layout.astro';
const seed = seedInput.value;

if (seed.length === 0 || seed.length > 64) {
errorDisplay.innerText = 'Please enter a seed between 1 and 64 characters long';
errorDisplay.textContent = 'Please enter a seed between 1 and 64 characters long';
return;
}

if (!isHex(seed)) {
errorDisplay.innerText = 'Please enter a valid hex string (i.e. only numbers and A-F)';
errorDisplay.textContent = 'Please enter a valid hex string (i.e. only numbers and A-F)';
return;
}

_seed.set(seed);
window.location.href = '/';
};

form.onsubmit = onSubmit;
form.addEventListener('submit', onSubmit);
seedInput.value = randomKey();
</script>
2 changes: 2 additions & 0 deletions examples/snap-chapi-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"dependencies": {
"@astrojs/react": "^1.1.3",
"@astrojs/tailwind": "^2.0.1",
"@learncard/chapi-plugin": "workspace:*",
"@learncard/core": "workspace:*",
"@learncard/init": "workspace:*",
"@learncard/helpers": "workspace:*",
"@learncard/meta-mask-snap": "workspace:*",
"@learncard/react": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useStore } from '@nanostores/react';
import { initLearnCard, CredentialStoreEvent } from '@learncard/core';
import { initLearnCard } from '@learncard/init';
import type { CredentialStoreEvent } from '@learncard/chapi-plugin';
import { VCCard } from '@learncard/react';

import '@learncard/react/dist/main.css';
Expand Down
2 changes: 1 addition & 1 deletion examples/snap-chapi-example/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
export interface Props {
export type Props = {
title: string;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/snap-chapi-example/src/pages/login.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ import Layout from '../layouts/Layout.astro';
const seed = seedInput.value;

if (seed.length === 0 || seed.length > 64) {
errorDisplay.innerText = 'Please enter a seed between 1 and 64 characters long';
errorDisplay.textContent = 'Please enter a seed between 1 and 64 characters long';
return;
}

if (!isHex(seed)) {
errorDisplay.innerText = 'Please enter a valid hex string (i.e. only numbers and A-F)';
errorDisplay.textContent = 'Please enter a valid hex string (i.e. only numbers and A-F)';
return;
}

_seed.set(seed);
window.location.href = '/';
};

form.onsubmit = onSubmit;
form.addEventListener('submit', onSubmit);
seedInput.value = randomKey();
</script>
4 changes: 2 additions & 2 deletions examples/snap-chapi-example/src/pages/wallet-worker.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import Layout from '../layouts/Layout.astro';

try {
await wallet.installChapiHandler();
} catch (e) {
console.error('Error in loadOnce:', e);
} catch (error) {
console.error('Error in loadOnce:', error);
}

wallet.activateChapiHandler({
Expand Down
2 changes: 1 addition & 1 deletion examples/snap-chapi-example/src/stores/walletStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LearnCard } from '@learncard/core';
import type { LearnCard } from '@learncard/core';
import { atom } from 'nanostores';
import { persistentAtom } from '@nanostores/persistent';

Expand Down
1 change: 1 addition & 0 deletions examples/snap-chapi-example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "astro/tsconfigs/strictest",
"compilerOptions": {
"jsx": "react",
"moduleResolution": "node",
"baseUrl": ".",
"paths": {
"@components/*": ["./src/components/*"],
Expand Down
2 changes: 1 addition & 1 deletion examples/snap-example-dapp/src/components/Did.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { DidMethod } from '@learncard/didkit-plugin';
import type { DidMethod } from '@learncard/didkit-plugin';

import DidSelector from '@components/DidSelector';

Expand Down
2 changes: 1 addition & 1 deletion examples/snap-example-dapp/src/components/DidSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { DidMethod } from '@learncard/didkit-plugin';
import type { DidMethod } from '@learncard/didkit-plugin';

type DidSelectorProps = {
did: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { VC } from '@learncard/types';
import type { VC } from '@learncard/types';

import TextBox from '@components/input/TextBox';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { VC } from '@learncard/types';
import type { VC } from '@learncard/types';

import { useIsSnapReady } from '@state/snapState';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { CredentialRecord } from '@learncard/types';
import type { CredentialRecord } from '@learncard/types';

import { useIsSnapReady } from '@state/snapState';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { UnsignedVC, VC } from '@learncard/types';
import type { UnsignedVC, VC } from '@learncard/types';

import TextBox from '@components/input/TextBox';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { UnsignedVP, VP } from '@learncard/types';
import type { UnsignedVP, VP } from '@learncard/types';

import TextBox from '@components/input/TextBox';

Expand Down
Loading
Loading