tantaman/strut

How can I test the latest version?

Opened this issue · 17 comments

Hi
Is there anyway to test the latest version?
Is there any roadmap for the final version?

Best Wishes

The repository currently has some link dependencies against https://github.com/vlcn-io/cr-sqlite so you'd have to:

git clone cr-sqlite
cd cr-sqlite
pnpm build
cd ..
git clone strut
cd strut/app
pnpm install
pnpm start

though should do the trick.

Given it's a re-write its still lacking in feature parity.

No roadmap yet, other than in my head. I'll get to writing it down at some point.

That worked (not OP but I wanted to try).

FYI:

I had to add make above line 9: https://github.com/vlcn-io/cr-sqlite/blob/main/js/wasm-esm/crsqlite/build.sh#L9

I had to rename /app/src/components/editor/markdown/plugins/AutolinkPlugin.jsx to AutoLinkPlugin (capital L)

refactoring the cr-sqlite build I should say. Not too much to the strut build and even less so once cr-sqlite is stable so it can just be served from npm.

I do not know if this should be a new issue, but I am also running into issues following your instructions for installing. It also might an issue with bcrypt, I am not that familiar with nodejs..

root@markus-VirtualBox:/var/strut/strut-workspace# make

cd cr-sqlite/core; \

make loadable

make[1]: Verzeichnis „/var/strut/strut-workspace/cr-sqlite/core“ wird betreten

cd ./rs/bundle &&  cargo build  --release --features loadable_extension 

warning: unused variable: `table`

   --> /var/strut/strut-workspace/cr-sqlite/core/rs/core/src/automigrate.rs:431:5

    |

431 |     table: &str,

    |     ^^^^^ help: if this is intentional, prefix it with an underscore: `_table`

    |

    = note: `#[warn(unused_variables)]` on by default



warning: unused variable: `mem_db`

   --> /var/strut/strut-workspace/cr-sqlite/core/rs/core/src/automigrate.rs:433:5

    |

433 |     mem_db: &ManagedConnection,

    |     ^^^^^^ help: if this is intentional, prefix it with an underscore: `_mem_db`



warning: `crsql_core` (lib) generated 2 warnings (run `cargo fix --lib -p crsql_core` to apply 2 suggestions)

warning: unused import: `core::alloc::GlobalAlloc`

  --> src/lib.rs:20:5

   |

20 | use core::alloc::GlobalAlloc;

   |     ^^^^^^^^^^^^^^^^^^^^^^^^

   |

   = note: `#[warn(unused_imports)]` on by default



warning: `crsql_bundle` (lib) generated 1 warning (run `cargo fix --lib -p crsql_bundle` to apply 1 suggestion)

    Finished release [optimized] target(s) in 0.02s

cp ./rs/bundle/target/release/libcrsql_bundle.a ./dist/libcrsql_bundle-loadable.a

gcc -O2 -I./src/ -I./src/sqlite \

-std=c99 -fPIC -shared -Wall \

 \

src/crsqlite.c src/util.c src/tableinfo.c src/triggers.c src/changes-vtab.c src/changes-vtab-read.c src/changes-vtab-common.c src/changes-vtab-write.c src/ext-data.c src/get-table.c src/seen-peers.c ./dist/libcrsql_bundle-loadable.a -o dist/crsqlite.so

src/crsqlite.c: In function ‘crsqlBeginAlterFunc’:

src/crsqlite.c:423:15: warning: variable ‘schemaName’ set but not used [-Wunused-but-set-variable]

  423 |   const char *schemaName = 0;

      |               ^~~~~~~~~~

make[1]: Verzeichnis „/var/strut/strut-workspace/cr-sqlite/core“ wird verlassen

git submodule update --init --recursive

git submodule update --init --recursive

pnpm install

 WARN  Unsupported engine: wanted: {"node":">=19"} (current: {"node":"v18.16.0","pnpm":"8.3.0"})

Scope: all 61 workspace projects

strut/server                             |  WARN  deprecated formidable@1.2.6

model-js/ts/connectors/sqlite3-connector |  WARN  deprecated @npmcli/move-file@1.1.2

strut/app                                |  WARN  deprecated source-map-resolve@0.5.3

strut/app                                |  WARN  deprecated urix@0.1.0

strut/app                                |  WARN  deprecated resolve-url@0.2.1

strut/app                                |  WARN  deprecated source-map-url@0.4.1

strut/deps/access-token-jwt              |  WARN  deprecated w3c-hr-time@1.0.2

Packages: +1565

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Progress: resolved 1610, reused 1562, downloaded 0, added 0, done

