Skip to content

Commit 7782c18

Browse files
committed
PATCH: Fix NMP build of @neos-project/neos-ui-extensibility by separating types declaration
otherwise typescript attempts to parse the whole neos ui repo and that fails
1 parent 89b7222 commit 7782c18

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

packages/neos-ui-extensibility/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"extensibilityMap.json"
1616
],
1717
"scripts": {
18-
"build": "yarn tsc --declaration"
18+
"build": "yarn tsc --declaration --noResolve"
1919
},
2020
"devDependencies": {
2121
"@neos-project/jest-preset-neos-ui": "workspace:*",

packages/neos-ui-extensibility/src/index.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
1-
import type {GlobalRegistry} from '@neos-project/neos-ui-registry';
21
import createConsumerApi from './createConsumerApi';
32
import readFromConsumerApi from './readFromConsumerApi';
43

5-
type BootstrapDependencies = {
6-
// correct store type depends on https://github.com/neos/neos-ui/pull/4010
7-
store: any;
8-
frontendConfiguration: Record<string, unknown>;
9-
configuration: Record<string, unknown>;
10-
routes: Record<string, unknown>;
11-
};
12-
13-
type Bootstrap = (
14-
globalRegistry: GlobalRegistry,
15-
bootstrapDependencies: BootstrapDependencies
16-
) => void;
17-
18-
const manifest: (
19-
identifier: string,
20-
// the age-old commit a2dae5b78a649ad75643f48b02b6df67f5915a58 introduced this parameter "options" though we not make use of it
21-
options: {},
22-
bootstrap: Bootstrap
23-
) => void = readFromConsumerApi('manifest');
24-
25-
export default manifest;
4+
export default readFromConsumerApi('manifest');
265

276
export {
287
createConsumerApi,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
/**
3+
* Dedicated types declaration as we cannot bundle the types GlobalRegistry, Configuration correctly for distributing "neos-ui-extensibility" via NMP
4+
* This file is not published.
5+
*/
6+
declare module '@neos-project/neos-ui-extensibility' {
7+
import type {GlobalRegistry} from '@neos-project/neos-ui-registry';
8+
9+
type BootstrapDependencies = {
10+
// correct store type depends on https://github.com/neos/neos-ui/pull/4010
11+
store: any;
12+
/** @deprecated use `import {getFrontendConfigurationForPackage} from '@neos-project/neos-ui-configuration'` instead */
13+
frontendConfiguration: Record<string, any>;
14+
configuration: Record<string, any>;
15+
routes: Record<string, unknown>;
16+
};
17+
18+
type Bootstrap = (
19+
globalRegistry: GlobalRegistry,
20+
bootstrapDependencies: BootstrapDependencies
21+
) => void;
22+
23+
export default function manifest(
24+
identifier: string,
25+
// the age-old commit a2dae5b78a649ad75643f48b02b6df67f5915a58 introduced this parameter "options" though we not make use of it
26+
options: {},
27+
bootstrap: Bootstrap
28+
): void;
29+
}

0 commit comments

Comments
 (0)