global: use bun for patching modules instead of patch-package

This commit is contained in:
Abdullah Atta
2025-10-11 21:10:18 +05:00
parent 17efaf9932
commit 3b65ca56a1
28 changed files with 256 additions and 2876 deletions

View File

@@ -135,8 +135,7 @@
"build:beta": "PLATFORM=web BETA=true vite build",
"build:desktop": "PLATFORM=desktop vite build",
"analyze": "ANALYZING=true PLATFORM=web vite build",
"test": "playwright test -u",
"postinstall": "patch-package"
"test": "playwright test -u"
},
"browserslist": {
"production": [

View File

@@ -16,6 +16,9 @@
},
},
},
"patchedDependencies": {
"css-what@6.1.0": "patches/css-what@6.1.0.patch",
},
"packages": {
"@emnapi/core": ["@emnapi/core@1.5.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg=="],

View File

@@ -25,7 +25,6 @@
"build": "tsc && bunx rsbuild build",
"prepublishOnly": "bun run build",
"test": "playwright test",
"postinstall": "patch-package",
"watch": "tsc --watch"
},
"bugs": {
@@ -36,5 +35,8 @@
"css-what": "6.1.0",
"hyperapp": "^2.0.22",
"specificity": "^0.4.1"
},
"patchedDependencies": {
"css-what@6.1.0": "patches/css-what@6.1.0.patch"
}
}

View File

@@ -1,7 +1,7 @@
diff --git a/node_modules/css-what/lib/commonjs/stringify.js b/node_modules/css-what/lib/commonjs/stringify.js
diff --git a/lib/commonjs/stringify.js b/lib/commonjs/stringify.js
index 158b180..89b5b6c 100644
--- a/node_modules/css-what/lib/commonjs/stringify.js
+++ b/node_modules/css-what/lib/commonjs/stringify.js
--- a/lib/commonjs/stringify.js
+++ b/lib/commonjs/stringify.js
@@ -11,7 +11,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringify = void 0;
@@ -11,10 +11,10 @@ index 158b180..89b5b6c 100644
var pseudoValChars = __spreadArray(__spreadArray([], attribValChars, true), ["(", ")"], false);
var charsToEscapeInAttributeValue = new Set(attribValChars.map(function (c) { return c.charCodeAt(0); }));
var charsToEscapeInPseudoValue = new Set(pseudoValChars.map(function (c) { return c.charCodeAt(0); }));
diff --git a/node_modules/css-what/lib/es/stringify.js b/node_modules/css-what/lib/es/stringify.js
diff --git a/lib/es/stringify.js b/lib/es/stringify.js
index 5f3b8ef..0ec34f7 100644
--- a/node_modules/css-what/lib/es/stringify.js
+++ b/node_modules/css-what/lib/es/stringify.js
--- a/lib/es/stringify.js
+++ b/lib/es/stringify.js
@@ -1,5 +1,5 @@
import { SelectorType, AttributeAction } from "./types";
-const attribValChars = ["\\", '"'];

View File

@@ -54,7 +54,6 @@
"ws": "^8.13.0"
},
"scripts": {
"postinstall": "patch-package",
"prebuild": "bun run scripts/prebuild.mjs",
"pretest": "bun run scripts/prebuild.mjs",
"pretest:e2e": "bun run scripts/prebuild.mjs",
@@ -96,5 +95,9 @@
},
"trustedDependencies": [
"better-sqlite3-multiple-ciphers"
]
],
"patchedDependencies": {
"@microsoft/signalr@8.0.0": "patches/@microsoft%2Fsignalr@8.0.0.patch",
"html-to-text@9.0.5.patch": "patches/html-to-text@9.0.5.patch"
}
}

View File

