@weapp-sqlite/sqljs 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ice breaker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @weapp-sqlite/sqljs
2
+
3
+ `weapp-sqlite` 使用的 sql.js 引擎与 WASM 资源包。
4
+
5
+ ```ts
6
+ import initSqlJs from '@weapp-sqlite/sqljs/full'
7
+ // 或 import initSqlJs from '@weapp-sqlite/sqljs/lite'
8
+ ```
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 与贡献数学/字符串函数。
12
+ - `@weapp-sqlite/sqljs/node` 仅供构建期解析 full/lite 的 WASM 文件名与绝对路径。
13
+
14
+ lite 的来源、版本、哈希与许可证会复制到发布包。普通消费者构建不依赖 Docker 或 Emscripten。
15
+
16
+ ```bash
17
+ pnpm --filter @weapp-sqlite/sqljs verify:lite
18
+ pnpm --filter @weapp-sqlite/sqljs rebuild:lite
19
+ ```
20
+
21
+ `rebuild:lite` 使用固定的 `emscripten/emsdk:5.0.0` Docker 镜像重新生成资源,然后刷新哈希并检查体积预算。
Binary file
package/dist/full.cjs ADDED
@@ -0,0 +1,12 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_rolldown_runtime = require("./rolldown-runtime-y5ARvAq5.cjs");
6
+ let sql_js = require("sql.js");
7
+ sql_js = require_rolldown_runtime.__toESM(sql_js, 1);
8
+ //#region src/full.ts
9
+ const initSqlJsFull = sql_js.default;
10
+ //#endregion
11
+ exports.default = initSqlJsFull;
12
+ exports.initSqlJsFull = initSqlJsFull;
@@ -0,0 +1,5 @@
1
+ import { SqlJsInitializer } from "@weapp-sqlite/wasm";
2
+ //#region src/full.d.ts
3
+ declare const initSqlJsFull: SqlJsInitializer;
4
+ //#endregion
5
+ export { initSqlJsFull as default, initSqlJsFull };
@@ -0,0 +1,5 @@
1
+ import { SqlJsInitializer } from "@weapp-sqlite/wasm";
2
+ //#region src/full.d.ts
3
+ declare const initSqlJsFull: SqlJsInitializer;
4
+ //#endregion
5
+ export { initSqlJsFull as default, initSqlJsFull };
package/dist/full.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import initializeSqlJs from "sql.js";
2
+ //#region src/full.ts
3
+ const initSqlJsFull = initializeSqlJs;
4
+ //#endregion
5
+ export { initSqlJsFull as default, initSqlJsFull };
@@ -0,0 +1,44 @@
1
+ MIT license
2
+ ===========
3
+
4
+ Copyright (c) 2017 sql.js authors (see AUTHORS)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+
25
+
26
+ # Some portions of the Makefile taken from:
27
+ Copyright 2017 Ryusei Yamaguchi
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
30
+ this software and associated documentation files (the "Software"), to deal in
31
+ the Software without restriction, including without limitation the rights to
32
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
33
+ the Software, and to permit persons to whom the Software is furnished to do so,
34
+ subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in all
37
+ copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
41
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
42
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
43
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
44
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ SQLite is in the public domain. The SQLite amalgamation used for this build is
2
+ distributed under the SQLite blessing at https://www.sqlite.org/copyright.html.