Skip to content

Commit 165e8ee

Browse files
authored
Merge pull request #5 from windingtree/develop
refactor: πŸ’‘ Updated build system
2 parents 437787d + 2d3f7ee commit 165e8ee

File tree

11 files changed

+45
-45
lines changed

11 files changed

+45
-45
lines changed

β€Žexamples/client/package.jsonβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"eslint-plugin-react-refresh": "^0.3.4",
1717
"react": "^18.2.0",
1818
"react-dom": "^18.2.0",
19-
"typescript": "^4.9.3",
19+
"typescript": "^5.0.3",
2020
"vite": "^4.1.0",
2121
"zod": "^3.21.4",
22-
"@windingtree/sdk": "^0.1.0-beta.3"
22+
"@windingtree/sdk": "latest"
2323
},
2424
"eslintConfig": {
2525
"extends": [

β€Žexamples/client/src/App.tsxβ€Ž

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import {
77
contractConfig,
88
serverAddress,
99
} from '../../shared/types.js';
10-
import { isExpired } from '../../../src/utils/time.js';
1110
import { RequestRecord } from '../../../src/client/requestsRegistry.js';
12-
import { createClient, Client } from '../../../src/client/index.js';
13-
import { ClientOptions, storage } from '@windingtree/sdk';
14-
// import { isExpired } from '@windingtree/sdk/utils';
11+
import { Client, createClient } from '../../../src/client/index.js';
12+
import { ClientOptions, storage, utils } from '../../../src/index.js';
13+
// import { Client, ClientOptions, RequestRecord, createClient, storage } from '@windingtree/sdk';
1514

1615
/** Default request expiration time */
1716
const defaultExpire = '30s';
@@ -114,10 +113,10 @@ export const Requests = ({ requests, subscribed, onClear, onCancel }: RequestsPr
114113
<td>{r.data.id}</td>
115114
<td>{JSON.stringify(r.data.query)}</td>
116115
<td>{subscribed && subscribed(r.data.id) ? 'βœ…' : 'no'}</td>
117-
<td>{isExpired(r.data.expire) || r.cancelled ? 'βœ…' : 'no'}</td>
116+
<td>{utils.isExpired(r.data.expire) || r.cancelled ? 'βœ…' : 'no'}</td>
118117
<td>{r.offers.length}</td>
119118
<td>
120-
{!r.cancelled && !isExpired(r.data.expire) ? (
119+
{!r.cancelled && !utils.isExpired(r.data.expire) ? (
121120
<button
122121
onClick={() => {
123122
onCancel(r.data.id);

β€Žexamples/client/tsconfig.jsonβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
"strict": true,
1111
"forceConsistentCasingInFileNames": true,
1212
"module": "ESNext",
13-
"moduleResolution": "Node",
13+
"moduleResolution": "NodeNext",
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
1616
"noEmit": true,
17+
"noErrorTruncation": true,
1718
"jsx": "react-jsx"
1819
},
1920
"include": ["src"],

β€Žexamples/client/yarn.lockβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@
21772177
magic-string "^0.27.0"
21782178
react-refresh "^0.14.0"
21792179

2180-
"@windingtree/sdk@^0.1.0-beta.3":
2180+
"@windingtree/sdk@latest":
21812181
version "0.1.0-beta.3"
21822182
resolved "https://registry.yarnpkg.com/@windingtree/sdk/-/sdk-0.1.0-beta.3.tgz#02678fea232da12f493fa3057cba089b2612c55a"
21832183
integrity sha512-9PEjlopjizfkfWSRAT5VTY5I3eCTIipTF59p3vHd/CUjRHGnziFYUPUKSlD8rQ8fpBtrwvFC5Iivo2c6OY1FYQ==
@@ -4514,10 +4514,10 @@ typed-array-length@^1.0.4:
45144514
for-each "^0.3.3"
45154515
is-typed-array "^1.1.9"
45164516

4517-
typescript@^4.9.3:
4518-
version "4.9.5"
4519-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
4520-
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
4517+
typescript@^5.0.3:
4518+
version "5.0.3"
4519+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf"
4520+
integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==
45214521

45224522
uint8-varint@^1.0.1, uint8-varint@^1.0.2, uint8-varint@^1.0.6:
45234523
version "1.0.6"

β€Žpackage.jsonβ€Ž

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,29 @@
2525
"type": "module",
2626
"exports": {
2727
".": {
28-
"types": "./lib/cjs/types/index.d.ts",
29-
"import": "./lib/esm/index.mjs",
30-
"require": "./lib/cjs/index.js"
28+
"import": "./lib/index.js"
3129
},
3230
"./utils": {
33-
"types": "./lib/cjs/types/utils/index.d.ts",
34-
"import": "./lib/esm/utils/index.js",
35-
"require": "./lib/cjs/utils/index.js"
31+
"import": "./lib/utils/index.js"
3632
}
3733
},
38-
"types": "./lib/cjs/types/index.d.ts",
39-
"main": "./lib/cjs/index.js",
34+
"typesVersions": {
35+
"*": {
36+
"*": [
37+
"lib/types/*",
38+
"lib/types/utils/*"
39+
]
40+
}
41+
},
42+
"types": "./lib/types/index.d.ts",
43+
"main": "./lib/index.js",
4044
"files": [
41-
"lib/**/*"
45+
"lib/**/*",
46+
"!**/*.tsbuildinfo"
4247
],
4348
"scripts": {
4449
"clean": "rm -rf ./lib",
45-
"build": "npm run clean && npm run build:esm && npm run build:cjs",
46-
"build:esm": "tsc -p ./tsconfig.esm.json && mv lib/esm/index.js lib/esm/index.mjs",
47-
"build:cjs": "tsc -p ./tsconfig.cjs.json",
50+
"build": "npm run clean && tsc -p ./tsconfig.build.json",
4851
"test": "mocha -t 60000 --extension spec.ts",
4952
"semantic-release": "semantic-release",
5053
"prepack": "npm run build",

β€Žsrc/index.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * as constants from './constants.js';
22
export * as storage from './storage/index.js';
3+
export * as utils from './utils/index.js';
34
export * from './server/index.js';
45
export * from './client/index.js';
56
export * from './node/index.js';

β€Žsrc/storage/local.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export class LocalStorage extends Storage {
9696
if (value !== null) {
9797
return this.deserialize<ValueType>(value);
9898
}
99+
return;
99100
}
100101

101102
/**

β€Žtest/shared.queue.spec.tsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ describe('Shared.Queue', () => {
155155
if (job.state.attempts >= counter) {
156156
return true;
157157
}
158+
159+
return;
158160
};
159161

160162
queue.addJobHandler(name, handler);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "./lib/esm",
5-
"declarationDir": "./lib/esm/types"
4+
"outDir": "./lib",
5+
"declarationDir": "./lib/types"
66
},
77
"exclude": ["./examples", "./test"]
88
}

β€Žtsconfig.cjs.jsonβ€Ž

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
Β (0)