@24i/bigscreen-sdk 1.0.4-alpha.2109 → 1.0.4-alpha.2113
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/package.json +1 -1
- package/packages/epg/README.md +1 -0
- package/packages/epg/src/v2/Epg.tsx +20 -2
- package/packages/epg/src/v2/IdleController.ts +25 -0
- package/packages/epg/src/v2/InputEvents.ts +7 -0
- package/packages/epg/src/v2/basic/RowsManager.tsx +2 -1
- package/packages/epg/src/v2/interface.ts +18 -1
- package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +1 -1
- package/packages/grid/src/interface.ts +2 -0
- package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.scss +1 -2
- package/packages/list/src/UnifiedListController/UnifiedListController.ts +1 -1
- package/packages/list/src/UnifiedListController/UnifiedVariedListController.ts +1 -1
- package/packages/list/src/interface.ts +5 -0
- package/packages/rnv-build-engine/dist/src/scripts/release/notifySlack/generateWebhoook.js +3 -2
- package/packages/rnv-build-engine/dist/src/scripts/release/notifySlack/makePayload.js +8 -1
- package/packages/rnv-build-engine/dist/src/scripts/utils/gitUtils.js +2 -2
- package/packages/rnv-build-engine/dist/src/sdks/sdk-tizen/sdkTizen.js +116 -44
- package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/sdkInstaller.js +4 -2
- package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/download.js +4 -6
- package/packages/rnv-build-engine/dist/src/sdks/sdk-webos/sdkWebos.js +73 -18
- package/packages/rnv-build-engine/dist/src/sdks/sdk-webpack/sdkWebpack.js +30 -4
- package/packages/rnv-build-engine/dist/src/sdks/sdk-xbox/sdkXbox.js +3 -2
- package/packages/rnv-build-engine/dist/src/tasks/engineTasks.js +0 -2
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.build.js +21 -13
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.configure.js +14 -11
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.configureSoft.js +1 -0
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.deploy.js +3 -3
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.hooks.run.js +2 -1
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.package.js +1 -0
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.project.configure.js +3 -3
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.start.js +3 -4
- package/packages/rnv-build-engine/dist/src/utils/mergeSvgAndPngIcons.js +2 -6
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/template.js +26 -3
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.base.js +5 -0
- package/packages/rnv-build-engine/dist/templates/platforms/entone/webpack.config.dev.js +63 -0
- package/packages/rnv-build-engine/dist/templates/platforms/entone/webpack.config.prod.js +58 -0
- package/packages/rnv-build-engine/dist/templates/platforms/hbbtv/webpack.config.dev.js +80 -0
- package/packages/rnv-build-engine/dist/templates/platforms/hbbtv/webpack.config.prod.js +75 -0
- package/packages/rnv-build-engine/dist/templates/platforms/kreatv/webpack.config.dev.js +63 -0
- package/packages/rnv-build-engine/dist/templates/platforms/kreatv/webpack.config.prod.js +58 -0
- package/packages/rnv-build-engine/dist/templates/platforms/saphi/webpack.config.dev.js +63 -0
- package/packages/rnv-build-engine/dist/templates/platforms/saphi/webpack.config.prod.js +58 -0
- package/packages/rnv-build-engine/dist/templates/platforms/tizen/webpack.config.dev.js +64 -0
- package/packages/rnv-build-engine/dist/templates/platforms/tizen/webpack.config.prod.js +58 -0
- package/packages/rnv-build-engine/dist/templates/platforms/webos/webpack.config.dev.js +65 -0
- package/packages/rnv-build-engine/dist/templates/platforms/webos/webpack.config.prod.js +58 -0
- package/packages/rnv-build-engine/dist/templates/platforms/webtv/webpack.config.dev.js +63 -0
- package/packages/rnv-build-engine/dist/templates/platforms/webtv/webpack.config.prod.js +58 -0
- package/packages/rnv-build-engine/dist/templates/platforms/xbox/webpack.config.dev.js +64 -0
- package/packages/rnv-build-engine/dist/templates/platforms/xbox/webpack.config.prod.js +58 -0
- package/packages/sdk-installer/dist/index.js +5 -0
- package/packages/sdk-installer/dist/sdkInstaller.js +38 -0
- package/packages/sdk-installer/dist/services/clean.js +11 -0
- package/packages/sdk-installer/dist/services/download.js +55 -0
- package/packages/sdk-installer/dist/services/index.js +11 -0
- package/packages/sdk-installer/dist/services/install.js +24 -0
- package/packages/sdk-installer/dist/services/unzip.js +12 -0
- package/packages/sdk-installer/dist/types/index.d.ts +1 -0
- package/packages/sdk-installer/dist/types/sdkInstaller.d.ts +7 -0
- package/packages/sdk-installer/dist/types/services/clean.d.ts +2 -0
- package/packages/sdk-installer/dist/types/services/download.d.ts +2 -0
- package/packages/sdk-installer/dist/types/services/index.d.ts +4 -0
- package/packages/sdk-installer/dist/types/services/install.d.ts +2 -0
- package/packages/sdk-installer/dist/types/services/unzip.d.ts +2 -0
- package/packages/rnv-build-engine/dist/src/tasks/task.rnv.platform.configure.js +0 -37
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.config.dev.js +0 -6
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.config.prod.js +0 -6
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.extend.js +0 -8
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpackConfigAdapter.js +0 -100
- package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpackPlatformProps.js +0 -8
- package/packages/rnv-build-engine/dist/templates/platforms/hbbtv/webpackPlatformProps.js +0 -24
- package/packages/rnv-build-engine/dist/templates/platforms/webos/webpackPlatformProps.js +0 -8
package/package.json
CHANGED
package/packages/epg/README.md
CHANGED
|
@@ -20,6 +20,7 @@ This package contains a prepared Electronic Program Guide component.
|
|
|
20
20
|
- `fetchPrograms` - the function to fetch more programs for a channel in a given time range
|
|
21
21
|
- `timelineWidthMs` - optional - the width of the timeline (the part where the programs are) in milliseconds (defaults to `90 minutes`)
|
|
22
22
|
- `scrollStepMs` - optional - the amount of movement step left/right in milliseconds (defaults to `0.5 hours`)
|
|
23
|
+
- `idleTimerMs` - optional - the amount of ms without user input after which epg jumps to the current time (defaults to `scrollStepMs`)
|
|
23
24
|
- `timelineSectionWidthMs` - optional - the width of timeline header section (above rows) in milliseconds (defaults to `0.5 hours`)
|
|
24
25
|
- `limitFromMs` - optional - left limit for movement (cannot go more into history) (defaults to `-Infinity`)
|
|
25
26
|
- `limitToMs` - optional - right limit for movement (cannot go further into future) (defaults to `Infinity`)
|
|
@@ -15,6 +15,7 @@ import { TimelineSection } from './TimelineSection';
|
|
|
15
15
|
import { EpgMouseNavigation } from './MouseNavigation';
|
|
16
16
|
import { DataManager } from './DataManager';
|
|
17
17
|
import { InputEvents } from './InputEvents';
|
|
18
|
+
import { IdleController } from './IdleController';
|
|
18
19
|
import { shouldRenderDatePicker, clamp } from './utils';
|
|
19
20
|
import {
|
|
20
21
|
Props,
|
|
@@ -73,7 +74,9 @@ export class Epg<
|
|
|
73
74
|
|
|
74
75
|
focused: EpgFocus = 'epg';
|
|
75
76
|
|
|
76
|
-
private readonly
|
|
77
|
+
private readonly idleController: IdleController;
|
|
78
|
+
|
|
79
|
+
private readonly inputEvents: InputEvents;
|
|
77
80
|
|
|
78
81
|
static defaultProps = {
|
|
79
82
|
timelineWidthMs: DEFAULT_TIMELINE_WIDTH_IN_MIN * MINUTE_IN_MS,
|
|
@@ -128,7 +131,7 @@ export class Epg<
|
|
|
128
131
|
constructor(props: Props<T, U, V, W>) {
|
|
129
132
|
super(props);
|
|
130
133
|
const {
|
|
131
|
-
initialTimestamp, timeProvider,
|
|
134
|
+
initialTimestamp, timeProvider, scrollStepMs, idleTimerMs,
|
|
132
135
|
channelData, timelineWidthMs, fetchPrograms,
|
|
133
136
|
} = this.props;
|
|
134
137
|
|
|
@@ -143,6 +146,8 @@ export class Epg<
|
|
|
143
146
|
this.dataManagers = map(channelData, (channel) => (
|
|
144
147
|
new DataManager(channel, timelineWidthMs, fetchPrograms, this)
|
|
145
148
|
));
|
|
149
|
+
this.idleController = new IdleController(idleTimerMs ?? scrollStepMs, this.onIdle);
|
|
150
|
+
this.inputEvents = new InputEvents(this, this.idleController.onKeyDown);
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
componentDidMount() {
|
|
@@ -153,6 +158,7 @@ export class Epg<
|
|
|
153
158
|
|
|
154
159
|
componentWillUnmount() {
|
|
155
160
|
this.time.destroy();
|
|
161
|
+
this.idleController.clear();
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
private readonly onDatePickerChange = (timestamp: number) => {
|
|
@@ -211,6 +217,13 @@ export class Epg<
|
|
|
211
217
|
}
|
|
212
218
|
};
|
|
213
219
|
|
|
220
|
+
private readonly onIdle = () => {
|
|
221
|
+
const now = this.time.getCurrentTime();
|
|
222
|
+
this.setCurrentTime(now);
|
|
223
|
+
this.setFocusTimestamp(now);
|
|
224
|
+
this.setFocusToEpg();
|
|
225
|
+
};
|
|
226
|
+
|
|
214
227
|
setFocusTimestamp(timestamp: number, allowScroll = true) {
|
|
215
228
|
const { timelineWidthMs, scrollStepMs, limitFromMs, limitToMs } = this.props;
|
|
216
229
|
this.focusTimestamp = timestamp;
|
|
@@ -363,6 +376,10 @@ export class Epg<
|
|
|
363
376
|
return this.inputEvents.isVerticallyFastScrolling();
|
|
364
377
|
}
|
|
365
378
|
|
|
379
|
+
isFocusInRows = () => {
|
|
380
|
+
return this.focused === 'epg';
|
|
381
|
+
};
|
|
382
|
+
|
|
366
383
|
render() {
|
|
367
384
|
const {
|
|
368
385
|
datePickerProps, timelineWidthPx, channelHeaderWidthPx, scrollStepMs, rowHeightPx,
|
|
@@ -426,6 +443,7 @@ export class Epg<
|
|
|
426
443
|
onMouseEnter={this.onMouseEnter}
|
|
427
444
|
renderChannelHeader={renderChannelHeader}
|
|
428
445
|
renderProgram={renderProgram}
|
|
446
|
+
isFocusInRows={this.isFocusInRows}
|
|
429
447
|
/>
|
|
430
448
|
<EpgMouseNavigation
|
|
431
449
|
// @ts-ignore - needed to convert fallback (false) to interface
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createTimeout } from '@24i/bigscreen-sdk/utils/timers';
|
|
2
|
+
|
|
3
|
+
export class IdleController {
|
|
4
|
+
private timeout = createTimeout();
|
|
5
|
+
|
|
6
|
+
constructor(
|
|
7
|
+
private intervalMs: number,
|
|
8
|
+
private onIdleCallback: () => void,
|
|
9
|
+
) {
|
|
10
|
+
this.timeout.set(this.onTimeout, this.intervalMs);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
onKeyDown = () => {
|
|
14
|
+
this.timeout.set(this.onTimeout, this.intervalMs);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
onTimeout = () => {
|
|
18
|
+
this.timeout.set(this.onTimeout, this.intervalMs);
|
|
19
|
+
this.onIdleCallback();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
clear() {
|
|
23
|
+
this.timeout.clear();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -23,6 +23,7 @@ export class InputEvents {
|
|
|
23
23
|
|
|
24
24
|
constructor(
|
|
25
25
|
private readonly epg: InternalEpg<any, any, any, any>,
|
|
26
|
+
private readonly onUserInput: () => void,
|
|
26
27
|
) {}
|
|
27
28
|
|
|
28
29
|
onKeyDown = (event: KeyboardEvent) => {
|
|
@@ -44,6 +45,7 @@ export class InputEvents {
|
|
|
44
45
|
this.stopFastHorizontalScrolling();
|
|
45
46
|
this.stopFastVerticalScrolling();
|
|
46
47
|
}
|
|
48
|
+
this.onUserInput();
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
onKeyUp = (event: KeyboardEvent) => {
|
|
@@ -188,6 +190,7 @@ export class InputEvents {
|
|
|
188
190
|
|
|
189
191
|
onWheel = (e: WheelEvent) => {
|
|
190
192
|
const processed = e.deltaY > 0 ? this.onWheelDown() : this.onWheelUp();
|
|
193
|
+
this.onUserInput();
|
|
191
194
|
if (processed) {
|
|
192
195
|
stopEvent(e);
|
|
193
196
|
this.setVerticalScroll(ARROWS_FACTOR);
|
|
@@ -266,21 +269,25 @@ export class InputEvents {
|
|
|
266
269
|
}
|
|
267
270
|
|
|
268
271
|
onMouseClickUp = () => {
|
|
272
|
+
this.onUserInput();
|
|
269
273
|
this.onUp();
|
|
270
274
|
this.fakeMouseClickStop();
|
|
271
275
|
};
|
|
272
276
|
|
|
273
277
|
onMouseClickDown = () => {
|
|
278
|
+
this.onUserInput();
|
|
274
279
|
this.onDown();
|
|
275
280
|
this.fakeMouseClickStop();
|
|
276
281
|
};
|
|
277
282
|
|
|
278
283
|
onMouseClickLeft = () => {
|
|
284
|
+
this.onUserInput();
|
|
279
285
|
this.onLeft();
|
|
280
286
|
this.fakeMouseClickStop();
|
|
281
287
|
};
|
|
282
288
|
|
|
283
289
|
onMouseClickRight = () => {
|
|
290
|
+
this.onUserInput();
|
|
284
291
|
this.onRight();
|
|
285
292
|
this.fakeMouseClickStop();
|
|
286
293
|
};
|
|
@@ -72,6 +72,7 @@ export class RowsManager<
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
onFastScrollingEnd() {
|
|
75
|
+
const { isFocusInRows } = this.props;
|
|
75
76
|
this.isFastScrolling = false;
|
|
76
77
|
if (this.coiBeforeFastScrolling < this.channelOffsetIndex) {
|
|
77
78
|
const { navigatableRows } = this.props;
|
|
@@ -82,7 +83,7 @@ export class RowsManager<
|
|
|
82
83
|
this.updateRowsBackward();
|
|
83
84
|
}
|
|
84
85
|
// it is same if we scroll horizontally and at that case we do not need to do anything
|
|
85
|
-
this.focusCurrentRowAtTimestamp();
|
|
86
|
+
if (isFocusInRows()) this.focusCurrentRowAtTimestamp();
|
|
86
87
|
this.setCurrentRowActive();
|
|
87
88
|
forEach(this.rows, ({ current: row }) => {
|
|
88
89
|
row!.onFastScrollingEnd();
|
|
@@ -212,6 +212,14 @@ type RenderTimeProp<T extends TimelineSection> = {
|
|
|
212
212
|
renderTime: TimeRenderer<T>,
|
|
213
213
|
};
|
|
214
214
|
|
|
215
|
+
type IsFocusInRowsProp = {
|
|
216
|
+
/**
|
|
217
|
+
* Returns whether the focus is in Rows part of the epg.
|
|
218
|
+
* @returns true fif cosu is in rows part, false otherwise
|
|
219
|
+
*/
|
|
220
|
+
isFocusInRows: () => boolean,
|
|
221
|
+
};
|
|
222
|
+
|
|
215
223
|
type RowHeightPxProp = {
|
|
216
224
|
/**
|
|
217
225
|
* The height of the EPG row in pixels
|
|
@@ -233,6 +241,14 @@ type ScrollStepMsProp = {
|
|
|
233
241
|
scrollStepMs: number,
|
|
234
242
|
};
|
|
235
243
|
|
|
244
|
+
type IdleTimerMsProp = {
|
|
245
|
+
/**
|
|
246
|
+
* The number of milliseconds of inactivity (no input) after which EPG starts jumps
|
|
247
|
+
* to the current time.
|
|
248
|
+
*/
|
|
249
|
+
idleTimerMs: number,
|
|
250
|
+
};
|
|
251
|
+
|
|
236
252
|
type TimeProp = {
|
|
237
253
|
/**
|
|
238
254
|
* The time interface that provides current time and time change events
|
|
@@ -806,6 +822,7 @@ export type RowsManagerProps<
|
|
|
806
822
|
& OnFocusChangeProp<U>
|
|
807
823
|
& RenderChannelHeaderProp<T>
|
|
808
824
|
& RenderProgramProp<U>
|
|
825
|
+
& IsFocusInRowsProp
|
|
809
826
|
);
|
|
810
827
|
|
|
811
828
|
/**
|
|
@@ -1250,6 +1267,7 @@ export type Props<
|
|
|
1250
1267
|
& FetchProgramsProp
|
|
1251
1268
|
& Partial<TimelineWidthMsProp>
|
|
1252
1269
|
& Partial<ScrollStepMsProp>
|
|
1270
|
+
& Partial<IdleTimerMsProp>
|
|
1253
1271
|
& Partial<TimelineSectionWidthMsProp>
|
|
1254
1272
|
& Partial<LimitFromMsProp>
|
|
1255
1273
|
& Partial<LimitToMsProp>
|
|
@@ -1267,7 +1285,6 @@ export type Props<
|
|
|
1267
1285
|
& Partial<RenderTimeProp<W>>
|
|
1268
1286
|
& Partial<DatePickerProp>
|
|
1269
1287
|
& Partial<PluginsProp<U>>
|
|
1270
|
-
|
|
1271
1288
|
);
|
|
1272
1289
|
|
|
1273
1290
|
/**
|
|
@@ -197,8 +197,8 @@ export class UnifiedGridController<T> implements IUnifiedGridController<T> {
|
|
|
197
197
|
if (animate && scrollToPx === this.toPx) {
|
|
198
198
|
base.current!.animatedScrollFinished();
|
|
199
199
|
}
|
|
200
|
-
this.handleOnScrollChanged(scrollToPx, backward);
|
|
201
200
|
this.adjustGroupsOffsetsOnFrame(scrollToPx, backward);
|
|
201
|
+
this.handleOnScrollChanged(scrollToPx, backward);
|
|
202
202
|
this.scrollGridScroller(scrollToPx);
|
|
203
203
|
if (this.isScrollWrapFocused()) {
|
|
204
204
|
this.focusCurrentItem();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, Reference } from '@24i/bigscreen-sdk/jsx';
|
|
2
2
|
import { IFocusable } from '@24i/bigscreen-sdk/focus';
|
|
3
|
+
import { UnifiedGridController } from './UnifiedGridController/UnifiedGridController';
|
|
3
4
|
import { SharedProps, Item } from './types';
|
|
4
5
|
import { GridBase } from './Base';
|
|
5
6
|
|
|
@@ -7,6 +8,7 @@ export interface Grid<
|
|
|
7
8
|
T extends Item<U>, U, V extends SharedProps<T, U> = SharedProps<T, U>,
|
|
8
9
|
> extends IFocusable, Component<V> {
|
|
9
10
|
base: Reference<GridBase<T, U>>,
|
|
11
|
+
controller: UnifiedGridController<U>;
|
|
10
12
|
appendData(data: U[]): void,
|
|
11
13
|
prependData(data: U[]): void,
|
|
12
14
|
focusToIndex(dataIndex: number, animated?: boolean): void,
|
|
@@ -101,8 +101,8 @@ extends SharedProps<any, any> = SharedProps<any, any>>
|
|
|
101
101
|
if (animate && scrollToPx === this.toPx) {
|
|
102
102
|
base.current!.animatedScrollFinished();
|
|
103
103
|
}
|
|
104
|
-
this.handleOnScrollChanged(scrollToPx, backward);
|
|
105
104
|
this.adjustItemsOffsetsOnFrame(scrollToPx, backward);
|
|
105
|
+
this.handleOnScrollChanged(scrollToPx, backward);
|
|
106
106
|
this.scrollListScroller(scrollToPx);
|
|
107
107
|
if (this.isScrollWrapFocused()) {
|
|
108
108
|
this.focusCurrentItem();
|
|
@@ -72,8 +72,8 @@ extends SharedVariedProps<any, any> = SharedVariedProps<any, any>>
|
|
|
72
72
|
if (animate && scrollToPx === this.toPx) {
|
|
73
73
|
base.current!.animatedScrollFinished();
|
|
74
74
|
}
|
|
75
|
-
this.handleOnScrollChanged(scrollToPx, backward);
|
|
76
75
|
this.adjustItemsOffsetsOnFrame(scrollToPx, backward);
|
|
76
|
+
this.handleOnScrollChanged(scrollToPx, backward);
|
|
77
77
|
this.scrollListScroller(scrollToPx);
|
|
78
78
|
if (this.isScrollWrapFocused()) {
|
|
79
79
|
// try to focus current item if available, otherwise keep focused Scroll wrap
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Component, Reference } from '@24i/bigscreen-sdk/jsx';
|
|
2
2
|
import { IFocusable } from '@24i/bigscreen-sdk/focus';
|
|
3
|
+
import { UnifiedListController } from './UnifiedListController/UnifiedListController';
|
|
4
|
+
import { UnifiedVariedListController } from './UnifiedListController/UnifiedVariedListController';
|
|
3
5
|
import { SharedProps, SharedVariedProps, Item } from './types';
|
|
4
6
|
import { ListBase } from './Base';
|
|
5
7
|
|
|
@@ -7,6 +9,7 @@ export interface List<
|
|
|
7
9
|
T extends Item<U>, U, V extends SharedProps<T, U> = SharedProps<T, U>,
|
|
8
10
|
> extends IFocusable, Component<V> {
|
|
9
11
|
base: Reference<ListBase<T, U>>,
|
|
12
|
+
controller: UnifiedListController<U>,
|
|
10
13
|
appendData(data: U[]): void,
|
|
11
14
|
prependData(data: U[]): void,
|
|
12
15
|
scrollTo(index: number): void,
|
|
@@ -15,6 +18,8 @@ export interface List<
|
|
|
15
18
|
export interface VariedList<
|
|
16
19
|
T extends Item<U>, U, V extends SharedVariedProps<T, U> = SharedVariedProps<T, U>,
|
|
17
20
|
> extends IFocusable, Component<V> {
|
|
21
|
+
base: Reference<ListBase<T, U>>,
|
|
22
|
+
controller: UnifiedVariedListController<U>,
|
|
18
23
|
appendData(data: U[]): void,
|
|
19
24
|
prependData(data: U[]): void,
|
|
20
25
|
scrollTo(index: number): void,
|
|
@@ -20,6 +20,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
const https = __importStar(require("https"));
|
|
23
|
+
const querystring = __importStar(require("querystring"));
|
|
23
24
|
const path = __importStar(require("path"));
|
|
24
25
|
const fs = __importStar(require("fs"));
|
|
25
26
|
const replaceWebhookUrl = (newWebhookUrl, channelName) => {
|
|
@@ -38,8 +39,8 @@ const postRequestCallback = (receivedData) => {
|
|
|
38
39
|
console.log(`\nGenerated slack webhook: ${url}`);
|
|
39
40
|
replaceWebhookUrl(url, channel);
|
|
40
41
|
};
|
|
41
|
-
const { redirect_uri
|
|
42
|
-
const formData =
|
|
42
|
+
const { redirect_uri, client_id, client_secret, code } = process.env;
|
|
43
|
+
const formData = querystring.stringify({ redirect_uri, client_id, client_secret, code });
|
|
43
44
|
const requestOptions = {
|
|
44
45
|
hostname: 'slack.com',
|
|
45
46
|
path: '/api/oauth.v2.access',
|
|
@@ -10,7 +10,14 @@ const getPlatformsObject = (c) => {
|
|
|
10
10
|
const { platforms = {} } = getVersionsObject(c)[version] || {};
|
|
11
11
|
return platforms;
|
|
12
12
|
};
|
|
13
|
-
const getCommonAppName = (c) =>
|
|
13
|
+
const getCommonAppName = (c) => {
|
|
14
|
+
try {
|
|
15
|
+
return c.buildConfig.common.appName;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
14
21
|
const makeFlavoursMarkdown = (platformName, entries) => entries
|
|
15
22
|
.map(([flavour, flavourData]) => {
|
|
16
23
|
const { indexUrl, packageUrl } = flavourData;
|
|
@@ -50,12 +50,12 @@ const checkout = (branchName) => (0, cmdUtils_1.cmdSyncPipeOut)(`git checkout ${
|
|
|
50
50
|
exports.checkout = checkout;
|
|
51
51
|
const createBranch = (branchName) => (0, cmdUtils_1.cmdSyncPipeOut)(`git branch ${branchName}`);
|
|
52
52
|
exports.createBranch = createBranch;
|
|
53
|
-
const commit = (commitMessage, noVerify
|
|
53
|
+
const commit = (commitMessage, noVerify) => {
|
|
54
54
|
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
55
55
|
return (0, cmdUtils_1.cmdSyncPipeOut)(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
|
|
56
56
|
};
|
|
57
57
|
exports.commit = commit;
|
|
58
|
-
const push = (branchName, noVerify
|
|
58
|
+
const push = (branchName, noVerify) => {
|
|
59
59
|
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
60
60
|
const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
|
|
61
61
|
return (0, cmdUtils_1.cmdSyncPipeOut)(cmd);
|
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.handleTizenSdk = exports.configureTizenProject = exports.buildTizenProject = void 0;
|
|
22
|
+
exports.runTizen = exports.handleTizenSdk = exports.configureTizenProject = exports.configureTizenGlobal = exports.buildTizenProject = void 0;
|
|
23
23
|
const fs = __importStar(require("fs"));
|
|
24
24
|
const path = __importStar(require("path"));
|
|
25
25
|
const os = __importStar(require("os"));
|
|
@@ -29,62 +29,135 @@ const rnv_1 = require("rnv");
|
|
|
29
29
|
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
30
30
|
const sdk_utils_1 = require("../sdk-utils");
|
|
31
31
|
const constants_1 = require("../../constants");
|
|
32
|
-
const {
|
|
32
|
+
const { execCLI } = rnv_1.Exec;
|
|
33
|
+
const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
|
|
34
|
+
const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
|
|
35
|
+
const { chalk, logTask, logDebug, logError, logSuccess, logWarning, logInfo, } = rnv_1.Logger;
|
|
36
|
+
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
37
|
+
const { writeCleanFile, fsExistsSync, updateObjectSync } = rnv_1.FileUtils;
|
|
38
|
+
const { copyAssetsFolder, copyBuildsFolder } = rnv_1.ProjectManager;
|
|
39
|
+
const { runTizenSimOrDevice, createDevelopTizenCertificate, DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME, } = rnv_1.SDKManager.Tizen;
|
|
33
40
|
const DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION = `${DEFAULT_CERTIFICATE_NAME}.p12`;
|
|
41
|
+
const configureTizenGlobal = (c) => new Promise((resolve, reject) => {
|
|
42
|
+
logTask('configureTizenGlobal');
|
|
43
|
+
const authorCert = path.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
|
|
44
|
+
if (fsExistsSync(authorCert)) {
|
|
45
|
+
logDebug(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file exists!`);
|
|
46
|
+
resolve();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
logWarning(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file missing! Creating one for you...`);
|
|
50
|
+
createDevelopTizenCertificate(c)
|
|
51
|
+
.then(() => resolve())
|
|
52
|
+
.catch((e) => reject(e));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
exports.configureTizenGlobal = configureTizenGlobal;
|
|
56
|
+
const handleRunTizenSimOrDevice = async (c) => {
|
|
57
|
+
try {
|
|
58
|
+
await runTizenSimOrDevice(c);
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
return Promise.reject(e);
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
};
|
|
65
|
+
const runTizen = async (c, target) => {
|
|
66
|
+
logTask('runTizen', `target:${target}`);
|
|
67
|
+
const { platform } = c;
|
|
68
|
+
const { hosted } = c.program;
|
|
69
|
+
const isHosted = hosted && !getConfigProp(c, platform, 'bundleAssets');
|
|
70
|
+
if (isHosted) {
|
|
71
|
+
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
72
|
+
if (isPortActive) {
|
|
73
|
+
const resetCompleted = await confirmActiveBundler(c);
|
|
74
|
+
c.runtime.skipActiveServerCheck = !resetCompleted;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
logTask('runTizen', `target:${target} hosted:${!!isHosted}`);
|
|
78
|
+
if (isHosted)
|
|
79
|
+
return;
|
|
80
|
+
const bundleAssets = getConfigProp(c, platform, 'bundleAssets') === true;
|
|
81
|
+
if (bundleAssets) {
|
|
82
|
+
await (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
83
|
+
await handleRunTizenSimOrDevice(c);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
87
|
+
const isDebuggerEnabledForPlatform = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform);
|
|
88
|
+
const isWeinreEnabled = isDebuggerEnabledForPlatform && !hosted;
|
|
89
|
+
if (!isPortActive) {
|
|
90
|
+
logInfo(`Your ${chalk().white(platform)} devServer at port ${chalk().white(c.runtime.port)} is not running. Starting it up for you...`);
|
|
91
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
92
|
+
.then(() => handleRunTizenSimOrDevice(c))
|
|
93
|
+
.catch(logError);
|
|
94
|
+
await (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const resetCompleted = await confirmActiveBundler(c);
|
|
98
|
+
if (resetCompleted) {
|
|
99
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
100
|
+
.then(() => handleRunTizenSimOrDevice(c))
|
|
101
|
+
.catch(logError);
|
|
102
|
+
await (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
await handleRunTizenSimOrDevice(c);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.runTizen = runTizen;
|
|
34
111
|
const buildTizenProject = async (c) => {
|
|
35
|
-
|
|
112
|
+
logTask('buildTizenProject');
|
|
36
113
|
await (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
37
114
|
if (!c.program.hosted) {
|
|
38
|
-
const
|
|
115
|
+
const { buildConfig } = c;
|
|
116
|
+
const platformConfig = buildConfig.platforms[constants_1.Platforms.TIZEN];
|
|
117
|
+
const projectDir = getPlatformProjectDir(c);
|
|
39
118
|
const projectParentDir = path.join(projectDir, '..');
|
|
40
119
|
const tBuild = path.join(projectParentDir, 'build');
|
|
41
120
|
const tOut = path.join(projectParentDir, 'output');
|
|
42
|
-
const platformConfig = c.buildConfig.platforms[c.platform];
|
|
43
121
|
const certProfile = platformConfig.certificateProfile ?? DEFAULT_SECURITY_PROFILE_NAME;
|
|
44
|
-
await
|
|
45
|
-
await
|
|
46
|
-
|
|
122
|
+
await execCLI(c, CLI_TIZEN, `build-web -- ${projectDir} -out ${tBuild}`);
|
|
123
|
+
await execCLI(c, CLI_TIZEN, `package -- ${tBuild} -s ${certProfile} -t wgt -o ${tOut}`);
|
|
124
|
+
logSuccess(`Your WGT package is located in ${chalk().cyan(tOut)} .`);
|
|
47
125
|
}
|
|
48
126
|
return true;
|
|
49
127
|
};
|
|
50
128
|
exports.buildTizenProject = buildTizenProject;
|
|
51
|
-
|
|
52
|
-
|
|
129
|
+
let isGlobalConfigured = false;
|
|
130
|
+
const configureProject = (c) => new Promise((resolve) => {
|
|
131
|
+
logTask('configureProject');
|
|
132
|
+
const platform = constants_1.Platforms.TIZEN;
|
|
53
133
|
const configFile = 'config.xml';
|
|
54
|
-
const p = c.buildConfig.platforms[
|
|
55
|
-
const injects = [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
override: semver.coerce(rnv_1.Common.getAppVersion(c, c.platform)),
|
|
67
|
-
}];
|
|
68
|
-
rnv_1.Common.addSystemInjects(c, injects);
|
|
69
|
-
const file = path.join(rnv_1.Common.getPlatformProjectDir(c), configFile);
|
|
70
|
-
rnv_1.FileUtils.writeCleanFile(file, file, injects, null, c);
|
|
71
|
-
};
|
|
134
|
+
const p = c.buildConfig.platforms[platform];
|
|
135
|
+
const injects = [
|
|
136
|
+
{ pattern: '{{PACKAGE}}', override: p.package },
|
|
137
|
+
{ pattern: '{{ID}}', override: p.id },
|
|
138
|
+
{ pattern: '{{APP_NAME}}', override: p.appName },
|
|
139
|
+
{ pattern: '{{APP_VERSION}}', override: semver.coerce(getAppVersion(c, platform)) },
|
|
140
|
+
];
|
|
141
|
+
addSystemInjects(c, injects);
|
|
142
|
+
const file = path.join(getPlatformProjectDir(c), configFile);
|
|
143
|
+
writeCleanFile(file, file, injects, null, c);
|
|
144
|
+
resolve();
|
|
145
|
+
});
|
|
72
146
|
const configureTizenProject = async (c) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
rnv_1.Logger.logDebug(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file exists.`);
|
|
147
|
+
logTask('configureTizenProject');
|
|
148
|
+
const { platform } = c;
|
|
149
|
+
c.runtime.platformBuildsProjectPath = `${getPlatformProjectDir(c)}`;
|
|
150
|
+
if (!isPlatformActive(c, platform)) {
|
|
151
|
+
return;
|
|
79
152
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
await
|
|
153
|
+
if (!isGlobalConfigured) {
|
|
154
|
+
isGlobalConfigured = true;
|
|
155
|
+
await configureTizenGlobal(c);
|
|
83
156
|
}
|
|
84
|
-
await
|
|
157
|
+
await copyAssetsFolder(c, platform);
|
|
85
158
|
await (0, sdk_webpack_1.configureCoreWebProject)(c);
|
|
86
|
-
configureProject(c);
|
|
87
|
-
|
|
159
|
+
await configureProject(c);
|
|
160
|
+
copyBuildsFolder(c, platform);
|
|
88
161
|
};
|
|
89
162
|
exports.configureTizenProject = configureTizenProject;
|
|
90
163
|
const handleLinuxKeyring = () => {
|
|
@@ -130,17 +203,16 @@ const setTizenCertificate = (c) => {
|
|
|
130
203
|
tizen: { certificateProfile: TIZEN_SECURITY_PROFILE_NAME },
|
|
131
204
|
},
|
|
132
205
|
};
|
|
133
|
-
|
|
206
|
+
updateObjectSync(rnvWorkspaceConfigPath, customObjectToMerge);
|
|
134
207
|
Object.assign(c.buildConfig, customObjectToMerge);
|
|
135
208
|
return true;
|
|
136
209
|
};
|
|
137
210
|
const getSdkInstallerUrl = () => {
|
|
138
|
-
const folderUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen';
|
|
139
211
|
switch (os.platform()) {
|
|
140
212
|
case 'darwin':
|
|
141
|
-
return
|
|
213
|
+
return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_mac.zip';
|
|
142
214
|
case 'linux':
|
|
143
|
-
return
|
|
215
|
+
return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_ubuntu.zip';
|
|
144
216
|
default:
|
|
145
217
|
return '';
|
|
146
218
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sdkInstaller = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
+
const url_1 = require("url");
|
|
5
6
|
const services_1 = require("./services");
|
|
6
7
|
const log = (message) => process.stdout.write(message);
|
|
7
8
|
const noLog = () => false;
|
|
@@ -10,10 +11,11 @@ const sdkInstaller = async (remoteZipPath, installToPath, enableLogs = false) =>
|
|
|
10
11
|
const pathsToDelete = [];
|
|
11
12
|
let usedInstallPath;
|
|
12
13
|
try {
|
|
13
|
-
|
|
14
|
+
const parsedZipPath = (0, path_1.parse)(remoteZipPath);
|
|
15
|
+
const parsedZipUrl = (0, url_1.parse)(remoteZipPath);
|
|
16
|
+
if (!parsedZipUrl.protocol) {
|
|
14
17
|
throw new Error('Installation from local packages is not supported yet.');
|
|
15
18
|
}
|
|
16
|
-
const parsedZipPath = (0, path_1.parse)(remoteZipPath);
|
|
17
19
|
logger('Downloading...');
|
|
18
20
|
const downloadedFilePath = `${process.cwd()}/${parsedZipPath.base}`;
|
|
19
21
|
pathsToDelete.push(downloadedFilePath);
|
package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/download.js
CHANGED
|
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.download = void 0;
|
|
23
23
|
const fs = __importStar(require("fs"));
|
|
24
24
|
const path = __importStar(require("path"));
|
|
25
|
+
const url = __importStar(require("url"));
|
|
25
26
|
const http = __importStar(require("http"));
|
|
26
27
|
const https = __importStar(require("https"));
|
|
27
28
|
const createDirPathIfDoesntExist = async (dirPath) => {
|
|
@@ -30,13 +31,10 @@ const createDirPathIfDoesntExist = async (dirPath) => {
|
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
const getNetworkProtocolAdapter = (requestedUrl) => {
|
|
33
|
-
const
|
|
34
|
-
if (!rest) {
|
|
35
|
-
throw new Error('unknown protocol');
|
|
36
|
-
}
|
|
34
|
+
const { protocol } = url.parse(requestedUrl);
|
|
37
35
|
switch (protocol) {
|
|
38
|
-
case 'http': return http;
|
|
39
|
-
case 'https': return https;
|
|
36
|
+
case 'http:': return http;
|
|
37
|
+
case 'https:': return https;
|
|
40
38
|
default: throw new Error(`${protocol} protocol is not supported`);
|
|
41
39
|
}
|
|
42
40
|
};
|