Skip to content

Commit c8ca09a

Browse files
authored
chore: switch Biome's line ending setting from CRLF to LF (#46)
1 parent 7eb309b commit c8ca09a

29 files changed

+1869
-1869
lines changed

biome.json

+44-44
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3-
"organizeImports": {
4-
"enabled": true
5-
},
6-
"files": {
7-
"include": ["docs", "packages/*"],
8-
"ignore": [
9-
".github",
10-
".gitignore",
11-
".vitepress",
12-
".vscode",
13-
"*.md",
14-
"*.toml",
15-
"build",
16-
"dist",
17-
"node_modules",
18-
"package.json",
19-
"tsconfig.json",
20-
"packages/lexicons/src/lib/lexicons.ts"
21-
]
22-
},
23-
"linter": {
24-
"enabled": true,
25-
"rules": {
26-
"recommended": true
27-
}
28-
},
29-
"formatter": {
30-
"indentStyle": "space",
31-
"lineWidth": 80,
32-
"lineEnding": "crlf"
33-
},
34-
"vcs": {
35-
"enabled": true,
36-
"clientKind": "git",
37-
"useIgnoreFile": true
38-
},
39-
"javascript": {
40-
"formatter": {
41-
"quoteStyle": "single"
42-
}
43-
}
44-
}
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"files": {
7+
"include": ["docs", "packages/*"],
8+
"ignore": [
9+
".github",
10+
".gitignore",
11+
".vitepress",
12+
".vscode",
13+
"*.md",
14+
"*.toml",
15+
"build",
16+
"dist",
17+
"node_modules",
18+
"package.json",
19+
"tsconfig.json",
20+
"packages/lexicons/src/lib/lexicons.ts"
21+
]
22+
},
23+
"linter": {
24+
"enabled": true,
25+
"rules": {
26+
"recommended": true
27+
}
28+
},
29+
"formatter": {
30+
"indentStyle": "space",
31+
"lineWidth": 80,
32+
"lineEnding": "lf"
33+
},
34+
"vcs": {
35+
"enabled": true,
36+
"clientKind": "git",
37+
"useIgnoreFile": true
38+
},
39+
"javascript": {
40+
"formatter": {
41+
"quoteStyle": "single"
42+
}
43+
}
44+
}

