Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(site): add support for.sh and.tpl files to template editor#9674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/support-tpl-and-sh-files
Sep 13, 2023

Conversation

BrunoQuaresma
Copy link
Collaborator

Close#7921

@BrunoQuaresmaBrunoQuaresma requested a review froma teamSeptember 13, 2023 18:31
@BrunoQuaresmaBrunoQuaresma self-assigned thisSep 13, 2023
@BrunoQuaresmaBrunoQuaresma requested review froma team,Kira-Pilot,Parkreiner andaslilac and removed request fora team andKira-PilotSeptember 13, 2023 18:31
@matifalimatifali changed the titlefeat(site): add support to .sh and .tpl filesfeat(site): add support to .sh and .tpl files to template editorSep 13, 2023
@matifalimatifali changed the titlefeat(site): add support to .sh and .tpl files to template editorfeat(site): add support for.sh and.tpl files to template editorSep 13, 2023
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

suggested some changes that feel a bit cleaner to me

};

constlanguageByExtension:Record<string,string>={
constlanguageByExtension:Record<AllowedExtension,string>={
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
constlanguageByExtension:Record<AllowedExtension,string>={
constlanguageByExtension={

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

actually, move this wholeconst to templateVersion.ts

Copy link
CollaboratorAuthor

@BrunoQuaresmaBrunoQuaresmaSep 13, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Since this is only used on TemplateFiles, I would keep it there.

PS: After seeing your other comment I think it would make sense if thelanguageByExtesion would define the types but I left a comment there why I don't think this is the best option.

Comment on lines +26 to +36
exportconstallowedExtensions=[
"tf",
"md",
"mkd",
"Dockerfile",
"protobuf",
"sh",
"tpl",
]asconst;

exporttypeAllowedExtension=(typeofallowedExtensions)[number];
Copy link
Member

@aslilacaslilacSep 13, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
exportconstallowedExtensions=[
"tf",
"md",
"mkd",
"Dockerfile",
"protobuf",
"sh",
"tpl",
]asconst;
exporttypeAllowedExtension=(typeofallowedExtensions)[number];
exporttypeAllowedExtension=keyoftypeoflanguageByExtension;

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hm... in this case theAllowedExtension should be defined from the arrayallowedExtensions and not the other way around. By having it in this way, we are not going to forget to update thelanguageByExtension when a new extension is added.

Copy link
Member

@aslilacaslilacSep 13, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

we just aren't using theallowedExtensions variable anywhere. we could even just definetype AllowedExtension = 'tf' | 'md' | ...

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

we are! we use it to do some checks + filtering when unzipping the template files.

Copy link
Member

@aslilacaslilacSep 14, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

oh, well then nevermind lmao. you're doing great. 💕

@BrunoQuaresma
Copy link
CollaboratorAuthor

@aslilac I'm going to merge this now but we can keep the discussion moving forward

@BrunoQuaresmaBrunoQuaresma merged commite7b0181 intomainSep 13, 2023
@BrunoQuaresmaBrunoQuaresma deleted the bq/support-tpl-and-sh-files branchSeptember 13, 2023 19:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 13, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@aslilacaslilacaslilac left review comments

@kylecarbskylecarbskylecarbs approved these changes

@ParkreinerParkreinerAwaiting requested review from ParkreinerParkreiner is a code owner

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ability to modify tpl file in web ui for the templates

3 participants

@BrunoQuaresma@aslilac@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp