Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33037312
D7218.1768410596.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D7218.1768410596.diff
View Options
diff --git a/desktop/addons/windows-pushnotifications/.gitignore b/desktop/addons/windows-pushnotifications/.gitignore
new file mode 100644
--- /dev/null
+++ b/desktop/addons/windows-pushnotifications/.gitignore
@@ -0,0 +1,2 @@
+build/
+Microsoft.WindowsAppSDK.*/
diff --git a/desktop/addons/windows-pushnotifications/_nodert_generated.cpp b/desktop/addons/windows-pushnotifications/_nodert_generated.cpp
--- a/desktop/addons/windows-pushnotifications/_nodert_generated.cpp
+++ b/desktop/addons/windows-pushnotifications/_nodert_generated.cpp
@@ -27,6 +27,9 @@
#include "OpaqueWrapper.h"
#include "WrapperBase.h"
+#include "Microsoft.WindowsAppSDK.1.2.221109.1\include\WindowsAppSDK-VersionInfo.h"
+#include "Microsoft.WindowsAppSDK.1.2.221109.1\include\MddBootstrap.h"
+
#using < Microsoft.Windows.PushNotifications.WinMD>
// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
@@ -419,7 +422,7 @@
try
{
::Windows::Foundation::Uri ^ result = wrapper->_instance->Uri;
- info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
+ info.GetReturnValue().Set(NodeRT::Utils::NewString(result->ToString()->Data()));
return;
}
catch (Platform::Exception ^ exception)
@@ -1650,6 +1653,14 @@
}
*/
+ // Bootstrap runtime initialization
+ PACKAGE_VERSION version;
+ version.Version = Microsoft::WindowsAppSDK::Runtime::Version::UInt64;
+ if (FAILED(MddBootstrapInitialize(Microsoft::WindowsAppSDK::Release::MajorMinor, Microsoft::WindowsAppSDK::Release::VersionTag, version)))
+ {
+ throw std::exception("Error in Bootstrap initialization");
+ }
+
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationChannelStatusEnum(target);
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationChannel(target);
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationCreateChannelResult(target);
diff --git a/desktop/addons/windows-pushnotifications/binding.gyp b/desktop/addons/windows-pushnotifications/binding.gyp
--- a/desktop/addons/windows-pushnotifications/binding.gyp
+++ b/desktop/addons/windows-pushnotifications/binding.gyp
@@ -1,43 +1,36 @@
{
- "variables": {
- "USE_ADDITIONAL_WINMD": "true"
- },
"includes": ["common.gypi"],
"targets": [{
"target_name": "binding",
- "sources": [],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
- "libraries": [],
- "conditions": [
- ["OS=='win'", {
- "libraries": ["-lruntimeobject.lib"],
- "sources": [
- "_nodert_generated.cpp",
- "NodeRtUtils.cpp",
- "OpaqueWrapper.cpp",
- "CollectionsConverterUtils.cpp"
- ]
- }],
- ["USE_ADDITIONAL_WINMD==\"true\"", {
- "msvs_settings": {
- "VCCLCompilerTool": {
- "AdditionalUsingDirectories": [
- "%ProgramFiles%/Windows Kits/10/UnionMetadata/windows-pushnotifications",
- "%ProgramFiles%/Windows Kits/10/Include/windows-pushnotifications/um",
- "%ProgramFiles(x86)%/Windows Kits/10/UnionMetadata/windows-pushnotifications",
- "%ProgramFiles(x86)%/Windows Kits/10/Include/windows-pushnotifications/um"
- ]
- }
- }
- }]
+ "copies": [
+ {
+ "destination": "./build/Release",
+ "files": ["Microsoft.WindowsAppSDK.1.2.221109.1/runtimes/win10-x64/native/Microsoft.WindowsAppRuntime.Bootstrap.dll"],
+ }
+ ],
+ "libraries": [
+ "-lruntimeobject.lib",
+ "../Microsoft.WindowsAppSDK.1.2.221109.1/lib/win10-x64/Microsoft.WindowsAppRuntime.Bootstrap.lib"
+ ],
+ "sources": [
+ "_nodert_generated.cpp",
+ "NodeRtUtils.cpp",
+ "OpaqueWrapper.cpp",
+ "CollectionsConverterUtils.cpp"
],
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": ["/ZW"],
- "DisableSpecificWarnings": [4609]
- }
+ "DisableSpecificWarnings": [4609],
+ "AdditionalUsingDirectories": [
+ "$(VCIDEInstallDir)/vcpackages/x86",
+ "$(ProgramFiles)/Windows Kits/10/UnionMetadata/10.0.22000.0",
+ "<(module_root_dir)/Microsoft.WindowsAppSDK.1.2.221109.1/lib/uap10.0/"
+ ],
+ },
}
}]
}
\ No newline at end of file
diff --git a/desktop/addons/windows-pushnotifications/package.json b/desktop/addons/windows-pushnotifications/package.json
--- a/desktop/addons/windows-pushnotifications/package.json
+++ b/desktop/addons/windows-pushnotifications/package.json
@@ -1,5 +1,5 @@
{
- "name": "microsoft.windows.pushnotifications",
+ "name": "windows-pushnotifications",
"version": "0.0.1",
"description": "Use the Microsoft.Windows.PushNotifications UWP API directly from Node.js",
"main": "lib/main.js",
@@ -19,6 +19,9 @@
"WinRT",
"Microsoft"
],
+ "scripts": {
+ "preinstall": "nuget install"
+ },
"dependencies": {
"nan": "2.17.0"
},
diff --git a/desktop/addons/windows-pushnotifications/packages.config b/desktop/addons/windows-pushnotifications/packages.config
new file mode 100644
--- /dev/null
+++ b/desktop/addons/windows-pushnotifications/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Microsoft.WindowsAppSDK" version="1.2.221109.1" targetFramework="native" />
+</packages>
diff --git a/desktop/package.json b/desktop/package.json
--- a/desktop/package.json
+++ b/desktop/package.json
@@ -22,6 +22,9 @@
"dependencies": {
"@babel/runtime": "^7.20.1"
},
+ "optionalDependencies": {
+ "@commapp/windowspush": "file:addons/windows-pushnotifications"
+ },
"devDependencies": {
"@babel/core": "^7.13.14",
"@babel/plugin-proposal-class-properties": "^7.13.0",
diff --git a/keyserver/Dockerfile b/keyserver/Dockerfile
--- a/keyserver/Dockerfile
+++ b/keyserver/Dockerfile
@@ -116,6 +116,8 @@
COPY --chown=comm native/package.json native/.flowconfig native/
COPY --chown=comm landing/package.json landing/.flowconfig landing/
COPY --chown=comm desktop/package.json desktop/
+COPY --chown=comm desktop/addons/windows-pushnotifications/package.json \
+ desktop/addons/windows-pushnotifications/
COPY --chown=comm keyserver/addons/rust-node-addon/package.json \
keyserver/addons/rust-node-addon/install_ci_deps.sh \
keyserver/addons/rust-node-addon/postinstall.sh \
diff --git a/yarn.lock b/yarn.lock
--- a/yarn.lock
+++ b/yarn.lock
@@ -1729,6 +1729,11 @@
resolved "https://registry.yarnpkg.com/@commapp/sqlcipher-amalgamation/-/sqlcipher-amalgamation-4.4.3-a.tgz#39c297132b9ad02358bf022a164bfc03292ecce1"
integrity sha512-nPu0ZpvfqzxudOMi2bE3g9LdR80RLovcwrYhhFVfWCQQZqkVgUpOOqG1U647d06kz/P9hZRdFktnEqRua+RqBQ==
+"@commapp/windowspush@file:desktop/addons/windows-pushnotifications":
+ version "0.0.1"
+ dependencies:
+ nan "2.17.0"
+
"@discoveryjs/json-ext@^0.5.0":
version "0.5.7"
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
@@ -17130,16 +17135,16 @@
dependencies:
lru-cache "^4.1.3"
+nan@2.17.0, nan@^2.4.0:
+ version "2.17.0"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
+ integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==
+
nan@^2.12.1:
version "2.14.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==
-nan@^2.4.0:
- version "2.17.0"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
- integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==
-
nanoid@^2.0.0:
version "2.1.11"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 14, 5:09 PM (9 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5933046
Default Alt Text
D7218.1768410596.diff (8 KB)
Attached To
Mode
D7218: [desktop] Modify the generated native windows notifs module
Attached
Detach File
Event Timeline
Log In to Comment