@motiadev/core 0.0.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 (54) hide show
  1. package/dist/index.d.ts +8 -0
  2. package/dist/index.js +24 -0
  3. package/dist/jest.config.d.ts +6 -0
  4. package/dist/src/config.types.d.ts +16 -0
  5. package/dist/src/config.types.js +2 -0
  6. package/dist/src/event-manager.d.ts +2 -0
  7. package/dist/src/event-manager.js +22 -0
  8. package/dist/src/flows-endpoint.d.ts +25 -0
  9. package/dist/src/flows-endpoint.js +81 -0
  10. package/dist/src/get-step-language.d.ts +1 -0
  11. package/dist/src/get-step-language.js +27 -0
  12. package/dist/src/guards.d.ts +4 -0
  13. package/dist/src/guards.js +9 -0
  14. package/dist/src/logger.d.ts +23 -0
  15. package/dist/src/logger.js +76 -0
  16. package/dist/src/node/logger.d.ts +8 -0
  17. package/dist/src/node/logger.js +23 -0
  18. package/dist/src/node/node-runner.d.ts +1 -0
  19. package/dist/src/node/node-runner.js +56 -0
  20. package/dist/src/node/rpc-state-manager.d.ts +10 -0
  21. package/dist/src/node/rpc-state-manager.js +21 -0
  22. package/dist/src/node/rpc.d.ts +7 -0
  23. package/dist/src/node/rpc.js +32 -0
  24. package/dist/src/python/get-config.py +42 -0
  25. package/dist/src/python/get-python-config.d.ts +2 -0
  26. package/dist/src/python/get-python-config.js +34 -0
  27. package/dist/src/python/logger.py +42 -0
  28. package/dist/src/python/python-runner.py +73 -0
  29. package/dist/src/python/rpc.py +80 -0
  30. package/dist/src/python/rpc_state_manager.py +18 -0
  31. package/dist/src/ruby/get-ruby-config.d.ts +2 -0
  32. package/dist/src/ruby/get-ruby-config.js +34 -0
  33. package/dist/src/ruby/get_config.rb +78 -0
  34. package/dist/src/ruby/logger.rb +55 -0
  35. package/dist/src/ruby/ruby_runner.rb +80 -0
  36. package/dist/src/ruby/state_adapter.rb +62 -0
  37. package/dist/src/server.d.ts +18 -0
  38. package/dist/src/server.js +73 -0
  39. package/dist/src/state/adapters/default-state-adapter.d.ts +17 -0
  40. package/dist/src/state/adapters/default-state-adapter.js +102 -0
  41. package/dist/src/state/adapters/redis-state-adapter.d.ts +19 -0
  42. package/dist/src/state/adapters/redis-state-adapter.js +44 -0
  43. package/dist/src/state/create-state-adapter.d.ts +8 -0
  44. package/dist/src/state/create-state-adapter.js +16 -0
  45. package/dist/src/state/state-adapter.d.ts +10 -0
  46. package/dist/src/state/state-adapter.js +2 -0
  47. package/dist/src/step-handler-rpc-processor.d.ts +12 -0
  48. package/dist/src/step-handler-rpc-processor.js +35 -0
  49. package/dist/src/step-handlers.d.ts +2 -0
  50. package/dist/src/step-handlers.js +98 -0
  51. package/dist/src/types.d.ts +109 -0
  52. package/dist/src/types.js +2 -0
  53. package/package.json +31 -0
  54. package/tsconfig.json +20 -0
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.FileStateAdapter = void 0;
40
+ const fs_1 = __importDefault(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ class FileStateAdapter {
43
+ constructor(config) {
44
+ this.filePath = path.join(config.filePath, 'motia-state.json');
45
+ }
46
+ async init() {
47
+ const dir = this.filePath.replace('motia-state.json', '');
48
+ try {
49
+ fs_1.default.realpathSync(dir);
50
+ }
51
+ catch (err) {
52
+ fs_1.default.mkdirSync(dir, { recursive: true });
53
+ }
54
+ try {
55
+ fs_1.default.readFileSync(this.filePath, 'utf-8');
56
+ }
57
+ catch (err) {
58
+ fs_1.default.writeFileSync(this.filePath, JSON.stringify({}), 'utf-8');
59
+ }
60
+ }
61
+ async get(traceId, key) {
62
+ const data = await this._readFile();
63
+ const fullKey = this._makeKey(traceId, key);
64
+ return data[fullKey] ? JSON.parse(data[fullKey]) : null;
65
+ }
66
+ async set(traceId, key, value) {
67
+ const data = await this._readFile();
68
+ const fullKey = this._makeKey(traceId, key);
69
+ data[fullKey] = JSON.stringify(value);
70
+ await this._writeFile(data);
71
+ }
72
+ async delete(traceId, key) {
73
+ const data = await this._readFile();
74
+ const fullKey = this._makeKey(traceId, key);
75
+ delete data[fullKey];
76
+ await this._writeFile(data);
77
+ }
78
+ async clear(traceId) {
79
+ const data = await this._readFile();
80
+ const pattern = this._makeKey(traceId, '');
81
+ for (const key in data) {
82
+ if (key.startsWith(pattern)) {
83
+ delete data[key];
84
+ }
85
+ }
86
+ await this._writeFile(data);
87
+ }
88
+ async cleanup() {
89
+ // No cleanup needed for file system
90
+ }
91
+ _makeKey(traceId, key) {
92
+ return `${traceId}:${key}`;
93
+ }
94
+ async _readFile() {
95
+ const content = fs_1.default.readFileSync(this.filePath, 'utf-8');
96
+ return JSON.parse(content);
97
+ }
98
+ async _writeFile(data) {
99
+ fs_1.default.writeFileSync(this.filePath, JSON.stringify(data, null, 2), 'utf-8');
100
+ }
101
+ }
102
+ exports.FileStateAdapter = FileStateAdapter;
@@ -0,0 +1,19 @@
1
+ import { StateAdapter } from '../state-adapter';
2
+ export type RedisAdapterConfig = {
3
+ host: string;
4
+ port: number;
5
+ password?: string;
6
+ ttl?: number;
7
+ };
8
+ export declare class RedisStateAdapter implements StateAdapter {
9
+ private client;
10
+ private prefix;
11
+ private ttl;
12
+ constructor(config: RedisAdapterConfig);
13
+ get(traceId: string, key: string): Promise<any>;
14
+ set(traceId: string, key: string, value: any): Promise<void>;
15
+ delete(traceId: string, key: string): Promise<void>;
16
+ clear(traceId: string): Promise<void>;
17
+ cleanup(): Promise<void>;
18
+ _makeKey(traceId: string, key: string): string;
19
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RedisStateAdapter = void 0;
7
+ const ioredis_1 = __importDefault(require("ioredis"));
8
+ class RedisStateAdapter {
9
+ constructor(config) {
10
+ this.ttl = 3600;
11
+ this.client = new ioredis_1.default(config);
12
+ this.prefix = 'motia:state';
13
+ if (config.ttl) {
14
+ this.ttl = config.ttl;
15
+ }
16
+ }
17
+ async get(traceId, key) {
18
+ const fullKey = this._makeKey(traceId, key);
19
+ const value = await this.client.get(fullKey);
20
+ return value ? JSON.parse(value) : null;
21
+ }
22
+ async set(traceId, key, value) {
23
+ const fullKey = this._makeKey(traceId, key);
24
+ await this.client.set(fullKey, JSON.stringify(value), 'EX', this.ttl);
25
+ }
26
+ async delete(traceId, key) {
27
+ const fullKey = this._makeKey(traceId, key);
28
+ await this.client.del(fullKey);
29
+ }
30
+ async clear(traceId) {
31
+ const pattern = this._makeKey(traceId, '*');
32
+ const keys = await this.client.keys(pattern);
33
+ if (keys.length > 0) {
34
+ await this.client.del(keys);
35
+ }
36
+ }
37
+ async cleanup() {
38
+ await this.client.quit();
39
+ }
40
+ _makeKey(traceId, key) {
41
+ return `${this.prefix}:${traceId}:${key}`;
42
+ }
43
+ }
44
+ exports.RedisStateAdapter = RedisStateAdapter;
@@ -0,0 +1,8 @@
1
+ import { FileStateAdapter } from './adapters/default-state-adapter';
2
+ import { RedisAdapterConfig, RedisStateAdapter } from './adapters/redis-state-adapter';
3
+ type BaseConfig = {
4
+ adapter: 'default' | 'redis';
5
+ };
6
+ export type AdapterConfig = (BaseConfig & RedisAdapterConfig) | Record<string, unknown>;
7
+ export declare function createStateAdapter(config: Record<string, unknown>): FileStateAdapter | RedisStateAdapter;
8
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createStateAdapter = createStateAdapter;
4
+ const default_state_adapter_1 = require("./adapters/default-state-adapter");
5
+ const redis_state_adapter_1 = require("./adapters/redis-state-adapter");
6
+ function createStateAdapter(config) {
7
+ const { adapter = 'redis', ...adapterConfig } = config;
8
+ switch (adapter) {
9
+ case 'redis':
10
+ return new redis_state_adapter_1.RedisStateAdapter(adapterConfig);
11
+ case 'default':
12
+ return new default_state_adapter_1.FileStateAdapter(adapterConfig);
13
+ default:
14
+ throw new Error(`Unknown state adapter type: ${adapter}`);
15
+ }
16
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Interface for state management adapters
3
+ */
4
+ export interface StateAdapter {
5
+ get<T>(traceId: string, key: string): Promise<T | null>;
6
+ set<T>(traceId: string, key: string, value: T): Promise<void>;
7
+ delete(traceId: string, key: string): Promise<void>;
8
+ clear(traceId: string): Promise<void>;
9
+ cleanup(): Promise<void>;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { ChildProcess } from 'child_process';
2
+ type RpcHandler<TInput, TOutput> = (input: TInput) => Promise<TOutput>;
3
+ export declare class RpcProcessor {
4
+ private child;
5
+ private handlers;
6
+ constructor(child: ChildProcess);
7
+ handler<TInput, TOutput = unknown>(method: string, handler: RpcHandler<TInput, TOutput>): void;
8
+ handle(method: string, input: any): Promise<any>;
9
+ private response;
10
+ init(): Promise<void>;
11
+ }
12
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RpcProcessor = void 0;
4
+ class RpcProcessor {
5
+ constructor(child) {
6
+ this.child = child;
7
+ this.handlers = {};
8
+ }
9
+ handler(method, handler) {
10
+ this.handlers[method] = handler;
11
+ }
12
+ async handle(method, input) {
13
+ const handler = this.handlers[method];
14
+ if (!handler) {
15
+ throw new Error(`Handler for method ${method} not found`);
16
+ }
17
+ return handler(input);
18
+ }
19
+ response(id, result, error) {
20
+ if (id) {
21
+ this.child.send?.({ type: 'rpc_response', id, result, error });
22
+ }
23
+ }
24
+ async init() {
25
+ this.child.on('message', (msg) => {
26
+ if (msg.type === 'rpc_request') {
27
+ const { id, method, args } = msg;
28
+ this.handle(method, args)
29
+ .then((result) => this.response(id, result, null))
30
+ .catch((error) => this.response(id, null, error));
31
+ }
32
+ });
33
+ }
34
+ }
35
+ exports.RpcProcessor = RpcProcessor;
@@ -0,0 +1,2 @@
1
+ import { EventManager, InternalStateManager, Step } from './types';
2
+ export declare const createStepHandlers: (steps: Step[], eventManager: EventManager, state: InternalStateManager) => void;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createStepHandlers = void 0;
7
+ const child_process_1 = require("child_process");
8
+ const path_1 = __importDefault(require("path"));
9
+ const logger_1 = require("./logger");
10
+ const guards_1 = require("./guards");
11
+ const step_handler_rpc_processor_1 = require("./step-handler-rpc-processor");
12
+ const nodeRunner = path_1.default.join(__dirname, 'node', 'node-runner.js');
13
+ const pythonRunner = path_1.default.join(__dirname, 'python', 'python-runner.py');
14
+ const rubyRunner = path_1.default.join(__dirname, 'ruby', 'ruby_runner.rb');
15
+ const getLanguageBasedRunner = (stepFilePath = '') => {
16
+ const isPython = stepFilePath.endsWith('.py');
17
+ const isRuby = stepFilePath.endsWith('.rb');
18
+ const isNode = stepFilePath.endsWith('.js') || stepFilePath.endsWith('.ts');
19
+ if (isPython) {
20
+ return { runner: pythonRunner, command: 'python' };
21
+ }
22
+ else if (isRuby) {
23
+ return { runner: rubyRunner, command: 'ruby' };
24
+ }
25
+ else if (isNode) {
26
+ return { runner: nodeRunner, command: 'node' };
27
+ }
28
+ throw Error(`Unsupported file extension ${stepFilePath}`);
29
+ };
30
+ const callStepFile = (stepPath, step, event, eventManager, state) => {
31
+ return new Promise((resolve, reject) => {
32
+ const jsonData = JSON.stringify({ ...event });
33
+ const { runner, command } = getLanguageBasedRunner(stepPath);
34
+ const child = (0, child_process_1.spawn)(command, [runner, stepPath, jsonData], {
35
+ stdio: [undefined, undefined, undefined, 'ipc'],
36
+ });
37
+ const rpcProcessor = new step_handler_rpc_processor_1.RpcProcessor(child);
38
+ rpcProcessor.handler('log', async (input) => {
39
+ event.logger.log(input);
40
+ });
41
+ rpcProcessor.handler('state.get', (input) => state.get(input.traceId, input.key));
42
+ rpcProcessor.handler('state.set', (input) => state.set(input.traceId, input.key, input.value));
43
+ rpcProcessor.handler('state.delete', (input) => state.delete(input.traceId, input.key));
44
+ rpcProcessor.handler('state.clear', (input) => state.clear(input.traceId));
45
+ rpcProcessor.handler('emit', (input) => {
46
+ return eventManager.emit({
47
+ ...input,
48
+ traceId: event.traceId,
49
+ flows: event.flows,
50
+ logger: event.logger,
51
+ }, stepPath);
52
+ });
53
+ rpcProcessor.init();
54
+ child.stdout?.on('data', (data) => {
55
+ try {
56
+ const message = JSON.parse(data.toString());
57
+ event.logger.log(message);
58
+ }
59
+ catch (error) {
60
+ event.logger.info(Buffer.from(data).toString(), { step });
61
+ }
62
+ });
63
+ child.stderr?.on('data', (data) => event.logger.error(Buffer.from(data).toString(), { step }));
64
+ child.on('close', (code) => {
65
+ if (code !== 0) {
66
+ reject(new Error(`Process exited with code ${code}`));
67
+ }
68
+ else {
69
+ resolve();
70
+ }
71
+ });
72
+ });
73
+ };
74
+ const createStepHandlers = (steps, eventManager, state) => {
75
+ logger_1.globalLogger.debug(`[step handler] creating step handlers for ${steps.length} steps`);
76
+ steps.filter(guards_1.isEventStep).forEach((step) => {
77
+ const { config, filePath } = step;
78
+ const { subscribes } = config;
79
+ logger_1.globalLogger.debug('[step handler] establishing step subscriptions', { filePath, step: step.config.name });
80
+ subscribes.forEach((subscribe) => {
81
+ eventManager.subscribe(subscribe, step.config.name, async (event) => {
82
+ const { logger, ...rest } = event;
83
+ logger_1.globalLogger.debug('[step handler] received event', { event: rest, step: step.config.name });
84
+ try {
85
+ await callStepFile(filePath, step.config.name, event, eventManager, state);
86
+ }
87
+ catch (error) {
88
+ logger_1.globalLogger.error(`[step handler] error calling step`, {
89
+ error: error.message,
90
+ filePath,
91
+ step: step.config.name,
92
+ });
93
+ }
94
+ });
95
+ });
96
+ });
97
+ };
98
+ exports.createStepHandlers = createStepHandlers;
@@ -0,0 +1,109 @@
1
+ import { z, ZodObject } from 'zod';
2
+ import { Server } from 'http';
3
+ import { Server as SocketIOServer } from 'socket.io';
4
+ import { Logger } from './logger';
5
+ export type InternalStateManager = {
6
+ get<T>(traceId: string, key: string): Promise<T | null>;
7
+ set<T>(traceId: string, key: string, value: T): Promise<void>;
8
+ delete(traceId: string, key: string): Promise<void>;
9
+ clear(traceId: string): Promise<void>;
10
+ };
11
+ export type EmitData = {
12
+ type: string;
13
+ data: Record<string, unknown>;
14
+ };
15
+ export type Emitter = (event: EmitData) => Promise<void>;
16
+ export type FlowContext = {
17
+ emit: Emitter;
18
+ traceId: string;
19
+ state: InternalStateManager;
20
+ logger: Logger;
21
+ };
22
+ export type EventHandler<TInput extends ZodObject<any>> = (input: z.infer<TInput>, ctx: FlowContext) => Promise<void>;
23
+ export type Emit = string | {
24
+ type: string;
25
+ label?: string;
26
+ conditional?: boolean;
27
+ };
28
+ export type EventConfig<TInput extends ZodObject<any>> = {
29
+ type: 'event';
30
+ name: string;
31
+ description?: string;
32
+ subscribes: string[];
33
+ emits: Emit[];
34
+ virtualEmits?: Emit[];
35
+ input: TInput;
36
+ flows: string[];
37
+ };
38
+ export type NoopConfig = {
39
+ type: 'noop';
40
+ name: string;
41
+ description?: string;
42
+ virtualEmits: Emit[];
43
+ virtualSubscribes: string[];
44
+ flows: string[];
45
+ };
46
+ export type ApiRouteMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD';
47
+ export type ApiRouteConfig = {
48
+ type: 'api';
49
+ name: string;
50
+ description?: string;
51
+ path: string;
52
+ method: ApiRouteMethod;
53
+ emits: string[];
54
+ virtualEmits?: Emit[];
55
+ virtualSubscribes?: string[];
56
+ flows: string[];
57
+ bodySchema?: ZodObject<any>;
58
+ };
59
+ export type ApiRequest = {
60
+ pathParams: Record<string, string>;
61
+ queryParams: Record<string, string | string[]>;
62
+ body: Record<string, any>;
63
+ headers: Record<string, string | string[]>;
64
+ };
65
+ export type ApiResponse = {
66
+ status: number;
67
+ headers?: Record<string, string>;
68
+ body: string | Buffer | Record<string, any>;
69
+ };
70
+ export type ApiRouteHandler = (req: ApiRequest, ctx: FlowContext) => Promise<ApiResponse>;
71
+ export type StepHandler<T> = T extends EventConfig<any> ? EventHandler<T['input']> : T extends ApiRouteConfig ? ApiRouteHandler : never;
72
+ export type MotiaServer = Server<any>;
73
+ export type MotiaSocketServer = SocketIOServer;
74
+ export type Event<TData = unknown> = {
75
+ type: string;
76
+ data: TData;
77
+ traceId: string;
78
+ flows: string[];
79
+ logger: Logger;
80
+ };
81
+ export type Handler<TData = unknown> = (event: Event<TData>) => Promise<void>;
82
+ export type EventManager = {
83
+ emit: <TData>(event: Event<TData>, file?: string) => Promise<void>;
84
+ subscribe: <TData>(event: string, handlerName: string, handler: Handler<TData>) => void;
85
+ };
86
+ export type StepConfig = EventConfig<ZodObject<any>> | NoopConfig | ApiRouteConfig;
87
+ export type Step<TConfig extends StepConfig = StepConfig> = {
88
+ filePath: string;
89
+ version: string;
90
+ config: TConfig;
91
+ };
92
+ export type Flow = {
93
+ name: string;
94
+ description?: string;
95
+ steps: Step[];
96
+ };
97
+ export type LockedData = {
98
+ baseDir: string;
99
+ steps: {
100
+ active: Step[];
101
+ dev: Step[];
102
+ };
103
+ flows: Record<string, Flow>;
104
+ state: {
105
+ adapter: string;
106
+ host: string;
107
+ port: number;
108
+ };
109
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@motiadev/core",
3
+ "main": "dist/index.js",
4
+ "version": "0.0.1",
5
+ "dependencies": {
6
+ "body-parser": "^1.20.3",
7
+ "express": "^4.21.2",
8
+ "ioredis": "^5.4.2",
9
+ "pino": "^9.6.0",
10
+ "socket.io": "^4.8.1",
11
+ "ts-node": "^10.9.2",
12
+ "yaml": "^2.7.0",
13
+ "zod": "^3.24.1",
14
+ "zod-to-json-schema": "^3.24.1"
15
+ },
16
+ "devDependencies": {
17
+ "@types/body-parser": "^1.19.5",
18
+ "@types/express": "^5.0.0",
19
+ "@types/jest": "^29.5.14",
20
+ "jest": "^29.7.0",
21
+ "ts-jest": "^29.2.5",
22
+ "typescript": "^5.7.2"
23
+ },
24
+ "scripts": {
25
+ "move:python": "cp src/python/*.py dist/src/python",
26
+ "move:rb": "cp src/ruby/*.rb dist/src/ruby",
27
+ "build": "rm -rf dist && tsc && npm run move:python && npm run move:rb",
28
+ "watch": "tsc --watch",
29
+ "test": "jest"
30
+ }
31
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "CommonJS",
5
+ "moduleResolution": "Node",
6
+ "esModuleInterop": true,
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "resolveJsonModule": true,
11
+ "allowJs": true,
12
+ "outDir": "./dist",
13
+ "rootDir": ".",
14
+ "baseUrl": ".",
15
+ "declaration": true
16
+ },
17
+ "include": ["**/*.ts", "**/*.js"],
18
+ "jsx": "react-jsx",
19
+ "exclude": ["node_modules", "dist"]
20
+ }