Skip to content

Commit 10241ef

Browse files
committed
chore: revamped integration for NativeScript with Angular 12
0 parents  commit 10241ef

File tree

248 files changed

+13175
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+13175
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.eslintrc.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"parserOptions": {},
9+
"rules": {}
10+
},
11+
{
12+
"files": ["*.ts", "*.tsx"],
13+
"extends": ["plugin:@nrwl/nx/typescript"],
14+
"rules": {}
15+
},
16+
{
17+
"files": ["*.js", "*.jsx"],
18+
"extends": ["plugin:@nrwl/nx/javascript"],
19+
"rules": {}
20+
}
21+
]
22+
}

.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
package-lock.json
11+
12+
# IDEs and editors
13+
/.idea
14+
.project
15+
.classpath
16+
.c9/
17+
*.launch
18+
.settings/
19+
*.sublime-workspace
20+
21+
# IDE - VSCode
22+
.vscode/*
23+
!.vscode/settings.json
24+
!.vscode/tasks.json
25+
!.vscode/launch.json
26+
!.vscode/extensions.json
27+
28+
# misc
29+
/.sass-cache
30+
/connect.lock
31+
/coverage
32+
/libpeerconnection.log
33+
npm-debug.log
34+
yarn-error.log
35+
testem.log
36+
/typings
37+
38+
*.tgz
39+
packages/angular/dist
40+
41+
# System Files
42+
.DS_Store
43+
Thumbs.db

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
4+
/coverage
5+
6+
**/xplat/*/.xplatframework
7+
8+
9+
# xplat added rules
10+
**/*.d.ts
11+
**/apps/**/platforms/**/*
12+
**/App_Resources/**/*
13+
**/apps/nativescript*/hooks/**/*
14+
**/apps/nativescript*/tools/**/*
15+
**/apps/nativescript*/src/assets/*.min.css
16+
**/apps/*nativescript/hooks/**/*
17+
**/apps/*nativescript/tools/**/*
18+
**/apps/*nativescript/src/assets/*.css
19+
**/xplat/nativescript/scss/fonticons/*.css
20+
**/xplat/nativescript*/plugins/**/*

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": false,
3+
"printWidth": 600,
4+
"tabWidth": 2,
5+
"singleQuote": true
6+
}

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["ms-vscode.vscode-typescript-tslint-plugin", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner"]
3+
}

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# @nativescript/angular 12
2+
3+
Clean and setup workspace:
4+
5+
```
6+
npm run clean
7+
```
8+
9+
Build angular package:
10+
11+
```
12+
nx run angular:build
13+
```
14+
15+
Run angular demo:
16+
17+
```
18+
nx run nativescript-demo-ng:ios
19+
```

apps/nativescript-demo-ng/.gitignore

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# NativeScript
2+
hooks/
3+
node_modules/
4+
platforms/
5+
6+
# NativeScript Template
7+
*.js.map
8+
*.js
9+
!webpack.config.js
10+
!ngcc.config.js
11+
12+
# Logs
13+
logs
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
19+
# General
20+
.DS_Store
21+
.AppleDouble
22+
.LSOverride
23+
.idea
24+
.cloud
25+
.project
26+
tmp/
27+
typings/
28+
29+
# misc
30+
npm-debug.log
31+
32+
# app
33+
!*.d.ts
34+
/report/
35+
.nsbuildinfo
36+
/temp/
37+
/src/tns_modules/
38+
39+
package-lock.json
40+
!tools/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Add your native dependencies here:
2+
3+
// Uncomment to add recyclerview-v7 dependency
4+
//dependencies {
5+
// compile 'com.android.support:recyclerview-v7:+'
6+
//}
7+
8+
android {
9+
defaultConfig {
10+
minSdkVersion 17
11+
targetSdkVersion 29
12+
generatedDensities = []
13+
applicationId = "__PACKAGE__"
14+
manifestPlaceholders = [isUnitTesting:"${unitTesting}"]
15+
}
16+
aaptOptions {
17+
additionalParameters "--no-version-vectors"
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
14+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
15+
<uses-permission android:name="android.permission.INTERNET"/>
16+
17+
<application
18+
android:name="com.tns.NativeScriptApplication"
19+
android:allowBackup="true"
20+
android:icon="@drawable/icon"
21+
android:usesCleartextTraffic="${isUnitTesting}"
22+
android:label="@string/app_name"
23+
android:theme="@style/AppTheme">
24+
25+
<activity
26+
android:name="com.tns.NativeScriptActivity"
27+
android:label="@string/title_activity_kimera"
28+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
29+
android:theme="@style/LaunchScreenTheme">
30+
31+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
32+
33+
<intent-filter>
34+
<action android:name="android.intent.action.MAIN" />
35+
<category android:name="android.intent.category.LAUNCHER" />
36+
</intent-filter>
37+
</activity>
38+
<activity android:name="com.tns.ErrorReportActivity"/>
39+
</application>
40+
</manifest>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
2+
<item>
3+
<bitmap android:gravity="fill" android:src="@drawable/background" />
4+
</item>
5+
<item>
6+
<bitmap android:gravity="center" android:src="@drawable/logo" />
7+
</item>
8+
</layer-list>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_accent">#3d5afe</color>
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<!-- Application theme -->
5+
<style name="AppTheme" parent="AppThemeBase">
6+
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
7+
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
8+
</style>
9+
10+
<!-- Default style for DatePicker - in spinner mode -->
11+
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
12+
<item name="android:datePickerMode">spinner</item>
13+
</style>
14+
15+
<!-- Default style for TimePicker - in spinner mode -->
16+
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
17+
<item name="android:timePickerMode">spinner</item>
18+
</style>
19+
20+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
21+
<item name="android:elevation">4dp</item>
22+
</style>
23+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_primary">#F5F5F5</color>
4+
<color name="ns_primaryDark">#757575</color>
5+
<color name="ns_accent">#33B5E5</color>
6+
<color name="ns_blue">#272734</color>
7+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- theme to use FOR launch screen-->
5+
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
6+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
7+
8+
<item name="colorPrimary">@color/ns_primary</item>
9+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
10+
<item name="colorAccent">@color/ns_accent</item>
11+
12+
<item name="android:windowBackground">@drawable/splash_screen</item>
13+
14+
<item name="android:windowActionBarOverlay">true</item>
15+
<item name="android:windowTranslucentStatus">true</item>
16+
17+
</style>
18+
19+
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
20+
</style>
21+
22+
<!-- theme to use AFTER launch screen is loaded-->
23+
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
24+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
25+
26+
<item name="colorPrimary">@color/ns_primary</item>
27+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
28+
<item name="colorAccent">@color/ns_accent</item>
29+
30+
</style>
31+
32+
<style name="AppTheme" parent="AppThemeBase">
33+
</style>
34+
35+
<!-- theme for action-bar -->
36+
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
37+
<item name="android:background">@color/ns_primary</item>
38+
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
39+
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
40+
41+
</style>
42+
43+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
44+
</style>
45+
</resources>

0 commit comments

Comments
 (0)