Merge pull request #22 from h-sphere/fix/process-on-mobile-error

fix: fixing issue with process on mobile not present
This commit is contained in:
Kacper Kula 2024-12-20 11:36:41 +00:00 committed by GitHub
commit 56aade75f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 40 deletions

View file

@ -1,3 +1,6 @@
# 0.12.1
fix: Fixed issue with the library on mobile - now it should load properly.
# 0.12.0
This update does not bring any functionality changes yet but it fixes some problems with underlying architecture, helping to make SQLSeal more efficient in the future. If you work with many datasets, you might see slightly smaller memory usage as the database is now persisted in the IndexedDb (tech comment: as block storage).
Technical update:

View file

@ -3,6 +3,7 @@ import process from "process";
import builtins from "builtin-modules";
import { readFileSync } from 'fs';
import { join } from 'path';
import { polyfillNode } from 'esbuild-plugin-polyfill-node'
const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
@ -38,41 +39,6 @@ const wasmPlugin = {
},
};
// Plugin to handle Node.js module shims
// const nodeModulesPlugin = {
// name: 'node-modules',
// setup(build) {
// build.onResolve({ filter: /^path$/ }, args => ({
// path: args.path,
// namespace: 'node-modules',
// }));
// build.onLoad({ filter: /^path$/, namespace: 'node-modules' }, () => ({
// contents: `
// export function dirname(path) {
// return path.replace(/\\/[^\\/]*$/, '');
// }
// export function normalize(path) {
// return path;
// }
// `,
// }));
// build.onResolve({ filter: /^fs$/ }, args => ({
// path: args.path,
// namespace: 'node-modules',
// }));
// build.onLoad({ filter: /^fs$/, namespace: 'node-modules' }, () => ({
// contents: `
// export function readFileSync() {
// throw new Error('readFileSync is not supported in the browser');
// }
// `,
// }));
// },
// };
// Plugin to inject worker code
const workerPlugin = {
name: 'worker',
@ -91,7 +57,8 @@ const workerPlugin = {
format: 'iife',
target: 'es2020',
external: ['fs', 'path'],
plugins: [wasmPlugin, /*nodeModulesPlugin*/],
plugins: [wasmPlugin, polyfillNode({
})],
minify: process.argv[2] === 'production',
define: {
'process.env.NODE_ENV': JSON.stringify(process.argv[2] === 'production' ? 'production' : 'development'),
@ -142,7 +109,6 @@ const context = await esbuild.context({
outfile: "main.js",
plugins: [
wasmPlugin,
// nodeModulesPlugin,
workerPlugin
],
define: {

View file

@ -1,7 +1,7 @@
{
"id": "sqlseal",
"name": "SQLSeal",
"version": "0.12.0",
"version": "0.12.1",
"minAppVersion": "0.15.0",
"description": "Use SQL in your notes to query your vault files and CSV content.",
"author": "hypersphere",

View file

@ -1,6 +1,6 @@
{
"name": "sqlseal",
"version": "0.12.0",
"version": "0.12.1",
"description": "A plugin for Obsidian that allows you to run SQL queries on your notes.",
"main": "main.js",
"scripts": {
@ -46,6 +46,7 @@
"absurd-sql": "^0.0.54",
"ag-grid-community": "^32.3.3",
"comlink": "^4.4.2",
"esbuild-plugin-polyfill-node": "^0.3.0",
"json5": "^2.2.3",
"lodash": "^4.17.21",
"markdown-table-ts": "^1.0.3",

View file

@ -23,6 +23,9 @@ importers:
comlink:
specifier: ^4.4.2
version: 4.4.2
esbuild-plugin-polyfill-node:
specifier: ^0.3.0
version: 0.3.0(esbuild@0.24.0)
json5:
specifier: ^2.2.3
version: 2.2.3
@ -817,6 +820,9 @@ packages:
'@jridgewell/trace-mapping@0.3.25':
resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
'@jspm/core@2.1.0':
resolution: {integrity: sha512-3sRl+pkyFY/kLmHl0cgHiFp2xEqErA8N3ECjMs7serSUBmoJ70lBa0PG5t0IM6WJgdZNyyI0R8YFfi5wM8+mzg==}
'@malept/cross-spawn-promise@2.0.0':
resolution: {integrity: sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==}
engines: {node: '>= 12.13.0'}
@ -1629,6 +1635,11 @@ packages:
resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
engines: {node: '>= 0.4'}
esbuild-plugin-polyfill-node@0.3.0:
resolution: {integrity: sha512-SHG6CKUfWfYyYXGpW143NEZtcVVn8S/WHcEOxk62LuDXnY4Zpmc+WmxJKN6GMTgTClXJXhEM5KQlxKY6YjbucQ==}
peerDependencies:
esbuild: '*'
esbuild-plugin-replace@1.4.0:
resolution: {integrity: sha512-lP3ZAyzyRa5JXoOd59lJbRKNObtK8pJ/RO7o6vdjwLi71GfbL32NR22ZuS7/cLZkr10/L1lutoLma8E4DLngYg==}
@ -1939,6 +1950,9 @@ packages:
engines: {node: '>=8'}
hasBin: true
import-meta-resolve@3.1.1:
resolution: {integrity: sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==}
imurmurhash@0.1.4:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
@ -3826,6 +3840,8 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.0
'@jspm/core@2.1.0': {}
'@malept/cross-spawn-promise@2.0.0':
dependencies:
cross-spawn: 7.0.6
@ -4697,6 +4713,12 @@ snapshots:
es-errors@1.3.0: {}
esbuild-plugin-polyfill-node@0.3.0(esbuild@0.24.0):
dependencies:
'@jspm/core': 2.1.0
esbuild: 0.24.0
import-meta-resolve: 3.1.1
esbuild-plugin-replace@1.4.0:
dependencies:
magic-string: 0.25.9
@ -5103,6 +5125,8 @@ snapshots:
pkg-dir: 4.2.0
resolve-cwd: 3.0.0
import-meta-resolve@3.1.1: {}
imurmurhash@0.1.4: {}
indent-string@4.0.0: {}

View file

@ -14,5 +14,6 @@
"0.10.0": "0.15.0",
"0.10.1": "0.15.0",
"0.11.0": "0.15.0",
"0.12.0": "0.15.0"
"0.12.0": "0.15.0",
"0.12.1": "0.15.0"
}