@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.0 → 3.2.0-ultramodern.1

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.
Files changed (107) hide show
  1. package/package.json +11 -11
  2. package/dist/types/baseline.d.ts +0 -46
  3. package/dist/types/builder/builder-rspack/index.d.ts +0 -2
  4. package/dist/types/builder/generator/adapterCopy.d.ts +0 -3
  5. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +0 -3
  6. package/dist/types/builder/generator/createCopyPattern.d.ts +0 -16
  7. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +0 -6
  8. package/dist/types/builder/generator/index.d.ts +0 -8
  9. package/dist/types/builder/index.d.ts +0 -3
  10. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +0 -3
  11. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +0 -3
  12. package/dist/types/builder/shared/builderPlugins/adapterPrecompress.d.ts +0 -3
  13. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +0 -3
  14. package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +0 -3
  15. package/dist/types/builder/shared/builderPlugins/index.d.ts +0 -5
  16. package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +0 -7
  17. package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +0 -9
  18. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +0 -32
  19. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +0 -3
  20. package/dist/types/builder/shared/createCopyInfo.d.ts +0 -8
  21. package/dist/types/builder/shared/index.d.ts +0 -3
  22. package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +0 -3
  23. package/dist/types/builder/shared/types.d.ts +0 -6
  24. package/dist/types/commands/build.d.ts +0 -4
  25. package/dist/types/commands/deploy.d.ts +0 -3
  26. package/dist/types/commands/dev.d.ts +0 -9
  27. package/dist/types/commands/index.d.ts +0 -10
  28. package/dist/types/commands/info.d.ts +0 -18
  29. package/dist/types/commands/inspect.d.ts +0 -4
  30. package/dist/types/commands/runtime.d.ts +0 -11
  31. package/dist/types/commands/serve.d.ts +0 -8
  32. package/dist/types/compat/hooks.d.ts +0 -7
  33. package/dist/types/compat/index.d.ts +0 -2
  34. package/dist/types/compat/utils.d.ts +0 -13
  35. package/dist/types/config/default.d.ts +0 -3
  36. package/dist/types/config/index.d.ts +0 -2
  37. package/dist/types/config/initialize/index.d.ts +0 -3
  38. package/dist/types/config/initialize/inits.d.ts +0 -4
  39. package/dist/types/constants.d.ts +0 -2
  40. package/dist/types/defineConfig.d.ts +0 -11
  41. package/dist/types/esm/register-esm.d.mts +0 -11
  42. package/dist/types/esm/ts-node-loader.d.mts +0 -6
  43. package/dist/types/esm/ts-paths-loader.d.mts +0 -6
  44. package/dist/types/exports/server.d.ts +0 -1
  45. package/dist/types/index.d.ts +0 -17
  46. package/dist/types/locale/en.d.ts +0 -44
  47. package/dist/types/locale/index.d.ts +0 -90
  48. package/dist/types/locale/zh.d.ts +0 -44
  49. package/dist/types/plugins/analyze/constants.d.ts +0 -3
  50. package/dist/types/plugins/analyze/getBundleEntry.d.ts +0 -4
  51. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +0 -7
  52. package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +0 -27
  53. package/dist/types/plugins/analyze/getServerRoutes.d.ts +0 -8
  54. package/dist/types/plugins/analyze/index.d.ts +0 -3
  55. package/dist/types/plugins/analyze/isDefaultExportFunction.d.ts +0 -1
  56. package/dist/types/plugins/analyze/templates.d.ts +0 -5
  57. package/dist/types/plugins/analyze/utils.d.ts +0 -10
  58. package/dist/types/plugins/deploy/index.d.ts +0 -3
  59. package/dist/types/plugins/deploy/platforms/gh-pages.d.ts +0 -2
  60. package/dist/types/plugins/deploy/platforms/netlify.d.ts +0 -2
  61. package/dist/types/plugins/deploy/platforms/node.d.ts +0 -2
  62. package/dist/types/plugins/deploy/platforms/platform.d.ts +0 -17
  63. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +0 -2
  64. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.mts +0 -2
  65. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.cts +0 -1
  66. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.mts +0 -1
  67. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.cts +0 -2
  68. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.mts +0 -2
  69. package/dist/types/plugins/deploy/platforms/vercel.d.ts +0 -2
  70. package/dist/types/plugins/deploy/types.d.ts +0 -3
  71. package/dist/types/plugins/deploy/utils/generator.d.ts +0 -24
  72. package/dist/types/plugins/deploy/utils/index.d.ts +0 -16
  73. package/dist/types/plugins/initialize/index.d.ts +0 -3
  74. package/dist/types/plugins/serverBuild.d.ts +0 -3
  75. package/dist/types/plugins/serverRuntime.d.ts +0 -3
  76. package/dist/types/presetUltramodern.d.ts +0 -6
  77. package/dist/types/rsbuild.d.ts +0 -12
  78. package/dist/types/run/index.d.ts +0 -20
  79. package/dist/types/types/config/deploy.d.ts +0 -38
  80. package/dist/types/types/config/dev.d.ts +0 -55
  81. package/dist/types/types/config/experiments.d.ts +0 -3
  82. package/dist/types/types/config/html.d.ts +0 -3
  83. package/dist/types/types/config/index.d.ts +0 -48
  84. package/dist/types/types/config/output.d.ts +0 -61
  85. package/dist/types/types/config/performance.d.ts +0 -3
  86. package/dist/types/types/config/resolve.d.ts +0 -2
  87. package/dist/types/types/config/security.d.ts +0 -2
  88. package/dist/types/types/config/source.d.ts +0 -61
  89. package/dist/types/types/config/testing.d.ts +0 -8
  90. package/dist/types/types/config/tools.d.ts +0 -21
  91. package/dist/types/types/index.d.ts +0 -10
  92. package/dist/types/types/plugin.d.ts +0 -114
  93. package/dist/types/types/utils.d.ts +0 -1
  94. package/dist/types/ultramodern/designSystem.d.ts +0 -54
  95. package/dist/types/utils/config.d.ts +0 -2
  96. package/dist/types/utils/createServer.d.ts +0 -5
  97. package/dist/types/utils/env.d.ts +0 -2
  98. package/dist/types/utils/generateWatchFiles.d.ts +0 -2
  99. package/dist/types/utils/getConfigFile.d.ts +0 -1
  100. package/dist/types/utils/getSelectedEntries.d.ts +0 -5
  101. package/dist/types/utils/initAppContext.d.ts +0 -31
  102. package/dist/types/utils/loadPlugins.d.ts +0 -13
  103. package/dist/types/utils/printInstructions.d.ts +0 -3
  104. package/dist/types/utils/register.d.ts +0 -19
  105. package/dist/types/utils/restart.d.ts +0 -2
  106. package/dist/types/utils/routes.d.ts +0 -4
  107. package/dist/types/utils/types.d.ts +0 -49
