Skip to content

Commit 44756ef

Browse files
committed
🔀 Merge view from @siguici
2 parents 234452c + fc586f0 commit 44756ef

29 files changed

+4534
-9
lines changed

‎.editorconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ insert_final_newline = true
77
indent_style = space
88
indent_size = 4
99
trim_trailing_whitespace = true
10+
quote_type = single
1011

1112
[*.json]
1213
insert_final_newline = ignore

‎.eslintignore‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/*.log
2+
**/.DS_Store
3+
*.
4+
.vscode/settings.json
5+
.history
6+
.yarn
7+
bazel-*
8+
bazel-bin
9+
bazel-out
10+
bazel-qwik
11+
bazel-testlogs
12+
dist
13+
dist-dev
14+
lib
15+
lib-types
16+
etc
17+
external
18+
node_modules
19+
temp
20+
tsc-out
21+
tsdoc-metadata.json
22+
target
23+
output
24+
rollup.config.js
25+
build
26+
.cache
27+
.vscode
28+
.rollup.cache
29+
dist
30+
tsconfig.tsbuildinfo
31+
*.config.ts
32+
*.config.js
33+
*.spec.ts
34+
*.spec.js

‎.eslintrc.js‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
'eslint:recommended',
10+
'plugin:@typescript-eslint/recommended',
11+
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
12+
// 'plugin:@typescript-eslint/strict',
13+
// 'standard-with-typescript',
14+
'prettier',
15+
'plugin:qwik/recommended',
16+
],
17+
overrides: [],
18+
parser: '@typescript-eslint/parser',
19+
parserOptions: {
20+
tsconfigRootDir: __dirname,
21+
project: ['./tsconfig.json'],
22+
ecmaVersion: 2021,
23+
sourceType: 'module',
24+
allowImportExportEverywhere: true,
25+
ecmaFeatures: {
26+
jsx: true,
27+
},
28+
},
29+
plugins: ['@typescript-eslint'],
30+
rules: {
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
'@typescript-eslint/explicit-module-boundary-types': 'off',
33+
'@typescript-eslint/no-inferrable-types': 'off',
34+
'@typescript-eslint/no-non-null-assertion': 'off',
35+
'@typescript-eslint/no-empty-interface': 'off',
36+
'@typescript-eslint/no-namespace': 'off',
37+
'@typescript-eslint/no-empty-function': 'off',
38+
'@typescript-eslint/no-this-alias': 'off',
39+
'@typescript-eslint/ban-types': 'off',
40+
'@typescript-eslint/ban-ts-comment': 'off',
41+
'prefer-spread': 'off',
42+
'no-case-declarations': 'off',
43+
'no-console': 'off',
44+
'@typescript-eslint/no-unused-vars': ['error'],
45+
'@typescript-eslint/consistent-type-imports': 'warn',
46+
'@typescript-eslint/strict-boolean-expressions': 'off',
47+
},
48+
};

‎.gitattributes‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* text=auto
22

3+
*.blade.php diff=html
34
*.css diff=css
45
*.html diff=html
56
*.md diff=markdown
@@ -14,12 +15,9 @@
1415
*.jpg binary
1516
*.jpeg binary
1617

17-
/src/Program.php export-ignore
18-
/tests/Feat/ExampleTest.php export-ignore
19-
/tests/Unit/ProgramTest.php export-ignore
20-
# CHANGELOG.md export-ignore
21-
# .editorconfig export-ignore
22-
# .gitattributes export-ignore
23-
# .gitignore export-ignore
24-
# /.github export-ignore
25-
# /tests export-ignore
18+
CHANGELOG.md export-ignore
19+
.editorconfig export-ignore
20+
.gitattributes export-ignore
21+
.gitignore export-ignore
22+
/.github export-ignore
23+
/tests export-ignore

‎.gitignore‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ Homestead.yaml
2020
# Cache
2121
*.cache
2222
.mf
23+
.vscode/
2324
.rollup.cache
2425
tsconfig.tsbuildinfo
26+
/site/static/
2527

2628
# Logs
2729
logs/
@@ -33,6 +35,9 @@ pnpm-debug.log*
3335
lerna-debug.log*
3436
error_log*
3537

38+
# Temp
39+
tmp/
40+
3641
# Editor
3742
.vscode/*
3843
!.vscode/extensions.json
@@ -44,7 +49,12 @@ error_log*
4449
*.sln
4550
*.sw?
4651

52+
# Yarn
53+
.yarn/*
54+
!.yarn/releases
55+
4756
# Tests
4857
/test-results/
4958
/playwright-report/
5059
/playwright/.cache/
60+
/test-results/

‎.prettierignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Files Prettier should not format
2+
**/*.log
3+
**/.DS_Store
4+
*.
5+
dist
6+
node_modules

‎app/res/global.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import 'tailwindcss/base';
2+
@import 'tailwindcss/components';
3+
@import 'tailwindcss/utilities';

‎app/res/global.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { NameInputComponent } from 'App/Components/Hello/Hello';
2+
import { Composer } from 'App/Core/Composer';
3+
4+
const composer = new Composer()
5+
composer.compose([
6+
NameInputComponent,
7+
]);

‎app/res/index.html‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>RAngular</title>
7+
<link rel="stylesheet" href="./global.css">
8+
</head>
9+
<body>
10+
<div id="app" class="text-center my-4">
11+
<h1 class="text-3xl my-4">Welcome to RAngular!</h1>
12+
<div>
13+
<p>
14+
<label for="name">Name</label>
15+
<input hello color="red" type="text" name="name" placeholder="Type your name..." class="border-2 rounded px-4 py-2" />
16+
</p>
17+
<p>
18+
<label for="name">Name</label>
19+
<input hello type="text" name="name" placeholder="Type your name..." class="border-2 rounded px-4 py-2" />
20+
</p>
21+
<p>
22+
<label for="name">Name</label>
23+
<input hello color="green" type="text" name="name" placeholder="Type your name..." class="border-2 rounded px-4 py-2" />
24+
</p>
25+
</div>
26+
</div>
27+
<script type="module" src="./global.ts"></script>
28+
</body>
29+
</html>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { BaseComponent } from "App/Core/Component";
2+
3+
export class NameInputComponent extends BaseComponent
4+
{
5+
static selector = '[hello]';
6+
protected color = 'blue';
7+
8+
constructor(public element: HTMLInputElement, public formater = new FormData())
9+
{
10+
super(element);
11+
}
12+
13+
init()
14+
{
15+
this.element.style.color = this.element.getAttribute('color') || this.color;
16+
17+
this.element.addEventListener('input', (event) => {
18+
this.helloInput(event.target as HTMLInputElement);
19+
});
20+
}
21+
22+
getOutputId(): string
23+
{
24+
return (this.element.id || this.id) + 'Output';
25+
}
26+
27+
helloInput(input: HTMLInputElement)
28+
{
29+
const output = this.findOutput() ?? this.makeOutput();
30+
output.innerHTML = '<div class="m-4 text-xl">Hello, <b class="text-3xl">' + input.value + '</b>.</div>';
31+
}
32+
33+
findOutput(): HTMLOutputElement|null
34+
{
35+
const output = document.getElementById(this.getOutputId());
36+
37+
if (output instanceof HTMLOutputElement) {
38+
return output;
39+
}
40+
41+
return null;
42+
}
43+
44+
makeOutput(): HTMLOutputElement
45+
{
46+
const output = document.createElement('output');
47+
output.setAttribute('id', this.getOutputId());
48+
this.element.parentElement?.appendChild(output);
49+
return output;
50+
}
51+
}

0 commit comments

Comments
 (0)