flagwire-typegen 0.1.0 → 0.1.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/README.md +27 -6
- package/package.json +12 -1
package/README.md
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
# `flagwire-typegen`
|
|
2
2
|
|
|
3
|
-
Generate TypeScript
|
|
3
|
+
Generate TypeScript declarations for FlagWire keys and value types.
|
|
4
|
+
|
|
5
|
+
## Run
|
|
4
6
|
|
|
5
7
|
```sh
|
|
6
|
-
|
|
7
|
-
--
|
|
8
|
-
|
|
8
|
+
FLAGWIRE_SERVER_KEY=sk_live_... \
|
|
9
|
+
pnpm dlx flagwire-typegen --out src/flags.gen.ts
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Import the generated file once from your application entry point:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import "./flags.gen";
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
Calls to `@flagwire/sdk-js` and `@flagwire/sdk-node` then infer known flag keys and their value
|
|
19
|
+
types through TypeScript module augmentation.
|
|
20
|
+
|
|
21
|
+
## Options
|
|
22
|
+
|
|
23
|
+
| Option | Required | Default | Description |
|
|
24
|
+
| -------------- | -------- | -------------------------- | ------------------------------------- |
|
|
25
|
+
| `--out` | yes | — | Generated TypeScript file |
|
|
26
|
+
| `--key` | no | `FLAGWIRE_SERVER_KEY` | Server key used to fetch the manifest |
|
|
27
|
+
| `--project` | no | key's project | Explicit project identifier |
|
|
28
|
+
| `--base-url` | no | `https://api.flagwire.dev` | Manifest API endpoint |
|
|
29
|
+
| `--help`, `-h` | no | — | Print command usage |
|
|
30
|
+
|
|
31
|
+
Prefer `FLAGWIRE_SERVER_KEY` over a command-line key so the secret does not appear in shell history
|
|
32
|
+
or process listings. The CLI validates the manifest, rejects responses larger than 1 MiB, and
|
|
33
|
+
writes the generated file atomically. Never commit a server key.
|
package/package.json
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flagwire-typegen",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Generate type-safe FlagWire flag definitions",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"feature-flags",
|
|
7
|
+
"codegen",
|
|
8
|
+
"cli",
|
|
9
|
+
"typescript"
|
|
10
|
+
],
|
|
5
11
|
"license": "MIT",
|
|
12
|
+
"homepage": "https://github.com/flagwire/flagwire-js/tree/main/tools/typegen-cli#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/flagwire/flagwire-js/issues"
|
|
15
|
+
},
|
|
6
16
|
"type": "module",
|
|
7
17
|
"bin": {
|
|
8
18
|
"flagwire-typegen": "./dist/index.js"
|
|
@@ -26,6 +36,7 @@
|
|
|
26
36
|
"directory": "tools/typegen-cli"
|
|
27
37
|
},
|
|
28
38
|
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
29
40
|
"provenance": true
|
|
30
41
|
},
|
|
31
42
|
"devDependencies": {
|