Move sdkman into narvar zsh setup
Include narvar specific configuration
Rust analyzer uses clippy instead of check
Share command history between sessions
Sync Brewfile with actual installed casks/formulae/images/taps
Prune Brewfile
Fix sdkman slowness
Enable auto-formatting
JavaScript autoformatting works via null-ls. Everything else would use this.
Format init.lua
Stop using jenv
Switch to kickstart.nvim
Add null-ls support for prettier, eslint, shellcheck
We add some cargo commands to fix dependency issues when building.
Thinking about this more, Cargo.toml should look like:
[workspace]
members = [
"crates/*",
]
so maybe this whole section can be removed?
This is how https://rust-on-nails.com/docs/full-stack-web/server-side-components/ currently looks:
First, thank you for start this project.
I think most VSCode users are using https://code.visualstudio.com/docs/devcontainers/containers#_temporarily-forwarding-a-port to forward port 3000 to their host machine. I am not using VSCode for my dev container setup though.
To get my setup working, I have to make the following changes:
Publish container port 3000 to host IP 127.0.0.1, port 3000.
--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -13,10 +13,12 @@ services:
retries: 5
development:
- build:
+ build:
context: .
dockerfile: Dockerfile
-
+ ports:
+ - "127.0.0.1:3000:3000"
+
volumes:
- ..:/workspace:cached
# Give access to ssh keys on the host (Is there a better way to do this?)
Make the server inside the container accept connections on all (virtual) interfaces rather than just the container's localhost (127.0.0.1).
--- a/crates/axum-server/src/main.rs
+++ b/crates/axum-server/src/main.rs
@@ -19,7 +19,7 @@ async fn main() {
.layer(Extension(pool.clone()));
// run it
- let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
+ let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
println!("listening on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())
From a Microsoft/GitHub developer:
Our examples show using 0.0.0.0 instead of localhost ...
This was in 2019 though and I know they have since separated the notion of always forward a port and publish a port.
I absolutely understand if you want to leave things as is. If so, this can serve as guidance for anyone else who runs into this issue.
Prevent .git directory in crates/axum-server
Running the command "cargo new crates/axum-server" will create crates/axum-server/.git as a side-effect. When we later run "git add ." we will see this message:
error: 'crates/axum-server/' does not have a commit checked out
Using the --vsc=none flag will omit the .git directory.
Log of how I got the error:
/workspace
$ git init
Initialized empty Git repository in /workspace/.git/
/workspace
$ cargo new crates/axum-server
Created binary (application) `crates/axum-server` package
/workspace
$ git add .
error: 'crates/axum-server/' does not have a commit checked out
fatal: adding files failed
With the updated docs:
/workspace
$ git init
Initialized empty Git repository in /workspace/.git/
/workspace
$ cargo new --vcs=none crates/axum-server
Created binary (application) `crates/axum-server` package
/workspace
$ git add .
$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .devcontainer/.bash_aliases
new file: .devcontainer/Dockerfile
new file: .devcontainer/devcontainer.json
new file: .devcontainer/docker-compose.yml
new file: .devcontainer/ps1.bash
new file: .gitignore
new file: Cargo.lock
new file: Cargo.toml
new file: README.md
new file: crates/axum-server/Cargo.toml
new file: crates/axum-server/src/main.rs
Running the command "cargo new crates/axum-server" will create crates/axum-server/.git as a side-effect. When we later run "git add ." we will see this message:
error: 'crates/axum-server/' does not have a commit checked out
Using the --vsc=none flag will omit the .git directory.
prefer fnm instead of nvm
support sdkman
Fix issue with lack of history in zsh
We should be able to do this using docker buildx
for multi-platform builds.
Example:
$ cd /path/to/rust-on-nails
$ docker buildx build --platform linux/arm64 nails-devcontainer
...
=> => writing image sha256:5c9c95cb837f7e6d2c447dbe5a614e8726ba6ee336f49416f840c3431bba27b9
$ docker image inspect --format "{{.Architecture}}" 5c9c95cb837f7e6d2c447dbe5a614e8726ba6ee336f49416f840c3431bba27b9
arm64
See https://docs.docker.com/build/building/multi-platform/ for more information.
I also opened https://github.com/purton-tech/rust-on-nails/pull/27 to resolve one issue I ran into when building an arm64
target.
For arm64 builds, cargo uses all available memory and often gets killed by the OS. Rust v1.68 has stable support for the sparse registry protocol, which uses much less memory.
Relates to https://github.com/purton-tech/rust-on-nails/issues/14
I ran into this error due to an empty string at the end of the publish command:
lerna publish --yes --npm-tag latest --repo-version 1.0.0 ''
- notice the ''
at the end.
The above publish command was generated inside a bash function that sometimes took a parameter:
lerna_publish_to () {
lerna publish --yes --npm-tag latest --repo-version 1.0.0 "$1"
}
When the parameter was not included in the function call, we get the above command and lerna throws the error.
lerna_publish_to --skip-git # works
lerna_publish_to # fails
The fix is some arcane bash:
lerna_publish_to () {
lerna publish --yes --npm-tag latest --repo-version 1.0.0 ${1:+"$1"}
}
fix(website): update link to defer and stream RFC
Deploy hjr3/hjr3.github.io to hjr3/hjr3.github.io:gh-pages
Add desk to Uses section
But I know they're looking at only providing minimal support for this package because they plan to deprecate it.
How do we know they are planning to deprecate it?