Skip to content

Commit 28f9fe6

Browse files
committed
chore: latest updates
1 parent ecbfb83 commit 28f9fe6

32 files changed

+5251
-5110
lines changed

Diff for: .eslintrc.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@
2424
{
2525
"files": ["*.ts", "*.tsx"],
2626
"extends": ["plugin:@nx/typescript"],
27-
"rules": {}
27+
"rules": {
28+
"@typescript-eslint/no-extra-semi": "error",
29+
"no-extra-semi": "off"
30+
}
2831
},
2932
{
3033
"files": ["*.js", "*.jsx"],
3134
"extends": ["plugin:@nx/javascript"],
32-
"rules": {}
35+
"rules": {
36+
"@typescript-eslint/no-extra-semi": "error",
37+
"no-extra-semi": "off"
38+
}
3339
},
3440
{
3541
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ testem.log
3838
# System Files
3939
.DS_Store
4040
Thumbs.db
41+
42+
.nx/cache
43+
.nx/workspace-data

Diff for: .prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
/dist
44
/coverage
5+
6+
/.nx/cache
7+
/.nx/workspace-data

Diff for: README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ iOS apps flavored with Angular, React, Solid, Svelte, TypeScript and Vue
1414
Prerequisites:
1515
- [NativeScript Environment Setup](https://docs.nativescript.org/environment-setup.html)
1616
- yarn installed: `npm install -g yarn` (tested with 1.22.19)
17-
- node >=16 (recommend 18.x.x)
17+
- node >=20
1818

1919
```
2020
yarn setup
@@ -25,37 +25,37 @@ yarn setup
2525
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/2048px-Angular_full_color_logo.svg.png" width="60"/>
2626

2727
```
28-
yarn nx run nativescript-angular:ios
28+
yarn nx debug nativescript-angular ios
2929
```
3030

3131
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/1000px-React-icon.svg.png" width="60"/>
3232

3333
```
34-
yarn nx run nativescript-react:ios
34+
yarn nx debug nativescript-react ios
3535
```
3636

3737
<img src="https://www.solidjs.com/img/logo/without-wordmark/logo.png" width="60"/>
3838

3939
```
40-
yarn nx run nativescript-solid:ios
40+
yarn nx debug nativescript-solid ios
4141
```
4242

4343
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Svelte_Logo.svg/996px-Svelte_Logo.svg.png?20191219133350" width="60"/>
4444

4545
```
46-
yarn nx run nativescript-svelte:ios
46+
yarn nx debug nativescript-svelte ios
4747
```
4848

4949
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Typescript_logo_2020.svg/1024px-Typescript_logo_2020.svg.png?20221110153201" width="60"/>
5050

5151
```
52-
yarn nx run nativescript-typescript:ios
52+
yarn nx debug nativescript-typescript ios
5353
```
5454

5555
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Vue.js_Logo_2.svg/1024px-Vue.js_Logo_2.svg.png?20170919082558" width="60"/>
5656

5757
```
58-
yarn nx run nativescript-vue:ios
58+
yarn nx debug nativescript-vue ios
5959
```
6060

6161
## What is This?

Diff for: apps/nativescript-angular/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ platforms/
88
*.js
99
!ngcc.config.js
1010
!webpack.config.js
11+
!tailwind.config.js
1112
!jest.config.js
12-
*.css
1313

1414
# Logs
1515
logs

Diff for: apps/nativescript-angular/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"version": "0.0.0",
66
"private": true,
77
"dependencies": {
8-
"@nativescript/core": "next",
9-
"@nativescript/swift-ui": "^1.1.0"
8+
"@nativescript/core": "~8.8.0",
9+
"@nativescript/swift-ui": "^4.0.2",
10+
"@nativescript/tailwind": "^2.1.0"
1011
},
1112
"devDependencies": {
12-
"@nativescript/android": "~8.5.0",
13-
"@nativescript/ios": "~8.5.0"
13+
"@nativescript/android": "~8.8.0",
14+
"@nativescript/ios": "~8.8.0"
1415
}
1516
}

Diff for: apps/nativescript-angular/project.json

+28-14
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,40 @@
1111
"production": true,
1212
"uglify": true,
1313
"release": true,
14-
"forDevice": true
14+
"forDevice": true,
15+
"tsConfig": "apps/nativescript-angular/tsconfig.app.json"
1516
}
1617
},
17-
"ios": {
18-
"executor": "@nativescript/nx:build",
18+
"debug": {
19+
"executor": "@nativescript/nx:debug",
1920
"options": {
20-
"platform": "ios"
21-
}
21+
"noHmr": true,
22+
"uglify": false,
23+
"release": false,
24+
"forDevice": false,
25+
"prepare": false
26+
},
27+
"dependsOn": [
28+
"^build"
29+
]
2230
},
23-
"android": {
24-
"executor": "@nativescript/nx:build",
31+
"prepare": {
32+
"executor": "@nativescript/nx:prepare",
2533
"options": {
26-
"platform": "android"
27-
}
34+
"noHmr": true,
35+
"production": true,
36+
"uglify": true,
37+
"release": true,
38+
"forDevice": true,
39+
"prepare": true
40+
},
41+
"dependsOn": [
42+
"^build"
43+
]
2844
},
2945
"clean": {
30-
"executor": "@nativescript/nx:build",
31-
"options": {
32-
"clean": true
33-
}
46+
"executor": "@nativescript/nx:clean",
47+
"options": {}
3448
}
3549
}
36-
}
50+
}

Diff for: apps/nativescript-angular/src/app.css

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
.h-center {
6+
horizontal-align: center;
7+
}
8+
.h-left {
9+
horizontal-align: left;
10+
}
11+
.h-right {
12+
horizontal-align: right;
13+
}

Diff for: apps/nativescript-angular/src/app/app-routing.module.ts

-16
This file was deleted.

Diff for: apps/nativescript-angular/src/app/app.component.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { Component } from '@angular/core'
2-
import { registerElement } from '@nativescript/angular'
1+
import { Component, NO_ERRORS_SCHEMA } from '@angular/core'
2+
import { PageRouterOutlet, registerElement } from '@nativescript/angular'
33
import { SwiftUI } from '@nativescript/swift-ui'
44

55
registerElement('SwiftUI', () => SwiftUI);
66

77
@Component({
88
selector: 'ns-app',
99
templateUrl: './app.component.html',
10+
imports: [PageRouterOutlet],
11+
schemas: [NO_ERRORS_SCHEMA],
1012
})
1113
export class AppComponent {}

Diff for: apps/nativescript-angular/src/app/app.module.ts

-15
This file was deleted.

Diff for: apps/nativescript-angular/src/app/app.routes.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Routes } from '@angular/router';
2+
import { HomeComponent } from './home.component'
3+
4+
export const routes: Routes = [
5+
{ path: '', redirectTo: '/home', pathMatch: 'full' },
6+
{ path: 'home', component: HomeComponent },
7+
];
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<GridLayout class="bg-black">
1+
<GridLayout class="bg-black" iosOverflowSafeArea="true">
22

33
<SwiftUI swiftId="lavaLamp" [data]="data">
44
</SwiftUI>
55

6-
<Image src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/2048px-Angular_full_color_logo.svg.png" class="logo"></Image>
6+
<Image src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/2048px-Angular_full_color_logo.svg.png" class="w-[100] h-[100] align-top h-left mt-2 ml-2"></Image>
77
</GridLayout>

Diff for: apps/nativescript-angular/src/app/home.component.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
import { Component } from "@angular/core";
1+
import { Component, NO_ERRORS_SCHEMA } from "@angular/core";
22
import { Color } from "@nativescript/core";
33
import { setupLamp, ISwiftLamp } from '@lava/nativescript-lamp';
4-
setupLamp();
4+
import { NativeScriptCommonModule, NativeScriptRouterModule } from "@nativescript/angular";
55

66
@Component({
77
selector: "ns-home",
88
templateUrl: "./home.component.html",
9+
imports: [NativeScriptCommonModule, NativeScriptRouterModule],
10+
schemas: [NO_ERRORS_SCHEMA],
911
})
1012
export class HomeComponent {
1113
data: ISwiftLamp = {
1214
gradientTopColor: new Color('#b32535').ios,
1315
gradientMiddleColor: new Color('#bd2b39').ios,
1416
gradientBottomColor: new Color('#bd2b39').ios,
15-
};;
17+
};
18+
19+
ngOnInit() {
20+
setupLamp();
21+
}
1622
}

Diff for: apps/nativescript-angular/src/main.ts

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
1-
import { platformNativeScript, runNativeScriptAngularApp } from '@nativescript/angular';
1+
import {
2+
bootstrapApplication,
3+
provideNativeScriptHttpClient,
4+
provideNativeScriptNgZone,
5+
provideNativeScriptRouter,
6+
runNativeScriptAngularApp,
7+
} from '@nativescript/angular';
8+
import { provideExperimentalZonelessChangeDetection } from '@angular/core';
9+
import { withInterceptorsFromDi } from '@angular/common/http';
10+
import { routes } from './app/app.routes';
11+
import { AppComponent } from './app/app.component';
212

3-
import { AppModule } from './app/app.module';
13+
/**
14+
* Disable zone by setting this to true
15+
* Then also adjust polyfills.ts (see note there)
16+
*/
17+
const EXPERIMENTAL_ZONELESS = true;
418

519
runNativeScriptAngularApp({
6-
appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
20+
appModuleBootstrap: () => {
21+
return bootstrapApplication(AppComponent, {
22+
providers: [
23+
provideNativeScriptHttpClient(withInterceptorsFromDi()),
24+
provideNativeScriptRouter(routes),
25+
EXPERIMENTAL_ZONELESS
26+
? provideExperimentalZonelessChangeDetection()
27+
: provideNativeScriptNgZone(),
28+
],
29+
});
30+
},
731
});
8-

Diff for: apps/nativescript-angular/src/polyfills.ts

-12
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,3 @@
66
import '@nativescript/core/globals';
77
// Install @nativescript/angular specific polyfills
88
import '@nativescript/angular/polyfills';
9-
10-
/**
11-
* Zone.js and patches
12-
*/
13-
// Add pre-zone.js patches needed for the NativeScript platform
14-
import '@nativescript/zone-js/dist/pre-zone-polyfills';
15-
16-
// Zone JS is required by default for Angular itself
17-
import 'zone.js';
18-
19-
// Add NativeScript specific Zone JS patches
20-
import '@nativescript/zone-js';

Diff for: apps/nativescript-angular/tailwind.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: ['./src/**/*.{css,xml,html,vue,svelte,ts,tsx}'],
4+
// use the .ns-dark class to control dark mode (applied by NativeScript) - since 'media' (default) is not supported.
5+
darkMode: ['class', '.ns-dark'],
6+
theme: {
7+
extend: {},
8+
},
9+
plugins: [],
10+
corePlugins: {
11+
preflight: false, // disables browser-specific resets
12+
},
13+
};
14+

Diff for: apps/nativescript-react/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"version": "1.0.0",
55
"private": true,
66
"dependencies": {
7-
"@nativescript/core": "next",
8-
"@nativescript/swift-ui": "^1.1.0"
7+
"@nativescript/core": "~8.8.0",
8+
"@nativescript/swift-ui": "^4.0.2"
99
},
1010
"devDependencies": {
11-
"@nativescript/android": "~8.5.0",
12-
"@nativescript/ios": "~8.5.0"
11+
"@nativescript/android": "~8.8.0",
12+
"@nativescript/ios": "~8.8.0"
1313
}
1414
}

0 commit comments

Comments
 (0)