Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
4d5c705
feat: add missing language codes
chikof Mar 1, 2025
4897663
chore: remove unnecessary blank line
chikof Mar 1, 2025
b2d4531
feat: Improve error message format in translation macro
chikof Mar 1, 2025
214b4e1
feat: translation object validation
stifskere Mar 1, 2025
4b3c35c
feat: better errors for invalid languages and fix typo
stifskere Mar 2, 2025
3c2ddd1
feat: Merge pull request #3 from FlakySL/feat/translation_file_errors
stifskere Mar 2, 2025
25997a4
Merge branch 'main' into refactor/languages
stifskere Mar 2, 2025
f2f3040
feat: Merge pull request #2 from FlakySL/refactor/languages
stifskere Mar 2, 2025
dc8b3fe
refactor: improve code quality and add documentation
chikof Mar 6, 2025
14ab047
chore: improve error showcase
chikof Mar 6, 2025
53bb4f6
chore: fix inconsistent title
chikof Mar 6, 2025
a1963e4
feat: Improve documentation and code examples
chikof Mar 9, 2025
623d004
Merge pull request #4 from FlakySL/refactor/code-quality
stifskere Mar 10, 2025
e70279d
feat: refactor
stifskere Mar 14, 2025
82aeb23
feat: translation obtention refactoring && workspace creation
stifskere Mar 23, 2025
6c4e9e2
feat: add Into<TokenStream> for NestingType and refactor what's there
stifskere Mar 24, 2025
20ce1c5
feat: simplified load_translation_static
stifskere Mar 24, 2025
455cd5d
feat: exported enums for runtime handling
stifskere Mar 24, 2025
603eac5
feat: finished generation functions
stifskere Mar 25, 2025
aae5961
feat: first version of translation macros
stifskere Mar 25, 2025
fbdb9f8
chore: tests pass
stifskere Mar 25, 2025
e3d89c0
fix: error messages
stifskere Mar 25, 2025
45544d5
feat: add similarities limit
stifskere Mar 25, 2025
be45b34
chore: clippy suggestions and code formatting
chikof Mar 25, 2025
071568d
chore: remove unnecessary `.into()`
chikof Mar 25, 2025
33965a0
fix: hide all the variables that shouldn't be used by the user
stifskere Mar 26, 2025
d574d5b
feat: add cause method to error for convenience
stifskere Mar 26, 2025
c3206bb
chore: remove docs from docs hidden
stifskere Mar 26, 2025
09206d7
fix: use overlap
stifskere Mar 26, 2025
d3b03bc
docs: improved readme with real data
stifskere Mar 26, 2025
a6d0f1e
docs: remove configuration as it is sub category of usage
stifskere Mar 26, 2025
b623fbc
docs: fix readme escapes
stifskere Mar 26, 2025
ca8daa1
docs: fix indent for app tree and add miniscript for config values
stifskere Mar 26, 2025
494a9aa
docs: clarify return types on behavior matrix
stifskere Mar 26, 2025
d24260b
feat: add PathNotFound in runtime errors
stifskere Mar 26, 2025
3bcc1ec
fix: fix translation format and sync with tests (tests won't pass unt…
stifskere Mar 26, 2025
df71e10
docs: code documentation and rustfmt file
Mar 27, 2025
01d38db
fix: change #[doc(hidden)] place for NestingType::get_path
stifskere Mar 27, 2025
42c6b92
Merge pull request #5 from FlakySL/feat/macro-handling
stifskere Mar 27, 2025
68bf303
feat: kwarg parsing for format
stifskere Mar 27, 2025
9573dad
feat: implement templating on the macros
stifskere Mar 27, 2025
18764dc
feat: possibly inefficient {} escaping
stifskere Mar 27, 2025
4712009
docs: readme
stifskere Mar 27, 2025
1503425
feat: completly remove template validation, as it's kinda pointless.
stifskere Mar 27, 2025
953d5f9
feat: pre process compile warning, wait for addition in the std.
stifskere Mar 27, 2025
500edbc
feat: licenses and contributing
stifskere Mar 27, 2025
cd3f30c
feat: prepare Cargo.toml for release
stifskere Mar 27, 2025
7963c37
chore: update chiko email
stifskere Mar 27, 2025
69c19be
fix: readme sub
stifskere Mar 27, 2025
b8516d5
fix: add br in between licenses in readme
stifskere Mar 27, 2025
44f851b
docs: improve documentation grammar, formatting, and clarity
chikof Mar 28, 2025
f215a61
feat: add issue templates for feature requests and bug reports
chikof Mar 28, 2025
385b4a4
docs: kwargs documentation
chikof Mar 28, 2025
d092d75
feat: change templates
stifskere Mar 28, 2025
ae28fbd
Merge pull request #10 from FlakySL/feat/templating
stifskere Mar 28, 2025
d65b558
feat: add SUPPORT.md
stifskere Mar 28, 2025
5979f76
feat: SECURITY.md
stifskere Mar 28, 2025
824f2a4
feat: governance
stifskere Mar 28, 2025
c6fa52c
feat: code of conduct
stifskere Mar 28, 2025
d53032d
fix: change whose code of conduct this is xD
stifskere Mar 28, 2025
30eefae
fix: random capital letter
stifskere Mar 28, 2025
40a55a1
Merge pull request #11 from FlakySL/feat/repository_meta
stifskere Mar 28, 2025
8804fed
test: add dynamic and static tests for translations functionality
chikof Mar 29, 2025
58a26c2
feat(config): add environment variable support for configuration over…
chikof Mar 29, 2025
f97ddbb
chore: half refactor
stifskere Mar 31, 2025
2baf327
feat: end environment support for config
stifskere Mar 31, 2025
978c1b4
chore: remove serde and format imports
chikof Mar 31, 2025
5eea0d4
fix: path should be a dir not a file
chikof Mar 31, 2025
532ff65
docs: update security and governance md files for clarity
chikof Mar 31, 2025
3620054
Merge pull request #12 from FlakySL/feat/config-env-overrides
stifskere Mar 31, 2025
d7ed05d
Merge `origin/main` into `feat/tests`
chikof Mar 31, 2025
adddb8e
chore: remove rstest and add makefile
chikof Mar 31, 2025
fe70f81
refactor: re-organize tests
chikof Mar 31, 2025
7fd2c17
feat: rearange namespaces
stifskere Apr 4, 2025
ee281ef
fix: managed to mitigate all comp time errors
stifskere Apr 6, 2025
4330fd8
chore: changed names and module of shared items
stifskere Apr 6, 2025
83f767a
chore: created abstraction path for both macros
stifskere Apr 6, 2025
1d08dd8
chore: change import layout to render inputs in a new line when too l…
stifskere Apr 6, 2025
046e982
feat: separated macro parsing and generation logic && formated with c…
stifskere Apr 8, 2025
3d7f79c
feat: implemented thiserror to parse `translatable!` macro input in a…
stifskere Apr 8, 2025
4df850b
feat: refactored translation loading
stifskere Apr 9, 2025
c66f967
feat: changed Into<TokenStream2> implementations for ToTokens which h…
stifskere Apr 9, 2025
cef035f
feat: macro generation refactor complete
stifskere Apr 9, 2025
edea6c4
Merge branch 'main' into feat/translatable_macro
stifskere Apr 10, 2025
c335232
feat: fixed all lifetime and type errors generated by the macro
stifskere Apr 10, 2025
63c2d27
feat: deleted serde :evil:
stifskere Apr 10, 2025
7660774
fix: re-add strum into translatable_proc
stifskere Apr 10, 2025
d784c9c
chore: sync
stifskere Apr 10, 2025
965d3b9
feat: moved `utils` to `translatable_shared` and reordered files
stifskere Apr 11, 2025
255331f
feat: implemeted collection abstraction elsewhere
stifskere Apr 12, 2025
88b7cdb
fix: re-added specifications on collection generation
stifskere Apr 13, 2025
f2d899d
feat: add dependabot workflow
stifskere Apr 14, 2025
87cde02
feat: implement translation templating
stifskere Apr 15, 2025
ea7af83
feat: move language and templating to misc
stifskere Apr 15, 2025
d76bda3
fix: replace hardcoded values offsets for char_to_byte index conversi…
stifskere Apr 15, 2025
d8ca7e9
fix: string slicing order
chikof Apr 15, 2025
f76e920
chore: range is already imported
chikof Apr 15, 2025
365db45
chore: replace type definition by torpedo
stifskere Apr 15, 2025
51e6243
chore: review fixes
stifskere Apr 16, 2025
9bfb070
fix: indentation on macro attribute invocation
stifskere Apr 16, 2025
7110163
feat: move template validation to compile time and changed `cargo fmt…
stifskere Apr 16, 2025
0c4244c
docs: translatable/src/error.rs
stifskere Apr 16, 2025
a9f6ee3
docs: added module description to error.rs
stifskere Apr 16, 2025
1bbe64e
docs translatable/src/lib.rs
stifskere Apr 16, 2025
bf197ea
docs: change method standards
stifskere Apr 16, 2025
cb626e6
docs: change enum documentation format
stifskere Apr 16, 2025
92f7add
docs: translatable_proc/src/data/config.rs
stifskere Apr 16, 2025
4e8196c
docs: translatable_proc/src/data/mod.rs
stifskere Apr 16, 2025
48eb0c9
docs: translatable_proc/src/data/translations.rs
stifskere Apr 17, 2025
a51b2b7
docs: translatable_proc/src/macro_generation/mod.rs
stifskere Apr 17, 2025
177fca8
docs: translatable_proc/src/macro_generation/translation.rs
stifskere Apr 17, 2025
b470361
docs: add type links to all documentation
stifskere Apr 17, 2025
09e871c
docs: translatable_proc/src/macro_input/input_type.rs
stifskere Apr 17, 2025
6784311
docs: translatable_proc/src/macro_input/mod.rs
stifskere Apr 17, 2025
d853ef9
docs: translatable_proc/src/macro_input/translation.rs
stifskere Apr 17, 2025
b4600da
docs: translatable_proc/src/lib.rs
stifskere Apr 17, 2025
3033a78
docs: translatable_shared/src/macros/collections.rs
stifskere Apr 17, 2025
c1c0d1b
docs: translatable_shared/src/macros/errors.rs
stifskere Apr 17, 2025
de6cc56
docs: translatable_shared/src/macros/mod.rs
stifskere Apr 17, 2025
d54a26c
feat: removed unused implementations in language and documented it's …
stifskere Apr 18, 2025
79a4614
docs: translatable_shared/src/misc/mod.rs
stifskere Apr 18, 2025
fbd65cb
chore: sync
stifskere Apr 18, 2025
f3f1930
fix: templates only supported one of each key due to HashMap limits
stifskere Apr 18, 2025
34f0236
docs: translatable_shared/src/misc/templating.rs
stifskere Apr 18, 2025
a76577f
docs: translatable_shared/src/translations/collection.rs
stifskere Apr 18, 2025
ced1d3a
docs: translatable_shared/src/translations/mod.rs
stifskere Apr 18, 2025
2b8d0b0
docs: translatable_shared/src/translations/node.rs
stifskere Apr 18, 2025
0a719c9
docs: translatable_shared/src/lib.rs
stifskere Apr 18, 2025
a16122e
docs: update readme to reflect changes
stifskere Apr 19, 2025
96e42ab
chore: readme table of contents update
stifskere Apr 19, 2025
dc0f064
fix: readme test
stifskere Apr 19, 2025
700930e
chore: rewrite readme
stifskere Apr 19, 2025
7792dde
chore: change repo metadata
stifskere Apr 19, 2025
62a93a5
chore: resolve ambiguity between error types
stifskere Apr 19, 2025
cffcabd
chore: add make pkg
chikof Apr 19, 2025
ea1187f
fix: typo fixes
stifskere Apr 19, 2025
19081c6
fix: documentation issues
stifskere Apr 19, 2025
7c15743
docs: readme add examples on top
stifskere Apr 19, 2025
f315956
Merge pull request #16 from FlakySL/feat/translatable_macro
stifskere Apr 19, 2025
8f9af4b
Merge remote-tracking branch 'origin' into feat/tests
chikof Apr 19, 2025
68aa6f8
chore: new file structure
chikof Apr 20, 2025
cef697c
chore(deps): bump proc-macro2 from 1.0.94 to 1.0.95
dependabot[bot] Apr 21, 2025
f6ba3cb
Merge pull request #17 from FlakySL/dependabot/cargo/proc-macro2-1.0.95
stifskere Apr 21, 2025
435d24b
chore: change license
stifskere Apr 21, 2025
4798723
chore: replace licenses in other files and polish security
stifskere Apr 21, 2025
eca62a0
Merge branch 'main' into feat/tests
stifskere Apr 21, 2025
bc27a75
chore: clear tests
stifskere Apr 23, 2025
fdaddb9
chore: add test case files
stifskere Apr 24, 2025
39d6158
chore: load test cases
stifskere Apr 24, 2025
7a128a3
chore: specify configuration tests
stifskere Apr 24, 2025
417b5ab
docs: specify template validation and change call matrix return types
stifskere Apr 24, 2025
3e00c24
chore(tests): prepare test environments
stifskere Apr 24, 2025
024c620
chore(tests): change ui to integration and document possible test manual
stifskere Apr 24, 2025
fd5a8da
chore(tests): complete language tests not tried out
stifskere Apr 25, 2025
e5f5b0a
chore(tests): complete path tests not tried out
stifskere Apr 25, 2025
ca0f522
chore(tests): add test annotation to pass_static_existing
stifskere Apr 25, 2025
fae0872
chore(tests): sync progress, need to load tests from environment vari…
stifskere Apr 25, 2025
c82e0d2
chore(tests): main tests passed
stifskere Apr 26, 2025
666bf47
docs(tests): running tests documentation
stifskere Apr 26, 2025
af9d829
docs(tests): add pull request documentation on contributing
stifskere Apr 26, 2025
79a0c99
chore(tests): everything passes
stifskere Apr 26, 2025
83c9ba3
chore(tests): add unitary tests
stifskere Apr 26, 2025
3e0d110
feat(workflows): pull request coverage
stifskere Apr 26, 2025
3a5383d
feat(workflows): coverage uploading
stifskere Apr 26, 2025
cfb8e9f
docs(readme): add codecov badge
stifskere Apr 26, 2025
05a2c5b
fix(readme): CodeCov badge
stifskere Apr 26, 2025
d827989
fix(workflows): add toolchain to setup rust
stifskere Apr 26, 2025
1de86a6
fix(workflows): change llvm-cov installation
stifskere Apr 26, 2025
b98453f
fix(workflows): run single threaded with nocapture
stifskere Apr 26, 2025
a71f621
fix(toolchain): add toolchain override
stifskere Apr 26, 2025
50b0c4a
fix(workflows): add override to setup rust
stifskere Apr 26, 2025
88757d2
fix(workflows): replace deprecated actions-rs
stifskere Apr 26, 2025
4526242
fix(workflows): sudo the thing
stifskere Apr 26, 2025
e1e0e6f
chore(toolchain): allow updates
stifskere Apr 26, 2025
9b9a1aa
chore: update nix flake and add rust toolchain components
chikof Apr 26, 2025
9dff43a
fix: i didn't have to remove rust-src
chikof Apr 26, 2025
2689cbf
fix: update error message
chikof Apr 26, 2025
ec8e409
ci: install cargoo-llvm-cov with cargo-binstall
chikof Apr 26, 2025
cd00418
ci: improve PR coverage check to avoid LCOV generation
chikof Apr 26, 2025
0b7c8e4
Merge pull request #15 from FlakySL/feat/tests
stifskere Apr 26, 2025
b54ce12
fix(ci): forgot to install binstall
chikof Apr 26, 2025
0552827
chore(workflows): update titles
stifskere Apr 26, 2025
782f538
fix(ci): add codecov token
chikof Apr 26, 2025
75a4611
fix(ci): add missing slug
chikof Apr 26, 2025
e30d8b0
chore(ci): codecov verbose
stifskere Apr 26, 2025
758ee6f
chore(ci): update codecov
stifskere Apr 26, 2025
70c43b0
chore(test): test runtime error display
stifskere Apr 26, 2025
67e7cb8
chore(publish): publish attempt 1
stifskere Apr 26, 2025
a4f09fb
chore(publish): publish attempt 1.1 // cancelled workflow
stifskere Apr 26, 2025
a5b3084
chore(publish): publish attempt 2
stifskere Apr 26, 2025
1a5cc41
chore(publish): publish attempt 3
stifskere Apr 26, 2025
4de044d
chore(publish): publish attempt 4 // specify packages
stifskere Apr 26, 2025
3ef0602
chore(ci): set workflow permissions
stifskere Apr 27, 2025
0693938
feat(context): macro parsing
stifskere Apr 27, 2025
0920473
feat(macros): abstract translation_path into its own type
stifskere Apr 27, 2025
9b84b7a
feat(context): allow optional base paths
stifskere Apr 27, 2025
aadf6ab
ci: codecov reports when mergint to main and making a PR
chikof Apr 27, 2025
678fa3c
chore: pull request template
chikof Apr 27, 2025
4413ab7
fix: pr template checklists
chikof Apr 27, 2025
3c8fcb0
fix(ci): add workflow permissions
chikof Apr 27, 2025
0935615
chore: add more badges
chikof Apr 27, 2025
62bd7ac
Merge pull request #18 from FlakySL/chore/enhance-gh-prs
stifskere Apr 27, 2025
54fb5cd
feat(context): re parse macro context
stifskere Apr 28, 2025
c89320b
feat(context): add getters and merge translation paths
stifskere Apr 28, 2025
c605b52
feat(context): parse and generate whole macro
stifskere Apr 29, 2025
c797123
chore: sync
stifskere Apr 29, 2025
bed4693
chore(meta): change code of conduct and add discord link in readme
stifskere Apr 29, 2025
8ac5b45
fix(meta): change server id
stifskere Apr 29, 2025
428d6f8
fix: merge conflicts
stifskere Apr 29, 2025
0e2b0d7
feat(context): parse context parameters
stifskere Apr 30, 2025
1108400
feat(context): implement fallback_language
stifskere Apr 30, 2025
10f8e4d
feat(coverage): set 80%
stifskere Apr 30, 2025
cfaa19f
feat(coverage): remove config
stifskere Apr 30, 2025
3007bec
feat(coverage): set 80%
stifskere Apr 30, 2025
d623f30
Merge branch 'main' into feat/translation_contexts
stifskere Apr 30, 2025
ac7913e
feat(coverage): set 80% to both patch and project
stifskere Apr 30, 2025
39fb604
Merge branch 'main' into feat/translation_contexts
stifskere Apr 30, 2025
e370996
docs(context): document translation path abstraction
stifskere May 2, 2025
904d552
chore: apply cargo fmt
stifskere May 2, 2025
2dd2756
feat(context): limit macro allowed types
stifskere May 2, 2025
d37adda
chore: apply cargo fmt
stifskere May 2, 2025
d0d557f
feat(context): abstracted the field generation with ToTokens implemen…
stifskere May 2, 2025
956c347
fix(context): disallow use of _ as it's damned useless
stifskere May 2, 2025
2168888
feat: remove serde
chikof May 3, 2025
2930ca8
fix: use immutable documents instead
chikof May 3, 2025
8ab7d67
fix: remove unnecessary clone
chikof May 3, 2025
5c76575
fix: remove unnecessary documentation for impl traits
chikof May 3, 2025
595850f
docs(context): document macro_generation/context.rs
stifskere May 3, 2025
b6d1a98
chore(docs): add missing docs as a warning in all crate levels
stifskere May 3, 2025
7b93608
fix(ci): remove pr-converage.yml
stifskere May 3, 2025
cfe3d05
fix: switch back to mutable document
chikof May 4, 2025
2a28e67
docs(context): macro_input/translation.rs
stifskere May 4, 2025
8c85ba3
docs(context): translation_context macro
stifskere May 4, 2025
bb58d58
docs(context): errors
stifskere May 4, 2025
7f7a10a
chore: sync
stifskere May 5, 2025
0359f95
chore(tests): reorder integration tests
stifskere May 5, 2025
1c6e8ad
feat(tests): add integration tests for context
stifskere May 5, 2025
8fd9b42
chore: apply cargo fmt
stifskere May 5, 2025
48c60f6
chore(tests): run integration
stifskere May 5, 2025
2d3a7e1
chore(tests): add original string test
stifskere May 5, 2025
c82a1a0
fix(tests): variable can't hold a dropped reference
stifskere May 5, 2025
5ef66c5
fix(ci): set pipefail
stifskere May 5, 2025
fb95e8f
chore(tests): fail generic arguments
stifskere May 5, 2025
3c7cc3f
chore(tests): display to error tokens
stifskere May 5, 2025
7b06afc
Merge pull request #19 from FlakySL/feat/translation_contexts
stifskere May 5, 2025
eb1ad4a
fix: parse table refernces instead of DocumentMut
stifskere May 5, 2025
4af9d98
Merge pull request #22 from FlakySL/feat/remove-serde
stifskere May 5, 2025
ad70eb3
chore(deps): bump trybuild from 1.0.104 to 1.0.105
dependabot[bot] May 12, 2025
7dea5e3
Merge pull request #28 from FlakySL/dependabot/cargo/trybuild-1.0.105
stifskere May 12, 2025
7916bd7
chore(deps): bump trybuild from 1.0.105 to 1.0.106
dependabot[bot] Jul 14, 2025
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bug Report
description: Report unexpected behavior or crashes
title: "[BUG] "
labels: ["bug-report", "triage"]
body:
- type: checkboxes
attributes:
label: Pre-submission Checklist
options:
- label: I've checked existing issues and pull requests
required: true
- label: I've read the [Code of Conduct](https://github.com/FlakySL/translatable/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Are you using the latest translatable version?
required: true

- type: dropdown
attributes:
label: Component
options:
- Core library
- Macros crate
- Documentation
validations:
required: true

- type: input
attributes:
label: Rust Version
placeholder: Output of `rustc --version`
validations:
required: true

- type: textarea
attributes:
label: Reproduction Steps
description: Step-by-step instructions to reproduce the issue
validations:
required: true

- type: textarea
attributes:
label: Expected vs Actual Behavior
description: What you expected to happen vs what actually happened

- type: textarea
attributes:
label: Additional Context
description: Logs, screenshots, or code samples
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Feature Request
description: Suggest an idea for Translatable
title: "[FEATURE] "
labels: ["feature-request", "triage"]
body:
- type: checkboxes
attributes:
label: Pre-submission Checklist
options:
- label: I've checked existing issues and pull requests
required: true
- label: I've read the [Code of Conduct](https://github.com/FlakySL/translatable/blob/main/CODE_OF_CONDUCT.md)
required: true

- type: textarea
attributes:
label: Problem Description
description: What problem are you trying to solve?
validations:
required: true

- type: textarea
attributes:
label: Proposed Solution
description: How should Translatable address this problem?
validations:
required: true

- type: textarea
attributes:
label: Alternatives Considered
description: Other ways this could potentially be solved

- type: textarea
attributes:
label: Additional Context
description: Potential disadvantages, edge cases, or examples
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
blank_issues_enabled: false

contact_links:
- name: "💬 Community Help (Discord)"
url: https://discord.gg/AJWFyps23a
about: |
For general questions, discussion, or brainstorming:
- Get real-time help from maintainers
- Discuss potential features
- Chat with other contributors
*Please check existing issues first!*

- name: "⚖️ Code of Conduct"
url: https://github.com/FlakySL/translatable/blob/main/CODE_OF_CONDUCT.md
about: |
All community interactions must follow the project
code of conduct, which is based on the contributor covenant.
*Required reading before participating*

- name: "🚨 Moderation Contact"
url: mailto:[email protected]
about: |
For urgent moderation issues:
- Code of Conduct violations
- Community safety concerns
- Escalation requests
3 changes: 3 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Useful resources

- [Discord server](https://discord.gg/AJWFyps23a)
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"

15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

## Pre-submission Checklist

- [ ] I've checked existing issues and pull requests
- [ ] I've read the [Code of Conduct](https://github.com/FlakySL/translatable/blob/main/CODE_OF_CONDUCT.md)
- [ ] I've [implemented tests](https://github.com/FlakySL/translatable/blob/main/translatable/tests/README.md) for my changes
- [ ] I've listed all my changes in the `Changes` section

## Changes

-

## Linked Issues

- fixes #<issue_number>
56 changes: 56 additions & 0 deletions .github/workflows/overall-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: tests

on:
push:
branches: [main]
pull_request:

jobs:
coverage:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set-up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: llvm-tools-preview

- name: Install cargo-binstall@latest
uses: cargo-bins/cargo-binstall@main

- name: Install cargo-llvm-cov
run: |
cargo binstall cargo-llvm-cov

- name: Generate coverage and get percentage
id: coverage
run: |
set -o pipefail
make cov export-lcov=1 | tee output.log
coverage=$(grep 'Total Coverage: ' output.log | awk '{print $3}')
echo "coverage_percentage=${coverage%\%}" >> $GITHUB_OUTPUT
echo "Detected coverage: ${coverage}"

- name: Fail if overall coverage is below 80%
run: |
if (( $(echo "${{ steps.coverage.outputs.coverage_percentage }} < 80" | bc -l) )); then
echo "❌ Coverage is below 80% (${{ steps.coverage.outputs.coverage_percentage }}%)"
exit 1
else
echo "✅ Coverage meets requirement (${{ steps.coverage.outputs.coverage_percentage }}%)"
fi

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: coverage.lcov
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
slug: FlakySL/translatable
verbose: true
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: publish to crates.io

on:
workflow_run:
workflows: ["tests"]
types:
- completed

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set-up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Set-up semver
run: |
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
npm install -g semver

- name: Get crate version
id: crate_version
run: |
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Get latest git tag
id: latest_tag
run: |
TAG=$(git describe --tags --abbrev=0 || echo "")
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: Compare versions
id: should_publish
run: |
VERSION="${{ steps.crate_version.outputs.version }}"
TAG="${{ steps.latest_tag.outputs.tag }}"

if [ -z "$TAG" ]; then
TAG="0.0.0"
fi

if semver -r "> $TAG" "$VERSION"; then
echo "publish=true" >> $GITHUB_OUTPUT
else
echo "publish=false" >> $GITHUB_OUTPUT
fi

- name: Publish to crates.io
if: steps.should_publish.outputs.publish == 'true'
run: |
cargo publish -p translatable_shared
cargo publish -p translatable_proc
cargo publish -p translatable
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

- name: Crate and push new git tag
if: steps.should_publish.outputs.publish == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.crate_version.outputs.version }}
git push origin ${{ steps.crate_version.outputs.version }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/target
.bacon-locations
.direnv

**/*.lcov
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Translatable Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [`[email protected]`](mailto:[email protected]).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at [contributor covenant].

[homepage]: https://www.contributor-covenant.org
[contributor covenant]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
Loading
Loading