@levrbet/shared 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -107,6 +107,48 @@ This package bundles server dependencies for the best developer experience:
|
|
|
107
107
|
npm run clean
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
## 🔗 Local Development with npm link
|
|
111
|
+
|
|
112
|
+
For developing and testing changes locally without publishing:
|
|
113
|
+
|
|
114
|
+
### 1. Setup shared package for development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cd /path/to/levr-shared
|
|
118
|
+
npm run build # Initial build
|
|
119
|
+
npm link # Register package globally
|
|
120
|
+
npm run dev # Start watch mode (auto-rebuilds on changes)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 2. Link in your consumer projects
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
cd /path/to/your-consumer-app
|
|
127
|
+
npm link @levrbet/shared
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 3. Development workflow
|
|
131
|
+
|
|
132
|
+
- **Shared package**: Keep `npm run dev` running (auto-rebuilds on file changes)
|
|
133
|
+
- **Consumer apps**: Run normally (`npm start`, `npm run dev`, etc.)
|
|
134
|
+
- **Changes**: Edit files in shared package → TypeScript auto-compiles → consumers get updates instantly
|
|
135
|
+
|
|
136
|
+
### 4. When finished developing
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# In consumer projects - unlink and use published version
|
|
140
|
+
cd /path/to/consumer-app
|
|
141
|
+
npm unlink @levrbet/shared
|
|
142
|
+
npm install @levrbet/shared
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Available Scripts
|
|
146
|
+
|
|
147
|
+
- `npm run build` - Full build (Prisma + TypeScript + assets)
|
|
148
|
+
- `npm run watch` - TypeScript watch mode only
|
|
149
|
+
- `npm run dev` - Initial build + watch mode
|
|
150
|
+
- `npm run build:tsc` - TypeScript build only (faster)
|
|
151
|
+
|
|
110
152
|
## 🔒 Pre-commit Hooks Setup
|
|
111
153
|
|
|
112
154
|
1. **Install Python 3.11+** from [python.org/downloads](https://www.python.org/downloads/)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levrbet/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "npx prisma generate && npx tsc && npm run copy-assets",
|
|
34
|
+
"build:tsc": "npx tsc",
|
|
35
|
+
"watch": "npx tsc --watch",
|
|
36
|
+
"dev": "npm link && npm run build && npm run watch",
|
|
34
37
|
"copy-assets": "mkdir -p dist/server/oracle/prisma/generated && cp -r src/server/oracle/prisma/generated/* dist/server/oracle/prisma/generated/ 2>/dev/null || true && mkdir -p dist/server/contracts/clients/relayer-sdk && cp -r src/server/contracts/clients/relayer-sdk/* dist/server/contracts/clients/relayer-sdk/ 2>/dev/null || true",
|
|
35
38
|
"clean": "rm -rf dist",
|
|
36
39
|
"prepublishOnly": "npm run build"
|