Skip to content

Commit 70caaa3

Browse files
authored
Merge pull request #425 from NativeScript/release
chore: merge release in master
2 parents 01673b5 + 518d2d3 commit 70caaa3

File tree

7 files changed

+45
-38
lines changed

7 files changed

+45
-38
lines changed

core/settings/Settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Packages(object):
125125
SASS = resolve_package(name='nativescript-dev-sass', variable='nativescript_dev_sass')
126126

127127
# Templates branch
128-
TEMPLATES_BRANCH = os.environ.get('templates_branch', 'release')
128+
TEMPLATES_BRANCH = os.environ.get('templates_branch', 'master')
129129

130130

131131
# noinspection SpellCheckingInspection

data/changes.py

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from data.const import Colors
66

77

8-
# noinspection PyShadowingBuiltins
98
class ChangeSet(object):
109
def __init__(self, file_path, old_value, new_value, old_text=None, new_text=None, old_color=None, new_color=None):
1110
self.file_path = file_path
@@ -35,7 +34,8 @@ class JSHelloWord(object):
3534
old_value='taps left', new_value='clicks left',
3635
old_text='taps left', new_text='clicks left')
3736
CSS = ChangeSet(file_path=os.path.join('app', 'app.css'),
38-
old_value='font-size: 18', new_value='font-size: 50',
37+
old_value='font-size: 18',
38+
new_value='font-size: 18;\nbackground-color: red;',
3939
old_color=None, new_color=None)
4040
XML = ChangeSet(file_path=os.path.join('app', 'main-page.xml'),
4141
old_value='TAP', new_value='HIT',
@@ -54,7 +54,8 @@ class TSHelloWord(object):
5454
old_value='taps left', new_value='clicks left',
5555
old_text='taps left', new_text='clicks left')
5656
CSS = ChangeSet(file_path=os.path.join('app', 'app.css'),
57-
old_value='font-size: 18', new_value='font-size: 50',
57+
old_value='font-size: 18',
58+
new_value='font-size: 18;\nbackground-color: red;',
5859
old_color=None, new_color=None)
5960
XML = ChangeSet(file_path=os.path.join('app', 'main-page.xml'),
6061
old_value='TAP', new_value='HIT',
@@ -65,11 +66,10 @@ class NGHelloWorld(object):
6566
old_value='Ter Stegen', new_value='Unknown',
6667
old_text='Ter Stegen', new_text='Unknown')
6768
CSS = ChangeSet(file_path=os.path.join('src', 'app.css'),
68-
old_value='light', new_value='dark',
69-
old_color=Colors.WHITE, new_color=Colors.DARK)
70-
HTML = ChangeSet(file_path=os.path.join('src', 'app', 'item', 'items.component.html'),
71-
old_value='"item.name"', new_value='"item.id"',
72-
old_text=None, new_text=None)
69+
old_value='}', new_value='}\nListView { background-color: pink;}\n',
70+
old_color=Colors.WHITE, new_color=Colors.PINK)
71+
HTML = ChangeSet(file_path=os.path.join('src', 'app', 'item', 'items.component.html'), old_value='"item.name"',
72+
new_value='"item.id"', old_text=None, new_text=None)
7373
XML_ACTION_BAR = ChangeSet(file_path=os.path.join('src', 'app', 'item', 'items.component.html'),
7474
old_value='My App', new_value='TestApp',
7575
old_text='My App', new_text='TestApp')
@@ -89,33 +89,35 @@ class MasterDetailNG(object):
8989

9090
# This change should make title of cars pink
9191
SCSS_ROOT_COMMON = ChangeSet(file_path=os.path.join('src', '_app-common.scss'),
92-
old_value='$accent-dark;', new_value='pink;',
92+
old_value='font-weight: 900;',
93+
new_value='font-weight: 900;\nbackground-color: pink;\n',
9394
old_color=Colors.ACCENT_DARK, new_color=Colors.PINK)
9495

