diff --git a/package.json b/package.json index f40f657..01c1ec1 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "version": "0.0.0", "packageManager": "yarn@4.12.0", "workspaces": [ + "packages/core", "packages/javascript", "packages/sveltekit", "packages/sveltekit/playground" diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..e06be1d --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,40 @@ +{ + "name": "@hawk.so/core", + "version": "1.0.0", + "description": "Base implementation for all Hawk.so JavaScript SDKs", + "files": [ + "dist" + ], + "main": "./dist/hawk-core.umd.js", + "module": "./dist/hawk-core.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "source": "./src/index.ts", + "types": "./dist/index.d.ts", + "import": "./dist/hawk-core.mjs", + "require": "./dist/hawk-core.umd.js" + } + }, + "scripts": { + "build": "vite build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/codex-team/hawk.javascript.git", + "directory": "packages/core" + }, + "author": { + "name": "CodeX", + "email": "team@codex.so" + }, + "license": "AGPL-3.0-only", + "bugs": { + "url": "https://github.com/codex-team/hawk.javascript/issues" + }, + "homepage": "https://github.com/codex-team/hawk.javascript#readme", + "devDependencies": { + "vite": "^7.3.1", + "vite-plugin-dts": "^4.2.4" + } +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000..56896f0 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts new file mode 100644 index 0000000..2d03290 --- /dev/null +++ b/packages/core/vite.config.ts @@ -0,0 +1,22 @@ +import path from 'path'; +import dts from 'vite-plugin-dts'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => { + return { + build: { + copyPublicDir: false, + lib: { + entry: path.resolve(__dirname, 'src', 'index.ts'), + name: 'HawkCore', + fileName: 'hawk-core', + }, + }, + + plugins: [ + dts({ + tsconfigPath: './tsconfig.json', + }), + ], + }; +}); diff --git a/yarn.lock b/yarn.lock index 317217e..b4ec9e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -576,6 +576,15 @@ __metadata: languageName: node linkType: hard +"@hawk.so/core@workspace:packages/core": + version: 0.0.0-use.local + resolution: "@hawk.so/core@workspace:packages/core" + dependencies: + vite: "npm:^7.3.1" + vite-plugin-dts: "npm:^4.2.4" + languageName: unknown + linkType: soft + "@hawk.so/javascript@npm:^3.0.0, @hawk.so/javascript@workspace:packages/javascript": version: 0.0.0-use.local resolution: "@hawk.so/javascript@workspace:packages/javascript"