Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
# BEGIN Standard MS Devcontainer for Typescript-Node

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/typescript-node/.devcontainer/base.Dockerfile
# [Choice] Node.js version: 14, 12, 10
ARG VARIANT="22-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:1-${VARIANT}
# Tags: https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/typescript-node/tags
# [Choice] Node.js version: 18, 20, 22
ARG VARIANT="22-bookworm"
FROM mcr.microsoft.com/devcontainers/typescript-node:2-${VARIANT}

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
Expand All @@ -22,11 +23,11 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:1-${VARIANT}
# --------------------------------------------------------------------
# BEGIN EMSDK
# Install EMSDK to /emsdk just like the EMSDK Dockerfile: https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
ENV EMSDK /emsdk
ENV EMSDK=/emsdk
# We pin the EMSDK version rather than 'latest' so that everyone is using the same compiler version
ENV EMSCRIPTEN_VERSION 4.0.5
ENV EMSCRIPTEN_VERSION=4.0.13

RUN git clone https://github.com/emscripten-core/emsdk.git $EMSDK
RUN git clone --depth=1 https://github.com/emscripten-core/emsdk.git $EMSDK

RUN echo "## Install Emscripten" \
&& cd ${EMSDK} \
Expand All @@ -44,7 +45,7 @@ RUN cd ${EMSDK} \
&& cat ${EMSDK}/upstream/emscripten/cache/sanity.txt \
&& echo "## Done"

ENV PATH $EMSDK:$EMSDK/upstream/emscripten/:$PATH
ENV PATH=$EMSDK:$EMSDK/upstream/emscripten/:$PATH

# Cleanup Emscripten installation and strip some symbols
# Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
Expand Down
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: devcontainers
directory: /
schedule:
interval: weekly
- package-ecosystem: docker
directory: .devcontainer
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: make
uses: ./.github/actions/build-sqljs
- uses: actions/upload-artifact@v4
with: {name: dist, path: dist}
- run: cat out/versions.txt
- name: test
run: npm ci && npm test
- name: generate documentation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Create a release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: make
uses: ./.github/actions/build-sqljs
- name: Create Release
Expand Down
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Note: Last built with version 2.0.15 of Emscripten

# TODO: Emit a file showing which version of emcc and SQLite was used to compile the emitted output.
# TODO: Create a release on Github with these compiled assets rather than checking them in
# TODO: Consider creating different files based on browser vs module usage: https://github.com/vuejs/vue/tree/dev/dist

# I got this handy makefile syntax from : https://github.com/mandel59/sqlite-wasm (MIT License) Credited in LICENSE
# To use another version of Sqlite, visit https://www.sqlite.org/download.html and copy the appropriate values here:
SQLITE_AMALGAMATION = sqlite-amalgamation-3490100
SQLITE_AMALGAMATION_ZIP_URL = https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
SQLITE_AMALGAMATION_ZIP_SHA3 = e7eb4cfb2d95626e782cfa748f534c74482f2c3c93f13ee828b9187ce05b2da7
SQLITE_AMALGAMATION = sqlite-amalgamation-3500400
SQLITE_AMALGAMATION_ZIP_URL = https://sqlite.org/2025/sqlite-amalgamation-3500400.zip
SQLITE_AMALGAMATION_ZIP_SHA3 = f131b68e6ba5fb891cc13ebb5ff9555054c77294cb92d8d1268bad5dba4fa2a1

# Note that extension-functions.c hasn't been updated since 2010-02-06, so likely doesn't need to be updated
EXTENSION_FUNCTIONS = extension-functions.c
Expand Down Expand Up @@ -146,6 +143,8 @@ out/sqlite3.o: sqlite-src/$(SQLITE_AMALGAMATION)
mkdir -p out
# Generate llvm bitcode
$(EMCC) $(SQLITE_COMPILATION_FLAGS) -c sqlite-src/$(SQLITE_AMALGAMATION)/sqlite3.c -o $@
$(EMCC) --version | grep '^emcc ' | grep -oP '\K[0-9]+\.[0-9]+\.[0-9]+' | echo Emscripten > out/versions.txt
grep '#define SQLITE_VERSION' sqlite-src/$(SQLITE_AMALGAMATION)/sqlite3.h | awk -F'"' '{print $2}' | xargs echo SQLite >> out/versions.txt

# Since the extension-functions.c includes other headers in the sqlite_amalgamation, we declare that this depends on more than just extension-functions.c
out/extension-functions.o: sqlite-src/$(SQLITE_AMALGAMATION)
Expand Down Expand Up @@ -187,6 +186,10 @@ sqlite-src/$(SQLITE_AMALGAMATION)/$(EXTENSION_FUNCTIONS): cache/$(EXTENSION_FUNC
cp 'cache/$(EXTENSION_FUNCTIONS)' $@


.PHONY: ci
ci: all
npm ci && npm test

.PHONY: clean
clean:
rm -f out/* dist/* cache/*
Expand Down
Loading
Loading