-
Notifications
You must be signed in to change notification settings - Fork 4
feat: setup-metagram #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: setup-metagram #121
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5746157
feat: setup-metagram
grv-saini-20 76b4430
chore: tailwind css worked
grv-saini-20 d752800
feat: fonts added
grv-saini-20 bd3bb01
feat: typography
grv-saini-20 0d302c8
fix: removed stories and fixed setup for icons lib
grv-saini-20 b13d8a1
feat: icons and story file
grv-saini-20 a317a89
fix: type of args in story
grv-saini-20 e09c7cc
fix: lint errors
grv-saini-20 1818207
feat: colors added
grv-saini-20 4d641e1
feat: Button
grv-saini-20 77ab269
fix: format and lint
grv-saini-20 8deb910
fix: colors
grv-saini-20 27f58d4
fix: spinner
grv-saini-20 626368c
fix: code rebbit suggestions
grv-saini-20 71e5428
fix: code rebbit suggestions
grv-saini-20 025e98b
fix: paraglide removed
grv-saini-20 d28c107
fix: lock file
grv-saini-20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,28 @@ | ||
node_modules | ||
|
||
# Output | ||
.output | ||
.vercel | ||
.netlify | ||
.wrangler | ||
/.svelte-kit | ||
/build | ||
|
||
# OS | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Env | ||
.env | ||
.env.* | ||
!.env.example | ||
!.env.test | ||
|
||
# Vite | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
|
||
# Paraglide | ||
src/lib/paraglide | ||
|
||
*storybook.log |
This file contains hidden or 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 @@ | ||
engine-strict=true |
This file contains hidden or 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,6 @@ | ||
# Package Managers | ||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock | ||
bun.lock | ||
bun.lockb |
This file contains hidden or 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,18 @@ | ||
{ | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"printWidth": 100, | ||
"plugins": [ | ||
"prettier-plugin-svelte", | ||
"prettier-plugin-tailwindcss" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": "*.svelte", | ||
"options": { | ||
"parser": "svelte" | ||
} | ||
} | ||
] | ||
} |
This file contains hidden or 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,27 @@ | ||
import type { StorybookConfig } from '@storybook/sveltekit'; | ||
|
||
import { join, dirname } from "path" | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value: string): any { | ||
return dirname(require.resolve(join(value, 'package.json'))) | ||
} | ||
const config: StorybookConfig = { | ||
"stories": [ | ||
"../src/**/*.mdx", | ||
"../src/**/*.stories.@(js|ts|svelte)" | ||
], | ||
"addons": [ | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@storybook/addon-svelte-csf'), | ||
getAbsolutePath('@chromatic-com/storybook') | ||
], | ||
"framework": { | ||
"name": getAbsolutePath('@storybook/sveltekit'), | ||
"options": {} | ||
} | ||
}; | ||
export default config; |
This file contains hidden or 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,14 @@ | ||
import type { Preview } from '@storybook/svelte' | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains hidden or 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,38 @@ | ||
# sv | ||
|
||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). | ||
|
||
## Creating a project | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npx sv create | ||
|
||
# create a new project in my-app | ||
npx sv create 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 | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
|
||
## Building | ||
|
||
To create a production version of your app: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
You can preview the production build with `npm run preview`. | ||
|
||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. |
This file contains hidden or 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,40 @@ | ||
import prettier from 'eslint-config-prettier'; | ||
import js from '@eslint/js'; | ||
import { includeIgnoreFile } from '@eslint/compat'; | ||
import svelte from 'eslint-plugin-svelte'; | ||
import globals from 'globals'; | ||
import { fileURLToPath } from 'node:url'; | ||
import ts from 'typescript-eslint'; | ||
import svelteConfig from './svelte.config.js'; | ||
|
||
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); | ||
|
||
export default ts.config( | ||
includeIgnoreFile(gitignorePath), | ||
js.configs.recommended, | ||
...ts.configs.recommended, | ||
...svelte.configs.recommended, | ||
prettier, | ||
...svelte.configs.prettier, | ||
{ | ||
languageOptions: { | ||
globals: { ...globals.browser, ...globals.node } | ||
}, | ||
rules: { "no-undef": 'off' } | ||
This conversation was marked as resolved.
Outdated
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
files: [ | ||
'**/*.svelte', | ||
'**/*.svelte.ts', | ||
'**/*.svelte.js' | ||
], | ||
languageOptions: { | ||
parserOptions: { | ||
projectService: true, | ||
extraFileExtensions: ['.svelte'], | ||
parser: ts.parser, | ||
svelteConfig | ||
} | ||
} | ||
} | ||
); |
This file contains hidden or 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,4 @@ | ||
{ | ||
"$schema": "https://inlang.com/schema/inlang-message-format", | ||
"hello_world": "Hello, {name} from en!" | ||
} |
This file contains hidden or 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,4 @@ | ||
{ | ||
"$schema": "https://inlang.com/schema/inlang-message-format", | ||
"hello_world": "Hello, {name} from es!" | ||
} |
This file contains hidden or 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,50 @@ | ||
{ | ||
"name": "metagram", | ||
"private": true, | ||
"version": "0.0.1", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"prepare": "svelte-kit sync || echo ''", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"format": "prettier --write .", | ||
"lint": "prettier --check . && eslint .", | ||
"storybook": "storybook dev -p 6006", | ||
"build-storybook": "storybook build" | ||
}, | ||
"devDependencies": { | ||
"@eslint/compat": "^1.2.5", | ||
"@eslint/js": "^9.18.0", | ||
"@sveltejs/adapter-static": "^3.0.8", | ||
"@sveltejs/kit": "^2.16.0", | ||
"@sveltejs/vite-plugin-svelte": "^5.0.0", | ||
"@tailwindcss/vite": "^4.0.0", | ||
"eslint": "^9.18.0", | ||
"eslint-config-prettier": "^10.0.1", | ||
"eslint-plugin-svelte": "^3.0.0", | ||
"globals": "^16.0.0", | ||
"prettier": "^3.4.2", | ||
"prettier-plugin-svelte": "^3.3.3", | ||
"prettier-plugin-tailwindcss": "^0.6.11", | ||
"svelte": "^5.0.0", | ||
"svelte-check": "^4.0.0", | ||
"tailwindcss": "^4.0.0", | ||
"typescript": "^5.0.0", | ||
"typescript-eslint": "^8.20.0", | ||
"vite": "^6.2.6", | ||
"storybook": "^8.6.12", | ||
"@storybook/svelte": "^8.6.12", | ||
"@storybook/sveltekit": "^8.6.12", | ||
"@storybook/addon-essentials": "^8.6.12", | ||
"@storybook/blocks": "^8.6.12", | ||
"@storybook/test": "^8.6.12", | ||
"@storybook/addon-svelte-csf": "^5.0.0-next.0", | ||
"@chromatic-com/storybook": "^3" | ||
}, | ||
"dependencies": { | ||
"@inlang/paraglide-js": "^2.0.0" | ||
} | ||
} | ||
This conversation was marked as resolved.
Show resolved
Hide resolved
|
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
platforms/metagram/project.inlang/cache/plugins/ygx0uiahq6uw
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 @@ | ||
1lExt3FnvpxOpPeeZE |
This file contains hidden or 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,15 @@ | ||
{ | ||
"$schema": "https://inlang.com/schema/project-settings", | ||
"modules": [ | ||
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@4/dist/index.js", | ||
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@2/dist/index.js" | ||
], | ||
"plugin.inlang.messageFormat": { | ||
"pathPattern": "./messages/{locale}.json" | ||
}, | ||
This conversation was marked as resolved.
Show resolved
Hide resolved
|
||
"baseLocale": "en", | ||
"locales": [ | ||
"en", | ||
"es" | ||
] | ||
} |
This file contains hidden or 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,35 @@ | ||
@import 'tailwindcss'; | ||
This conversation was marked as resolved.
Show resolved
Hide resolved
|
||
|
||
@font-face { | ||
font-family: "Geist", sans-serif; | ||
font-style: normal; | ||
font-weight: 700; | ||
font-display: swap; | ||
src: url("/fonts/Geist-VariableFont_wght.ttf") format("truetype"); | ||
} | ||
|
||
@layer base { | ||
h1 { | ||
@apply font-geist text-xl/[1] font-semibold; | ||
} | ||
h2 { | ||
@apply font-geist text-lg/[1] font-medium; | ||
} | ||
h3 { | ||
@apply font-geist text-base/[1] font-normal; | ||
} | ||
p { | ||
@apply font-geist text-[15px]/[1] font-normal; | ||
} | ||
.small { | ||
@apply font-geist text-sm/[1] font-normal; | ||
} | ||
.subtext { | ||
@apply font-geist text-xs/[1] font-normal; | ||
} | ||
} | ||
|
||
@theme { | ||
/* fonts */ | ||
--font-geist: "Geist", sans-serif; | ||
} |
This file contains hidden or 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,13 @@ | ||
// See https://svelte.dev/docs/kit/types#app.d.ts | ||
// for information about these interfaces | ||
declare global { | ||
namespace App { | ||
// interface Error {} | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface PageState {} | ||
// interface Platform {} | ||
} | ||
} | ||
|
||
export {}; |
This file contains hidden or 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,12 @@ | ||
<!doctype html> | ||
<html lang="%paraglide.lang%"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
</html> |
This file contains hidden or 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,12 @@ | ||
import type { Handle } from '@sveltejs/kit'; | ||
import { paraglideMiddleware } from '$lib/paraglide/server'; | ||
This conversation was marked as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
const handleParaglide: Handle = ({ event, resolve }) => paraglideMiddleware(event.request, ({ request, locale }) => { | ||
event.request = request; | ||
|
||
return resolve(event, { | ||
transformPageChunk: ({ html }) => html.replace('%paraglide.lang%', locale) | ||
}); | ||
}); | ||
|
||
export const handle: Handle = handleParaglide; |
This file contains hidden or 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,3 @@ | ||
import { deLocalizeUrl } from '$lib/paraglide/runtime'; | ||
|
||
export const reroute = (request) => deLocalizeUrl(request.url).pathname; |
This file contains hidden or 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 @@ | ||
// place files you want to import through the `$lib` alias in this folder. | ||
This conversation was marked as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,7 @@ | ||
<script lang="ts"> | ||
import '../app.css'; | ||
|
||
let { children } = $props(); | ||
</script> | ||
|
||
{@render children()} |
This file contains hidden or 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,2 @@ | ||
export const prerender = true | ||
export const ssr = false |
This file contains hidden or 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,6 @@ | ||
<h1>metagram</h1> | ||
<h2>metagram</h2> | ||
<h3>metagram</h3> | ||
<p>metagram</p> | ||
<p class="small">metagram</p> | ||
<p class="subtext">metagram</p> | ||
This conversation was marked as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or 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 @@ | ||
<a href="/demo/paraglide">paraglide</a> |
This file contains hidden or 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,16 @@ | ||
<script lang="ts"> | ||
import { setLocale } from '$lib/paraglide/runtime'; | ||
import { page } from '$app/state'; | ||
import { goto } from '$app/navigation'; | ||
import { m } from '$lib/paraglide/messages.js'; | ||
</script> | ||
|
||
|
||
|
||
<h1>{m.hello_world({ name: 'SvelteKit User' })}</h1> | ||
<div> | ||
<button onclick={() => setLocale('en')}>en</button> | ||
<button onclick={() => setLocale('es')}>es</button> | ||
</div><p> | ||
If you use VSCode, install the <a href="https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension" target="_blank">Sherlock i18n extension</a> for a better i18n experience. | ||
</p> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.