Skip to content

Commit

Permalink
Merge branch 'main' into update-npm-data
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Dec 17, 2023
2 parents 37131b4 + 3ee0d8f commit 4853733
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 61 deletions.
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 🎯 Changes

<!-- What changes are made in this PR? Is it a feature or a package submission? -->

## ✅ Checklist

- [ ] I have given my PR a descriptive title
- [ ] I have run `pnpm run lint` locally on my changes
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Svelte Society Website

Using SvelteKit!
Welcome to Svelte Society! This repository hosts the main website, which serves as a central index of events, a components directory, as well as recipes and other useful resources.

## Developing

Expand All @@ -9,17 +9,10 @@ In order to start a development server:
```bash
pnpm install
pnpm run dev

# or start the server and open the app in a new browser tab
pnpm run start
```

## Building

Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then:
## Contributing

```bash
pnpm run build
```
If you would like to improve the site, you are very welcome to submit a PR! The website has a [form](https://sveltesociety.dev/help/submitting?type=component) which helps streamline adding your package or resource.

> You can preview the built app with `pnpm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.
Please locally ensure your code passes `pnpm run lint` before submitting your PR. If you have Prettier formatting issues, please run `pnpm run format`.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"devDependencies": {
"@actions/core": "^1.10.1",
"@macfja/svelte-persistent-store": "2.4.1",
"@sindresorhus/slugify": "^2.2.1",
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

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

14 changes: 4 additions & 10 deletions src/routes/searchableJson.svelte → src/lib/SearchableJson.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script lang="ts">
import slugify from '@sindresorhus/slugify';
import ComponentCard from '$lib/components/ComponentIndex/Card.svelte';
import List from '$lib/components/ComponentIndex/CardList.svelte';
import SearchLayout from '$layouts/SearchLayout.svelte';
import { extractUnique } from '$lib/utils/extractUnique';
import Seo from '$lib/components/Seo.svelte';
import Search from '$lib/components/Search.svelte';
import Select from '../lib/components/Select.svelte';
import Select from '$lib/components/Select.svelte';
import { packageManager } from '$stores/packageManager';
export let data;
Expand All @@ -19,8 +20,6 @@
$: dataToDisplay = data.map((line) => ({ ...dataDefault, ...line }));
$: categories = extractUnique(dataToDisplay, 'category');
export let categoryId = {};
</script>

<Seo title={displayTitle} />
Expand All @@ -39,9 +38,7 @@
facetsConfig={[
{
title: 'Category',
identifier: 'category',
isClearable: true,
showIndicator: true
identifier: 'category'
},
{
title: 'Tags',
Expand Down Expand Up @@ -81,10 +78,7 @@
</section>
<section slot="items">
{#each categories as category}
<List
title={category.label || 'Unclassified'}
id={categoryId[category.label] || category.label || 'unclassified'}
>
<List title={category.label || 'Unclassified'} id={slugify(category.label) || 'unclassified'}>
{#each dataToDisplay.filter((d) => d.category === category.value || (!categories
.map((v) => v.value)
.includes(d.category) && category.value === '')) as cardData}
Expand Down
19 changes: 1 addition & 18 deletions src/routes/components/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
<script lang="ts">
import components from './components.json';
import SearchableJson from '../searchableJson.svelte';
import SearchableJson from '$lib/SearchableJson.svelte';
import { injectNpmData } from '$utils/injectNpmData';
import { injectStars } from '$utils/stars';
const categoryId = {
Animations: 'animations',
'Data Visualisation': 'data-vis',
'Design Pattern': 'design-patterns',
'Design System': 'design-systems',
'Developer Experience': 'dx',
'Forms & User Input': 'input',
Integration: 'integrations',
'Rich Text Editor': 'text-editors',
Routers: 'routers',
Stores: 'stores',
'SvelteKit Adapters': 'adapters',
Testing: 'testing',
'User Interaction': 'ui'
};
</script>

<SearchableJson
{categoryId}
data={injectNpmData(injectStars(components))}
displayTitle="Components"
displayTitleSingular="component"
Expand Down
6 changes: 3 additions & 3 deletions src/routes/help/submitting/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@
</pre>
<br />
Copy this snippet and add it to
<a href="{repoURL}/blob/main/src/routes/{pathName}/{pathName}.json">{pathName}.json</a>. You can
propose your changes
<a href="{repoURL}/edit/main/src/routes/{pathName}/{pathName}.json">directly in GitHub</a>.
<a href="{repoURL}/blob/main/src/routes/{pathName}/{pathName}.json">{pathName}.json</a>. Before
submitting a PR, please clone your changes locally and run:
<pre>pnpm run lint</pre>

<style>
.json-generator,
Expand Down
10 changes: 1 addition & 9 deletions src/routes/templates/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<script lang="ts">
import templates from './templates.json';
import SearchableJson from '../searchableJson.svelte';
import SearchableJson from '$lib/SearchableJson.svelte';
import { injectStars } from '$utils/stars';
const categoryId = {
Sapper: 'sapper',
Svelte: 'svelte',
'Svelte Add': 'adders',
SvelteKit: 'svelte-kit'
};
</script>

<SearchableJson
{categoryId}
data={injectStars(templates)}
displayTitle="Template"
displayTitleSingular="template"
Expand Down
11 changes: 1 addition & 10 deletions src/routes/tools/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<script lang="ts">
import tools from '../tools/tools.json';
import SearchableJson from '../searchableJson.svelte';
import SearchableJson from '$lib/SearchableJson.svelte';
import { injectNpmData } from '$utils/injectNpmData';
import { injectStars } from '$utils/stars';
const categoryId = {
'Bundler Plugins': 'bundling',
Debugging: 'debugging',
'Editor Extensions': 'editor-support',
'Linting and Formatting': 'code-quality',
Preprocessors: 'preprocessors'
};
</script>

<SearchableJson
{categoryId}
data={injectNpmData(injectStars(tools))}
displayTitle="Tools"
displayTitleSingular="tool"
Expand Down

0 comments on commit 4853733

Please sign in to comment.