@intrig/next 0.0.8 → 0.0.10

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.
@@ -1,5 +1,4 @@
1
1
  import { ZodError } from 'zod';
2
-
3
2
  /**
4
3
  * State of an asynchronous call. Network state follows the state diagram given below.
5
4
  *
@@ -24,46 +23,33 @@ import { ZodError } from 'zod';
24
23
  * </pre>
25
24
  */
26
25
  export interface NetworkState<T = unknown, E = unknown> {
27
- state: 'init' | 'pending' | 'success' | 'error';
26
+ state: 'init' | 'pending' | 'success' | 'error';
28
27
  }
29
-
30
28
  /**
31
29
  * Network call is not yet started
32
30
  */
33
31
  export interface InitState<T, E = unknown> extends NetworkState<T, E> {
34
- state: 'init';
32
+ state: 'init';
35
33
  }
36
-
37
34
  /**
38
35
  * Checks whether the state is init state
39
36
  * @param state
40
37
  */
41
- export function isInit<T, E = unknown>(
42
- state: NetworkState<T, E>,
43
- ): state is InitState<T, E> {
44
- return state.state === 'init';
45
- }
46
-
38
+ export declare function isInit<T, E = unknown>(state: NetworkState<T, E>): state is InitState<T, E>;
47
39
  /**
48
40
  * Initializes a new state.
49
41
  *
50
42
  * @template T The type of the state.
51
43
  * @return {InitState<T>} An object representing the initial state.
52
44
  */
53
- export function init<T, E = unknown>(): InitState<T, E> {
54
- return {
55
- state: 'init',
56
- };
57
- }
58
-
45
+ export declare function init<T, E = unknown>(): InitState<T, E>;
59
46
  /**
60
47
  * Network call is not yet completed
61
48
  */
62
49
  export interface PendingState<T, E = unknown> extends NetworkState<T, E> {
63
- state: 'pending';
64
- progress?: Progress;
50
+ state: 'pending';
51
+ progress?: Progress;
65
52
  }
66
-
67
53
  /**
68
54
  * Interface representing progress information for an upload or download operation.
69
55
  *
@@ -76,86 +62,54 @@ export interface PendingState<T, E = unknown> extends NetworkState<T, E> {
76
62
  * @property {number} [total] - The total amount of data to be loaded (if known).
77
63
  */
78
64
  export interface Progress {
79
- type?: 'upload' | 'download';
80
- loaded: number;
81
- total?: number;
65
+ type?: 'upload' | 'download';
66
+ loaded: number;
67
+ total?: number;
82
68
  }
83
-
84
69
  /**
85
70
  * Checks whether the state is pending state
86
71
  * @param state
87
72
  */
88
- export function isPending<T, E = unknown>(
89
- state: NetworkState<T, E>,
90
- ): state is PendingState<T, E> {
91
- return state.state === 'pending';
92
- }
93
-
73
+ export declare function isPending<T, E = unknown>(state: NetworkState<T, E>): state is PendingState<T, E>;
94
74
  /**
95
75
  * Generates a PendingState object with a state of "pending".
96
76
  *
97
77
  * @return {PendingState<T>} An object representing the pending state.
98
78
  */
99
- export function pending<T, E = unknown>(
100
- progress: Progress | undefined = undefined,
101
- ): PendingState<T, E> {
102
- return {
103
- state: 'pending',
104
- progress,
105
- };
106
- }
107
-
79
+ export declare function pending<T, E = unknown>(progress?: Progress | undefined): PendingState<T, E>;
108
80
  /**
109
81
  * Network call is completed with success state
110
82
  */
111
83
  export interface SuccessState<T, E = unknown> extends NetworkState<T, E> {
112
- state: 'success';
113
- data: T;
84
+ state: 'success';
85
+ data: T;
114
86
  }
115
-
116
87
  /**
117
88
  * Checks whether the state is success response
118
89
  * @param state
119
90
  */
120
- export function isSuccess<T, E = unknown>(
121
- state: NetworkState<T, E>,
122
- ): state is SuccessState<T, E> {
123
- return state.state === 'success';
124
- }
125
-
91
+ export declare function isSuccess<T, E = unknown>(state: NetworkState<T, E>): state is SuccessState<T, E>;
126
92
  /**
127
93
  * Creates a success state object with the provided data.
128
94
  *
129
95
  * @param {T} data - The data to be included in the success state.
130
96
  * @return {SuccessState<T>} An object representing a success state containing the provided data.
131
97
  */