@@ -1,114 +0,0 @@
1
- import type { AppContext, AsyncHook, InternalContext, PluginHook, PluginHookTap, TransformFunction } from '@modern-js/plugin';
2
- import type { Hooks } from '@modern-js/plugin/cli';
3
- import type { Entrypoint, HtmlPartials, HtmlTemplates, NestedRouteForCli, PageRoute, RouteLegacy, ServerPlugin, ServerRoute } from '@modern-js/types';
4
- import type { getHookRunners } from '../compat/hooks';
5
- import type { AppTools } from '.';
6
- import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
7
- export type AfterPrepareFn = () => Promise<void> | void;
8
- export type CheckEntryPointFn = TransformFunction<{
9
- path: string;
10
- entry: false | string;
11
- }>;
12
- export type ModifyEntrypointsFn = TransformFunction<{
13
- entrypoints: Entrypoint[];
14
- }>;
15
- export type ModifyFileSystemRoutesFn = TransformFunction<{
16
- entrypoint: Entrypoint;
17
- routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
18
- }>;
19
- export type DeplpoyFn = () => Promise<void> | void;
20
- export type GenerateEntryCodeFn = (params: {
21
- entrypoints: Entrypoint[];
22
- }) => Promise<void> | void;
23
- export type BeforeGenerateRoutesFn = TransformFunction<{
24
- entrypoint: Entrypoint;
25
- code: string;
26
- }>;
27
- export type BeforePrintInstructionsFn = TransformFunction<{
28
- instructions: string;
29
- }>;
30
- export type AddRuntimeExportsFn = () => Promise<void> | void;
31
- export interface AppToolsExtendAPI {
32
- onAfterPrepare: PluginHookTap<AfterPrepareFn>;
33
- deploy: PluginHookTap<DeplpoyFn>;
34
- checkEntryPoint: PluginHookTap<CheckEntryPointFn>;
35
- modifyEntrypoints: PluginHookTap<ModifyEntrypointsFn>;
36
- modifyFileSystemRoutes: PluginHookTap<ModifyFileSystemRoutesFn>;
37
- generateEntryCode: PluginHookTap<GenerateEntryCodeFn>;
38
- onBeforeGenerateRoutes: PluginHookTap<BeforeGenerateRoutesFn>;
39
- /**
40
- * @deprecated
41
- */
42
- onBeforePrintInstructions: PluginHookTap<BeforePrintInstructionsFn>;
43
- /**
44
- * @deprecated use getAppContext instead
45
- */
46
- useAppContext: () => AppToolsContext;
47
- /**
48
- * @deprecated use getConfig instead
49
- */
50
- useConfigContext: () => AppToolsUserConfig;
51
- /**
52
- * @deprecated use getNormalizedConfig instead
53
- */
54
- useResolvedConfigContext: () => AppToolsNormalizedConfig<AppToolsUserConfig>;
55
- /**
56
- * @deprecated use api.xx instead
57
- */
58
- useHookRunners: () => ReturnType<typeof getHookRunners>;
59
- }
60
- export interface AppToolsExtendHooks extends Record<string, PluginHook<(...args: any[]) => any>> {
61
- onAfterPrepare: AsyncHook<AfterPrepareFn>;
62
- deploy: AsyncHook<DeplpoyFn>;
63
- checkEntryPoint: AsyncHook<CheckEntryPointFn>;
64
- modifyEntrypoints: AsyncHook<ModifyEntrypointsFn>;
65
- modifyFileSystemRoutes: AsyncHook<ModifyFileSystemRoutesFn>;
66
- generateEntryCode: AsyncHook<GenerateEntryCodeFn>;
67
- onBeforeGenerateRoutes: AsyncHook<BeforeGenerateRoutesFn>;
68
- /**
69
- * @deprecated
70
- */
71
- onBeforePrintInstructions: AsyncHook<BeforePrintInstructionsFn>;
72
- }
73
- export interface AppToolsExtendContext {
74
- metaName: string;
75
- internalDirectory: string;
76
- sharedDirectory: string;
77
- internalDirAlias: string;
78
- internalSrcAlias: string;
79
- apiDirectory: string;
80
- lambdaDirectory: string;
81
- runtimeConfigFile: string;
82
- serverPlugins: ServerPlugin[];
83
- moduleType: 'module' | 'commonjs';
84
- /** Information for entry points */
85
- entrypoints: Entrypoint[];
86
- /** Selected entry points */
87
- checkedEntries: string[];
88
- /** Information for server routes */
89
- serverRoutes: ServerRoute[];
90
- /** Whether to use api only mode */
91
- apiOnly: boolean;
92
- _internalContext: InternalContext<AppTools>;
93
- /**
94
- * Information for HTML templates by entry
95
- * @private
96
- */
97
- partialsByEntrypoint?: Record<string, HtmlPartials>;
98
- /**
99
- * Information for HTML templates
100
- * @private
101
- */
102
- htmlTemplates: HtmlTemplates;
103
- /**
104
- * @deprecated compat old plugin, default is app tools
105
- */
106
- toolsType?: string;
107
- /**
108
- * Identification for bff runtime framework
109
- * @private
110
- */
111
- bffRuntimeFramework?: 'hono' | 'effect';
112
- }
113
- export type AppToolsContext = AppContext<AppTools> & AppToolsExtendContext;
114
- export type AppToolsHooks = Hooks<AppToolsUserConfig, AppToolsNormalizedConfig, {}, {}> & AppToolsExtendHooks;
@@ -1 +0,0 @@
1
- export type UnwrapBuilderConfig<Config, Key extends keyof Config> = Required<Config>[Key];
@@ -1,54 +0,0 @@
1
- export declare const DESIGN_SYSTEM_MODES: readonly ["off", "tokens", "components", "strict"];
2
- export declare const DESIGN_SYSTEM_OVERRIDE_LAYERS: readonly ["brand", "vertical", "application"];
3
- export type DesignSystemMode = (typeof DESIGN_SYSTEM_MODES)[number];
4
- export type DesignSystemOverrideLayer = (typeof DESIGN_SYSTEM_OVERRIDE_LAYERS)[number];
5
- export type DesignSystemTokenValue = string | number;
6
- export interface DesignSystemTokenPack {
7
- id: string;
8
- version: string;
9
- brand: string;
10
- tokens: Record<string, DesignSystemTokenValue>;
11
- }
12
- export interface DesignSystemOverride {
13
- layer: DesignSystemOverrideLayer;
14
- tokens?: Record<string, DesignSystemTokenValue>;
15
- reason?: string;
16
- }
17
- export interface DesignSystemConsumerContract {
18
- id: string;
19
- requiredTokens?: string[];
20
- unsupportedModes?: DesignSystemMode[];
21
- tokenPackVersions?: Record<string, string>;
22
- }
23
- export interface DesignSystemRollbackMetadata {
24
- tokenPack: string;
25
- version: string;
26
- reason: string;
27
- }
28
- export interface DesignSystemPinMetadata {
29
- tokenPack: string;
30
- version: string;
31
- rollback: DesignSystemRollbackMetadata;
32
- }
33
- export interface DesignSystemVerticalContract {
34
- mode: DesignSystemMode;
35
- tokenPack?: string;
36
- overrides?: DesignSystemOverride[];
37
- pin?: DesignSystemPinMetadata;
38
- consumers?: DesignSystemConsumerContract[];
39
- }
40
- export interface DesignSystemContract {
41
- tokenPacks: DesignSystemTokenPack[];
42
- verticals: Record<string, DesignSystemVerticalContract>;
43
- }
44
- export interface DesignSystemValidationIssue {
45
- path: string;
46
- message: string;
47
- }
48
- export interface DesignSystemValidationResult {
49
- valid: boolean;
50
- issues: DesignSystemValidationIssue[];
51
- }
52
- export declare const createDesignSystemTokenPackMap: (tokenPacks: DesignSystemTokenPack[]) => Map<string, DesignSystemTokenPack>;
53
- export declare const validateDesignSystemConsumerCompatibility: (vertical: DesignSystemVerticalContract, tokenPack: DesignSystemTokenPack | undefined, path?: string) => DesignSystemValidationResult;
54
- export declare const validateDesignSystemContract: (contract: DesignSystemContract) => DesignSystemValidationResult;
@@ -1,2 +0,0 @@
1
- import type { AppNormalizedConfig } from '../types';
2
- export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig) => Promise<void>;
@@ -1,5 +0,0 @@
1
- import type { Server } from 'node:http';
2
- import type { Http2SecureServer } from 'node:http2';
3
- export declare const getServer: () => Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse> | Http2SecureServer<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse, typeof import("node:http2").Http2ServerRequest, typeof import("node:http2").Http2ServerResponse> | null;
4
- export declare const setServer: (newServer: Server | Http2SecureServer) => void;
5
- export declare const closeServer: () => Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { AppToolsContext } from '../types/plugin';
2
- export declare function getAutoInjectEnv(appContext: AppToolsContext): Record<string, string>;
@@ -1,2 +0,0 @@
1
- import type { AppToolsContext } from '../types/plugin';
2
- export declare function generateWatchFiles(appContext: AppToolsContext, configDir?: string): Promise<string[]>;
@@ -1 +0,0 @@
1
- export declare const getConfigFile: (configFile?: string, cwd?: string) => string | false;
@@ -1,5 +0,0 @@
1
- import type { Entrypoint } from '@modern-js/types';
2
- /**
3
- * Allow user to select entrypoints to build.
4
- */
5
- export declare const getSelectedEntries: (entry: string[] | boolean, entrypoints: Entrypoint[]) => Promise<string[]>;
@@ -1,31 +0,0 @@
1
- export declare const initAppContext: ({ metaName, appDirectory, runtimeConfigFile, options, tempDir, }: {
2
- metaName: string;
3
- appDirectory: string;
4
- runtimeConfigFile: string;
5
- options?: {
6
- srcDir?: string;
7
- apiDir?: string;
8
- distDir?: string;
9
- sharedDir?: string;
10
- bffRuntimeFramework?: "hono" | "effect";
11
- };
12
- tempDir?: string;
13
- }) => {
14
- runtimeConfigFile: string;
15
- ip: any;
16
- port: number;
17
- moduleType: any;
18
- apiDirectory: string;
19
- lambdaDirectory: string;
20
- sharedDirectory: string;
21
- serverPlugins: never[];
22
- internalDirectory: string;
23
- htmlTemplates: {};
24
- serverRoutes: never[];
25
- entrypoints: never[];
26
- checkedEntries: never[];
27
- apiOnly: boolean;
28
- internalDirAlias: string;
29
- internalSrcAlias: string;
30
- bffRuntimeFramework: "hono" | "effect";
31
- };
@@ -1,13 +0,0 @@
1
- import type { CLIPluginAPI, Plugin } from '@modern-js/plugin';
2
- import type { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
3
- import type { InternalPlugins, ServerPlugin } from '@modern-js/types';
4
- import type { AppTools } from '../types';
5
- export declare function getServerPlugins(api: CLIPluginAPI<AppTools>, metaName?: string): Promise<ServerPlugin[]>;
6
- export declare function loadServerPlugins(api: CLIPluginAPI<AppTools>, appDirectory: string, metaName: string): Promise<ServerPluginInstance[]>;
7
- /**
8
- * Load internal plugins which in @modern-js scope and user's custom plugins.
9
- * @param appDirectory - Application root directory.
10
- * @param internalPlugins - Internal plugins.
11
- * @returns Plugin Objects has been required.
12
- */
13
- export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<Plugin[]>;
@@ -1,3 +0,0 @@
1
- import type { AppNormalizedConfig } from '../types';
2
- import type { AppToolsContext, AppToolsHooks } from '../types/plugin';
3
- export declare const printInstructions: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<void>;
@@ -1,19 +0,0 @@
1
- import { type Alias } from '@modern-js/utils';
2
- import type { ConfigChain } from '@rsbuild/core';
3
- type TsRuntimeRegisterMode = 'ts-node' | 'node-loader' | 'unsupported';
4
- interface TsRuntimeSetupOptions {
5
- moduleType?: string;
6
- /**
7
- * User-configured `server.tsconfigPath`. Forwarded into the shared
8
- * resolveServerTsconfig helper. Resolved relative to appDir when not
9
- * absolute. Falls back to `<appDir>/tsconfig.json` when unset.
10
- */
11
- tsconfigPath?: string;
12
- }
13
- export declare const resolveTsRuntimeRegisterMode: (hasTsNode: boolean) => TsRuntimeRegisterMode;
14
- /**
15
- * Setup TypeScript runtime support.
16
- * Register ts-node for compilation and tsconfig-paths for path alias resolution.
17
- */
18
- export declare const setupTsRuntime: (appDir: string, distDir: string, alias?: ConfigChain<Alias>, options?: TsRuntimeSetupOptions) => Promise<void>;
19
- export {};
@@ -1,2 +0,0 @@
1
- import type { AppToolsHooks } from '../types/plugin';
2
- export declare function restart(hooks: AppToolsHooks, filename: string): Promise<void>;
@@ -1,4 +0,0 @@
1
- import type { AppToolsContext } from '../types/plugin';
2
- export declare const generateRoutes: (appContext: AppToolsContext) => Promise<void>;
3
- export declare const getPathWithoutExt: (filename: string) => string;
4
- export declare const isMainEntry: (entryName: string, mainEntryName?: string) => boolean;
@@ -1,49 +0,0 @@
1
- export type DevOptions = {
2
- entry?: string[] | boolean;
3
- config?: string;
4
- apiOnly?: boolean;
5
- analyze?: boolean;
6
- };
7
- export type BuildOptions = {
8
- config?: string;
9
- analyze?: boolean;
10
- watch?: boolean;
11
- };
12
- export type DeployOptions = {
13
- config?: string;
14
- skipBuild?: boolean;
15
- };
16
- export type StartOptions = {
17
- apiOnly?: boolean;
18
- };
19
- export type InspectOptions = {
20
- env: string;
21
- output: string;
22
- verbose?: boolean;
23
- };
24
- export type InfoOptions = {
25
- config?: string;
26
- json?: boolean;
27
- };
28
- export type RuntimeStatusOptions = {
29
- endpoint?: string;
30
- token?: string;
31
- tokenEnv?: string;
32
- headerName?: string;
33
- timeout?: string;
34
- json?: boolean;
35
- };
36
- export type RuntimeFallbackSignalOptions = {
37
- endpoint?: string;
38
- app: string;
39
- reason?: string;
40
- phase?: string;
41
- entry?: string;
42
- runtimeDigest?: string;
43
- metadata?: string;
44
- token?: string;
45
- tokenEnv?: string;
46
- headerName?: string;
47
- timeout?: string;
48
- json?: boolean;
49
- };