@modern-js/app-tools 1.22.2 → 2.0.0-alpha.0
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.
- package/CHANGELOG.md +1383 -104
- package/bin/modern.js +13 -1
- package/dist/js/modern/analyze/Builder.js +39 -0
- package/dist/js/modern/analyze/constants.js +48 -15
- package/dist/js/modern/analyze/generateCode.js +286 -133
- package/dist/js/modern/analyze/getBundleEntry.js +39 -41
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +220 -0
- package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +216 -0
- package/dist/js/modern/analyze/getClientRoutes/index.js +6 -0
- package/dist/js/modern/analyze/getClientRoutes/utils.js +31 -0
- package/dist/js/modern/analyze/getFileSystemEntry.js +74 -39
- package/dist/js/modern/analyze/getHtmlTemplate.js +90 -57
- package/dist/js/modern/analyze/getServerRoutes.js +123 -140
- package/dist/js/modern/analyze/index.js +220 -133
- package/dist/js/modern/analyze/isDefaultExportFunction.js +30 -20
- package/dist/js/modern/analyze/makeLegalIdentifier.js +10 -13
- package/dist/js/modern/analyze/nestedRoutes.js +166 -0
- package/dist/js/modern/analyze/templates.js +289 -29
- package/dist/js/modern/analyze/utils.js +128 -58
- package/dist/js/modern/builder/builderPlugins/compatModern.js +233 -0
- package/dist/js/modern/builder/index.js +154 -0
- package/dist/js/modern/builder/loaders/routerLoader.js +17 -0
- package/dist/js/modern/builder/loaders/serverModuleLoader.js +7 -0
- package/dist/js/modern/builder/share.js +46 -0
- package/dist/js/modern/builder/webpackPlugins/htmlAsyncChunkPlugin.js +30 -0
- package/dist/js/modern/builder/webpackPlugins/htmlBottomTemplate.js +37 -0
- package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +113 -0
- package/dist/js/modern/commands/build.js +75 -138
- package/dist/js/modern/commands/deploy.js +27 -4
- package/dist/js/modern/commands/dev.js +102 -66
- package/dist/js/modern/commands/index.js +1 -1
- package/dist/js/modern/commands/inspect.js +33 -64
- package/dist/js/modern/commands/serve.js +54 -0
- package/dist/js/modern/config/default.js +173 -0
- package/dist/js/modern/config/index.js +8 -0
- package/dist/js/modern/config/initial/createHtmlConfig.js +35 -0
- package/dist/js/modern/config/initial/createOutputConfig.js +68 -0
- package/dist/js/modern/config/initial/createSourceConfig.js +39 -0
- package/dist/js/modern/config/initial/createToolsConfig.js +42 -0
- package/dist/js/modern/config/initial/index.js +16 -0
- package/dist/js/modern/config/initial/inits.js +153 -0
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +47 -0
- package/dist/js/modern/defineConfig.js +27 -0
- package/dist/js/modern/exports/server.js +4 -1
- package/dist/js/modern/hooks.js +37 -21
- package/dist/js/modern/index.js +185 -94
- package/dist/js/modern/initialize/index.js +120 -0
- package/dist/js/modern/locale/en.js +20 -22
- package/dist/js/modern/locale/index.js +6 -6
- package/dist/js/modern/locale/zh.js +21 -23
- package/dist/js/modern/schema/Schema.js +40 -0
- package/dist/js/modern/schema/index.js +88 -0
- package/dist/js/modern/schema/legacy.js +148 -0
- package/dist/js/modern/types/config/deploy.js +0 -0
- package/dist/js/modern/types/config/dev.js +0 -0
- package/dist/js/modern/types/config/experiments.js +0 -0
- package/dist/js/modern/types/config/html.js +0 -0
- package/dist/js/modern/types/config/index.js +1 -0
- package/dist/js/modern/types/config/output.js +0 -0
- package/dist/js/modern/types/config/performance.js +0 -0
- package/dist/js/modern/types/config/security.js +0 -0
- package/dist/js/modern/types/config/source.js +0 -0
- package/dist/js/modern/types/config/tools.js +0 -0
- package/dist/js/modern/types/hooks.js +0 -0
- package/dist/js/modern/types/index.js +3 -0
- package/dist/js/modern/types/legacyConfig/deploy.js +0 -0
- package/dist/js/modern/types/legacyConfig/dev.js +0 -0
- package/dist/js/modern/types/legacyConfig/index.js +0 -0
- package/dist/js/modern/types/legacyConfig/output.js +0 -0
- package/dist/js/modern/types/legacyConfig/source.js +0 -0
- package/dist/js/modern/types/legacyConfig/tools.js +0 -0
- package/dist/js/modern/utils/commands.js +13 -0
- package/dist/js/modern/utils/config.js +102 -52
- package/dist/js/modern/utils/createFileWatcher.js +115 -0
- package/dist/js/modern/utils/createServer.js +67 -10
- package/dist/js/modern/utils/getServerInternalPlugins.js +58 -0
- package/dist/js/modern/utils/getSpecifiedEntries.js +46 -25
- package/dist/js/modern/utils/language.js +6 -3
- package/dist/js/modern/utils/printInstructions.js +29 -9
- package/dist/js/modern/utils/restart.js +44 -0
- package/dist/js/modern/utils/routes.js +29 -14
- package/dist/js/node/analyze/Builder.js +64 -0
- package/dist/js/node/analyze/constants.js +86 -33
- package/dist/js/node/analyze/generateCode.js +305 -163
- package/dist/js/node/analyze/getBundleEntry.js +66 -58
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +242 -0
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +238 -0
- package/dist/js/node/analyze/getClientRoutes/index.js +30 -0
- package/dist/js/node/analyze/getClientRoutes/utils.js +58 -0
- package/dist/js/node/analyze/getFileSystemEntry.js +99 -58
- package/dist/js/node/analyze/getHtmlTemplate.js +121 -83
- package/dist/js/node/analyze/getServerRoutes.js +146 -160
- package/dist/js/node/analyze/index.js +243 -161
- package/dist/js/node/analyze/isDefaultExportFunction.js +59 -38
- package/dist/js/node/analyze/makeLegalIdentifier.js +31 -19
- package/dist/js/node/analyze/nestedRoutes.js +193 -0
- package/dist/js/node/analyze/templates.js +316 -43
- package/dist/js/node/analyze/utils.js +158 -78
- package/dist/js/node/builder/builderPlugins/compatModern.js +258 -0
- package/dist/js/node/builder/index.js +177 -0
- package/dist/js/node/builder/loaders/routerLoader.js +38 -0
- package/dist/js/node/builder/loaders/serverModuleLoader.js +28 -0
- package/dist/js/node/builder/share.js +75 -0
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +53 -0
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +60 -0
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +135 -0
- package/dist/js/node/commands/build.js +97 -159
- package/dist/js/node/commands/deploy.js +49 -12
- package/dist/js/node/commands/dev.js +121 -93
- package/dist/js/node/commands/index.js +19 -44
- package/dist/js/node/commands/inspect.js +56 -93
- package/dist/js/node/commands/serve.js +83 -0
- package/dist/js/node/config/default.js +195 -0
- package/dist/js/node/config/index.js +34 -0
- package/dist/js/node/config/initial/createHtmlConfig.js +58 -0
- package/dist/js/node/config/initial/createOutputConfig.js +91 -0
- package/dist/js/node/config/initial/createSourceConfig.js +62 -0
- package/dist/js/node/config/initial/createToolsConfig.js +65 -0
- package/dist/js/node/config/initial/index.js +41 -0
- package/dist/js/node/config/initial/inits.js +176 -0
- package/dist/js/node/config/initial/transformNormalizedConfig.js +70 -0
- package/dist/js/node/defineConfig.js +49 -0
- package/dist/js/node/exports/server.js +25 -11
- package/dist/js/node/hooks.js +53 -36
- package/dist/js/node/index.js +216 -128
- package/dist/js/node/initialize/index.js +135 -0
- package/dist/js/node/locale/en.js +40 -26
- package/dist/js/node/locale/index.js +31 -18
- package/dist/js/node/locale/zh.js +41 -27
- package/dist/js/node/schema/Schema.js +63 -0
- package/dist/js/node/schema/index.js +118 -0
- package/dist/js/node/schema/legacy.js +169 -0
- package/dist/js/node/types/config/deploy.js +15 -0
- package/dist/js/node/types/config/dev.js +15 -0
- package/dist/js/node/types/config/experiments.js +15 -0
- package/dist/js/node/types/config/html.js +15 -0
- package/dist/js/node/types/config/index.js +17 -0
- package/dist/js/node/types/config/output.js +15 -0
- package/dist/js/node/types/config/performance.js +15 -0
- package/dist/js/node/types/config/security.js +15 -0
- package/dist/js/node/types/config/source.js +15 -0
- package/dist/js/node/types/config/tools.js +15 -0
- package/dist/js/node/types/hooks.js +15 -0
- package/dist/js/node/types/index.js +19 -0
- package/dist/js/node/types/legacyConfig/deploy.js +15 -0
- package/dist/js/node/types/legacyConfig/dev.js +15 -0
- package/dist/js/node/types/legacyConfig/index.js +15 -0
- package/dist/js/node/types/legacyConfig/output.js +15 -0
- package/dist/js/node/types/legacyConfig/source.js +15 -0
- package/dist/js/node/types/legacyConfig/tools.js +15 -0
- package/dist/js/node/utils/commands.js +37 -0
- package/dist/js/node/utils/config.js +125 -75
- package/dist/js/node/utils/createFileWatcher.js +139 -0
- package/dist/js/node/utils/createServer.js +96 -25
- package/dist/js/node/utils/getServerInternalPlugins.js +79 -0
- package/dist/js/node/utils/getSpecifiedEntries.js +68 -34
- package/dist/js/node/utils/language.js +28 -10
- package/dist/js/node/utils/printInstructions.js +51 -19
- package/dist/js/node/utils/restart.js +67 -0
- package/dist/js/node/utils/routes.js +58 -24
- package/dist/js/node/utils/types.js +15 -0
- package/dist/js/treeshaking/analyze/Builder.js +199 -0
- package/dist/js/treeshaking/analyze/constants.js +37 -0
- package/dist/js/treeshaking/analyze/generateCode.js +615 -0
- package/dist/js/treeshaking/analyze/getBundleEntry.js +64 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +233 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +231 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/index.js +3 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +23 -0
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +107 -0
- package/dist/js/treeshaking/analyze/getHtmlTemplate.js +302 -0
- package/dist/js/treeshaking/analyze/getServerRoutes.js +222 -0
- package/dist/js/treeshaking/analyze/index.js +589 -0
- package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +47 -0
- package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +13 -0
- package/dist/js/treeshaking/analyze/nestedRoutes.js +426 -0
- package/dist/js/treeshaking/analyze/templates.js +446 -0
- package/dist/js/treeshaking/analyze/utils.js +390 -0
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +304 -0
- package/dist/js/treeshaking/builder/index.js +374 -0
- package/dist/js/treeshaking/builder/loaders/routerLoader.js +13 -0
- package/dist/js/treeshaking/builder/loaders/serverModuleLoader.js +5 -0
- package/dist/js/treeshaking/builder/share.js +40 -0
- package/dist/js/treeshaking/builder/webpackPlugins/htmlAsyncChunkPlugin.js +110 -0
- package/dist/js/treeshaking/builder/webpackPlugins/htmlBottomTemplate.js +72 -0
- package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +343 -0
- package/dist/js/treeshaking/commands/build.js +291 -0
- package/dist/js/treeshaking/commands/deploy.js +154 -0
- package/dist/js/treeshaking/commands/dev.js +319 -0
- package/dist/js/treeshaking/commands/index.js +3 -0
- package/dist/js/treeshaking/commands/inspect.js +149 -0
- package/dist/js/treeshaking/commands/serve.js +199 -0
- package/dist/js/treeshaking/config/default.js +208 -0
- package/dist/js/treeshaking/config/index.js +3 -0
- package/dist/js/treeshaking/config/initial/createHtmlConfig.js +19 -0
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +41 -0
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +42 -0
- package/dist/js/treeshaking/config/initial/createToolsConfig.js +23 -0
- package/dist/js/treeshaking/config/initial/index.js +12 -0
- package/dist/js/treeshaking/config/initial/inits.js +213 -0
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +35 -0
- package/dist/js/treeshaking/defineConfig.js +61 -0
- package/dist/js/treeshaking/exports/server.js +2 -0
- package/dist/js/treeshaking/hooks.js +31 -0
- package/dist/js/treeshaking/index.js +694 -0
- package/dist/js/treeshaking/initialize/index.js +300 -0
- package/dist/js/treeshaking/locale/en.js +35 -0
- package/dist/js/treeshaking/locale/index.js +9 -0
- package/dist/js/treeshaking/locale/zh.js +35 -0
- package/dist/js/treeshaking/schema/Schema.js +273 -0
- package/dist/js/treeshaking/schema/index.js +181 -0
- package/dist/js/treeshaking/schema/legacy.js +337 -0
- package/dist/js/treeshaking/types/config/deploy.js +1 -0
- package/dist/js/treeshaking/types/config/dev.js +1 -0
- package/dist/js/treeshaking/types/config/experiments.js +1 -0
- package/dist/js/treeshaking/types/config/html.js +1 -0
- package/dist/js/treeshaking/types/config/index.js +1 -0
- package/dist/js/treeshaking/types/config/output.js +1 -0
- package/dist/js/treeshaking/types/config/performance.js +1 -0
- package/dist/js/treeshaking/types/config/security.js +1 -0
- package/dist/js/treeshaking/types/config/source.js +1 -0
- package/dist/js/treeshaking/types/config/tools.js +1 -0
- package/dist/js/treeshaking/types/hooks.js +1 -0
- package/dist/js/treeshaking/types/index.js +3 -0
- package/dist/js/treeshaking/types/legacyConfig/deploy.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/dev.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/index.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/output.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/source.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/tools.js +1 -0
- package/dist/js/treeshaking/utils/commands.js +10 -0
- package/dist/js/treeshaking/utils/config.js +302 -0
- package/dist/js/treeshaking/utils/createFileWatcher.js +283 -0
- package/dist/js/treeshaking/utils/createServer.js +258 -0
- package/dist/js/treeshaking/utils/getServerInternalPlugins.js +210 -0
- package/dist/js/treeshaking/utils/getSpecifiedEntries.js +185 -0
- package/dist/js/treeshaking/utils/language.js +6 -0
- package/dist/js/treeshaking/utils/printInstructions.js +152 -0
- package/dist/js/treeshaking/utils/restart.js +187 -0
- package/dist/js/treeshaking/utils/routes.js +153 -0
- package/dist/js/treeshaking/utils/types.js +1 -0
- package/dist/types/analyze/Builder.d.ts +8 -0
- package/dist/types/analyze/constants.d.ts +13 -1
- package/dist/types/analyze/generateCode.d.ts +3 -2
- package/dist/types/analyze/getBundleEntry.d.ts +2 -2
- package/dist/types/analyze/{getClientRoutes.d.ts → getClientRoutes/getRoutes.d.ts} +2 -7
- package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +15 -0
- package/dist/types/analyze/getClientRoutes/index.d.ts +2 -0
- package/dist/types/analyze/getClientRoutes/utils.d.ts +5 -0
- package/dist/types/analyze/getFileSystemEntry.d.ts +2 -2
- package/dist/types/analyze/getHtmlTemplate.d.ts +3 -3
- package/dist/types/analyze/getServerRoutes.d.ts +3 -2
- package/dist/types/analyze/index.d.ts +3 -40
- package/dist/types/analyze/nestedRoutes.d.ts +5 -0
- package/dist/types/analyze/templates.d.ts +24 -5
- package/dist/types/analyze/utils.d.ts +12 -2
- package/dist/types/builder/builderPlugins/compatModern.d.ts +14 -0
- package/dist/types/builder/index.d.ts +18 -0
- package/dist/types/builder/loaders/routerLoader.d.ts +3 -0
- package/dist/types/builder/loaders/serverModuleLoader.d.ts +3 -0
- package/dist/types/builder/share.d.ts +26 -0
- package/dist/types/builder/webpackPlugins/htmlAsyncChunkPlugin.d.ts +8 -0
- package/dist/types/builder/webpackPlugins/htmlBottomTemplate.d.ts +10 -0
- package/dist/types/builder/webpackPlugins/routerPlugin.d.ts +4 -0
- package/dist/types/commands/build.d.ts +2 -1
- package/dist/types/commands/deploy.d.ts +2 -1
- package/dist/types/commands/dev.d.ts +2 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/inspect.d.ts +10 -6
- package/dist/types/commands/serve.d.ts +3 -0
- package/dist/types/config/default.d.ts +3 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/initial/createHtmlConfig.d.ts +2 -0
- package/dist/types/config/initial/createOutputConfig.d.ts +2 -0
- package/dist/types/config/initial/createSourceConfig.d.ts +2 -0
- package/dist/types/config/initial/createToolsConfig.d.ts +2 -0
- package/dist/types/config/initial/index.d.ts +4 -0
- package/dist/types/config/initial/inits.d.ts +4 -0
- package/dist/types/config/initial/transformNormalizedConfig.d.ts +2 -0
- package/dist/types/defineConfig.d.ts +8 -0
- package/dist/types/hooks.d.ts +2 -37
- package/dist/types/index.d.ts +9 -3
- package/dist/types/initialize/index.d.ts +5 -0
- package/dist/types/locale/en.d.ts +1 -2
- package/dist/types/locale/index.d.ts +2 -4
- package/dist/types/locale/zh.d.ts +1 -2
- package/dist/types/schema/Schema.d.ts +14 -0
- package/dist/types/schema/index.d.ts +4 -0
- package/dist/types/schema/legacy.d.ts +3 -0
- package/dist/types/types/config/deploy.d.ts +9 -0
- package/dist/types/types/config/dev.d.ts +13 -0
- package/dist/types/types/config/experiments.d.ts +4 -0
- package/dist/types/types/config/html.d.ts +4 -0
- package/dist/types/types/config/index.d.ts +66 -0
- package/dist/types/types/config/output.d.ts +22 -0
- package/dist/types/types/config/performance.d.ts +4 -0
- package/dist/types/types/config/security.d.ts +4 -0
- package/dist/types/types/config/source.d.ts +24 -0
- package/dist/types/types/config/tools.d.ts +24 -0
- package/dist/types/types/hooks.d.ts +89 -0
- package/dist/types/types/index.d.ts +23 -0
- package/dist/types/types/legacyConfig/deploy.d.ts +8 -0
- package/dist/types/types/legacyConfig/dev.d.ts +13 -0
- package/dist/types/types/legacyConfig/index.d.ts +33 -0
- package/dist/types/types/legacyConfig/output.d.ts +51 -0
- package/dist/types/types/legacyConfig/source.d.ts +25 -0
- package/dist/types/types/legacyConfig/tools.d.ts +17 -0
- package/dist/types/utils/commands.d.ts +2 -0
- package/dist/types/utils/config.d.ts +2 -2
- package/dist/types/utils/createFileWatcher.d.ts +4 -0
- package/dist/types/utils/createServer.d.ts +9 -1
- package/dist/types/utils/getServerInternalPlugins.d.ts +2 -0
- package/dist/types/utils/printInstructions.d.ts +3 -2
- package/dist/types/utils/restart.d.ts +3 -0
- package/dist/types/utils/types.d.ts +2 -3
- package/lib/types.d.ts +1 -1
- package/package.json +37 -46
- package/dist/js/modern/analyze/getClientRoutes.js +0 -219
- package/dist/js/modern/commands/start.js +0 -31
- package/dist/js/modern/utils/createCompiler.js +0 -61
- package/dist/js/node/analyze/getClientRoutes.js +0 -241
- package/dist/js/node/commands/start.js +0 -47
- package/dist/js/node/utils/createCompiler.js +0 -81
- package/dist/types/commands/start.d.ts +0 -2
- package/dist/types/utils/createCompiler.d.ts +0 -13
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { webpack } from '@modern-js/builder-webpack-provider';
|
|
2
|
+
import type { AsyncWaterfall, AsyncWorkflow, ParallelWorkflow } from '@modern-js/plugin';
|
|
3
|
+
import type { Entrypoint, HtmlPartials, NestedRoute, PageRoute, RouteLegacy, ServerRoute } from '@modern-js/types';
|
|
4
|
+
import type { RegisterBuildPlatformResult, DevToolData } from '@modern-js/core';
|
|
5
|
+
import type { Stats, MultiStats } from '@modern-js/builder-shared';
|
|
6
|
+
export interface ImportSpecifier {
|
|
7
|
+
local?: string;
|
|
8
|
+
imported?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ImportStatement {
|
|
11
|
+
specifiers: ImportSpecifier[];
|
|
12
|
+
value: string;
|
|
13
|
+
initialize?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RuntimePlugin {
|
|
16
|
+
name: string;
|
|
17
|
+
options: string;
|
|
18
|
+
args?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare type AppToolsHooks = {
|
|
21
|
+
modifyEntryExport: AsyncWaterfall<{
|
|
22
|
+
entrypoint: Entrypoint;
|
|
23
|
+
exportStatement: string;
|
|
24
|
+
}>;
|
|
25
|
+
modifyEntryImports: AsyncWaterfall<{
|
|
26
|
+
imports: ImportStatement[];
|
|
27
|
+
entrypoint: Entrypoint;
|
|
28
|
+
}>;
|
|
29
|
+
modifyEntryRuntimePlugins: AsyncWaterfall<{
|
|
30
|
+
entrypoint: Entrypoint;
|
|
31
|
+
plugins: RuntimePlugin[];
|
|
32
|
+
}>;
|
|
33
|
+
modifyEntryRenderFunction: AsyncWaterfall<{
|
|
34
|
+
entrypoint: Entrypoint;
|
|
35
|
+
code: string;
|
|
36
|
+
}>;
|
|
37
|
+
modifyAsyncEntry: AsyncWaterfall<{
|
|
38
|
+
entrypoint: Entrypoint;
|
|
39
|
+
code: string;
|
|
40
|
+
}>;
|
|
41
|
+
modifyFileSystemRoutes: AsyncWaterfall<{
|
|
42
|
+
entrypoint: Entrypoint;
|
|
43
|
+
routes: RouteLegacy[] | (NestedRoute | PageRoute)[];
|
|
44
|
+
}>;
|
|
45
|
+
modifyServerRoutes: AsyncWaterfall<{
|
|
46
|
+
routes: ServerRoute[];
|
|
47
|
+
}>;
|
|
48
|
+
htmlPartials: AsyncWaterfall<{
|
|
49
|
+
entrypoint: Entrypoint;
|
|
50
|
+
partials: HtmlPartials;
|
|
51
|
+
}>;
|
|
52
|
+
beforeGenerateRoutes: AsyncWaterfall<{
|
|
53
|
+
entrypoint: Entrypoint;
|
|
54
|
+
code: string;
|
|
55
|
+
}>;
|
|
56
|
+
addDefineTypes: AsyncWaterfall<void>;
|
|
57
|
+
collectServerPlugins: AsyncWaterfall<{
|
|
58
|
+
plugins: Array<Record<string, string>>;
|
|
59
|
+
}>;
|
|
60
|
+
beforeDev: AsyncWorkflow<void, unknown>;
|
|
61
|
+
afterDev: AsyncWorkflow<void, unknown>;
|
|
62
|
+
beforeCreateCompiler: AsyncWorkflow<{
|
|
63
|
+
bundlerConfigs: webpack.Configuration[];
|
|
64
|
+
}, unknown>;
|
|
65
|
+
afterCreateCompiler: AsyncWorkflow<{
|
|
66
|
+
compiler?: webpack.Compiler | webpack.MultiCompiler;
|
|
67
|
+
}, unknown>;
|
|
68
|
+
beforePrintInstructions: AsyncWaterfall<{
|
|
69
|
+
instructions: string;
|
|
70
|
+
}>;
|
|
71
|
+
beforeBuild: AsyncWorkflow<{
|
|
72
|
+
bundlerConfigs?: webpack.Configuration[];
|
|
73
|
+
}, unknown>;
|
|
74
|
+
afterBuild: AsyncWorkflow<{
|
|
75
|
+
stats?: Stats | MultiStats;
|
|
76
|
+
}, unknown>;
|
|
77
|
+
beforeDeploy: AsyncWorkflow<Record<string, any>, unknown>;
|
|
78
|
+
afterDeploy: AsyncWorkflow<Record<string, any>, unknown>;
|
|
79
|
+
watchFiles: ParallelWorkflow<void>;
|
|
80
|
+
fileChange: AsyncWorkflow<{
|
|
81
|
+
filename: string;
|
|
82
|
+
eventType: 'add' | 'change' | 'unlink';
|
|
83
|
+
}, void>;
|
|
84
|
+
beforeRestart: AsyncWorkflow<void, void>;
|
|
85
|
+
registerDev: ParallelWorkflow<void, DevToolData>;
|
|
86
|
+
beforeDevTask: ParallelWorkflow<DevToolData, void>;
|
|
87
|
+
registerBuildPlatform: ParallelWorkflow<void, RegisterBuildPlatformResult>;
|
|
88
|
+
beforeBuildPlatform: ParallelWorkflow<RegisterBuildPlatformResult[], void>;
|
|
89
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NormalizedConfig, UserConfig } from '@modern-js/core';
|
|
2
|
+
import type { AppToolsUserConfig, AppToolsNormalizedConfig } from './config';
|
|
3
|
+
import type { AppToolsHooks } from './hooks';
|
|
4
|
+
import type { AppToolsLegacyUserConfig, AppToolsLegacyNormalizedConfig } from './legacyConfig';
|
|
5
|
+
export * from './hooks';
|
|
6
|
+
export * from './config';
|
|
7
|
+
export * from './legacyConfig';
|
|
8
|
+
export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries } from '@modern-js/server-core';
|
|
9
|
+
export type { IAppContext, PluginAPI, CliPlugin, NormalizedConfig, UserConfig } from '@modern-js/core';
|
|
10
|
+
export declare type AppTools = {
|
|
11
|
+
hooks: AppToolsHooks;
|
|
12
|
+
userConfig: AppToolsUserConfig;
|
|
13
|
+
normalizedConfig: AppToolsNormalizedConfig;
|
|
14
|
+
};
|
|
15
|
+
export declare type LegacyAppTools = {
|
|
16
|
+
hooks: AppToolsHooks;
|
|
17
|
+
userConfig: AppToolsLegacyUserConfig;
|
|
18
|
+
normalizedConfig: AppToolsLegacyNormalizedConfig;
|
|
19
|
+
};
|
|
20
|
+
export declare type AppNormalizedConfig = NormalizedConfig<AppTools>;
|
|
21
|
+
export declare type AppLegacyNormalizedConfig = NormalizedConfig<LegacyAppTools>;
|
|
22
|
+
export declare type AppUserConfig = UserConfig<AppTools>;
|
|
23
|
+
export declare type AppLegacyUserConfig = UserConfig<LegacyAppTools>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DevServerHttpsOptions } from '@modern-js/types';
|
|
2
|
+
export declare type DevProxyOptions = string | Record<string, string>;
|
|
3
|
+
export declare type DevUserLegacyConfig = {
|
|
4
|
+
assetPrefix?: string | boolean;
|
|
5
|
+
https?: DevServerHttpsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* The configuration of `dev.proxy` is provided by `proxy` plugin.
|
|
8
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
9
|
+
* @requires `proxy` plugin
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
proxy?: DevProxyOptions;
|
|
13
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ServerUserConfig as LegacyServerUserConfig, BffUserConfig as LegacyBffUserConfig } from '@modern-js/server-core';
|
|
2
|
+
import type { DevUserLegacyConfig } from './dev';
|
|
3
|
+
import type { OutputLegacyUserConfig } from './output';
|
|
4
|
+
import type { SourceLegacyUserConfig } from './source';
|
|
5
|
+
import type { DeployLegacyUserConfig } from './deploy';
|
|
6
|
+
import type { ToolsLegacyUserConfig } from './tools';
|
|
7
|
+
export type { DevUserLegacyConfig } from './dev';
|
|
8
|
+
export type { OutputLegacyUserConfig } from './output';
|
|
9
|
+
export type { DeployLegacyUserConfig } from './deploy';
|
|
10
|
+
export type { SourceLegacyUserConfig } from './source';
|
|
11
|
+
export type { ToolsLegacyUserConfig } from './tools';
|
|
12
|
+
export interface RuntimeLegacyConfig {
|
|
13
|
+
[name: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface RuntimeByEntriesLegacyConfig {
|
|
16
|
+
[name: string]: RuntimeLegacyConfig;
|
|
17
|
+
}
|
|
18
|
+
export declare type AppToolsLegacyUserConfig = {
|
|
19
|
+
source?: SourceLegacyUserConfig;
|
|
20
|
+
output?: OutputLegacyUserConfig;
|
|
21
|
+
server?: LegacyServerUserConfig;
|
|
22
|
+
dev?: DevUserLegacyConfig;
|
|
23
|
+
deploy?: DeployLegacyUserConfig;
|
|
24
|
+
tools?: ToolsLegacyUserConfig;
|
|
25
|
+
runtime?: RuntimeLegacyConfig;
|
|
26
|
+
runtimeByEntries?: RuntimeByEntriesLegacyConfig;
|
|
27
|
+
bff?: LegacyBffUserConfig;
|
|
28
|
+
legacy?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export interface AppToolsLegacyNormalizedConfig extends Required<AppToolsLegacyUserConfig> {
|
|
31
|
+
cliOptions?: Record<string, any>;
|
|
32
|
+
_raw: AppToolsLegacyUserConfig;
|
|
33
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { MetaOptions } from '@modern-js/utils';
|
|
2
|
+
import { SSGConfig } from '../config';
|
|
3
|
+
declare type CrossOrigin = 'anonymous' | 'use-credentials';
|
|
4
|
+
export declare type OutputLegacyUserConfig = {
|
|
5
|
+
assetPrefix?: string;
|
|
6
|
+
htmlPath?: string;
|
|
7
|
+
jsPath?: string;
|
|
8
|
+
cssPath?: string;
|
|
9
|
+
mediaPath?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
titleByEntries?: Record<string, string>;
|
|
13
|
+
meta?: MetaOptions;
|
|
14
|
+
metaByEntries?: Record<string, MetaOptions>;
|
|
15
|
+
inject?: 'body' | 'head' | boolean;
|
|
16
|
+
injectByEntries?: Record<string, 'body' | 'head' | boolean>;
|
|
17
|
+
mountId?: string;
|
|
18
|
+
favicon?: string;
|
|
19
|
+
faviconByEntries?: Record<string, string | undefined>;
|
|
20
|
+
copy?: Array<Record<string, unknown> & {
|
|
21
|
+
from: string;
|
|
22
|
+
}>;
|
|
23
|
+
disableTsChecker?: boolean;
|
|
24
|
+
disableHtmlFolder?: boolean;
|
|
25
|
+
disableCssModuleExtension?: boolean;
|
|
26
|
+
disableCssExtract?: boolean;
|
|
27
|
+
enableCssModuleTSDeclaration?: boolean;
|
|
28
|
+
disableMinimize?: boolean;
|
|
29
|
+
enableInlineStyles?: boolean;
|
|
30
|
+
enableInlineScripts?: boolean;
|
|
31
|
+
disableSourceMap?: boolean;
|
|
32
|
+
disableInlineRuntimeChunk?: boolean;
|
|
33
|
+
disableAssetsCache?: boolean;
|
|
34
|
+
enableLatestDecorators?: boolean;
|
|
35
|
+
polyfill?: 'off' | 'usage' | 'entry' | 'ua';
|
|
36
|
+
dataUriLimit?: number;
|
|
37
|
+
templateParameters?: Record<string, unknown>;
|
|
38
|
+
templateParametersByEntries?: Record<string, Record<string, unknown>>;
|
|
39
|
+
crossorigin?: boolean | CrossOrigin;
|
|
40
|
+
cssModuleLocalIdentName?: string;
|
|
41
|
+
disableNodePolyfill?: boolean;
|
|
42
|
+
enableTsLoader?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The configuration of `output.ssg` is provided by `ssg` plugin.
|
|
45
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
46
|
+
* @requires `ssg` plugin
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
ssg?: SSGConfig;
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AliasOption } from '@modern-js/utils';
|
|
2
|
+
export declare type SourceLegacyUserConfig = {
|
|
3
|
+
alias?: AliasOption;
|
|
4
|
+
entries?: Record<string, string | {
|
|
5
|
+
entry: string;
|
|
6
|
+
disableMount?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
preEntry?: string | string[];
|
|
9
|
+
enableAsyncEntry?: boolean;
|
|
10
|
+
disableDefaultEntries?: boolean;
|
|
11
|
+
entriesDir?: string;
|
|
12
|
+
configDir?: string;
|
|
13
|
+
apiDir?: string;
|
|
14
|
+
envVars?: Array<string>;
|
|
15
|
+
globalVars?: Record<string, string>;
|
|
16
|
+
moduleScopes?: Array<string | RegExp> | (((scopes: Array<string | RegExp>) => void) | ((scopes: Array<string | RegExp>) => Array<string | RegExp>))[] | ((scopes: Array<string | RegExp>) => Array<string | RegExp>) | ((scopes: Array<string | RegExp>) => void);
|
|
17
|
+
include?: Array<string | RegExp>;
|
|
18
|
+
/**
|
|
19
|
+
* The configuration of `source.designSystem` is provided by `tailwindcss` plugin.
|
|
20
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
21
|
+
* @requires `tailwindcss` plugin
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
designSystem?: Record<string, any>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DevServerOptions } from '@modern-js/types';
|
|
2
|
+
import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
3
|
+
import type { JestConfig } from '@modern-js/core';
|
|
4
|
+
declare type BuilderToolsConfig = Required<BuilderConfig>['tools'];
|
|
5
|
+
export declare type ToolsLegacyUserConfig = BuilderToolsConfig & {
|
|
6
|
+
esbuild?: Record<string, unknown>;
|
|
7
|
+
devServer?: DevServerOptions;
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.
|
|
10
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
11
|
+
* @requires `tailwindcss` plugin
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
tailwindcss?: Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
|
|
15
|
+
jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bundle } from '@modern-js/node-bundle-require';
|
|
2
|
-
import type { NormalizedConfig } from '@modern-js/core';
|
|
3
2
|
import type { ServerConfig } from '@modern-js/server-core';
|
|
3
|
+
import type { AppNormalizedConfig } from '../types';
|
|
4
4
|
export declare const defineServerConfig: (config: ServerConfig) => ServerConfig;
|
|
5
5
|
export declare const buildServerConfig: ({
|
|
6
6
|
appDirectory,
|
|
@@ -19,4 +19,4 @@ export declare const buildServerConfig: ({
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
export declare const safeReplacer: () => (key: string, value: unknown) => unknown;
|
|
22
|
-
export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig:
|
|
22
|
+
export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig) => Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IAppContext, ToRunners } from '@modern-js/core';
|
|
2
|
+
import { AppToolsHooks } from '../types/hooks';
|
|
3
|
+
export declare const addServerConfigToDeps: (dependencies: string[], appDirectory: string, serverConfigFile: string) => Promise<void>;
|
|
4
|
+
export declare const createFileWatcher: (appContext: IAppContext, configDir: string | undefined, hooksRunner: ToRunners<AppToolsHooks>) => Promise<import("@modern-js/utils").FSWatcher | undefined>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { Server, ModernDevServerOptions } from '@modern-js/server';
|
|
2
|
+
import type { InternalPlugins } from '@modern-js/types';
|
|
2
3
|
export declare const getServer: () => Server | null;
|
|
4
|
+
export declare const setServer: (newServer: Server) => void;
|
|
3
5
|
export declare const closeServer: () => Promise<void>;
|
|
4
|
-
export declare const createServer: (options: ModernDevServerOptions) => Promise<Server>;
|
|
6
|
+
export declare const createServer: (options: ModernDevServerOptions) => Promise<Server>;
|
|
7
|
+
export declare const injectDataLoaderPlugin: (internalPlugins: InternalPlugins) => {
|
|
8
|
+
'@modern-js/plugin-data-loader': {
|
|
9
|
+
path: string;
|
|
10
|
+
forced: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { IAppContext,
|
|
2
|
-
|
|
1
|
+
import type { IAppContext, CliHooksRunner } from '@modern-js/core';
|
|
2
|
+
import type { AppNormalizedConfig, AppTools } from '../types';
|
|
3
|
+
export declare const printInstructions: (hookRunners: CliHooksRunner<AppTools>, appContext: IAppContext, config: AppNormalizedConfig) => Promise<void>;
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "
|
|
14
|
+
"version": "2.0.0-alpha.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"default": "./dist/js/node/exports/server.js"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=14.17.6"
|
|
43
|
+
},
|
|
41
44
|
"typesVersions": {
|
|
42
45
|
"*": {
|
|
43
46
|
".": [
|
|
@@ -52,68 +55,56 @@
|
|
|
52
55
|
}
|
|
53
56
|
},
|
|
54
57
|
"bin": {
|
|
55
|
-
"modern": "./bin/modern.js"
|
|
58
|
+
"modern": "./bin/modern.js",
|
|
59
|
+
"modern-app": "./bin/modern.js"
|
|
56
60
|
},
|
|
57
61
|
"dependencies": {
|
|
58
|
-
"@babel/runtime": "^7.18.0",
|
|
59
62
|
"@babel/parser": "^7.18.0",
|
|
63
|
+
"@babel/runtime": "^7.18.0",
|
|
60
64
|
"@babel/traverse": "^7.18.0",
|
|
61
65
|
"@babel/types": "^7.18.0",
|
|
62
|
-
"@modern-js/
|
|
63
|
-
"@modern-js/
|
|
64
|
-
"@modern-js/
|
|
65
|
-
"@modern-js/
|
|
66
|
-
"@modern-js/
|
|
67
|
-
"@modern-js/
|
|
68
|
-
"@modern-js/
|
|
69
|
-
"@modern-js/
|
|
70
|
-
"@modern-js/
|
|
71
|
-
"@modern-js/
|
|
72
|
-
"@modern-js/
|
|
73
|
-
"@modern-js/
|
|
66
|
+
"@modern-js/builder": "2.0.0-beta.6",
|
|
67
|
+
"@modern-js/builder-plugin-esbuild": "2.0.0-beta.6",
|
|
68
|
+
"@modern-js/builder-plugin-node-polyfill": "2.0.0-beta.6",
|
|
69
|
+
"@modern-js/builder-shared": "2.0.0-beta.6",
|
|
70
|
+
"@modern-js/builder-webpack-provider": "2.0.0-beta.6",
|
|
71
|
+
"@modern-js/core": "2.0.0-beta.6",
|
|
72
|
+
"@modern-js/new-action": "2.0.0-beta.6",
|
|
73
|
+
"@modern-js/node-bundle-require": "2.0.0-beta.6",
|
|
74
|
+
"@modern-js/plugin": "2.0.0-beta.6",
|
|
75
|
+
"@modern-js/plugin-data-loader": "2.0.0-beta.6",
|
|
76
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.6",
|
|
77
|
+
"@modern-js/plugin-lint": "2.0.0-beta.6",
|
|
78
|
+
"@modern-js/prod-server": "2.0.0-beta.6",
|
|
79
|
+
"@modern-js/server": "2.0.0-beta.6",
|
|
80
|
+
"@modern-js/types": "2.0.0-beta.6",
|
|
81
|
+
"@modern-js/upgrade": "2.0.0-beta.6",
|
|
82
|
+
"@modern-js/utils": "2.0.0-beta.6",
|
|
83
|
+
"es-module-lexer": "^1.1.0",
|
|
84
|
+
"esbuild": "0.15.7"
|
|
74
85
|
},
|
|
75
86
|
"devDependencies": {
|
|
87
|
+
"@modern-js/builder-plugin-swc": "2.0.0-beta.6",
|
|
88
|
+
"@modern-js/server-core": "2.0.0-beta.6",
|
|
89
|
+
"@scripts/build": "2.0.0-beta.6",
|
|
90
|
+
"@scripts/jest-config": "2.0.0-beta.6",
|
|
76
91
|
"@types/babel__traverse": "^7.14.2",
|
|
77
92
|
"@types/jest": "^27",
|
|
78
93
|
"@types/node": "^14",
|
|
79
94
|
"jest": "^27",
|
|
80
95
|
"typescript": "^4",
|
|
81
|
-
"
|
|
82
|
-
"@scripts/build": "1.22.2",
|
|
83
|
-
"@scripts/jest-config": "1.22.2"
|
|
96
|
+
"webpack": "^5.75.0"
|
|
84
97
|
},
|
|
85
98
|
"sideEffects": false,
|
|
86
99
|
"publishConfig": {
|
|
87
100
|
"registry": "https://registry.npmjs.org/",
|
|
88
101
|
"access": "public"
|
|
89
102
|
},
|
|
90
|
-
"wireit": {
|
|
91
|
-
"build": {
|
|
92
|
-
"command": "modern build",
|
|
93
|
-
"files": [
|
|
94
|
-
"src/**/*",
|
|
95
|
-
"tsconfig.json",
|
|
96
|
-
"package.json"
|
|
97
|
-
],
|
|
98
|
-
"output": [
|
|
99
|
-
"dist/**/*"
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
"test": {
|
|
103
|
-
"command": "jest --passWithNoTests",
|
|
104
|
-
"files": [
|
|
105
|
-
"src/**/*",
|
|
106
|
-
"tsconfig.json",
|
|
107
|
-
"package.json",
|
|
108
|
-
"tests/**/*"
|
|
109
|
-
],
|
|
110
|
-
"output": []
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
103
|
"scripts": {
|
|
114
|
-
"new": "modern new",
|
|
115
|
-
"dev": "modern build --watch",
|
|
116
|
-
"build": "
|
|
117
|
-
"test": "
|
|
118
|
-
}
|
|
104
|
+
"new": "modern-lib new",
|
|
105
|
+
"dev": "modern-lib build --watch",
|
|
106
|
+
"build": "modern-lib build",
|
|
107
|
+
"test": "jest --passWithNoTests"
|
|
108
|
+
},
|
|
109
|
+
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
|
119
110
|
}
|