Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@hawk.so/javascript",
"type": "commonjs",
"version": "3.2.11",
"workspaces": [
"packages/*"
],
"description": "JavaScript errors tracking for Hawk.so",
"files": [
"dist"
Expand Down
23 changes: 23 additions & 0 deletions packages/svelte/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Hawk JavaScript Catcher: Svelte Integration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Hawk JavaScript Catcher: Svelte Integration
# Hawk SDK for Svelte


Hawk Error Tracker integration for Svelte applications.

## Usage

Install package:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Install package:
**1. Install package:**


```shell
npm install @hawk.so/javascript --save
Copy link
Member

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?

```

Svelte is supported out of the box. Initialize HawkCatcher in app's client hooks.

Create or update `src/hooks.client.ts`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Create or update `src/hooks.client.ts`:
**2. Create or update `src/hooks.client.ts`:**


```ts
import HawkCatcher from '@hawk.so/javascript';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Suggested change
import HawkCatcher from '@hawk.so/javascript';
import Hawk from '@hawk.so/svelte';
new Hawk({...})


new HawkCatcher({
token: 'YOUR_INTEGRATION_TOKEN'
});
```
14 changes: 14 additions & 0 deletions packages/svelte/package.json
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:../.."
Copy link
Member

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?

}
}
9 changes: 9 additions & 0 deletions packages/svelte/src/index.ts
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Svelte/SvelteKit integration for Hawk.so JavaScript error tracker
* Svelte/SvelteKit integration for Hawk Error Tracker

*/

// 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
Copy link
Member

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?

export * from '@hawk.so/javascript';
export { default } from '@hawk.so/javascript';
10 changes: 10 additions & 0 deletions packages/svelte/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**/*"
]
}
23 changes: 23 additions & 0 deletions packages/svelte/vite.config.ts
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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: 'HawkSvelte',
name: 'Hawk',

fileName: 'hawk-svelte',
},
rollupOptions: {
external: ['svelte', '@hawk.so/javascript'],
},
},
plugins: [
dts({
tsconfigPath: './tsconfig.json',
}),
],
};
});
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"

"@hawk.so/javascript@file:.":
version "3.2.11"
dependencies:
"@hawk.so/types" "^0.1.36"
error-stack-parser "^2.1.4"
vite-plugin-dts "^4.2.4"

"@hawk.so/types@^0.1.36":
version "0.1.36"
resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.36.tgz#234b0e4c81bf5f50b1208910d45fc4ffb62e8ae1"
Expand Down
Loading