@locusai/sdk 0.21.17 → 0.22.1
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/PACKAGE_GUIDE.md +35 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/PACKAGE_GUIDE.md
CHANGED
|
@@ -212,35 +212,62 @@ Output uses the same prefix symbols as the Locus CLI (`●`, `⚠`, `✗`, `⋯`
|
|
|
212
212
|
|
|
213
213
|
## Step-by-step: adding a new package
|
|
214
214
|
|
|
215
|
-
###
|
|
215
|
+
### Quick start with `locus create`
|
|
216
|
+
|
|
217
|
+
The fastest way to scaffold a new package:
|
|
218
|
+
|
|
219
|
+
```sh
|
|
220
|
+
locus create <name>
|
|
221
|
+
# or with a custom description:
|
|
222
|
+
locus create <name> --description "My awesome integration"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
This generates the full directory structure, `package.json`, `tsconfig.json`,
|
|
226
|
+
entry points, and README — all with correct naming and configuration.
|
|
227
|
+
|
|
228
|
+
After scaffolding, skip to [step 6](#6-build-and-test-locally) below.
|
|
229
|
+
|
|
230
|
+
### Manual setup (if not using `locus create`)
|
|
231
|
+
|
|
232
|
+
#### 1. Create the package directory
|
|
216
233
|
|
|
217
234
|
```sh
|
|
218
235
|
mkdir -p packages/<name>/src packages/<name>/bin
|
|
219
236
|
```
|
|
220
237
|
|
|
221
|
-
|
|
238
|
+
#### 2. Create `package.json`
|
|
222
239
|
|
|
223
240
|
Use the template above. Set the `name` to `@locusai/locus-<name>` and fill in
|
|
224
241
|
the `locus` manifest.
|
|
225
242
|
|
|
226
|
-
|
|
243
|
+
#### 3. Create `tsconfig.json`
|
|
227
244
|
|
|
228
245
|
```json
|
|
229
246
|
{
|
|
230
|
-
"extends": "../../tsconfig.base.json",
|
|
231
247
|
"compilerOptions": {
|
|
232
|
-
"
|
|
248
|
+
"target": "ES2022",
|
|
249
|
+
"module": "ESNext",
|
|
250
|
+
"moduleResolution": "bundler",
|
|
251
|
+
"strict": true,
|
|
252
|
+
"skipLibCheck": true,
|
|
253
|
+
"esModuleInterop": true,
|
|
254
|
+
"isolatedModules": true,
|
|
255
|
+
"resolveJsonModule": true,
|
|
256
|
+
"noEmit": true,
|
|
233
257
|
"rootDir": "./src"
|
|
234
258
|
},
|
|
235
|
-
"include": ["src"]
|
|
259
|
+
"include": ["src/**/*"],
|
|
260
|
+
"exclude": ["node_modules", "dist", "bin"]
|
|
236
261
|
}
|
|
237
262
|
```
|
|
238
263
|
|
|
239
|
-
|
|
264
|
+
#### 4. Write your source code
|
|
240
265
|
|
|
241
266
|
Create `src/cli.ts` as the entry point:
|
|
242
267
|
|
|
243
268
|
```ts
|
|
269
|
+
#!/usr/bin/env node
|
|
270
|
+
|
|
244
271
|
import { main } from "./index.js";
|
|
245
272
|
|
|
246
273
|
main(process.argv.slice(2)).catch((error) => {
|
|
@@ -263,7 +290,7 @@ export async function main(args: string[]): Promise<void> {
|
|
|
263
290
|
}
|
|
264
291
|
```
|
|
265
292
|
|
|
266
|
-
|
|
293
|
+
#### 5. Add build script to root `package.json`
|
|
267
294
|
|
|
268
295
|
Add your package's build to the root `build:packages` script:
|
|
269
296
|
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED