Skip to content

Commit

Permalink
Merge branch 'master' into locales
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Aug 8, 2023
2 parents 92833ca + 2ee1c70 commit 5e9eef7
Show file tree
Hide file tree
Showing 110 changed files with 6,157 additions and 63 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# We are using crystal as image we are building the binary on
FROM crystallang/crystal:1.8.2-alpine AS build
FROM crystallang/crystal:1.9.1-alpine AS build

# Create a build directory and set it as default
RUN mkdir -p /opt/mint
Expand Down
2 changes: 1 addition & 1 deletion shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ shards:

ameba:
git: https://github.com/crystal-ameba/ameba.git
version: 1.4.3+git.commit.8c9d234d0b06d945d0cf841dfa0596734acc715c
version: 1.5.0

backtracer:
git: https://github.com/sija/backtracer.cr.git
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
development_dependencies:
ameba:
github: crystal-ameba/ameba
branch: master
version: ~> 1.5.0

targets:
mint:
Expand Down
102 changes: 102 additions & 0 deletions spec/compilers/provider_with_items
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
record Subscription {
a : Bool,
b : Bool
}

provider Provider : Subscription {
const NAME = "hello"

state a : String = ""

get b : String {
a
}

fun name : String {
NAME
}
}

component Main {
use Provider {
a: true,
b: false
}

fun render {
<div/>
}
}
--------------------------------------------------------------------------------
const A = _R({
a: [
"a",
Decoder.boolean
],
b: [
"b",
Decoder.boolean
]
});

const B = new(class extends _P {
constructor() {
super();

this.state = {
c: ``
};

this._d({
b: () => {
return `hello`
}
});
}

get c() {
return this.state.c;
}

get d() {
return this.c
}

a() {
return this.b;
}
});

class C extends _C {
componentWillUnmount() {
B._unsubscribe(this);
}

componentDidUpdate() {
if (true) {
B._subscribe(this, new A({
a: true,
b: false
}))
} else {
B._unsubscribe(this)
};
}

componentDidMount() {
if (true) {
B._subscribe(this, new A({
a: true,
b: false
}))
} else {
B._unsubscribe(this)
};
}

render() {
return _h("div", {});
}
};

C.displayName = "Main";
24 changes: 24 additions & 0 deletions spec/formatters/constant_provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
record Subscription {
a : Bool
}

provider Provider:Subscription {
/* Comment */constNAME="hello"

fun name:String {
NAME
}
}
--------------------------------------------------------------------------------
record Subscription {
a : Bool
}

provider Provider : Subscription {
/* Comment */
const NAME = "hello"

fun name : String {
NAME
}
}
34 changes: 34 additions & 0 deletions spec/formatters/provider_with_items
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
record Subscription {
a : Bool
}

provider Provider:Subscription {
/* Comment */constNAME="hello"

state a :String = ""
getb:String {
a
}
fun name:String {
NAME
}
}
--------------------------------------------------------------------------------
record Subscription {
a : Bool
}

provider Provider : Subscription {
/* Comment */
const NAME = "hello"

state a : String = ""

get b : String {
a
}

fun name : String {
NAME
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
global component Header {
const TITLE = "Mint"

fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header:TITLE }>
</div>
}
}
------------------------------------------------------------------file test.mint
{
"id": 0,
"method": "initialize",
"params": {
"capabilities": {
"textDocument": {
"definition": {
"linkSupport": false
}
}
}
}
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"id": 1,
"params": {
"textDocument": {
"uri": "file://#{root_path}/test.mint"
},
"position": {
"line": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 8
},
"end": {
"line": 1,
"character": 13
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
global component Header {
fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header.render() }>
</div>
}
}
------------------------------------------------------------------file test.mint
{
"id": 0,
"method": "initialize",
"params": {
"capabilities": {
"textDocument": {
"definition": {
"linkSupport": false
}
}
}
}
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"id": 1,
"params": {
"textDocument": {
"uri": "file://#{root_path}/test.mint"
},
"position": {
"line": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 6
},
"end": {
"line": 1,
"character": 12
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
global component Header {
get title : String {
"Mint"
}

fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header.title }>
</div>
}
}
------------------------------------------------------------------file test.mint
{
"id": 0,
"method": "initialize",
"params": {
"capabilities": {
"textDocument": {
"definition": {
"linkSupport": false
}
}
}
}
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"id": 1,
"params": {
"textDocument": {
"uri": "file://#{root_path}/test.mint"
},
"position": {
"line": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 6
},
"end": {
"line": 1,
"character": 11
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Loading

0 comments on commit 5e9eef7

Please sign in to comment.