cf-service-sdk 0.1.10 → 0.1.13
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 +61 -0
- package/dist/generated/graphql.d.ts +649 -1
- package/dist/generated/graphql.js +549 -4
- package/dist/mutations.js +199 -0
- package/dist/queries.d.ts +2 -0
- package/dist/queries.js +277 -3
- package/dist/sdk.d.ts +3 -1
- package/dist/sdk.js +14 -2
- package/package.json +2 -4
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# cf-service-sdk
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for the CloudForge Service, built with Apollo Client and GraphQL.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install cf-service-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
### Prerequisites
|
|
14
|
+
|
|
15
|
+
- Node.js
|
|
16
|
+
- The `cf-service` Django backend checked out as a sibling directory (`../cf-service`)
|
|
17
|
+
- Django virtual environment at `../cf-service/venv`
|
|
18
|
+
|
|
19
|
+
### Local Development Workflow
|
|
20
|
+
|
|
21
|
+
Use `update-local.sh` to pull the latest schema from the Django backend, regenerate all SDK files, build, and install the package directly into `cf-web` — all in one step.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
./update-local.sh
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This script will:
|
|
28
|
+
1. Clean the `dist` directory and remove old generated schema/documents
|
|
29
|
+
2. Pull the latest GraphQL schema from the Django backend (`npm run update-schema`)
|
|
30
|
+
3. Run GraphQL codegen to regenerate TypeScript types (`npm run generate`)
|
|
31
|
+
4. Run SDK codegen (`npm run generate-sdk`)
|
|
32
|
+
5. Install dependencies
|
|
33
|
+
6. Build the package
|
|
34
|
+
7. Pack and install it directly into `../cf-web`
|
|
35
|
+
|
|
36
|
+
> **Note:** Both `cf-service` and `cf-web` must be checked out as sibling directories alongside this repo.
|
|
37
|
+
|
|
38
|
+
### Publishing to npm
|
|
39
|
+
|
|
40
|
+
Use `publish.sh` to build and publish a new version to npm.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
./publish.sh
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This script will:
|
|
47
|
+
1. Verify you are logged in to npm (run `npm login` first if not)
|
|
48
|
+
2. Clean and regenerate all schema, documents, and SDK files
|
|
49
|
+
3. Check whether the current version in `package.json` already exists on npm
|
|
50
|
+
4. If it does, prompt you to bump the version (patch / minor / major)
|
|
51
|
+
5. Confirm before publishing
|
|
52
|
+
6. Publish the package with `npm publish --access public`
|
|
53
|
+
|
|
54
|
+
### npm Scripts
|
|
55
|
+
|
|
56
|
+
| Script | Description |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `npm run update-schema` | Pull GraphQL schema from Django and generate `.graphql` files |
|
|
59
|
+
| `npm run generate` | Run GraphQL codegen to produce TypeScript types |
|
|
60
|
+
| `npm run generate-sdk` | Generate the TypeScript SDK from GraphQL operations |
|
|
61
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|