Skip to content

Commit

Permalink
feat: add alwatr package (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD authored Oct 15, 2024
2 parents 43e5aa6 + e5dfff8 commit 37dd32f
Show file tree
Hide file tree
Showing 2,372 changed files with 9,050 additions and 65,203 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
max_line_length = 140

[*.{js,ts}]
block_comment_start = /**
Expand Down
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
*.js
*.d.ts
/demo/es-bench/
/uniquely/flight-finder-pwa
node_modules
_data
67 changes: 1 addition & 66 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,4 @@
{
"root": true,
"extends": [
"eslint:recommended",
"google",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/stylistic",
// "plugin:@typescript-eslint/strict-type-checked",
// "plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:wc/best-practice",
"plugin:lit/recommended"
],
"env": {
"shared-node-browser": true,
"es2022": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true,
"ecmaVersion": 2021,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import", "wc"],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": ["**/tsconfig.json"],
"projectFolderIgnoreList": ["**/node_modules/**"]
},
"node": true
},
"wc": {
"elementBaseClasses": ["LitElement"]
}
},
"rules": {
"max-len": ["error", {"code": 300}],
"no-eval": ["error", {"allowIndirect": true}],
"no-floating-decimal": "error",
"space-infix-ops": "error",
"new-cap": ["error", {"capIsNewExceptionPattern": "Mixin$"}],
"brace-style": ["error", "stroustrup", {"allowSingleLine": true}],
"operator-linebreak": ["error", "after", {"overrides": {"?": "before", ":": "before"}}],
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", ["parent", "sibling", "index"], "object", "unknown", "type"],
"newlines-between": "always",
"warnOnUnassignedImports": true,
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/prefer-string-starts-ends-with": "off",
"lit/attribute-value-entities": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"import/no-unresolved": "off",
"wc/guard-super-call": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-throw-literal": "off",
"require-jsdoc": "off",
"valid-jsdoc": "off"
}
"extends": "@alwatr/eslint-config"
}
5 changes: 0 additions & 5 deletions .gitattributes

This file was deleted.

101 changes: 0 additions & 101 deletions .gitconfig

This file was deleted.

44 changes: 44 additions & 0 deletions .github/copilot-instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Instruction

As an advanced web developer, prioritize code maintainability, readability, and performance. Write clean, efficient, and well-documented code. Adhere to instructions without adding extra code or features. Identify and report bugs and mistakes for correction. Carefully review prompts and provide detailed feedback if something is incorrect.

## General Rules

- Follow JAMstack architecture principles.
- Write minimal and clear descriptions and if possible don't write anything and just send code.
- Fully optimize JavaScript code for best performance.
- Ensure clear separation of concerns.
- Do not use extra packages unless explicitly required; prefer vanilla JavaScript.
- Use modern TypeScript; avoid outdated versions and polyfills. Add TODO comments if polyfills are needed.

## Technologies

- Use Lit for web components with light DOM.
- Use Tailwind CSS for styling; avoid additional CSS.
- Use the latest TypeScript features for type safety and improved code quality.
- Use Nunjucks templating engine in the 11ty static site generator.
- Utilize in-ecosystem packages developed by our team.
- Use the NoSQL database developed by our team.
- Alpine Store for state management.
- Use FSM for state machines by our team for many part of client-side logics.
- Use logger for logging by our team for each function.

## Commenting

1. Comments should not duplicate the code, if duplicate, don't write it.
2. Rewrite unclear code instead of adding comments to explain it.
3. If a comment is unclear, there may be an issue with the code itself.
4. Comments should clarify, not confuse. Remove comments that cause confusion.
5. Explain non-standard code with comments.
6. Provide links to the original source of copied code.
7. Include links to external references where helpful.
8. Add comments when fixing bugs.
9. Use comments to mark incomplete implementations.
10. minimize usage of jsdoc comments.

## Other

1. call me `bro`.
2. Please consider the logic and if my opinion is against your opinion, please don't accept it immediately and just check it again and give reasons.
3. Do not speak too formally and sloppily, Feel like you're talking to your friend.
4. Explain with simple english.
71 changes: 71 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 20
commit-message:
prefix: deps
include: scope
reviewers:
- AliMD
schedule:
interval: weekly
time: '10:30'
day: thursday
labels:
- ci
- priority-low
- maintenance
groups:
github-actions:
patterns:
- '*'

- package-ecosystem: npm
directory: /
versioning-strategy: increase
open-pull-requests-limit: 20
commit-message:
prefix: deps
include: scope
reviewers:
- AliMD
schedule:
interval: weekly
time: '10:30'
day: thursday
labels:
- dependencies
- ci
- priority-low
- maintenance
groups:
production-dependencies:
dependency-type: 'production'
exclude-patterns:
- '@alwatr/*'
- 'fract'
development-dependencies:
dependency-type: 'development'
exclude-patterns:
- '@alwatr/*'
- 'fract'
alwatr-dependencies:
patterns:
- '@alwatr/*'
- 'fract'

- package-ecosystem: docker
directory: /packages/alwatr
reviewers:
- AliMD
schedule:
interval: weekly
time: '10:30'
day: thursday
labels:
- ci
- priority-low
- maintenance
54 changes: 0 additions & 54 deletions .github/dependabot.yml.disabled

This file was deleted.

2 changes: 1 addition & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
description: 'Enhancement of the code, not introducing new features.'
- name: 'refactor'
color: 1d76db
description: 'Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features.'
description: 'Updating the code with simpler, easier to understand or more efficient syntax or methods.'
- name: 'performance'
color: 1d76db
description: 'Improving performance of the project, not introducing new features.'
Expand Down
Loading

0 comments on commit 37dd32f

Please sign in to comment.