@contentful/create-contentful-app 1.4.1 → 1.4.3
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/lib/index.js +1 -1
- package/lib/template.js +11 -7
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -87,7 +87,7 @@ function initProject(appName, options) {
|
|
|
87
87
|
yield (0, template_1.cloneTemplateIn)(fullAppFolder, normalizedOptions);
|
|
88
88
|
updatePackageName(fullAppFolder);
|
|
89
89
|
const useYarn = normalizedOptions.yarn || (0, utils_1.detectManager)() === 'yarn';
|
|
90
|
-
(0, logger_1.wrapInBlanks)((0, logger_1.highlight)(`---- Installing the dependencies for your app (
|
|
90
|
+
(0, logger_1.wrapInBlanks)((0, logger_1.highlight)(`---- Installing the dependencies for your app (using ${chalk_1.default.cyan(useYarn ? 'yarn' : 'npm')})...`));
|
|
91
91
|
if (useYarn) {
|
|
92
92
|
yield (0, utils_1.exec)('yarn', [], { cwd: fullAppFolder });
|
|
93
93
|
}
|
package/lib/template.js
CHANGED
|
@@ -32,7 +32,8 @@ function getGithubFolderNames(username, repo, path) {
|
|
|
32
32
|
const url = `https://api.github.com/repos/${username}/${repo}/contents/${path}`;
|
|
33
33
|
const response = yield (0, node_fetch_1.default)(url);
|
|
34
34
|
const contents = yield response.json();
|
|
35
|
-
return contents
|
|
35
|
+
return contents
|
|
36
|
+
.filter((content) => content.type === 'dir')
|
|
36
37
|
.map((content) => content.name);
|
|
37
38
|
});
|
|
38
39
|
}
|
|
@@ -43,20 +44,23 @@ function promptExampleSelection() {
|
|
|
43
44
|
const { starter } = yield inquirer_1.default.prompt([
|
|
44
45
|
{
|
|
45
46
|
name: 'starter',
|
|
46
|
-
message: 'Do you want to start with
|
|
47
|
+
message: 'Do you want to start with a blank template or use one of our examples?',
|
|
47
48
|
type: 'list',
|
|
48
49
|
choices: ['blank', 'example'],
|
|
49
50
|
default: 'blank',
|
|
50
51
|
},
|
|
51
52
|
]);
|
|
52
53
|
// if the user chose to use an blank template, ask which language they prefer
|
|
53
|
-
if (starter ===
|
|
54
|
+
if (starter === 'blank') {
|
|
54
55
|
const { language } = yield inquirer_1.default.prompt([
|
|
55
56
|
{
|
|
56
57
|
name: 'language',
|
|
57
|
-
message: 'Do you prefer
|
|
58
|
+
message: 'Do you prefer TypeScript or JavaScript',
|
|
58
59
|
type: 'list',
|
|
59
|
-
choices: [
|
|
60
|
+
choices: [
|
|
61
|
+
{ name: 'TypeScript', value: 'typescript' },
|
|
62
|
+
{ name: 'JavaScript', value: 'javascript' },
|
|
63
|
+
],
|
|
60
64
|
default: 'typescript',
|
|
61
65
|
},
|
|
62
66
|
]);
|
|
@@ -64,7 +68,7 @@ function promptExampleSelection() {
|
|
|
64
68
|
}
|
|
65
69
|
else {
|
|
66
70
|
// get available templates from examples
|
|
67
|
-
const availableTemplates = yield getGithubFolderNames(
|
|
71
|
+
const availableTemplates = yield getGithubFolderNames('contentful', 'apps', 'examples');
|
|
68
72
|
// ask user to select a template from the available examples
|
|
69
73
|
const { example } = yield inquirer_1.default.prompt([
|
|
70
74
|
{
|
|
@@ -101,7 +105,7 @@ function makeContentfulExampleSource(options) {
|
|
|
101
105
|
function getTemplateSource(options) {
|
|
102
106
|
var _a;
|
|
103
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
const source = (_a = options.source) !== null && _a !== void 0 ? _a : yield makeContentfulExampleSource(options);
|
|
108
|
+
const source = (_a = options.source) !== null && _a !== void 0 ? _a : (yield makeContentfulExampleSource(options));
|
|
105
109
|
if (options.source && !isContentfulTemplate(source)) {
|
|
106
110
|
(0, logger_1.warn)(`Template at ${(0, logger_1.highlight)(source)} is not an official Contentful app template!`);
|
|
107
111
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/create-contentful-app",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "A template for building Contentful Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contentful",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"@types/chalk": "2.2.0",
|
|
61
61
|
"@types/degit": "2.8.3",
|
|
62
62
|
"@types/inquirer": "8.2.1",
|
|
63
|
-
"@types/node": "14.18.
|
|
63
|
+
"@types/node": "14.18.36",
|
|
64
64
|
"@types/node-fetch": "^2.6.2",
|
|
65
65
|
"@types/rimraf": "3.0.2",
|
|
66
66
|
"@types/tildify": "2.0.2",
|
|
67
67
|
"@types/validate-npm-package-name": "4.0.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "cb4144f3bee72000942c71bf4e473706e9906823"
|
|
70
70
|
}
|