├── .editorconfig
├── .gitignore
├── .vscode
└── extensions.json
├── App_Resources
├── Android
│ ├── app.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── res
│ │ ├── drawable-hdpi
│ │ ├── background.png
│ │ ├── icon.png
│ │ └── logo.png
│ │ ├── drawable-ldpi
│ │ ├── background.png
│ │ ├── icon.png
│ │ └── logo.png
│ │ ├── drawable-mdpi
│ │ ├── background.png
│ │ ├── icon.png
│ │ └── logo.png
│ │ ├── drawable-nodpi
│ │ └── splash_screen.xml
│ │ ├── drawable-xhdpi
│ │ ├── background.png
│ │ ├── icon.png
│ │ └── logo.png
│ │ ├── drawable-xxhdpi
│ │ ├── background.png
│ │ ├── icon.png
│ │ └── logo.png
│ │ ├── drawable-xxxhdpi
│ │ ├── background.png
│ │ ├── icon.png
│ │ └── logo.png
│ │ ├── values-v21
│ │ ├── colors.xml
│ │ └── styles.xml
│ │ ├── values-v29
│ │ └── styles.xml
│ │ └── values
│ │ ├── colors.xml
│ │ └── styles.xml
└── iOS
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── icon-1024.png
│ │ ├── icon-20.png
│ │ ├── icon-20@2x.png
│ │ ├── icon-20@3x.png
│ │ ├── icon-29.png
│ │ ├── icon-29@2x.png
│ │ ├── icon-29@3x.png
│ │ ├── icon-40.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-60@2x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-76.png
│ │ ├── icon-76@2x.png
│ │ └── icon-83.5@2x.png
│ ├── Contents.json
│ ├── LaunchScreen.AspectFill.imageset
│ │ ├── Contents.json
│ │ ├── LaunchScreen-AspectFill.png
│ │ ├── LaunchScreen-AspectFill@2x.png
│ │ └── LaunchScreen-AspectFill@3x.png
│ └── LaunchScreen.Center.imageset
│ │ ├── Contents.json
│ │ ├── LaunchScreen-Center.png
│ │ ├── LaunchScreen-Center@2x.png
│ │ └── LaunchScreen-Center@3x.png
│ ├── Info.plist
│ ├── LaunchScreen.storyboard
│ └── build.xcconfig
├── angular.json
├── nativescript.config.ts
├── package-lock.json
├── package.json
├── references.d.ts
├── src
├── app.css
├── app
│ ├── app-routing.module.ts
│ ├── app.component.html
│ ├── app.component.ts
│ ├── app.module.ts
│ └── item
│ │ ├── item-detail.component.html
│ │ ├── item-detail.component.ts
│ │ ├── item.service.ts
│ │ ├── item.ts
│ │ ├── items.component.html
│ │ └── items.component.ts
└── main.ts
├── tsconfig.json
├── tsfmt.json
└── webpack.config.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 | charset = utf-8
8 |
9 | [*.json]
10 | indent_style = space
11 | indent_size = 2
12 |
13 | [*.ts]
14 | indent_style = space
15 | indent_size = 4
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # NativeScript
2 | hooks/
3 | node_modules/
4 | platforms/
5 |
6 | # NativeScript Template
7 | *.js.map
8 | *.js
9 | !ngcc.config.js
10 | !webpack.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 | # Visual Studio Code
30 | .vscode/*
31 | !.vscode/settings.json
32 | !.vscode/tasks.json
33 | !.vscode/launch.json
34 | !.vscode/extensions.json
35 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "nativescript.nativescript"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // implementation 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | // If you want to add something to be applied before applying plugins' include.gradle files
9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1"
10 | // create a file named before-plugins.gradle in the current directory and place it there
11 |
12 | android {
13 | defaultConfig {
14 | minSdkVersion 17
15 | generatedDensities = []
16 | }
17 | aaptOptions {
18 | additionalParameters "--no-version-vectors"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
23 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
13 |
14 |
15 |
18 |
19 |
20 |
23 |
24 |
28 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/values-v29/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "icon-29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "icon-29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "icon-40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "icon-40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "icon-20.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "icon-20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "icon-29.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "icon-29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "icon-40.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "icon-40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "icon-76.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "icon-76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "icon-83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "icon-1024.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchScreen-AspectFill@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchScreen-Center@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avif/native-test/857dd41fd02971dcf0f9aa3fa0f180ff2a9cea3e/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png
--------------------------------------------------------------------------------
/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "cli": {
6 | "analytics": "3e9a32eb-fc58-4ac3-82a4-69ff9681d6a6",
7 | "defaultCollection": "@nativescript/schematics"
8 | },
9 | "projects": {
10 | "hello-world": {
11 | "root": "",
12 | "sourceRoot": "src",
13 | "projectType": "application",
14 | "prefix": "ns"
15 | }
16 | },
17 | "defaultProject": "hello-world"
18 | }
19 |
--------------------------------------------------------------------------------
/nativescript.config.ts:
--------------------------------------------------------------------------------
1 | import { NativeScriptConfig } from '@nativescript/core';
2 |
3 | export default {
4 | id: 'org.nativescript.nativetest',
5 | appResourcesPath: 'App_Resources',
6 | android: {
7 | v8Flags: '--expose_gc',
8 | markingMode: 'none'
9 | }
10 | } as NativeScriptConfig;
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/template-hello-world-ng",
3 | "main": "main.js",
4 | "version": "7.0.9",
5 | "author": "NativeScript Team ",
6 | "description": "NativeScript Application",
7 | "license": "SEE LICENSE IN ",
8 | "publishConfig": {
9 | "access": "public"
10 | },
11 | "keywords": [
12 | "nativescript",
13 | "mobile",
14 | "angular",
15 | "{N}",
16 | "template"
17 | ],
18 | "repository": "",
19 | "bugs": {
20 | "url": "https://github.com/NativeScript/NativeScript/issues"
21 | },
22 | "dependencies": {
23 | "@angular/animations": "~11.0.0",
24 | "@angular/common": "~11.0.0",
25 | "@angular/compiler": "~11.0.0",
26 | "@angular/core": "~11.0.0",
27 | "@angular/forms": "~11.0.0",
28 | "@angular/platform-browser": "~11.0.0",
29 | "@angular/platform-browser-dynamic": "~11.0.0",
30 | "@angular/router": "~11.0.0",
31 | "@nativescript/angular": "~11.0.0",
32 | "@nativescript/core": "~7.1.0",
33 | "@nativescript/theme": "~3.0.0",
34 | "reflect-metadata": "~0.1.12",
35 | "rxjs": "^6.6.0",
36 | "zone.js": "~0.11.1"
37 | },
38 | "devDependencies": {
39 | "@angular/cli": "^11.1.2",
40 | "@angular/compiler-cli": "~11.0.0",
41 | "@nativescript/schematics": "^11.0.0",
42 | "@nativescript/types": "~7.0.0",
43 | "@nativescript/webpack": "~4.0.0",
44 | "@ngtools/webpack": "~11.0.0",
45 | "typescript": "~4.0.0"
46 | },
47 | "private": "true",
48 | "readme": "NativeScript Application"
49 | }
50 |
--------------------------------------------------------------------------------
/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/src/app.css:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.css file is where you place CSS rules that
3 | you would like to apply to your entire application. Check out
4 | http://docs.nativescript.org/ui/styling for a full list of the CSS
5 | selectors and properties you can use to style UI components.
6 |
7 | /*
8 | In many cases you may want to use the NativeScript core theme instead
9 | of writing your own CSS rules. You can learn more about the
10 | NativeScript core theme at https://github.com/nativescript/theme
11 | The imported CSS rules must precede all other types of rules.
12 | */
13 | @import "~@nativescript/theme/css/core.css";
14 | @import "~@nativescript/theme/css/default.css";
15 |
16 | /* Place any CSS rules you want to apply on both iOS and Android here.
17 | This is where the vast majority of your CSS code goes. */
18 |
19 | /*
20 | The following CSS rule changes the font size of all Buttons that have the
21 | "-primary" class modifier.
22 | */
23 | Button.-primary {
24 | font-size: 18;
25 | }
26 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { Routes } from "@angular/router";
3 | import { NativeScriptRouterModule } from "@nativescript/angular";
4 |
5 | import { ItemsComponent } from "./item/items.component";
6 | import { ItemDetailComponent } from "./item/item-detail.component";
7 |
8 | const routes: Routes = [
9 | { path: "", redirectTo: "/items", pathMatch: "full" },
10 | { path: "items", component: ItemsComponent },
11 | { path: "item/:id", component: ItemDetailComponent }
12 | ];
13 |
14 | @NgModule({
15 | imports: [NativeScriptRouterModule.forRoot(routes)],
16 | exports: [NativeScriptRouterModule]
17 | })
18 | export class AppRoutingModule { }
19 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "ns-app",
5 | templateUrl: "./app.component.html"
6 | })
7 | export class AppComponent { }
8 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2 | import { NativeScriptModule } from "@nativescript/angular";
3 |
4 | import { AppRoutingModule } from "./app-routing.module";
5 | import { AppComponent } from "./app.component";
6 | import { ItemsComponent } from "./item/items.component";
7 | import { ItemDetailComponent } from "./item/item-detail.component";
8 |
9 | @NgModule({
10 | bootstrap: [
11 | AppComponent
12 | ],
13 | imports: [
14 | NativeScriptModule,
15 | AppRoutingModule
16 | ],
17 | declarations: [
18 | AppComponent,
19 | ItemsComponent,
20 | ItemDetailComponent
21 | ],
22 | providers: [],
23 | schemas: [
24 | NO_ERRORS_SCHEMA
25 | ]
26 | })
27 | export class AppModule { }
28 |
--------------------------------------------------------------------------------
/src/app/item/item-detail.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/app/item/item-detail.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from "@angular/core";
2 | import { ActivatedRoute } from "@angular/router";
3 |
4 | import { Item } from "./item";
5 | import { ItemService } from "./item.service";
6 |
7 | @Component({
8 | selector: "ns-details",
9 | templateUrl: "./item-detail.component.html",
10 | })
11 | export class ItemDetailComponent implements OnInit {
12 | item: Item;
13 |
14 | constructor(
15 | private itemService: ItemService,
16 | private route: ActivatedRoute
17 | ) {}
18 |
19 | ngOnInit(): void {
20 | const id = +this.route.snapshot.params.id;
21 | this.item = this.itemService.getItem(id);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/app/item/item.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from "@angular/core";
2 |
3 | import { Item } from "./item";
4 |
5 | @Injectable({
6 | providedIn: "root"
7 | })
8 | export class ItemService {
9 | private items = new Array- (
10 | { id: 1, name: "Ter Stegen", role: "Goalkeeper" },
11 | { id: 3, name: "Piqué", role: "Defender" },
12 | { id: 4, name: "I. Rakitic", role: "Midfielder" },
13 | { id: 5, name: "Sergio", role: "Midfielder" },
14 | { id: 6, name: "Denis Suárez", role: "Midfielder" },
15 | { id: 7, name: "Arda", role: "Midfielder" },
16 | { id: 8, name: "A. Iniesta", role: "Midfielder" },
17 | { id: 9, name: "Suárez", role: "Forward" },
18 | { id: 10, name: "Messi", role: "Forward" },
19 | { id: 11, name: "Neymar", role: "Forward" },
20 | { id: 12, name: "Rafinha", role: "Midfielder" },
21 | { id: 13, name: "Cillessen", role: "Goalkeeper" },
22 | { id: 14, name: "Mascherano", role: "Defender" },
23 | { id: 17, name: "Paco Alcácer", role: "Forward" },
24 | { id: 18, name: "Jordi Alba", role: "Defender" },
25 | { id: 19, name: "Digne", role: "Defender" },
26 | { id: 20, name: "Sergi Roberto", role: "Midfielder" },
27 | { id: 21, name: "André Gomes", role: "Midfielder" },
28 | { id: 22, name: "Aleix Vidal", role: "Midfielder" },
29 | { id: 23, name: "Umtiti", role: "Defender" },
30 | { id: 24, name: "Mathieu", role: "Defender" },
31 | { id: 25, name: "Masip", role: "Goalkeeper" }
32 | );
33 |
34 | getItems(): Array
- {
35 | return this.items;
36 | }
37 |
38 | getItem(id: number): Item {
39 | return this.items.filter((item) => item.id === id)[0];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/app/item/item.ts:
--------------------------------------------------------------------------------
1 | export interface Item {
2 | id: number;
3 | name: string;
4 | role: string;
5 | }
6 |
--------------------------------------------------------------------------------
/src/app/item/items.component.html:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
14 |
15 |
16 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/app/item/items.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from "@angular/core";
2 |
3 | import { Item } from "./item";
4 | import { ItemService } from "./item.service";
5 |
6 | @Component({
7 | selector: "ns-items",
8 | templateUrl: "./items.component.html"
9 | })
10 | export class ItemsComponent implements OnInit {
11 | items: Array
- ;
12 |
13 | constructor(private itemService: ItemService) { }
14 |
15 | ngOnInit(): void {
16 | this.items = this.itemService.getItems();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScriptDynamic } from "@nativescript/angular";
3 |
4 | import { AppModule } from "./app/app.module";
5 |
6 | // A traditional NativeScript application starts by initializing global objects,
7 | // setting up global CSS rules, creating, and navigating to the main page.
8 | // Angular applications need to take care of their own initialization:
9 | // modules, components, directives, routes, DI providers.
10 | // A NativeScript Angular app needs to make both paradigms work together,
11 | // so we provide a wrapper platform object, platformNativeScriptDynamic,
12 | // that sets up a NativeScript application and can bootstrap the Angular framework.
13 | platformNativeScriptDynamic().bootstrapModule(AppModule);
14 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "es2017",
5 | "moduleResolution": "node",
6 | "experimentalDecorators": true,
7 | "emitDecoratorMetadata": true,
8 | "noEmitHelpers": true,
9 | "noEmitOnError": true,
10 | "skipLibCheck": true,
11 | "lib": [
12 | "es2018", "es2017", "dom", "es6"
13 | ],
14 | "baseUrl": ".",
15 | "paths": {
16 | "~/*": [
17 | "app/*"
18 | ]
19 | }
20 | },
21 | "include": [
22 | "src/tests/**/*.ts",
23 | "src/**/*.ios.ts",
24 | "src/**/*.android.ts"
25 | ],
26 | "files": [
27 | "./references.d.ts",
28 | "./src/main.ts"
29 | ],
30 | "exclude": [
31 | "node_modules",
32 | "platforms",
33 | "e2e"
34 | ]
35 | }
--------------------------------------------------------------------------------
/tsfmt.json:
--------------------------------------------------------------------------------
1 | {
2 | "indentSize": 2,
3 | "tabSize": 2
4 | }
5 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep, dirname } = require('path');
2 | const fs = require('fs');
3 |
4 | const webpack = require('webpack');
5 | const nsWebpack = require('@nativescript/webpack');
6 | const nativescriptTarget = require('@nativescript/webpack/nativescript-target');
7 | const {
8 | nsSupportHmrNg
9 | } = require('@nativescript/webpack/transformers/ns-support-hmr-ng');
10 | const { nsTransformNativeClassesNg } = require("@nativescript/webpack/transformers/ns-transform-native-classes-ng");
11 | const {
12 | parseWorkspaceConfig, hasConfigurations
13 | } = require('@nativescript/webpack/helpers/angular-config-parser');
14 | const {
15 | getMainModulePath
16 | } = require('@nativescript/webpack/utils/ast-utils');
17 | const { getNoEmitOnErrorFromTSConfig, getCompilerOptionsFromTSConfig } = require("@nativescript/webpack/utils/tsconfig-utils");
18 | const { CleanWebpackPlugin } = require('clean-webpack-plugin');
19 | const CopyWebpackPlugin = require('copy-webpack-plugin');
20 | const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
21 | const {
22 | NativeScriptWorkerPlugin
23 | } = require('nativescript-worker-loader/NativeScriptWorkerPlugin');
24 | const TerserPlugin = require('terser-webpack-plugin');
25 | const {
26 | getAngularCompilerPlugin
27 | } = require('@nativescript/webpack/plugins/NativeScriptAngularCompilerPlugin');
28 | const hashSalt = Date.now().toString();
29 |
30 | module.exports = env => {
31 | // Add your custom Activities, Services and other Android app components here.
32 | const appComponents = [
33 | "@nativescript/core/ui/frame", "@nativescript/core/ui/frame/activity"
34 | ];
35 |
36 | const platform = env && ((env.android && 'android') || (env.ios && 'ios'));
37 | if (!platform) {
38 | throw new Error('You need to provide a target platform!');
39 | }
40 |
41 | const AngularCompilerPlugin = getAngularCompilerPlugin(platform);
42 | const projectRoot = __dirname;
43 |
44 | // Default destination inside platforms//...
45 | const dist = resolve(
46 | projectRoot,
47 | nsWebpack.getAppPath(platform, projectRoot)
48 | );
49 |
50 | const {
51 | // The 'appPath' and 'appResourcesPath' values are fetched from
52 | // the nsconfig.json configuration file
53 | // when bundling with `tns run android|ios --bundle`.
54 | appPath = 'src',
55 | appResourcesPath = 'App_Resources',
56 |
57 | // You can provide the following flags when running 'tns run android|ios'
58 | snapshot, // --env.snapshot,
59 | production, // --env.production
60 | configuration, // --env.configuration (consistent with angular cli usage)
61 | projectName, // --env.projectName (drive configuration through angular projects)
62 | uglify, // --env.uglify
63 | report, // --env.report
64 | sourceMap, // --env.sourceMap
65 | hiddenSourceMap, // --env.hiddenSourceMap
66 | hmr, // --env.hmr,
67 | unitTesting, // --env.unitTesting
68 | testing, // --env.testing
69 | verbose, // --env.verbose
70 | ci, // --env.ci
71 | snapshotInDocker, // --env.snapshotInDocker
72 | skipSnapshotTools, // --env.skipSnapshotTools
73 | compileSnapshot // --env.compileSnapshot
74 | } = env;
75 |
76 | const { fileReplacements, copyReplacements } = parseWorkspaceConfig(platform, configuration, projectName);
77 |
78 | const useLibs = compileSnapshot;
79 | const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
80 | const externals = nsWebpack.getConvertedExternals(env.externals);
81 | const appFullPath = resolve(projectRoot, appPath);
82 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
83 | let tsConfigName = 'tsconfig.json';
84 | let tsConfigPath = resolve(projectRoot, tsConfigName);
85 | const tsConfigTnsName = 'tsconfig.tns.json';
86 | const tsConfigTnsPath = resolve(projectRoot, tsConfigTnsName);
87 | if (fs.existsSync(tsConfigTnsPath)) {
88 | // support shared angular app configurations
89 | tsConfigName = tsConfigTnsName;
90 | tsConfigPath = tsConfigTnsPath;
91 | }
92 | const tsConfigEnvName = 'tsconfig.env.json';
93 | const tsConfigEnvPath = resolve(projectRoot, tsConfigEnvName);
94 | if (hasConfigurations(configuration) && fs.existsSync(tsConfigEnvPath)) {
95 | // when configurations are used, switch to environments supported config
96 | tsConfigName = tsConfigEnvName;
97 | tsConfigPath = tsConfigEnvPath;
98 | }
99 | const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
100 | const entryPath = `.${sep}${entryModule}`;
101 | const entries = { bundle: entryPath };
102 | const areCoreModulesExternal =
103 | Array.isArray(env.externals) &&
104 | env.externals.some(e => e.indexOf('@nativescript') > -1);
105 | if (platform === 'ios' && !areCoreModulesExternal && !testing) {
106 | entries['tns_modules/@nativescript/core/inspector_modules'] =
107 | 'inspector_modules';
108 | }
109 |
110 | const compilerOptions = getCompilerOptionsFromTSConfig(tsConfigPath);
111 | nsWebpack.processTsPathsForScopedModules({ compilerOptions });
112 | nsWebpack.processTsPathsForScopedAngular({ compilerOptions });
113 |
114 | const ngCompilerTransformers = [nsTransformNativeClassesNg];
115 | const additionalLazyModuleResources = [];
116 |
117 | const copyIgnore = { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] };
118 | const copyTargets = [
119 | { from: { glob: 'assets/**', dot: false } },
120 | { from: { glob: 'fonts/**', dot: false } },
121 | ...copyReplacements,
122 | ];
123 |
124 | if (!production) {
125 | // for development purposes only
126 | // for example, include mock json folder
127 | // copyTargets.push({ from: 'tools/mockdata', to: 'assets/mockdata' });
128 |
129 | if (hmr) {
130 | ngCompilerTransformers.push(nsSupportHmrNg);
131 | }
132 | }
133 |
134 | // when "@angular/core" is external, it's not included in the bundles. In this way, it will be used
135 | // directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes
136 | // fixes https://github.com/NativeScript/nativescript-cli/issues/4024
137 | if (env.externals && env.externals.indexOf('@angular/core') > -1) {
138 | const appModuleRelativePath = getMainModulePath(
139 | resolve(appFullPath, entryModule),
140 | tsConfigName
141 | );
142 | if (appModuleRelativePath) {
143 | const appModuleFolderPath = dirname(
144 | resolve(appFullPath, appModuleRelativePath)
145 | );
146 | // include the new lazy loader path in the allowed ones
147 | additionalLazyModuleResources.push(appModuleFolderPath);
148 | }
149 | }
150 |
151 | const ngCompilerPlugin = new AngularCompilerPlugin({
152 | hostReplacementPaths: nsWebpack.getResolver([platform, 'tns']),
153 | platformTransformers: ngCompilerTransformers.map(t =>
154 | t(() => ngCompilerPlugin, resolve(appFullPath, entryModule), projectRoot)
155 | ),
156 | mainPath: join(appFullPath, entryModule),
157 | tsConfigPath,
158 | skipCodeGeneration: false,
159 | sourceMap: !!isAnySourceMapEnabled,
160 | additionalLazyModuleResources: additionalLazyModuleResources,
161 | compilerOptions: { paths: compilerOptions.paths }
162 | });
163 |
164 | let sourceMapFilename = nsWebpack.getSourceMapFilename(
165 | hiddenSourceMap,
166 | __dirname,
167 | dist
168 | );
169 |
170 | const itemsToClean = [`${dist}/**/*`];
171 | if (platform === 'android') {
172 | itemsToClean.push(
173 | `${join(
174 | projectRoot,
175 | 'platforms',
176 | 'android',
177 | 'app',
178 | 'src',
179 | 'main',
180 | 'assets',
181 | 'snapshots'
182 | )}`
183 | );
184 | itemsToClean.push(
185 | `${join(
186 | projectRoot,
187 | 'platforms',
188 | 'android',
189 | 'app',
190 | 'build',
191 | 'configurations',
192 | 'nativescript-android-snapshot'
193 | )}`
194 | );
195 | }
196 |
197 | const noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigName);
198 |
199 | nsWebpack.processAppComponents(appComponents, platform);
200 | const config = {
201 | mode: production ? 'production' : 'development',
202 | context: appFullPath,
203 | externals,
204 | watchOptions: {
205 | ignored: [
206 | appResourcesFullPath,
207 | // Don't watch hidden files
208 | '**/.*'
209 | ]
210 | },
211 | target: nativescriptTarget,
212 | entry: entries,
213 | output: {
214 | pathinfo: false,
215 | path: dist,
216 | sourceMapFilename,
217 | libraryTarget: 'commonjs2',
218 | filename: '[name].js',
219 | globalObject: 'global',
220 | hashSalt
221 | },
222 | resolve: {
223 | extensions: ['.ts', '.js', '.scss', '.css'],
224 | // Resolve {N} system modules from @nativescript/core
225 | modules: [
226 | resolve(__dirname, 'node_modules/@nativescript/core'),
227 | resolve(__dirname, 'node_modules'),
228 | 'node_modules/@nativescript/core',
229 | 'node_modules'
230 | ],
231 | alias: {
232 | '~/package.json': resolve(projectRoot, 'package.json'),
233 | '~': appFullPath,
234 | "tns-core-modules": "@nativescript/core",
235 | "nativescript-angular": "@nativescript/angular",
236 | ...fileReplacements
237 | },
238 | symlinks: true
239 | },
240 | resolveLoader: {
241 | symlinks: false
242 | },
243 | node: {
244 | // Disable node shims that conflict with NativeScript
245 | http: false,
246 | timers: false,
247 | setImmediate: false,
248 | fs: 'empty',
249 | __dirname: false
250 | },
251 | devtool: hiddenSourceMap
252 | ? 'hidden-source-map'
253 | : sourceMap
254 | ? 'inline-source-map'
255 | : 'none',
256 | optimization: {
257 | runtimeChunk: 'single',
258 | noEmitOnErrors: noEmitOnErrorFromTSConfig,
259 | splitChunks: {
260 | cacheGroups: {
261 | vendor: {
262 | name: 'vendor',
263 | chunks: 'all',
264 | test: (module, chunks) => {
265 | const moduleName = module.nameForCondition
266 | ? module.nameForCondition()
267 | : '';
268 | return (
269 | /[\\/]node_modules[\\/]/.test(moduleName) ||
270 | appComponents.some(comp => comp === moduleName)
271 | );
272 | },
273 | enforce: true
274 | }
275 | }
276 | },
277 | minimize: !!uglify,
278 | minimizer: [
279 | new TerserPlugin({
280 | parallel: true,
281 | cache: !ci,
282 | sourceMap: isAnySourceMapEnabled,
283 | terserOptions: {
284 | output: {
285 | comments: false,
286 | semicolons: !isAnySourceMapEnabled
287 | },
288 | compress: {
289 | // The Android SBG has problems parsing the output
290 | // when these options are enabled
291 | collapse_vars: platform !== 'android',
292 | sequences: platform !== 'android',
293 | // custom
294 | drop_console: true,
295 | drop_debugger: true,
296 | ecma: 6,
297 | keep_infinity: platform === 'android', // for Chrome/V8
298 | reduce_funcs: platform !== 'android', // for Chrome/V8
299 | global_defs: {
300 | __UGLIFIED__: true
301 | }
302 | },
303 | // custom
304 | ecma: 6,
305 | safari10: platform !== 'android'
306 | }
307 | })
308 | ]
309 | },
310 | module: {
311 | rules: [
312 | {
313 | include: join(appFullPath, entryPath),
314 | use: [
315 | // Require all Android app components
316 | platform === 'android' && {
317 | loader: '@nativescript/webpack/helpers/android-app-components-loader',
318 | options: { modules: appComponents }
319 | },
320 |
321 | {
322 | loader: '@nativescript/webpack/bundle-config-loader',
323 | options: {
324 | angular: true,
325 | loadCss: !snapshot, // load the application css if in debug mode
326 | unitTesting,
327 | appFullPath,
328 | projectRoot,
329 | ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)
330 | }
331 | }
332 | ].filter(loader => !!loader)
333 | },
334 |
335 | { test: /\.html$|\.xml$/, use: 'raw-loader' },
336 |
337 | {
338 | test: /[\/|\\]app\.css$/,
339 | use: [
340 | '@nativescript/webpack/helpers/style-hot-loader',
341 | {
342 | loader: "@nativescript/webpack/helpers/css2json-loader",
343 | options: { useForImports: true }
344 | },
345 | ],
346 | },
347 | {
348 | test: /[\/|\\]app\.scss$/,
349 | use: [
350 | '@nativescript/webpack/helpers/style-hot-loader',
351 | {
352 | loader: "@nativescript/webpack/helpers/css2json-loader",
353 | options: { useForImports: true }
354 | },
355 | 'sass-loader',
356 | ],
357 | },
358 |
359 | // Angular components reference css files and their imports using raw-loader
360 | { test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: 'raw-loader' },
361 | {
362 | test: /\.scss$/,
363 | exclude: /[\/|\\]app\.scss$/,
364 | use: ['raw-loader', 'resolve-url-loader', 'sass-loader']
365 | },
366 |
367 | {
368 | test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
369 | use: [
370 | '@nativescript/webpack/helpers/moduleid-compat-loader',
371 | '@nativescript/webpack/helpers/lazy-ngmodule-hot-loader',
372 | '@ngtools/webpack'
373 | ]
374 | },
375 |
376 | // Mark files inside `@angular/core` as using SystemJS style dynamic imports.
377 | // Removing this will cause deprecation warnings to appear.
378 | {
379 | test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
380 | parser: { system: true }
381 | }
382 | ]
383 | },
384 | plugins: [
385 | // Define useful constants like TNS_WEBPACK
386 | new webpack.DefinePlugin({
387 | 'global.TNS_WEBPACK': 'true',
388 | 'global.isAndroid': platform === 'android',
389 | 'global.isIOS': platform === 'ios',
390 | process: 'global.process'
391 | }),
392 | // Remove all files from the out dir.
393 | new CleanWebpackPlugin({
394 | cleanOnceBeforeBuildPatterns: itemsToClean,
395 | verbose: !!verbose
396 | }),
397 | // Copy assets
398 | new CopyWebpackPlugin([
399 | ...copyTargets,
400 | { from: { glob: '**/*.jpg', dot: false } },
401 | { from: { glob: '**/*.png', dot: false } },
402 | ], copyIgnore),
403 | new nsWebpack.GenerateNativeScriptEntryPointsPlugin('bundle'),
404 | // For instructions on how to set up workers with webpack
405 | // check out https://github.com/nativescript/worker-loader
406 | new NativeScriptWorkerPlugin(),
407 | ngCompilerPlugin,
408 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
409 | new nsWebpack.WatchStateLoggerPlugin()
410 | ]
411 | };
412 |
413 | if (report) {
414 | // Generate report files for bundles content
415 | config.plugins.push(
416 | new BundleAnalyzerPlugin({
417 | analyzerMode: 'static',
418 | openAnalyzer: false,
419 | generateStatsFile: true,
420 | reportFilename: resolve(projectRoot, 'report', `report.html`),
421 | statsFilename: resolve(projectRoot, 'report', `stats.json`)
422 | })
423 | );
424 | }
425 |
426 | if (snapshot) {
427 | config.plugins.push(
428 | new nsWebpack.NativeScriptSnapshotPlugin({
429 | chunk: 'vendor',
430 | angular: true,
431 | requireModules: [
432 | 'reflect-metadata',
433 | '@angular/platform-browser',
434 | '@angular/core',
435 | '@angular/common',
436 | '@angular/router',
437 | '@nativescript/angular'
438 | ],
439 | projectRoot,
440 | webpackConfig: config,
441 | snapshotInDocker,
442 | skipSnapshotTools,
443 | useLibs
444 | })
445 | );
446 | }
447 |
448 | if (!production && hmr) {
449 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
450 | }
451 |
452 | return config;
453 | };
--------------------------------------------------------------------------------