Skip to content

Commit f7c0822

Browse files
authored
fix: Don't inline normalizr into cjs (#1038)
1 parent 9c80a80 commit f7c0822

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

packages/experimental/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
]
2626
}
2727
},
28+
"engines": {
29+
"node": "^12.17 || ^13.7 || >=14"
30+
},
2831
"files": [
2932
"src",
3033
"dist",

packages/experimental/rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const nativeExtensions = ['.native.ts', ...extensions];
1717
process.env.NODE_ENV = 'production';
1818
process.env.BROWSERSLIST_ENV = 'legacy';
1919
process.env.ROOT_PATH_PREFIX = '@rest-hooks/experimental';
20+
process.env.BROWSERSLIST_ENV = 'node12';
2021

2122
function isExternal(id) {
2223
return dependencies.some(dep => dep === id || id.startsWith(dep));

packages/experimental/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export { default as useFetcher } from './useFetcher';
22
export { default as createFetch } from './createFetch';
33
export { default as Resource } from './rest/Resource';
44
export { default as BaseResource } from './rest/BaseResource';
5-
import { schema, Entity } from '@rest-hooks/normalizr';
5+
import { schema, Entity } from '@rest-hooks/endpoint';
66
const Delete = schema.Delete;
77
export { Delete, Entity };
88
export * from './rest/types';

packages/experimental/src/rest/BaseResource.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Endpoint } from '@rest-hooks/endpoint';
2-
import type { EndpointExtraOptions } from '@rest-hooks/endpoint';
3-
import type { Schema } from '@rest-hooks/normalizr';
2+
import type { EndpointExtraOptions, Schema } from '@rest-hooks/endpoint';
43
import { EntityRecord } from '@rest-hooks/rest';
54

65
import paramsToString from './paramsToString';

packages/experimental/src/rest/Resource.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import type { SchemaDetail, SchemaList } from '@rest-hooks/endpoint';
2-
import type { AbstractInstanceType } from '@rest-hooks/normalizr';
3-
import { schema } from '@rest-hooks/normalizr';
1+
import type {
2+
SchemaDetail,
3+
SchemaList,
4+
AbstractInstanceType,
5+
} from '@rest-hooks/endpoint';
6+
import { schema } from '@rest-hooks/endpoint';
47

58
import getArrayPath from './getArrayPath';
69
import BaseResource from './BaseResource';

packages/experimental/src/rest/getArrayPath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Schema, schema } from '@rest-hooks/normalizr';
1+
import { Schema, schema } from '@rest-hooks/endpoint';
22

33
export default function getArrayPath(s: Schema | undefined): string[] | false {
44
if (s === undefined || s instanceof schema.Array || Array.isArray(s)) {

packages/experimental/src/rest/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { Schema } from '@rest-hooks/normalizr';
2-
import { EndpointInstance, FetchFunction } from '@rest-hooks/endpoint';
1+
import type {
2+
EndpointInstance,
3+
FetchFunction,
4+
Schema,
5+
} from '@rest-hooks/endpoint';
36

47
export type RestFetch<P = any, B = any, R = any> = (
58
this: RestEndpoint,

0 commit comments

Comments
 (0)