@olane/o-protocol 0.1.1

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.
Files changed (87) hide show
  1. package/.babelrc +6 -0
  2. package/README.md +24 -0
  3. package/dist/address/index.d.ts +2 -0
  4. package/dist/address/index.d.ts.map +1 -0
  5. package/dist/address/index.js +17 -0
  6. package/dist/address/o-address.d.ts +5 -0
  7. package/dist/address/o-address.d.ts.map +1 -0
  8. package/dist/address/o-address.js +2 -0
  9. package/dist/config.d.ts +2 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +4 -0
  12. package/dist/dependency/index.d.ts +2 -0
  13. package/dist/dependency/index.d.ts.map +1 -0
  14. package/dist/dependency/index.js +17 -0
  15. package/dist/dependency/o-dependency.d.ts +8 -0
  16. package/dist/dependency/o-dependency.d.ts.map +1 -0
  17. package/dist/dependency/o-dependency.js +2 -0
  18. package/dist/enums/index.d.ts +2 -0
  19. package/dist/enums/index.d.ts.map +1 -0
  20. package/dist/enums/index.js +17 -0
  21. package/dist/enums/o-protocol-methods.enum.d.ts +9 -0
  22. package/dist/enums/o-protocol-methods.enum.d.ts.map +1 -0
  23. package/dist/enums/o-protocol-methods.enum.js +12 -0
  24. package/dist/handshake/index.d.ts +2 -0
  25. package/dist/handshake/index.d.ts.map +1 -0
  26. package/dist/handshake/index.js +17 -0
  27. package/dist/handshake/o-handshake.d.ts +19 -0
  28. package/dist/handshake/o-handshake.d.ts.map +1 -0
  29. package/dist/handshake/o-handshake.js +2 -0
  30. package/dist/index.d.ts +11 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +26 -0
  33. package/dist/json-rpc/index.d.ts +2 -0
  34. package/dist/json-rpc/index.d.ts.map +1 -0
  35. package/dist/json-rpc/index.js +17 -0
  36. package/dist/json-rpc/json-rpc.d.ts +89 -0
  37. package/dist/json-rpc/json-rpc.d.ts.map +1 -0
  38. package/dist/json-rpc/json-rpc.js +10 -0
  39. package/dist/method/index.d.ts +2 -0
  40. package/dist/method/index.d.ts.map +1 -0
  41. package/dist/method/index.js +17 -0
  42. package/dist/method/o-method.d.ts +9 -0
  43. package/dist/method/o-method.d.ts.map +1 -0
  44. package/dist/method/o-method.js +2 -0
  45. package/dist/parameter/index.d.ts +2 -0
  46. package/dist/parameter/index.d.ts.map +1 -0
  47. package/dist/parameter/index.js +17 -0
  48. package/dist/parameter/o-parameter.d.ts +8 -0
  49. package/dist/parameter/o-parameter.d.ts.map +1 -0
  50. package/dist/parameter/o-parameter.js +2 -0
  51. package/dist/register/index.d.ts +2 -0
  52. package/dist/register/index.d.ts.map +1 -0
  53. package/dist/register/index.js +17 -0
  54. package/dist/register/o-register.d.ts +14 -0
  55. package/dist/register/o-register.d.ts.map +1 -0
  56. package/dist/register/o-register.js +2 -0
  57. package/dist/router/index.d.ts +2 -0
  58. package/dist/router/index.d.ts.map +1 -0
  59. package/dist/router/index.js +17 -0
  60. package/dist/router/o-router.d.ts +12 -0
  61. package/dist/router/o-router.d.ts.map +1 -0
  62. package/dist/router/o-router.js +2 -0
  63. package/package.json +67 -0
  64. package/schema/v1.0.0/schema.ts +159 -0
  65. package/src/address/index.ts +1 -0
  66. package/src/address/o-address.ts +4 -0
  67. package/src/config.ts +1 -0
  68. package/src/dependency/index.ts +1 -0
  69. package/src/dependency/o-dependency.ts +8 -0
  70. package/src/enums/index.ts +1 -0
  71. package/src/enums/o-protocol-methods.enum.ts +8 -0
  72. package/src/handshake/index.ts +1 -0
  73. package/src/handshake/o-handshake.ts +24 -0
  74. package/src/index.ts +10 -0
  75. package/src/json-rpc/index.ts +1 -0
  76. package/src/json-rpc/json-rpc.ts +100 -0
  77. package/src/method/index.ts +1 -0
  78. package/src/method/o-method.ts +9 -0
  79. package/src/parameter/index.ts +1 -0
  80. package/src/parameter/o-parameter.ts +7 -0
  81. package/src/register/index.ts +1 -0
  82. package/src/register/o-register.ts +15 -0
  83. package/src/router/index.ts +1 -0
  84. package/src/router/o-router.ts +12 -0
  85. package/ts-aggregator-loader.js +91 -0
  86. package/tsconfig.json +12 -0
  87. package/webpack.config.js +30 -0
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@olane/o-protocol",
3
+ "version": "0.1.1",
4
+ "description": "oLane Protocol specification and protocol schema",
5
+ "license": "MIT",
6
+ "author": "oLane Inc. (https://olane.com)",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "default": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "engines": {
16
+ "node": ">=20"
17
+ },
18
+ "prettier": {
19
+ "overrides": [
20
+ {
21
+ "files": "*.{md,mdx}",
22
+ "options": {
23
+ "proseWrap": "preserve"
24
+ }
25
+ }
26
+ ]
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/olane-labs/o-protocol.git"
31
+ },
32
+ "scripts": {
33
+ "check": "npm run check:schema && npm run check:docs",
34
+ "check:schema": "npm run check:schema:ts && npm run check:schema:json",
35
+ "check:schema:ts": "tsc",
36
+ "check:schema:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" | cat | cmp \"${f%ts}json\" - || exit 1; done",
37
+ "check:docs": "npm run check:docs:format && npm run check:docs:links",
38
+ "check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
39
+ "check:docs:links": "cd docs && mintlify broken-links",
40
+ "generate:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" -o \"${f%ts}json\"; done",
41
+ "format": "prettier --write \"**/*.{md,mdx}\"",
42
+ "serve:docs": "cd docs && mintlify dev",
43
+ "build": "tsc"
44
+ },
45
+ "devDependencies": {
46
+ "@babel/core": "^7.27.4",
47
+ "@babel/preset-env": "^7.27.2",
48
+ "@babel/preset-react": "^7.27.1",
49
+ "@babel/preset-typescript": "^7.27.1",
50
+ "@tsconfig/node20": "^20.1.6",
51
+ "ajv": "^8.17.1",
52
+ "ajv-formats": "^3.0.1",
53
+ "babel-loader": "^10.0.0",
54
+ "glob": "^11.0.0",
55
+ "mintlify": "^4.0.468",
56
+ "prettier": "^3.4.2",
57
+ "ts-loader": "^9.5.2",
58
+ "tsx": "^4.19.1",
59
+ "typescript": "^5.6.2",
60
+ "typescript-json-schema": "^0.65.1",
61
+ "webpack": "^5.99.9",
62
+ "webpack-cli": "^6.0.1"
63
+ },
64
+ "resolutions": {
65
+ "fast-json-patch": "^3.1.1"
66
+ }
67
+ }
@@ -0,0 +1,159 @@
1
+ export const LATEST_PROTOCOL_VERSION = "1.0.0";
2
+
3
+ export enum oProtocolMethods {
4
+ HANDSHAKE = "handshake",
5
+ REGISTER = "register",
6
+ ROUTE = "route",
7
+ }
8
+ export interface oDependency {
9
+ address: string;
10
+ version: string;
11
+ parameters: {
12
+ [key: string]: unknown;
13
+ };
14
+ }
15
+ export const JSONRPC_VERSION = "2.0";
16
+
17
+ export type ConnectionId = string;
18
+
19
+ /**
20
+ * An opaque token used to represent a cursor for pagination.
21
+ */
22
+ export type Cursor = string;
23
+
24
+ export interface RequestParams {
25
+ _connectionId: ConnectionId;
26
+ _requestMethod: string;
27
+ [key: string]: unknown;
28
+ }
29
+
30
+ export interface Request {
31
+ method: string;
32
+ params: RequestParams;
33
+ }
34
+
35
+ export interface Notification {
36
+ method: string;
37
+ params?: {
38
+ _meta?: { [key: string]: unknown };
39
+ [key: string]: unknown;
40
+ };
41
+ }
42
+
43
+ export interface Result {
44
+ _connectionId: ConnectionId;
45
+ _requestMethod: string;
46
+ [key: string]: unknown;
47
+ }
48
+
49
+ /**
50
+ * A uniquely identifying ID for a request in JSON-RPC.
51
+ */
52
+ export type RequestId = string | number;
53
+
54
+ /**
55
+ * A request that expects a response.
56
+ */
57
+ export interface JSONRPCRequest extends Request {
58
+ jsonrpc: typeof JSONRPC_VERSION;
59
+ id: RequestId;
60
+ }
61
+
62
+ /**
63
+ * A notification which does not expect a response.
64
+ */
65
+ export interface JSONRPCNotification extends Notification {
66
+ jsonrpc: typeof JSONRPC_VERSION;
67
+ }
68
+
69
+ /**
70
+ * A successful (non-error) response to a request.
71
+ */
72
+ export interface JSONRPCResponse {
73
+ jsonrpc: typeof JSONRPC_VERSION;
74
+ id: RequestId;
75
+ result: Result;
76
+ }
77
+
78
+ // Standard JSON-RPC error codes
79
+ export const PARSE_ERROR = -32700;
80
+ export const INVALID_REQUEST = -32600;
81
+ export const METHOD_NOT_FOUND = -32601;
82
+ export const INVALID_PARAMS = -32602;
83
+ export const INTERNAL_ERROR = -32603;
84
+
85
+ /**
86
+ * A response to a request that indicates an error occurred.
87
+ */
88
+ export interface JSONRPCError {
89
+ jsonrpc: typeof JSONRPC_VERSION;
90
+ id: RequestId;
91
+ error: {
92
+ /**
93
+ * The error type that occurred.
94
+ */
95
+ code: number;
96
+ /**
97
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
98
+ */
99
+ message: string;
100
+ /**
101
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
102
+ */
103
+ data?: unknown;
104
+ };
105
+ }
106
+
107
+ /* Empty result */
108
+ /**
109
+ * A response that indicates success but carries no data.
110
+ */
111
+ export type EmptyResult = Result;
112
+
113
+ export interface oRequest extends JSONRPCRequest {}
114
+ export interface oResponse extends JSONRPCResponse {}
115
+
116
+ export interface oAddress {
117
+ transports: string[];
118
+ protocol: string;
119
+ }
120
+
121
+ export interface oRouterRequest extends JSONRPCRequest {
122
+ method: oProtocolMethods.ROUTE;
123
+ params: RequestParams & {
124
+ address: string;
125
+ payload: {
126
+ [key: string]: unknown;
127
+ };
128
+ };
129
+ }
130
+
131
+ export interface oHandshakeRequest extends JSONRPCRequest {
132
+ method: oProtocolMethods.HANDSHAKE;
133
+ params: RequestParams & {
134
+ address: string;
135
+ };
136
+ }
137
+
138
+ export interface oHandshakeResponse extends JSONRPCResponse {
139
+ result: {
140
+ _connectionId: string;
141
+ _requestMethod: oProtocolMethods.HANDSHAKE;
142
+ method: string;
143
+ dependencies: oDependency[];
144
+ parameters: any;
145
+ };
146
+ }
147
+
148
+ export interface oRegistrationParams extends RequestParams {
149
+ transports: string[];
150
+ peerId: string;
151
+ address: string;
152
+ protocols: string[];
153
+ ttl?: number;
154
+ }
155
+
156
+ export interface oRegisterRequest extends oRequest {
157
+ method: oProtocolMethods.REGISTER;
158
+ params: oRegistrationParams;
159
+ }
@@ -0,0 +1 @@
1
+ export * from './o-address';
@@ -0,0 +1,4 @@
1
+ export interface oAddress {
2
+ transports: string[];
3
+ protocol: string;
4
+ }
package/src/config.ts ADDED
@@ -0,0 +1 @@
1
+ export const LATEST_PROTOCOL_VERSION = '1.0.0';
@@ -0,0 +1 @@
1
+ export * from './o-dependency';
@@ -0,0 +1,8 @@
1
+ import { oParameter } from "../parameter";
2
+
3
+ export interface oDependency {
4
+ address: string;
5
+ version?: string;
6
+ method?: string;
7
+ parameters?: oParameter[];
8
+ }
@@ -0,0 +1 @@
1
+ export * from './o-protocol-methods.enum';
@@ -0,0 +1,8 @@
1
+ export enum oProtocolMethods {
2
+ HANDSHAKE = "handshake",
3
+ REGISTER = "register",
4
+ ROUTE = "route",
5
+ INDEX_NETWORK = "index_network",
6
+ INTENT = "intent",
7
+ INTENT_METHOD_CONFIGURATION = "intent_method_configuration",
8
+ }
@@ -0,0 +1 @@
1
+ export * from './o-handshake';
@@ -0,0 +1,24 @@
1
+ import { oParameter } from "../parameter";
2
+ import { oDependency } from "../dependency";
3
+ import { oProtocolMethods } from "../enums";
4
+ import {
5
+ JSONRPCRequest,
6
+ JSONRPCResponse,
7
+ RequestParams,
8
+ } from "../json-rpc/json-rpc";
9
+
10
+ export interface oHandshakeRequest extends JSONRPCRequest {
11
+ method: oProtocolMethods.HANDSHAKE;
12
+ params: RequestParams & {
13
+ address: string;
14
+ };
15
+ }
16
+
17
+ export interface oHandshakeResponse extends JSONRPCResponse {
18
+ result: {
19
+ _connectionId: string;
20
+ _requestMethod: oProtocolMethods.HANDSHAKE;
21
+ dependencies: oDependency[];
22
+ parameters: oParameter[];
23
+ };
24
+ }
package/src/index.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from "./address";
2
+ export * from "./dependency";
3
+ export * from "./enums";
4
+ export * from "./handshake";
5
+ export * from "./json-rpc";
6
+ export * from "./router";
7
+ export * from "./config";
8
+ export * from "./register";
9
+ export * from "./parameter";
10
+ export * from "./method";
@@ -0,0 +1 @@
1
+ export * from './json-rpc';
@@ -0,0 +1,100 @@
1
+ export const JSONRPC_VERSION = "2.0";
2
+
3
+ export type ConnectionId = string;
4
+
5
+ /**
6
+ * An opaque token used to represent a cursor for pagination.
7
+ */
8
+ export type Cursor = string;
9
+
10
+ export interface RequestParams {
11
+ _connectionId: ConnectionId;
12
+ _requestMethod: string;
13
+ [key: string]: unknown;
14
+ }
15
+
16
+ export interface Request {
17
+ method: string;
18
+ params: RequestParams;
19
+ }
20
+
21
+ export interface Notification {
22
+ method: string;
23
+ params?: {
24
+ _meta?: { [key: string]: unknown };
25
+ [key: string]: unknown;
26
+ };
27
+ }
28
+
29
+ export interface Result {
30
+ _connectionId: ConnectionId;
31
+ _requestMethod: string;
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ /**
36
+ * A uniquely identifying ID for a request in JSON-RPC.
37
+ */
38
+ export type RequestId = string | number;
39
+
40
+ /**
41
+ * A request that expects a response.
42
+ */
43
+ export interface JSONRPCRequest extends Request {
44
+ jsonrpc: typeof JSONRPC_VERSION;
45
+ id: RequestId;
46
+ }
47
+
48
+ /**
49
+ * A notification which does not expect a response.
50
+ */
51
+ export interface JSONRPCNotification extends Notification {
52
+ jsonrpc: typeof JSONRPC_VERSION;
53
+ }
54
+
55
+ /**
56
+ * A successful (non-error) response to a request.
57
+ */
58
+ export interface JSONRPCResponse {
59
+ jsonrpc: typeof JSONRPC_VERSION;
60
+ id: RequestId;
61
+ result: Result;
62
+ }
63
+
64
+ // Standard JSON-RPC error codes
65
+ export const PARSE_ERROR = -32700;
66
+ export const INVALID_REQUEST = -32600;
67
+ export const METHOD_NOT_FOUND = -32601;
68
+ export const INVALID_PARAMS = -32602;
69
+ export const INTERNAL_ERROR = -32603;
70
+
71
+ /**
72
+ * A response to a request that indicates an error occurred.
73
+ */
74
+ export interface JSONRPCError {
75
+ jsonrpc: typeof JSONRPC_VERSION;
76
+ id: RequestId;
77
+ error: {
78
+ /**
79
+ * The error type that occurred.
80
+ */
81
+ code: number;
82
+ /**
83
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
84
+ */
85
+ message: string;
86
+ /**
87
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
88
+ */
89
+ data?: unknown;
90
+ };
91
+ }
92
+
93
+ /* Empty result */
94
+ /**
95
+ * A response that indicates success but carries no data.
96
+ */
97
+ export type EmptyResult = Result;
98
+
99
+ export interface oRequest extends JSONRPCRequest {}
100
+ export interface oResponse extends JSONRPCResponse {}
@@ -0,0 +1 @@
1
+ export * from "./o-method";
@@ -0,0 +1,9 @@
1
+ import { oDependency } from "../dependency/o-dependency";
2
+ import { oParameter } from "../parameter/o-parameter";
3
+
4
+ export interface oMethod {
5
+ name: string;
6
+ description: string;
7
+ parameters: oParameter[];
8
+ dependencies: oDependency[];
9
+ }
@@ -0,0 +1 @@
1
+ export * from "./o-parameter";
@@ -0,0 +1,7 @@
1
+ export interface oParameter {
2
+ name: string;
3
+ type: string;
4
+ value?: any;
5
+ description?: string;
6
+ required?: boolean;
7
+ }
@@ -0,0 +1 @@
1
+ export * from "./o-register";
@@ -0,0 +1,15 @@
1
+ import { oProtocolMethods } from "../enums";
2
+ import { oRequest, RequestParams } from "../json-rpc";
3
+
4
+ export interface oRegistrationParams extends RequestParams {
5
+ transports: string[];
6
+ peerId: string;
7
+ address: string;
8
+ protocols: string[];
9
+ ttl?: number;
10
+ }
11
+
12
+ export interface oRegisterRequest extends oRequest {
13
+ method: oProtocolMethods.REGISTER;
14
+ params: oRegistrationParams;
15
+ }
@@ -0,0 +1 @@
1
+ export * from './o-router';
@@ -0,0 +1,12 @@
1
+ import { RequestParams, JSONRPCRequest } from "../json-rpc";
2
+ import { oProtocolMethods } from "../enums";
3
+
4
+ export interface oRouterRequest extends JSONRPCRequest {
5
+ method: oProtocolMethods.ROUTE;
6
+ params: RequestParams & {
7
+ address: string;
8
+ payload: {
9
+ [key: string]: unknown;
10
+ };
11
+ };
12
+ }
@@ -0,0 +1,91 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ // Track processed files to avoid circular dependencies
5
+ const processedFiles = new Set();
6
+ const aggregatedContent = [];
7
+
8
+ function resolveImportPath(importPath, currentFile) {
9
+ if (importPath.startsWith('.')) {
10
+ // Relative import
11
+ const resolvedPath = path.resolve(path.dirname(currentFile), importPath);
12
+
13
+ // Try different extensions
14
+ const extensions = ['.ts', '.tsx', '.js', '.jsx'];
15
+ for (const ext of extensions) {
16
+ const fullPath = resolvedPath + ext;
17
+ if (fs.existsSync(fullPath)) {
18
+ return fullPath;
19
+ }
20
+ }
21
+
22
+ // Try index files
23
+ for (const ext of extensions) {
24
+ const fullPath = path.join(resolvedPath, `index${ext}`);
25
+ if (fs.existsSync(fullPath)) {
26
+ return fullPath;
27
+ }
28
+ }
29
+ }
30
+ return null;
31
+ }
32
+
33
+ function extractImports(content) {
34
+ const importRegex = /import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+|\w+))*\s+from\s+)?['"`]([^'"`]+)['"`]/g;
35
+ const imports = [];
36
+ let match;
37
+
38
+ while ((match = importRegex.exec(content)) !== null) {
39
+ imports.push(match[1]);
40
+ }
41
+
42
+ return imports;
43
+ }
44
+
45
+ function processFile(filePath, baseDir) {
46
+ if (processedFiles.has(filePath)) {
47
+ return;
48
+ }
49
+
50
+ processedFiles.add(filePath);
51
+
52
+ try {
53
+ const content = fs.readFileSync(filePath, 'utf8');
54
+
55
+ // Extract imports
56
+ const imports = extractImports(content);
57
+
58
+ // Process local imports first
59
+ for (const importPath of imports) {
60
+ const resolvedPath = resolveImportPath(importPath, filePath);
61
+ if (resolvedPath && resolvedPath.startsWith(baseDir) && !resolvedPath.includes('node_modules')) {
62
+ processFile(resolvedPath, baseDir);
63
+ }
64
+ }
65
+ aggregatedContent.push(content.replace(/import[\s\S]*?;/g, ''));
66
+ aggregatedContent.push(''); // Empty line for separation
67
+
68
+ } catch (error) {
69
+ console.error(`Error processing file ${filePath}:`, error);
70
+ }
71
+ }
72
+
73
+ module.exports = function(source) {
74
+ const callback = this.async();
75
+ const resourcePath = this.resourcePath;
76
+ const baseDir = path.dirname(resourcePath);
77
+
78
+ // Reset for each build
79
+ processedFiles.clear();
80
+ aggregatedContent.length = 0;
81
+
82
+ // Process the entry file and all its dependencies
83
+ processFile(resourcePath, baseDir);
84
+
85
+ // console.log('Aggregated Content::::', aggregatedContent.length);
86
+
87
+ // Return the aggregated content
88
+ const result = aggregatedContent.join('\n');
89
+ fs.appendFileSync('dist/schema.ts', result);
90
+ callback(null, result);
91
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@tsconfig/node20/tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "declarationDir": "./dist",
8
+ "emitDeclarationOnly": false
9
+ },
10
+ "include": ["src/**/*"],
11
+ "exclude": ["node_modules", "dist", "src/tests", "webpack.config.js"]
12
+ }
@@ -0,0 +1,30 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ entry: './src/index.ts',
5
+ module: {
6
+ rules: [
7
+ {
8
+ test: /\.ts$/,
9
+ use: [
10
+ {
11
+ loader: 'babel-loader',
12
+ },
13
+ {
14
+ loader: path.resolve(__dirname, 'ts-aggregator-loader.js'),
15
+ }
16
+ ],
17
+ exclude: /node_modules|index.ts/,
18
+ },
19
+ ],
20
+ },
21
+ resolve: {
22
+ extensions: ['.ts', '.js'],
23
+ },
24
+ output: {
25
+ filename: 'index.js',
26
+ path: path.resolve(__dirname, 'dist'),
27
+
28
+ },
29
+ mode: 'production',
30
+ };