@ui5/webcomponents-ngx 0.0.1-rc.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/README.md +3 -0
- package/esm2020/fiori/directives/bar.mjs +36 -0
- package/esm2020/fiori/directives/barcode-scanner-dialog.mjs +35 -0
- package/esm2020/fiori/directives/dynamic-side-content.mjs +80 -0
- package/esm2020/fiori/directives/filter-item-option.mjs +38 -0
- package/esm2020/fiori/directives/filter-item.mjs +33 -0
- package/esm2020/fiori/directives/flexible-column-layout.mjs +107 -0
- package/esm2020/fiori/directives/illustrated-message.mjs +68 -0
- package/esm2020/fiori/directives/media-gallery-item.mjs +49 -0
- package/esm2020/fiori/directives/media-gallery.mjs +72 -0
- package/esm2020/fiori/directives/notification-action.mjs +54 -0
- package/esm2020/fiori/directives/notification-list-group-item.mjs +104 -0
- package/esm2020/fiori/directives/notification-list-item-base.mjs +85 -0
- package/esm2020/fiori/directives/notification-list-item.mjs +99 -0
- package/esm2020/fiori/directives/page.mjs +60 -0
- package/esm2020/fiori/directives/product-switch-item.mjs +66 -0
- package/esm2020/fiori/directives/product-switch.mjs +22 -0
- package/esm2020/fiori/directives/shell-bar-item.mjs +50 -0
- package/esm2020/fiori/directives/shell-bar.mjs +171 -0
- package/esm2020/fiori/directives/side-navigation-item.mjs +62 -0
- package/esm2020/fiori/directives/side-navigation-sub-item.mjs +46 -0
- package/esm2020/fiori/directives/side-navigation.mjs +40 -0
- package/esm2020/fiori/directives/sort-item.mjs +38 -0
- package/esm2020/fiori/directives/timeline-item.mjs +66 -0
- package/esm2020/fiori/directives/timeline.mjs +38 -0
- package/esm2020/fiori/directives/upload-collection-item.mjs +124 -0
- package/esm2020/fiori/directives/upload-collection.mjs +75 -0
- package/esm2020/fiori/directives/view-settings-dialog.mjs +52 -0
- package/esm2020/fiori/directives/wizard-step.mjs +70 -0
- package/esm2020/fiori/directives/wizard.mjs +26 -0
- package/esm2020/fiori/ui5-fiori.module.mjs +134 -0
- package/esm2020/generic-cva.mjs +41 -0
- package/esm2020/index.mjs +114 -0
- package/esm2020/main/directives/avatar-group.mjs +56 -0
- package/esm2020/main/directives/avatar.mjs +81 -0
- package/esm2020/main/directives/badge.mjs +33 -0
- package/esm2020/main/directives/breadcrumbs-item.mjs +46 -0
- package/esm2020/main/directives/breadcrumbs.mjs +42 -0
- package/esm2020/main/directives/busy-indicator.mjs +54 -0
- package/esm2020/main/directives/button.mjs +98 -0
- package/esm2020/main/directives/calendar-date.mjs +30 -0
- package/esm2020/main/directives/calendar.mjs +88 -0
- package/esm2020/main/directives/card-header.mjs +64 -0
- package/esm2020/main/directives/card.mjs +41 -0
- package/esm2020/main/directives/carousel.mjs +85 -0
- package/esm2020/main/directives/check-box.mjs +154 -0
- package/esm2020/main/directives/color-palette-item.mjs +30 -0
- package/esm2020/main/directives/color-palette-popover.mjs +67 -0
- package/esm2020/main/directives/color-palette.mjs +26 -0
- package/esm2020/main/directives/color-picker.mjs +34 -0
- package/esm2020/main/directives/combo-box-group-item.mjs +30 -0
- package/esm2020/main/directives/combo-box-item.mjs +38 -0
- package/esm2020/main/directives/combo-box.mjs +158 -0
- package/esm2020/main/directives/custom-list-item.mjs +53 -0
- package/esm2020/main/directives/date-picker.mjs +242 -0
- package/esm2020/main/directives/date-range-picker.mjs +274 -0
- package/esm2020/main/directives/date-time-picker.mjs +242 -0
- package/esm2020/main/directives/day-picker.mjs +111 -0
- package/esm2020/main/directives/dialog.mjs +160 -0
- package/esm2020/main/directives/file-uploader.mjs +141 -0
- package/esm2020/main/directives/group-header-list-item.mjs +38 -0
- package/esm2020/main/directives/icon.mjs +62 -0
- package/esm2020/main/directives/input.mjs +210 -0
- package/esm2020/main/directives/label.mjs +54 -0
- package/esm2020/main/directives/link.mjs +98 -0
- package/esm2020/main/directives/list.mjs +146 -0
- package/esm2020/main/directives/menu-item.mjs +70 -0
- package/esm2020/main/directives/menu.mjs +40 -0
- package/esm2020/main/directives/message-strip.mjs +53 -0
- package/esm2020/main/directives/month-picker.mjs +95 -0
- package/esm2020/main/directives/multi-combo-box-group-item.mjs +30 -0
- package/esm2020/main/directives/multi-combo-box-item.mjs +46 -0
- package/esm2020/main/directives/multi-combo-box.mjs +177 -0
- package/esm2020/main/directives/multi-input.mjs +227 -0
- package/esm2020/main/directives/option.mjs +62 -0
- package/esm2020/main/directives/panel.mjs +85 -0
- package/esm2020/main/directives/popover.mjs +192 -0
- package/esm2020/main/directives/progress-indicator.mjs +62 -0
- package/esm2020/main/directives/radio-button.mjs +154 -0
- package/esm2020/main/directives/range-slider.mjs +195 -0
- package/esm2020/main/directives/rating-indicator.mjs +66 -0
- package/esm2020/main/directives/responsive-popover.mjs +192 -0
- package/esm2020/main/directives/segmented-button-item.mjs +106 -0
- package/esm2020/main/directives/segmented-button.mjs +42 -0
- package/esm2020/main/directives/select.mjs +85 -0
- package/esm2020/main/directives/slider-base.mjs +135 -0
- package/esm2020/main/directives/slider.mjs +183 -0
- package/esm2020/main/directives/split-button.mjs +69 -0
- package/esm2020/main/directives/standard-list-item.mjs +101 -0
- package/esm2020/main/directives/step-input.mjs +133 -0
- package/esm2020/main/directives/suggestion-group-item.mjs +30 -0
- package/esm2020/main/directives/suggestion-item.mjs +86 -0
- package/esm2020/main/directives/switch.mjs +130 -0
- package/esm2020/main/directives/tab-container.mjs +96 -0
- package/esm2020/main/directives/tab-separator.mjs +25 -0
- package/esm2020/main/directives/tab.mjs +76 -0
- package/esm2020/main/directives/table-cell.mjs +22 -0
- package/esm2020/main/directives/table-column.mjs +46 -0
- package/esm2020/main/directives/table-group-row.mjs +22 -0
- package/esm2020/main/directives/table-row.mjs +46 -0
- package/esm2020/main/directives/table.mjs +126 -0
- package/esm2020/main/directives/text-area.mjs +144 -0
- package/esm2020/main/directives/time-picker.mjs +143 -0
- package/esm2020/main/directives/title.mjs +38 -0
- package/esm2020/main/directives/toast.mjs +41 -0
- package/esm2020/main/directives/toggle-button.mjs +106 -0
- package/esm2020/main/directives/token.mjs +53 -0
- package/esm2020/main/directives/tree-item-custom.mjs +115 -0
- package/esm2020/main/directives/tree-item.mjs +120 -0
- package/esm2020/main/directives/tree.mjs +104 -0
- package/esm2020/main/directives/wheel-slider.mjs +62 -0
- package/esm2020/main/directives/year-picker.mjs +95 -0
- package/esm2020/main/ui5-main.module.mjs +376 -0
- package/esm2020/main/ui5-webcomponents-theming.module.mjs +21 -0
- package/esm2020/main/ui5-webcomponents-theming.service.mjs +34 -0
- package/esm2020/ui5-angular.module.mjs +22 -0
- package/esm2020/ui5-webcomponents-ngx.mjs +5 -0
- package/fesm2015/ui5-webcomponents-ngx.mjs +9375 -0
- package/fesm2015/ui5-webcomponents-ngx.mjs.map +1 -0
- package/fesm2020/ui5-webcomponents-ngx.mjs +9368 -0
- package/fesm2020/ui5-webcomponents-ngx.mjs.map +1 -0
- package/fiori/directives/bar.d.ts +20 -0
- package/fiori/directives/barcode-scanner-dialog.d.ts +33 -0
- package/fiori/directives/dynamic-side-content.d.ts +49 -0
- package/fiori/directives/filter-item-option.d.ts +19 -0
- package/fiori/directives/filter-item.d.ts +19 -0
- package/fiori/directives/flexible-column-layout.d.ts +63 -0
- package/fiori/directives/illustrated-message.d.ts +32 -0
- package/fiori/directives/media-gallery-item.d.ts +24 -0
- package/fiori/directives/media-gallery.d.ts +43 -0
- package/fiori/directives/notification-action.d.ts +25 -0
- package/fiori/directives/notification-list-group-item.d.ts +54 -0
- package/fiori/directives/notification-list-item-base.d.ts +46 -0
- package/fiori/directives/notification-list-item.d.ts +54 -0
- package/fiori/directives/page.d.ts +30 -0
- package/fiori/directives/product-switch-item.d.ts +37 -0
- package/fiori/directives/product-switch.d.ts +13 -0
- package/fiori/directives/shell-bar-item.d.ts +33 -0
- package/fiori/directives/shell-bar.d.ts +106 -0
- package/fiori/directives/side-navigation-item.d.ts +28 -0
- package/fiori/directives/side-navigation-sub-item.d.ts +22 -0
- package/fiori/directives/side-navigation.d.ts +32 -0
- package/fiori/directives/sort-item.d.ts +19 -0
- package/fiori/directives/timeline-item.d.ts +37 -0
- package/fiori/directives/timeline.d.ts +19 -0
- package/fiori/directives/upload-collection-item.d.ts +65 -0
- package/fiori/directives/upload-collection.d.ts +49 -0
- package/fiori/directives/view-settings-dialog.d.ts +51 -0
- package/fiori/directives/wizard-step.d.ts +31 -0
- package/fiori/directives/wizard.d.ts +26 -0
- package/fiori/ui5-fiori.module.d.ts +36 -0
- package/generic-cva.d.ts +27 -0
- package/index.d.ts +113 -0
- package/main/directives/avatar-group.d.ts +38 -0
- package/main/directives/avatar.d.ts +36 -0
- package/main/directives/badge.d.ts +19 -0
- package/main/directives/breadcrumbs-item.d.ts +22 -0
- package/main/directives/breadcrumbs.d.ts +34 -0
- package/main/directives/busy-indicator.d.ts +25 -0
- package/main/directives/button.d.ts +53 -0
- package/main/directives/calendar-date.d.ts +16 -0
- package/main/directives/calendar.d.ts +50 -0
- package/main/directives/card-header.d.ts +38 -0
- package/main/directives/card.d.ts +21 -0
- package/main/directives/carousel.d.ts +47 -0
- package/main/directives/check-box.d.ts +62 -0
- package/main/directives/color-palette-item.d.ts +16 -0
- package/main/directives/color-palette-popover.d.ts +42 -0
- package/main/directives/color-palette.d.ts +24 -0
- package/main/directives/color-picker.d.ts +25 -0
- package/main/directives/combo-box-group-item.d.ts +16 -0
- package/main/directives/combo-box-item.d.ts +19 -0
- package/main/directives/combo-box.d.ts +70 -0
- package/main/directives/custom-list-item.d.ts +34 -0
- package/main/directives/date-picker.d.ts +115 -0
- package/main/directives/date-range-picker.d.ts +127 -0
- package/main/directives/date-time-picker.d.ts +115 -0
- package/main/directives/day-picker.d.ts +60 -0
- package/main/directives/dialog.d.ts +90 -0
- package/main/directives/file-uploader.d.ts +60 -0
- package/main/directives/group-header-list-item.d.ts +19 -0
- package/main/directives/icon.d.ts +28 -0
- package/main/directives/input.d.ts +98 -0
- package/main/directives/label.d.ts +25 -0
- package/main/directives/link.d.ts +57 -0
- package/main/directives/list.d.ts +85 -0
- package/main/directives/menu-item.d.ts +31 -0
- package/main/directives/menu.d.ts +32 -0
- package/main/directives/message-strip.d.ts +34 -0
- package/main/directives/month-picker.d.ts +54 -0
- package/main/directives/multi-combo-box-group-item.d.ts +16 -0
- package/main/directives/multi-combo-box-item.d.ts +22 -0
- package/main/directives/multi-combo-box.d.ts +78 -0
- package/main/directives/multi-input.d.ts +110 -0
- package/main/directives/option.d.ts +28 -0
- package/main/directives/panel.d.ts +45 -0
- package/main/directives/popover.d.ts +102 -0
- package/main/directives/progress-indicator.d.ts +28 -0
- package/main/directives/radio-button.d.ts +62 -0
- package/main/directives/range-slider.d.ts +89 -0
- package/main/directives/rating-indicator.d.ts +37 -0
- package/main/directives/responsive-popover.d.ts +102 -0
- package/main/directives/segmented-button-item.d.ts +52 -0
- package/main/directives/segmented-button.d.ts +31 -0
- package/main/directives/select.d.ts +48 -0
- package/main/directives/slider-base.d.ts +76 -0
- package/main/directives/slider.d.ts +86 -0
- package/main/directives/split-button.d.ts +39 -0
- package/main/directives/standard-list-item.d.ts +52 -0
- package/main/directives/step-input.d.ts +63 -0
- package/main/directives/suggestion-group-item.d.ts +16 -0
- package/main/directives/suggestion-item.d.ts +37 -0
- package/main/directives/switch.d.ts +53 -0
- package/main/directives/tab-container.d.ts +56 -0
- package/main/directives/tab-separator.d.ts +15 -0
- package/main/directives/tab.d.ts +36 -0
- package/main/directives/table-cell.d.ts +13 -0
- package/main/directives/table-column.d.ts +22 -0
- package/main/directives/table-group-row.d.ts +13 -0
- package/main/directives/table-row.d.ts +22 -0
- package/main/directives/table.d.ts +71 -0
- package/main/directives/text-area.d.ts +68 -0
- package/main/directives/time-picker.d.ts +64 -0
- package/main/directives/title.d.ts +19 -0
- package/main/directives/toast.d.ts +21 -0
- package/main/directives/toggle-button.d.ts +52 -0
- package/main/directives/token.d.ts +34 -0
- package/main/directives/tree-item-custom.d.ts +59 -0
- package/main/directives/tree-item.d.ts +60 -0
- package/main/directives/tree.d.ts +74 -0
- package/main/directives/wheel-slider.d.ts +28 -0
- package/main/directives/year-picker.d.ts +54 -0
- package/main/ui5-main.module.d.ts +86 -0
- package/main/ui5-webcomponents-theming.module.d.ts +9 -0
- package/main/ui5-webcomponents-theming.service.d.ts +16 -0
- package/package.json +51 -0
- package/schematics/add-dependencies/index.d.ts +3 -0
- package/schematics/add-dependencies/index.js +31 -0
- package/schematics/add-dependencies/index.js.map +1 -0
- package/schematics/add-dependencies/index.ts +24 -0
- package/schematics/add-dependencies/schema.json +15 -0
- package/schematics/add-styles/index.d.ts +3 -0
- package/schematics/add-styles/index.js +38 -0
- package/schematics/add-styles/index.js.map +1 -0
- package/schematics/add-styles/index.ts +34 -0
- package/schematics/add-styles/schema.json +15 -0
- package/schematics/add-theming/index.d.ts +5 -0
- package/schematics/add-theming/index.js +91 -0
- package/schematics/add-theming/index.js.map +1 -0
- package/schematics/add-theming/index.ts +116 -0
- package/schematics/add-theming/schema.json +15 -0
- package/schematics/collection.json +34 -0
- package/schematics/ng-add/available-themes.d.ts +4 -0
- package/schematics/ng-add/available-themes.js +38 -0
- package/schematics/ng-add/available-themes.js.map +1 -0
- package/schematics/ng-add/available-themes.ts +34 -0
- package/schematics/ng-add/common-css-parts.d.ts +4 -0
- package/schematics/ng-add/common-css-parts.js +46 -0
- package/schematics/ng-add/common-css-parts.js.map +1 -0
- package/schematics/ng-add/common-css-parts.ts +42 -0
- package/schematics/ng-add/index.d.ts +4 -0
- package/schematics/ng-add/index.js +93 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/index.ts +92 -0
- package/schematics/ng-add/schema.json +16 -0
- package/schematics/schema.d.ts +6 -0
- package/schematics/schema.js +3 -0
- package/schematics/schema.js.map +1 -0
- package/schematics/schema.ts +6 -0
- package/schematics/types.d.ts +1 -0
- package/schematics/utils/package-config.d.ts +5 -0
- package/schematics/utils/package-config.js +45 -0
- package/schematics/utils/package-config.js.map +1 -0
- package/schematics/utils/package-config.ts +55 -0
- package/schematics/utils/promt.d.ts +1 -0
- package/schematics/utils/promt.js +22 -0
- package/schematics/utils/promt.js.map +1 -0
- package/schematics/utils/promt.ts +6 -0
- package/ui5-angular.module.d.ts +10 -0
- package/ui5-webcomponents-ngx-v0.0.1-rc.0.tgz +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Rule,
|
|
3
|
+
SchematicContext,
|
|
4
|
+
Tree,
|
|
5
|
+
chain,
|
|
6
|
+
schematic
|
|
7
|
+
} from '@angular-devkit/schematics';
|
|
8
|
+
import { RunSchematicTask } from '@angular-devkit/schematics/tasks';
|
|
9
|
+
import { Schema } from '../schema';
|
|
10
|
+
import { askQuestion } from '../utils/promt';
|
|
11
|
+
import { AvailableThemes } from './available-themes';
|
|
12
|
+
import { CommonCssParts } from './common-css-parts';
|
|
13
|
+
|
|
14
|
+
export function ngAdd(options: Schema): Rule {
|
|
15
|
+
return async (_: Tree, context: SchematicContext) => {
|
|
16
|
+
const userConfig = await collectConfig();
|
|
17
|
+
options = { ...options, ...userConfig };
|
|
18
|
+
|
|
19
|
+
console.log(options);
|
|
20
|
+
// First, queue dependency installation task.
|
|
21
|
+
const dependenciesTaskId = context.addTask(new RunSchematicTask('add-dependencies', options));
|
|
22
|
+
|
|
23
|
+
// Wait for dependencies to be installed and proceed with main schematics.
|
|
24
|
+
context.addTask(new RunSchematicTask('proceed-with-schematics', options), [dependenciesTaskId]);
|
|
25
|
+
|
|
26
|
+
return chain([]);
|
|
27
|
+
|
|
28
|
+
// return tree;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function collectConfig(): Promise<Partial<Schema>> {
|
|
33
|
+
const schema: Partial<Schema> = {
|
|
34
|
+
commonCss: [],
|
|
35
|
+
defaultTheme: 'sap_horizon'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const includeCommonCss = await askCommonCssDependency();
|
|
39
|
+
|
|
40
|
+
if (includeCommonCss) {
|
|
41
|
+
schema.commonCss = await askCommonCssParts();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
schema.theming = await askThemingDependency();
|
|
45
|
+
|
|
46
|
+
if (schema.theming) {
|
|
47
|
+
schema.defaultTheme = await askDefaultTheme();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return schema;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function askCommonCssDependency(): Promise<boolean> {
|
|
54
|
+
return await askQuestion({
|
|
55
|
+
type: 'confirm',
|
|
56
|
+
message: 'Would you like to add Common CSS into your application?',
|
|
57
|
+
default: false,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function askCommonCssParts(): Promise<string[]> {
|
|
62
|
+
return await askQuestion({
|
|
63
|
+
type: 'checkbox',
|
|
64
|
+
message: 'Please select desired Common CSS features',
|
|
65
|
+
choices: CommonCssParts,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function askThemingDependency(): Promise<boolean> {
|
|
70
|
+
return await askQuestion({
|
|
71
|
+
type: 'confirm',
|
|
72
|
+
message:
|
|
73
|
+
'Would you like to add Theming capabilities into your application?',
|
|
74
|
+
default: true,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function askDefaultTheme(): Promise<string> {
|
|
79
|
+
return await askQuestion({
|
|
80
|
+
type: 'list',
|
|
81
|
+
message: 'Please select desired Common CSS features',
|
|
82
|
+
default: 'sap_horizon',
|
|
83
|
+
choices: AvailableThemes,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function proceedWithSchematics(options: Schema): Rule {
|
|
88
|
+
return chain([
|
|
89
|
+
schematic('add-styles', options),
|
|
90
|
+
schematic('add-theming', options)
|
|
91
|
+
]);
|
|
92
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "SchematicsMySchematic",
|
|
4
|
+
"title": "My Schematic Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the project.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": []
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../libs/ui5-angular/schematics/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'inquirer';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
3
|
+
export declare function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree;
|
|
4
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
5
|
+
export declare function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPackageVersionFromPackageJson = exports.addPackageToPackageJson = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sorts the keys of the given object.
|
|
6
|
+
* @returns A new object instance with sorted keys
|
|
7
|
+
*/
|
|
8
|
+
function sortObjectByKeys(obj) {
|
|
9
|
+
return Object.keys(obj)
|
|
10
|
+
.sort()
|
|
11
|
+
.reduce((result, key) => {
|
|
12
|
+
result[key] = obj[key];
|
|
13
|
+
return result;
|
|
14
|
+
}, {});
|
|
15
|
+
}
|
|
16
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
17
|
+
function addPackageToPackageJson(host, pkg, version) {
|
|
18
|
+
if (host.exists('package.json')) {
|
|
19
|
+
const sourceText = host.read('package.json').toString('utf-8');
|
|
20
|
+
const json = JSON.parse(sourceText);
|
|
21
|
+
if (!json.dependencies) {
|
|
22
|
+
json.dependencies = {};
|
|
23
|
+
}
|
|
24
|
+
if (!json.dependencies[pkg]) {
|
|
25
|
+
json.dependencies[pkg] = version;
|
|
26
|
+
json.dependencies = sortObjectByKeys(json.dependencies);
|
|
27
|
+
}
|
|
28
|
+
host.overwrite('package.json', JSON.stringify(json, null, 2));
|
|
29
|
+
}
|
|
30
|
+
return host;
|
|
31
|
+
}
|
|
32
|
+
exports.addPackageToPackageJson = addPackageToPackageJson;
|
|
33
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
34
|
+
function getPackageVersionFromPackageJson(tree, name) {
|
|
35
|
+
if (!tree.exists('package.json')) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const packageJson = JSON.parse(tree.read('package.json').toString('utf8'));
|
|
39
|
+
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
|
40
|
+
return packageJson.dependencies[name];
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
|
|
45
|
+
//# sourceMappingURL=package-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/utils/package-config.ts"],"names":[],"mappings":";;;AAOA;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAA2B;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAA4B,CAAC,CAAC;AACrC,CAAC;AAED,iEAAiE;AACjE,SAAgB,uBAAuB,CAAC,IAAU,EAAE,GAAW,EAAE,OAAe;IAC9E,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAgB,CAAC;QAEnD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;SACxB;QAED,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;YAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;YACjC,IAAI,CAAC,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACzD;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/D;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAlBD,0DAkBC;AAED,kGAAkG;AAClG,SAAgB,gCAAgC,CAAC,IAAU,EAAE,IAAY;IACvE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAChC,OAAO,IAAI,CAAC;KACb;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAgB,CAAC;IAE3F,IAAI,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;QAC9D,OAAO,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;KACvC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAZD,4EAYC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {Tree} from '@angular-devkit/schematics';
|
|
2
|
+
|
|
3
|
+
interface PackageJson {
|
|
4
|
+
dependencies: Record<string, string>;
|
|
5
|
+
devDependencies: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Sorts the keys of the given object.
|
|
10
|
+
* @returns A new object instance with sorted keys
|
|
11
|
+
*/
|
|
12
|
+
function sortObjectByKeys(obj: Record<string, string>) {
|
|
13
|
+
return Object.keys(obj)
|
|
14
|
+
.sort()
|
|
15
|
+
.reduce((result, key) => {
|
|
16
|
+
result[key] = obj[key];
|
|
17
|
+
return result;
|
|
18
|
+
}, {} as Record<string, string>);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
22
|
+
export function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree {
|
|
23
|
+
if (host.exists('package.json')) {
|
|
24
|
+
const sourceText = host.read('package.json')!.toString('utf-8');
|
|
25
|
+
const json = JSON.parse(sourceText) as PackageJson;
|
|
26
|
+
|
|
27
|
+
if (!json.dependencies) {
|
|
28
|
+
json.dependencies = {};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!json.dependencies[pkg]) {
|
|
32
|
+
json.dependencies[pkg] = version;
|
|
33
|
+
json.dependencies = sortObjectByKeys(json.dependencies);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
host.overwrite('package.json', JSON.stringify(json, null, 2));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return host;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
43
|
+
export function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null {
|
|
44
|
+
if (!tree.exists('package.json')) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const packageJson = JSON.parse(tree.read('package.json')!.toString('utf8')) as PackageJson;
|
|
49
|
+
|
|
50
|
+
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
|
51
|
+
return packageJson.dependencies[name];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function askQuestion(config: any): Promise<any>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.askQuestion = void 0;
|
|
13
|
+
function askQuestion(config) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const { prompt } = yield Promise.resolve().then(() => require('inquirer'));
|
|
16
|
+
config.name = 'question';
|
|
17
|
+
const result = yield prompt([config]);
|
|
18
|
+
return result.question;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.askQuestion = askQuestion;
|
|
22
|
+
//# sourceMappingURL=promt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promt.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/utils/promt.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAsB,WAAW,CAAC,MAAW;;QAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,2CAAa,UAAU,EAAC,CAAC;QAC5C,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;CAAA;AALD,kCAKC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./fiori/ui5-fiori.module";
|
|
3
|
+
import * as i2 from "./main/ui5-main.module";
|
|
4
|
+
import * as i3 from "./main/ui5-webcomponents-theming.module";
|
|
5
|
+
declare class Ui5AngularModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Ui5AngularModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<Ui5AngularModule, never, [typeof i1.Ui5FioriModule, typeof i2.Ui5MainModule, typeof i3.Ui5WebcomponentsThemingModule], [typeof i1.Ui5FioriModule, typeof i2.Ui5MainModule, typeof i3.Ui5WebcomponentsThemingModule]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<Ui5AngularModule>;
|
|
9
|
+
}
|
|
10
|
+
export { Ui5AngularModule };
|
|
Binary file
|