@@ -1,7 +1,7 @@
diff --git a/node_modules/@microsoft/signalr/dist/browser/signalr.js b/node_modules/@microsoft/signalr/dist/browser/signalr.js
diff --git a/dist/browser/signalr.js b/dist/browser/signalr.js
index 86f7968..9bc9745 100644
--- a/node_modules/@microsoft/signalr/dist/browser/signalr.js
+++ b/node_modules/@microsoft/signalr/dist/browser/signalr.js
--- a/dist/browser/signalr.js
+++ b/dist/browser/signalr.js
@@ -347,7 +347,7 @@ class Platform {
// Node apps shouldn't have a window object, but WebWorkers don't either
// so we need to check for both WebWorker and window
@@ -11,10 +11,10 @@ index 86f7968..9bc9745 100644
}
}
/** @private */
diff --git a/node_modules/@microsoft/signalr/dist/cjs/Utils.js b/node_modules/@microsoft/signalr/dist/cjs/Utils.js
diff --git a/dist/cjs/Utils.js b/dist/cjs/Utils.js
index 2db55f7..228d318 100644
--- a/node_modules/@microsoft/signalr/dist/cjs/Utils.js
+++ b/node_modules/@microsoft/signalr/dist/cjs/Utils.js
--- a/dist/cjs/Utils.js
+++ b/dist/cjs/Utils.js
@@ -45,7 +45,7 @@ class Platform {
// Node apps shouldn't have a window object, but WebWorkers don't either
// so we need to check for both WebWorker and window
@@ -24,10 +24,10 @@ index 2db55f7..228d318 100644
}
}
exports.Platform = Platform;
diff --git a/node_modules/@microsoft/signalr/dist/esm/Utils.js b/node_modules/@microsoft/signalr/dist/esm/Utils.js
diff --git a/dist/esm/Utils.js b/dist/esm/Utils.js
index a8962ee..2fd2558 100644
--- a/node_modules/@microsoft/signalr/dist/esm/Utils.js
+++ b/node_modules/@microsoft/signalr/dist/esm/Utils.js
--- a/dist/esm/Utils.js
+++ b/dist/esm/Utils.js
@@ -41,7 +41,7 @@ export class Platform {
// Node apps shouldn't have a window object, but WebWorkers don't either
// so we need to check for both WebWorker and window
@@ -37,10 +37,10 @@ index a8962ee..2fd2558 100644
}
}
/** @private */
diff --git a/node_modules/@microsoft/signalr/dist/webworker/signalr.js b/node_modules/@microsoft/signalr/dist/webworker/signalr.js
diff --git a/dist/webworker/signalr.js b/dist/webworker/signalr.js
index 86f7968..9bc9745 100644
--- a/node_modules/@microsoft/signalr/dist/webworker/signalr.js
+++ b/node_modules/@microsoft/signalr/dist/webworker/signalr.js
--- a/dist/webworker/signalr.js
+++ b/dist/webworker/signalr.js
@@ -347,7 +347,7 @@ class Platform {
// Node apps shouldn't have a window object, but WebWorkers don't either
// so we need to check for both WebWorker and window

View File

@@ -1,7 +1,7 @@
diff --git a/node_modules/html-to-text/lib/html-to-text.cjs b/node_modules/html-to-text/lib/html-to-text.cjs
diff --git a/lib/html-to-text.cjs b/lib/html-to-text.cjs
index 6bcef9d..99203a1 100644
--- a/node_modules/html-to-text/lib/html-to-text.cjs
+++ b/node_modules/html-to-text/lib/html-to-text.cjs
--- a/lib/html-to-text.cjs
+++ b/lib/html-to-text.cjs
@@ -1240,6 +1240,7 @@ function recursiveWalk (walk, dom, builder) {
case 'tag': {
const tagDefinition = builder.picker.pick1(elem);
@@ -10,10 +10,10 @@ index 6bcef9d..99203a1 100644
format(elem, walk, builder, tagDefinition.options || {});
break;
}
diff --git a/node_modules/html-to-text/lib/html-to-text.mjs b/node_modules/html-to-text/lib/html-to-text.mjs
diff --git a/lib/html-to-text.mjs b/lib/html-to-text.mjs
index e42ff85..6659bbc 100644
--- a/node_modules/html-to-text/lib/html-to-text.mjs
+++ b/node_modules/html-to-text/lib/html-to-text.mjs
--- a/lib/html-to-text.mjs
+++ b/lib/html-to-text.mjs
@@ -1232,6 +1232,7 @@ function recursiveWalk (walk, dom, builder) {
case 'tag': {
const tagDefinition = builder.picker.pick1(elem);

File diff suppressed because it is too large Load Diff

View File

@@ -24,17 +24,15 @@
},
"devDependencies": {
"@playwright/test": "^1.37.1",
"@rsbuild/core": "^1.5.16",
"@rsbuild/plugin-react": "^1.4.1",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
"react-scripts": "^5.0.1"
"@types/react-dom": "^18.2.17"
},
"scripts": {
"start": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=true BROWSER=none react-scripts start",
"build": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=true BROWSER=none react-scripts build",
"postbuild": "bun run scripts/build.mjs",
"test": "react-scripts test",
"eject": "react-scripts eject",
"postinstall": "patch-package"
"start": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=true BROWSER=none rsbuild start",
"build": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=true BROWSER=none rsbuild build",
"postbuild": "bun run scripts/build.mjs"
},
"homepage": ".",
"browserslist": {
@@ -48,14 +46,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/build.bundle"
]
}
}
}
}

View File

@@ -1,141 +0,0 @@
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js
index e465d8e..19a2c01 100644
--- a/node_modules/react-scripts/config/webpack.config.js
+++ b/node_modules/react-scripts/config/webpack.config.js
@@ -106,6 +106,9 @@ module.exports = function (webpackEnv) {
const isEnvProductionProfile =
isEnvProduction && process.argv.includes('--profile');
+ const isEnvProductionTest =
+ isEnvProduction && process.argv.includes('--test');
+
// We will provide `paths.publicUrlOrPath` to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
@@ -256,7 +259,7 @@ module.exports = function (webpackEnv) {
level: 'none',
},
optimization: {
- minimize: isEnvProduction,
+ minimize: isEnvProduction && !isEnvProductionTest,
minimizer: [
// This is only used in production mode
new TerserPlugin({
@@ -304,6 +307,14 @@ module.exports = function (webpackEnv) {
},
resolve: {
// This allows you to set a fallback for where webpack should look for modules.
+ fallback: {
+ crypto: false,
+ module: false,
+ dgram: false,
+ path: false,
+ url: false,
+ fs: false
+ },
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebook/create-react-app/issues/253
@@ -320,13 +331,19 @@ module.exports = function (webpackEnv) {
.map(ext => `.${ext}`)
.filter(ext => useTypeScript || !ext.includes('ts')),
alias: {
+ "react": path.resolve(path.join(__dirname,'../../react')),
+ "react-dom": path.resolve(path.join(__dirname,'../../react-dom')),
+ "@mdi/js": path.resolve(path.join(__dirname,'../../@mdi/js')),
+ "@mdi/react": path.resolve(path.join(__dirname,'../../@mdi/react')),
+ "@emotion/react": path.resolve(path.join(__dirname,'../../@emotion/react')),
+
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
// Allows for better profiling with ReactDevTools
...(isEnvProductionProfile && {
'react-dom$': 'react-dom/profiling',
- 'scheduler/tracing': 'scheduler/tracing-profiling',
+ 'scheduler/tracing': 'scheduler/tracing-profiling'
}),
...(modules.webpackAliases || {}),
},
@@ -336,14 +353,14 @@ module.exports = function (webpackEnv) {
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
- new ModuleScopePlugin(paths.appSrc, [
- paths.appPackageJson,
- reactRefreshRuntimeEntry,
- reactRefreshWebpackPluginRuntimeEntry,
- babelRuntimeEntry,
- babelRuntimeEntryHelpers,
- babelRuntimeRegenerator,
- ]),
+ // new ModuleScopePlugin(paths.appSrc, [
+ // paths.appPackageJson,
+ // reactRefreshRuntimeEntry,
+ // reactRefreshWebpackPluginRuntimeEntry,
+ // babelRuntimeEntry,
+ // babelRuntimeEntryHelpers,
+ // babelRuntimeRegenerator,
+ // ]),
],
},
module: {
@@ -353,7 +370,7 @@ module.exports = function (webpackEnv) {
shouldUseSourceMap && {
enforce: 'pre',
exclude: /@babel(?:\/|\\{1,2})runtime/,
- test: /\.(js|mjs|jsx|ts|tsx|css)$/,
+ test: /\.(cjs|js|mjs|jsx|ts|tsx|css)$/,
loader: require.resolve('source-map-loader'),
},
{
@@ -408,13 +425,13 @@ module.exports = function (webpackEnv) {
},
],
issuer: {
- and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
+ and: [/\.(ts|tsx|cjs|js|jsx|md|mdx)$/],
},
},
// Process application JS with Babel.
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
{
- test: /\.(js|mjs|jsx|ts|tsx)$/,
+ test: /\.(cjs|js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
@@ -452,7 +469,7 @@ module.exports = function (webpackEnv) {
plugins: [
isEnvDevelopment &&
shouldUseReactRefresh &&
- require.resolve('react-refresh/babel'),
+ require.resolve('react-refresh/babel')
].filter(Boolean),
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
@@ -460,13 +477,13 @@ module.exports = function (webpackEnv) {
cacheDirectory: true,
// See #6846 for context on why cacheCompression is disabled
cacheCompression: false,
- compact: isEnvProduction,
+ compact: isEnvProduction && !isEnvProductionTest,
},
},
// Process any JS outside of the app with Babel.
// Unlike the application JS, we only compile the standard ES features.
{
- test: /\.(js|mjs)$/,
+ test: /\.(cjs|js|mjs)$/,
exclude: /@babel(?:\/|\\{1,2})runtime/,
loader: require.resolve('babel-loader'),
options: {
@@ -594,7 +611,7 @@ module.exports = function (webpackEnv) {
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
- exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
+ exclude: [/^$/, /\.(cjs|js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
type: 'asset/resource',
},
// ** STOP ** Are you adding a new loader?

View File

@@ -0,0 +1,52 @@
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import path from "path";
export default defineConfig({
html: {
template: "./public/index.html"
},
output: {
distPath: {
root: "build"
},
sourceMap: {
css: false,
js: "cheap-module-source-map"
}
},
tools: {
rspack: {
externals: {
"node:crypto": "commonjs crypto"
},
resolve: {
alias: {
react: path.resolve(path.join(__dirname, "node_modules", "react")),
"react-dom": path.resolve(
path.join(__dirname, "node_modules", "react-dom")
),
"@mdi/js": path.resolve(
path.join(__dirname, "node_modules", "@mdi/js")
),
"@mdi/react": path.resolve(
path.join(__dirname, "node_modules", "@mdi/react")
),
"@emotion/react": path.resolve(
path.join(__dirname, "node_modules", "@emotion/react")
)
},
fallback: {
crypto: false,
module: false,
dgram: false,
path: false,
url: false,
fs: false
}
}
}
},
plugins: [pluginReact()]
});

View File

@@ -48,7 +48,7 @@
"nanoid": "5.0.7",
"prism-themes": "^1.9.0",
"prosemirror-codemark": "^0.4.2",
"prosemirror-view": "1.34.2",
"prosemirror-view": "1.41.3",
"re-resizable": "^6.9.18",
"react-colorful": "^5.6.1",
"redent": "^4.0.0",
@@ -92,6 +92,16 @@
},
},
},
"patchedDependencies": {
"prosemirror-model@1.25.3": "patches/prosemirror-model@1.25.3.patch",
"katex@0.16.11": "patches/katex@0.16.11.patch",
"prosemirror-view@1.41.3": "patches/prosemirror-view@1.41.3.patch",
"@tiptap/core@2.6.6": "patches/@tiptap%2Fcore@2.6.6.patch",
"@tiptap/extension-list-keymap@2.6.6": "patches/@tiptap%2Fextension-list-keymap@2.6.6.patch",
},
"overrides": {
"prosemirror-view": "1.41.3",
},
"packages": {
"@azure/msal-browser": ["@azure/msal-browser@3.30.0", "", { "dependencies": { "@azure/msal-common": "14.16.1" } }, "sha512-I0XlIGVdM4E9kYP5eTjgW8fgATdzwxJvQ6bm2PNiHaZhEuUz47NYw1xHthC9R+lXz4i9zbShS0VdLyxd7n0GGA=="],
@@ -945,7 +955,7 @@
"prosemirror-transform": ["prosemirror-transform@1.10.4", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-pwDy22nAnGqNR1feOQKHxoFkkUtepoFAd3r2hbEDsnf4wp57kKA36hXsB3njA9FtONBEwSDnDeCiJe+ItD+ykw=="],
"prosemirror-view": ["prosemirror-view@1.34.2", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-tPX/V2Xd70vrAGQ/V9CppJtPKnQyQMypJGlLylvdI94k6JaG+4P6fVmXPR1zc1eVTW0gq3c6zsfqwJKCRLaG9Q=="],
"prosemirror-view": ["prosemirror-view@1.41.3", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-SqMiYMUQNNBP9kfPhLO8WXEk/fon47vc52FQsUiJzTBuyjKgEcoAwMyF04eQ4WZ2ArMn7+ReypYL60aKngbACQ=="],
"pstree.remy": ["pstree.remy@1.1.8", "", {}, "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w=="],
@@ -1209,14 +1219,6 @@
"postcss/nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
"prosemirror-dropcursor/prosemirror-view": ["prosemirror-view@1.41.3", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-SqMiYMUQNNBP9kfPhLO8WXEk/fon47vc52FQsUiJzTBuyjKgEcoAwMyF04eQ4WZ2ArMn7+ReypYL60aKngbACQ=="],
"prosemirror-gapcursor/prosemirror-view": ["prosemirror-view@1.41.3", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-SqMiYMUQNNBP9kfPhLO8WXEk/fon47vc52FQsUiJzTBuyjKgEcoAwMyF04eQ4WZ2ArMn7+ReypYL60aKngbACQ=="],
"prosemirror-history/prosemirror-view": ["prosemirror-view@1.41.3", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-SqMiYMUQNNBP9kfPhLO8WXEk/fon47vc52FQsUiJzTBuyjKgEcoAwMyF04eQ4WZ2ArMn7+ReypYL60aKngbACQ=="],
"prosemirror-tables/prosemirror-view": ["prosemirror-view@1.41.3", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-SqMiYMUQNNBP9kfPhLO8WXEk/fon47vc52FQsUiJzTBuyjKgEcoAwMyF04eQ4WZ2ArMn7+ReypYL60aKngbACQ=="],
"remark-supersub/unist-util-visit": ["unist-util-visit@4.1.2", "", { "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0", "unist-util-visit-parents": "^5.1.1" } }, "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg=="],
"unfurl.js/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="],

View File

@@ -74,7 +74,7 @@
"nanoid": "5.0.7",
"prism-themes": "^1.9.0",
"prosemirror-codemark": "^0.4.2",
"prosemirror-view": "1.34.2",
"prosemirror-view": "1.41.3",
"re-resizable": "^6.9.18",
"react-colorful": "^5.6.1",
"redent": "^4.0.0",
@@ -122,7 +122,6 @@
"postbuild": "bun run ./scripts/postbuild.mjs",
"start": "bun run watch",
"prepublishOnly": "bun run build && bun run test",
"postinstall": "patch-package",
"build": "bun run ../../scripts/build.mjs",
"watch": "nodemon -V --watch src --watch styles/styles.css -i src/extensions/code-block/languages/index.ts --ext ts,tsx,css --exec bun run build"
},
@@ -130,5 +129,15 @@
"type": "git",
"url": "git://github.com/streetwriters/notesnook.git",
"directory": "packages/editor"
},
"overrides": {
"prosemirror-view": "1.41.3"
},
"patchedDependencies": {
"prosemirror-view@1.41.3": "patches/prosemirror-view@1.41.3.patch",
"prosemirror-model@1.25.3": "patches/prosemirror-model@1.25.3.patch",
"@tiptap/core@2.6.6": "patches/@tiptap%2Fcore@2.6.6.patch",
"@tiptap/extension-list-keymap@2.6.6": "patches/@tiptap%2Fextension-list-keymap@2.6.6.patch",
"katex@0.16.11": "patches/katex@0.16.11.patch"
}
}

View File

@@ -1,7 +1,7 @@
diff --git a/node_modules/@tiptap/extension-list-keymap/dist/index.cjs b/node_modules/@tiptap/extension-list-keymap/dist/index.cjs
diff --git a/dist/index.cjs b/dist/index.cjs
index 0f8ae36..adeee92 100644
--- a/node_modules/@tiptap/extension-list-keymap/dist/index.cjs
+++ b/node_modules/@tiptap/extension-list-keymap/dist/index.cjs
--- a/dist/index.cjs
+++ b/dist/index.cjs
@@ -82,7 +82,9 @@ const handleBackspace = (editor, name, parentListTypes) => {
// the previous item is a list (orderedList or bulletList)
// move the cursor into the list and delete the current item
@@ -25,10 +25,10 @@ index 0f8ae36..adeee92 100644
const $prev = editor.state.doc.resolve(listItemPos.$pos.pos - 2);
const prevNode = $prev.node(listItemPos.depth);
const previousListItemHasSubList = listItemHasSubList(name, editor.state, prevNode);
diff --git a/node_modules/@tiptap/extension-list-keymap/dist/index.js b/node_modules/@tiptap/extension-list-keymap/dist/index.js
diff --git a/dist/index.js b/dist/index.js
index f7ab1e4..6ea03d5 100644
--- a/node_modules/@tiptap/extension-list-keymap/dist/index.js
+++ b/node_modules/@tiptap/extension-list-keymap/dist/index.js
--- a/dist/index.js
+++ b/dist/index.js
@@ -78,7 +78,9 @@ const handleBackspace = (editor, name, parentListTypes) => {
// the previous item is a list (orderedList or bulletList)
// move the cursor into the list and delete the current item

View File

@@ -1,7 +1,7 @@
diff --git a/node_modules/prosemirror-model/dist/index.cjs b/node_modules/prosemirror-model/dist/index.cjs
index aa31355..1409b46 100644
--- a/node_modules/prosemirror-model/dist/index.cjs
+++ b/node_modules/prosemirror-model/dist/index.cjs
diff --git a/dist/index.cjs b/dist/index.cjs
index b34cd59f3cda71520f18494aad17e01a0f800421..aea0154df64d7d0fc69039ee0a52a45d54ad545f 100644
--- a/dist/index.cjs
+++ b/dist/index.cjs
@@ -95,6 +95,7 @@ var Fragment = function () {
var nodeStart = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
var parent = arguments.length > 4 ? arguments[4] : undefined;
@@ -10,7 +10,7 @@ index aa31355..1409b46 100644
var child = this.content[i],
end = pos + child.nodeSize;
if (end > from && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {
@@ -2817,7 +2818,7 @@ function _renderSpec(doc, structure, xmlNS, blockArraysIn) {
@@ -2834,7 +2835,7 @@ function _renderSpec(doc, structure, xmlNS, blockArraysIn) {
var tagName = structure[0],
suspicious;
if (typeof tagName != "string") throw new RangeError("Invalid array passed to renderSpec");
@@ -19,10 +19,10 @@ index aa31355..1409b46 100644
var space = tagName.indexOf(" ");
if (space > 0) {
xmlNS = tagName.slice(0, space);
diff --git a/node_modules/prosemirror-model/dist/index.js b/node_modules/prosemirror-model/dist/index.js
index 0097d9f..19d7031 100644
--- a/node_modules/prosemirror-model/dist/index.js
+++ b/node_modules/prosemirror-model/dist/index.js
diff --git a/dist/index.js b/dist/index.js
index c933a50adf002f81f88312ce53ba3ccee49f86d6..a82807398a9273ff6611f4b598f92daa0ce2b069 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -84,6 +84,7 @@ class Fragment {
*/
nodesBetween(from, to, f, nodeStart = 0, parent) {
@@ -31,7 +31,7 @@ index 0097d9f..19d7031 100644
let child = this.content[i], end = pos + child.nodeSize;
if (end > from && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {
let start = pos + 1;
@@ -3397,9 +3398,9 @@ function renderSpec(doc, structure, xmlNS, blockArraysIn) {
@@ -3406,9 +3407,9 @@ function renderSpec(doc, structure, xmlNS, blockArraysIn) {
let tagName = structure[0], suspicious;
if (typeof tagName != "string")
throw new RangeError("Invalid array passed to renderSpec");

View File

@@ -1,18 +1,18 @@
diff --git a/node_modules/prosemirror-view/dist/index.cjs b/node_modules/prosemirror-view/dist/index.cjs
index 8ea57c7..c289489 100644
--- a/node_modules/prosemirror-view/dist/index.cjs
+++ b/node_modules/prosemirror-view/dist/index.cjs
@@ -980,8 +980,8 @@ var ViewDesc = function () {
if (!(force || brKludge && safari) && isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset) && isEquivalentPosition(headDOM.node, headDOM.offset, domSel.focusNode, domSel.focusOffset)) return;
diff --git a/dist/index.cjs b/dist/index.cjs
index 8c8948eceeb9d8af1779f5bda31bd7a88dafebd7..bceee1aaf01d5b8c6c8ca45b05e3636a882b0804 100644
--- a/dist/index.cjs
+++ b/dist/index.cjs
@@ -999,8 +999,8 @@ var ViewDesc = function () {
if (!(force || brKludge && safari) && isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) && isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset)) return;
var domSelExtended = false;
if ((domSel.extend || anchor == head) && !brKludge) {
if ((domSel.extend || anchor == head) && !(brKludge && gecko)) {
- domSel.collapse(anchorDOM.node, anchorDOM.offset);
try {
+ domSel.collapse(anchorDOM.node, anchorDOM.offset);
if (anchor != head) domSel.extend(headDOM.node, headDOM.offset);
domSelExtended = true;
} catch (_) {}
@@ -3456,7 +3456,7 @@ editHandlers.drop = function (view, _event) {
@@ -3532,7 +3532,7 @@ editHandlers.drop = function (view, _event) {
});
tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));
}
@@ -21,21 +21,21 @@ index 8ea57c7..c289489 100644
view.dispatch(tr.setMeta("uiEvent", "drop"));
};
handlers.focus = function (view) {
diff --git a/node_modules/prosemirror-view/dist/index.js b/node_modules/prosemirror-view/dist/index.js
index 9583dc3..6899e62 100644
--- a/node_modules/prosemirror-view/dist/index.js
+++ b/node_modules/prosemirror-view/dist/index.js
@@ -1052,8 +1052,8 @@ class ViewDesc {
diff --git a/dist/index.js b/dist/index.js
index 08aa138d630f9e40e6f314ab54f35a0f81fd3e3a..f3a5ed220c7495e4a3ceb8282f243d4c496c5b98 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1073,8 +1073,8 @@ class ViewDesc {
// browsers support it yet.
let domSelExtended = false;
if ((domSel.extend || anchor == head) && !brKludge) {
if ((domSel.extend || anchor == head) && !(brKludge && gecko)) {
- domSel.collapse(anchorDOM.node, anchorDOM.offset);
try {
+ domSel.collapse(anchorDOM.node, anchorDOM.offset);
if (anchor != head)
domSel.extend(headDOM.node, headDOM.offset);
domSelExtended = true;
@@ -3731,7 +3731,7 @@ editHandlers.drop = (view, _event) => {
@@ -3787,7 +3787,7 @@ editHandlers.drop = (view, _event) => {
tr.mapping.maps[tr.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) => end = newTo);
tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));
}

View File

@@ -24,7 +24,7 @@ import {
findParentNodeClosestToPos,
NodeWithPos
} from "@tiptap/core";
import { Root, refractor } from "refractor/lib/core.js";
import { RefractorRoot, refractor } from "refractor/lib/core.js";
import { RootContent } from "hast";
import { ReplaceAroundStep, ReplaceStep } from "prosemirror-transform";
import { toCaretPosition, toCodeLines } from "./utils.js";
@@ -60,7 +60,7 @@ function parseNodes(
}, [] as { text: string; classes: string[] }[]);
}
function getHighlightNodes(result: Root) {
function getHighlightNodes(result: RefractorRoot) {
return result.children || [];
}

View File

@@ -18,7 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { FunctionComponent, SyntheticEvent } from "react";
import { NodeView, Decoration, DecorationSource } from "prosemirror-view";
import {
NodeView,
Decoration,
DecorationSource,
ViewMutationRecord
} from "prosemirror-view";
import { Node as PMNode, Slice } from "prosemirror-model";
import { NodeSelection } from "prosemirror-state";
import { PortalProviderAPI } from "./react-portal-provider.js";
@@ -29,19 +34,11 @@ import {
ContentDOM
} from "./types.js";
import { Editor, NodeViewRendererProps } from "@tiptap/core";
import { __serializeForClipboard, EditorView } from "prosemirror-view";
import { EditorView } from "prosemirror-view";
import { EmotionThemeProvider } from "@notesnook/theme";
import { isAndroid, isiOS } from "../../utils/platform.js";
import { useToolbarStore } from "../../toolbar/stores/toolbar-store.js";
// This is hacky workaround to manually handle serialization when
// drag/dropping on mobile devices.
declare module "prosemirror-view" {
export function __serializeForClipboard(
view: EditorView,
slice: Slice
): { dom: HTMLElement; text: string };
}
const portalProviderAPI = new PortalProviderAPI();
export class ReactNodeView<P extends ReactNodeViewProps> implements NodeView {
private domRef!: HTMLElement;
@@ -394,9 +391,7 @@ export class ReactNodeView<P extends ReactNodeViewProps> implements NodeView {
return true;
}
ignoreMutation(
mutation: MutationRecord | { type: "selection"; target: Element }
) {
ignoreMutation(mutation: ViewMutationRecord) {
if (!this.dom || !this.contentDOM) {
return true;
}
@@ -495,7 +490,7 @@ function forceHandleDrag(event: DragEvent, editor: Editor) {
if (!event.dataTransfer) return;
const { view } = editor;
const slice = view.state.selection.content();
const { dom, text } = __serializeForClipboard(view, slice);
const { dom, text } = view.serializeForClipboard(slice);
event.dataTransfer.clearData();
event.dataTransfer.setData("Text", text);

View File

@@ -23,6 +23,9 @@
},
},
},
"patchedDependencies": {
"@lingui/cli@5.5.1": "patches/@lingui%2Fcli@5.5.1.patch",
},
"packages": {
"@babel/code-frame": ["@babel/code-frame@7.27.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="],

View File

@@ -27,8 +27,7 @@
"compile": "lingui compile --typescript",
"build-locale": "bun scripts/generate-strings.mjs && bun run extract && bun run compile",
"build": "bun run build-locale && bunx vite build && bun run scripts/postbuild.mjs",
"watch": "nodemon --watch scripts/ --watch src --ext ts,mjs --exec \"bun run build\"",
"postinstall": "patch-package"
"watch": "nodemon --watch scripts/ --watch src --ext ts,mjs --exec \"bun run build\""
},
"devDependencies": {
"@lingui/cli": "5.5.1",
@@ -47,5 +46,8 @@
"peerDependencies": {
"@lingui/macro": "*",
"react": ">=18"
},
"patchedDependencies": {
"@lingui/cli@5.5.1": "patches/@lingui%2Fcli@5.5.1.patch"
}
}

View File

@@ -0,0 +1,15 @@
diff --git a/dist/api/pseudoLocalize.js b/dist/api/pseudoLocalize.js
index fa44b2bc99c2774df3966723858eb30408e3d69b..cd28728d0a8baafef80b3e5c078265d8683fe37e 100644
--- a/dist/api/pseudoLocalize.js
+++ b/dist/api/pseudoLocalize.js
@@ -49,8 +49,8 @@ function default_1(message) {
message = addDelimitersVariables(message);
message = (0, pseudolocale_1.default)(message, {
delimiter,
- prepend: "",
- append: "",
+ prepend: "[!!",
+ append: "!!]",
});
return removeDelimiters(message);
}

View File

@@ -1,16 +0,0 @@
diff --git a/node_modules/@lingui/cli/dist/api/pseudoLocalize.js b/node_modules/@lingui/cli/dist/api/pseudoLocalize.js
index 34f3952..83cbc1e 100644
--- a/node_modules/@lingui/cli/dist/api/pseudoLocalize.js
+++ b/node_modules/@lingui/cli/dist/api/pseudoLocalize.js
@@ -48,8 +48,9 @@ function default_1(message) {
message = addDelimiters(message);
message = (0, pseudolocale_1.default)(message, {
delimiter,
- prepend: "",
- append: "",
+ prepend: "[!!",
+ append: "!!]",
+ extend: 0.3
});
return removeDelimiters(message);
}

View File

@@ -18,6 +18,9 @@
},
},
},
"patchedDependencies": {
"libsodium-sumo@0.7.15": "patches/libsodium-sumo@0.7.15.patch",
},
"packages": {
"@arrows/array": ["@arrows/array@1.4.1", "", { "dependencies": { "@arrows/composition": "^1.2.2" } }, "sha512-MGYS8xi3c4tTy1ivhrVntFvufoNzje0PchjEz6G/SsWRgUKxL4tKwS6iPdO8vsaJYldagAeWMd5KRD0aX3Q39g=="],

View File

@@ -35,7 +35,6 @@
"bench": "bun run benches/bench.ts",
"postbuild": "bun run scripts/postbuild.mjs",
"prepublishOnly": "bun run build && bun run test",
"postinstall": "patch-package",
"build": "tsdown src/browser.ts src/node.ts",
"watch": "bun run build -- --watch"
},
@@ -57,5 +56,8 @@
},
"dependencies": {
"libsodium-wrappers-sumo": "^0.7.15"
},
"patchedDependencies": {
"libsodium-sumo@0.7.15": "patches/libsodium-sumo@0.7.15.patch"
}
}

View File

@@ -20,10 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import fs from "fs/promises";
import { existsSync } from "fs";
import path from "path";
import { findPackages, readConfig, runTasks } from "./utils.mjs";
const config = readConfig();
const allPackages = await findPackages(config.projects);
import { allPackages, runTasks } from "./utils.mjs";
const tasks = [];
for (const pkg of allPackages) {