@contentful/create-contentful-app 1.1.0-alpha.6 → 1.1.0-alpha.9
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 +78 -8
- package/lib/index.js +4 -4
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -1,19 +1,89 @@
|
|
|
1
|
+
<!-- Don't forget to also update the corresponding README.md of the create-contentful-app package -->
|
|
2
|
+
|
|
1
3
|
# Create Contentful App
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
`create-contentful-app` is a command line interface to easily bootstrap [Contentful Apps](https://www.contentful.com/developers/docs/extensibility/app-framework/).
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
# Requirements
|
|
6
8
|
|
|
7
9
|
- Node.js v14.15 or v16
|
|
8
|
-
-
|
|
10
|
+
- npm v6 or later
|
|
11
|
+
|
|
12
|
+
# Usage
|
|
13
|
+
|
|
14
|
+
To start developing your first app, run:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx create-contentful-app my-first-app
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
## Bootstrap
|
|
23
|
+
|
|
24
|
+
You can run `create-contentful-app` using one of the following commands:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# npx
|
|
28
|
+
npx create-contentful-app <app-name>
|
|
29
|
+
|
|
30
|
+
# npm
|
|
31
|
+
npm init contentful-app <app-name>
|
|
32
|
+
|
|
33
|
+
# Yarn
|
|
34
|
+
yarn create contentful-app <app-name>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## CLI Options
|
|
38
|
+
|
|
39
|
+
### Package Manager
|
|
9
40
|
|
|
41
|
+
`--npm` or `--yarn`
|
|
10
42
|
|
|
11
|
-
|
|
43
|
+
Use npm or Yarn to manage dependencies. If omitted, defaults to the manager used to run `create-contentful-app`.
|
|
12
44
|
|
|
13
|
-
|
|
45
|
+
Both flags are mutually exclusive.
|
|
46
|
+
|
|
47
|
+
### Template
|
|
48
|
+
|
|
49
|
+
Select between predefined and custom templates:
|
|
50
|
+
|
|
51
|
+
- `-ts, --typescript`: Use TypeScript template (default)
|
|
52
|
+
- `-js, --javascript`: Use JavaScript template
|
|
53
|
+
- `-e, --example <example-name>`: Select a predefined template from https://github.com/contentful/apps/tree/master/examples
|
|
54
|
+
- `-s, --source <url>`: Use a custom template. Format: URL (HTTPS or SSH) or vendor:user/repo (e.g., github:user/repo)
|
|
55
|
+
|
|
56
|
+
These flags are mutually exclusive. If no flag is provided, the TypeScript template is used.
|
|
57
|
+
|
|
58
|
+
### Help
|
|
59
|
+
|
|
60
|
+
`--help`
|
|
61
|
+
|
|
62
|
+
Shows all available CLI options:
|
|
14
63
|
|
|
15
64
|
```
|
|
16
|
-
npx
|
|
17
|
-
|
|
18
|
-
|
|
65
|
+
Usage: npx create-contentful-app [options] [app-name]
|
|
66
|
+
|
|
67
|
+
Bootstrap your app inside a new folder `my-app`
|
|
68
|
+
|
|
69
|
+
create-contentful-app my-app
|
|
70
|
+
|
|
71
|
+
or specify your own template
|
|
72
|
+
|
|
73
|
+
create-contentful-app my-app --source "github:user/repo"
|
|
74
|
+
|
|
75
|
+
Official Contentful templates are hosted at https://github.com/contentful/apps/tree/master/examples.
|
|
76
|
+
|
|
77
|
+
Arguments:
|
|
78
|
+
app-name app name
|
|
79
|
+
|
|
80
|
+
Options:
|
|
81
|
+
--npm use npm
|
|
82
|
+
--yarn use Yarn
|
|
83
|
+
-js, --javascript use default JavaScript template
|
|
84
|
+
-ts, --typescript use default TypeScript template
|
|
85
|
+
-e, --example <example-name> bootstrap an example app from https://github.com/contentful/apps/tree/master/examples
|
|
86
|
+
-s, --source <url> provide a template by its source repository.
|
|
87
|
+
format: URL (HTTPS or SSH) or vendor:user/repo (e.g., github:user/repo)
|
|
88
|
+
-h, --help shows all available CLI options
|
|
19
89
|
```
|
package/lib/index.js
CHANGED
|
@@ -103,7 +103,7 @@ function initProject(appName, options) {
|
|
|
103
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
104
|
commander_1.program
|
|
105
105
|
.name(`npx ${(0, logger_1.code)('create-contentful-app')}`)
|
|
106
|
-
.helpOption(true)
|
|
106
|
+
.helpOption(true, 'shows all available CLI options')
|
|
107
107
|
.description([
|
|
108
108
|
'Bootstrap your app inside a new folder `my-app`',
|
|
109
109
|
'',
|
|
@@ -118,13 +118,13 @@ function initProject(appName, options) {
|
|
|
118
118
|
.argument('[app-name]', 'app name')
|
|
119
119
|
.option('--npm', 'use npm')
|
|
120
120
|
.option('--yarn', 'use Yarn')
|
|
121
|
-
.option('
|
|
122
|
-
.option('
|
|
121
|
+
.option('-ts, --typescript', 'use TypeScript template (default)')
|
|
122
|
+
.option('-js, --javascript', 'use JavaScript template')
|
|
123
|
+
.option('-e, --example <example-name>', 'bootstrap an example app from https://github.com/contentful/apps/tree/master/examples')
|
|
123
124
|
.option('-s, --source <url>', [
|
|
124
125
|
`provide a template by its source repository.`,
|
|
125
126
|
`format: URL (HTTPS or SSH) or ${(0, logger_1.code)('vendor:user/repo')} (e.g., ${(0, logger_1.code)('github:user/repo')})`,
|
|
126
127
|
].join('\n'))
|
|
127
|
-
.option('-e, --example <example-name>', 'bootstrap an example app from https://github.com/contentful/apps/tree/master/examples')
|
|
128
128
|
.action(initProject);
|
|
129
129
|
yield commander_1.program.parseAsync();
|
|
130
130
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/create-contentful-app",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.9",
|
|
4
4
|
"description": "A template for building Contentful Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contentful",
|
|
@@ -36,12 +36,11 @@
|
|
|
36
36
|
"build": "tsc"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@contentful/app-scripts": "^0.16.0-alpha.
|
|
39
|
+
"@contentful/app-scripts": "^0.16.0-alpha.2",
|
|
40
40
|
"chalk": "^4.1.0",
|
|
41
41
|
"commander": "^9.0.0",
|
|
42
|
-
"contentful-management": "^8.0.0",
|
|
43
42
|
"degit": "2.8.4",
|
|
44
|
-
"inquirer": "^8.2.
|
|
43
|
+
"inquirer": "^8.2.1",
|
|
45
44
|
"rimraf": "^3.0.2",
|
|
46
45
|
"tildify": "^2.0.0",
|
|
47
46
|
"validate-npm-package-name": "^3.0.0"
|
|
@@ -61,10 +60,10 @@
|
|
|
61
60
|
"@types/chalk": "^2.2.0",
|
|
62
61
|
"@types/degit": "^2.8.3",
|
|
63
62
|
"@types/inquirer": "^8.2.0",
|
|
64
|
-
"@types/node": "^
|
|
63
|
+
"@types/node": "^14.14.31",
|
|
65
64
|
"@types/rimraf": "^3.0.2",
|
|
66
65
|
"@types/tildify": "^2.0.2",
|
|
67
66
|
"@types/validate-npm-package-name": "^3.0.3"
|
|
68
67
|
},
|
|
69
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "c2e26ece746ca718b1fe38bf7c933ed8b1cd102a"
|
|
70
69
|
}
|