Skip to content

Commit

Permalink
Merge pull request #9 from nstudio/develop
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
Codex- authored Oct 14, 2020
2 parents 991c511 + d61683d commit 8194db6
Show file tree
Hide file tree
Showing 21 changed files with 2,627 additions and 2,881 deletions.
28 changes: 16 additions & 12 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
### Make sure to check the demo app(s) for sample usage
### Make sure to check the demo app(s) for sample usage

### Make sure to check the existing issues in this repository
### Make sure to check the existing issues in this repository

### If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

### Which platform(s) does your issue occur on?
- iOS/Android/Both
- iOS/Android versions

- iOS/Android/Both
- iOS/Android versions
- emulator or device. What type of device?

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

- CLI: (run `tns --version` to fetch it)
- CLI: (run `ns --version` to fetch it)
- Cross-platform modules: (check the 'version' attribute in the
`node_modules/tns-core-modules/package.json` file in your project)
- Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project)
`node_modules/@nativescript/core/package.json` file in your project)
- Runtime(s): (look for the `"@nativescript/android"` and `"@nativescript/ios"` properties in the `package.json` file of your project)
- Plugin(s): (look for the version numbers in the `package.json` file of your
project and paste your dependencies and devDependencies here)
project and paste your dependencies and devDependencies here)

### Please, tell us how to recreate the issue in as much detail as possible.

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

### Is there any code involved?
- provide a code example to recreate the problem
- (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.
### Is there any code involved?

- provide a code example to recreate the problem
- (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Set Node.js 10.x
- name: Set Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: "10.x"
node-version: "12.x"

- name: Build Plugin Source
run: cd src && npm i && npx tsc
Expand All @@ -32,18 +32,18 @@ jobs:
- name: Setup NativeScript CLI
run: |
echo no | npm i -g nativescript
tns usage-reporting disable
tns error-reporting disable
ns usage-reporting disable
ns error-reporting disable
- name: Build Android Demo App
run: |
cd demo
tns build android --env.uglify --force
ns build android --env.uglify
- name: Build iOS Demo App
run: |
cd demo
tns build ios --env.uglify --force
ns build ios --env.uglify
- name: Lint
run: cd src && npm run ci.lint
Expand Down
29 changes: 16 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# IDE
.vscode
.idea

# Files
.DS_Store
*.esm.json
*.js
*.js.map
*.log
src/*.d.ts
!src/index.d.ts
!src/references.d.ts
!src/scripts/*.js
!seed-tests/*.js
seed-tests/seed-copy
seed-tests/seed-copy-new-git-repo/**/*.*

# Folders
node_modules

# Demo
!demo/karma.conf.js
!demo/app/tests/*.js
demo/*.d.ts
!demo/references.d.ts
demo/lib
demo/platforms
node_modules
publish/src
publish/package
demo/report/report.html
demo/report/stats.json

# Lib
publish/src
publish/package
src/*.d.ts
!src/index.d.ts
!src/references.d.ts
!src/scripts/*.js
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NativeScript Mixpanel

[![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)
[![npm](https://img.shields.io/badge/nativescript-6.5-blue?style=flat-square)](https://nativescript.org/)
[![npm](https://img.shields.io/badge/nativescript-7-blue?style=flat-square)](https://nativescript.org/)
[![npm](https://img.shields.io/npm/v/@nstudio/nativescript-mixpanel?style=flat-square)](https://www.npmjs.com/package/@nstudio/nativescript-mixpanel)
[![npm](https://img.shields.io/npm/dt/@nstudio/nativescript-mixpanel?style=flat-square)](https://www.npmjs.com/package/@nstudio/nativescript-mixpanel)

Expand All @@ -11,7 +11,11 @@

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

`tns plugin add @nstudio/nativescript-mixpanel`
`ns plugin add @nstudio/nativescript-mixpanel`

### NativeScript 6.5

`tns plugin add @nstudio/[email protected]`

# Usage

Expand Down
4 changes: 2 additions & 2 deletions demo/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as app from "tns-core-modules/application";
import { Application } from "@nativescript/core";

app.run({ moduleName: "app-root" });
Application.run({ moduleName: "app-root" });
7 changes: 3 additions & 4 deletions demo/app/main/main-page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as observable from "tns-core-modules/data/observable";
import * as pages from "tns-core-modules/ui/page";
import { EventData, Page } from "@nativescript/core";
import { MainModel } from "./main-view-model";

// Event handler for Page 'loaded' event attached in main-page.xml
export function pageLoaded(args: observable.EventData): void {
export function pageLoaded(args: EventData): void {
// Get the event sender
const page = args.object as pages.Page;
const page = args.object as Page;
page.bindingContext = new MainModel();
}
34 changes: 17 additions & 17 deletions demo/app/main/main-page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@
<ActionBar title="Mixpanel plugin demo"/>
</Page.actionBar>
<ScrollView orientation="vertical">
<GridLayout rows="auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, *">
<GridLayout rows="auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, 15, auto, *" style="background-color: #f6f6f6;">
<Label row="0" text="{{'Using token: ' + token}}" class="t-10 text-center" style="color: green;" visibility="{{ token !== '' ? 'visible' : 'collapsed' }}" textWrap="true"/>
<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"/>

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

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

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

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

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

<GridLayout row="12" rows="auto, auto">
<Label row="0" text="Logger" class="h3 text-center" textWrap="true"/>
<Button row="1" text="Use Custom Logger" tap="{{ onUserCustomLoggerPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded-sm"></Button>
<Button row="1" text="Use Custom Logger" tap="{{ onUserCustomLoggerPress }}" isEnabled="{{ testsEnabled }}" class="-outline -rounded"></Button>
</GridLayout>
</GridLayout>
</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion demo/app/main/main-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from "@nativescript/core/data/observable/observable";
import { Observable } from "@nativescript/core";
import { setTimeout } from "@nativescript/core/timer";
import {
JSONObject,
Expand Down
7 changes: 0 additions & 7 deletions demo/app/package.json

This file was deleted.

14 changes: 14 additions & 0 deletions demo/nativescript.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NativeScriptConfig } from "@nativescript/core";

const config: NativeScriptConfig = {
id: "org.nativescript.demo",
appResourcesPath: "app/App_Resources",
android: {
v8Flags: "--expose_gc",
markingMode: "none",
},
appPath: "app",
};

// tslint:disable-next-line: no-default-export
export default config;
Loading

0 comments on commit 8194db6

Please sign in to comment.