mirror of
https://github.com/zhigang1992/devhub.git
synced 2026-06-17 11:11:21 +08:00
Getting app name from package.json
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
import { AppRegistry } from 'react-native';
|
||||
|
||||
import { name as appName } from './package.json';
|
||||
|
||||
import App from './src/';
|
||||
|
||||
AppRegistry.registerComponent('devhub', () => App);
|
||||
AppRegistry.registerComponent(appName, () => App);
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import { AppRegistry } from 'react-native';
|
||||
|
||||
import { name as appName } from './package.json';
|
||||
|
||||
import App from './src/';
|
||||
|
||||
AppRegistry.registerComponent('devhub', () => App);
|
||||
AppRegistry.registerComponent(appName, () => App);
|
||||
|
||||
@@ -5,8 +5,9 @@ import { AppRegistry } from 'react-native';
|
||||
|
||||
import './web/src/index.css';
|
||||
import App from './src/';
|
||||
import { name as appName } from './package.json';
|
||||
|
||||
AppRegistry.registerComponent('devhub', () => App);
|
||||
AppRegistry.runApplication('devhub', {
|
||||
AppRegistry.registerComponent(appName, () => App);
|
||||
AppRegistry.runApplication(appName, {
|
||||
rootTag: document.getElementById('root'),
|
||||
});
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import GitHubAPI from 'github';
|
||||
|
||||
import { name as appName } from '../../package.json';
|
||||
|
||||
const PUBLIC_EVENTS: 'PUBLIC_EVENTS' = 'PUBLIC_EVENTS';
|
||||
const REPO_EVENTS: 'REPO_EVENTS' = 'REPO_EVENTS';
|
||||
const REPO_ISSUE_EVENTS: 'REPO_ISSUE_EVENTS' = 'REPO_ISSUE_EVENTS';
|
||||
@@ -18,7 +20,7 @@ const MARK_NOTIFICATION_THREAD_AS_READ: 'MARK_NOTIFICATION_THREAD_AS_READ' = 'MA
|
||||
const MARK_ALL_NOTIFICATIONS_AS_READ_FOR_REPO: 'MARK_ALL_NOTIFICATIONS_AS_READ_FOR_REPO' = 'MARK_ALL_NOTIFICATIONS_AS_READ_FOR_REPO';
|
||||
|
||||
const github = new GitHubAPI({
|
||||
agent: 'devhub',
|
||||
agent: appName,
|
||||
// debug: process.env.NODE_ENV !== 'production',
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@ import qs from 'qs';
|
||||
import { Linking } from 'react-native';
|
||||
|
||||
import { getUrlParamsIfMatches, listenForNextUrl } from './helpers';
|
||||
import { name as appName } from '../../../package.json';
|
||||
|
||||
const callbackURL = 'devhub://oauth/github';
|
||||
const callbackURL = `${appName}://oauth/github`;
|
||||
|
||||
export default async function (serverURL, scopes = []) {
|
||||
const scopesStr = (scopes || []).join(' ');
|
||||
|
||||
@@ -5,6 +5,8 @@ import { Linking, Platform } from 'react-native';
|
||||
|
||||
import { get } from '../../immutable';
|
||||
|
||||
import { name as appName } from '../../../../package.json';
|
||||
|
||||
import type {
|
||||
GithubIssue,
|
||||
GithubPullRequest,
|
||||
@@ -112,7 +114,7 @@ function openURL(url: string) {
|
||||
} else {
|
||||
// replace http with devhub:// so the app deeplinking will handle this
|
||||
// the app will decide if it will push an app screen or open the web browser
|
||||
_url = _url.replace(/(http[s]?)/, 'devhub');
|
||||
_url = _url.replace(/(http[s]?)/, appName);
|
||||
}
|
||||
|
||||
return Linking.openURL(_url);
|
||||
|
||||
Reference in New Issue
Block a user