@dimo-network/data-sdk 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "@dimo-network/data-sdk",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "DIMO Data SDK for JavaScript",
5
5
  "main": "dist/index.js",
6
6
  "author": "James Li",
7
7
  "contributors": [],
8
8
  "license": "Apache-2.0",
9
9
  "type": "module",
10
+ "exports": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ },
10
14
  "keywords": [
11
- "data-sdk", "dimo", "dimo-network"
15
+ "data-sdk",
16
+ "dimo",
17
+ "dimo-network"
12
18
  ],
13
19
  "homepage": "https://dimo.org/developers",
14
20
  "bugs": {
@@ -20,7 +26,7 @@
20
26
  },
21
27
  "scripts": {
22
28
  "test": "jest",
23
- "build": "tsc"
29
+ "build": "tsc && npx rollup -c"
24
30
  },
25
31
  "dependencies": {
26
32
  "axios": "^1.6.7",
@@ -29,13 +35,20 @@
29
35
  "web3": "^4.6.0"
30
36
  },
31
37
  "devDependencies": {
38
+ "@rollup/plugin-commonjs": "^28.0.2",
39
+ "@rollup/plugin-json": "^6.1.0",
40
+ "@rollup/plugin-node-resolve": "^16.0.0",
41
+ "@rollup/plugin-typescript": "^12.1.2",
32
42
  "@types/dotenv-safe": "^8.1.6",
33
43
  "@types/jest": "^29.5.12",
34
44
  "@types/node": "^20.11.25",
45
+ "@types/rollup-plugin-node-globals": "^1.4.5",
35
46
  "eslint": "^8.56.0",
36
47
  "eslint-config-airbnb-base": "^15.0.0",
37
48
  "eslint-plugin-import": "^2.29.1",
38
49
  "jest": "^29.7.0",
50
+ "rollup": "^4.29.1",
51
+ "rollup-plugin-node-globals": "^1.4.0",
39
52
  "ts-jest": "^29.1.4",
40
53
  "typescript": "^5.4.5"
41
54
  },
@@ -0,0 +1,28 @@
1
+ import resolve from '@rollup/plugin-node-resolve';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import typescript from '@rollup/plugin-typescript';
4
+ import json from '@rollup/plugin-json';
5
+ import globals from 'rollup-plugin-node-globals';
6
+
7
+
8
+ export default {
9
+ input: './src/index.ts',
10
+ output: {
11
+ file: './dist/index.cjs',
12
+ format: 'cjs',
13
+ },
14
+ plugins: [
15
+ resolve({ preferBuiltins: true }), // Resolves node_modules and relative paths
16
+ commonjs(), // Converts CommonJS modules to ES6
17
+ typescript(), // Handles TypeScript (if needed)
18
+ json(),
19
+ globals(),
20
+ ],
21
+ onwarn(warning, warn) {
22
+ // Print detailed warnings
23
+ if (warning.code === 'UNRESOLVED_IMPORT') {
24
+ throw new Error(warning.message);
25
+ }
26
+ warn(warning);
27
+ },
28
+ };