Skip to content

Commit 0bc76c6

Browse files
committed
feat: transpile tns-core-modules via nativescript-dev-webpack
This commit: - adds `tns-core-modules/xml/xml.js` to source control as required by `nativescript-dev-webpack`: NativeScript/nativescript-dev-webpack#932 - configures the `tsconfig.json` file of tests - delete irrelevent steps from the development workflow instructions
1 parent c647fb3 commit 0bc76c6

File tree

8 files changed

+274
-22
lines changed

8 files changed

+274
-22
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ tscommand*.tmp.txt
4848

4949
# Other
5050
*.js
51+
# https://github.com/NativeScript/nativescript-dev-webpack/issues/932
52+
!tns-core-modules/xml/xml.js
5153
!tests/hooks/**/*.*
5254
!gruntfile.js
5355
!js-libs/**/*.*

Diff for: DevelopmentWorkflow.md

+4-17
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ Install devDependencies:
4242
npm install
4343
```
4444

45-
Run `setup` script. This will [`npm link`](https://docs.npmjs.com/cli/link) the `tns-core-modules` and `tns-core-modules-declarations` dependencies inside the `tests` and `apps` projects.
46-
47-
```bash
48-
npm run setup
49-
```
50-
5145
## TypeScript
5246

5347
The following commands are commonly used to compile the `tns-core-modules`:
@@ -68,24 +62,17 @@ The modules have `typescript` as a devDependency so you should also be able to u
6862
./node_modules/.bin/tsc
6963
```
7064

71-
You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps` and `tests` at once at the root of the repo:
65+
You can compile the TypeScript files in the `tns-core-modules` and `tns-platform-declarations` at once at the root of the repo:
7266

7367
```bash
7468
npm run tsc
7569
```
7670

7771
## Running Unit Tests
7872

79-
The test app is an ordinary NativeScript app that logs the test results as it go.
80-
After the [initial setup](#initial-setup) you can run the tests with:
81-
82-
```bash
83-
# Make sure TypeScript is transpiled
84-
tsc
85-
86-
# Run the tests app
87-
tns run ios --path tests
88-
tns run android --path tests
73+
```
74+
cd ./tests
75+
tns run android| ios
8976
```
9077

9178
## Running the Test App

Diff for: tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"tns-core-modules": "file:../tns-core-modules"
1717
},
1818
"devDependencies": {
19-
"nativescript-dev-webpack": "~0.22.0",
19+
"nativescript-dev-webpack": "next",
2020
"node-sass": "^4.12.0",
2121
"tns-platform-declarations": "file:../tns-platform-declarations",
2222
"typescript": "~3.4.1"

Diff for: tests/tsconfig.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@
1717
]
1818
}
1919
},
20+
"include": [
21+
"../tns-core-modules",
22+
"**/*"
23+
],
2024
"exclude": [
25+
"../tns-core-modules/node_modules",
2126
"node_modules",
2227
"platforms"
2328
]
24-
}
29+
}

Diff for: tns-core-modules/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@types/node": "~7.0.5",
34-
"tns-platform-declarations": "*"
34+
"tns-platform-declarations": "file:../tns-platform-declarations"
3535
},
3636
"scripts": {
3737
"version": "conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md"

Diff for: tns-core-modules/references.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
2-
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
1+
/// <reference path="../tns-platform-declarations/ios.d.ts" />
2+
/// <reference path="../tns-platform-declarations/android.d.ts" />

Diff for: tns-core-modules/xml/xml.js

+255
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tns-core-modules/xml/xml.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// TODO: Delete `tns-core-modules/xml/xml.js` from source control after
2+
// https://github.com/NativeScript/nativescript-dev-webpack/issues/932
3+
14
import * as definition from ".";
25
import * as easysax from "../js-libs/easysax";
36

0 commit comments

Comments
 (0)