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
11 changes: 3 additions & 8 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ jobs:
- uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install released Norm
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download v0.25.3 --repo normlanguage/Norm --pattern norm-v0.25.3-linux-x64.tar.gz --pattern SHA256SUMS --dir "$RUNNER_TEMP/norm-cli"
(cd "$RUNNER_TEMP/norm-cli" && grep ' norm-v0.25.3-linux-x64.tar.gz$' SHA256SUMS | sha256sum --check --strict)
tar -xzf "$RUNNER_TEMP/norm-cli/norm-v0.25.3-linux-x64.tar.gz" -C "$RUNNER_TEMP/norm-cli"
echo "$RUNNER_TEMP/norm-cli/norm/bin" >> "$GITHUB_PATH"
- uses: normlanguage/registry/.github/actions/setup-norm@90b4d247fa4f5f2b620924d2cbc0553e89843700
with:
version: 0.27.23
- name: Verify package behavior
run: node scripts/verify.mjs

Expand Down
2 changes: 1 addition & 1 deletion java-commons-lang/app/module.norm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Module module() {
name: "app",
version: 1,
exports: ["Main"],
dependencies: [dependency(repository: "github", name: "commons.lang", version: 3)]
dependencies: [dependency(repository: "github", name: "commons.lang", version: 5)]
)
}
2 changes: 1 addition & 1 deletion java-commons-lang/object/app/module.norm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Module module() {
name: "object.app",
version: 1,
exports: ["Main"],
dependencies: [dependency(repository: "github", name: "commons.lang", version: 3)]
dependencies: [dependency(repository: "github", name: "commons.lang", version: 5)]
)
}
17 changes: 8 additions & 9 deletions micronaut-bbs/app/sample/bbs/Domain.norm
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import micronaut.core.annotation.IntrospectedAccessKind
import micronaut.serde.api.annotation.Serdeable
import orm.Column
import orm.Entity
import orm.Generated
import orm.GenerationStrategy
import orm.GeneratedValue
import orm.GenerationType
import orm.Id
import orm.Table
import std.collections.MutableList

