@webstir-io/webstir-frontend 0.1.40 → 0.1.41
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/README.md +124 -60
- package/dist/assets/imageOptimizer.js +10 -15
- package/dist/assets/precompression.js +1 -1
- package/dist/builders/contentBuilder.js +102 -90
- package/dist/builders/cssBuilder.js +25 -19
- package/dist/builders/htmlBuilder.js +57 -42
- package/dist/builders/index.js +1 -1
- package/dist/builders/jsBuilder.js +219 -76
- package/dist/builders/staticAssetsBuilder.js +27 -9
- package/dist/builders/types.d.ts +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +6 -30
- package/dist/config/manifest.js +7 -6
- package/dist/config/paths.js +2 -2
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.js +7 -6
- package/dist/config/setup.js +1 -1
- package/dist/config/workspace.js +11 -9
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.js +5 -5
- package/dist/core/diagnostics.js +1 -1
- package/dist/core/pages.js +4 -4
- package/dist/hooks.js +3 -3
- package/dist/html/criticalCss.js +6 -3
- package/dist/html/htmlSecurity.d.ts +6 -1
- package/dist/html/htmlSecurity.js +28 -14
- package/dist/html/lazyLoad.js +1 -1
- package/dist/html/pageScaffold.js +1 -1
- package/dist/html/resourceHints.js +5 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/inspect.d.ts +2 -0
- package/dist/inspect.js +110 -0
- package/dist/modes/ssg/metadata.js +4 -4
- package/dist/modes/ssg/routing.js +2 -5
- package/dist/modes/ssg/seo.js +5 -5
- package/dist/modes/ssg/views.js +17 -11
- package/dist/operations.js +18 -10
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +6 -1
- package/dist/provider.js +28 -24
- package/dist/runtime/boundary.d.ts +28 -0
- package/dist/runtime/boundary.js +247 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/types.d.ts +52 -0
- package/dist/utils/fs.d.ts +11 -10
- package/dist/utils/fs.js +48 -20
- package/dist/utils/glob.d.ts +8 -0
- package/dist/utils/glob.js +21 -0
- package/dist/utils/hash.js +1 -2
- package/dist/utils/pagePaths.js +2 -2
- package/package.json +19 -14
- package/scripts/publish.sh +2 -94
- package/scripts/update-contract.sh +12 -10
- package/src/assets/assetManifest.ts +39 -29
- package/src/assets/imageOptimizer.ts +91 -82
- package/src/assets/precompression.ts +22 -16
- package/src/builders/contentBuilder.ts +1224 -1149
- package/src/builders/cssBuilder.ts +466 -417
- package/src/builders/htmlBuilder.ts +511 -448
- package/src/builders/index.ts +7 -7
- package/src/builders/jsBuilder.ts +538 -280
- package/src/builders/staticAssetsBuilder.ts +166 -135
- package/src/builders/types.ts +7 -6
- package/src/cli.ts +66 -90
- package/src/config/manifest.ts +16 -14
- package/src/config/paths.ts +5 -5
- package/src/config/schema.ts +38 -37
- package/src/config/setup.ts +7 -7
- package/src/config/workspace.ts +118 -116
- package/src/config/workspaceManifest.ts +14 -14
- package/src/core/constants.ts +62 -62
- package/src/core/diagnostics.ts +26 -26
- package/src/core/pages.ts +19 -19
- package/src/hooks.ts +128 -118
- package/src/html/criticalCss.ts +84 -77
- package/src/html/htmlSecurity.ts +107 -66
- package/src/html/lazyLoad.ts +22 -19
- package/src/html/pageScaffold.ts +37 -28
- package/src/html/resourceHints.ts +83 -74
- package/src/index.ts +2 -0
- package/src/inspect.ts +158 -0
- package/src/modes/ssg/metadata.ts +53 -51
- package/src/modes/ssg/routing.ts +177 -177
- package/src/modes/ssg/seo.ts +208 -200
- package/src/modes/ssg/validation.ts +31 -25
- package/src/modes/ssg/views.ts +257 -238
- package/src/operations.ts +105 -95
- package/src/pipeline.ts +81 -69
- package/src/provider.ts +184 -176
- package/src/runtime/boundary.ts +325 -0
- package/src/runtime/index.ts +1 -0
- package/src/types.ts +107 -48
- package/src/utils/changedFile.ts +22 -22
- package/src/utils/fs.ts +73 -26
- package/src/utils/glob.ts +38 -0
- package/src/utils/hash.ts +2 -4
- package/src/utils/pagePaths.ts +35 -23
- package/src/utils/pathMatch.ts +26 -23
- package/tests/add-page-defaults.test.js +44 -39
- package/tests/bundlerParity.test.js +252 -0
- package/tests/cli.contract.test.js +13 -0
- package/tests/content-pages.test.js +108 -13
- package/tests/css-app-imports.test.js +22 -11
- package/tests/css-page-imports.test.js +26 -13
- package/tests/diagnostics.test.js +39 -36
- package/tests/features.test.js +48 -43
- package/tests/hooks.test.js +58 -42
- package/tests/htmlSecurity.test.js +66 -0
- package/tests/inspect.test.js +148 -0
- package/tests/provider.integration.test.js +71 -20
- package/tests/runtime.test.js +493 -0
- package/tests/ssg-defaults.test.js +284 -177
- package/tests/ssg-guardrails.test.js +51 -51
- package/tsconfig.json +3 -10
- package/dist/watch/frontendFiles.d.ts +0 -3
- package/dist/watch/frontendFiles.js +0 -25
- package/dist/watch/hotUpdateTracker.d.ts +0 -51
- package/dist/watch/hotUpdateTracker.js +0 -205
- package/dist/watch/pipelineHelpers.d.ts +0 -26
- package/dist/watch/pipelineHelpers.js +0 -177
- package/dist/watch/types.d.ts +0 -27
- package/dist/watch/types.js +0 -1
- package/dist/watch/watchCoordinator.d.ts +0 -36
- package/dist/watch/watchCoordinator.js +0 -551
- package/dist/watch/watchDaemon.d.ts +0 -17
- package/dist/watch/watchDaemon.js +0 -127
- package/dist/watch/watchReporter.d.ts +0 -21
- package/dist/watch/watchReporter.js +0 -64
- package/scripts/smoke.mjs +0 -35
- package/src/watch/frontendFiles.ts +0 -32
- package/src/watch/hotUpdateTracker.ts +0 -285
- package/src/watch/pipelineHelpers.ts +0 -242
- package/src/watch/types.ts +0 -23
- package/src/watch/watchCoordinator.ts +0 -666
- package/src/watch/watchDaemon.ts +0 -144
- package/src/watch/watchReporter.ts +0 -98
package/src/operations.ts
CHANGED
|
@@ -4,135 +4,145 @@ import { runPipeline } from './pipeline.js';
|
|
|
4
4
|
import { createPageScaffold } from './html/pageScaffold.js';
|
|
5
5
|
import { prepareWorkspaceConfig } from './config/setup.js';
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
applySsgRouting,
|
|
8
|
+
assertNoSsgRoutes,
|
|
9
|
+
ensureSsgViewMetadataForPage,
|
|
10
|
+
generateSsgViewData,
|
|
11
11
|
} from './modes/ssg/index.js';
|
|
12
12
|
import path from 'node:path';
|
|
13
13
|
import { FOLDERS } from './core/constants.js';
|
|
14
14
|
import { pathExists, readJson, remove } from './utils/fs.js';
|
|
15
15
|
|
|
16
16
|
export async function runBuild(options: FrontendCommandOptions): Promise<void> {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const config = await prepareWorkspaceConfig(options.workspaceRoot);
|
|
18
|
+
const enable = await readWorkspaceEnableFlags(options.workspaceRoot);
|
|
19
|
+
|
|
20
|
+
console.info('[webstir-frontend] Running build pipeline...');
|
|
21
|
+
await runPipeline(config, 'build', {
|
|
22
|
+
changedFile: options.changedFile,
|
|
23
|
+
enable,
|
|
24
|
+
env: process.env,
|
|
25
|
+
});
|
|
26
|
+
console.info('[webstir-frontend] Build pipeline completed.');
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export async function runPublish(options: FrontendCommandOptions): Promise<void> {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
const config = await prepareWorkspaceConfig(options.workspaceRoot);
|
|
31
|
+
const enable = await readWorkspaceEnableFlags(options.workspaceRoot);
|
|
32
|
+
const publishConfig = options.publishMode === 'ssg' ? applySsgPublishLayout(config) : config;
|
|
33
|
+
|
|
34
|
+
const modeLabel = options.publishMode === 'ssg' ? 'SSG publish' : 'publish';
|
|
35
|
+
console.info(`[webstir-frontend] Running ${modeLabel} pipeline...`);
|
|
36
|
+
|
|
37
|
+
if (options.publishMode === 'ssg') {
|
|
38
|
+
await assertNoSsgRoutes(config.paths.workspace);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
await runPipeline(publishConfig, 'publish', { enable, env: process.env });
|
|
42
|
+
if (options.publishMode === 'ssg') {
|
|
43
|
+
await generateSsgViewData(publishConfig);
|
|
44
|
+
await applySsgRouting(publishConfig);
|
|
45
|
+
await removeLegacyPagesFolder(publishConfig);
|
|
46
|
+
}
|
|
47
|
+
console.info(`[webstir-frontend] ${modeLabel} pipeline completed.`);
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
export async function runRebuild(options: FrontendCommandOptions): Promise<void> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const config = await prepareWorkspaceConfig(options.workspaceRoot);
|
|
52
|
+
const enable = await readWorkspaceEnableFlags(options.workspaceRoot);
|
|
53
|
+
|
|
54
|
+
console.info('[webstir-frontend] Running rebuild pipeline...');
|
|
55
|
+
await runPipeline(config, 'build', {
|
|
56
|
+
changedFile: options.changedFile,
|
|
57
|
+
enable,
|
|
58
|
+
env: process.env,
|
|
59
|
+
});
|
|
60
|
+
console.info('[webstir-frontend] Rebuild pipeline completed.');
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
export async function runAddPage(options: AddPageCommandOptions): Promise<void> {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
const config = await prepareWorkspaceConfig(options.workspaceRoot);
|
|
65
|
+
console.info('[webstir-frontend] Creating page scaffold...');
|
|
66
|
+
|
|
67
|
+
const isSsgWorkspace = await detectSsgWorkspace(options.workspaceRoot);
|
|
68
|
+
const effectiveSsg = options.ssg ?? isSsgWorkspace;
|
|
69
|
+
await createPageScaffold({
|
|
70
|
+
workspaceRoot: options.workspaceRoot,
|
|
71
|
+
pageName: options.pageName,
|
|
72
|
+
mode: effectiveSsg ? 'ssg' : 'standard',
|
|
73
|
+
paths: {
|
|
74
|
+
pages: config.paths.src.pages,
|
|
75
|
+
app: config.paths.src.app,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
if (effectiveSsg) {
|
|
79
|
+
await ensureSsgViewMetadataForPage({
|
|
80
|
+
workspaceRoot: options.workspaceRoot,
|
|
81
|
+
pageName: options.pageName,
|
|
69
82
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
workspaceRoot: options.workspaceRoot,
|
|
73
|
-
pageName: options.pageName
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
console.info('[webstir-frontend] Page scaffold created.');
|
|
83
|
+
}
|
|
84
|
+
console.info('[webstir-frontend] Page scaffold created.');
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
interface WorkspacePackageJsonMode {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
readonly webstir?: {
|
|
89
|
+
readonly mode?: string;
|
|
90
|
+
};
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
async function detectSsgWorkspace(workspaceRoot: string): Promise<boolean> {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
const pkgPath = path.join(workspaceRoot, 'package.json');
|
|
95
|
+
const pkg = await readJson<WorkspacePackageJsonMode>(pkgPath);
|
|
96
|
+
const mode = pkg?.webstir?.mode;
|
|
97
|
+
return typeof mode === 'string' && mode.toLowerCase() === 'ssg';
|
|
90
98
|
}
|
|
91
99
|
|
|
92
|
-
function applySsgPublishLayout(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
function applySsgPublishLayout(
|
|
101
|
+
config: import('./types.js').FrontendConfig,
|
|
102
|
+
): import('./types.js').FrontendConfig {
|
|
103
|
+
const distFrontend = config.paths.dist.frontend;
|
|
104
|
+
const distPages = distFrontend;
|
|
105
|
+
const distContent = path.join(distFrontend, 'docs');
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
...config,
|
|
109
|
+
paths: {
|
|
110
|
+
...config.paths,
|
|
111
|
+
dist: {
|
|
112
|
+
...config.paths.dist,
|
|
113
|
+
pages: distPages,
|
|
114
|
+
content: distContent,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
108
118
|
}
|
|
109
119
|
|
|
110
120
|
interface WorkspacePackageJsonEnable {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
readonly webstir?: {
|
|
122
|
+
readonly enable?: EnableFlags;
|
|
123
|
+
};
|
|
114
124
|
}
|
|
115
125
|
|
|
116
126
|
async function readWorkspaceEnableFlags(workspaceRoot: string): Promise<EnableFlags | undefined> {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
const pkgPath = path.join(workspaceRoot, 'package.json');
|
|
128
|
+
const pkg = await readJson<WorkspacePackageJsonEnable>(pkgPath);
|
|
129
|
+
return pkg?.webstir?.enable;
|
|
120
130
|
}
|
|
121
131
|
|
|
122
132
|
async function removeLegacyPagesFolder(config: import('./types.js').FrontendConfig): Promise<void> {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
const legacyPagesRoot = path.join(config.paths.dist.frontend, FOLDERS.pages);
|
|
134
|
+
if (legacyPagesRoot === config.paths.dist.pages) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
127
137
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
138
|
+
if (!(await pathExists(legacyPagesRoot))) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
131
141
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
142
|
+
const entries = await readdir(legacyPagesRoot);
|
|
143
|
+
if (entries.length > 0) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
136
146
|
|
|
137
|
-
|
|
147
|
+
await remove(legacyPagesRoot);
|
|
138
148
|
}
|
package/src/pipeline.ts
CHANGED
|
@@ -5,84 +5,96 @@ import type { Builder, BuilderContext } from './builders/types.js';
|
|
|
5
5
|
import { createHookContext, executeHooks, loadHooks } from './hooks.js';
|
|
6
6
|
|
|
7
7
|
export interface PipelineOptions {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
readonly changedFile?: string;
|
|
9
|
+
readonly enable?: EnableFlags;
|
|
10
|
+
readonly env?: Record<string, string | undefined>;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export type PipelineMode = 'build' | 'publish';
|
|
13
14
|
|
|
14
|
-
export async function runPipeline(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const end = performance.now();
|
|
53
|
-
const duration = end - start;
|
|
54
|
-
console.info(`[webstir-frontend] ${mode}:${builder.name} completed in ${duration.toFixed(1)}ms`);
|
|
55
|
-
|
|
56
|
-
if (builderError) {
|
|
57
|
-
throw builderError;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (afterHookError) {
|
|
61
|
-
throw afterHookError;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
} catch (error) {
|
|
65
|
-
pipelineError = error;
|
|
66
|
-
} finally {
|
|
67
|
-
try {
|
|
68
|
-
await executeHooks('pipeline.afterAll', hooks.pipelineAfter, pipelineContext);
|
|
69
|
-
} catch (hookError) {
|
|
70
|
-
if (!pipelineError) {
|
|
71
|
-
pipelineError = hookError;
|
|
72
|
-
}
|
|
15
|
+
export async function runPipeline(
|
|
16
|
+
config: FrontendConfig,
|
|
17
|
+
mode: PipelineMode,
|
|
18
|
+
options: PipelineOptions = {},
|
|
19
|
+
): Promise<void> {
|
|
20
|
+
const context: BuilderContext = {
|
|
21
|
+
config,
|
|
22
|
+
changedFile: options.changedFile,
|
|
23
|
+
enable: options.enable,
|
|
24
|
+
env: options.env,
|
|
25
|
+
};
|
|
26
|
+
const builders: Builder[] = createBuilders(context);
|
|
27
|
+
const hooks = await loadHooks(config.paths.workspace, mode === 'build');
|
|
28
|
+
const pipelineContext = createHookContext(config, mode, options.changedFile);
|
|
29
|
+
|
|
30
|
+
await executeHooks('pipeline.beforeAll', hooks.pipelineBefore, pipelineContext);
|
|
31
|
+
|
|
32
|
+
let pipelineError: unknown;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
for (const builder of builders) {
|
|
36
|
+
const builderContext = createHookContext(config, mode, options.changedFile, builder.name);
|
|
37
|
+
const beforeHooks = hooks.builderBefore.get(builder.name) ?? [];
|
|
38
|
+
const afterHooks = hooks.builderAfter.get(builder.name) ?? [];
|
|
39
|
+
|
|
40
|
+
await executeHooks(`builder.${builder.name}.before`, beforeHooks, builderContext);
|
|
41
|
+
|
|
42
|
+
const start = performance.now();
|
|
43
|
+
let builderError: Error | undefined;
|
|
44
|
+
let afterHookError: Error | undefined;
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
if (mode === 'build') {
|
|
48
|
+
await builder.build(context);
|
|
49
|
+
} else {
|
|
50
|
+
await builder.publish(context);
|
|
73
51
|
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
builderError = wrapPipelineError(builder.name, mode, error);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
await executeHooks(`builder.${builder.name}.after`, afterHooks, builderContext);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
afterHookError = error as Error;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const end = performance.now();
|
|
63
|
+
const duration = end - start;
|
|
64
|
+
console.info(
|
|
65
|
+
`[webstir-frontend] ${mode}:${builder.name} completed in ${duration.toFixed(1)}ms`,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
if (builderError) {
|
|
69
|
+
throw builderError;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (afterHookError) {
|
|
73
|
+
throw afterHookError;
|
|
74
|
+
}
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
} catch (error) {
|
|
77
|
+
pipelineError = error;
|
|
78
|
+
} finally {
|
|
79
|
+
try {
|
|
80
|
+
await executeHooks('pipeline.afterAll', hooks.pipelineAfter, pipelineContext);
|
|
81
|
+
} catch (hookError) {
|
|
82
|
+
if (!pipelineError) {
|
|
83
|
+
pipelineError = hookError;
|
|
84
|
+
}
|
|
78
85
|
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (pipelineError) {
|
|
89
|
+
throw pipelineError;
|
|
90
|
+
}
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
function wrapPipelineError(name: string, mode: PipelineMode, error: unknown): Error {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
if (error instanceof Error) {
|
|
95
|
+
error.message = `[${mode}:${name}] ${error.message}`;
|
|
96
|
+
return error;
|
|
97
|
+
}
|
|
86
98
|
|
|
87
|
-
|
|
99
|
+
return new Error(`[${mode}:${name}] ${String(error)}`);
|
|
88
100
|
}
|