@contentful/app-scripts 1.19.1 → 1.20.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/lib/activate/index.js +3 -0
- package/lib/bin.js +7 -0
- package/lib/feedback/feedback.d.ts +2 -0
- package/lib/feedback/feedback.js +18 -0
- package/lib/feedback/index.d.ts +4 -0
- package/lib/feedback/index.js +15 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/upload/index.js +2 -0
- package/package.json +9 -7
package/lib/activate/index.js
CHANGED
|
@@ -4,13 +4,16 @@ exports.activate = void 0;
|
|
|
4
4
|
const activate_bundle_1 = require("./activate-bundle");
|
|
5
5
|
const get_activate_args_1 = require("./get-activate-args");
|
|
6
6
|
const build_bundle_activate_settings_1 = require("./build-bundle-activate-settings");
|
|
7
|
+
const feedback_1 = require("../feedback/feedback");
|
|
7
8
|
const interactive = async (options) => {
|
|
8
9
|
const settings = await (0, build_bundle_activate_settings_1.buildBundleActivateSettings)(options);
|
|
9
10
|
await (0, activate_bundle_1.activateBundle)(settings);
|
|
11
|
+
(0, feedback_1.logFeedbackNudge)();
|
|
10
12
|
};
|
|
11
13
|
const nonInteractive = async (options) => {
|
|
12
14
|
const settings = await (0, get_activate_args_1.getActivateSettingsArgs)(options);
|
|
13
15
|
await (0, activate_bundle_1.activateBundle)(settings);
|
|
16
|
+
(0, feedback_1.logFeedbackNudge)();
|
|
14
17
|
};
|
|
15
18
|
exports.activate = {
|
|
16
19
|
interactive,
|
package/lib/bin.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const index_1 = require("./index");
|
|
6
|
+
const feedback_1 = require("./feedback");
|
|
6
7
|
async function runCommand(command, options) {
|
|
7
8
|
const { ci } = commander_1.program.opts();
|
|
8
9
|
return ci ? await command.nonInteractive(options) : await command.interactive(options);
|
|
@@ -58,6 +59,12 @@ async function runCommand(command, options) {
|
|
|
58
59
|
.action(async (options) => {
|
|
59
60
|
await runCommand(index_1.cleanup, options);
|
|
60
61
|
});
|
|
62
|
+
commander_1.program
|
|
63
|
+
.command('feedback')
|
|
64
|
+
.description('Provide Contentful with feedback on the CLI')
|
|
65
|
+
.action(async (options) => {
|
|
66
|
+
await runCommand(feedback_1.feedback, options);
|
|
67
|
+
});
|
|
61
68
|
commander_1.program.hook('preAction', (thisCommand) => {
|
|
62
69
|
(0, index_1.track)({ command: thisCommand.args[0], ci: thisCommand.opts().ci });
|
|
63
70
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logFeedbackNudge = exports.openFeedbackLink = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const open_1 = __importDefault(require("open"));
|
|
9
|
+
function openFeedbackLink() {
|
|
10
|
+
(0, open_1.default)('https://87dc93gvoy0.typeform.com/to/d1RgWfZX');
|
|
11
|
+
}
|
|
12
|
+
exports.openFeedbackLink = openFeedbackLink;
|
|
13
|
+
function logFeedbackNudge() {
|
|
14
|
+
console.log(`Have any feedback for the ${chalk_1.default.blue('Conte')}${chalk_1.default.yellow('ntful')}${chalk_1.default.red(' CLI')}? We'd love to hear from you! Check out our five question developer experience survey at:
|
|
15
|
+
${chalk_1.default.underline('https://87dc93gvoy0.typeform.com/to/d1RgWfZX')}
|
|
16
|
+
`);
|
|
17
|
+
}
|
|
18
|
+
exports.logFeedbackNudge = logFeedbackNudge;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.feedback = void 0;
|
|
4
|
+
const feedback_1 = require("./feedback");
|
|
5
|
+
const nonInteractive = async () => {
|
|
6
|
+
(0, feedback_1.openFeedbackLink)();
|
|
7
|
+
};
|
|
8
|
+
const interactive = async () => {
|
|
9
|
+
// No difference between interactive and non-interactive mode for opening feedback link
|
|
10
|
+
nonInteractive();
|
|
11
|
+
};
|
|
12
|
+
exports.feedback = {
|
|
13
|
+
nonInteractive,
|
|
14
|
+
interactive
|
|
15
|
+
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.track = exports.open = exports.cleanup = exports.activate = exports.upload = exports.createAppDefinition = void 0;
|
|
3
|
+
exports.feedback = exports.track = exports.open = exports.cleanup = exports.activate = exports.upload = exports.createAppDefinition = void 0;
|
|
4
4
|
var create_app_definition_1 = require("./create-app-definition");
|
|
5
5
|
Object.defineProperty(exports, "createAppDefinition", { enumerable: true, get: function () { return create_app_definition_1.createAppDefinition; } });
|
|
6
6
|
var upload_1 = require("./upload");
|
|
@@ -13,3 +13,5 @@ var open_1 = require("./open");
|
|
|
13
13
|
Object.defineProperty(exports, "open", { enumerable: true, get: function () { return open_1.open; } });
|
|
14
14
|
var analytics_1 = require("./analytics");
|
|
15
15
|
Object.defineProperty(exports, "track", { enumerable: true, get: function () { return analytics_1.track; } });
|
|
16
|
+
var feedback_1 = require("./feedback");
|
|
17
|
+
Object.defineProperty(exports, "feedback", { enumerable: true, get: function () { return feedback_1.feedback; } });
|
package/lib/upload/index.js
CHANGED
|
@@ -5,10 +5,12 @@ const activate_bundle_1 = require("../activate/activate-bundle");
|
|
|
5
5
|
const get_upload_settings_args_1 = require("./get-upload-settings-args");
|
|
6
6
|
const create_app_bundle_1 = require("./create-app-bundle");
|
|
7
7
|
const build_upload_settings_1 = require("./build-upload-settings");
|
|
8
|
+
const feedback_1 = require("../feedback/feedback");
|
|
8
9
|
async function uploadAndActivate(settings) {
|
|
9
10
|
const bundle = await (0, create_app_bundle_1.createAppBundleFromSettings)(settings);
|
|
10
11
|
if (!settings.skipActivation && bundle) {
|
|
11
12
|
await (0, activate_bundle_1.activateBundle)({ ...settings, bundleId: bundle.sys.id });
|
|
13
|
+
(0, feedback_1.logFeedbackNudge)();
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
const interactive = async (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/app-scripts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "A collection of scripts for building Contentful Apps",
|
|
5
5
|
"author": "Contentful GmbH",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"prettier": "prettier **/*.js --write --ignore-path .gitignore",
|
|
29
29
|
"lint": "eslint ./src",
|
|
30
30
|
"lint:fix": "npm run lint -- --fix",
|
|
31
|
-
"test": "mocha \"./{,!(node_modules)/**/}*.test.
|
|
31
|
+
"test": "ts-mocha \"./{,!(node_modules)/**/}*.test.ts\"",
|
|
32
32
|
"test:watch": "npm t -- --watch",
|
|
33
33
|
"pre-commit": "lint-staged",
|
|
34
34
|
"build": "rm -rf lib && tsc"
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"adm-zip": "0.5.12",
|
|
52
52
|
"bottleneck": "2.19.5",
|
|
53
53
|
"chalk": "4.1.2",
|
|
54
|
-
"commander": "12.
|
|
55
|
-
"contentful-management": "11.25.
|
|
54
|
+
"commander": "12.1.0",
|
|
55
|
+
"contentful-management": "11.25.6",
|
|
56
56
|
"dotenv": "16.4.5",
|
|
57
57
|
"ignore": "5.3.1",
|
|
58
58
|
"inquirer": "8.2.6",
|
|
@@ -60,17 +60,19 @@
|
|
|
60
60
|
"open": "8.4.2",
|
|
61
61
|
"ora": "5.4.1"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ebf25f744dae8f8aa1c165ddcda2981e29fd489e",
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@tsconfig/node18": "18.2.4",
|
|
66
66
|
"@types/adm-zip": "0.5.5",
|
|
67
67
|
"@types/analytics-node": "3.1.14",
|
|
68
68
|
"@types/inquirer": "8.2.1",
|
|
69
|
-
"@types/lodash": "4.17.
|
|
69
|
+
"@types/lodash": "4.17.4",
|
|
70
|
+
"@types/mocha": "10.0.6",
|
|
70
71
|
"@types/proxyquire": "1.3.31",
|
|
71
72
|
"@types/sinon": "17.0.3",
|
|
72
73
|
"proxyquire": "2.1.3",
|
|
73
|
-
"sinon": "
|
|
74
|
+
"sinon": "18.0.0",
|
|
75
|
+
"ts-mocha": "10.0.0",
|
|
74
76
|
"ts-node": "10.9.2"
|
|
75
77
|
}
|
|
76
78
|
}
|