Skip to content

Commit 5587ea3

Browse files
committed
Init extension
0 parents  commit 5587ea3

File tree

9 files changed

+7092
-0
lines changed

9 files changed

+7092
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[*]
2+
insert_final_newline = true
3+
end_of_line = lf
4+
charset = utf-8
5+
trim_trailing_whitespace = true
6+
indent_style = space
7+
indent_size = 4
8+
9+
[*.{json,js,yml}]
10+
indent_size = 2
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": [
3+
"@sourcegraph/eslint-config"
4+
],
5+
"parserOptions": {
6+
"project": "tsconfig.json"
7+
}
8+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
.cache/

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# find-replace (Sourcegraph extension)
2+
3+
Perform a find-replace over multiple repositories by creating a Sourcegraph campaign.

package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/sourcegraph/sourcegraph/main/client/shared/src/schema/extension.schema.json",
3+
"name": "find-replace",
4+
"description": "",
5+
"publisher": "sourcegraph",
6+
"activationEvents": [
7+
"*"
8+
],
9+
"wip": true,
10+
"categories": [],
11+
"tags": [],
12+
"contributes": {
13+
"actions": [],
14+
"menus": {
15+
"editor/title": [],
16+
"commandPalette": []
17+
},
18+
"configuration": {}
19+
},
20+
"version": "0.0.0-DEVELOPMENT",
21+
"license": "Apache-2.0",
22+
"main": "dist/find-replace.js",
23+
"scripts": {
24+
"eslint": "eslint 'src/**/*.ts'",
25+
"typecheck": "tsc -p tsconfig.json",
26+
"build": "parcel build --out-file dist/find-replace.js src/find-replace.ts",
27+
"symlink-package": "mkdirp dist && lnfs ./package.json ./dist/package.json",
28+
"serve": "yarn run symlink-package && parcel serve --no-hmr --out-file dist/find-replace.js src/find-replace.ts",
29+
"watch:typecheck": "tsc -p tsconfig.json -w",
30+
"watch:build": "tsc -p tsconfig.dist.json -w",
31+
"sourcegraph:prepublish": "yarn run typecheck && yarn run build"
32+
},
33+
"browserslist": [
34+
"last 1 Chrome versions",
35+
"last 1 Firefox versions",
36+
"last 1 Edge versions",
37+
"last 1 Safari versions"
38+
],
39+
"devDependencies": {
40+
"@sourcegraph/eslint-config": "^0.20.11",
41+
"@sourcegraph/tsconfig": "^4.0.1",
42+
"eslint": "^7.11.0",
43+
"lnfs-cli": "^2.1.0",
44+
"mkdirp": "^1.0.4",
45+
"parcel-bundler": "^1.12.4",
46+
"sourcegraph": "^24.7.0",
47+
"typescript": "^4.0.3"
48+
}
49+
}

prettier.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@sourcegraph/prettierrc')

src/find-replace.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as sourcegraph from 'sourcegraph'
2+
3+
export function activate(ctx: sourcegraph.ExtensionContext): void {
4+
ctx.subscriptions.add(
5+
sourcegraph.languages.registerHoverProvider(['*'], {
6+
provideHover: () => ({
7+
contents: {
8+
value: 'Hello world from find-replace! 🎉🎉🎉',
9+
kind: sourcegraph.MarkupKind.Markdown
10+
}
11+
}),
12+
})
13+
)
14+
}
15+
16+
// Sourcegraph extension documentation: https://docs.sourcegraph.com/extensions/authoring

tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@sourcegraph/tsconfig",
3+
"compilerOptions": {
4+
"target": "ES2019",
5+
"module": "ESNext",
6+
"moduleResolution": "Node",
7+
"sourceMap": true,
8+
"declaration": true,
9+
"outDir": "dist",
10+
"rootDir": "src",
11+
"esModuleInterop": true,
12+
"allowSyntheticDefaultImports": true
13+
}
14+
}

0 commit comments

Comments
 (0)