Skip to content

Commit 8194db6

Browse files
authored
Merge pull request #9 from nstudio/develop
3.0.0
2 parents 991c511 + d61683d commit 8194db6

21 files changed

+2627
-2881
lines changed

.github/issue_template.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
### Make sure to check the demo app(s) for sample usage
1+
### Make sure to check the demo app(s) for sample usage
22

3-
### Make sure to check the existing issues in this repository
3+
### Make sure to check the existing issues in this repository
44

55
### If the demo apps cannot help and there is no issue for your problem, tell us about it
6+
67
Please, ensure your title is less than 63 characters long and starts with a capital
78
letter.
89

910
### Which platform(s) does your issue occur on?
10-
- iOS/Android/Both
11-
- iOS/Android versions
11+
12+
- iOS/Android/Both
13+
- iOS/Android versions
1214
- emulator or device. What type of device?
1315

1416
### Please, provide the following version numbers that your issue occurs with:
1517

16-
- CLI: (run `tns --version` to fetch it)
18+
- CLI: (run `ns --version` to fetch it)
1719
- Cross-platform modules: (check the 'version' attribute in the
18-
`node_modules/tns-core-modules/package.json` file in your project)
19-
- Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project)
20+
`node_modules/@nativescript/core/package.json` file in your project)
21+
- Runtime(s): (look for the `"@nativescript/android"` and `"@nativescript/ios"` properties in the `package.json` file of your project)
2022
- Plugin(s): (look for the version numbers in the `package.json` file of your
21-
project and paste your dependencies and devDependencies here)
23+
project and paste your dependencies and devDependencies here)
24+
25+
### Please, tell us how to recreate the issue in as much detail as possible.
2226

23-
### Please, tell us how to recreate the issue in as much detail as possible.
2427
Describe the steps to reproduce it.
2528

