Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 5539ddb

Browse files
feat: angular 5 (#328)
* Enable plugin to run through hooks Instead of relying on npm scripts, rely on hooks so that certain parts of the prepare chain can be overriden. Do not skip moving `App_Resources` directory, as CLI expects it to be present in platforms and will take care of the resources inside. chore(deps): unpin nativescript-hook version enable webpack builds in debug and optional snapshot feat: support for Angular 5 - add NativeScriptAngularCompilerPlugin that extends AngularCompilerPlugin BREAKING CHANGES NativeScriptAngularCompilerPlugin must be used instead of AotPlugin in your webpack configuration from now on. You can regenerate the webpack configuration if you haven't made changes to it by running "./node_modules/.bin/update-ns-webpack --configs". ... Implement NativeScriptAngularCompilerPlugin and integrate the PlatformFSPlugin .js .map.js and .d.ts files don't have to stay in source control, they will be generated on prepare Make prepare script to tsc, and ignore .ts artifacts from source control Remove the prepare scripts that create templates/webpack.*.js Make the webpack config work for angular, typescript and javascript WIP chore: update added versions Add Angular and JavaScript apps for tests Add demo/AngularApp, demo/JavaScriptApp in wip chore: remove dependency to @angular/animations as it's not used feat(demo-ng): add lazy loaded modules Add scss and platform specific files to the JavaScriptApp demo Make JavaScriptApp work with css and scss, bundle all .js, .css and .scss files test(AngularApp): add configs, dependencies and samples Add some testable rectangles for the app so we can ensure CSS and SCSS work Fix a minor bug in the angular webpack plugin Added a TypeScript project and configured the TypeScript webpack config test(AngularApp): add tests and images Map the watchFileSystem, seems to work 'decently' now... Map timestamps so platform specific files dont get rebuild with every change Add IPC notifications for CLI watch Adding IPC channel without watch made the proccess hang filter for watcher was mapping absolute paths to basenames * chore(AngularApp): update config files * Minor fix Fix `cwd` parameter name. Remove `shell: true` becuase it causes issues on windows. * test(TypeScriptApp): update demo and add tests * PR review, changes * text(TypeScriptApp): update resources and tests * Make scss work with the nativescript-dev-sass hooks when run without webpack, figured out routes * test(TypeScriptApp): update ios style image * Add a simple attribute directive to test that angular works well with the .ios.ts and .android.ts suffixes * Roll back the platform specific Directive as it does not work with --env.aot, fix tsconfig.aot.json paths * We still need to copy App_Resources/** for the prepareNative to work * test(AngularApp): update demo and tests
1 parent 9a57a53 commit 5539ddb

File tree

305 files changed

+4286
-1192
lines changed

Some content is hidden

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

305 files changed

+4286
-1192
lines changed

Diff for: .gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1+
12
node_modules
23
*.tgz
4+
package-lock.json
5+
6+
plugins/NativeScriptAngularCompilerPlugin.d.ts
7+
plugins/NativeScriptAngularCompilerPlugin.js
8+
plugins/NativeScriptAngularCompilerPlugin.js.map
9+
10+
plugins/PlatformFSPlugin.d.ts
11+
plugins/PlatformFSPlugin.js
12+
plugins/PlatformFSPlugin.js.map
13+
14+
plugins/WatchStateLoggerPlugin.d.ts
15+
plugins/WatchStateLoggerPlugin.js
16+
plugins/WatchStateLoggerPlugin.js.map
17+
18+
hooks
19+
.DS_Store

Diff for: .npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
prepublish
2+
demo

Diff for: bin/ns-bundle

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ function spawnChildProcess(command, ...args) {
225225

226226
const childProcess = spawn(command, escapedArgs, {
227227
stdio: "inherit",
228-
pwd: PROJECT_DIR,
228+
cwd: PROJECT_DIR,
229229
shell: true,
230230
});
231231

Diff for: demo/.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
platforms
3+
hooks
4+
report
5+
6+
**/*.map
7+
8+
reports/
9+
test-results.xml
10+
11+
tsconfig.aot.json
12+
13+
vendor.js
14+
vendor-platform.android.js
15+
vendor-platform.ios.js
16+
17+
vendor.ts
18+
vendor-platform.android.ts
19+
vendor-platform.ios.ts
20+
21+
webpack.config.js

Diff for: demo/AngularApp/.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
platforms
3+
hooks
4+
5+
app/**/*.js
6+
e2e/**/*.js
7+
e2e/**/*.map
8+
e2e/reports/
9+
test-results.xml
10+
11+
app/item/items.component.android.css
12+
app/item/items.component.ios.css

Diff for: demo/AngularApp/.vscode/launch.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Debug",
11+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12+
"args": [
13+
"-u",
14+
"tdd",
15+
"--timeout",
16+
"999999",
17+
"--colors",
18+
"--opts",
19+
"./e2e/config/mocha.opts",
20+
"--runType",
21+
"android23",
22+
"--reuseDevice"
23+
// "${workspaceFolder}/test"
24+
],
25+
"internalConsoleOptions": "openOnSessionStart"
26+
},
27+
{
28+
"type": "node",
29+
"request": "launch",
30+
"name": "Launch Program",
31+
"program": "${file}"
32+
}
33+
]
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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-sdk
14+
android:minSdkVersion="17"
15+
android:targetSdkVersion="__APILEVEL__"/>
16+
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19+
<uses-permission android:name="android.permission.INTERNET"/>
20+
21+
<application
22+
android:name="com.tns.NativeScriptApplication"
23+
android:allowBackup="true"
24+
android:icon="@drawable/icon"
25+
android:label="@string/app_name"
26+
android:theme="@style/AppTheme">
27+
28+
<activity
29+
android:name="com.tns.NativeScriptActivity"
30+
android:label="@string/title_activity_kimera"
31+
android:configChanges="keyboardHidden|orientation|screenSize"
32+
android:theme="@style/LaunchScreenTheme">
33+
34+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
35+
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
<category android:name="android.intent.category.LAUNCHER" />
39+
</intent-filter>
40+
</activity>
41+
<activity android:name="com.tns.ErrorReportActivity"/>
42+
</application>
43+
</manifest>

