Skip to content

Commit 14c2ec7

Browse files
committed
fix(ci): restore registry-url, add debug output for publish
1 parent 84f72b4 commit 14c2ec7

20 files changed

Lines changed: 1577 additions & 75 deletions

.claude/CLAUDE.md

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
Avoid `accessKey` attr and distracting els
2+
No `aria-hidden="true"` on focusable els
3+
No ARIA roles, states, props on unsupported els
4+
Use `scope` prop only on `<th>` els
5+
No non-interactive ARIA roles on interactive els
6+
Label els need text and associated input
7+
No event handlers on non-interactive els
8+
No interactive ARIA roles on non-interactive els
9+
No `tabIndex` on non-interactive els
10+
No positive integers on `tabIndex` prop
11+
No `image`, `picture`, or `photo` in img alt props
12+
No explicit role matching implicit role
13+
Valid role attrs on static, visible els w/ click handlers
14+
Use `title` el for `svg` els
15+
Provide meaningful alt text for all els requiring it
16+
Anchors need accessible content
17+
Assign `tabIndex` to non-interactive els w/ `aria-activedescendant`
18+
Include all required ARIA attrs for els w/ ARIA roles
19+
Use valid ARIA props for the el's role
20+
Use `type` attr on `button` els
21+
Make els w/ interactive roles and handlers focusable
22+
Heading els need accessible content
23+
Add `lang` attr to `html` el
24+
Use `title` attr on `iframe` els
25+
Pair `onClick` w/ `onKeyUp`, `onKeyDown`, or `onKeyPress`
26+
Pair `onMouseOver`/`onMouseOut` w/ `onFocus`/`onBlur`
27+
Add caption tracks to audio and video els
28+
Use semantic els vs role attrs
29+
All anchors must be valid and navigable
30+
Use valid, non-abstract ARIA props, roles, states, and values
31+
Use valid values for `autocomplete` attr
32+
Use correct ISO language codes in `lang` attr
33+
Include generic font family in font families
34+
No consecutive spaces in regex literals
35+
Avoid `arguments`, comma op, and primitive type aliases
36+
No empty type params in type aliases and interfaces
37+
Keep fns under Cognitive Complexity limit
38+
Limit nesting depth of `describe()` in tests
39+
No unnecessary boolean casts or callbacks on `flatMap`
40+
Use `for...of` vs `Array.forEach`
41+
No classes w/ only static members
42+
No `this` and `super` in static contexts
43+
No unnecessary catch clauses, ctors, `continue`, escape sequences in regex literals, fragments, labels, or nested blocks
44+
No empty exports
45+
No renaming imports, exports, or destructured assignments to same name
46+
No unnecessary string/template literal concatenation or useless cases in switch stmts, `this` aliasing, or `String.raw` without escape sequences
47+
Use simpler alternatives to ternary ops if possible
48+
No `any` or `unknown` as type constraints or initializing vars to `undefined`
49+
Avoid `void` op
50+
Use arrow fns vs function exprs
51+
Use `Date.now()` for milliseconds since Unix Epoch
52+
Use `.flatMap()` vs `map().flat()`
53+
Use `indexOf`/`lastIndexOf` vs `findIndex`/`findLastIndex` for simple lookups
54+
Use literal property access vs computed property access
55+
Use binary, octal, or hex literals vs `parseInt()`
56+
Use concise optional chains vs chained logical exprs
57+
Use regex literals vs `RegExp` ctor
58+
Use base 10 or underscore separators for number literal object member names
59+
Remove redundant terms from logical exprs
60+
Use `while` loops vs `for` loops if initializer and update aren't needed
61+
No reassigning `const` vars or constant exprs in conditions
62+
No `Math.min`/`Math.max` to clamp values where result is constant
63+
No return values from ctors or setters
64+
No empty character classes in regex literals or destructuring patterns
65+
No `__dirname` and `__filename` in global scope
66+
No calling global object props as fns or declaring fns and `var` accessible outside their block
67+
Instantiate builtins correctly
68+
Use `super()` correctly in classes
69+
Use standard direction values for linear gradient fns
70+
Use valid named grid areas in CSS Grid Layouts
71+
Use `@import` at-rules in valid positions
72+
No vars and params before their decl
73+
Include `var` fn for CSS vars
74+
No `\8` and `\9` escape sequences in strings
75+
No literal numbers that lose precision, configured els, or assigning where both sides are same
76+
Compare string case modifications w/ compliant values
77+
No lexical decls in switch clauses or undeclared vars
78+
No unknown CSS value fns, media feature names, props, pseudo-class/pseudo-element selectors, type selectors, or units
79+
No unmatchable An+B selectors or unreachable code
80+
Call `super()` exactly once before accessing `this` in ctors
81+
No control flow stmts in `finally` blocks
82+
No optional chaining where `undefined` is not allowed
83+
No unused fn params, imports, labels, private class members, or vars
84+
No return values from fns w/ return type `void`
85+
Specify all dependencies correctly in React hooks and names for GraphQL operations
86+
Call React hooks from top level of component fns
87+
Use `isNaN()` when checking for NaN
88+
Use `{ type: "json" }` for JSON module imports
89+
Use radix arg w/ `parseInt()`
90+
Start JSDoc comment lines w/ single asterisk
91+
Move `for` loop counters in right direction
92+
Compare `typeof` exprs to valid values
93+
Include `yield` in generator fns
94+
No importing deprecated exports, duplicate dependencies, or Promises where they're likely a mistake
95+
No non-null assertions after optional chaining or shadowing vars from outer scope
96+
No expr stmts that aren't fn calls or assignments or useless `undefined`
97+
Add `href` attr to `<a>` els and `width`/`height` attrs to `<img>` els
98+
Use consistent arrow fn bodies and either `interface` or `type` consistently
99+
Specify deletion date w/ `@deprecated` directive
100+
Make switch-case stmts exhaustive and limit number of fn params
101+
Sort CSS utility classes
102+
No spread syntax on accumulators, barrel files, `delete` op, dynamic namespace import access, namespace imports, or duplicate polyfills from Polyfill.io
103+
Use `preconnect` attr w/ Google Fonts
104+
Declare regex literals at top level
105+
Add `rel="noopener"` when using `target="_blank"`
106+
No dangerous JSX props
107+
No both `children` and `dangerouslySetInnerHTML` props
108+
No global `eval()`
109+
No callbacks in async tests and hooks, TS enums, exporting imported vars, type annotations for vars initialized w/ literals, magic numbers without named constants, or TS namespaces
110+
No negating `if` conditions when there's an `else` clause, nested ternary exprs, non-null assertions (`!`), reassigning fn params, parameter props in class ctors, specified global var names, importing specified modules, or specified user-defined types
111+
No constants where value is upper-case version of name, template literals without interpolation or special chars, `else` blocks when `if` block breaks early, yoda exprs, or `Array` ctors
112+
Use `String.slice()` vs `String.substr()` and `String.substring()`
113+
Use `as const` vs literal type annotations and `at()` vs integer index access
114+
Follow curly brace conventions
115+
Use `else if` vs nested `if` in `else` clauses and single `if` vs nested `if` clauses
116+
Use `T[]` vs `Array<T>`
117+
Use `new` for all builtins except `String`, `Number`, and `Boolean`
118+
Use consistent accessibility modifiers on class props and methods
119+
Declare object literals consistently
120+
Use `const` for vars only assigned once
121+
Put default and optional fn params last
122+
Include `default` clause in switch stmts
123+
Specify reason arg w/ `@deprecated` directive
124+
Explicitly initialize each enum member value
125+
Use `**` op vs `Math.pow`
126+
Use `export type` and `import type` for types
127+
Use kebab-case, ASCII filenames
128+
Use `for...of` vs `for` loops w/ array index access
129+
Use `<>...</>` vs `<Fragment>...</Fragment>`
130+
Capitalize all enum values
131+
Place getters and setters for same prop adjacent
132+
Use literal values for all enum members
133+
Use `node:assert/strict` vs `node:assert`
134+
Use `node:` protocol for Node.js builtin modules
135+
Use `Number` props vs global ones
136+
Use numeric separators in numeric literals
137+
Use object spread vs `Object.assign()` for new objects
138+
Mark members `readonly` if never modified outside ctor
139+
No extra closing tags for comps without children
140+
Use assignment op shorthand
141+
Use fn types vs object types w/ call signatures
142+
Add description param to `Symbol()`
143+
Use template literals vs string concatenation
144+
Use `new` when throwing an error
145+
No throwing non-`Error` values
146+
Use `String.trimStart()`/`String.trimEnd()` vs `String.trimLeft()`/`String.trimRight()`
147+
No overload signatures that can be unified
148+
No lower specificity selectors after higher specificity selectors
149+
No `@value` rule in CSS modules
150+
No `alert`, `confirm`, and `prompt`
151+
Use standard constants vs approximated literals
152+
No assigning in exprs
153+
No async fns as Promise executors
154+
No `!` pattern in first position of `files.includes`
155+
No bitwise ops
156+
No reassigning exceptions in catch clauses
157+
No reassigning class members
158+
No inserting comments as text nodes
159+
No comparing against `-0`
160+
No labeled stmts that aren't loops
161+
No `void` type outside generic or return types
162+
No `console`
163+
No TS const enums
164+
No exprs where op doesn't affect value
165+
No control chars in regex literals
166+
No `debugger`
167+
No assigning directly to `document.cookie`
168+
Use `===` and `!==`
169+
No duplicate `@import` rules, case labels, class members, custom props, conditions in if-else-if chains, GraphQL fields, font family names, object keys, fn param names, decl block props, keyframe selectors, or describe hooks
170+
No empty CSS blocks, block stmts, static blocks, or interfaces
171+
No letting vars evolve into `any` type through reassignments
172+
No `any` type
173+
No `export` or `module.exports` in test files
174+
No misusing non-null assertion op (`!`)
175+
No fallthrough in switch clauses
176+
No focused or disabled tests
177+
No reassigning fn decls
178+
No assigning to native objects and read-only global vars
179+
Use `Number.isFinite` and `Number.isNaN` vs global `isFinite` and `isNaN`
180+
No implicit `any` type on var decls
181+
No assigning to imported bindings
182+
No `!important` within keyframe decls
183+
No irregular whitespace chars
184+
No labels that share name w/ var
185+
No chars made w/ multiple code points in char classes
186+
Use `new` and `constructor` properly
187+
Place assertion fns inside `it()` fn calls
188+
No shorthand assign when var appears on both sides
189+
No octal escape sequences in strings
190+
No `Object.prototype` builtins directly
191+
No `quickfix.biome` in editor settings
192+
No redeclaring vars, fns, classes, and types in same scope
193+
No redundant `use strict`
194+
No comparing where both sides are same
195+
No shadowing restricted names
196+
No shorthand props that override related longhand props
197+
No sparse arrays
198+
No template literal placeholder syntax in regular strings
199+
No `then` prop
200+
No `@ts-ignore` directive
201+
No `let` or `var` vars that are read but never assigned
202+
No unknown at-rules
203+
No merging interface and class decls unsafely
204+
No unsafe negation (`!`)
205+
No unnecessary escapes in strings or useless backreferences in regex literals
206+
No `var`
207+
No `with` stmts
208+
No separating overload signatures
209+
Use `await` in async fns
210+
Use correct syntax for ignoring folders in config
211+
Put default clauses in switch stmts last
212+
Pass message value when creating built-in errors
213+
Return value from get methods
214+
Use recommended display strategy w/ Google Fonts
215+
Include `if` stmt in for-in loops
216+
Use `Array.isArray()` vs `instanceof Array`
217+
Return consistent values in iterable callbacks
218+
Use `namespace` keyword vs `module` keyword
219+
Use digits arg w/ `Number#toFixed()`
220+
Use static `Response` methods vs `new Response()`
221+
Use `use strict` directive in script files

