Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@grconrad/vscode-extension-feedback

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grconrad/vscode-extension-feedback - npm Package Compare versions

Comparing version 0.0.4 to 1.0.0

23

lib/checker.js

@@ -8,2 +8,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.checkNow = exports.checkForFeedback = void 0;
const types_1 = require("./types");

@@ -31,3 +32,3 @@ const state_1 = require("./state");

// Don't schedule another check.
state_1.setFeedbackCheckTimeoutId(null);
(0, state_1.setFeedbackCheckTimeoutId)(null);
return;

@@ -43,3 +44,3 @@ }

// Hang onto timeout id.
state_1.setFeedbackCheckTimeoutId(feedbackCheckTimeoutId);
(0, state_1.setFeedbackCheckTimeoutId)(feedbackCheckTimeoutId);
}

@@ -63,3 +64,3 @@ exports.checkForFeedback = checkForFeedback;

// If user has already provided feedback, don't ask anymore.
if (state_1.getLastFeedbackTime() !== undefined) {
if ((0, state_1.getLastFeedbackTime)() !== undefined) {
logFn("Skipping feedback prompt (feedback already provided)");

@@ -69,3 +70,3 @@ return types_1.FeedbackCheckResult.ALREADY_RESPONDED;

// If user has said "don't ask again", respect that.
if (state_1.getDontAsk()) {
if ((0, state_1.getDontAsk)()) {
logFn("Skipping feedback prompt (user doesn't want to be asked again)");

@@ -76,3 +77,3 @@ return types_1.FeedbackCheckResult.WONT_ASK;

// Have we ever run the feedback check?
const firstCheckedTime = state_1.getFirstCheckedTime();
const firstCheckedTime = (0, state_1.getFirstCheckedTime)();
// If we've never asked, don't ask now. This is the first time the feedback check is running,

@@ -82,3 +83,3 @@ // and probably the first time the extension is running. The user hasn't had enough time to use

if (firstCheckedTime === undefined) {
state_1.updateFirstCheckedTime(checkTime);
(0, state_1.updateFirstCheckedTime)(checkTime);
logFn("Skipping feedback prompt (too soon for first ask)");

@@ -88,3 +89,3 @@ return types_1.FeedbackCheckResult.TOO_SOON;

// We've run a check before, but might or might not have actually asked for feedback.
const lastAskedTime = state_1.getLastAskedTime();
const lastAskedTime = (0, state_1.getLastAskedTime)();
const { firstAskInterval, reminderInterval } = opts.timings;

@@ -103,9 +104,9 @@ if (lastAskedTime === undefined && ((checkTime - firstCheckedTime) < firstAskInterval)) {

// Ask now.
state_1.updateLastAskedTime(Date.now());
const result = await prompt_1.askForFeedback(vscodeApi, feedbackContext, opts);
(0, state_1.updateLastAskedTime)(Date.now());
const result = await (0, prompt_1.askForFeedback)(vscodeApi, feedbackContext, opts);
if (result === types_1.FeedbackCheckResult.RESPONSE_DONT_ASK) {
state_1.updateDontAsk(true);
(0, state_1.updateDontAsk)(true);
}
else if (result === types_1.FeedbackCheckResult.RESPONSE_FEEDBACK) {
state_1.updateLastFeedbackTime(Date.now());
(0, state_1.updateLastFeedbackTime)(Date.now());
}

@@ -112,0 +113,0 @@ return result;

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.clearStorage = exports.openExternalFeedbackForm = exports.scheduleFeedbackChecks = void 0;
const vscode_1 = require("vscode");

@@ -26,3 +27,3 @@ // Expected API

};
return scheduler_1.scheduleFeedbackChecks(vscodeApi, feedbackContext, opts);
return (0, scheduler_1.scheduleFeedbackChecks)(vscodeApi, feedbackContext, opts);
}

@@ -35,9 +36,10 @@ exports.scheduleFeedbackChecks = scheduleFeedbackChecks;

*/
exports.openExternalFeedbackForm = async function (feedbackFormUrl) {
const openExternalFeedbackForm = async function (feedbackFormUrl) {
const successful = await vscode_1.env.openExternal(vscode_1.Uri.parse(feedbackFormUrl));
return successful;
};
exports.openExternalFeedbackForm = openExternalFeedbackForm;
// To support upgrade scenarios or authors choosing to ignore prior feedback history
var state_1 = require("./state");
exports.clearStorage = state_1.clearStorage;
Object.defineProperty(exports, "clearStorage", { enumerable: true, get: function () { return state_1.clearStorage; } });
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultText = void 0;
const DEFAULT_PROMPT_TEXT = "Enjoying this extension? We'd love your feedback!";

@@ -4,0 +5,0 @@ const DEFAULT_OPEN_SURVEY_TEXT = "Give feedback";

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.askForFeedback = void 0;
const types_1 = require("./types");

@@ -8,0 +9,0 @@ /**

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.scheduleFeedbackChecks = void 0;
const state_1 = require("./state");

@@ -15,5 +16,5 @@ const timings_1 = require("./timings");

async function scheduleFeedbackChecks(vscodeApi, feedbackContext, opts) {
state_1.initState(feedbackContext.memento);
(0, state_1.initState)(feedbackContext.memento);
// Just to be defensive, make sure this hasn't been called before.
if (state_1.getFeedbackCheckTimeoutId() !== null) {
if ((0, state_1.getFeedbackCheckTimeoutId)() !== null) {
throw "scheduleFeedbackChecks called twice";

@@ -26,3 +27,3 @@ }

// Start the checking sequence.
await checker_1.checkForFeedback(vscodeApi, feedbackContext, opts);
await (0, checker_1.checkForFeedback)(vscodeApi, feedbackContext, opts);
// Return a disposable.

@@ -40,8 +41,8 @@ return {

function unscheduleFeedbackChecks() {
const feedbackCheckTimeoutId = state_1.getFeedbackCheckTimeoutId();
const feedbackCheckTimeoutId = (0, state_1.getFeedbackCheckTimeoutId)();
if (feedbackCheckTimeoutId !== null) {
clearTimeout(feedbackCheckTimeoutId);
state_1.setFeedbackCheckTimeoutId(null);
(0, state_1.setFeedbackCheckTimeoutId)(null);
}
}
//# sourceMappingURL=scheduler.js.map

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.clearState = exports.clearStorage = exports.updateDontAsk = exports.getDontAsk = exports.updateLastFeedbackTime = exports.getLastFeedbackTime = exports.updateLastAskedTime = exports.getLastAskedTime = exports.updateFirstCheckedTime = exports.getFirstCheckedTime = exports.StorageKey = exports.setFeedbackCheckTimeoutId = exports.getFeedbackCheckTimeoutId = exports.initState = void 0;
let state = null;

@@ -19,0 +20,0 @@ /**

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultTimings = void 0;
// Once per day, see if we need to do anything

@@ -8,0 +9,0 @@ const DEFAULT_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeedbackCheckResult = void 0;
var FeedbackCheckResult;

@@ -4,0 +5,0 @@ (function (FeedbackCheckResult) {

{
"name": "@grconrad/vscode-extension-feedback",
"version": "0.0.4",
"version": "1.0.0",
"description": "Timing based feedback gathering for VS Code extensions",

@@ -28,28 +28,25 @@ "keywords": [

"clean": "rimraf lib",
"coverage": "jest --coverage",
"dev:all": "yarn && yarn clean && yarn lint && yarn build && yarn test",
"lint": "eslint -c .eslintrc 'src/**/*.ts' --ext js,ts",
"test": "jest"
"test": "npm-run-all 'test:*'",
"test:vitest": "vitest run --coverage"
},
"jest": {
"preset": "ts-jest"
},
"devDependencies": {
"@types/jest": "^25.1.4",
"@types/node": "^13.9.5",
"@types/node": "^18.11.17",
"@types/vscode": "^1.43.0",
"@typescript-eslint/eslint-plugin": "^2.25.0",
"@typescript-eslint/parser": "^2.25.0",
"esdoc": "^1.1.0",
"eslint": "^6.5.1",
"jest": "^25.2.4",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"@vitest/coverage-c8": "^0.26.3",
"c8": "^7.12.0",
"eslint": "^8.9.0",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.0",
"ts-jest": "^25.3.0",
"ts-node": "^8.8.1",
"typescript": "^3.8.3"
"ts-node": "^10.0.0",
"typescript": "~4.9.4",
"vitest": "^0.26.3"
},
"volta": {
"node": "12.13.0",
"yarn": "1.19.1"
"node": "18.12.1",
"yarn": "1.22.19"
}
}

@@ -8,2 +8,4 @@ # @grconrad/vscode-extension-feedback

![Prompt](./assets/prompt.png)
Make a single API call from your extension's `activate` entry point.

@@ -39,3 +41,3 @@

logFn: (text: string) => {
outputChannel.appendLine(text);
channel.appendLine(text);
}

@@ -81,3 +83,3 @@ },

logFn: (text: string) => {
outputChannel.appendLine(text);
channel.appendLine(text);
}

@@ -84,0 +86,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc