Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

dependencies: Patch handlebars to declare its types correctly.

Anders Kaseorg4e8d028c49ea
diff --git a/package.json b/package.json
index 08a77eef818..17a4b1b2a35 100644
--- a/package.json
+++ b/package.json
@@ -160,6 +160,7 @@
"source-map@^0.6": "npm:source-map-js@^1.2.1"
},
"patchedDependencies": {
+ "handlebars": "patches/handlebars.patch",
"svgicons2svgfont": "patches/svgicons2svgfont.patch",
diff --git a/patches/handlebars.patch b/patches/handlebars.patch
new file mode 100644
index 00000000000..b0ce5db1ac1
--- /dev/null
+++ b/patches/handlebars.patch
@@ -0,0 +1,57 @@
+diff --git a/runtime.d.ts b/runtime.d.ts
+index 0d5105eb73794b7ab88a7c30502977d10a836f45..a8e8768addd7c424eb8e82372eb3d955582eb456 100644
+--- a/runtime.d.ts
++++ b/runtime.d.ts
+@@ -1,5 +1,3 @@
+ import Handlebars = require('handlebars')
+
+-declare module "handlebars/runtime" {
+-
+-}
+\ No newline at end of file
++export = Handlebars;
+diff --git a/types/index.d.ts b/types/index.d.ts
+index 3f2f8b792edbd621d06c399ff4c722234f233742..3b3d8cb0d3c9f264b00104c3ea0ba96a2e63d485 100644
+--- a/types/index.d.ts
++++ b/types/index.d.ts
+@@ -14,7 +14,8 @@
+ */
+ // TypeScript Version: 2.3
+
+-declare namespace Handlebars {
++declare global {
++namespace Handlebars {
+ export interface TemplateDelegate<T = any> {
+ (context: T, options?: RuntimeOptions): string;
+ }
+@@ -243,7 +244,7 @@ interface PrecompileOptions extends CompileOptions {
+ destName?: string;
+ }
+
+-declare namespace hbs {
++namespace hbs {
+ // for backward compatibility of this typing
+ type SafeString = Handlebars.SafeString;
+
+@@ -264,7 +265,7 @@ interface Logger {
+
+ type CompilerInfo = [number/* revision */, string /* versions */];
+
+-declare namespace hbs {
++namespace hbs {
+ namespace AST {
+ interface Node {
+ type: string;
+@@ -412,11 +413,6 @@ declare namespace hbs {
+ }
+ }
+ }
+-
+-declare module "handlebars" {
+- export = Handlebars;
+ }
+
+-declare module "handlebars/runtime" {
+- export = Handlebars;
+-}
++export = Handlebars;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f5ea0f07036..63f032fbc6b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -8,6 +8,9 @@ overrides:
source-map@^0.6: npm:source-map-js@^1.2.1
patchedDependencies:
+ handlebars:
+ hash: c5t5wnxp6mvabdrpn7wm4zt2zu
+ path: patches/handlebars.patch
hash: 4n7ij66tzyhzaqnxsenbilrxr4
path: patches/[email protected]
@@ -147,10 +150,10 @@ importers:
version: 1.2.0
handlebars:
specifier: ^4.7.2
- version: 4.7.8
+ version: 4.7.8(patch_hash=c5t5wnxp6mvabdrpn7wm4zt2zu)
handlebars-loader:
specifier: ^1.7.1
- version: 1.7.3([email protected])
+ version: 1.7.3([email protected](patch_hash=c5t5wnxp6mvabdrpn7wm4zt2zu))
html-webpack-plugin:
specifier: ^5.3.2
version: 5.6.3([email protected])
@@ -11600,7 +11603,7 @@ snapshots:
'@vusion/[email protected]':
dependencies:
- handlebars: 4.7.8
+ handlebars: 4.7.8(patch_hash=c5t5wnxp6mvabdrpn7wm4zt2zu)
mkdirp: 1.0.4
q: 1.5.1
svg2ttf: 6.0.3
@@ -14310,15 +14313,15 @@ snapshots:
+ [email protected]([email protected](patch_hash=c5t5wnxp6mvabdrpn7wm4zt2zu)):
dependencies:
async: 3.2.6
fastparse: 1.1.2
- handlebars: 4.7.8
+ handlebars: 4.7.8(patch_hash=c5t5wnxp6mvabdrpn7wm4zt2zu)
loader-utils: 1.4.2
object-assign: 4.1.1
+ [email protected](patch_hash=c5t5wnxp6mvabdrpn7wm4zt2zu):
dependencies:
minimist: 1.2.8
neo-async: 2.6.2
diff --git a/version.py b/version.py
index 1a62d30157f..fd5e9c3abb4 100644
--- a/version.py
+++ b/version.py
@@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 319 # Last bumped for message-link class
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
-PROVISION_VERSION = (301, 1) # bumped 2024-11-12 to add types for Google analytics
+PROVISION_VERSION = (301, 2) # bumped 2024-11-12 to patch handlebars