.github/workflows/publish.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ jobs:
142142
uses: actions/setup-node@v4
143143
with:
144144
node-version: 22
145+
registry-url: https://registry.npmjs.org
145146

146147
- name: Install dependencies
147148
run: bun install
@@ -168,5 +169,12 @@ jobs:
168169
exit 1
169170
fi
170171
172+
- name: Debug publish environment
173+
run: |
174+
npm --version
175+
node --version
176+
cat "$NPM_CONFIG_USERCONFIG" 2>/dev/null || echo "no npmrc"
177+
echo "ACTIONS_ID_TOKEN_REQUEST_URL is set: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL != '' }}"
178+
171179
- name: Publish to npm
172180
run: npm publish --provenance --access public

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
"source.fixAll.biome": "explicit",
3333
"source.organizeImports.biome": "explicit"
3434
}
35-
}
35+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: Audit Logs
3+
description: Query and manage audit logs
4+
icon: FileSearch
5+
---
6+
7+
# Audit Logs
8+
9+
Methods for querying and managing audit logs (requires `auditLogs: true` in configuration).
10+
11+
## getLogs()
12+
13+
Query audit logs.
14+
15+
```typescript
16+
// Get logs for a specific key
17+
const logs = await keys.getLogs({
18+
keyId: 'key_123',
19+
limit: 100,
20+
})
21+
22+
// Get logs by action
23+
const revokedLogs = await keys.getLogs({
24+
action: 'revoked',
25+
startDate: '2025-01-01',
26+
})
27+
28+
// Get logs for an owner
29+
const ownerLogs = await keys.getLogs({
30+
ownerId: 'user_123',
31+
limit: 50,
32+
offset: 0,
33+
})
34+
```
35+
36+
**Returns**: `Promise<AuditLog[]>`
37+
38+
### AuditLogQuery Options
39+
40+
```typescript
41+
{
42+
keyId?: string // Filter by key ID
43+
ownerId?: string // Filter by owner ID
44+
action?: AuditAction // Filter by action
45+
startDate?: string // Filter by start date (ISO timestamp)
46+
endDate?: string // Filter by end date (ISO timestamp)
47+
limit?: number // Maximum results (default: 100)
48+
offset?: number // Pagination offset (default: 0)
49+
}
50+
```
51+
52+
## countLogs()
53+
54+
Count audit logs matching a query.
55+
56+
```typescript
57+
const count = await keys.countLogs({
58+
action: 'created',
59+
startDate: '2025-01-01',
60+
})
61+
```
62+
63+
**Returns**: `Promise<number>`
64+
65+
## deleteLogs()
66+
67+
Delete audit logs matching a query.
68+
69+
```typescript
70+
// Delete old logs
71+
const deleted = await keys.deleteLogs({
72+
endDate: '2024-01-01',
73+
})
74+
```
75+
76+
**Returns**: `Promise<number>` (number of logs deleted)
77+
78+
## clearLogs()
79+
80+
Clear all logs for a specific key.
81+
82+
```typescript
83+
await keys.clearLogs('key_123')
84+
```
85+
86+
**Returns**: `Promise<number>` (number of logs deleted)
87+
88+
## getLogStats()
89+
90+
Get statistics about audit logs for an owner.
91+
92+
```typescript
93+
const stats = await keys.getLogStats('user_123')
94+
95+
console.log(stats.total) // Total number of logs
96+
console.log(stats.byAction.created) // Number of created actions
97+
console.log(stats.byAction.revoked) // Number of revoked actions
98+
console.log(stats.lastActivity) // Last activity timestamp
99+
```
100+
101+
**Returns**: `Promise<AuditLogStats>`
102+
103+
### AuditLogStats Structure
104+
105+
```typescript
106+
{
107+
total: number
108+
byAction: {
109+
created?: number
110+
revoked?: number
111+
rotated?: number
112+
enabled?: number
113+
disabled?: number
114+
}
115+
lastActivity: string | null
116+
}
117+
```
118+
119+
## Audit Actions
120+
121+
- `'created'` - Key was created
122+
- `'revoked'` - Key was revoked
123+
- `'rotated'` - Key was rotated
124+
- `'enabled'` - Key was enabled
125+
- `'disabled'` - Key was disabled
126+

0 commit comments

Comments
 (0)