Skip to content

Commit

Permalink
fix teal sqlite template, enhance build script, fix download counts
Browse files Browse the repository at this point in the history
  • Loading branch information
micovi committed Oct 16, 2024
1 parent 15d23d7 commit 4e18be2
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/eight-socks-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"create-ao-dapp": patch
"site": patch
---

fix teal-sqlite template and downloads number
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "factory.globals"
require "books.globals"

local sqlite3 = require('lsqlite3')
local dbUtils = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "lsqlite3"

-- Define types
global Owner: string
global Variant: string
global Counter: number
global DB: db
Expand Down
4 changes: 3 additions & 1 deletion create-ao-dapp/templates/scripts/build-amalg/lua-sqlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ luacheck src/process.lua \

cd src
amalg.lua -s process.lua -o ../build/process.lua \
lib.process_lib lib.db utils.db
lib.process_lib lib.db utils.db

echo "Build finished."
4 changes: 3 additions & 1 deletion create-ao-dapp/templates/scripts/build-amalg/lua.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ luacheck src/process.lua \

cd src
amalg.lua -s process.lua -o ../build/process.lua \
lib.process_lib
lib.process_lib

echo "Build finished."
4 changes: 3 additions & 1 deletion create-ao-dapp/templates/scripts/build-amalg/teal-sqlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ cd build-lua
amalg.lua -s books/main.lua -o ../build/process.lua \
books.globals books.utils.tl-utils books.db-utils

# FINAL RESULT is build/main.lua
# FINAL RESULT is build/main.lua

echo "Build finished."
4 changes: 3 additions & 1 deletion create-ao-dapp/templates/scripts/build-amalg/teal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ cd build-lua
amalg.lua -s counter/main.lua -o ../build/process.lua \
counter.utils.tl-utils

# FINAL RESULT is build/main.lua
# FINAL RESULT is build/main.lua

echo "Build finished."
4 changes: 3 additions & 1 deletion create-ao-dapp/templates/scripts/build-squishy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ output_line=$(grep "Output" ./squishy)
output_file=$(echo "$output_line" | awk -F "'" '{print $2}')

# Prepend reset_modules.lua to the squished file
cat ./src/reset_modules.lua | cat - ./$output_file > temp && mv temp ./build/process.lua
cat ./src/reset_modules.lua | cat - ./$output_file > temp && mv temp ./build/process.lua

echo "Build finished."
4 changes: 3 additions & 1 deletion site/components/Downloads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import React from "react";
export function Downloads() {
const [downloads, setDownloads] = React.useState(null);

const EXTERNAL_DOWNLOADS = 500;

React.useEffect(() => {
async function fetchDownloads() {
try {
const response = await fetch(
"https://api.npmjs.org/downloads/point/last-year/create-ao-dapp"
);
const data = await response.json();
setDownloads(data.downloads);
setDownloads(data.downloads + EXTERNAL_DOWNLOADS);
} catch (error) {
console.error("Error fetching downloads:", error);
}
Expand Down

0 comments on commit 4e18be2

Please sign in to comment.