Skip to content

Commit

Permalink
Merge pull request #234 from xmtp/rygine/consent-exports
Browse files Browse the repository at this point in the history
Add CommonJS export to consent-proof-signature
  • Loading branch information
rygine authored May 16, 2024
2 parents 9f059b6 + 8adc23f commit 6b03827
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-yaks-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@xmtp/consent-proof-signature": patch
---

Add CommonJS export to `consent-proof-signature` package
7 changes: 3 additions & 4 deletions packages/consent-proof-signature/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
"exports": {
".": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
"require": "./lib/index.cjs",
"import": "./lib/index.js"
}
},
"main": "index.js",
"main": "lib/index.cjs",
"module": "lib/index.js",
"browser": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -81,11 +82,9 @@
"rollup": "^4.13.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-tsconfig-paths": "^1.5.2",
"typedoc": "^0.25.12",
"typescript": "^5.4.2",
"vite": "^5.1.6",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.3.1"
},
"packageManager": "[email protected]",
Expand Down
16 changes: 12 additions & 4 deletions packages/consent-proof-signature/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { defineConfig } from "rollup";
import typescript from "@rollup/plugin-typescript";
import { dts } from "rollup-plugin-dts";
import tsConfigPaths from "rollup-plugin-tsconfig-paths";
import terser from "@rollup/plugin-terser";
import filesize from "rollup-plugin-filesize";

const plugins = [
tsConfigPaths(),
typescript({
declaration: false,
declarationMap: false,
Expand All @@ -16,7 +14,7 @@ const plugins = [
}),
];

const external = ["@xmtp/proto", "node:crypto"];
const external = ["@xmtp/proto", "node:crypto", "long"];

export default defineConfig([
{
Expand All @@ -29,6 +27,16 @@ export default defineConfig([
external,
plugins,
},
{
input: "src/index.ts",
output: {
file: "lib/index.cjs",
format: "cjs",
sourcemap: true,
},
external,
plugins,
},
{
input: "src/index.ts",
output: {
Expand All @@ -45,6 +53,6 @@ export default defineConfig([
file: "lib/index.d.ts",
format: "es",
},
plugins: [tsConfigPaths(), dts()],
plugins: [dts()],
},
]);
5 changes: 1 addition & 4 deletions packages/consent-proof-signature/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { defineConfig, mergeConfig } from "vite";
import { defineConfig as defineVitestConfig } from "vitest/config";
import tsconfigPaths from "vite-tsconfig-paths";

// https://vitejs.dev/config/
const viteConfig = defineConfig({
plugins: [tsconfigPaths()],
});
const viteConfig = defineConfig({});

const vitestConfig = defineVitestConfig({
test: {
Expand Down
2 changes: 0 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5384,11 +5384,9 @@ __metadata:
rollup: "npm:^4.13.0"
rollup-plugin-dts: "npm:^6.1.0"
rollup-plugin-filesize: "npm:^10.0.0"
rollup-plugin-tsconfig-paths: "npm:^1.5.2"
typedoc: "npm:^0.25.12"
typescript: "npm:^5.4.2"
vite: "npm:^5.1.6"
vite-tsconfig-paths: "npm:^4.3.1"
vitest: "npm:^1.3.1"
languageName: unknown
linkType: soft
Expand Down

0 comments on commit 6b03827

Please sign in to comment.