Skip to content

Commit 9d74f02

Browse files
committed
chore: enable nx release
1 parent 5bb8ea5 commit 9d74f02

7 files changed

Lines changed: 133 additions & 582 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
Changelogs are maintained per package:
4+
5+
- [`@nativescript/angular`](packages/angular/CHANGELOG.md)
6+
- [`@nativescript/zone-js`](packages/zone-js/CHANGELOG.md)

README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,67 @@
1-
# @nativescript/angular
1+
# NativeScript Angular
22

3-
For usage with NativeScript for Angular projects.
3+
Monorepo for [Angular](https://angular.dev) integration with [NativeScript](https://nativescript.org), enabling you to build native iOS, Android and visionOS apps with Angular.
4+
5+
## Packages
6+
7+
| Package | Version | Description |
8+
| --- | --- | --- |
9+
| [`@nativescript/angular`](packages/angular) | [![npm](https://img.shields.io/npm/v/%40nativescript%2Fangular.svg)](https://www.npmjs.com/package/@nativescript/angular) | The Angular integration for NativeScript: renderer, router integration, dialogs, list view templates, zone setup and application bootstrap. |
10+
| [`@nativescript/zone-js`](packages/zone-js) | [![npm](https://img.shields.io/npm/v/%40nativescript%2Fzone-js.svg)](https://www.npmjs.com/package/@nativescript/zone-js) | NativeScript-specific patches for [zone.js](https://www.npmjs.com/package/zone.js) so Angular change detection works with native APIs. |
11+
12+
The workspace also contains [`apps/nativescript-demo-ng`](apps/nativescript-demo-ng), a demo app used to develop and test the packages.
13+
14+
See [DevelopmentWorkflow.md](DevelopmentWorkflow.md) for more details on contributing.
15+
16+
## Development
417

518
Clean and setup workspace:
619

720
```
821
npm run clean.all
922
```
1023

11-
## Build packages:
24+
Build packages:
1225

1326
```
1427
npm run build
1528
```
1629

17-
## Run demo:
30+
Run demo:
1831

1932
```
2033
npm run demo.ios
2134
// or...
2235
npm run demo.android
2336
```
2437

25-
## Clean/Reset demo dependencies
38+
Clean/Reset demo dependencies:
2639

2740
```
2841
npm run demo.clean
2942
```
3043

31-
## Unit tests for iOS and Android:
44+
Unit tests for iOS and Android:
3245

3346
```
3447
npm run test.android
3548
npm run test.ios
3649
```
50+
51+
## Releasing
52+
53+
Releases are managed with [Nx Release](https://nx.dev/features/manage-releases). Each package is released independently:
54+
55+
```
56+
npm run release.angular
57+
npm run release.zone-js
58+
```
59+
60+
This will build the package, prompt for the new version (or accept it as an argument, e.g. `npm run release.angular -- 22.0.0`), update the package's changelog ([packages/angular/CHANGELOG.md](packages/angular/CHANGELOG.md) or [packages/zone-js/CHANGELOG.md](packages/zone-js/CHANGELOG.md)), commit as `release: <version>`, tag as `<package>@<version>` (e.g. `angular@22.0.0`, `zone-js@4.0.1`), push, create the GitHub release and publish to npm from `dist/packages/*`.
61+
62+
Useful flags (pass after `--`):
63+
64+
- `--dry-run` — preview everything without changing anything
65+
- `--skip-publish` — do everything except publish to npm
66+
67+
A `GITHUB_TOKEN` environment variable (e.g. `GITHUB_TOKEN=$(gh auth token)`) is required to create the GitHub release non-interactively.

nx.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
"inputs": ["production", "^production"],
1919
"cache": true
2020
},
21+
"nx-release-publish": {
22+
"dependsOn": ["build"],
23+
"options": {
24+
"packageRoot": "dist/packages/{projectName}"
25+
}
26+
},
2127
"test": {
2228
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
2329
"cache": true
@@ -62,6 +68,45 @@
6268
"parallel": 2,
6369
"useInferencePlugins": false,
6470
"defaultBase": "main",
71+
"release": {
72+
"releaseTag": {
73+
"pattern": "{projectName}@{version}"
74+
},
75+
"version": {
76+
"preVersionCommand": "npx nx run-many -t build -p angular,zone-js",
77+
"manifestRootsToUpdate": ["{projectRoot}", "dist/packages/{projectName}"],
78+
"updateDependents": "never"
79+
},
80+
"git": {
81+
"commitMessage": "release: {version}"
82+
},
83+
"groups": {
84+
"angular": {
85+
"projects": ["angular"],
86+
"releaseTag": {
87+
"pattern": "angular@{version}"
88+
},
89+
"changelog": {
90+
"createRelease": "github",
91+
"renderOptions": {
92+
"authors": false
93+
}
94+
}
95+
},
96+
"zone-js": {
97+
"projects": ["zone-js"],
98+
"releaseTag": {
99+
"pattern": "zone-js@{version}"
100+
},
101+
"changelog": {
102+
"createRelease": "github",
103+
"renderOptions": {
104+
"authors": false
105+
}
106+
}
107+
}
108+
}
109+
},
65110
"generators": {
66111
"@nx/angular:component": {
67112
"type": "component"

0 commit comments

Comments
 (0)