From 59569dba141392f71446a1bfefea7c1ff5a51f26 Mon Sep 17 00:00:00 2001 From: cprass Date: Mon, 2 Oct 2023 16:46:32 +0200 Subject: [PATCH] Add licensing information and allow later versions of GPL --- README.md | 7 ++++++- components/Banner.tsx | 1 + components/Board.tsx | 1 + components/Button.tsx | 1 + components/Cell.tsx | 1 + components/Controls.tsx | 1 + components/Footer.tsx | 1 + components/Link.tsx | 1 + components/cells/ClearedCell.tsx | 1 + components/cells/FlaggedCell.tsx | 1 + components/cells/HiddenCell.tsx | 1 + components/cells/IconWrapper.tsx | 1 + components/cells/ZonkCell.tsx | 1 + components/cells/useBaseClassNames.ts | 1 + components/cells/usePointerHandlers.ts | 9 +++++---- components/useBoardGapSize.ts | 1 + config/index.ts | 1 + deno.json | 2 +- islands/Game.tsx | 1 + routes/index.tsx | 4 ++-- state/actions.ts | 1 + state/signals.ts | 1 + state/types.ts | 1 + state/utils.ts | 1 + 24 files changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f605bd9..aec1d8b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# fresh project +# Deno Fresh Minesweeper + +## License + +The code in this repository is licensed under AGPL-3.0-or-later +([LICENSE](./LICENSE)) ### Usage diff --git a/components/Banner.tsx b/components/Banner.tsx index 4a5a9da..03af7ea 100644 --- a/components/Banner.tsx +++ b/components/Banner.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { game, gameState, generation, mines, scale } from "../state/signals.ts"; import { batch, diff --git a/components/Board.tsx b/components/Board.tsx index a88bc48..2753241 100644 --- a/components/Board.tsx +++ b/components/Board.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import Cell from "./Cell.tsx"; import { game, width } from "../state/signals.ts"; import useBoardGapSize from "./useBoardGapSize.ts"; diff --git a/components/Button.tsx b/components/Button.tsx index 909d380..cdbcdcd 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { JSX } from "preact"; import { IS_BROWSER } from "$fresh/runtime.ts"; diff --git a/components/Cell.tsx b/components/Cell.tsx index 750e08d..3b26b38 100644 --- a/components/Cell.tsx +++ b/components/Cell.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { CellState, CellValue, GameState } from "../state/types.ts"; import { gameState } from "../state/signals.ts"; import HiddenCell from "./cells/HiddenCell.tsx"; diff --git a/components/Controls.tsx b/components/Controls.tsx index 4c47405..17755bd 100644 --- a/components/Controls.tsx +++ b/components/Controls.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { useComputed } from "@preact/signals"; import { mines, scale } from "../state/signals.ts"; import { ComponentChildren } from "preact"; diff --git a/components/Footer.tsx b/components/Footer.tsx index eb50479..20e27b7 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { ComponentChild } from "preact"; interface Props { diff --git a/components/Link.tsx b/components/Link.tsx index 74ff63f..04d2328 100644 --- a/components/Link.tsx +++ b/components/Link.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { ComponentChild } from "preact"; interface Props { diff --git a/components/cells/ClearedCell.tsx b/components/cells/ClearedCell.tsx index a1e5a38..4c0fe01 100644 --- a/components/cells/ClearedCell.tsx +++ b/components/cells/ClearedCell.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { useBaseClassNames } from "./useBaseClassNames.ts"; enum TEXT_COLORS { diff --git a/components/cells/FlaggedCell.tsx b/components/cells/FlaggedCell.tsx index 4f2d2a3..a424387 100644 --- a/components/cells/FlaggedCell.tsx +++ b/components/cells/FlaggedCell.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { gameState } from "../../state/signals.ts"; import { GameState } from "../../state/types.ts"; import IconWrapper from "./IconWrapper.tsx"; diff --git a/components/cells/HiddenCell.tsx b/components/cells/HiddenCell.tsx index 5dc9170..896c4f7 100644 --- a/components/cells/HiddenCell.tsx +++ b/components/cells/HiddenCell.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { game, gameState } from "../../state/signals.ts"; import { GameState } from "../../state/types.ts"; import { useBaseClassNames } from "./useBaseClassNames.ts"; diff --git a/components/cells/IconWrapper.tsx b/components/cells/IconWrapper.tsx index ab17ff6..4edc529 100644 --- a/components/cells/IconWrapper.tsx +++ b/components/cells/IconWrapper.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { ComponentChildren } from "preact"; export default function IconWrapper({ diff --git a/components/cells/ZonkCell.tsx b/components/cells/ZonkCell.tsx index f1bc80f..ca773a9 100644 --- a/components/cells/ZonkCell.tsx +++ b/components/cells/ZonkCell.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import IconWrapper from "./IconWrapper.tsx"; import { useBaseClassNames } from "./useBaseClassNames.ts"; diff --git a/components/cells/useBaseClassNames.ts b/components/cells/useBaseClassNames.ts index 256116a..1440797 100644 --- a/components/cells/useBaseClassNames.ts +++ b/components/cells/useBaseClassNames.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { useComputed } from "@preact/signals"; import { CELL_BASE_SIZE } from "../../config/index.ts"; import { scale } from "../../state/signals.ts"; diff --git a/components/cells/usePointerHandlers.ts b/components/cells/usePointerHandlers.ts index 35d36b1..e9982d6 100644 --- a/components/cells/usePointerHandlers.ts +++ b/components/cells/usePointerHandlers.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { useCallback, useEffect, useMemo } from "preact/hooks"; import { JSX } from "preact"; import { gameState } from "../../state/signals.ts"; @@ -24,7 +25,7 @@ export default function usePointerHandlers(fieldIdx: number) { // cancel the timeout when unmounting the component stopTimer(); }, - [] + [], ); const onPointerUp = useCallback( @@ -48,7 +49,7 @@ export default function usePointerHandlers(fieldIdx: number) { revealField(fieldIdx); } }, - [fieldIdx] + [fieldIdx], ); const onPointerDown = useCallback( @@ -69,7 +70,7 @@ export default function usePointerHandlers(fieldIdx: number) { }, 500); } }, - [fieldIdx] + [fieldIdx], ); const onPointerLeave = useCallback(() => { @@ -83,6 +84,6 @@ export default function usePointerHandlers(fieldIdx: number) { onPointerUp, onPointerLeave, }), - [onPointerDown, onPointerUp, onPointerLeave] + [onPointerDown, onPointerUp, onPointerLeave], ); } diff --git a/components/useBoardGapSize.ts b/components/useBoardGapSize.ts index 1e21af6..f4025af 100644 --- a/components/useBoardGapSize.ts +++ b/components/useBoardGapSize.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { useComputed } from "@preact/signals"; import { GAP_BASE_SIZE } from "../config/index.ts"; import { scale } from "../state/signals.ts"; diff --git a/config/index.ts b/config/index.ts index e9fc78f..4435921 100644 --- a/config/index.ts +++ b/config/index.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later export const GAP_BASE_SIZE = 5; export const CELL_BASE_SIZE = 30; export const BASE_FONT_SIZE = 18; diff --git a/deno.json b/deno.json index 9a1952f..36710fd 100644 --- a/deno.json +++ b/deno.json @@ -10,4 +10,4 @@ "jsx": "react-jsx", "jsxImportSource": "preact" } -} \ No newline at end of file +} diff --git a/islands/Game.tsx b/islands/Game.tsx index ca273bd..e480dbe 100644 --- a/islands/Game.tsx +++ b/islands/Game.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import Banner from "../components/Banner.tsx"; import Board from "../components/Board.tsx"; import { scale, width } from "../state/signals.ts"; diff --git a/routes/index.tsx b/routes/index.tsx index 5d37eb7..021ed5c 100644 --- a/routes/index.tsx +++ b/routes/index.tsx @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import Footer from "../components/Footer.tsx"; import Link from "../components/Link.tsx"; import Game from "../islands/Game.tsx"; @@ -23,9 +24,8 @@ export default function Home() { Made by CP - AGPL v3.0 + AGPL-3.0-or-later - license Source diff --git a/state/actions.ts b/state/actions.ts index a9f3008..928f409 100644 --- a/state/actions.ts +++ b/state/actions.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import produce, { enableMapSet } from "immer"; import { game, gameState, height, mines, width } from "./signals.ts"; import { CellState, GameState } from "./types.ts"; diff --git a/state/signals.ts b/state/signals.ts index 4ecf82f..c9f7659 100644 --- a/state/signals.ts +++ b/state/signals.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { batch, effect, Signal, signal } from "@preact/signals"; import { createGame } from "./utils.ts"; import { CellState, Game, GameState } from "./types.ts"; diff --git a/state/types.ts b/state/types.ts index eadc373..8e6c40a 100644 --- a/state/types.ts +++ b/state/types.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later export enum GameState { Active, Lost, diff --git a/state/utils.ts b/state/utils.ts index 839bd1d..eed9d62 100644 --- a/state/utils.ts +++ b/state/utils.ts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later import { CellState, CellValue, Game } from "./types.ts"; function countNeighbourMines(