Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 0bfee30

Browse files
authored
Merge pull request #75 from xmtp/rygine/dep-updates
Use primitives package for types
2 parents 1143d9e + 8d9160f commit 0bfee30

35 files changed

+761
-675
lines changed

.changeset/moody-comics-hug.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@xmtp/experimental-content-type-screen-effect": patch
3+
"@xmtp/content-type-primitives": patch
4+
"@xmtp/content-type-reaction": patch
5+
"@xmtp/content-type-read-receipt": patch
6+
"@xmtp/content-type-remote-attachment": patch
7+
"@xmtp/content-type-reply": patch
8+
"@xmtp/content-type-transaction-reference": patch
9+
---
10+
11+
Use primitives package for types

.prettierrc

-18
This file was deleted.

.prettierrc.cjs

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
arrowParens: "always",
3+
bracketSameLine: true,
4+
bracketSpacing: true,
5+
embeddedLanguageFormatting: "auto",
6+
endOfLine: "lf",
7+
htmlWhitespaceSensitivity: "css",
8+
jsxSingleQuote: false,
9+
printWidth: 80,
10+
proseWrap: "preserve",
11+
quoteProps: "as-needed",
12+
semi: true,
13+
singleAttributePerLine: false,
14+
singleQuote: false,
15+
tabWidth: 2,
16+
trailingComma: "all",
17+
useTabs: false,
18+
plugins: [
19+
"prettier-plugin-packagejson",
20+
"@ianvs/prettier-plugin-sort-imports",
21+
],
22+
importOrder: [
23+
"<BUILTIN_MODULES>",
24+
"<THIRD_PARTY_MODULES>",
25+
"^@(/.*)$",
26+
"^[.]",
27+
],
28+
importOrderTypeScriptVersion: "5.4.2",
29+
};

