@modern-js/utils 2.34.0 → 2.35.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/dist/cjs/cli/alias.js +3 -3
  2. package/dist/cjs/cli/constants/chainId.js +3 -3
  3. package/dist/cjs/cli/is/config.js +9 -11
  4. package/dist/cjs/cli/logger.js +6 -1
  5. package/dist/cjs/cli/port.js +1 -1
  6. package/dist/cjs/cli/prettyInstructions.js +2 -5
  7. package/dist/cjs/cli/require.js +1 -2
  8. package/dist/cjs/universal/formatWebpack.js +3 -3
  9. package/dist/compiled/gradient-string/index.d.ts +1 -0
  10. package/dist/compiled/gradient-string/index.js +1 -0
  11. package/dist/compiled/gradient-string/license +21 -0
  12. package/dist/compiled/gradient-string/package.json +1 -0
  13. package/dist/esm/cli/alias.js +3 -3
  14. package/dist/esm/cli/constants/chainId.js +3 -3
  15. package/dist/esm/cli/is/config.js +9 -11
  16. package/dist/esm/cli/logger.js +6 -1
  17. package/dist/esm/cli/port.js +1 -1
  18. package/dist/esm/cli/prettyInstructions.js +2 -3
  19. package/dist/esm/cli/require.js +1 -2
  20. package/dist/esm/universal/formatWebpack.js +3 -3
  21. package/dist/esm-node/cli/alias.js +3 -3
  22. package/dist/esm-node/cli/constants/chainId.js +3 -3
  23. package/dist/esm-node/cli/is/config.js +9 -11
  24. package/dist/esm-node/cli/logger.js +6 -1
  25. package/dist/esm-node/cli/port.js +1 -1
  26. package/dist/esm-node/cli/prettyInstructions.js +2 -5
  27. package/dist/esm-node/cli/require.js +1 -2
  28. package/dist/esm-node/universal/formatWebpack.js +3 -3
  29. package/dist/types/cli/constants/chainId.d.ts +2 -2
  30. package/dist/types/cli/logger.d.ts +5 -0
  31. package/package.json +8 -75
  32. package/dist/cjs/runtime/nestedRoutes.js +0 -149
  33. package/dist/cjs/runtime/remixRouter.js +0 -6
  34. package/dist/cjs/runtime/router.js +0 -6
  35. package/dist/cjs/runtime-browser/index.js +0 -6
  36. package/dist/cjs/runtime-browser/parsed.js +0 -28
  37. package/dist/cjs/runtime-node/index.js +0 -28
  38. package/dist/cjs/runtime-node/loaderContext/createLoaderCtx.js +0 -34
  39. package/dist/cjs/runtime-node/loaderContext/createRequestCtx.js +0 -38
  40. package/dist/cjs/runtime-node/loaderContext/index.js +0 -22
  41. package/dist/cjs/runtime-node/nestedRoutes.js +0 -28
  42. package/dist/cjs/runtime-node/router.js +0 -6
  43. package/dist/cjs/runtime-node/serialize.js +0 -17
  44. package/dist/cjs/runtime-node/storage.js +0 -48
  45. package/dist/cjs/universal/time.js +0 -38
  46. package/dist/esm/runtime/nestedRoutes.js +0 -163
  47. package/dist/esm/runtime/remixRouter.js +0 -1
  48. package/dist/esm/runtime/router.js +0 -1
  49. package/dist/esm/runtime-browser/index.js +0 -1
  50. package/dist/esm/runtime-browser/parsed.js +0 -18
  51. package/dist/esm/runtime-node/index.js +0 -6
  52. package/dist/esm/runtime-node/loaderContext/createLoaderCtx.js +0 -20
  53. package/dist/esm/runtime-node/loaderContext/createRequestCtx.js +0 -24
  54. package/dist/esm/runtime-node/loaderContext/index.js +0 -3
  55. package/dist/esm/runtime-node/nestedRoutes.js +0 -20
  56. package/dist/esm/runtime-node/router.js +0 -1
  57. package/dist/esm/runtime-node/serialize.js +0 -6
  58. package/dist/esm/runtime-node/storage.js +0 -36
  59. package/dist/esm/universal/time.js +0 -29
  60. package/dist/esm-node/runtime/nestedRoutes.js +0 -129
  61. package/dist/esm-node/runtime/remixRouter.js +0 -1
  62. package/dist/esm-node/runtime/router.js +0 -1
  63. package/dist/esm-node/runtime-browser/index.js +0 -1
  64. package/dist/esm-node/runtime-browser/parsed.js +0 -18
  65. package/dist/esm-node/runtime-node/index.js +0 -6
  66. package/dist/esm-node/runtime-node/loaderContext/createLoaderCtx.js +0 -15
  67. package/dist/esm-node/runtime-node/loaderContext/createRequestCtx.js +0 -19
  68. package/dist/esm-node/runtime-node/loaderContext/index.js +0 -3
  69. package/dist/esm-node/runtime-node/nestedRoutes.js +0 -18
  70. package/dist/esm-node/runtime-node/router.js +0 -1
  71. package/dist/esm-node/runtime-node/serialize.js +0 -6
  72. package/dist/esm-node/runtime-node/storage.js +0 -38
  73. package/dist/esm-node/universal/time.js +0 -28
  74. package/dist/types/runtime/nestedRoutes.d.ts +0 -13
  75. package/dist/types/runtime/remixRouter.d.ts +0 -1
  76. package/dist/types/runtime/router.d.ts +0 -1
  77. package/dist/types/runtime-browser/index.d.ts +0 -1
  78. package/dist/types/runtime-browser/parsed.d.ts +0 -1
  79. package/dist/types/runtime-node/index.d.ts +0 -10
  80. package/dist/types/runtime-node/loaderContext/createLoaderCtx.d.ts +0 -7
  81. package/dist/types/runtime-node/loaderContext/createRequestCtx.d.ts +0 -7
  82. package/dist/types/runtime-node/loaderContext/index.d.ts +0 -4
  83. package/dist/types/runtime-node/nestedRoutes.d.ts +0 -3
  84. package/dist/types/runtime-node/router.d.ts +0 -1
  85. package/dist/types/runtime-node/serialize.d.ts +0 -1
  86. package/dist/types/runtime-node/storage.d.ts +0 -5
  87. package/dist/types/universal/time.d.ts +0 -1
