Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate default themes to TypeScript #20

Merged
merged 11 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
paths:
# rerun when typescript files change
- "ts/**"
# rerun when theme files change
- "themes/gruvbox/**"
- "themes/dracula/**"
# rerun when workflow is changed
- ".github/workflows/check.yml"
# rerun when packages change
Expand Down Expand Up @@ -64,6 +67,9 @@ jobs:
-
name: Run ESLint
run: npm run lint
-
name: Run ESLint for themes
run: npm run lint:themes

prettier:

Expand All @@ -89,6 +95,9 @@ jobs:
-
name: Run Prettier
run: npm run prettier
-
name: Run Prettier for themes
run: npm run prettier:themes

package-lock:

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ jobs:
-
name: Run ESLint
run: npm run lint:fix
-
name: Run ESLint for themes
run: npm run lint:themes:fix
-
name: Run Prettier
run: npm run prettier:fix
-
name: Run Prettier for themes
run: npm run prettier:themes:fix
-
run: |
git restore package-lock.json
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This is a LightDM Greeter made with [Electron.js][Electron] and [node-gtk][node-
- Themes could be simple, or very complex.
- Battery and brightness control.
- Multi-monitor support, thanks to [s0](https://github.com/s0)
- TypeScript based.

## Considerations

Expand Down
28 changes: 26 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,37 @@
"scripts": {
"start": "electron .",
"rebuild": "electron-rebuild -w node-gtk",

"build": "npm run build:tsc && node make build",
"build:tsc": "tsc --build && npm run build:themes",

"build:theme:gruvbox": "tsc --build themes/gruvbox",
"build:theme:dracula": "tsc --build themes/dracula",

"build:themes": "npm run build:theme:gruvbox && npm run build:theme:dracula",

"type-check": "tsc --noEmit",
"build": "tsc --build && node make build",
"lint": "eslint \"ts/**\"",
"lint:fix": "eslint \"ts/**\" --fix",

"lint:theme:gruvbox": "eslint \"themes/gruvbox/ts/**\"",
"lint:theme:gruvbox:fix": "eslint \"themes/gruvbox/ts/**\" --fix",
"lint:theme:dracula": "eslint \"themes/dracula/ts/**\"",
"lint:theme:dracula:fix": "eslint \"themes/dracula/ts/**\" --fix",

"lint:themes": "npm run lint:theme:gruvbox && npm run lint:theme:dracula",
"lint:themes:fix": "npm run lint:theme:gruvbox:fix && npm run lint:theme:dracula:fix",

"prettier": "prettier --check ts/",
"prettier:fix": "prettier --write ts/",
"do_install": "node install.js"

"prettier:theme:gruvbox": "prettier --check themes/gruvbox/ts/ ",
"prettier:theme:gruvbox:fix": "prettier --write themes/gruvbox/ts/",
"prettier:theme:dracula": "prettier --check themes/dracula/ts/ ",
"prettier:theme:dracula:fix": "prettier --write themes/dracula/ts/",

"prettier:themes": "npm run prettier:theme:gruvbox && npm run prettier:theme:dracula",
"prettier:themes:fix": "npm run prettier:theme:gruvbox:fix && npm run prettier:theme:dracula:fix"
},
"author": {
"name": "Jezer Mejía",
Expand Down
1 change: 1 addition & 0 deletions themes/dracula/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/
6 changes: 3 additions & 3 deletions themes/dracula/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ html {
html * {
font-family: system-ui;
font-size: inherit;
transition: var(--animation-duration);
color: var(--fg0);
}

Expand All @@ -59,6 +58,7 @@ body {
margin: 0;
overflow-x: hidden;
background-color: var(--bg0);
transition: var(--animation-duration);
}

.hide {
Expand Down Expand Up @@ -610,10 +610,10 @@ button {
backdrop-filter: blur(50px);
}

#layouts-list {
#layout-list {
padding: 0;
}
#layouts-button {
#layout-list-button {
all: unset;
cursor: pointer;
padding: 8px;
Expand Down
18 changes: 4 additions & 14 deletions themes/dracula/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ <h2 id="date-label">20-05-2021</h2>
</div>

<div id="system-bar">
<div id="layouts-list">
<button id="layouts-button" class="">LATAM</button>
<div id="layout-list">
<button id="layout-list-button" class="">LATAM</button>
<ul id="layouts-dropdown" class="dropdown hide">
<li><button>Latam</button></li>
<li><button>English</button></li>
Expand Down Expand Up @@ -155,17 +155,7 @@ <h3>Background selector</h3>
</div>
</div>

<script src="js/debug.js"></script>
<script src="js/accounts.js"></script>
<script src="js/sessions.js"></script>
<script src="js/authenticate.js"></script>
<script src="js/sidebar.js"></script>
<script src="js/backgrounds.js"></script>
<script src="js/time-date.js"></script>
<script src="js/layouts.js"></script>
<script src="js/power.js"></script>
<script src="js/battery.js"></script>
<script src="js/brightness.js"></script>
<script src="js/index.js"></script>
<!--<script src="js/debug.js"></script>-->
<script src="js/index.js" type="module"></script>
</body>
</html>
98 changes: 0 additions & 98 deletions themes/dracula/js/accounts.js

This file was deleted.

126 changes: 0 additions & 126 deletions themes/dracula/js/authenticate.js

This file was deleted.

Loading