Skip to content

Commit 8e8132c

Browse files
committed
moving json schema out of extension-registry
1 parent 78544db commit 8e8132c

File tree

5 files changed

+142
-25
lines changed

5 files changed

+142
-25
lines changed

devops/json-schema-generator/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { writeFileSync } from 'fs';
2+
import { format, resolveConfig } from 'prettier';
3+
import { createImportMap } from '../importmap/index.js';
4+
5+
const tsPath = './src/all-packages.ts';
6+
7+
const importmap = createImportMap({
8+
rootDir: './src',
9+
replaceModuleExtensions: true,
10+
});
11+
12+
const paths = Object.keys(importmap.imports);
13+
14+
const content = `
15+
${
16+
paths.map(path => `import '${path}';`).join('\n')
17+
}
18+
`;
19+
20+
//const config = await resolveConfig('./.prettierrc.json');
21+
//const formattedContent = await format(content, { ...config, parser: 'json' });
22+
23+
writeFileSync(tsPath, content);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@
160160
"generate:server-api": "openapi-ts --file devops/openapi-ts/openapi-ts.config.js",
161161
"generate:icons": "node ./devops/icons/index.js",
162162
"generate:overrides": "node ./devops/tsc/index.js",
163-
"generate:jsonschema:dist": "typescript-json-schema --required --include \"./src/packages/core/extension-registry/umbraco-package.ts\" --out dist-cms/umbraco-package-schema.json tsconfig.json UmbracoPackage",
164-
"generate:jsonschema": "typescript-json-schema --required --include \"./src/packages/core/extension-registry/*.ts\"",
163+
"generate:jsonschema:imports": "node ./devops/json-schema-generator/index.js",
164+
"generate:jsonschema:dist": "typescript-json-schema --required --include \"./src/umbraco-package-schema.ts\" --out dist-cms/umbraco-package-schema.json tsconfig.json UmbracoPackage",
165+
"generate:jsonschema": "typescript-json-schema --required --include \"./src/umbraco-package-schema.ts\"",
165166
"lint:errors": "npm run lint -- --quiet",
166167
"lint:fix": "npm run lint -- --fix",
167168
"lint": "eslint src",

