Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Rename shit to Fyra
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Lee committed Mar 27, 2022
1 parent 078d8a6 commit 868c2ac
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 4,359 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@getskye:registry=https://npm.pkg.github.com
@fyralabs:registry=https://npm.pkg.github.com
@fortawesome:registry=https://npm.fontawesome.com/
shamefully-hoist=true
script-shell = bash
2 changes: 1 addition & 1 deletion app/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const BASE_SKYE_URL =
process.env.NODE_ENV !== "development"
? "skye://ui"
? "photon://ui"
: "http://localhost:3000";
6 changes: 3 additions & 3 deletions app/events/search.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import zod from "zod";
import { SearchEvents, SearchRendererEvents } from "./../../utils/constants";
import { app, ipcMain } from "electron";
import { EngineWindow, EngineWindowManager } from "@getskye/engine";
import { EngineOverlay } from "@getskye/engine/dist/models/overlay";
import { EngineWindow, EngineWindowManager } from "@fyralabs/photon-engine";
import { EngineOverlay } from "@fyralabs/photon-engine/dist/models/overlay";
import path from "path";
import { ddg } from "@getskye/suggest";
import { ddg } from "@fyralabs/photon-suggest";
import { BASE_SKYE_URL } from "../constants";

const generateSearch = (win: EngineWindow, onDelete: () => void) => {
Expand Down
2 changes: 1 addition & 1 deletion app/events/tabs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RendererEvents } from "./../../utils/constants";
import { EngineWindow, EngineWindowManager } from "@getskye/engine";
import { EngineWindow, EngineWindowManager } from "@fyralabs/photon-engine";
import { ipcMain, nativeTheme } from "electron";
import { TabEvents } from "../../utils/constants";