packages/client/src/bsky/feed.ts

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
import type {
2-
AppBskyFeedGetFeed,
3-
AppBskyFeedGetTimeline,
4-
} from '@tsky/lexicons';
5-
import type { Client } from '~/tsky/client';
6-
import { Paginator } from '~/tsky/paginator';
7-
8-
export class Feed {
9-
constructor(private client: Client) {}
10-
11-
/**
12-
* Get a hydrated feed from an actor's selected feed generator. Implemented by App View.
13-
*/
14-
async getFeed(
15-
params: AppBskyFeedGetFeed.Params,
16-
options?: AppBskyFeedGetFeed.Input,
17-
): Promise<Paginator<AppBskyFeedGetFeed.Output>> {
18-
return Paginator.init(async (cursor) => {
19-
const res = await this.client.get('app.bsky.feed.getFeed', {
20-
...(options ?? {}),
21-
params: {
22-
cursor,
23-
...params,
24-
},
25-
});
26-
27-
return res.data;
28-
});
29-
}
30-
31-
/**
32-
* Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.
33-
*/
34-
getTimeline(
35-
params: AppBskyFeedGetTimeline.Params,
36-
options?: AppBskyFeedGetTimeline.Input,
37-
): Promise<Paginator<AppBskyFeedGetTimeline.Output>> {
38-
return Paginator.init(async (cursor) => {
39-
const res = await this.client.get('app.bsky.feed.getTimeline', {
40-
...(options ?? {}),
41-
params: {
42-
cursor,
43-
...params,
44-
},
45-
});
46-
47-
return res.data;
48-
});
49-
}
50-
}
1+
import type {
2+
AppBskyFeedGetFeed,
3+
AppBskyFeedGetTimeline,
4+
} from '@tsky/lexicons';
5+
import type { Client } from '~/tsky/client';
6+
import { Paginator } from '~/tsky/paginator';
7+
8+
export class Feed {
9+
constructor(private client: Client) {}
10+
11+
/**
12+
* Get a hydrated feed from an actor's selected feed generator. Implemented by App View.
13+
*/
14+
async getFeed(
15+
params: AppBskyFeedGetFeed.Params,
16+
options?: AppBskyFeedGetFeed.Input,
17+
): Promise<Paginator<AppBskyFeedGetFeed.Output>> {
18+
return Paginator.init(async (cursor) => {
19+
const res = await this.client.get('app.bsky.feed.getFeed', {
20+
...(options ?? {}),
21+
params: {
22+
cursor,
23+
...params,
24+
},
25+
});
26+
27+
return res.data;
28+
});
29+
}
30+
31+
/**
32+
* Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.
33+
*/
34+
getTimeline(
35+
params: AppBskyFeedGetTimeline.Params,
36+
options?: AppBskyFeedGetTimeline.Input,
37+
): Promise<Paginator<AppBskyFeedGetTimeline.Output>> {
38+
return Paginator.init(async (cursor) => {
39+
const res = await this.client.get('app.bsky.feed.getTimeline', {
40+
...(options ?? {}),
41+
params: {
42+
cursor,
43+
...params,
44+
},
45+
});
46+
47+
return res.data;
48+
});
49+
}
50+
}
+79-79
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
import { CredentialManager } from '@atcute/client';
2-
import { describe, expect, it } from 'vitest';
3-
import { Tsky } from '~/index';
4-
5-
const formatSecret = (secret: string | undefined) => {
6-
if (!secret) {
7-
throw new Error('Secret is required');
8-
}
9-
10-
return secret.replace(/^tsky /g, '').trim();
11-
};
12-
13-
const TEST_CREDENTIALS = {
14-
alice: {
15-
handle: 'alice.tsky.dev',
16-
did: 'did:plc:jguhdmnjclquqf5lsvkyxqy3',
17-
password: 'alice_and_bob',
18-
},
19-
bob: {
20-
handle: 'bob.tsky.dev',
21-
did: 'did:plc:2ig7akkyfq256j42uxvc4g2h',
22-
password: 'alice_and_bob',
23-
},
24-
};
25-
26-
async function getAliceTsky() {
27-
const manager = new CredentialManager({ service: 'https://bsky.social' });
28-
await manager.login({
29-
identifier: TEST_CREDENTIALS.alice.handle,
30-
password: TEST_CREDENTIALS.alice.password,
31-
});
32-
33-
return new Tsky(manager);
34-
}
35-
36-
describe('bsky', () => {
37-
it('.profile()', async () => {
38-
const tsky = await getAliceTsky();
39-
const profile = await tsky.bsky.profile(TEST_CREDENTIALS.alice.did);
40-
41-
expect(profile).toBeDefined();
42-
expect(profile).toHaveProperty('handle', TEST_CREDENTIALS.alice.handle);
43-
});
44-
45-
describe('feed', () => {
46-
it('.timeline()', async () => {
47-
const tsky = await getAliceTsky();
48-
49-
const paginator = await tsky.bsky.feed.getTimeline({
50-
limit: 30,
51-
});
52-
53-
expect(paginator).toBeDefined();
54-
expect(paginator.values).toBeDefined();
55-
expect(paginator.values).toBeInstanceOf(Array);
56-
expect(paginator.values.length).toBe(1); // we should get the first page from the paginator
57-
expect(paginator.values[0].feed.length).toBeGreaterThan(0); // alice has some posts ;)
58-
expect(paginator.values[0].feed[0]).toHaveProperty('post');
59-
});
60-
61-
it('.feed()', async () => {
62-
const tsky = await getAliceTsky();
63-
64-
const paginator = await tsky.bsky.feed.getFeed({
65-
// "Birds! 🦉" custom feed
66-
// - https://bsky.app/profile/daryllmarie.bsky.social/feed/aaagllxbcbsje
67-
feed: 'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.generator/aaagllxbcbsje',
68-
limit: 30,
69-
});
70-
71-
expect(paginator).toBeDefined();
72-
expect(paginator.values).toBeDefined();
73-
expect(paginator.values).toBeInstanceOf(Array);
74-
expect(paginator.values.length).toBe(1); // we should get the first page from the paginator
75-
expect(paginator.values[0].feed.length).toBeGreaterThan(0); // we found some birds posts ;)
76-
expect(paginator.values[0].feed[0]).toHaveProperty('post');
77-
});
78-
});
79-
});
1+
import { CredentialManager } from '@atcute/client';
2+
import { describe, expect, it } from 'vitest';
3+
import { Tsky } from '~/index';
4+
5+
const formatSecret = (secret: string | undefined) => {
6+
if (!secret) {
7+
throw new Error('Secret is required');
8+
}
9+
10+
return secret.replace(/^tsky /g, '').trim();
11+
};
12+
13+
const TEST_CREDENTIALS = {
14+
alice: {
15+
handle: 'alice.tsky.dev',
16+
did: 'did:plc:jguhdmnjclquqf5lsvkyxqy3',
17+
password: 'alice_and_bob',
18+
},
19+
bob: {
20+
handle: 'bob.tsky.dev',
21+
did: 'did:plc:2ig7akkyfq256j42uxvc4g2h',
22+
password: 'alice_and_bob',
23+
},
24+
};
25+
26+
async function getAliceTsky() {
27+
const manager = new CredentialManager({ service: 'https://bsky.social' });
28+
await manager.login({
29+
identifier: TEST_CREDENTIALS.alice.handle,
30+
password: TEST_CREDENTIALS.alice.password,
31+
});
32+
33+
return new Tsky(manager);
34+
}
35+
36+
describe('bsky', () => {
37+
it('.profile()', async () => {
38+
const tsky = await getAliceTsky();
39+
const profile = await tsky.bsky.profile(TEST_CREDENTIALS.alice.did);
40+
41+
expect(profile).toBeDefined();
42+
expect(profile).toHaveProperty('handle', TEST_CREDENTIALS.alice.handle);
43+
});
44+
45+
describe('feed', () => {
46+
it('.timeline()', async () => {
47+
const tsky = await getAliceTsky();
48+
49+
const paginator = await tsky.bsky.feed.getTimeline({
50+
limit: 30,
51+
});
52+
53+
expect(paginator).toBeDefined();
54+
expect(paginator.values).toBeDefined();
55+
expect(paginator.values).toBeInstanceOf(Array);
56+
expect(paginator.values.length).toBe(1); // we should get the first page from the paginator
57+
expect(paginator.values[0].feed.length).toBeGreaterThan(0); // alice has some posts ;)
58+
expect(paginator.values[0].feed[0]).toHaveProperty('post');
59+
});
60+
61+
it('.feed()', async () => {
62+
const tsky = await getAliceTsky();
63+
64+
const paginator = await tsky.bsky.feed.getFeed({
65+
// "Birds! 🦉" custom feed
66+
// - https://bsky.app/profile/daryllmarie.bsky.social/feed/aaagllxbcbsje
67+
feed: 'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.generator/aaagllxbcbsje',
68+
limit: 30,
69+
});
70+
71+
expect(paginator).toBeDefined();
72+
expect(paginator.values).toBeDefined();
73+
expect(paginator.values).toBeInstanceOf(Array);
74+
expect(paginator.values.length).toBe(1); // we should get the first page from the paginator
75+
expect(paginator.values[0].feed.length).toBeGreaterThan(0); // we found some birds posts ;)
76+
expect(paginator.values[0].feed[0]).toHaveProperty('post');
77+
});
78+
});
79+
});

0 commit comments

Comments
 (0)