node_modules/.pnpm/core-js@3.29.0/node_modules/core-js: Running postinstall script, done in 153ms

node_modules/.pnpm/better-sqlite3@8.1.0/node_modules/better-sqlite3: Running install script...

node_modules/.pnpm/bcrypt@5.1.0/node_modules/bcrypt: Running install script, failed in 273ms

.../bcrypt@5.1.0/node_modules/bcrypt install$ node-pre-gyp install --fallback-to-build

└─ Failed in 273ms at /var/strut/strut-workspace/node_modules/.pnpm/bcrypt@5.1.0/node_modules/bcrypt

 ELIFECYCLE  Command failed with exit code 1.

make: *** [Makefile:10: node_modules] Fehler 1

 WARN  Unsupported engine: wanted: {"node":">=19"} (current: {"node":"v18.16.0","pnpm":"8.3.0"})

Could you try again with node 19? Or not possible to upgrade?

Still the same issue:

strut/deps/access-token-jwt              |  WARN  Unsupported engine: wanted: {"node":"^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0"} (current: {"node":"v19.9.0","pnpm":"8.3.0"})
Scope: all 61 workspace projects
strut/server                             |  WARN  deprecated formidable@1.2.6
model-js/ts/connectors/sqlite3-connector |  WARN  deprecated @npmcli/move-file@1.1.2
strut/app                                |  WARN  deprecated source-map-resolve@0.5.3
strut/app                                |  WARN  deprecated urix@0.1.0
strut/app                                |  WARN  deprecated resolve-url@0.2.1
strut/app                                |  WARN  deprecated source-map-url@0.4.1
strut/deps/access-token-jwt              |  WARN  deprecated w3c-hr-time@1.0.2
Packages: +1565
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1610, reused 1562, downloaded 0, added 0, done
node_modules/.pnpm/browser-tabs-lock@1.2.15/node_modules/browser-tabs-lock: Running postinstall script, done in 200ms
node_modules/.pnpm/core-js@3.29.0/node_modules/core-js: Running postinstall script, done in 178ms
node_modules/.pnpm/bcrypt@5.1.0/node_modules/bcrypt: Running install script, failed in 312ms
.../bcrypt@5.1.0/node_modules/bcrypt install$ node-pre-gyp install --fallback-to-build
└─ Failed in 312ms at /var/strut/strut-workspace/node_modules/.pnpm/bcrypt@5.1.0/node_modules/bcrypt
node_modules/.pnpm/better-sqlite3@8.1.0/node_modules/better-sqlite3: Running install script...
 ELIFECYCLE  Command failed with exit code 1.
make: *** [Makefile:10: node_modules] Fehler 1

Looks like it is an issue installing better-sqlite3.

That component is technically only needed for the server side rather than the client. You could remove the server package from pnpm-workspace.yaml to unblock you for the time being.

I'm about to push an update the simplifies things quite a bit (no more need for the giant workspace checkout).

Also, since it seems like a better-sqlite3 issue, what happens if you create a new project and try only installing that package?

Ok, things should be much simpler to checkout and build now. Updated instructions in the readme.

This likely will not resolve the better-sqlite3 / bcrypt issue, however. lmk if you still have an issue with that dependency and we can look into why.

makefu commented

hey! anyone got at least the dockerfile running?
removing the "pnpm fetch" "--offline" from "pnpm install" got the container building at least, however after starting i get:
A1EFCD35673DAA4FC3560685: cannot acquire lease or find primary, retrying: fetch primary url: Get "http://127.0.0.1:8500/v1/kv/litefs": dial tcp 127.0.0.1:8500: connect: connection refused

Ah, I haven't kept the docker file up to date. The build instructions in the readme should work on all platforms.

Will update the docker.

makefu commented

okay, thanks for the response!

okay, thanks for the response!

an update on this -- finishing up a nextjs integration for cr-sqlite. Once that is done, Strut will be NextJS based and built & launched via a single command.

makefu commented

sounds awesome! looking forward to testing it!

Have a pretty solid vite scaffolding together that includes a sync server + automatic migrations (https://github.com/vlcn-io/vite-starter)

Working on porting Strut over to that.

The original plan was NextJS but webpack is a bit in the stone age and missing require features, hence the pivot to Vite.

@tantaman Your Vite project is very intriguing, be perfect for a classroom environment. Following...

Everything should be good to go now.

strut.mov

Fixing some server bugs with respect to schema migrations next but the UI works fine.

note that the UI doesn't have feature parity with the original version. Only text components are available at the moment.