Skip to content

Commit

Permalink
Merge pull request #28 from xmtp-labs/rygine/build
Browse files Browse the repository at this point in the history
Update message-kit build process
  • Loading branch information
rygine authored Jun 17, 2024
2 parents bc8510c + 4621429 commit 98197d3
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 50 deletions.
31 changes: 0 additions & 31 deletions packages/message-kit/CHANGELOG.md

This file was deleted.

6 changes: 5 additions & 1 deletion packages/message-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ Minimal viable package for creating messaging apps.
For a streamlined setup process, you can use the `create-message-kit` CLI tool, which simplifies the creation and configuration of new XMTP apps.

```bash
# with NPM
npm init message-kit

# with yarn
yarn dlx create-message-kit
```

## Overview
Expand Down Expand Up @@ -44,7 +48,7 @@ KEY= # 0x... the private key of the app (with the 0x prefix)
XMTP_ENV=production # or `dev`
```

> ⚠️ Bot kit is not compatible with `bun` yet. Use `npm` or `yarn`
> ⚠️ This package is not compatible with `bun` yet. Use `npm` or `yarn`
```bash
# install dependencies
Expand Down
19 changes: 10 additions & 9 deletions packages/message-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
{
"name": "@xmtp/message-kit",
"version": "2.3.1",
"version": "1.0.0",
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"require": "./dist/index.cjs",
"import": "./dist/index.js"
}
},
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*"
],
"scripts": {
"build": "tsc",
"build:watch": "tsc -w",
"build": "rollup -c",
"build:watch": "yarn build -w",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"format": "yarn format:base -w .",
"format:base": "prettier --ignore-path ../../.gitignore",
"format:check": "yarn format:base -c .",
"start": "node dist/src/index.js",
"start:gm": "nodemon dist/src/gm.js",
"start:watch": "nodemon --exec node --loader ts-node/esm ./src/gm.ts",
"typecheck": "tsc --noEmit"
"typecheck": "tsc"
},
"dependencies": {
"@xmtp/content-type-primitives": "^1.0.1",
Expand All @@ -37,9 +35,12 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.14.2",
"nodemon": "^3.1.3",
"prettier": "^3.3.1",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
Expand Down
52 changes: 52 additions & 0 deletions packages/message-kit/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import typescript from "@rollup/plugin-typescript";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";

const external = [
"@xmtp/content-type-primitives",
"@xmtp/content-type-text",
"@xmtp/grpc-api-client",
"@xmtp/mls-client",
"@xmtp/proto",
"@xmtp/xmtp-js",
"dotenv",
"ethers",
];

const plugins = [
typescript({
declaration: false,
declarationMap: false,
}),
];

export default defineConfig([
{
input: "src/index.ts",
output: {
file: "dist/index.js",
format: "es",
sourcemap: true,
},
plugins,
external,
},
{
input: "src/index.ts",
output: {
file: "dist/index.cjs",
format: "cjs",
sourcemap: true,
},
plugins,
external,
},
{
input: "src/index.ts",
output: {
file: "dist/index.d.ts",
format: "es",
},
plugins: [dts()],
},
]);
7 changes: 2 additions & 5 deletions packages/message-kit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"include": ["src/**/*"],
"extends": "@xmtp/tsconfig/base.json",
"compilerOptions": {
"outDir": "./dist"
}
"include": ["src/**/*", "rollup.config.js"],
"extends": "@xmtp/tsconfig/base.json"
}
1 change: 1 addition & 0 deletions shared/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lib": ["ESNext"],
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
Expand Down
Loading

0 comments on commit 98197d3

Please sign in to comment.