Skip to content

Commit

Permalink
Misc. improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lostintangent authored Nov 19, 2023
1 parent 244d66b commit 9217a6a
Show file tree
Hide file tree
Showing 10 changed files with 6,450 additions and 3,975 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v0.6.0 (11/19/2023)

- Added the `New Gist` context menu to tag groups in the tree, which allows quickly creating a gist with the selected tag
- Fixed the ability to create new repos from a repo template
- Removed the GistLog integration, since that service is no longer active
- Updated the minimum VS Code version to >=1.75

## v0.5.1 (11/22/2022)

- Added a new `New Notebook` command, for quickly creating Jupyter notebook-based gists
Expand Down
10,154 changes: 6,362 additions & 3,792 deletions package-lock.json

Large diffs are not rendered by default.

109 changes: 35 additions & 74 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "GistPad",
"description": "Manage your code snippets and developer notes using GitHub Gists and repositories.",
"publisher": "vsls-contrib",
"version": "0.5.1",
"version": "0.6.0",
"extensionKind": [
"ui",
"workspace"
Expand All @@ -19,7 +19,7 @@
"homepage": "https://github.com/lostintangent/gistpad#readme",
"license": "MIT",
"engines": {
"vscode": "^1.48.0"
"vscode": "^1.75.0"
},
"categories": [
"Other"
Expand All @@ -32,40 +32,10 @@
"notes"
],
"activationEvents": [
"onCommand:gistpad.addFileToGist",
"onCommand:gistpad.addSelectionToGist",
"onCommand:gistpad.copyFileUrl",
"onCommand:gistpad.copyRepositoryFileUrl",
"onCommand:gistpad.deleteFile",
"onCommand:gistpad.deleteGist",
"onCommand:gistpad.followUser",
"onCommand:gistpad.forkGist",
"onCommand:gistpad.newGistLog",
"onCommand:gistpad.newNotebook",
"onCommand:gistpad.newPublicGist",
"onCommand:gistpad.newScratchNote",
"onCommand:gistpad.newSecretGist",
"onCommand:gistpad.newSecretSwing",
"onCommand:gistpad.newSwing",
"onCommand:gistpad.openGist",
"onCommand:gistpad.openGistNewWindow",
"onCommand:gistpad.openGistWorkspace",
"onCommand:gistpad.openRepository",
"onCommand:gistpad.openTodayPage",
"onCommand:gistpad.pasteGistFile",
"onCommand:gistpad.pasteImage",
"onCommand:gistpad.refreshGists",
"onCommand:gistpad.refreshRepositories",
"onCommand:gistpad.renameFile",
"onCommand:gistpad.renameRepositoryFile",
"onCommand:gistpad.starredGists",
"onFileSystem:gist",
"onFileSystem:repo",
"onStartupFinished",
"onUri",
"onView:gistpad.gists",
"onView:gistpad.repos",
"onView:gistpad.showcase"
"onUri"
],
"main": "./dist/extension.js",
"browser": "./dist/extension-web.js",
Expand Down Expand Up @@ -330,11 +300,6 @@
"command": "gistpad.mergeRepositoryBranch",
"title": "Merge Branch"
},
{
"command": "gistpad.newGistLog",
"title": "New GistLog",
"category": "GistPad"
},
{
"command": "gistpad.newSwing",
"title": "New CodeSwing",
Expand Down Expand Up @@ -363,6 +328,11 @@
"category": "GistPad",
"icon": "$(gist-secret)"
},
{
"command": "gistpad.newGistFromTag",
"title": "New Gist",
"icon": "$(add)"
},
{
"command": "gistpad.newNotebook",
"title": "New Notebook",
Expand All @@ -379,10 +349,6 @@
"command": "gistpad.openGistFile",
"title": "Open Gist File"
},
{
"command": "gistpad.openGistLogFeed",
"title": "View Feed in GistLog"
},
{
"command": "gistpad.openGistInBrowser",
"title": "View Gist in GitHub"
Expand All @@ -391,10 +357,6 @@
"command": "gistpad.openGistInBlocks",
"title": "View Gist in Bl.ocks"
},
{
"command": "gistpad.openGistInGistLog",
"title": "View Gist in GistLog"
},
{
"command": "gistpad.openGistInNbViewer",
"title": "View Gist in NbViewer"
Expand Down Expand Up @@ -596,10 +558,6 @@
"command": "gistpad.signIn",
"when": "gistpad:state != SignedIn"
},
{
"command": "gistpad.newGistLog",
"when": "gistpad:state == SignedIn"
},
{
"command": "gistpad.newNotebook",
"when": "gistpad:state == SignedIn"
Expand Down Expand Up @@ -792,6 +750,10 @@
"command": "gistpad.mergeRepositoryBranch",
"when": "false"
},
{
"command": "gistpad.newGistFromTag",
"when": "false"
},
{
"command": "gistpad.recordRepoCodeTour",
"when": "false"
Expand Down Expand Up @@ -820,18 +782,10 @@
"command": "gistpad.openGistInBrowser",
"when": "false"
},
{
"command": "gistpad.openGistLogFeed",
"when": "false"
},
{
"command": "gistpad.openGistInNbViewer",
"when": "false"
},
{
"command": "gistpad.openGistInGistLog",
"when": "false"
},
{
"command": "gistpad.openProfile",
"when": "false"
Expand Down Expand Up @@ -1028,9 +982,14 @@
"group": "open@2"
},
{
"command": "gistpad.openGistLogFeed",
"when": "viewItem == gists",
"group": "open@3"
"command": "gistpad.newGistFromTag",
"when": "viewItem == gistType.tag",
"group": "inline@1"
},
{
"command": "gistpad.newGistFromTag",
"when": "viewItem == gistType.tag",
"group": "new@1"
},
{
"command": "gistpad.openGist",
Expand Down Expand Up @@ -1077,11 +1036,6 @@
"when": "viewItem =~ /^(gists|starredGists|followedUser).gist.swing.block$/",
"group": "browse@4"
},
{
"command": "gistpad.openGistInGistLog",
"when": "viewItem =~ /^(gists|starredGists|followedUser).gist$/",
"group": "browse@4"
},
{
"command": "gistpad.openGistInNbViewer",
"when": "viewItem =~ /^(gists|starredGists|followedUser).gist.notebook$/",
Expand Down Expand Up @@ -1551,26 +1505,33 @@
"diff-match-patch": "^1.0.5",
"gists": "github:lostintangent/gists",
"github-base": "^1.0.0",
"https-browserify": "^1.0.0",
"is-binary-path": "^2.1.0",
"markdown-it": "^10.0.0",
"markdown-it-regex": "^0.2.0",
"mobx": "^5.14.2",
"moment": "^2.24.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"querystring-es3": "^0.2.1",
"rxjs": "^6.5.4",
"simple-git": "^1.126.0",
"title-case": "^3.0.2"
"stream-http": "^3.2.0",
"title-case": "^3.0.2",
"url": "^0.11.3",
"util": "^0.12.5"
},
"devDependencies": {
"@types/moment": "^2.13.0",
"@types/node": "^8.10.25",
"@types/vscode": "^1.48.0",
"@types/vscode": "^1.75.0",
"copy-webpack-plugin": "^5.0.5",
"ts-loader": "^6.2.1",
"ts-loader": "^9.5.1",
"tslint": "^5.8.0",
"typescript": "^3.7.3",
"vsce": "^1.95.0",
"typescript": "^5.2.2",
"vsce": "^2.15.0",
"vscode-nls-dev": "^3.3.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
}
}
21 changes: 15 additions & 6 deletions src/commands/gist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
import { ensureAuthenticated, getApi, signIn } from "../store/auth";
import {
FollowedUserGistNode,
GistGroupNode,
GistNode,
GistsNode,
StarredGistNode
Expand Down Expand Up @@ -60,7 +61,7 @@ export interface GistQuickPickItem extends QuickPickItem {
const newPublicGist = newGistInternal.bind(null, true);
const newSecretGist = newGistInternal.bind(null, false);

async function newGistInternal(isPublic: boolean = true) {
async function newGistInternal(isPublic: boolean = true, description: string = "") {
await ensureAuthenticated();

const title = "Create new " + (isPublic ? "" : "secret ") + "gist";
Expand All @@ -72,6 +73,8 @@ async function newGistInternal(isPublic: boolean = true) {
descriptionInputBox.prompt = "Enter an optional description for the new Gist";
descriptionInputBox.step = currentStep++;
descriptionInputBox.totalSteps = totalSteps;
descriptionInputBox.value = description;
descriptionInputBox.valueSelection = [0, 0];

descriptionInputBox.onDidAccept(() => {
descriptionInputBox.hide();
Expand Down Expand Up @@ -287,9 +290,8 @@ export async function registerGistCommands(context: ExtensionContext) {
async (node: GistNode) => {
// Note: The "html_url" property doesn't include the Gist's owner
// in it, and the API doesn't support that URL format
const url = `https://gist.github.com/${node.gist.owner!.login}/${
node.gist.id
}`;
const url = `https://gist.github.com/${node.gist.owner!.login}/${node.gist.id
}`;
env.clipboard.writeText(url);
}
)
Expand Down Expand Up @@ -449,6 +451,13 @@ export async function registerGistCommands(context: ExtensionContext) {
commands.registerCommand(`${EXTENSION_NAME}.newSecretGist`, newSecretGist)
);

context.subscriptions.push(
commands.registerCommand(`${EXTENSION_NAME}.newGistFromTag`, (node: GistGroupNode) => {
const description = ` #${node.label}`;
newSecretGist(description);
})
);

context.subscriptions.push(
commands.registerCommand(
`${EXTENSION_NAME}.openGist`,
Expand All @@ -459,8 +468,8 @@ export async function registerGistCommands(context: ExtensionContext) {
// don't pass on the tree node object to the open gist method.
const gistNode =
node instanceof GistNode ||
node instanceof StarredGistNode ||
node instanceof FollowedUserGistNode
node instanceof StarredGistNode ||
node instanceof FollowedUserGistNode
? node
: undefined;
openGistInternal({ node: gistNode });
Expand Down
81 changes: 0 additions & 81 deletions src/commands/gistLog.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { registerEditorCommands } from "./editor";
import { registerFileCommands } from "./file";
import { registerFollowCommands } from "./follow";
import { registerGistCommands } from "./gist";
import { registerGistLogCommands } from "./gistLog";
import { registerNotebookCommands } from "./notebook";
import { registerScratchCommands } from "./scratch";
import { registerTourCommands } from "./tour";
Expand All @@ -19,7 +18,6 @@ export function registerCommands(context: ExtensionContext) {
registerFileCommands(context);
registerFollowCommands(context);
registerGistCommands(context);
registerGistLogCommands(context);
registerNotebookCommands(context);
registerScratchCommands(context);
registerTourCommands(context);
Expand Down
Loading

0 comments on commit 9217a6a

Please sign in to comment.