@modern-js/utils 2.35.0 → 2.36.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/cli/alias.js +48 -49
- package/dist/cjs/cli/applyOptionsChain.js +30 -13
- package/dist/cjs/cli/babel.js +36 -26
- package/dist/cjs/cli/commands.js +29 -21
- package/dist/cjs/cli/common.js +29 -20
- package/dist/cjs/cli/config.js +24 -7
- package/dist/cjs/cli/constants/chainId.js +27 -10
- package/dist/cjs/cli/constants/index.js +86 -104
- package/dist/cjs/cli/ensure.js +37 -18
- package/dist/cjs/cli/fs.js +29 -19
- package/dist/cjs/cli/get/config.js +26 -9
- package/dist/cjs/cli/get/data.js +67 -54
- package/dist/cjs/cli/get/index.js +46 -25
- package/dist/cjs/cli/index.js +58 -23
- package/dist/cjs/cli/is/config.js +45 -41
- package/dist/cjs/cli/is/env.js +32 -29
- package/dist/cjs/cli/is/index.js +26 -8
- package/dist/cjs/cli/is/project.js +67 -53
- package/dist/cjs/cli/is/type.js +39 -36
- package/dist/cjs/cli/logger.js +25 -125
- package/dist/cjs/cli/monorepo.js +58 -58
- package/dist/cjs/cli/package.js +34 -26
- package/dist/cjs/cli/path.js +64 -54
- package/dist/cjs/cli/port.js +39 -13
- package/dist/cjs/cli/prettyInstructions.js +50 -34
- package/dist/cjs/cli/require.js +36 -31
- package/dist/cjs/cli/runtimeExports.js +42 -16
- package/dist/cjs/cli/watch.js +41 -22
- package/dist/cjs/compiled.js +127 -138
- package/dist/cjs/import.js +25 -15
- package/dist/cjs/index.js +24 -6
- package/dist/cjs/universal/constants.js +29 -21
- package/dist/cjs/universal/formatWebpack.js +28 -18
- package/dist/cjs/universal/pluginDagSort.js +25 -8
- package/dist/esm/cli/alias.js +13 -25
- package/dist/esm/cli/applyOptionsChain.js +4 -1
- package/dist/esm/cli/babel.js +6 -2
- package/dist/esm/cli/commands.js +10 -4
- package/dist/esm/cli/common.js +8 -3
- package/dist/esm/cli/config.js +4 -1
- package/dist/esm/cli/constants/chainId.js +7 -4
- package/dist/esm/cli/constants/index.js +64 -31
- package/dist/esm/cli/ensure.js +6 -2
- package/dist/esm/cli/fs.js +6 -2
- package/dist/esm/cli/get/config.js +4 -1
- package/dist/esm/cli/get/data.js +18 -8
- package/dist/esm/cli/get/index.js +6 -2
- package/dist/esm/cli/is/config.js +23 -17
- package/dist/esm/cli/is/env.js +12 -8
- package/dist/esm/cli/is/index.js +0 -1
- package/dist/esm/cli/is/project.js +17 -8
- package/dist/esm/cli/is/type.js +20 -9
- package/dist/esm/cli/logger.js +4 -123
- package/dist/esm/cli/monorepo.js +14 -16
- package/dist/esm/cli/package.js +10 -4
- package/dist/esm/cli/path.js +24 -11
- package/dist/esm/cli/port.js +6 -3
- package/dist/esm/cli/prettyInstructions.js +8 -5
- package/dist/esm/cli/require.js +15 -8
- package/dist/esm/cli/runtimeExports.js +6 -3
- package/dist/esm/cli/watch.js +10 -6
- package/dist/esm/compiled.js +65 -31
- package/dist/esm/import.js +6 -3
- package/dist/esm/universal/constants.js +10 -4
- package/dist/esm/universal/formatWebpack.js +8 -5
- package/dist/esm/universal/pluginDagSort.js +5 -2
- package/dist/esm-node/cli/alias.js +11 -22
- package/dist/esm-node/cli/applyOptionsChain.js +4 -1
- package/dist/esm-node/cli/babel.js +6 -2
- package/dist/esm-node/cli/commands.js +10 -4
- package/dist/esm-node/cli/common.js +8 -3
- package/dist/esm-node/cli/config.js +4 -1
- package/dist/esm-node/cli/constants/chainId.js +7 -4
- package/dist/esm-node/cli/constants/index.js +64 -31
- package/dist/esm-node/cli/ensure.js +6 -2
- package/dist/esm-node/cli/fs.js +6 -2
- package/dist/esm-node/cli/get/config.js +4 -1
- package/dist/esm-node/cli/get/data.js +18 -8
- package/dist/esm-node/cli/get/index.js +6 -2
- package/dist/esm-node/cli/is/config.js +23 -17
- package/dist/esm-node/cli/is/env.js +12 -6
- package/dist/esm-node/cli/is/index.js +0 -1
- package/dist/esm-node/cli/is/project.js +16 -7
- package/dist/esm-node/cli/is/type.js +20 -9
- package/dist/esm-node/cli/logger.js +4 -108
- package/dist/esm-node/cli/monorepo.js +14 -18
- package/dist/esm-node/cli/package.js +10 -4
- package/dist/esm-node/cli/path.js +24 -11
- package/dist/esm-node/cli/port.js +5 -2
- package/dist/esm-node/cli/prettyInstructions.js +8 -7
- package/dist/esm-node/cli/require.js +15 -8
- package/dist/esm-node/cli/runtimeExports.js +4 -1
- package/dist/esm-node/cli/watch.js +6 -2
- package/dist/esm-node/compiled.js +65 -31
- package/dist/esm-node/import.js +5 -2
- package/dist/esm-node/universal/constants.js +10 -4
- package/dist/esm-node/universal/formatWebpack.js +8 -5
- package/dist/esm-node/universal/pluginDagSort.js +5 -2
- package/dist/types/cli/alias.d.ts +0 -5
- package/dist/types/cli/constants/chainId.d.ts +2 -2
- package/dist/types/cli/is/env.d.ts +1 -2
- package/dist/types/cli/is/index.d.ts +0 -1
- package/dist/types/cli/logger.d.ts +1 -64
- package/dist/types/cli/monorepo.d.ts +0 -1
- package/package.json +6 -84
- package/dist/cjs/cli/is/platform.js +0 -21
- package/dist/cjs/runtime/nestedRoutes.js +0 -149
- package/dist/cjs/runtime/remixRouter.js +0 -6
- package/dist/cjs/runtime/router.js +0 -6
- package/dist/cjs/runtime-browser/index.js +0 -6
- package/dist/cjs/runtime-browser/parsed.js +0 -28
- package/dist/cjs/runtime-node/index.js +0 -28
- package/dist/cjs/runtime-node/loaderContext/createLoaderCtx.js +0 -34
- package/dist/cjs/runtime-node/loaderContext/createRequestCtx.js +0 -38
- package/dist/cjs/runtime-node/loaderContext/index.js +0 -22
- package/dist/cjs/runtime-node/nestedRoutes.js +0 -28
- package/dist/cjs/runtime-node/router.js +0 -6
- package/dist/cjs/runtime-node/serialize.js +0 -17
- package/dist/cjs/runtime-node/storage.js +0 -48
- package/dist/cjs/universal/time.js +0 -38
- package/dist/compiled/gradient-string/index.d.ts +0 -1
- package/dist/compiled/gradient-string/index.js +0 -1
- package/dist/compiled/gradient-string/license +0 -21
- package/dist/compiled/gradient-string/package.json +0 -1
- package/dist/compiled/webpack-dev-middleware/index.js +0 -7
- package/dist/compiled/webpack-dev-middleware/license +0 -20
- package/dist/compiled/webpack-dev-middleware/package.json +0 -1
- package/dist/compiled/webpack-dev-middleware/types/index.d.ts +0 -262
- package/dist/esm/cli/is/platform.js +0 -6
- package/dist/esm/runtime/nestedRoutes.js +0 -163
- package/dist/esm/runtime/remixRouter.js +0 -1
- package/dist/esm/runtime/router.js +0 -1
- package/dist/esm/runtime-browser/index.js +0 -1
- package/dist/esm/runtime-browser/parsed.js +0 -18
- package/dist/esm/runtime-node/index.js +0 -6
- package/dist/esm/runtime-node/loaderContext/createLoaderCtx.js +0 -20
- package/dist/esm/runtime-node/loaderContext/createRequestCtx.js +0 -24
- package/dist/esm/runtime-node/loaderContext/index.js +0 -3
- package/dist/esm/runtime-node/nestedRoutes.js +0 -20
- package/dist/esm/runtime-node/router.js +0 -1
- package/dist/esm/runtime-node/serialize.js +0 -6
- package/dist/esm/runtime-node/storage.js +0 -36
- package/dist/esm/universal/time.js +0 -29
- package/dist/esm-node/cli/is/platform.js +0 -2
- package/dist/esm-node/runtime/nestedRoutes.js +0 -129
- package/dist/esm-node/runtime/remixRouter.js +0 -1
- package/dist/esm-node/runtime/router.js +0 -1
- package/dist/esm-node/runtime-browser/index.js +0 -1
- package/dist/esm-node/runtime-browser/parsed.js +0 -18
- package/dist/esm-node/runtime-node/index.js +0 -6
- package/dist/esm-node/runtime-node/loaderContext/createLoaderCtx.js +0 -15
- package/dist/esm-node/runtime-node/loaderContext/createRequestCtx.js +0 -19
- package/dist/esm-node/runtime-node/loaderContext/index.js +0 -3
- package/dist/esm-node/runtime-node/nestedRoutes.js +0 -18
- package/dist/esm-node/runtime-node/router.js +0 -1
- package/dist/esm-node/runtime-node/serialize.js +0 -6
- package/dist/esm-node/runtime-node/storage.js +0 -38
- package/dist/esm-node/universal/time.js +0 -28
- package/dist/types/cli/is/platform.d.ts +0 -2
- package/dist/types/runtime/nestedRoutes.d.ts +0 -13
- package/dist/types/runtime/remixRouter.d.ts +0 -1
- package/dist/types/runtime/router.d.ts +0 -1
- package/dist/types/runtime-browser/index.d.ts +0 -1
- package/dist/types/runtime-browser/parsed.d.ts +0 -1
- package/dist/types/runtime-node/index.d.ts +0 -10
- package/dist/types/runtime-node/loaderContext/createLoaderCtx.d.ts +0 -7
- package/dist/types/runtime-node/loaderContext/createRequestCtx.d.ts +0 -7
- package/dist/types/runtime-node/loaderContext/index.d.ts +0 -4
- package/dist/types/runtime-node/nestedRoutes.d.ts +0 -3
- package/dist/types/runtime-node/router.d.ts +0 -1
- package/dist/types/runtime-node/serialize.d.ts +0 -1
- package/dist/types/runtime-node/storage.d.ts +0 -5
- package/dist/types/universal/time.d.ts +0 -1
@@ -1,13 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import type { NestedRoute, Reporter } from '@modern-js/types';
|
3
|
-
export declare const transformNestedRoutes: (routes: NestedRoute[], reporter: Reporter) => import("react-router-dom").RouteObject[];
|
4
|
-
type DeferredDataComponentType = (props?: {
|
5
|
-
nonce?: string;
|
6
|
-
}) => JSX.Element | null;
|
7
|
-
export declare const renderNestedRoute: (nestedRoute: NestedRoute, options?: {
|
8
|
-
parent?: NestedRoute;
|
9
|
-
DeferredDataComponent?: DeferredDataComponentType;
|
10
|
-
props?: Record<string, any>;
|
11
|
-
reporter?: Reporter;
|
12
|
-
}) => JSX.Element;
|
13
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from '@remix-run/router';
|
@@ -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
|
-
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 +0,0 @@
|
|
1
|
-
export declare const time: () => () => number;
|