@contentful/app-scripts 2.4.0 → 2.5.0
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 +34 -0
- package/lib/upload/create-app-bundle.js +0 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -60,6 +60,40 @@ interface Script<Result, Options> {
|
|
|
60
60
|
>
|
|
61
61
|
> Both interactive and nonInteractive version of the same script is meant to return the same result.
|
|
62
62
|
|
|
63
|
+
### Generate Function
|
|
64
|
+
Allows generating a new function template from our [function examples](https://github.com/contentful/apps/tree/master/function-examples). Automatically updates `contentful-app-manifest.json` and merges scripts/dependencies from `package.json` into existing project.
|
|
65
|
+
|
|
66
|
+
#### Interactive mode:
|
|
67
|
+
|
|
68
|
+
In the interactive mode, the CLI will ask for all required options.
|
|
69
|
+
|
|
70
|
+
> **Example**
|
|
71
|
+
>
|
|
72
|
+
> ```shell
|
|
73
|
+
> $ npx --no-install @contentful/app-scripts generate-function
|
|
74
|
+
> ```
|
|
75
|
+
|
|
76
|
+
#### Non-interactive mode:
|
|
77
|
+
|
|
78
|
+
When passing the `--ci` argument the command will fail when the required variables are not set as arguments.
|
|
79
|
+
|
|
80
|
+
> **Example**
|
|
81
|
+
>
|
|
82
|
+
> ```shell
|
|
83
|
+
> $ npx --no-install @contentful/app-scripts generate-function --ci \
|
|
84
|
+
> --name <name> \
|
|
85
|
+
> --example <example> \
|
|
86
|
+
> --language <javascript/typescript> \
|
|
87
|
+
> ```
|
|
88
|
+
|
|
89
|
+
**Options:**
|
|
90
|
+
|
|
91
|
+
| Argument | Description | Default value |
|
|
92
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- |
|
|
93
|
+
| `--name` | The name of your function. | |
|
|
94
|
+
| `--example` | The name of the example as listed in our [function examples](https://github.com/contentful/apps/tree/master/function-examples) | |
|
|
95
|
+
| `--language` | Choice of javascript or typescript | |
|
|
96
|
+
|
|
63
97
|
### Create App Definition
|
|
64
98
|
|
|
65
99
|
Allows creating a new [AppDefinition](https://www.contentful.com/developers/docs/extensibility/app-framework/app-definition/)
|
|
@@ -48,9 +48,6 @@ function processCreateAppBundleError(err) {
|
|
|
48
48
|
if (reasons.includes('Not entitled to App Functions.')) {
|
|
49
49
|
return 'Your app seems to be using App Functions, which your organization is not entitled to. Remove your app function, or upgrade your account to proceed with your app upload.';
|
|
50
50
|
}
|
|
51
|
-
else if (reasons.includes('App Functions beta not enabled.')) {
|
|
52
|
-
return 'Your app seems to be using App Functions, which your organization has not enabled in the Preview Center. In the Contentful web app, go to the Account Menu → Preview Center → App Functions to enable and proceed with your app upload.';
|
|
53
|
-
}
|
|
54
51
|
else {
|
|
55
52
|
return reasons;
|
|
56
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/app-scripts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "A collection of scripts for building Contentful Apps",
|
|
5
5
|
"author": "Contentful GmbH",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"tiged": "^2.12.7",
|
|
68
68
|
"zod": "^3.24.1"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "f60bbb2e3b86350ae3ae6125f1cf4a5c1ccf85e6",
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/adm-zip": "0.5.7",
|
|
73
73
|
"@types/analytics-node": "3.1.14",
|