9596
# This change should add some red between list view items on home page
9697
SCSS_ROOT_ANDROID = ChangeSet(file_path=os.path.join('src', 'app.android.scss'),
9798
old_value='Android here',
98-
new_value='Android here\n.page { background-color: red;}\n',
99-
old_color=Colors.WHITE, new_color=Colors.RED_DARK)
99+
new_value='Android here\n.m-r-20{ background-color: red; }\n',
100+
old_color=Colors.WHITE, new_color=Colors.RED)
100101
SCSS_ROOT_IOS = ChangeSet(file_path=os.path.join('src', 'app.ios.scss'),
101102
old_value='iOS here',
102-
new_value='iOS here\n.page { padding: 30; background-color: red; }\n',
103+
new_value='iOS here\n.m-r-20{ background-color: red; }\n',
103104
old_color=Colors.WHITE, new_color=Colors.RED)
104105

105106
# This change should make background of items on home page purple
106107
SCSS_NESTED_COMMON = ChangeSet(file_path=os.path.join('src', 'app', 'cars', '_car-list.component.scss'),
107-
old_value='$background-light;', new_value='purple;',
108-
old_color=Colors.WHITE, new_color=Colors.PURPLE)
108+
old_value='$background-color: background',
109+
new_value='$background-color: purple',
110+
old_color=Colors.WHITE, new_color=Colors.PURPLE_CUSTOM)
109111

110112
# This change should make icons on home page yellow
111113
SCSS_NESTED_ANDROID = ChangeSet(file_path=os.path.join('src', 'app', 'cars', 'car-list.component.android.scss'),
112114
old_value='Android here',
113-
new_value='Android here\n.list-group{.list-group-item{.fa{color:yellow;}}}\n',
115+
new_value='Android here\n.cars-list__item{ color: yellow; }\n',
114116
old_color=None, new_color=Colors.YELLOW)
115117

116118
SCSS_NESTED_IOS = ChangeSet(file_path=os.path.join('src', 'app', 'cars', 'car-list.component.ios.scss'),
117119
old_value='iOS here',
118-
new_value='iOS here\n.list-group{.list-group-item{.fa{color:yellow;}}}\n',
120+
new_value='iOS here\n.cars-list__item{ color: yellow; }\n',
119121
old_color=None, new_color=Colors.YELLOW)
120122

121123
class JSTabNavigation(object):
@@ -126,16 +128,19 @@ class JSTabNavigation(object):
126128
old_value='Home', new_value='Test',
127129
old_text='Home', new_text='Test')
128130

129-
# This change should make title of home red
130-
SCSS_VARIABLES = ChangeSet(file_path=os.path.join('app', '_app-variables.scss'),
131-
old_value='#D7D7D7', new_value='red',
132-
old_color='#D7D7D7', new_color=Colors.RED)
131+
# This change should make background of home red
132+
SCSS_VARIABLES = ChangeSet(file_path=os.path.join('app', '_app-common.scss'),
133+
old_value='Font icon class',
134+
new_value='Font icon class\n.page__content{ background-color: red; }\n',
135+
old_color=None, new_color=Colors.RED)
133136
SCSS_ROOT_ANDROID = ChangeSet(file_path=os.path.join('app', 'app.android.scss'),
134-
old_value='$blue-dark;', new_value='pink;',
135-
old_color=Colors.ACCENT_DARK, new_color=Colors.PINK)
137+
old_value='Android here',
138+
new_value='Android here\n.navigation__item{ background-color: yellow; }\n',
139+
old_color=None, new_color=Colors.YELLOW)
136140
SCSS_ROOT_IOS = ChangeSet(file_path=os.path.join('app', 'app.ios.scss'),
137-
old_value='$item-active-color;', new_value='pink;',
138-
old_color=Colors.ACCENT_DARK, new_color=Colors.PINK)
141+
old_value='iOS here',
142+
new_value='iOS here\n.navigation__item{ background-color: yellow; }\n',
143+
old_color=None, new_color=Colors.YELLOW)
139144