src/all-packages.ts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
2+
import '@umbraco-cms/backoffice/app';
3+
import '@umbraco-cms/backoffice/class-api';
4+
import '@umbraco-cms/backoffice/context-api';
5+
import '@umbraco-cms/backoffice/controller-api';
6+
import '@umbraco-cms/backoffice/element-api';
7+
import '@umbraco-cms/backoffice/extension-api';
8+
import '@umbraco-cms/backoffice/formatting-api';
9+
import '@umbraco-cms/backoffice/localization-api';
10+
import '@umbraco-cms/backoffice/observable-api';
11+
import '@umbraco-cms/backoffice/action';
12+
import '@umbraco-cms/backoffice/audit-log';
13+
import '@umbraco-cms/backoffice/auth';
14+
import '@umbraco-cms/backoffice/block-custom-view';
15+
import '@umbraco-cms/backoffice/block-grid';
16+
import '@umbraco-cms/backoffice/block-list';
17+
import '@umbraco-cms/backoffice/block-rte';
18+
import '@umbraco-cms/backoffice/block-type';
19+
import '@umbraco-cms/backoffice/block';
20+
import '@umbraco-cms/backoffice/code-editor';
21+
import '@umbraco-cms/backoffice/collection';
22+
import '@umbraco-cms/backoffice/components';
23+
import '@umbraco-cms/backoffice/content-type';
24+
import '@umbraco-cms/backoffice/content';
25+
import '@umbraco-cms/backoffice/culture';
26+
import '@umbraco-cms/backoffice/picker';
27+
import '@umbraco-cms/backoffice/current-user';
28+
import '@umbraco-cms/backoffice/data-type';
29+
import '@umbraco-cms/backoffice/debug';
30+
import '@umbraco-cms/backoffice/dictionary';
31+
import '@umbraco-cms/backoffice/document-blueprint';
32+
import '@umbraco-cms/backoffice/document-type';
33+
import '@umbraco-cms/backoffice/document';
34+
import '@umbraco-cms/backoffice/entity-action';
35+
import '@umbraco-cms/backoffice/entity-bulk-action';
36+
import '@umbraco-cms/backoffice/entity';
37+
import '@umbraco-cms/backoffice/event';
38+
import '@umbraco-cms/backoffice/extension-registry';
39+
import '@umbraco-cms/backoffice/help';
40+
import '@umbraco-cms/backoffice/icon';
41+
import '@umbraco-cms/backoffice/id';
42+
import '@umbraco-cms/backoffice/imaging';
43+
import '@umbraco-cms/backoffice/language';
44+
import '@umbraco-cms/backoffice/lit-element';
45+
import '@umbraco-cms/backoffice/localization';
46+
import '@umbraco-cms/backoffice/log-viewer';
47+
import '@umbraco-cms/backoffice/markdown-editor';
48+
import '@umbraco-cms/backoffice/media-type';
49+
import '@umbraco-cms/backoffice/media';
50+
import '@umbraco-cms/backoffice/member-group';
51+
import '@umbraco-cms/backoffice/member-type';
52+
import '@umbraco-cms/backoffice/member';
53+
import '@umbraco-cms/backoffice/menu';
54+
import '@umbraco-cms/backoffice/modal';
55+
import '@umbraco-cms/backoffice/models';
56+
import '@umbraco-cms/backoffice/multi-url-picker';
57+
import '@umbraco-cms/backoffice/notification';
58+
import '@umbraco-cms/backoffice/object-type';
59+
import '@umbraco-cms/backoffice/package';
60+
import '@umbraco-cms/backoffice/partial-view';
61+
import '@umbraco-cms/backoffice/picker-input';
62+
import '@umbraco-cms/backoffice/property-action';
63+
import '@umbraco-cms/backoffice/property-editor';
64+
import '@umbraco-cms/backoffice/property-type';
65+
import '@umbraco-cms/backoffice/property';
66+
import '@umbraco-cms/backoffice/recycle-bin';
67+
import '@umbraco-cms/backoffice/relation-type';
68+
import '@umbraco-cms/backoffice/relations';
69+
import '@umbraco-cms/backoffice/repository';
70+
import '@umbraco-cms/backoffice/resources';
71+
import '@umbraco-cms/backoffice/router';
72+
import '@umbraco-cms/backoffice/script';
73+
import '@umbraco-cms/backoffice/search';
74+
import '@umbraco-cms/backoffice/section';
75+
import '@umbraco-cms/backoffice/server-file-system';
76+
import '@umbraco-cms/backoffice/settings';
77+
import '@umbraco-cms/backoffice/sorter';
78+
import '@umbraco-cms/backoffice/static-file';
79+
import '@umbraco-cms/backoffice/store';
80+
import '@umbraco-cms/backoffice/style';
81+
import '@umbraco-cms/backoffice/stylesheet';
82+
import '@umbraco-cms/backoffice/sysinfo';
83+
import '@umbraco-cms/backoffice/tags';
84+
import '@umbraco-cms/backoffice/template';
85+
import '@umbraco-cms/backoffice/temporary-file';
86+
import '@umbraco-cms/backoffice/themes';
87+
import '@umbraco-cms/backoffice/tiny-mce';
88+
import '@umbraco-cms/backoffice/tree';
89+
import '@umbraco-cms/backoffice/ufm';
90+
import '@umbraco-cms/backoffice/user-group';
91+
import '@umbraco-cms/backoffice/user-permission';
92+
import '@umbraco-cms/backoffice/user';
93+
import '@umbraco-cms/backoffice/utils';
94+
import '@umbraco-cms/backoffice/validation';
95+
import '@umbraco-cms/backoffice/variant';
96+
import '@umbraco-cms/backoffice/webhook';
97+
import '@umbraco-cms/backoffice/workspace';
98+
import '@umbraco-cms/backoffice/external/backend-api';
99+
import '@umbraco-cms/backoffice/external/base64-js';
100+
import '@umbraco-cms/backoffice/external/diff';
101+
import '@umbraco-cms/backoffice/external/dompurify';
102+
import '@umbraco-cms/backoffice/external/lit';
103+
import '@umbraco-cms/backoffice/external/marked';
104+
import '@umbraco-cms/backoffice/external/monaco-editor';
105+
import '@umbraco-cms/backoffice/external/openid';
106+
import '@umbraco-cms/backoffice/external/router-slot';
107+
import '@umbraco-cms/backoffice/external/rxjs';
108+
import '@umbraco-cms/backoffice/external/tinymce';
109+
import '@umbraco-cms/backoffice/external/uui';
110+
import '@umbraco-cms/backoffice/external/uuid';

src/packages/core/workspace/extensions/types.ts

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,11 @@ import type {
1414
} from './workspace-view.model.js';
1515
import type { ManifestWorkspace, ManifestWorkspaceRoutableKind } from './workspace.model.js';
1616

17-
export type {
18-
ManifestWorkspaceAction,
19-
MetaWorkspaceAction,
20-
ManifestWorkspaceActionDefaultKind,
21-
MetaWorkspaceActionDefaultKind,
22-
} from './workspace-action.model.js';
23-
export type {
24-
ManifestWorkspaceFooterApp,
25-
ManifestWorkspaceFooterAppMenuBreadcrumbKind,
26-
ManifestWorkspaceFooterAppVariantMenuBreadcrumbKind,
27-
} from './workspace-footer-app.model.js';
28-
export type {
29-
UmbWorkspaceViewElement,
30-
ManifestWorkspaceView,
31-
ManifestWorkspaceViewContentTypeDesignEditorKind,
32-
} from './workspace-view.model.js';
33-
export type { ManifestWorkspace, ManifestWorkspaceRoutableKind } from './workspace.model.js';
34-
export type {
35-
ManifestWorkspaceActionMenuItem,
36-
ManifestWorkspaceActionMenuItemDefaultKind,
37-
MetaWorkspaceActionMenuItemDefaultKind,
38-
} from './workspace-action-menu-item.model.js';
17+
export type * from './workspace-action.model.js';
18+
export type * from './workspace-footer-app.model.js';
19+
export type * from './workspace-view.model.js';
20+
export type * from './workspace.model.js';
21+
export type * from './workspace-action-menu-item.model.js';
3922

4023
export type ManifestWorkspaceFooterApps =
4124
| ManifestWorkspaceFooterApp

src/packages/core/extension-registry/umbraco-package.ts renamed to src/umbraco-package-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './models/index.js';
1+
import './all-packages.js';
22

33
/**
44
* Umbraco package manifest JSON

0 commit comments

Comments
 (0)