@@ -1 +0,0 @@
1
- export * from 'react-router-dom';
@@ -1 +0,0 @@
1
- export * from './parsed';
@@ -1 +0,0 @@
1
- export declare const parsedJSONFromElement: (id: string) => any;
@@ -1,10 +0,0 @@
1
- /// <reference types="node" />
2
- /**
3
- * ssr helpers
4
- */
5
- import type { IncomingHttpHeaders } from 'http';
6
- declare const run: <O>(context: IncomingHttpHeaders, cb: () => O | Promise<O>) => Promise<O>, useHeaders: () => IncomingHttpHeaders;
7
- export { run, useHeaders };
8
- export { serializeJson } from './serialize';
9
- export * from './nestedRoutes';
10
- export * from './loaderContext';
@@ -1,7 +0,0 @@
1
- export declare class LoaderContext<T = unknown> {
2
- symbol: symbol;
3
- private defaultValue?;
4
- constructor(defaultValue?: T);
5
- getDefaultValue(): T;
6
- }
7
- export declare function createLoaderContext<T = unknown>(defaultValue?: T): LoaderContext<T>;
@@ -1,7 +0,0 @@
1
- import { LoaderContext } from './createLoaderCtx';
2
- export declare class RequestContext {
3
- private store;
4
- get<T>(loaderCtx: LoaderContext<T>): T;
5
- set<T = unknown>(loaderCtx: LoaderContext, value: T): void;
6
- }
7
- export declare function createRequestContext(): RequestContext;
@@ -1,4 +0,0 @@
1
- import type { Reporter } from '@modern-js/types';
2
- export { createRequestContext, type RequestContext } from './createRequestCtx';
3
- export type { LoaderContext } from './createLoaderCtx';
4
- export declare const reporterCtx: import("./createLoaderCtx").LoaderContext<Reporter>;
@@ -1,3 +0,0 @@
1
- import type { ModernServerContext, ServerRoute } from '@modern-js/types';
2
- export type ServerContext = Pick<ModernServerContext, 'logger' | 'req' | 'reporter' | 'res' | 'params' | 'headers' | 'method' | 'url' | 'host' | 'protocol' | 'origin' | 'href' | 'path' | 'query'>;
3
- export declare const matchEntry: (pathname: string, entries: ServerRoute[]) => ServerRoute | undefined;
@@ -1 +0,0 @@
1
- export * from 'react-router-dom/server';
@@ -1 +0,0 @@
1
- export declare const serializeJson: (data: any) => string;
@@ -1,5 +0,0 @@
1
- declare const createStorage: <T>() => {
2
- run: <O>(context: T, cb: () => O | Promise<O>) => Promise<O>;
3
- useContext: () => T;
4
- };
5
- export { createStorage };
@@ -1 +0,0 @@
1
- export declare const time: () => () => number;