-
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?
Conversation
packages/svelte/package.json
Outdated
| { | ||
| "name": "@hawk.so/svelte", | ||
| "version": "1.0.0", | ||
| "description": "Svelte/SvelteKit integration for hawk.javascript SDK", |
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.
| "description": "Svelte/SvelteKit integration for hawk.javascript SDK", | |
| "description": "Svelte/SvelteKit integration for Hawk Error Tracker", |
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.
Fixed.
packages/svelte/README.md
Outdated
| @@ -0,0 +1,3 @@ | |||
| # Hawk SDK for Svelte | |||
|
|
|||
| This package is a wrapper around `@hawk.so/javascript` for better integration with SvelteKit applications. | |||
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.
provide install & usage instructions instead
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.
Done.
package.json
Outdated
| "name": "@hawk.so/javascript", | ||
| "type": "commonjs", | ||
| "version": "3.2.11", | ||
| "private": true, |
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.
I'm not sure that this is a correct options in current setup, because @hawk.so/javascript is not a private package.
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.
Well, seems like yarn requires this option:
https://github.com/codex-team/hawk.javascript/actions/runs/20316524303/job/58361497429?pr=140
5771ae4 to
c2abe1d
Compare
- Create packages/svelte with TypeScript and Vite configuration - Configure workspace to use local @hawk.so/javascript sources - Add minimal package structure with build support
| // Just verification that main sources may be used in current workspace | ||
| // TODO: should be replaced with actual code during further implementation |
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.
Are these docs still actual?
| @@ -0,0 +1,9 @@ | |||
| /** | |||
| * @hawk.so/javascript-svelte | |||
| * Svelte/SvelteKit integration for Hawk.so JavaScript error tracker | |||
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.
| * Svelte/SvelteKit integration for Hawk.so JavaScript error tracker | |
| * Svelte/SvelteKit integration for Hawk Error Tracker |
| "build": "vite build" | ||
| }, | ||
| "dependencies": { | ||
| "@hawk.so/javascript": "file:../.." |
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.
seems strange, is it production ready?
| @@ -0,0 +1,23 @@ | |||
| # Hawk JavaScript Catcher: Svelte Integration | |||
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.
| # Hawk JavaScript Catcher: Svelte Integration | |
| # Hawk SDK for Svelte |
| Install package: | ||
|
|
||
| ```shell | ||
| npm install @hawk.so/javascript --save |
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.
why not @hawk.so/svelte?
|
|
||
| ## Usage | ||
|
|
||
| Install package: |
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.
| Install package: | |
| **1. Install package:** |
|
|
||
| Svelte is supported out of the box. Initialize HawkCatcher in app's client hooks. | ||
|
|
||
| Create or update `src/hooks.client.ts`: |
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.
| Create or update `src/hooks.client.ts`: | |
| **2. Create or update `src/hooks.client.ts`:** |
| Create or update `src/hooks.client.ts`: | ||
|
|
||
| ```ts | ||
| import HawkCatcher from '@hawk.so/javascript'; |
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.
same
| import HawkCatcher from '@hawk.so/javascript'; | |
| import Hawk from '@hawk.so/svelte'; | |
| new Hawk({...}) |
| build: { | ||
| lib: { | ||
| entry: path.resolve(__dirname, 'src', 'index.ts'), | ||
| name: 'HawkSvelte', |
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.
| name: 'HawkSvelte', | |
| name: 'Hawk', |
Closes #136
Created and configured
packages/svelteworkspace as module for implementing Svelte integration utilities in future.