Skip to content

Commit 5771ae4

Browse files
committed
feat(svelte-integration): set up svelte package workspace
- Create packages/svelte with TypeScript and Vite configuration - Configure workspace to use local @hawk.so/javascript sources - Add minimal package structure with build support
1 parent 001c8ab commit 5771ae4

File tree

7 files changed

+70
-0
lines changed

7 files changed

+70
-0
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "@hawk.so/javascript",
33
"type": "commonjs",
44
"version": "3.2.11",
5+
"private": true,
6+
"workspaces": [
7+
"packages/*"
8+
],
59
"description": "JavaScript errors tracking for Hawk.so",
610
"files": [
711
"dist"

packages/svelte/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Hawk SDK for Svelte
2+
3+
This package is a wrapper around `@hawk.so/javascript` for better integration with SvelteKit applications.

packages/svelte/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@hawk.so/svelte",
3+
"version": "1.0.0",
4+
"description": "Svelte/SvelteKit integration for hawk.javascript SDK",
5+
"main": "./dist/hawk-svelte.umd.js",
6+
"module": "./dist/hawk-svelte.mjs",
7+
"types": "dist/index.d.ts",
8+
"scripts": {
9+
"build": "vite build"
10+
},
11+
"dependencies": {
12+
"@hawk.so/javascript": "file:../.."
13+
}
14+
}

packages/svelte/src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @hawk.so/javascript-svelte
3+
* Svelte/SvelteKit integration for Hawk.so JavaScript error tracker
4+
*/
5+
6+
// Just verification that main sources may be used in current workspace
7+
// TODO: should be replaced with actual code during further implementation
8+
export * from '@hawk.so/javascript';
9+
export { default } from '@hawk.so/javascript';

packages/svelte/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"rootDir": "src"
6+
},
7+
"include": [
8+
"src/**/*"
9+
]
10+
}

packages/svelte/vite.config.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import path from 'path';
2+
import dts from 'vite-plugin-dts';
3+
import { defineConfig } from 'vite';
4+
5+
export default defineConfig(() => {
6+
return {
7+
build: {
8+
lib: {
9+
entry: path.resolve(__dirname, 'src', 'index.ts'),
10+
name: 'HawkSvelte',
11+
fileName: 'hawk-svelte',
12+
},
13+
rollupOptions: {
14+
external: ['svelte', '@hawk.so/javascript'],
15+
},
16+
},
17+
plugins: [
18+
dts({
19+
tsconfigPath: './tsconfig.json',
20+
}),
21+
],
22+
};
23+
});

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@
316316
minimatch "^3.0.4"
317317
strip-json-comments "^3.1.1"
318318

319+
"@hawk.so/javascript@file:.":
320+
version "3.2.11"
321+
dependencies:
322+
"@hawk.so/types" "^0.1.36"
323+
error-stack-parser "^2.1.4"
324+
vite-plugin-dts "^4.2.4"
325+
319326
"@hawk.so/types@^0.1.36":
320327
version "0.1.36"
321328
resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.36.tgz#234b0e4c81bf5f50b1208910d45fc4ffb62e8ae1"

0 commit comments

Comments
 (0)