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

Commit

Permalink
Merge pull request #75 from xmtp/rygine/dep-updates
Browse files Browse the repository at this point in the history
Use primitives package for types
  • Loading branch information
rygine authored Jun 13, 2024
2 parents 1143d9e + 8d9160f commit 0bfee30
Show file tree
Hide file tree
Showing 35 changed files with 761 additions and 675 deletions.
11 changes: 11 additions & 0 deletions .changeset/moody-comics-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@xmtp/experimental-content-type-screen-effect": patch
"@xmtp/content-type-primitives": patch
"@xmtp/content-type-reaction": patch
"@xmtp/content-type-read-receipt": patch
"@xmtp/content-type-remote-attachment": patch
"@xmtp/content-type-reply": patch
"@xmtp/content-type-transaction-reference": patch
---

Use primitives package for types
18 changes: 0 additions & 18 deletions .prettierrc

This file was deleted.

29 changes: 29 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
arrowParens: "always",
bracketSameLine: true,
bracketSpacing: true,
embeddedLanguageFormatting: "auto",
endOfLine: "lf",
htmlWhitespaceSensitivity: "css",
jsxSingleQuote: false,
printWidth: 80,
proseWrap: "preserve",
quoteProps: "as-needed",
semi: true,
singleAttributePerLine: false,
singleQuote: false,
tabWidth: 2,
trailingComma: "all",
useTabs: false,
plugins: [
"prettier-plugin-packagejson",
"@ianvs/prettier-plugin-sort-imports",
],
importOrder: [
"<BUILTIN_MODULES>",
"<THIRD_PARTY_MODULES>",
"^@(/.*)$",
"^[.]",
],
importOrderTypeScriptVersion: "5.4.2",
};
9 changes: 4 additions & 5 deletions experimental/content-type-screen-effect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
"directory": "experimental/content-type-screen-effect"
},
"license": "MIT",
Expand Down Expand Up @@ -67,12 +67,14 @@
]
},
"dependencies": {
"@xmtp/xmtp-js": "^11.3.12"
"@xmtp/content-type-primitives": "^1.0.1"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^18.19.22",
"@xmtp/xmtp-js": "^11.6.3",
"buffer": "^6.0.3",
"eslint": "^8.57.0",
"eslint-config-custom": "workspace:*",
Expand All @@ -88,9 +90,6 @@
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"peerDependencies": {
"@xmtp/xmtp-js": "^11.1.1"
},
"publishConfig": {
"access": "public",
"provenance": true,
Expand Down
4 changes: 2 additions & 2 deletions experimental/content-type-screen-effect/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "rollup";
import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";
import terser from "@rollup/plugin-terser";
import filesize from "rollup-plugin-filesize";

const plugins = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Wallet } from "ethers";
import { Client } from "@xmtp/xmtp-js";
import { ContentTypeScreenEffect, ScreenEffectCodec } from "./ScreenEffect";
import type { ScreenEffect } from "./ScreenEffect";
import { Wallet } from "ethers";
import {
ContentTypeScreenEffect,
ScreenEffectCodec,
type ScreenEffect,
} from "./ScreenEffect";

describe("ScreenEffectContentType", () => {
it("has the right content type", () => {
Expand Down
7 changes: 5 additions & 2 deletions experimental/content-type-screen-effect/src/ScreenEffect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ContentTypeId } from "@xmtp/xmtp-js";
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
import {
ContentTypeId,
type ContentCodec,
type EncodedContent,
} from "@xmtp/content-type-primitives";

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

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@turbo/gen": "^1.12.5",
"@types/node": "^18.19.22",
"prettier": "^3.2.5",
Expand Down
1 change: 1 addition & 0 deletions packages/content-type-primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@xmtp/proto": "^3.61.1"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^18.19.22",
Expand Down
4 changes: 2 additions & 2 deletions packages/content-type-primitives/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "rollup";
import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";
import terser from "@rollup/plugin-terser";
import filesize from "rollup-plugin-filesize";

const plugins = [
Expand Down
2 changes: 1 addition & 1 deletion packages/content-type-primitives/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "vitest";
import { describe, expect, it } from "vitest";
import { ContentTypeId } from ".";

describe("ContentTypeId", () => {
Expand Down
9 changes: 4 additions & 5 deletions packages/content-type-reaction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
"directory": "packages/content-type-reaction"
},
"license": "MIT",
Expand Down Expand Up @@ -67,12 +67,14 @@
]
},
"dependencies": {
"@xmtp/xmtp-js": "^11.3.12"
"@xmtp/content-type-primitives": "^1.0.1"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^18.19.22",
"@xmtp/xmtp-js": "^11.6.3",
"buffer": "^6.0.3",
"eslint": "^8.57.0",
"eslint-config-custom": "workspace:*",
Expand All @@ -88,9 +90,6 @@
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"peerDependencies": {
"@xmtp/xmtp-js": "^11.1.1"
},
"publishConfig": {
"access": "public",
"provenance": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/content-type-reaction/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "rollup";
import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";
import terser from "@rollup/plugin-terser";
import filesize from "rollup-plugin-filesize";

const plugins = [
Expand Down
5 changes: 2 additions & 3 deletions packages/content-type-reaction/src/Reaction.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Wallet } from "ethers";
import { Client } from "@xmtp/xmtp-js";
import { ContentTypeReaction, ReactionCodec } from "./Reaction";
import type { Reaction } from "./Reaction";
import { Wallet } from "ethers";
import { ContentTypeReaction, ReactionCodec, type Reaction } from "./Reaction";

describe("ReactionContentType", () => {
it("has the right content type", () => {
Expand Down
7 changes: 5 additions & 2 deletions packages/content-type-reaction/src/Reaction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ContentTypeId } from "@xmtp/xmtp-js";
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
import {
ContentTypeId,
type ContentCodec,
type EncodedContent,
} from "@xmtp/content-type-primitives";

export const ContentTypeReaction = new ContentTypeId({
authorityId: "xmtp.org",
Expand Down
10 changes: 4 additions & 6 deletions packages/content-type-read-receipt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
"directory": "packages/content-type-read-receipt"
},
"license": "MIT",
Expand Down Expand Up @@ -67,13 +67,14 @@
]
},
"dependencies": {
"@xmtp/proto": "^3.29.0",
"@xmtp/xmtp-js": "^11.3.12"
"@xmtp/content-type-primitives": "^1.0.1"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^18.19.22",
"@xmtp/xmtp-js": "^11.6.3",
"buffer": "^6.0.3",
"eslint": "^8.57.0",
"eslint-config-custom": "workspace:*",
Expand All @@ -89,9 +90,6 @@
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"peerDependencies": {
"@xmtp/xmtp-js": "^11.1.1"
},
"publishConfig": {
"access": "public",
"provenance": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/content-type-read-receipt/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "rollup";
import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";
import terser from "@rollup/plugin-terser";
import filesize from "rollup-plugin-filesize";

const plugins = [
Expand Down
9 changes: 6 additions & 3 deletions packages/content-type-read-receipt/src/ReadReceipt.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Wallet } from "ethers";
import { Client } from "@xmtp/xmtp-js";
import { ContentTypeReadReceipt, ReadReceiptCodec } from "./ReadReceipt";
import type { ReadReceipt } from "./ReadReceipt";
import { Wallet } from "ethers";
import {
ContentTypeReadReceipt,
ReadReceiptCodec,
type ReadReceipt,
} from "./ReadReceipt";

describe("ReadReceiptContentType", () => {
it("has the right content type", () => {
Expand Down
16 changes: 8 additions & 8 deletions packages/content-type-read-receipt/src/ReadReceipt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ContentTypeId } from "@xmtp/xmtp-js";
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
import {
ContentTypeId,
type ContentCodec,
type EncodedContent,
} from "@xmtp/content-type-primitives";

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

// eslint-disable-next-line @typescript-eslint/no-unused-vars
encode(content: ReadReceipt): EncodedContent {
encode(): EncodedContent {
return {
type: ContentTypeReadReceipt,
parameters: {},
content: new Uint8Array(),
};
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
decode(content: EncodedContent): ReadReceipt {
decode(): ReadReceipt {
return {};
}

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

Expand Down
12 changes: 6 additions & 6 deletions packages/content-type-remote-attachment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
"directory": "packages/content-type-remote-attachment"
},
"license": "MIT",
Expand Down Expand Up @@ -68,14 +68,17 @@
},
"dependencies": {
"@noble/secp256k1": "^1.7.1",
"@xmtp/proto": "^3.29.0",
"@xmtp/xmtp-js": "^11.3.12"
"@xmtp/content-type-primitives": "^1.0.1",
"@xmtp/proto": "^3.61.1",
"@xmtp/xmtp-js": "^11.6.3"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^18.19.22",
"@xmtp/rollup-plugin-resolve-extensions": "^1.0.1",
"@xmtp/xmtp-js": "^11.6.3",
"buffer": "^6.0.3",
"eslint": "^8.57.0",
"eslint-config-custom": "workspace:*",
Expand All @@ -91,9 +94,6 @@
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"peerDependencies": {
"@xmtp/xmtp-js": "^11.1.1"
},
"publishConfig": {
"access": "public",
"provenance": true,
Expand Down
6 changes: 3 additions & 3 deletions packages/content-type-remote-attachment/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from "rollup";
import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import { resolveExtensions } from "@xmtp/rollup-plugin-resolve-extensions";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";
import terser from "@rollup/plugin-terser";
import filesize from "rollup-plugin-filesize";
import { resolveExtensions } from "@xmtp/rollup-plugin-resolve-extensions";

const plugins = [
typescript({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Wallet } from "ethers";
import { Client } from "@xmtp/xmtp-js";
import { ContentTypeAttachment, AttachmentCodec } from "./Attachment";
import type { Attachment } from "./Attachment";
import { Wallet } from "ethers";
import {
AttachmentCodec,
ContentTypeAttachment,
type Attachment,
} from "./Attachment";

test("content type exists", () => {
expect(ContentTypeAttachment.authorityId).toBe("xmtp.org");
Expand Down
Loading

0 comments on commit 0bfee30

Please sign in to comment.