Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Install Crystal (Linux)
if: matrix.target == 'linux-x86_64'
uses: crystal-lang/install-crystal@v1
uses: crystal-lang/install-crystal@d8ef131ecec0352ce0e39b81b0a6d95def58fe2f # v1
with:
crystal: latest

Expand All @@ -36,7 +36,7 @@ jobs:
run: brew install crystal openssl@3

- name: Cache shards
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cache/shards
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
run: scripts/smoke_generated_web.sh ./amber

- name: Upload build artifacts
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: github.event_name == 'workflow_dispatch'
with:
name: amber-cli-${{ matrix.target }}-build
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
uses: crystal-lang/install-crystal@d8ef131ecec0352ce0e39b81b0a6d95def58fe2f # v1
with:
crystal: ${{ matrix.crystal }}


- name: Cache shards
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cache/shards
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
crystal build src/amber_lsp.cr --release --no-debug -o amber_lsp

- name: Upload binary artifacts (Linux)
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: matrix.os == 'ubuntu-latest'
with:
name: amber-cli-linux
Expand All @@ -91,15 +91,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
uses: crystal-lang/install-crystal@d8ef131ecec0352ce0e39b81b0a6d95def58fe2f # v1
with:
crystal: latest

- name: Restore tested shard cache
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cache/shards
Expand Down Expand Up @@ -130,10 +130,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
uses: crystal-lang/install-crystal@d8ef131ecec0352ce0e39b81b0a6d95def58fe2f # v1
with:
crystal: latest

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
uses: crystal-lang/install-crystal@d8ef131ecec0352ce0e39b81b0a6d95def58fe2f # v1
with:
crystal: latest

Expand All @@ -49,11 +49,11 @@ jobs:

- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v5
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5

- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: ./docs

Expand All @@ -68,4 +68,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
4 changes: 2 additions & 2 deletions .github/workflows/platform-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: scripts/smoke_generated_web.sh ./amber

windows-x86-64:
name: Windows x86_64 generated web app (merged framework fix)
name: Windows x86_64 generated web app
runs-on: windows-latest
steps:
- name: Checkout code
Expand All @@ -57,4 +57,4 @@ jobs:

- name: Compile generated Amber V2 web app
shell: pwsh
run: scripts/smoke_generated_web.ps1 ./amber.exe d044ea05e884b3247fd2af00859bde272aab676a
run: scripts/smoke_generated_web.ps1 ./amber.exe
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.ref }}

- name: Install Crystal (Linux)
if: startsWith(matrix.target, 'linux-')
uses: crystal-lang/install-crystal@v1
uses: crystal-lang/install-crystal@d8ef131ecec0352ce0e39b81b0a6d95def58fe2f # v1
with:
crystal: latest

Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
echo "sha256=$(cat amber_cli-${{ matrix.target }}.tar.gz.sha256 | cut -d' ' -f1)" >> $GITHUB_OUTPUT

- name: Upload artifact
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: amber_cli-${{ matrix.target }}
path: |
Expand All @@ -127,7 +127,7 @@ jobs:

steps:
- name: Download all artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: artifacts

Expand All @@ -151,7 +151,7 @@ jobs:
done

- name: Upload release assets
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@c12583777ecdfd3be55c69cf75464299dc01057e # v3
with:
files: |
artifacts/amber_cli-darwin-arm64/amber_cli-darwin-arm64.tar.gz
Expand All @@ -173,15 +173,15 @@ jobs:

steps:
- name: Dispatch to underscore tap (homebrew-amber_cli)
uses: peter-evans/repository-dispatch@v4
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
with:
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
repository: amberframework/homebrew-amber_cli
event-type: release-published
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'

