@flexacms/cli 0.3.1 → 0.3.2
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 +5 -5
- package/dist/cli.js +2 -3
- package/dist/index.js +2 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,8 +16,8 @@ const flexa = createClient<FlexaSchema>({ url, apiKey });
|
|
|
16
16
|
|
|
17
17
|
Field types map to their API values: translatable fields become `Localized<T>`, selects become unions of their options, repeaters become arrays of typed items, relationships become ids, and optional fields are `| null`. Run the command again whenever a content model changes.
|
|
18
18
|
|
|
19
|
-
| Option | Default
|
|
20
|
-
| ------- |
|
|
21
|
-
| `--url` | `$FLEXA_URL`, then `https://flexacms.com` |
|
|
22
|
-
| `--key` | `$FLEXA_API_KEY` (Read ability)
|
|
23
|
-
| `--out` | `flexa.d.ts`
|
|
19
|
+
| Option | Default |
|
|
20
|
+
| ------- | --------------------------------------------- |
|
|
21
|
+
| `--url` | `$FLEXA_URL`, then `https://app.flexacms.com` |
|
|
22
|
+
| `--key` | `$FLEXA_API_KEY` (Read ability) |
|
|
23
|
+
| `--out` | `flexa.d.ts` |
|
package/dist/cli.js
CHANGED
|
@@ -21,9 +21,8 @@ function generateTypes(schemas) {
|
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
for (const schema of schemas) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
24
|
+
const summary = [schema.name, schema.description].filter(Boolean).join(" \u2014 ");
|
|
25
|
+
lines.push(`/** ${escapeComment(summary)} */`);
|
|
27
26
|
lines.push(`export interface ${names.get(schema.slug)} {`);
|
|
28
27
|
for (const field of schema.fields.filter(
|
|
29
28
|
(item) => item.is_active !== false
|
package/dist/index.js
CHANGED
|
@@ -13,9 +13,8 @@ function generateTypes(schemas) {
|
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
for (const schema of schemas) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
);
|
|
16
|
+
const summary = [schema.name, schema.description].filter(Boolean).join(" \u2014 ");
|
|
17
|
+
lines.push(`/** ${escapeComment(summary)} */`);
|
|
19
18
|
lines.push(`export interface ${names.get(schema.slug)} {`);
|
|
20
19
|
for (const field of schema.fields.filter(
|
|
21
20
|
(item) => item.is_active !== false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flexacms/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Generate TypeScript types from your Flexa CMS content models.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typecheck": "tsc -p tsconfig.json"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@flexacms/client": "^0.3.
|
|
45
|
+
"@flexacms/client": "^0.3.2"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=20"
|