26-
### Is there any code involved?
27-
- provide a code example to recreate the problem
28-
- (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.
29+
### Is there any code involved?
30+
31+
- provide a code example to recreate the problem
32+
- (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v1
1313

14-
- name: Set Node.js 10.x
14+
- name: Set Node.js 12.x
1515
uses: actions/setup-node@v1
1616
with:
17-
node-version: "10.x"
17+
node-version: "12.x"
1818

1919
- name: Build Plugin Source
2020
run: cd src && npm i && npx tsc
@@ -32,18 +32,18 @@ jobs:
3232
- name: Setup NativeScript CLI
3333
run: |
3434
echo no | npm i -g nativescript
35-
tns usage-reporting disable
36-
tns error-reporting disable
35+
ns usage-reporting disable
36+
ns error-reporting disable
3737
3838
- name: Build Android Demo App
3939
run: |
4040
cd demo
41-
tns build android --env.uglify --force
41+
ns build android --env.uglify
4242
4343
- name: Build iOS Demo App
4444
run: |
4545
cd demo
46-
tns build ios --env.uglify --force
46+
ns build ios --env.uglify
4747
4848
- name: Lint
4949
run: cd src && npm run ci.lint

.gitignore

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1+
# IDE
12
.vscode
23
.idea
4+
5+
# Files
36
.DS_Store
47
*.esm.json
58
*.js
69
*.js.map
710
*.log
8-
src/*.d.ts
9-
!src/index.d.ts
10-
!src/references.d.ts
11-
!src/scripts/*.js
12-
!seed-tests/*.js
13-
seed-tests/seed-copy
14-
seed-tests/seed-copy-new-git-repo/**/*.*
11+
12+
# Folders
13+
node_modules
14+
15+
# Demo
1516
!demo/karma.conf.js
1617
!demo/app/tests/*.js
17-
demo/*.d.ts
18-
!demo/references.d.ts
19-
demo/lib
2018
demo/platforms
21-
node_modules
22-
publish/src
23-
publish/package
2419
demo/report/report.html
2520
demo/report/stats.json
21+
22+
# Lib
23+
publish/src
24+
publish/package
25+
src/*.d.ts
26+
!src/index.d.ts
27+
!src/references.d.ts
28+
!src/scripts/*.js

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NativeScript Mixpanel
22

33
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nstudio/nativescript-mixpanel/Build%20CI?style=flat-square)](https://github.com/nstudio/nativescript-mixpanel/actions?workflow=Build+CI)
4-
[![npm](https://img.shields.io/badge/nativescript-6.5-blue?style=flat-square)](https://nativescript.org/)
4+
[![npm](https://img.shields.io/badge/nativescript-7-blue?style=flat-square)](https://nativescript.org/)
55
[![npm](https://img.shields.io/npm/v/@nstudio/nativescript-mixpanel?style=flat-square)](https://www.npmjs.com/package/@nstudio/nativescript-mixpanel)
66
[![npm](https://img.shields.io/npm/dt/@nstudio/nativescript-mixpanel?style=flat-square)](https://www.npmjs.com/package/@nstudio/nativescript-mixpanel)
77

@@ -11,7 +11,11 @@
1111

1212
From your command prompt/terminal go to your application's root folder and execute:
1313

14-
`tns plugin add @nstudio/nativescript-mixpanel`
14+
`ns plugin add @nstudio/nativescript-mixpanel`
15+
16+
### NativeScript 6.5
17+
18+
`tns plugin add @nstudio/[email protected]`
1519

1620
# Usage
1721

demo/app/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import * as app from "tns-core-modules/application";
1+
import { Application } from "@nativescript/core";
22

3-
app.run({ moduleName: "app-root" });
3+
Application.run({ moduleName: "app-root" });

demo/app/main/main-page.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import * as observable from "tns-core-modules/data/observable";
2-
import * as pages from "tns-core-modules/ui/page";
1+
import { EventData, Page } from "@nativescript/core";
32
import { MainModel } from "./main-view-model";
43

54
// Event handler for Page 'loaded' event attached in main-page.xml
6-
export function pageLoaded(args: observable.EventData): void {
5+
export function pageLoaded(args: EventData): void {
76
// Get the event sender
8-
const page = args.object as pages.Page;
7+
const page = args.object as Page;
98
page.bindingContext = new MainModel();
109
}

demo/app/main/main-page.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,48 @@
55
<ActionBar title="Mixpanel plugin demo"/>
66
</Page.actionBar>
77
<ScrollView orientation="vertical">
8-
<GridLayout rows="auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, *">
8+
<GridLayout rows="auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, *" style="background-color: #f6f6f6;">
99
<Label row="0" text="{{'Using token: ' + token}}" class="t-10 text-center" style="color: green;" visibility="{{ token !== '' ? 'visible' : 'collapsed' }}" textWrap="true"/>
1010
<Label row="0" text="No token has been set, please set token in constants.ts" class="t-10 font-weight-bold text-center" style="color: red;" visibility="{{ token === '' ? 'visible' : 'collapsed' }}" textWrap="true"/>
1111

1212
<GridLayout row="2" rows="auto, auto, auto, auto">
1313
<Label row="0" text="User Identity" class="h3 text-center" textWrap="true"/>
14-
<Button row="1" text="Identify" tap="{{ onIdentifyPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
15-
<Button row="2" text="Get Distinct ID" tap="{{ onGetDistinctIdPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
16-
<Button row="3" text="Alias" tap="{{ onAliasPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
14+
<Button row="1" text="Identify" tap="{{ onIdentifyPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
15+
<Button row="2" text="Get Distinct ID" tap="{{ onGetDistinctIdPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
16+
<Button row="3" text="Alias" tap="{{ onAliasPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
1717
</GridLayout>
1818

1919
<GridLayout row="4" rows="auto, auto, auto, auto">
2020
<Label row="0" text="Super Properties" class="h3 text-center" textWrap="true"/>
21-
<Button row="1" text="Register Super Properties" tap="{{ onRegisterSuperPropertiesPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
22-
<Button row="2" text="Clear Super Property" tap="{{ onUnregisterSuperPropertyPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
23-
<Button row="3" text="Clear All Super Properties" tap="{{ onClearPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
21+
<Button row="1" text="Register Super Properties" tap="{{ onRegisterSuperPropertiesPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
22+
<Button row="2" text="Clear Super Property" tap="{{ onUnregisterSuperPropertyPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
23+
<Button row="3" text="Clear All Super Properties" tap="{{ onClearPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
2424
</GridLayout>
2525

2626
<GridLayout row="6" rows="auto, auto, auto">
2727
<Label row="0" text="Events" class="h3 text-center" textWrap="true"/>
28-
<Button row="1" text="Track" tap="{{ onTrackPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
29-
<Button row="2" text="Time Event" tap="{{ onTimeEventPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
28+
<Button row="1" text="Track" tap="{{ onTrackPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
29+
<Button row="2" text="Time Event" tap="{{ onTimeEventPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
3030
</GridLayout>
3131

3232
<GridLayout row="8" rows="auto, auto, auto, auto">
3333
<Label row="0" text="People" class="h3 text-center" textWrap="true"/>
34-
<Button row="1" text="Get People" tap="{{ onPeopleGetPeoplePress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
35-
<Button row="2" text="Identify" tap="{{ onPeopleIdentifyPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
36-
<Button row="3" text="Set Properties" tap="{{ onPeopleSetPropertiesPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
34+
<Button row="1" text="Get People" tap="{{ onPeopleGetPeoplePress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
35+
<Button row="2" text="Identify" tap="{{ onPeopleIdentifyPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
36+
<Button row="3" text="Set Properties" tap="{{ onPeopleSetPropertiesPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
3737
</GridLayout>
3838

3939
<GridLayout row="10" rows="auto, auto, auto, auto, auto">
4040
<Label row="0" text="Other" class="h3 text-center" textWrap="true"/>
41-
<Button row="1" text="Opt Out of Tracking" tap="{{ onOptOutPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
42-
<Button row="2" text="Opt In to Tracking" tap="{{ onOptInPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
43-
<Button row="3" text="Flush" tap="{{ onFlushPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
44-
<Button row="4" text="Reset" tap="{{ onResetPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
41+
<Button row="1" text="Opt Out of Tracking" tap="{{ onOptOutPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
42+
<Button row="2" text="Opt In to Tracking" tap="{{ onOptInPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
43+
<Button row="3" text="Flush" tap="{{ onFlushPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
44+
<Button row="4" text="Reset" tap="{{ onResetPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
4545
</GridLayout>
4646

4747
<GridLayout row="12" rows="auto, auto">
4848
<Label row="0" text="Logger" class="h3 text-center" textWrap="true"/>
49-
<Button row="1" text="Use Custom Logger" tap="{{ onUserCustomLoggerPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
49+
<Button row="1" text="Use Custom Logger" tap="{{ onUserCustomLoggerPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
5050
</GridLayout>
5151
</GridLayout>
5252
</ScrollView>

demo/app/main/main-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Observable } from "@nativescript/core/data/observable/observable";
1+
import { Observable } from "@nativescript/core";
22
import { setTimeout } from "@nativescript/core/timer";
33
import {
44
JSONObject,

demo/app/package.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

demo/nativescript.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NativeScriptConfig } from "@nativescript/core";
2+
3+
const config: NativeScriptConfig = {
4+
id: "org.nativescript.demo",
5+
appResourcesPath: "app/App_Resources",
6+
android: {
7+
v8Flags: "--expose_gc",
8+
markingMode: "none",
9+
},
10+
appPath: "app",
11+
};
12+
13+
// tslint:disable-next-line: no-default-export
14+
export default config;

0 commit comments

Comments
 (0)