Skip to content

Commit

Permalink
Update to Gleam 1.3.0 (#8)
Browse files Browse the repository at this point in the history
NIX CHANGES: Add support and tests for arithmetic operators in guards; replace foo/bar with wibble/wobble.


* fix confusing append error message

* CHANGELOG!

* Add test

* fix-3210

* Bump vec1 from 1.12.0 to 1.12.1

Bumps [vec1](https://github.com/rustonaut/vec1) from 1.12.0 to 1.12.1.
- [Changelog](https://github.com/rustonaut/vec1/blob/nightly/CHANGELOG.md)
- [Commits](https://github.com/rustonaut/vec1/commits/v1.12.1)

---
updated-dependencies:
- dependency-name: vec1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump insta from 1.38.0 to 1.39.0

Bumps [insta](https://github.com/mitsuhiko/insta) from 1.38.0 to 1.39.0.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](mitsuhiko/insta@1.38.0...1.39.0)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump spdx from 0.10.4 to 0.10.6

Bumps [spdx](https://github.com/EmbarkStudios/spdx) from 0.10.4 to 0.10.6.
- [Release notes](https://github.com/EmbarkStudios/spdx/releases)
- [Changelog](https://github.com/EmbarkStudios/spdx/blob/main/CHANGELOG.md)
- [Commits](EmbarkStudios/spdx@0.10.4...0.10.6)

---
updated-dependencies:
- dependency-name: spdx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update annoyances

* wip warn for redundant capture

* move code to its own function

* CHANGELOG!

* clippy!

* ci: remove wasm from nightly and add to release

* Fix bug with redundant capture warning

* Add `maybe` as a reserved word for Erlang compile target
`maybe` is reserved as of Erlang/OTP 27.
See https://www.erlang.org/doc/system/expressions.html#maybe for more info.

* update test snapshot

* changelog

* Changes!

* Suggest reduntant tuple action if case has a catch all discard

* CHANGELOG

* Use better names

* Fix bug with offset

* fix excessive `gleam.mjs` generation

This patch fixes excessive generation by checking if `modules` is empty.

Two other possible solutions have been ruled out:

- Checking for file existence may result in not updating outdated files
- Comparing contents is slow

* Revert "fix excessive `gleam.mjs` generation"

This reverts commit 50d7a90b3328298b3d370190abea9b8f49c83fde.

* Fix compiler crash when defining duplicate types

* Add fix to changelog

* Add tests for redefinition of imported types

* Format

* initial implementation for completing importable modules

* changelog

* add import above first import instead of top of file

* Add module name to completion

* completions now always include text edits and use previous word to improve suggestions

take into account phrase following cursor

changelog

* feedback

* snapshot tests

* lints

* move completions out to own module

* lifetimes

* fix bug with module names

* use equality and fix bugs for module select

* Add annotation printer in language server

* Minor Fixes and more unit tests

* Remove unnecessary module prefix in type annotations and add more tests

* Clean up docs and names

* Extract TypeNames struct

* Move type name finding to TypeNames

* Simplify interface

* Simplify API more

* Simplify, qualify types not in scope

* Create functional interface

* Fix collision bug

* Clippy

* Rename

* Update content width of built docs to avoid horizontal scrolling

* Fix #3279

* Return error when package not exist

* Remove unused function

* Format

* Tweak wording

* Changes!

* Try to compile time error when trying to make non byte aligned array on js

Try to detect when someone tries to make a non byte aligned array on Javascript.
This compile time error still fails to trigger if the size value is a variable though.
So we still need the runtime error in the Javascript template too.

Fixes #1591

* Log the change

* Add Tests for Negative Sized Bit Arrays

It seems our current behaviour is to assume a negative size really means a size of 0 so might as well document this with some tests

* rename tests

* gleam 1.3.0

feat: add error message for trying to match after a spread


fix: typo

chore: add changelog

fix: pr changes

chore: update changelog

fix: handle the parsing better to fully match a list pattern

chore: update changelog

fix: change test case and cleanup

Changes!

Alter error copy

basic statement level fault tolerance

changelog

more tests

handle patterns

fix for unsupported public function

Changes!

Fix JS const bug

Closes 3294

Further tests

Snaps

wip warn for deprecated prepend syntax

fix-3108

CHANGELOG!

Add missing contributor to changelog

Fix wrong warning wording

Remove additional fields from list

Remove additional fields from list pattern

Prepare things before big refactoring

Emit parsing warnings

Rephrase changelog entry

Use better name for parser function

Use WarningEmitter instead of TypeWarningEmitter

Fix #3288

fix excessive `gleam.mjs` generation

This patch fixes excessive generation by checking for file existence.

An earlier attempt (#3238) had done this by checking for empty `modules`,
noting in its commit message that file existence checks will cause old
`gleam.mjs` to never be updated when a new version is available. I have
since learned that that was incorrect, as new versions of `gleam` delete
`build` folders created by previous versions.

closes #3178

Changes!

Add else to Erlang's reserved keywords

Rename method

fix-3250

Support arithmetic in guards

Add to CHANGELOG.md

Add failing test for module import alias used in case expr

It is failing but it shouldn't. It is used so there shouldn't be any
warnings.

Remove module alias from 'unused' when used

This comes up in case-expressions. Without this case we get a warning
as covered by the test in the last commit.

This change is a best guess and it fixes the test. It is not based on
any understanding of the code base.

Add changelog entry

Adjust test name and add link to original issue

For clarity. I'm not sure that previous name was particularly clear.

feat: handle pubgrub compatible versions at package download

feat: update version parser at package download to use @ as delimiter and map to pubgrub ranges

test: error handling of version specifier parser

fix: typo in err msg of InvalidVersionFormat

refac: rename hex requirement parser

refac: break down multiple asserts for parse_hex_requirement into separate tests

refac: address clippy errors on indexing_slicing

chore: update changelog

Use @1 in README

improved lsp rendering of extra labels and added locations to cycled imports

changelog

move diagnostics to be subdiagnostic

move diagnostics to be subdiagnostic

write dependency srcspans to metadata

restructure to Vec1 of tuple

feedback

Wrap text

Do not autocomplete if cursor is in a comment

Add tests

Do not provide completions on empty comment

Move comment context detection for ignoring autocompletion to `is_within_comment`

Changes!

Add Information About Found Token in UnexpectedToken Error Type (#3299)


Alter error

Annotate javascript constants as pure

Make sure lists constructors are annotated as pure

Replace with_spread with spread location

Display missing fields

clippy!

CHANGELOG!

Avoid needless clones

v1.3.0-rc1

Remove unclear example

Update to macos-12 in release-nightly and release

macos-11 was deprecated 2 days ago leaving the nightly release job
hanging with no error message lol.

mentioned in 2 places, apparently:
- https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/
- https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job

Fix typo in changelog
Remove all foo-bar-baz from code

Turn LS tests into snapshot tests

replace raw Positions with PositionFinder

allow assert_hover macro to accept literal string

Remove references to the term 'pointer'

Fix wrong formatting of case subjects

bump all macos runners to latest compatible versions

macos 13 for x64

Bump oven-sh/setup-bun from 1 to 2

Bumps [oven-sh/setup-bun](https://github.com/oven-sh/setup-bun) from 1 to 2.
- [Release notes](https://github.com/oven-sh/setup-bun/releases)
- [Commits](oven-sh/setup-bun@v1...v2)

---
updated-dependencies:
- dependency-name: oven-sh/setup-bun
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bump docker/build-push-action from 5 to 6

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Fixed spelling mistake in function get_module_inferface -> get_module_interface

Make sure all constants inside a module constant definition are marked as pure

CHANGELOG!

Review comments

v1.3.0-rc3

Correct message

v1.3.0

* fix compilation of nix modules

* foo -> wibble, bar -> wobble

* update flake hash

* nix: add case clause guard arithmetic tests

* Update deps to fix build for new Rust

* update cargo lock hash

* alright clippy

---------

Co-authored-by: Giacomo Cavalieri <giacomo.cavalieri@icloud.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Louis Pilfold <louis@lpil.uk>
Co-authored-by: bgw <bgw@bgw.dev>
Co-authored-by: Jake Barszcz <jfbarszcz@gmail.com>
Co-authored-by: Ofek Doitch <Ofek@WeedonAndScott.com>
Co-authored-by: GearsDatapacks <surya@seriousinfinitude.com>
Co-authored-by: Ace <therespie@gmail.com>
Co-authored-by: Om Prakaash <omsuseela@gmail.com>
Co-authored-by: Richard Viney <richard.viney@gmail.com>
Co-authored-by: Changfeng Lou <louchangfeng@shuimuyulin.com>
Co-authored-by: Pi-Cla <pirateclip@protonmail.com>
Co-authored-by: Ameen Radwan <ameen_radwan@intuit.com>
Co-authored-by: Antonio Iaccarino <antonio.iaccarino@gmail.com>
Co-authored-by: Danielle Maywood <danielle@themaywoods.com>
Co-authored-by: djaruun <caargajac@gmail.com>
Co-authored-by: graphiteisaac <mrminer2229.galaxycraft@gmail.com>
Co-authored-by: Michael Jones <m.pricejones@gmail.com>
Co-authored-by: Nicky Lim <nickylim.p@gmail.com>
Co-authored-by: Rahul D. Ghosal <RDGhosal@gmail.com>
Co-authored-by: Robert Attard <robert.attard@mail.mcgill.ca>
Co-authored-by: TankorSmash <tankorsmash+github@gmail.com>
  • Loading branch information
23 people authored Jul 28, 2024
1 parent 5cfe162 commit 905b9e7
Show file tree
Hide file tree
Showing 396 changed files with 16,303 additions and 3,499 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ jobs:
use-cross: true
run-integration-tests: false # Cannot run aarch64 binaries on x86_64
supports-nix: true
- os: macos-12 # intel
# macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
- os: macos-13 # intel
target: x86_64-apple-darwin
use-cross: false
run-integration-tests: true
supports-nix: true
- os: macos-14 # aarch64
- os: macos-latest # aarch64
toolchain: stable
target: aarch64-apple-darwin
use-cross: false
Expand Down Expand Up @@ -517,7 +518,7 @@ jobs:
deno-version: v1.x

- name: Install Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2

- name: Install Erlang
uses: erlef/setup-beam@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
mv glistix glistix-arm64
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down
48 changes: 46 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ jobs:
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
use-cross: true
- os: macos-latest
# macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
- os: macos-13
target: x86_64-apple-darwin
use-cross: false
- os: macos-11
- os: macos-latest
target: aarch64-apple-darwin
use-cross: false
- os: windows-latest
Expand Down Expand Up @@ -108,3 +109,46 @@ jobs:
${{ env.ASSET }}
${{ env.ASSET }}.sha256
${{ env.ASSET }}.sha512
build-release-wasm:
name: build-release-wasm
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
profile: minimal
override: true

- name: Install wasm-pack
run: curl -sSL https://rustwasm.github.io/wasm-pack/installer/init.sh | sh

- name: Build wasm
run: wasm-pack build --release --target web compiler-wasm

- name: Build wasm archive
run: |
VERSION="${GITHUB_REF#refs/tags/}"
ARCHIVE="glistix-$VERSION-browser.tar.gz"
tar -C compiler-wasm/pkg/ -czvf $ARCHIVE .
openssl dgst -r -sha256 -out "$ARCHIVE".sha256 "$ARCHIVE"
openssl dgst -r -sha512 -out "$ARCHIVE".sha512 "$ARCHIVE"
echo "ASSET=$ARCHIVE" >> $GITHUB_ENV
- name: Upload release archive
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
fail_on_unmatched_files: true
files: |
${{ env.ASSET }}
${{ env.ASSET }}.sha256
${{ env.ASSET }}.sha512
18 changes: 1 addition & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gleam's Changelog

## v1.3.0 - Unreleased
## Unreleased

### Build tool

Expand All @@ -11,19 +11,3 @@
### Language Server

### Bug Fixes


## v1.2.1 - 2024-05-30

### Bug Fixes

- Fixed a bug where the compiler could fail to detect modules that would clash
with Erlang modules.
([Louis Pilfold](https://github.com/lpil))

- Fixed a bug where dependency version resolution could crash for certain
release candidate versions.
([Marshall Bowers](https://github.com/maxdeviant))

- Fixed a bug where trailing comments would be moved out of a bit array.
([Giacomo Cavalieri](https://github.com/giacomocavalieri))
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ javascript-prelude-test-watch: ## Run the JavaScript prelude core tests when fil

.PHONY: test-watch
test-watch: ## Run compiler tests when files change
watchexec --changes-only -e rs,toml,gleam,html,capnp "cargo test --quiet"
watchexec -e rs,toml,gleam,html,capnp "cargo test --quiet"

.PHONY: export-hex-tarball-test
export-hex-tarball-test: ## Run `gleam export hex-tarball` and verify it is created
Expand Down
Loading

0 comments on commit 905b9e7

Please sign in to comment.