Skip to content

Commit

Permalink
chore: update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Jun 12, 2024
1 parent 46134aa commit c823eeb
Show file tree
Hide file tree
Showing 16 changed files with 2,585 additions and 2,209 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"extends": ["@hugomrdias/configs/biome"]
}
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
"name": "iso-repo",
"version": "0.0.0",
"private": true,
"workspaces": ["packages/*"],
"workspaces": [
"packages/*"
],
"engines": {
"node": ">=20"
},
"scripts": {
"format": "biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true .",
"fix": "biome check --fix --no-errors-on-unmatched --files-ignore-unknown=true",
"clean": "rm -rf docs node_modules pnpm-lock.yaml packages/*/{pnpm-lock.yaml,coverage,.nyc_output,dist,node_modules,.next}",
"lint": "pnpm -r --if-present run lint",
"test": "pnpm -r --if-present run test",
Expand All @@ -17,20 +19,15 @@
"docs": "typedoc --out docs --plugin typedoc-plugin-missing-exports"
},
"devDependencies": {
"depcheck": "^1.4.7",
"@biomejs/biome": "1.8.1",
"@hugomrdias/configs": "workspace:^",
"lint-staged": "^15.2.2",
"prettier": "3.2.5",
"depcheck": "^1.4.7",
"simple-git-hooks": "^2.11.0",
"typedoc": "^0.25.12",
"typedoc-plugin-missing-exports": "^2.2.0",
"typescript": "5.4.5",
"@biomejs/biome": "1.7.3"
"typescript": "5.4.5"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*": "biome check --no-errors-on-unmatched --files-ignore-unknown=true"
"pre-commit": "pnpm exec biome check --no-errors-on-unmatched --files-ignore-unknown=true --staged"
}
}
76 changes: 37 additions & 39 deletions packages/configs/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"files": {
// this should be just in the formatter
// https://github.com/biomejs/biome-vscode/issues/211
"ignore": ["**/package.json"]
"ignore": [
"**/node_modules",
"**/dist",
"**/package-lock.json",
"**/yarn.lock",
"**/pnpm-lock.yaml",
"**/bun.lockb",

"**/output",
"**/coverage",
"**/temp",
"**/.temp",
"**/tmp",
"**/.tmp",
"**/.history",
"**/.vitepress/cache",
"**/.nuxt",
"**/.next",
"**/.vercel",
"**/.changeset",
"**/.idea",
"**/.cache",
"**/.output",
"**/.vite-inspect",
"**/.yarn",

"**/CHANGELOG*.md",
"**/*.min.*",
"**/LICENSE*",
"**/__snapshots__",
"**/auto-import?(s).d.ts",
"**/components.d.ts",
"**/mockServiceWorker.js"
]
},
"vcs": {
"clientKind": "git",
Expand All @@ -17,7 +48,8 @@
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto"
"attributePosition": "auto",
"ignore": ["**/package.json"]
},
"organizeImports": { "enabled": true },
"linter": {
Expand Down Expand Up @@ -63,41 +95,7 @@
"noEmptyBlockStatements": "error",
"useAwait": "warn"
}
},
"ignore": [
"**/node_modules",
"**/dist",
"**/package-lock.json",
"**/yarn.lock",
"**/pnpm-lock.yaml",
"**/bun.lockb",

"**/output",
"**/coverage",
"**/temp",
"**/.temp",
"**/tmp",
"**/.tmp",
"**/.history",
"**/.vitepress/cache",
"**/.nuxt",
"**/.next",
"**/.vercel",
"**/.changeset",
"**/.idea",
"**/.cache",
"**/.output",
"**/.vite-inspect",
"**/.yarn",

"**/CHANGELOG*.md",
"**/*.min.*",
"**/LICENSE*",
"**/__snapshots__",
"**/auto-import?(s).d.ts",
"**/components.d.ts",
"**/mockServiceWorker.js"
]
}
},
"javascript": {
"formatter": {
Expand Down
52 changes: 39 additions & 13 deletions packages/iso-did/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"url": "hugomrdias/iso-repo",
"directory": "packages/iso-did"
},
"keywords": ["did", "did:key", "did-core"],
"keywords": [
"did",
"did:key",
"did-core"
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
Expand Down Expand Up @@ -40,17 +44,33 @@
"types": "dist/src/index.d.ts",
"typesVersions": {
"*": {
".": ["dist/src/index"],
"core": ["dist/src/core"],
"key": ["dist/src/key"],
"web": ["dist/src/web"],
"fission": ["dist/src/fission"],
"types": ["dist/src/types"]
".": [
"dist/src/index"
],
"core": [
"dist/src/core"
],
"key": [
"dist/src/key"
],
"web": [
"dist/src/web"
],
"fission": [
"dist/src/fission"
],
"types": [
"dist/src/types"
]
}
},
"files": ["src", "dist/src/*.d.ts", "dist/src/*.d.ts.map"],
"files": [
"src",
"dist/src/*.d.ts",
"dist/src/*.d.ts.map"
],
"scripts": {
"lint": "tsc --build && biome check --no-errors-on-unmatched --files-ignore-unknown=true .",
"lint": "tsc --build && biome check --no-errors-on-unmatched --files-ignore-unknown=true",
"test": "tsc --build && pnpm run test:node && pnpm run test:browser",
"test:node": "mocha 'test/**/!(*.browser).test.js'",
"update-msw": "msw init test/mocks/ --save",
Expand All @@ -60,7 +80,7 @@
"did-resolver": "^4.1.0",
"iso-base": "workspace:^",
"iso-web": "workspace:^",
"multiformats": "^13.1.0"
"multiformats": "^13.1.1"
},
"devDependencies": {
"@noble/hashes": "^1.3.3",
Expand All @@ -71,15 +91,21 @@
"mocha": "^10.3.0",
"msw": "^2.2.3",
"playwright-test": "^14.1.1",
"type-fest": "^4.12.0",
"type-fest": "^4.20.0",
"typescript": "5.4.5"
},
"publishConfig": {
"provenance": true
},
"depcheck": {
"specials": ["bin"],
"ignores": ["@types/*", "assert", "type-fest"]
"specials": [
"bin"
],
"ignores": [
"@types/*",
"assert",
"type-fest"
]
},
"msw": {
"workerDirectory": "test/mocks"
Expand Down
8 changes: 4 additions & 4 deletions packages/iso-did/test/mocks/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.2.14'
const PACKAGE_VERSION = '2.3.1'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()
Expand Down Expand Up @@ -140,7 +140,7 @@ async function handleRequest(event, requestId) {
headers: Object.fromEntries(responseClone.headers.entries()),
},
},
[responseClone.body]
[responseClone.body],
)
})()
}
Expand Down Expand Up @@ -229,7 +229,7 @@ async function getResponse(event, client, requestId) {
keepalive: request.keepalive,
},
},
[requestBuffer]
[requestBuffer],
)

