Skip to content

Commit

Permalink
WIP #134 Add "bin" for running the server
Browse files Browse the repository at this point in the history
Using the "bin" field in package.json, it is possible to declare an
executable for a package. Declared the "bin" field to point at
./lib/server.js so that one just has to install the npm module
globally and then launch the executable.

Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed Aug 6, 2017
1 parent c978a25 commit fb4bc16
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.

## [Unreleased]
### Added
- created a docker-langserver binary for launching the server ([#134](https://github.com/rcjsuen/dockerfile-language-server-nodejs/issues/134))
- textDocument/codeAction
- created docker.command.convertToLowercase for directives not written in lowercase ([#128](https://github.com/rcjsuen/dockerfile-language-server-nodejs/issues/128))
- textDocument/onTypeFormatting
Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
[![Build Status](https://travis-ci.org/rcjsuen/dockerfile-language-server-nodejs.svg?branch=master)](https://travis-ci.org/rcjsuen/dockerfile-language-server-nodejs) [![Coverage Status](https://coveralls.io/repos/github/rcjsuen/dockerfile-language-server-nodejs/badge.svg?branch=master)](https://coveralls.io/github/rcjsuen/dockerfile-language-server-nodejs?branch=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

This is a language server for Dockerfiles powered by Node.js
written in TypeScript.
written in TypeScript. To build or to install this language server,
you will need to have [Node.js](https://nodejs.org/en/download/)
installed on your computer.

Supported features:
- code actions
Expand All @@ -16,10 +18,10 @@ Supported features:
- hovers
- rename

## Setup Instructions
## Development Instructions

To build and compile this language server, you should first [install
Node.js](https://nodejs.org/en/download/) if you haven't already done so.
To build and compile this language server, please run the following
commands after cloning the repository with Git.

```
npm install
Expand All @@ -33,6 +35,27 @@ TypeScript files transpiled on-the-fly as they are modified.
Once the code has finished compiling, you can connect a language server
client to the server via Node IPC, stdio, or sockets.

## Installation Instructions

To install this language server onto your computer, please install the
[dockerfile-language-server-nodejs npm module](https://www.npmjs.com/package/dockerfile-language-server-nodejs).
The `-g` flag will install the npm module globally onto your computer.

```
npm install -g dockerfile-language-server-nodejs
```

After the installation has completed, you can start the language
server with the `docker-langserver` binary. You should specify
the desired method of communciating with the language server via one
of the three arguments shown below.

```
docker-langserver --node-ipc
docker-langserver --stdio
docker-langserver --socket=<port>
```

### Settings

Clients may send a `workspace/didChangeConfiguration` notification to
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"typescript": "^2.1.5",
"nyc": "^11.0.2"
},
"bin": {
"docker-langserver": "./lib/server.js"
},
"scripts": {
"build": "tsc -p .",
"prepublish": "tsc -p ./src",
Expand Down

0 comments on commit fb4bc16

Please sign in to comment.