Skip to content

chore: update dev workflow for Angular app #7861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions DevelopmentWorkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,47 @@ tns run ios
tns run android
```

### Running Another Angular App

When linking within a Angular/TS project, `tns run` will grab the linked TS files in core modules and try to compile them without the references needed. To work around this, from the root of your `NativeScript` clone do the following:

1. Create a copy of `tns-core-modules` folder via:
```bash
mkdir dist && cp -r tns-core-modules dist/
# Should look like this:
NativeScript
|
+--> dist
|
+--> tns-core-modules
|
+--> ...
+--> ...
+--> ...
```
2. Delete all `.ts` files, keeping `d.ts` ones via:
```bash
find dist/tns-core-modules -name "*.ts" -not -name "*.d.ts" -delete
```
3. Add `--outDir dist` to the `tsc-w` script in `package.json`
```
"scripts": {
...
"tsc-w": "npm run tsc -- --skipLibCheck -w --outDir dist",
...
```
4. Run `npm run tsc-w`
5. In another terminal, go to the root of your NS Angular project and link the `dist/tns-core-modules` via:
```bash
npm install --save <path to dist/tns-core-modules>
# Example: npm install --save ../NativeScript/dist/tns-core-modules
```
6. Run the app
```bash
tns run ios
tns run android
```

## Platform declarations
To update the platform declarations (the ios.d.ts-es) you can run:

Expand Down