140145
class TSTabNavigation(object):
141146
TS = ChangeSet(file_path=os.path.join('src', 'app', 'home', 'home-items-view-model.ts'),
@@ -194,15 +199,14 @@ class MasterDetailVUE(object):
194199
old_text='/day', new_text='/24h')
195200

196201
class DateTimePicker(object):
197-
COMMON_TS = ChangeSet(file_path=os.path.join(
198-
Settings.TEST_SUT_HOME, 'nativescript-datetimepicker', 'src', 'ui', 'date-picker-field.common.ts'),
199-
old_value='name: "date",', new_value='name: "date", defaultValue: new Date(),')
200-
ANDROID_TS = ChangeSet(file_path=os.path.join(
201-
Settings.TEST_SUT_HOME, 'nativescript-datetimepicker', 'src', 'datetimepicker.android.ts'),
202+
DATETIME_PICKER_PATH = os.path.join(Settings.TEST_SUT_HOME, 'nativescript-datetimepicker', 'src')
203+
COMMON_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'ui', 'date-picker-field.common.ts'),
204+
old_value='name: "date",',
205+
new_value='name: "date", defaultValue: new Date(),')
206+
ANDROID_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'datetimepicker.android.ts'),
202207
old_value='datePicker.init(date.getFullYear(), date.getMonth(), date.getDate(), null);',
203208
new_value='datePicker.init(2010, date.getMonth(), date.getDate(), null);')
204-
IOS_TS = ChangeSet(file_path=os.path.join(
205-
Settings.TEST_SUT_HOME, 'nativescript-datetimepicker', 'src', 'datetimepicker.ios.ts'),
209+
IOS_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'datetimepicker.ios.ts'),
206210
old_value='pickerView.date = date;',
207211
new_value='date.setFullYear(2010); pickerView.date = date;')
208212

data/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Colors(object):
1616
RED = numpy.array([0, 0, 255]) # Red (standard CSS color).
1717
RED_DARK = numpy.array([5, 4, 229]) # A bit custom red (happens when apply red on master-detail template).
1818
PURPLE = numpy.array([128, 0, 128]) # Purple (standard CSS color).
19+
PURPLE_CUSTOM = numpy.array([255, 48, 129]) # A bit custom purple (when apply purple on master-detail).
1920
YELLOW = numpy.array([0, 255, 255]) # Yellow (standard CSS color).
2021
YELLOW_ICON = numpy.array([0, 242, 255]) # Yellow of star.png
2122
GREEN_ICON = numpy.array([0, 128, 0]) # Green of background colour of resources generate images

data/sync/hello_world_js.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __sync_hello_world_js_ts(app_type, app_name, platform, device, bundle=True,
9595
# Edit CSS file and verify changes are applied
9696
blue_count = device.get_pixels_by_color(color=Colors.LIGHT_BLUE)
9797
Sync.replace(app_name=app_name, change_set=css_change)
98-
device.wait_for_color(color=Colors.LIGHT_BLUE, pixel_count=blue_count * 2, delta=25)
98+
device.wait_for_color(color=Colors.RED, pixel_count=blue_count)
9999
device.wait_for_text(text=xml_change.old_text)
100100
device.wait_for_text(text=js_change.old_text)
101101
strings = TnsLogs.run_messages(app_name=app_name, platform=platform, run_type=RunType.INCREMENTAL, bundle=bundle,

data/sync/hello_world_ng.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
7878
not_existing_string_list=not_existing_string_list)
7979

8080
Sync.replace(app_name=app_name, change_set=Changes.NGHelloWorld.CSS)
81-
device.wait_for_main_color(color=Colors.DARK)
8281
if platform == Platform.IOS:
8382
for number in ["10", "1"]:
8483
device.wait_for_text(text=number)
@@ -91,6 +90,7 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
9190
device=device)
9291
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
9392
not_existing_string_list=not_existing_string_list)
93+
device.wait_for_main_color(color=Colors.PINK)
9494

