]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the 'npm' ext/wasm makefile target to create npm-bundle.zip for use by the downst...
authorstephan <stephan@noemail.net>
Fri, 9 Jan 2026 19:44:31 +0000 (19:44 +0000)
committerstephan <stephan@noemail.net>
Fri, 9 Jan 2026 19:44:31 +0000 (19:44 +0000)
FossilOrigin-Name: a4752c18a85bee0cef61ee5ac7911661c1894fb861412c957692069195a001a5

ext/wasm/GNUmakefile
manifest
manifest.uuid

index 90f260ab6f4bda559c617363f6f67bcdceb2fc6e..3e39ea767bece29ba0fbc237c8109d4979797048 100644 (file)
@@ -86,6 +86,7 @@ emo.strip     = ๐Ÿ’ˆ
 emo.test      = ๐Ÿงช
 emo.tool      = ๐Ÿ”จ
 emo.wasm-opt  = ๐Ÿงผ
+emo.cleanup   = ๐Ÿงผ
 # ๐Ÿ‘ท๐Ÿช„๐Ÿงฎ๐Ÿงซ๐Ÿงฝ๐Ÿฟโ›ฝ๐Ÿšง๐ŸŽฑ๐Ÿชš๐Ÿ†๐Ÿงผ
 
 #
@@ -317,7 +318,7 @@ endif
 #
 sqlite3.canonical.c = $(dir.top)/sqlite3.c
 sqlite3.c ?= $(firstword $(wildcard $(dir.top)/sqlite3-see.c) $(sqlite3.canonical.c))
-sqlite3.h = $(dir $(sqlite3.c))/sqlite3.h
+sqlite3.h = $(dir $(sqlite3.c))sqlite3.h
 
 #
 # bin.version-info = binary to output various sqlite3 version info for
@@ -1592,6 +1593,39 @@ endif
 # ^^^ making dist/snapshot
 CLEAN_FILES += $(wildcard sqlite-wasm-*.zip)
 
+########################################################################
+# The npm target is specifically for preparing files for the downstream
+# https://github.com/sqlite/sqlite-wasm (npm) distribution.
+#
+# Per agreement with that project's maintainers, these filenames need
+# to remain stable. To avoid breakage in their deployment process, any
+# changes (like renaming files) which potentially break their deployment
+# needs to be communicated to that project via opening a new ticket or
+# direct coordination with its maintainers.
+#
+# This target does a full clean/rebuild so that we can ensure that the
+# optimization level is set consistently across all files.
+#
+npm.bundle.zip = npm-bundle.zip
+CLEAN_FILES += $(npm.bundle.zip)
+# Distributables which need to be built for npm:
+npm_files = $(addprefix $(dir.dout)/, \
+sqlite3-bundler-friendly.mjs \
+sqlite3-opfs-async-proxy.js \
+sqlite3-worker1-bundler-friendly.mjs \
+sqlite3-worker1-promiser.mjs \
+sqlite3-worker1.mjs \
+sqlite3.mjs \
+sqlite3.wasm \
+sqlite3-node.mjs \
+)
+npm: $(sqlite3.canonical.c)
+       @echo "$(emo.cleanup) Forcing a clean rebuild to ensure consistent optimization flags."
+       $(MAKE) clean
+       $(MAKE) -e "emcc_opt=-Oz $(emcc-opt-extra)" $(npm_files)
+       rm -f $(npm.bundle.zip); zip -r $(npm.bundle.zip) $(npm_files)
+       unzip -l $(npm.bundle.zip)
+
 ########################################################################
 # Explanation of, and some commentary on, various emcc build flags
 # follows. Full docs for these can be found at:
index df7e6735bec4a1b0f23e8ebb62fef7d1b1ecadac..411e1626115641408f67fe504eec24802b99caa3 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sthe\swasm\ssnapshot\sbuild's\szipfile\sname\sto\sinclude\s'-snapshot'\sand\scorrect\sthe\supdate-docs\starget\sfor\srecent\sbuild\srefactoring.
-D 2026-01-09T18:42:27.684
+C Add\sthe\s'npm'\sext/wasm\smakefile\starget\sto\screate\snpm-bundle.zip\sfor\suse\sby\sthe\sdownstream\snpm\spackage.\sThis\starget\sis\sintended\sto\sbecome\stheir\spath\sfor\spulling\snpm-relevant\sdeliverables,\srather\sthan\sthe\scanonical\sdownloads,\sand\sthey\shave\sour/my\scommitment\snot\sto\sbreak\sit\swithout\sinvolving\sthem\sfirst.
+D 2026-01-09T19:44:31.051
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -580,7 +580,7 @@ F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009e
 F ext/session/sqlite3session.c b3de195ce668cace9b324599bf6255a70290cbfb5451e826e946f3aee6e64c54
 F ext/session/sqlite3session.h 7404723606074fcb2afdc6b72c206072cdb2b7d8ba097ca1559174a80bc26f7a
 F ext/session/test_session.c 8766b5973a6323934cb51248f621c3dc87ad2a98f023c3cc280d79e7d78d36fb
-F ext/wasm/GNUmakefile f2c9aefe6398d7171f698f96ac22dca9c42d149dc8f5e5adb2bf7e715f04c04c
+F ext/wasm/GNUmakefile ffd166e3fa26d00b6623104051981a3641df8943f51905de2a4a88f14d586c11
 F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
 F ext/wasm/README.md 2e87804e12c98f1d194b7a06162a88441d33bb443efcfe00dc6565a780d2f259
 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
@@ -2191,8 +2191,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
 F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P 9adab8b2bef4130abd358d53384cb5f4dd691b808336bb7102793b0165b1c516
-R 8142de4df1409c3197b6657fa6b5fe9c
+P 0f53dbf06010f66ba23941ee4269d507efa370f1a8cc0099d274d8baadebdb46
+R 64fd9becb93ebc8b129fa81217b5f109
 U stephan
-Z 6d267efc16568d51ef4b143084a87d51
+Z fbc6ff4d9dec0f732dbb941d472276a9
 # Remove this line to create a well-formed Fossil manifest.
index 6b7ed9e02eae6790ceda8c4aa8e259c941842e5f..90a5a4fb60751858d3d508bba3cdeabe6c1c3778 100644 (file)
@@ -1 +1 @@
-0f53dbf06010f66ba23941ee4269d507efa370f1a8cc0099d274d8baadebdb46
+a4752c18a85bee0cef61ee5ac7911661c1894fb861412c957692069195a001a5