@Serdeable()
@Introspected(accessKind: [IntrospectedAccessKind.FIELD])
Expand All @@ -36,7 +35,7 @@ public class Registration {
@Table(name: "bbs_users")
public class UserEntity {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false, unique: true)
Expand Down Expand Up @@ -66,7 +65,7 @@ public class UserEntity {
@Table(name: "bbs_sessions")
public class SessionEntity {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false, unique: true)
Expand Down Expand Up @@ -96,7 +95,7 @@ public class SessionEntity {
@Table(name: "bbs_boards")
public class BoardEntity {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false)
Expand All @@ -120,7 +119,7 @@ public class BoardEntity {
@Table(name: "bbs_topics")
public class TopicEntity {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false)
Expand Down Expand Up @@ -161,7 +160,7 @@ public class TopicEntity {
@Table(name: "bbs_replies")
public class ReplyEntity {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false)
Expand Down Expand Up @@ -209,7 +208,7 @@ public class TopicPageable {
@Serdeable()
@Introspected(accessKind: [IntrospectedAccessKind.FIELD])
public class TopicPage {
MutableList<TopicEntity?>? content
List<TopicEntity?>? content

TopicPageable pageable

Expand Down
11 changes: 5 additions & 6 deletions micronaut-bbs/app/sample/bbs/Web.norm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import micronaut.serde.api.annotation.Serdeable
import micronaut.validation.Validated
import sample.bbs.service.AccountService
import sample.bbs.service.ForumService
import std.collections.MutableList

@Serdeable()
@Introspected(accessKind: [IntrospectedAccessKind.FIELD])
Expand Down Expand Up @@ -56,11 +55,11 @@ class BbsSessionFilter {
@RequestFilter()
@Nullable()
HttpResponse<Any?>? filter(HttpRequest<Any?> request) {
String? token = request.getHeaders()?.findFirst("X-Session")
String? token = request.getHeaders()?.findFirst("X-Session")?.orElse(null)
if token != null && !accounts.usernameForToken(token).isEmpty() {
return null
}
return httpResponseUnauthorized<Any>()
return httpResponseUnauthorized<Any?>()
}
}

Expand Down Expand Up @@ -88,7 +87,7 @@ class BbsController {
}

@Get("/boards")
MutableList<BoardEntity?>? boards() {
List<BoardEntity?>? boards() {
return forumService.allBoards()
}

Expand Down Expand Up @@ -136,7 +135,7 @@ class BbsController {
}

@Get("/topics/{id}/replies")
MutableList<ReplyEntity?>? replies(Long id) {
List<ReplyEntity?>? replies(Long id) {
return forumService.repliesForTopic(id)
}

Expand All @@ -146,7 +145,7 @@ class BbsController {
}

private String sessionUsername(HttpRequest<Any?> request) {
String? token = request.getHeaders()?.findFirst("X-Session")
String? token = request.getHeaders()?.findFirst("X-Session")?.orElse(null)
return accountService.usernameForToken(token ?? "")
}
}
6 changes: 3 additions & 3 deletions micronaut-bbs/app/sample/bbs/module.norm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Module module() {
name: "sample.bbs",
version: 1,
dependencies: [
dependency(repository: "github", name: "micronaut.web", version: 9),
dependency(repository: "github", name: "orm.micronaut.tx", version: 5),
dependency(repository: "github", name: "h2.database", version: 2)
dependency(repository: "github", name: "micronaut.web", version: 11),
dependency(repository: "github", name: "orm.micronaut.tx", version: 11),
dependency(repository: "github", name: "h2.database", version: 3)
]
)
}
3 changes: 1 addition & 2 deletions micronaut-bbs/app/sample/bbs/repository/ReplyRepository.norm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import micronaut.inject.context.annotation.Prototype
import orm.Repository
import orm.RepositoryContext
import sample.bbs.ReplyEntity
import std.collections.MutableList

@Prototype()
public class ReplyRepository extends Repository<ReplyEntity, Long> {
Expand All @@ -14,7 +13,7 @@ public class ReplyRepository extends Repository<ReplyEntity, Long> {
super(context)
}

public MutableList<ReplyEntity?>? findByTopic(Long topicId) {
public List<ReplyEntity?>? findByTopic(Long topicId) {
return this.findWhereOrdered<Long, Long?>(
field: ReplyEntity.topicId.field,
value: topicId,
Expand Down
5 changes: 2 additions & 3 deletions micronaut-bbs/app/sample/bbs/service/ForumService.norm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import sample.bbs.TopicSort
import sample.bbs.repository.BoardRepository
import sample.bbs.repository.ReplyRepository
import sample.bbs.repository.TopicRepository
import std.collections.MutableList

@Prototype()
public class ForumService {
Expand Down Expand Up @@ -54,7 +53,7 @@ public class ForumService {
}

@Transactional()
public MutableList<BoardEntity?>? allBoards() {
public List<BoardEntity?>? allBoards() {
return boards.findAll()
}

Expand All @@ -64,7 +63,7 @@ public class ForumService {
}

@Transactional()
public MutableList<ReplyEntity?>? repliesForTopic(Long topicId) {
public List<ReplyEntity?>? repliesForTopic(Long topicId) {
return replies.findByTopic(topicId)
}

Expand Down
12 changes: 6 additions & 6 deletions micronaut-single-file/web.norm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import micronaut.web.MicronautConfig
import micronaut.web.SchemaMode
import orm.Column
import orm.Entity
import orm.Generated
import orm.GenerationStrategy
import orm.GeneratedValue
import orm.GenerationType
import orm.Id
import orm.Repository
import orm.RepositoryContext
Expand All @@ -22,9 +22,9 @@ import std.core.Result
Module module() {
return module(
dependencies: [
dependency(repository: "github", name: "micronaut.web", version: 9),
dependency(repository: "github", name: "orm.micronaut.tx", version: 5),
dependency(repository: "github", name: "h2.database", version: 2)
dependency(repository: "github", name: "micronaut.web", version: 11),
dependency(repository: "github", name: "orm.micronaut.tx", version: 11),
dependency(repository: "github", name: "h2.database", version: 3)
]
)
}
Expand All @@ -35,7 +35,7 @@ class HelloEntity {
String name

@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id = null

HelloEntity(String name) {
Expand Down
12 changes: 6 additions & 6 deletions norm-orm/app/sample/orm/Main.norm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package sample.orm

import orm.Column
import orm.Entity
import orm.Fetch
import orm.Generated
import orm.GenerationStrategy
import orm.FetchType
import orm.GeneratedValue
import orm.GenerationType
import orm.Id
import orm.JoinColumn
import orm.ManyToOne
Expand All @@ -19,7 +19,7 @@ import orm.hibernate.builderNew
@Table(name: "accounts")
class Account {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false, unique: true)
Expand All @@ -40,13 +40,13 @@ class Account {
@Table(name: "posts")
class Post {
@Id()
@Generated(strategy: GenerationStrategy.IDENTITY)
@GeneratedValue(strategy: GenerationType.IDENTITY)
Long? id

@Column(nullable: false)
String title

@ManyToOne(fetch: Fetch.LAZY, optional: false)
@ManyToOne(fetch: FetchType.LAZY, optional: false)
@JoinColumn(name: "author_id", nullable: false)
Account author

Expand Down
6 changes: 3 additions & 3 deletions norm-orm/app/sample/orm/module.norm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Module module() {
version: 1,
exports: ["Main"],
dependencies: [
dependency(repository: "github", name: "orm", version: 3),
dependency(repository: "github", name: "orm.hibernate", version: 4),
dependency(repository: "github", name: "h2.database", version: 2)
dependency(repository: "github", name: "orm", version: 7),
dependency(repository: "github", name: "orm.hibernate", version: 8),
dependency(repository: "github", name: "h2.database", version: 3)
]
)
}