- name: Dispatch to hyphen tap (homebrew-amber-cli)
uses: peter-evans/repository-dispatch@v4
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
with:
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
repository: amberframework/homebrew-amber-cli
Expand Down
65 changes: 29 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
[![GitHub release](https://img.shields.io/github/release/amberframework/amber_cli.svg)](https://github.com/amberframework/amber_cli/releases)
[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://amberframework.github.io/amber_cli/)

Amber CLI is the standalone command-line companion for Amber V2. CLI `2.0.3`
creates the supported Amber `2.0.0-beta.2` ECR web application and includes
Amber CLI is the standalone command-line companion for Amber V2. CLI `2.0.4`
creates the supported Amber `2.0.0-beta.3` ECR web application and includes
development, generator, database, and LSP tooling.

Amber V2 is a beta. The release-gated path is a web application on Apple
Silicon macOS or x86_64 Linux. Linux ARM64 generated-app compilation is checked
in CI; its first direct archive will ship with the next CLI release. See [Generator support](docs/GENERATOR_SUPPORT.md)
before relying on persistence, authentication, API-resource, or native output.
before relying on authentication, API-resource, or native output.

## Install

Expand All @@ -31,13 +31,12 @@ the `amber_cli` formula.

### Direct release archive

CLI `2.0.3` publishes `darwin-arm64` for Apple Silicon macOS and
`linux-x86_64` for x86_64 Linux. The release workflow now also builds
`linux-arm64`; that archive becomes available with the next published CLI
version.
CLI `2.0.4` publishes `darwin-arm64`, `linux-x86_64`, and `linux-arm64`
archives. Windows x86-64 is compiled in CI but does not yet have a release
archive.

```bash
version=v2.0.3
version=v2.0.4
platform=darwin-arm64
asset="amber_cli-${platform}.tar.gz"

Expand All @@ -52,27 +51,6 @@ amber --version
On Linux, use `sha256sum -c` for the checksum. Prefix only the `install`
command with `sudo` if `/usr/local/bin` is not writable.

### Linux ARM64 source install for 2.0.3

CLI `2.0.3` does not contain a `linux-arm64` archive. On an ARM64 Linux host,
build that tagged source instead of downloading the x86_64 binary:

```bash
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
git clone --branch v2.0.3 --depth 1 https://github.com/amberframework/amber_cli.git
cd amber_cli
shards install --production
crystal build src/amber_cli.cr -o amber --release
crystal build src/amber_lsp.cr -o amber-lsp --release
sudo install -m 0755 amber amber-lsp /usr/local/bin/
amber --version
```

Run the clone command from a directory where the temporary `amber_cli/`
checkout can be created. The next CLI release workflow now builds and smoke
tests a native `linux-arm64` archive on a GitHub-hosted ARM64 Linux runner.

## Create and verify a web app

```bash
Expand All @@ -89,15 +67,30 @@ workflow needs to run `shards install` later. Open <http://127.0.0.1:3000> and

The web template is deliberately small:

- Amber from `amberframework/amber`, pinned to `2.0.0-beta.2`
- Amber from `amberframework/amber`, pinned to `2.0.0-beta.3`
- ECR views (Slang and Kilt are not supported in Amber V2)
- typed development, test, and production YAML
- branded homepage, controller spec, and static CSS/JavaScript
- a browser-native import map with a local JavaScript module entry point
- no ORM or database driver by default
- Grant ORM, Micrate-powered migration commands, and the selected database driver
- SQLite by default, so the first persisted feature needs no database server

The `-d pg|mysql|sqlite` option selects the generated driver, connection, and
development/test URLs. SQLite is the default; PostgreSQL and MySQL expect their
respective local servers or a `DATABASE_URL`.

Create the first complete resource and its database table:

```bash
amber generate scaffold Pet name:string:required species:string:required adopted:bool
amber database migrate
amber watch
```

The `-d pg|mysql|sqlite` option records metadata and suggested URLs for future
persistence tooling. It does not add an ORM or driver to the core web app.
The generator writes the Grant model to `src/models/pet.cr`, the request schema
to `src/schemas/pet_schema.cr`, the controller to
`src/controllers/pet_controller.cr`, ECR views to `src/views/pet/`, a Micrate
SQL migration to `db/migrations/`, and the resource route to `config/routes.cr`.

## Commands

Expand All @@ -107,8 +100,8 @@ persistence tooling. It does not add an ORM or driver to the core web app.
| `amber watch` | Supported | Rebuild and restart during development |
| `amber routes` | Supported | Inspect application routes |
| `amber pipelines` | Supported | Inspect configured pipelines |
| `amber generate` | Mixed | Core generators supported; dependency-backed generators preview |
| `amber database` | Preview for new apps | Requires an explicitly configured persistence stack |
| `amber generate` | Mixed | Model, scaffold, migration, and core generators supported; auth and API preview |
| `amber database` | Supported | Apply, roll back, inspect, redo, and seed the generated database |
| `amber new APP --type native` | Preview | Not part of the beta platform guarantee |
| `amber setup:lsp` | Available | Configure the bundled diagnostics LSP |

Expand Down Expand Up @@ -143,7 +136,7 @@ The release archive includes `amber-lsp`. From an Amber project:
amber setup:lsp
```

See the [LSP setup guide](https://github.com/amberframework/amber/blob/v2.0.0-beta.2/docs/guides/lsp-setup.md).
See the [LSP setup guide](https://github.com/amberframework/amber/blob/v2.0.0-beta.3/docs/guides/lsp-setup.md).

## Contributing

Expand Down
39 changes: 39 additions & 0 deletions RELEASE_NOTES_V2.0.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Amber CLI 2.0.4

Amber CLI 2.0.4 makes persistence part of the supported Amber V2 web-app path.
A new application includes Grant ORM, SQLite, typed database settings, and
Micrate-powered database commands by default.

## Start a database-backed app

```bash
amber new pet_tracker --type web
cd pet_tracker
amber generate scaffold Pet name:string:required species:string:required adopted:bool
amber database migrate
amber watch
```

Open <http://127.0.0.1:3000/pets/new>. The generated resource includes a Grant
model, request schema, HTML CRUD controller, ECR views, specs, resource route,
and reversible SQL migration. SQLite keeps the first run self-contained; pass
`-d pg` or `-d mysql` to `amber new` for a server database.

## What changed

- Added Grant and the selected database driver to every generated web app.
- Made SQLite the default database and connected development, test, and
production settings through `config/database.cr`.
- Embedded Micrate in `amber database` for migrations, status, rollback, redo,
reset, and seeding.
- Promoted model, scaffold, and migration generation to the supported beta path.
- Corrected scaffold forms, optional fields, resource routes, and form-body
handling so generated create and update requests persist successfully.
- Added a release smoke test that generates a Pet resource, migrates both test
and development databases, runs its specs, boots the app, creates a Pet, and
updates it through the generated HTML forms.
- Added a native Linux ARM64 release artifact and a Windows x86-64 generated-app
compile gate.

Amber V2 native applications, generated authentication, and generated APIs
remain preview surfaces in this release.
Loading
Loading