Expand Down
4 changes: 2 additions & 2 deletions app/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app, BrowserWindow, globalShortcut, protocol } from "electron";
import { EngineSession, EngineWindowManager } from "@getskye/engine";
import { EngineSession, EngineWindowManager } from "@fyralabs/photon-engine";
import path from "path";
import loadTabEvents from "./events/tabs";
import { RendererEvents } from "../utils/constants";
Expand All @@ -19,7 +19,7 @@ app.once("ready", async () => {
const rootPath = path.resolve(path.join(app.getAppPath(), "./dist"));

if (process.env.NODE_ENV !== "development") {
protocol.registerFileProtocol("skye", (request, callback) => {
protocol.registerFileProtocol("photon", (request, callback) => {
const pathname = new URL(request.url).pathname;

if (pathname.indexOf("\0") !== -1) {
Expand Down
2 changes: 1 addition & 1 deletion dialogs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RendererEvents } from "../utils/constants";
export {};
declare global {
interface Window {
skye: {
photon: {
loadURL: (url: string) => void;
resize: (height: number) => void;
on: (
Expand Down
6 changes: 3 additions & 3 deletions dialogs/search/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, RootObject } from "@getskye/suggest/dist/engines/ddg";
import { Icon, RootObject } from "@fyralabs/photon-suggest/dist/engines/ddg";
import { observer } from "mobx-react-lite";
import { Fragment, useEffect } from "react";
import { render } from "react-dom";
Expand All @@ -16,7 +16,7 @@ const Search = observer(() => {
console.log(search.instantAnswer);

useEffect(() => {
window.skye.resize(height + 40);
window.photon.resize(height + 40);
}, [height]);

return (
Expand Down Expand Up @@ -50,7 +50,7 @@ const Search = observer(() => {
<a
className="py-1 cursor-pointer flex items-center gap-2"
onClick={() =>
window.skye.loadURL(
window.photon.loadURL(
`https://duckduckgo.com?q=${encodeURIComponent(result)}`
)
}
Expand Down
6 changes: 3 additions & 3 deletions dialogs/search/stores/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SearchRendererEvents } from "./../../../utils/constants";
import { makeObservable, observable, action } from "mobx";
import { Result } from "@getskye/suggest";
import { Result } from "@fyralabs/photon-suggest";
import { createContext, useContext } from "react";
import { DuckDuckGo, RootObject } from "@getskye/suggest/dist/engines/ddg";
import { DuckDuckGo, RootObject } from "@fyralabs/photon-suggest/dist/engines/ddg";
class SearchStore {
public query: string = "";
public searchEngineSuggestions: Result = [];
Expand All @@ -19,7 +19,7 @@ class SearchStore {
updateSearchEngineSuggestions: action,
});

window.skye.on(
window.photon.on(
SearchRendererEvents.SEARCH_QUERY_UPDATED,
(query: string, ddg: DuckDuckGo) => {
this.updateQuery(query);
Expand Down
4 changes: 2 additions & 2 deletions dialogs/search/suggestions/abstract.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { RootObject } from "@getskye/suggest/dist/engines/ddg";
import { RootObject } from "@fyralabs/photon-suggest/dist/engines/ddg";

const Abstract = (instantAnswer: RootObject) => {
return (
<div
className="px-4 mt-4 cursor-pointer"
onClick={() =>
instantAnswer.AbstractURL &&
window.skye.loadURL(instantAnswer.AbstractURL)
window.photon.loadURL(instantAnswer.AbstractURL)
}
>
<div className="flex items-center gap-1 font-medium cursor-pointer">
Expand Down
4 changes: 2 additions & 2 deletions dialogs/search/suggestions/company.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, RootObject } from "@getskye/suggest/dist/engines/ddg";
import { Icon, RootObject } from "@fyralabs/photon-suggest/dist/engines/ddg";

const Company = (instantAnswer: RootObject) => {
const companyResult = instantAnswer.Results[0] as {
Expand All @@ -10,7 +10,7 @@ const Company = (instantAnswer: RootObject) => {
<div
className="p-4 flex items-center gap-1 font-medium cursor-pointer"
onClick={() =>
companyResult.FirstURL && window.skye.loadURL(companyResult.FirstURL)
companyResult.FirstURL && window.photon.loadURL(companyResult.FirstURL)
}
>
{companyResult.Icon && (
Expand Down
2 changes: 1 addition & 1 deletion dialogs/search/suggestions/software.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RootObject } from "@getskye/suggest/dist/engines/ddg";
import { RootObject } from "@fyralabs/photon-suggest/dist/engines/ddg";

const Software = (instantAnswer: RootObject) => {
return (
Expand Down
8 changes: 4 additions & 4 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"appId": "com.innatical.skye",
"productName": "Skye",
"appId": "com.fyralabs.photon",
"productName": "photonBrowser",
"generateUpdatesFilesForAllChannels": true,
"asar": true,
"afterSign": "electron-builder-notarize",
Expand All @@ -13,13 +13,13 @@
"github",
{
"provider": "snapStore",
"repo": "skye",
"repo": "photon",
"channels": ["stable"]
}
],
"linux": {
"category": "Network",
"executableName": "skye",
"executableName": "photon",
"artifactName": "${productName}-${version}.${ext}",
"desktop": {
"Comment": "Browse the Web",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@getskye/browser",
"name": "@fyralabs/photon",
"version": "1.2.0",
"description": "A fast, beautiful, private web browser, designed for you",
"scripts": {
Expand All @@ -16,14 +16,14 @@
"main": "./dist-main/app/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/getskye/browser.git"
"url": "git+https://github.com/fyralabs/photonBrowser.git"
},
"author": "Innatical, LLC <contact@innatical.com>",
"author": "Fyra Labs <contact@fyralabs.com>",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/getskye/browser/issues"
"url": "https://github.com/fyralabs/photonBrowser/issues"
},
"homepage": "https://github.com/getskye/browser#readme",
"homepage": "https://github.com/fyralabs/photonBrowser#readme",
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "^6.1.0",
"@fortawesome/pro-duotone-svg-icons": "^6.1.0",
Expand Down Expand Up @@ -68,8 +68,8 @@
"vite": "^2.8.6"
},
"dependencies": {
"@getskye/engine": "^1.2.0",
"@getskye/suggest": "^1.0.1",
"@fyralabs/photon-engine": "^1.2.0",
"@fyralabs/photon-suggest": "^1.0.1",
"@sentry/electron": "^3.0.4",
"zod": "^3.14.2"
}
Expand Down
2 changes: 1 addition & 1 deletion pages/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RendererEvents } from "../utils/constants";
export {};
declare global {
interface Window {
skye: {
photon: {
fetchTabs: () => Promise<
[
{
Expand Down
2 changes: 1 addition & 1 deletion pages/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const Navigation = observer(() => {
<div className="no-drag">
<NavigationIcon
icon={faPlus}
onClick={() => window.skye.createTab()}
onClick={() => window.photon.createTab()}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/navigation/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Search = observer(() => {
event.preventDefault();
}}
onBlur={() => {
window.skye.hideSearch();
window.photon.hideSearch();
setFocused(false);
}}
/>
Expand Down
20 changes: 10 additions & 10 deletions pages/navigation/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class NavigationStore {
});

(async () => {
const tabs = await window.skye.fetchTabs();
const tabs = await window.photon.fetchTabs();
this.loadTabs(tabs);
})();

window.skye.on(
window.photon.on(
RendererEvents.TAB_CREATED,
({
id,
Expand Down Expand Up @@ -56,37 +56,37 @@ class NavigationStore {
}
);

window.skye.on(
window.photon.on(
RendererEvents.TAB_TITLE_CHANGED,
({ id, title }: { id: string; title: string | undefined }) => {
this.findTab(id)?.setTitle(title);
}
);

window.skye.on(
window.photon.on(
RendererEvents.TAB_THEME_COLOR_CHANGED,
({ id, color }: { id: string; color: string | undefined }) => {
this.findTab(id)?.setColor(color);
}
);

window.skye.on(RendererEvents.TAB_DELETED, (id: string) => {
window.photon.on(RendererEvents.TAB_DELETED, (id: string) => {
this.removeTab(id);
});

window.skye.on(RendererEvents.TAB_FOCUSED, (id: string) => {
window.photon.on(RendererEvents.TAB_FOCUSED, (id: string) => {
this.focusTab(id);
});

window.skye.on(RendererEvents.TAB_LOAD_START, (id: string) => {
window.photon.on(RendererEvents.TAB_LOAD_START, (id: string) => {
this.findTab(id)?.setLoading(true);
});

window.skye.on(RendererEvents.TAB_LOAD_STOP, (id: string) => {
window.photon.on(RendererEvents.TAB_LOAD_STOP, (id: string) => {
this.findTab(id)?.setLoading(false);
});

window.skye.on(
window.photon.on(
RendererEvents.TAB_NAVIGATION_STATE_CHANGED,
(state: {
id: string;
Expand All @@ -104,7 +104,7 @@ class NavigationStore {

autorun(() => {
this.focusedTab;
window.skye.hideSearch();
window.photon.hideSearch();
});
}

Expand Down
22 changes: 11 additions & 11 deletions pages/navigation/stores/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class Tab {
}

updateSearchQuery = (query: string) => {
if (!query?.length) return window.skye.hideSearch();
window.skye.updateSearchQuery(query);
if (!query?.length) return window.photon.hideSearch();
window.photon.updateSearchQuery(query);
};

load(input: string) {
Expand All @@ -66,16 +66,16 @@ class Tab {
const url = normalizeUrl(input);
this.url = new URL(url);
this.input = this.url.hostname;
window.skye.loadURL(url);
window.photon.loadURL(url);
} else {
const url = normalizeUrl(
`https://duckduckgo.com/?q=${encodeURIComponent(input)}`
);
this.url = new URL(url);
this.input = input;
window.skye.loadURL(url);
window.photon.loadURL(url);
}
window.skye.hideSearch();
window.photon.hideSearch();
}

setInput(input: string) {
Expand Down Expand Up @@ -112,27 +112,27 @@ class Tab {
}

close = () => {
window.skye.deleteTab(this.id);
window.photon.deleteTab(this.id);
};

focus = () => {
window.skye.focusTab(this.id);
window.photon.focusTab(this.id);
};

reload() {
window.skye.reloadTab(this.id);
window.photon.reloadTab(this.id);
}

cancel() {
window.skye.cancelTabNavigation(this.id);
window.photon.cancelTabNavigation(this.id);
}

navigateForward() {
window.skye.navigateForward(this.id);
window.photon.navigateForward(this.id);
}

navigateBackward() {
window.skye.navigateBackward(this.id);
window.photon.navigateBackward(this.id);
}
}

Expand Down
Loading

0 comments on commit 868c2ac

Please sign in to comment.