Skip to content

Commit

Permalink
Add licensing information and allow later versions of GPL
Browse files Browse the repository at this point in the history
  • Loading branch information
cprass committed Oct 2, 2023
1 parent 1e6fd7d commit 59569db
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 8 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions components/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { game, gameState, generation, mines, scale } from "../state/signals.ts";
import {
batch,
Expand Down
1 change: 1 addition & 0 deletions components/Board.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { JSX } from "preact";
import { IS_BROWSER } from "$fresh/runtime.ts";

Expand Down
1 change: 1 addition & 0 deletions components/Cell.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions components/Controls.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { ComponentChild } from "preact";

interface Props {
Expand Down
1 change: 1 addition & 0 deletions components/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { ComponentChild } from "preact";

interface Props {
Expand Down
1 change: 1 addition & 0 deletions components/cells/ClearedCell.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { useBaseClassNames } from "./useBaseClassNames.ts";

enum TEXT_COLORS {
Expand Down
1 change: 1 addition & 0 deletions components/cells/FlaggedCell.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions components/cells/HiddenCell.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions components/cells/IconWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { ComponentChildren } from "preact";

export default function IconWrapper({
Expand Down
1 change: 1 addition & 0 deletions components/cells/ZonkCell.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import IconWrapper from "./IconWrapper.tsx";
import { useBaseClassNames } from "./useBaseClassNames.ts";

Expand Down
1 change: 1 addition & 0 deletions components/cells/useBaseClassNames.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
9 changes: 5 additions & 4 deletions components/cells/usePointerHandlers.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -24,7 +25,7 @@ export default function usePointerHandlers(fieldIdx: number) {
// cancel the timeout when unmounting the component
stopTimer();
},
[]
[],
);

const onPointerUp = useCallback(
Expand All @@ -48,7 +49,7 @@ export default function usePointerHandlers(fieldIdx: number) {
revealField(fieldIdx);
}
},
[fieldIdx]
[fieldIdx],
);

const onPointerDown = useCallback(
Expand All @@ -69,7 +70,7 @@ export default function usePointerHandlers(fieldIdx: number) {
}, 500);
}
},
[fieldIdx]
[fieldIdx],
);

const onPointerLeave = useCallback(() => {
Expand All @@ -83,6 +84,6 @@ export default function usePointerHandlers(fieldIdx: number) {
onPointerUp,
onPointerLeave,
}),
[onPointerDown, onPointerUp, onPointerLeave]
[onPointerDown, onPointerUp, onPointerLeave],
);
}
1 change: 1 addition & 0 deletions components/useBoardGapSize.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions config/index.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
}
}
1 change: 1 addition & 0 deletions islands/Game.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions routes/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -23,9 +24,8 @@ export default function Home() {
Made by <Link href="https://prass.tech">CP</Link>
<Divider />
<Link href="https://github.com/cprass/minesweeper/blob/main/LICENSE">
AGPL v3.0
AGPL-3.0-or-later
</Link>
license
<Divider />
<Link href="https://github.com/cprass/minesweeper">Source</Link>
</Footer>
Expand Down
1 change: 1 addition & 0 deletions state/actions.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions state/signals.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions state/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
export enum GameState {
Active,
Lost,
Expand Down
1 change: 1 addition & 0 deletions state/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { CellState, CellValue, Game } from "./types.ts";

function countNeighbourMines(
Expand Down

0 comments on commit 59569db

Please sign in to comment.