experimental/content-type-screen-effect/package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
21+
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
2222
"directory": "experimental/content-type-screen-effect"
2323
},
2424
"license": "MIT",
@@ -67,12 +67,14 @@
6767
]
6868
},
6969
"dependencies": {
70-
"@xmtp/xmtp-js": "^11.3.12"
70+
"@xmtp/content-type-primitives": "^1.0.1"
7171
},
7272
"devDependencies": {
73+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
7374
"@rollup/plugin-terser": "^0.4.4",
7475
"@rollup/plugin-typescript": "^11.1.6",
7576
"@types/node": "^18.19.22",
77+
"@xmtp/xmtp-js": "^11.6.3",
7678
"buffer": "^6.0.3",
7779
"eslint": "^8.57.0",
7880
"eslint-config-custom": "workspace:*",
@@ -88,9 +90,6 @@
8890
"vite": "^5.1.6",
8991
"vitest": "^1.3.1"
9092
},
91-
"peerDependencies": {
92-
"@xmtp/xmtp-js": "^11.1.1"
93-
},
9493
"publishConfig": {
9594
"access": "public",
9695
"provenance": true,

experimental/content-type-screen-effect/rollup.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from "rollup";
1+
import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
3+
import { defineConfig } from "rollup";
34
import { dts } from "rollup-plugin-dts";
4-
import terser from "@rollup/plugin-terser";
55
import filesize from "rollup-plugin-filesize";
66

77
const plugins = [

experimental/content-type-screen-effect/src/ScreenEffect.test.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { Wallet } from "ethers";
21
import { Client } from "@xmtp/xmtp-js";
3-
import { ContentTypeScreenEffect, ScreenEffectCodec } from "./ScreenEffect";
4-
import type { ScreenEffect } from "./ScreenEffect";
2+
import { Wallet } from "ethers";
3+
import {
4+
ContentTypeScreenEffect,
5+
ScreenEffectCodec,
6+
type ScreenEffect,
7+
} from "./ScreenEffect";
58

69
describe("ScreenEffectContentType", () => {
710
it("has the right content type", () => {

experimental/content-type-screen-effect/src/ScreenEffect.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { ContentTypeId } from "@xmtp/xmtp-js";
2-
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
1+
import {
2+
ContentTypeId,
3+
type ContentCodec,
4+
type EncodedContent,
5+
} from "@xmtp/content-type-primitives";
36

47
export type EffectType = "SNOW" | "RAIN";
58

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"devDependencies": {
2323
"@changesets/changelog-github": "^0.5.0",
2424
"@changesets/cli": "^2.27.1",
25+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
2526
"@turbo/gen": "^1.12.5",
2627
"@types/node": "^18.19.22",
2728
"prettier": "^3.2.5",

packages/content-type-primitives/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"@xmtp/proto": "^3.61.1"
7171
},
7272
"devDependencies": {
73+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
7374
"@rollup/plugin-terser": "^0.4.4",
7475
"@rollup/plugin-typescript": "^11.1.6",
7576
"@types/node": "^18.19.22",

packages/content-type-primitives/rollup.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from "rollup";
1+
import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
3+
import { defineConfig } from "rollup";
34
import { dts } from "rollup-plugin-dts";
4-
import terser from "@rollup/plugin-terser";
55
import filesize from "rollup-plugin-filesize";
66

77
const plugins = [

packages/content-type-primitives/src/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from "vitest";
1+
import { describe, expect, it } from "vitest";
22
import { ContentTypeId } from ".";
33

44
describe("ContentTypeId", () => {

packages/content-type-reaction/package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
21+
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
2222
"directory": "packages/content-type-reaction"
2323
},
2424
"license": "MIT",
@@ -67,12 +67,14 @@
6767
]
6868
},
6969
"dependencies": {
70-
"@xmtp/xmtp-js": "^11.3.12"
70+
"@xmtp/content-type-primitives": "^1.0.1"
7171
},
7272
"devDependencies": {
73+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
7374
"@rollup/plugin-terser": "^0.4.4",
7475
"@rollup/plugin-typescript": "^11.1.6",
7576
"@types/node": "^18.19.22",
77+
"@xmtp/xmtp-js": "^11.6.3",
7678
"buffer": "^6.0.3",
7779
"eslint": "^8.57.0",
7880
"eslint-config-custom": "workspace:*",
@@ -88,9 +90,6 @@
8890
"vite": "^5.1.6",
8991
"vitest": "^1.3.1"
9092
},
91-
"peerDependencies": {
92-
"@xmtp/xmtp-js": "^11.1.1"
93-
},
9493
"publishConfig": {
9594
"access": "public",
9695
"provenance": true,

packages/content-type-reaction/rollup.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from "rollup";
1+
import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
3+
import { defineConfig } from "rollup";
34
import { dts } from "rollup-plugin-dts";
4-
import terser from "@rollup/plugin-terser";
55
import filesize from "rollup-plugin-filesize";
66

77
const plugins = [

packages/content-type-reaction/src/Reaction.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Wallet } from "ethers";
21
import { Client } from "@xmtp/xmtp-js";
3-
import { ContentTypeReaction, ReactionCodec } from "./Reaction";
4-
import type { Reaction } from "./Reaction";
2+
import { Wallet } from "ethers";
3+
import { ContentTypeReaction, ReactionCodec, type Reaction } from "./Reaction";
54

65
describe("ReactionContentType", () => {
76
it("has the right content type", () => {

packages/content-type-reaction/src/Reaction.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { ContentTypeId } from "@xmtp/xmtp-js";
2-
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
1+
import {
2+
ContentTypeId,
3+
type ContentCodec,
4+
type EncodedContent,
5+
} from "@xmtp/content-type-primitives";
36

47
export const ContentTypeReaction = new ContentTypeId({
58
authorityId: "xmtp.org",

packages/content-type-read-receipt/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
21+
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
2222
"directory": "packages/content-type-read-receipt"
2323
},
2424
"license": "MIT",
@@ -67,13 +67,14 @@
6767
]
6868
},
6969
"dependencies": {
70-
"@xmtp/proto": "^3.29.0",
71-
"@xmtp/xmtp-js": "^11.3.12"
70+
"@xmtp/content-type-primitives": "^1.0.1"
7271
},
7372
"devDependencies": {
73+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
7474
"@rollup/plugin-terser": "^0.4.4",
7575
"@rollup/plugin-typescript": "^11.1.6",
7676
"@types/node": "^18.19.22",
77+
"@xmtp/xmtp-js": "^11.6.3",
7778
"buffer": "^6.0.3",
7879
"eslint": "^8.57.0",
7980
"eslint-config-custom": "workspace:*",
@@ -89,9 +90,6 @@
8990
"vite": "^5.1.6",
9091
"vitest": "^1.3.1"
9192
},
92-
"peerDependencies": {
93-
"@xmtp/xmtp-js": "^11.1.1"
94-
},
9593
"publishConfig": {
9694
"access": "public",
9795
"provenance": true,

packages/content-type-read-receipt/rollup.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from "rollup";
1+
import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
3+
import { defineConfig } from "rollup";
34
import { dts } from "rollup-plugin-dts";
4-
import terser from "@rollup/plugin-terser";
55
import filesize from "rollup-plugin-filesize";
66

77
const plugins = [

packages/content-type-read-receipt/src/ReadReceipt.test.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { Wallet } from "ethers";
21
import { Client } from "@xmtp/xmtp-js";
3-
import { ContentTypeReadReceipt, ReadReceiptCodec } from "./ReadReceipt";
4-
import type { ReadReceipt } from "./ReadReceipt";
2+
import { Wallet } from "ethers";
3+
import {
4+
ContentTypeReadReceipt,
5+
ReadReceiptCodec,
6+
type ReadReceipt,
7+
} from "./ReadReceipt";
58

69
describe("ReadReceiptContentType", () => {
710
it("has the right content type", () => {

packages/content-type-read-receipt/src/ReadReceipt.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { ContentTypeId } from "@xmtp/xmtp-js";
2-
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
1+
import {
2+
ContentTypeId,
3+
type ContentCodec,
4+
type EncodedContent,
5+
} from "@xmtp/content-type-primitives";
36

47
export const ContentTypeReadReceipt = new ContentTypeId({
58
authorityId: "xmtp.org",
@@ -15,22 +18,19 @@ export class ReadReceiptCodec implements ContentCodec<ReadReceipt> {
1518
return ContentTypeReadReceipt;
1619
}
1720

18-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
19-
encode(content: ReadReceipt): EncodedContent {
21+
encode(): EncodedContent {
2022
return {
2123
type: ContentTypeReadReceipt,
2224
parameters: {},
2325
content: new Uint8Array(),
2426
};
2527
}
2628

27-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
28-
decode(content: EncodedContent): ReadReceipt {
29+
decode(): ReadReceipt {
2930
return {};
3031
}
3132

32-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
33-
fallback(content: ReadReceipt): string | undefined {
33+
fallback(): string | undefined {
3434
return undefined;
3535
}
3636

packages/content-type-remote-attachment/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
21+
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
2222
"directory": "packages/content-type-remote-attachment"
2323
},
2424
"license": "MIT",
@@ -68,14 +68,17 @@
6868
},
6969
"dependencies": {
7070
"@noble/secp256k1": "^1.7.1",
71-
"@xmtp/proto": "^3.29.0",
72-
"@xmtp/xmtp-js": "^11.3.12"
71+
"@xmtp/content-type-primitives": "^1.0.1",
72+
"@xmtp/proto": "^3.61.1",
73+
"@xmtp/xmtp-js": "^11.6.3"
7374
},
7475
"devDependencies": {
76+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
7577
"@rollup/plugin-terser": "^0.4.4",
7678
"@rollup/plugin-typescript": "^11.1.6",
7779
"@types/node": "^18.19.22",
7880
"@xmtp/rollup-plugin-resolve-extensions": "^1.0.1",
81+
"@xmtp/xmtp-js": "^11.6.3",
7982
"buffer": "^6.0.3",
8083
"eslint": "^8.57.0",
8184
"eslint-config-custom": "workspace:*",
@@ -91,9 +94,6 @@
9194
"vite": "^5.1.6",
9295
"vitest": "^1.3.1"
9396
},
94-
"peerDependencies": {
95-
"@xmtp/xmtp-js": "^11.1.1"
96-
},
9797
"publishConfig": {
9898
"access": "public",
9999
"provenance": true,

packages/content-type-remote-attachment/rollup.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { defineConfig } from "rollup";
1+
import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
3+
import { resolveExtensions } from "@xmtp/rollup-plugin-resolve-extensions";
4+
import { defineConfig } from "rollup";
35
import { dts } from "rollup-plugin-dts";
4-
import terser from "@rollup/plugin-terser";
56
import filesize from "rollup-plugin-filesize";
6-
import { resolveExtensions } from "@xmtp/rollup-plugin-resolve-extensions";
77

88
const plugins = [
99
typescript({

packages/content-type-remote-attachment/src/Attachment.test.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { Wallet } from "ethers";
21
import { Client } from "@xmtp/xmtp-js";
3-
import { ContentTypeAttachment, AttachmentCodec } from "./Attachment";
4-
import type { Attachment } from "./Attachment";
2+
import { Wallet } from "ethers";
3+
import {
4+
AttachmentCodec,
5+
ContentTypeAttachment,
6+
type Attachment,
7+
} from "./Attachment";
58

69
test("content type exists", () => {
710
expect(ContentTypeAttachment.authorityId).toBe("xmtp.org");

0 commit comments

Comments
 (0)