-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial design with listing functionality
- Loading branch information
1 parent
8f31ec4
commit 84d6257
Showing
17 changed files
with
624 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,26 @@ | ||
# create-svelte | ||
# Github Declutter | ||
|
||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
Declutter your unused repo. Create your github personal access token, give permission for these scopes: | ||
|
||
## Creating a project | ||
* repo | ||
* gist | ||
* delete_repo | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
then declutter your repo. | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
![docs/img/screenshot.png](docs/img/screenshot.png) | ||
|
||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
|
||
## Developing | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
|
||
```bash | ||
npm run dev | ||
## Deveelopment | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
```sh | ||
$ npm install | ||
$ npm run dev -- --host | ||
``` | ||
|
||
## Building | ||
|
||
To create a production version of your app: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
## To Do | ||
|
||
You can preview the production build with `npm run preview`. | ||
* [ ] Actually delete the repo (currently just console log it) | ||
* [ ] Implement Vuex for toggle and username+token | ||
* [ ] Sort by | ||
* [ ] Multiple deletion | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script lang="ts"> | ||
import { userStore, patStore } from '$lib/utils/store'; | ||
import { github } from '$lib/utils/github'; | ||
import { AxiosError } from 'axios'; | ||
let pat = ''; | ||
async function fetchRepos() { | ||
patStore.set(pat); | ||
try { | ||
const response = await github.get('/user'); | ||
userStore.set({ ...response.data, total_repos: 0 }); | ||
} catch (error) { | ||
if (error instanceof AxiosError) { | ||
if (error.response !== undefined) { | ||
if (error.response.status === 401) { | ||
alert('Your token is not valid'); | ||
} else { | ||
alert(`Something went wrong: "${error.message}" with code ${error.response.status}`); | ||
} | ||
} else { | ||
alert(`Something went wrong: ${error.message}`); | ||
} | ||
} else { | ||
alert(error); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<form class="mt-10" on:submit|preventDefault={fetchRepos}> | ||
<input | ||
bind:value={pat} | ||
type="password" | ||
placeholder="Github Token" | ||
class="input input-bordered border-gray-500 w-full max-w-xs mr-4" | ||
/> | ||
<button class="btn btn-outline" type="submit">Fetch Data</button> | ||
</form> |
Oops, something went wrong.
84d6257
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
github-declutter – ./
github-declutter.vercel.app
github-declutter-tegarimansyah.vercel.app
github-declutter-git-refactor-move-to-svelte-tegarimansyah.vercel.app