Skip to content

Commit

Permalink
More uniform file naming
Browse files Browse the repository at this point in the history
kebap-case for .ts, .scss, .html, and directories
  • Loading branch information
hgiesel committed Jul 1, 2021
1 parent 3581ee8 commit 24af5ba
Show file tree
Hide file tree
Showing 101 changed files with 100 additions and 144 deletions.
2 changes: 1 addition & 1 deletion qt/aqt/changenotetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _setup_ui(self, notetype_id: NotetypeId) -> None:

self.web = AnkiWebView(title=self.TITLE)
self.web.setVisible(False)
self.web.load_ts_page("ChangeNotetype")
self.web.load_ts_page("change-notetype")
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.web)
Expand Down
2 changes: 1 addition & 1 deletion qt/aqt/data/web/css/deckbrowser.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */

@use 'ts/sass/card_counts';
@use 'ts/sass/card-counts';

a.deck {
color: var(--text-fg);
Expand Down
2 changes: 1 addition & 1 deletion qt/aqt/data/web/css/overview.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */

@use 'ts/sass/card_counts';
@use 'ts/sass/card-counts';

.smallLink {
font-size: 10px;
Expand Down
2 changes: 1 addition & 1 deletion qt/aqt/data/web/css/reviewer-bottom.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */

@use 'ts/sass/card_counts';
@use 'ts/sass/card-counts';

body {
margin: 0;
Expand Down
4 changes: 2 additions & 2 deletions qt/aqt/data/web/pages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ load("//ts:copy.bzl", "copy_files_into_group")
_pages = [
"graphs",
"congrats",
"deckoptions",
"ChangeNotetype",
"deck-options",
"change-notetype",
]

[copy_files_into_group(
Expand Down
2 changes: 1 addition & 1 deletion qt/aqt/deckoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _setup_ui(self) -> None:

self.web = AnkiWebView(title=self.TITLE)
self.web.setVisible(False)
self.web.load_ts_page("deckoptions")
self.web.load_ts_page("deck-options")
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.web)
Expand Down
16 changes: 8 additions & 8 deletions ts/ChangeNotetype/BUILD.bazel → ts/change-notetype/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("//ts:compile_sass.bzl", "compile_sass")
load("//ts:jest.bzl", "jest_test")

compile_sass(
srcs = ["ChangeNotetype-base.scss"],
srcs = ["change-notetype-base.scss"],
group = "base_css",
visibility = ["//visibility:public"],
deps = [
Expand Down Expand Up @@ -48,7 +48,7 @@ ts_library(
srcs = [
"lib.ts",
],
module_name = "ChangeNotetype",
module_name = "change-notetype",
deps = [
"//ts/components",
"//ts/lib",
Expand All @@ -60,7 +60,7 @@ ts_library(
)

esbuild(
name = "ChangeNotetype",
name = "change-notetype",
srcs = [
"//ts:protobuf-shim.js",
],
Expand All @@ -75,22 +75,22 @@ esbuild(
external = [
"protobufjs/light",
],
output_css = "ChangeNotetype.css",
output_css = "change-notetype.css",
visibility = ["//visibility:public"],
deps = [
"index",
":base_css",
"@npm//bootstrap",
"@npm//marked",
"//ts/lib",
"//ts/lib:backend_proto",
"@npm//bootstrap",
":base_css",
"//ts/sveltelib",
"@npm//marked",
"//ts/components",
"//ts/components:svelte_components",
] + svelte_names,
)

exports_files(["ChangeNotetype.html"])
exports_files(["change-notetype.html"])

# Tests
################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" id="viewport" content="width=device-width" />
<link href="ChangeNotetype-base.css" rel="stylesheet" />
<link href="ChangeNotetype.css" rel="stylesheet" />
<link href="change-notetype-base.css" rel="stylesheet" />
<link href="change-notetype.css" rel="stylesheet" />
<script src="../js/vendor/protobuf.min.js"></script>
<script src="../js/vendor/bootstrap.bundle.min.js"></script>
<script src="ChangeNotetype.js"></script>
<script src="change-notetype.js"></script>
</head>
<body>
<div id="main"></div>
Expand Down
2 changes: 1 addition & 1 deletion ts/ChangeNotetype/index.ts → ts/change-notetype/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ChangeNotetypeState, getChangeNotetypeInfo, getNotetypeNames } from "./
import { setupI18n, ModuleName } from "lib/i18n";
import { checkNightMode } from "lib/nightmode";
import ChangeNotetypePage from "./ChangeNotetypePage.svelte";
import { nightModeKey } from "components/contextKeys";
import { nightModeKey } from "components/context-keys";

export async function changeNotetypePage(
target: HTMLDivElement,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ts/components/ButtonDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="typescript">
import { setContext } from "svelte";
import { dropdownKey } from "./contextKeys";
import { dropdownKey } from "./context-keys";
import ButtonToolbar from "./ButtonToolbar.svelte";
Expand Down
2 changes: 1 addition & 1 deletion ts/components/ButtonGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import ButtonGroupItem from "./ButtonGroupItem.svelte";
import { setContext } from "svelte";
import { writable } from "svelte/store";
import { buttonGroupKey } from "./contextKeys";
import { buttonGroupKey } from "./context-keys";
import type { Identifier } from "./identifier";
import { insertElement, appendElement } from "./identifier";
import type { ButtonRegistration } from "./buttons";
Expand Down
2 changes: 1 addition & 1 deletion ts/components/ButtonGroupItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { Register } from "./registration";
import { getContext, hasContext } from "svelte";
import { buttonGroupKey } from "./contextKeys";
import { buttonGroupKey } from "./context-keys";
export let id: string | undefined = undefined;
export let registration: ButtonRegistration | undefined = undefined;
Expand Down
2 changes: 1 addition & 1 deletion ts/components/ButtonToolbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { setContext } from "svelte";
import { writable } from "svelte/store";
import Item from "./Item.svelte";
import { sectionKey } from "./contextKeys";
import { sectionKey } from "./context-keys";
import type { Identifier } from "./identifier";
import { insertElement, appendElement } from "./identifier";
import type { SvelteComponent, Registration } from "./registration";
Expand Down
4 changes: 2 additions & 2 deletions ts/components/DropdownItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="typescript">
import { onMount, createEventDispatcher, getContext } from "svelte";
import { nightModeKey } from "./contextKeys";
import { nightModeKey } from "./context-keys";
export let id: string | undefined = undefined;
let className = "";
Expand Down Expand Up @@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</button>

<style lang="scss">
@use 'ts/sass/button_mixins' as button;
@use 'ts/sass/button-mixins' as button;
button {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion ts/components/DropdownMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="typescript">
import { setContext } from "svelte";
import { dropdownKey } from "./contextKeys";
import { dropdownKey } from "./context-keys";
export let id: string | undefined = undefined;
Expand Down
4 changes: 2 additions & 2 deletions ts/components/IconButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="typescript">
import { getContext, onMount, createEventDispatcher } from "svelte";
import { nightModeKey, dropdownKey } from "./contextKeys";
import { nightModeKey, dropdownKey } from "./context-keys";
import type { DropdownProps } from "./dropdown";
export let id: string | undefined = undefined;
Expand Down Expand Up @@ -49,7 +49,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</button>

<style lang="scss">
@use "ts/sass/button_mixins" as button;
@use "ts/sass/button-mixins" as button;
button {
padding: 0;
Expand Down
2 changes: 1 addition & 1 deletion ts/components/Item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { Register, Registration } from "./registration";
import { getContext, hasContext } from "svelte";
import { sectionKey } from "./contextKeys";
import { sectionKey } from "./context-keys";
export let id: string | undefined = undefined;
export let registration: Registration | undefined = undefined;
Expand Down
4 changes: 2 additions & 2 deletions ts/components/LabelButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="typescript">
import type { Readable } from "svelte/store";
import { onMount, createEventDispatcher, getContext } from "svelte";
import { disabledKey, nightModeKey, dropdownKey } from "./contextKeys";
import { disabledKey, nightModeKey, dropdownKey } from "./context-keys";
import type { DropdownProps } from "./dropdown";
export let id: string | undefined = undefined;
Expand Down Expand Up @@ -53,7 +53,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</button>

<style lang="scss">
@use "ts/sass/button_mixins" as button;
@use "ts/sass/button-mixins" as button;
button {
padding: 0 calc(var(--buttons-size) / 3);
Expand Down
2 changes: 1 addition & 1 deletion ts/components/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { setContext } from "svelte";
import { writable } from "svelte/store";
import Item from "./Item.svelte";
import { sectionKey } from "./contextKeys";
import { sectionKey } from "./context-keys";
import type { Identifier } from "./identifier";
import { insertElement, appendElement } from "./identifier";
import type { SvelteComponent, Registration } from "./registration";
Expand Down
4 changes: 2 additions & 2 deletions ts/components/SelectButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="typescript">
import type { Readable } from "svelte/store";
import { onMount, createEventDispatcher, getContext } from "svelte";
import { disabledKey, nightModeKey } from "./contextKeys";
import { disabledKey, nightModeKey } from "./context-keys";
export let id: string | undefined = undefined;
let className = "";
Expand Down Expand Up @@ -43,7 +43,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</select>

<style lang="scss">
@use "ts/sass/button_mixins" as button;
@use "ts/sass/button-mixins" as button;
select {
height: var(--buttons-size);
Expand Down
2 changes: 1 addition & 1 deletion ts/components/WithDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import Dropdown from "bootstrap/js/dist/dropdown";
import { setContext, onDestroy } from "svelte";
import { dropdownKey } from "./contextKeys";
import { dropdownKey } from "./context-keys";
setContext(dropdownKey, {
dropdown: true,
Expand Down
27 changes: 0 additions & 27 deletions ts/components/WithLabel.svelte

This file was deleted.

File renamed without changes.
17 changes: 0 additions & 17 deletions ts/components/types.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions ts/deckoptions/BUILD.bazel → ts/deck-options/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load("//ts:compile_sass.bzl", "compile_sass")
load("//ts:jest.bzl", "jest_test")

compile_sass(
srcs = ["deckoptions-base.scss"],
srcs = ["deck-options-base.scss"],
group = "base_css",
visibility = ["//visibility:public"],
deps = [
Expand Down Expand Up @@ -76,7 +76,7 @@ ts_library(
)

esbuild(
name = "deckoptions",
name = "deck-options",
srcs = [
"//ts:protobuf-shim.js",
],
Expand All @@ -91,23 +91,23 @@ esbuild(
external = [
"protobufjs/light",
],
output_css = "deckoptions.css",
output_css = "deck-options.css",
visibility = ["//visibility:public"],
deps = [
"index",
"//ts/lib",
"//ts/lib:backend_proto",
":bootstrap-icons",
"@npm//bootstrap",
":base_css",
"//ts/sveltelib",
"@npm//bootstrap",
"@npm//marked",
"//ts/lib",
"//ts/lib:backend_proto",
"//ts/sveltelib",
"//ts/components",
"//ts/components:svelte_components",
] + svelte_names,
)

exports_files(["deckoptions.html"])
exports_files(["deck-options.html"])

# Tests
################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import type { DropdownProps } from "components/dropdown";
import { dropdownKey } from "components/contextKeys";
import { dropdownKey } from "components/context-keys";
import { onMount, createEventDispatcher, getContext } from "svelte";
let className = "";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="ts">
import * as tr from "lib/i18n";
import { getContext } from "svelte";
import { modalsKey } from "components/contextKeys";
import { modalsKey } from "components/context-keys";
import type { DeckOptionsState, ConfigListEntry } from "./lib";
import type Modal from "bootstrap/js/dist/modal";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 24af5ba

Please sign in to comment.