Skip to content

Commit ce6d925

Browse files
author
vakrilov
committed
chore: dev-workflow for other apps
1 parent 67004c2 commit ce6d925

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

DevelopmentWorkflow.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,28 @@ tns run ios
7070
>Note: NOTE: do not commit changes in the runtime versions to `e2e/<app-name>/package.json`
7171
7272
---
73-
**NOTE**
7473

75-
Linking `tns-core-modules` in Angular app does not work at the moment. Check [#7905](https://github.com/NativeScript/NativeScript/issues/7905) for more details on the issue.
74+
## Running Another App
75+
76+
### TypeScript Applications
77+
Link both the `nativescript-core` folder and the generated compatibility package (`dist\tns-core-modules`):
78+
``` bash
79+
npm i <path-to-nativescript-repo>/nativescript-core --save
80+
npm i <path-to-nativescript-repo>/dist/tns-core-modules --save
81+
```
82+
83+
You can do changes in the app code and `nativescript-core` and rely on HMR to refresh the app.
84+
85+
### JavaScript Applications
86+
Use the same steps as with TS application. However, the configuration of JS application does not include loading and transpiling TS code. You need to transpile the TS code in `nativescript-core` yourself. The following npm script will run tsc in watch mode in `nativescript-core` (run it in a separate terminal so that you can do `tns run` in parallel):
87+
88+
``` bash
89+
npm run tsc-core-watch
90+
```
91+
92+
### Angular Applications
93+
Linking `tns-core-modules` and `@nativescript/core` in **Angular applications** does not work at the moment. Check [#7905](https://github.com/NativeScript/NativeScript/issues/7905) for more details on the issue.
7694

77-
---
7895

7996
## Building `tns-core-modules-widgets`
8097
You can the following npm script to build and link the `tns-core-modules-widgets` package.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"setup": "npm run build-core && npm run build-compat && npm run setup-link",
4242
"setup-link": "(cd nativescript-core && npm link) && (cd dist/tns-core-modules && npm uninstall @nativescript/core -S)",
4343
"setup-widgets": "(cd tns-core-modules-widgets && sh build.sh) && npm run dev-link-tns-core-modules-widgets",
44+
"tsc-core-watch":" tsc -p nativescript-core/tsconfig.json -w",
4445
"tslint": "tslint --project tsconfig.tslint.json --config build/tslint.json",
4546
"unit-test": "tsc -p unit-tests/tsconfig.json && mocha --opts unit-tests/mocha.opts",
4647
"unit-test-watch": "mocha-typescript-watch -p unit-tests/tsconfig.json --opts unit-tests/mocha.opts",

0 commit comments

Comments
 (0)