Skip to content

Commit a548e9e

Browse files
committed
feat: initial commit
0 parents  commit a548e9e

26 files changed

+6909
-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

.gitignore

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

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.test.js

.prettierignore

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

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
language: node_js
2+
node_js: '10'
3+
cache: yarn
4+
env:
5+
global:
6+
- FORCE_COLOR=1
7+
install:
8+
- yarn
9+
jobs:
10+
include:
11+
- stage: test
12+
script:
13+
- yarn run prettier-check
14+
- yarn run tslint
15+
- yarn run build
16+
- yarn test
17+
- nyc report --reporter json
18+
- 'bash <(curl -s https://codecov.io/bash)'
19+
- stage: release
20+
script:
21+
- yarn run build
22+
- yarn run semantic-release
23+
stages:
24+
- test
25+
- name: release
26+
if: branch = master AND type = push AND fork = false
27+
branches:
28+
only:
29+
- master
30+
- /^renovate\//

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Sourcegraph
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# @sourcegraph/extension-api-classes
2+
3+
[![npm](https://img.shields.io/npm/v/@sourcegraph/extension-api-classes.svg)](https://www.npmjs.com/package/@sourcegraph/extension-api-classes)
4+
[![downloads](https://img.shields.io/npm/dt/@sourcegraph/extension-api-classes.svg)](https://www.npmjs.com/package/@sourcegraph/extension-api-classes)
5+
[![build](https://travis-ci.org/sourcegraph/extension-api-classes.svg?branch=master)](https://travis-ci.org/sourcegraph/extension-api-classes)
6+
[![codecov](https://codecov.io/gh/sourcegraph/extension-api-classes/branch/master/graph/badge.svg?token=k6ajjWygaW)](https://codecov.io/gh/sourcegraph/extension-api-classes)
7+
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
8+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
9+
10+
Classes used by the Sourcegraph extension API
11+
12+
## Install
13+
14+
```
15+
npm install @sourcegraph/extension-api-classes
16+
# or
17+
yarn add @sourcegraph/extension-api-classes
18+
```
19+
20+
## Build
21+
22+
```
23+
yarn
24+
yarn build
25+
```
26+
27+
## Test
28+
29+
```
30+
yarn test
31+
```
32+
33+
## Release
34+
35+
Releases are done automatically in CI when commits are merged into master by analyzing [Conventional Commit Messages](https://conventionalcommits.org/).
36+
After running `yarn`, commit messages will be linted automatically when committing though a git hook.
37+
The git hook can be circumvented for fixup commits with [git's `fixup!` autosquash feature](https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html), or by passing `--no-verify` to `git commit`.
38+
You may have to rebase a branch before merging to ensure it has a proper commit history, or squash merge with a manually edited commit message that conforms to the convention.

package.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"name": "@sourcegraph/extension-api-classes",
3+
"description": "Classes used by the Sourcegraph extension API",
4+
"version": "0.0.0-DEVELOPMENT",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/sourcegraph/extension-api-classes.git"
9+
},
10+
"files": [
11+
"dist"
12+
],
13+
"main": "dist/index.js",
14+
"types": "dist/index.d.ts",
15+
"scripts": {
16+
"test": "nyc mocha",
17+
"semantic-release": "semantic-release",
18+
"prettier": "prettier '**/{*.{js?(on),ts?(x),scss},.*.js?(on)}' --write --list-different",
19+
"prettier-check": "npm run prettier -- --write=false",
20+
"tslint": "tslint -c tslint.json -p tsconfig.json './src/*.ts?(x)' './*.ts?(x)'",
21+
"build": "tsc -p .",
22+
"watch": "tsc -p . -w"
23+
},
24+
"commitlint": {
25+
"extends": [
26+
"@commitlint/config-conventional"
27+
]
28+
},
29+
"mocha": {
30+
"require": "ts-node/register",
31+
"spec": "src/**/*.test.ts",
32+
"ui": "tdd"
33+
},
34+
"nyc": {
35+
"include": [
36+
"src/**/*.ts?(x)"
37+
],
38+
"exclude": [
39+
"**/*.test.ts?(x)"
40+
],
41+
"extension": [
42+
".tsx",
43+
".ts"
44+
]
45+
},
46+
"peerDependencies": {
47+
"sourcegraph": "*"
48+
},
49+
"devDependencies": {
50+
"@commitlint/cli": "^7.5.2",
51+
"@commitlint/config-conventional": "^7.5.0",
52+
"@sourcegraph/extension-api-types": "^2.0.0",
53+
"@sourcegraph/prettierrc": "^2.2.0",
54+
"@sourcegraph/tsconfig": "^4.0.0",
55+
"@sourcegraph/tslint-config": "^13.1.0",
56+
"@types/mocha": "^5.2.6",
57+
"husky": "^2.1.0",
58+
"mocha": "^6.1.4",
59+
"nyc": "^14.0.0",
60+
"prettier": "^1.17.0",
61+
"semantic-release": "^15.13.3",
62+
"sourcegraph": "^23.0.0",
63+
"ts-node": "^8.1.0",
64+
"tslint": "^5.16.0",
65+
"typescript": "^3.4.5"
66+
},
67+
"husky": {
68+
"hooks": {
69+
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
70+
}
71+
}
72+
}

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')

renovate.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["github>sourcegraph/renovate-config"]
3+
}

0 commit comments

Comments
 (0)