@yr-lang/yr 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUGS.md +35 -0
- package/CNAME +1 -0
- package/LICENSE +42 -0
- package/README.md +21 -0
- package/lib/%build.yr +3 -0
- package/lib/%deploy.yr +7 -0
- package/lib/%gh-pages.yr +60 -0
- package/lib/%nvm.yr +18 -0
- package/lib/%serve.yr +7 -0
- package/lib/.yrrc +2 -0
- package/lib/Ciyr/A1.yr +25 -0
- package/lib/Ciyr/B1.yr +11 -0
- package/lib/Ciyr/B2.yr +0 -0
- package/lib/Ciyr/C1.yr +14 -0
- package/lib/Ciyr/C2.yr +5 -0
- package/lib/Ciyr/C2_2.yr +5 -0
- package/lib/Ciyr/a1.yr +23 -0
- package/lib/Ciyr/b1.yr +21 -0
- package/lib/Ciyr/c1.yr +18 -0
- package/lib/Yrci/&app.yr +1 -0
- package/lib/Yrci/&app2.yr +1 -0
- package/lib/Yrci/@m1.yr +7 -0
- package/lib/Yrci/@m2.yr +11 -0
- package/lib/Yrci/A1.yr +8 -0
- package/lib/Yrci/A2.yr +26 -0
- package/lib/Yrci/A3.yr +51 -0
- package/lib/Yrci/B1.yr +8 -0
- package/lib/Yrci/C1.yr +58 -0
- package/lib/Yrci/C1.yrr +14 -0
- package/lib/Yrci/C2.yr +17 -0
- package/lib/Yrci/C3.yr +28 -0
- package/lib/Yrci/C4.yr +4 -0
- package/lib/Yrci/C5.yr +3 -0
- package/lib/Yrci/C6.yr +7 -0
- package/lib/Yrci/C7.yr +3 -0
- package/lib/Yrci/C8.yr +3 -0
- package/lib/Yrci/C9.yr +11 -0
- package/lib/Yrci/Index_.yr +4 -0
- package/lib/Yrci/Login.yr +3 -0
- package/lib/Yrci/M1.yr +7 -0
- package/lib/Yrci/Sp.yr +5 -0
- package/lib/Yrci/T1.yr +4 -0
- package/lib/Yrci/T2.yr +4 -0
- package/lib/Yrci/Ta1.yr +4 -0
- package/lib/Yrci/Ta2.yr +4 -0
- package/lib/Yrci/Tg.yr +5 -0
- package/lib/Yrci/Wr.yr +7 -0
- package/lib/Yrci/Wrapper.yr +14 -0
- package/lib/Yrci/Wrapper1.yr +5 -0
- package/lib/Yrci/Wrapper2.yr +24 -0
- package/lib/Yrci/Wrapper3.yr +5 -0
- package/lib/Yrci/Wrapperext.yr +4 -0
- package/lib/Yrci/Wrt.yr +3 -0
- package/lib/Yrci/Yrwm.yr +32 -0
- package/lib/Yrci/a1.yr +18 -0
- package/lib/Yrci/a2.yr +10 -0
- package/lib/Yrci/app.yr +3 -0
- package/lib/Yrci/b2.yr +10 -0
- package/lib/Yrci/j1.yr +5 -0
- package/lib/Yrci/j2.yr +5 -0
- package/lib/Yrci/j3.yr +3 -0
- package/lib/Yrci/modal.yr +5 -0
- package/lib/bodyblock.yr +13 -0
- package/lib/ci.yr +21 -0
- package/lib/crypto.yr +13 -0
- package/lib/element.yr +358 -0
- package/lib/hidden.yr +9 -0
- package/lib/utils.yr +13 -0
- package/node.js +807 -0
- package/package.json +14 -0
- package/src/common.js +7 -0
- package/yr.js +1308 -0
package/BUGS.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## Known Issues
|
|
2
|
+
|
|
3
|
+
This file documents known bugs and limitations in yr.
|
|
4
|
+
The project is under active development.
|
|
5
|
+
|
|
6
|
+
### Wrapper-only section closure can fail
|
|
7
|
+
|
|
8
|
+
In some cases, a section cannot be closed using only a wrapper, and must instead be closed explicitly with an element (_).
|
|
9
|
+
|
|
10
|
+
For example, the following may result in an error:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
++
|
|
14
|
+
_ .teste
|
|
15
|
+
_wrapper/test
|
|
16
|
+
_ .teste2
|
|
17
|
+
_wrapper/test2
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
However, explicitly closing the section with elements works as expected:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
++
|
|
24
|
+
_ .teste
|
|
25
|
+
_wrapper/test
|
|
26
|
+
_ .teste2
|
|
27
|
+
_wrapper/test2
|
|
28
|
+
_
|
|
29
|
+
_
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Notes
|
|
33
|
+
|
|
34
|
+
* This appears to be related to how section termination is detected when the last node is a wrapper.
|
|
35
|
+
* The parser may not recognize wrappers as valid closing tokens in some nesting scenarios.
|
package/CNAME
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cdn.yr-lang.org
|
package/LICENSE
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
yr Source-Available License
|
|
2
|
+
yr-lang™
|
|
3
|
+
Copyright (c) 2025 Matheus Araújo
|
|
4
|
+
|
|
5
|
+
1. Usage
|
|
6
|
+
Permission is granted to use this software, without modification,
|
|
7
|
+
as a dependency or tool to build, run, and commercialize your own
|
|
8
|
+
applications, services, or platforms.
|
|
9
|
+
|
|
10
|
+
2. Modifications
|
|
11
|
+
You may modify this software for internal or personal use.
|
|
12
|
+
Redistribution of modified versions is not permitted except
|
|
13
|
+
through contributions to the official yr-lang™ repositories.
|
|
14
|
+
|
|
15
|
+
3. Redistribution and Competition
|
|
16
|
+
You may not redistribute, sublicense, sell, or offer this software
|
|
17
|
+
or a modified version of it as a standalone product, service,
|
|
18
|
+
or as a competing language, runtime, toolchain, or platform.
|
|
19
|
+
|
|
20
|
+
4. Forking
|
|
21
|
+
Forking this software for public redistribution or commercial
|
|
22
|
+
purposes is prohibited.
|
|
23
|
+
|
|
24
|
+
Forks created for personal inspection, experimentation, or internal
|
|
25
|
+
use are permitted, provided they are not redistributed.
|
|
26
|
+
|
|
27
|
+
Contributions via pull requests to the official repositories
|
|
28
|
+
are allowed and encouraged.
|
|
29
|
+
|
|
30
|
+
5. Version Scope
|
|
31
|
+
This license applies only to the specific version obtained.
|
|
32
|
+
No rights to future versions are granted unless explicitly stated.
|
|
33
|
+
|
|
34
|
+
6. Contributions
|
|
35
|
+
By submitting a contribution, you grant the owner of the
|
|
36
|
+
yr-lang™ project a perpetual, worldwide, royalty-free right
|
|
37
|
+
to use, modify, relicense, and distribute your contribution.
|
|
38
|
+
|
|
39
|
+
7. Disclaimer
|
|
40
|
+
This software is provided "as is", without warranty of any kind.
|
|
41
|
+
The author is not responsible for any damages or issues resulting
|
|
42
|
+
from its use.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# `yr` - a lightweight multi-stack programming language
|
|
2
|
+
|
|
3
|
+
`yr` is a **domain-specific language (DSL)** designed to streamline multi-stack development projects. Built for frontend, backend, and DevOps workflows, it merges stacks such as HTML, CSS, JS, Bash, and Python into a single cohesive language. It eliminates the need for heavy frameworks and excessive boilerplate by using indentation-based syntax, reusable macros, and modular wrapper files.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
The goal of `yr` is to:
|
|
8
|
+
|
|
9
|
+
- Eliminate repetitive HTML and project boilerplate
|
|
10
|
+
- Provide reusable macros and components
|
|
11
|
+
- Enable seamless cross-stack scripting and code generation
|
|
12
|
+
- Offer a developer-friendly syntax based on indentation and triggers
|
|
13
|
+
- Simplify dev workflows across frontend, backend, and DevOps
|
|
14
|
+
|
|
15
|
+
# Documentation
|
|
16
|
+
|
|
17
|
+
For more information on how to use the `yr` API or syntax description with examples, read the [docs](https://github.com/yr-lang/docs) for concise explanation or [Yrci](https://github.com/yr-lang/yr/tree/main/lib/Yrci) for code snippets.
|
|
18
|
+
|
|
19
|
+
# License
|
|
20
|
+
|
|
21
|
+
Read the LICENSE for information on how to use or distribute this software. This license should always be available.
|
package/lib/%build.yr
ADDED
package/lib/%deploy.yr
ADDED
package/lib/%gh-pages.yr
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
**
|
|
2
|
+
|
|
3
|
+
___common
|
|
4
|
+
|
|
5
|
+
gh-pages() {
|
|
6
|
+
if [[ -z $1 ]]; then set -- "www"; fi
|
|
7
|
+
CNAME=$(echo $_CONFIG | jq -r .setters.web.cname)
|
|
8
|
+
|
|
9
|
+
cd $_PROJECT_PATH/
|
|
10
|
+
if [[ ! -d .git ]]; then
|
|
11
|
+
git_name=$(echo $_CONFIG | jq -r .config.deploy)
|
|
12
|
+
git clone https://github.com/mbinaryhost/$git_name
|
|
13
|
+
mv $git_name/.git .
|
|
14
|
+
rm -rf $git_name
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
git add .
|
|
18
|
+
git commit -m "# DEPLOY"
|
|
19
|
+
git push -f origin main
|
|
20
|
+
|
|
21
|
+
git branch -D gh-pages
|
|
22
|
+
git checkout -b gh-pages
|
|
23
|
+
|
|
24
|
+
mkdir aux/
|
|
25
|
+
mv {*,.[^.]*,..?*} aux/
|
|
26
|
+
mv aux/$1/{*,.[^.]*,..?*} aux/.git .
|
|
27
|
+
rm -rf aux/
|
|
28
|
+
|
|
29
|
+
echo $CNAME > CNAME
|
|
30
|
+
|
|
31
|
+
git add .
|
|
32
|
+
git commit -m "# DEPLOY"
|
|
33
|
+
git push -f origin gh-pages
|
|
34
|
+
git checkout main
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
gh-pages_fix() {
|
|
38
|
+
set -e
|
|
39
|
+
|
|
40
|
+
OWNER="mwhost"
|
|
41
|
+
REPO_NAME="QuEFR2eQhATKHYe"
|
|
42
|
+
REPO_URL="https://github.com/${OWNER}/${REPO_NAME}.git"
|
|
43
|
+
|
|
44
|
+
git init
|
|
45
|
+
git checkout --orphan gh-pages
|
|
46
|
+
|
|
47
|
+
git add .
|
|
48
|
+
git commit -m "# DEPLOY" || true
|
|
49
|
+
|
|
50
|
+
git remote remove origin 2>/dev/null || true
|
|
51
|
+
git remote add origin "$REPO_URL"
|
|
52
|
+
|
|
53
|
+
git push --force origin gh-pages
|
|
54
|
+
|
|
55
|
+
# Enable GitHub Pages (idempotent)
|
|
56
|
+
gh api repos/${OWNER}/${REPO_NAME}/pages \
|
|
57
|
+
-X PUT \
|
|
58
|
+
-F source.branch=gh-pages \
|
|
59
|
+
2>/dev/null || true
|
|
60
|
+
}
|
package/lib/%nvm.yr
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
**
|
|
2
|
+
|
|
3
|
+
___common
|
|
4
|
+
|
|
5
|
+
set_nvm() {
|
|
6
|
+
if [[ $(node -v) != "$1" ]]; then
|
|
7
|
+
export NVM_DIR=$HOME/.nvm
|
|
8
|
+
source $NVM_DIR/nvm.sh
|
|
9
|
+
|
|
10
|
+
if [[ $(nvm ls | grep $1) == "" ]]; then
|
|
11
|
+
nvm install $1
|
|
12
|
+
else
|
|
13
|
+
nvm use $1
|
|
14
|
+
fi
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [[ "$2" == "-i" ]] && [[ ! -d 'node_modules' ]]; then npm i; fi
|
|
18
|
+
}
|
package/lib/%serve.yr
ADDED
package/lib/.yrrc
ADDED
package/lib/Ciyr/A1.yr
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[[ attributes=["teste1", "teste2"]; setters=["ciyr:a1"]
|
|
2
|
+
!! @wrapper
|
|
3
|
+
|
|
4
|
+
++
|
|
5
|
+
|
|
6
|
+
_ .teste-a1
|
|
7
|
+
___ .teste-inner
|
|
8
|
+
_ .teste2
|
|
9
|
+
_a .teste-a href="oi"
|
|
10
|
+
_img .teste-img src="%/api/teste"
|
|
11
|
+
Teste A1
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
|
|
15
|
+
.teste-a1 {
|
|
16
|
+
min-height: 20px;
|
|
17
|
+
background: red;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@>
|
|
21
|
+
|
|
22
|
+
_@wrapper(Ciyr, A1) {
|
|
23
|
+
console.log('oiiii');
|
|
24
|
+
console.log(element._config, _config);
|
|
25
|
+
@}
|
package/lib/Ciyr/B1.yr
ADDED
package/lib/Ciyr/B2.yr
ADDED
|
File without changes
|
package/lib/Ciyr/C1.yr
ADDED
package/lib/Ciyr/C2.yr
ADDED
package/lib/Ciyr/C2_2.yr
ADDED
package/lib/Ciyr/a1.yr
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
><
|
|
2
|
+
|
|
3
|
+
_
|
|
4
|
+
_ciyr/a1 .teste1
|
|
5
|
+
Oi
|
|
6
|
+
_ciyr/a1 .teste2
|
|
7
|
+
_ .teste3
|
|
8
|
+
Boi
|
|
9
|
+
|
|
10
|
+
||
|
|
11
|
+
|
|
12
|
+
_
|
|
13
|
+
_ciyr/a1 .teste1
|
|
14
|
+
_ .teste
|
|
15
|
+
_ .teste-inner
|
|
16
|
+
Oi
|
|
17
|
+
_ .teste2
|
|
18
|
+
_ciyr/a1 .teste2
|
|
19
|
+
_ .teste
|
|
20
|
+
_ .teste-inner
|
|
21
|
+
_ .teste3
|
|
22
|
+
Boi
|
|
23
|
+
_ .teste2
|
package/lib/Ciyr/b1.yr
ADDED
package/lib/Ciyr/c1.yr
ADDED
package/lib/Yrci/&app.yr
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!! &api
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!! Yrci/&app
|
package/lib/Yrci/@m1.yr
ADDED
package/lib/Yrci/@m2.yr
ADDED
package/lib/Yrci/A1.yr
ADDED
package/lib/Yrci/A2.yr
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
!! Yrci/j1
|
|
2
|
+
|
|
3
|
+
@@
|
|
4
|
+
|
|
5
|
+
TesteA2
|
|
6
|
+
|
|
7
|
+
++
|
|
8
|
+
|
|
9
|
+
_ .a2-first
|
|
10
|
+
_ .a2-inner
|
|
11
|
+
___ .a2-inner-inner
|
|
12
|
+
_yrci/a1 .a2-a1
|
|
13
|
+
_ .a2
|
|
14
|
+
Oi tudo bem
|
|
15
|
+
_ .a2-a2
|
|
16
|
+
_ .inner-a2
|
|
17
|
+
_ .really-long-string \\
|
|
18
|
+
#matched-by-other-really-long-string \\
|
|
19
|
+
.yet-another-really-long-string
|
|
20
|
+
_
|
|
21
|
+
Teste
|
|
22
|
+
|
|
23
|
+
><
|
|
24
|
+
|
|
25
|
+
THIS SHOULD BE ON BODY
|
|
26
|
+
TESTE QUALQUEEEEER
|
package/lib/Yrci/A3.yr
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
><
|
|
2
|
+
|
|
3
|
+
_yrci/a2 .teste-upper
|
|
4
|
+
_ .teste
|
|
5
|
+
|
|
6
|
+
||
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
_!yrci/a2 .teste-upper
|
|
10
|
+
_ .a2-first
|
|
11
|
+
_ .a2-inner
|
|
12
|
+
___ .a2-inner-inner
|
|
13
|
+
_ .teste
|
|
14
|
+
_!yrci/a1 .a2-a1
|
|
15
|
+
_ .a1
|
|
16
|
+
___ .a1-inner
|
|
17
|
+
_ .a2
|
|
18
|
+
Oi tudo bem
|
|
19
|
+
_ .a2-a2
|
|
20
|
+
_ .inner-a2
|
|
21
|
+
_ .really-long-string \\
|
|
22
|
+
#matched-by-other-really-long-string \\
|
|
23
|
+
.yet-another-really-long-string
|
|
24
|
+
_
|
|
25
|
+
Teste
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<div class="teste-upper">
|
|
29
|
+
<div class="a2-first">
|
|
30
|
+
<div class="a2-inner">
|
|
31
|
+
<div class="a2-inner-inner">
|
|
32
|
+
<div class="teste"></div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="a2-a1">
|
|
36
|
+
<div class="a1">
|
|
37
|
+
<div class="a1-inner">
|
|
38
|
+
<div class="a2"></div>
|
|
39
|
+
<span>Oi tudo bem</span>
|
|
40
|
+
<div class="a2-a2">
|
|
41
|
+
<div class="inner-a2"></div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="really-long-string yet-another-really-long-string" id="matched-by-other-really-long-string"></div>
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<span>Teste</span>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
package/lib/Yrci/C1.yr
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[[ attributes=["teste"]; icon="code-slash"; teste="teste"
|
|
2
|
+
-- express, mongoose
|
|
3
|
+
!! Yrci/C2
|
|
4
|
+
|
|
5
|
+
""
|
|
6
|
+
|
|
7
|
+
# Yrci/C1
|
|
8
|
+
|
|
9
|
+
This is a teste example
|
|
10
|
+
|
|
11
|
+
# Should write md files here
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
|
|
15
|
+
middle
|
|
16
|
+
|
|
17
|
+
#<
|
|
18
|
+
|
|
19
|
+
footer
|
|
20
|
+
|
|
21
|
+
#>
|
|
22
|
+
|
|
23
|
+
header
|
|
24
|
+
|
|
25
|
+
==
|
|
26
|
+
|
|
27
|
+
pixel tags here
|
|
28
|
+
|
|
29
|
+
>>
|
|
30
|
+
|
|
31
|
+
_meta
|
|
32
|
+
|
|
33
|
+
><
|
|
34
|
+
|
|
35
|
+
_
|
|
36
|
+
_
|
|
37
|
+
|
|
38
|
+
<<
|
|
39
|
+
|
|
40
|
+
_
|
|
41
|
+
_
|
|
42
|
+
|
|
43
|
+
<>
|
|
44
|
+
|
|
45
|
+
_script
|
|
46
|
+
|
|
47
|
+
@@
|
|
48
|
+
|
|
49
|
+
middle
|
|
50
|
+
|
|
51
|
+
@<
|
|
52
|
+
|
|
53
|
+
footer
|
|
54
|
+
|
|
55
|
+
@>
|
|
56
|
+
|
|
57
|
+
header
|
|
58
|
+
|
package/lib/Yrci/C1.yrr
ADDED
package/lib/Yrci/C2.yr
ADDED
package/lib/Yrci/C3.yr
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[[ attributes=["teste"]; icon="code-slash"
|
|
2
|
+
!! hidden
|
|
3
|
+
!! @css
|
|
4
|
+
!! %serve
|
|
5
|
+
|
|
6
|
+
++
|
|
7
|
+
|
|
8
|
+
_ .teste
|
|
9
|
+
|
|
10
|
+
><
|
|
11
|
+
|
|
12
|
+
_
|
|
13
|
+
_yrci/c2 att={{ observer-id: yrci/c2 }}
|
|
14
|
+
Teste
|
|
15
|
+
|
|
16
|
+
##
|
|
17
|
+
|
|
18
|
+
_@cssTablet() {
|
|
19
|
+
.teste {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
@}
|
|
23
|
+
|
|
24
|
+
%%
|
|
25
|
+
|
|
26
|
+
_@teste() {
|
|
27
|
+
oi
|
|
28
|
+
@}
|
package/lib/Yrci/C4.yr
ADDED
package/lib/Yrci/C5.yr
ADDED
package/lib/Yrci/C6.yr
ADDED
package/lib/Yrci/C7.yr
ADDED
package/lib/Yrci/C8.yr
ADDED
package/lib/Yrci/C9.yr
ADDED
package/lib/Yrci/M1.yr
ADDED
package/lib/Yrci/Sp.yr
ADDED
package/lib/Yrci/T1.yr
ADDED
package/lib/Yrci/T2.yr
ADDED
package/lib/Yrci/Ta1.yr
ADDED