diff --git a/Dockerfile b/Dockerfile index e914e63d7..e781bd123 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 3b647a78d..41347c3d2 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/bin/yaml-language-server b/bin/yaml-language-server index d1dbeeeea..cbb4467b1 100755 --- a/bin/yaml-language-server +++ b/bin/yaml-language-server @@ -1,3 +1,3 @@ #!/usr/bin/env node -require('../out/server/src/server.js'); +require('../lib/cjs/server.js'); diff --git a/out/.gitignore b/out/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/package.json b/package.json index 37af0ebdf..2c45e6afb 100644 --- a/package.json +++ b/package.json @@ -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": [ @@ -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", diff --git a/src/yamlServerInit.ts b/src/yamlServerInit.ts index 77767b182..2bf6db654 100644 --- a/src/yamlServerInit.ts +++ b/src/yamlServerInit.ts @@ -59,7 +59,7 @@ export class YAMLServerInit { public async setupl10nBundle(params: InitializeParams): Promise { 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`)) diff --git a/tsconfig.esm.json b/tsconfig.esm.json index a2c13969e..8197dddc9 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -8,7 +8,6 @@ }, "exclude": [ "node_modules", - "out", "lib", "test" ] diff --git a/tsconfig.json b/tsconfig.json old mode 100755 new mode 100644 index fa23d249a..0d25078a5 --- a/tsconfig.json +++ b/tsconfig.json @@ -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" + ] +} \ No newline at end of file diff --git a/tsconfig.umd.json b/tsconfig.umd.json index 7da9c61ff..2377624ed 100644 --- a/tsconfig.umd.json +++ b/tsconfig.umd.json @@ -7,7 +7,6 @@ }, "exclude": [ "node_modules", - "out", "lib", "test" ]