-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/JS-5093: Publishing #988
base: main
Are you sure you want to change the base?
Changes from 25 commits
a8c5c08
e04e9cd
24b8c0a
7a98e10
daeae38
5663593
9aa5a8c
be1426c
7262098
ebe1832
59c2f4a
83cdd8b
b4f0419
6dac777
12ec6b6
478002f
b752486
01c5d1c
e765673
508d48f
a101897
a60aa6a
cb743fe
4610102
22a0694
abc9f9c
33b97c3
20cbb8e
b160e44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# nix-ld should be enabled in configuration.nix: | ||
# programs.nix-ld.enable = true; | ||
# programs.nix-ld.libraries = with pkgs; [ | ||
# gtk3 | ||
# # Add any missing dynamic libraries for unpackaged programs | ||
# # here, NOT in environment.systemPackages | ||
# ]; | ||
|
||
{ | ||
description = ""; | ||
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
config = { allowUnfree = true; }; | ||
}; | ||
deps = [ | ||
pkgs.appimage-run | ||
# commit hook | ||
pkgs.husky | ||
# build deps | ||
pkgs.libxcrypt | ||
pkgs.libsecret | ||
pkgs.pkg-config | ||
pkgs.jq | ||
pkgs.nodejs_22 | ||
|
||
# keytar build fails on npm install because python312 has distutils removed | ||
pkgs.python311 | ||
|
||
# electron binary launch deps. | ||
# see also https://nix.dev/guides/faq#how-to-run-non-nix-executables | ||
pkgs.glib | ||
pkgs.nss | ||
pkgs.nspr | ||
pkgs.dbus | ||
pkgs.atk | ||
pkgs.cups | ||
pkgs.libdrm | ||
pkgs.gtk3 | ||
pkgs.adwaita-icon-theme | ||
pkgs.pango | ||
pkgs.cairo | ||
pkgs.xorg.libX11 | ||
pkgs.xorg.libX11 | ||
pkgs.xorg.libXcomposite | ||
pkgs.xorg.libXdamage | ||
pkgs.xorg.libXext | ||
pkgs.xorg.libXfixes | ||
pkgs.xorg.libXrandr | ||
pkgs.mesa | ||
pkgs.expat | ||
pkgs.libxkbcommon | ||
pkgs.xorg.libxcb | ||
pkgs.alsa-lib | ||
pkgs.libGL | ||
]; | ||
XDG_ICONS_PATH = "${pkgs.hicolor-icon-theme}/share:${pkgs.adwaita-icon-theme}/share"; | ||
in { | ||
devShell = pkgs.mkShell { | ||
name = "anytype-ts-dev"; | ||
SERVER_PORT = 9090; | ||
ANY_SYNC_NETWORK = "/home/zarkone/anytype/local-network-config.yml"; | ||
LD_LIBRARY_PATH = "${pkgs.lib.strings.makeLibraryPath deps}"; | ||
nativeBuildInputs = deps; | ||
shellHook = '' | ||
# fixes "No GSettings schemas" error | ||
export XDG_DATA_DIRS=$GSETTINGS_SCHEMAS_PATH:$XDG_ICONS_PATH:$XDG_DATA_DIRS | ||
''; | ||
}; | ||
|
||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -810,6 +810,18 @@ class Action { | |
analytics.event('ThemeSet', { id }); | ||
}; | ||
|
||
publish (objectId: string) { | ||
C.ObjectPublish(S.Common.space, objectId, (message: any) => { | ||
if (message.error.code) { | ||
return; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can just skip brackets and make in online. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not write one-line if clauses. |
||
|
||
const { key, cid } = message; | ||
const url = `http://localhost:8787/?cid=${cid}&key=${key}`; | ||
|
||
U.Common.copyToast(translate('commonLink'), url); | ||
}); | ||
}; | ||
}; | ||
|
||
export default new Action(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,13 @@ export const ObjectShow = (response: Rpc.Object.Show.Response) => { | |
}; | ||
}; | ||
|
||
export const ObjectPublish = (response: Rpc.Object.Publish.Response) => { | ||
return { | ||
cid: response.getPublishcid(), | ||
key: response.getPublishfilekey(), | ||
}; | ||
}; | ||
|
||
Comment on lines
+201
to
+207
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. export const ObjectPublish = (response: Rpc.Object.Publish.Response) => ({
cid: response.getPublishcid(),
key: response.getPublishfilekey(),
}) I find it nicer |
||
export const ObjectSearch = (response: Rpc.Object.Search.Response) => { | ||
return { | ||
records: (response.getRecordsList() || []).map(Decode.struct), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to format it like that?