@weapp-sqlite/sqljs 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,8 +7,11 @@ import initSqlJs from '@weapp-sqlite/sqljs/full'
7
7
  // 或 import initSqlJs from '@weapp-sqlite/sqljs/lite'
8
8
  ```
9
9
 
10
- - `full` 包装 `sql.js@1.14.2`,保持 FTS3、normalize 与贡献扩展函数。
11
- - `lite` 固定 SQLite 3.49.1 与 Emscripten 5.0.0,保留普通表、索引、事务、触发器、CTE、JSON1、ALTER、参数绑定、BLOB 和数据库导入导出;不提供 FTS3、normalize 与贡献数学/字符串函数。
10
+ - `full` 包装官方 `sql.js@1.14.2`,保持 FTS3、normalize 与贡献扩展函数,是本包的默认完整能力基线。
11
+ - `lite` 基于同一 sql.js 版本重新编译,固定 SQLite 3.49.1 与 Emscripten 5.0.0,保留普通表、索引、事务、触发器、CTE、JSON1、ALTER、参数绑定、BLOB 和数据库导入导出;明确移除 FTS3、SQLite normalized SQL(`getNormalizedSQL()`)和 sql.js 贡献的数学/字符串/聚合函数(例如 `reverse()`)。
12
+
13
+ `full` 与 `lite` 生成的数据库文件使用相同的 SQLite 文件格式,可以互相导入导出;如果数据库包含 FTS3 虚表,`lite` 不能执行该虚表相关 SQL。`lite` 主要用于降低 WASM 包体积,不应默认视为查询性能更高的版本。普通 `LIKE`/`GLOB`、事务和迁移不受这些裁剪影响。
14
+
12
15
  - `@weapp-sqlite/sqljs/node` 仅供构建期解析 full/lite 的 WASM 文件名与绝对路径。
13
16
 
14
17
  lite 的来源、版本、哈希与许可证会复制到发布包。普通消费者构建不依赖 Docker 或 Emscripten。
package/dist/full.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SqlJsInitializer } from "@weapp-sqlite/wasm";
2
2
  //#region src/full.d.ts
3
- declare const initSqlJsFull: SqlJsInitializer;
3
+ export declare const initSqlJsFull: SqlJsInitializer;
4
4
  //#endregion
5
- export { initSqlJsFull as default, initSqlJsFull };
5
+ export { initSqlJsFull as default };
package/dist/full.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SqlJsInitializer } from "@weapp-sqlite/wasm";
2
2
  //#region src/full.d.ts
3
- declare const initSqlJsFull: SqlJsInitializer;
3
+ export declare const initSqlJsFull: SqlJsInitializer;
4
4
  //#endregion
5
- export { initSqlJsFull as default, initSqlJsFull };
5
+ export { initSqlJsFull as default };
package/dist/lite.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SqlJsInitializer } from "@weapp-sqlite/wasm";
2
2
  //#region src/lite.d.ts
3
- declare const initSqlJsLite: SqlJsInitializer;
3
+ export declare const initSqlJsLite: SqlJsInitializer;
4
4
  //#endregion
5
- export { initSqlJsLite as default, initSqlJsLite };
5
+ export { initSqlJsLite as default };
package/dist/lite.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SqlJsInitializer } from "@weapp-sqlite/wasm";
2
2
  //#region src/lite.d.ts
3
- declare const initSqlJsLite: SqlJsInitializer;
3
+ export declare const initSqlJsLite: SqlJsInitializer;
4
4
  //#endregion
5
- export { initSqlJsLite as default, initSqlJsLite };
5
+ export { initSqlJsLite as default };
package/dist/node.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  //#region src/node.d.ts
2
- type SqliteWasmVariant = 'full' | 'lite';
3
- type SqliteWasmAssetTarget = 'web' | 'miniprogram';
4
- declare function sqliteWasmAssetName(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): "sql-wasm-lite.wasm" | "sql-wasm-browser.wasm" | "sql-wasm.wasm";
5
- declare function resolveSqliteWasmAsset(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): string;
6
- //#endregion
7
- export { SqliteWasmAssetTarget, SqliteWasmVariant, resolveSqliteWasmAsset, sqliteWasmAssetName };
2
+ export type SqliteWasmVariant = 'full' | 'lite';
3
+ export type SqliteWasmAssetTarget = 'web' | 'miniprogram';
4
+ export declare function sqliteWasmAssetName(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): "sql-wasm-lite.wasm" | "sql-wasm-browser.wasm" | "sql-wasm.wasm";
5
+ export declare function resolveSqliteWasmAsset(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): string;
6
+ //#endregion
package/dist/node.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  //#region src/node.d.ts
2
- type SqliteWasmVariant = 'full' | 'lite';
3
- type SqliteWasmAssetTarget = 'web' | 'miniprogram';
4
- declare function sqliteWasmAssetName(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): "sql-wasm-lite.wasm" | "sql-wasm-browser.wasm" | "sql-wasm.wasm";
5
- declare function resolveSqliteWasmAsset(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): string;
6
- //#endregion
7
- export { SqliteWasmAssetTarget, SqliteWasmVariant, resolveSqliteWasmAsset, sqliteWasmAssetName };
2
+ export type SqliteWasmVariant = 'full' | 'lite';
3
+ export type SqliteWasmAssetTarget = 'web' | 'miniprogram';
4
+ export declare function sqliteWasmAssetName(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): "sql-wasm-lite.wasm" | "sql-wasm-browser.wasm" | "sql-wasm.wasm";
5
+ export declare function resolveSqliteWasmAsset(variant: SqliteWasmVariant, target: SqliteWasmAssetTarget): string;
6
+ //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-sqlite/sqljs",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.2.1",
5
5
  "description": "weapp-sqlite 的 full 与 lite sql.js WASM 引擎资源",
6
6
  "author": "weapp-sqlite contributors",
7
7
  "license": "MIT",
@@ -54,8 +54,8 @@
54
54
  "node": "^20.19.0 || >=22.12.0"
55
55
  },
56
56
  "dependencies": {
57
- "sql.js": "1.14.2",
58
- "@weapp-sqlite/wasm": "0.1.0"
57
+ "@weapp-sqlite/wasm": "0.1.2",
58
+ "sql.js": "1.14.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/sql.js": "^1.4.11"