132
- export function success<T, E = unknown>(data: T): SuccessState<T, E> {
133
- return {
134
- state: 'success',
135
- data,
136
- };
137
- }
138
-
98
+ export declare function success<T, E = unknown>(data: T): SuccessState<T, E>;
139
99
  /**
140
100
  * Network call is completed with error response
141
101
  */
142
102
  export interface ErrorState<T, E = unknown> extends NetworkState<T, E> {
143
- state: 'error';
144
- error: E;
145
- statusCode?: number;
146
- request?: any;
103
+ state: 'error';
104
+ error: E;
105
+ statusCode?: number;
106
+ request?: any;
147
107
  }
148
-
149
108
  /**
150
109
  * Checks whether the state is error state
151
110
  * @param state
152
111
  */
153
- export function isError<T, E = unknown>(
154
- state: NetworkState<T, E>,
155
- ): state is ErrorState<T, E> {
156
- return state.state === 'error';
157
- }
158
-
112
+ export declare function isError<T, E = unknown>(state: NetworkState<T, E>): state is ErrorState<T, E>;
159
113
  /**
160
114
  * Constructs an ErrorState object representing an error.
161
115
  *
@@ -163,19 +117,7 @@ export function isError<T, E = unknown>(
163
117
  * @param {string} [statusCode] - An optional status code associated with the error.
164
118
  * @return {ErrorState<T>} An object representing the error state.
165
119
  */
166
- export function error<T, E = unknown>(
167
- error: E,
168
- statusCode?: number,
169
- request?: any,
170
- ): ErrorState<T> {
171
- return {
172
- state: 'error',
173
- error,
174
- statusCode,
175
- request,
176
- };
177
- }
178
-
120
+ export declare function error<T, E = unknown>(error: E, statusCode?: number, request?: any): ErrorState<T>;
179
121
  /**
180
122
  * Represents an error state with additional contextual information.
181
123
  *
@@ -187,13 +129,11 @@ export function error<T, E = unknown>(
187
129
  * @property {string} operation - The operation being performed when the error occurred.
188
130
  * @property {string} key - A unique key identifying the specific error instance.
189
131
  */
