Skip to content

Commit 04a11f7

Browse files
committed
workable
1 parent b83d6e2 commit 04a11f7

11 files changed

Lines changed: 152 additions & 771 deletions

File tree

package-lock.json

Lines changed: 15 additions & 574 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"icon": "socket-square.png",
3535
"activationEvents": [
3636
"workspaceConatains:**/[pP][aA][cC][kK][aA][gG][eE].[jJ][sS][oO][nN]",
37-
"workspaceContains:**/[sS][oO][cC][kK][eE][tT].[yY][mM][lL]",
3837
"workspaceContains:**/[rR][eE][qQ][uU][iI][rR][eE][mM][eE][nN][tT][sS].[tT][xX][tT]",
3938
"workspaceContains:**/[pP][yY][pP][rR][oO][jJ][eE][cC][tT].[tT][oO][mM][lL]",
4039
"workspaceContains:**/[pP][iI][pP][fF][iI][lL][eE]",
@@ -76,7 +75,7 @@
7675
"publisher": "SocketSecurity",
7776
"scripts": {
7877
"vscode:prepublish": "npm run esbuild -- --minify",
79-
"esbuild-base": "esbuild --bundle --external:vscode --loader:.wasm=binary --loader:.go=file --loader:.py=text --outdir=out/ --platform=node --sourcemap",
78+
"esbuild-base": "esbuild --bundle --external:tree-sitter-java --external:vscode --loader:.wasm=binary --loader:.go=file --loader:.py=text --outdir=out/ --platform=node --sourcemap",
8079
"esbuild": "npm run esbuild-base -- --format=cjs main=src/extension.ts",
8180
"test-compile": "tsc -p ./",
8281
"lint": "eslint \"src/**/*.ts\"",
@@ -91,16 +90,15 @@
9190
"@socketsecurity/registry": "^1.0.66",
9291
"@vscode/python-extension": "^1.0.5",
9392
"@vscode/vsce": "^3.6.0",
94-
"ini": "^3.0.1",
95-
"json-to-ast": "^2.1.0",
96-
"octokit": "^3.1.2"
93+
"ini": "^5.0.0",
94+
"json-to-ast": "^2.1.0"
9795
},
9896
"devDependencies": {
9997
"@types/babel__traverse": "^7.20.7",
10098
"@types/ini": "^1.3.31",
10199
"@types/json-to-ast": "^2.1.2",
102100
"@types/micromatch": "^4.0.2",
103-
"@types/node": "^16.11.7",
101+
"@types/node": "^24.0.15",
104102
"@types/vscode": "^1.26.0",
105103
"@typescript-eslint/eslint-plugin": "^5.42.0",
106104
"@typescript-eslint/parser": "^5.42.0",

src/data/github.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import * as vscode from 'vscode'
22
import { parseTOML, getStaticTOMLValue } from 'toml-eslint-parser';
33
import ini from 'ini'
4-
import { Octokit } from 'octokit';
5-
import { getWorkspaceFolderURI } from '../util';
64

75
function orgOrUserFromString(url: string): string | undefined {
86
const ghHTTP = /^(?:git\+)?https?:\/\/(?:www.)?github.com(?::80|:443)?\/(?<target>[^\/\?#]*)(?=\/|$)/u;
@@ -77,58 +75,3 @@ export async function sniffForGithubOrgOrUser(workspaceRootURI: vscode.Uri): Pro
7775
}
7876
} catch (e) {}
7977
}
80-
81-
export function installGithubApp(uri: vscode.Uri) {return
82-
vscode.authentication.getSession('github', [
83-
'read:user',
84-
'read:org'
85-
], {
86-
createIfNone: true,
87-
}).then(
88-
async s => {
89-
const client = new Octokit({
90-
auth: s.accessToken,
91-
})
92-
let workspaceFolderURI = getWorkspaceFolderURI(uri)
93-
if (!workspaceFolderURI) {
94-
// can't be smart, just open it
95-
workspaceFolderURI = vscode.Uri.joinPath(uri, '.')
96-
}
97-
const orgOrUser = await sniffForGithubOrgOrUser(workspaceFolderURI)
98-
const currentUser = await client.rest.users.getAuthenticated()
99-
let id
100-
if (currentUser.data.login === orgOrUser) {
101-
id = currentUser.data.id
102-
} else {
103-
const userOrgs = await client.rest.orgs.listForAuthenticatedUser()
104-
const matchingOrg = userOrgs.data.find(org => {
105-
return org.login === orgOrUser
106-
})
107-
if (matchingOrg) {
108-
id = matchingOrg.id
109-
}
110-
}
111-
if (id) {
112-
vscode.env.openExternal(
113-
vscode.Uri.parse(
114-
`https://github.com/apps/socket-security/installations/new/permissions?target_id=${id}`
115-
)
116-
)
117-
} else {
118-
vscode.env.openExternal(
119-
vscode.Uri.parse(
120-
`https://github.com/apps/socket-security/installations/new/`
121-
)
122-
)
123-
}
124-
},
125-
() => {
126-
// user did not want to use vscode auth
127-
vscode.env.openExternal(
128-
vscode.Uri.parse(
129-
`https://github.com/apps/socket-security/installations/new/`
130-
)
131-
)
132-
}
133-
)
134-
}

src/data/python/builtins.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)