9595
# Revert changes
9696
Sync.revert(app_name=app_name, change_set=Changes.NGHelloWorld.HTML)
@@ -103,21 +103,20 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
103103

104104
Sync.revert(app_name=app_name, change_set=Changes.NGHelloWorld.TS)
105105
device.wait_for_text(text=Changes.NGHelloWorld.TS.old_text)
106-
device.wait_for_main_color(color=Colors.DARK)
107106
strings = TnsLogs.run_messages(app_name=app_name, platform=platform, run_type=RunType.INCREMENTAL, bundle=bundle,
108107
file_name='item.service.ts', hmr=hmr, instrumented=instrumented, app_type=AppType.NG,
109108
device=device)
110109
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
111110
not_existing_string_list=not_existing_string_list)
112111

113112
Sync.revert(app_name=app_name, change_set=Changes.NGHelloWorld.CSS)
114-
device.wait_for_main_color(color=Colors.WHITE)
115113
device.wait_for_text(text=Changes.NGHelloWorld.TS.old_text)
116114
strings = TnsLogs.run_messages(app_name=app_name, platform=platform, run_type=RunType.INCREMENTAL, bundle=bundle,
117115
file_name='app.css', hmr=hmr, instrumented=instrumented, app_type=AppType.NG,
118116
device=device)
119117
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
120118
not_existing_string_list=not_existing_string_list)
119+
device.wait_for_main_color(color=Colors.WHITE)
121120

122121
# Assert final and initial states are same
123122
initial_state = os.path.join(Settings.TEST_OUT_IMAGES, device.name, 'initial_state.png')

products/nativescript/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@ def install_dev_dependency(app_name, dependency, version='latest'):
4545
Npm.install(package='{0}@{1}'.format(dependency, version), option='--save-dev --save-exact', folder=app_path)
4646

4747
@staticmethod
48-
def update(app_name, modules=True, angular=True, typescript=False, web_pack=True, vue=True):
48+
def update(app_name, modules=True, angular=True, typescript=False, web_pack=True, vue=True, theme=True):
4949
app_path = os.path.join(Settings.TEST_RUN_HOME, app_name)
5050
modules_path = os.path.join(app_path, 'node_modules')
5151
if modules and App.is_dependency(app_name=app_name, dependency='tns-core-modules'):
5252
Npm.uninstall(package='tns-core-modules', option='--save', folder=app_path)
5353
Npm.install(package=Settings.Packages.MODULES, option='--save --save-exact', folder=app_path)
54+
if theme and App.is_dependency(app_name=app_name, dependency='@nativescript/theme'):
55+
Npm.uninstall(package='@nativescript/theme', option='--save', folder=app_path)
56+
Npm.install(package='@nativescript/theme@next', option='--save --save-exact', folder=app_path)
5457
if angular and App.is_dependency(app_name=app_name, dependency='nativescript-angular'):
5558
Npm.uninstall(package='nativescript-angular', option='--save', folder=app_path)
5659
Npm.install(package=Settings.Packages.ANGULAR, option='--save --save-exact', folder=app_path)

products/nativescript/tns_assert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME, w
4848

4949
# Verify {N} core theme is installed
5050
if theme:
51-
assert Folder.exists(os.path.join(node_path, 'nativescript-theme-core')), '{N} theme do not exists.'
51+
assert Folder.exists(os.path.join(node_path, '@nativescript', 'theme')), '{N} theme do not exists.'
5252

5353
# Verify webpack is installed
5454
before_watch_hooks = os.path.join(app_path, 'hooks', 'before-watch')

0 commit comments

Comments
 (0)