Skip to content

Commit

Permalink
moss.ryanatkn.com
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn committed Apr 13, 2024
1 parent 59b0f81 commit 5650fc4
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 324 deletions.
158 changes: 6 additions & 152 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,157 +1,11 @@
[<img src="/static/favicon.png" align="right" width="192" height="192">](https://template.fuz.dev/)
[<img src="/static/favicon.png" align="right" width="192" height="192">](https://moss.ryanatkn.com/)

# @ryanatkn/fuz_template ❄
# @ryanatkn/moss 🌿

> a static web app and Node library template with
> [TypeScript](https://github.com/microsoft/TypeScript),
> [Svelte](https://github.com/sveltejs/svelte),
> [SvelteKit](https://github.com/sveltejs/kit),
> [Vite](https://github.com/vitejs/vite),
> [esbuild](https://github.com/evanw/esbuild),
> [Fuz](https://github.com/ryanatkn/fuz),
> and [Gro](https://github.com/ryanatkn/gro)
> magical organic stylesheets
[**template.fuz.dev**](https://template.fuz.dev/)
[**moss.ryanatkn.com**](https://moss.ryanatkn.com/)

## contents
## License [🐦](https://wikipedia.org/wiki/Free_and_open-source_software)

- [SvelteKit](https://github.com/sveltejs/kit) with [Svelte](https://github.com/sveltejs/svelte) and
[Vite](https://github.com/vitejs/vite)
- [Gro](https://github.com/ryanatkn/gro):
- extends [SvelteKit](https://github.com/sveltejs/kit) and
[Vite](https://github.com/vitejs/vite)
- integrated [TypeScript](https://github.com/microsoft/TypeScript)
with [Svelte](https://github.com/sveltejs/svelte) and
[svelte-check](https://github.com/sveltejs/language-tools/tree/master/packages/svelte-check)
- testing with [uvu](https://github.com/lukeed/uvu)
- formatting with [Prettier](https://github.com/prettier/prettier)
- linting with [ESLint](https://github.com/eslint/eslint)
and [`@ryanatkn/eslint-config`](https://github.com/ryanatkn/eslint-config)
- also has [a task system](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/task.md)
with a bunch of [builtins](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/tasks.md),
[codegen](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/gen.md),
and [other things](https://github.com/ryanatkn/gro/tree/main/src/lib/docs)
- optional [utilities library `@ryanatkn/belt`](https://github.com/ryanatkn/belt)
- [Fuz](https://github.com/ryanatkn/fuz):
- libraries with styles, themes, and Svelte components - [fuz.dev](https://www.fuz.dev/)
- to remove, `npm uninstall @ryanatkn/fuz` and delete the imports

## usage

This project uses [SvelteKit](https://kit.svelte.dev/) with the static adapter
and [Vite](https://vitejs.dev/),
so the normal commands like `vite dev` work as expected.
It also uses [Gro](https://github.com/ryanatkn/gro)
for tasks like deploying and more.

**⚠️ Important,** this template is designed for **public** open source projects.
Its `package.json` has `"public": true` by default,
which [tells Gro](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/gro_plugin_sveltekit_frontend.md#well_known_package_json)
to publish the `package.json` and a map of its `src/` directory
to `static/.well-known/` during the build.
This can leak sensitive information if you are not careful ⚠️
To disable the feature, edit [package.json](/package.json):

```diff
// package.json
- "public": true, // remove this to disable the public `.well-known` files
+ "private": true, // if you want to disable npm publishing, add this
```

> [Windows will not be suported supported](https://github.com/ryanatkn/fuz_template/issues/4)
> because I chose Bash instead - [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) works
If you're logged into GitHub, click "Use this template" above or clone with
[`degit`](https://github.com/Rich-Harris/degit):

```bash
npx degit ryanatkn/fuz_template cooltoy
cd cooltoy
npm i
# then
vite dev
# or
npm run dev
# or
gro dev # npm i -g @ryanatkn/gro
gro sync # called by `gro dev`, refreshes generated files and calls `svelte-kit sync`
```

> learn more about [SvelteKit](https://github.com/sveltejs/kit),
> [Vite](https://github.com/vitejs/vite), [Gro](https://github.com/ryanatkn/gro),
> and [Fuz](https://github.com/ryanatkn/fuz)
The template includes
[`@sveltejs/adapter-static`](https://github.com/sveltejs/kit/tree/master/packages/adapter-static)
so it can [deploy](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/deploy.md)
with no further configuration.
To learn how to swap it out for another deployment target, see
[the SvelteKit adapter docs](https://kit.svelte.dev/docs#adapters).

To make it your own, change `@ryanatkn/fuz_template` and `template.fuz.dev`
to your project name in the following files:

- [`package.json`](package.json)
- [`svelte.config.js`](svelte.config.js)
- [`src/routes/+layout.svelte`](src/routes/+layout.svelte)
- [`src/routes/+page.svelte`](src/routes/+page.svelte)
- update or delete [`src/static/CNAME`](src/static/CNAME)

Then run `npm i` to update `package-lock.json`.

Optionally add a [license file](https://choosealicense.com/)
and [`package.json` value](https://spdx.org/licenses/), like `"license": "MIT"`.

## build

```bash
npm run build
# or
gro build
```

See [Gro's build docs](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/build.md) for more.

## test

```bash
npm test
# or
gro test
gro test filepattern1 filepatternB
gro test -- uvu --forwarded_args 'to uvu'
```

See [uvu](https://github.com/lukeed/uvu),
[`src/lib/example.test.ts`](src/lib/example.test.ts),
and [Gro's test docs](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/test.md) for more.

## deploy

[Deploy](https://github.com/ryanatkn/gro/blob/main/src/lib/docs/deploy.md)
(build, commit, and push) to the `deploy` branch, e.g. for GitHub Pages:

```bash
npm i -D @sveltejs/package # enables Gro's library plugin by default
npm run deploy
# or
gro deploy
```

## credits 🐢<sub>🐢</sub><sub><sub>🐢</sub></sub>

[Svelte](https://github.com/sveltejs/svelte)
[SvelteKit](https://github.com/sveltejs/kit)
[Vite](https://github.com/vitejs/vite)
[esbuild](https://github.com/evanw/esbuild)
[uvu](https://github.com/lukeed/uvu)
[TypeScript](https://github.com/microsoft/TypeScript)
[ESLint](https://github.com/eslint/eslint)
[Prettier](https://github.com/prettier/prettier)
[Fuz](https://github.com/ryanatkn/fuz)
[Gro](https://github.com/ryanatkn/gro)
[@ryanatkn/belt](https://github.com/ryanatkn/belt)
[Zod](https://github.com/colinhacks/zod)
& [more](package.json)

## [🐦](https://wikipedia.org/wiki/Free_and_open-source_software)
[MIT](LICENSE)
8 changes: 6 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"name": "@ryanatkn/fuz_template",
"name": "@ryanatkn/moss",
"version": "0.0.1",
"description": "a static web app and Node library template with TypeScript, Svelte, SvelteKit, Vite, esbuild, Fuz, and Gro",
"icon": "",
"description": "magical organic stylesheets",
"icon": "🌿",
"public": true,
"homepage": "https://template.fuz.dev/",
"repository": "https://github.com/ryanatkn/fuz_template",
"license": "MIT",
"homepage": "https://moss.ryanatkn.com/",
"repository": "https://github.com/ryanatkn/moss",
"author": {
"name": "Ryan Atkinson",
"email": "mail@ryanatkn.com",
"url": "https://www.ryanatkn.com/"
},
"bugs": "https://github.com/ryanatkn/moss/issues",
"funding": "https://www.ryanatkn.com/funding",
"type": "module",
"engines": {
"node": ">=20.10"
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</script>

<svelte:head>
<title>@ryanatkn/fuz_template</title>
<title>@ryanatkn/moss</title>
</svelte:head>

<svelte:body
Expand Down
23 changes: 12 additions & 11 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<script lang="ts">
import Card from '@ryanatkn/fuz/Card.svelte';
import {base} from '$app/paths';
import {random_item} from '@ryanatkn/belt/random.js';
import Mreows, {items} from '$routes/Mreows.svelte';
let mreows: Array<{icon: string}> | undefined = $state([random_item(items), items[4]]);
</script>

<main class="prose">
<main>
<section class="box">
<header class="prose">
<h1 class="mt_xl2">fuz_template</h1>
<header class="box">
<h1 class="mt_xl2 mb_xl2">moss</h1>
<img
src="{base}/favicon.png"
alt="the Moss logo, a fuzzy tuft of green moss"
style:width="var(--icon_size_xl2)"
style:height="var(--icon_size_xl2)"
class="mb_xl2"
/>
<blockquote>magical organic stylesheets</blockquote>
<a href="https://github.com/ryanatkn/moss">source code</a>
</header>
<Card href="{base}/about" icon={mreows ? mreows[0].icon : ''}>about</Card>
</section>
<Mreows bind:mreows />
</main>

<style>
Expand Down
107 changes: 0 additions & 107 deletions src/routes/Mreows.svelte

This file was deleted.

Loading

0 comments on commit 5650fc4

Please sign in to comment.