190
- export interface ErrorWithContext<T = unknown, E = unknown>
191
- extends ErrorState<T, E> {
192
- source: string;
193
- operation: string;
194
- key: string;
132
+ export interface ErrorWithContext<T = unknown, E = unknown> extends ErrorState<T, E> {
133
+ source: string;
134
+ operation: string;
135
+ key: string;
195
136
  }
196
-
197
137
  /**
198
138
  * Represents an action in the network context.
199
139
  *
@@ -203,97 +143,74 @@ export interface ErrorWithContext<T = unknown, E = unknown>
203
143
  * @property {string} key - The unique identifier for the network action
204
144
  */
205
145
  export interface NetworkAction<T, E> {
206
- key: string;
207
- source: string;
208
- operation: string;
209
- state: NetworkState<T, E>;
210
- handled?: boolean;
146
+ key: string;
147
+ source: string;
148
+ operation: string;
149
+ state: NetworkState<T, E>;
150
+ handled?: boolean;
211
151
  }
212
-
213
152
  type HookWithKey = {
214
- key: string;
153
+ key: string;
154
+ };
155
+ export type UnitHookOptions = {
156
+ key?: string;
157
+ fetchOnMount?: false;
158
+ clearOnUnmount?: boolean;
159
+ } | {
160
+ key?: string;
161
+ fetchOnMount: true;
162
+ params?: Record<string, any>;
163
+ clearOnUnmount?: boolean;
164
+ };
165
+ export type UnitHook<E = unknown> = ((options: UnitHookOptions) => [
166
+ NetworkState<never, E>,
167
+ (params?: Record<string, any>) => DispatchState<any>,
168
+ () => void
169
+ ]) & HookWithKey;
170
+ export type ConstantHook<T, E = unknown> = ((options: UnitHookOptions) => [
171
+ NetworkState<T, E>,
172
+ (params?: Record<string, any>) => DispatchState<any>,
173
+ () => void
174
+ ]) & HookWithKey;
175
+ export type UnaryHookOptions<P> = {
176
+ key?: string;
177
+ fetchOnMount?: false;
178
+ clearOnUnmount?: boolean;
179
+ } | {
180
+ key?: string;
181
+ fetchOnMount: true;
182
+ params: P;
183
+ clearOnUnmount?: boolean;
184
+ };
185
+ export type UnaryProduceHook<P, E = unknown> = ((options?: UnaryHookOptions<P>) => [NetworkState<never, E>, (params: P) => DispatchState<any>, () => void]) & HookWithKey;
186
+ export type UnaryFunctionHook<P, T, E = unknown> = ((options?: UnaryHookOptions<P>) => [NetworkState<T, E>, (params: P) => DispatchState<any>, () => void]) & HookWithKey;
187
+ export type BinaryHookOptions<P, B> = {
188
+ key?: string;
189
+ fetchOnMount?: false;
190
+ clearOnUnmount?: boolean;
191
+ } | {
192
+ key?: string;
193
+ fetchOnMount: true;
194
+ params: P;
195
+ body: B;
196
+ clearOnUnmount?: boolean;
215
197
  };
216
-
217
- export type UnitHookOptions =
218
- | { key?: string; fetchOnMount?: false; clearOnUnmount?: boolean }
219
- | {
220
- key?: string;
221
- fetchOnMount: true;
222
- params?: Record<string, any>;
223
- clearOnUnmount?: boolean;
224
- };
225
- export type UnitHook<E = unknown> = ((
226
- options: UnitHookOptions,
227
- ) => [
228
- NetworkState<never, E>,
229
- (params?: Record<string, any>) => DispatchState<any>,
230
- () => void,
231
- ]) &
232
- HookWithKey;
233
- export type ConstantHook<T, E = unknown> = ((
234
- options: UnitHookOptions,
235
- ) => [
236
- NetworkState<T, E>,
237
- (params?: Record<string, any>) => DispatchState<any>,
238
- () => void,
239
- ]) &
240
- HookWithKey;
241
-
242
- export type UnaryHookOptions<P> =
243
- | { key?: string; fetchOnMount?: false; clearOnUnmount?: boolean }
244
- | { key?: string; fetchOnMount: true; params: P; clearOnUnmount?: boolean };
245
- export type UnaryProduceHook<P, E = unknown> = ((
246
- options?: UnaryHookOptions<P>,
247
- ) => [NetworkState<never, E>, (params: P) => DispatchState<any>, () => void]) &
248
- HookWithKey;
249
- export type UnaryFunctionHook<P, T, E = unknown> = ((
250
- options?: UnaryHookOptions<P>,
251
- ) => [NetworkState<T, E>, (params: P) => DispatchState<any>, () => void]) &
252
- HookWithKey;
253
-
254
- export type BinaryHookOptions<P, B> =
255
- | { key?: string; fetchOnMount?: false; clearOnUnmount?: boolean }
256
- | {
257
- key?: string;
258
- fetchOnMount: true;
259
- params: P;
260
- body: B;
261
- clearOnUnmount?: boolean;
262
- };
263
- export type BinaryProduceHook<P, B, E = unknown> = ((
264
- options?: BinaryHookOptions<P, B>,
265
- ) => [
266
- NetworkState<never, E>,
267
- (body: B, params: P) => DispatchState<any>,
268
- () => void,
269
- ]) &
270
- HookWithKey;
271
- export type BinaryFunctionHook<P, B, T, E = unknown> = ((
272
- options?: BinaryHookOptions<P, B>,
273
- ) => [
274
- NetworkState<T, E>,
275
- (body: B, params: P) => DispatchState<any>,
276
- () => void,
277
- ]) &
278
- HookWithKey;
279
-
280
- export type IntrigHookOptions<P = undefined, B = undefined> =
281
- | UnitHookOptions
282
- | UnaryHookOptions<P>
283
- | BinaryHookOptions<P, B>;
284
- export type IntrigHook<P = undefined, B = undefined, T = any, E = unknown> =
285
- | UnitHook<E>
286
- | ConstantHook<T, E>
287
- | UnaryProduceHook<P, E>
288
- | UnaryFunctionHook<P, T, E>
289
- | BinaryProduceHook<P, B, E>
290
- | BinaryFunctionHook<P, B, T, E>;
291
-
198
+ export type BinaryProduceHook<P, B, E = unknown> = ((options?: BinaryHookOptions<P, B>) => [
199
+ NetworkState<never, E>,
200
+ (body: B, params: P) => DispatchState<any>,
201
+ () => void
202
+ ]) & HookWithKey;
203
+ export type BinaryFunctionHook<P, B, T, E = unknown> = ((options?: BinaryHookOptions<P, B>) => [
204
+ NetworkState<T, E>,
205
+ (body: B, params: P) => DispatchState<any>,
206
+ () => void
207
+ ]) & HookWithKey;
208
+ export type IntrigHookOptions<P = undefined, B = undefined> = UnitHookOptions | UnaryHookOptions<P> | BinaryHookOptions<P, B>;
209
+ export type IntrigHook<P = undefined, B = undefined, T = any, E = unknown> = UnitHook<E> | ConstantHook<T, E> | UnaryProduceHook<P, E> | UnaryFunctionHook<P, T, E> | BinaryProduceHook<P, B, E> | BinaryFunctionHook<P, B, T, E>;
292
210
  export interface AsyncRequestOptions {
293
- hydrate?: boolean;
294
- key?: string;
211
+ hydrate?: boolean;
212
+ key?: string;
295
213
  }
296
-
297
214
  /**
298
215
  * Represents the dispatch state of a process.
299
216
  *
@@ -303,9 +220,8 @@ export interface AsyncRequestOptions {
303
220
  * @property {string} state The current state of the dispatch process.
304
221
  */
305
222
  export interface DispatchState<T> {
306
- state: string;
223
+ state: string;
307
224
  }
308
-
309
225
  /**
310
226
  * Represents a successful dispatch state.
311
227
  *
@@ -316,32 +232,21 @@ export interface DispatchState<T> {
316
232
  * @property {string} state - The state of the dispatch, always 'success'.
317
233
  */
318
234
  export interface SuccessfulDispatch<T> extends DispatchState<T> {
319
- state: 'success';
235
+ state: 'success';
320
236
  }
321
-
322
237
  /**
323
238
  * Indicates a successful dispatch state.
324
239
  *
325
240
  * @return {DispatchState<T>} An object representing a successful state.
326
241
  */
327
- export function successfulDispatch<T>(): DispatchState<T> {
328
- return {
329
- state: 'success',
330
- };
331
- }
332
-
242
+ export declare function successfulDispatch<T>(): DispatchState<T>;
333
243
  /**
334
244
  * Determines if the provided dispatch state represents a successful dispatch.
335
245
  *
336
246
  * @param {DispatchState<T>} value - The dispatch state to check.
337
247
  * @return {value is SuccessfulDispatch<T>} - True if the dispatch state indicates success, false otherwise.
338
248
  */
339
- export function isSuccessfulDispatch<T>(
340
- value: DispatchState<T>,
341
- ): value is SuccessfulDispatch<T> {
342
- return value.state === 'success';
343
- }
344
-
249
+ export declare function isSuccessfulDispatch<T>(value: DispatchState<T>): value is SuccessfulDispatch<T>;
345
250
  /**
346
251
  * ValidationError interface represents a specific type of dispatch state
347
252
  * where a validation error has occurred.
@@ -349,35 +254,23 @@ export function isSuccessfulDispatch<T>(
349
254
  * @typeparam T - The type of the data associated with this dispatch state.
350
255
  */
351
256
  export interface ValidationError<T> extends DispatchState<T> {
352
- state: 'validation-error';
353
- error: any;
257
+ state: 'validation-error';
258
+ error: any;
354
259
  }
355
-
356
260
  /**
357
261
  * Generates a ValidationError object.
358
262
  *
359
263
  * @param error The error details that caused the validation to fail.
360
264
  * @return The ValidationError object containing the error state and details.
361
265
  */
362
- export function validationError<T>(error: any): ValidationError<T> {
363
- return {
364
- state: 'validation-error',
365
- error,
366
- };
367
- }
368
-
266
+ export declare function validationError<T>(error: any): ValidationError<T>;
369
267
  /**
370
268
  * Determines if a provided DispatchState object is a ValidationError.
371
269
  *
372
270
  * @param {DispatchState<T>} value - The DispatchState object to evaluate.
373
271
  * @return {boolean} - Returns true if the provided DispatchState object is a ValidationError, otherwise returns false.
374
272
  */
375
- export function isValidationError<T>(
376
- value: DispatchState<T>,
377
- ): value is ValidationError<T> {
378
- return value.state === 'validation-error';
379
- }
380
-
273
+ export declare function isValidationError<T>(value: DispatchState<T>): value is ValidationError<T>;
381
274
  /**
382
275
  * Represents an error structure with a specified type and associated data.
383
276
  *
@@ -387,9 +280,8 @@ export function isValidationError<T>(
387
280
  * @property {string} type - A string representing the type of the error.
388
281
  */
389
282
  export interface IntrigError<T, E> {
390
- type: string;
283
+ type: string;
391
284
  }
392
-
393
285
  /**
394
286
  * Represents an error encountered during a network operation.
395
287
  * Extends from the `IntrigError` interface, adding network-specific properties.
@@ -403,12 +295,11 @@ export interface IntrigError<T, E> {
403
295
  * @property {any} request - The request object that was attempted when the network error occurred, providing context for what operation failed.
404
296
  */
405
297
  export interface NetworkError<T, E = unknown> extends IntrigError<T, E> {
406
- type: 'network';
407
- statusCode: string;
408
- error: E;
409
- request: any;
298
+ type: 'network';
299
+ statusCode: string;
300
+ error: E;
301
+ request: any;
410
302
  }
411
-
412
303
  /**
413
304
  * Constructs a network error object.
414
305
  *
@@ -417,31 +308,14 @@ export interface NetworkError<T, E = unknown> extends IntrigError<T, E> {
417
308
  * @param request The request object associated with the network operation.
418
309
  * @return A NetworkError object containing the error type, status code, error details, and the original request.
419
310
  */
420
- export function networkError<T, E>(
421
- error: E,
422
- statusCode: string,
423
- request: any,
424
- ): NetworkError<T, E> {
425
- return {
426
- type: 'network',
427
- statusCode,
428
- error,
429
- request,
430
- };
431
- }
432
-
311
+ export declare function networkError<T, E>(error: E, statusCode: string, request: any): NetworkError<T, E>;
433
312
  /**
434
313
  * Determines if the provided IntrigError is of type 'network'.
435
314
  *
436
315
  * @param {IntrigError<T, E>} value - The error value to check the type of.
437
316
  * @return {boolean} - Returns true if the error is of type 'network', otherwise false.
438
317
  */
439
- export function isNetworkError<T, E>(
440
- value: IntrigError<T, E>,
441
- ): value is NetworkError<T, E> {
442
- return value.type === 'network';
443
- }
444
-
318
+ export declare function isNetworkError<T, E>(value: IntrigError<T, E>): value is NetworkError<T, E>;
445
319
  /**
446
320
  * Interface representing a request validation error.
447
321
  *
@@ -456,39 +330,24 @@ export function isNetworkError<T, E>(
456
330
  * @property {string} type - A string literal indicating the error type as 'request-validation'.
457
331
  * @property {ZodError} error - An instance of ZodError containing detailed validation error information.
458
332
  */
459
- export interface RequestValidationError<T, E = unknown>
460
- extends IntrigError<T, E> {
461
- type: 'request-validation';
462
- error: ZodError;
333
+ export interface RequestValidationError<T, E = unknown> extends IntrigError<T, E> {
334
+ type: 'request-validation';
335
+ error: ZodError;
463
336
  }
464
-
465
337
  /**
466
338
  * Constructs a RequestValidationError object encapsulating the ZodError.
467
339
  *
468
340
  * @param {ZodError} error - The error object resulting from Zod schema validation.
469
341
  * @return {RequestValidationError<T, E>} A RequestValidationError object containing the validation error information.
470
342
  */
471
- export function requestValidationError<T, E>(
472
- error: ZodError,
473
- ): RequestValidationError<T, E> {
474
- return {
475
- type: 'request-validation',
476
- error,
477
- };
478
- }
479
-
343
+ export declare function requestValidationError<T, E>(error: ZodError): RequestValidationError<T, E>;
480
344
  /**
481
345
  * Determines if a given error is of type RequestValidationError.
482
346
  *
483
347
  * @param value The error object to check, which implements the IntrigError interface.
484
348
  * @return A boolean indicating whether the error is a RequestValidationError.
485
349
  */
486
- export function isRequestValidationError<T, E>(
487
- value: IntrigError<T, E>,
488
- ): value is RequestValidationError<T, E> {
489
- return value.type === 'request-validation';
490
- }
491
-
350
+ export declare function isRequestValidationError<T, E>(value: IntrigError<T, E>): value is RequestValidationError<T, E>;
492
351
  /**
493
352
  * ResponseValidationError interface is designed to extend the capabilities of the IntrigError interface,
494
353
  * specifically for handling errors related to response validation.
@@ -501,35 +360,23 @@ export function isRequestValidationError<T, E>(
501
360
  * @property type - A string literal that identifies the type of error as 'response-validation'.
502
361
  * @property error - An instance of ZodError representing the validation error encountered.
503
362
  */
504
- export interface ResponseValidationError<T, E = unknown>
505
- extends IntrigError<T, E> {
506
- type: 'response-validation';
507
- error: ZodError;
363
+ export interface ResponseValidationError<T, E = unknown> extends IntrigError<T, E> {
364
+ type: 'response-validation';
365
+ error: ZodError;
508
366
  }
509
-
510
367
  /**
511
368
  * Constructs a ResponseValidationError object with a specified error.
512
369
  *
513
370
  * @param {ZodError} error - The validation error encountered during response validation.
514
371
  * @return {ResponseValidationError<T, E>} An error object containing the type of error and the validation error details.
515
372
  */
516
- export function responseValidationError<T, E>(
517
- error: ZodError,
518
- ): ResponseValidationError<T, E> {
519
- return {
520
- type: 'response-validation',
521
- error,
522
- };
523
- }
524
-
373
+ export declare function responseValidationError<T, E>(error: ZodError): ResponseValidationError<T, E>;
525
374
  /**
526
375
  * Determines if the given error is a response validation error.
527
376
  *
528
377
  * @param {IntrigError<T, E>} value - The error object to assess.
529
378
  * @return {boolean} True if the error is a response validation error, otherwise false.
530
379
  */
531
- export function isResponseValidationError<T, E>(
532
- value: IntrigError<T, E>,
533
- ): value is ResponseValidationError<T, E> {
534
- return value.type === 'response-validation';
535
- }
380
+ export declare function isResponseValidationError<T, E>(value: IntrigError<T, E>): value is ResponseValidationError<T, E>;
381
+ export {};
382
+ //# sourceMappingURL=network-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-state.d.ts","sourceRoot":"","sources":["../../../lib/src/network-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IACpD,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAE,SAAQ,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC;IACnE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EACnC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GACxB,KAAK,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAE1B;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAItD;AAED;;GAE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"usage"
8
- }
9
- ]
10
- ],
11
- "plugins": []
12
- }
package/project.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "name": "@intrig/next",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "lib/next-client/src",
5
- "projectType": "library",
6
- "tags": [],
7
- "// targets": "to see all targets run: nx show project @intrig/next --web",
8
- "targets": {},
9
- "nx-release-publish": {
10
- "executor": "@nx/js:release-publish",
11
- "options": {
12
- "packageRoot": "dist/lib/next-client"
13
- }
14
- }
15
- }
package/rollup.config.cjs DELETED
@@ -1,31 +0,0 @@
1
- const { withNx } = require('@nx/rollup/with-nx');
2
- const url = require('@rollup/plugin-url');
3
- const svg = require('@svgr/rollup');
4
-
5
- module.exports = withNx(
6
- {
7
- main: './src/index.ts',
8
- outputPath: '../../dist/lib/next-client',
9
- tsConfig: './tsconfig.lib.json',
10
- compiler: 'babel',
11
- external: ['react', 'react-dom', 'react/jsx-runtime'],
12
- format: ['esm'],
13
- assets: [
14
- { input: 'lib/next-client', output: '.', glob: 'README.md' },
15
- { input: 'lib/next-client', output: '.', glob: 'package.json' }
16
- ],
17
- },
18
- {
19
- // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
20
- plugins: [
21
- svg({
22
- svgo: false,
23
- titleProp: true,
24
- ref: true,
25
- }),
26
- url({
27
- limit: 10000, // 10kB
28
- }),
29
- ],
30
- },
31
- );