Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
garredow committed Apr 12, 2024
1 parent 44386df commit ed41ace
Show file tree
Hide file tree
Showing 10 changed files with 713 additions and 23 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# kaiware-lib
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{
"name": "@nothing-special/kaiware-lib",
"private": true,
"version": "0.1.0",
"version": "0.2.0",
"type": "module",
"author": {
"name": "Garrett Downs",
"url": "https://nothingspecial.io"
},
"homepage": "https://github.com/nothingspecialdev/kaiware-lib",
"repository": {
"type": "git",
"url": "https://github.com/nothingspecialdev/kaiware-lib"
},
"scripts": {
"dev": "vite",
"build": "rimraf build && rollup -c --bundleConfigAsCjs",
Expand Down
16 changes: 14 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import path from 'node:path';
/** @type {import('rollup').RollupOptions[]} */
export default [
{
input: ['src/index.ts'],
input: [
'src/index.ts',
'src/enums/index.ts',
'src/lib/index.ts',
'src/types/index.ts',
'src/utils/index.ts'
],
output: {
dir: 'build/esm',
format: 'esm',
Expand Down Expand Up @@ -51,7 +57,13 @@ export default [
]
},
{
input: ['src/index.ts'],
input: [
'src/index.ts',
'src/enums/index.ts',
'src/lib/index.ts',
'src/types/index.ts',
'src/utils/index.ts'
],
output: {
dir: 'build/cjs',
format: 'cjs',
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Kaiware } from '$/lib/kaiware';
import { Kaiware } from './lib/kaiware';

export { Kaiware };
9 changes: 3 additions & 6 deletions src/lib/connection.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { LogLevel } from '$/enums';
import { MessageType } from '$/enums/MessageType';
import { Log } from '$/types';
import { Config } from '$/types/Config';
import { Message } from '$/types/Message';
import { isJson } from '$/utils/isJson';
import { z } from 'zod';
import { LogLevel, MessageType } from '../enums';
import { Config, Log, Message } from '../types';
import { isJson } from '../utils';

export class Connection {
private socket: WebSocket | null = null;
Expand Down
8 changes: 3 additions & 5 deletions src/lib/kaiware.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { LogLevel } from '$/enums/LogLevel';
import { MessageType } from '$/enums/MessageType';
import { Connection } from '$/lib/connection';
import { Config } from '$/types/Config';
import { Log } from '$/types/Log';
import { LogLevel, MessageType } from '../enums';
import { Config, Log } from '../types';
import { Connection } from './connection';

export class Kaiware {
private static config: Config | null = null;
Expand Down
2 changes: 1 addition & 1 deletion src/types/Log.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogLevel } from '$/enums/LogLevel';
import { LogLevel } from '../enums';

export type Log = {
id: number;
Expand Down
2 changes: 1 addition & 1 deletion src/types/Message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageType } from '$/enums/MessageType';
import { MessageType } from '../enums';

export type Message<TData = undefined> = {
type: MessageType;
Expand Down
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"compilerOptions": {
"target": "ES6",
"module": "ES2015",
"baseUrl": ".",
"paths": {
"$": ["./src"],
"$/*": ["./src/*"]
},
// "baseUrl": ".",
// "paths": {
// "$": ["./src"],
// "$/*": ["./src/*"]
// },
"strict": true,
"strictNullChecks": true,
"noUnusedParameters": true,
Expand Down

0 comments on commit ed41ace

Please sign in to comment.