Diff for: demo/AngularApp/app/App_Resources/Android/app.gradle

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
generatedDensities = []
11+
applicationId = "org.nativescript.AngularApp"
12+
}
13+
aaptOptions {
14+
additionalParameters "--no-version-vectors"
15+
}
16+
}
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>
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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"size" : "29x29",
5+
"idiom" : "iphone",
6+
"filename" : "icon-29.png",
7+
"scale" : "1x"
8+
},
9+
{
10+
"size" : "29x29",
11+
"idiom" : "iphone",
12+
"filename" : "[email protected]",
13+
"scale" : "2x"
14+
},
15+
{
16+
"size" : "29x29",
17+
"idiom" : "iphone",
18+
"filename" : "[email protected]",
19+
"scale" : "3x"
20+
},
21+
{
22+
"size" : "40x40",
23+
"idiom" : "iphone",
24+
"filename" : "[email protected]",
25+
"scale" : "2x"
26+
},
27+
{
28+
"size" : "40x40",
29+
"idiom" : "iphone",
30+
"filename" : "[email protected]",
31+
"scale" : "3x"
32+
},
33+
{
34+
"size" : "60x60",
35+
"idiom" : "iphone",
36+
"filename" : "[email protected]",
37+
"scale" : "2x"
38+
},
39+
{
40+
"size" : "60x60",
41+
"idiom" : "iphone",
42+
"filename" : "[email protected]",
43+
"scale" : "3x"
44+
},
45+
{
46+
"size" : "29x29",
47+
"idiom" : "ipad",
48+
"filename" : "icon-29.png",
49+
"scale" : "1x"
50+
},
51+
{
52+
"size" : "29x29",
53+
"idiom" : "ipad",
54+
"filename" : "[email protected]",
55+
"scale" : "2x"
56+
},
57+
{
58+
"size" : "40x40",
59+
"idiom" : "ipad",
60+
"filename" : "icon-40.png",
61+
"scale" : "1x"
62+
},
63+
{
64+
"size" : "40x40",
65+
"idiom" : "ipad",
66+
"filename" : "[email protected]",
67+
"scale" : "2x"
68+
},
69+
{
70+
"size" : "76x76",
71+
"idiom" : "ipad",
72+
"filename" : "icon-76.png",
73+
"scale" : "1x"
74+
},
75+
{
76+
"size" : "76x76",
77+
"idiom" : "ipad",
78+
"filename" : "[email protected]",
79+
"scale" : "2x"
80+
},
81+
{
82+
"size" : "83.5x83.5",
83+
"idiom" : "ipad",
84+
"filename" : "[email protected]",
85+
"scale" : "2x"
86+
},
87+
{
88+
"size" : "1024x1024",
89+
"idiom" : "ios-marketing",
90+
"filename" : "icon-1024.png",
91+
"scale" : "1x"
92+
}
93+
],
94+
"info" : {
95+
"version" : 1,
96+
"author" : "xcode"
97+
}
98+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

0 commit comments

Comments
 (0)