switch (clientMessage.type) {
Expand Down Expand Up @@ -259,7 +259,7 @@ function sendToClient(client, message, transferrables = []) {

client.postMessage(
message,
[channel.port2].concat(transferrables.filter(Boolean))
[channel.port2].concat(transferrables.filter(Boolean)),
)
})
}
Expand Down
4 changes: 2 additions & 2 deletions packages/iso-filecoin/test/message.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'assert'
import { Schemas } from '../src/message.js'

describe('message validation', () => {
it('should validate', async () => {
it('should validate', () => {
const valid = Schemas.message.safeParse({
version: 0,
to: 't1pc2apytmdas3sn5ylwhfa32jfpx7ez7ykieelna',
Expand All @@ -19,7 +19,7 @@ describe('message validation', () => {
assert.ok(valid.success)
})

it('should validate from partial', async () => {
it('should validate from partial', () => {
const valid = Schemas.message.safeParse({
to: 't1pc2apytmdas3sn5ylwhfa32jfpx7ez7ykieelna',
from: 't1pc2apytmdas3sn5ylwhfa32jfpx7ez7ykieelna',
Expand Down
4 changes: 2 additions & 2 deletions packages/iso-filecoin/test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'assert'
import { parseDerivationPath } from '../src/utils.js'

describe('derivation path', () => {
it('should parse testnet bip44 derivation path', async () => {
it('should parse testnet bip44 derivation path', () => {
const components = parseDerivationPath("m/44'/1'/0'/0/0")

assert.deepStrictEqual(components, {
Expand All @@ -14,7 +14,7 @@ describe('derivation path', () => {
})
})

it('should parse mainnet bip44 derivation path', async () => {
it('should parse mainnet bip44 derivation path', () => {
const components = parseDerivationPath("m/44'/461'/0'/0/0")

assert.deepStrictEqual(components, {
Expand Down
2 changes: 1 addition & 1 deletion packages/iso-kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"devDependencies": {
"@types/better-sqlite3": "^7.6.9",
"@types/node": "^20.14.2",
"better-sqlite3": "^10.0.0",
"better-sqlite3": "^11.0.0",
"delay": "^6.0.0",
"playwright-test": "^14.1.1",
"quick-lru": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/iso-passkeys/src/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function validateOKP(data, key) {
* @param {AuthData} data
* @param {import("./types").COSEPublicKey} pubKey
*/
export async function validateAuth(data, pubKey) {
export function validateAuth(data, pubKey) {
const keyType = getCoseKeyType(pubKey)

switch (keyType) {
Expand Down
43 changes: 33 additions & 10 deletions packages/iso-signatures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,31 @@
"types": "dist/src/index.d.ts",
"typesVersions": {
"*": {
".": ["dist/src/index"],
"types": ["dist/src/types"],
"signers/*": ["dist/src/signers/*"],
"verifiers/*": ["dist/src/verifiers/*"],
"asn1": ["./dist/src/asn1"],
"spki": ["./dist/src/spki"]
".": [
"dist/src/index"
],
"types": [
"dist/src/types"
],
"signers/*": [
"dist/src/signers/*"
],
"verifiers/*": [
"dist/src/verifiers/*"
],
"asn1": [
"./dist/src/asn1"
],
"spki": [
"./dist/src/spki"
]
}
},
"files": ["src", "dist/src/**/*.d.ts", "dist/src/**/*.d.ts.map"],
"files": [
"src",
"dist/src/**/*.d.ts",
"dist/src/**/*.d.ts.map"
],
"scripts": {
"lint": "tsc --build && biome check --no-errors-on-unmatched --files-ignore-unknown=true .",
"test": "tsc --build && pnpm run test:node && pnpm run test:browser",
Expand All @@ -82,14 +98,21 @@
"assert": "^2.1.0",
"mocha": "^10.3.0",
"playwright-test": "^14.1.1",
"type-fest": "^4.12.0",
"type-fest": "^4.20.0",
"typescript": "5.4.5"
},
"publishConfig": {
"provenance": true
},
"depcheck": {
"specials": ["bin"],
"ignores": ["@types/*", "assert", "type-fest", "mocha"]
"specials": [
"bin"
],
"ignores": [
"@types/*",
"assert",
"type-fest",
"mocha"
]
}
}
2 changes: 1 addition & 1 deletion packages/iso-signatures/src/signers/eddsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class EdDSASigner {
*
* @param {Uint8Array} message
*/
async sign(message) {
sign(message) {
return signAsync(message, this.#privateKey)
}

Expand Down
Loading

0 comments on commit c823eeb

Please sign in to comment.