-
Notifications
You must be signed in to change notification settings - Fork 4
Set up svelte package workspace #140
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||
| # Hawk JavaScript Catcher: Svelte Integration | ||||||||||
|
|
||||||||||
| Hawk Error Tracker integration for Svelte applications. | ||||||||||
|
|
||||||||||
| ## Usage | ||||||||||
|
|
||||||||||
| Install package: | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| npm install @hawk.so/javascript --save | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not |
||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Svelte is supported out of the box. Initialize HawkCatcher in app's client hooks. | ||||||||||
|
|
||||||||||
| Create or update `src/hooks.client.ts`: | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
|
||||||||||
| ```ts | ||||||||||
| import HawkCatcher from '@hawk.so/javascript'; | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same
Suggested change
|
||||||||||
|
|
||||||||||
| new HawkCatcher({ | ||||||||||
| token: 'YOUR_INTEGRATION_TOKEN' | ||||||||||
| }); | ||||||||||
| ``` | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "name": "@hawk.so/svelte", | ||
| "version": "1.0.0", | ||
| "description": "Svelte/SvelteKit integration for Hawk Error Tracker", | ||
| "main": "./dist/hawk-svelte.umd.js", | ||
| "module": "./dist/hawk-svelte.mjs", | ||
| "types": "dist/index.d.ts", | ||
| "scripts": { | ||
| "build": "vite build" | ||
| }, | ||
| "dependencies": { | ||
| "@hawk.so/javascript": "file:../.." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems strange, is it production ready? |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||
| /** | ||||||
| * @hawk.so/javascript-svelte | ||||||
| * Svelte/SvelteKit integration for Hawk.so JavaScript error tracker | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| */ | ||||||
|
|
||||||
| // Just verification that main sources may be used in current workspace | ||||||
| // TODO: should be replaced with actual code during further implementation | ||||||
|
Comment on lines
+6
to
+7
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these docs still actual? |
||||||
| export * from '@hawk.so/javascript'; | ||||||
| export { default } from '@hawk.so/javascript'; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "extends": "../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "dist", | ||
| "rootDir": "src" | ||
| }, | ||
| "include": [ | ||
| "src/**/*" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||
| import path from 'path'; | ||||||
| import dts from 'vite-plugin-dts'; | ||||||
| import { defineConfig } from 'vite'; | ||||||
|
|
||||||
| export default defineConfig(() => { | ||||||
| return { | ||||||
| build: { | ||||||
| lib: { | ||||||
| entry: path.resolve(__dirname, 'src', 'index.ts'), | ||||||
| name: 'HawkSvelte', | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| fileName: 'hawk-svelte', | ||||||
| }, | ||||||
| rollupOptions: { | ||||||
| external: ['svelte', '@hawk.so/javascript'], | ||||||
| }, | ||||||
| }, | ||||||
| plugins: [ | ||||||
| dts({ | ||||||
| tsconfigPath: './tsconfig.json', | ||||||
| }), | ||||||
| ], | ||||||
| }; | ||||||
| }); | ||||||
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.