Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ COPY . .
RUN npm install && \
npm run build

ENTRYPOINT [ "node", "./out/server/src/server.js" ]
ENTRYPOINT [ "node", "./lib/cjs/server.js" ]
CMD [ "--stdio" ]
6 changes: 3 additions & 3 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ This repository only contains the server implementation. Here are some known cli
```bash
$ npm run build
```
5. The new built server is now located in ./out/server/src/server.js.
5. The new built server is now located in ./lib/cjs/server.js.
```bash
node (Yaml Language Server Location)/out/server/src/server.js [--stdio]
node (Yaml Language Server Location)/lib/cjs/server.js [--stdio]
```

### Connecting to the language server via stdio
Expand All @@ -417,7 +417,7 @@ We have included the option to connect to the language server via [stdio](https:

### ESM and UMD Modules

Building the YAML Language Server produces [CommonJS](http://www.commonjs.org/) modules in the `/out/server/src` directory. In addition, a build also produces [UMD](https://github.com/umdjs/umd) (Universal Module Definition) modules and [ES Modules](https://tc39.es/ecma262/#sec-modules) (ESM) in the `/lib` directory. That gives you choices in using the YAML Language Server with different module loaders on the server side and in the browser with bundlers like webpack.
Building the YAML Language Server produces [CommonJS](http://www.commonjs.org/) modules in the `./lib/cjs` directory. In addition, a build also produces [UMD](https://github.com/umdjs/umd) (Universal Module Definition) modules and [ES Modules](https://tc39.es/ecma262/#sec-modules) (ESM) in the `./lib/umd` and `./lib/esm` directories (repectively). That gives you choices in using the YAML Language Server with different module loaders on the server side and in the browser with bundlers like webpack.

### CI

Expand Down
2 changes: 1 addition & 1 deletion bin/yaml-language-server
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../out/server/src/server.js');
require('../lib/cjs/server.js');
Empty file removed out/.gitignore
Empty file.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yaml-language-server",
"description": "YAML language server",
"version": "1.19.0",
"version": "2.0.0",
"author": "Red Hat",
"license": "MIT",
"contributors": [
Expand All @@ -16,7 +16,7 @@
"bin": {
"yaml-language-server": "bin/yaml-language-server"
},
"main": "./out/server/src/index.js",
"main": "./lib/cjs/index.js",
"l10n": "./l10n",
"keywords": [
"yaml",
Expand Down
2 changes: 1 addition & 1 deletion src/yamlServerInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class YAMLServerInit {

public async setupl10nBundle(params: InitializeParams): Promise<void> {
const __dirname = path.dirname(__filename);
const l10nPath: string = params.initializationOptions?.l10nPath || path.join(__dirname, '../../../l10n');
const l10nPath: string = params.initializationOptions?.l10nPath || path.join(__dirname, '../../l10n');
const locale: string = params.locale || 'en';
if (l10nPath) {
const bundleFile = !fs.existsSync(path.join(l10nPath, `bundle.l10n.${locale}.json`))
Expand Down
1 change: 0 additions & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"exclude": [
"node_modules",
"out",
"lib",
"test"
]
Expand Down
19 changes: 14 additions & 5 deletions tsconfig.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@
"alwaysStrict": true,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2020", "WebWorker"],
"lib": [
"es2020",
"WebWorker"
],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./out/server",
"outDir": "./lib/cjs",
"sourceMap": true,
"target": "es2020",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
},
"include": [ "src", "test" ],
"exclude": ["node_modules", "out"]
}
"include": [
"src",
],
"exclude": [
"node_modules",
"test",
"lib"
]
}
1 change: 0 additions & 1 deletion tsconfig.umd.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
},
"exclude": [
"node_modules",
"out",
"lib",
"test"
]
Expand Down
Loading